yt-uikit 0.10.76 → 0.10.77

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.
@@ -342,6 +342,7 @@ export type BundlePayload = {
342
342
  primaryBackgroundColorCta?: string;
343
343
  enableProgressBar?: boolean;
344
344
  enableSortAndFilter?: boolean;
345
+ selectedCategories?: string[];
345
346
  disableQuantitySelector?: boolean;
346
347
  disableInventoryTracking?: boolean;
347
348
  alignFixedBundleContent?: "left" | "right" | "center" | "";
package/dist/esm/index.js CHANGED
@@ -3452,7 +3452,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
3452
3452
  font-size: 1em;
3453
3453
  justify-content: center;
3454
3454
  align-items: center;
3455
- `;const pd=({options:t,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i,showOutOfStockVariants:l=!0})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const i=!a||a(t.name);return l||i?e.createElement("div",{key:t.name,onClick:()=>{i&&r(t)},style:{cursor:i?"pointer":"not-allowed"}},((t,n)=>{const r=!a||a(t.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"},className:r?"":"variant-out-of-stock"}):e.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"},className:r?"":"variant-out-of-stock"},t.name);return"image"===o?e.createElement("img",{src:Jn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"},className:r?"":"variant-out-of-stock"}):e.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"},className:r?"":"variant-out-of-stock"},t.name)})(t,n?.name===t.name)):null})),md=({product:o,isOpen:a,onClose:i,variantOptions:l,cta:s,onConfirm:c,showOutOfStockVariants:d=!0})=>{const p=r(()=>e=>e?o?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[o?.tracksInventory]),m=r(()=>{const e=o.variants.edges.find(e=>{const t=e.node;return p(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):o.options?.map(e=>e.values[0])||[]},[o,p]),[u,g]=t(m),[y,f]=t(window.innerWidth<1024);n(()=>{const e=()=>f(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&i()};return a&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[a,i]);const x=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,h=x?.image?.url||o.featuredMedia?.preview?.image?.url,b=Jn(h,150,85,"webp"),w=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},C=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!a)return null;const E=e.createElement("div",{onClick:i,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:o.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},o.title))),e.createElement("div",{style:{padding:"20px"}},o.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(t,n)?.name||t.values[0])),e.createElement(pd,{options:v(t),selectedValue:C(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,g(n)})(n,e)},type:w(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const r=o.options?.length>0?n.join(" / "):n[0],a=o.variants.edges.find(e=>e.node.title===r)?.node;return!!a&&p(a)>0})(n,e),isMobile:y,showOutOfStockVariants:d}))))),e.createElement("button",{onClick:()=>{const e=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&p(e)>0;if(e?.id&&t)c(e.id),i();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=o.variants.edges.find(e=>p(e.node)>0)?.node.id;e&&(c(e),i())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:s.backgroundColor,color:s.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},"data-gokwik-processed":"true"},"Add to Bundle")));return M.createPortal(E,document.body)},ud=e=>e.split("?")[0],gd=({className:t,product:n,rating:r,reviewRatingType:o})=>{const a=n?.rating?.averageRating??r?.averageRating??0,i=n?.rating?.ratingCount??r?.ratingCount??0;return a<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===o&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},a," rating")),"ratingAndReviewCount"===o&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14}),a,e.createElement(_e,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",i," reviews)"))},yd=({isMobile:t,product:n,bundleType:r,images:o,mobileScrollRef:a,desktopThumbsRef:i,selectedVariantImage:l,currentImageIndex:s,setCurrentImageIndex:c,themeColor:d})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:a,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},o.length>0&&o.map((t,o)=>e.createElement("div",{key:o,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(Rt,{small:Nu(t?.url),medium:Nu(t?.url),large:Nu(t?.url),alt:t.altText||`${n?.title||"Product"} - Image ${o+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:`yt-${r}-modal-desktop-main-image yt-${r}-modal-desktop-main-image`})))):e.createElement(e.Fragment,null,e.createElement(Rt,{small:Nu(l??"")||Nu(o[s]?.url),medium:Nu(l??"")||Nu(o[s]?.url),large:Nu(l??"")||Nu(o[s]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:`yt-${r}-modal-desktop-main-image yt-${r}-modal-desktop-main-image main-image`}),e.createElement("div",{ref:i,style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},o.length>1&&o.map((r,o)=>e.createElement("img",{key:o,src:Nu(r?.url),alt:r.altText||`${n?.title||"Product"} - Image ${o+1}`,onClick:()=>c(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:s===o?`2px solid ${d||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),fd=({className:t,product:n,selectedVariant:r,onVariantChange:o,getMaxAvailableQty:a,showOutOfStockVariants:i})=>n?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},n.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},r?.title)),e.createElement("select",{className:`${t}-select`,value:r?.id||"",onChange:o,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},n?.variants?.edges?.map(({node:t})=>!1===i&&0===a(t)?null:e.createElement("option",{key:t.id,value:t.id,disabled:0===a(t),className:0===a(t)?"variant-out-of-stock":""},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(yt,null)))),xd=({isMobile:t,product:n,selectedVariants:r,getOptionValues:o,getSelectedOption:a,getOptionType:i,isOptionValueAvailable:l,onOptionChange:s,showOutOfStockVariants:c})=>e.createElement(e.Fragment,null,n.options.map((n,d)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},r[d]||n.values[0])),e.createElement(pd,{options:o(n),selectedValue:a(n,d),onChange:e=>{s(d,e)},type:i(n.name),isOptionAvailable:e=>l(d,e),isMobile:t,showOutOfStockVariants:!1!==c}))))),hd=({isMobile:t,bundleType:n,selectedVariant:r,discountedPrice:o,compareAtDisplayPrice:a,isFreebieTier:i,showFreebieTierProductPrices:l,currencySymbol:s,primaryColor:c})=>e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-price yt-${n}-modal-${t?"mobile":"desktop"}-price`,style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},i&&!l?e.createElement(e.Fragment,null,e.createElement("span",{className:`yt-${n}-compare-price yt-${n}-compare-price yt-fixed-bundle-original-price`,style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Su(s),Tu(r?.price)),e.createElement("span",{className:`yt-${n}-current-price yt-${n}-current-price`,style:{color:c||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,a>0&&e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-compare-price yt-${n}-modal-${t?"mobile":"desktop"}-compare-price`,style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Su(s),Tu(a)),e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-current-price yt-${n}-modal-${t?"mobile":"desktop"}-current-price`},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"left",lineHeight:"normal"}},Su(s),Tu(o))))),bd=({isMobile:t,bundleType:n,hideAddToBundle:r,themeColor:o,cornerRadius:a,primaryTextColorCta:i,disabled:l,onClick:s,label:c})=>r?null:e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-atc-wrapper yt-${n}-modal-${t?"mobile":"desktop"}-atc-wrapper ${t?"":"yt-product-modal-atc-wrapper"}`,style:{width:t?"100%":"80%"}},e.createElement("button",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-atc-button yt-${n}-modal-${t?"mobile":"desktop"}-atc-button ${t?"":"yt-product-modal-atc-button"}`,style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:o||"#111",borderRadius:a,color:i||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:l?.5:1,cursor:l?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),s()},disabled:l},c)),wd=l((i,l)=>{const[s,c]=ve(id),d=r(()=>{const e=i.bundleType;return e&&i.styles?.[e]?i.styles[e]:i.styles?.byob},[i.styles,i.bundleType]),p=i.reviewRatingType??{byob:i.styles?.byob?.productRatingsDisplay,fixedBundle:i.styles?.fixedBundle?.productRatingsDisplay,comboBundle:i.styles?.comboBundle?.comboProductRatingsDisplay}[i.bundleType??""]??i.bundle?.reviewRatingType,m=d?.productVariantTitleType,u=d?.variantSelectorType??d?.comboVariantTypeSelector??"dropdown",g=r(()=>e=>{const t=i?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:e?s?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?i?.bundleProductsCustomQuantity??e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?i?.bundleProductsCustomQuantity??1/0:0:i?.bundleProductsCustomQuantity??1/0:0},[s?.tracksInventory,i?.customVariantsQuantity,i?.bundleProductsCustomQuantity]),y=s?.variants.edges?.filter(e=>g(e.node)>0)||[],[f,x]=t(y?.[0]?.node),h=r(()=>{if(!f)return 0;const e=parseFloat(f?.price??"0");let t=e;if("comboBundle"===i.bundleType){const n=Number(i.totalPriceSum||0);let r=Number(i.dealPrice||0);!r&&i.bundle&&(i.bundle?.percentageOff?r=n*(1-i.bundle.percentageOff/100):i.bundle?.dealAmount?r=i.bundle.dealAmount:i.bundle?.amountOff&&(r=n-i.bundle.amountOff)),n>0&&r>0&&(t=e/n*r)}else if("fixedBundle"===i.bundleType){const n=i.bundleDiscountType||(i.bundle?.percentageOff?"percentageOff":i.bundle?.dealAmount?"fixedPrice":i.bundle?.amountOff?"amountOff":""),r=i.bundleDiscountValue??i.bundle?.percentageOff??i.bundle?.dealAmount??i.bundle?.amountOff??0,o=i.totalSelectedOriginal??0;if(r)switch(n){case"percentOff":case"percentageOff":case"percentage":case"Percentage":t=e*(1-r/100);break;case"amountOff":case"amount":case"Amount Off":if(o>0){const n=e/o*r;t=Math.max(0,e-n)}break;case"fixedPrice":case"fixed":case"fixedPrice":if(o>0){t=r*(e/o)}}}return parseFloat(t.toFixed(2))},[f,i.bundleType,i.totalPriceSum,i.dealPrice,i.bundleDiscountType,i.bundleDiscountValue,i.totalSelectedOriginal,i.bundle]),b=r(()=>{if(!f)return 0;const e=parseFloat(f?.price??"0"),t=parseFloat(f?.compareAtPrice??"0"),n=i.styles?.[i.bundleType||""]||i.styles?.general,r=n?.discountBadgeDisplay;let o=0;return"comboBundle"===i.bundleType||"fixedBundle"===i.bundleType?"discount-on-compare"===r&&t>0?o=t:h<e?o=e:t>e&&(o=t):t>e&&(o=t),o>0?parseFloat(o.toFixed(2)):0},[f,i.bundleType,i.styles,h]),[w,v]=t(0),[C,E]=t("undefined"!=typeof window&&window.innerWidth<=600),[k,T]=t(1),[S,N]=t("idle"),F=o(null),B=o(null),I=o(null),[z,$]=t(null),P=o(!1),A=o(),[D,_]=t(0),[L,R]=t(),O=r(()=>{const e=s?.variants.edges.find(e=>{const t=e.node;return g(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):s?.options?.map(e=>e.values[0])||[]},[s,g]),[V,W]=t(O);n(()=>{if(s?.id){P.current=!1;const e=s.variants.edges?.filter(e=>g(e.node)>0),t=s?.selectedVariant??e[0]?.node;x(t);const n=t?.image?.url,r=n?(s.media?.edges??[]).map(e=>e?.node?.preview?.image??e?.node?.image).filter(e=>e?.url?.length>0).findIndex(e=>ud(e.url)===ud(n)):-1;$(s.selectedVariant&&r>=0?{index:r}:null),v(r>=0?r:0),R(r>=0?void 0:n),t?.title&&"Default Title"!==t.title&&W(t.title.split(" / "))}},[s?.id]),n(()=>{const e=i.selectedProducts?.find(e=>e.variantId===f?.id);T(e?e.quantity:0)},[i.selectedProducts,f?.id]);const j=o(i.onVariantSelect);n(()=>{j.current=i.onVariantSelect},[i.onVariantSelect]),n(()=>{f?.id&&s&&P.current&&j.current?.(f.id,s)},[f?.id,s?.id]),n(()=>{if(!z)return;let e=!1;[B.current,I.current].forEach(t=>{const n=t?.children[z.index];t&&n&&(n.scrollIntoView({behavior:"instant",block:"nearest",inline:"center"}),e=!0)}),e&&$(null)},[z,s?.media?.edges?.length]);const H=()=>{f?.id&&s&&(N("check"),i.handleAddToBundle(f?.id,s,1),clearTimeout(A.current),A.current=setTimeout(()=>{N("idle"),c(void 0)},500))};n(()=>{const e=()=>E(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>()=>clearTimeout(A.current),[]);const q=s?.descriptionHtml??"",U=s?.media,Q=U?.edges?.map(e=>e?.node?.preview?.image??e?.node?.image).filter(e=>e?.url?.length>0)??[],Y=a(e=>{v(e),R(void 0)},[]),G=a(e=>{const t=e.target.value,n=y?.find(e=>e.node.id===t)?.node;n&&g(n)>0&&(P.current=!0,x(n),R(n?.image?.url),n.title&&"Default Title"!==n.title&&W(n.title.split(" / ")))},[y,g]),Z=a(e=>{if(!i.bundleVariantOptions?.options)return"text";const t=i.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[i.bundleVariantOptions]),X=a(e=>{if(!i?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=i?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[i.bundleVariantOptions]),K=a((e,t)=>{const n=[...V];n[e]=t.name,W(n);const r=(s?.options?.length??0)>0?n.join(" / "):n[0],o=s?.variants.edges.find(e=>e.node.title===r)?.node;R(o?.image?.url),o&&g(o)>0&&(P.current=!0,x(o))},[V,s,g]),J=a((e,t)=>{const n=V[t];if(!n)return null;return X(e).find(e=>e.name===n)||null},[V,X]),ee=a((e,t)=>{const n=[...V];n[e]=t;const r=(s?.options?.length??0)>0?n.join(" / "):n[0],o=s?.variants.edges.find(e=>e.node.title===r)?.node;return!!o&&g(o)>0},[V,s,g]);if(n(()=>{if(s?.id){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{c(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[s?.id,c]),n(()=>{if(C&&s?.id&&F.current){const e=()=>{F.current&&_(F.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[C,s?.id]),!s)return null;const ne=i.selectedProducts.filter(e=>e.variantId===f?.id).reduce((e,t)=>e+t.quantity,0),re=i.customVariantsQuantity?.find(e=>e.variantId===f?.id)?.quantity??i.bundleProductsCustomQuantity??1/0,oe=re!==1/0&&ne>=re,ae=i.hideAddToBundle||!f||g(f)<=0||oe||"idle"!==S||i?.disableQuantitySelector&&1===k,ie=e.createElement(sd,{className:`yt-${i?.bundleType}-modal-desktop-overlay yt-${i?.bundleType}-modal-desktop-overlay`,onClick:()=>c(void 0)},e.createElement(cd,{$isSmallScreen:C,ref:l,onClick:e=>e.stopPropagation()},e.createElement(dd,{ref:l,className:`yt-${i?.bundleType}-modal-desktop-container yt-${i?.bundleType}-modal-desktop-container yt-variant-selection-modal`},e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop yt-${i?.bundleType}-modal-desktop yt-variant-selection-modal ${C?"small-screen":"large-screen"}`},e.createElement(ld,{className:`yt-${i?.bundleType}-modal-desktop-close yt-${i?.bundleType}-modal-desktop-close`,onClick:()=>{c(void 0)},style:{backgroundColor:"white"}},e.createElement(te,{size:"25"})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-image-section yt-${i?.bundleType}-modal-desktop-image-section image-section`},e.createElement(yd,{product:s,bundleType:i.bundleType,images:Q,mobileScrollRef:B,desktopThumbsRef:I,selectedVariantImage:L,currentImageIndex:w,setCurrentImageIndex:Y,themeColor:i.themeColor})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-details-section yt-${i?.bundleType}-modal-desktop-details-section details-section`,style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:`yt-${i?.bundleType}-modal-desktop-title yt-${i?.bundleType}-modal-desktop-title`},"byob"===i?.bundleType?e.createElement(e.Fragment,null,"variant-display-name"===m&&s?.selectedVariant?.displayName?s?.selectedVariant?.displayName:"variant-title"===m&&s?.selectedVariant?.title?s?.selectedVariant?.title:s?.title):s?.title),e.createElement(gd,{product:s,rating:i.rating,reviewRatingType:p,className:`yt-${i?.bundleType}-modal-desktop-rating yt-${i?.bundleType}-modal-desktop-rating`}),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-variant-price-wrapper yt-${i?.bundleType}-modal-desktop-variant-price-wrapper`,style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===u&&e.createElement(fd,{product:s,selectedVariant:f,onVariantChange:G,getMaxAvailableQty:g,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants,className:`yt-${i?.bundleType}-modal-desktop-variant-selector yt-${i?.bundleType}-modal-desktop-variant-selector`}),"customOptions"===u&&e.createElement(xd,{product:s,selectedVariants:V,getOptionValues:X,getSelectedOption:J,getOptionType:Z,isOptionValueAvailable:ee,onOptionChange:K,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants}),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-price-atc-wrapper yt-${i?.bundleType}-modal-desktop-price-atc-wrapper`,style:{display:"flex",justifyContent:i.hideAddToBundle?"flex-start":"center",alignItems:"center",width:"100%"}},e.createElement(hd,{bundleType:i.bundleType,selectedVariant:f,discountedPrice:h,compareAtDisplayPrice:b,isFreebieTier:i.isFreebieTier,showFreebieTierProductPrices:i.showFreebieTierProductPrices,currencySymbol:i.styles.general.currencySymbol,primaryColor:i.styles.general.primaryColor}),e.createElement(bd,{bundleType:i.bundleType,hideAddToBundle:i.hideAddToBundle,themeColor:i.themeColor,cornerRadius:i.cornerRadius,primaryTextColorCta:i.primaryTextColorCta,disabled:ae,onClick:H,label:i.styles?.byob?.addToBundleCTAText??"Add to bundle"}))),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-divider yt-${i?.bundleType}-modal-desktop-divider`,style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:`yt-${i?.bundleType}-modal-desktop-description yt-${i?.bundleType}-modal-desktop-description yt-description-content`,style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:q}})))))),le=e.createElement(sd,{className:`yt-${i?.bundleType}-modal-mobile-overlay yt-${i?.bundleType}-modal-mobile-overlay`,onClick:()=>c(void 0)},e.createElement(cd,{className:`yt-${i?.bundleType}-modal-mobile-content yt-${i?.bundleType}-modal-mobile-content`,style:{padding:"0px",position:"relative"},$isSmallScreen:C,ref:l,onClick:e=>e.stopPropagation()},e.createElement(dd,{ref:l,className:`yt-${i?.bundleType}-modal-mobile-container yt-${i?.bundleType}-modal-mobile-container yt-variant-selection-modal`},e.createElement("button",{className:`yt-${i?.bundleType}-modal-mobile-close-btn yt-${i?.bundleType}-modal-mobile-close-btn`,style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{c(void 0)}},e.createElement(gt,{className:`yt-${i?.bundleType}-modal-mobile-close-icon yt-${i?.bundleType}-modal-mobile-close-icon`,style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile yt-${i?.bundleType}-modal-mobile yt-variant-selection-modal small-screen`,style:{padding:"0px"}},e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-image-section yt-${i?.bundleType}-modal-mobile-image-section image-section`},e.createElement(yd,{product:s,bundleType:i.bundleType,images:Q,mobileScrollRef:B,desktopThumbsRef:I,selectedVariantImage:L,currentImageIndex:w,setCurrentImageIndex:Y,themeColor:i.themeColor,isMobile:!0})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-details-section yt-${i?.bundleType}-modal-mobile-details-section details-section`,style:{padding:"0 30px",margin:"15px 0",paddingBottom:D?`${D+20}px`:"120px"}},e.createElement("h2",{className:`yt-${i?.bundleType}-modal-mobile-title yt-${i?.bundleType}-modal-mobile-title`,style:{margin:"0px"}},"byob"===i?.bundleType?e.createElement(e.Fragment,null,"variant-display-name"===m&&s?.selectedVariant?.displayName?s?.selectedVariant?.displayName:"variant-title"===m&&s?.selectedVariant?.title?s?.selectedVariant?.title:s?.title):s?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(gd,{product:s,rating:i.rating,reviewRatingType:p,className:`yt-${i?.bundleType}-modal-mobile-rating yt-${i?.bundleType}-modal-mobile-rating`})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-divider yt-${i?.bundleType}-modal-mobile-divider`,style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-description yt-${i?.bundleType}-modal-mobile-description yt-description-content`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:q}})))),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-bottom-bar yt-${i?.bundleType}-modal-mobile-bottom-bar`,ref:F,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===u?e.createElement(xd,{product:s,selectedVariants:V,getOptionValues:X,getSelectedOption:J,getOptionType:Z,isOptionValueAvailable:ee,onOptionChange:K,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants,isMobile:!0}):e.createElement(fd,{product:s,selectedVariant:f,onVariantChange:G,getMaxAvailableQty:g,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants,className:`yt-${i?.bundleType}-modal-desktop-variant-selector yt-${i?.bundleType}-modal-desktop-variant-selector`}),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-price-atc-wrapper yt-${i?.bundleType}-modal-mobile-price-atc-wrapper`,style:{display:"flex",justifyContent:i.hideAddToBundle?"flex-start":"center",alignItems:"center",width:"100%"}},e.createElement(hd,{bundleType:i.bundleType,selectedVariant:f,discountedPrice:h,compareAtDisplayPrice:b,isFreebieTier:i.isFreebieTier,showFreebieTierProductPrices:i.showFreebieTierProductPrices,currencySymbol:i.styles.general.currencySymbol,primaryColor:i.styles.general.primaryColor,isMobile:!0}),e.createElement(bd,{bundleType:i.bundleType,hideAddToBundle:i.hideAddToBundle,themeColor:i.themeColor,cornerRadius:i.cornerRadius,primaryTextColorCta:i.primaryTextColorCta,disabled:ae,onClick:H,label:i.styles?.byob?.addToBundleCTAText??"Add to bundle",isMobile:!0})))));return M.createPortal(C?le:ie,document.body)}),vd=({coverImageUrl:t,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map(({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const s=t||n||"",c=i(s,800)||s,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:c,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Cd=({title:t,isOpen:n,onToggle:r,children:o})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:r,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(et,{className:"yt-byob-icon-minus",size:20}):e.createElement(Ze,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},o)),Ed=({availableFilters:n,appliedFilters:r,toggleFilter:o,clearAllFilters:a,applyPriceFilter:i,priceMin:l,setPriceMin:s,priceMax:c,setPriceMax:d,maxPossiblePrice:p,styles:m,availableProductCount:u,products:g,unavailableProductCount:y,storeCurrencyCode:f,showActions:x=!0,openSections:h,toggleSection:b})=>{const[w,v]=t(null),C=Su(m?.general?.currencySymbol)??f??"USD";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Cd,{key:t.id,title:t.label,isOpen:!!h[t.id],onToggle:()=>b(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const a=r[t.id]?.includes(n.id)||!1;return"filter.v.availability.1"===n.id?u??g.length:"filter.v.availability.0"===n.id||n.count,e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:a,onChange:()=>o(t.id,n.id),style:{width:"18px",height:"18px",accentColor:m?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,c.toLocaleString()),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-c/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>v("min"),onTouchStart:()=>v("min"),onChange:e=>{const t=Math.min(Number(e.target.value),c-10);s(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===w?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:c,onMouseDown:()=>v("max"),onTouchStart:()=>v("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===w?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),x&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:a,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:i,style:{flex:1,padding:"8px",background:m?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},kd=t=>{const{showFiltersDrawer:n,handleClose:r,isAnimating:o,isMobile:a}=t;return n?V(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:o?1:0,transition:"opacity 300ms ease-in-out"},onClick:r},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:a?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:o?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Ed,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),r()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},Td=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Ed,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},Sd=({enableSortAndFilter:r,isMobile:o,setSearchTerm:a,searchTerm:i,styles:l,setSortBy:s,appliedFilters:c,setAppliedFilters:d,availableFilters:p=[],products:m,availableProductCount:u,unavailableProductCount:g,maxPossiblePrice:y,storeCurrencyCode:f,sharedFiltersState:x,openSections:b,toggleSection:w,sortBy:v})=>{const[C,E]=t(!1),[k,T]=t(i),{showFilters:S,setShowFilters:N,priceMax:F,setPriceMax:B,priceMin:I,setPriceMin:z}=x,[$,P]=t(!1),A=l?.byob?.productFiltersDisplay||"drawer",D=!o&&"sidebar"===A,_="none"===A;n(()=>{c["filter.v.price"]||(B(y),z(0))},[y,c]);n(()=>{const e=setTimeout(()=>{a(k)},300);return()=>clearTimeout(e)},[k,a]),n(()=>(S&&!D?(document.body.style.overflow="hidden",P(!0)):(document.body.style.overflow="",P(!1)),()=>{document.body.style.overflow=""}),[S,D]);const L=Object.entries(c).reduce((e,[t,n])=>"filter.v.price"===t?I>0||F<y?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:o?"column":"row",justifyContent:"space-between",alignItems:o?"flex-end":"center",marginBottom:"20px",width:"100%",gap:o?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:r?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},r&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:o?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},o&&!C?e.createElement(Xe,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:o?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(Xe,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),o&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>N(!S),style:{display:_?"none":"flex",alignItems:"center",gap:o?"0px":"6px",background:S&&D?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Ke,{className:"yt-byob-filter-toggle-icon",size:18}),!o&&"Filters",L>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},L)),r&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!o&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),o&&e.createElement(Je,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:v,onChange:e=>s(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(h,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!D&&!_&&e.createElement(kd,{showFiltersDrawer:S,handleClose:()=>{D?N(!1):(document.body.style.overflow="",P(!1),setTimeout(()=>{N(!1)},300))},isAnimating:$,isMobile:o,availableFilters:p,appliedFilters:c,toggleFilter:(e,t)=>{d(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{B(y),z(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${I}-max:${F}`],t})},priceMin:I,setPriceMin:z,priceMax:F,setPriceMax:B,maxPossiblePrice:y,styles:l,availableProductCount:u,products:m,unavailableProductCount:g,storeCurrencyCode:f,openSections:b,toggleSection:w}))},Nd=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),Fd=({title:t,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="string"==typeof n?{url:n,name:"Attachment"}:n,l=i?.loading,s=i?.error,c=i?.url;return e.createElement("div",{className:"yt-personalization-upload-field",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",border:"1px dashed #ccc",borderRadius:"10px",background:"#fff",gap:"12px"}},e.createElement("div",{className:"yt-personalized-form-field-content",style:{flex:1,minWidth:0}},e.createElement("div",{className:"yt-personalized-form-field-title",style:{fontWeight:600,fontSize:"14px",color:"#1a1a1a"}},t),!i&&!l&&!s&&e.createElement("div",{className:"yt-personalized-form-field-hint",style:{fontSize:"12px",color:"#888",marginTop:"2px"}},"jpeg/png/img (max size: 5MB)"),l&&e.createElement("div",{className:"yt-personalized-form-field-loading",style:{display:"flex",alignItems:"center",gap:"6px",color:"#007bff",fontSize:"12px",marginTop:"4px"}},e.createElement(Nd,null)," Uploading ",i?.name||"image","..."),s&&e.createElement("div",{className:"yt-personalized-form-field-error",style:{fontSize:"12px",color:"#dc3545",marginTop:"2px"}},"Upload failed."),c&&!l&&!s&&e.createElement("div",{className:"yt-personalized-form-field-preview",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px"}},e.createElement("img",{className:"yt-personalized-form-field-preview-image",src:i.url,alt:"Uploaded",style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"4px",border:"1px solid #eee"}}),e.createElement("span",{className:"yt-personalized-form-field-preview-name",style:{fontSize:"12px",color:"#28a745",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},i.name))),e.createElement("div",{className:"yt-personalized-form-field-actions",style:{flexShrink:0}},s&&e.createElement("button",{type:"button",className:"yt-personalized-form-retry-button",onClick:a,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Retry"),c&&!l&&!s&&e.createElement("button",{type:"button",className:"yt-personalized-form-remove-button",onClick:o,style:{fontSize:"13px",fontWeight:600,color:"#fff",background:"#dc3545",border:"none",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Remove"),!i&&!l&&e.createElement("button",{type:"button",className:"yt-personalized-form-upload-button",onClick:r,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Upload Image")))},Bd=({form:r,formData:a,setFormData:i,barHeight:l=0,isUploading:s,setIsUploading:c})=>{const d=o(new Map),[p,m]=t(!1),u=c??m;n(()=>()=>{d.current.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),d.current.clear()},[]);const g=e=>{if(!d.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.multiple=!1,t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");i(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),u(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw alert("Upload failed. Try again."),e}finally{u(!1)}})(n);i(r=>({...r,[e]:{url:t,name:n.name}}))}catch{i(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),d.current.set(e,t)}return d.current.get(e)};return e.createElement("div",{className:"yt-personalized-form",style:{width:"100%",padding:"8px 0",marginBottom:`${l}px`,boxSizing:"border-box"}},r.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-personalized-form-section",style:{marginBottom:"28px"}},e.createElement("label",{className:"yt-personalized-form-section-title",style:{display:"block",fontWeight:700,marginBottom:"10px",color:"#1a1a1a",fontSize:"15px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-personalized-form-text-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement("textarea",{key:r,className:"yt-personalized-form-textarea",placeholder:t?.title,rows:3,maxLength:500,value:a[r]||"",onChange:e=>i(t=>({...t,[r]:e.target.value})),style:{width:"100%",padding:"8px 0",border:"none",borderBottom:"1.5px solid #ddd",borderRadius:0,fontSize:"14px",color:"#1a1a1a",background:"transparent",resize:"none",outline:"none",lineHeight:"1.5",boxSizing:"border-box"}})})),"image"===t.type&&e.createElement("div",{className:"yt-personalized-form-image-section"},e.createElement("div",{className:"yt-personalized-form-image-hint",style:{fontSize:"12px",color:"#888",marginBottom:"10px"}},"Supported formats - jpeg/png/img (max size: 5MB)"),e.createElement("div",{className:"yt-personalized-form-image-fields",style:{display:"flex",flexDirection:"column",gap:"10px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement(Fd,{key:r,title:t?.title,uploadState:a[r],onUpload:()=>g(r).click(),onRemove:()=>i(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>g(r).click()})}))))))},Id={position:"absolute",width:72,height:72,border:"4px solid #333366",background:"#fff",boxSizing:"border-box"},zd={...Id},$d="6s",Pd=({isOpen:t,message:n="Preparing Bundle..."})=>{if(!t)return null;const r=e.createElement(e.Fragment,null,e.createElement("style",null,"\n@keyframes ytBundleLoaderFadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes ytBundleLoaderFloat {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-10px); }\n}\n\n/*\n * Flaps start OPEN, stay open while items fall, then close, pause, reopen.\n * 0-60%: open (180deg) — items fall in\n * 60-78%: closing\n * 78-88%: closed pause\n * 88-100%: reopening\n */\n@keyframes ytBundleLoaderOpenNorth {\n 0% { transform: rotateX(180deg); }\n 60% { transform: rotateX(180deg); }\n 78% { transform: rotateX(0deg); }\n 88% { transform: rotateX(0deg); }\n 100% { transform: rotateX(180deg); }\n}\n@keyframes ytBundleLoaderOpenSouth {\n 0% { transform: rotateX(-180deg); }\n 60% { transform: rotateX(-180deg); }\n 78% { transform: rotateX(0deg); }\n 88% { transform: rotateX(0deg); }\n 100% { transform: rotateX(-180deg); }\n}\n@keyframes ytBundleLoaderOpenEast {\n 0% { transform: rotateY(180deg); }\n 60% { transform: rotateY(180deg); }\n 78% { transform: rotateY(0deg); }\n 88% { transform: rotateY(0deg); }\n 100% { transform: rotateY(180deg); }\n}\n@keyframes ytBundleLoaderOpenWest {\n 0% { transform: rotateY(-180deg); }\n 60% { transform: rotateY(-180deg); }\n 78% { transform: rotateY(0deg); }\n 88% { transform: rotateY(0deg); }\n 100% { transform: rotateY(-180deg); }\n}\n\n/* Item 1: falls into top box opening and disappears behind front wall */\n@keyframes ytBundleLoaderItemFall1 {\n 0%, 5% {\n transform: translate3d(-50%, -90px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.5);\n opacity: 0;\n }\n 10% {\n transform: translate3d(-50%, -65px, 0px) rotateY(-50deg) rotateX(45deg) scale(1);\n opacity: 1;\n }\n 22% {\n transform: translate3d(-50%, -5px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.85);\n opacity: 1;\n }\n 27% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n 100% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n}\n\n/* Item 2: falls 20-41% */\n@keyframes ytBundleLoaderItemFall2 {\n 0%, 19% {\n transform: translate3d(-50%, -90px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.5);\n opacity: 0;\n }\n 24% {\n transform: translate3d(-50%, -65px, 0px) rotateY(-50deg) rotateX(45deg) scale(1);\n opacity: 1;\n }\n 36% {\n transform: translate3d(-50%, -5px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.85);\n opacity: 1;\n }\n 41% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n 100% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n}\n\n/* Item 3: falls 34-55% */\n@keyframes ytBundleLoaderItemFall3 {\n 0%, 33% {\n transform: translate3d(-50%, -90px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.5);\n opacity: 0;\n }\n 38% {\n transform: translate3d(-50%, -65px, 0px) rotateY(-50deg) rotateX(45deg) scale(1);\n opacity: 1;\n }\n 50% {\n transform: translate3d(-50%, -5px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.85);\n opacity: 1;\n }\n 55% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n 100% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n}\n"),e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",backgroundColor:"rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",zIndex:2147483644,animation:"ytBundleLoaderFadeIn 0.4s ease-out"}},e.createElement("p",{style:{fontFamily:"inherit",fontSize:15,fontWeight:600,color:"#fff",margin:"0 0 48px",letterSpacing:"0.04em",textShadow:"0 1px 8px rgba(0,0,0,0.3)",lineHeight:"normal"}},n),e.createElement("div",{style:{position:"relative",width:140,height:140,display:"flex",justifyContent:"center",alignItems:"center",perspective:600}},e.createElement("div",{style:{animation:`ytBundleLoaderFloat ${$d} ease-in-out infinite`,transformStyle:"preserve-3d"}},e.createElement("div",{style:{position:"relative",width:72,height:72,transformStyle:"preserve-3d",transform:"rotateX(-45deg) rotateY(50deg) rotateZ(0deg)"}},e.createElement("div",{style:{...zd,transform:"rotateY(180deg) translateZ(36px)",background:"#f1f5f9"}}),e.createElement("div",{style:{...zd,transform:"rotateY(-90deg) translateZ(36px)",background:"#f8fafc"}}),e.createElement("div",{style:{...zd,transform:"rotateY(90deg) translateZ(36px)",background:"#f8fafc"}}),e.createElement("div",{style:{...zd,transform:"rotateX(-90deg) translateZ(36px)",background:"#e2e8f0"}}),e.createElement("div",{style:{position:"absolute",top:0,left:"50%",width:24,height:24,animation:`ytBundleLoaderItemFall1 ${$d} cubic-bezier(0.25, 1, 0.5, 1) infinite`,pointerEvents:"none"}},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e.createElement("path",{d:"M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4H6z",stroke:"#f5a623",strokeWidth:"2",fill:"#fef3c7"}),e.createElement("path",{d:"M3 6h18",stroke:"#f5a623",strokeWidth:"2"}),e.createElement("path",{d:"M16 10a4 4 0 01-8 0",stroke:"#f5a623",strokeWidth:"2",fill:"none"}))),e.createElement("div",{style:{position:"absolute",top:0,left:"50%",width:22,height:22,animation:`ytBundleLoaderItemFall2 ${$d} cubic-bezier(0.25, 1, 0.5, 1) infinite`,pointerEvents:"none"}},e.createElement("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none"},e.createElement("path",{d:"M16 3h4l2 4-4 2v13H6V9L2 7l2-4h4",stroke:"#4a90d9",strokeWidth:"2",fill:"#dbeafe"}),e.createElement("path",{d:"M8 3a4 4 0 008 0",stroke:"#4a90d9",strokeWidth:"2",fill:"none"}))),e.createElement("div",{style:{position:"absolute",top:0,left:"50%",width:22,height:22,animation:`ytBundleLoaderItemFall3 ${$d} cubic-bezier(0.25, 1, 0.5, 1) infinite`,pointerEvents:"none"}},e.createElement("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none"},e.createElement("rect",{x:"3",y:"8",width:"18",height:"14",rx:"1",stroke:"#7ed321",strokeWidth:"2",fill:"#dcfce7"}),e.createElement("rect",{x:"1",y:"8",width:"22",height:"5",rx:"1",stroke:"#7ed321",strokeWidth:"2",fill:"#bbf7d0"}),e.createElement("path",{d:"M12 8V22",stroke:"#7ed321",strokeWidth:"2"}),e.createElement("path",{d:"M12 8c-2-4-6-4-6-1s4 1 6 1",stroke:"#7ed321",strokeWidth:"2",fill:"none"}),e.createElement("path",{d:"M12 8c2-4 6-4 6-1s-4 1-6 1",stroke:"#7ed321",strokeWidth:"2",fill:"none"}))),e.createElement("div",{style:{...zd,transform:"translateZ(36px)"}}),e.createElement("div",{style:{position:"absolute",top:0,left:0,width:72,height:72,transform:"rotateX(90deg) translateZ(36px)",transformStyle:"preserve-3d"}},e.createElement("div",{style:{...Id,top:0,left:0,width:"100%",height:"50%",transformOrigin:"top center",animation:`ytBundleLoaderOpenNorth ${$d} ease-in-out infinite`}}),e.createElement("div",{style:{...Id,bottom:0,left:0,width:"100%",height:"50%",transformOrigin:"bottom center",animation:`ytBundleLoaderOpenSouth ${$d} ease-in-out infinite`}}),e.createElement("div",{style:{...Id,top:0,right:0,width:"50%",height:"100%",transformOrigin:"right center",animation:`ytBundleLoaderOpenEast ${$d} ease-in-out infinite`}}),e.createElement("div",{style:{...Id,top:0,left:0,width:"50%",height:"100%",transformOrigin:"left center",animation:`ytBundleLoaderOpenWest ${$d} ease-in-out infinite`}})))))));return M.createPortal(r,document.body)};function Ad({quantity:t,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:s,selectedVariantInventoryQty:c}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<c;return e.createElement(pc,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const r=Math.max(0,t-1);n?.(r),l&&a&&l(a,1)},style:d,"data-gokwik-processed":"true"},"-"),e.createElement(mc,{className:"yt-byob-quantity-display","data-gokwik-processed":"true"},t," ",e.createElement("span",{className:"yt-byob-quantity-added-text",style:{paddingLeft:"4px"}}," ","added")),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(r,t+1,c);n?.(l),o&&a&&i&&o(a,i,1)},disabled:!p||s,style:{...d,cursor:!p||s?"not-allowed":"pointer",opacity:!p||s?.6:1},"data-gokwik-processed":"true"},"+"))}!function(){if("undefined"==typeof window||window.__yt_dom_safeguarded)return;window.__yt_dom_safeguarded=!0;const e=Node.prototype,t=e.insertBefore;e.insertBefore=function(e,n){return n&&n.parentNode!==this?n.parentNode?n.parentNode.insertBefore(e,n):this.appendChild(e):t.call(this,e,n)};const n=e.removeChild;e.removeChild=function(e){return e&&e.parentNode!==this?e.parentNode?e.parentNode.removeChild(e):e:n.call(this,e)}}();const Dd=({product:o,styles:a,selectedVariant:i})=>{const[l,s]=t(!1),c=r(()=>Nu(i?.image?.url||o?.featuredMedia?.preview?.image?.url||o?.media?.edges?.[0]?.node?.image?.url)||"",[i?.image?.url,o?.featuredMedia?.preview?.image?.url,o?.media?.edges]),d=r(()=>o?.media?.edges?.map(e=>Nu(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[o?.media?.edges]),p=r(()=>d?.[1]??c??"",[d,c]);n(()=>{if(c){(new Image).src=c}},[c]);const m=r(()=>c||d?.[0],[c,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:a.general.imageAspectRatio||"1/1"},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&m!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:m,alt:o.title}),m!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:o.title})))},_d=({product:r,bundle:o,handleAddToBundle:i,hideAddToBundle:l,remainingQuantity:s,themeColor:c,handleRemoveItem:d,transitionActive:p,idx:m,selecteditems:u,customVariantsQuantity:g,currentProductTier:y,showFreebieTierProductPrices:f,tierIndex:x})=>{const b=we(id),w=o.customizations,v=w?.byob?.variantSelectorType,[C,E]=t(!1),k=w.general?.variantTitleSuffix?r?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}})})(r?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=a(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;const n=k?.find(t=>t.node.id===e),a=n?.node;return a?r.tracksInventory&&a.inventoryItem?.tracked?a.inventoryQuantity>0?o?.customProductsQuantity??a.inventoryQuantity:a.inventoryQuantity<=0&&"continue"===a.inventoryPolicy?.toLowerCase()?o?.customProductsQuantity??1/0:0:o?.customProductsQuantity??1/0:0},[k,g,r.tracksInventory]),S=k?.filter(e=>!1!==w.general.showOutOfStockVariants||T(e.node.id)>0);if(!S||!S.length)return e.createElement(e.Fragment,null);const N=S?.find(e=>T(e.node.id)>0)?.node?.id;if(!N&&!w.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[F,B]=t(S?.find(e=>T(e.node.id)>0)?.node?.id||S[0]?.node?.id),[I,z]=t(window.innerWidth<450),[$,P]=t("normal"),A=S?.find(e=>e?.node?.id===F)?.node,D=T(F||""),_=u?.find(e=>e.variantId===F&&(void 0===x||e.tierIndex===x)),L=_?_.quantity:0;n(()=>{const e=()=>{z(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",$)},[$]),n(()=>{if(F&&!S?.some(e=>e.node.id===F)){const e=S.find(e=>T(e.node.id)>0)?.node.id||S[0]?.node?.id;e&&B(e)}},[F,S,T]);const R=w?.byob?.productClickAction??(w?.general?.redirectToPDP?"redirect-pdp":"details-modal"),O=r.variants&&r.variants.edges?.length>1&&"customOptions"!==v,M="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,V="53933408435"===M,W="75851235630"===M,j=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(r),H=j.length>0;return e.createElement(e.Fragment,null,e.createElement(yc,{borderRadius:w?.byob.borderRadius,borderColor:w?.byob.borderColor,shadowType:w?.byob.shadowType,backgroundColor:w?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":m%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if("details-modal"!==R)return;if(D<=0)return;const e={...r,variants:{...r.variants,edges:S},selectedVariant:A};b(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:w?.byob?.productCardDetailsAlignment||"left"}},e.createElement(fc,{className:"yt-byob-image-wrapper",onClick:e=>{if("redirect-pdp"===R&&r?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${r.handle}`}},style:{cursor:"none"===R?"default":"pointer"}},e.createElement(Dd,{product:r,styles:w,selectedVariant:A}),o?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:w.byob.borderRadius}},o.productCardBadgeText),O&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(xc,{className:"yt-byob-variant-selector",isCoralHaze:V,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:F||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),B(e.target.value)}},S?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id,className:0===T(t.node.id)?"variant-out-of-stock":""},r)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(h,null)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",alignItems:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"},className:"yt-byob-product-details-wrapper"},e.createElement("div",{className:"yt-byob-product-content"},"enabled"===o?.customizations?.byob?.productCardCategoryVisibility&&H&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"}},j.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:I?"10px":"14px",color:"#666",fontWeight:"500",paddingBottom:"4px"}},t.charAt(0).toUpperCase()+t.slice(1))),j.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",j.length-2," more"))),e.createElement(hc,{isMobile:I,showBorder:o?.showBorder??!0,style:{...!w?.byob.productsPriceVisibility&&{padding:"8px"},...w?.byob.productTitleFontSize&&{fontSize:w?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:w?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},W?String(A?.displayName).replace("- Default Title",""):r.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&w?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:o?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14})," ",r?.rating?.averageRating,e.createElement(_e,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews"),")"),w?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:o?.showBorder?"0px 10px":"0 4px"}},y?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Su(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",Tu(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:w.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},Su(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",Tu(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!y?.isFreebieTier||f)&&A?.compareAtPrice&&w?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},Su(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",Tu(A.compareAtPrice)))),(D>0||D===1/0)&&e.createElement(bc,{borderRadius:w?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===L||void 0===L)&&e.createElement(uc,{key:"add-to-bundle-btn",style:{...!l&&{backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),(()=>{if(!F)return;"customOptions"===v&&S.length>1?E(!0):i(F,r,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button","data-gokwik-processed":"true"},w?.byob.addToBundleCTAText),!o?.disableQuantitySelector&&L>0&&F&&e.createElement(gc,{key:"quantity-selector-container",className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(Ad,{remainingQuantity:s,quantity:L,handleAddToBundle:i,variantId:F,product:r,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:D})),o?.disableQuantitySelector&&L>0&&F&&e.createElement(uc,{key:"single-qty-added-btn",style:{backgroundColor:"#747474",color:w?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector","data-gokwik-processed":"true"},e.createElement(wc,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(vc,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation(),d&&F&&d(F,x)},"data-gokwik-processed":"true"},e.createElement(tt,{style:{color:"#fff",fontSize:"20px"}})))),D<=0&&D!==1/0&&e.createElement(uc,{style:{backgroundColor:w.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled","data-gokwik-processed":"true"},w?.general.outOfStockLabel||"Out of Stock")),"customOptions"===v&&C&&S.length>1&&e.createElement(md,{product:r,isOpen:C,onClose:()=>E(!1),variantOptions:o.variantOptions,cta:{textColor:w?.general?.ctaTextColor||"#fff",backgroundColor:w?.general?.ctaBackgroundColor||"#000"},onConfirm:e=>{B(e),i(e,r,1)},showOutOfStockVariants:!1!==w.general.showOutOfStockVariants}))},Ld=({currentStep:t,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:s="#fff",tierNavigation:c})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((s,d)=>{const p=d+1,m=!o[d].isFormStep&&o[d].minimumQuantity-(i[d]?.length??0)===0,u=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===c?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?"white":m?`${l}50`:"white",border:`2px solid ${u?"#666666":m?l:"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[t]?.title)),Rd=({styles:t,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...r].map(r=>{const a=o===r;return e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(t.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{a||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px",maxWidth:"100%"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:o===r?t?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{o!==r&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1)))))},Od=({bundle:i,selectedItems:l,setSelectedItems:s,handleAddToCart:c,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:m,handleRemoveItem:u,bundleSubtotal:g,dispatchAnalyticsEvent:y,fetchStoreDetails:f,productsPagination:x,categoryFilters:h})=>{const[b,w]=t(void 0),[v,C]=t(window.innerWidth<450),[E,k]=t(0),[T,S]=t({}),N=!!i.personalizedForm?.title&&"productTier"===i.builderTiers?.type,[F,B]=t({}),[I,z]=t(!1),$=N&&E===(i.builderTiers?.productTier?.length||0),P=E===(i.builderTiers?.productTier?.length||0)-1,A=N&&P&&!$,[D,_]=t(i?.products),[L,R]=t(!1),[O,M]=t({}),[V,W]=t(20),j=o(null),[H,q]=t(i?.products),[U,Q]=t({}),[Y,G]=t(x?.cursorData),Z=i.builderTiers?.type,X=i.customizations,K=i.builderTiers?.productTier??[],J=i.builderTiers?.offerTier??[],[ee,te]=t("All"),ne=o(null),re=o(!0);n(()=>(re.current=!0,()=>{re.current=!1}),[]);const[oe,ae]=t({}),ie=o(void 0),le=o({appliedFilters:oe,currentProductTier:E,tierType:Z}),[se,ce]=t([]),[de,pe]=t(!1),[me,ue]=t(0),[ge,ye]=t(0),[fe,xe]=t({}),he=e=>{xe(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{se.length>0&&xe(e=>{const t={...e};return se.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[se]),n(()=>{!(Object.values(oe).length>0)&&x?.cursorData&&G(x.cursorData)},[oe,x?.cursorData]);const be=i.customStoreDetails?.fixedInventoryDetails;n(()=>{X?.byob?.productFiltersDisplay&&"none"!==X?.byob?.productFiltersDisplay&&(async()=>{const e=X?.byob?.productFiltersDisplay??"none";if("drawer"===e||"sidebar"===e)try{const e=await(f?.());e?.productFilters&&ce(e.productFilters??[])}catch(e){console.error("no filters data found")}})()},[X?.byob,f]);const we=r(()=>{if(!h)return;const e=K[E]?.tier,t="productTier"===Z?e:1,n="object"!=typeof h||Array.isArray(h)||h.id?h:h[t];if(!n)return;const r=Array.isArray(n)?n.find(e=>"filter.p.m.categories"===e.id||"categories"===e.label):n;return r&&r.values?{...r,values:[...r.values].sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:"base",numeric:!0}))}:void 0},[h,E,K]),Ce=r(()=>{const e=(we?.values?.map(e=>e.label)??[])?.filter(e=>"All"!==e);return e},[we]),Ee=Ce.length>0;n(()=>{ae({})},[E,ee]);const ke=((e,t)=>"All"===t?e:e.filter(e=>{const n=e?.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(D.filter(e=>{if("undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop&&""===e?.productDetails?.onlineStoreUrl)return!1;const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,r="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&r}),ee),Te="productTier"===Z?K.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===Z?J.reduce((e,t)=>e+t.minimumQuantity,0):i.minimumQuantity,Se=a((e,t)=>{const n=be?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[be]),[Fe,Be]=t(3e3);n(()=>{const e=se?.find(e=>"PRICE_RANGE"===e.type||"filter.v.price"===e.id);e&&e.values?.[0]?.input?.price?.max&&Be(e.values[0].input.price.max)},[D,se]);const[Ie,ze]=t(""),[$e,Pe]=t(""),Ae=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(ke,Ie),De=((e,t)=>[...e].sort((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}}))(Ae,$e);n(()=>{(async e=>{if(!x)return;const{initialCursorData:t,cursorData:n,fetchFn:r,setCursorData:o}=x,a="productTier"===Z?K?.[E]?.tier:1;if(0===Object.values(e)?.length)return void("productTier"===Z?(M(e=>({...e,[E]:U?.[E]||[]})),o(Y||{...n})):(_(H),o(Y||{1:t?.[1]})));const i=await r(e,a,null);re.current&&i&&("productTier"===Z?(M(e=>({...e,[E]:i})),_(e=>{const t=new Set(e.map(e=>e.productId)),n=i.filter(e=>!t.has(e.productId));return[...e,...n]})):_(i))})(oe)},[oe]);const[_e,Le]=ve(id),[Re,Oe]=t(!1);n(()=>{y?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i?._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder"}}),setTimeout(()=>{Oe(!0)},100)},[]);const Me=o(null);n(()=>{const e=()=>{C(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(i.coverImageUrl){const e=new Image;e.src=Nu(i.coverImageUrl)??"",e.onload=()=>{w(e.width/e.height)}}},[i.coverImageUrl]),n(()=>{Oe(!1),setTimeout(()=>Oe(!0),100)},[E]);const Ve=(e,t)=>{if("productTier"===Z){let n={...T},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=K.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}S(n);const o=K.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==o&&k(o)}u(e,t)},We=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if(i){if("productTier"!==i?.builderTiers?.type)return _(i?.products??[]),void q(i?.products??[]);if(i?.workWithoutPagination){if("productTier"===i?.builderTiers?.type){const e={};i.builderTiers.productTier?.forEach((t,n)=>{const r=t.products.map(e=>{const t=i?.products?.find(t=>t.productId===e.productId);return t?{...t,variantIds:e.variantIds?.length?e.variantIds:t.variantIds}:null}).filter(Boolean);e[n]=r}),M(e),Q(e)}}else"productTier"===i?.builderTiers?.type&&(M({0:i?.products}),Q({0:i?.products}))}},[i]),n(()=>{if("productTier"!==Z||!K[E])return;if(Te===m)return;const e=K.findIndex((e,t)=>{const n=T[t]||[];return t>=E&&n.length<e.minimumQuantity});if(-1!==e&&e!==E){k(e);const t=K[E];t?.products?.length>1&&We()}else if(-1===e&&N&&E<K.length){K.every((e,t)=>(T[t]?.length||0)>=e.minimumQuantity)&&k(K.length)}},[T,K,Z,N]),n(()=>{ze(""),te("All")},[E]),n(()=>{function e(e){if(!Me.current||!e.target)return;!Me.current.contains(e.target)&&Le(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const je=(e,t,n)=>{var r;"productTier"===Z&&(r=e,S(e=>{const t={...e},n=K.findIndex((e,n)=>{const r=t[n]||[];return n>=E&&r.length<e.minimumQuantity}),o=-1!==n?n:E;return-1!==n&&k(n),t[o]||(t[o]=[]),t[o].push(r),t}));const o=!0===K[E]?.isFreebieTier;y?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Fu(e,t,n,l,s,o,E)},He=(()=>{if(!i?.builderTiers)return i.minimumQuantity;const{type:e,offerTier:t,productTier:n}=i.builderTiers,r="offerTier"===e?t:"productTier"===e?n:null;if(!r)return i.minimumQuantity;let o=0;return r.map(e=>{o+=e.minimumQuantity}),o})(),qe=v&&i.mobileCoverImageUrl?Nu(i.mobileCoverImageUrl):Nu(i.coverImageUrl??"")||null,Ue=a(e=>{if("undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop&&""===e?.productDetails?.onlineStoreUrl)return!1;const t=X?.general?.showOutOfStockProducts;if(t)return!0;const n=e?.productDetails,r=n?.variants?.edges||[];if(be){if(r.some(e=>be.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>Se(n,e.node.id)>0)},[X?.general?.showOutOfStockProducts,be,Se]),Qe=r(()=>{if("productTier"===Z&&K.length>0){const e=O?.[E]??[];return $e?De.filter(t=>e.some(e=>e.productId===t.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))&&Ue(t)):e.map(e=>De.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))).filter(e=>e&&Ue(e))}return De.filter(Ue)},[Z,K,O,E,De,Ue,$e]),Ye=Qe;n(()=>{if("productTier"!==Z)return;const e=K[E];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;if(1!==O?.[E]?.length)return;const t=e.products[0],n=D.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const r=n.variants?.edges?.find(e=>Se(n,e.node.id)>0)?.node;if(!r)return;const o=r.id,a=T[E]?.includes(o);if(!a&&(je(o,n,1),E<K.length-(N?0:1))){k(E+1);const e=K?.[E];e?.products?.length>1&&We()}},[Z,K,E,D,T,Se,je]);const Ge=r(()=>ke.filter(e=>{const t=e?.productDetails;return(t.variants?.edges||[]).some(e=>Se(t,e.node.id)>0)}).length,[ke,Se]),Ze=r(()=>ke.length-Ge,[ke,Ge]),Xe="bundles"==i.appName?i.pageHeader?.title:i?.title,Ke="bundles"==i.appName?i.pageHeader?.description:i?.subtitle,Je=Ee&&Boolean(X?.byob?.enableProductCategories),et=r(()=>{if(i?.workWithoutPagination)return!1;if(!Je)return!1;if(!x)return!1;const e="productTier"===Z?K[E]?.tier:1;if(void 0===e)return!1;const t=x.cursorData?.[e];return t?t.hasNext:L},[i?.workWithoutPagination,Je,x,Z,K,E,L]);n(()=>{if(i?.workWithoutPagination)return;if(Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Z?n:1;if(e?.[r]&&!e?.[r]?.hasNext||!t)return;const o=le.current;o.currentProductTier===E&&o.tierType===Z||(ie.current=void 0,le.current={...o,currentProductTier:E,tierType:Z});const a=new IntersectionObserver(async([n])=>{if(!n.isIntersecting)return;if(L)return;const o=e?.[r]?.cursor||null;if(ie.current!==o){ie.current=o,R(!0);try{const n=await t(oe,r,e?.[r]?.cursor);if(!re.current)return;if(n?.length>0){const e=Object.values(oe).length>0;"productTier"===Z?(M(e=>({...e,[E]:[...e[E]||[],...n]})),e||Q(e=>({...e,[E]:[...e[E]||[],...n]})),_(e=>[...e,...n])):(_(e=>[...e,...n]),e||q(e=>[...e,...n]))}}catch(e){console.error("Pagination fetch failed:",e),ie.current=void 0}finally{re.current&&R(!1)}}},{root:null,rootMargin:"300px",threshold:.01}),l=ne.current;return l&&a.observe(l),()=>{l&&a.unobserve(l)}},[i?.workWithoutPagination,Je,x,L,Z,E,K,oe]),n(()=>{if(i?.workWithoutPagination)return;if(!Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Z?n:1;if(!t)return;const o=le.current;(o.currentProductTier!==E||o.tierType!==Z||JSON.stringify(o.appliedFilters)!==JSON.stringify(oe))&&(ie.current=void 0,le.current={appliedFilters:oe,currentProductTier:E,tierType:Z});if(!(!e?.[r]||e[r].hasNext))return void R(!1);if(L)return;(async()=>{const n=e?.[r]?.cursor||null;if(ie.current!==n){ie.current=n,R(!0);try{const e=await t(oe,r,n);if(!re.current)return;if(e?.length>0){const t=Object.values(oe).length>0;"productTier"===Z?(M(t=>({...t,[E]:[...t[E]||[],...e]})),t||Q(t=>({...t,[E]:[...t[E]||[],...e]})),_(t=>[...t,...e])):(_(t=>[...t,...e]),t||q(t=>[...t,...e]))}}catch(e){console.error("Fetch all products pagination error:",e),ie.current=void 0}finally{re.current&&R(!1)}}})()},[i?.workWithoutPagination,Je,x,E,oe,Z,L,K]),n(()=>{if(!Je&&!i?.workWithoutPagination)return;if(et)return;if(!j.current)return;const e=new IntersectionObserver(([e])=>{e.isIntersecting&&V<Qe.length&&W(e=>Math.min(e+20,Qe.length))},{rootMargin:"200px"});return e.observe(j.current),()=>e.disconnect()},[Je,et,V,Qe.length]),n(()=>{W(20)},[E,Qe.length,Je,i?.workWithoutPagination]);const tt=()=>{y?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-builder-section",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",marginBottom:"20px",backgroundColor:X.byob.sectionBackgroundColor,..."transparent"!==X.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},qe?e.createElement("div",{className:"yt-byob-cover-image-container",style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...i?.coverImageVerticalMargin&&{marginBottom:i?.coverImageVerticalMargin,marginTop:i?.coverImageVerticalMargin}}},qe&&e.createElement(vd,{coverImageUrl:qe,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{className:"yt-byob-cover-image-overlay",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:X?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},Xe),e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Ke))):(Xe||Ke)&&e.createElement("div",{className:"yt-byob-header-content",style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},Xe&&e.createElement("span",{className:"bundle-builder-title",style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:X?.byob?.titleBackgroundColor??"transparent"}},Xe),Ke&&e.createElement("span",{className:"bundle-builder-subtitle",style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"}},Ke)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===Z&&K.length>0&&X?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-stepper-wrapper"},e.createElement(Ld,{currentStep:E,totalSteps:K.length+(N?1:0),tiers:N?[...K,{title:i.personalizedForm?.title||"Personalize",tier:K.length,minimumQuantity:0,products:[],isFormStep:!0}]:K,isMobile:v,primaryColor:X?.general?.primaryColor,primaryTextColorCta:X?.general?.primaryContrastColor,setCurrentProductTier:k,selectedProductsByTier:T,tierNavigation:X.byob.tierNavigation})))),e.createElement("div",{className:"yt-byob-layout-wrapper",style:{display:"flex",flexDirection:"row",width:v?"100%":"90%",marginInline:"auto"}},"sidebar"===X?.byob?.productFiltersDisplay&&!v&&!$&&e.createElement(Td,{showFiltersDrawer:de,handleClose:()=>pe(!1),isAnimating:!1,isMobile:!1,availableFilters:se,appliedFilters:oe,toggleFilter:(e,t)=>{ae(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{ae({}),ye(0),ue(Fe)},applyPriceFilter:()=>{ae(e=>{const t={...e};return t["filter.v.price"]=[`min:${ge}-max:${me}`],t})},priceMin:ge,setPriceMin:ye,priceMax:me,setPriceMax:ue,maxPossiblePrice:Fe,styles:X,products:D,unavailableProductCount:Ze,storeCurrencyCode:i?.storeCurrencyCode,openSections:fe,toggleSection:he}),e.createElement("div",{className:"yt-byob-products-column",style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},!$&&e.createElement("div",{className:"yt-byob-filters-wrapper",style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(Sd,{enableSortAndFilter:i?.enableSortAndFilter??!1,isMobile:v,searchTerm:Ie,setSearchTerm:ze,setSortBy:Pe,styles:X,appliedFilters:oe,setAppliedFilters:ae,availableFilters:se,products:D,availableProductCount:Ge,unavailableProductCount:Ze,maxPossiblePrice:Fe,storeCurrencyCode:i?.storeCurrencyCode,sharedFiltersState:{showFilters:de,setShowFilters:pe,priceMax:me,setPriceMax:ue,priceMin:ge,setPriceMin:ye},openSections:fe,toggleSection:he}),i?.customizations?.byob?.enableProductCategories&&Ee&&e.createElement("div",{className:"yt-byob-category-filter-container"},e.createElement(Rd,{styles:X,isMobile:v,categories:Ce,activeCategory:ee,onCategoryChange:e=>{te(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:X?.byob?.listingsGap||"12px",justifyContent:de&&"sidebar"===X?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},$&&i.personalizedForm?.title?e.createElement(Bd,{form:i.personalizedForm,formData:F,setFormData:B,isUploading:I,setIsUploading:z}):0!==Ye?.length||L||et?(Je?Qe.slice(0,V):Qe).map((t,n)=>{if("productTier"===Z){const r=(K[E]?.minimumQuantity??0)>(T[E]?.length??0),o=De.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return o?e.createElement(_d,{bundle:i,idx:n,key:`tier-${E}-${t?.variantIds?.[0]??t.productId}-${n}`,product:o?.productDetails,handleAddToBundle:je,hideAddToBundle:!r,remainingQuantity:He-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>Ve(e,E),selecteditems:l,transitionActive:Re,customVariantsQuantity:be,currentProductTier:K[E],showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:E}):null}return e.createElement(_d,{bundle:i,idx:n,key:`card-${t.productId}-${n}`,product:t?.productDetails,handleAddToBundle:je,hideAddToBundle:m>=He,remainingQuantity:He-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>u(e),selecteditems:l,transitionActive:Re,customVariantsQuantity:be,tierIndex:E})}):e.createElement("div",{className:"yt-byob-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"40px 20px",gap:"16px"}},e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",margin:0}},Object.values(oe).length>0?"No products match your filters":"No products found"),Object.values(oe).length>0&&e.createElement("button",{onClick:()=>{ae({}),ye(0),ue(Fe)},style:{padding:"8px 16px",background:X?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:X?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px"}},"Clear All Filters")),!$&&(L||et)&&e.createElement("div",{className:"yt-byob-loading-wrapper",style:{width:"100%",display:"flex",justifyContent:"center",padding:"20px"}},e.createElement(Ne,{color:X?.general?.primaryColor||"#333",size:30})),!Je&&!i?.workWithoutPagination&&e.createElement("div",{ref:ne,className:"yt-byob-pagination-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null)),(Je||i?.workWithoutPagination)&&!et&&e.createElement("div",{ref:j,className:"yt-byob-virtualFetchAll-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null))),!p&&e.createElement(ad,{builderTiers:i?.builderTiers,showNextStep:A,handleAddToCart:async e=>{if(A)return k(E+1),void We();const t={};N&&Object.entries(F).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await c(e,t),tt()},minimumQuantity:Te,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:Ve,selectedItemsQuantity:m,percentageOff:i.percentageOff,loading:d,bundleSubtotal:g,amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:i?.dealTextColor??"#333",primaryTextColorCta:i?.primaryTextColorCta??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:I}),p&&e.createElement("div",{className:"yt-byob-sticky-tracker-wrapper",style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(ad,{showNextStep:A,handleAddToCart:async e=>{if(A)return k(E+1),void We();const t={};N&&Object.entries(F).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await c(e,t),tt()},minimumQuantity:Te,builderTiers:i?.builderTiers,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,loading:d,handleRemoveItem:u,handleRemoveItemProductTier:Ve,percentageOff:i.percentageOff,selectedItemsQuantity:m??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:X.general.primaryContrastColor??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:I})))),_e&&void 0!==m&&(()=>{let t=m<i.minimumQuantity;return"productTier"==Z?t=(K[E]?.minimumQuantity??0)>(T[E]?.length??0):"offerTier"==Z&&(t=m<J.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(wd,{bundleType:"byob",bundle:i,handleAddToBundle:je,ref:Me,remainingQuantity:i.minimumQuantity-m,hideAddToBundle:!t,disableQuantitySelector:i?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:T,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:i?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:X?.general.primaryColor||"#000",cornerRadius:i?.customizations.byob.borderRadius,styles:i.customizations,customVariantsQuantity:be,bundleProductsCustomQuantity:i?.customProductsQuantity,isFreebieTier:K?.[E]?.isFreebieTier,showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:i?.variantOptions})})(),e.createElement(Pd,{isOpen:Boolean(d)&&"animated"===i?.customizations?.general?.atcLoaderType})))},Md="\n@keyframes cartATCFadeIn {\n 0% {\n opacity: 0;\n transform: scale(0.96);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes cartATCSlideIn {\n 0% {\n transform: translateX(-150%);\n opacity: 0;\n }\n 20% {\n opacity: 1;\n }\n 100% {\n transform: translateX(0);\n opacity: 1;\n }\n}\n\n@keyframes cartATCSlideOut {\n 0% {\n transform: translateX(0);\n opacity: 1;\n }\n 80% {\n opacity: 1;\n }\n 100% {\n transform: translateX(150%);\n opacity: 0;\n }\n}\n\n@keyframes cartATCBounce {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(1.5px);\n }\n}\n\n@keyframes cartATCItemDrop1 {\n 0%, 5% {\n transform: translate3d(-50%, -22px, 0) scale(0.4);\n opacity: 0;\n }\n 20% {\n transform: translate3d(-50%, -10px, 0) scale(0.95);\n opacity: 1;\n }\n 55% {\n transform: translate3d(-50%, 3px, 0) scale(0.7);\n opacity: 1;\n }\n 75%, 100% {\n transform: translate3d(-50%, 7px, 0) scale(0.3);\n opacity: 0;\n }\n}\n\n@keyframes cartATCItemDrop2 {\n 0%, 30% {\n transform: translate3d(-50%, -22px, 0) scale(0.4);\n opacity: 0;\n }\n 45% {\n transform: translate3d(-50%, -10px, 0) scale(0.95);\n opacity: 1;\n }\n 80% {\n transform: translate3d(-50%, 3px, 0) scale(0.7);\n opacity: 1;\n }\n 95%, 100% {\n transform: translate3d(-50%, 7px, 0) scale(0.3);\n opacity: 0;\n }\n}\n",Vd=({loading:r,color:a="currentColor",size:i=24,children:l,className:s="",style:c,onComplete:d})=>{const[p,m]=t(r?"entering":"idle"),u=o(null),g=o(null);if(n(()=>(r?(g.current&&clearTimeout(g.current),m("entering"),u.current=setTimeout(()=>{m("filling")},400)):(u.current&&clearTimeout(u.current),m(e=>"filling"===e||"entering"===e?(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{m("idle"),d?.()},450),"exiting"):"idle")),()=>{u.current&&clearTimeout(u.current),g.current&&clearTimeout(g.current)}),[r,d]),"idle"===p)return l?e.createElement("span",{className:s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",animation:"cartATCFadeIn 0.3s ease-out forwards",...c}},e.createElement("style",null,Md),l):null;const y="entering"===p,f="exiting"===p,x={display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden",height:i+6,paddingLeft:8,paddingRight:8,verticalAlign:"middle",width:"100%",...c},h={display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",animation:y?"cartATCSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards":f?"cartATCSlideOut 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards":"cartATCBounce 1.2s ease-in-out infinite"};return e.createElement("span",{className:`yt-cart-atc-loader ${s}`,style:x},e.createElement("style",null,Md),e.createElement("div",{style:h},e.createElement("svg",{width:i,height:Math.round(24*i/28),viewBox:"0 0 28 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M1 2h4l2.6 13.2a2 2 0 002 1.6h12.8a2 2 0 002-1.6L26 6H6.6",stroke:a,strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("circle",{cx:"10.5",cy:"20.5",r:"1.8",fill:a}),e.createElement("circle",{cx:"21.5",cy:"20.5",r:"1.8",fill:a})),("filling"===p||"entering"===p||"exiting"===p)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"absolute",top:1,left:"56%",width:9,height:9,animation:"cartATCItemDrop1 1.4s ease-in-out infinite",pointerEvents:"none"}},e.createElement("svg",{width:"9",height:"9",viewBox:"0 0 10 10",fill:"none"},e.createElement("rect",{x:"1",y:"2",width:"8",height:"7",rx:"1",fill:"#f5a623",stroke:a,strokeWidth:"1"}),e.createElement("path",{d:"M5 2v7",stroke:a,strokeWidth:"1"}))),e.createElement("div",{style:{position:"absolute",top:1,left:"56%",width:9,height:9,animation:"cartATCItemDrop2 1.4s ease-in-out infinite",pointerEvents:"none"}},e.createElement("svg",{width:"9",height:"9",viewBox:"0 0 10 10",fill:"none"},e.createElement("rect",{x:"1",y:"2",width:"8",height:"7",rx:"1",fill:"#4a90d9",stroke:a,strokeWidth:"1"}),e.createElement("path",{d:"M1 5h8",stroke:a,strokeWidth:"1"}))))))},Wd=({isOpen:r,onClose:o,formConfig:a,onCheckout:i,cta:l,isMobile:s})=>{const[c,d]=t({}),[p,m]=t(!1);n(()=>{r||d({})},[r]);const u=e=>{if(p)return;const t={};Object.entries(c).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),i(e?{}:t)};if(!r)return null;const g=e.createElement("div",{className:"yt-personalized-form-modal-overlay",onClick:o,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:s?"flex-end":"center",justifyContent:"center"}},e.createElement("style",null,"\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes fadeIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "),e.createElement("div",{className:"yt-personalized-form-modal",onClick:e=>e.stopPropagation(),style:{background:"white",width:s?"100vw":"500px",maxWidth:s?"100vw":"560px",height:s?"80vh":"auto",maxHeight:s?"80vh":"90vh",borderRadius:s?"20px 20px 0 0":"20px",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:999,animation:s?"slideUp 0.3s ease-out":"fadeIn 0.2s ease-out"}},e.createElement("div",{className:"yt-personalized-form-modal-header",style:{width:"100%",padding:s?"20px 20px 16px":"18px 20px",fontWeight:700,fontSize:s?"18px":"16px",textAlign:"center",position:"relative",borderBottom:"1px solid #eee",flexShrink:0,backgroundColor:"#ffffff",color:"#1a1a1a",boxSizing:"border-box",lineHeight:"1.4"}},a.title||"Personalization",!s&&e.createElement("button",{className:"yt-personalized-form-modal-close",onClick:o,style:{position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",fontSize:"24px",lineHeight:1,cursor:"pointer",color:"#666",padding:"4px"}},"×")),e.createElement("div",{className:"yt-personalized-form-modal-body",style:{flex:1,overflowY:"auto",padding:s?"20px 20px":"16px 20px"}},e.createElement(Bd,{form:a,formData:c,setFormData:d,isUploading:p,setIsUploading:m})),e.createElement("div",{className:"yt-personalized-form-modal-footer",style:{padding:s?"12px 16px":"12px 24px 16px",borderTop:"1px solid #eee",flexShrink:0,background:"white",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"}},e.createElement("button",{className:"yt-personalized-form-submit-button",onClick:()=>{u(),o()},disabled:p,style:{width:"100%",fontSize:"15px",fontWeight:700,textAlign:"center",padding:"15px 0",border:"none",borderRadius:"10px",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l.backgroundColor,color:l.textColor,letterSpacing:"0.01em"}},p?e.createElement(Ne,{color:l.textColor,size:15}):"Submit"),e.createElement("button",{className:"yt-personalized-form-skip-button",onClick:()=>{u(!0),o()},style:{background:"none",border:"none",fontSize:"14px",fontWeight:600,color:"#1a1a1a",cursor:"pointer",padding:"4px 8px",textAlign:"center"}},"Add without customization"))));return M.createPortal(g,document.body)},jd=({product:t,selectedVariantId:n,onVariantChange:o,styles:a,originalPrice:i,dealPrice:l,totalPriceSum:s,isVertical:c=!1,variantOptions:d,storeCurrencyCode:p,reviewRatingType:m,productIndex:u,setActiveModalIndex:g})=>{const y=we(id),f=a?.comboBundle?.productClickAction??"details-modal",x=r(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),r=n?.node;return r?t?.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t?.productDetails]),b=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;x(n);const w=r(()=>{if(b?.title&&t?.productDetails.options){const e=b.title.split(" / ");if(e.length===t?.productDetails.options.length)return e}return t?.productDetails.options?.map(e=>e.values[0])||[]},[b,t?.productDetails.options]),v=e=>{o(e)};return c?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},a.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:Nu(b?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,onClick:e=>{if("details-modal"===f&&t?.productDetails){e.stopPropagation(),void 0!==u&&g?.(u);const n={...t.productDetails,selectedVariant:b||t.productDetails.variants?.edges?.[0]?.node};y(n)}},style:{cursor:"details-modal"===f?"pointer":"default",objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:a.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>v(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=x(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(h,null)))))),(a.comboBundle.subProductsProductTitleVisibility||a.comboBundle.subProductsProductPriceVisibility||m)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal"}},e.createElement(He,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal",fontWeight:"500"}},e.createElement(He,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(_e,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},Su(a.general.currencySymbol),Tu((Number(b?.price||0)/Number(s)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.compareAtPrice?b.compareAtPrice:b?.price)):Number(l)<Number(s)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.price)))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===a.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===a.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},a.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:Nu(b?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,onClick:e=>{if("details-modal"===f&&t?.productDetails){e.stopPropagation();const n={...t.productDetails,selectedVariant:b||t.productDetails.variants?.edges?.[0]?.node};y(n)}},style:{cursor:"details-modal"===f?"pointer":"default",objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:a?.general?.imageAspectRatio||"1 / 1",height:"100px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===a.comboBundle?.infoAlignment?"flex-start":"right"===a.comboBundle?.infoAlignment?"flex-end":"center"===a.comboBundle?.infoAlignment?"flex-start":void 0}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==a.comboBundle.comboVariantTypeSelector&&t?.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&w&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},w.length>1?w.join(" / "):w)),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal"}},e.createElement(He,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal",fontWeight:"500"}},e.createElement(He,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(_e,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},Su(a.general.currencySymbol),Tu((Number(b?.price||0)/Number(s)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.compareAtPrice?b?.compareAtPrice:b?.price)):Number(l)<Number(s)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.price)))),t?.productDetails.variants.edges.length>1&&("dropdown"===a.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>v(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t?.productDetails.variants.edges.map(t=>{const n=x(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(h,null))):t?.productDetails.options.length>0?e.createElement(e.Fragment,null,t?.productDetails.options.map((n,r)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t?.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(o=>{const i=[...w];i[r]=o;const l=t?.productDetails.options.length>0?i.join(" / "):i[r],s=t?.productDetails.variants.edges.find(e=>e.node.title===l)?.node,c=0===(s?x(s.id):0);if(!1===a?.general?.showOutOfStockVariants&&c)return null;const p=w[r]===o,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${c?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!c&&s&&v(s.id)},disabled:c,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:c?.5:1,cursor:c?"not-allowed":"pointer"}},m?.values.find(e=>e.name===o)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!c?"26px":"24px",height:p&&!c?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===o)?.value}},e.createElement("span",null)):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:c?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!c?"#F7F7F7":"transparent",color:c?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):m&&"image"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${c?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!c&&s&&v(s.id)},disabled:c,style:{border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!c?"#F7F7F7":"transparent",cursor:c?"not-allowed":"pointer",padding:"0px",width:p&&!c?"26px":"24px",height:p&&!c?"26px":"24px",overflow:"hidden",opacity:c?.5:1}},m?.values.find(e=>e.name===o)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:Nu(m?.values.find(e=>e.name===o)?.value||"/placeholder.svg"),alt:o,style:{width:p&&!c?"26px":"24px",height:p&&!c?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:c?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!c?"#F7F7F7":"transparent",color:c?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${c?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!c&&s&&v(s.id)},disabled:c,style:{padding:"4px 8px",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:c?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!c?"#F7F7F7":"transparent",color:c?"#ccc":"#707070",cursor:c?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:c?.5:1}},o)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const r=0===x(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&r?null:e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>v(t?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},t?.node?.title)}))))))},Hd=({bundle:o,addToCartFunction:a,dispatchAnalyticsEvent:i})=>{const l=r(()=>{const e="undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop,t=o.products?.filter(t=>{if(e&&""===t?.productDetails?.onlineStoreUrl)return!1;const n=t?.productDetails?.status?.toLowerCase();return!n||("active"===n||"unlisted"===n)})||[];if(!t.some(e=>e.quantity&&e.quantity>1))return{...o,products:t};const n=t.reduce((e,t)=>{const n=t.quantity||1;for(let r=0;r<n;r++)e.push(t);return e},[]);return{...o,products:n}},[o]),[s,c]=t(!1),[d,p]=t(window.innerWidth<786),[m,u]=t(!1),[g,y]=t(null),f=r(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[x,h]=t(()=>{const e={};return l.products.forEach((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>f(t?.productDetails,e?.node?.id)>0)?.node;e[n]=r?r.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e}),[b,w]=t(null);n(()=>{if(b){const e=setTimeout(()=>w(null),2e3);return()=>clearTimeout(e)}},[b]);const v=l.products?.every((e,t)=>{const n=x[t];return f(e?.productDetails,n)>0});n(()=>(a&&(window.ytComboBundle={bundle:l,addToCart:a,selectedVariants:x},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[l,a,x]);const C=(e,t)=>{h(n=>({...n,[e]:t}))},E=async e=>{const t=Object.entries(x).map(([e])=>({id:l.products[parseInt(e)].productId,title:l.products[parseInt(e)]?.productDetails?.title}));i?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:l._id,bundleType:"combo-bundle",selectedProducts:t}});try{if(c(!0),w(null),!a)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const t=Object.entries(x).map(([e,t])=>{const n=l.products[parseInt(e)],r=n?.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return r?{variantId:t,price:Number(r.price)}:null}).filter(e=>null!==e),n=Object.values(x);await a(Number(N),n,Number(F),t,e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e),w(Cc(e))}c(!1)},k=l.customizations,T=k?.comboBundle?.discountBadgeDisplay||"discount-on-compare",S=k?.comboBundle?.discountBadgeVisibility,{originalPrice:N,dealPrice:F,offerValue:B,totalPriceSum:I,offerPercentage:z}=r(()=>{const{price:e,compareAtPrice:t}=Object.entries(x).reduce((e,[t,n])=>{const r=l.products[parseInt(t)],o=r?.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),n=!1===S?e:"discount-on-price"===T?e:t;let r=e;l?.percentageOff?r=e*(1-l.percentageOff/100):l?.dealAmount?r=l.dealAmount:l?.amountOff&&(r=e-l.amountOff);const o=n-r,a=n>0?Math.round((n-r)/n*100):0;return{originalPrice:n.toFixed(2),dealPrice:r.toFixed(2),offerValue:o.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:a}},[x,l.products,l.percentageOff,l.dealAmount,l.amountOff,T,S]);n(()=>{i?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:l._id,bundleType:"combo-bundle"}});const e=()=>{p(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const $=k.comboBundle?.comboCardStyle||"auto",P="vertical"===$||"auto"===$&&!d,A=k.comboBundle?.embedContentVisibility,D="bundles"==l.appName?l.pageHeader?.title:l?.title,_="bundles"==l.appName?l.pageHeader?.description:l?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:k.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===k.comboBundle?.infoAlignment?"flex-start":"right"===k.comboBundle?.infoAlignment?"flex-end":"center"===k.comboBundle?.infoAlignment?"center":void 0,textAlign:k.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},A&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:k.comboBundle?.productTitleFontSize||"28px",color:k.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},D)),A&&k?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:k.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(k.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Su(k.general.currencySymbol,l.storeCurrencyCode),Tu(F)),!isNaN(Number(N))&&!isNaN(Number(F))&&Number(N)>Number(F)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:k.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Su(k.general.currencySymbol,l.storeCurrencyCode),Tu(N)),Number(B)>0&&!1!==S&&(()=>{const t="percentage"===(k?.comboBundle?.discountDisplayType||"amount")?`${z}% Off`:`Save ${Su(k.general.currencySymbol,l.storeCurrencyCode)}${Tu(B)}`;return e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},t)})())),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:k.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),k.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,P?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(d?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},l.products.map((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===x[n])?.node;return r?e.createElement(jd,{key:`combo-product-${n}-${t.productId}`,product:t,styles:k,originalPrice:N,dealPrice:F,totalPriceSum:I,selectedVariantId:x[n],onVariantChange:e=>C(n,e),isVertical:P,variantOptions:l.variantOptions,storeCurrencyCode:l.storeCurrencyCode,reviewRatingType:k?.comboBundle?.comboProductRatingsDisplay,productIndex:n,setActiveModalIndex:y}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(d?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},k.comboBundle.subProductsSectionVisibility&&l.products.map((t,n)=>e.createElement(jd,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:k,originalPrice:N,dealPrice:F,totalPriceSum:I,selectedVariantId:x[n],onVariantChange:e=>C(n,e),variantOptions:l.variantOptions,reviewRatingType:k?.comboBundle?.comboProductRatingsDisplay,productIndex:n,setActiveModalIndex:y})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${v?"":"yt-comboBundle-bundle-cta-button-disabled"} ${d?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:b?"#dc2626":v?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor,color:b?"#ffffff":k.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:k.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:v?"pointer":"not-allowed",border:`1px solid ${b?"#dc2626":v?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor}`,boxShadow:k.general.ctaShadowType,padding:k.general?.ctaPadding,width:k.general?.ctaWidth,margin:"0"},disabled:!v||s,onMouseOver:e=>{k.general.customizeHoverState&&v&&!b&&!s&&(e.currentTarget.style.backgroundColor=k.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=k.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{k.general.customizeHoverState&&v&&!b&&!s&&(e.currentTarget.style.backgroundColor=k.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=k.general?.ctaTextColor||"#FFFFFF")},onClick:()=>{s||(async()=>{l?.personalizedForm?.title?u(!0):await E()})()}},"animated"===k?.general?.atcLoaderType?e.createElement(Vd,{color:"white",loading:s,size:22},b?e.createElement(e.Fragment,null,b):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement("span",null,v?k.comboBundle?.ctaTitle??"Add Bundle to cart":k.general.outOfStockLabel||"Out of Stock"),v&&k?.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("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"}))))):s?e.createElement(Ne,{color:"white",loading:s,size:20}):b?e.createElement(e.Fragment,null,b):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement("span",null,v?k.comboBundle?.ctaTitle??"Add Bundle to cart":k.general.outOfStockLabel||"Out of Stock"),v&&k?.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("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"})))))),A&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px",width:"100%"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:k.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:k.general.primaryColor+"08"},dangerouslySetInnerHTML:{__html:tr(_)}})),l?.personalizedForm?.title&&e.createElement(Wd,{isOpen:m,onClose:()=>u(!1),formConfig:l.personalizedForm,onCheckout:async e=>{await E(e),u(!1)},cta:{backgroundColor:k.general?.ctaBackgroundColor||"#121212",textColor:k.general?.ctaTextColor||"#FFFFFF"},isMobile:d}),e.createElement(wd,{bundleType:"comboBundle",handleAddToBundle:()=>{},selectedProducts:[],remainingQuantity:0,hideAddToBundle:!0,disableQuantitySelector:!0,themeColor:k?.general?.primaryColor||"#000",primaryTextColorCta:k?.general?.primaryContrastColor||"#fff",primaryBackgroundColorCta:k?.general?.primaryColor||"#000",cornerRadius:"8px",styles:k,onVariantSelect:e=>{null!==g&&C(g,e)},bundle:l,totalPriceSum:I,dealPrice:F}))},qd=c.div`
3455
+ `;const pd=({options:t,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i,showOutOfStockVariants:l=!0})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const i=!a||a(t.name);return l||i?e.createElement("div",{key:t.name,onClick:()=>{i&&r(t)},style:{cursor:i?"pointer":"not-allowed"}},((t,n)=>{const r=!a||a(t.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"},className:r?"":"variant-out-of-stock"}):e.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"},className:r?"":"variant-out-of-stock"},t.name);return"image"===o?e.createElement("img",{src:Jn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"},className:r?"":"variant-out-of-stock"}):e.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"},className:r?"":"variant-out-of-stock"},t.name)})(t,n?.name===t.name)):null})),md=({product:o,isOpen:a,onClose:i,variantOptions:l,cta:s,onConfirm:c,showOutOfStockVariants:d=!0})=>{const p=r(()=>e=>e?o?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[o?.tracksInventory]),m=r(()=>{const e=o.variants.edges.find(e=>{const t=e.node;return p(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):o.options?.map(e=>e.values[0])||[]},[o,p]),[u,g]=t(m),[y,f]=t(window.innerWidth<1024);n(()=>{const e=()=>f(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&i()};return a&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[a,i]);const x=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,h=x?.image?.url||o.featuredMedia?.preview?.image?.url,b=Jn(h,150,85,"webp"),w=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},C=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!a)return null;const E=e.createElement("div",{onClick:i,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:o.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},o.title))),e.createElement("div",{style:{padding:"20px"}},o.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(t,n)?.name||t.values[0])),e.createElement(pd,{options:v(t),selectedValue:C(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,g(n)})(n,e)},type:w(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const r=o.options?.length>0?n.join(" / "):n[0],a=o.variants.edges.find(e=>e.node.title===r)?.node;return!!a&&p(a)>0})(n,e),isMobile:y,showOutOfStockVariants:d}))))),e.createElement("button",{onClick:()=>{const e=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&p(e)>0;if(e?.id&&t)c(e.id),i();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=o.variants.edges.find(e=>p(e.node)>0)?.node.id;e&&(c(e),i())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:s.backgroundColor,color:s.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},"data-gokwik-processed":"true"},"Add to Bundle")));return M.createPortal(E,document.body)},ud=e=>e.split("?")[0],gd=({className:t,product:n,rating:r,reviewRatingType:o})=>{const a=n?.rating?.averageRating??r?.averageRating??0,i=n?.rating?.ratingCount??r?.ratingCount??0;return a<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===o&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},a," rating")),"ratingAndReviewCount"===o&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14}),a,e.createElement(_e,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",i," reviews)"))},yd=({isMobile:t,product:n,bundleType:r,images:o,mobileScrollRef:a,desktopThumbsRef:i,selectedVariantImage:l,currentImageIndex:s,setCurrentImageIndex:c,themeColor:d})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:a,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},o.length>0&&o.map((t,o)=>e.createElement("div",{key:o,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(Rt,{small:Nu(t?.url),medium:Nu(t?.url),large:Nu(t?.url),alt:t.altText||`${n?.title||"Product"} - Image ${o+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:`yt-${r}-modal-desktop-main-image yt-${r}-modal-desktop-main-image`})))):e.createElement(e.Fragment,null,e.createElement(Rt,{small:Nu(l??"")||Nu(o[s]?.url),medium:Nu(l??"")||Nu(o[s]?.url),large:Nu(l??"")||Nu(o[s]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:`yt-${r}-modal-desktop-main-image yt-${r}-modal-desktop-main-image main-image`}),e.createElement("div",{ref:i,style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},o.length>1&&o.map((r,o)=>e.createElement("img",{key:o,src:Nu(r?.url),alt:r.altText||`${n?.title||"Product"} - Image ${o+1}`,onClick:()=>c(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:s===o?`2px solid ${d||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),fd=({className:t,product:n,selectedVariant:r,onVariantChange:o,getMaxAvailableQty:a,showOutOfStockVariants:i})=>n?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},n.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},r?.title)),e.createElement("select",{className:`${t}-select`,value:r?.id||"",onChange:o,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},n?.variants?.edges?.map(({node:t})=>!1===i&&0===a(t)?null:e.createElement("option",{key:t.id,value:t.id,disabled:0===a(t),className:0===a(t)?"variant-out-of-stock":""},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(yt,null)))),xd=({isMobile:t,product:n,selectedVariants:r,getOptionValues:o,getSelectedOption:a,getOptionType:i,isOptionValueAvailable:l,onOptionChange:s,showOutOfStockVariants:c})=>e.createElement(e.Fragment,null,n.options.map((n,d)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},r[d]||n.values[0])),e.createElement(pd,{options:o(n),selectedValue:a(n,d),onChange:e=>{s(d,e)},type:i(n.name),isOptionAvailable:e=>l(d,e),isMobile:t,showOutOfStockVariants:!1!==c}))))),hd=({isMobile:t,bundleType:n,selectedVariant:r,discountedPrice:o,compareAtDisplayPrice:a,isFreebieTier:i,showFreebieTierProductPrices:l,currencySymbol:s,primaryColor:c})=>e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-price yt-${n}-modal-${t?"mobile":"desktop"}-price`,style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},i&&!l?e.createElement(e.Fragment,null,e.createElement("span",{className:`yt-${n}-compare-price yt-${n}-compare-price yt-fixed-bundle-original-price`,style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Su(s),Tu(r?.price)),e.createElement("span",{className:`yt-${n}-current-price yt-${n}-current-price`,style:{color:c||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,a>0&&e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-compare-price yt-${n}-modal-${t?"mobile":"desktop"}-compare-price`,style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Su(s),Tu(a)),e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-current-price yt-${n}-modal-${t?"mobile":"desktop"}-current-price`},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"left",lineHeight:"normal"}},Su(s),Tu(o))))),bd=({isMobile:t,bundleType:n,hideAddToBundle:r,themeColor:o,cornerRadius:a,primaryTextColorCta:i,disabled:l,onClick:s,label:c})=>r?null:e.createElement("div",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-atc-wrapper yt-${n}-modal-${t?"mobile":"desktop"}-atc-wrapper ${t?"":"yt-product-modal-atc-wrapper"}`,style:{width:t?"100%":"80%"}},e.createElement("button",{className:`yt-${n}-modal-${t?"mobile":"desktop"}-atc-button yt-${n}-modal-${t?"mobile":"desktop"}-atc-button ${t?"":"yt-product-modal-atc-button"}`,style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:o||"#111",borderRadius:a,color:i||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:l?.5:1,cursor:l?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),s()},disabled:l},c)),wd=l((i,l)=>{const[s,c]=ve(id),d=r(()=>{const e=i.bundleType;return e&&i.styles?.[e]?i.styles[e]:i.styles?.byob},[i.styles,i.bundleType]),p=i.reviewRatingType??{byob:i.styles?.byob?.productRatingsDisplay,fixedBundle:i.styles?.fixedBundle?.productRatingsDisplay,comboBundle:i.styles?.comboBundle?.comboProductRatingsDisplay}[i.bundleType??""]??i.bundle?.reviewRatingType,m=d?.productVariantTitleType,u=d?.variantSelectorType??d?.comboVariantTypeSelector??"dropdown",g=r(()=>e=>{const t=i?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:e?s?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?i?.bundleProductsCustomQuantity??e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?i?.bundleProductsCustomQuantity??1/0:0:i?.bundleProductsCustomQuantity??1/0:0},[s?.tracksInventory,i?.customVariantsQuantity,i?.bundleProductsCustomQuantity]),y=s?.variants.edges?.filter(e=>g(e.node)>0)||[],[f,x]=t(y?.[0]?.node),h=r(()=>{if(!f)return 0;const e=parseFloat(f?.price??"0");let t=e;if("comboBundle"===i.bundleType){const n=Number(i.totalPriceSum||0);let r=Number(i.dealPrice||0);!r&&i.bundle&&(i.bundle?.percentageOff?r=n*(1-i.bundle.percentageOff/100):i.bundle?.dealAmount?r=i.bundle.dealAmount:i.bundle?.amountOff&&(r=n-i.bundle.amountOff)),n>0&&r>0&&(t=e/n*r)}else if("fixedBundle"===i.bundleType){const n=i.bundleDiscountType||(i.bundle?.percentageOff?"percentageOff":i.bundle?.dealAmount?"fixedPrice":i.bundle?.amountOff?"amountOff":""),r=i.bundleDiscountValue??i.bundle?.percentageOff??i.bundle?.dealAmount??i.bundle?.amountOff??0,o=i.totalSelectedOriginal??0;if(r)switch(n){case"percentOff":case"percentageOff":case"percentage":case"Percentage":t=e*(1-r/100);break;case"amountOff":case"amount":case"Amount Off":if(o>0){const n=e/o*r;t=Math.max(0,e-n)}break;case"fixedPrice":case"fixed":case"fixedPrice":if(o>0){t=r*(e/o)}}}return parseFloat(t.toFixed(2))},[f,i.bundleType,i.totalPriceSum,i.dealPrice,i.bundleDiscountType,i.bundleDiscountValue,i.totalSelectedOriginal,i.bundle]),b=r(()=>{if(!f)return 0;const e=parseFloat(f?.price??"0"),t=parseFloat(f?.compareAtPrice??"0"),n=i.styles?.[i.bundleType||""]||i.styles?.general,r=n?.discountBadgeDisplay;let o=0;return"comboBundle"===i.bundleType||"fixedBundle"===i.bundleType?"discount-on-compare"===r&&t>0?o=t:h<e?o=e:t>e&&(o=t):t>e&&(o=t),o>0?parseFloat(o.toFixed(2)):0},[f,i.bundleType,i.styles,h]),[w,v]=t(0),[C,E]=t("undefined"!=typeof window&&window.innerWidth<=600),[k,T]=t(1),[S,N]=t("idle"),F=o(null),B=o(null),I=o(null),[z,$]=t(null),P=o(!1),A=o(),[D,_]=t(0),[L,R]=t(),O=r(()=>{const e=s?.variants.edges.find(e=>{const t=e.node;return g(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):s?.options?.map(e=>e.values[0])||[]},[s,g]),[V,W]=t(O);n(()=>{if(s?.id){P.current=!1;const e=s.variants.edges?.filter(e=>g(e.node)>0),t=s?.selectedVariant??e[0]?.node;x(t);const n=t?.image?.url,r=n?(s.media?.edges??[]).map(e=>e?.node?.preview?.image??e?.node?.image).filter(e=>e?.url?.length>0).findIndex(e=>ud(e.url)===ud(n)):-1;$(s.selectedVariant&&r>=0?{index:r}:null),v(r>=0?r:0),R(r>=0?void 0:n),t?.title&&"Default Title"!==t.title&&W(t.title.split(" / "))}},[s?.id]),n(()=>{const e=i.selectedProducts?.find(e=>e.variantId===f?.id);T(e?e.quantity:0)},[i.selectedProducts,f?.id]);const j=o(i.onVariantSelect);n(()=>{j.current=i.onVariantSelect},[i.onVariantSelect]),n(()=>{f?.id&&s&&P.current&&j.current?.(f.id,s)},[f?.id,s?.id]),n(()=>{if(!z)return;let e=!1;[B.current,I.current].forEach(t=>{const n=t?.children[z.index];t&&n&&(n.scrollIntoView({behavior:"instant",block:"nearest",inline:"center"}),e=!0)}),e&&$(null)},[z,s?.media?.edges?.length]);const H=()=>{f?.id&&s&&(N("check"),i.handleAddToBundle(f?.id,s,1),clearTimeout(A.current),A.current=setTimeout(()=>{N("idle"),c(void 0)},500))};n(()=>{const e=()=>E(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>()=>clearTimeout(A.current),[]);const q=s?.descriptionHtml??"",U=s?.media,Q=U?.edges?.map(e=>e?.node?.preview?.image??e?.node?.image).filter(e=>e?.url?.length>0)??[],Y=a(e=>{v(e),R(void 0)},[]),G=a(e=>{const t=e.target.value,n=y?.find(e=>e.node.id===t)?.node;n&&g(n)>0&&(P.current=!0,x(n),R(n?.image?.url),n.title&&"Default Title"!==n.title&&W(n.title.split(" / ")))},[y,g]),Z=a(e=>{if(!i.bundleVariantOptions?.options)return"text";const t=i.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[i.bundleVariantOptions]),X=a(e=>{if(!i?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=i?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[i.bundleVariantOptions]),K=a((e,t)=>{const n=[...V];n[e]=t.name,W(n);const r=(s?.options?.length??0)>0?n.join(" / "):n[0],o=s?.variants.edges.find(e=>e.node.title===r)?.node;R(o?.image?.url),o&&g(o)>0&&(P.current=!0,x(o))},[V,s,g]),J=a((e,t)=>{const n=V[t];if(!n)return null;return X(e).find(e=>e.name===n)||null},[V,X]),ee=a((e,t)=>{const n=[...V];n[e]=t;const r=(s?.options?.length??0)>0?n.join(" / "):n[0],o=s?.variants.edges.find(e=>e.node.title===r)?.node;return!!o&&g(o)>0},[V,s,g]);if(n(()=>{if(s?.id){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{c(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[s?.id,c]),n(()=>{if(C&&s?.id&&F.current){const e=()=>{F.current&&_(F.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[C,s?.id]),!s)return null;const ne=i.selectedProducts.filter(e=>e.variantId===f?.id).reduce((e,t)=>e+t.quantity,0),re=i.customVariantsQuantity?.find(e=>e.variantId===f?.id)?.quantity??i.bundleProductsCustomQuantity??1/0,oe=re!==1/0&&ne>=re,ae=i.hideAddToBundle||!f||g(f)<=0||oe||"idle"!==S||i?.disableQuantitySelector&&1===k,ie=e.createElement(sd,{className:`yt-${i?.bundleType}-modal-desktop-overlay yt-${i?.bundleType}-modal-desktop-overlay`,onClick:()=>c(void 0)},e.createElement(cd,{$isSmallScreen:C,ref:l,onClick:e=>e.stopPropagation()},e.createElement(dd,{ref:l,className:`yt-${i?.bundleType}-modal-desktop-container yt-${i?.bundleType}-modal-desktop-container yt-variant-selection-modal`},e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop yt-${i?.bundleType}-modal-desktop yt-variant-selection-modal ${C?"small-screen":"large-screen"}`},e.createElement(ld,{className:`yt-${i?.bundleType}-modal-desktop-close yt-${i?.bundleType}-modal-desktop-close`,onClick:()=>{c(void 0)},style:{backgroundColor:"white"}},e.createElement(te,{size:"25"})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-image-section yt-${i?.bundleType}-modal-desktop-image-section image-section`},e.createElement(yd,{product:s,bundleType:i.bundleType,images:Q,mobileScrollRef:B,desktopThumbsRef:I,selectedVariantImage:L,currentImageIndex:w,setCurrentImageIndex:Y,themeColor:i.themeColor})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-details-section yt-${i?.bundleType}-modal-desktop-details-section details-section`,style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:`yt-${i?.bundleType}-modal-desktop-title yt-${i?.bundleType}-modal-desktop-title`},"byob"===i?.bundleType?e.createElement(e.Fragment,null,"variant-display-name"===m&&s?.selectedVariant?.displayName?s?.selectedVariant?.displayName:"variant-title"===m&&s?.selectedVariant?.title?s?.selectedVariant?.title:s?.title):s?.title),e.createElement(gd,{product:s,rating:i.rating,reviewRatingType:p,className:`yt-${i?.bundleType}-modal-desktop-rating yt-${i?.bundleType}-modal-desktop-rating`}),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-variant-price-wrapper yt-${i?.bundleType}-modal-desktop-variant-price-wrapper`,style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===u&&e.createElement(fd,{product:s,selectedVariant:f,onVariantChange:G,getMaxAvailableQty:g,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants,className:`yt-${i?.bundleType}-modal-desktop-variant-selector yt-${i?.bundleType}-modal-desktop-variant-selector`}),"customOptions"===u&&e.createElement(xd,{product:s,selectedVariants:V,getOptionValues:X,getSelectedOption:J,getOptionType:Z,isOptionValueAvailable:ee,onOptionChange:K,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants}),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-price-atc-wrapper yt-${i?.bundleType}-modal-desktop-price-atc-wrapper`,style:{display:"flex",justifyContent:i.hideAddToBundle?"flex-start":"center",alignItems:"center",width:"100%"}},e.createElement(hd,{bundleType:i.bundleType,selectedVariant:f,discountedPrice:h,compareAtDisplayPrice:b,isFreebieTier:i.isFreebieTier,showFreebieTierProductPrices:i.showFreebieTierProductPrices,currencySymbol:i.styles.general.currencySymbol,primaryColor:i.styles.general.primaryColor}),e.createElement(bd,{bundleType:i.bundleType,hideAddToBundle:i.hideAddToBundle,themeColor:i.themeColor,cornerRadius:i.cornerRadius,primaryTextColorCta:i.primaryTextColorCta,disabled:ae,onClick:H,label:i.styles?.byob?.addToBundleCTAText??"Add to bundle"}))),e.createElement("div",{className:`yt-${i?.bundleType}-modal-desktop-divider yt-${i?.bundleType}-modal-desktop-divider`,style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:`yt-${i?.bundleType}-modal-desktop-description yt-${i?.bundleType}-modal-desktop-description yt-description-content`,style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:q}})))))),le=e.createElement(sd,{className:`yt-${i?.bundleType}-modal-mobile-overlay yt-${i?.bundleType}-modal-mobile-overlay`,onClick:()=>c(void 0)},e.createElement(cd,{className:`yt-${i?.bundleType}-modal-mobile-content yt-${i?.bundleType}-modal-mobile-content`,style:{padding:"0px",position:"relative"},$isSmallScreen:C,ref:l,onClick:e=>e.stopPropagation()},e.createElement(dd,{ref:l,className:`yt-${i?.bundleType}-modal-mobile-container yt-${i?.bundleType}-modal-mobile-container yt-variant-selection-modal`},e.createElement("button",{className:`yt-${i?.bundleType}-modal-mobile-close-btn yt-${i?.bundleType}-modal-mobile-close-btn`,style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{c(void 0)}},e.createElement(gt,{className:`yt-${i?.bundleType}-modal-mobile-close-icon yt-${i?.bundleType}-modal-mobile-close-icon`,style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile yt-${i?.bundleType}-modal-mobile yt-variant-selection-modal small-screen`,style:{padding:"0px"}},e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-image-section yt-${i?.bundleType}-modal-mobile-image-section image-section`},e.createElement(yd,{product:s,bundleType:i.bundleType,images:Q,mobileScrollRef:B,desktopThumbsRef:I,selectedVariantImage:L,currentImageIndex:w,setCurrentImageIndex:Y,themeColor:i.themeColor,isMobile:!0})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-details-section yt-${i?.bundleType}-modal-mobile-details-section details-section`,style:{padding:"0 30px",margin:"15px 0",paddingBottom:D?`${D+20}px`:"120px"}},e.createElement("h2",{className:`yt-${i?.bundleType}-modal-mobile-title yt-${i?.bundleType}-modal-mobile-title`,style:{margin:"0px"}},"byob"===i?.bundleType?e.createElement(e.Fragment,null,"variant-display-name"===m&&s?.selectedVariant?.displayName?s?.selectedVariant?.displayName:"variant-title"===m&&s?.selectedVariant?.title?s?.selectedVariant?.title:s?.title):s?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(gd,{product:s,rating:i.rating,reviewRatingType:p,className:`yt-${i?.bundleType}-modal-mobile-rating yt-${i?.bundleType}-modal-mobile-rating`})),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-divider yt-${i?.bundleType}-modal-mobile-divider`,style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-description yt-${i?.bundleType}-modal-mobile-description yt-description-content`,style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:q}})))),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-bottom-bar yt-${i?.bundleType}-modal-mobile-bottom-bar`,ref:F,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===u?e.createElement(xd,{product:s,selectedVariants:V,getOptionValues:X,getSelectedOption:J,getOptionType:Z,isOptionValueAvailable:ee,onOptionChange:K,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants,isMobile:!0}):e.createElement(fd,{product:s,selectedVariant:f,onVariantChange:G,getMaxAvailableQty:g,showOutOfStockVariants:i.styles?.general?.showOutOfStockVariants,className:`yt-${i?.bundleType}-modal-desktop-variant-selector yt-${i?.bundleType}-modal-desktop-variant-selector`}),e.createElement("div",{className:`yt-${i?.bundleType}-modal-mobile-price-atc-wrapper yt-${i?.bundleType}-modal-mobile-price-atc-wrapper`,style:{display:"flex",justifyContent:i.hideAddToBundle?"flex-start":"center",alignItems:"center",width:"100%"}},e.createElement(hd,{bundleType:i.bundleType,selectedVariant:f,discountedPrice:h,compareAtDisplayPrice:b,isFreebieTier:i.isFreebieTier,showFreebieTierProductPrices:i.showFreebieTierProductPrices,currencySymbol:i.styles.general.currencySymbol,primaryColor:i.styles.general.primaryColor,isMobile:!0}),e.createElement(bd,{bundleType:i.bundleType,hideAddToBundle:i.hideAddToBundle,themeColor:i.themeColor,cornerRadius:i.cornerRadius,primaryTextColorCta:i.primaryTextColorCta,disabled:ae,onClick:H,label:i.styles?.byob?.addToBundleCTAText??"Add to bundle",isMobile:!0})))));return M.createPortal(C?le:ie,document.body)}),vd=({coverImageUrl:t,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map(({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const s=t||n||"",c=i(s,800)||s,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:c,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Cd=({title:t,isOpen:n,onToggle:r,children:o})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:r,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(et,{className:"yt-byob-icon-minus",size:20}):e.createElement(Ze,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},o)),Ed=({availableFilters:n,appliedFilters:r,toggleFilter:o,clearAllFilters:a,applyPriceFilter:i,priceMin:l,setPriceMin:s,priceMax:c,setPriceMax:d,maxPossiblePrice:p,styles:m,availableProductCount:u,products:g,unavailableProductCount:y,storeCurrencyCode:f,showActions:x=!0,openSections:h,toggleSection:b})=>{const[w,v]=t(null),C=Su(m?.general?.currencySymbol)??f??"USD";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Cd,{key:t.id,title:t.label,isOpen:!!h[t.id],onToggle:()=>b(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const a=r[t.id]?.includes(n.id)||!1;return"filter.v.availability.1"===n.id?u??g.length:"filter.v.availability.0"===n.id||n.count,e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:a,onChange:()=>o(t.id,n.id),style:{width:"18px",height:"18px",accentColor:m?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,c.toLocaleString()),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-c/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>v("min"),onTouchStart:()=>v("min"),onChange:e=>{const t=Math.min(Number(e.target.value),c-10);s(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===w?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:c,onMouseDown:()=>v("max"),onTouchStart:()=>v("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===w?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),x&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:a,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:i,style:{flex:1,padding:"8px",background:m?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},kd=t=>{const{showFiltersDrawer:n,handleClose:r,isAnimating:o,isMobile:a}=t;return n?V(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:o?1:0,transition:"opacity 300ms ease-in-out"},onClick:r},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:a?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:o?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Ed,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),r()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},Td=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Ed,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},Sd=({enableSortAndFilter:r,isMobile:o,setSearchTerm:a,searchTerm:i,styles:l,setSortBy:s,appliedFilters:c,setAppliedFilters:d,availableFilters:p=[],products:m,availableProductCount:u,unavailableProductCount:g,maxPossiblePrice:y,storeCurrencyCode:f,sharedFiltersState:x,openSections:b,toggleSection:w,sortBy:v})=>{const[C,E]=t(!1),[k,T]=t(i),{showFilters:S,setShowFilters:N,priceMax:F,setPriceMax:B,priceMin:I,setPriceMin:z}=x,[$,P]=t(!1),A=l?.byob?.productFiltersDisplay||"drawer",D=!o&&"sidebar"===A,_="none"===A;n(()=>{c["filter.v.price"]||(B(y),z(0))},[y,c]);n(()=>{const e=setTimeout(()=>{a(k)},300);return()=>clearTimeout(e)},[k,a]),n(()=>(S&&!D?(document.body.style.overflow="hidden",P(!0)):(document.body.style.overflow="",P(!1)),()=>{document.body.style.overflow=""}),[S,D]);const L=Object.entries(c).reduce((e,[t,n])=>"filter.v.price"===t?I>0||F<y?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:o?"column":"row",justifyContent:"space-between",alignItems:o?"flex-end":"center",marginBottom:"20px",width:"100%",gap:o?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:r?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},r&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:o?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},o&&!C?e.createElement(Xe,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:o?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(Xe,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),o&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>N(!S),style:{display:_?"none":"flex",alignItems:"center",gap:o?"0px":"6px",background:S&&D?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Ke,{className:"yt-byob-filter-toggle-icon",size:18}),!o&&"Filters",L>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},L)),r&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!o&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),o&&e.createElement(Je,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:v,onChange:e=>s(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(h,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!D&&!_&&e.createElement(kd,{showFiltersDrawer:S,handleClose:()=>{D?N(!1):(document.body.style.overflow="",P(!1),setTimeout(()=>{N(!1)},300))},isAnimating:$,isMobile:o,availableFilters:p,appliedFilters:c,toggleFilter:(e,t)=>{d(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{B(y),z(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${I}-max:${F}`],t})},priceMin:I,setPriceMin:z,priceMax:F,setPriceMax:B,maxPossiblePrice:y,styles:l,availableProductCount:u,products:m,unavailableProductCount:g,storeCurrencyCode:f,openSections:b,toggleSection:w}))},Nd=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),Fd=({title:t,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="string"==typeof n?{url:n,name:"Attachment"}:n,l=i?.loading,s=i?.error,c=i?.url;return e.createElement("div",{className:"yt-personalization-upload-field",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",border:"1px dashed #ccc",borderRadius:"10px",background:"#fff",gap:"12px"}},e.createElement("div",{className:"yt-personalized-form-field-content",style:{flex:1,minWidth:0}},e.createElement("div",{className:"yt-personalized-form-field-title",style:{fontWeight:600,fontSize:"14px",color:"#1a1a1a"}},t),!i&&!l&&!s&&e.createElement("div",{className:"yt-personalized-form-field-hint",style:{fontSize:"12px",color:"#888",marginTop:"2px"}},"jpeg/png/img (max size: 5MB)"),l&&e.createElement("div",{className:"yt-personalized-form-field-loading",style:{display:"flex",alignItems:"center",gap:"6px",color:"#007bff",fontSize:"12px",marginTop:"4px"}},e.createElement(Nd,null)," Uploading ",i?.name||"image","..."),s&&e.createElement("div",{className:"yt-personalized-form-field-error",style:{fontSize:"12px",color:"#dc3545",marginTop:"2px"}},"Upload failed."),c&&!l&&!s&&e.createElement("div",{className:"yt-personalized-form-field-preview",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px"}},e.createElement("img",{className:"yt-personalized-form-field-preview-image",src:i.url,alt:"Uploaded",style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"4px",border:"1px solid #eee"}}),e.createElement("span",{className:"yt-personalized-form-field-preview-name",style:{fontSize:"12px",color:"#28a745",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},i.name))),e.createElement("div",{className:"yt-personalized-form-field-actions",style:{flexShrink:0}},s&&e.createElement("button",{type:"button",className:"yt-personalized-form-retry-button",onClick:a,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Retry"),c&&!l&&!s&&e.createElement("button",{type:"button",className:"yt-personalized-form-remove-button",onClick:o,style:{fontSize:"13px",fontWeight:600,color:"#fff",background:"#dc3545",border:"none",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Remove"),!i&&!l&&e.createElement("button",{type:"button",className:"yt-personalized-form-upload-button",onClick:r,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Upload Image")))},Bd=({form:r,formData:a,setFormData:i,barHeight:l=0,isUploading:s,setIsUploading:c})=>{const d=o(new Map),[p,m]=t(!1),u=c??m;n(()=>()=>{d.current.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),d.current.clear()},[]);const g=e=>{if(!d.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.multiple=!1,t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");i(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),u(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw alert("Upload failed. Try again."),e}finally{u(!1)}})(n);i(r=>({...r,[e]:{url:t,name:n.name}}))}catch{i(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),d.current.set(e,t)}return d.current.get(e)};return e.createElement("div",{className:"yt-personalized-form",style:{width:"100%",padding:"8px 0",marginBottom:`${l}px`,boxSizing:"border-box"}},r.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-personalized-form-section",style:{marginBottom:"28px"}},e.createElement("label",{className:"yt-personalized-form-section-title",style:{display:"block",fontWeight:700,marginBottom:"10px",color:"#1a1a1a",fontSize:"15px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-personalized-form-text-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement("textarea",{key:r,className:"yt-personalized-form-textarea",placeholder:t?.title,rows:3,maxLength:500,value:a[r]||"",onChange:e=>i(t=>({...t,[r]:e.target.value})),style:{width:"100%",padding:"8px 0",border:"none",borderBottom:"1.5px solid #ddd",borderRadius:0,fontSize:"14px",color:"#1a1a1a",background:"transparent",resize:"none",outline:"none",lineHeight:"1.5",boxSizing:"border-box"}})})),"image"===t.type&&e.createElement("div",{className:"yt-personalized-form-image-section"},e.createElement("div",{className:"yt-personalized-form-image-hint",style:{fontSize:"12px",color:"#888",marginBottom:"10px"}},"Supported formats - jpeg/png/img (max size: 5MB)"),e.createElement("div",{className:"yt-personalized-form-image-fields",style:{display:"flex",flexDirection:"column",gap:"10px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement(Fd,{key:r,title:t?.title,uploadState:a[r],onUpload:()=>g(r).click(),onRemove:()=>i(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>g(r).click()})}))))))},Id={position:"absolute",width:72,height:72,border:"4px solid #333366",background:"#fff",boxSizing:"border-box"},zd={...Id},$d="6s",Pd=({isOpen:t,message:n="Preparing Bundle..."})=>{if(!t)return null;const r=e.createElement(e.Fragment,null,e.createElement("style",null,"\n@keyframes ytBundleLoaderFadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes ytBundleLoaderFloat {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-10px); }\n}\n\n/*\n * Flaps start OPEN, stay open while items fall, then close, pause, reopen.\n * 0-60%: open (180deg) — items fall in\n * 60-78%: closing\n * 78-88%: closed pause\n * 88-100%: reopening\n */\n@keyframes ytBundleLoaderOpenNorth {\n 0% { transform: rotateX(180deg); }\n 60% { transform: rotateX(180deg); }\n 78% { transform: rotateX(0deg); }\n 88% { transform: rotateX(0deg); }\n 100% { transform: rotateX(180deg); }\n}\n@keyframes ytBundleLoaderOpenSouth {\n 0% { transform: rotateX(-180deg); }\n 60% { transform: rotateX(-180deg); }\n 78% { transform: rotateX(0deg); }\n 88% { transform: rotateX(0deg); }\n 100% { transform: rotateX(-180deg); }\n}\n@keyframes ytBundleLoaderOpenEast {\n 0% { transform: rotateY(180deg); }\n 60% { transform: rotateY(180deg); }\n 78% { transform: rotateY(0deg); }\n 88% { transform: rotateY(0deg); }\n 100% { transform: rotateY(180deg); }\n}\n@keyframes ytBundleLoaderOpenWest {\n 0% { transform: rotateY(-180deg); }\n 60% { transform: rotateY(-180deg); }\n 78% { transform: rotateY(0deg); }\n 88% { transform: rotateY(0deg); }\n 100% { transform: rotateY(-180deg); }\n}\n\n/* Item 1: falls into top box opening and disappears behind front wall */\n@keyframes ytBundleLoaderItemFall1 {\n 0%, 5% {\n transform: translate3d(-50%, -90px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.5);\n opacity: 0;\n }\n 10% {\n transform: translate3d(-50%, -65px, 0px) rotateY(-50deg) rotateX(45deg) scale(1);\n opacity: 1;\n }\n 22% {\n transform: translate3d(-50%, -5px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.85);\n opacity: 1;\n }\n 27% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n 100% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n}\n\n/* Item 2: falls 20-41% */\n@keyframes ytBundleLoaderItemFall2 {\n 0%, 19% {\n transform: translate3d(-50%, -90px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.5);\n opacity: 0;\n }\n 24% {\n transform: translate3d(-50%, -65px, 0px) rotateY(-50deg) rotateX(45deg) scale(1);\n opacity: 1;\n }\n 36% {\n transform: translate3d(-50%, -5px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.85);\n opacity: 1;\n }\n 41% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n 100% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n}\n\n/* Item 3: falls 34-55% */\n@keyframes ytBundleLoaderItemFall3 {\n 0%, 33% {\n transform: translate3d(-50%, -90px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.5);\n opacity: 0;\n }\n 38% {\n transform: translate3d(-50%, -65px, 0px) rotateY(-50deg) rotateX(45deg) scale(1);\n opacity: 1;\n }\n 50% {\n transform: translate3d(-50%, -5px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.85);\n opacity: 1;\n }\n 55% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n 100% {\n transform: translate3d(-50%, 25px, 0px) rotateY(-50deg) rotateX(45deg) scale(0.6);\n opacity: 0;\n }\n}\n"),e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",backgroundColor:"rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",zIndex:2147483644,animation:"ytBundleLoaderFadeIn 0.4s ease-out"}},e.createElement("p",{style:{fontFamily:"inherit",fontSize:15,fontWeight:600,color:"#fff",margin:"0 0 48px",letterSpacing:"0.04em",textShadow:"0 1px 8px rgba(0,0,0,0.3)",lineHeight:"normal"}},n),e.createElement("div",{style:{position:"relative",width:140,height:140,display:"flex",justifyContent:"center",alignItems:"center",perspective:600}},e.createElement("div",{style:{animation:`ytBundleLoaderFloat ${$d} ease-in-out infinite`,transformStyle:"preserve-3d"}},e.createElement("div",{style:{position:"relative",width:72,height:72,transformStyle:"preserve-3d",transform:"rotateX(-45deg) rotateY(50deg) rotateZ(0deg)"}},e.createElement("div",{style:{...zd,transform:"rotateY(180deg) translateZ(36px)",background:"#f1f5f9"}}),e.createElement("div",{style:{...zd,transform:"rotateY(-90deg) translateZ(36px)",background:"#f8fafc"}}),e.createElement("div",{style:{...zd,transform:"rotateY(90deg) translateZ(36px)",background:"#f8fafc"}}),e.createElement("div",{style:{...zd,transform:"rotateX(-90deg) translateZ(36px)",background:"#e2e8f0"}}),e.createElement("div",{style:{position:"absolute",top:0,left:"50%",width:24,height:24,animation:`ytBundleLoaderItemFall1 ${$d} cubic-bezier(0.25, 1, 0.5, 1) infinite`,pointerEvents:"none"}},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e.createElement("path",{d:"M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4H6z",stroke:"#f5a623",strokeWidth:"2",fill:"#fef3c7"}),e.createElement("path",{d:"M3 6h18",stroke:"#f5a623",strokeWidth:"2"}),e.createElement("path",{d:"M16 10a4 4 0 01-8 0",stroke:"#f5a623",strokeWidth:"2",fill:"none"}))),e.createElement("div",{style:{position:"absolute",top:0,left:"50%",width:22,height:22,animation:`ytBundleLoaderItemFall2 ${$d} cubic-bezier(0.25, 1, 0.5, 1) infinite`,pointerEvents:"none"}},e.createElement("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none"},e.createElement("path",{d:"M16 3h4l2 4-4 2v13H6V9L2 7l2-4h4",stroke:"#4a90d9",strokeWidth:"2",fill:"#dbeafe"}),e.createElement("path",{d:"M8 3a4 4 0 008 0",stroke:"#4a90d9",strokeWidth:"2",fill:"none"}))),e.createElement("div",{style:{position:"absolute",top:0,left:"50%",width:22,height:22,animation:`ytBundleLoaderItemFall3 ${$d} cubic-bezier(0.25, 1, 0.5, 1) infinite`,pointerEvents:"none"}},e.createElement("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none"},e.createElement("rect",{x:"3",y:"8",width:"18",height:"14",rx:"1",stroke:"#7ed321",strokeWidth:"2",fill:"#dcfce7"}),e.createElement("rect",{x:"1",y:"8",width:"22",height:"5",rx:"1",stroke:"#7ed321",strokeWidth:"2",fill:"#bbf7d0"}),e.createElement("path",{d:"M12 8V22",stroke:"#7ed321",strokeWidth:"2"}),e.createElement("path",{d:"M12 8c-2-4-6-4-6-1s4 1 6 1",stroke:"#7ed321",strokeWidth:"2",fill:"none"}),e.createElement("path",{d:"M12 8c2-4 6-4 6-1s-4 1-6 1",stroke:"#7ed321",strokeWidth:"2",fill:"none"}))),e.createElement("div",{style:{...zd,transform:"translateZ(36px)"}}),e.createElement("div",{style:{position:"absolute",top:0,left:0,width:72,height:72,transform:"rotateX(90deg) translateZ(36px)",transformStyle:"preserve-3d"}},e.createElement("div",{style:{...Id,top:0,left:0,width:"100%",height:"50%",transformOrigin:"top center",animation:`ytBundleLoaderOpenNorth ${$d} ease-in-out infinite`}}),e.createElement("div",{style:{...Id,bottom:0,left:0,width:"100%",height:"50%",transformOrigin:"bottom center",animation:`ytBundleLoaderOpenSouth ${$d} ease-in-out infinite`}}),e.createElement("div",{style:{...Id,top:0,right:0,width:"50%",height:"100%",transformOrigin:"right center",animation:`ytBundleLoaderOpenEast ${$d} ease-in-out infinite`}}),e.createElement("div",{style:{...Id,top:0,left:0,width:"50%",height:"100%",transformOrigin:"left center",animation:`ytBundleLoaderOpenWest ${$d} ease-in-out infinite`}})))))));return M.createPortal(r,document.body)};function Ad({quantity:t,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:s,selectedVariantInventoryQty:c}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<c;return e.createElement(pc,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const r=Math.max(0,t-1);n?.(r),l&&a&&l(a,1)},style:d,"data-gokwik-processed":"true"},"-"),e.createElement(mc,{className:"yt-byob-quantity-display","data-gokwik-processed":"true"},t," ",e.createElement("span",{className:"yt-byob-quantity-added-text",style:{paddingLeft:"4px"}}," ","added")),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(r,t+1,c);n?.(l),o&&a&&i&&o(a,i,1)},disabled:!p||s,style:{...d,cursor:!p||s?"not-allowed":"pointer",opacity:!p||s?.6:1},"data-gokwik-processed":"true"},"+"))}!function(){if("undefined"==typeof window||window.__yt_dom_safeguarded)return;window.__yt_dom_safeguarded=!0;const e=Node.prototype,t=e.insertBefore;e.insertBefore=function(e,n){return n&&n.parentNode!==this?n.parentNode?n.parentNode.insertBefore(e,n):this.appendChild(e):t.call(this,e,n)};const n=e.removeChild;e.removeChild=function(e){return e&&e.parentNode!==this?e.parentNode?e.parentNode.removeChild(e):e:n.call(this,e)}}();const Dd=({product:o,styles:a,selectedVariant:i})=>{const[l,s]=t(!1),c=r(()=>Nu(i?.image?.url||o?.featuredMedia?.preview?.image?.url||o?.media?.edges?.[0]?.node?.image?.url)||"",[i?.image?.url,o?.featuredMedia?.preview?.image?.url,o?.media?.edges]),d=r(()=>o?.media?.edges?.map(e=>Nu(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[o?.media?.edges]),p=r(()=>d?.[1]??c??"",[d,c]);n(()=>{if(c){(new Image).src=c}},[c]);const m=r(()=>c||d?.[0],[c,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:a.general.imageAspectRatio||"1/1"},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&m!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:m,alt:o.title}),m!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:o.title})))},_d=({product:r,bundle:o,handleAddToBundle:i,hideAddToBundle:l,remainingQuantity:s,themeColor:c,handleRemoveItem:d,transitionActive:p,idx:m,selecteditems:u,customVariantsQuantity:g,currentProductTier:y,showFreebieTierProductPrices:f,tierIndex:x})=>{const b=we(id),w=o.customizations,v=w?.byob?.variantSelectorType,[C,E]=t(!1),k=w.general?.variantTitleSuffix?r?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}})})(r?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=a(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;const n=k?.find(t=>t.node.id===e),a=n?.node;return a?r.tracksInventory&&a.inventoryItem?.tracked?a.inventoryQuantity>0?o?.customProductsQuantity??a.inventoryQuantity:a.inventoryQuantity<=0&&"continue"===a.inventoryPolicy?.toLowerCase()?o?.customProductsQuantity??1/0:0:o?.customProductsQuantity??1/0:0},[k,g,r.tracksInventory]),S=k?.filter(e=>!1!==w.general.showOutOfStockVariants||T(e.node.id)>0);if(!S||!S.length)return e.createElement(e.Fragment,null);const N=S?.find(e=>T(e.node.id)>0)?.node?.id;if(!N&&!w.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[F,B]=t(S?.find(e=>T(e.node.id)>0)?.node?.id||S[0]?.node?.id),[I,z]=t(window.innerWidth<450),[$,P]=t("normal"),A=S?.find(e=>e?.node?.id===F)?.node,D=T(F||""),_=u?.find(e=>e.variantId===F&&(void 0===x||e.tierIndex===x)),L=_?_.quantity:0;n(()=>{const e=()=>{z(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",$)},[$]),n(()=>{if(F&&!S?.some(e=>e.node.id===F)){const e=S.find(e=>T(e.node.id)>0)?.node.id||S[0]?.node?.id;e&&B(e)}},[F,S,T]);const R=w?.byob?.productClickAction??(w?.general?.redirectToPDP?"redirect-pdp":"details-modal"),O=r.variants&&r.variants.edges?.length>1&&"customOptions"!==v,M="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,V="53933408435"===M,W="75851235630"===M,j=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(r),H=j.length>0;return e.createElement(e.Fragment,null,e.createElement(yc,{borderRadius:w?.byob.borderRadius,borderColor:w?.byob.borderColor,shadowType:w?.byob.shadowType,backgroundColor:w?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":m%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if("details-modal"!==R)return;if(D<=0)return;const e={...r,variants:{...r.variants,edges:S},selectedVariant:A};b(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:w?.byob?.productCardDetailsAlignment||"left"}},e.createElement(fc,{className:"yt-byob-image-wrapper",onClick:e=>{if("redirect-pdp"===R&&r?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${r.handle}`}},style:{cursor:"none"===R?"default":"pointer"}},e.createElement(Dd,{product:r,styles:w,selectedVariant:A}),o?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:w.byob.borderRadius}},o.productCardBadgeText),O&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(xc,{className:"yt-byob-variant-selector",isCoralHaze:V,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:F||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),B(e.target.value)}},S?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id,className:0===T(t.node.id)?"variant-out-of-stock":""},r)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(h,null)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",alignItems:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"},className:"yt-byob-product-details-wrapper"},e.createElement("div",{className:"yt-byob-product-content"},"enabled"===o?.customizations?.byob?.productCardCategoryVisibility&&H&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"}},j.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:I?"10px":"14px",color:"#666",fontWeight:"500",paddingBottom:"4px"}},t.charAt(0).toUpperCase()+t.slice(1))),j.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",j.length-2," more"))),e.createElement(hc,{isMobile:I,showBorder:o?.showBorder??!0,style:{...!w?.byob.productsPriceVisibility&&{padding:"8px"},...w?.byob.productTitleFontSize&&{fontSize:w?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:w?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},W?String(A?.displayName).replace("- Default Title",""):r.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&w?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:o?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement(He,{color:"gold",size:14})," ",r?.rating?.averageRating,e.createElement(_e,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews"),")"),w?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:o?.showBorder?"0px 10px":"0 4px"}},y?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Su(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",Tu(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:w.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},Su(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",Tu(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!y?.isFreebieTier||f)&&A?.compareAtPrice&&w?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},Su(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",Tu(A.compareAtPrice)))),(D>0||D===1/0)&&e.createElement(bc,{borderRadius:w?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===L||void 0===L)&&e.createElement(uc,{key:"add-to-bundle-btn",style:{...!l&&{backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),(()=>{if(!F)return;"customOptions"===v&&S.length>1?E(!0):i(F,r,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button","data-gokwik-processed":"true"},w?.byob.addToBundleCTAText),!o?.disableQuantitySelector&&L>0&&F&&e.createElement(gc,{key:"quantity-selector-container",className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(Ad,{remainingQuantity:s,quantity:L,handleAddToBundle:i,variantId:F,product:r,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:D})),o?.disableQuantitySelector&&L>0&&F&&e.createElement(uc,{key:"single-qty-added-btn",style:{backgroundColor:"#747474",color:w?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector","data-gokwik-processed":"true"},e.createElement(wc,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(vc,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation(),d&&F&&d(F,x)},"data-gokwik-processed":"true"},e.createElement(tt,{style:{color:"#fff",fontSize:"20px"}})))),D<=0&&D!==1/0&&e.createElement(uc,{style:{backgroundColor:w.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled","data-gokwik-processed":"true"},w?.general.outOfStockLabel||"Out of Stock")),"customOptions"===v&&C&&S.length>1&&e.createElement(md,{product:r,isOpen:C,onClose:()=>E(!1),variantOptions:o.variantOptions,cta:{textColor:w?.general?.ctaTextColor||"#fff",backgroundColor:w?.general?.ctaBackgroundColor||"#000"},onConfirm:e=>{B(e),i(e,r,1)},showOutOfStockVariants:!1!==w.general.showOutOfStockVariants}))},Ld=({currentStep:t,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:s="#fff",tierNavigation:c})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((s,d)=>{const p=d+1,m=!o[d].isFormStep&&o[d].minimumQuantity-(i[d]?.length??0)===0,u=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===c?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?"white":m?`${l}50`:"white",border:`2px solid ${u?"#666666":m?l:"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[t]?.title)),Rd=({styles:t,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...r].map(r=>{const a=o===r;return e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(t.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{a||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px",maxWidth:"100%"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:o===r?t?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{o!==r&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1)))))},Od=({bundle:i,selectedItems:l,setSelectedItems:s,handleAddToCart:c,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:m,handleRemoveItem:u,bundleSubtotal:g,dispatchAnalyticsEvent:y,fetchStoreDetails:f,productsPagination:x,categoryFilters:h})=>{const[b,w]=t(void 0),[v,C]=t(window.innerWidth<450),[E,k]=t(0),[T,S]=t({}),N=!!i.personalizedForm?.title&&"productTier"===i.builderTiers?.type,[F,B]=t({}),[I,z]=t(!1),$=N&&E===(i.builderTiers?.productTier?.length||0),P=E===(i.builderTiers?.productTier?.length||0)-1,A=N&&P&&!$,[D,_]=t(i?.products),[L,R]=t(!1),[O,M]=t({}),[V,W]=t(20),j=o(null),[H,q]=t(i?.products),[U,Q]=t({}),[Y,G]=t(x?.cursorData),Z=i.builderTiers?.type,X=i.customizations,K=i.builderTiers?.productTier??[],J=i.builderTiers?.offerTier??[],[ee,te]=t("All"),ne=o(null),re=o(!0);n(()=>(re.current=!0,()=>{re.current=!1}),[]);const[oe,ae]=t({}),ie=o(void 0),le=o({appliedFilters:oe,currentProductTier:E,tierType:Z}),[se,ce]=t([]),[de,pe]=t(!1),[me,ue]=t(0),[ge,ye]=t(0),[fe,xe]=t({}),he=e=>{xe(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{se.length>0&&xe(e=>{const t={...e};return se.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[se]),n(()=>{!(Object.values(oe).length>0)&&x?.cursorData&&G(x.cursorData)},[oe,x?.cursorData]);const be=i.customStoreDetails?.fixedInventoryDetails;n(()=>{X?.byob?.productFiltersDisplay&&"none"!==X?.byob?.productFiltersDisplay&&(async()=>{const e=X?.byob?.productFiltersDisplay??"none";if("drawer"===e||"sidebar"===e)try{const e=await(f?.());e?.productFilters&&ce(e.productFilters??[])}catch(e){console.error("no filters data found")}})()},[X?.byob,f]);const we=r(()=>{if(!h)return;const e=K[E]?.tier,t="productTier"===Z?e:1,n="object"!=typeof h||Array.isArray(h)||h.id?h:h[t];if(!n)return;const r=Array.isArray(n)?n.find(e=>"filter.p.m.categories"===e.id||"categories"===e.label):n;return r&&r.values?{...r,values:[...r.values].sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:"base",numeric:!0}))}:void 0},[h,E,K]),Ce=r(()=>{const e=(we?.values?.map(e=>e.label)??[])?.filter(e=>"All"!==e),t=i?.selectedCategories??[];if(0===t.length)return e;const n=new Set(t.map(e=>e.trim()));return e.filter(e=>n.has(e.trim()))},[we,i?.selectedCategories]),Ee=Ce.length>0;n(()=>{ae({})},[E,ee]);const ke=((e,t)=>"All"===t?e:e.filter(e=>{const n=e?.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(D.filter(e=>{if("undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop&&""===e?.productDetails?.onlineStoreUrl)return!1;const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,r="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&r}),ee),Te="productTier"===Z?K.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===Z?J.reduce((e,t)=>e+t.minimumQuantity,0):i.minimumQuantity,Se=a((e,t)=>{const n=be?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[be]),[Fe,Be]=t(3e3);n(()=>{const e=se?.find(e=>"PRICE_RANGE"===e.type||"filter.v.price"===e.id);e&&e.values?.[0]?.input?.price?.max&&Be(e.values[0].input.price.max)},[D,se]);const[Ie,ze]=t(""),[$e,Pe]=t(""),Ae=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(ke,Ie),De=((e,t)=>[...e].sort((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}}))(Ae,$e);n(()=>{(async e=>{if(!x)return;const{initialCursorData:t,cursorData:n,fetchFn:r,setCursorData:o}=x,a="productTier"===Z?K?.[E]?.tier:1;if(0===Object.values(e)?.length)return void("productTier"===Z?(M(e=>({...e,[E]:U?.[E]||[]})),o(Y||{...n})):(_(H),o(Y||{1:t?.[1]})));const i=await r(e,a,null);re.current&&i&&("productTier"===Z?(M(e=>({...e,[E]:i})),_(e=>{const t=new Set(e.map(e=>e.productId)),n=i.filter(e=>!t.has(e.productId));return[...e,...n]})):_(i))})(oe)},[oe]);const[_e,Le]=ve(id),[Re,Oe]=t(!1);n(()=>{y?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i?._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder"}}),setTimeout(()=>{Oe(!0)},100)},[]);const Me=o(null);n(()=>{const e=()=>{C(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(i.coverImageUrl){const e=new Image;e.src=Nu(i.coverImageUrl)??"",e.onload=()=>{w(e.width/e.height)}}},[i.coverImageUrl]),n(()=>{Oe(!1),setTimeout(()=>Oe(!0),100)},[E]);const Ve=(e,t)=>{if("productTier"===Z){let n={...T},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=K.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}S(n);const o=K.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==o&&k(o)}u(e,t)},We=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if(i){if("productTier"!==i?.builderTiers?.type)return _(i?.products??[]),void q(i?.products??[]);if(i?.workWithoutPagination){if("productTier"===i?.builderTiers?.type){const e={};i.builderTiers.productTier?.forEach((t,n)=>{const r=t.products.map(e=>{const t=i?.products?.find(t=>t.productId===e.productId);return t?{...t,variantIds:e.variantIds?.length?e.variantIds:t.variantIds}:null}).filter(Boolean);e[n]=r}),M(e),Q(e)}}else"productTier"===i?.builderTiers?.type&&(M({0:i?.products}),Q({0:i?.products}))}},[i]),n(()=>{if("productTier"!==Z||!K[E])return;if(Te===m)return;const e=K.findIndex((e,t)=>{const n=T[t]||[];return t>=E&&n.length<e.minimumQuantity});if(-1!==e&&e!==E){k(e);const t=K[E];t?.products?.length>1&&We()}else if(-1===e&&N&&E<K.length){K.every((e,t)=>(T[t]?.length||0)>=e.minimumQuantity)&&k(K.length)}},[T,K,Z,N]),n(()=>{ze(""),te("All")},[E]),n(()=>{function e(e){if(!Me.current||!e.target)return;!Me.current.contains(e.target)&&Le(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const je=(e,t,n)=>{var r;"productTier"===Z&&(r=e,S(e=>{const t={...e},n=K.findIndex((e,n)=>{const r=t[n]||[];return n>=E&&r.length<e.minimumQuantity}),o=-1!==n?n:E;return-1!==n&&k(n),t[o]||(t[o]=[]),t[o].push(r),t}));const o=!0===K[E]?.isFreebieTier;y?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Fu(e,t,n,l,s,o,E)},He=(()=>{if(!i?.builderTiers)return i.minimumQuantity;const{type:e,offerTier:t,productTier:n}=i.builderTiers,r="offerTier"===e?t:"productTier"===e?n:null;if(!r)return i.minimumQuantity;let o=0;return r.map(e=>{o+=e.minimumQuantity}),o})(),qe=v&&i.mobileCoverImageUrl?Nu(i.mobileCoverImageUrl):Nu(i.coverImageUrl??"")||null,Ue=a(e=>{if("undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop&&""===e?.productDetails?.onlineStoreUrl)return!1;const t=X?.general?.showOutOfStockProducts;if(t)return!0;const n=e?.productDetails,r=n?.variants?.edges||[];if(be){if(r.some(e=>be.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>Se(n,e.node.id)>0)},[X?.general?.showOutOfStockProducts,be,Se]),Qe=r(()=>{if("productTier"===Z&&K.length>0){const e=O?.[E]??[];return $e?De.filter(t=>e.some(e=>e.productId===t.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))&&Ue(t)):e.map(e=>De.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))).filter(e=>e&&Ue(e))}return De.filter(Ue)},[Z,K,O,E,De,Ue,$e]),Ye=Qe;n(()=>{if("productTier"!==Z)return;const e=K[E];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;if(1!==O?.[E]?.length)return;const t=e.products[0],n=D.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const r=n.variants?.edges?.find(e=>Se(n,e.node.id)>0)?.node;if(!r)return;const o=r.id,a=T[E]?.includes(o);if(!a&&(je(o,n,1),E<K.length-(N?0:1))){k(E+1);const e=K?.[E];e?.products?.length>1&&We()}},[Z,K,E,D,T,Se,je]);const Ge=r(()=>ke.filter(e=>{const t=e?.productDetails;return(t.variants?.edges||[]).some(e=>Se(t,e.node.id)>0)}).length,[ke,Se]),Ze=r(()=>ke.length-Ge,[ke,Ge]),Xe="bundles"==i.appName?i.pageHeader?.title:i?.title,Ke="bundles"==i.appName?i.pageHeader?.description:i?.subtitle,Je=Ee&&Boolean(X?.byob?.enableProductCategories),et=r(()=>{if(i?.workWithoutPagination)return!1;if(!Je)return!1;if(!x)return!1;const e="productTier"===Z?K[E]?.tier:1;if(void 0===e)return!1;const t=x.cursorData?.[e];return t?t.hasNext:L},[i?.workWithoutPagination,Je,x,Z,K,E,L]);n(()=>{if(i?.workWithoutPagination)return;if(Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Z?n:1;if(e?.[r]&&!e?.[r]?.hasNext||!t)return;const o=le.current;o.currentProductTier===E&&o.tierType===Z||(ie.current=void 0,le.current={...o,currentProductTier:E,tierType:Z});const a=new IntersectionObserver(async([n])=>{if(!n.isIntersecting)return;if(L)return;const o=e?.[r]?.cursor||null;if(ie.current!==o){ie.current=o,R(!0);try{const n=await t(oe,r,e?.[r]?.cursor);if(!re.current)return;if(n?.length>0){const e=Object.values(oe).length>0;"productTier"===Z?(M(e=>({...e,[E]:[...e[E]||[],...n]})),e||Q(e=>({...e,[E]:[...e[E]||[],...n]})),_(e=>[...e,...n])):(_(e=>[...e,...n]),e||q(e=>[...e,...n]))}}catch(e){console.error("Pagination fetch failed:",e),ie.current=void 0}finally{re.current&&R(!1)}}},{root:null,rootMargin:"300px",threshold:.01}),l=ne.current;return l&&a.observe(l),()=>{l&&a.unobserve(l)}},[i?.workWithoutPagination,Je,x,L,Z,E,K,oe]),n(()=>{if(i?.workWithoutPagination)return;if(!Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Z?n:1;if(!t)return;const o=le.current;(o.currentProductTier!==E||o.tierType!==Z||JSON.stringify(o.appliedFilters)!==JSON.stringify(oe))&&(ie.current=void 0,le.current={appliedFilters:oe,currentProductTier:E,tierType:Z});if(!(!e?.[r]||e[r].hasNext))return void R(!1);if(L)return;(async()=>{const n=e?.[r]?.cursor||null;if(ie.current!==n){ie.current=n,R(!0);try{const e=await t(oe,r,n);if(!re.current)return;if(e?.length>0){const t=Object.values(oe).length>0;"productTier"===Z?(M(t=>({...t,[E]:[...t[E]||[],...e]})),t||Q(t=>({...t,[E]:[...t[E]||[],...e]})),_(t=>[...t,...e])):(_(t=>[...t,...e]),t||q(t=>[...t,...e]))}}catch(e){console.error("Fetch all products pagination error:",e),ie.current=void 0}finally{re.current&&R(!1)}}})()},[i?.workWithoutPagination,Je,x,E,oe,Z,L,K]),n(()=>{if(!Je&&!i?.workWithoutPagination)return;if(et)return;if(!j.current)return;const e=new IntersectionObserver(([e])=>{e.isIntersecting&&V<Qe.length&&W(e=>Math.min(e+20,Qe.length))},{rootMargin:"200px"});return e.observe(j.current),()=>e.disconnect()},[Je,et,V,Qe.length]),n(()=>{W(20)},[E,Qe.length,Je,i?.workWithoutPagination]);const tt=()=>{y?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-builder-section",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",marginBottom:"20px",backgroundColor:X.byob.sectionBackgroundColor,..."transparent"!==X.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},qe?e.createElement("div",{className:"yt-byob-cover-image-container",style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...i?.coverImageVerticalMargin&&{marginBottom:i?.coverImageVerticalMargin,marginTop:i?.coverImageVerticalMargin}}},qe&&e.createElement(vd,{coverImageUrl:qe,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{className:"yt-byob-cover-image-overlay",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:X?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},Xe),e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Ke))):(Xe||Ke)&&e.createElement("div",{className:"yt-byob-header-content",style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},Xe&&e.createElement("span",{className:"bundle-builder-title",style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:X?.byob?.titleBackgroundColor??"transparent"}},Xe),Ke&&e.createElement("span",{className:"bundle-builder-subtitle",style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"}},Ke)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===Z&&K.length>0&&X?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-stepper-wrapper"},e.createElement(Ld,{currentStep:E,totalSteps:K.length+(N?1:0),tiers:N?[...K,{title:i.personalizedForm?.title||"Personalize",tier:K.length,minimumQuantity:0,products:[],isFormStep:!0}]:K,isMobile:v,primaryColor:X?.general?.primaryColor,primaryTextColorCta:X?.general?.primaryContrastColor,setCurrentProductTier:k,selectedProductsByTier:T,tierNavigation:X.byob.tierNavigation})))),e.createElement("div",{className:"yt-byob-layout-wrapper",style:{display:"flex",flexDirection:"row",width:v?"100%":"90%",marginInline:"auto"}},"sidebar"===X?.byob?.productFiltersDisplay&&!v&&!$&&e.createElement(Td,{showFiltersDrawer:de,handleClose:()=>pe(!1),isAnimating:!1,isMobile:!1,availableFilters:se,appliedFilters:oe,toggleFilter:(e,t)=>{ae(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{ae({}),ye(0),ue(Fe)},applyPriceFilter:()=>{ae(e=>{const t={...e};return t["filter.v.price"]=[`min:${ge}-max:${me}`],t})},priceMin:ge,setPriceMin:ye,priceMax:me,setPriceMax:ue,maxPossiblePrice:Fe,styles:X,products:D,unavailableProductCount:Ze,storeCurrencyCode:i?.storeCurrencyCode,openSections:fe,toggleSection:he}),e.createElement("div",{className:"yt-byob-products-column",style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},!$&&e.createElement("div",{className:"yt-byob-filters-wrapper",style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(Sd,{enableSortAndFilter:i?.enableSortAndFilter??!1,isMobile:v,searchTerm:Ie,setSearchTerm:ze,setSortBy:Pe,styles:X,appliedFilters:oe,setAppliedFilters:ae,availableFilters:se,products:D,availableProductCount:Ge,unavailableProductCount:Ze,maxPossiblePrice:Fe,storeCurrencyCode:i?.storeCurrencyCode,sharedFiltersState:{showFilters:de,setShowFilters:pe,priceMax:me,setPriceMax:ue,priceMin:ge,setPriceMin:ye},openSections:fe,toggleSection:he}),i?.customizations?.byob?.enableProductCategories&&Ee&&e.createElement("div",{className:"yt-byob-category-filter-container"},e.createElement(Rd,{styles:X,isMobile:v,categories:Ce,activeCategory:ee,onCategoryChange:e=>{te(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:X?.byob?.listingsGap||"12px",justifyContent:de&&"sidebar"===X?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},$&&i.personalizedForm?.title?e.createElement(Bd,{form:i.personalizedForm,formData:F,setFormData:B,isUploading:I,setIsUploading:z}):0!==Ye?.length||L||et?(Je?Qe.slice(0,V):Qe).map((t,n)=>{if("productTier"===Z){const r=(K[E]?.minimumQuantity??0)>(T[E]?.length??0),o=De.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return o?e.createElement(_d,{bundle:i,idx:n,key:`tier-${E}-${t?.variantIds?.[0]??t.productId}-${n}`,product:o?.productDetails,handleAddToBundle:je,hideAddToBundle:!r,remainingQuantity:He-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>Ve(e,E),selecteditems:l,transitionActive:Re,customVariantsQuantity:be,currentProductTier:K[E],showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:E}):null}return e.createElement(_d,{bundle:i,idx:n,key:`card-${t.productId}-${n}`,product:t?.productDetails,handleAddToBundle:je,hideAddToBundle:m>=He,remainingQuantity:He-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>u(e),selecteditems:l,transitionActive:Re,customVariantsQuantity:be,tierIndex:E})}):e.createElement("div",{className:"yt-byob-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"40px 20px",gap:"16px"}},e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",margin:0}},Object.values(oe).length>0?"No products match your filters":"No products found"),Object.values(oe).length>0&&e.createElement("button",{onClick:()=>{ae({}),ye(0),ue(Fe)},style:{padding:"8px 16px",background:X?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:X?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px"}},"Clear All Filters")),!$&&(L||et)&&e.createElement("div",{className:"yt-byob-loading-wrapper",style:{width:"100%",display:"flex",justifyContent:"center",padding:"20px"}},e.createElement(Ne,{color:X?.general?.primaryColor||"#333",size:30})),!Je&&!i?.workWithoutPagination&&e.createElement("div",{ref:ne,className:"yt-byob-pagination-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null)),(Je||i?.workWithoutPagination)&&!et&&e.createElement("div",{ref:j,className:"yt-byob-virtualFetchAll-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null))),!p&&e.createElement(ad,{builderTiers:i?.builderTiers,showNextStep:A,handleAddToCart:async e=>{if(A)return k(E+1),void We();const t={};N&&Object.entries(F).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await c(e,t),tt()},minimumQuantity:Te,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:Ve,selectedItemsQuantity:m,percentageOff:i.percentageOff,loading:d,bundleSubtotal:g,amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:i?.dealTextColor??"#333",primaryTextColorCta:i?.primaryTextColorCta??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:I}),p&&e.createElement("div",{className:"yt-byob-sticky-tracker-wrapper",style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(ad,{showNextStep:A,handleAddToCart:async e=>{if(A)return k(E+1),void We();const t={};N&&Object.entries(F).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await c(e,t),tt()},minimumQuantity:Te,builderTiers:i?.builderTiers,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,loading:d,handleRemoveItem:u,handleRemoveItemProductTier:Ve,percentageOff:i.percentageOff,selectedItemsQuantity:m??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:X.general.primaryContrastColor??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:I})))),_e&&void 0!==m&&(()=>{let t=m<i.minimumQuantity;return"productTier"==Z?t=(K[E]?.minimumQuantity??0)>(T[E]?.length??0):"offerTier"==Z&&(t=m<J.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(wd,{bundleType:"byob",bundle:i,handleAddToBundle:je,ref:Me,remainingQuantity:i.minimumQuantity-m,hideAddToBundle:!t,disableQuantitySelector:i?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:T,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:i?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:X?.general.primaryColor||"#000",cornerRadius:i?.customizations.byob.borderRadius,styles:i.customizations,customVariantsQuantity:be,bundleProductsCustomQuantity:i?.customProductsQuantity,isFreebieTier:K?.[E]?.isFreebieTier,showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:i?.variantOptions})})(),e.createElement(Pd,{isOpen:Boolean(d)&&"animated"===i?.customizations?.general?.atcLoaderType})))},Md="\n@keyframes cartATCFadeIn {\n 0% {\n opacity: 0;\n transform: scale(0.96);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes cartATCSlideIn {\n 0% {\n transform: translateX(-150%);\n opacity: 0;\n }\n 20% {\n opacity: 1;\n }\n 100% {\n transform: translateX(0);\n opacity: 1;\n }\n}\n\n@keyframes cartATCSlideOut {\n 0% {\n transform: translateX(0);\n opacity: 1;\n }\n 80% {\n opacity: 1;\n }\n 100% {\n transform: translateX(150%);\n opacity: 0;\n }\n}\n\n@keyframes cartATCBounce {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(1.5px);\n }\n}\n\n@keyframes cartATCItemDrop1 {\n 0%, 5% {\n transform: translate3d(-50%, -22px, 0) scale(0.4);\n opacity: 0;\n }\n 20% {\n transform: translate3d(-50%, -10px, 0) scale(0.95);\n opacity: 1;\n }\n 55% {\n transform: translate3d(-50%, 3px, 0) scale(0.7);\n opacity: 1;\n }\n 75%, 100% {\n transform: translate3d(-50%, 7px, 0) scale(0.3);\n opacity: 0;\n }\n}\n\n@keyframes cartATCItemDrop2 {\n 0%, 30% {\n transform: translate3d(-50%, -22px, 0) scale(0.4);\n opacity: 0;\n }\n 45% {\n transform: translate3d(-50%, -10px, 0) scale(0.95);\n opacity: 1;\n }\n 80% {\n transform: translate3d(-50%, 3px, 0) scale(0.7);\n opacity: 1;\n }\n 95%, 100% {\n transform: translate3d(-50%, 7px, 0) scale(0.3);\n opacity: 0;\n }\n}\n",Vd=({loading:r,color:a="currentColor",size:i=24,children:l,className:s="",style:c,onComplete:d})=>{const[p,m]=t(r?"entering":"idle"),u=o(null),g=o(null);if(n(()=>(r?(g.current&&clearTimeout(g.current),m("entering"),u.current=setTimeout(()=>{m("filling")},400)):(u.current&&clearTimeout(u.current),m(e=>"filling"===e||"entering"===e?(g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{m("idle"),d?.()},450),"exiting"):"idle")),()=>{u.current&&clearTimeout(u.current),g.current&&clearTimeout(g.current)}),[r,d]),"idle"===p)return l?e.createElement("span",{className:s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",animation:"cartATCFadeIn 0.3s ease-out forwards",...c}},e.createElement("style",null,Md),l):null;const y="entering"===p,f="exiting"===p,x={display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden",height:i+6,paddingLeft:8,paddingRight:8,verticalAlign:"middle",width:"100%",...c},h={display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",animation:y?"cartATCSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards":f?"cartATCSlideOut 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards":"cartATCBounce 1.2s ease-in-out infinite"};return e.createElement("span",{className:`yt-cart-atc-loader ${s}`,style:x},e.createElement("style",null,Md),e.createElement("div",{style:h},e.createElement("svg",{width:i,height:Math.round(24*i/28),viewBox:"0 0 28 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M1 2h4l2.6 13.2a2 2 0 002 1.6h12.8a2 2 0 002-1.6L26 6H6.6",stroke:a,strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("circle",{cx:"10.5",cy:"20.5",r:"1.8",fill:a}),e.createElement("circle",{cx:"21.5",cy:"20.5",r:"1.8",fill:a})),("filling"===p||"entering"===p||"exiting"===p)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"absolute",top:1,left:"56%",width:9,height:9,animation:"cartATCItemDrop1 1.4s ease-in-out infinite",pointerEvents:"none"}},e.createElement("svg",{width:"9",height:"9",viewBox:"0 0 10 10",fill:"none"},e.createElement("rect",{x:"1",y:"2",width:"8",height:"7",rx:"1",fill:"#f5a623",stroke:a,strokeWidth:"1"}),e.createElement("path",{d:"M5 2v7",stroke:a,strokeWidth:"1"}))),e.createElement("div",{style:{position:"absolute",top:1,left:"56%",width:9,height:9,animation:"cartATCItemDrop2 1.4s ease-in-out infinite",pointerEvents:"none"}},e.createElement("svg",{width:"9",height:"9",viewBox:"0 0 10 10",fill:"none"},e.createElement("rect",{x:"1",y:"2",width:"8",height:"7",rx:"1",fill:"#4a90d9",stroke:a,strokeWidth:"1"}),e.createElement("path",{d:"M1 5h8",stroke:a,strokeWidth:"1"}))))))},Wd=({isOpen:r,onClose:o,formConfig:a,onCheckout:i,cta:l,isMobile:s})=>{const[c,d]=t({}),[p,m]=t(!1);n(()=>{r||d({})},[r]);const u=e=>{if(p)return;const t={};Object.entries(c).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),i(e?{}:t)};if(!r)return null;const g=e.createElement("div",{className:"yt-personalized-form-modal-overlay",onClick:o,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:s?"flex-end":"center",justifyContent:"center"}},e.createElement("style",null,"\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes fadeIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "),e.createElement("div",{className:"yt-personalized-form-modal",onClick:e=>e.stopPropagation(),style:{background:"white",width:s?"100vw":"500px",maxWidth:s?"100vw":"560px",height:s?"80vh":"auto",maxHeight:s?"80vh":"90vh",borderRadius:s?"20px 20px 0 0":"20px",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:999,animation:s?"slideUp 0.3s ease-out":"fadeIn 0.2s ease-out"}},e.createElement("div",{className:"yt-personalized-form-modal-header",style:{width:"100%",padding:s?"20px 20px 16px":"18px 20px",fontWeight:700,fontSize:s?"18px":"16px",textAlign:"center",position:"relative",borderBottom:"1px solid #eee",flexShrink:0,backgroundColor:"#ffffff",color:"#1a1a1a",boxSizing:"border-box",lineHeight:"1.4"}},a.title||"Personalization",!s&&e.createElement("button",{className:"yt-personalized-form-modal-close",onClick:o,style:{position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",fontSize:"24px",lineHeight:1,cursor:"pointer",color:"#666",padding:"4px"}},"×")),e.createElement("div",{className:"yt-personalized-form-modal-body",style:{flex:1,overflowY:"auto",padding:s?"20px 20px":"16px 20px"}},e.createElement(Bd,{form:a,formData:c,setFormData:d,isUploading:p,setIsUploading:m})),e.createElement("div",{className:"yt-personalized-form-modal-footer",style:{padding:s?"12px 16px":"12px 24px 16px",borderTop:"1px solid #eee",flexShrink:0,background:"white",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"}},e.createElement("button",{className:"yt-personalized-form-submit-button",onClick:()=>{u(),o()},disabled:p,style:{width:"100%",fontSize:"15px",fontWeight:700,textAlign:"center",padding:"15px 0",border:"none",borderRadius:"10px",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l.backgroundColor,color:l.textColor,letterSpacing:"0.01em"}},p?e.createElement(Ne,{color:l.textColor,size:15}):"Submit"),e.createElement("button",{className:"yt-personalized-form-skip-button",onClick:()=>{u(!0),o()},style:{background:"none",border:"none",fontSize:"14px",fontWeight:600,color:"#1a1a1a",cursor:"pointer",padding:"4px 8px",textAlign:"center"}},"Add without customization"))));return M.createPortal(g,document.body)},jd=({product:t,selectedVariantId:n,onVariantChange:o,styles:a,originalPrice:i,dealPrice:l,totalPriceSum:s,isVertical:c=!1,variantOptions:d,storeCurrencyCode:p,reviewRatingType:m,productIndex:u,setActiveModalIndex:g})=>{const y=we(id),f=a?.comboBundle?.productClickAction??"details-modal",x=r(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),r=n?.node;return r?t?.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t?.productDetails]),b=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;x(n);const w=r(()=>{if(b?.title&&t?.productDetails.options){const e=b.title.split(" / ");if(e.length===t?.productDetails.options.length)return e}return t?.productDetails.options?.map(e=>e.values[0])||[]},[b,t?.productDetails.options]),v=e=>{o(e)};return c?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},a.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:Nu(b?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,onClick:e=>{if("details-modal"===f&&t?.productDetails){e.stopPropagation(),void 0!==u&&g?.(u);const n={...t.productDetails,selectedVariant:b||t.productDetails.variants?.edges?.[0]?.node};y(n)}},style:{cursor:"details-modal"===f?"pointer":"default",objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:a.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>v(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=x(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(h,null)))))),(a.comboBundle.subProductsProductTitleVisibility||a.comboBundle.subProductsProductPriceVisibility||m)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal"}},e.createElement(He,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal",fontWeight:"500"}},e.createElement(He,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(_e,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},Su(a.general.currencySymbol),Tu((Number(b?.price||0)/Number(s)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.compareAtPrice?b.compareAtPrice:b?.price)):Number(l)<Number(s)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.price)))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===a.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===a.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},a.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:Nu(b?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,onClick:e=>{if("details-modal"===f&&t?.productDetails){e.stopPropagation();const n={...t.productDetails,selectedVariant:b||t.productDetails.variants?.edges?.[0]?.node};y(n)}},style:{cursor:"details-modal"===f?"pointer":"default",objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:a?.general?.imageAspectRatio||"1 / 1",height:"100px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===a.comboBundle?.infoAlignment?"flex-start":"right"===a.comboBundle?.infoAlignment?"flex-end":"center"===a.comboBundle?.infoAlignment?"flex-start":void 0}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==a.comboBundle.comboVariantTypeSelector&&t?.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&w&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},w.length>1?w.join(" / "):w)),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal"}},e.createElement(He,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal",fontWeight:"500"}},e.createElement(He,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(_e,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},Su(a.general.currencySymbol),Tu((Number(b?.price||0)/Number(s)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.compareAtPrice?b?.compareAtPrice:b?.price)):Number(l)<Number(s)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Su(a.general.currencySymbol),Tu(b?.price)))),t?.productDetails.variants.edges.length>1&&("dropdown"===a.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>v(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t?.productDetails.variants.edges.map(t=>{const n=x(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(h,null))):t?.productDetails.options.length>0?e.createElement(e.Fragment,null,t?.productDetails.options.map((n,r)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t?.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(o=>{const i=[...w];i[r]=o;const l=t?.productDetails.options.length>0?i.join(" / "):i[r],s=t?.productDetails.variants.edges.find(e=>e.node.title===l)?.node,c=0===(s?x(s.id):0);if(!1===a?.general?.showOutOfStockVariants&&c)return null;const p=w[r]===o,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${c?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!c&&s&&v(s.id)},disabled:c,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:c?.5:1,cursor:c?"not-allowed":"pointer"}},m?.values.find(e=>e.name===o)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!c?"26px":"24px",height:p&&!c?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===o)?.value}},e.createElement("span",null)):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:c?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!c?"#F7F7F7":"transparent",color:c?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):m&&"image"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${c?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!c&&s&&v(s.id)},disabled:c,style:{border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!c?"#F7F7F7":"transparent",cursor:c?"not-allowed":"pointer",padding:"0px",width:p&&!c?"26px":"24px",height:p&&!c?"26px":"24px",overflow:"hidden",opacity:c?.5:1}},m?.values.find(e=>e.name===o)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:Nu(m?.values.find(e=>e.name===o)?.value||"/placeholder.svg"),alt:o,style:{width:p&&!c?"26px":"24px",height:p&&!c?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:c?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!c?"#F7F7F7":"transparent",color:c?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${c?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!c&&s&&v(s.id)},disabled:c,style:{padding:"4px 8px",border:p&&!c?`1px solid ${a.general?.ctaBackgroundColor}`:c?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!c?"#F7F7F7":"transparent",color:c?"#ccc":"#707070",cursor:c?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:c?.5:1}},o)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const r=0===x(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&r?null:e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>v(t?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},t?.node?.title)}))))))},Hd=({bundle:o,addToCartFunction:a,dispatchAnalyticsEvent:i})=>{const l=r(()=>{const e="undefined"!=typeof window&&"clayco-com.myshopify.com"===window?.Shopify?.shop,t=o.products?.filter(t=>{if(e&&""===t?.productDetails?.onlineStoreUrl)return!1;const n=t?.productDetails?.status?.toLowerCase();return!n||("active"===n||"unlisted"===n)})||[];if(!t.some(e=>e.quantity&&e.quantity>1))return{...o,products:t};const n=t.reduce((e,t)=>{const n=t.quantity||1;for(let r=0;r<n;r++)e.push(t);return e},[]);return{...o,products:n}},[o]),[s,c]=t(!1),[d,p]=t(window.innerWidth<786),[m,u]=t(!1),[g,y]=t(null),f=r(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[x,h]=t(()=>{const e={};return l.products.forEach((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>f(t?.productDetails,e?.node?.id)>0)?.node;e[n]=r?r.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e}),[b,w]=t(null);n(()=>{if(b){const e=setTimeout(()=>w(null),2e3);return()=>clearTimeout(e)}},[b]);const v=l.products?.every((e,t)=>{const n=x[t];return f(e?.productDetails,n)>0});n(()=>(a&&(window.ytComboBundle={bundle:l,addToCart:a,selectedVariants:x},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[l,a,x]);const C=(e,t)=>{h(n=>({...n,[e]:t}))},E=async e=>{const t=Object.entries(x).map(([e])=>({id:l.products[parseInt(e)].productId,title:l.products[parseInt(e)]?.productDetails?.title}));i?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:l._id,bundleType:"combo-bundle",selectedProducts:t}});try{if(c(!0),w(null),!a)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const t=Object.entries(x).map(([e,t])=>{const n=l.products[parseInt(e)],r=n?.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return r?{variantId:t,price:Number(r.price)}:null}).filter(e=>null!==e),n=Object.values(x);await a(Number(N),n,Number(F),t,e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e),w(Cc(e))}c(!1)},k=l.customizations,T=k?.comboBundle?.discountBadgeDisplay||"discount-on-compare",S=k?.comboBundle?.discountBadgeVisibility,{originalPrice:N,dealPrice:F,offerValue:B,totalPriceSum:I,offerPercentage:z}=r(()=>{const{price:e,compareAtPrice:t}=Object.entries(x).reduce((e,[t,n])=>{const r=l.products[parseInt(t)],o=r?.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),n=!1===S?e:"discount-on-price"===T?e:t;let r=e;l?.percentageOff?r=e*(1-l.percentageOff/100):l?.dealAmount?r=l.dealAmount:l?.amountOff&&(r=e-l.amountOff);const o=n-r,a=n>0?Math.round((n-r)/n*100):0;return{originalPrice:n.toFixed(2),dealPrice:r.toFixed(2),offerValue:o.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:a}},[x,l.products,l.percentageOff,l.dealAmount,l.amountOff,T,S]);n(()=>{i?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:l._id,bundleType:"combo-bundle"}});const e=()=>{p(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const $=k.comboBundle?.comboCardStyle||"auto",P="vertical"===$||"auto"===$&&!d,A=k.comboBundle?.embedContentVisibility,D="bundles"==l.appName?l.pageHeader?.title:l?.title,_="bundles"==l.appName?l.pageHeader?.description:l?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:k.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===k.comboBundle?.infoAlignment?"flex-start":"right"===k.comboBundle?.infoAlignment?"flex-end":"center"===k.comboBundle?.infoAlignment?"center":void 0,textAlign:k.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},A&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:k.comboBundle?.productTitleFontSize||"28px",color:k.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},D)),A&&k?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:k.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(k.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Su(k.general.currencySymbol,l.storeCurrencyCode),Tu(F)),!isNaN(Number(N))&&!isNaN(Number(F))&&Number(N)>Number(F)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:k.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Su(k.general.currencySymbol,l.storeCurrencyCode),Tu(N)),Number(B)>0&&!1!==S&&(()=>{const t="percentage"===(k?.comboBundle?.discountDisplayType||"amount")?`${z}% Off`:`Save ${Su(k.general.currencySymbol,l.storeCurrencyCode)}${Tu(B)}`;return e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},t)})())),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:k.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),k.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,P?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(d?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},l.products.map((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===x[n])?.node;return r?e.createElement(jd,{key:`combo-product-${n}-${t.productId}`,product:t,styles:k,originalPrice:N,dealPrice:F,totalPriceSum:I,selectedVariantId:x[n],onVariantChange:e=>C(n,e),isVertical:P,variantOptions:l.variantOptions,storeCurrencyCode:l.storeCurrencyCode,reviewRatingType:k?.comboBundle?.comboProductRatingsDisplay,productIndex:n,setActiveModalIndex:y}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(d?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},k.comboBundle.subProductsSectionVisibility&&l.products.map((t,n)=>e.createElement(jd,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:k,originalPrice:N,dealPrice:F,totalPriceSum:I,selectedVariantId:x[n],onVariantChange:e=>C(n,e),variantOptions:l.variantOptions,reviewRatingType:k?.comboBundle?.comboProductRatingsDisplay,productIndex:n,setActiveModalIndex:y})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${v?"":"yt-comboBundle-bundle-cta-button-disabled"} ${d?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:b?"#dc2626":v?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor,color:b?"#ffffff":k.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:k.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:v?"pointer":"not-allowed",border:`1px solid ${b?"#dc2626":v?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor}`,boxShadow:k.general.ctaShadowType,padding:k.general?.ctaPadding,width:k.general?.ctaWidth,margin:"0"},disabled:!v||s,onMouseOver:e=>{k.general.customizeHoverState&&v&&!b&&!s&&(e.currentTarget.style.backgroundColor=k.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=k.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{k.general.customizeHoverState&&v&&!b&&!s&&(e.currentTarget.style.backgroundColor=k.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=k.general?.ctaTextColor||"#FFFFFF")},onClick:()=>{s||(async()=>{l?.personalizedForm?.title?u(!0):await E()})()}},"animated"===k?.general?.atcLoaderType?e.createElement(Vd,{color:"white",loading:s,size:22},b?e.createElement(e.Fragment,null,b):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement("span",null,v?k.comboBundle?.ctaTitle??"Add Bundle to cart":k.general.outOfStockLabel||"Out of Stock"),v&&k?.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("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"}))))):s?e.createElement(Ne,{color:"white",loading:s,size:20}):b?e.createElement(e.Fragment,null,b):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement("span",null,v?k.comboBundle?.ctaTitle??"Add Bundle to cart":k.general.outOfStockLabel||"Out of Stock"),v&&k?.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("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"})))))),A&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px",width:"100%"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:k.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:k.general.primaryColor+"08"},dangerouslySetInnerHTML:{__html:tr(_)}})),l?.personalizedForm?.title&&e.createElement(Wd,{isOpen:m,onClose:()=>u(!1),formConfig:l.personalizedForm,onCheckout:async e=>{await E(e),u(!1)},cta:{backgroundColor:k.general?.ctaBackgroundColor||"#121212",textColor:k.general?.ctaTextColor||"#FFFFFF"},isMobile:d}),e.createElement(wd,{bundleType:"comboBundle",handleAddToBundle:()=>{},selectedProducts:[],remainingQuantity:0,hideAddToBundle:!0,disableQuantitySelector:!0,themeColor:k?.general?.primaryColor||"#000",primaryTextColorCta:k?.general?.primaryContrastColor||"#fff",primaryBackgroundColorCta:k?.general?.primaryColor||"#000",cornerRadius:"8px",styles:k,onVariantSelect:e=>{null!==g&&C(g,e)},bundle:l,totalPriceSum:I,dealPrice:F}))},qd=c.div`
3456
3456
  max-width: 800px;
3457
3457
  container-type: inline-size;
3458
3458
  margin-top: ${e=>e.verticalMargin||"0px"};
@@ -4005,21 +4005,22 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
4005
4005
  overflow: hidden;
4006
4006
  position: relative;
4007
4007
 
4008
- -webkit-mask-image: linear-gradient(
4009
- to right,
4010
- transparent 0%,
4011
- black 2%,
4012
- black 98%,
4013
- transparent 100%
4014
- );
4015
- mask-image: linear-gradient(
4016
- to right,
4017
- transparent 0%,
4018
- black 2%,
4019
- black 98%,
4020
- transparent 100%
4021
- );
4022
-
4008
+ &[data-overflow="true"] {
4009
+ -webkit-mask-image: linear-gradient(
4010
+ to right,
4011
+ transparent 0%,
4012
+ black 2%,
4013
+ black 98%,
4014
+ transparent 100%
4015
+ );
4016
+ mask-image: linear-gradient(
4017
+ to right,
4018
+ transparent 0%,
4019
+ black 2%,
4020
+ black 98%,
4021
+ transparent 100%
4022
+ );
4023
+ }
4023
4024
 
4024
4025
  span {
4025
4026
  display: inline-block;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.10.76",
3
+ "version": "0.10.77",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "rm -rf dist && tsc && rollup -c",