1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[37],{24978:(e,a,s)=>{"use strict";s.d(a,{A:()=>t});var l=s(26514);let t=({...e})=>(0,l.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",...e,children:[(0,l.jsx)("path",{d:"M19 12H5",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M12 19L5 12L12 5",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},29782:e=>{e.exports={root:"PromotionProduct_root__oB1Om",sidebar:"PromotionProduct_sidebar__Elgje"}},79612:(e,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>z});var l=s(26514),t=s(11280),i=s(24978),r=s(36934),o=s(58201),n=s(36559),d=s(57507),c=s(25300),x=s(25750),m=s(95822),h=s(99576),p=s(67300),u=s(34889),v=s(49255),b=s(97246),g=s(32465),f=s(38077),j=s(62618),N=s(77569),w=s.n(N),y=s(58245),k=s.n(y),C=s(96456),L=s.n(C),S=s(75834),_=s(29782),A=s.n(_);let E=({products:e})=>{let{promotionTag:a,promotionProductHandle:s,setPromotionProductHandle:t,setSidebarView:i}=(0,o.mL)(),[r,n]=(0,S.useState)(0),[N,y]=(0,S.useState)({}),[C,_]=(0,S.useState)(!1),E=(0,b.A)(),{data:z}=(0,g.A)(),R=e?.filter(e=>e?.slug===s)?.[0]||null;if((0,S.useEffect)(()=>{let e=R?.variants.filter(e=>!0===e.availableForSale);e?.length===0?R?.variants[0].options?.forEach(e=>{y(a=>({...a,[e.displayName.toLowerCase()]:e.values[0].label.toLowerCase()}))}):e?.[0].options?.forEach(e=>{"Colour"===e.displayName&&y(a=>({...a,[e.displayName.toLowerCase()]:e.values[0].label.toLowerCase()})),"Size"===e.displayName&&e.values&&1==e.values.length&&y(a=>({...a,[e.displayName.toLowerCase()]:e.values[0].label.toLowerCase()}))})},[R?.variants]),!R)return(0,l.jsx)(l.Fragment,{});let B=R?.metafields.find(e=>"SKU__code"===e.key),F=R?.tags?.find(e=>e.startsWith("style:")),I=R?.images.length===0?[{url:"/product-img-placeholder.svg",alt:"Totally workwear"}]:R?.images,P=R?.metafields.find(e=>"colour_siblings"===e.key)?.value?JSON.parse(R?.metafields.find(e=>"colour_siblings"===e.key).value):[],O=(0,j.Uc)(R?.tags),$=(0,p.I)(R,N),T=R?.variants.filter(e=>!0===e.availableForSale),G=z?.lineItems.filter(e=>e.customAttributes?.some(e=>e.key===`_${a}`)),M=G?.filter(e=>e.path===R?.slug)?.reduce((e,a)=>e+a.quantity,0)??0,W=Math.max(Math.floor((z?.lineItems?.filter(e=>e.customAttributes?.some(e=>e.value===a))?.reduce((e,a)=>e+a.quantity,0)??0)/1)-M,1),q=P.sort((e,a)=>e.colour_code.toLowerCase()<a.colour_code.toLowerCase()?-1:+(a.colour_code.toLowerCase()>e.colour_code.toLowerCase())),H=async()=>{if($?.availableForSale){_(!0);try{await E({variables:(0,f.Np)({variantId:String($?$.id:R.variants[0].id),quantity:W,attributes:[{key:`_${a}`,value:s}]})}),i("CART_VIEW"),_(!1)}catch(e){_(!1)}}};return(0,l.jsx)(u.A,{className:"wrapper lg:px-24 pb-48",clean:!0,children:(0,l.jsxs)("div",{className:w()(A().root,"fit"),children:[(0,l.jsxs)("div",{className:"",children:[(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsx)(h.A,{name:R?.vendor}),B&&(0,l.jsx)("p",{className:"text-13 leading-20 text-darkGrey font-sans pt-10",children:`SKU ${B.value}`}),F&&(0,l.jsx)("div",{className:"flex items-end pb-20",children:(0,l.jsx)("p",{className:"text-12 text-darkGrey font-sean leading-16",children:F?.replace("style:","Item No: ")})})]}),(0,l.jsx)("div",{children:(0,l.jsx)("h3",{className:"text-24 font-klavikaB mb-3",children:R?.name})})]}),(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)(c.A,{tags:R?.tags,images:I,children:I?.map((e,a)=>(0,l.jsx)("div",{},e.url))},R?.id)})}),(0,l.jsxs)("div",{className:w()(A().sidebar),children:[(0,l.jsx)("section",{children:R?.options?.map(e=>(0,l.jsxs)("div",{className:"pt-24 laptop:pt-32",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsxs)("h6",{className:"text-14 text-subdued leading-16 font-klavikaM uppercase",children:[`${e.displayName}`,(0,l.jsx)("span",{className:"label-bold pl-12",children:"Colour"===e.displayName?e?.values[0]?.label:"Size"===e.displayName?N?.size?N?.size:"*Please select":null})]}
1),"Size"===e.displayName&&(0,l.jsxs)(L(),{href:{pathname:"/pages/[handle]",query:{handle:"sizecharts"}},passHref:!0,className:"flex gap-x-4 items-center",target:"_blank",rel:"noreferrer",children:[(0,l.jsx)(d.A,{}),(0,l.jsx)("h6",{className:"label-bold",children:"Size Guide"})]})]}),(0,l.jsx)("div",{className:"my-12",children:(0,l.jsxs)("div",{className:"flex flex-wrap w-full gap-y-8 gap-x-8 laptop:gap-x-6 swatchScrollHidden",children:["Colour"!==e.displayName&&e.values.map((a,s)=>{let t=N[e.displayName.toLowerCase()];return(0,l.jsx)(x.A,{sizeOptions:R?.options,sizeTypes:O,selectedSizeType:r,tags:R?.tags,sizeAvailable:T,sortedProductImages:q,productSlug:R?.slug,active:a.label.toLowerCase()===t,variant:e.displayName,color:a.hexColors?a.hexColors[0]:"",label:a.label,onClick:()=>{y(s=>({...s,[e.displayName.toLowerCase()]:a.label.toLowerCase()}))}},`${e.id}-${s}`)}),"Colour"===e.displayName&&q&&q?.map((e,a)=>(0,l.jsx)("button",{onClick:()=>t(e?.handle),"aria-label":"Variant Swatch",className:w()("hover:border-b-2 hover:border-darkestGrey",{"border-b-2 border-white":e.handle!==R?.slug,"border-b-2 border-darkestGrey":e.handle==R?.slug}),children:(0,l.jsx)(k(),{src:e.image,alt:"Product Image",width:64,height:64,style:{objectFit:"contain"}})},a))]})})]},e.displayName))}),(0,l.jsx)("div",{className:w()("text-24 text-secondary leading-32 font-bold font-sans inline-block tracking-wide pt-32"),children:"FREE"}),(0,l.jsxs)("div",{className:"text-disabled text-13 leading-20 font-bold",children:["Regular $",$?.price?.toFixed(2)]}),(0,l.jsx)("div",{className:"pt-16",children:(0,l.jsx)(v.A,{"aria-label":"Add to Cart",type:"button",onClick:H,loading:C,loaderHeight:"14",disabled:!N?.size||C||!$?.availableForSale,width:"100%",variant:C?"outline":"primary",children:N?.size?$?.availableForSale?"Confirm":"Out of stock":"Please select a size"})}),(0,l.jsx)("div",{className:"border-t border-uiLightGrey pb-16 mt-32"}),(0,l.jsx)(m.A,{product:R})]})]})})},z=({onClose:e})=>{let{setSidebarView:a,promotionTag:s,setPromotionProductHandle:d}=(0,o.mL)(),c=(0,n.PS)([s]),x=c?.promotionProducts;return(0,l.jsxs)(t.A,{handleClose:e,children:[(0,l.jsxs)("div",{className:"h-56 px-24 flex items-center sticky top-0 z-50 bg-white",children:[(0,l.jsx)(i.A,{className:"text-bodyBlack mr-auto cursor-pointer",onClick:()=>a("CART_VIEW")}),(0,l.jsx)(r.A,{className:"text-bodyBlack ml-auto cursor-pointer",onClick:e})]}),(0,l.jsx)("div",{className:"h-28 px-24 text-center text-16 leading-28 font-klavikaB font-bold",children:"SELECT SIZE"}),(0,l.jsx)(E,{products:x,onChangeColour:d})]})}},98098:(e,a,s)=>{"use strict";s.d(a,{A:()=>d});var l=s(26514),t=s(80465),i=s(87125),r=s.n(i),o=s(58245),n=s.n(o);let d=({tags:e=[],showCount:a=1,alignment:s="left",choices:i})=>{let o=[];r()(e)?o=e:e.badge&&(o=e.badge,r()(o)||(o=[o]),o=o.map(e=>"badge:"+e));let d=(0,t.no)(o),c=["new","sale","hot-price","hot-deal","exclusive"];return d?.length!=0?(0,l.jsx)("div",{className:`absolute top-0 flex flex-row gap-4 ${s}-0 z-10`,children:d?.slice(0,a).map((e,a)=>c.includes(e)?(0,l.jsx)("div",{className:"relative w-104 h-28",children:(0,l.jsx)(n(),{fill:!0,src:`/icons/badge-${e}.svg`,alt:e,className:"object-fill"})},a):"free-gift"==e?(0,l.jsx)("div",{className:"relative min-w-104 h-28 bg-disabledV2 px-15 flex items-center justify-center",children:(0,l.jsx)("div",{className:"text-white font-klavikaB text-13 leading-20 uppercase text-center align-middle whitespace-nowrap",children:"Free Gift"})},a):"in-store-only"===e.toLowerCase()?(0,l.jsx)("div",{className:"relative min-w-104 h-28 bg-secondary px-15 flex items-center justify-center",children:(0,l.jsx)("div",{className:"text-white font-klavikaB text-13 leading-20 uppercase text-center align-middle whitespace-nowrap",children:"IN-STORE ONLY"})},a):"PRE-ORDER"==e||"BACK-ORDER"==e||"CUSTOM-ORDER"==e?(0,l.jsx)(l.Fragment,{children:i?.size&&(0,l.jsx)("div",{className:"relative min-w-104 h-28 bg-black px-15 flex items-center justify-center",children:(0,l.jsx)("div",{className:"text-white font-klavikaB text-13 leading-20 uppercase text-center align-middle whitespace-nowrap",children:e})},a)}):(0,l.jsx)("div",{className:"relative min-w-104 h-28 bg-secondary px-15 flex items-center justify-center",children:(0,l.jsx)("div",{className:"text-white font-klavikaB text-13 leading-20 uppercase text-center align-middle whitespace-nowrap",children:e.replaceAll("-"," ")})},a))}):null}}}]);
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.