(()=>{"use strict";const t={delay:function(t){return new Promise(((e,n)=>{setTimeout((()=>{e()}),t)}))},debounce:function(t,e){let n;return o=>{clearTimeout(n),n=setTimeout((()=>{t(o)}),e)}},startInterval:function(t,e){let n=0,o=setInterval((()=>{t(++n)||clearInterval(o)}),e)},startIntervalAsync:function(t,e){const n=[];let o=0;const r=async()=>{try{await t(++o)?n.push(setTimeout(r,e)):n.forEach((t=>clearTimeout(t)))}catch(Re){n.forEach((t=>clearTimeout(t))),console.error(Re)}};r()}};function e(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function n(t){return t instanceof e(t).Element||t instanceof Element}function o(t){return t instanceof e(t).HTMLElement||t instanceof HTMLElement}function r(t){return"undefined"!==typeof ShadowRoot&&(t instanceof e(t).ShadowRoot||t instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function c(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function u(){return!/^((?!chrome|android).)*safari/i.test(c())}function d(t,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);var a=t.getBoundingClientRect(),c=1,d=1;r&&o(t)&&(c=t.offsetWidth>0&&s(a.width)/t.offsetWidth||1,d=t.offsetHeight>0&&s(a.height)/t.offsetHeight||1);var l=(n(t)?e(t):window).visualViewport,f=!u()&&i,p=(a.left+(f&&l?l.offsetLeft:0))/c,v=(a.top+(f&&l?l.offsetTop:0))/d,E=a.width/c,m=a.height/d;return{width:E,height:m,top:v,right:p+E,bottom:v+m,left:p,x:p,y:v}}function l(t){var n=e(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function f(t){return t?(t.nodeName||"").toLowerCase():null}function p(t){return((n(t)?t.ownerDocument:t.document)||window.document).documentElement}function v(t){return d(p(t)).left+l(t).scrollLeft}function E(t){return e(t).getComputedStyle(t)}function m(t){var e=E(t),n=e.overflow,o=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function T(t,n,r){void 0===r&&(r=!1);var i=o(n),a=o(n)&&function(t){var e=t.getBoundingClientRect(),n=s(e.width)/t.offsetWidth||1,o=s(e.height)/t.offsetHeight||1;return 1!==n||1!==o}(n),c=p(n),u=d(t,a,r),E={scrollLeft:0,scrollTop:0},T={x:0,y:0};return(i||!i&&!r)&&(("body"!==f(n)||m(c))&&(E=function(t){return t!==e(t)&&o(t)?{scrollLeft:(n=t).scrollLeft,scrollTop:n.scrollTop}:l(t);var n}(n)),o(n)?((T=d(n,!0)).x+=n.clientLeft,T.y+=n.clientTop):c&&(T.x=v(c))),{x:u.left+E.scrollLeft-T.x,y:u.top+E.scrollTop-T.y,width:u.width,height:u.height}}function g(t){var e=d(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function h(t){return"html"===f(t)?t:t.assignedSlot||t.parentNode||(r(t)?t.host:null)||p(t)}function _(t){return["html","body","#document"].indexOf(f(t))>=0?t.ownerDocument.body:o(t)&&m(t)?t:_(h(t))}function y(t,n){var o;void 0===n&&(n=[]);var r=_(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),a=e(r),s=i?[a].concat(a.visualViewport||[],m(r)?r:[]):r,c=n.concat(s);return i?c:c.concat(y(h(s)))}function b(t){return["table","td","th"].indexOf(f(t))>=0}function A(t){return o(t)&&"fixed"!==E(t).position?t.offsetParent:null}function O(t){for(var n=e(t),i=A(t);i&&b(i)&&"static"===E(i).position;)i=A(i);return i&&("html"===f(i)||"body"===f(i)&&"static"===E(i).position)?n:i||function(t){var e=/firefox/i.test(c());if(/Trident/i.test(c())&&o(t)&&"fixed"===E(t).position)return null;var n=h(t);for(r(n)&&(n=n.host);o(n)&&["html","body"].indexOf(f(n))<0;){var i=E(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||n}var R="top",S="bottom",L="right",N="left",w="auto",C=[R,S,L,N],x="start",I="end",P="clippingParents",D="viewport",M="popper",B="reference",U=C.reduce((function(t,e){return t.concat([e+"-"+x,e+"-"+I])}),[]),H=[].concat(C,[w]).reduce((function(t,e){return t.concat([e,e+"-"+x,e+"-"+I])}),[]),k=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(t){var e=new Map,n=new Set,o=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var o=e.get(t);o&&r(o)}})),o.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),o}function F(t){var e;return function(){return e||(e=new Promise((function(n){Promise.resolve().then((function(){e=void 0,n(t())}))}))),e}}var j={placement:"bottom",modifiers:[],strategy:"absolute"};function V(){for(var t=arguments.length,e=new Array(t),n=0;n=0?"x":"y"}function K(t){var e,n=t.reference,o=t.element,r=t.placement,i=r?q(r):null,a=r?Y(r):null,s=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(i){case R:e={x:s,y:n.y-o.height};break;case S:e={x:s,y:n.y+n.height};break;case L:e={x:n.x+n.width,y:c};break;case N:e={x:n.x-o.width,y:c};break;default:e={x:n.x,y:n.y}}var u=i?Q(i):null;if(null!=u){var d="y"===u?"height":"width";switch(a){case x:e[u]=e[u]-(n[d]/2-o[d]/2);break;case I:e[u]=e[u]+(n[d]/2-o[d]/2)}}return e}var J={top:"auto",right:"auto",bottom:"auto",left:"auto"};function z(t){var n,o=t.popper,r=t.popperRect,i=t.placement,a=t.variation,c=t.offsets,u=t.position,d=t.gpuAcceleration,l=t.adaptive,f=t.roundOffsets,v=t.isFixed,m=c.x,T=void 0===m?0:m,g=c.y,h=void 0===g?0:g,_="function"===typeof f?f({x:T,y:h}):{x:T,y:h};T=_.x,h=_.y;var y=c.hasOwnProperty("x"),b=c.hasOwnProperty("y"),A=N,w=R,C=window;if(l){var x=O(o),P="clientHeight",D="clientWidth";if(x===e(o)&&"static"!==E(x=p(o)).position&&"absolute"===u&&(P="scrollHeight",D="scrollWidth"),i===R||(i===N||i===L)&&a===I)w=S,h-=(v&&x===C&&C.visualViewport?C.visualViewport.height:x[P])-r.height,h*=d?1:-1;if(i===N||(i===R||i===S)&&a===I)A=L,T-=(v&&x===C&&C.visualViewport?C.visualViewport.width:x[D])-r.width,T*=d?1:-1}var M,B=Object.assign({position:u},l&&J),U=!0===f?function(t,e){var n=t.x,o=t.y,r=e.devicePixelRatio||1;return{x:s(n*r)/r||0,y:s(o*r)/r||0}}({x:T,y:h},e(o)):{x:T,y:h};return T=U.x,h=U.y,d?Object.assign({},B,((M={})[w]=b?"0":"",M[A]=y?"0":"",M.transform=(C.devicePixelRatio||1)<=1?"translate("+T+"px, "+h+"px)":"translate3d("+T+"px, "+h+"px, 0)",M)):Object.assign({},B,((n={})[w]=b?h+"px":"",n[A]=y?T+"px":"",n.transform="",n))}const Z={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];o(i)&&f(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],i=e.attributes[t]||{},a=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});o(r)&&f(r)&&(Object.assign(r.style,a),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};const $={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,r=n.offset,i=void 0===r?[0,0]:r,a=H.reduce((function(t,n){return t[n]=function(t,e,n){var o=q(t),r=[N,R].indexOf(o)>=0?-1:1,i="function"===typeof n?n(Object.assign({},e,{placement:t})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*r,[N,L].indexOf(o)>=0?{x:s,y:a}:{x:a,y:s}}(n,e.rects,i),t}),{}),s=a[e.placement],c=s.x,u=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[o]=a}};var tt={left:"right",right:"left",bottom:"top",top:"bottom"};function et(t){return t.replace(/left|right|bottom|top/g,(function(t){return tt[t]}))}var nt={start:"end",end:"start"};function ot(t){return t.replace(/start|end/g,(function(t){return nt[t]}))}function rt(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&r(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function it(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function at(t,o,r){return o===D?it(function(t,n){var o=e(t),r=p(t),i=o.visualViewport,a=r.clientWidth,s=r.clientHeight,c=0,d=0;if(i){a=i.width,s=i.height;var l=u();(l||!l&&"fixed"===n)&&(c=i.offsetLeft,d=i.offsetTop)}return{width:a,height:s,x:c+v(t),y:d}}(t,r)):n(o)?function(t,e){var n=d(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(o,r):it(function(t){var e,n=p(t),o=l(t),r=null==(e=t.ownerDocument)?void 0:e.body,a=i(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-o.scrollLeft+v(t),u=-o.scrollTop;return"rtl"===E(r||n).direction&&(c+=i(n.clientWidth,r?r.clientWidth:0)-a),{width:a,height:s,x:c,y:u}}(p(t)))}function st(t,e,r,s){var c="clippingParents"===e?function(t){var e=y(h(t)),r=["absolute","fixed"].indexOf(E(t).position)>=0&&o(t)?O(t):t;return n(r)?e.filter((function(t){return n(t)&&rt(t,r)&&"body"!==f(t)})):[]}(t):[].concat(e),u=[].concat(c,[r]),d=u[0],l=u.reduce((function(e,n){var o=at(t,n,s);return e.top=i(o.top,e.top),e.right=a(o.right,e.right),e.bottom=a(o.bottom,e.bottom),e.left=i(o.left,e.left),e}),at(t,d,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function ct(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function ut(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function dt(t,e){void 0===e&&(e={});var o=e,r=o.placement,i=void 0===r?t.placement:r,a=o.strategy,s=void 0===a?t.strategy:a,c=o.boundary,u=void 0===c?P:c,l=o.rootBoundary,f=void 0===l?D:l,v=o.elementContext,E=void 0===v?M:v,m=o.altBoundary,T=void 0!==m&&m,g=o.padding,h=void 0===g?0:g,_=ct("number"!==typeof h?h:ut(h,C)),y=E===M?B:M,b=t.rects.popper,A=t.elements[T?y:E],O=st(n(A)?A:A.contextElement||p(t.elements.popper),u,f,s),N=d(t.elements.reference),w=K({reference:N,element:b,strategy:"absolute",placement:i}),x=it(Object.assign({},b,w)),I=E===M?x:N,U={top:O.top-I.top+_.top,bottom:I.bottom-O.bottom+_.bottom,left:O.left-I.left+_.left,right:I.right-O.right+_.right},H=t.modifiersData.offset;if(E===M&&H){var k=H[i];Object.keys(U).forEach((function(t){var e=[L,S].indexOf(t)>=0?1:-1,n=[R,S].indexOf(t)>=0?"y":"x";U[t]+=k[n]*e}))}return U}function lt(t,e,n){return i(t,a(e,n))}const ft={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name,r=n.mainAxis,s=void 0===r||r,c=n.altAxis,u=void 0!==c&&c,d=n.boundary,l=n.rootBoundary,f=n.altBoundary,p=n.padding,v=n.tether,E=void 0===v||v,m=n.tetherOffset,T=void 0===m?0:m,h=dt(e,{boundary:d,rootBoundary:l,padding:p,altBoundary:f}),_=q(e.placement),y=Y(e.placement),b=!y,A=Q(_),w="x"===A?"y":"x",C=e.modifiersData.popperOffsets,I=e.rects.reference,P=e.rects.popper,D="function"===typeof T?T(Object.assign({},e.rects,{placement:e.placement})):T,M="number"===typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),B=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(C){if(s){var H,k="y"===A?R:N,G="y"===A?S:L,F="y"===A?"height":"width",j=C[A],V=j+h[k],X=j-h[G],W=E?-P[F]/2:0,K=y===x?I[F]:P[F],J=y===x?-P[F]:-I[F],z=e.elements.arrow,Z=E&&z?g(z):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=$[k],et=$[G],nt=lt(0,I[F],Z[F]),ot=b?I[F]/2-W-nt-tt-M.mainAxis:K-nt-tt-M.mainAxis,rt=b?-I[F]/2+W+nt+et+M.mainAxis:J+nt+et+M.mainAxis,it=e.elements.arrow&&O(e.elements.arrow),at=it?"y"===A?it.clientTop||0:it.clientLeft||0:0,st=null!=(H=null==B?void 0:B[A])?H:0,ct=j+rt-st,ut=lt(E?a(V,j+ot-st-at):V,j,E?i(X,ct):X);C[A]=ut,U[A]=ut-j}if(u){var ft,pt="x"===A?R:N,vt="x"===A?S:L,Et=C[w],mt="y"===w?"height":"width",Tt=Et+h[pt],gt=Et-h[vt],ht=-1!==[R,N].indexOf(_),_t=null!=(ft=null==B?void 0:B[w])?ft:0,yt=ht?Tt:Et-I[mt]-P[mt]-_t+M.altAxis,bt=ht?Et+I[mt]+P[mt]-_t-M.altAxis:gt,At=E&&ht?function(t,e,n){var o=lt(t,e,n);return o>n?n:o}(yt,Et,bt):lt(E?yt:Tt,Et,E?bt:gt);C[w]=At,U[w]=At-Et}e.modifiersData[o]=U}},requiresIfExists:["offset"]};const pt={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,o=t.name,r=t.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=q(n.placement),c=Q(s),u=[N,L].indexOf(s)>=0?"height":"width";if(i&&a){var d=function(t,e){return ct("number"!==typeof(t="function"===typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ut(t,C))}(r.padding,n),l=g(i),f="y"===c?R:N,p="y"===c?S:L,v=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],E=a[c]-n.rects.reference[c],m=O(i),T=m?"y"===c?m.clientHeight||0:m.clientWidth||0:0,h=v/2-E/2,_=d[f],y=T-l[u]-d[p],b=T/2-l[u]/2+h,A=lt(_,b,y),w=c;n.modifiersData[o]=((e={})[w]=A,e.centerOffset=A-b,e)}},effect:function(t){var e=t.state,n=t.options.element,o=void 0===n?"[data-popper-arrow]":n;null!=o&&("string"!==typeof o||(o=e.elements.popper.querySelector(o)))&&rt(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Et(t){return[R,L,S,N].some((function(e){return t[e]>=0}))}var mt=X({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,o=t.instance,r=t.options,i=r.scroll,a=void 0===i||i,s=r.resize,c=void 0===s||s,u=e(n.elements.popper),d=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&d.forEach((function(t){t.addEventListener("scroll",o.update,W)})),c&&u.addEventListener("resize",o.update,W),function(){a&&d.forEach((function(t){t.removeEventListener("scroll",o.update,W)})),c&&u.removeEventListener("resize",o.update,W)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=K({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,r=void 0===o||o,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,c=void 0===s||s,u={placement:q(e.placement),variation:Y(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,z(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,z(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Z,$,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var r=n.mainAxis,i=void 0===r||r,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,u=n.padding,d=n.boundary,l=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,v=void 0===p||p,E=n.allowedAutoPlacements,m=e.options.placement,T=q(m),g=c||(T===m||!v?[et(m)]:function(t){if(q(t)===w)return[];var e=et(t);return[ot(t),e,ot(e)]}(m)),h=[m].concat(g).reduce((function(t,n){return t.concat(q(n)===w?function(t,e){void 0===e&&(e={});var n=e,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?H:c,d=Y(o),l=d?s?U:U.filter((function(t){return Y(t)===d})):C,f=l.filter((function(t){return u.indexOf(t)>=0}));0===f.length&&(f=l);var p=f.reduce((function(e,n){return e[n]=dt(t,{placement:n,boundary:r,rootBoundary:i,padding:a})[q(n)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}(e,{placement:n,boundary:d,rootBoundary:l,padding:u,flipVariations:v,allowedAutoPlacements:E}):n)}),[]),_=e.rects.reference,y=e.rects.popper,b=new Map,A=!0,O=h[0],I=0;I=0,k=B?"width":"height",G=dt(e,{placement:P,boundary:d,rootBoundary:l,altBoundary:f,padding:u}),F=B?M?L:N:M?S:R;_[k]>y[k]&&(F=et(F));var j=et(F),V=[];if(i&&V.push(G[D]<=0),s&&V.push(G[F]<=0,G[j]<=0),V.every((function(t){return t}))){O=P,A=!1;break}b.set(P,V)}if(A)for(var X=function(t){var e=h.find((function(e){var n=b.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return O=e,"break"},W=v?3:1;W>0;W--){if("break"===X(W))break}e.placement!==O&&(e.modifiersData[o]._skip=!0,e.placement=O,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},ft,pt,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,a=dt(e,{elementContext:"reference"}),s=dt(e,{altBoundary:!0}),c=vt(a,o),u=vt(s,r,i),d=Et(c),l=Et(u);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:l},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":l})}}]}),Tt="tippy-content",gt="tippy-backdrop",ht="tippy-arrow",_t="tippy-svg-arrow",yt={passive:!0,capture:!0},bt=function(){return document.body};function At(t,e,n){if(Array.isArray(t)){var o=t[e];return null==o?Array.isArray(n)?n[e]:n:o}return t}function Ot(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function Rt(t,e){return"function"===typeof t?t.apply(void 0,e):t}function St(t,e){return 0===e?t:function(o){clearTimeout(n),n=setTimeout((function(){t(o)}),e)};var n}function Lt(t){return[].concat(t)}function Nt(t,e){-1===t.indexOf(e)&&t.push(e)}function wt(t){return t.split("-")[0]}function Ct(t){return[].slice.call(t)}function xt(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function It(){return document.createElement("div")}function Pt(t){return["Element","Fragment"].some((function(e){return Ot(t,e)}))}function Dt(t){return Ot(t,"MouseEvent")}function Mt(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function Bt(t){return Pt(t)?[t]:function(t){return Ot(t,"NodeList")}(t)?Ct(t):Array.isArray(t)?t:Ct(document.querySelectorAll(t))}function Ut(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Ht(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function kt(t){var e,n=Lt(t)[0];return null!=n&&null!=(e=n.ownerDocument)&&e.body?n.ownerDocument:document}function Gt(t,e,n){var o=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[o](e,n)}))}function Ft(t,e){for(var n=e;n;){var o;if(t.contains(n))return!0;n=null==n.getRootNode||null==(o=n.getRootNode())?void 0:o.host}return!1}var jt={isTouch:!1},Vt=0;function Xt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Wt))}function Wt(){var t=performance.now();t-Vt<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Wt)),Vt=t}function qt(){var t=document.activeElement;if(Mt(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var Yt=!!("undefined"!==typeof window&&"undefined"!==typeof document)&&!!window.msCrypto;var Qt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Kt=Object.assign({appendTo:bt,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Qt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Jt=Object.keys(Kt);function zt(t){var e=(t.plugins||[]).reduce((function(e,n){var o,r=n.name,i=n.defaultValue;r&&(e[r]=void 0!==t[r]?t[r]:null!=(o=Kt[r])?o:i);return e}),{});return Object.assign({},t,e)}function Zt(t,e){var n=Object.assign({},e,{content:Rt(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(zt(Object.assign({},Kt,{plugins:e}))):Jt).reduce((function(e,n){var o=(t.getAttribute("data-tippy-"+n)||"").trim();if(!o)return e;if("content"===n)e[n]=o;else try{e[n]=JSON.parse(o)}catch(Re){e[n]=o}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},Kt.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}var $t=function(){return"innerHTML"};function te(t,e){t[$t()]=e}function ee(t){var e=It();return!0===t?e.className=ht:(e.className=_t,Pt(t)?e.appendChild(t):te(e,t)),e}function ne(t,e){Pt(e.content)?(te(t,""),t.appendChild(e.content)):"function"!==typeof e.content&&(e.allowHTML?te(t,e.content):t.textContent=e.content)}function oe(t){var e=t.firstElementChild,n=Ct(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Tt)})),arrow:n.find((function(t){return t.classList.contains(ht)||t.classList.contains(_t)})),backdrop:n.find((function(t){return t.classList.contains(gt)}))}}function re(t){var e=It(),n=It();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var o=It();function r(n,o){var r=oe(e),i=r.box,a=r.content,s=r.arrow;o.theme?i.setAttribute("data-theme",o.theme):i.removeAttribute("data-theme"),"string"===typeof o.animation?i.setAttribute("data-animation",o.animation):i.removeAttribute("data-animation"),o.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"===typeof o.maxWidth?o.maxWidth+"px":o.maxWidth,o.role?i.setAttribute("role",o.role):i.removeAttribute("role"),n.content===o.content&&n.allowHTML===o.allowHTML||ne(a,t.props),o.arrow?s?n.arrow!==o.arrow&&(i.removeChild(s),i.appendChild(ee(o.arrow))):i.appendChild(ee(o.arrow)):s&&i.removeChild(s)}return o.className=Tt,o.setAttribute("data-state","hidden"),ne(o,t.props),e.appendChild(n),n.appendChild(o),r(t.props,t.props),{popper:e,onUpdate:r}}re.$$tippy=!0;var ie=1,ae=[],se=[];function ce(t,e){var n,o,r,i,a,s,c,u,d=Zt(t,Object.assign({},Kt,zt(xt(e)))),l=!1,f=!1,p=!1,v=!1,E=[],m=St(Y,d.interactiveDebounce),T=ie++,g=(u=d.plugins).filter((function(t,e){return u.indexOf(t)===e})),h={id:T,reference:t,popper:It(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(r)},setProps:function(e){0;if(h.state.isDestroyed)return;P("onBeforeUpdate",[h,e]),W();var n=h.props,o=Zt(t,Object.assign({},n,xt(e),{ignoreAttributes:!0}));h.props=o,X(),n.interactiveDebounce!==o.interactiveDebounce&&(B(),m=St(Y,o.interactiveDebounce));n.triggerTarget&&!o.triggerTarget?Lt(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):o.triggerTarget&&t.removeAttribute("aria-expanded");M(),I(),b&&b(n,o);h.popperInstance&&(z(),$().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})));P("onAfterUpdate",[h,e])},setContent:function(t){h.setProps({content:t})},show:function(){0;var t=h.state.isVisible,e=h.state.isDestroyed,n=!h.state.isEnabled,o=jt.isTouch&&!h.props.touch,r=At(h.props.duration,0,Kt.duration);if(t||e||n||o)return;if(N().hasAttribute("disabled"))return;if(P("onShow",[h],!1),!1===h.props.onShow(h))return;h.state.isVisible=!0,L()&&(y.style.visibility="visible");I(),G(),h.state.isMounted||(y.style.transition="none");if(L()){var i=C();Ut([i.box,i.content],0)}s=function(){var t;if(h.state.isVisible&&!v){if(v=!0,y.offsetHeight,y.style.transition=h.props.moveTransition,L()&&h.props.animation){var e=C(),n=e.box,o=e.content;Ut([n,o],r),Ht([n,o],"visible")}D(),M(),Nt(se,h),null==(t=h.popperInstance)||t.forceUpdate(),P("onMount",[h]),h.props.animation&&L()&&function(t,e){j(t,e)}(r,(function(){h.state.isShown=!0,P("onShown",[h])}))}},function(){var t,e=h.props.appendTo,n=N();t=h.props.interactive&&e===bt||"parent"===e?n.parentNode:Rt(e,[n]);t.contains(y)||t.appendChild(y);h.state.isMounted=!0,z(),!1}()},hide:function(){0;var t=!h.state.isVisible,e=h.state.isDestroyed,n=!h.state.isEnabled,o=At(h.props.duration,1,Kt.duration);if(t||e||n)return;if(P("onHide",[h],!1),!1===h.props.onHide(h))return;h.state.isVisible=!1,h.state.isShown=!1,v=!1,l=!1,L()&&(y.style.visibility="hidden");if(B(),F(),I(!0),L()){var r=C(),i=r.box,a=r.content;h.props.animation&&(Ut([i,a],o),Ht([i,a],"hidden"))}D(),M(),h.props.animation?L()&&function(t,e){j(t,(function(){!h.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&e()}))}(o,h.unmount):h.unmount()},hideWithInteractivity:function(t){0;w().addEventListener("mousemove",m),Nt(ae,m),m(t)},enable:function(){h.state.isEnabled=!0},disable:function(){h.hide(),h.state.isEnabled=!1},unmount:function(){0;h.state.isVisible&&h.hide();if(!h.state.isMounted)return;Z(),$().forEach((function(t){t._tippy.unmount()})),y.parentNode&&y.parentNode.removeChild(y);se=se.filter((function(t){return t!==h})),h.state.isMounted=!1,P("onHidden",[h])},destroy:function(){0;if(h.state.isDestroyed)return;h.clearDelayTimeouts(),h.unmount(),W(),delete t._tippy,h.state.isDestroyed=!0,P("onDestroy",[h])}};if(!d.render)return h;var _=d.render(h),y=_.popper,b=_.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+h.id,h.popper=y,t._tippy=h,y._tippy=h;var A=g.map((function(t){return t.fn(h)})),O=t.hasAttribute("aria-expanded");return X(),M(),I(),P("onCreate",[h]),d.showOnCreate&&tt(),y.addEventListener("mouseenter",(function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()})),y.addEventListener("mouseleave",(function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&w().addEventListener("mousemove",m)})),h;function R(){var t=h.props.touch;return Array.isArray(t)?t:[t,0]}function S(){return"hold"===R()[0]}function L(){var t;return!(null==(t=h.props.render)||!t.$$tippy)}function N(){return c||t}function w(){var t=N().parentNode;return t?kt(t):document}function C(){return oe(y)}function x(t){return h.state.isMounted&&!h.state.isVisible||jt.isTouch||i&&"focus"===i.type?0:At(h.props.delay,t?0:1,Kt.delay)}function I(t){void 0===t&&(t=!1),y.style.pointerEvents=h.props.interactive&&!t?"":"none",y.style.zIndex=""+h.props.zIndex}function P(t,e,n){var o;(void 0===n&&(n=!0),A.forEach((function(n){n[t]&&n[t].apply(n,e)})),n)&&(o=h.props)[t].apply(o,e)}function D(){var e=h.props.aria;if(e.content){var n="aria-"+e.content,o=y.id;Lt(h.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(h.state.isVisible)t.setAttribute(n,e?e+" "+o:o);else{var r=e&&e.replace(o,"").trim();r?t.setAttribute(n,r):t.removeAttribute(n)}}))}}function M(){!O&&h.props.aria.expanded&&Lt(h.props.triggerTarget||t).forEach((function(t){h.props.interactive?t.setAttribute("aria-expanded",h.state.isVisible&&t===N()?"true":"false"):t.removeAttribute("aria-expanded")}))}function B(){w().removeEventListener("mousemove",m),ae=ae.filter((function(t){return t!==m}))}function U(e){if(!jt.isTouch||!p&&"mousedown"!==e.type){var n=e.composedPath&&e.composedPath()[0]||e.target;if(!h.props.interactive||!Ft(y,n)){if(Lt(h.props.triggerTarget||t).some((function(t){return Ft(t,n)}))){if(jt.isTouch)return;if(h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else P("onClickOutside",[h,e]);!0===h.props.hideOnClick&&(h.clearDelayTimeouts(),h.hide(),f=!0,setTimeout((function(){f=!1})),h.state.isMounted||F())}}}function H(){p=!0}function k(){p=!1}function G(){var t=w();t.addEventListener("mousedown",U,!0),t.addEventListener("touchend",U,yt),t.addEventListener("touchstart",k,yt),t.addEventListener("touchmove",H,yt)}function F(){var t=w();t.removeEventListener("mousedown",U,!0),t.removeEventListener("touchend",U,yt),t.removeEventListener("touchstart",k,yt),t.removeEventListener("touchmove",H,yt)}function j(t,e){var n=C().box;function o(t){t.target===n&&(Gt(n,"remove",o),e())}if(0===t)return e();Gt(n,"remove",a),Gt(n,"add",o),a=o}function V(e,n,o){void 0===o&&(o=!1),Lt(h.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,o),E.push({node:t,eventType:e,handler:n,options:o})}))}function X(){var t;S()&&(V("touchstart",q,{passive:!0}),V("touchend",Q,{passive:!0})),(t=h.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(V(t,q),t){case"mouseenter":V("mouseleave",Q);break;case"focus":V(Yt?"focusout":"blur",K);break;case"focusin":V("focusout",K)}}))}function W(){E.forEach((function(t){var e=t.node,n=t.eventType,o=t.handler,r=t.options;e.removeEventListener(n,o,r)})),E=[]}function q(t){var e,n=!1;if(h.state.isEnabled&&!J(t)&&!f){var o="focus"===(null==(e=i)?void 0:e.type);i=t,c=t.currentTarget,M(),!h.state.isVisible&&Dt(t)&&ae.forEach((function(e){return e(t)})),"click"===t.type&&(h.props.trigger.indexOf("mouseenter")<0||l)&&!1!==h.props.hideOnClick&&h.state.isVisible?n=!0:tt(t),"click"===t.type&&(l=!n),n&&!o&&et(t)}}function Y(t){var e=t.target,n=N().contains(e)||y.contains(e);if("mousemove"!==t.type||!n){var o=$().concat(y).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean);(function(t,e){var n=e.clientX,o=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,i=t.props.interactiveBorder,a=wt(r.placement),s=r.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,d="right"===a?s.left.x:0,l="left"===a?s.right.x:0,f=e.top-o+c>i,p=o-e.bottom-u>i,v=e.left-n+d>i,E=n-e.right-l>i;return f||p||v||E}))})(o,t)&&(B(),et(t))}}function Q(t){J(t)||h.props.trigger.indexOf("click")>=0&&l||(h.props.interactive?h.hideWithInteractivity(t):et(t))}function K(t){h.props.trigger.indexOf("focusin")<0&&t.target!==N()||h.props.interactive&&t.relatedTarget&&y.contains(t.relatedTarget)||et(t)}function J(t){return!!jt.isTouch&&S()!==t.type.indexOf("touch")>=0}function z(){Z();var e=h.props,n=e.popperOptions,o=e.placement,r=e.offset,i=e.getReferenceClientRect,a=e.moveTransition,c=L()?oe(y).arrow:null,u=i?{getBoundingClientRect:i,contextElement:i.contextElement||N()}:t,d={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(L()){var n=C().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}},l=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},d];L()&&c&&l.push({name:"arrow",options:{element:c,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),h.popperInstance=mt(u,y,Object.assign({},n,{placement:o,onFirstUpdate:s,modifiers:l}))}function Z(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function $(){return Ct(y.querySelectorAll("[data-tippy-root]"))}function tt(t){h.clearDelayTimeouts(),t&&P("onTrigger",[h,t]),G();var e=x(!0),o=R(),r=o[0],i=o[1];jt.isTouch&&"hold"===r&&i&&(e=i),e?n=setTimeout((function(){h.show()}),e):h.show()}function et(t){if(h.clearDelayTimeouts(),P("onUntrigger",[h,t]),h.state.isVisible){if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&l)){var e=x(!1);e?o=setTimeout((function(){h.state.isVisible&&h.hide()}),e):r=requestAnimationFrame((function(){h.hide()}))}}else F()}}function ue(t,e){void 0===e&&(e={});var n=Kt.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",Xt,yt),window.addEventListener("blur",qt);var o=Object.assign({},e,{plugins:n}),r=Bt(t).reduce((function(t,e){var n=e&&ce(e,o);return n&&t.push(n),t}),[]);return Pt(t)?r[0]:r}ue.defaultProps=Kt,ue.setDefaultProps=function(t){Object.keys(t).forEach((function(e){Kt[e]=t[e]}))},ue.currentInput=jt;Object.assign({},Z,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});ue.setDefaultProps({render:re});const de=ue;const le={getCookie:async function(t,e){var n;const o=await chrome.cookies.get({url:t,name:e});return null!==(n=null===o||void 0===o?void 0:o.value)&&void 0!==n?n:""},getLocalStorage:async function(t){return new Promise(((e,n)=>{try{chrome.storage.sync.get(t,(n=>{e(null===n||void 0===n?void 0:n[t])}))}catch(Re){console.error(Re),n(Re)}}))},setLocalStorage:async function(t,e){return new Promise(((n,o)=>{try{chrome.storage.sync.set({[t]:e},(()=>n()))}catch(Re){console.error(Re),o(Re)}}))},getBytesInUse:async function(){return new Promise(((t,e)=>{chrome.storage.sync.getBytesInUse((e=>{t(e)}))}))}},fe="PENDING_MESSAGE_KEY";async function pe(t){return new Promise(((e,n)=>{chrome.tabs.sendMessage(t.targetTabId,t,(t=>{chrome.runtime.lastError?e("CONNECTION_ERROR"):e(t)}))}))}const ve={addPendingMessage:async function(t){var e;const n=null!==(e=await le.getLocalStorage(fe))&&void 0!==e?e:Array(),o=Date.now(),r=n.filter((t=>t.expirationAt>=o));r.push({...t}),await le.setLocalStorage(fe,r)},consumePendingMessage:async function(t){var e;return(null!==(e=await le.getLocalStorage(fe))&&void 0!==e?e:Array()).find((e=>(null===e||void 0===e?void 0:e.receiverName)===t))},sendRuntimeMessage:function(t,e){chrome.runtime.sendMessage(t,(t=>{null===e||void 0===e||e(null!==t&&void 0!==t?t:void 0)}))},sendRuntimeMessageAsync:async function(t){return new Promise(((e,n)=>{chrome.runtime.sendMessage(t,(t=>{e(t)}))}))},sendTabsMessage:function(t,e){chrome.tabs.sendMessage(t.targetTabId,t,(t=>{null===e||void 0===e||e(null!==t&&void 0!==t?t:void 0)}))},sendTabsMessageAsync:pe,sendTabMessageAsyncUntilConnect:async function(e,n){return new Promise(((o,r)=>{t.startIntervalAsync((async t=>{const r=await pe(e);return"CONNECTION_ERROR"===r&&t<=n||(o("CONNECTION_ERROR"===r&&t>n?"CONNECTION_ERROR":r),!1)}),1e3)}))},addMessageListener:function(t){chrome.runtime.onMessage.addListener(((e,n,o)=>t(e,n,o)))}};class Ee{constructor(t){this.type=t}}let me=function(t){return t.TO_CONTENT_SCRAP_AUTO_BY_URL="TO_CONTENT_SCRAP_AUTO_BY_URL",t.TO_BACKGROUND_SET_1688_QUERY="TO_BACKGROUND_SET_1688_QUERY",t.GET_PERCENTY_TOKEN="GET_PERCENTY_TOKEN",t.INJECT_RESULT="INJECT_RESULT",t.OPEN_TAB_AND_SCRAP="OPEN_TAB_AND_SCRAP",t.OPEN_TAB_AND_SCRAP_FINISH="OPEN_TAB_AND_SCRAP_FINISH",t.SCRAP_AUTO="SCRAP_AUTO",t.SCRAP_AUTO_FINISH="SCRAP_AUTO_FINISH",t.SCRAP_AUTO_FINISH_TO_LIST_PAGE="SCRAP_AUTO_FINISH_TO_LIST_PAGE",t.OPEN_PERCENTY_TAB="OPEN_PERCENTY_TAB",t.GET_CURRENT_TAB_ID_FROM_CONTENTS_SCRIPT="GET_CURRENT_TAB_ID_FROM_CONTENTS_SCRIPT",t.CLOSE_TAB="CLOSE_TAB",t.SCRAP_SUCCESS_TO_PERCENTY_WEB="SCRAP_SUCCESS_TO_PERCENTY_WEB",t.SCRAP_SUCCESS_TO_PERCENTY_WEB_TAB="SCRAP_SUCCESS_TO_PERCENTY_WEB_TAB",t.EXTENSION_INSTALLED_TO_PERCENTY_WEB_TAB="EXTENSION_INSTALLED_TO_PERCENTY_WEB_TAB",t.FETCH_RAW="FETCH_RAW",t.GET_NAVER_SHOPPING_LENS="GET_NAVER_SHOPPING_LENS",t.IMG_SEARCH="IMG_SEARCH",t.IMG_SEARCH_TAB="IMG_SEARCH_TAB",t.IMG_SEARCH_RESULT="IMG_SEARCH_RESULT",t.IMAGE_SEARCH_POSITION="IMAGE_SEARCH_POSITION",t.IMAGE_SEARCH_BTN_POSITION="IMAGE_SEARCH_BTN_POSITION",t.IMAGE_SEARCH_RESULT="IMAGE_SEARCH_RESULT",t.IMAGE_SEARCH_MODAL_OPEN="IMAGE_SEARCH_MODAL_OPEN",t.UPDATE_DECLARATIVE_NET_REQUEST_RULES="UPDATE_DECLARATIVE_NET_REQUEST_RULES",t.GET_SHEIN_THUMBNAIL_IMGS="GET_SHEIN_THUMBNAIL_IMGS",t.GET_IMG_BLOB_URL="GET_IMG_BLOB_URL",t.TO_DELETE_COOKIES="TO_DELETE_COOKIES",t.HEALTH_CHECK="HEALTH_CHECK",t.OPEN_SMART_STORE_LOGIN_EXTERNAL="OPEN_SMART_STORE_LOGIN_EXTERNAL",t.UPLOAD_SMART_STORE_EXTERNAL="UPLOAD_SMART_STORE_EXTERNAL",t.EDIT_SMART_STORE_EXTERNAL="EDIT_SMART_STORE_EXTERNAL",t.GET_CURRENT_LOGGED_IN_SMART_STORE_CHANNEL_EXTERNAL="GET_CURRENT_LOGGED_IN_SMART_STORE_CHANNEL_EXTERNAL",t.GET_CHROME_EXTENSION_VERSION_EXTERNAL="GET_CHROME_EXTENSION_VERSION_EXTERNAL",t.DELETE_SMART_STORE_PRODUCT_EXTERNAL="DELETE_SMART_STORE_PRODUCT_EXTERNAL",t.UPDATE_SMART_STORE_PRODUCT_STATE_EXTERNAL="UPDATE_SMART_STORE_PRODUCT_STATE_EXTERNAL",t.GET_SMART_STORE_PRODUCT_EXTERNAL="GET_SMART_STORE_PRODUCT_EXTERNAL",t.FETCH_RAW_EXTERNAL="FETCH_RAW_EXTERNAL",t.UPDATE_DECLARATIVE_NET_REQUEST_RULES_EXTERNAL="UPDATE_DECLARATIVE_NET_REQUEST_RULES_EXTERNAL",t.GET_DECLARATIVE_NET_REQUEST_RULES_EXTERNAL="GET_DECLARATIVE_NET_REQUEST_RULES_EXTERNAL",t.SCRAP_START_EXTERNAL="SCRAP_START_EXTERNAL",t.REQUEST_AI_SOURCING="REQUEST_AI_SOURCING",t.REQUEST_NAVER_SHOPPING_POPULAR_TERMS="REQUEST_NAVER_SHOPPING_POPULAR_TERMS",t.REQUEST_TAOBAO_IMG_SEARCH_EXTERNAL="REQUEST_TAOBAO_IMG_SEARCH_EXTERNAL",t.SCRAP_SUCCESS_FROM_EXT="SCRAP_SUCCESS_FROM_EXT",t.CHROME_EXTENSION_INSTALLED_FROM_EXT="CHROME_EXTENSION_INSTALLED_FROM_EXT",t.NAVER_SHOPPING_LENS_FROM_EXT="NAVER_SHOPPING_LENS_FROM_EXT",t}({});class Te extends Ee{constructor(){super(me.OPEN_PERCENTY_TAB)}}let ge=function(t){return t[t.INITIAL=0]="INITIAL",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.ERROR=3]="ERROR",t[t.ANALYSING=4]="ANALYSING",t[t.DUPLICATED_SCRAP=5]="DUPLICATED_SCRAP",t[t.NEED_LOGIN=6]="NEED_LOGIN",t}({}),he=function(t){return t[t.NONE=0]="NONE",t[t.NEED_LOGIN=1]="NEED_LOGIN",t[t.DUPLICATED_SCRAP=2]="DUPLICATED_SCRAP",t[t.ERROR=3]="ERROR",t}({}),_e=function(t){return t[t.INITIAL=0]="INITIAL",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.ERROR=3]="ERROR",t[t.DUPLICATED_SCRAP=4]="DUPLICATED_SCRAP",t[t.NEED_LOGIN=5]="NEED_LOGIN",t}({});function ye(t){t.classList.remove("PercentyFloatingButtonTextLoading","PercentyFloatingButtonTextSuccess","PercentyFloatingButtonTextError","PercentyFloatingButtonTextNeedLogin")}function be(t){t.classList.remove("PercentyListButtonTextLoading","PercentyListButtonTextSuccess","PercentyListButtonTextError","PercentyListButtonTextNeedLogin")}const Ae={createFloatingButton:function(){const t=document.createElement("button");return t.innerHTML="".concat(' ',"
\ud37c\uc13c\ud2f0\ub85c
\uc218\uc9d1\ud558\uae30
"),t.classList.add("PercentyFloatingButtonRoot"),t},setFloatingButtonState:function(t,e){const n=t.querySelector("#percenty_floating_button_id");if(n)switch(e){case ge.INITIAL:ye(n),t.disabled=!1,n.outerHTML="
\ud37c\uc13c\ud2f0\ub85c
\uc218\uc9d1\ud558\uae30
";break;case ge.LOADING:ye(n),t.disabled=!1,n.outerHTML="
\uc218\uc9d1 \uc911...
";break;case ge.SUCCESS:ye(n),t.disabled=!1,n.outerHTML="
\uc218\uc9d1 \uc644\ub8cc!
";break;case ge.ERROR:ye(n),t.disabled=!1,n.outerHTML="
\uc218\uc9d1 \uc624\ub958
\uc7ac\uc2dc\ub3c4
";break;case ge.ANALYSING:ye(n),t.disabled=!1,n.outerHTML="
\ubd84\uc11d \uc911...
";break;case ge.NEED_LOGIN:ye(n),t.disabled=!1,n.outerHTML="
\ub85c\uadf8\uc778\uc774
\ud544\uc694\ud574\uc694
";break;case ge.DUPLICATED_SCRAP:ye(n),t.disabled=!1,n.outerHTML="
\uc911\ubcf5\uc0c1\ud488
\uac15\uc81c\uc218\uc9d1
"}},createFloatingTooltip:function(t){return de(t,{placement:"bottom-end",allowHTML:!0,arrow:!0,animation:"shift-away",interactive:!0,trigger:"manual",zIndex:9e8})},setFloatingTooltipState:function(t,e,n){switch(e){case he.NEED_LOGIN:const e=document.createElement("template");e.innerHTML='
\n
\ud37c\uc13c\ud2f0 \ub85c\uadf8\uc778\uc774 \ud544\uc694\ud574\uc694!
\n
\ub85c\uadf8\uc778 \ud558\ub7ec\uac00\uae30
\n
';e.content.getElementById("PercentyFloatingTooltipLoginBtnId").onclick=()=>{t.hide(),ve.sendRuntimeMessage(new Te)},t.setContent(e.content),setTimeout((()=>t.show()),0);break;case he.ERROR:t.setContent('
\uc218\uc9d1\uc5d0 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.

'.concat(n,"
")),setTimeout((()=>t.show()),0);break;case he.DUPLICATED_SCRAP:t.setContent('
\uc774\ubbf8 \uc218\uc9d1\ud55c \uc0c1\ud488\uc785\ub2c8\ub2e4.

\uc218\uc9d1\ud558\uc2dc\ub824\uba74 \ud55c\ubc88 \ub354 \ub20c\ub7ec\uc8fc\uc138\uc694.
'),setTimeout((()=>t.show()),0);break;case he.NONE:default:setTimeout((()=>t.hide()),0)}},createListButton:function(t){const e=document.createElement("button");return e.innerHTML="".concat('',"
\ud37c\uc13c\ud2f0\ub85c
\uc218\uc9d1\ud558\uae30
"),t?e.classList.add(t):e.classList.add("PercentyListButtonRoot"),e},setListButtonState:function(t,e){var n;const o=null===(n=t.getElementsByClassName("PercentyListButtonText"))||void 0===n?void 0:n[0];if(o)switch(e){case _e.INITIAL:be(o),t.disabled=!1,o.outerHTML="
\ud37c\uc13c\ud2f0\ub85c
\uc218\uc9d1\ud558\uae30
";break;case _e.LOADING:be(o),t.disabled=!0,o.outerHTML="
\uc218\uc9d1 \uc911...
";break;case _e.SUCCESS:be(o),t.disabled=!0,o.outerHTML="
\uc218\uc9d1 \uc644\ub8cc!
";break;case _e.ERROR:be(o),t.disabled=!1,o.outerHTML="
\uc218\uc9d1 \uc624\ub958
\uc7ac\uc2dc\ub3c4
";break;case _e.DUPLICATED_SCRAP:be(o),t.disabled=!1,o.outerHTML="
\uc911\ubcf5 \uc0c1\ud488
\uac15\uc81c \uc218\uc9d1
";break;case _e.NEED_LOGIN:be(o),t.disabled=!0,o.outerHTML="
\ub85c\uadf8\uc778\uc774
\ud544\uc694\ud574\uc694
"}},createListTooltip:function(t,e){const n=de(t,{placement:"bottom-end",allowHTML:!0,arrow:!0,animation:"shift-away",interactive:!1,zIndex:9e8,trigger:"manual mouseenter focus"});return n.setContent('
'.concat(e,"
")),n}};class Oe extends Ee{constructor(t,e,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(me.OPEN_TAB_AND_SCRAP),this.url=t,this.callerTabId=e,this.targetProductId=n,this.ignoreDuplicatedScrap=o}}function Re(t){this.message=t}Re.prototype=new Error,Re.prototype.name="InvalidCharacterError";var Se="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Re("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,r=0,i=0,a="";o=e.charAt(i++);~o&&(n=r%4?64*n+o:o,r++%4)?a+=String.fromCharCode(255&n>>(-2*r&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return a};function Le(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(Se(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(e)}catch(t){return Se(e)}}function Ne(t){this.message=t}Ne.prototype=new Error,Ne.prototype.name="InvalidTokenError";const we=function(t,e){if("string"!=typeof t)throw new Ne("Invalid token specified");var n=!0===(e=e||{}).header?0:1;try{return JSON.parse(Le(t.split(".")[n]))}catch(t){throw new Ne("Invalid token specified: "+t.message)}},Ce="_jg_tk";async function xe(){return le.getLocalStorage(Ce).then((t=>null!==t&&void 0!==t?t:""))}const Ie={getToken:xe,setToken:async function(t){return le.setLocalStorage(Ce,t)},isTokenValid:async function(){try{const t=await xe();if(!t)return!1;const e=we(null!==t&&void 0!==t?t:"");if(null!==e&&void 0!==e&&e.exp&&e.exp>Date.now()/1e3)return!0}catch(Re){console.error(Re)}return!1},getStagedRolloutNumber:async function(){try{const t=await xe();if(!t)return 0;return we(null!==t&&void 0!==t?t:"").sub.split("").reduce(((t,e)=>t+e.charCodeAt(0)),0)%100}catch(Re){return console.error(Re),0}},getUserId:async function(){try{const t=await xe();if(!t)return"";return we(null!==t&&void 0!==t?t:"").sub}catch(Re){return console.error(Re),""}}},Pe="ENCITOZYJCMXSFZ";const De={setScrapState:function(t,e,n){window.sessionStorage.setItem(Pe+t,JSON.stringify({id:t,state:e,message:n}))},getScrapState:function(t){const e=window.sessionStorage.getItem(Pe+t);return e?JSON.parse(e):void 0},stringifyAndParse:function(t){if(t)try{return JSON.parse(JSON.stringify(t))}catch(Re){return void console.error(Re)}}},Me="div#rnkRankingMain",Be="RAKUTEN_LIST_ITEM_BTN_ID_";let Ue=-1,He=!1,ke=new Map;const Ge=new MutationObserver((t=>{t.some((t=>t.addedNodes.length>0))&&Fe(document.body)}));async function Fe(t){const e=t.querySelectorAll("div#rnkRankingMain .rnkRanking_top3box, div#rnkRankingMain .rnkRanking_after4box");e.length<1||(ke.forEach((t=>t.destroy())),ke=new Map,console.error("\uc5b4\ud39c\ub4dc\ubc84\ud2bc: ".concat(e.length)),e.forEach((t=>{const e=function(t){var e,n,o,r;const i=null!==(e=t.querySelector(".rnkRanking_imageBox a"))&&void 0!==e?e:void 0;return i?null!==(r=i.href)&&void 0!==r?r:"":null!==(n=null===(o=t.querySelector(".rnkRanking_dispRank"))||void 0===o?void 0:o.textContent)&&void 0!==n?n:""}(t),n=t.querySelector("button.PercentyListButtonRoot");if(console.error("ProductId: "+e),!e||n&&n.id===Be+e)return;n&&n.remove();const o=Ae.createListButton("PercentyListButtonRootRelative");t instanceof HTMLElement&&(o.id=Be+e,o.onclick=function(n){var r;n.preventDefault(),n.stopPropagation(),He?(De.setScrapState(e,_e.LOADING),Ae.setListButtonState(o,_e.LOADING),ve.sendRuntimeMessage(new Oe(function(t){var e,n;return null!==(e=null===(n=t.querySelector(".rnkRanking_imageBox a"))||void 0===n?void 0:n.href)&&void 0!==e?e:""}(t),Ue,e))):(je(),Ae.setListButtonState(o,_e.NEED_LOGIN)),null===(r=ke.get(e))||void 0===r||r.destroy(),ke.delete(e)});const r=De.getScrapState(e);if(r&&r.state===_e.SUCCESS&&Ae.setListButtonState(o,r.state),console.error("append item"),console.error(t),console.error("append btn"),console.error(o),t instanceof HTMLDataListElement){const e=document.createElement("dd");e.appendChild(o),t.appendChild(e)}else t.appendChild(o)})))}function je(){Ie.isTokenValid().then((t=>{He=t}))}je(),console.error("rakuten ranking:"),ve.sendRuntimeMessage(new class extends Ee{constructor(){super(me.GET_CURRENT_TAB_ID_FROM_CONTENTS_SCRIPT)}},(t=>{var e;Ue=null!==(e=null===t||void 0===t?void 0:t.tabId)&&void 0!==e?e:-1})),ve.addMessageListener(((t,e,n)=>{try{if(t.type===me.SCRAP_AUTO_FINISH_TO_LIST_PAGE){const e=t,n=document.getElementById(Be+e.targetProductId);if(n&&e&&(De.setScrapState(e.targetProductId,e.scrapState.state,e.scrapState.message),Ae.setListButtonState(n,e.scrapState.state),e.scrapState.message&&e.scrapState.message.length>0)){const t=Ae.createListTooltip(n,e.scrapState.message);t.show(),ke.set(e.targetProductId,t)}}}catch(Re){console.error(Re)}return!1})),Fe(document.body),async function(){for(Ge.disconnect();!(document.body.querySelector(Me)instanceof HTMLElement);)await t.delay(500);const e=document.body.querySelector(Me);e instanceof HTMLElement&&Ge.observe(e,{childList:!0,subtree:!1})}()})(); //# sourceMappingURL=ranking_rakuten_com.js.map