"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[36],{62:(e,a,t)=>{t.d(a,{a:()=>k});var r=t(0),i=t(36),n=t(1),o=t(7),l=t(67),s=t(3),c=t(75),d=t(65),p=t(39),u=t(13),h=t(28),m=t(4),v=t(63),x=t(51),g=t(6);function b({disruptor:e}){return"bite_disruptor"===e.type?(0,r.jsx)(f,{disruptor:e}):(0,r.jsx)(y,{disruptor:e})}function f({disruptor:e}){return e.biteHtml?(0,r.jsx)("div",{style:{display:"grid"},dangerouslySetInnerHTML:{__html:e.biteHtml}}):(0,r.jsx)(m.Fragment,{})}function y({disruptor:e}){var a;return(0,r.jsxs)("div",{class:v.a.card,style:{color:e.text_color},children:[(0,r.jsx)(j,{media:e.media}),(0,r.jsx)("div",{class:v.a.title,dangerouslySetInnerHTML:{__html:e.title}}),(0,r.jsx)("div",{class:v.a.body,dangerouslySetInnerHTML:{__html:null!==(a=e.body_text)&&void 0!==a?a:""}}),(0,r.jsx)(P,{disruptor:e})]})}function j({media:e}){var a,t;return"image"===e.type&&e.url?(0,r.jsx)(o.a,{src:(0,g.b)(e.url),alt:null!==(a=e.altText)&&void 0!==a?a:"",initialWidth:null!==(t=e.width)&&void 0!==t?t:400,cssClass:v.a.media}):"video"===e.type&&e.sources.length>0?(0,r.jsx)("div",{class:v.a.media,children:(0,r.jsx)(x.a,{sources:e.sources,className:v.a.mediaVideo})}):(0,r.jsx)(m.Fragment,{})}const _={primary:v.a.cta_primary,secondary:v.a.cta_secondary,tertiary:v.a.cta_tertiary};function P({disruptor:e}){var a;if(!e.cta_url||!e.cta_label||!e.cta_style)return(0,r.jsx)(m.Fragment,{});const t=null!==(a=_[e.cta_style])&&void 0!==a?a:v.a.cta_primary;return(0,r.jsx)("a",{href:e.cta_url,class:`${v.a.cta} ${t}`,children:e.cta_label})}var C=t(52),S=t(76),O=t(77),T=t(57),A=t(61),w=t(16);const I=300;function k({product:e,collectionHandle:a,replaceStateEnabled:t,initialVariantId:i,showSelectedOptions:n,productApp:o,authApp:l}){return(null==e?void 0:e.handle)?!("type"in(s=e))||"disruptor"!==s.type&&"bite_disruptor"!==s.type?(0,r.jsx)(V,{product:e,collectionHandle:a,replaceStateEnabled:t,initialVariantId:i,showSelectedOptions:n,productApp:o,authApp:l}):(0,r.jsx)(b,{disruptor:e}):null;var s}function V({product:e,collectionHandle:a,replaceStateEnabled:t,initialVariantId:m,showSelectedOptions:v,productApp:x,authApp:g}){var b;const{getHexForOptionColor:f,EXCLUDE_TAGS:y,promo_prefix_tag:j,product_image_height:_,product_image_width:P,disable_color_swatches:O,showVendor:k,cardPriceDisplay:V,soldOutBadgeText:M,onSaleBadgeText:D,preOrderBadgeText:F,quickshopButton:L,packModal:$}=(0,s.d)((e=>({getHexForOptionColor:e.getHexForOptionColor,EXCLUDE_TAGS:e.config.exclude_tags,promo_prefix_tag:e.config.promo_prefix_tag,product_image_width:e.config.product_image_width,product_image_height:e.config.product_image_height,disable_color_swatches:e.config.disable_color_swatches,showVendor:e.showVendor,cardPriceDisplay:e.cardPriceDisplay,soldOutBadgeText:e.soldOutBadgeText,onSaleBadgeText:e.onSaleBadgeText,preOrderBadgeText:e.preOrderBadgeText,quickshopButton:e.quickshopButton,packModal:e.packModal}))),E=!0===e.isPack,q=L&&"disabled"!==L&&(!E||$),R=e.options.find((e=>"Color"===e.name)),{pricePrefix:W,priceText:U,showCompareAtPrice:G,onSaleDataAttribute:K,compareAtPriceText:Q,priceClassName:X,ssrStyle:z}=function(e,a){var t,r;const{country:i,internationalPricing:o,dynamicCurrencyChange:l}=(0,s.d)((e=>({country:e.country,internationalPricing:e.internationalPricing,dynamicCurrencyChange:e.dynamicCurrencyChange}))),c=Boolean((0,A.d)(l,o)&&i&&"US"!==i),d=(0,n.useMemo)((()=>{const a=[e.handle];if(e.preorderSiblingHandle&&a.push(e.preorderSiblingHandle),e.combinedKey){const t=e.variants.map((e=>{var a;return null===(a=e.selectedOptions)||void 0===a?void 0:a.childProductHandle})).filter((e=>!!e));a.push(...t)}return[...new Set(a)]}),[e.handle,e.preorderSiblingHandle,e.combinedKey,e.variants]),{data:p,className:u,ssrStyle:h,isHydrated:m,isLoading:v}=(0,T.a)(d,c,i),x=c&&(!m||v),g=d.find((e=>{var a;return null===(a=p[e])||void 0===a?void 0:a.currency})),b=g&&null!==(r=null===(t=p[g])||void 0===t?void 0:t.currency)&&void 0!==r?r:"USD",f=(0,w.b)({currency:b});return(0,n.useMemo)((()=>{if(e.priceTextOverride)return{priceText:e.priceTextOverride,pricePrefix:"",showCompareAtPrice:!1,onSaleDataAttribute:{},compareAtPriceText:void 0,priceClassName:u,ssrStyle:h};if(x)return{priceText:"",pricePrefix:"",showCompareAtPrice:!1,onSaleDataAttribute:{},compareAtPriceText:void 0,priceClassName:u,ssrStyle:h};if(c&&Object.keys(p).length>0){const t=function(e,a,t,r,i,n,o){var l,s,c,d;const p=null!==(l=e.priceRange.variantIds)&&void 0!==l?l:[],u=[],h=[],m=[];for(const e of r){const a=null!==(c=null===(s=t[e])||void 0===s?void 0:s.variants)&&void 0!==c?c:[];for(const e of a)null!=e.price.amount&&h.push(e.price.amount),null!=(null===(d=e.compareAtPrice)||void 0===d?void 0:d.amount)&&m.push(e.compareAtPrice.amount),p.includes(e.id)&&null!=e.price.amount&&u.push(e.price.amount)}const v=u.length>0?u:h;if(0===v.length)return;const x=N(Math.min(...v),Math.max(...v),m.length>0?Math.max(...m):void 0,a,i);return Object.assign(Object.assign({},x),{priceClassName:n,ssrStyle:o})}(e,a,p,d,f,u,h);if(t)return t}const t=function(e,a,t){const{minPrice:r,maxPrice:i}=function(e){let{minPrice:a,maxPrice:t}=e.priceRange;if(null==a||Number.isNaN(a)){const r=e.variants.find((a=>a.variantId===e.defaultVariantId));r&&(a=parseFloat(r.price),t=a)}return{minPrice:a,maxPrice:t}}(e),n=N(r,i,e.compareAtRange.maxPrice,a,t);return Object.assign(Object.assign({},n),{priceClassName:"",ssrStyle:void 0})}(e,a,f);return c?Object.assign(Object.assign({},t),{priceClassName:u,ssrStyle:h}):t}),[c,e,a,p,d,f,x,u,h])}(e,V),J=null!=m?m:e.defaultVariantId,Y=e.variants.find((e=>e.variantId===J)),[Z,ee]=(0,n.useState)(null!=Y?Y:e.variants[0]),ae=(0,p.c)(e.imageMap,Z)[0],te=(0,h.b)(e,Z);if(!ae)return null;const re=(0,n.useMemo)((()=>{var a,t,r;const i=null!==(a=Z.badge)&&void 0!==a?a:e.badge;return"string"==typeof i?i:Z.oos&&Z.preorderVariant&&!Z.preorderVariant.oos?F||null:Z.oos&&!Z.preorderVariant?M||null:Z.compareAtPrice&&parseFloat(Z.price){a.preventDefault(),a.stopPropagation(),x.openQuickShop({products:[e],initialVariantId:Z.variantId})}})]}),(0,r.jsx)("a",{href:te,onClick:e=>{t&&(e.preventDefault(),location.replace(te))},class:i.a.link,"data-orly-type":a,"data-orly-handle":e.handle,children:(0,r.jsxs)("div",{class:i.a.textWrapper,children:[k&&(0,r.jsx)("div",{class:i.a.vendor,children:e.vendor}),v&&Z.selectedOptions&&(0,r.jsx)("span",{class:i.a.selectedOptions,children:Object.entries(Z.selectedOptions).filter((([e])=>"childProductHandle"!==e)).map((([,e])=>e)).join(" | ")}),(0,r.jsx)("div",{class:i.a.title,children:ne}),oe&&(0,r.jsx)("div",{class:i.a.subtitle,children:oe}),(0,r.jsx)(H,{labels:e.plpTagLabels}),(0,r.jsx)("div",{class:i.a.price,children:(0,r.jsx)("span",{class:X,style:z,children:(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{class:i.a.originalPrice,style:G&&Q?void 0:"visibility:hidden",children:Q})," ",W,(0,r.jsx)("span",Object.assign({},K,{children:U}))]})})}),(0,r.jsx)(S.a,{reviewCount:e.reviewCount,reviewRating:e.reviewRating,productId:e.id}),j&&e.plpPromoText&&(0,r.jsx)("div",{class:i.a.plpPromoText,children:e.plpPromoText})]})}),(0,r.jsx)(l.a,{appearance:"plp",product:e,selectedVariant:Z,authApp:g}),(0,r.jsx)("div",{class:i.a.colorSwatchContainer,children:!O&&R&&(0,r.jsx)(c.a,{product:e,small:!0,disableOosAttributes:!0,maxItems:12,hideLabel:!0,groupContext:"card",option:R,getHexForOptionColor:f,selectedVariant:Z,findProductVariantWithOption:a=>{var t;return(0,d.a)({option:a,variants:e.variants,currentOptions:null!==(t=null==Y?void 0:Y.selectedOptions)&&void 0!==t?t:{},fallbackVariant:Y})},setSelectedVariantId:a=>{const t=e.variants.find((e=>e.variantId===a));t&&ee(t)}})})]})}function H({labels:e}){return(null==e?void 0:e.length)?(0,r.jsx)("div",{class:i.a.cardTags,children:e.map(((e,a)=>(0,r.jsx)("span",{class:i.a.cardTag,children:e},`${e}-${a}`)))}):null}function B({mode:e,onClick:a}){return"cartButton"===e?(0,r.jsx)("button",{type:"button",className:i.a.quickshopIconButton,onClick:a,"aria-label":"Quick add to cart",children:(0,r.jsx)("div",{className:i.a.quickshopIcon})}):(0,r.jsx)("button",{type:"button",className:i.a.quickshopOverlay,onClick:a,"aria-label":e,children:e})}function N(e,a,t,r,i){const n=null!=a&&e!==a,o="range"===r&&n,l=o?"":n?"From ":"",s=o?`${i(e)} – ${i(a)}`:i(e),c=null!=t&&t>e,d=(0,O.a)(c);let p;return c&&null!=t&&(p=i(t)),{pricePrefix:l,priceText:s,showCompareAtPrice:c,onSaleDataAttribute:d,compareAtPriceText:p}}}}]);