yt-uikit 0.7.344-shadowdomBundle.19 → 0.7.344-shadowdomBundle.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2861,7 +2861,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2861
2861
|
&:hover {
|
|
2862
2862
|
border-color: ${({$themeColor:e})=>e||"#000"};
|
|
2863
2863
|
}
|
|
2864
|
-
`,Xp=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=Ut(nn),v=Ht(Gt),w=o(null),[C,k]=c(null),[E,T]=c(!1),[S,B]=c({}),[$,z]=c(y?.variantId),[D,I]=c(y?.quantity||1),[P,N]=c(!1),[_,O]=c(null);l((()=>{const e=localStorage.getItem("yt_variant_options");if(e)try{const t=JSON.parse(e);Array.isArray(t)&&O({options:t})}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}}),[]),l((()=>{y?.open?setTimeout((()=>{N(!0)}),10):N(!1)}),[y?.open]);l((()=>{(async()=>{if(!C&&r&&y?.variantId&&y?.handle){const e=await r(y.handle,y.variantId);if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds;if(t=y.freebieSelection&&Array.isArray(n)&&n.length>0?e.variants.find((e=>e.available&&n.includes(String(e.id)))):e.variants.find((e=>e.available&&String(e.id)===String(y.variantId))),t){z(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),B(n)}else z(void 0),B({})}k(e)}})()}),[C,r,y]);const M=(e,t)=>{const n={...S,[e]:t};B(n);const r=C?.variants?.find((e=>C.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));r&&(y?.freebieSelection&&Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.length>0?y.allowedVariantIds.includes(String(r.id))&&z(String(r.id)):z(String(r.id)))},A=C?.variants?.find((e=>String(e.id)===String($))),F=pn(v,v?.currency),R=i((()=>{const e={};if(!C)return e;const t=y?.freebieSelection&&Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0,n=y.allowedVariantIds;return C.options.forEach((r=>{e[r.name]=r.values.filter((e=>C.variants.filter((t=>{const n=C.options.indexOf(r);if(t[`option${n+1}`]!==e)return!1;return!!C.options.every(((e,n)=>{if(e.name===r.name)return!0;const o=S[e.name];return!o||t[`option${n+1}`]===o}))&&!!t.available})).some((e=>!t||n?.includes(String(e.id))))))})),e}),[C,S,y]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{N(!1),setTimeout((()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Dp,{ref:x,className:"yt-variant-selection-popup"},t.createElement(Pp,{ref:w,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(Ip,null,"Unlocked Freebie"),t.createElement(_p,null,t.createElement(Op,null,t.createElement(Mp,null,t.createElement(Ap,{src:A?.featured_image?.src??C?.featured_image,alt:A?.featured_image?.alt??C?.title})),t.createElement(Fp,null,t.createElement(Rp,{$themeColor:a,$primaryTextColor:h,href:`${C?.url}?variant=${A?.id}`},C?.title),t.createElement(Yp,null,t.createElement(Lp,null,t.createElement(jp,{$primaryTextColor:h},F,dn(A?.price,v?.currency??"INR")),null!=A?.compare_at_price&&null!=A?.price&&A.compare_at_price>A.price&&t.createElement(Vp,null,F,dn(A?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(la,{value:D,handleItemQuantityIncrement:async()=>{I((e=>e+1))},handleItemQuantityDecrement:async()=>{D>1&&I((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),C?.options?.map((e=>{const n=_?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(Wp,{key:e.name},t.createElement(Gp,null,t.createElement("span",null,"Select ",e.name),S[e.name]&&t.createElement(Qp,null,S[e.name])),t.createElement(qp,null,R[e.name]?.map((r=>{const o=S[e.name]===r,i=n?.values?.find((e=>e.name.trim().toLowerCase()===r.trim().toLowerCase()));return"color"===n?.type&&i?.value?t.createElement(Zp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Kp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$imageUrl:i.value}):t.createElement(Up,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>M(e.name,r)},r)}))))}))),t.createElement(Hp,{$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if($&&n){T(!0);try{await n($,D,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!$)return;const t=!!y?.lineItemKey,r=String($)!==String(y?.variantId);if(!t||r){T(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m($,y.allowedVariantIds):n&&$&&await n($,D,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||E},E?t.createElement(Wo,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Dp,{ref:x},t.createElement(Pp,{style:{backgroundColor:p||"white"}},t.createElement(Np,null,t.createElement(qo,{color:a||"#868E96"}))))}));Xp.displayName="DesktopVariantPopup";const Jp=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=Ut(nn),v=Ht(Gt),[w,C]=c(null),[k,E]=c(!1),[T,S]=c({}),[B,$]=c(y?.variantId),[z,D]=c(y?.quantity||1),I=o(null),[P,N]=c(null),[_,O]=c(!1);l((()=>{const e=localStorage.getItem("yt_variant_options");if(e)try{const t=JSON.parse(e);Array.isArray(t)&&N({options:t})}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}}),[]),l((()=>{y?.open?setTimeout((()=>{O(!0)}),10):O(!1)}),[y?.open]);l((()=>{(async()=>{if(!w&&r&&y?.variantId&&y?.handle)try{const e=await r(y.handle,y.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds;if(t=y.freebieSelection&&Array.isArray(n)&&n.length>0?e.variants.find((e=>e.available&&n.includes(String(e.id)))):e.variants.find((e=>e.available&&String(e.id)===String(y.variantId))),t){$(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),S(n)}else $(void 0),S({})}C(e)}catch(e){}})()}),[w,r,y]),l((()=>{}),[p,e,n,r]);const M=(e,t)=>{const n={...T,[e]:t};S(n);const r=w?.variants?.find((e=>w.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));r&&$(String(r.id))},A=w?.variants?.find((e=>String(e.id)===String(B))),F=pn(v,v?.currency),R=i((()=>{const e={};if(!w)return e;const t=y?.freebieSelection&&Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0,n=y.allowedVariantIds;return w.options.forEach((r=>{e[r.name]=r.values.filter((e=>w.variants.filter((t=>{const n=w.options.indexOf(r);if(t[`option${n+1}`]!==e)return!1;return!!w.options.every(((e,n)=>{if(e.name===r.name)return!0;const o=T[e.name];return!o||t[`option${n+1}`]===o}))&&!!t.available})).some((e=>!t||n?.includes(String(e.id))))))})),e}),[w,T,y]);return w?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{O(!1),setTimeout((()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Dp,{ref:x,className:"yt-variant-selection-popup"},t.createElement(Pp,{ref:I,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(Ip,null,"Unlocked Freebie"),t.createElement(_p,null,t.createElement(Op,null,t.createElement(Mp,null,t.createElement(Ap,{src:A?.featured_image?.src??w?.featured_image,alt:A?.featured_image?.alt??w?.title})),t.createElement(Fp,null,t.createElement(Rp,{$themeColor:a,$primaryTextColor:h,href:`${w?.url}?variant=${A?.id}`},w?.title),t.createElement(Yp,null,t.createElement(Lp,null,t.createElement(jp,{$primaryTextColor:h},F,dn(A?.price,v?.currency??"INR")),null!=A?.compare_at_price&&null!=A?.price&&A.compare_at_price>A.price&&t.createElement(Vp,null,F,dn(A?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(la,{value:z,handleItemQuantityIncrement:async()=>{D((e=>e+1))},handleItemQuantityDecrement:async()=>{z>1&&D((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),w?.options?.map((e=>{const n=P?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(Wp,{key:e.name},t.createElement(Gp,null,t.createElement("span",null,"Select ",e.name,":"),T[e.name]&&t.createElement(Qp,null,T[e.name])),t.createElement(qp,null,R[e.name]?.map((r=>{const o=T[e.name]===r,i=n?.values?.find((e=>e.name.trim().toLowerCase()===r.trim().toLowerCase()));return"color"===n?.type&&i?.value?t.createElement(Zp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Kp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$imageUrl:i.value}):t.createElement(Up,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>M(e.name,r)},r)}))))}))),t.createElement(Hp,{$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if(B&&n){E(!0);try{await n(B,z,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}E(!1)}}:async()=>{if(!B)return;const t=!!y?.lineItemKey,r=String(B)!==String(y?.variantId);if(!t||r){E(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m(B,y.allowedVariantIds):n&&B&&await n(B,z,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}E(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||k},k?t.createElement(Wo,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Dp,{ref:x},t.createElement(Pp,{style:{backgroundColor:p||"white"}},t.createElement(Np,null,t.createElement(qo,{color:a||"#868E96"}))))})),eu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,cartTitle:s,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:m,backgroundColor:f,backgroundSubdued:h,tertiaryColor:x,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,showCouponOptions:k,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:D,applyDiscount:I,discountApplied:P,rewardCoupons:N,userTotalPoints:_,checkoutFunction:O,joinNowFunction:M,guestLoyaltyPercentage:A,showToggleButton:F,isOpen:R,setIsOpen:L,isDev:j,switchWidthVariant:V,recProductsList:H,showMultiStepProgressBar:W,cartCheckpoints:U,redemptionRate:G,pointsRewardRate:Q,showCartLevelAltPay:q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:K,exploreCtaRedirectLink:X,discountAmountApplied:J,discountInCheckoutButton:ee,isStickyCheckout:te,showDiscountsListToGuestUsers:ne,showApplyCouponsButtonToGuestUsers:re,handleCheckpointCrossed:oe,customCartProgressBarCriteria:ae,checkoutButtonColor:ie,ctaButtonBackgroundColor:le,ctaButtonTextColor:ce,primaryTextColor:de,productRecsCtaButtonText:se,productRecsTitleText:pe,secondaryTextColor:ue,showProductRecsOnDesktop:me,showProductRecsOnMobile:fe,themeColor:ge,themeTextColor:he,companyName:xe,gstNumber:ye,showGSTOption:be,applyGSTToCart:ve,showMOVForProgressTiers:we,freeProduct:Ce,showLoyaltyCta:ke,freeProductAdjustedCartTotal:Ee,minimumOrderValueToAvailDiscount:Te,signinCTAButtonVisible:Se,cartSigninCTAMainText:Be,showNoteOption:$e,applyNoteToCart:ze,note:De,inlineCartOfferInfoText:Ie,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:_e,getProductDetailsByVariantId:Oe,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Ae,originalCartSubtotal:Fe,currentTier:Re,freebieProductsInCart:Le,showFreebieClaim:je,addFreebieToCart:Ve,freebiesInCart:He,effectiveQuantityForProgressBar:We,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:qe,enableGeoLocationDeliveryRestriction:Ye,applyPostalCodeAndDeliverySlotToCart:Ze,showDeleteOnFreebies:Ke,freebieCouponTemplates:Xe,freebieFlowCheckpoints:Je,freebieClaimData:et,showStickyAddToCart:tt,stickyCartLineItem:nt,postalCodeBasedItemTrackingParameter:rt,enableSlotPicker:ot,deliveryHeaderTitle:at,deliveryAvailableText:it,deliveryNotAvailableText:lt,giftWrapSetupData:ct,giftWrapProductDetail:dt,enableCustomCartOnCartPage:st,isCartPage:pt,progressBarFreeProductIconType:ut,addToStickyCart:mt,productRecsCardLayout:ft,productRecsCardListVariant:gt,showCartTimer:ht,showFreebieMilestone:xt,freebieMilestoneData:yt,cartTimerInMinutes:bt,cartTimerCustomText:vt,imageAspectSelector:wt,cartComponentsCornerType:Ct,cartComponentsCornerRadius:kt,stickyCartCustomizationData:Et,cartOffersCarousalData:Tt,stickyBarBuyNowFunction:St,gstSectionCustomizationData:Bt,noteSectionTitle:$t,checkoutSectionMessage:zt,checkoutSectionMessageRedirectLink:Dt,checkoutSectionMessageDisplay:It,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:Nt,brandTokenName:_t,showDiscountOnMRP:Ot,prefixMessageText:Mt,suffixMessageText:At,successMessageText:Ft,toggleDecimal:Rt,cartOffersCarouselHeight:Lt,disableCheckoutButton:jt,showEmptyCartRecommendations:Vt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:Qt,showPoweredByBadge:qt=!0,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Kt,showCheckoutButtonPaymentIcons:Xt=!0})=>{const Jt=Wt(Gt),[en,tn]=Ut(nn),[rn,on]=Ut(Ui),an=()=>L(!R);g((()=>{v&&Jt(v)}),[v]);const ln=o(null);l((()=>{function e(e){ln.current&&!ln.current.contains(e.target)&&(tn({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),on({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const[cn,dn]=c(!1);return l((()=>{const e=()=>{dn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:st&&pt?"relative":"absolute",width:"100%",display:st&&pt?"flex":"block",alignItems:"center",justifyContent:"center"}},F&&!(st&&pt)&&t.createElement("button",{style:{margin:"16px"},onClick:an},R?"Close Drawer":"Open Drawer"),R&&b&&!(st&&pt)&&t.createElement("div",{onClick:an,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),t.createElement(sp,{isCartPage:pt,enableCustomCartOnCartPage:st,isOpen:R,setIsOpen:L,backgroundColor:f,backgroundSubdued:h??"#F5F5F5",tertiaryColor:x,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:s,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,emptyCartTitle:p,emptyCartButtons:m,emptyCartDescription:u,showCouponOptions:k,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:D,applyDiscount:I,discountApplied:P,rewardCoupons:N,userTotalPoints:_,checkoutFunction:O,joinNowFunction:M,guestLoyaltyPercentage:A,isDev:j,switchWidthVariant:V,recProductsList:H,showMultiStepProgressBar:W,cartCheckpoints:U,redemptionRate:G,pointsRewardRate:Q,showCartLevelAltPay:q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:K,exploreCtaRedirectLink:X,discountAmountApplied:J,discountInCheckoutButton:ee,isStickyCheckout:te,showDiscountsListToGuestUsers:ne,showApplyCouponsButtonToGuestUsers:re,handleCheckpointCrossed:oe,customCartProgressBarCriteria:ae??"minimum_order_value",checkoutButtonColor:ie,ctaButtonBackgroundColor:le,ctaButtonTextColor:ce,primaryTextColor:de,productRecsCtaButtonText:se,productRecsTitleText:pe,secondaryTextColor:ue,showProductRecsOnDesktop:me,showProductRecsOnMobile:fe,themeColor:ge,themeTextColor:he,companyName:xe,gstNumber:ye,showGSTOption:be,applyGSTToCart:ve,showMOVForProgressTiers:we,freeProduct:Ce,showLoyaltyCta:ke,freeProductAdjustedCartTotal:Ee,minimumOrderValueToAvailDiscount:Te,signinCTAButtonVisible:Se,cartSigninCTAMainText:Be,applyNoteToCart:ze,note:De,showNoteOption:$e,inlineCartOfferInfoText:Ie,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:_e,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Ae,originalCartSubtotal:Fe,currentTier:Re,freebieProductsInCart:Le,cartOffersCarousalData:Tt,showFreebieClaim:je,addFreebieToCart:Ve,freebiesInCart:He,effectiveQuantityForProgressBar:We,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:qe,enableGeoLocationDeliveryRestriction:Ye,applyPostalCodeAndDeliverySlotToCart:Ze,showDeleteOnFreebies:Ke,freebieCouponTemplates:Xe,freebieFlowCheckpoints:Je,freebieClaimData:et,postalCodeBasedItemTrackingParameter:rt,enableSlotPicker:ot,deliveryHeaderTitle:at,deliveryAvailableText:it,deliveryNotAvailableText:lt,giftWrapSetupData:ct,giftWrapProductDetail:dt,progressBarFreeProductIconType:ut,productRecsCardLayout:ft,productRecsCardListVariant:gt,showCartTimer:ht,showFreebieMilestone:xt,freebieMilestoneData:yt,cartTimerCustomText:vt,cartTimerInMinutes:bt,imageAspectSelector:wt,cartComponentsCornerType:Ct,cartComponentsCornerRadius:kt,gstSectionCustomizationData:Bt,noteSectionTitle:$t,checkoutSectionMessage:zt,checkoutSectionMessageRedirectLink:Dt,checkoutSectionMessageDisplay:It,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:Nt,getProductDetailsByVariantId:Oe,brandTokenName:_t,showDiscountOnMRP:Ot??!0,prefixMessageText:Mt,suffixMessageText:At,successMessageText:Ft,toggleDecimal:Rt,cartOffersCarouselHeight:Lt,disableCheckoutButton:jt,showEmptyCartRecommendations:Vt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:Qt,showPoweredByBadge:qt,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Kt,showCheckoutButtonPaymentIcons:Xt}),tt&&nt&&d&&t.createElement(zp,{showStickyCart:tt,stickyCartCustomizationData:Et,product:nt,addCartItem:d,onSetLoading:Me,themeColor:ge,themeTextColor:he,cartData:v,isCartOpen:R,setIsCartOpen:L,ctaButtonBackgroundColor:le,ctaButtonTextColor:ce,addToStickyCart:mt,cartComponentsCornerRadius:kt,cartComponentsCornerType:Ct,checkoutFunction:St,backgroundColor:f,primaryTextColor:de}),cn&&en.open&&t.createElement(Xp,{backgroundColor:f,ref:ln,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Oe,themeColor:ge,cartComponentsCornerRadius:kt,cartComponentsCornerType:Ct,removeFreebieFromCart:Qe,freebieClaimAddToCart:Ve,productClaimCtaButtonText:et?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de}),!cn&&en.open&&t.createElement(Jp,{ref:ln,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Oe,themeColor:ge,cartComponentsCornerRadius:kt,cartComponentsCornerType:Ct,backgroundColor:f,removeFreebieFromCart:Qe,freebieClaimAddToCart:Ve,productClaimCtaButtonText:et?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de})))};const tu=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:d})=>t.createElement(t.Fragment,null,e.map(((a,s)=>{const p=a.minimumQuantity-(r[s]?.length??0),u=o?.filter((e=>r[s]?.includes(e.variantId)));return t.createElement("div",{className:"yt-bundleBuilderTracker-tier-product-list",style:{display:"flex",width:"100%"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",gap:"5px"}},u?.map?.((e=>{const o=e.product.variants?.edges?.find((t=>t.node.id===e.variantId)),a=r[s]?.filter((e=>e===o?.node.id)).length||0;return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-product-item",key:e.variantId,style:{borderRadius:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge",style:{borderRadius:"2px"}},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},d,Dg(o?.node?.price)),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>l(e.variantId,s)},t.createElement(_a,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-item",key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-tracker-item",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,..."high"===c&&{borderRadius:"20px"},..."medium"===c&&{borderRadius:"6px"},...""===c&&{borderRadius:"0px"},height:n?"60px":"70px",width:n?"60px":"70px"}},a>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"}},a,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>l(e.variantId,s)},t.createElement(dt,{fontSize:"12px"}))))})),p>=1&&[...Array(p)].map(((e,r)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:n?"60px":"70px",height:n?"60px":"70px",borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"},key:r},t.createElement(Jr,{size:40,color:"#A0A0A0"})))))),s<e.length-1&&t.createElement("div",{className:"yt-bundleBuilderTracker-plus-icon-container"},t.createElement(Jr,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))}))),nu=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:a,showProductDetailsInTracker:i,loading:d,handleRemoveItem:s,percentageOff:p,selectedItemsQuantity:u,bundleSubtotal:m,amountOff:f,styles:g,dealAmount:h,isMobile:x=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:v,handleRemoveItemProductTier:w,selectedProductsByTier:C,storeCurrencyCode:k,shadowRoot:E})=>{const[T,S]=c(!1),[B,$]=c(0),[z,D]=c([]),[I,P]=c(0),[N,_]=c(0),[O,M]=c(!1),[A,F]=c(null),R=function(){const e=o(null);return l((()=>{const t=document.createElement("canvas");return t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n z-index: 2147483647;\n background: rgba(255,0,0,0.02); /* EXTREMELY light - just to detect */\n outline: 2px dashed rgba(255,0,0,0.15);\n ",document.body.appendChild(t),e.current=t,console.log("[confetti] canvas appended to document.body:",t),requestAnimationFrame((()=>{if(!e.current)return void console.warn("[confetti] canvasRef missing after RAF");const t=e.current.getBoundingClientRect();console.log("[confetti] canvas rect:",t.width,t.height,t)})),()=>{console.log("[confetti] removing canvas"),t.remove()}}),[]),function(t){if(!e.current)return void console.warn("[confetti] no canvasRef to draw on");const n=Ar(e.current,{resize:!0,useWorker:!1});console.log("[confetti] firing with options:",t),n(t)}}(),L=m?.price||0,j=e?.type,V=e=>{if(e<0||!z[e])return L;const t=z[e].discountValue??0;return p?L*(1-t/100):h?t:f?L-t:L};l((()=>{if(e&&"none"!==e.type)if("productTier"===j&&e.productTier){const t=e.productTier||[];D(t);let n=0;e.productTier.map((e=>{n+=e.minimumQuantity})),_(n-u)}else if(z.length)I>0&&u<z[I-1]?.minimumQuantity?(P(I-1),F(I-1)):u<z[I]?.minimumQuantity&&F(I-1),$(V(I));else{const t=e.offerTier||[];D(t),P(0),_(t[0]?.minimumQuantity-u||r-u)}else D([]),_(r-u),P(0)}),[e,r,u]),l((()=>{z.length&&"productTier"!=j?(()=>{if(!z?.length)return;let e=-1,t=null,n=0;if("offerTier"===j)for(let r=0;r<z.length&&(n+=z[r].minimumQuantity,u>=n);r++)t=r,e=r+1<z.length?r+1:r;if(P(e),F(t),null!==t){let e=z.slice(0,t+1).reduce(((e,t)=>e+t.minimumQuantity),0);M(e===u),S(!0),$(V(t))}else M(!1),S(!1),$(L);const r=e>=0&&e<z.length?z.slice(0,e+1).reduce(((e,t)=>e+t.minimumQuantity),0)-u:z[0].minimumQuantity-u;_(r)})():u===r?(S(!0),$(p?L*(1-p/100):h||(f?L-f:L)),M(!0)):(M(!1),S(!1))}),[u,z]);const H=T?Math.max(m?.compareAtPrice,m?.price):m?.compareAtPrice>m?.price?m?.compareAtPrice:null,W=T?B.toFixed(2):m?.price?.toFixed(2),U=H&&W?(H-Number(W)).toFixed(2):0,G=e&&"none"!==j&&e.offerTier?"offerTier"===j?Math.min(u/(u+N)*100,100):void 0:u/r*100,Q=o(!1);return l((()=>{const e=Q.current;if(Q.current=T,!e&&T&&g.byob.enableConfetti){const e=E??document,t=("getElementById"in e?e.getElementById("checkoutButton"):null)||document.getElementById("checkoutButton");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;R?.({particleCount:100,spread:70,origin:{x:r,y:o}})}}),[T,g]),t.createElement("div",{className:"yt-bundleBuilderTracker-container "+(x?"mobile":""),style:{justifyContent:g.byob.selectedProductsVisibility&&!x?"space-between":"center"}},"offerTier"==j&&null!==A&&A>=0&&t.createElement("div",{className:"yt-bundleBuilderTracker-offer-tier-tag",style:{backgroundColor:y||"#000",color:v||"#fff"}},t.createElement(t.Fragment,null,"Buy"," ",z.slice(0,A+1).reduce(((e,t)=>e+t.minimumQuantity),0)," ","at",f||h?t.createElement(t.Fragment,null," ",Ig(g.general.currencySymbol,k)):""," ",Dg(z[A]?.discountValue),p?t.createElement(t.Fragment,null,"% "):Dg(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied")),x&&N>=1&&!O&&"offerTier"!==j?t.createElement("div",{className:"yt-bundleBuilderTracker-mobile-remaining",style:{margin:"0",height:"auto"}},"Select ",N," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==j&&t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-container"},t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-text"},"offerTier"==j&&z.length>0&&I>=0&&N>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"},className:"yt-bundleBuilderTracker-add-more-text"},"Add ",N," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",u+N," at",f||h?t.createElement(t.Fragment,null,Ig(g.general.currencySymbol,k)):""," ",Dg(z[I]?.discountValue),p?t.createElement(t.Fragment,null,"% "):Dg(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):""))),t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-background"},t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-fill",style:{width:`${G??0}%`,backgroundColor:100===(G??0)?"#4caf50":y??g?.general.primaryColor??"black"}}," "))),g.byob.selectedProductsVisibility&&t.createElement("div",{className:"hide-tracker-scrollbar yt-bundleBuilderTracker-product-list-wrapper",style:{columnGap:"productTier"===j?"0px":"10px",maxWidth:x?"90%":"55%"}},"productTier"===j?t.createElement(tu,{tiers:z,isMobile:x,selectedProductsByTier:C??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:i,handleRemoveItemProductTier:w,cornerRadius:g.byob.borderRadius,currencySymbol:Ig(g.general.currencySymbol,k)}):t.createElement(t.Fragment,null,a?.map?.((e=>{const n=e.product.variants?.edges?.find((t=>t.node.id===e.variantId));return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-item-container",style:{borderRadius:g.byob.borderRadius},key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge"},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},g.general.currencySymbol,n?.node?.price),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(_a,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-item-wrapper",key:e.variantId,style:{marginTop:"8px",marginRight:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-item-image-box",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,height:x?"60px":"70px",width:x?"60px":"70px",borderRadius:g.byob.borderRadius}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:g.byob.borderRadius}},e.quantity,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>s(e.variantId)},t.createElement(dt,{fontSize:"12px"}))))})),N>=1&&[...Array(N)].map(((e,n)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:x?"60px":"70px",height:x?"60px":"70px",borderRadius:g.byob.borderRadius},key:n},t.createElement(Jr,{size:40,color:"#A0A0A0"})))))),(!x||O)&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-container",style:{width:x?"100%":"auto"}},Number(W)>0&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-info"},t.createElement("div",{style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},t.createElement("span",{className:"yt-bundleBuilderTracker-subtotal-label"},"Subtotal"),Number(U)>0?t.createElement("span",{className:"yt-bundleBuilderTracker-save-label"},"Save:"," ",Ig(g.general.currencySymbol,k),Dg(U)):""),t.createElement("div",{className:"yt-bundleBuilderTracker-subtotal-row"},t.createElement("span",{className:"yt-bundleBuilderTracker-total_price"},Ig(g.general.currencySymbol,k),Number(W)>=0?Dg(Number(W).toFixed(2)):0),H&&g.byob.compareAtPriceVisibility&&Number(H)>Number(W)&&t.createElement("span",{className:"yt-bundleBuilderTracker-summary_price"},Ig(g.general.currencySymbol,k),Dg(Number(H).toFixed(2))))),t.createElement("button",{className:"yt-bundleBuilderTracker-checkout-button",style:{cursor:O?"pointer":"auto",backgroundColor:100===(G??0)||O?g.general.ctaBackgroundColor||"black":"#f4f4f6",color:100===(G??0)||O?g.general.ctaTextColor||"#fff":"#000",border:`1.18px solid ${g.general.ctaBorderColor}`,borderRadius:g.general.ctaBorderRadius,boxShadow:O?"0px 4px 8px rgba(0, 0, 0, 0.2)":"none"},disabled:!O&&N>=1,onClick:e=>{d||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},d?t.createElement(Wo,{color:"white",loading:d,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!O?t.createElement("div",{className:"yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",N," More Item(s)"):t.createElement("div",{className:"yt-bundleBuilderTracker-checkout-text",style:{color:v??g.general.ctaTextColor}},g.byob.checkoutCTAText??"Checkout"))))},ru={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},ou={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},au=e=>{const[n,r]=c(!1);l((()=>{const e=()=>{r(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const o="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,a=((e,t=!1)=>{const n=e&&ru[e]?ru[e]:{},r={...ou,...n};return t&&n.mobile?{...r,...n.mobile}:r})(String(o),n);e.renderingOnPage||(a.position="static",a.zIndex=0);const i={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...a};return t.createElement("div",{className:"yt-bundle-builder-tracker-bar",style:{...i,width:n?"100%":a.width,...!e.styles.byob.selectedProductsVisibility&&{width:n?"96%":"fit-content",paddingInline:"10px"},...n&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===a.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=a.transform||"translateY(0)"}},t.createElement(nu,{...e,isMobile:n}))},iu=It(void 0);function lu(e){return lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lu(e)}function cu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function du(e,t){return du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},du(e,t)}function su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pu(e);if(t){var o=pu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===lu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function pu(e){return pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pu(e)}var uu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&du(e,t)}(o,h);var e,t,n,r=su(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,t=[{key:"componentDidMount",value:function(){!function(e,t){if(!document.head.querySelector("#"+e)){var n=document.createElement("style");n.textContent=t,n.type="text/css",n.id=e,document.head.appendChild(n)}}(this.props.name,this.props.css)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById(this.props.name);e.parentNode.removeChild(e)}},{key:"render",value:function(){return null}}],t&&cu(e.prototype,t),n&&cu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),mu=function(e){var t=e.imageBackgroundColor;return"\n body {\n overflow: hidden;\n }\n\n .__react_modal_image__modal_container {\n position: fixed;\n z-index: 5000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n touch-action: none;\n overflow: hidden;\n }\n\n .__react_modal_image__modal_content {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .__react_modal_image__modal_content img, \n .__react_modal_image__modal_content svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n -webkit-transform: translate3d(-50%, -50%, 0);\n -ms-transform: translate3d(-50%, -50%, 0);\n overflow: hidden;\n }\n\n .__react_modal_image__medium_img {\n max-width: 98%;\n max-height: 98%;\n background-color: ".concat(t,";\n }\n\n .__react_modal_image__large_img {\n cursor: move;\n background-color: ").concat(t,"\n }\n\n .__react_modal_image__icon_menu a {\n display: inline-block;\n font-size: 40px;\n cursor: pointer;\n line-height: 40px;\n box-sizing: border-box;\n border: none;\n padding: 0px 5px 0px 5px;\n margin-left: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .__react_modal_image__icon_menu {\n display: inline-block;\n float: right;\n }\n\n .__react_modal_image__caption {\n display: inline-block;\n color: white;\n font-size: 120%;\n padding: 10px;\n margin: 0;\n }\n\n .__react_modal_image__header {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n overflow: hidden;\n }\n")},fu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},gu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))},hu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},xu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},yu=function(){return t.createElement("svg",{fill:"#ffffff",height:"48",viewBox:"0 0 24 24",width:"48",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"}),t.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}))},bu=function(){return t.createElement("svg",{fill:"#ffffff",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0z"}),t.createElement("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"}))};var vu=function(e){return function(t){(function(e){return document.location.hostname!==new URL(e,document.location).hostname})(e)&&(t.preventDefault(),fetch(e).then((function(t){return t.ok||console.error("Failed to download image, HTTP status "+t.status+" from "+e),t.blob().then((function(t){var n=document.createElement("a");n.setAttribute("download",e.split("/").pop()),n.href=URL.createObjectURL(t),n.click()}))})).catch((function(t){console.error(t),console.error("Failed to download image from "+e)})))}},wu=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,d=e.enableZoom,s=e.enableRotate;return t.createElement("div",{className:"__react_modal_image__header"},t.createElement("span",{className:"__react_modal_image__icon_menu"},c&&t.createElement("a",{href:n,download:!0,onClick:vu(n)},t.createElement(hu,null)),d&&t.createElement("a",{onClick:a},o?t.createElement(gu,null):t.createElement(fu,null)),s&&t.createElement("a",{onClick:i},t.createElement(bu,null)),t.createElement("a",{onClick:l},t.createElement(xu,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Cu(e){return Cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cu(e)}function ku(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eu(e,t){return Eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Eu(e,t)}function Tu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bu(e);if(t){var o=Bu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Cu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Su(e)}(this,n)}}function Su(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bu(e){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bu(e)}function $u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Eu(e,t)}(a,h);var e,n,r,o=Tu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $u(Su(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),$u(Su(e),"handleOnLoad",(function(){e.setState({loading:!1})})),$u(Su(e),"handleOnContextMenu",(function(t){!e.props.contextMenu&&t.preventDefault()})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.id,r=e.className,o=e.src,a=e.style,i=e.handleDoubleClick;return t.createElement("div",null,this.state.loading&&t.createElement(yu,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&ku(e.prototype,n),r&&ku(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Du(e){return Du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Du(e)}function Iu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pu(e,t){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pu(e,t)}function Nu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ou(e);if(t){var o=Ou(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Du(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _u(e)}(this,n)}}function _u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ou(e){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ou(e)}function Mu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Au=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pu(e,t)}(a,h);var e,n,r,o=Nu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Mu(_u(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),Mu(_u(e),"handleKeyDown",(function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()})),Mu(_u(e),"getCoordinatesIfOverImg",(function(t){var n=t.changedTouches?t.changedTouches[0]:t;if("react-modal-image-img"===n.target.id){var r=e.contentEl.getBoundingClientRect();return{x:n.clientX-r.left,y:n.clientY-r.top}}})),Mu(_u(e),"handleMouseDownOrTouchStart",(function(t){if(t.preventDefault(),!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n||e.props.onClose(),e.state.zoomed&&e.setState((function(e){return{moveStart:{x:n.x-e.move.x,y:n.y-e.move.y}}}))}})),Mu(_u(e),"handleMouseMoveOrTouchMove",(function(t){if(t.preventDefault(),e.state.zoomed&&e.state.moveStart&&!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n&&e.setState((function(e){return{move:{x:n.x-e.moveStart.x,y:n.y-e.moveStart.y}}}))}})),Mu(_u(e),"handleMouseUpOrTouchEnd",(function(t){e.setState({moveStart:void 0})})),Mu(_u(e),"toggleZoom",(function(t){t.preventDefault(),e.setState((function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}}))})),Mu(_u(e),"toggleRotate",(function(t){t.preventDefault(),360!==e.state.rotationDeg?e.setState((function(e){return{rotationDeg:e.rotationDeg+=90}})):e.setState({rotationDeg:90})})),e}return e=a,(n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown,!1)}},{key:"render",value:function(){var e=this,n=this.props,r=n.medium,o=n.large,a=n.alt,i=n.onClose,l=n.hideDownload,c=n.hideZoom,d=n.showRotate,s=n.imageBackgroundColor,p=void 0===s?"black":s,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(uu,{name:"__react_modal_image__lightbox",css:mu({imageBackgroundColor:p})}),t.createElement("div",{className:"__react_modal_image__modal_container"},t.createElement("div",{className:"__react_modal_image__modal_content",onMouseDown:this.handleMouseDownOrTouchStart,onMouseUp:this.handleMouseUpOrTouchEnd,onMouseMove:this.handleMouseMoveOrTouchMove,onTouchStart:this.handleMouseDownOrTouchStart,onTouchEnd:this.handleMouseUpOrTouchEnd,onTouchMove:this.handleMouseMoveOrTouchMove,ref:function(t){e.contentEl=t}},f&&t.createElement(zu,{id:"react-modal-image-img",className:"__react_modal_image__large_img",src:o||r,style:{transform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)")},handleDoubleClick:this.toggleZoom}),!f&&t.createElement(zu,{id:"react-modal-image-img",className:"__react_modal_image__medium_img",src:r||o,handleDoubleClick:this.toggleZoom,contextMenu:!r,style:{transform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)")}})),t.createElement(wu,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!d})))}}])&&Iu(e.prototype,n),r&&Iu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Fu(e){return Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(e)}function Ru(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Lu(e,t){return Lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lu(e,t)}function ju(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hu(e);if(t){var o=Hu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Fu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vu(e)}(this,n)}}function Vu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hu(e){return Hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hu(e)}function Wu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Uu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lu(e,t)}(a,h);var e,n,r,o=ju(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wu(Vu(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),Wu(Vu(e),"toggleModal",(function(){e.setState((function(e){return{modalOpen:!e.modalOpen}}))})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.className,r=e.small,o=e.smallSrcSet,a=e.medium,i=e.large,l=e.alt,c=e.hideDownload,d=e.hideZoom,s=e.showRotate,p=e.imageBackgroundColor,u=this.state.modalOpen;return t.createElement("div",null,t.createElement("img",{className:n,style:{cursor:"pointer",maxWidth:"100%",maxHeight:"100%"},onClick:this.toggleModal,src:r,srcSet:o,alt:l}),u&&t.createElement(Au,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:d,showRotate:s,imageBackgroundColor:p}))}}],n&&Ru(e.prototype,n),r&&Ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const Gu=n(((e,n)=>{const[r,o]=Ut(iu),a=(e.disableInventoryTracking?r?.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableInventoryTracking)):r?.variants.edges)??[],[i,d]=c(a[0]?.node),[s,p]=c(0),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=600),[f,g]=c(1),[h,x]=c("idle"),[y,b]=c(null),[w,C]=c(null),k=e.shadowRoot??document.body;l((()=>{if(r){const t=r.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableQuantitySelector));d(r?.selectedVariant??t[0]?.node)}}),[r]),l((()=>{const t=e.selectedProducts.find((e=>e.variantId===i?.id));g(t?t.quantity:0)}),[f,e.selectedProducts,i]);const E=()=>{i?.id&&r&&(x("check"),e.handleAddToBundle(i?.id,r,1),setTimeout((()=>{x("idle"),o(void 0)}),500))};if(l((()=>{const e=()=>m(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),!r||0===a.length)return null;const{title:T,descriptionHtml:S,media:B,variants:$}=r,z=B.edges.map((e=>e.node.image)).filter((e=>e.url.length>0));l((()=>{if(r&&i?.image?.url&&Array.isArray(z)){const e=z.findIndex((e=>e.url===i?.image.url));-1!==e&&e!==s&&p(e)}}),[i]);const D=t=>{const n=t.target.value,r=a.find((e=>e.node.id===n))?.node;r&&(r.inventoryQuantity>0||e.disableInventoryTracking)&&d(r)};l((()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}}),[r,o]);const I=e=>{b(e.targetTouches[0].clientX),C(null)},P=e=>{C(e.targetTouches[0].clientX)},N=()=>{if(null!==y&&null!==w&&z.length>1){const e=y-w,t=50;e>t?p((e=>e<z.length-1?e+1:0)):e<-t&&p((e=>e>0?e-1:z.length-1))}b(null),C(null)};e.hideAddToBundle||(i?.inventoryQuantity??0)<=0&&e.disableInventoryTracking;const _=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content "+(u?"small-screen":"large-screen"),ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal "+(u?"small-screen":"large-screen")},t.createElement("div",{className:"yt-variant-selection-modal "+(u?"small-screen":"large-screen")},t.createElement("button",{className:"yt-bundleProductModal-modal-close-button",onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(it,{size:"25"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-section"},t.createElement(t.Fragment,null,t.createElement("div",{onTouchStart:I,onTouchMove:P,onTouchEnd:N},t.createElement(Uu,{small:z[s].url,medium:z[s].url,large:z[s].url,hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},z.length>1&&z.filter((e=>e.url.length>0)).map(((n,r)=>t.createElement("img",{key:r,src:n.url,alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>p(r),className:s===r?"active":"",style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...s===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"}})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",null,a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(Un,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-variant-selection",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:D,className:"yt-bundleProductModal-modal-select-input",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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(oo,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},i?.compareAtPrice&&parseFloat(i.compareAtPrice)>parseFloat(i?.price)&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.price)))),!e.hideAddToBundle&&((i?.inventoryQuantity??0)>0||e.disableInventoryTracking)&&(!e?.disableQuantitySelector||f<1)&&t.createElement("div",{style:{width:"80%"},className:"yt-bundleProductModal-modal-atc-wrapper"},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},className:"yt-bundleProductModal-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),E()},disabled:"idle"!==h},"Add to bundle")))),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:S}})))))),O=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content small-screen",style:{padding:"0px",position:"relative"},ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal"},t.createElement("button",{className:"yt-bundleProductModal-modal-phone-close-button",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:()=>{o(void 0)}},t.createElement(ao,{style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-variant-selection-modal small-screen",style:{padding:"0px",width:"100vw",height:"100vh",overflowY:"auto"}},t.createElement("div",{className:"yt-bundleProductModal-modal-image-section small-screen"},t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"},onTouchStart:I,onTouchMove:P,onTouchEnd:N},t.createElement(Uu,{small:z[s].url,medium:z[s].url,large:z[s].url,hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"}),t.createElement("div",{style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},z.length>1&&z.map(((e,n)=>t.createElement("span",{className:"yt-bundleProductModal-modal-image-indicator",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:s===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}}))))),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},z.length>1&&z.map(((n,r)=>t.createElement("img",{key:r,src:n.url,alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>p(r),className:s===r?"active":"",style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...s===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"}})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section small-screen",style:{padding:"0px !important",margin:"15px 0",paddingBottom:"50px"}},t.createElement("h2",{style:{margin:"0px"}},a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-only",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Un,{style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important",width:"95vw"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:S}})))),t.createElement("div",{className:"yt-bundleProductModal-modal-phone-bottom-bar",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}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:D,className:"yt-bundleProductModal-modal-select-input",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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(oo,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},i?.compareAtPrice&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.price)))),!e.hideAddToBundle&&((i?.inventoryQuantity??0)>0||e.disableInventoryTracking)&&(!e?.disableQuantitySelector||f<1)&&t.createElement("div",{style:{width:"100%"}},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},className:"yt-bundleProductModal-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),E()},disabled:"idle"!==h},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(u?O:_,k)})),Qu=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map((e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};return"color"===o?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):"image"===o?t.createElement("img",{src:kn(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.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"}},e.name)})(e,n?.name===e.name))}))),qu=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:i,disableInventoryTracking:d})=>{const[s,p]=c((()=>{const t=e.variants.edges.find((e=>d||e.node.inventoryQuantity>0))?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map((e=>e.values[0]))||[]})),[u,m]=c(window.innerWidth<1024);l((()=>{const e=()=>m(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n,r]);const f=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?s.join(" / "):s[0])))?.node,g=f?.image?.url||e.featuredMedia?.preview?.image?.url,h=kn(g,150,85,"webp"),x=e=>{if(!o?.options)return"text";const t=o.options.find((t=>t.name===e));return t?.type||"text"},y=e=>{if(!o?.options)return e.values.map((e=>({name:e,value:e})));const t=o.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}}))},b=(e,t)=>{const n=s[t];if(!n)return null;return y(e).find((e=>e.name===n))||null};if(!n)return null;const w=t.createElement("div",{onClick:r,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",className:"yt-bundleBuilder-variant-options-modal-backdrop"},t.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"}},className:"yt-bundleBuilder-variant-options-modal-container"},t.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"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"},className:"yt-bundleBuilder-variant-options-modal-product-block"},t.createElement("img",{src:h,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"},className:"yt-bundleBuilder-variant-options-modal-product-image"}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4},className:"yt-bundleBuilder-variant-options-modal-product-info"},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-product-title"},e.title))),t.createElement("div",{style:{padding:"20px"},className:"yt-bundleBuilder-variant-options-modal-variant-selectors"},e.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0},className:"yt-bundleBuilder-variant-options-modal-option"},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},className:"yt-bundleBuilder-variant-options-modal-option-label"},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-option-name"},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"},className:"yt-bundleBuilder-variant-options-modal-option-selected-value"},b(n,r)?.name||n.values[0])),t.createElement(Qu,{options:y(n),selectedValue:b(n,r),onChange:e=>{((e,t)=>{const n=[...s];n[e]=t.name,p(n)})(r,e)},type:x(n.name),isOptionAvailable:t=>((t,n)=>{if(d)return!0;const r=[...s];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find((e=>e.node.title===o))?.node;return!!a&&a.inventoryQuantity>0})(r,t),isMobile:u})))))),t.createElement("button",{className:"yt-bundleBuilder-variant-options-modal-confirm-button",onClick:()=>{const t=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?s.join(" / "):s[0])))?.node,n=t&&(d||t.inventoryQuantity>0);if(t?.id&&n)i(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",s);const t=e.variants.edges.find((e=>d||e.node.inventoryQuantity>0))?.node.id;t&&(i(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.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"}},"Add to Bundle")));return v.createPortal(w,document.body)};function Yu({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,disableInventoryTracking:d,selectedVariantInventoryQty:s}){const p={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"},u=d||e<s;return t.createElement("div",{className:"yt-bundleBuilder-quantity-selector-container"},t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-minus",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:p},"-"),t.createElement("div",{className:"yt-bundleBuilder-quantity-selector_quantity"},e," added"),t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-plus",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1);n(l),o&&a&&i&&o(a,i,1)},disabled:!u||c,style:{...p,cursor:!u||c?"not-allowed":"pointer",opacity:!u||c?.6:1}},"+"))}const Zu=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),i=r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url||"",l=e?.media?.edges?.map((e=>e.node.image.url)).filter(Boolean),d=l?.[1]??i??"";return t.createElement("div",{className:"yt-bundleBuilder-image-effect",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-bundleBuilder-image-effect_wrapper",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-bundleBuilder-image-effect_main-image",loading:"lazy",decoding:"async",fetchPriority:"low",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o&&(i||l?.[0])!==d?0:1,transition:l?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:i||l?.[0],alt:e.title}),(i||l?.[0])!==d&&t.createElement("img",{className:"yt-bundleBuilder-image-effect_hover-image",loading:"lazy",decoding:"async",fetchPriority:"low",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0},src:i||d,alt:e.title})))},Ku=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:a,themeColor:i,handleRemoveItem:d,transitionActive:s,idx:p,selecteditems:u,customVariantsQuantity:m})=>{const f=Wt(iu),g=n.customizations,h=g?.byob?.variantSelectorType,[x,y]=c(!1),b=g.general?.variantTitleSuffix?e?.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(" ")}}}))})(e?.variants?.edges);if(!b||!b.length)return t.createElement(t.Fragment,null);const v=b?.find((e=>e.node.inventoryQuantity>0||!g?.general.trackInventory))?.node?.id;if(!v&&!g.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[w,C]=c(b?.find((e=>!g?.general.trackInventory||e.node.inventoryQuantity>0))?.node?.id||b[0]?.node?.id),[k,E]=c(0),[T,S]=c(window.innerWidth<450),[B,$]=c("normal"),z=b?.find((e=>e?.node?.id===w))?.node,D=m&&m.length>0&&m.find((e=>e.variantId==z?.id))?.quantity||z&&z?.inventoryQuantity;l((()=>{const e=u.find((e=>e.variantId===w));E(e?e.quantity:0)}),[k,u,w]),l((()=>{const e=()=>{S(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{CSS.supports("font-weight","500")?$("500"):CSS.supports("font-weight","400")?$("400"):CSS.supports("font-weight","600")&&$("600")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",B)}),[B]),l((()=>{if(w&&!b?.some((e=>e.node.id===w))){const e=b[0]?.node.id;e&&C(e)}}),[w,b]);const I=e.variants&&e.variants.edges?.length>1&&"customOptions"!==h,P="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,N="53933408435"===P,_="75851235630"===P,O=(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[]})(e),M=O.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{className:`bundle-builder-product-container ${s?"yt-product-card-transition-active":p%2==0?"yt-product-card-transition":"yt-product-card-transition-up"} ${"none"===g?.byob.shadowType?"shadow-none":"spread"===g?.byob.shadowType?"shadow-spread":"shadow-no-spread"}`,style:{borderRadius:g?.byob.borderRadius,border:"transparent"!==g?.byob.borderColor?`1px solid ${g?.byob.borderColor}`:"none",backgroundColor:g?.byob.cardBackgroundColor||"#fff"},onClick:()=>{if(D<=0&&g?.general.trackInventory)return;const t={...e,variants:{...e.variants,edges:b},selectedVariant:z};f(t)}},t.createElement("div",{className:"yt-bundleBuilder-product-card_image-wrapper"},t.createElement(Zu,{product:e,styles:g,selectedVariant:z}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-bundleBuilder-product-card_badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:g.byob.borderRadius}},n.productCardBadgeText),I&&t.createElement("div",{className:"yt-bundleBuilder-variant-selector-container",style:{position:"relative",width:"100%"}},t.createElement("select",{className:"bundle-builder-variant-selector "+(N?"bundle-builder-variant-selector--coralHaze":""),onClick:e=>{e.preventDefault(),e.stopPropagation()},value:w||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),C(e.target.value)}},b?.map((e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)}))),t.createElement("div",{className:"yt-bundleBuilder-variant-selector_icon",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(A,null)))),t.createElement("div",{className:"yt-bundleBuilder-product-card_details"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&M&&t.createElement("div",{className:"yt-bundleBuilder-product-card_category-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-bundleBuilder-product-card_category-container",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},O.slice(0,2).map(((e,n)=>t.createElement("span",{className:"yt-bundleBuilder-product-card_category",key:n,style:{fontSize:T?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1)))),O.length>2&&t.createElement("span",{className:"yt-bundleBuilder-product-card_category-more",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",O.length-2," more"))),t.createElement("div",{className:"yt-bundleBuilder-product-card_title",style:{"--title-margin-top":T?"4px":"0px","--title-padding":n?.showBorder??1?"0 10px":"0 4px",...!1===g?.byob.productsPriceVisibility&&{"--title-padding":"8px"},...g?.byob.productTitleFontSize&&{"--title-font-size":g?.byob.productTitleFontSize}}},_?String(z?.displayName).replace("- Default Title",""):e.title,z?.commonSuffix?" -"+z?.commonSuffix:"")),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14}),t.createElement("span",{className:"yt-bundleBuilder-product-card_rating-text",style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Un,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),g?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-bundleBuilder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(z?.price??"0")>0?t.createElement("span",{className:"yt-bundleBuilder-product_price--new"},Ig(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Dg(z?.price)):t.createElement("span",{className:"yt-bundleBuilder-product-card_price--free"},"Free"),z?.compareAtPrice&&g?.byob.compareAtPriceVisibility&&parseFloat(z.compareAtPrice)>parseFloat(z?.price)&&t.createElement("span",{className:"yt-fixed-bundle-original-price yt-bundleBuilder-product-card_price--old",style:{fontSize:"14px"}},Ig(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Dg(z.compareAtPrice))),(D>0||!g?.general.trackInventory)&&t.createElement("div",{className:"yt-product-atc-wrapper"},(0===k||void 0===k)&&t.createElement("button",{style:{...!o&&{backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),E(1),(()=>{if(!w)return;"customOptions"===h&&b.length>1?y(!0):r(w,e,1)})()},className:"yt-product-atc-button"},g?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&k>0&&w&&t.createElement("div",{className:"visible yt-bundleBuilder-quantity-selector-container--visible",style:{overflow:"hidden"}},t.createElement(Yu,{remainingQuantity:a,setQuantity:E,quantity:k,handleAddToBundle:r,variantId:w,product:e,handleRemoveItem:d,hideAddToBundle:o,disableInventoryTracking:!g?.general.trackInventory,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&k>0&&w&&t.createElement("button",{style:{backgroundColor:g?.general?.primaryContrastColor||"#fff"},className:"yt-bundleBuilder-product-card_add-to-bundle-button--added"},t.createElement("div",{className:"yt-bundleBuilder-product-card_added-button-text"},"ADDED"),t.createElement("div",{onClick:e=>{e.stopPropagation();const t=Math.max(0,k-1);E(t),d&&w&&d(w,1)},className:"yt-bundleBuilder-product-card_remove-button"},t.createElement(to,{className:"yt-bundleBuilder-product-card_remove-icon",style:{color:"#fff",fontSize:"20px"}})))),D<=0&&g?.general.trackInventory&&t.createElement("div",{style:{backgroundColor:g.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled yt-bundleBuilder-product-card_add-to-bundle-button--disabled"},g?.general.outOfStockLabel||"Out of Stock")),"customOptions"===h&&x&&b.length>1&&t.createElement(qu,{product:e,isOpen:x,onClose:()=>y(!1),variantOptions:n.variantOptions,cta:{textColor:g.general.ctaTextColor,backgroundColor:g.general.primaryColor},onConfirm:t=>{C(t),r(t,e,1)},disableInventoryTracking:!g?.general.trackInventory}))},Xu=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:d})=>t.createElement("div",{className:"yt-bundleBuilder-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map(((c,s)=>{const p=s+1,u=o[s].minimumQuantity-(i[s]?.length??0)==0,m=s===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-bundleBuilder-stepper_step "+(m?"yt-bundleBuilder-stepper_step--active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===d?()=>{}:n(p-1)},t.createElement("div",{className:"yt-bundleBuilder-stepper_label",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-bundleBuilder-stepper_line-container",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_dot",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:s<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))}))),t.createElement("div",{className:"yt-bundleBuilder-tier_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[e]?.title)),Ju=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,d]=c(!1),[s,p]=c(r);return l((()=>{const e=setTimeout((()=>{n(s)}),300);return()=>clearTimeout(e)}),[s,n]),t.createElement("div",{className:"yt-byob-sort-filter-container yt-bundleBuilder-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner yt-bundleBuilder-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper yt-bundleBuilder-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(eo,{className:"yt-byob-search-icon yt-bundleBuilder-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>d(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input yt-bundleBuilder-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:s,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input yt-bundleBuilder-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(eo,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon yt-bundleBuilder-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>d(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper yt-bundleBuilder-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label yt-bundleBuilder-filter_label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select yt-bundleBuilder-filter_select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},em=({styles:e,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"===e?.byob?.categoryFilterOnPage?t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"},className:"yt-categoryfilter-tabs-container"},["All",...r].map((r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-tab-button "+(a?"yt-categoryfilter-tab-button--active":""),style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))})))):t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"},className:"yt-categoryfilter-buttons-container"},["All",...r].map((r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.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:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1))))))},tm=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:a,bundleAddToCartLoading:i,renderingOnPage:d,selectedItemsQuantity:s,handleRemoveItem:p,bundleSubtotal:u,shadowRoot:m})=>{const[f,g]=c(void 0),[h,x]=c(window.innerWidth<450),[y,b]=c(0),[v,w]=c({}),C=e.builderTiers?.type,k=e.customizations,E=e.builderTiers?.productTier??[],T=e.builderTiers?.offerTier??[],[S,B]=c([]),[$,z]=c(!1),[D,I]=c("All");l((()=>{const t=new Set;let n=!1;e?.products?.forEach((e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach((e=>t.add(e))))}})),B(Array.from(t)),z(n)}),[e.products]);const P=((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})))(e.products.filter((e=>"ACTIVE"===e.productDetails.status||void 0===e.productDetails.status||""===e.productDetails.status)),D),N="productTier"===C?E.reduce(((e,t)=>e+t.minimumQuantity),0):"offerTier"===C?T.reduce(((e,t)=>e+t.minimumQuantity),0):e.minimumQuantity,[_,O]=c(""),[M,A]=c(""),F=((e,t)=>e.filter((e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase()))))(P,_),R=((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}})))(F,M),L=((e,t,n,r,o)=>(e[o]?.products.filter((e=>t.some((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))))||[]).sort(((e,n)=>{let o=t.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0])))),a=t.find((e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0]))));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges[0]?.node?.price||"0"),d=parseFloat(a?.productDetails?.variants?.edges[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-d;case"price-high-to-low":return d-c;default:return 0}})))(E,R,_,M,y),[j,V]=Ut(iu),[H,W]=c(!1);l((()=>{setTimeout((()=>{W(!0)}),100)}),[]);const U=o(null);l((()=>{const e=()=>{x(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{if(e.coverImageUrl){const t=new Image;t.src=e.coverImageUrl,t.onload=()=>{g(t.width/t.height)}}}),[e.coverImageUrl]),l((()=>{W(!1),setTimeout((()=>W(!0)),100)}),[y]);const G=(e,t)=>{if("productTier"===C){let n={...v},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=E.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}w(n);const o=E.findIndex(((e,t)=>n[t]?.length<e.minimumQuantity));-1!==o&&b(o)}p(e)};l((()=>{if("productTier"===C){const e=Object.fromEntries(E.map((e=>[e.tier,[]])));w(e)}}),[e]),l((()=>{if("productTier"!==C||!E[y])return;if(N===s)return;const e=E.findIndex(((e,t)=>{const n=v[t]||[];return t>=y&&n.length<e.minimumQuantity}));-1!==e&&e!==y&&(b(e),(()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})})())}),[v,E,C]),l((()=>{O("")}),[y]),l((()=>{function e(e){if(!U.current||!e.target)return;!U.current.contains(e.target)&&V(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const Q=(e,t,o)=>{var a;"productTier"===C&&(a=e,w((e=>{const t={...e},n=E.findIndex(((e,n)=>{const r=t[n]||[];return n>=y&&r.length<e.minimumQuantity}));return-1!==n&&b(n),t[n]||(t[n]=[]),t[n].push(a),t}))),Pg(e,t,o,n,r)},q=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map((e=>{a+=e.minimumQuantity})),a})(),Y=h&&e.mobileCoverImageUrl?e.mobileCoverImageUrl:e.coverImageUrl||null,Z=e.customStoreDetails?.fixedInventoryDetails,K=e=>{const t=k?.general?.showOutOfStockProducts;if(t||!k?.general.trackInventory)return!0;const n=e?.productDetails?.variants?.edges||[];if(Z){if(n.some((e=>Z.some((t=>t.variantId===e.node.id&&t.quantity>0)))))return!0}return n.some((e=>e.node.inventoryQuantity>0))},X="bundles"==e.appName?e.pageHeader?.title:e?.title,J="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:k.byob.sectionBackgroundColor,..."transparent"!==k.fixedBundle.sectionBackgroundColor&&{padding:"20px"}},id:"yt-bundleBuilder-main-container",className:"yt-bundleBuilder-main-container"},Y?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}},className:"yt-bundleBuilder-header-banner"},Y&&t.createElement("img",{src:Y,alt:"Background",className:"yt-bundleBuilder-header_image",style:{width:"100%",height:"auto",display:"block"}}),t.createElement("div",{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)"},className:"yt-bundleBuilder-header_text-overlay"},t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:k?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title yt-bundleBuilder-header_title"},X),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle yt-bundleBuilder-header_subtitle"},J))):(X||J)&&t.createElement("div",{className:"yt-bundleBuilder-header-container"},X&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:k?.byob?.titleBackgroundColor??"transparent"},className:"yt-bundleBuilder-header_title"},X),J&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"yt-bundleBuilder-header_subtitle"},J)),t.createElement("div",{className:"products-display yt-bundleBuilder-products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(Xu,{currentStep:y,totalSteps:E.length,tiers:E,isMobile:h,primaryColor:k?.general?.primaryColor,primaryTextColorCta:k?.general?.primaryContrastColor,setCurrentProductTier:b,selectedProductsByTier:v,tierNavigation:k.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"},className:"yt-bundleBuilder-filters-container"},e?.enableSortAndFilter&&t.createElement(Ju,{isMobile:h,searchTerm:_,setSearchTerm:O,setSortBy:A,styles:k}),e?.customizations?.byob?.enableProductCategories&&$&&t.createElement("div",null,t.createElement(em,{styles:k,isMobile:h,categories:S,activeCategory:D,onCategoryChange:e=>{I(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display yt-bundleBuilder-product-grid"},0===R?.length||"productTier"===C&&0===L?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"},className:"yt-bundleBuilder-product-grid_no-products-text"},"No products found"):"productTier"===C&&E.length>0?L.filter((e=>K(R.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))))).map(((r,o)=>{const a=(E[y]?.minimumQuantity??0)>(v[y]?.length??0),i=R.find((e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0]))));return i?t.createElement(Ku,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:Q,hideAddToBundle:!a,remainingQuantity:q-s,themeColor:e?.dealTextColor,handleRemoveItem:e=>G(e,y),selecteditems:n,transitionActive:H,customVariantsQuantity:Z}):null})):R.filter(K).map(((r,o)=>t.createElement(Ku,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:Q,hideAddToBundle:s>=q,remainingQuantity:q-s,themeColor:e?.dealTextColor,handleRemoveItem:p,selecteditems:n,transitionActive:H,customVariantsQuantity:Z})))),!d&&t.createElement(au,{builderTiers:e?.builderTiers,handleAddToCart:a,minimumQuantity:N,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:p,handleRemoveItemProductTier:G,selectedItemsQuantity:s,percentageOff:e.percentageOff,loading:i,bundleSubtotal:u,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d,shadowRoot:m})),d&&t.createElement(au,{handleAddToCart:a,minimumQuantity:N,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:i,handleRemoveItem:p,handleRemoveItemProductTier:G,percentageOff:e.percentageOff,selectedItemsQuantity:s??0,bundleSubtotal:u??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:k.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d,shadowRoot:m}),j&&void 0!==s&&(()=>{let r=s<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=s<T.reduce(((e,t)=>e+t.minimumQuantity),0)),t.createElement(Gu,{handleAddToBundle:Q,ref:U,remainingQuantity:e.minimumQuantity-s,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,disableInventoryTracking:!e?.customizations.general.trackInventory,selectedProducts:n,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:k?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none",shadowRoot:m})})())},nm=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:d,storeCurrencyCode:s})=>{const p=e?.productDetails?.variants?.edges?.find((e=>e?.node?.id===n))?.node,u=i((()=>{if(p?.title&&e.productDetails.options){const t=p.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map((e=>e.values[0]))||[]}),[p,e.productDetails.options]),m=e=>{r(e)};return c?t.createElement("div",{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"}},t.createElement("div",{style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{src:p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg",alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{value:n,onChange:e=>m(e.target.value),style:{padding:"8px 10px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"14px",width:"100%",appearance:"none",marginRight:"30px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:e.node.inventoryQuantity<=0},e?.node?.title)))),t.createElement("div",{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"}},t.createElement(A,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{style:{lineHeight:"normal"}},Ig(o.general.currencySymbol,s),Dg((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},Ig(o.general.currencySymbol,s),Dg(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))))):t.createElement("div",{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"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.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"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{style:{position:"relative"}},t.createElement("img",{src:p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg",alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}}),t.createElement("div",{style:{position:"absolute",top:-8,right:-8,backgroundColor:"#f8f8f8",borderRadius:"50%",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #eee",fontSize:"14px"}},"1")),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",null," ",e?.productDetails?.title," "),e.productDetails.variants.edges.length>1&&d&&u&&t.createElement("span",{style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},u.length>1?u.join(" / "):u)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{style:{lineHeight:"normal"}},Ig(o.general.currencySymbol,s),Dg((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Ig(o.general.currencySymbol,s),Dg(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))),e.productDetails.variants.edges.length>1&&e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{marginTop:"10px",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&t.createElement("label",{style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map((a=>{const i=d&&d?.options?.find((e=>e.name===n.name));return i&&"color"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent"}},i?.values.find((e=>e.name===a))?.value?t.createElement("div",{style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",borderRadius:"50%",backgroundColor:i?.values.find((e=>e.name===a))?.value,cursor:"pointer"}},t.createElement("span",null)):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):i&&"image"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u[r]===a?"#F7F7F7":"transparent",cursor:"pointer",padding:"0px",width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",overflow:"hidden"}},i?.values.find((e=>e.name===a))?.value?t.createElement("img",{src:i?.values.find((e=>e.name===a))?.value||"/placeholder.svg",alt:a,style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)}))))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("button",{key:e?.node?.id,onClick:()=>m(e?.node?.id),disabled:e.node.inventoryQuantity<=0,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},e?.node?.title)))))))},rm=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,d]=c(window.innerWidth<786),[s,p]=c((()=>{const t={};return e.products.forEach(((e,n)=>{const r=e.productDetails.variants.edges.find((e=>e.node.inventoryQuantity>0))?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id})),t})),u=e.products?.filter((e=>e?.productDetails?.variants?.edges.some((e=>e?.node?.inventoryQuantity>0))))||[],m=Object.keys(s).length===u.length,f=(e,t)=>{p((n=>({...n,[e]:t})))},{originalPrice:g,dealPrice:h,offerValue:x}=i((()=>{const{price:t,compareAtPrice:n}=Object.entries(s).reduce(((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find((e=>e.node.id===r))?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[s,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l((()=>{const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Ig(y.general.currencySymbol,e.storeCurrencyCode),Dg(h)),t.createElement("div",{style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Ig(y.general.currencySymbol,e.storeCurrencyCode),Dg(g)),t.createElement("span",{style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${Ig(y.general.currencySymbol,e.storeCurrencyCode)}${Dg(e?.amountOff)} Off`:`Save ${Ig(y.general.currencySymbol,e.storeCurrencyCode)}${Dg(x)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===s[r]))?.node;return o?t.createElement(nm,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:s[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null}))):t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map(((n,r)=>t.createElement(nm,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:s[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions}))))),t.createElement("div",{style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return void o(!1);const t=Object.entries(s).map((([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find((e=>e.node.id===n))?.node;return o?{variantId:n,price:Number(o.price)}:null})).filter((e=>null!==e)),r=Object.values(s);await n(Number(g),r,Number(h),t)}catch(e){}o(!1)}},r?t.createElement(Wo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},om=x.div`
|
|
2864
|
+
`,Xp=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=Ut(nn),v=Ht(Gt),w=o(null),[C,k]=c(null),[E,T]=c(!1),[S,B]=c({}),[$,z]=c(y?.variantId),[D,I]=c(y?.quantity||1),[P,N]=c(!1),[_,O]=c(null);l((()=>{const e=localStorage.getItem("yt_variant_options");if(e)try{const t=JSON.parse(e);Array.isArray(t)&&O({options:t})}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}}),[]),l((()=>{y?.open?setTimeout((()=>{N(!0)}),10):N(!1)}),[y?.open]);l((()=>{(async()=>{if(!C&&r&&y?.variantId&&y?.handle){const e=await r(y.handle,y.variantId);if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds;if(t=y.freebieSelection&&Array.isArray(n)&&n.length>0?e.variants.find((e=>e.available&&n.includes(String(e.id)))):e.variants.find((e=>e.available&&String(e.id)===String(y.variantId))),t){z(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),B(n)}else z(void 0),B({})}k(e)}})()}),[C,r,y]);const M=(e,t)=>{const n={...S,[e]:t};B(n);const r=C?.variants?.find((e=>C.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));r&&(y?.freebieSelection&&Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.length>0?y.allowedVariantIds.includes(String(r.id))&&z(String(r.id)):z(String(r.id)))},A=C?.variants?.find((e=>String(e.id)===String($))),F=pn(v,v?.currency),R=i((()=>{const e={};if(!C)return e;const t=y?.freebieSelection&&Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0,n=y.allowedVariantIds;return C.options.forEach((r=>{e[r.name]=r.values.filter((e=>C.variants.filter((t=>{const n=C.options.indexOf(r);if(t[`option${n+1}`]!==e)return!1;return!!C.options.every(((e,n)=>{if(e.name===r.name)return!0;const o=S[e.name];return!o||t[`option${n+1}`]===o}))&&!!t.available})).some((e=>!t||n?.includes(String(e.id))))))})),e}),[C,S,y]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{N(!1),setTimeout((()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Dp,{ref:x,className:"yt-variant-selection-popup"},t.createElement(Pp,{ref:w,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(Ip,null,"Unlocked Freebie"),t.createElement(_p,null,t.createElement(Op,null,t.createElement(Mp,null,t.createElement(Ap,{src:A?.featured_image?.src??C?.featured_image,alt:A?.featured_image?.alt??C?.title})),t.createElement(Fp,null,t.createElement(Rp,{$themeColor:a,$primaryTextColor:h,href:`${C?.url}?variant=${A?.id}`},C?.title),t.createElement(Yp,null,t.createElement(Lp,null,t.createElement(jp,{$primaryTextColor:h},F,dn(A?.price,v?.currency??"INR")),null!=A?.compare_at_price&&null!=A?.price&&A.compare_at_price>A.price&&t.createElement(Vp,null,F,dn(A?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(la,{value:D,handleItemQuantityIncrement:async()=>{I((e=>e+1))},handleItemQuantityDecrement:async()=>{D>1&&I((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),C?.options?.map((e=>{const n=_?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(Wp,{key:e.name},t.createElement(Gp,null,t.createElement("span",null,"Select ",e.name),S[e.name]&&t.createElement(Qp,null,S[e.name])),t.createElement(qp,null,R[e.name]?.map((r=>{const o=S[e.name]===r,i=n?.values?.find((e=>e.name.trim().toLowerCase()===r.trim().toLowerCase()));return"color"===n?.type&&i?.value?t.createElement(Zp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Kp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$imageUrl:i.value}):t.createElement(Up,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>M(e.name,r)},r)}))))}))),t.createElement(Hp,{$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if($&&n){T(!0);try{await n($,D,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!$)return;const t=!!y?.lineItemKey,r=String($)!==String(y?.variantId);if(!t||r){T(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m($,y.allowedVariantIds):n&&$&&await n($,D,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||E},E?t.createElement(Wo,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Dp,{ref:x},t.createElement(Pp,{style:{backgroundColor:p||"white"}},t.createElement(Np,null,t.createElement(qo,{color:a||"#868E96"}))))}));Xp.displayName="DesktopVariantPopup";const Jp=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=Ut(nn),v=Ht(Gt),[w,C]=c(null),[k,E]=c(!1),[T,S]=c({}),[B,$]=c(y?.variantId),[z,D]=c(y?.quantity||1),I=o(null),[P,N]=c(null),[_,O]=c(!1);l((()=>{const e=localStorage.getItem("yt_variant_options");if(e)try{const t=JSON.parse(e);Array.isArray(t)&&N({options:t})}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}}),[]),l((()=>{y?.open?setTimeout((()=>{O(!0)}),10):O(!1)}),[y?.open]);l((()=>{(async()=>{if(!w&&r&&y?.variantId&&y?.handle)try{const e=await r(y.handle,y.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds;if(t=y.freebieSelection&&Array.isArray(n)&&n.length>0?e.variants.find((e=>e.available&&n.includes(String(e.id)))):e.variants.find((e=>e.available&&String(e.id)===String(y.variantId))),t){$(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),S(n)}else $(void 0),S({})}C(e)}catch(e){}})()}),[w,r,y]),l((()=>{}),[p,e,n,r]);const M=(e,t)=>{const n={...T,[e]:t};S(n);const r=w?.variants?.find((e=>w.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));r&&$(String(r.id))},A=w?.variants?.find((e=>String(e.id)===String(B))),F=pn(v,v?.currency),R=i((()=>{const e={};if(!w)return e;const t=y?.freebieSelection&&Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0,n=y.allowedVariantIds;return w.options.forEach((r=>{e[r.name]=r.values.filter((e=>w.variants.filter((t=>{const n=w.options.indexOf(r);if(t[`option${n+1}`]!==e)return!1;return!!w.options.every(((e,n)=>{if(e.name===r.name)return!0;const o=T[e.name];return!o||t[`option${n+1}`]===o}))&&!!t.available})).some((e=>!t||n?.includes(String(e.id))))))})),e}),[w,T,y]);return w?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{O(!1),setTimeout((()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Dp,{ref:x,className:"yt-variant-selection-popup"},t.createElement(Pp,{ref:I,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(Ip,null,"Unlocked Freebie"),t.createElement(_p,null,t.createElement(Op,null,t.createElement(Mp,null,t.createElement(Ap,{src:A?.featured_image?.src??w?.featured_image,alt:A?.featured_image?.alt??w?.title})),t.createElement(Fp,null,t.createElement(Rp,{$themeColor:a,$primaryTextColor:h,href:`${w?.url}?variant=${A?.id}`},w?.title),t.createElement(Yp,null,t.createElement(Lp,null,t.createElement(jp,{$primaryTextColor:h},F,dn(A?.price,v?.currency??"INR")),null!=A?.compare_at_price&&null!=A?.price&&A.compare_at_price>A.price&&t.createElement(Vp,null,F,dn(A?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(la,{value:z,handleItemQuantityIncrement:async()=>{D((e=>e+1))},handleItemQuantityDecrement:async()=>{z>1&&D((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),w?.options?.map((e=>{const n=P?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(Wp,{key:e.name},t.createElement(Gp,null,t.createElement("span",null,"Select ",e.name,":"),T[e.name]&&t.createElement(Qp,null,T[e.name])),t.createElement(qp,null,R[e.name]?.map((r=>{const o=T[e.name]===r,i=n?.values?.find((e=>e.name.trim().toLowerCase()===r.trim().toLowerCase()));return"color"===n?.type&&i?.value?t.createElement(Zp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Kp,{key:r,$isSelected:o,$themeColor:a,onClick:()=>M(e.name,r),$imageUrl:i.value}):t.createElement(Up,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>M(e.name,r)},r)}))))}))),t.createElement(Hp,{$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if(B&&n){E(!0);try{await n(B,z,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}E(!1)}}:async()=>{if(!B)return;const t=!!y?.lineItemKey,r=String(B)!==String(y?.variantId);if(!t||r){E(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m(B,y.allowedVariantIds):n&&B&&await n(B,z,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}E(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||k},k?t.createElement(Wo,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Dp,{ref:x},t.createElement(Pp,{style:{backgroundColor:p||"white"}},t.createElement(Np,null,t.createElement(qo,{color:a||"#868E96"}))))})),eu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,cartTitle:s,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:m,backgroundColor:f,backgroundSubdued:h,tertiaryColor:x,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,showCouponOptions:k,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:D,applyDiscount:I,discountApplied:P,rewardCoupons:N,userTotalPoints:_,checkoutFunction:O,joinNowFunction:M,guestLoyaltyPercentage:A,showToggleButton:F,isOpen:R,setIsOpen:L,isDev:j,switchWidthVariant:V,recProductsList:H,showMultiStepProgressBar:W,cartCheckpoints:U,redemptionRate:G,pointsRewardRate:Q,showCartLevelAltPay:q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:K,exploreCtaRedirectLink:X,discountAmountApplied:J,discountInCheckoutButton:ee,isStickyCheckout:te,showDiscountsListToGuestUsers:ne,showApplyCouponsButtonToGuestUsers:re,handleCheckpointCrossed:oe,customCartProgressBarCriteria:ae,checkoutButtonColor:ie,ctaButtonBackgroundColor:le,ctaButtonTextColor:ce,primaryTextColor:de,productRecsCtaButtonText:se,productRecsTitleText:pe,secondaryTextColor:ue,showProductRecsOnDesktop:me,showProductRecsOnMobile:fe,themeColor:ge,themeTextColor:he,companyName:xe,gstNumber:ye,showGSTOption:be,applyGSTToCart:ve,showMOVForProgressTiers:we,freeProduct:Ce,showLoyaltyCta:ke,freeProductAdjustedCartTotal:Ee,minimumOrderValueToAvailDiscount:Te,signinCTAButtonVisible:Se,cartSigninCTAMainText:Be,showNoteOption:$e,applyNoteToCart:ze,note:De,inlineCartOfferInfoText:Ie,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:_e,getProductDetailsByVariantId:Oe,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Ae,originalCartSubtotal:Fe,currentTier:Re,freebieProductsInCart:Le,showFreebieClaim:je,addFreebieToCart:Ve,freebiesInCart:He,effectiveQuantityForProgressBar:We,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:qe,enableGeoLocationDeliveryRestriction:Ye,applyPostalCodeAndDeliverySlotToCart:Ze,showDeleteOnFreebies:Ke,freebieCouponTemplates:Xe,freebieFlowCheckpoints:Je,freebieClaimData:et,showStickyAddToCart:tt,stickyCartLineItem:nt,postalCodeBasedItemTrackingParameter:rt,enableSlotPicker:ot,deliveryHeaderTitle:at,deliveryAvailableText:it,deliveryNotAvailableText:lt,giftWrapSetupData:ct,giftWrapProductDetail:dt,enableCustomCartOnCartPage:st,isCartPage:pt,progressBarFreeProductIconType:ut,addToStickyCart:mt,productRecsCardLayout:ft,productRecsCardListVariant:gt,showCartTimer:ht,showFreebieMilestone:xt,freebieMilestoneData:yt,cartTimerInMinutes:bt,cartTimerCustomText:vt,imageAspectSelector:wt,cartComponentsCornerType:Ct,cartComponentsCornerRadius:kt,stickyCartCustomizationData:Et,cartOffersCarousalData:Tt,stickyBarBuyNowFunction:St,gstSectionCustomizationData:Bt,noteSectionTitle:$t,checkoutSectionMessage:zt,checkoutSectionMessageRedirectLink:Dt,checkoutSectionMessageDisplay:It,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:Nt,brandTokenName:_t,showDiscountOnMRP:Ot,prefixMessageText:Mt,suffixMessageText:At,successMessageText:Ft,toggleDecimal:Rt,cartOffersCarouselHeight:Lt,disableCheckoutButton:jt,showEmptyCartRecommendations:Vt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:Qt,showPoweredByBadge:qt=!0,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Kt,showCheckoutButtonPaymentIcons:Xt=!0})=>{const Jt=Wt(Gt),[en,tn]=Ut(nn),[rn,on]=Ut(Ui),an=()=>L(!R);g((()=>{v&&Jt(v)}),[v]);const ln=o(null);l((()=>{function e(e){ln.current&&!ln.current.contains(e.target)&&(tn({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),on({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const[cn,dn]=c(!1);return l((()=>{const e=()=>{dn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:st&&pt?"relative":"absolute",width:"100%",display:st&&pt?"flex":"block",alignItems:"center",justifyContent:"center"}},F&&!(st&&pt)&&t.createElement("button",{style:{margin:"16px"},onClick:an},R?"Close Drawer":"Open Drawer"),R&&b&&!(st&&pt)&&t.createElement("div",{onClick:an,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),t.createElement(sp,{isCartPage:pt,enableCustomCartOnCartPage:st,isOpen:R,setIsOpen:L,backgroundColor:f,backgroundSubdued:h??"#F5F5F5",tertiaryColor:x,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:s,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,emptyCartTitle:p,emptyCartButtons:m,emptyCartDescription:u,showCouponOptions:k,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:D,applyDiscount:I,discountApplied:P,rewardCoupons:N,userTotalPoints:_,checkoutFunction:O,joinNowFunction:M,guestLoyaltyPercentage:A,isDev:j,switchWidthVariant:V,recProductsList:H,showMultiStepProgressBar:W,cartCheckpoints:U,redemptionRate:G,pointsRewardRate:Q,showCartLevelAltPay:q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:K,exploreCtaRedirectLink:X,discountAmountApplied:J,discountInCheckoutButton:ee,isStickyCheckout:te,showDiscountsListToGuestUsers:ne,showApplyCouponsButtonToGuestUsers:re,handleCheckpointCrossed:oe,customCartProgressBarCriteria:ae??"minimum_order_value",checkoutButtonColor:ie,ctaButtonBackgroundColor:le,ctaButtonTextColor:ce,primaryTextColor:de,productRecsCtaButtonText:se,productRecsTitleText:pe,secondaryTextColor:ue,showProductRecsOnDesktop:me,showProductRecsOnMobile:fe,themeColor:ge,themeTextColor:he,companyName:xe,gstNumber:ye,showGSTOption:be,applyGSTToCart:ve,showMOVForProgressTiers:we,freeProduct:Ce,showLoyaltyCta:ke,freeProductAdjustedCartTotal:Ee,minimumOrderValueToAvailDiscount:Te,signinCTAButtonVisible:Se,cartSigninCTAMainText:Be,applyNoteToCart:ze,note:De,showNoteOption:$e,inlineCartOfferInfoText:Ie,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:_e,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Ae,originalCartSubtotal:Fe,currentTier:Re,freebieProductsInCart:Le,cartOffersCarousalData:Tt,showFreebieClaim:je,addFreebieToCart:Ve,freebiesInCart:He,effectiveQuantityForProgressBar:We,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:qe,enableGeoLocationDeliveryRestriction:Ye,applyPostalCodeAndDeliverySlotToCart:Ze,showDeleteOnFreebies:Ke,freebieCouponTemplates:Xe,freebieFlowCheckpoints:Je,freebieClaimData:et,postalCodeBasedItemTrackingParameter:rt,enableSlotPicker:ot,deliveryHeaderTitle:at,deliveryAvailableText:it,deliveryNotAvailableText:lt,giftWrapSetupData:ct,giftWrapProductDetail:dt,progressBarFreeProductIconType:ut,productRecsCardLayout:ft,productRecsCardListVariant:gt,showCartTimer:ht,showFreebieMilestone:xt,freebieMilestoneData:yt,cartTimerCustomText:vt,cartTimerInMinutes:bt,imageAspectSelector:wt,cartComponentsCornerType:Ct,cartComponentsCornerRadius:kt,gstSectionCustomizationData:Bt,noteSectionTitle:$t,checkoutSectionMessage:zt,checkoutSectionMessageRedirectLink:Dt,checkoutSectionMessageDisplay:It,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:Nt,getProductDetailsByVariantId:Oe,brandTokenName:_t,showDiscountOnMRP:Ot??!0,prefixMessageText:Mt,suffixMessageText:At,successMessageText:Ft,toggleDecimal:Rt,cartOffersCarouselHeight:Lt,disableCheckoutButton:jt,showEmptyCartRecommendations:Vt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:Qt,showPoweredByBadge:qt,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Kt,showCheckoutButtonPaymentIcons:Xt}),tt&&nt&&d&&t.createElement(zp,{showStickyCart:tt,stickyCartCustomizationData:Et,product:nt,addCartItem:d,onSetLoading:Me,themeColor:ge,themeTextColor:he,cartData:v,isCartOpen:R,setIsCartOpen:L,ctaButtonBackgroundColor:le,ctaButtonTextColor:ce,addToStickyCart:mt,cartComponentsCornerRadius:kt,cartComponentsCornerType:Ct,checkoutFunction:St,backgroundColor:f,primaryTextColor:de}),cn&&en.open&&t.createElement(Xp,{backgroundColor:f,ref:ln,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Oe,themeColor:ge,cartComponentsCornerRadius:kt,cartComponentsCornerType:Ct,removeFreebieFromCart:Qe,freebieClaimAddToCart:Ve,productClaimCtaButtonText:et?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de}),!cn&&en.open&&t.createElement(Jp,{ref:ln,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Oe,themeColor:ge,cartComponentsCornerRadius:kt,cartComponentsCornerType:Ct,backgroundColor:f,removeFreebieFromCart:Qe,freebieClaimAddToCart:Ve,productClaimCtaButtonText:et?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de})))};const tu=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:d})=>t.createElement(t.Fragment,null,e.map(((a,s)=>{const p=a.minimumQuantity-(r[s]?.length??0),u=o?.filter((e=>r[s]?.includes(e.variantId)));return t.createElement("div",{className:"yt-bundleBuilderTracker-tier-product-list",style:{display:"flex",width:"100%"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",gap:"5px"}},u?.map?.((e=>{const o=e.product.variants?.edges?.find((t=>t.node.id===e.variantId)),a=r[s]?.filter((e=>e===o?.node.id)).length||0;return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-product-item",key:e.variantId,style:{borderRadius:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge",style:{borderRadius:"2px"}},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},d,Dg(o?.node?.price)),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>l(e.variantId,s)},t.createElement(_a,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-item",key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-tracker-item",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,..."high"===c&&{borderRadius:"20px"},..."medium"===c&&{borderRadius:"6px"},...""===c&&{borderRadius:"0px"},height:n?"60px":"70px",width:n?"60px":"70px"}},a>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"}},a,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>l(e.variantId,s)},t.createElement(dt,{fontSize:"12px"}))))})),p>=1&&[...Array(p)].map(((e,r)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:n?"60px":"70px",height:n?"60px":"70px",borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"},key:r},t.createElement(Jr,{size:40,color:"#A0A0A0"})))))),s<e.length-1&&t.createElement("div",{className:"yt-bundleBuilderTracker-plus-icon-container"},t.createElement(Jr,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))}))),nu=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:a,showProductDetailsInTracker:i,loading:d,handleRemoveItem:s,percentageOff:p,selectedItemsQuantity:u,bundleSubtotal:m,amountOff:f,styles:g,dealAmount:h,isMobile:x=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:v,handleRemoveItemProductTier:w,selectedProductsByTier:C,storeCurrencyCode:k,shadowRoot:E})=>{const[T,S]=c(!1),[B,$]=c(0),[z,D]=c([]),[I,P]=c(0),[N,_]=c(0),[O,M]=c(!1),[A,F]=c(null),R=function(){const e=o(null);return l((()=>{const t=document.createElement("canvas");return t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n z-index: 2147483647;\n background: rgba(255,0,0,0.02); /* EXTREMELY light - just to detect */\n outline: 2px dashed rgba(255,0,0,0.15);\n ",document.body.appendChild(t),e.current=t,console.log("[confetti] canvas appended to document.body:",t),requestAnimationFrame((()=>{if(!e.current)return void console.warn("[confetti] canvasRef missing after RAF");const t=e.current.getBoundingClientRect();console.log("[confetti] canvas rect:",t.width,t.height,t)})),()=>{console.log("[confetti] removing canvas"),t.remove()}}),[]),function(t){if(!e.current)return void console.warn("[confetti] no canvasRef to draw on");const n=Ar(e.current,{resize:!0,useWorker:!1});console.log("[confetti] firing with options:",t),n(t)}}(),L=m?.price||0,j=e?.type,V=e=>{if(e<0||!z[e])return L;const t=z[e].discountValue??0;return p?L*(1-t/100):h?t:f?L-t:L};l((()=>{if(e&&"none"!==e.type)if("productTier"===j&&e.productTier){const t=e.productTier||[];D(t);let n=0;e.productTier.map((e=>{n+=e.minimumQuantity})),_(n-u)}else if(z.length)I>0&&u<z[I-1]?.minimumQuantity?(P(I-1),F(I-1)):u<z[I]?.minimumQuantity&&F(I-1),$(V(I));else{const t=e.offerTier||[];D(t),P(0),_(t[0]?.minimumQuantity-u||r-u)}else D([]),_(r-u),P(0)}),[e,r,u]),l((()=>{z.length&&"productTier"!=j?(()=>{if(!z?.length)return;let e=-1,t=null,n=0;if("offerTier"===j)for(let r=0;r<z.length&&(n+=z[r].minimumQuantity,u>=n);r++)t=r,e=r+1<z.length?r+1:r;if(P(e),F(t),null!==t){let e=z.slice(0,t+1).reduce(((e,t)=>e+t.minimumQuantity),0);M(e===u),S(!0),$(V(t))}else M(!1),S(!1),$(L);const r=e>=0&&e<z.length?z.slice(0,e+1).reduce(((e,t)=>e+t.minimumQuantity),0)-u:z[0].minimumQuantity-u;_(r)})():u===r?(S(!0),$(p?L*(1-p/100):h||(f?L-f:L)),M(!0)):(M(!1),S(!1))}),[u,z]);const H=T?Math.max(m?.compareAtPrice,m?.price):m?.compareAtPrice>m?.price?m?.compareAtPrice:null,W=T?B.toFixed(2):m?.price?.toFixed(2),U=H&&W?(H-Number(W)).toFixed(2):0,G=e&&"none"!==j&&e.offerTier?"offerTier"===j?Math.min(u/(u+N)*100,100):void 0:u/r*100,Q=o(!1);return l((()=>{const e=Q.current;if(Q.current=T,!e&&T&&g.byob.enableConfetti){const e=E??document,t=("getElementById"in e?e.getElementById("checkoutButton"):null)||document.getElementById("checkoutButton");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;R?.({particleCount:100,spread:70,origin:{x:r,y:o}})}}),[T,g]),t.createElement("div",{className:"yt-bundleBuilderTracker-container "+(x?"mobile":""),style:{justifyContent:g.byob.selectedProductsVisibility&&!x?"space-between":"center"}},"offerTier"==j&&null!==A&&A>=0&&t.createElement("div",{className:"yt-bundleBuilderTracker-offer-tier-tag",style:{backgroundColor:y||"#000",color:v||"#fff"}},t.createElement(t.Fragment,null,"Buy"," ",z.slice(0,A+1).reduce(((e,t)=>e+t.minimumQuantity),0)," ","at",f||h?t.createElement(t.Fragment,null," ",Ig(g.general.currencySymbol,k)):""," ",Dg(z[A]?.discountValue),p?t.createElement(t.Fragment,null,"% "):Dg(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied")),x&&N>=1&&!O&&"offerTier"!==j?t.createElement("div",{className:"yt-bundleBuilderTracker-mobile-remaining",style:{margin:"0",height:"auto"}},"Select ",N," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==j&&t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-container"},t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-text"},"offerTier"==j&&z.length>0&&I>=0&&N>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"},className:"yt-bundleBuilderTracker-add-more-text"},"Add ",N," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",u+N," at",f||h?t.createElement(t.Fragment,null,Ig(g.general.currencySymbol,k)):""," ",Dg(z[I]?.discountValue),p?t.createElement(t.Fragment,null,"% "):Dg(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):""))),t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-background"},t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-fill",style:{width:`${G??0}%`,backgroundColor:100===(G??0)?"#4caf50":y??g?.general.primaryColor??"black"}}," "))),g.byob.selectedProductsVisibility&&t.createElement("div",{className:"hide-tracker-scrollbar yt-bundleBuilderTracker-product-list-wrapper",style:{columnGap:"productTier"===j?"0px":"10px",maxWidth:x?"90%":"55%"}},"productTier"===j?t.createElement(tu,{tiers:z,isMobile:x,selectedProductsByTier:C??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:i,handleRemoveItemProductTier:w,cornerRadius:g.byob.borderRadius,currencySymbol:Ig(g.general.currencySymbol,k)}):t.createElement(t.Fragment,null,a?.map?.((e=>{const n=e.product.variants?.edges?.find((t=>t.node.id===e.variantId));return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-item-container",style:{borderRadius:g.byob.borderRadius},key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge"},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},g.general.currencySymbol,n?.node?.price),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(_a,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-item-wrapper",key:e.variantId,style:{marginTop:"8px",marginRight:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-item-image-box",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,height:x?"60px":"70px",width:x?"60px":"70px",borderRadius:g.byob.borderRadius}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:g.byob.borderRadius}},e.quantity,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>s(e.variantId)},t.createElement(dt,{fontSize:"12px"}))))})),N>=1&&[...Array(N)].map(((e,n)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:x?"60px":"70px",height:x?"60px":"70px",borderRadius:g.byob.borderRadius},key:n},t.createElement(Jr,{size:40,color:"#A0A0A0"})))))),(!x||O)&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-container",style:{width:x?"100%":"auto"}},Number(W)>0&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-info"},t.createElement("div",{style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},t.createElement("span",{className:"yt-bundleBuilderTracker-subtotal-label"},"Subtotal"),Number(U)>0?t.createElement("span",{className:"yt-bundleBuilderTracker-save-label"},"Save:"," ",Ig(g.general.currencySymbol,k),Dg(U)):""),t.createElement("div",{className:"yt-bundleBuilderTracker-subtotal-row"},t.createElement("span",{className:"yt-bundleBuilderTracker-total_price"},Ig(g.general.currencySymbol,k),Number(W)>=0?Dg(Number(W).toFixed(2)):0),H&&g.byob.compareAtPriceVisibility&&Number(H)>Number(W)&&t.createElement("span",{className:"yt-bundleBuilderTracker-summary_price"},Ig(g.general.currencySymbol,k),Dg(Number(H).toFixed(2))))),t.createElement("button",{className:"yt-bundleBuilderTracker-checkout-button",style:{cursor:O?"pointer":"auto",backgroundColor:100===(G??0)||O?g.general.ctaBackgroundColor||"black":"#f4f4f6",color:100===(G??0)||O?g.general.ctaTextColor||"#fff":"#000",border:`1.18px solid ${g.general.ctaBorderColor}`,borderRadius:g.general.ctaBorderRadius,boxShadow:O?"0px 4px 8px rgba(0, 0, 0, 0.2)":"none"},disabled:!O&&N>=1,onClick:e=>{d||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},d?t.createElement(Wo,{color:"white",loading:d,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!O?t.createElement("div",{className:"yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",N," More Item(s)"):t.createElement("div",{className:"yt-bundleBuilderTracker-checkout-text",style:{color:v??g.general.ctaTextColor}},g.byob.checkoutCTAText??"Checkout"))))},ru={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},ou={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},au=e=>{const[n,r]=c(!1);l((()=>{const e=()=>{r(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const o="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,a=((e,t=!1)=>{const n=e&&ru[e]?ru[e]:{},r={...ou,...n};return t&&n.mobile?{...r,...n.mobile}:r})(String(o),n);e.renderingOnPage||(a.position="static",a.zIndex=0);const i={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...a};return t.createElement("div",{className:"yt-bundle-builder-tracker-bar",style:{...i,width:n?"100%":a.width,...!e.styles.byob.selectedProductsVisibility&&{width:n?"96%":"fit-content",paddingInline:"10px"},...n&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===a.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=a.transform||"translateY(0)"}},t.createElement(nu,{...e,isMobile:n}))},iu=It(void 0);function lu(e){return lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lu(e)}function cu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function du(e,t){return du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},du(e,t)}function su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pu(e);if(t){var o=pu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===lu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function pu(e){return pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pu(e)}var uu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&du(e,t)}(o,h);var e,t,n,r=su(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,t=[{key:"componentDidMount",value:function(){!function(e,t){if(!document.head.querySelector("#"+e)){var n=document.createElement("style");n.textContent=t,n.type="text/css",n.id=e,document.head.appendChild(n)}}(this.props.name,this.props.css)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById(this.props.name);e.parentNode.removeChild(e)}},{key:"render",value:function(){return null}}],t&&cu(e.prototype,t),n&&cu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),mu=function(e){var t=e.imageBackgroundColor;return"\n body {\n overflow: hidden;\n }\n\n .__react_modal_image__modal_container {\n position: fixed;\n z-index: 5000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n touch-action: none;\n overflow: hidden;\n }\n\n .__react_modal_image__modal_content {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .__react_modal_image__modal_content img, \n .__react_modal_image__modal_content svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n -webkit-transform: translate3d(-50%, -50%, 0);\n -ms-transform: translate3d(-50%, -50%, 0);\n overflow: hidden;\n }\n\n .__react_modal_image__medium_img {\n max-width: 98%;\n max-height: 98%;\n background-color: ".concat(t,";\n }\n\n .__react_modal_image__large_img {\n cursor: move;\n background-color: ").concat(t,"\n }\n\n .__react_modal_image__icon_menu a {\n display: inline-block;\n font-size: 40px;\n cursor: pointer;\n line-height: 40px;\n box-sizing: border-box;\n border: none;\n padding: 0px 5px 0px 5px;\n margin-left: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .__react_modal_image__icon_menu {\n display: inline-block;\n float: right;\n }\n\n .__react_modal_image__caption {\n display: inline-block;\n color: white;\n font-size: 120%;\n padding: 10px;\n margin: 0;\n }\n\n .__react_modal_image__header {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n overflow: hidden;\n }\n")},fu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},gu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))},hu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},xu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},yu=function(){return t.createElement("svg",{fill:"#ffffff",height:"48",viewBox:"0 0 24 24",width:"48",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"}),t.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}))},bu=function(){return t.createElement("svg",{fill:"#ffffff",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0z"}),t.createElement("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"}))};var vu=function(e){return function(t){(function(e){return document.location.hostname!==new URL(e,document.location).hostname})(e)&&(t.preventDefault(),fetch(e).then((function(t){return t.ok||console.error("Failed to download image, HTTP status "+t.status+" from "+e),t.blob().then((function(t){var n=document.createElement("a");n.setAttribute("download",e.split("/").pop()),n.href=URL.createObjectURL(t),n.click()}))})).catch((function(t){console.error(t),console.error("Failed to download image from "+e)})))}},wu=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,d=e.enableZoom,s=e.enableRotate;return t.createElement("div",{className:"__react_modal_image__header"},t.createElement("span",{className:"__react_modal_image__icon_menu"},c&&t.createElement("a",{href:n,download:!0,onClick:vu(n)},t.createElement(hu,null)),d&&t.createElement("a",{onClick:a},o?t.createElement(gu,null):t.createElement(fu,null)),s&&t.createElement("a",{onClick:i},t.createElement(bu,null)),t.createElement("a",{onClick:l},t.createElement(xu,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Cu(e){return Cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cu(e)}function ku(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eu(e,t){return Eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Eu(e,t)}function Tu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bu(e);if(t){var o=Bu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Cu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Su(e)}(this,n)}}function Su(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bu(e){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bu(e)}function $u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Eu(e,t)}(a,h);var e,n,r,o=Tu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $u(Su(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),$u(Su(e),"handleOnLoad",(function(){e.setState({loading:!1})})),$u(Su(e),"handleOnContextMenu",(function(t){!e.props.contextMenu&&t.preventDefault()})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.id,r=e.className,o=e.src,a=e.style,i=e.handleDoubleClick;return t.createElement("div",null,this.state.loading&&t.createElement(yu,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&ku(e.prototype,n),r&&ku(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Du(e){return Du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Du(e)}function Iu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pu(e,t){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pu(e,t)}function Nu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ou(e);if(t){var o=Ou(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Du(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _u(e)}(this,n)}}function _u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ou(e){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ou(e)}function Mu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Au=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pu(e,t)}(a,h);var e,n,r,o=Nu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Mu(_u(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),Mu(_u(e),"handleKeyDown",(function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()})),Mu(_u(e),"getCoordinatesIfOverImg",(function(t){var n=t.changedTouches?t.changedTouches[0]:t;if("react-modal-image-img"===n.target.id){var r=e.contentEl.getBoundingClientRect();return{x:n.clientX-r.left,y:n.clientY-r.top}}})),Mu(_u(e),"handleMouseDownOrTouchStart",(function(t){if(t.preventDefault(),!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n||e.props.onClose(),e.state.zoomed&&e.setState((function(e){return{moveStart:{x:n.x-e.move.x,y:n.y-e.move.y}}}))}})),Mu(_u(e),"handleMouseMoveOrTouchMove",(function(t){if(t.preventDefault(),e.state.zoomed&&e.state.moveStart&&!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n&&e.setState((function(e){return{move:{x:n.x-e.moveStart.x,y:n.y-e.moveStart.y}}}))}})),Mu(_u(e),"handleMouseUpOrTouchEnd",(function(t){e.setState({moveStart:void 0})})),Mu(_u(e),"toggleZoom",(function(t){t.preventDefault(),e.setState((function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}}))})),Mu(_u(e),"toggleRotate",(function(t){t.preventDefault(),360!==e.state.rotationDeg?e.setState((function(e){return{rotationDeg:e.rotationDeg+=90}})):e.setState({rotationDeg:90})})),e}return e=a,(n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown,!1)}},{key:"render",value:function(){var e=this,n=this.props,r=n.medium,o=n.large,a=n.alt,i=n.onClose,l=n.hideDownload,c=n.hideZoom,d=n.showRotate,s=n.imageBackgroundColor,p=void 0===s?"black":s,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(uu,{name:"__react_modal_image__lightbox",css:mu({imageBackgroundColor:p})}),t.createElement("div",{className:"__react_modal_image__modal_container"},t.createElement("div",{className:"__react_modal_image__modal_content",onMouseDown:this.handleMouseDownOrTouchStart,onMouseUp:this.handleMouseUpOrTouchEnd,onMouseMove:this.handleMouseMoveOrTouchMove,onTouchStart:this.handleMouseDownOrTouchStart,onTouchEnd:this.handleMouseUpOrTouchEnd,onTouchMove:this.handleMouseMoveOrTouchMove,ref:function(t){e.contentEl=t}},f&&t.createElement(zu,{id:"react-modal-image-img",className:"__react_modal_image__large_img",src:o||r,style:{transform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)")},handleDoubleClick:this.toggleZoom}),!f&&t.createElement(zu,{id:"react-modal-image-img",className:"__react_modal_image__medium_img",src:r||o,handleDoubleClick:this.toggleZoom,contextMenu:!r,style:{transform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)")}})),t.createElement(wu,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!d})))}}])&&Iu(e.prototype,n),r&&Iu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Fu(e){return Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(e)}function Ru(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Lu(e,t){return Lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lu(e,t)}function ju(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hu(e);if(t){var o=Hu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Fu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vu(e)}(this,n)}}function Vu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hu(e){return Hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hu(e)}function Wu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Uu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lu(e,t)}(a,h);var e,n,r,o=ju(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wu(Vu(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),Wu(Vu(e),"toggleModal",(function(){e.setState((function(e){return{modalOpen:!e.modalOpen}}))})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.className,r=e.small,o=e.smallSrcSet,a=e.medium,i=e.large,l=e.alt,c=e.hideDownload,d=e.hideZoom,s=e.showRotate,p=e.imageBackgroundColor,u=this.state.modalOpen;return t.createElement("div",null,t.createElement("img",{className:n,style:{cursor:"pointer",maxWidth:"100%",maxHeight:"100%"},onClick:this.toggleModal,src:r,srcSet:o,alt:l}),u&&t.createElement(Au,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:d,showRotate:s,imageBackgroundColor:p}))}}],n&&Ru(e.prototype,n),r&&Ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const Gu=n(((e,n)=>{const[r,o]=Ut(iu),a=(e.disableInventoryTracking?r?.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableInventoryTracking)):r?.variants.edges)??[],[i,d]=c(a[0]?.node),[s,p]=c(0),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=600),[f,g]=c(1),[h,x]=c("idle"),[y,b]=c(null),[w,C]=c(null),k=e.shadowRoot??document.body;l((()=>{if(r){const t=r.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableQuantitySelector));d(r?.selectedVariant??t[0]?.node)}}),[r]),l((()=>{const t=e.selectedProducts.find((e=>e.variantId===i?.id));g(t?t.quantity:0)}),[f,e.selectedProducts,i]);const E=()=>{i?.id&&r&&(x("check"),e.handleAddToBundle(i?.id,r,1),setTimeout((()=>{x("idle"),o(void 0)}),500))};if(l((()=>{const e=()=>m(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),!r||0===a.length)return null;const{title:T,descriptionHtml:S,media:B,variants:$}=r,z=B.edges.map((e=>e.node.image)).filter((e=>e.url.length>0));l((()=>{if(r&&i?.image?.url&&Array.isArray(z)){const e=z.findIndex((e=>e.url===i?.image.url));-1!==e&&e!==s&&p(e)}}),[i]);const D=t=>{const n=t.target.value,r=a.find((e=>e.node.id===n))?.node;r&&(r.inventoryQuantity>0||e.disableInventoryTracking)&&d(r)};l((()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}}),[r,o]);const I=e=>{b(e.targetTouches[0].clientX),C(null)},P=e=>{C(e.targetTouches[0].clientX)},N=()=>{if(null!==y&&null!==w&&z.length>1){const e=y-w,t=50;e>t?p((e=>e<z.length-1?e+1:0)):e<-t&&p((e=>e>0?e-1:z.length-1))}b(null),C(null)};e.hideAddToBundle||(i?.inventoryQuantity??0)<=0&&e.disableInventoryTracking;const _=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content "+(u?"small-screen":"large-screen"),ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal "+(u?"small-screen":"large-screen")},t.createElement("div",{className:"yt-variant-selection-modal "+(u?"small-screen":"large-screen")},t.createElement("button",{className:"yt-bundleProductModal-modal-close-button",onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(it,{size:"25"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-section"},t.createElement(t.Fragment,null,t.createElement("div",{onTouchStart:I,onTouchMove:P,onTouchEnd:N},t.createElement(Uu,{small:z[s].url,medium:z[s].url,large:z[s].url,hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},z.length>1&&z.filter((e=>e.url.length>0)).map(((n,r)=>t.createElement("img",{key:r,src:n.url,alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>p(r),className:s===r?"active":"",style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...s===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"}})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",null,a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(Un,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-variant-selection",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:D,className:"yt-bundleProductModal-modal-select-input",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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(oo,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},i?.compareAtPrice&&parseFloat(i.compareAtPrice)>parseFloat(i?.price)&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.price)))),!e.hideAddToBundle&&((i?.inventoryQuantity??0)>0||e.disableInventoryTracking)&&(!e?.disableQuantitySelector||f<1)&&t.createElement("div",{style:{width:"80%"},className:"yt-bundleProductModal-modal-atc-wrapper"},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},className:"yt-bundleProductModal-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),E()},disabled:"idle"!==h},"Add to bundle")))),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:S}})))))),O=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content small-screen",style:{padding:"0px",position:"relative"},ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal"},t.createElement("button",{className:"yt-bundleProductModal-modal-phone-close-button",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:()=>{o(void 0)}},t.createElement(ao,{style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-variant-selection-modal small-screen",style:{padding:"0px",width:"100vw",height:"100vh",overflowY:"auto"}},t.createElement("div",{className:"yt-bundleProductModal-modal-image-section small-screen"},t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"},onTouchStart:I,onTouchMove:P,onTouchEnd:N},t.createElement(Uu,{small:z[s].url,medium:z[s].url,large:z[s].url,hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"}),t.createElement("div",{style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},z.length>1&&z.map(((e,n)=>t.createElement("span",{className:"yt-bundleProductModal-modal-image-indicator",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:s===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}}))))),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},z.length>1&&z.map(((n,r)=>t.createElement("img",{key:r,src:n.url,alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>p(r),className:s===r?"active":"",style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...s===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"}})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section small-screen",style:{padding:"0px !important",margin:"15px 0",paddingBottom:"50px"}},t.createElement("h2",{style:{margin:"0px"}},a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-only",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Un,{style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important",width:"95vw"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:S}})))),t.createElement("div",{className:"yt-bundleProductModal-modal-phone-bottom-bar",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}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:D,className:"yt-bundleProductModal-modal-select-input",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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(oo,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},i?.compareAtPrice&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Ig(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Dg(i?.price)))),!e.hideAddToBundle&&((i?.inventoryQuantity??0)>0||e.disableInventoryTracking)&&(!e?.disableQuantitySelector||f<1)&&t.createElement("div",{style:{width:"100%"}},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},className:"yt-bundleProductModal-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),E()},disabled:"idle"!==h},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(u?O:_,k)})),Qu=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map((e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};return"color"===o?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):"image"===o?t.createElement("img",{src:kn(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.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"}},e.name)})(e,n?.name===e.name))}))),qu=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:i,disableInventoryTracking:d})=>{const[s,p]=c((()=>{const t=e.variants.edges.find((e=>d||e.node.inventoryQuantity>0))?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map((e=>e.values[0]))||[]})),[u,m]=c(window.innerWidth<1024);l((()=>{const e=()=>m(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n,r]);const f=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?s.join(" / "):s[0])))?.node,g=f?.image?.url||e.featuredMedia?.preview?.image?.url,h=kn(g,150,85,"webp"),x=e=>{if(!o?.options)return"text";const t=o.options.find((t=>t.name===e));return t?.type||"text"},y=e=>{if(!o?.options)return e.values.map((e=>({name:e,value:e})));const t=o.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}}))},b=(e,t)=>{const n=s[t];if(!n)return null;return y(e).find((e=>e.name===n))||null};if(!n)return null;const w=t.createElement("div",{onClick:r,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",className:"yt-bundleBuilder-variant-options-modal-backdrop"},t.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"}},className:"yt-bundleBuilder-variant-options-modal-container"},t.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"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"},className:"yt-bundleBuilder-variant-options-modal-product-block"},t.createElement("img",{src:h,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"},className:"yt-bundleBuilder-variant-options-modal-product-image"}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4},className:"yt-bundleBuilder-variant-options-modal-product-info"},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-product-title"},e.title))),t.createElement("div",{style:{padding:"20px"},className:"yt-bundleBuilder-variant-options-modal-variant-selectors"},e.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0},className:"yt-bundleBuilder-variant-options-modal-option"},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},className:"yt-bundleBuilder-variant-options-modal-option-label"},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-option-name"},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"},className:"yt-bundleBuilder-variant-options-modal-option-selected-value"},b(n,r)?.name||n.values[0])),t.createElement(Qu,{options:y(n),selectedValue:b(n,r),onChange:e=>{((e,t)=>{const n=[...s];n[e]=t.name,p(n)})(r,e)},type:x(n.name),isOptionAvailable:t=>((t,n)=>{if(d)return!0;const r=[...s];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find((e=>e.node.title===o))?.node;return!!a&&a.inventoryQuantity>0})(r,t),isMobile:u})))))),t.createElement("button",{className:"yt-bundleBuilder-variant-options-modal-confirm-button",onClick:()=>{const t=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?s.join(" / "):s[0])))?.node,n=t&&(d||t.inventoryQuantity>0);if(t?.id&&n)i(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",s);const t=e.variants.edges.find((e=>d||e.node.inventoryQuantity>0))?.node.id;t&&(i(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.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"}},"Add to Bundle")));return v.createPortal(w,document.body)};function Yu({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,disableInventoryTracking:d,selectedVariantInventoryQty:s}){const p={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"},u=d||e<s;return t.createElement("div",{className:"yt-bundleBuilder-quantity-selector-container"},t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-minus",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:p},"-"),t.createElement("div",{className:"yt-bundleBuilder-quantity-selector_quantity"},e," added"),t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-plus",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1);n(l),o&&a&&i&&o(a,i,1)},disabled:!u||c,style:{...p,cursor:!u||c?"not-allowed":"pointer",opacity:!u||c?.6:1}},"+"))}const Zu=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),i=r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url||"",l=e?.media?.edges?.map((e=>e.node.image.url)).filter(Boolean),d=l?.[1]??i??"";return t.createElement("div",{className:"yt-bundleBuilder-image-effect",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-bundleBuilder-image-effect_wrapper",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-bundleBuilder-image-effect_main-image",loading:"lazy",decoding:"async",fetchPriority:"low",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o&&(i||l?.[0])!==d?0:1,transition:l?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:i||l?.[0],alt:e.title}),(i||l?.[0])!==d&&t.createElement("img",{className:"yt-bundleBuilder-image-effect_hover-image",loading:"lazy",decoding:"async",fetchPriority:"low",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0},src:i||d,alt:e.title})))},Ku=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:a,themeColor:i,handleRemoveItem:d,transitionActive:s,idx:p,selecteditems:u,customVariantsQuantity:m})=>{const f=Wt(iu),g=n.customizations,h=g?.byob?.variantSelectorType,[x,y]=c(!1),b=g.general?.variantTitleSuffix?e?.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(" ")}}}))})(e?.variants?.edges);if(!b||!b.length)return t.createElement(t.Fragment,null);const v=b?.find((e=>e.node.inventoryQuantity>0||!g?.general.trackInventory))?.node?.id;if(!v&&!g.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[w,C]=c(b?.find((e=>!g?.general.trackInventory||e.node.inventoryQuantity>0))?.node?.id||b[0]?.node?.id),[k,E]=c(0),[T,S]=c(window.innerWidth<450),[B,$]=c("normal"),z=b?.find((e=>e?.node?.id===w))?.node,D=m&&m.length>0&&m.find((e=>e.variantId==z?.id))?.quantity||z&&z?.inventoryQuantity;l((()=>{const e=u.find((e=>e.variantId===w));E(e?e.quantity:0)}),[k,u,w]),l((()=>{const e=()=>{S(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{CSS.supports("font-weight","500")?$("500"):CSS.supports("font-weight","400")?$("400"):CSS.supports("font-weight","600")&&$("600")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",B)}),[B]),l((()=>{if(w&&!b?.some((e=>e.node.id===w))){const e=b[0]?.node.id;e&&C(e)}}),[w,b]);const I=e.variants&&e.variants.edges?.length>1&&"customOptions"!==h,P="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,N="53933408435"===P,_="75851235630"===P,O=(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[]})(e),M=O.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{className:`bundle-builder-product-container ${s?"yt-product-card-transition-active":p%2==0?"yt-product-card-transition":"yt-product-card-transition-up"} ${"none"===g?.byob.shadowType?"shadow-none":"spread"===g?.byob.shadowType?"shadow-spread":"shadow-no-spread"}`,style:{borderRadius:g?.byob.borderRadius,border:"transparent"!==g?.byob.borderColor?`1px solid ${g?.byob.borderColor}`:"none",backgroundColor:g?.byob.cardBackgroundColor||"#fff"},onClick:()=>{if(D<=0&&g?.general.trackInventory)return;const t={...e,variants:{...e.variants,edges:b},selectedVariant:z};f(t)}},t.createElement("div",{className:"yt-bundleBuilder-product-card_image-wrapper"},t.createElement(Zu,{product:e,styles:g,selectedVariant:z}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-bundleBuilder-product-card_badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:g.byob.borderRadius}},n.productCardBadgeText),I&&t.createElement("div",{className:"yt-bundleBuilder-variant-selector-container",style:{position:"relative",width:"100%"}},t.createElement("select",{className:"bundle-builder-variant-selector "+(N?"bundle-builder-variant-selector--coralHaze":""),onClick:e=>{e.preventDefault(),e.stopPropagation()},value:w||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),C(e.target.value)}},b?.map((e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)}))),t.createElement("div",{className:"yt-bundleBuilder-variant-selector_icon",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(A,null)))),t.createElement("div",{className:"yt-bundleBuilder-product-card_details"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&M&&t.createElement("div",{className:"yt-bundleBuilder-product-card_category-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-bundleBuilder-product-card_category-container",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},O.slice(0,2).map(((e,n)=>t.createElement("span",{className:"yt-bundleBuilder-product-card_category",key:n,style:{fontSize:T?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1)))),O.length>2&&t.createElement("span",{className:"yt-bundleBuilder-product-card_category-more",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",O.length-2," more"))),t.createElement("div",{className:"yt-bundleBuilder-product-card_title",style:{"--title-margin-top":T?"4px":"0px","--title-padding":n?.showBorder??1?"0 10px":"0 4px",...!1===g?.byob.productsPriceVisibility&&{"--title-padding":"8px"},...g?.byob.productTitleFontSize&&{"--title-font-size":g?.byob.productTitleFontSize}}},_?String(z?.displayName).replace("- Default Title",""):e.title,z?.commonSuffix?" -"+z?.commonSuffix:"")),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14}),t.createElement("span",{className:"yt-bundleBuilder-product-card_rating-text",style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Hr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Un,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),g?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-bundleBuilder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(z?.price??"0")>0?t.createElement("span",{className:"yt-bundleBuilder-product_price--new"},Ig(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Dg(z?.price)):t.createElement("span",{className:"yt-bundleBuilder-product-card_price--free"},"Free"),z?.compareAtPrice&&g?.byob.compareAtPriceVisibility&&parseFloat(z.compareAtPrice)>parseFloat(z?.price)&&t.createElement("span",{className:"yt-fixed-bundle-original-price yt-bundleBuilder-product-card_price--old",style:{fontSize:"14px"}},Ig(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Dg(z.compareAtPrice))),(D>0||!g?.general.trackInventory)&&t.createElement("div",{className:"yt-product-atc-wrapper"},(0===k||void 0===k)&&t.createElement("button",{style:{...!o&&{backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),E(1),(()=>{if(!w)return;"customOptions"===h&&b.length>1?y(!0):r(w,e,1)})()},className:"yt-product-atc-button"},g?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&k>0&&w&&t.createElement("div",{className:"visible yt-bundleBuilder-quantity-selector-container--visible",style:{overflow:"hidden"}},t.createElement(Yu,{remainingQuantity:a,setQuantity:E,quantity:k,handleAddToBundle:r,variantId:w,product:e,handleRemoveItem:d,hideAddToBundle:o,disableInventoryTracking:!g?.general.trackInventory,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&k>0&&w&&t.createElement("button",{style:{backgroundColor:g?.general?.primaryContrastColor||"#fff"},className:"yt-bundleBuilder-product-card_add-to-bundle-button--added"},t.createElement("div",{className:"yt-bundleBuilder-product-card_added-button-text"},"ADDED"),t.createElement("div",{onClick:e=>{e.stopPropagation();const t=Math.max(0,k-1);E(t),d&&w&&d(w,1)},className:"yt-bundleBuilder-product-card_remove-button"},t.createElement(to,{className:"yt-bundleBuilder-product-card_remove-icon",style:{color:"#fff",fontSize:"20px"}})))),D<=0&&g?.general.trackInventory&&t.createElement("div",{style:{backgroundColor:g.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled yt-bundleBuilder-product-card_add-to-bundle-button--disabled"},g?.general.outOfStockLabel||"Out of Stock")),"customOptions"===h&&x&&b.length>1&&t.createElement(qu,{product:e,isOpen:x,onClose:()=>y(!1),variantOptions:n.variantOptions,cta:{textColor:g.general.ctaTextColor,backgroundColor:g.general.primaryColor},onConfirm:t=>{C(t),r(t,e,1)},disableInventoryTracking:!g?.general.trackInventory}))},Xu=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:d})=>t.createElement("div",{className:"yt-bundleBuilder-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map(((c,s)=>{const p=s+1,u=o[s].minimumQuantity-(i[s]?.length??0)==0,m=s===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-bundleBuilder-stepper_step "+(m?"yt-bundleBuilder-stepper_step--active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===d?()=>{}:n(p-1)},t.createElement("div",{className:"yt-bundleBuilder-stepper_label",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-bundleBuilder-stepper_line-container",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_dot",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:s<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))}))),t.createElement("div",{className:"yt-bundleBuilder-tier_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[e]?.title)),Ju=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,d]=c(!1),[s,p]=c(r);return l((()=>{const e=setTimeout((()=>{n(s)}),300);return()=>clearTimeout(e)}),[s,n]),t.createElement("div",{className:"yt-byob-sort-filter-container yt-bundleBuilder-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner yt-bundleBuilder-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper yt-bundleBuilder-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(eo,{className:"yt-byob-search-icon yt-bundleBuilder-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>d(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input yt-bundleBuilder-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:s,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input yt-bundleBuilder-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(eo,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon yt-bundleBuilder-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>d(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper yt-bundleBuilder-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label yt-bundleBuilder-filter_label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select yt-bundleBuilder-filter_select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},em=({styles:e,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"===e?.byob?.categoryFilterOnPage?t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"},className:"yt-categoryfilter-tabs-container"},["All",...r].map((r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-tab-button "+(a?"yt-categoryfilter-tab-button--active":""),style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))})))):t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"},className:"yt-categoryfilter-buttons-container"},["All",...r].map((r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.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:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1))))))},tm=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:a,bundleAddToCartLoading:i,renderingOnPage:d,selectedItemsQuantity:s,handleRemoveItem:p,bundleSubtotal:u,shadowRoot:m})=>{const[f,g]=c(void 0),[h,x]=c(window.innerWidth<450),[y,b]=c(0),[v,w]=c({}),C=e.builderTiers?.type,k=e.customizations,E=e.builderTiers?.productTier??[],T=e.builderTiers?.offerTier??[],[S,B]=c([]),[$,z]=c(!1),[D,I]=c("All");l((()=>{const t=new Set;let n=!1;e?.products?.forEach((e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach((e=>t.add(e))))}})),B(Array.from(t)),z(n)}),[e.products]);const P=((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})))(e.products.filter((e=>"ACTIVE"===e.productDetails.status||void 0===e.productDetails.status||""===e.productDetails.status)),D),N="productTier"===C?E.reduce(((e,t)=>e+t.minimumQuantity),0):"offerTier"===C?T.reduce(((e,t)=>e+t.minimumQuantity),0):e.minimumQuantity,[_,O]=c(""),[M,A]=c(""),F=((e,t)=>e.filter((e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase()))))(P,_),R=((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}})))(F,M),L=((e,t,n,r,o)=>(e[o]?.products.filter((e=>t.some((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))))||[]).sort(((e,n)=>{let o=t.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0])))),a=t.find((e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0]))));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges[0]?.node?.price||"0"),d=parseFloat(a?.productDetails?.variants?.edges[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-d;case"price-high-to-low":return d-c;default:return 0}})))(E,R,_,M,y),[j,V]=Ut(iu),[H,W]=c(!1);l((()=>{setTimeout((()=>{W(!0)}),100)}),[]);const U=o(null);l((()=>{const e=()=>{x(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{if(e.coverImageUrl){const t=new Image;t.src=e.coverImageUrl,t.onload=()=>{g(t.width/t.height)}}}),[e.coverImageUrl]),l((()=>{W(!1),setTimeout((()=>W(!0)),100)}),[y]);const G=(e,t)=>{if("productTier"===C){let n={...v},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=E.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}w(n);const o=E.findIndex(((e,t)=>n[t]?.length<e.minimumQuantity));-1!==o&&b(o)}p(e)};l((()=>{if("productTier"===C){const e=Object.fromEntries(E.map((e=>[e.tier,[]])));w(e)}}),[e]),l((()=>{if("productTier"!==C||!E[y])return;if(N===s)return;const e=E.findIndex(((e,t)=>{const n=v[t]||[];return t>=y&&n.length<e.minimumQuantity}));-1!==e&&e!==y&&(b(e),(()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})})())}),[v,E,C]),l((()=>{O("")}),[y]),l((()=>{function e(e){if(!U.current||!e.target)return;!U.current.contains(e.target)&&V(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const Q=(e,t,o)=>{var a;"productTier"===C&&(a=e,w((e=>{const t={...e},n=E.findIndex(((e,n)=>{const r=t[n]||[];return n>=y&&r.length<e.minimumQuantity}));return-1!==n&&b(n),t[n]||(t[n]=[]),t[n].push(a),t}))),Pg(e,t,o,n,r)},q=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map((e=>{a+=e.minimumQuantity})),a})(),Y=h&&e.mobileCoverImageUrl?e.mobileCoverImageUrl:e.coverImageUrl||null,Z=e.customStoreDetails?.fixedInventoryDetails,K=e=>{const t=k?.general?.showOutOfStockProducts;if(t||!k?.general.trackInventory)return!0;const n=e?.productDetails?.variants?.edges||[];if(Z){if(n.some((e=>Z.some((t=>t.variantId===e.node.id&&t.quantity>0)))))return!0}return n.some((e=>e.node.inventoryQuantity>0))},X="bundles"==e.appName?e.pageHeader?.title:e?.title,J="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:k.byob.sectionBackgroundColor,..."transparent"!==k.fixedBundle.sectionBackgroundColor&&{padding:"20px"},willChange:"transform",backfaceVisibility:"hidden",transform:"translateZ(0)"},id:"yt-bundleBuilder-main-container",className:"yt-bundleBuilder-main-container"},Y?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}},className:"yt-bundleBuilder-header-banner"},Y&&t.createElement("img",{src:Y,alt:"Background",className:"yt-bundleBuilder-header_image",style:{width:"100%",height:"auto",display:"block"}}),t.createElement("div",{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)"},className:"yt-bundleBuilder-header_text-overlay"},t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:k?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title yt-bundleBuilder-header_title"},X),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle yt-bundleBuilder-header_subtitle"},J))):(X||J)&&t.createElement("div",{className:"yt-bundleBuilder-header-container"},X&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:k?.byob?.titleBackgroundColor??"transparent"},className:"yt-bundleBuilder-header_title"},X),J&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"yt-bundleBuilder-header_subtitle"},J)),t.createElement("div",{className:"products-display yt-bundleBuilder-products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(Xu,{currentStep:y,totalSteps:E.length,tiers:E,isMobile:h,primaryColor:k?.general?.primaryColor,primaryTextColorCta:k?.general?.primaryContrastColor,setCurrentProductTier:b,selectedProductsByTier:v,tierNavigation:k.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"},className:"yt-bundleBuilder-filters-container"},e?.enableSortAndFilter&&t.createElement(Ju,{isMobile:h,searchTerm:_,setSearchTerm:O,setSortBy:A,styles:k}),e?.customizations?.byob?.enableProductCategories&&$&&t.createElement("div",null,t.createElement(em,{styles:k,isMobile:h,categories:S,activeCategory:D,onCategoryChange:e=>{I(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display yt-bundleBuilder-product-grid"},0===R?.length||"productTier"===C&&0===L?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"},className:"yt-bundleBuilder-product-grid_no-products-text"},"No products found"):"productTier"===C&&E.length>0?L.filter((e=>K(R.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))))).map(((r,o)=>{const a=(E[y]?.minimumQuantity??0)>(v[y]?.length??0),i=R.find((e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0]))));return i?t.createElement(Ku,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:Q,hideAddToBundle:!a,remainingQuantity:q-s,themeColor:e?.dealTextColor,handleRemoveItem:e=>G(e,y),selecteditems:n,transitionActive:H,customVariantsQuantity:Z}):null})):R.filter(K).map(((r,o)=>t.createElement(Ku,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:Q,hideAddToBundle:s>=q,remainingQuantity:q-s,themeColor:e?.dealTextColor,handleRemoveItem:p,selecteditems:n,transitionActive:H,customVariantsQuantity:Z})))),!d&&t.createElement(au,{builderTiers:e?.builderTiers,handleAddToCart:a,minimumQuantity:N,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:p,handleRemoveItemProductTier:G,selectedItemsQuantity:s,percentageOff:e.percentageOff,loading:i,bundleSubtotal:u,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d,shadowRoot:m})),d&&t.createElement(au,{handleAddToCart:a,minimumQuantity:N,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:i,handleRemoveItem:p,handleRemoveItemProductTier:G,percentageOff:e.percentageOff,selectedItemsQuantity:s??0,bundleSubtotal:u??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:k.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d,shadowRoot:m}),j&&void 0!==s&&(()=>{let r=s<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=s<T.reduce(((e,t)=>e+t.minimumQuantity),0)),t.createElement(Gu,{handleAddToBundle:Q,ref:U,remainingQuantity:e.minimumQuantity-s,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,disableInventoryTracking:!e?.customizations.general.trackInventory,selectedProducts:n,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:k?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none",shadowRoot:m})})())},nm=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:d,storeCurrencyCode:s})=>{const p=e?.productDetails?.variants?.edges?.find((e=>e?.node?.id===n))?.node,u=i((()=>{if(p?.title&&e.productDetails.options){const t=p.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map((e=>e.values[0]))||[]}),[p,e.productDetails.options]),m=e=>{r(e)};return c?t.createElement("div",{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"}},t.createElement("div",{style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{src:p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg",alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{value:n,onChange:e=>m(e.target.value),style:{padding:"8px 10px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"14px",width:"100%",appearance:"none",marginRight:"30px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:e.node.inventoryQuantity<=0},e?.node?.title)))),t.createElement("div",{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"}},t.createElement(A,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{style:{lineHeight:"normal"}},Ig(o.general.currencySymbol,s),Dg((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},Ig(o.general.currencySymbol,s),Dg(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))))):t.createElement("div",{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"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.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"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{style:{position:"relative"}},t.createElement("img",{src:p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg",alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}}),t.createElement("div",{style:{position:"absolute",top:-8,right:-8,backgroundColor:"#f8f8f8",borderRadius:"50%",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #eee",fontSize:"14px"}},"1")),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",null," ",e?.productDetails?.title," "),e.productDetails.variants.edges.length>1&&d&&u&&t.createElement("span",{style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},u.length>1?u.join(" / "):u)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{style:{lineHeight:"normal"}},Ig(o.general.currencySymbol,s),Dg((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Ig(o.general.currencySymbol,s),Dg(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))),e.productDetails.variants.edges.length>1&&e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{marginTop:"10px",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&t.createElement("label",{style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map((a=>{const i=d&&d?.options?.find((e=>e.name===n.name));return i&&"color"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent"}},i?.values.find((e=>e.name===a))?.value?t.createElement("div",{style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",borderRadius:"50%",backgroundColor:i?.values.find((e=>e.name===a))?.value,cursor:"pointer"}},t.createElement("span",null)):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):i&&"image"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u[r]===a?"#F7F7F7":"transparent",cursor:"pointer",padding:"0px",width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",overflow:"hidden"}},i?.values.find((e=>e.name===a))?.value?t.createElement("img",{src:i?.values.find((e=>e.name===a))?.value||"/placeholder.svg",alt:a,style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)}))))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("button",{key:e?.node?.id,onClick:()=>m(e?.node?.id),disabled:e.node.inventoryQuantity<=0,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},e?.node?.title)))))))},rm=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,d]=c(window.innerWidth<786),[s,p]=c((()=>{const t={};return e.products.forEach(((e,n)=>{const r=e.productDetails.variants.edges.find((e=>e.node.inventoryQuantity>0))?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id})),t})),u=e.products?.filter((e=>e?.productDetails?.variants?.edges.some((e=>e?.node?.inventoryQuantity>0))))||[],m=Object.keys(s).length===u.length,f=(e,t)=>{p((n=>({...n,[e]:t})))},{originalPrice:g,dealPrice:h,offerValue:x}=i((()=>{const{price:t,compareAtPrice:n}=Object.entries(s).reduce(((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find((e=>e.node.id===r))?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[s,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l((()=>{const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Ig(y.general.currencySymbol,e.storeCurrencyCode),Dg(h)),t.createElement("div",{style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Ig(y.general.currencySymbol,e.storeCurrencyCode),Dg(g)),t.createElement("span",{style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${Ig(y.general.currencySymbol,e.storeCurrencyCode)}${Dg(e?.amountOff)} Off`:`Save ${Ig(y.general.currencySymbol,e.storeCurrencyCode)}${Dg(x)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===s[r]))?.node;return o?t.createElement(nm,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:s[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null}))):t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map(((n,r)=>t.createElement(nm,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:s[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions}))))),t.createElement("div",{style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return void o(!1);const t=Object.entries(s).map((([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find((e=>e.node.id===n))?.node;return o?{variantId:n,price:Number(o.price)}:null})).filter((e=>null!==e)),r=Object.values(s);await n(Number(g),r,Number(h),t)}catch(e){}o(!1)}},r?t.createElement(Wo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},om=x.div`
|
|
2865
2865
|
max-width: 800px;
|
|
2866
2866
|
container-type: inline-size;
|
|
2867
2867
|
margin-top: ${e=>e.verticalMargin||"0px"};
|