PageSourceSearch

https://www.anker.com/_next/static/chunks/90005.727fde10dbfd4dd4.js

js anker.com collected 2026-09-24 08:28:08 UTC 15,133 bytes, 1 lines download raw bytes

1!function(){try{var l="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new l.Error).stack;e&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[e]="f68a52e9-db4e-491c-844a-165c8b49e94f",l._sentryDebugIdIdentifier="sentry-dbid-f68a52e9-db4e-491c-844a-165c8b49e94f")}catch(l){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90005],{90005:function(l,e,i){i.r(e),i.d(e,{default:function(){return F}});var n=i(52676),d=i(75271),o=i(34064),t=i(64944),u=i(39287),r=i(95156),a=i(82187),s=i.n(a),c=i(63440),v=i(61387),p=i(40611),f=i(23663),x=i(96496),m=i(38459),h=i(18659),g=i(33133),b=i(63073),w=i(94373);let _=l=>{if(!l)return[];try{let e="string"==typeof l?JSON.parse(l):l;return Array.isArray(e)?e:[e]}catch(l){return[]}},y=(l,e,i)=>{var n;let d=null==l?void 0:null===(n=l.result_detail)||void 0===n?void 0:n.main_product;return!!d&&(d.all_store_variant?!(d.skip_variants||[]).some(l=>(null==l?void 0:l.variant_id)===e||(null==l?void 0:l.sku)===i):(d.variant_list||[]).some(l=>(null==l?void 0:l.variant_id)===e||(null==l?void 0:l.sku)===i))},N=(l,e)=>null==e||!e.length||e.some(e=>{let i=(null==e?void 0:e.with_user_tags)||[],n=(null==e?void 0:e.without_user_tags)||[];return 0===i.length&&0===n.length||(0===i.length||i.some(e=>l.includes(e)))&&(0===n.length||!n.some(e=>l.includes(e)))}),j=(l,e,i,n)=>null==l?void 0:l.find(l=>y(l,e,i)&&N(n,null==l?void 0:l.rule_conditions)),D=l=>{var e,i,n;return(null==l?void 0:null===(n=l.options)||void 0===n?void 0:null===(i=n.map(l=>{var e,i;return null==l?void 0:null===(i=l.values)||void 0===i?void 0:null===(e=i[0])||void 0===e?void 0:e.label}))||void 0===i?void 0:null===(e=i.filter(Boolean))||void 0===e?void 0:e.join(", "))||(null==l?void 0:l.name)||(null==l?void 0:l.sku)},k=(l,e)=>{var i;let n=(0,g.Z)({variant:l,product:e,handle:null==e?void 0:e.handle});return(null==n?void 0:n.title)?{price:null!==(i=null==n?void 0:n.variant_price4wscode)&&void 0!==i?i:null==l?void 0:l.price,code:n.title}:{price:null,code:""}},C=(l,e,i)=>{var n;if(!e)return l;let d=e.discount,o=e.discount_type,t=d;if((null===(n=e.multi_markets)||void 0===n?void 0:n.length)>0&&i){let l=e.multi_markets.find(l=>l.enabled&&l.currencyCode===i);l&&(t=l.discount)}return null==t?l:1===o?new c.Z(l).times(new c.Z(1).minus(new c.Z(t).div(100))).toFixed(2,c.Z.ROUND_DOWN):2===o?new c.Z(l).minus(t).toFixed(2,c.Z.ROUND_DOWN):3===o?String(t):l},Z=(l,e,i,n)=>{var d;let o=Number(C(null==l?void 0:l.price,i,n)),t=(0,g.Z)({variant:l,product:e,handle:null==e?void 0:e.handle});if(!(null==t?void 0:t.title))return{price:o,couponCode:"",useFunctionDiscount:!0};let u=null!==(d=null==t?void 0:t.variant_price4wscode)&&void 0!==d?d:null==l?void 0:l.price;return Number(u)<o?{price:Number(u),couponCode:t.title,useFunctionDiscount:!1}:{price:o,couponCode:"",useFunctionDiscount:!0}},E=l=>{var e,i;let{variant:d,item:o,salePrice:t,hasDiscount:u,locale:r}=l;return(0,n.jsxs)("div",{className:"flex items-center gap-[8px] text-[16px] font-[700] xl:flex-col xl:gap-[2px] xl:text-[14px]",children:[u(null==d?void 0:d.price,t)&&(null==o?void 0:o.price)&&(0,n.jsx)("div",{children:(0,p.T4)({amount:Number(t),currencyCode:(null==o?void 0:null===(e=o.price)||void 0===e?void 0:e.currencyCode)||"USD",locale:r})}),(null==o?void 0:o.price)!=9999999.99&&(0,n.jsx)("div",{className:s()(u(null==d?void 0:d.price,t)&&"text-[#86868C] line-through xl:text-[12px]"),children:(0,p.T4)({amount:Number(null==d?void 0:d.price),currencyCode:(null==o?void 0:null===(i=o.price)||void 0===i?void 0:i.currencyCode)||"USD",locale:r})})]})};var F=l=>{var e,i,a,g,y,N,C,F,I,O;let{variant:S,product:T,totalPrice:R,totalBasePrice:G,tradeProducts:U}=l,{setSalePrice:M,setOriginalPrice:z,setTogetherTradegiftTotalSalePrice:P,setTogetherTradegiftTotalBasePrice:A}=(0,x.l8)(),{locale:L}=(0,o.useRouter)(),{metafields:W}=(0,f.L)(),{data:B}=(0,b.Z)(),[,q]=U,[H,J]=(0,d.useState)([]),[K,X]=(0,d.useState)([]),{memberSetting:Y,shopCommon:Q}=W||{},V=(0,d.useMemo)(()=>{let l=[...(null==B?void 0:B.tags)||[]];return B&&(null==Y?void 0:Y.memeber_tag)&&l.push(Y.memeber_tag),l},[B,null==Y?void 0:Y.memeber_tag]),$=(0,d.useMemo)(()=>_(null==W?void 0:W.bxgyDiscountConfig),[null==W?void 0:W.bxgyDiscountConfig]),ll=(0,d.useMemo)(()=>(null==$?void 0:$.length)&&S?j($,null==S?void 0:S.id,null==S?void 0:S.sku,V):null,[$,S,V]),le=(0,d.useMemo)(()=>{var l;return ll&&(null==ll?void 0:null===(l=ll.result_detail)||void 0===l?void 0:l.discount_products)||[]},[ll]),li=null==S?void 0:null===(e=S.metafields)||void 0===e?void 0:e.tradeGift,ln=(null==li?void 0:li.list)||[],ld=(0,d.useMemo)(()=>{let l=[];
1return null==le||le.forEach(e=>{var i;(null==e?void 0:null===(i=e.discount_product)||void 0===i?void 0:i.handle)&&l.push(e.discount_product.handle)}),null==ln||ln.forEach(e=>{var i;(null==e?void 0:e.handle)&&l.push(null==e?void 0:e.handle),null==e||null===(i=e.options)||void 0===i||i.forEach(e=>l.push(null==e?void 0:e.handle))}),null==l?void 0:l.filter((l,e,i)=>i.indexOf(l)===e)},[le,ln]),{data:lo}=(0,w.Z)({handles:null==ld?void 0:ld.join(",")});(0,d.useEffect)(()=>{X([]),q([])},[ll,q]),(0,d.useEffect)(()=>{if(K.length>0){let l=0,e=0;K.forEach(i=>{let n=new c.Z(i.quantity||1);l=new c.Z(i.basePrice||0).times(n).plus(l).toFixed(2,c.Z.ROUND_DOWN),e=new c.Z(i.price||0).times(n).plus(e).toFixed(2,c.Z.ROUND_DOWN)}),P(e),A(l),M(new c.Z(R).plus(e).toNumber()),z(new c.Z(G).plus(l).toNumber())}else P(0),A(0),M(0),z(0)},[K,R,G,M,z,P,A]),(0,r.Z)(()=>{A(0),P(0),M(0),z(0),q([])}),(0,d.useEffect)(()=>{let l=l=>{l.target.closest("[data-dropdown]")||J([])};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]);let lt=(0,d.useCallback)((l,e)=>!!(void 0!==e&&l&&Number(l)-Number(e)>0),[]),lu=l=>{let{key:e,variant:i,product:n,isFunction:d,discountConf:o,dpIndex:t,action:u}=l,r=(K||[]).filter(l=>(null==l?void 0:l.key)!==e);if("add"===u){var a,s,c,v,p,f,x,m;let l,u,h;if(d&&o){let e=Z(i,n,o,(null==T?void 0:null===(x=T.price)||void 0===x?void 0:x.currencyCode)||"USD");l=e.price,u=e.couponCode,h=e.useFunctionDiscount}else{let e=k(i,n);l=null!==(m=e.price)&&void 0!==m?m:null==i?void 0:i.price,u=e.code,h=!1}r.push({key:e,dpIndex:t,variantId:i.id,quantity:1,image:(null==i?void 0:null===(s=i.images)||void 0===s?void 0:null===(a=s[0])||void 0===a?void 0:a.url)||(null==i?void 0:null===(c=i.image)||void 0===c?void 0:c.url),name:null==n?void 0:n.name,price:l,basePrice:null==i?void 0:i.price,sku:null==i?void 0:i.sku,sellingPlanId:null==i?void 0:null===(f=i.sellingPlanAllocations)||void 0===f?void 0:null===(p=f[0])||void 0===p?void 0:null===(v=p.sellingPlan)||void 0===v?void 0:v.id,variant:i,product:n,isFunctionExchange:h,isGift:!h,ruleId:h?null==ll?void 0:ll.rule_id:0,counpon:u})}X(r),q(r)},lr=(null==ll?void 0:null===(a=ll.frontend_labels)||void 0===a?void 0:null===(i=a.find(l=>(null==l?void 0:l.key)==="title"))||void 0===i?void 0:i.value)||("ca-fr"===L&&(null==li?void 0:null===(g=li.labels_fr)||void 0===g?void 0:g[0])?li.labels_fr[0]:null==li?void 0:null===(y=li.labels)||void 0===y?void 0:y[0])||(null==Q?void 0:Q.byXgetYtitle)||"",la="ca-fr"===L&&(null==li?void 0:null===(N=li.labels_fr)||void 0===N?void 0:N[1])?li.labels_fr[1]:(null==li?void 0:null===(C=li.labels)||void 0===C?void 0:C[1])||"",ls=(null==li?void 0:null===(F=li.labels)||void 0===F?void 0:F[2])||(null==Q?void 0:Q.soldOut)||"Sold Out",lc=((null==le?void 0:le.length)>0||(null==ln?void 0:ln.length)>0)&&(null==lo?void 0:null===(O=lo.products)||void 0===O?void 0:null===(I=O[0])||void 0===I?void 0:I.name),lv=l=>{var e,i,n;let d=null==lo?void 0:null===(e=lo.products)||void 0===e?void 0:e.find(e=>{var i;return e.handle===(null==l?void 0:null===(i=l.discount_product)||void 0===i?void 0:i.handle)}),o=(null==d?void 0:null===(i=d.variants)||void 0===i?void 0:i.find(e=>{var i;return e.sku===(null==l?void 0:null===(i=l.discount_product)||void 0===i?void 0:i.sku)}))||(null==d?void 0:null===(n=d.variants)||void 0===n?void 0:n[0]),t=(null==d?void 0:d.price)==9999999.99||(null==o?void 0:o.availableForSale)==!1;return{item:d,variant:o,soldOut:t}},lp=(0,d.useMemo)(()=>{let l=new Map;return null==le||le.forEach((e,i)=>{var n;let d=null==e?void 0:null===(n=e.discount_product)||void 0===n?void 0:n.handle;d&&(l.has(d)||l.set(d,{handle:d,items:[],isTradeGift:!1}),l.get(d).items.push({dp:e,dpIndex:i}))}),null==ln||ln.forEach((e,i)=>{let n=null==e?void 0:e.handle;if(!n)return;let d="tg-".concat(n);l.has(d)||l.set(d,{handle:n,items:[],isTradeGift:!0,gift:e}),l.get(d).items.push({dp:{discount_product:{handle:e.handle,sku:e.sku},discount_conf:null},dpIndex:i,isTradeGift:!0,gift:e})}),Array.from(l.values())},[le,ln]);return lc?(0,n.jsxs)("div",{className:"flex flex-col gap-[20px] leading-[1.2] l:gap-[8px]",children:[lr&&(0,n.jsxs)("div",{children:[(0,n.jsx)(m.Z,{className:"text-[20px] font-[700] l:text-[18px]",html:lr}),la&&(0,n.jsx)(m.Z,{className:"text-[14px] font-[600] l:text-[12px]",html:la})]}),(0,n.jsx)("div",{children:(0,n.jsx)("div",{className:"flex flex-col gap-[11px] l:gap-[8px]",children:(null==lo?void 0:lo.products)&&(null==lp?void 0:lp.map((l,e)=>{var i,d,o,r,a,c;let f=l.isTradeGift?"tg-".concat(l.handle):"fx-".concat(l.handle),x=K.find(l=>(null==l?void 0:l.key)===f),m=l.items.find(l=>!lv(l.dp).soldOut)||l.items[0],{dp:g,dpIndex:b}=x&&l.items.find(l=>l.dpIndex===x.dpIndex)||m,{item:w,variant:_,soldOut:y}=lv(g);if(!w||!_)return null;let N=!!x,j=l.items.length>1,C=(null==w?void 0:null===(i=w.price)||void 0===i?void 0:i.currencyCode)||"USD",F=l.isTradeGift?null!==(c=k(_,w).price)&&void 0!==c?c:null==_?void 0:_.price:Z(_,w,null==g?void 0:g.discount_conf,C).price;return(null==w?void 0:w.name)&&!y?(0,n.jsx)("div",{"data-dropdown":!0,className:s()("relative",!N&&"p-[1px]"),children:(0,n.jsxs)("div",{role:"button",tabIndex:y?-1:0,"aria-label":"".concat(N?"Remove":"Add"," ").concat(null==w?void 0:w.name," to cart"),"aria-disabled":y,"aria-pressed":!!N,className:s()("box-border flex cursor-pointer items-center gap-[16px] border p-[16px] pt-[20px] xl:gap-[8px]",N?"border-[2px] border-anker-color":"border border-[#DDD]",y&&"!cursor-not-allowed"),onClick:()=>{y||lu({key:f,dpIndex:b,variant:_,product:w,isFunction:!l.isTradeGift,discountConf:null==g?void 0:g.discount_conf,action:N?"remove":"add"})},onKeyDown:e=>{y||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),lu({key:f,dpIndex:b,variant:_,product:w,isFunction:!l.isTradeGift,discountConf:null==g?void 0:g.discount_conf,action:N?"remove":"add"}))},children:[(0,n.jsxs)("div",{className:s()("flex size-5 flex-none justify-end border border-[#DDD] xl:size-[16px]",{"border-none bg-[#00A9E0]":N}),children:[(0,n.jsx)("input",{className:"Subscribe_checkout__6GwD6 !hidden",type:"checkbox",checked:!!N}),N&&(0,n.jsx)(t.Z,{className:"mx-auto",width:16,fill:"#fff"})]}),(0,n.jsxs)("div",{className:"relative size-[72px] xl:size-[48px]",children:[(0,n.jsx)(h.Z,{alt:null==_?void 0:null===(d=_.image)||void 0===d?void 0:d.altText,loading:"lazy",className:"size-full",imgClassName:"w-full h-full object-caontain",source:"".concat((null==_?void 0:null===(r=_.images)||void 0===r?void 0:null===(o=r[0])||void 0===o?void 0:o.url)||(null==_?void 0:null===(a=_.image)||void 0===a?void 0:a.url))}),y&&(0,n.jsx)("span",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 whitespace-nowrap bg-[#000] bg-opacity-40 px-[5px] pt-[2px] text-[12px] font-[700] text-[#fff]",children:ls})]}),(0,n.jsxs)("div",{className:"flex w-full flex-1 flex-col gap-[4px]",children:[(0,n.jsx)("div",{className:"line-clamp-2 text-[16px] font-[700] xl:text-[14px]",dangerouslySetInnerHTML:{__html:null==w?void 0:w.name}}),(0,n.jsx)("div",{className:"flex items-center justify-between gap-2",children:(0,n.jsxs)("div",{className:"relative flex w-full flex-wrap items-center justify-between",children:[j&&(0,n.jsxs)("button",{className:"flex items-center gap-[4px] py-[4px] text-[#86868C] xl:gap-[2px]",onClick:l=>{l.stopPropagation(),H[e]=!H[e],J([...H])},children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)("p",{className:"text-left text-[14px] font-[600]",children:D(_)})}),(0,n.jsx)(u.Z,{className:"size-5"})]}),j&&(0,n.jsx)(v.E.div,{"data-dropdown":!0,className:"absolute left-0 top-[100%] z-[10] flex h-0 w-full justify-between overflow-hidden",initial:{height:0},style:{boxShadow:"0px 4px 20px 0px rgba(212, 216, 220, 0.25)"}
1,animate:H[e]?"show":"hidden",variants:{show:{height:"auto"},hidden:{height:0}},transition:{ease:"easeOut",duration:.3},children:(0,n.jsx)("div",{className:"flex w-full flex-col gap-[8px] bg-[#fff] px-[8px] py-[16px] text-[#777]",children:l.items.map((i,d)=>{var o,t,u,r;let a=lv(i.dp),c=a.variant,v=a.item,x=a.soldOut;if(!c)return null;let m=Z(c,v,null===(o=i.dp)||void 0===o?void 0:o.discount_conf,(null==v?void 0:null===(t=v.price)||void 0===t?void 0:t.currencyCode)||"USD").price,h=i.dpIndex===b;return(0,n.jsxs)("button",{className:s()("flex w-full items-center gap-2 p-[4px] font-[600] hover:bg-[#F5F5F7]",h&&"bg-[#F5F5F7]",x?"cursor-not-allowed":"cursor-pointer"),onClick:n=>{var d;n.stopPropagation(),x||(lu({key:f,dpIndex:i.dpIndex,variant:c,product:v,isFunction:!l.isTradeGift,discountConf:null===(d=i.dp)||void 0===d?void 0:d.discount_conf,action:"add"}),H[e]=!1,J([...H]))},children:[(0,n.jsx)("p",{className:"text-left text-sm",children:D(c)}),x?(0,n.jsxs)("span",{className:"",children:["(",ls,")"]}):(0,n.jsxs)("div",{className:"flex gap-[8px]",children:[lt(null==c?void 0:c.price,m)&&(0,n.jsx)("div",{children:(0,p.T4)({amount:Number(m),currencyCode:(null==v?void 0:null===(u=v.price)||void 0===u?void 0:u.currencyCode)||"USD",locale:L})}),(null==c?void 0:c.price)!=9999999.99&&(0,n.jsx)("div",{className:s()(lt(null==c?void 0:c.price,m)&&"text-[#777] line-through"),children:(0,p.T4)({amount:Number(null==c?void 0:c.price),currencyCode:(null==v?void 0:null===(r=v.price)||void 0===r?void 0:r.currencyCode)||"USD",locale:L})})]})]},"fxopt"+d)})})}),(0,n.jsx)(E,{variant:_,item:w,salePrice:F,hasDiscount:lt,locale:L})]})})]})]})},f):null}))})})]}):null}},64944:function(l,e,i){var n=i(75271);let d=n.forwardRef(function({title:l,titleId:e,...i},d){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:d,"aria-labelledby":e},i),l?n.createElement("title",{id:e},l):null,n.createElement("path",{fillRule:"evenodd",d:"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))});e.Z=d},39287:function(l,e,i){var n=i(75271);let d=n.forwardRef(function({title:l,titleId:e,...i},d){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:d,"aria-labelledby":e},i),l?n.createElement("title",{id:e},l):null,n.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});e.Z=d}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.