yt-uikit 0.10.129 → 0.10.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -3905,7 +3905,7 @@ function pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;
3905
3905
  scrollbar-width: none;
3906
3906
 
3907
3907
  -ms-overflow-style: none;
3908
- `,hg=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function bg({bundle:r,addToCartFunction:l,currentProductId:s,dispatchAnalyticsEvent:c}){const d=o(()=>{if(!r)return r;const e="undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop,t=r.products?.filter(t=>{if(e&&""===t?.productDetails?.onlineStoreUrl)return!1;const n=t?.productDetails?.status?.toLowerCase();return!n||("active"===n||"unlisted"===n)})||[],n=r.freebieProducts?.filter(t=>{if(e&&""===t?.productDetails?.onlineStoreUrl)return!1;const n=(t?.productDetails?.status||t?.status)?.toLowerCase();return!n||("active"===n||"unlisted"===n)});return{...r,products:t,...n?{freebieProducts:n}:{}}},[r]),[p,m]=t(null);n(()=>{if(p){const e=setTimeout(()=>m(null),2e3);return()=>clearTimeout(e)}},[p]);const u=o(()=>{if(s){const e="gid://shopify/Product/"+s,t=d.products?.some(t=>t.productId===e);return t?e:d.products?.[0]?.productId}return d.products?.[0]?.productId},[s,d.products]),g=o(()=>hg(u,d.products),[u,d.products]),f=a(null),y=a(null);a({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[x,h]=t(0),[b,w]=t(""),v=d.customizations??{},C=!1===v?.general?.showDecimalsInBundlePricing,E=o(()=>g?.productDetails?.tracksInventory??!0,[g?.productDetails?.tracksInventory]),k=i(e=>{if(!E)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[E]),S=(o(()=>g?.productDetails?.variants?.edges?.reduce((e,{node:t})=>k(t)>0?e+1:e,0),[g,k]),o(()=>hg(u,d.products)?.id,[u,d.products]));o(()=>S?hg(u,d.products):void 0,[u,d.products,S]),o(()=>d.products?.some(e=>Xm(e?.productDetails))||!1,[d.products]),v.volumeBundle;const T=o(()=>d?.volumeTiers||[],[d?.volumeTiers]),N=T.findIndex(e=>e.isDefault),[z,I]=t(-1!==N?T[N].tier:T?.[0]?.tier||1),[F,B]=t(g?.productDetails?.variants?.edges?.find(e=>k(e?.node)>0)?.node?.id||g?.productDetails?.variants?.edges?.[0]?.node?.id||""),[$,A]=t({}),[P,D]=t(T.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>g?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[_,R]=t(!1),L=Se(Hm),O=v?.volumeBundle?.productClickAction??"details-modal",[M,W]=t(!1),[V,H]=t(!1),[j,q]=t(window.innerWidth<550),[U,Y]=t(null),[Q,G]=t({}),[Z,X]=t(null),[K,J]=t(null);a([]);const ee=a([]),te=a(z);n(()=>{if(c?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:d._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{q(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{U&&ee.current[U.index]&&ee.current[U.index][U.optionIndex]&&!ee.current[U.index][U.optionIndex]?.contains(e.target)&&Y(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[U]),i(e=>{const t=T.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,r=g?.productDetails?.variants?.edges||[];for(const e of r){const t=e.node;if(k(t)>=n){const e=Gm(g?.productDetails,t);return Array(n).fill(e)}}const o=[],a={},i=[...r].sort((e,t)=>{const n=k(e.node),r=k(t.node);return n===1/0&&r===1/0?0:n===1/0?-1:r===1/0?1:r-n});for(let e=0;e<n&&o.length<n;e++){let e=!1;for(const t of i){const n=t.node,r=a[n.id]||0;if(k(n)>r&&n.availableForSale){const t=Gm(g?.productDetails,n);o.push(t),a[n.id]=r+1,e=!0;break}}if(!e)return null}return o.length===n?o:null},[g,T,k]);const ne=i(e=>{const t=T.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=g?.productDetails?.variants?.edges||[];let o=0;for(const e of r){const t=k(e.node);if(t===1/0){o=1/0;break}o+=t}return o>=n},[T,g,k]);n(()=>{const e={},t=g?.productDetails?.variants?.edges?.find(e=>k(e?.node)>0)?.node?.id||g?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&T.forEach(n=>{e[n.tier]={};for(let r=0;r<n.minimumQuantity;r++)e[n.tier][r]=t}),A(e)},[g?.id,T?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),k]);const re=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,oe=i((e,t,n,r,o)=>{const a=T.find(t=>t.tier===e);if(!a)return!1;const i=a.minimumQuantity,l=[...n];l[r]=o;const s=l.join(" / "),c=g?.productDetails?.variants?.edges?.find(e=>e.node.title===s)?.node;if(!c||0===k(c))return!1;const d={},p=$[e]||{};for(let e=0;e<i;e++){let n;if(e===t)n=c.id;else{const t=p[e]||F,r=re(g,t);if(!r)return!1;n=r.id}d[n]=(d[n]||0)+1}for(const[e,t]of Object.entries(d)){const n=re(g,e),r=k(n);if(r!==1/0&&t>r)return!1}return!0},[T,g,P,P,$,F,k]),ae=i(e=>{const t=T.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=e-1,o={};for(let e=0;e<n;e++){const t=(P[r]?.[e]||g.productDetails.options.map(e=>e.values[0])).join(" / "),n=g?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const a=n.node.id;o[a]=(o[a]||0)+1}for(const[e,t]of Object.entries(o)){const n=re(g,e),r=k(n);if(r!==1/0&&t>r)return!1}return!0},[T,g,P,k]);n(()=>{h(e=>e+1)},[$]);const ie=(e,t,n)=>{A(r=>{const o=r[e]||{},a=T.find(t=>t.tier===e),i=a?.minimumQuantity||1,l={...o};for(let e=0;e<i;e++)l[e]||(l[e]=F);return l[t]=n,{...r,[e]:l}})},le=i(()=>g?.productDetails?.variants?.edges?.find(e=>k(e.node)>0)?.node||g?.productDetails?.variants?.edges?.[0]?.node,[g,k]),se=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{te.current=z},[z]),n(()=>{K?(J(null),ce()):ce()},[z]),n(()=>{if(d){const e=le();if(e)w(e.id),B(e.id);else{const e=g?.productDetails?.variants?.edges?.[0]?.node?.id||"";w(e),B(e)}}},[d,g,le]);const ce=()=>{const e=se();if(e){const t=g?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),h(e=>e+1);else{const e=le();e&&(B(String(e.id)),n=e),h(e=>e+1)}if(n){0===k(n)?(J(null),setTimeout(()=>{J({tier:te.current,index:0,optionIndex:0,value:n.title})},0)):K&&J(null)}}};n(()=>{ce();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(r.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",ce),()=>{t=!1,window.removeEventListener("urlChange",ce),window.history.pushState=n,window.history.replaceState=r}},[se,g?.id,le,k]);const de=e=>{const t=T.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,r=0,o=0;const a=$[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=a[e]||F,i=re(g,t);if(!i)continue;const l=Number.parseFloat(i.price);n+=i.compareAtPrice?Number.parseFloat(i.compareAtPrice):l,r+=l,o+=l}if("percentOff"===d?.discountType){o*=1-(t.discountValue??0)/100}else"amountOff"===d?.discountType&&(o-=t.discountValue??0);const i=Math.max(0,o),l=v?.volumeBundle?.discountBadgeDisplay,s=v?.volumeBundle?.discountBadgeVisibility;let c=n;"Disabled"===s?c=i:"discount-on-price"===l&&(c=r);const p=r-i,m=c-i,u=r>0?p/r*100:0,f=c>0?m/c*100:0;return{original:c,discounted:i,discountedFromPrice:i,discountedFromCompare:i,diffAmountFromPrice:p,diffAmountFromCompare:m,diffPercentFromPrice:Math.round(u),diffPercentFromCompare:Math.round(f),discountValue:t.discountValue??0}},pe=(e,t,n,r)=>{let o=re(e,t);if(r){const a=$[r]?.[n||0]||t;o=re(e,a)}return o?.image?.url?o.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""},me=async(e,t)=>{if(ae(z))try{R(!0),m(null);const n=T.find(e=>e.tier===z);if(!n)return;const r={},o=$[n.tier]||{};for(let e=0;e<n.minimumQuantity;e++){const t=o[e]||F;r[t]?r[t].quantity+=1:r[t]={quantity:1}}c?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:d._id,bundleType:"volume-bundle",selectedProducts:g?[{id:g?.productId,title:g?.productDetails?.title}]:[],selectedVariants:Object.values(o)}});const a=de(n.tier),i=Array.from({length:n.minimumQuantity},(e,t)=>o[t]||F),s=ve(n)?.variantIds?.[0]?[ve(n)?.variantIds?.[0]]:[];l&&await l(a.original,i,a.discounted,void 0,e,s,t?.isCheckout)}catch(e){console.error("VolumeBundle handleAddToCart error:",e),m(am(e))}finally{R(!1)}else console.error("Selected tier is out of stock")},ue=a(),ge=a();ue.current=async()=>{if(d?.personalizedForm?.title)return H(!1),void W(!0);await me()},ge.current=async()=>{if(d?.personalizedForm?.title)return H(!0),void W(!0);await me(void 0,{isCheckout:!0})};const fe=i(()=>ue.current?.(),[]),ye=i(()=>ge.current?.(),[]);n(()=>{if("shopify_atc_button"!==v.volumeBundle?.addtoCartMethod)return;const{cleanup:e}=Yo({onAddToCart:fe,onCheckout:ye,notifyVariant:K});return e},[v.volumeBundle?.addtoCartMethod,K,fe,ye]);const xe=o(()=>T.find(e=>e.tier===z),[T,z]),he=o(()=>xe?de(xe.tier):null,[xe,$,F]),be=o(()=>{if(!xe||!he)return;const e=$[xe.tier]||{},t={};for(let n=0;n<xe.minimumQuantity;n++){const r=e[n]||F;t[r]=(t[r]||0)+1}return t},[xe?.minimumQuantity,F,$,he]),we=o(()=>Object.entries(be??{}).map(([e,t])=>({variantId:e,quantity:t})),[be]);n(()=>{if(!xe||!he)return;const e={tier:z,items:xe.minimumQuantity,discountedPrice:he.discounted,originalPrice:he.original,variants:we,productId:g?.id??null,tierMeta:{title:xe.title,subtitle:xe.subtitle,badgeTitle:xe.badgeTitle},productData:g,tierData:xe},t=y.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(f.current&&clearTimeout(f.current),f.current=window.setTimeout(()=>{y.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:d,addToCart:l,currentTier:xe,selectedVariants:we},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{f.current&&clearTimeout(f.current)})},[z,xe?.tier,xe?.minimumQuantity,he?.discounted,he?.original,g?.id,JSON.stringify(we),JSON.stringify(Q),l,d]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!F||!g)return;const e=re(g,F);if(!e)return;const t=Gm(g?.productDetails,e),n={},r={};T.forEach(e=>{const o=e.tier-1,a={};for(let t=0;t<e.minimumQuantity;t++)a[t]=F;n[e.tier]=a,r[o]=Array(e.minimumQuantity).fill(t)}),A(e=>({...e,...n})),D(e=>({...e,...r}))},[F,g?.id,T.length]);const ve=i(e=>e.freebieProductIds?.[0]&&d.freebieProducts?.length?d.freebieProducts.find(t=>t.productId===e.freebieProductIds?.[0])??null:null,[d.freebieProducts]),Ce=i(e=>{if(!e)return"";const t=e.productDetails?.variants?.edges??[];return t.find(t=>{const n=t.node.inventoryQuantity??0,r=t.node.inventoryPolicy?.toLowerCase();return!e.productDetails?.tracksInventory||(!t.node.inventoryItem?.tracked||(n>0||"continue"===r))})?.node?.id??t[0]?.node?.id??""},[]);if(n(()=>{const e={};T.forEach(t=>{const n=ve(t);n&&(e[t.tier]=Q[t.tier]||Ce(n))}),Object.keys(e).length>0&&G(t=>({...e,...t}))},[T,d.freebieProducts]),!l)return e.createElement(e.Fragment,null);const Ee=v.volumeBundle?.cardStyle,ke=v.general?.primaryColor,Te=v.general?.secondaryColor,Ne=v.general.primaryContrastColor,ze=v.general.secondaryContrastColor,Ie="high"===d.cornerRadiusType?"20px":"medium"===d.cornerRadiusType?"6px":"0px",Fe="bundles"==d.appName?d.pageHeader?.title:d?.title,Be="bundles"==d.appName?d.pageHeader?.description:d?.subtitle;return n(()=>{const e=ae(z);e?J(null):e||J({tier:z,index:0,optionIndex:0,value:""})},[z,we,ae]),e.createElement(Hu,{verticalMargin:v.volumeBundle?.verticalMargin,$backgroundColor:v.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},(Fe||Be)&&e.createElement(ju,{className:"yt-bundle-header"},Fe&&Fe.trim().length>0&&e.createElement(qu,{fontSize:v.volumeBundle?.titleFontSize,$backgroundColor:v.volumeBundle?.titleBackgroundColor,textColor:v.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},Fe),e.createElement(Uu,{className:"yt-bundle-header-subtitle",fontSize:v.volumeBundle?.subtitleFontSize},Be)),"vertical"===Ee?e.createElement("div",{style:{display:"grid",gridTemplateColumns:j||4===T.length?"repeat(2, 1fr)":T.length>4?"repeat(3, 1fr)":`repeat(${T.length}, 1fr)`,justifyItems:"center",gap:j?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},T.map(t=>{const n=de(t.tier),r=n.original-n.discounted,o=z===t.tier,a=!ne(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:Ie||"24px",...o?{border:`2px solid ${ke}`}:{border:`1px solid ${Te}`},boxShadow:`6px 6px 0px -1px ${o?ke:Te}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:a?"#f5f5f5":"white",cursor:a?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:a?.6:1},className:"yt-volume-vertical-tier-item "+(o?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2),onClick:()=>!a&&I(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:o?ke:Te,color:o?Ne:ze,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:o?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===v.volumeBundle?.discountBadgeVisibility&&j&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Ty(v.general.currencySymbol,d.storeCurrencyCode);let a="";if(v?.volumeBundle?.discountBadgeDisplay&&v?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=v.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${Sy(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${Sy(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${Sy(n.discountValue)}`);return a?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(Xu,{primaryBackgroundColorCta:o?ke:Te,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?Ne:ze},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},a)):null})(),t.imageUrl&&e.createElement("img",{src:Ny(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:Ie||"24px",borderTopRightRadius:Ie||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(Ku,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(Ju,{style:{fontSize:j?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===d.discountType&&Ty(v.general.currencySymbol,d.storeCurrencyCode),`${t.discountValue}`,"percentOff"===d.discountType&&"fi"," Off")),"Enabled"===v.volumeBundle?.discountBadgeVisibility&&!j&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Ty(v.general.currencySymbol,d.storeCurrencyCode);let a="";if(v?.volumeBundle?.discountBadgeDisplay&&v?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=v.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${Sy(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${Sy(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${Sy(n.discountValue)}`);return a?e.createElement(Xu,{primaryBackgroundColorCta:o?ke:Te,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?Ne:ze},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},a):null})(),o&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ke,color:Ne,padding:"2px"}},e.createElement(lt,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(eg,{style:{lineHeight:"normal",fontSize:j?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),ne(t.tier)?e.createElement(tg,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2),"data-savings":r.toFixed(C?0:2)},(()=>{const o=v?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",i="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(C?0:2),i=e.toFixed(C?0:2)}else"tier-price"===o&&(a=n.original.toFixed(C?0:2),i=n.discounted.toFixed(C?0:2));return e.createElement(e.Fragment,null,e.createElement(ng,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(i),"unit-price"===o?"/unit":""),r>0&&e.createElement(rg,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(a),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),o&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ke,color:Ne,padding:"2px"}},e.createElement(lt,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,T.map(t=>{const n=de(t.tier),r=n.original-n.discounted,o=!ne(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement(Qu,{cornerRadiusType:d?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:ke??"",isSelected:z===t.tier,onClick:()=>I(t.tier),style:{borderRadius:Ie,cursor:"pointer",backgroundColor:o?"#f5f5f5":"white",opacity:o?.6:1,...t?.badgeTitle&&{position:"relative",marginTop:"30px"}},className:"yt-volume-horizontal-tier-container "+(z===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2)},t.badgeTitle&&e.createElement(Yu,{primaryTextColorCta:Ne,primaryBackgroundColorCta:ke,style:{lineHeight:"normal",position:"absolute",top:"-16.5px",left:"2%",right:"2%",marginInline:"auto"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement(Gu,{cornerRadiusType:d?.cornerRadiusType??"",style:{borderRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie},className:"yt-volume-horizontal-tier-header"},e.createElement(Zu,{className:"yt-volume-horizontal-tier-info"},e.createElement(sg,{"data-active":z===t.tier,accentColor:ke,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(cg,{name:"tier",checked:z===t.tier,onChange:()=>!o&&I(t.tier),disabled:o,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(dg,{accentColor:ke,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(Ku,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(Ju,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===d.discountType&&Ty(v.general.currencySymbol,d.storeCurrencyCode),`${t.discountValue}`,"percentOff"===d.discountType&&"fi"," ","Off")),"Enabled"===v.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Ty(v.general.currencySymbol,d.storeCurrencyCode);let o="";if(v?.volumeBundle?.discountBadgeDisplay&&v?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=v.volumeBundle;"discount-on-compare"===e&&(o="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${Sy(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(o="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${Sy(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(o="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${Sy(n.discountValue)}`);return o?e.createElement(Xu,{primaryBackgroundColorCta:ke,isSelected:z===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},o):null})()),e.createElement(eg,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),ne(t.tier)?e.createElement(tg,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2),"data-savings":r.toFixed(0)},(()=>{const o=v?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",i="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(C?0:2),i=e.toFixed(C?0:2)}else"tier-price"===o&&(a=n.original.toFixed(C?0:2),i=n.discounted.toFixed(C?0:2));return e.createElement(e.Fragment,null,r>0?e.createElement(rg,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(a),"unit-price"===o?"/unit":""):"",e.createElement(ng,{className:"yt-volume-horizontal-tier-discounted-price"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(i),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),z===t.tier&&e.createElement(og,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:g.productDetails.variants.edges.length>1||1===g.productDetails.variants.edges.length&&"Default Title"!==g.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:g.productDetails.variants.edges.length>1||1===g.productDetails.variants.edges.length&&"Default Title"!==g.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,r)=>{const a=t.tier-1,i=(P[a]||[])[r]||g.productDetails.options?.map(e=>e.values[0])||[],l=Xm(g?.productDetails)||1===g?.productDetails?.variants?.edges?.length&&"Default Title"!==g?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:r,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},l&&e.createElement(pg,{src:Ny(pe(g,F,r,t.tier)),onClick:e=>{if("details-modal"===O&&g?.productDetails){e.stopPropagation(),X({tier:t.tier,index:r});const n=$[t.tier]?.[r]||F,o=re(g,n)||g?.productDetails?.variants?.edges?.[0]?.node,a={...g.productDetails,selectedVariant:o};L(a)}},alt:g?.productDetails?.title||"Product",style:{height:"64px",width:"auto",cursor:"details-modal"===O?"pointer":"default"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===v?.volumeBundle?.variantSelectorType||"dropdown"===v?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},g?.productDetails?.options?.map((n,l)=>{const s=Zm(g.productDetails,i,l);if(s.length<=1)return null;const c=U?.tier===t.tier&&U?.index===r&&U?.optionIndex===l,p=d?.variantOptions?.options?.find(e=>e.name===n.name);let m="";return"color"===p?.type&&(m=p?.values?.find(e=>e.name===i[l])?.value||""),e.createElement(fg,{key:l,ref:e=>{ee.current[r]||(ee.current[r]=[]),ee.current[r][l]=e},style:{zIndex:c?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:c,onClick:e=>{e.preventDefault(),e.stopPropagation()}},v?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(yg,{onClick:e=>{e.stopPropagation(),e.preventDefault(),Y(c?null:{tier:t.tier,index:r,optionIndex:l})},isActive:c,disabled:o},"color"===p?.type&&m&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:m||"transparent",border:"1px solid #ddd"}}),i[l],e.createElement(Ze,{style:{display:"block"}})),c&&e.createElement(xg,{style:{zIndex:1001}},s.map((n,s)=>{const c=[...i];c[l]=n;const d=Km(g.productDetails,c),m=oe(t.tier,r,d,l,n),u=!m||o;if(!1===v?.general?.showOutOfStockVariants&&!m)return null;g.productDetails.variants.edges.find(({node:e})=>e.title===d.join(" / "));const f=e=>{if(e.preventDefault(),e.stopPropagation(),D(e=>{const t={...e},n=[...t[a]||[]];return n[r]=d,t[a]=n,t}),u){J({tier:z,index:r,optionIndex:l,value:n}),Y(null);const e=d.join(" / "),o=g.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||F;return void ie(t.tier,r,o)}const o=d.join(" / "),i=g.productDetails.variants.edges.find(e=>e.node.title===o)?.node.id||F;ie(t.tier,r,i),Y(null)},y=p?.values?.find(e=>e.name===n);return"image"===p?.type&&y?.value?e.createElement(mg,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),f(e)},style:{cursor:"pointer"}},e.createElement(ug,{src:y.value,alt:n}),n):"color"===p?.type&&y?.value?e.createElement(mg,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),f(e)},style:{cursor:"pointer"}},e.createElement(gg,{style:{backgroundColor:y.value}}),n):e.createElement(mg,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),f(e)},style:{cursor:"pointer"}},n)})))})),"swatches"===v?.volumeBundle?.variantSelectorType&&e.createElement(ag,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},g?.productDetails?.options.map((n,l)=>{const s=Zm(g.productDetails,i,l);if(s.length<=1)return null;const c=d.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},v?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},s.map(n=>{const s=i[l]===n,d=[...i];d[l]=n;const p=Km(g.productDetails,d),m=oe(t.tier,r,p,l,n),u=!m||o;if(!1===v?.general?.showOutOfStockVariants&&!m)return null;const f=c?.values?.find(e=>e.name===n),y=e=>{if(e.preventDefault(),e.stopPropagation(),u)return;D(e=>{const t={...e},n=[...t[a]||[]];return n[r]=p,t[a]=n,t});const n=p.join(" / "),o=g.productDetails.variants.edges.find(e=>e.node.title===n)?.node.id||F;ie(t.tier,r,o)},x={opacity:u?.5:1,cursor:u?"not-allowed":"pointer"};return"color"===c?.type&&f?.value?e.createElement("button",{key:n,onClick:y,style:{...x,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:s?`1px solid ${v.general?.primaryColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button yt-volume-horizontal-tier-variant-color-button"+(s?" yt-volume-horizontal-tier-variant-color-button--selected":""),disabled:u},e.createElement("div",{style:{width:s?"24px":"20px",height:s?"24px":"20px",borderRadius:"50%",backgroundColor:f.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===c?.type&&f?.value?e.createElement("button",{key:n,onClick:y,style:{...x,border:s?`1px solid ${v.general?.primaryColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:s?"#F7F7F7":"transparent",padding:"0px",width:s?"20px":"18px",height:s?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-button yt-volume-horizontal-tier-variant-image-button"+(s?" yt-volume-horizontal-tier-variant-image-button--selected":""),disabled:u},e.createElement("img",{src:f.value,alt:n,style:{width:s?"26px":"24px",height:s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(ig,{key:n,isSelected:s,onClick:y,style:{...x,padding:"4px 8px",border:s?`1px solid ${v.general?.primaryColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:s?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button yt-volume-horizontal-tier-variant-button-default"+(s?" yt-volume-horizontal-tier-variant-button-default--selected":""),disabled:u},n)})))})))})),K&&K.tier===t.tier&&e.createElement("div",{style:{color:ke,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${ke}1A`,padding:"12px",borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie}},"There aren’t enough items in our stock for select option, please select smaller bundle."),z===t.tier&&ve(t)&&(()=>{if("horizontal"===v?.volumeBundle?.cardStyle)return null;const n=ve(t),r=Q[t.tier],o=n.productDetails.variants.edges.find(e=>e.node.id===r)?.node||n.productDetails.variants.edges[0]?.node,a=v?.volumeBundle?.freebieDisplayType;return"compact"===a?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:Te||"#928d8d",borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie},className:"yt-volume-tier-freebie-detailed-section"},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:500},className:"yt-volume-tier-freebie-detailed-product-details"},e.createElement("strong",null,"+ FREE")," ",n.productDetails.title," worth"," ",Sy(o?.price)),e.createElement("span",{className:"yt-volume-tier-freebie-detailed-gift-icon",style:{color:"#fff",fontSize:"16px"}},e.createElement(st,{fill:"white"}))):e.createElement("div",{className:"yt-volume-freebie-compact-section",style:{padding:"12px 16px",borderTop:"1px solid #f0f0f0",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",gap:"12px",borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,paddingBottom:"20px"}},e.createElement("div",{style:{position:"relative",width:"56px",height:"56px",flexShrink:0},className:"yt-volume-freebie-compact-product-image"},e.createElement(pg,{src:Ny(o?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url),alt:n.productDetails.title,onClick:e=>{if("details-modal"===O&&n?.productDetails){e.stopPropagation(),X({tier:t.tier,index:-1,isFreebie:!0});const r={...n.productDetails,selectedVariant:o};L(r)}},style:{cursor:"details-modal"===O?"pointer":"default",height:"64px",width:"auto",objectFit:"cover",borderRadius:"6px"}})),e.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px"},className:"yt-volume-freebie-compact-product-details"},e.createElement("span",{style:{background:"#1a1a1a",color:"#fff",fontSize:"10px",fontWeight:600,padding:"2px 7px",borderRadius:"4px",display:"inline-block",width:"fit-content"}},"+ FREE"),e.createElement("span",{style:{fontSize:"14px",fontWeight:500}},n.productDetails.title),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},o?.title)))})()))})),(()=>{if(!T.some(e=>ve(e)))return null;const t=T.find(e=>e.tier===z),n=t?ve(t):null,r=T.find(e=>ve(e)),o=r?.title||`Pack of ${r?.minimumQuantity}`,a=n&&"detailed"===v?.volumeBundle?.freebieDisplayType;let i=null;if(a){const e=Q[t.tier];i=n.productDetails.variants.edges.find(t=>t.node.id===e)?.node||n.productDetails.variants.edges[0]?.node}return e.createElement("div",{style:{marginTop:"16px",marginBottom:d?.showCta?"16px":"0px",padding:a?"8px":"10px 12px",backgroundColor:`${ke}20`,border:"1px dashed #333",borderRadius:"8px",display:"flex",alignItems:"center",gap:"12px"},className:"yt-volume-freebie-status-banner"},a?e.createElement("div",{style:{display:"flex",gap:"12px",width:"100%",alignItems:"center"},className:"yt-volume-freebie-detailed-banner-container"},e.createElement("div",{style:{position:"relative",width:"60px",height:"60px",flexShrink:0,backgroundColor:"#eee",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image-container"},e.createElement("img",{src:Ny(i?.image?.url||n.productDetails.featuredMedia.preview.image.url),alt:n.productDetails.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image"}),e.createElement("div",{style:{position:"absolute",bottom:"-4px",right:"-4px",backgroundColor:"#fff",border:"1px solid #333",borderRadius:"4px",width:"20px",height:"20px",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2},className:"yt-volume-freebie-detailed-banner-gift-overlay"},e.createElement(st,{color:"#333",size:12}))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},className:"yt-volume-freebie-detailed-banner-text-container"},e.createElement("div",{style:{backgroundColor:"#333",color:"#fff",fontSize:"9px",fontWeight:"600",padding:"2px 6px",borderRadius:"4px",width:"fit-content"},className:"yt-volume-freebie-detailed-banner-pill"},"+ FREE — included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"),e.createElement("span",{style:{fontSize:"14px",fontWeight:"bold",color:"#111",lineHeight:"1.2",marginTop:"2px"},className:"yt-volume-freebie-detailed-banner-title"},n.productDetails.title),i?.title&&"Default Title"!==i.title&&e.createElement("span",{style:{fontSize:"12px",color:"#666",lineHeight:"1"},className:"yt-volume-freebie-detailed-banner-variant"},i.title))):e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:ke||"#ff4d94",borderRadius:"4px",width:"24px",height:"24px",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},className:"yt-volume-freebie-compact-banner-icon"},e.createElement(ct,{color:"#fff",size:16})),e.createElement("div",{style:{fontSize:"14px",color:"#111",lineHeight:"1.3"},className:"yt-volume-freebie-compact-banner-text"},n?e.createElement(e.Fragment,null,e.createElement("strong",null,"Free ",n.productDetails.title)," ","— included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"):e.createElement("span",{style:{fontWeight:500}},"Select ",e.createElement("strong",null,o)," to unlock a free gift."))))})(),d?.showCta&&"shopify_atc_button"!==v.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(lg,{bgColor:p?"#dc2626":ae(z)?v.general?.ctaBackgroundColor:"#ccc",textColor:p?"#ffffff":ae(z)?v.general?.ctaTextColor:"#666",border:`1px solid ${p?"#dc2626":ae(z)?v.general?.ctaBorderColor||"#121212":"#999"}`,shadow:v.general.ctaShadowType,padding:v.general?.ctaPadding,width:v.general?.ctaWidth,hoverProperties:{customizeHoverState:!(!ae(z)||p)&&v.general?.customizeHoverState,backgroundColor:v.general?.ctaHoverBackgroundColor,textColor:v.general?.ctaHoverTextColor},onClick:()=>{_||fe()},borderRadius:v.general.ctaBorderRadius??"",disabled:!ae(z),className:"yt-volume-add-to-cart-button"},"animated"===v?.general?.atcLoaderType?e.createElement(Ou,{color:"white",loading:_,size:22},ae(z)?p?e.createElement(e.Fragment,null,p):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,v.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=de(z);return e.createElement(e.Fragment,null,Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t.discounted.toFixed(C?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t?.original.toFixed(C?0:2))," "))})()),v?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}))):e.createElement(e.Fragment,null,"Out of Stock")):_?e.createElement($e,{color:"white",loading:_,size:20}):ae(z)?p?e.createElement(e.Fragment,null,p):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,v.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=de(z);return e.createElement(e.Fragment,null,Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t.discounted.toFixed(C?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t?.original.toFixed(C?0:2))," "))})()),v?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}))):e.createElement(e.Fragment,null,"Out of Stock"))),d?.personalizedForm?.title&&e.createElement(Mu,{isOpen:M,onClose:()=>W(!1),formConfig:d.personalizedForm,onCheckout:async e=>{await me(e,{isCheckout:V}),W(!1)},cta:{backgroundColor:v.general?.ctaBackgroundColor||"#121212",textColor:v.general?.ctaTextColor||"#FFFFFF"},isMobile:j}),e.createElement(yu,{bundleType:"volumeBundle",bundle:d,handleAddToBundle:()=>{},selectedProducts:[],remainingQuantity:0,hideAddToBundle:!0,disableQuantitySelector:!0,themeColor:v?.general?.primaryColor||"#000",primaryTextColorCta:v?.general?.primaryContrastColor||"#fff",primaryBackgroundColorCta:v?.general?.primaryColor||"#000",cornerRadius:"8px",styles:v,onVariantSelect:e=>{if(Z)if(Z.isFreebie)G(t=>({...t,[Z.tier]:e}));else{const t=Z.tier-1,n=re(g,e);if(n?.title&&"Default Title"!==n.title){const e=Gm(g?.productDetails,n);D(n=>{const r={...n},o=[...r[t]||[]];return o[Z.index]=e,r[t]=o,r})}ie(Z.tier,Z.index,e)}}}))}const wg=d.div`
3908
+ `,hg=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function bg({bundle:r,addToCartFunction:l,currentProductId:s,dispatchAnalyticsEvent:c}){const d=o(()=>{if(!r)return r;const e="undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop,t=r.products?.filter(t=>{if(e&&""===t?.productDetails?.onlineStoreUrl)return!1;const n=t?.productDetails?.status?.toLowerCase();return!n||("active"===n||"unlisted"===n)})||[],n=r.freebieProducts?.filter(t=>{if(e&&""===t?.productDetails?.onlineStoreUrl)return!1;const n=(t?.productDetails?.status||t?.status)?.toLowerCase();return!n||("active"===n||"unlisted"===n)});return{...r,products:t,...n?{freebieProducts:n}:{}}},[r]),[p,m]=t(null);n(()=>{if(p){const e=setTimeout(()=>m(null),2e3);return()=>clearTimeout(e)}},[p]);const u=o(()=>{if(s){const e="gid://shopify/Product/"+s,t=d.products?.some(t=>t.productId===e);return t?e:d.products?.[0]?.productId}return d.products?.[0]?.productId},[s,d.products]),g=o(()=>hg(u,d.products),[u,d.products]),f=a(null),y=a(null);a({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[x,h]=t(0),[b,w]=t(""),v=d.customizations??{},C=!1===v?.general?.showDecimalsInBundlePricing,E=o(()=>g?.productDetails?.tracksInventory??!0,[g?.productDetails?.tracksInventory]),k=i(e=>{if(!E)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[E]),S=(o(()=>g?.productDetails?.variants?.edges?.reduce((e,{node:t})=>k(t)>0?e+1:e,0),[g,k]),o(()=>hg(u,d.products)?.id,[u,d.products]));o(()=>S?hg(u,d.products):void 0,[u,d.products,S]),o(()=>d.products?.some(e=>Xm(e?.productDetails))||!1,[d.products]),v.volumeBundle;const T=o(()=>d?.volumeTiers||[],[d?.volumeTiers]),N=T.findIndex(e=>e.isDefault),[z,I]=t(-1!==N?T[N].tier:T?.[0]?.tier||1),[F,B]=t(g?.productDetails?.variants?.edges?.find(e=>k(e?.node)>0)?.node?.id||g?.productDetails?.variants?.edges?.[0]?.node?.id||""),[$,A]=t({}),[P,D]=t(T.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>g?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[_,R]=t(!1),L=Se(Hm),O=v?.volumeBundle?.productClickAction??"details-modal",[M,W]=t(!1),[V,H]=t(!1),[j,q]=t(window.innerWidth<550),[U,Y]=t(null),[Q,G]=t({}),[Z,X]=t(null),[K,J]=t(null);a([]);const ee=a([]),te=a(z);n(()=>{if(c?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:d._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{q(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{U&&ee.current[U.index]&&ee.current[U.index][U.optionIndex]&&!ee.current[U.index][U.optionIndex]?.contains(e.target)&&Y(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[U]),i(e=>{const t=T.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,r=g?.productDetails?.variants?.edges||[];for(const e of r){const t=e.node;if(k(t)>=n){const e=Gm(g?.productDetails,t);return Array(n).fill(e)}}const o=[],a={},i=[...r].sort((e,t)=>{const n=k(e.node),r=k(t.node);return n===1/0&&r===1/0?0:n===1/0?-1:r===1/0?1:r-n});for(let e=0;e<n&&o.length<n;e++){let e=!1;for(const t of i){const n=t.node,r=a[n.id]||0;if(k(n)>r&&n.availableForSale){const t=Gm(g?.productDetails,n);o.push(t),a[n.id]=r+1,e=!0;break}}if(!e)return null}return o.length===n?o:null},[g,T,k]);const ne=i(e=>{const t=T.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=g?.productDetails?.variants?.edges||[];let o=0;for(const e of r){const t=k(e.node);if(t===1/0){o=1/0;break}o+=t}return o>=n},[T,g,k]);n(()=>{const e={},t=g?.productDetails?.variants?.edges?.find(e=>k(e?.node)>0)?.node?.id||g?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&T.forEach(n=>{e[n.tier]={};for(let r=0;r<n.minimumQuantity;r++)e[n.tier][r]=t}),A(e)},[g?.id,T?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),k]);const re=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,oe=i((e,t,n,r,o)=>{const a=T.find(t=>t.tier===e);if(!a)return!1;const i=a.minimumQuantity,l=[...n];l[r]=o;const s=l.join(" / "),c=g?.productDetails?.variants?.edges?.find(e=>e.node.title===s)?.node;if(!c||0===k(c))return!1;const d={},p=$[e]||{};for(let e=0;e<i;e++){let n;if(e===t)n=c.id;else{const t=p[e]||F,r=re(g,t);if(!r)return!1;n=r.id}d[n]=(d[n]||0)+1}for(const[e,t]of Object.entries(d)){const n=re(g,e),r=k(n);if(r!==1/0&&t>r)return!1}return!0},[T,g,P,P,$,F,k]),ae=i(e=>{const t=T.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=e-1,o={};for(let e=0;e<n;e++){const t=(P[r]?.[e]||g.productDetails.options.map(e=>e.values[0])).join(" / "),n=g?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const a=n.node.id;o[a]=(o[a]||0)+1}for(const[e,t]of Object.entries(o)){const n=re(g,e),r=k(n);if(r!==1/0&&t>r)return!1}return!0},[T,g,P,k]);n(()=>{h(e=>e+1)},[$]);const ie=(e,t,n)=>{A(r=>{const o=r[e]||{},a=T.find(t=>t.tier===e),i=a?.minimumQuantity||1,l={...o};for(let e=0;e<i;e++)l[e]||(l[e]=F);return l[t]=n,{...r,[e]:l}})},le=i(()=>g?.productDetails?.variants?.edges?.find(e=>k(e.node)>0)?.node||g?.productDetails?.variants?.edges?.[0]?.node,[g,k]),se=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{te.current=z},[z]),n(()=>{K?(J(null),ce()):ce()},[z]),n(()=>{if(d){const e=le();if(e)w(e.id),B(e.id);else{const e=g?.productDetails?.variants?.edges?.[0]?.node?.id||"";w(e),B(e)}}},[d,g,le]);const ce=()=>{const e=se();if(e){const t=g?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),h(e=>e+1);else{const e=le();e&&(B(String(e.id)),n=e),h(e=>e+1)}if(n){0===k(n)?(J(null),setTimeout(()=>{J({tier:te.current,index:0,optionIndex:0,value:n.title})},0)):K&&J(null)}}};n(()=>{ce();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(r.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",ce),()=>{t=!1,window.removeEventListener("urlChange",ce),window.history.pushState=n,window.history.replaceState=r}},[se,g?.id,le,k]);const de=e=>{const t=T.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,r=0,o=0;const a=$[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=a[e]||F,i=re(g,t);if(!i)continue;const l=Number.parseFloat(i.price);n+=i.compareAtPrice?Number.parseFloat(i.compareAtPrice):l,r+=l,o+=l}if("percentOff"===d?.discountType){o*=1-(t.discountValue??0)/100}else"amountOff"===d?.discountType&&(o-=t.discountValue??0);const i=Math.max(0,o),l=v?.volumeBundle?.discountBadgeDisplay,s=v?.volumeBundle?.discountBadgeVisibility;let c=n;"Disabled"===s?c=i:"discount-on-price"===l&&(c=r);const p=r-i,m=c-i,u=r>0?p/r*100:0,f=c>0?m/c*100:0;return{original:c,discounted:i,discountedFromPrice:i,discountedFromCompare:i,diffAmountFromPrice:p,diffAmountFromCompare:m,diffPercentFromPrice:Math.round(u),diffPercentFromCompare:Math.round(f),discountValue:t.discountValue??0}},pe=(e,t,n,r)=>{let o=re(e,t);if(r){const a=$[r]?.[n||0]||t;o=re(e,a)}return o?.image?.url?o.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""},me=async(e,t)=>{if(ae(z))try{R(!0),m(null);const n=T.find(e=>e.tier===z);if(!n)return;const r={},o=$[n.tier]||{};for(let e=0;e<n.minimumQuantity;e++){const t=o[e]||F;r[t]?r[t].quantity+=1:r[t]={quantity:1}}c?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:d._id,bundleType:"volume-bundle",selectedProducts:g?[{id:g?.productId,title:g?.productDetails?.title}]:[],selectedVariants:Object.values(o)}});const a=de(n.tier),i=Array.from({length:n.minimumQuantity},(e,t)=>o[t]||F),s=ve(n)?.variantIds?.[0]?[ve(n)?.variantIds?.[0]]:[];l&&await l(a.original,i,a.discounted,void 0,e,s,t?.isCheckout)}catch(e){console.error("VolumeBundle handleAddToCart error:",e),m(am(e))}finally{R(!1)}else console.error("Selected tier is out of stock")},ue=a(),ge=a();ue.current=async()=>{if(d?.personalizedForm?.title)return H(!1),void W(!0);await me()},ge.current=async()=>{if(d?.personalizedForm?.title)return H(!0),void W(!0);await me(void 0,{isCheckout:!0})};const fe=i(()=>ue.current?.(),[]),ye=i(()=>ge.current?.(),[]);n(()=>{if("shopify_atc_button"!==v.volumeBundle?.addtoCartMethod)return;const{cleanup:e}=Yo({onAddToCart:fe,onCheckout:ye,notifyVariant:K});return e},[v.volumeBundle?.addtoCartMethod,K,fe,ye]);const xe=o(()=>T.find(e=>e.tier===z),[T,z]),he=o(()=>xe?de(xe.tier):null,[xe,$,F]),be=o(()=>{if(!xe||!he)return;const e=$[xe.tier]||{},t={};for(let n=0;n<xe.minimumQuantity;n++){const r=e[n]||F;t[r]=(t[r]||0)+1}return t},[xe?.minimumQuantity,F,$,he]),we=o(()=>Object.entries(be??{}).map(([e,t])=>({variantId:e,quantity:t})),[be]);n(()=>{if(!xe||!he)return;const e={tier:z,items:xe.minimumQuantity,discountedPrice:he.discounted,originalPrice:he.original,variants:we,productId:g?.id??null,tierMeta:{title:xe.title,subtitle:xe.subtitle,badgeTitle:xe.badgeTitle},productData:g,tierData:xe},t=y.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(f.current&&clearTimeout(f.current),f.current=window.setTimeout(()=>{y.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:d,addToCart:l,currentTier:xe,selectedVariants:we},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{f.current&&clearTimeout(f.current)})},[z,xe?.tier,xe?.minimumQuantity,he?.discounted,he?.original,g?.id,JSON.stringify(we),JSON.stringify(Q),l,d]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!F||!g)return;const e=re(g,F);if(!e)return;const t=Gm(g?.productDetails,e),n={},r={};T.forEach(e=>{const o=e.tier-1,a={};for(let t=0;t<e.minimumQuantity;t++)a[t]=F;n[e.tier]=a,r[o]=Array(e.minimumQuantity).fill(t)}),A(e=>({...e,...n})),D(e=>({...e,...r}))},[F,g?.id,T.length]);const ve=i(e=>e.freebieProductIds?.[0]&&d.freebieProducts?.length?d.freebieProducts.find(t=>t.productId===e.freebieProductIds?.[0])??null:null,[d.freebieProducts]),Ce=i(e=>{if(!e)return"";const t=e.productDetails?.variants?.edges??[];return t.find(t=>{const n=t.node.inventoryQuantity??0,r=t.node.inventoryPolicy?.toLowerCase();return!e.productDetails?.tracksInventory||(!t.node.inventoryItem?.tracked||(n>0||"continue"===r))})?.node?.id??t[0]?.node?.id??""},[]);if(n(()=>{const e={};T.forEach(t=>{const n=ve(t);n&&(e[t.tier]=Q[t.tier]||Ce(n))}),Object.keys(e).length>0&&G(t=>({...e,...t}))},[T,d.freebieProducts]),!l)return e.createElement(e.Fragment,null);const Ee=v.volumeBundle?.cardStyle,ke=v.general?.primaryColor,Te=v.general?.secondaryColor,Ne=v.general.primaryContrastColor,ze=v.general.secondaryContrastColor,Ie="high"===d.cornerRadiusType?"20px":"medium"===d.cornerRadiusType?"6px":"0px",Fe="bundles"==d.appName?d.pageHeader?.title:d?.title,Be="bundles"==d.appName?d.pageHeader?.description:d?.subtitle;return n(()=>{const e=ae(z);e?J(null):e||J({tier:z,index:0,optionIndex:0,value:""})},[z,we,ae]),e.createElement(Hu,{verticalMargin:v.volumeBundle?.verticalMargin,$backgroundColor:v.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},(Fe||Be)&&e.createElement(ju,{className:"yt-bundle-header"},Fe&&Fe.trim().length>0&&e.createElement(qu,{fontSize:v.volumeBundle?.titleFontSize,$backgroundColor:v.volumeBundle?.titleBackgroundColor,textColor:v.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},Fe),e.createElement(Uu,{className:"yt-bundle-header-subtitle",fontSize:v.volumeBundle?.subtitleFontSize},Be)),"vertical"===Ee?e.createElement("div",{style:{display:"grid",gridTemplateColumns:j||4===T.length?"repeat(2, 1fr)":T.length>4?"repeat(3, 1fr)":`repeat(${T.length}, 1fr)`,justifyItems:"center",gap:j?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},T.map(t=>{const n=de(t.tier),r=n.original-n.discounted,o=z===t.tier,a=!ne(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:Ie||"24px",...o?{border:`2px solid ${ke}`}:{border:`1px solid ${Te}`},boxShadow:`6px 6px 0px -1px ${o?ke:Te}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:a?"#f5f5f5":"white",cursor:a?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:a?.6:1},className:"yt-volume-vertical-tier-item "+(o?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2),onClick:()=>!a&&I(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:o?ke:Te,color:o?Ne:ze,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:o?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===v.volumeBundle?.discountBadgeVisibility&&j&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Ty(v.general.currencySymbol,d.storeCurrencyCode);let a="";if(v?.volumeBundle?.discountBadgeDisplay&&v?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=v.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${Sy(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${Sy(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${Sy(n.discountValue)}`);return a?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(Xu,{primaryBackgroundColorCta:o?ke:Te,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?Ne:ze},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},a)):null})(),t.imageUrl&&e.createElement("img",{src:Ny(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:Ie||"24px",borderTopRightRadius:Ie||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(Ku,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(Ju,{style:{fontSize:j?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===d.discountType&&Ty(v.general.currencySymbol,d.storeCurrencyCode),`${t.discountValue}`,"percentOff"===d.discountType&&"fi"," Off")),"Enabled"===v.volumeBundle?.discountBadgeVisibility&&!j&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Ty(v.general.currencySymbol,d.storeCurrencyCode);let a="";if(v?.volumeBundle?.discountBadgeDisplay&&v?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=v.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${Sy(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${Sy(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${Sy(n.discountValue)}`);return a?e.createElement(Xu,{primaryBackgroundColorCta:o?ke:Te,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?Ne:ze},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},a):null})(),o&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ke,color:Ne,padding:"2px"}},e.createElement(lt,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(eg,{style:{lineHeight:"normal",fontSize:j?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),ne(t.tier)?e.createElement(tg,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2),"data-savings":r.toFixed(C?0:2)},(()=>{const o=v?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",i="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(C?0:2),i=e.toFixed(C?0:2)}else"tier-price"===o&&(a=n.original.toFixed(C?0:2),i=n.discounted.toFixed(C?0:2));return e.createElement(e.Fragment,null,e.createElement(ng,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(i),"unit-price"===o?"/unit":""),r>0&&e.createElement(rg,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(a),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),o&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ke,color:Ne,padding:"2px"}},e.createElement(lt,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,T.map(t=>{const n=de(t.tier),r=n.original-n.discounted,o=!ne(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement(Qu,{cornerRadiusType:d?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:ke??"",isSelected:z===t.tier,onClick:()=>I(t.tier),style:{borderRadius:Ie,cursor:"pointer",backgroundColor:o?"#f5f5f5":"white",opacity:o?.6:1,...t?.badgeTitle&&{position:"relative",marginTop:"30px"}},className:"yt-volume-horizontal-tier-container "+(z===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2)},t.badgeTitle&&e.createElement(Yu,{primaryTextColorCta:Ne,primaryBackgroundColorCta:ke,style:{lineHeight:"normal",position:"absolute",top:"-16.5px",left:"2%",right:"2%",marginInline:"auto"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),t.imageUrl&&e.createElement("div",{style:{display:"flex",justifyContent:"center"},className:"yt-volume-horizontal-tier-image-container"},e.createElement("img",{src:Ny(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxWidth:j?"160px":"220px",borderTopLeftRadius:Ie,borderTopRightRadius:Ie},className:"yt-volume-horizontal-tier-image"})),e.createElement(Gu,{cornerRadiusType:d?.cornerRadiusType??"",style:{borderRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie},className:"yt-volume-horizontal-tier-header"},e.createElement(Zu,{className:"yt-volume-horizontal-tier-info"},e.createElement(sg,{"data-active":z===t.tier,accentColor:ke,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(cg,{name:"tier",checked:z===t.tier,onChange:()=>!o&&I(t.tier),disabled:o,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(dg,{accentColor:ke,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(Ku,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(Ju,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===d.discountType&&Ty(v.general.currencySymbol,d.storeCurrencyCode),`${t.discountValue}`,"percentOff"===d.discountType&&"fi"," ","Off")),"Enabled"===v.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Ty(v.general.currencySymbol,d.storeCurrencyCode);let o="";if(v?.volumeBundle?.discountBadgeDisplay&&v?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=v.volumeBundle;"discount-on-compare"===e&&(o="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${Sy(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(o="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${Sy(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(o="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${Sy(n.discountValue)}`);return o?e.createElement(Xu,{primaryBackgroundColorCta:ke,isSelected:z===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},o):null})()),e.createElement(eg,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),ne(t.tier)?e.createElement(tg,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(C?0:2),"data-discounted-price":n.discounted.toFixed(C?0:2),"data-savings":r.toFixed(0)},(()=>{const o=v?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",i="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(C?0:2),i=e.toFixed(C?0:2)}else"tier-price"===o&&(a=n.original.toFixed(C?0:2),i=n.discounted.toFixed(C?0:2));return e.createElement(e.Fragment,null,r>0?e.createElement(rg,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(a),"unit-price"===o?"/unit":""):"",e.createElement(ng,{className:"yt-volume-horizontal-tier-discounted-price"},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(i),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),z===t.tier&&e.createElement(og,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:g.productDetails.variants.edges.length>1||1===g.productDetails.variants.edges.length&&"Default Title"!==g.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:g.productDetails.variants.edges.length>1||1===g.productDetails.variants.edges.length&&"Default Title"!==g.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,r)=>{const a=t.tier-1,i=(P[a]||[])[r]||g.productDetails.options?.map(e=>e.values[0])||[],l=Xm(g?.productDetails)||1===g?.productDetails?.variants?.edges?.length&&"Default Title"!==g?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:r,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},l&&e.createElement(pg,{src:Ny(pe(g,F,r,t.tier)),onClick:e=>{if("details-modal"===O&&g?.productDetails){e.stopPropagation(),X({tier:t.tier,index:r});const n=$[t.tier]?.[r]||F,o=re(g,n)||g?.productDetails?.variants?.edges?.[0]?.node,a={...g.productDetails,selectedVariant:o};L(a)}},alt:g?.productDetails?.title||"Product",style:{height:"64px",width:"auto",cursor:"details-modal"===O?"pointer":"default"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===v?.volumeBundle?.variantSelectorType||"dropdown"===v?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},g?.productDetails?.options?.map((n,l)=>{const s=Zm(g.productDetails,i,l);if(s.length<=1)return null;const c=U?.tier===t.tier&&U?.index===r&&U?.optionIndex===l,p=d?.variantOptions?.options?.find(e=>e.name===n.name);let m="";return"color"===p?.type&&(m=p?.values?.find(e=>e.name===i[l])?.value||""),e.createElement(fg,{key:l,ref:e=>{ee.current[r]||(ee.current[r]=[]),ee.current[r][l]=e},style:{zIndex:c?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:c,onClick:e=>{e.preventDefault(),e.stopPropagation()}},v?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(yg,{onClick:e=>{e.stopPropagation(),e.preventDefault(),Y(c?null:{tier:t.tier,index:r,optionIndex:l})},isActive:c,disabled:o},"color"===p?.type&&m&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:m||"transparent",border:"1px solid #ddd"}}),i[l],e.createElement(Ze,{style:{display:"block"}})),c&&e.createElement(xg,{style:{zIndex:1001}},s.map((n,s)=>{const c=[...i];c[l]=n;const d=Km(g.productDetails,c),m=oe(t.tier,r,d,l,n),u=!m||o;if(!1===v?.general?.showOutOfStockVariants&&!m)return null;g.productDetails.variants.edges.find(({node:e})=>e.title===d.join(" / "));const f=e=>{if(e.preventDefault(),e.stopPropagation(),D(e=>{const t={...e},n=[...t[a]||[]];return n[r]=d,t[a]=n,t}),u){J({tier:z,index:r,optionIndex:l,value:n}),Y(null);const e=d.join(" / "),o=g.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||F;return void ie(t.tier,r,o)}const o=d.join(" / "),i=g.productDetails.variants.edges.find(e=>e.node.title===o)?.node.id||F;ie(t.tier,r,i),Y(null)},y=p?.values?.find(e=>e.name===n);return"image"===p?.type&&y?.value?e.createElement(mg,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),f(e)},style:{cursor:"pointer"}},e.createElement(ug,{src:y.value,alt:n}),n):"color"===p?.type&&y?.value?e.createElement(mg,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),f(e)},style:{cursor:"pointer"}},e.createElement(gg,{style:{backgroundColor:y.value}}),n):e.createElement(mg,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),f(e)},style:{cursor:"pointer"}},n)})))})),"swatches"===v?.volumeBundle?.variantSelectorType&&e.createElement(ag,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},g?.productDetails?.options.map((n,l)=>{const s=Zm(g.productDetails,i,l);if(s.length<=1)return null;const c=d.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},v?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},s.map(n=>{const s=i[l]===n,d=[...i];d[l]=n;const p=Km(g.productDetails,d),m=oe(t.tier,r,p,l,n),u=!m||o;if(!1===v?.general?.showOutOfStockVariants&&!m)return null;const f=c?.values?.find(e=>e.name===n),y=e=>{if(e.preventDefault(),e.stopPropagation(),u)return;D(e=>{const t={...e},n=[...t[a]||[]];return n[r]=p,t[a]=n,t});const n=p.join(" / "),o=g.productDetails.variants.edges.find(e=>e.node.title===n)?.node.id||F;ie(t.tier,r,o)},x={opacity:u?.5:1,cursor:u?"not-allowed":"pointer"};return"color"===c?.type&&f?.value?e.createElement("button",{key:n,onClick:y,style:{...x,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:s?`1px solid ${v.general?.primaryColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button yt-volume-horizontal-tier-variant-color-button"+(s?" yt-volume-horizontal-tier-variant-color-button--selected":""),disabled:u},e.createElement("div",{style:{width:s?"24px":"20px",height:s?"24px":"20px",borderRadius:"50%",backgroundColor:f.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===c?.type&&f?.value?e.createElement("button",{key:n,onClick:y,style:{...x,border:s?`1px solid ${v.general?.primaryColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:s?"#F7F7F7":"transparent",padding:"0px",width:s?"20px":"18px",height:s?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-button yt-volume-horizontal-tier-variant-image-button"+(s?" yt-volume-horizontal-tier-variant-image-button--selected":""),disabled:u},e.createElement("img",{src:f.value,alt:n,style:{width:s?"26px":"24px",height:s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(ig,{key:n,isSelected:s,onClick:y,style:{...x,padding:"4px 8px",border:s?`1px solid ${v.general?.primaryColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:s?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button yt-volume-horizontal-tier-variant-button-default"+(s?" yt-volume-horizontal-tier-variant-button-default--selected":""),disabled:u},n)})))})))})),K&&K.tier===t.tier&&e.createElement("div",{style:{color:ke,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${ke}1A`,padding:"12px",borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie}},"There aren’t enough items in our stock for select option, please select smaller bundle."),z===t.tier&&ve(t)&&(()=>{if("horizontal"===v?.volumeBundle?.cardStyle)return null;const n=ve(t),r=Q[t.tier],o=n.productDetails.variants.edges.find(e=>e.node.id===r)?.node||n.productDetails.variants.edges[0]?.node,a=v?.volumeBundle?.freebieDisplayType;return"compact"===a?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:Te||"#928d8d",borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie},className:"yt-volume-tier-freebie-detailed-section"},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:500},className:"yt-volume-tier-freebie-detailed-product-details"},e.createElement("strong",null,"+ FREE")," ",n.productDetails.title," worth"," ",Sy(o?.price)),e.createElement("span",{className:"yt-volume-tier-freebie-detailed-gift-icon",style:{color:"#fff",fontSize:"16px"}},e.createElement(st,{fill:"white"}))):e.createElement("div",{className:"yt-volume-freebie-compact-section",style:{padding:"12px 16px",borderTop:"1px solid #f0f0f0",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",gap:"12px",borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,paddingBottom:"20px"}},e.createElement("div",{style:{position:"relative",width:"56px",height:"56px",flexShrink:0},className:"yt-volume-freebie-compact-product-image"},e.createElement(pg,{src:Ny(o?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url),alt:n.productDetails.title,onClick:e=>{if("details-modal"===O&&n?.productDetails){e.stopPropagation(),X({tier:t.tier,index:-1,isFreebie:!0});const r={...n.productDetails,selectedVariant:o};L(r)}},style:{cursor:"details-modal"===O?"pointer":"default",height:"64px",width:"auto",objectFit:"cover",borderRadius:"6px"}})),e.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px"},className:"yt-volume-freebie-compact-product-details"},e.createElement("span",{style:{background:"#1a1a1a",color:"#fff",fontSize:"10px",fontWeight:600,padding:"2px 7px",borderRadius:"4px",display:"inline-block",width:"fit-content"}},"+ FREE"),e.createElement("span",{style:{fontSize:"14px",fontWeight:500}},n.productDetails.title),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},o?.title)))})()))})),(()=>{if(!T.some(e=>ve(e)))return null;const t=T.find(e=>e.tier===z),n=t?ve(t):null,r=T.find(e=>ve(e)),o=r?.title||`Pack of ${r?.minimumQuantity}`,a=n&&"detailed"===v?.volumeBundle?.freebieDisplayType;let i=null;if(a){const e=Q[t.tier];i=n.productDetails.variants.edges.find(t=>t.node.id===e)?.node||n.productDetails.variants.edges[0]?.node}return e.createElement("div",{style:{marginTop:"16px",marginBottom:d?.showCta?"16px":"0px",padding:a?"8px":"10px 12px",backgroundColor:`${ke}20`,border:"1px dashed #333",borderRadius:"8px",display:"flex",alignItems:"center",gap:"12px"},className:"yt-volume-freebie-status-banner"},a?e.createElement("div",{style:{display:"flex",gap:"12px",width:"100%",alignItems:"center"},className:"yt-volume-freebie-detailed-banner-container"},e.createElement("div",{style:{position:"relative",width:"60px",height:"60px",flexShrink:0,backgroundColor:"#eee",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image-container"},e.createElement("img",{src:Ny(i?.image?.url||n.productDetails.featuredMedia.preview.image.url),alt:n.productDetails.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image"}),e.createElement("div",{style:{position:"absolute",bottom:"-4px",right:"-4px",backgroundColor:"#fff",border:"1px solid #333",borderRadius:"4px",width:"20px",height:"20px",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2},className:"yt-volume-freebie-detailed-banner-gift-overlay"},e.createElement(st,{color:"#333",size:12}))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},className:"yt-volume-freebie-detailed-banner-text-container"},e.createElement("div",{style:{backgroundColor:"#333",color:"#fff",fontSize:"9px",fontWeight:"600",padding:"2px 6px",borderRadius:"4px",width:"fit-content"},className:"yt-volume-freebie-detailed-banner-pill"},"+ FREE — included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"),e.createElement("span",{style:{fontSize:"14px",fontWeight:"bold",color:"#111",lineHeight:"1.2",marginTop:"2px"},className:"yt-volume-freebie-detailed-banner-title"},n.productDetails.title),i?.title&&"Default Title"!==i.title&&e.createElement("span",{style:{fontSize:"12px",color:"#666",lineHeight:"1"},className:"yt-volume-freebie-detailed-banner-variant"},i.title))):e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:ke||"#ff4d94",borderRadius:"4px",width:"24px",height:"24px",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},className:"yt-volume-freebie-compact-banner-icon"},e.createElement(ct,{color:"#fff",size:16})),e.createElement("div",{style:{fontSize:"14px",color:"#111",lineHeight:"1.3"},className:"yt-volume-freebie-compact-banner-text"},n?e.createElement(e.Fragment,null,e.createElement("strong",null,"Free ",n.productDetails.title)," ","— included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"):e.createElement("span",{style:{fontWeight:500}},"Select ",e.createElement("strong",null,o)," to unlock a free gift."))))})(),d?.showCta&&"shopify_atc_button"!==v.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(lg,{bgColor:p?"#dc2626":ae(z)?v.general?.ctaBackgroundColor:"#ccc",textColor:p?"#ffffff":ae(z)?v.general?.ctaTextColor:"#666",border:`1px solid ${p?"#dc2626":ae(z)?v.general?.ctaBorderColor||"#121212":"#999"}`,shadow:v.general.ctaShadowType,padding:v.general?.ctaPadding,width:v.general?.ctaWidth,hoverProperties:{customizeHoverState:!(!ae(z)||p)&&v.general?.customizeHoverState,backgroundColor:v.general?.ctaHoverBackgroundColor,textColor:v.general?.ctaHoverTextColor},onClick:()=>{_||fe()},borderRadius:v.general.ctaBorderRadius??"",disabled:!ae(z),className:"yt-volume-add-to-cart-button"},"animated"===v?.general?.atcLoaderType?e.createElement(Ou,{color:"white",loading:_,size:22},ae(z)?p?e.createElement(e.Fragment,null,p):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,v.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=de(z);return e.createElement(e.Fragment,null,Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t.discounted.toFixed(C?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t?.original.toFixed(C?0:2))," "))})()),v?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}))):e.createElement(e.Fragment,null,"Out of Stock")):_?e.createElement($e,{color:"white",loading:_,size:20}):ae(z)?p?e.createElement(e.Fragment,null,p):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,v.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=de(z);return e.createElement(e.Fragment,null,Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t.discounted.toFixed(C?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},Ty(v.general.currencySymbol,d.storeCurrencyCode),Sy(t?.original.toFixed(C?0:2))," "))})()),v?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}))):e.createElement(e.Fragment,null,"Out of Stock"))),d?.personalizedForm?.title&&e.createElement(Mu,{isOpen:M,onClose:()=>W(!1),formConfig:d.personalizedForm,onCheckout:async e=>{await me(e,{isCheckout:V}),W(!1)},cta:{backgroundColor:v.general?.ctaBackgroundColor||"#121212",textColor:v.general?.ctaTextColor||"#FFFFFF"},isMobile:j}),e.createElement(yu,{bundleType:"volumeBundle",bundle:d,handleAddToBundle:()=>{},selectedProducts:[],remainingQuantity:0,hideAddToBundle:!0,disableQuantitySelector:!0,themeColor:v?.general?.primaryColor||"#000",primaryTextColorCta:v?.general?.primaryContrastColor||"#fff",primaryBackgroundColorCta:v?.general?.primaryColor||"#000",cornerRadius:"8px",styles:v,onVariantSelect:e=>{if(Z)if(Z.isFreebie)G(t=>({...t,[Z.tier]:e}));else{const t=Z.tier-1,n=re(g,e);if(n?.title&&"Default Title"!==n.title){const e=Gm(g?.productDetails,n);D(n=>{const r={...n},o=[...r[t]||[]];return o[Z.index]=e,r[t]=o,r})}ie(Z.tier,Z.index,e)}}}))}const wg=d.div`
3909
3909
  container-type: inline-size;
3910
3910
  border-radius: ${e=>e.borderRadius?e.borderRadius:"8px"};
3911
3911
  max-width: 800px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.10.129",
3
+ "version": "0.10.130",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "rm -rf dist && tsc && rollup -c",