1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3429],{17135:function(e,l,t){t.r(l),t.d(l,{default:function(){return eo}});var i=t(31549),n=t(41117),s=t(91351),a=t(21702),r=t(3094),o=t(46722),d=t(1313),c=t(9201),u=t(84148),m=t(77640),x=t(44194),v=t(71857),f=t(48508),h=t(94122),p=t(91877),g=t(33258),j=t(80765),b=t(99274),N=t(2623),y=t(3273),w=t(98912),_=t(37379),I=t(91480),k=t(91248),P=t(3704),S=t(96822),C=t(94301),T=e=>{var l,t,s,r,o,m,T,O,Z,E,q,L,D,A;let{wishlistId:F,item:z,removeBtn:R=!0,level:K=0,setWishlistIsLoading:G}=e,{t:Q}=(0,d.$G)("common"),{openModal:M}=(0,w.SO)();(0,_.useRouter)();let[X,$]=(0,c.KO)(u.P),U=(0,C.Y)(),{updateItemToWishlist:Y,isLoading:H}=(0,f._4)(),{removeItemFromWishlist:W,isLoading:V}=(0,f.FO)();(0,x.useEffect)(()=>{H||V?null==G||G(!0):null==G||G(!1)},[H,V,G]);let{id:B,product:J,quantity:ee,ratio:el,waste:et,children:ei,description:en}=z,{name:es,unit:ea,grouped_pivot:er,is_decimal:eo,manufacturer:ed}=J,ec=null!==(E=null==J?void 0:null===(l=J.variation_options)||void 0===l?void 0:l[0])&&void 0!==E?E:J,eu=null!==(q=null==J?void 0:null===(s=J.variation_options)||void 0===s?void 0:null===(t=s[0])||void 0===t?void 0:t.id)&&void 0!==q?q:null,em=null!==(L=null==J?void 0:null===(T=J.variation_options)||void 0===T?void 0:null===(m=T[0])||void 0===m?void 0:null===(o=m.gallery)||void 0===o?void 0:null===(r=o[0])||void 0===r?void 0:r.original)&&void 0!==L?L:null==J?void 0:null===(Z=J.gallery)||void 0===Z?void 0:null===(O=Z[0])||void 0===O?void 0:O.original,ex=(null==ec?void 0:ec.active_offers_count)>0,ev=null!==(D=null==ec?void 0:ec.unit_amount)&&void 0!==D?D:1,[ef,eh]=x.useState(ee.toString()),ep=j.O,eg=(0,x.useMemo)(()=>(0,S.N)(),[]),ej=(0,x.useCallback)(e=>{let l=e.target.value;eh(ep(l,eo)),eg({value:l,setIsLoading:G,sanitizeInput:ep,isDecimal:eo,unitAmount:ev,setInputValue:eh,updateItem:Y,updateParams:{wishlistId:F,listItem:{id:B}}})},[eg,B,F,eo,ev,eh,Y,G]);return(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:(0,v.m6)("flex items-center px-3 py-2 text-sm",0===K?"bg-light shadow-sm m-3":" border-b last:border-none"),children:(0,i.jsxs)("div",{className:"flex flex-col md:flex-row gap-3 w-full justify-between items-center",children:[(0,i.jsxs)("div",{className:"flex items-center w-full",children:[(0,i.jsx)("div",{className:(0,v.m6)("relative flex shrink-0 items-center m-2 justify-center overflow-hidden",0===K?"h-[75px] w-[75px]":"h-[55px] w-[55px]"),children:(0,i.jsx)(h.E,{src:null!==(A=(0,P.Q)(em))&&void 0!==A?A:N.Hb,alt:es,fill:!0,sizes:"(max-width: 768px) 100vw",className:"object-contain"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(g.Z,{href:I.Z.product(null==J?void 0:J.slug,null==J?void 0:J.id,eu),className:"hover:underline",onClick:()=>{$({display:!1,view:"cart"})},children:(0,i.jsxs)("h3",{className:"font-medium line-clamp-2",children:[es,(null==ec?void 0:ec.title)?" (".concat(null==ec?void 0:ec.title,")"):""]})}),(0,i.jsxs)("h3",{className:"text-xs text-body",children:["Ref.: ",null==ec?void 0:ec.sku," "]}),en&&(0,i.jsxs)("h3",{className:"text-xs text-body",children:["Origem: ",en]}),ed&&(0,i.jsxs)("p",{className:"text-xs text-body",children:[Q("text-brand"),": ",null==ed?void 0:ed.name]}),ex&&(0,i.jsxs)("p",{className:"text-green-700 text-sm pt-1 font-medium",children:[null==ec?void 0:ec.active_offers_count," ",Q((null==ec?void 0:ec.active_offers_count)>1?"text-available-offers":"text-available-offer")]}),1===K&&(0,i.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"font-medium text-gray-600",children:[Q("text-ratio"),":"]}),(0,i.jsx)("span",{className:"text-gray-600",children:"".concat(el," ").concat((0,k.x)({childUnit:ea}))})]}),(0,i.jsx)("div",{className:"flex pt-2 items-center gap-3",children:(0,i.jsxs)("button",{className:"flex transition-all duration-200 active:scale-[110%] hover:text-red-500",onClick:e=>{e.stopPropagation(),null==G||G(!0),W({wishlistId:F,itemId:B}),null==G||G(!1)},children:[(0,i.jsx)("span",{className:"sr-only",children:Q("text-close")}),(0,i.jsx)(b.X,{className:"h-4 w-4 text-body"})]})})]})]}),(0,i.jsxs)("div",{className:"flex gap-3 w-full justify-between items-center",children:[(0,i.jsx)(y.Z,{variant:"card",baseAmount:null==ec?void 0:ec.price,price:U&&(null==ec?void 0:ec.trending_price_pro)?null==ec?void 0:ec.trending_price_pro:null==ec?void 0:ec.trending_price,isPro:U&&!!(null==ec?void 0:ec.trending_price_pro)&&(null==ec?void 0:ec.trending_price_pro)>0,unit:ea}),0===K&&(0,i.jsx)("div",{className:"flex flex-col w-fit self-end items-center justify-between md:w-auto",children:(0,i.jsxs)("div",{className:"flex flex-col space-y-2 flex-shrink-0",children:[(0,i.jsxs)("span",{className:"text-xs",children:[Q("text-quantity")," ",(0,i.jsxs)("span",{className:"font-medium",children:["(",ea,")"]}),":"]}),(0,i.jsx)(p.Z,{value:ef,onDecrement:e=>{e.stopPropagation(),null==G||G(!0);let l=ee-ev;setTimeout(()=>{ee===ev?W({wishlistId:F,itemId:B}
1):(eh(l.toString()),Y({wishlistId:F,listItem:{id:B,quantity:l}})),null==G||G(!1)},600)},onIncrement:function(e){e.stopPropagation(),null==G||G(!0);let l=ee+ev;setTimeout(()=>{eh(l.toString()),Y({wishlistId:F,listItem:{id:B,quantity:l}}),null==G||G(!1)},600)},onChange:ej,placeholder:ev.toString(),variant:"bordered",disabled:!1})]})}),1===K&&(0,i.jsxs)("div",{className:"flex items-center gap-x-1",children:[(0,i.jsx)("span",{className:"font-medium",children:ee}),(0,i.jsx)("span",{className:"text-body",children:ea})]})]})]})})},O=t(29787),Z=t.n(O),E=t(92630),q=t.n(E),L=t(20782);let D=e=>{let{variation_options:l,price:t,trending_price:i,trending_price_pro:n}=e,[s]=l||[],a=Number((null==s?void 0:s.price)||t||0),r=Number((null==s?void 0:s.trending_price)||i||a);return{basePrice:a,trendingPrice:r,trendingPricePro:Number((null==s?void 0:s.trending_price_pro)||n||0)}},A=function(e){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{product:t,quantity:i=1}=e,{basePrice:n,trendingPrice:s,trendingPricePro:a}=D(t),r=i||1;return{baseTotal:n*r,trendingTotal:(l&&a>0?a:s)*r,isPro:l&&a>0}},F=function(e){let{children:l=[]}=e,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l.reduce((e,l)=>{let{baseTotal:i,trendingTotal:n}=e,s=A(l,t);return{baseTotal:i+s.baseTotal,trendingTotal:n+s.trendingTotal}},{baseTotal:0,trendingTotal:0})},z=function(e){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.reduce((e,t)=>{let{baseTotal:i,trendingTotal:n}=t.children&&t.children.length?F(t,l):A(t,l);return e.baseTotal+=i,e.trendingTotal+=n,e},{baseTotal:0,trendingTotal:0})};function R(e){var l,t,s,r,o,m,h,w;let{wishlistId:_,item:k,setWishlistIsLoading:O}=e,{t:Z}=(0,d.$G)("common"),[E,D]=x.useState(!1),[A,z]=(0,c.KO)(u.P),R=(0,C.Y)(),{updateItemToWishlist:K,isLoading:G}=(0,f._4)(),{removeItemFromWishlist:Q,isLoading:M}=(0,f.FO)();(0,x.useEffect)(()=>{G||M?null==O||O(!0):null==O||O(!1)},[G,M,O]);let{id:X,product:$,quantity:U,children:Y}=k,{name:H,unit:W,is_decimal:V,manufacturer:B}=$,J=null!==(m=null==$?void 0:null===(l=$.variation_options)||void 0===l?void 0:l[0])&&void 0!==m?m:$,ee=(null==J?void 0:J.active_offers_count)>0,el=null!==(h=null==J?void 0:J.unit_amount)&&void 0!==h?h:1,[et,ei]=x.useState(U.toString()),en=j.O,{baseTotal:es,trendingTotal:ea}=F(k,R),er=(0,x.useMemo)(()=>(0,S.N)(),[]),eo=(0,x.useCallback)(e=>{let l=e.target.value;ei(en(l,V)),er({value:l,setIsLoading:O,sanitizeInput:en,isDecimal:V,unitAmount:el,setInputValue:ei,updateItem:K,updateParams:{wishlistId:_,listItem:{id:X}}})},[er,X,_,V,el,ei,K,O]);return(0,i.jsxs)("div",{className:"bg-light m-3 shadow-sm px-3 py-2 text-sm",children:[(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:"flex flex-col items-center ",children:(0,i.jsxs)("div",{className:"flex flex-col md:flex-row gap-3 w-full justify-between items-center",children:[(0,i.jsxs)("div",{className:"flex w-full",children:[(0,i.jsx)("button",{className:(0,v.m6)("flex items-center text-end xl:space-x-2 p-1 border rounded-md",E&&"bg-blue-500 text-white border-blue-500"),onClick:()=>D(!E),children:(0,i.jsx)("span",{children:(0,i.jsx)(L._,{className:(0,v.m6)("h-5 w-5",!E&&"rotate-90",E&&"-rotate-90")})})}),(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"relative flex h-[75px] w-[75px] shrink-0 items-center m-2 justify-center overflow-hidden",children:(0,i.jsx)(q(),{src:null!==(w=(0,P.Q)(null==J?void 0:null===(s=J.gallery)||void 0===s?void 0:null===(t=s[0])||void 0===t?void 0:t.original))&&void 0!==w?w:N.Hb,alt:H,fill:!0,sizes:"(max-width: 768px) 100vw",className:"object-contain"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(g.Z,{href:I.Z.product(null==$?void 0:$.slug,null==$?void 0:$.id,null==$?void 0:null===(o=$.variation_options)||void 0===o?void 0:null===(r=o[0])||void 0===r?void 0:r.id),className:"hover:underline",onClick:()=>{z({display:!1,view:"cart"})},children:(0,i.jsxs)("h3",{className:"font-medium line-clamp-2",children:[H,(null==J?void 0:J.title)?" (".concat(null==J?void 0:J.title,")"):""]})}),(0,i.jsxs)("h3",{className:"text-xs text-body",children:["Ref.: ",null==J?void 0:J.sku]}),ee&&(0,i.jsxs)("p",{className:"text-green-700 text-sm pt-1 font-medium",children:[null==J?void 0:J.active_offers_count," ",Z((null==J?void 0:J.active_offers_count)>1?"text-available-offers":"text-available-offer")]}),B&&(0,i.jsxs)("p",{className:"text-xs text-body",children:[Z("text-brand"),": ",null==B?void 0:B.name]}),(0,i.jsxs)("button",{className:"flex pt-2 transition-all duration-200 active:scale-[110%] hover:text-red-500",onClick:e=>{e.stopPropagation(),null==O||O(!0),Q({wishlistId:_,itemId:X}),null==O||O(!1)},children:[(0,i.jsx)("span",{className:"sr-only",children:Z("text-close")}),(0,i.jsx)(b.X,{className:"h-4 w-4 text-body"})]})]})]})]}),(0,i.jsxs)("div",{className:"flex gap-3 w-full justify-between items-center",children:[(0,i.jsx)(y.Z,{variant:"card",baseAmount:es/U,price:ea/U,unit:W}),(0,i.jsx)("div",{className:"flex flex-col w-fit self-end items-center justify-between md:w-auto",children:(0,i.jsxs)("div",{className:"flex flex-col space-y-2 flex-shrink-0",children:[(0,i.jsxs)("span",{className:"text-xs",children:[Z("text-quantity")," ",(0,i.jsxs)("span",{className:"font-medium",children:["(",W,")"]}),":"]}),(0,i.jsx)(p.Z,{value:et,onDecrement:e=>{e.stopPropagation(),null==O||O(!0);let l=U-el;setTimeout(()=>{U===el?Q({wishlistId:_,itemId:X}
1):(ei(l.toString()),K({wishlistId:_,listItem:{id:X,quantity:l}})),null==O||O(!1)},600)},onIncrement:function(e){e.stopPropagation(),null==O||O(!0);let l=U+el;setTimeout(()=>{ei(l.toString()),K({wishlistId:_,listItem:{id:X,quantity:l}}),null==O||O(!1)},600)},onChange:eo,placeholder:el.toString(),variant:"bordered",disabled:!1})]})})]})]})}),(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:"w-full items-center bg-gray-50 rounded-lg my-2 shadow-inner",children:E&&(null==Y?void 0:Y.length)>0&&[...Y].sort((e,l)=>e.order-l.order).map(e=>(0,i.jsx)(x.Fragment,{children:(0,i.jsx)(T,{wishlistId:_,item:e,setWishlistIsLoading:O,level:1})},e.id))})]})}var K=t(30450),G=t(48912);let Q=e=>{var l,t;return null!==(null==e?void 0:null===(t=e.variation_options)||void 0===t?void 0:null===(l=t[0])||void 0===l?void 0:l.price)||(null==e?void 0:e.price)!==null},M=(e,l)=>{if(!Array.isArray(e))return!0;for(let l of e){var t;if(null===(t=l.children)||void 0===t?void 0:t.length){if(l.children.some(e=>{let{product:l}=e;if(!Q(l))return!0}))return!0}else{let{product:e}=l;if(!Q(e))return!0}}return isNaN(l)};var X=t(96709),$=t(7117),U=t(73352),Y=t.n(U),H=t(13295),W=t(57673),V=t(13600),B=t(57128),J=t(56257),ee=t(458);function el(e){var l,t;let i=(0,ee.Z)(),{selectedShops:n}=null!=e?e:{},{getCart:s,selectedCart:a}=(0,X.jD)(),{items:r}=s(a),{me:o}=(0,B.aF)(),[d,m]=(0,c.KO)(u.P),{marketId:x}=(0,J.AD)(),v=(0,C.Y)(),{createInquiry:f,isLoading:h}=(0,V.rp)(),[{billing_address:p,shipping_address:g,verified_response:j,delivery_methods:b}]=(0,c.KO)($.hq),[N]=(0,c.KO)(W.r),y=(null==g?void 0:g.location)?{...(null==g?void 0:g.location)&&Y()(null==g?void 0:g.location,["formatted_address"]),street_address:null==g?void 0:null===(l=g.location)||void 0===l?void 0:l.formatted_address}:{...(null==g?void 0:g.address)&&Y()(null==g?void 0:g.address,["__typename"]),id:null==g?void 0:null===(t=g.address)||void 0===t?void 0:t.id},w=N?function(e){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return null==e?void 0:e.map(e=>{var t,i,n,s,a,r,o,d,c,u,m;let{trendingPrice:x,trendingPricePro:v}=D(e.product),f=l&&v>0?v:x;return{product_id:null===(t=e.product)||void 0===t?void 0:t.id,variation_option_id:null!==(m=null===(n=e.product.variation_options)||void 0===n?void 0:null===(i=n[0])||void 0===i?void 0:i.id)&&void 0!==m?m:null,manufacturer:{id:null===(a=e.product)||void 0===a?void 0:null===(s=a.manufacturer)||void 0===s?void 0:s.id,name:null===(o=e.product)||void 0===o?void 0:null===(r=o.manufacturer)||void 0===r?void 0:r.name,slug:null===(c=e.product)||void 0===c?void 0:null===(d=c.manufacturer)||void 0===d?void 0:d.slug},quantity:e.quantity,unit_price:f,product_options:null,subtotal:(null==e?void 0:e.children)?F(e,l).trendingTotal:A(e,l).trendingTotal,children:null===(u=e.children)||void 0===u?void 0:u.map(e=>{var t,i,n,s,a,r,o,d;let c=D(e.product);return{product_id:e.product.id,variation_option_id:null!==(r=null===(i=e.product.variation_options)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.id)&&void 0!==r?r:null,manufacturer:{id:null===(n=e.product.manufacturer)||void 0===n?void 0:n.id,name:null===(s=e.product.manufacturer)||void 0===s?void 0:s.name,slug:null===(a=e.product.manufacturer)||void 0===a?void 0:a.slug},quantity:e.quantity,unit_price:(o=c.trendingPrice,d=c.trendingPricePro,l&&d>0?d:o),product_options:null,subtotal:A(e,l).trendingTotal}})}})}(N.items,v):r,_=(0,H.X)(w),I=null==_?void 0:_.filter(e=>{var l;return!(null==j?void 0:null===(l=j.unavailable_products)||void 0===l?void 0:l.includes(e.id))});return{handleGenerate:async e=>{var l;let{guest_customer_id:t}=e;if(!(null==y?void 0:y.zip)){m({display:!1,view:""}),setTimeout(()=>{m({display:!0,view:"ADDRESS_DRAWER"})},100);return}if(!(null==I?void 0:I.length)){console.log("No available items found");return}if(null==x)return;let s={customer_id:null==o?void 0:o.id,guest_customer_id:t,items:I,billing_address:{...null==p?void 0:p.address,id:null==p?void 0:null===(l=p.address)||void 0===l?void 0:l.id},shipping_address:y,delivery_methods:b,selected_shops:n,language:i,origin_domain:"dropdepot.com",market_id:String(x)};delete s.billing_address.__typename,delete s.shipping_address.__typename,f(s)},isLoading:h,selectedAddress:y,availableItems:I}}var et=t(6512),ei=t(48941),en=()=>{var e;let{t:l}
1=(0,d.$G)("common"),[t,h]=(0,c.KO)(u.P),{openModal:p}=(0,w.SO)(),g=(0,x.useRef)(null),[j,b]=(0,c.KO)(W.r),{marketId:N}=(0,ei.y5)(),y=(0,C.Y)(),_=null==N||(0,et.aF)(j,N),[I,k]=x.useState(!1),{wishlist:P,isLoading:S}=(0,f.Ei)({skip:Z()(j)||_,id:null==j?void 0:j.id}),{handleGenerate:O,isLoading:E,selectedAddress:q,availableItems:L}=el({selectedShops:null}),{items:D,id:A}=null!=P?P:{},{baseTotal:F,trendingTotal:Q}=D&&(null==D?void 0:D.length)>0?z(D,y):{baseTotal:void 0,trendingTotal:void 0},X=!M(D,F),{price:$}=(0,r.ZP)({amount:null!=Q?Q:0}),{price:U}=(0,r.ZP)({amount:null!=F?F:0}),Y=async()=>{await O({}),h({display:!1,view:""})},H=(0,x.useRef)(null==j?void 0:j.market_id);return H.current=null==j?void 0:j.market_id,(0,x.useEffect)(()=>{if(!P||_)return;let e=(0,et.aA)(P,H.current);e&&((0,et.aF)(e,N)||b({...P,...e}))},[P,b,_,N]),(0,x.useEffect)(()=>{g.current&&D&&(null==D?void 0:D.length)>0&&g.current.focus()},[null==D?void 0:D.length]),(0,i.jsxs)("section",{className:"relative flex h-full flex-col bg-gray-100",children:[I&&(0,i.jsx)("div",{className:"absolute top-0 left-0 flex h-full w-full items-center justify-center bg-opacity-40 z-10",children:(0,i.jsx)("div",{className:"img-spinner h-12 w-12"})}),(0,i.jsxs)("header",{className:"fixed top-0 z-10 flex w-full max-w-[24rem] md:max-w-3xl items-center justify-between border-b border-border-200 border-opacity-75 bg-light py-4 px-6",children:[(0,i.jsx)("span",{className:"truncate font-semibold text-xl",children:null==P?void 0:P.name}),(0,i.jsxs)("button",{onClick:()=>h({display:!1,view:""}),className:"flex h-7 w-7 items-center justify-center rounded-full bg-gray-100 text-muted transition-all duration-200 hover:text-black focus:bg-black focus:text-light focus:outline-none ltr:ml-3 ltr:-mr-2 rtl:mr-3 rtl:-ml-2",children:[(0,i.jsx)("span",{className:"sr-only",children:l("text-close")}),(0,i.jsx)(s.T,{className:"h-3 w-3"})]})]}),(0,i.jsxs)(n.E.div,{layout:!0,className:"flex-grow pt-[4rem] pb-[11rem] bg-gray-100",children:[(I||S)&&(0,i.jsx)("div",{className:"absolute top-0 left-0 flex h-full w-full items-center justify-center bg-gray-100 bg-opacity-40 z-10",children:(0,i.jsx)("div",{className:"img-spinner h-12 w-12"})}),D&&D.length>0?null==D?void 0:D.map(e=>{var l;return(0,i.jsx)(x.Fragment,{children:e.children&&(null===(l=e.children)||void 0===l?void 0:l.length)!==0?(0,i.jsx)(R,{item:e,wishlistId:null!=A?A:"",setWishlistIsLoading:k}):(0,i.jsx)(T,{item:e,wishlistId:null!=A?A:"",setWishlistIsLoading:k})},e.id)}):(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)("h4",{className:"mt-6 text-base font-semibold",children:l("text-empty-quote")})})]}),(0,i.jsxs)("div",{className:"fixed bottom-0 z-10 w-full max-w-[24rem] md:max-w-3xl border-t bg-light py-5 px-6",children:[(0,i.jsxs)("div",{className:(0,v.m6)("mb-3 flex justify-between text-lg font-semibold",I&&"opacity-50"),children:[(0,i.jsxs)("p",{children:[l("text-subtotal")," ",(0,i.jsxs)("span",{className:"text-sm font-light",children:["(",(0,o.U)(null==P?void 0:null===(e=P.items)||void 0===e?void 0:e.length,l("text-item")),"):"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,i.jsx)("span",{children:(0,i.jsx)(K.Q,{className:"h-6 w-6 text-[#0b57d0]"})}),(0,i.jsxs)("span",{className:"ltr:ml-auto rtl:mr-auto",children:[$+l("text-iva")," "]}),(0,i.jsx)("span",{className:"cursor-pointer",onClick:()=>p("INFO_MODAL",{title:l("text-treding-price-heading"),description:l("text-trending-price-description")}),children:(0,i.jsx)(G.s,{className:"h-4 w-4 text-gray-500"})})]}),X&&(0,i.jsx)("div",{className:"text-xs font-normal items-center text-body",children:(0,i.jsxs)("span",{className:"",children:["PVP ",U+l("text-iva")]})})]})]}),(0,i.jsxs)("div",{className:"mb-2 flex gap-2 text-center",children:[(0,i.jsx)(m.Z,{variant:"custom",className:"w-1/2 text-sm !px-2 rounded-md text-gray-600 hover:text-black border border-gray-300",onClick:()=>h({display:!1,view:""}),children:l("text-add-more-items")}),(0,i.jsx)(m.Z,{ref:g,variant:"normal",loading:E,className:"w-1/2 capitalize !px-2 rounded-md shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-100",disabled:!D||!((null==D?void 0:D.length)>0),onClick:Y,children:l("text-request-quotes")})]}),(0,i.jsx)("span",{className:"text-sm md:text-md text-gray-700",children:l("text-checkout-notice")})]})]})},es=e=>{var l;let{item:t,closeSidebar:s,removeBtn:r=!0,groupId:o,setItemIsLoading:m,level:f=0}=e,{t:C}=(0,d.$G)("common");(0,_.useRouter)();let{openModal:T}=(0,w.SO)(),[O,Z]=(0,c.KO)(u.P),{clearItemFromCart:E,removeItemFromCart:q,updateCartLanguage:L,language:D,updateItemQuantity:A,updateItemRatioOrWaste:F}=(0,X.jD)(),{id:z,product_id:R,variation_option_id:K,title:G,sku:Q,slug:M,quantity:$,manufacturer:U,unit_price:Y,compared_price:H,is_pro:W,image:V,itemTotal:B,unit:J,unit_amount:ee,ratio:el,waste:et,children:ei,language:en}=null!=t?t:{},es=null!=ee?ee:1,ea=o||null,[er,eo]=x.useState($),ed=j.O,ec=(0,x.useMemo)(()=>(0,S.N)(),[]),eu=(0,x.useCallback)(e=>{let l=e.target.value;eo(ed(l,!0)),ec({value:l,setIsLoading:m,sanitizeInput:ed,unitAmou
1nt:es,setInputValue:eo,updateItem:A,updateParams:{id:z,groupId:ea}})},[ec,z,ea,ed,es,eo,A,m]);return(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:(0,v.m6)("flex items-center px-3 py-2 text-sm",0===f?"bg-light shadow-sm m-3":" border-b last:border-none"),children:(0,i.jsxs)("div",{className:"flex flex-col md:flex-row gap-3 w-full justify-between items-center",children:[(0,i.jsxs)("div",{className:"flex items-center w-full",children:[(0,i.jsx)("div",{className:(0,v.m6)("relative flex shrink-0 items-center m-2 justify-center overflow-hidden",0===f?"h-[75px] w-[75px]":"h-[55px] w-[55px]"),children:(0,i.jsx)(h.E,{src:null!==(l=(0,P.Q)(null==V?void 0:V.original))&&void 0!==l?l:N.Hb,alt:G,fill:!0,sizes:"(max-width: 768px) 100vw",className:"object-contain"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(g.Z,{href:I.Z.product(M,R,K),className:"hover:underline",onClick:()=>{Z({display:!1,view:"cart"})},children:(0,i.jsx)("h3",{className:"font-medium line-clamp-2",children:G})}),(0,i.jsxs)("h3",{className:"text-xs text-body",children:["Ref.: ",Q," "]}),U&&(0,i.jsxs)("p",{className:"text-xs text-body",children:[C("text-brand"),": ",null==U?void 0:U.name]}),1===f&&(0,i.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"font-medium text-gray-600",children:[C("text-ratio"),":"]}),(0,i.jsx)("span",{className:"text-gray-600",children:"".concat(el," ").concat((0,k.x)({childUnit:J}))})]}),(0,i.jsx)("div",{className:"flex pt-2 items-center gap-3",children:(0,i.jsxs)("button",{className:"flex transition-all duration-200 active:scale-[110%] hover:text-red-500",onClick:()=>{if(0===f){E(z);return}q(z,ea,$)},children:[(0,i.jsx)("span",{className:"sr-only",children:C("text-close")}),(0,i.jsx)(b.X,{className:"h-4 w-4 text-body"})]})})]})]}),(0,i.jsxs)("div",{className:"flex gap-3 w-full justify-between items-center",children:[(0,i.jsx)(y.Z,{variant:"card",baseAmount:H,price:Y,isPro:W,unit:J}),0===f&&(0,i.jsx)("div",{className:"flex flex-col w-fit self-end items-center justify-between md:w-auto",children:(0,i.jsxs)("div",{className:"flex flex-col space-y-2 flex-shrink-0",children:[(0,i.jsxs)("span",{className:"text-xs",children:[C("text-quantity")," ",(0,i.jsxs)("span",{className:"font-medium",children:["(",J,")"]}),":"]}),(0,i.jsx)(p.Z,{value:er,onDecrement:e=>{e.stopPropagation(),null==m||m(!0);let l=$-es;setTimeout(()=>{$===es?q(z,ea,es):1===es?(eo(l.toString()),q(z,ea)):(eo(l.toString()),A(z,l,ea)),null==m||m(!1)},600)},onIncrement:function(e){e.stopPropagation(),null==m||m(!0),en!==D&&L(en);let l=$+es;setTimeout(()=>{eo(l.toString()),A(z,l,ea),null==m||m(!1)},600)},onChange:eu,placeholder:es.toString(),variant:"bordered",disabled:!1})]})}),1===f&&(0,i.jsxs)("div",{className:"flex items-center gap-x-1",children:[(0,i.jsx)("span",{className:"font-medium",children:$}),(0,i.jsx)("span",{className:"text-body",children:J})]})]})]})})},ea=e=>{var l;let{item:t,closeSidebar:s,removeBtn:r=!0,groupId:o,setItemIsLoading:m}=e,{t:f}=(0,d.$G)("common"),{clearItemFromCart:h,removeItemFromCart:w,updateCartLanguage:_,language:k,updateItemQuantity:C}=(0,X.jD)(),[T,O]=x.useState(!1),[Z,E]=(0,c.KO)(u.P),{id:D,product_id:A,variation_option_id:F,title:z,sku:R,slug:K,quantity:G,manufacturer:Q,unit_price:M,compared_price:$,is_pro:U,image:Y,itemTotal:H,unit:W,unit_amount:V,children:B,language:J}=null!=t?t:{},ee=null!=V?V:1,el=o||null,[et,ei]=x.useState(G.toString()),en=j.O,ea=(0,x.useMemo)(()=>(0,S.N)(),[]),er=(0,x.useCallback)(e=>{let l=e.target.value;ei(en(l,!0)),ea({value:l,setIsLoading:m,sanitizeInput:en,unitAmount:ee,setInputValue:ei,updateItem:C,updateParams:{id:D,groupId:el}})},[ea,D,el,en,ee,ei,C,m]);return(0,i.jsxs)("div",{className:"bg-light m-3 shadow-sm px-3 py-2 text-sm",children:[(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:"flex flex-col items-center ",children:(0,i.jsxs)("div",{className:"flex flex-col md:flex-row gap-3 w-full justify-between items-center",children:[(0,i.jsxs)("div",{className:"flex w-full",children:[(0,i.jsx)("button",{className:(0,v.m6)("flex items-center text-end xl:space-x-2 p-1 border rounded-md",T&&"bg-blue-500 text-white border-blue-500"),onClick:()=>O(!T),children:(0,i.jsx)("span",{children:(0,i.jsx)(L._,{className:(0,v.m6)("h-5 w-5",!T&&"rotate-90",T&&"-rotate-90")})})}),(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"relative flex h-[75px] w-[75px] shrink-0 items-center m-2 justify-center overflow-hidden",children:(0,i.jsx)(q(),{src:null!==(l=(0,P.Q)(null==Y?void 0:Y.original))&&void 0!==l?l:N.Hb,alt:z,fill:!0,sizes:"(max-width: 768px) 100vw",className:"object-contain"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(g.Z,{href:I.Z.product(K,A,F),className:"hover:underline",onClick:()=>{E({display:!1,view:"cart"})},children:(0,i.jsx)("h3",{className:"font-medium line-clamp-2",children:z})}),(0,i.jsxs)("h3",{className:"text-xs text-body",children:["Ref.: ",R]}),Q&&(0,i.jsxs)("p",{className:"text-xs text-body",children:[f("text-brand"),": ",null==Q?void 0:Q.name]}),(0,i.jsxs)("button",{className:"flex pt-2 transition-all duration-200 active:scale-[110%] hover:text-red-500",onClick:()=>{h(D)},children:[(0,i.jsx)("span",{className:"sr-only",children:f("text-close")}),(0,i.jsx)(b.X,{className:"h-4 w-4 text-body"})]})]})]})]}),(0,i.jsxs)("div",{className:"flex gap-3 w-full justify-between items-center",children:[(0,i.jsx)(y.Z,{variant:"card",baseAmount:$||null,price:M||0,isPro:!1,unit:W}),(0,i.jsx)("div",{className:"flex flex-col w-fit self-end items-center justify-between md:w-auto",children:(0,i.jsxs)("div",{className:"flex flex-col space-y-2 flex-shrink-0",children:[(0,i.jsxs)("span",{className:"text-xs",children:[f("text-quantity")," ",(0,i.jsxs)("span",{className:"font-medium",children:["(",W,")"]}),":"]}),(0,i.jsx)(p.Z,{value:et,onDecrement:e=>{e.stopPropagation(),null==m||m(!0);let l=G-ee;setTimeout(()=>{G===ee?h(D):1===ee?(ei(l.toString()),C(D,G-1,el)):(ei(l.toString()),C(D,l,el)),null==m||m(!1)},600)},onIncrement:function(e){e.stopPropagation(),null==m||m(!0),J!==k&&_(J);let l=G+ee;setTimeout(()=>{ei(l.toString()),C(D,l,el),null==m||m(!1)},600)},onChange:er,placeholder:ee.toString(),variant:"bordered",disabled:!1})]})})]})]})}),(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:"w-full items-center bg-gray-50 rounded-lg my-2 shadow-inner",children:T&&(null==B?void 0:B.length)>0&&[...B].sort((e,l)=>e.order-l.order).map(e=>(0,i.jsx)(x.Fragment,{children:(0,i.jsx)(es,{item:e,closeSidebar:s,groupId:D,removeBtn:!1,setItemIsLoading:m,level:1},e.id)},e.id))})]})},er=()=>{let{t:e}
1=(0,d.$G)("common"),{openModal:l}=(0,w.SO)(),{language:t,totalCarts:f,selectedCart:h,getCart:p}=(0,X.jD)(),[g,j]=x.useState(!1),{items:b,total:N,comparedTotal:y,totalUniqueItems:_,meta:I}=p(h),k=(0,x.useRef)(null),{handleGenerate:P,isLoading:S,selectedAddress:C,availableItems:T}=el({selectedShops:null}),[O,Z]=(0,c.KO)(u.P),{price:E}=(0,r.ZP)({amount:N}),{price:q}=(0,r.ZP)({amount:y}),L=!(b.some(e=>e.children&&e.children.length>0?e.children.some(e=>null===e.compared_price):null===e.compared_price)||isNaN(N)),D=async()=>{await P({}),Z({display:!1,view:""})};return(0,x.useEffect)(()=>{k.current&&(null==b?void 0:b.length)>0&&k.current.focus()},[null==b?void 0:b.length]),(0,i.jsxs)("section",{className:"relative flex h-full flex-col bg-gray-100",children:[g&&(0,i.jsx)("div",{className:"absolute top-0 left-0 flex h-full w-full items-center justify-center bg-gray-100 bg-opacity-40 z-10",children:(0,i.jsx)("div",{className:"img-spinner h-12 w-12"})}),(0,i.jsxs)("header",{className:"fixed top-0 z-10 flex w-full max-w-[24rem] md:max-w-3xl items-center justify-between border-b border-border-200 border-opacity-75 bg-light py-4 px-6",children:[(0,i.jsx)("div",{className:"flex items-center text-xl font-semibold",children:(0,i.jsx)("span",{className:"flex pr-2 ltr:ml-2 rtl:mr-2",children:e("text-my-project")})}),(0,i.jsxs)("button",{onClick:()=>Z({display:!1,view:""}),className:"flex h-7 w-7 items-center justify-center rounded-full bg-gray-100 text-muted transition-all duration-200 hover:text-black focus:bg-black focus:text-light focus:outline-none ltr:ml-3 ltr:-mr-2 rtl:mr-3 rtl:-ml-2",children:[(0,i.jsx)("span",{className:"sr-only",children:e("text-close")}),(0,i.jsx)(s.T,{className:"h-3 w-3"})]})]}),(0,i.jsx)(n.E.div,{layout:!0,className:"flex-grow pt-[3.8rem] pb-[10rem]",children:(null==b?void 0:b.length)>0?null==b?void 0:b.map((e,l)=>{var t;return(0,i.jsx)(x.Fragment,{children:e.children&&(null===(t=e.children)||void 0===t?void 0:t.length)!==0?(0,i.jsx)(ea,{item:e,closeSidebar:Z,setItemIsLoading:j}):(0,i.jsx)(es,{item:e,closeSidebar:Z,setItemIsLoading:j})},"".concat(e.id,"-").concat(l))}):(0,i.jsx)(n.E.div,{layout:!0,initial:"from",animate:"to",exit:"from",variants:(0,a.I)(.25),className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)("h4",{className:"mt-6 text-base font-semibold",children:e("text-empty-project")})})}),(0,i.jsxs)("div",{className:"fixed bottom-0 z-10 w-full max-w-[24rem] md:max-w-3xl border-t bg-light py-5 px-6",children:[(0,i.jsxs)("div",{className:(0,v.m6)("mb-3 flex justify-between text-lg font-semibold",g&&"opacity-50"),children:[(0,i.jsxs)("p",{children:[e("text-subtotal")," ",(0,i.jsxs)("span",{className:"text-sm font-light",children:["(",(0,o.U)(_,e("text-item")),"):"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,i.jsx)("span",{children:(0,i.jsx)(K.Q,{className:"h-6 w-6 text-[#0b57d0]"})}),(0,i.jsxs)("span",{className:"ltr:ml-auto rtl:mr-auto",children:[function(e,l){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"--*";return Number.isFinite(e)?l:t}(N,E)+(Number.isFinite(N)?e("text-iva"):"")," "]}),(0,i.jsx)("span",{className:"cursor-pointer",onClick:()=>l("INFO_MODAL",{title:e("text-treding-price-heading"),description:e("text-trending-price-description")}),children:(0,i.jsx)(G.s,{className:"h-4 w-4 text-gray-500"})})]}),L&&(0,i.jsx)("div",{className:"text-xs font-normal items-center text-body",children:(0,i.jsxs)("span",{className:"",children:["PVP ",q+e("text-iva")]})})]})]}),(0,i.jsxs)("div",{className:"mb-2 flex gap-2 text-center",children:[(0,i.jsx)(m.Z,{variant:"custom",className:"w-1/2 text-sm !px-2 rounded-md text-gray-600 hover:text-black border border-gray-300",onClick:()=>Z({display:!1,view:""}),children:e("text-add-more-items")}),(0,i.jsx)(m.Z,{ref:k,variant:"normal",className:"w-1/2 capitalize !px-2 rounded-md shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-100",disabled:!((null==b?void 0:b.length)>0),onClick:D,loading:S,loadingColor:"DEFAULT",children:(0,i.jsx)("span",{className:"items-center",children:e("text-request-quotes")})})]}),(0,i.jsx)("span",{className:"text-gray-700",children:e("text-checkout-notice")})]})]})},eo=()=>{let[e]=(0,c.KO)(W.r),{marketId:l}=(0,ei.y5)();return e&&null!=l&&!(0,et.aF)(e,l)?(0,i.jsx)(en,{}):(0,i.jsx)(er,{})}},91248:function(e,l,t){t.d(l,{x:function(){return i}});function i(e){let{childUnit:l}=e;return(null==l?void 0:l.trim())||"un"}},13295:function(e,l,t){function i(e){var l,t;return{product_id:null==e?void 0:e.product_id,variation_option_id:null!==(t=null==e?void 0:e.variation_option_id)&&void 0!==t?t:null,quantity:null==e?void 0:e.quantity,children:null==e?void 0:null===(l=e.children)||void 0===l?void 0:l.map(e=>{var l;return{product_id:(null==e?void 0:e.productId)?null==e?void 0:e.productId:null==e?void 0:e.id,variation_option_id:null!==(l=null==e?void 0:e.variation_option_id)&&void 0!==l?l:null,quantity:null==e?void 0:e.quantity}})}}function n(e){return null==e?void 0:e.map(e=>{let l=i(e);return Array.isArray(e.children)&&e.children.length>0?{...l,children:e.children.map(e=>i(e))}:l})}t.d(l,{X:function(){return n}})},94301:function(e,l,t){t.d(l,{Y:function(){return r},_:function(){return a}});var i=t(29787),n=t.n(i),s=t(18472);function a(e){return!n()(e)&&e.some(e=>{var l;return null===(l="string"==typeof e?e:"string"==typeof(null==e?void 0:e.name)?e.name:null)||void 0===l?void 0:l.includes("pro_customer")})}function r(){let{getAuthCredentials:e,hasAccess:l}=(0,s.dQ)();return l(s.p5,e().permissions)}}}]);
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.