"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[32],{125:(e,n,t)=>{t.d(n,{a:()=>N});var o=t(0),i=t(3),a=t(25),l=t(4),s=t(83),r=t(162),d=t(58);function c({groupColorsByOptionName:e=!1,newColorSectionName:n,coreColorSectionName:t,sizeGuideCodeBasedFlag:c=!1,defaultSizeGuideOptionName:u="",product:p,selectedVariant:v,setSelectedVariantId:U,compact:m=!1,productApp:f}){var S;const O=null==f?void 0:f.product.value,b=null==f?void 0:f.selectedVariant.value,{getOptionNameForColor:g,getHexForOptionColor:h}=(0,l.d)((e=>({getOptionNameForColor:e.getOptionNameForColor,getHexForOptionColor:e.getHexForOptionColor}))),K=null!=p?p:O,x=null!=v?v:b,C=null!=U?U:e=>{e&&f&&f.setSelectedVariantId({variantId:e})},j=(0,r.b)({product:K,newColorSectionName:n,coreColorSectionName:t,clearanceColors:null===(S=null==f?void 0:f.product.value)||void 0===S?void 0:S.clearanceColors,getOptionNameForColor:e?g:()=>{}});if(!K||!j)return(0,o.jsx)(i.Fragment,{});const E="sizeGuide"in K?K.sizeGuide:void 0;return(0,o.jsx)("div",{class:a.a.container,children:j.map((e=>{var n;return(0,o.jsx)(s.a,{product:K,option:e,getHexForOptionColor:h,selectedVariant:x,findProductVariantWithOption:e=>{var n,t,o,i;return null!==(o=null===(t=null==f?void 0:(n=f.findProductVariantWithOption).value)||void 0===t?void 0:t.call(n,e,K,x))&&void 0!==o?o:(0,d.a)({option:e,variants:K.variants,currentOptions:null!==(i=null==x?void 0:x.selectedOptions)&&void 0!==i?i:{},fallbackVariant:x})},setSelectedVariantId:C,sizeGuide:E,sizeGuideCodeBasedFlag:c,defaultSizeGuideOptionName:u,compact:m,productApp:f},`${K.handle}-${null!==(n=e.optionName)&&void 0!==n?n:e.name}`)}))})}var u=t(2),p=t(50),v=t(1),U=t(133);let m=0;function f(e,n){const t=S[`${e} (${n})`];if(!t)return e;for(const e of t.split(" / "))if(e.includes("US"))return e.split(" (")[0];return e}const S={"DD (US)":"DD (US,UK) / E (EU)","E (US)":"DD (US,UK) / E (EU)","DD (UK)":"DD (US,UK) / E (EU)","E (EU)":"DD (US,UK) / E (EU)","DDD (US)":"DDD (US) / E (UK) / F (EU)","F (US)":"DDD (US) / E (UK) / F (EU)","E (UK)":"DDD (US) / E (UK) / F (EU)","F (EU)":"DDD (US) / E (UK) / F (EU)","G (US)":"G (US,EU) / F (UK)","G (EU)":"G (US,EU) / F (UK)","F (UK)":"G (US,EU) / F (UK)","H (US)":"H (US,EU) / FF (UK)","FF (US)":"H (US,EU) / FF (UK)","H (EU)":"H (US,EU) / FF (UK)","FF (UK)":"H (US,EU) / FF (UK)","I (US)":"I (US,EU) / G (UK)","I (EU)":"I (US,EU) / G (UK)","G (UK)":"I (US,EU) / G (UK)","J (US)":"J (US,EU) / GG (UK)","GG (US)":"J (US,EU) / GG (UK)","J (EU)":"J (US,EU) / GG (UK)","GG (UK)":"J (US,EU) / GG (UK)","K (US)":"K (US,EU) / H (UK)","K (EU)":"K (US,EU) / H (UK)","H (UK)":"K (US,EU) / H (UK)","L (US)":"L (US,EU) / HH (UK)","L (EU)":"L (US,EU) / HH (UK)","HH (UK)":"L (US,EU) / HH (UK)","M (US)":"M (US,EU) / J (UK)","M (EU)":"M (US,EU) / J (UK)","J (UK)":"M (US,EU) / J (UK)","N (US)":"N (US,EU) / JJ (UK)","N (EU)":"N (US,EU) / JJ (UK)","JJ (UK)":"N (US,EU) / JJ (UK)","O (US)":"O (US,EU) / K (UK)","O (EU)":"O (US,EU) / K (UK)","K (UK)":"O (US,EU) / K (UK)","P (US)":"P (US,EU) / KK (UK)","KK (US)":"P (US,EU) / KK (UK)","P (EU)":"P (US,EU) / KK (UK)","KK (UK)":"P (US,EU) / KK (UK)","Q (US)":"Q (US,EU) / L (UK)","Q (EU)":"Q (US,EU) / L (UK)","L (UK)":"Q (US,EU) / L (UK)","R (US)":"R (US, EU)/LL (UK)","R (EU)":"R (US, EU)/LL (UK)","LL (UK)":"R (US, EU)/LL (UK)"};function O({option:e,displayedOptions:n,fieldsetName:t,placeholder:a,isUnselectedSize:s,isVariantUnavailable:r}){var d,c,S,O,g,h;const K=(0,l.d)((e=>e.device)),[x,C]=(0,u.useState)(!1),j=n.find((e=>e.isSelected)),E=null==j?void 0:j.value,N=r||j&&!j.availableForSale&&!s,z=null!==(d=null!=a?a:e.optionName)&&void 0!==d?d:e.name,y=s?z:null!=E?E:z,F=e.sizing,w=e.name.toLowerCase().includes("cup"),V=!!F&&"US"!==F&&w,k=(0,u.useMemo)((()=>n.map((e=>({id:e.value,textValue:e.value,optionRef:e})))),[n]),D=e=>{var n;e.setSelectedVariantId(null===(n=e.variant)||void 0===n?void 0:n.variantId)},G=(0,u.useRef)(null),I=(0,u.useRef)(null),L=(0,u.useRef)(null),H=function(e){const{items:n,selectedKey:t,defaultSelectedKey:o,onSelectionChange:i,isOpen:a,defaultOpen:l=!1,onOpenChange:s,disabledKeys:r=new Set}=e,[d,c]=(0,u.useState)(l),p=null!=a?a:d,[v,U]=(0,u.useState)(null!=o?o:null),m=null!=t?t:v,[f,S]=(0,u.useState)(null),[O,b]=(0,u.useState)(null),g=(0,u.useMemo)((()=>n.filter((e=>!e.disabled&&!r.has(e.id)))),[n,r]),h=(0,u.useCallback)((e=>{void 0===a&&c(e),null==s||s(e),e||S(null)}),[a,s]),K=(0,u.useCallback)((e=>{void 0===t&&U(e),null==i||i(e)}),[t,i]),x=(0,u.useCallback)((e=>{S(e)}),[]),C=(0,u.useCallback)((()=>{h(!1),b(null)}),[h]),j=(0,u.useCallback)(((e=null)=>{0!==n.length&&(b(e),h(!0),m&&g.some((e=>e.id===m))?S(m):"first"===e&&g.length>0?S(g[0].id):"last"===e&&g.length>0&&S(g[g.length-1].id))}),[n.length,g,m,h]),E=(0,u.useCallback)(((e=null)=>{p?C():j(e)}),[p,j,C]),N=(0,u.useCallback)((()=>{g.length>0&&S(g[0].id)}),[g]),z=(0,u.useCallback)((()=>{g.length>0&&S(g[g.length-1].id)}),[g]),y=(0,u.useCallback)((()=>{if(0===g.length)return;const e=(f?g.findIndex((e=>e.id===f)):-1)+1;S(e{if(0===g.length)return;const e=(f?g.findIndex((e=>e.id===f)):g.length)-1;S(e>=0?g[e].id:g[g.length-1].id)}),[g,f]),w=(0,u.useMemo)((()=>{var e;return null!==(e=n.find((e=>e.id===m)))&&void 0!==e?e:null}),[n,m]);return{isOpen:p,selectedKey:m,focusedKey:f,focusStrategy:O,items:n,selectedItem:w,open:j,close:C,toggle:E,setSelectedKey:K,setFocusedKey:x,focusFirst:N,focusLast:z,focusNext:y,focusPrevious:F}}({items:k,selectedKey:s?null:null!=E?E:null,onSelectionChange:e=>{if(null==e)return;const n=k.find((n=>n.id===e));n&&D(n.optionRef)}}),{triggerProps:P,valueProps:B,listBoxProps:M,getOptionProps:$}=function(e,n){const{triggerRef:t,popoverRef:o,listBoxRef:i,isDisabled:a=!1,"aria-label":l,"aria-labelledby":s}=e,r=(0,u.useMemo)((()=>"select-"+ ++m),[]),d=`${r}-label`,c=`${r}-trigger`,p=`${r}-value`,v=`${r}-listbox`,U=e=>`${r}-option-${e}`,f=(0,u.useRef)(""),S=(0,u.useRef)(null),O=(0,u.useCallback)((e=>{f.current+=e.toLowerCase(),S.current&&clearTimeout(S.current),S.current=setTimeout((()=>{f.current=""}),500);const t=f.current,o=n.items.filter((e=>!e.disabled)).find((e=>e.textValue.toLowerCase().startsWith(t)));o&&(n.isOpen?n.setFocusedKey(o.id):n.setSelectedKey(o.id))}),[n]),b=(0,u.useCallback)((e=>{var o,i;if(!a)switch(e.key){case"ArrowDown":e.preventDefault(),n.isOpen?n.focusNext():n.open("first");break;case"ArrowUp":e.preventDefault(),n.isOpen?n.focusPrevious():n.open("last");break;case"Home":n.isOpen&&(e.preventDefault(),n.focusFirst());break;case"End":n.isOpen&&(e.preventDefault(),n.focusLast());break;case"Enter":case" ":e.preventDefault(),n.isOpen?null!=n.focusedKey&&(n.setSelectedKey(n.focusedKey),n.close(),null===(o=t.current)||void 0===o||o.focus()):n.open();break;case"Escape":n.isOpen&&(e.preventDefault(),e.stopPropagation(),n.close(),null===(i=t.current)||void 0===i||i.focus());break;case"Tab":n.isOpen&&n.close();break;default:1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||!/\S/.test(e.key)||O(e.key)}}),[a,n,t,O]),g=(0,u.useCallback)((e=>{var o;a||(e.preventDefault(),n.toggle(),null===(o=t.current)||void 0===o||o.focus())}),[a,n,t]),h=(0,u.useCallback)((e=>{var t;const i=e.relatedTarget;i&&(null===(t=o.current)||void 0===t?void 0:t.contains(i))||n.isOpen&&n.close()}),[n,o]);(0,u.useEffect)((()=>{if(!n.isOpen)return;const e=e=>{var i,a;const l=e.target;(null===(i=t.current)||void 0===i?void 0:i.contains(l))||(null===(a=o.current)||void 0===a?void 0:a.contains(l))||n.close()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[n.isOpen,n,t,o]),(0,u.useEffect)((()=>{if(n.focusedKey&&i.current){const e=i.current.querySelector(`[data-key="${CSS.escape(n.focusedKey)}"]`);null==e||e.scrollIntoView({block:"nearest"})}}),[n.focusedKey,i]),(0,u.useEffect)((()=>()=>{S.current&&clearTimeout(S.current)}),[]);const K=n.focusedKey?U(n.focusedKey):void 0;return{labelProps:{id:d,htmlFor:c},triggerProps:{id:c,role:"combobox","aria-haspopup":"listbox","aria-expanded":n.isOpen,"aria-controls":n.isOpen?v:void 0,"aria-activedescendant":K,"aria-labelledby":null!=s?s:l?`${c} ${p}`:`${d} ${p}`,"aria-label":l,disabled:a,tabIndex:0,onClick:g,onKeyDown:b,onBlur:h},valueProps:{id:p},listBoxProps:{id:v,role:"listbox","aria-labelledby":null!=s?s:d,tabIndex:-1},getOptionProps:(e,o)=>({id:U(e.id),role:"option","aria-selected":e.id===n.selectedKey,"aria-disabled":e.disabled||void 0,"data-focused":e.id===n.focusedKey,"data-key":e.id,onClick:o=>{var i;e.disabled||(o.preventDefault(),n.setSelectedKey(e.id),n.close(),null===(i=t.current)||void 0===i||i.focus())},onMouseEnter:()=>{e.disabled||n.setFocusedKey(e.id)},onMouseDown:e=>{e.preventDefault()}})}}({triggerRef:G,popoverRef:I,listBoxRef:L},H),R=e=>V?(0,o.jsxs)(i.Fragment,{children:[(0,o.jsx)("span",{children:e.value}),(0,o.jsx)("span",{className:p.a.usEquivalent,children:f(e.value,F)})]}):e.value,A=e=>[p.a.dropdownOption,V?p.a.dropdownOptionRow:"",e.isSelected&&!s?p.a.dropdownOptionSelected:"",e.availableForSale?"":p.a.dropdownOptionUnavailable].filter(Boolean).join(" ");return(0,o.jsxs)(i.Fragment,{children:[(0,o.jsxs)("div",{className:p.a.dropdownContainerDesktop,children:[(0,o.jsxs)("button",Object.assign({},P,{ref:G,type:"button",className:[p.a.dropdownTrigger,!E||s?p.a.placeholder:"",N?p.a.dropdownTriggerUnavailable:""].filter(Boolean).join(" "),children:[(0,o.jsx)("span",Object.assign({},B,{className:p.a.dropdownTriggerText,children:y})),(0,o.jsx)(b,{className:H.isOpen?p.a.chevronUp:""})]})),H.isOpen&&(0,o.jsxs)("div",{ref:I,className:p.a.dropdownPanel,children:[V&&(0,o.jsxs)("div",{className:p.a.dropdownColumnHeader,children:[(0,o.jsx)("span",{children:F}),(0,o.jsx)("span",{children:"US"})]}),(0,o.jsx)("ul",Object.assign({},M,{ref:L,className:p.a.dropdownOptions,children:k.map(((e,n)=>{const t=e.optionRef,o=$(e,n);return(0,i.createElement)("li",Object.assign({},o,{key:e.id,className:A(t)}),R(t))}))}))]}),(0,o.jsx)("input",{type:"hidden",name:t,value:null!==(S=null===(c=null==j?void 0:j.variant)||void 0===c?void 0:c.variantId)&&void 0!==S?S:""})]}),(0,o.jsxs)("div",{className:p.a.dropdownContainerMobile,children:[(0,o.jsxs)("button",{type:"button",className:[p.a.dropdownTrigger,!E||s?p.a.placeholder:"",N?p.a.dropdownTriggerUnavailable:""].filter(Boolean).join(" "),onClick:()=>{"desktop"!==K&&C(!x)},"aria-haspopup":"listbox","aria-expanded":x,children:[(0,o.jsx)("span",{className:p.a.dropdownTriggerText,children:y}),(0,o.jsx)(b,{className:x?p.a.chevronUp:""})]}),(0,o.jsx)(U.a,{isOpen:x,onClose:()=>C(!1),title:`Select ${null!==(O=e.optionName)&&void 0!==O?O:e.name}`,children:(0,o.jsxs)("div",{className:p.a.dropdownOptions,children:[V&&(0,o.jsxs)("div",{className:p.a.dropdownColumnHeader,children:[(0,o.jsx)("span",{children:F}),(0,o.jsx)("span",{children:"US"})]}),n.map((e=>(0,o.jsx)("button",{type:"button",className:A(e),onClick:()=>(e=>{D(e),"stayOpen"!==(0,v.getAssignment)(`${K}_sizeDropdownSelect`)&&C(!1)})(e),role:"option","aria-selected":e.isSelected&&!s,children:R(e)},e.value)))]})}),(0,o.jsx)("input",{type:"hidden",name:t,value:null!==(h=null===(g=null==j?void 0:j.variant)||void 0===g?void 0:g.variantId)&&void 0!==h?h:""})]})]})}function b({className:e}){return(0,o.jsx)("svg",{className:[p.a.chevronIcon,e].filter(Boolean).join(" "),width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var g=t(206),h=t(42);function K({product:e,sizeOptions:n,selectedVariant:t,setSelectedVariantId:i,sizeGuide:a,sizeGuideCodeBasedData:l,sizeGuideId:s,combinedSizeOptions:r,productApp:d}){var c;const u=r&&r.length>0&&r.every((e=>n.some((n=>n.name.toLowerCase()===e.toLowerCase())))),v=null===(c=n.find((e=>e.sizing)))||void 0===c?void 0:c.sizing,U=!!v&&"US"!==v;return(0,o.jsxs)("fieldset",{className:p.a.sizeSection,children:[(0,o.jsxs)("legend",{className:p.a.visuallyHidden,children:[e.title," Size Selection"]}),(0,o.jsxs)("div",{className:p.a.sizeHeader,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:p.a.sizeLabel,children:"Size"}),U&&(0,o.jsxs)("span",{className:p.a.sizingSubtext,children:["This product is sold in ",v," sizes"]})]}),(0,o.jsx)(g.a,{sizeGuide:a,sizeGuideCodeBasedData:l,sizeGuideId:s})]}),(0,o.jsx)("div",{className:p.a.sizeDropdowns,children:u?(0,o.jsx)(C,{product:e,combinedOptionNames:r,sizeOptions:n,selectedVariant:t,setSelectedVariantId:i,productApp:d}):n.map(((a,l)=>(0,o.jsx)(x,{product:e,option:a,selectedVariant:t,precedingOptions:n.slice(0,l),allOtherOptions:n.filter(((e,n)=>n!==l)),setSelectedVariantId:i,productApp:d},a.name)))})]})}function x({product:e,option:n,selectedVariant:t,precedingOptions:a,allOtherOptions:l,setSelectedVariantId:s,productApp:r}){var d,c,p,v;const U=r?(e,n)=>{var t;if(n){const o=null===(t=n.mappedSizes)||void 0===t?void 0:t[e],i=1===(null==o?void 0:o.length)?o[0]:n.selectedOptions[e];r.selectOption({optionName:e,value:i})}}:void 0,m=null!==(d=null==r?void 0:r.selectedOptions.value)&&void 0!==d?d:{},f=null!==(c=null==r?void 0:r.defaultUnselected.value)&&void 0!==c&&c,S=(0,h.a)(r,t,n.name),b=null!==(p=null==t?void 0:t.selectedOptions[n.name])&&void 0!==p?p:null===(v=null==t?void 0:t.displayOptions)||void 0===v?void 0:v[n.name],g=(0,u.useMemo)((()=>{const e={};for(const n of a){const o=null==t?void 0:t.selectedOptions[n.name];o&&(e[n.name]=o)}return e}),[a,null==t?void 0:t.selectedOptions]),K=(0,u.useMemo)((()=>{const e={};for(const n of l){const o=null==t?void 0:t.selectedOptions[n.name];o&&(e[n.name]=o)}return e}),[l,null==t?void 0:t.selectedOptions]),x=null==t?void 0:t.selectedOptions.Color,C=(0,u.useMemo)((()=>{const e={};for(const n of l){const o=null==t?void 0:t.selectedOptions[n.name];o&&(f&&void 0===m[n.name]||(e[n.name]=o))}return e}),[l,null==t?void 0:t.selectedOptions,f,m]),j=(0,u.useMemo)((()=>n.values.map((t=>{var o;const i=e.variants.find((e=>{if(e.selectedOptions[n.name]!==t)return!1;if(e.oos)return!1;for(const[n,t]of Object.entries(g))if(e.selectedOptions[n]!==t)return!1;return!0})),a=x?e.variants.find((e=>{if(e.selectedOptions[n.name]!==t)return!1;if(e.oos)return!1;for(const[n,t]of Object.entries(C))if(e.selectedOptions[n]!==t)return!1;return e.selectedOptions.Color===x})):i,l=e.variants.find((e=>{if(e.selectedOptions[n.name]!==t)return!1;for(const[n,t]of Object.entries(K))if(e.selectedOptions[n]!==t)return!1;return!x||e.selectedOptions.Color===x})),r=e.variants.find((e=>{if(e.selectedOptions[n.name]!==t)return!1;for(const[n,t]of Object.entries(K))if(e.selectedOptions[n]!==t)return!1;return!0})),d=null!==(o=null!=l?l:r)&&void 0!==o?o:i;return{value:t,variant:d,isSelected:b===t&&!S,matchesSelectedValue:b===t,availableForSale:!!a,setSelectedVariantId:e=>{null==U||U(n.name,d),l?s(l.variantId):r?s(r.variantId):i?s(i.variantId):d&&s(d.variantId)}}}))),[n.values,n.name,e.variants,b,g,K,C,x,S,U,s]),E=(0,u.useMemo)((()=>!(S||!x||!b||e.variants.some((e=>{if(e.selectedOptions[n.name]!==b)return!1;if(e.oos)return!1;for(const[n,t]of Object.entries(C))if(e.selectedOptions[n]!==t)return!1;return e.selectedOptions.Color===x})))),[S,x,b,e.variants,n.name,C]);if(0===j.length)return(0,o.jsx)(i.Fragment,{});const N=`${e.handle}-${n.name}`.replaceAll(" ","-");return(0,o.jsx)(O,{displayedOptions:j,option:n,fieldsetName:N,isUnselectedSize:S,isVariantUnavailable:E})}function C({product:e,combinedOptionNames:n,sizeOptions:t,selectedVariant:a,setSelectedVariantId:l,productApp:s}){var r;const d=s?(e,n)=>{var t;if(n){const o=null===(t=n.mappedSizes)||void 0===t?void 0:t[e],i=1===(null==o?void 0:o.length)?o[0]:n.selectedOptions[e];s.selectOption({optionName:e,value:i})}}:void 0,c=(0,h.a)(s,a),p=(0,u.useMemo)((()=>n.map((e=>t.find((n=>n.name.toLowerCase()===e.toLowerCase())))).filter((e=>!!e))),[n,t]),v=null===(r=p.find((e=>e.sizing)))||void 0===r?void 0:r.sizing,U=!!v&&"US"!==v,m=(0,u.useMemo)((()=>p.map((e=>{var n;return null!==(n=null==a?void 0:a.selectedOptions[e.name])&&void 0!==n?n:""})).join("")),[p,null==a?void 0:a.selectedOptions]),S=null==a?void 0:a.selectedOptions.Color,b=(0,u.useMemo)((()=>{const n=new Map;for(const t of e.variants){const e={};let o="";for(const n of p){const i=t.selectedOptions[n.name];i&&(e[n.name]=i,o+=i)}Object.keys(e).length===p.length&&(n.get(o)||t.unavailable||n.set(o,{combinedValue:o,optionValues:e,variant:t,availableForSale:!t.oos}))}const t=Array.from(n.values());return t.sort(((e,n)=>{for(const t of p){const o=t.values.indexOf(e.optionValues[t.name]),i=t.values.indexOf(n.optionValues[t.name]);if(o!==i)return o-i}return 0})),t.map((n=>{const t=m===n.combinedValue&&!c;let o=n.variant,i=n.availableForSale;if(S){const t=e.variants.find((e=>{for(const[t,o]of Object.entries(n.optionValues))if(e.selectedOptions[t]!==o)return!1;return e.selectedOptions.Color===S}));t?(o=t,i=!t.oos):i=!1}let a=n.combinedValue;if(U&&v){const e=p.map((e=>{const t=n.optionValues[e.name];return e.name.toLowerCase().includes("cup")?f(t,v):t})).join("");e!==n.combinedValue&&(a=`${n.combinedValue} (${e} US)`)}return{value:a,variant:o,isSelected:t,matchesSelectedValue:m===n.combinedValue,availableForSale:i,setSelectedVariantId:()=>{for(const e of Object.keys(n.optionValues))null==d||d(e,o);l(o.variantId)}}}))}),[e.variants,p,m,c,S,d,l]),g=(0,u.useMemo)((()=>{if(c||!S||!m)return!1;const e=b.find((e=>e.isSelected));return!!e&&!e.availableForSale}),[c,S,m,b]);if(0===b.length)return(0,o.jsx)(i.Fragment,{});const K={name:"Size",values:b.map((e=>e.value))},x=`${e.handle}-combined-size`.replaceAll(" ","-");return(0,o.jsx)(O,{displayedOptions:b,option:K,fieldsetName:x,isUnselectedSize:c,isVariantUnavailable:g})}function j({groupColorsByOptionName:e=!1,newColorSectionName:n,coreColorSectionName:t,sizeGuideCodeBasedFlag:c=!1,defaultSizeGuideOptionName:p="",combinedSizeOptions:v,product:U,selectedVariant:m,setSelectedVariantId:f,compact:S=!1,productApp:O}){var b;const g=null==O?void 0:O.product.value,h=null==O?void 0:O.selectedVariant.value,{getOptionNameForColor:x,getHexForOptionColor:C}=(0,l.d)((e=>({getOptionNameForColor:e.getOptionNameForColor,getHexForOptionColor:e.getHexForOptionColor}))),j=null!=U?U:g,E=null!=m?m:h,N=null==O?void 0:O.findProductVariantWithOption.value,z=null!=N?N:(e,n,t)=>{var o,i,a,l;return(0,d.a)({option:e,variants:null!==(i=null===(o=null!=n?n:j)||void 0===o?void 0:o.variants)&&void 0!==i?i:[],currentOptions:null!==(l=null===(a=null!=t?t:E)||void 0===a?void 0:a.selectedOptions)&&void 0!==l?l:{},fallbackVariant:null!=t?t:E})},y=null!=f?f:e=>{e&&O&&O.setSelectedVariantId({variantId:e})},F=(0,r.b)({product:j,newColorSectionName:n,coreColorSectionName:t,clearanceColors:null===(b=null==O?void 0:O.product.value)||void 0===b?void 0:b.clearanceColors,getOptionNameForColor:e?x:()=>{}}),{sizeOptions:w,nonSizeOptions:V}=(0,u.useMemo)((()=>F?{sizeOptions:F.filter((e=>e.name.toLowerCase().includes("size"))),nonSizeOptions:F.filter((e=>!e.name.toLowerCase().includes("size")))}:{sizeOptions:[],nonSizeOptions:[]}),[F]);if(!j||!F)return(0,o.jsx)(i.Fragment,{});const k="sizeGuide"in j?j.sizeGuide:void 0,D=c?j.sizeGuideCodeBasedData:void 0;return(0,o.jsxs)("div",{className:a.a.container,children:[w.length>0&&(0,o.jsx)(K,{product:j,sizeOptions:w,selectedVariant:E,findProductVariantWithOption:e=>z(e,j,E),setSelectedVariantId:y,sizeGuide:k,sizeGuideCodeBasedData:D,sizeGuideId:j.sizeGuideId,compact:S,combinedSizeOptions:v,productApp:O}),V.map((e=>{var n;return(0,o.jsx)(s.a,{product:j,option:e,getHexForOptionColor:C,selectedVariant:E,findProductVariantWithOption:e=>z(e,j,E),setSelectedVariantId:y,compact:S,productApp:O},`${j.handle}-${null!==(n=e.optionName)&&void 0!==n?n:e.name}`)}))]})}var E=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i{t.d(n,{a:()=>d});var o=t(0),i=t(2),a=t(15),l=t(86),s=t(131),r=t(204);function d({isOpen:e,onClose:n,children:t,title:d,showTitle:c=!1,size:u="default"}){const[p,v]=(0,i.useState)(!1),U=(0,i.useRef)(null),m=(0,i.useRef)(!1);(0,r.a)(e);const f=(0,i.useCallback)((()=>{m.current=!0,v(!0)}),[]),S=(0,i.useCallback)((e=>{m.current&&e.target===U.current&&(m.current=!1,v(!1),n())}),[n]),O=(0,i.useCallback)((()=>{f()}),[f]);return(0,o.jsx)(s.a,{isOpen:e,onEscape:f,children:(0,o.jsxs)("div",{className:a.a.modalOverlayBottomSheet,"aria-hidden":!e,children:[(0,o.jsx)("div",{className:a.a.modalBackground,onClick:O,role:"presentation"}),(0,o.jsxs)("div",{ref:U,"data-animate":!0,role:"dialog","aria-modal":!0,tabIndex:-1,"aria-label":d,className:[a.a.modalBottomSheet,p?a.a.closing:"","large"===u?a.a.large:""].join(" "),onAnimationEnd:S,children:[c?(0,o.jsxs)("div",{className:a.a.bottomSheetHeader,children:[(0,o.jsx)("h2",{className:a.a.bottomSheetTitle,children:d}),(0,o.jsx)("button",{className:a.a.bottomSheetCloseBtn,onClick:f,"aria-label":"Close dialog",children:(0,o.jsx)(l.a,{size:"16px",iconClass:a.a.closeIconSVG})})]}):(0,o.jsx)("button",{className:a.a.bottomSheetCloseBtnFloating,onClick:f,"aria-label":"Close dialog",children:(0,o.jsx)(l.a,{size:"20px",iconClass:a.a.closeIconSVG})}),(0,o.jsx)("div",{className:a.a.bottomSheetContent,children:t})]})]})})}}}]);