1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1741],{50577:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[country]/cart",function(){return i(81336)}])},81336:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__N_SSP:()=>Y,default:()=>ee});var a=i(37876),r=i(16922),s=i(30647),l=i(52913),n=i(85671);let o={width:"6px",height:"6px",backgroundColor:"#825D00",borderRadius:"50%",marginTop:"8px"},c={display:"flex",alignItems:"flex-start",gap:"8px",marginLeft:"42px"};function d({showUnavailableItems:e=!1,showPriceChanges:t=!1,unavailableItemsCount:i=1,priceChangesCount:m=2,mb:u="md",size:h="md"}={}){let{t:x}=(0,l.A)("common");if(!e&&!t)return null;let g="sm"===h,b=g?16:20;return(0,a.jsx)(r.F,{color:"yellow",mb:u,icon:(0,a.jsx)(n.He,{width:b,height:b}),style:{color:"var(--mantine-color-saryellow-8)"},styles:{title:{color:"var(--mantine-color-saryellow-8)",...g&&{fontSize:"0.80rem"}},message:{color:"var(--mantine-color-saryellow-8)",...g&&{fontSize:"0.80rem"}},icon:{margin:0,padding:0,marginRight:"0.625rem"}},title:x("cartChangesTitle"),children:(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[e&&(0,a.jsxs)("div",{style:c,children:[(0,a.jsx)("div",{style:o}),(0,a.jsx)(s.E,{color:"#825D00",children:x("cartUnavailableItems",{count:i})})]}),t&&(0,a.jsxs)("div",{style:c,children:[(0,a.jsx)("div",{style:o}),(0,a.jsx)(s.E,{color:"#825D00",children:x("cartPriceChanges",{count:m})})]})]})})}var m=i(10748),u=i(84459),h=i(88173),x=i(19581),g=i(88229),b=i(95068),j=i(55396),p=i(36952),f=i(14430),y=i(85182),v=i(11199),k=i(89099),w=i(19093);let C=()=>{let e=(0,k.useRouter)(),{t}=(0,l.A)("forms"),{language:i,country:o}=(0,f.JK)(e),{regonData:c}=(0,w.D)(),d=c?c.eligible?"Eligible":"Not Eligible":null,m=`/${i}/${(0,f.$9)(o)}/customer/profile`;return"Not Eligible"===d?(0,a.jsx)(r.F,{color:"red",variant:"light",mb:"md",icon:(0,a.jsx)(n.LJ,{width:20,height:20}),style:{color:"#c8102e"},styles:{title:{color:"#c8102e",fontSize:"1rem"},message:{color:"#c8102e"},icon:{margin:0,padding:0,marginRight:"0.625rem"},body:{gap:"4px"}},title:t("regonCartEligibilityTitle"),children:(0,a.jsxs)(y.B,{spacing:"xs",children:[(0,a.jsx)(s.E,{size:"sm",children:t("regonCartEligibilityMessage")}),(0,a.jsx)(v.M,{href:m,size:"sm",fw:500,children:t("regonCartEligibilityProfileLink")})]})}):(0,a.jsx)(r.F,{color:"blue",variant:"light",mb:"md",children:(0,a.jsxs)(y.B,{spacing:"xs",children:[(0,a.jsx)(s.E,{fw:600,size:"sm",children:t("regonCartVerificationTitle")}),(0,a.jsx)(s.E,{size:"sm",children:t("regonCartVerificationMessage")})]})})};var I=i(25407),E=i(14232),S=i(30841),N=i(83388),A=i(67948);function L({fullWidth:e,className:t,disabled:i,"data-cy":r,"data-testid":s}){let{t:n,lang:o}=(0,l.A)("quote"),{cart:c}=(0,S._$)(),{allowExportAsQuote:d}=(0,N.A)(),[m,u]=(0,E.useState)(!1);if(!d)return null;let h=async()=>{if(c?.id&&c.lineItems?.length){u(!0);try{let e=await fetch("/api/cart/generate-quote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:o})});if(!e.ok)throw Error("Failed to generate quote");let t=await e.blob(),i=window.URL.createObjectURL(t),a=e.headers.get("Content-Disposition"),r=a?.match(/filename="(.+)"/),s=r?.[1]||`sarstedt-quote-${Date.now()}.pdf`,l=document.createElement("a");l.href=i,l.download=s,document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(i)}catch(e){(0,A.Oz)({errorMessage:e instanceof Error?e.message:String(e),errorType:"api_error"})}finally{u(!1)}}},x=i||m||!c?.lineItems?.length;return(0,a.jsx)(I.$,{onClick:h,disabled:x,loading:m,fullWidth:e,className:`secondary ${t||""}`,"data-cy":r||"export-quote","data-testid":s||"export-quote-button",children:n("exportAsQuoteLabel")})}var $=i(66402),_=i(40575),z=i(14169),R=i(91717),D=i(77328),V=i.n(D),T=i(75656),F=i(14941),q=i(79980),P=i(3934),O=i(57420),U=i(72556),K=i(73310),B=i(73940),M=i(22387),W=i(89228),H=i(95536),J=i(72983),Q=i(38404),X=i(91106);let Z=({availabilityStatus:e,savingsAlertData:t,isCustomerPrice:i,fullLocale:r,layout:s})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(F.o,{size:"sm",mb:s?"sm":0,mt:s?void 0:0,availabilityStatus:e}),t&&(0,a.jsx)(Q.A,{data:t,fullLocale:r,...s?{layout:s}:{}}),i&&(0,a.jsx)(q.V,{size:"sm",mb:s?"sm":0,mt:s?void 0:0})]}),G=({item:e,lowStock:t=!1,customer:i,customVariantData:r})=>{let{t:o}=(0,l.A)("common"),c=(0,k.useRouter)(),{cart:d,handleVariantSKUCustomField:m,setLineItemQuantity:h}=(0,x._$)(),{fullLocaleDefaultCountry:g,country:b}=(0,f.JK)(c),{location:j}=(0,P.zy)(),p=(0,J.unpackVariantDataset)(g,r||e.variant),y=p.name,v=p.description,{data:w}=(0,T.Ay)(`/api/commercetools/products/get-variant-available-quantity?variantSKU=${e.variant.sku}`,{refreshInterval:6e4}
1),{sharpsRestrictedSkus:C,backorderAllowedFor:I}=(0,N.A)(),E=!!w?.success&&w.backorderAllowed,S=(0,B.DO)(i,I)&&E,A=(0,H.Uk)(e.variant.sku??""),L=async t=>{j?.storeKey&&(await h({storeKey:j.storeKey,lineItemId:e.id,quantity:0}),m(e.variant.sku||"",j.storeKey||"","remove"))},$=d?.lineItems||[],_=$.find(t=>t.variant.sku===e.variant.sku)?.quantity||0,R=(0,u.u)(),D=e.variant.sku??"",V=!!R?.data[D]?.isCustomerPrice,F=(0,X.nR)(e),q=(0,M.ZD)({sku:D,restrictedSkus:C,customer:i}),Q=parseInt(R?.data[D]?.pieces||"1",10)||1,G=Math.floor((A?.quantity??0)/Q),{variantAvailabilityStatus:Y}=(0,K.S)({customer:i,availableQuantity:G,desiredQuantity:_,backorderAllowedForCountry:E});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("tr",{className:"hidden md:table-row",children:(0,a.jsx)("th",{align:"left",colSpan:4,children:(0,a.jsxs)(z.s,{fw:"bold",fz:"1.125rem",py:"sm",justify:"space-between",children:[(0,a.jsxs)("span",{children:[y,t&&(0,a.jsx)(s.E,{color:"var(--mantine-color-sarred-5)",maw:"500px",children:o(S?"lowStockCartWarning":"lowStockOrderBlocked")})]}),(0,a.jsx)("button",{type:"button","aria-label":"Remove",onClick:L,style:{background:"none",border:"none",cursor:"pointer",padding:0},children:(0,a.jsx)(n.d7,{className:"delete-icon",width:"1.5rem",height:"1.5rem"})})]})})}),(0,a.jsxs)("tr",{"data-cy":e.variant.sku,className:"hidden md:table-row border-solid border-b border-t-0 border-x-0 border-[#CCCCCC]",children:[(0,a.jsxs)("td",{style:{minWidth:"20rem",verticalAlign:"top"},children:[(0,a.jsxs)(s.E,{pb:"sm",children:["PL"===b&&(0,a.jsxs)(s.E,{component:"span",td:"underline",mr:"xs",children:[o("skuLabel"),": ",e.variant.sku]}),v]}),(0,a.jsx)("div",{style:{display:"inline-block"},children:(0,a.jsx)(z.s,{gap:"xs",children:Z({availabilityStatus:Y,savingsAlertData:F,isCustomerPrice:V,fullLocale:g,layout:"inline"})})}),(0,a.jsx)(W.A,{show:q,mb:"sm"})]}),(0,a.jsx)("td",{align:"right",colSpan:4,children:(0,a.jsx)(z.s,{pb:"sm",w:"fit-content",children:(0,a.jsx)(U.A,{variant:p,productId:e.productId||"",hideVariantControls:!0,view:O.V.CART,stockLimit:G+_,lineItemId:e.id,initialValue:_})})})]}),(0,a.jsxs)("div",{className:"md:hidden border-b border-[#CCCCCC] py-4","data-cy":e.variant.sku,children:[(0,a.jsxs)(z.s,{justify:"space-between",align:"flex-start",mb:"sm",fw:"bold",children:[(0,a.jsxs)("div",{className:"flex-1 pr-2",children:[(0,a.jsx)(s.E,{fw:"bold",fz:"1rem",mb:"xs",children:y}),t&&(0,a.jsx)(s.E,{color:"var(--mantine-color-sarred-5)",fz:"sm",children:o(S?"lowStockCartWarning":"lowStockOrderBlocked")})]}),(0,a.jsx)("button",{onClick:L,className:"flex-shrink-0 p-2 hover:bg-gray-100 rounded transition-colors","aria-label":o("removeLabel"),children:(0,a.jsx)(n.d7,{className:"delete-icon",width:"1.25rem",height:"1.25rem"})})]}),(0,a.jsxs)(s.E,{fz:"sm",mb:"sm",children:["PL"===b&&(0,a.jsxs)(s.E,{component:"span",td:"underline",mr:"xs",fw:500,children:[o("skuLabel"),": ",e.variant.sku]}),v]}),(0,a.jsxs)(z.s,{direction:"column",gap:"xs",children:[Z({availabilityStatus:Y,savingsAlertData:F,isCustomerPrice:V,fullLocale:g}),(0,a.jsx)(W.A,{show:q,fullWidth:!0,mb:0})]}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(U.A,{variant:p,productId:e.productId||"",hideVariantControls:!0,view:O.V.CART,stockLimit:G+_,lineItemId:e.id,initialValue:_})})]})]})};var Y=!0;function ee({variants:e}){let{t}=(0,l.A)("common"),i=(0,k.useRouter)(),{language:o,country:c}=(0,f.JK)(i),{cart:y,isLoading:v,formattedMinimumOrder:I,removeRabattCode:S,recalculateCart:A}=(0,x._$)(),{minimumOrderValueCentAmount:D,showSpecialPriceAlert:F}=(0,N.A)(),{isPL:q}=(0,w.D)(),P=[{label:"Home",href:`/${o}/${(0,f.$9)(c)}`},{label:t("cartLabel")}],{customer:O}=(0,x.cN)(),U=!!F&&!O?.id,{data:K}=(0,T.Ay)(y?.id?`/api/commercetools/cart/get-low-stock-warning?cartId=${y.id}`:null,{refreshInterval:1e4}),B=K?.success?K.lowStockItems:[],M=K?.success?K.lowButBackorderAllowed:[],W=B?.filter(e=>!M.includes(e)),H=(0,R.m)({initialValues:x.XE}),J=(0,E.useMemo)(()=>y?.lineItems?.map(e=>e.variant.sku).filter(Boolean),[y?.lineItems]),{data:Q,isLoading:X}=(0,h.v)(J,void 0,J?.length>0),Z="pending"===i.query.ieVerification,Y="1"===i.query.nipNotEligible;(0,E.useEffect)(()=>{y?.lineItems?.length&&A()},[y?.id]);let ee={seo:{title:t("seo:cartTitle"),description:t("seo:cartDescription"),canonicalUrl:`${(0,b.$_)()}/${o}/${(0,f.$9)(c)}/cart`,hreflang:{currentUrl:`${(0,b.$_)()}/${o}/${(0,f.$9)(c)}/cart`,languageSlugs:{en:"/cart",de:"/cart",ru:"/cart",ja:"/cart",pt:"/cart",fr:"/cart",es:"/cart"}},robots:{noFollow:!0,noIndex:!0}}},et=(0,b.cp)(ee);return v?(0,a.jsx)($.a,{mt:"2rem",mx:"auto"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V(),{children:(0,a.jsx)(a.Fragment,{children:et})}),(0,a.jsx)(x.Qp,{items:P,baseUrl:(0,b.$_)()}),Z&&(0,a.jsx)(r.F,{color:"yellow",icon:(0,a.jsx)(n.He,{}),mb:"md",children:t("ieVerificationPendingMessage")}),Y&&(0,a.jsx)(r.F,{color:"yellow",icon:(0,a.jsx)(n.He,{}),mb:"md",children:t("nipCheckoutBlockedMessage")}),(0,a.jsxs)(_.x,{mih:300,children:[(0,a.jsxs)(_.x.Col,{span:12,md:8,children:[(0,a.jsx)("h2",{className:"uppercase font-medium",children:t("cartLabel")}),(0,a.jsx)(m.F,{}),U&&(0,a.jsx)(j.A,{show:!0,fullWidth:!0}),(0,a.jsx)(d,{showUnavailableItems:W.length>0,showPriceChanges:y?.custom?.fields?.priceChanged,unavailableItemsCount:W.length,priceChangesCount:y?.custom?.fields?.priceChangedCount||0}),y?.lineItems?.length?(0,a.jsxs)(u.N,{data:Q,isLoading:X,children:[(0,a.jsx)("table",{className:"hidden md:table table-auto border-collapse w-full","data-cy":"cart-table",children:(0,a.jsx)("tbody",{children:y?.lineItems?.map(t=>{let i=e.find(e=>e.sku.includes(t.variant.sku));return(0,a.jsx)(p.A,{variantSku:t.variant.sku,productId:t.productId||"",children:(0,a.jsx)(G,{item:t,customVariantData:i,lowStock:!!B?.length&&B.includes(t.variant.sku),customer:O})},t.id)})})}),(0,a.jsx)("div",{className:"md:hidden","data-cy":"cart-table",children:y?.lineItems?.map(t=>{let i=e.find(e=>e.sku.includes(t.variant.sku));return(0,a.jsx)(p.A,{variantSku:t.variant.sku,productId:t.productId||"",children:(0,a.jsx)(G,{item:t,customVariantData:i,lowStock:!!B?.length&&B.includes(t.variant.sku),customer:O})},t.id)})})]}):(0,a.jsx)(s.E,{pt:"md",children:t("cartNoArticleLabel")})]}),y?(0,a.jsxs)(_.x.Col,{span:12,md:4,mb:"sm",children:[(0,a.jsx)(g.sK,{data:y,removeRabattCodeCallback:S}),(0,a.jsx)("div",{className:"my-6",children:(0,a.jsx)(x.E8,{form:H,children:(0,a.jsx)(x.K1,{hideLabels:!0,removePadding:!0})})}),q&&(0,a.jsx)(C,{}),(0,a.jsx)(x.LZ,{lowStockData:K??null,fullWidth:!0,className:"w-full bg-sargreen-500 hover:bg-sargreen-700","data-cy":"begin-checkout","data-testid":"checkout-button"}),(0,a.jsx)(L,{fullWidth:!0,className:"mt-3"}),D>0&&(0,a.jsx)(r.F,{style:{backgroundColor:"var(--mantine-color-gray-1)",borderRadius:0,minHeight:30,display:"flex",alignItems:"center",justifyContent:"center"},color:"gray",children:(0,a.jsxs)(z.s,{gap:"xs",align:"center",justify:"center",children:[(0,a.jsx)(n.He,{color:"var(--mantine-color-gray-6)"}),(0,a.jsx)(s.E,{style:{fontSize:"0.9em",marginTop:-2},children:t("minimumOrderTitle",{amount:I})})]})})]}):null]})]})}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=50577)),_N_E=e.O()}]);
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.