yt-uikit 0.8.14-minor-css.0 → 0.8.14
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/components/BundleBlock/Bundle.d.ts +3 -1
- package/dist/esm/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +2 -0
- package/dist/esm/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/types/components/BundleBlock/Bundle.d.ts +3 -1
- package/dist/esm/types/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +2 -0
- package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/esm/components/Cart/MobileMiniCart.d.ts +0 -21
- package/dist/esm/components/Cart/VariantSelectionPopup/MobileVariantPopover.styled.d.ts +0 -49
- package/dist/esm/components/shared/Spinner.d.ts +0 -23
- package/dist/esm/components/shared/index.d.ts +0 -2
- package/dist/esm/types/components/Cart/MobileMiniCart.d.ts +0 -21
- package/dist/esm/types/components/Cart/VariantSelectionPopup/MobileVariantPopover.styled.d.ts +0 -49
- package/dist/esm/types/components/shared/Spinner.d.ts +0 -23
- package/dist/esm/types/components/shared/index.d.ts +0 -2
package/dist/esm/index.js
CHANGED
|
@@ -993,7 +993,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
993
993
|
width: 100%;
|
|
994
994
|
gap: 10px;
|
|
995
995
|
margin-top: 16px;
|
|
996
|
-
`;function Uo({showLoyaltyCta:e,exploreCTAColor:n="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:o,isUserSignedIn:a=!1,joinNowFunction:i,exploreCtaRedirectLink:l,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:f,addCartItem:g,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:k="Empty cart Recommendations",backgroundSubdued:E,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[B,z]=c(!1),[I,N]=c(null);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},t.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},t.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),t.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),t.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),t.createElement("span",{style:{color:b,fontWeight:"semibold"}},r),o&&t.createElement("span",{style:{color:"#929292",fontSize:"14px"}},o),!a&&e&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},t.createElement(Wo,{color:n,fontSize:"14px",strokeWidth:2}),t.createElement(Ho,null,t.createElement("span",{onClick:i,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",t.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&t.createElement(qo,null,d.map((e,n)=>t.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>N(n),onMouseLeave:()=>N(null),onClick:()=>window.location.href=e.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:I===n?s||"#73DABB":"#CACACA30",color:I===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},e.title)))),T&&f&&f.length>0&&g&&t.createElement("div",{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},t.createElement(_r,{products:f,addCartItem:g,productRecsTitleText:k,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:E,tertiaryColor:S,tertiaryTextColor:$}))),t.createElement("button",{onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),onClick:()=>window.location.replace(l??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},t.createElement(Vo,{color:b}),t.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:b,cursor:"pointer"}},"Continue Shopping")))}function Go(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,18 L12,6 M6,12 L18,12"},child:[]}]})(e)}function Qo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"polyline",attr:{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"},child:[]}]})(e)}function Yo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M6,12 L18,12"},child:[]}]})(e)}const Zo=xn("gstNumber",""),Xo=xn("gstCompanyName",""),Ko=Kt("");q("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Jo=xn("postalCode",void 0);function ea({checkoutButtonColor:e,checkoutFontSize:n,checkoutFunction:r,discountApplied:a,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:f,applyNoteToCart:g,showNoteOption:h,enableGeoLocationDeliveryRestriction:x,applyPostalCodeAndDeliverySlotToCart:y,enableSlotPicker:b,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:k,checkoutSectionMessageDisplay:E,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:z,toggleDecimal:I,disableCheckoutButton:N,checkoutButtonBottomSpacing:D=8,showPoweredByBadge:_=!0,showCheckoutButtonPaymentIcons:P,primaryTextColor:A}){const O=dn(mn),F=dn(Zo),M=dn(Xo),R=dn(Ko),L=dn(bn),j=dn(yn),V=dn(Jo),W=dn(wn),H=dn(vn),[q,U]=c(!1),G=Dn(O,O?.currency),[Q,Y]=c("closed"),Z=o(null),[X,K]=c(!1),J=i(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),r=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16),a=9===n.length?parseInt(n.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),s=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==a?`${s}${a.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),ee=i(()=>In(p??0,O?.currency??"INR"),[p,O?.currency]),te=i(()=>Vn(I?ee.toFixed(2):ee.toFixed(0)),[ee,I]),ne=o(null),re=o(null),oe=o(null),ae=()=>{Y("closing"),setTimeout(()=>{Y("closed")},300)},ie=In(O?.original_total_price,O?.currency),le=i(()=>z?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[z]),ce=i(()=>!(!le||!le.minimumOrderValue)&&ie>=le.minimumOrderValue,[le,ie]),se=ce&&le&&le.discountValue||0,de=d?In(d,O?.currency??"INR"):0,pe=Number((ie-de).toFixed(2)),ue=i(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return In(e,O?.currency)},[O?.items,S]),me=i(()=>ce?ue+se:ue,[ce,ue,se]),fe=i(()=>ee&&ee>0?`Add products worth more than ${G}${te}`:"",[ee,G,te]),ge=i(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),he=In(ge,O?.currency??"INR");l(()=>{ne.current&&jn(ne.current),re.current&&jn(re.current),oe.current&&jn(oe.current)},[e,de,S,he,Q,se]);const xe=i(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),ye=i(()=>{const e=[];for(const t in xe)if(Object.prototype.hasOwnProperty.call(xe,t)){const n=xe[t],r=In(n,O?.currency??"INR"),o=qn(t);e.push({title:o,amount:r})}return e},[xe,O?.currency]),be=i(()=>{let e=0;return e+=S?de+he:de,ce&&(e+=se),e},[de,he,S,ce,se]),ve=async e=>{if(U(!0),pe<=0)U(!1);else{if(x){if("standard"!==H&&(b?!L:!j.isPostalCodeValid))return void U(!1);if(y)try{"standard"===H?await y(H):await y(H,String(V)||"",W&&b?new Date(W).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}f&&m&&""!==M&&""!==F&&await m(F,M),h&&g&&""!==R&&await g(R),await r(e),U(!1)}},[we,Ce]=c(!1);l(()=>{Ce(pe<=0||(!!N||!!x&&("standard"!==H&&(b?!L:!j.isPostalCodeValid))))},[j,H,x,b,L,W,N,pe]);const[ke,Ee]=c(!1),Te=o(null),[Se,$e]=c("0px");l(()=>{Te.current&&$e(ke?`${Te.current.scrollHeight}px`:"0px")},[ke,ye,ce]);const Be=()=>{Ee(!ke)};l(()=>{function e(e){Z.current&&!Z.current.contains(e.target)&&ae()}return"open"!==Q&&"opening"!==Q||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[Q]);const ze=e=>e?t.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},"Checkout"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Qo,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):t.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},t.createElement(po,{fontSize:"20px"}),t.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},"Checkout"));return t.createElement("div",{style:{position:"relative"}},!!k&&k.length>0&&!Wn()&&(()=>{const e=E||"ribbon";if("ribbon"===e)return t.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},k);const n=({children:n})=>t.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"max-content",padding:"0 55px",marginBottom:"4px",position:"bookmark"===e?"absolute":"static",top:"bookmark"===e?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===e?t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:J}),t.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},k),t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:J}),t.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:J}),t.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},k),t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:J}),t.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===s||"true"===s)&&"closed"!==Q&&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)",opacity:"open"===Q?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ae}),t.createElement("div",{ref:Z,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===Q?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},t.createElement("div",{style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},t.createElement("span",null,"Price Summary"),t.createElement("button",{onClick:ae,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),t.createElement("div",{style:{backgroundColor:"white",padding:"10px 1rem 0"}},t.createElement(t.Fragment,null,(S&&he>0||a&&ye.length>0||ce&&se>0)&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},G,Vn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||S&&he>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?he.toFixed(2):he.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?e.amount.toFixed(2):e.amount.toFixed(0))))),be>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},t.createElement("span",null,"Total Savings"),t.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",G,Vn(I?be.toFixed(2):be.toFixed(0))))),(de>0||S&&he>0||ce&&se>0)&&t.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:de>0||S&&he>0||ce&&se>0?"10px":"0"}},t.createElement("div",{style:{display:"flex",flexDirection:"column"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),t.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),t.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0)))),t.createElement("div",{style:{display:"flex",background:$,color:B,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},t.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",t.createElement("span",null,G,Vn(I?be.toFixed(2):be.toFixed(0)))," ","on your order")),t.createElement("button",{ref:re,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},ze(q)))),(!0===s||"true"===s)&&N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),!0===s||"true"===s?t.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${D}px 8px`}},t.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(de>0||S&&he>0||ce&&se>0)&&t.createElement("div",{className:"yt-cart-checkout-save-badge",ref:oe,style:{fontSize:"9px",backgroundColor:e,width:"max-content",padding:"2px 8px"}},"Saving ",G,Vn(I?be.toFixed(2):be.toFixed(0))),q?t.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):a||ce&&le?t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},t.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0))),(de>0||he>0||ce&&se>0)&&t.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},G,Vn(ce?me.toFixed(0):ue.toFixed(0))))):t.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0))),S&&he>0||a&&de>0||ce&&se>0?t.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Y("opening"),requestAnimationFrame(()=>{Y("open")}),K(!X)}},"See Details"):t.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),t.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{backgroundColor:e,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Qo,{fontSize:"24px"}))):"CHECKOUT"))),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}}))):t.createElement(t.Fragment,null,N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),t.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:A}},(he>0||a&&ye.length>0||ce&&se>0)&&be>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px"}},G,Vn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||he>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",t.createElement("button",{onClick:Be,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},ke?"Hide details":"See details")),t.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",G,Vn(I?be.toFixed(2):be.toFixed(0)))),t.createElement("div",{ref:Te,style:{height:Se,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:ke?1:0,marginTop:ke?"5px":"0",borderTop:ke?"1px solid #E5E7EB":"none",paddingTop:ke?"5px":"0",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?he.toFixed(2):he.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?e.amount.toFixed(2):e.amount.toFixed(0))))))),t.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),t.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0))))),t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==Q||v?"0":`4px 1rem ${D}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,color:u??"white",textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"closed"!==Q?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},ze(q)),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}})))))}const ta=x.button`
|
|
996
|
+
`;function Uo({showLoyaltyCta:e,exploreCTAColor:n="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:o,isUserSignedIn:a=!1,joinNowFunction:i,exploreCtaRedirectLink:l,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:f,addCartItem:g,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:k="Empty cart Recommendations",backgroundSubdued:E,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[B,z]=c(!1),[I,N]=c(null);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},t.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},t.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),t.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),t.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),t.createElement("span",{style:{color:b,fontWeight:"semibold"}},r),o&&t.createElement("span",{style:{color:"#929292",fontSize:"14px"}},o),!a&&e&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},t.createElement(Wo,{color:n,fontSize:"14px",strokeWidth:2}),t.createElement(Ho,null,t.createElement("span",{onClick:i,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",t.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&t.createElement(qo,null,d.map((e,n)=>t.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>N(n),onMouseLeave:()=>N(null),onClick:()=>window.location.href=e.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:I===n?s||"#73DABB":"#CACACA30",color:I===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},e.title)))),T&&f&&f.length>0&&g&&t.createElement("div",{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},t.createElement(_r,{products:f,addCartItem:g,productRecsTitleText:k,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:E,tertiaryColor:S,tertiaryTextColor:$}))),t.createElement("button",{onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),onClick:()=>window.location.replace(l??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},t.createElement(Vo,{color:b}),t.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:b,cursor:"pointer"}},"Continue Shopping")))}function Go(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,18 L12,6 M6,12 L18,12"},child:[]}]})(e)}function Qo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"polyline",attr:{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"},child:[]}]})(e)}function Yo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M6,12 L18,12"},child:[]}]})(e)}const Zo=xn("gstNumber",""),Xo=xn("gstCompanyName",""),Ko=Kt("");q("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Jo=xn("postalCode",void 0);function ea({checkoutButtonColor:e,checkoutFontSize:n,checkoutFunction:r,discountApplied:a,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:f,applyNoteToCart:g,showNoteOption:h,enableGeoLocationDeliveryRestriction:x,applyPostalCodeAndDeliverySlotToCart:y,enableSlotPicker:b,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:k,checkoutSectionMessageDisplay:E,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:z,toggleDecimal:I,disableCheckoutButton:N,checkoutButtonBottomSpacing:D=8,showPoweredByBadge:_=!0,showCheckoutButtonPaymentIcons:P,primaryTextColor:A}){const O=dn(mn),F=dn(Zo),M=dn(Xo),R=dn(Ko),L=dn(bn),j=dn(yn),V=dn(Jo),W=dn(wn),H=dn(vn),[q,U]=c(!1),G=Dn(O,O?.currency),[Q,Y]=c("closed"),Z=o(null),[X,K]=c(!1),J=i(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),r=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16),a=9===n.length?parseInt(n.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),s=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==a?`${s}${a.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),ee=i(()=>In(p??0,O?.currency??"INR"),[p,O?.currency]),te=i(()=>Vn(I?ee.toFixed(2):ee.toFixed(0)),[ee,I]),ne=o(null),re=o(null),oe=o(null),ae=()=>{Y("closing"),setTimeout(()=>{Y("closed")},300)},ie=In(O?.original_total_price,O?.currency),le=i(()=>z?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[z]),ce=i(()=>!(!le||!le.minimumOrderValue)&&ie>=le.minimumOrderValue,[le,ie]),se=ce&&le&&le.discountValue||0,de=d?In(d,O?.currency??"INR"):0,pe=Number((ie-de).toFixed(2)),ue=i(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return In(e,O?.currency)},[O?.items,S]),me=i(()=>ce?ue+se:ue,[ce,ue,se]),fe=i(()=>ee&&ee>0?`Add products worth more than ${G}${te}`:"",[ee,G,te]),ge=i(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),he=In(ge,O?.currency??"INR");l(()=>{ne.current&&jn(ne.current),re.current&&jn(re.current),oe.current&&jn(oe.current)},[e,de,S,he,Q,se]);const xe=i(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),ye=i(()=>{const e=[];for(const t in xe)if(Object.prototype.hasOwnProperty.call(xe,t)){const n=xe[t],r=In(n,O?.currency??"INR"),o=qn(t);e.push({title:o,amount:r})}return e},[xe,O?.currency]),be=i(()=>{let e=0;return e+=S?de+he:de,ce&&(e+=se),e},[de,he,S,ce,se]),ve=async e=>{if(U(!0),pe<=0)U(!1);else{if(x){if("standard"!==H&&(b?!L:!j.isPostalCodeValid))return void U(!1);if(y)try{"standard"===H?await y(H):await y(H,String(V)||"",W&&b?new Date(W).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}f&&m&&""!==M&&""!==F&&await m(F,M),h&&g&&""!==R&&await g(R),await r(e),U(!1)}},[we,Ce]=c(!1);l(()=>{Ce(pe<=0||(!!N||!!x&&("standard"!==H&&(b?!L:!j.isPostalCodeValid))))},[j,H,x,b,L,W,N,pe]);const[ke,Ee]=c(!1),Te=o(null),[Se,$e]=c("0px");l(()=>{Te.current&&$e(ke?`${Te.current.scrollHeight}px`:"0px")},[ke,ye,ce]);const Be=()=>{Ee(!ke)};l(()=>{function e(e){Z.current&&!Z.current.contains(e.target)&&ae()}return"open"!==Q&&"opening"!==Q||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[Q]);const ze=e=>e?t.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},"Checkout"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Qo,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):t.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},t.createElement(po,{fontSize:"20px"}),t.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},"Checkout"));return t.createElement("div",{style:{position:"relative"}},!!k&&k.length>0&&!Wn()&&(()=>{const e=E||"ribbon";if("ribbon"===e)return t.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},k);const n=({children:n})=>t.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:"0 55px",marginBottom:"4px",position:"bookmark"===e?"absolute":"static",top:"bookmark"===e?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===e?t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:J}),t.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},k),t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:J}),t.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:J}),t.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},k),t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:J}),t.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===s||"true"===s)&&"closed"!==Q&&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)",opacity:"open"===Q?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ae}),t.createElement("div",{ref:Z,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===Q?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},t.createElement("div",{style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},t.createElement("span",null,"Price Summary"),t.createElement("button",{onClick:ae,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),t.createElement("div",{style:{backgroundColor:"white",padding:"10px 1rem 0"}},t.createElement(t.Fragment,null,(S&&he>0||a&&ye.length>0||ce&&se>0)&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},G,Vn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||S&&he>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?he.toFixed(2):he.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?e.amount.toFixed(2):e.amount.toFixed(0))))),be>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},t.createElement("span",null,"Total Savings"),t.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",G,Vn(I?be.toFixed(2):be.toFixed(0))))),(de>0||S&&he>0||ce&&se>0)&&t.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:de>0||S&&he>0||ce&&se>0?"10px":"0"}},t.createElement("div",{style:{display:"flex",flexDirection:"column"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),t.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),t.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0)))),t.createElement("div",{style:{display:"flex",background:$,color:B,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},t.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",t.createElement("span",null,G,Vn(I?be.toFixed(2):be.toFixed(0)))," ","on your order")),t.createElement("button",{ref:re,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},ze(q)))),(!0===s||"true"===s)&&N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),!0===s||"true"===s?t.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${D}px 8px`}},t.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(de>0||S&&he>0||ce&&se>0)&&t.createElement("div",{className:"yt-cart-checkout-save-badge",ref:oe,style:{fontSize:"9px",backgroundColor:e,width:"max-content",padding:"2px 8px"}},"Saving ",G,Vn(I?be.toFixed(2):be.toFixed(0))),q?t.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):a||ce&&le?t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},t.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0))),(de>0||he>0||ce&&se>0)&&t.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},G,Vn(ce?me.toFixed(0):ue.toFixed(0))))):t.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0))),S&&he>0||a&&de>0||ce&&se>0?t.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Y("opening"),requestAnimationFrame(()=>{Y("open")}),K(!X)}},"See Details"):t.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),t.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{backgroundColor:e,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Qo,{fontSize:"24px"}))):"CHECKOUT"))),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}}))):t.createElement(t.Fragment,null,N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),t.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:A}},(he>0||a&&ye.length>0||ce&&se>0)&&be>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px"}},G,Vn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||he>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",t.createElement("button",{onClick:Be,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},ke?"Hide details":"See details")),t.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",G,Vn(I?be.toFixed(2):be.toFixed(0)))),t.createElement("div",{ref:Te,style:{height:Se,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:ke?1:0,marginTop:ke?"5px":"0",borderTop:ke?"1px solid #E5E7EB":"none",paddingTop:ke?"5px":"0",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?he.toFixed(2):he.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",G,Vn(I?e.amount.toFixed(2):e.amount.toFixed(0))))))),t.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),t.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},G,Vn(I?pe.toFixed(2):pe.toFixed(0))))),t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==Q||v?"0":`4px 1rem ${D}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,color:u??"white",textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"closed"!==Q?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},ze(q)),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}})))))}const ta=x.button`
|
|
997
997
|
background-color: ${e=>e.$ctaButtonBackgroundColor||"#BEB8EC"};
|
|
998
998
|
color: ${e=>e.$ctaButtonTextColor||"black"};
|
|
999
999
|
font-size: 11px;
|
|
@@ -3319,7 +3319,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3319
3319
|
text-align: center;
|
|
3320
3320
|
display: flex;
|
|
3321
3321
|
flex-shrink: 0;
|
|
3322
|
-
`,km=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:s})=>t.createElement(t.Fragment,null,e.map((a,d)=>{const p=a.minimumQuantity-(r[d]?.length??0),u=o?.filter(e=>r[d]?.includes(e.variantId));return Math.min(r[d]?.length/a.minimumQuantity*100,100),t.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},t.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},t.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(e=>{const o=e.product.variants?.edges?.find(t=>t.node.id===e.variantId),a=r[d]?.filter(e=>e===o?.node.id).length||0;return i?t.createElement(wm,{className:"yt-byob-tracker-detailed-product-item",key:e.variantId},t.createElement(om,{className:"yt-byob-tracker-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(tm,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},e.quantity,"x")),t.createElement(im,{className:"yt-byob-tracker-info-block"},t.createElement(lm,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(cm,{className:"yt-byob-tracker-product-price"},s,dx(o?.node?.price)),t.createElement(nm,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(e.variantId,d)},t.createElement(di,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(vm,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url,style:{..."high"===c&&{borderRadius:"20px"},..."medium"===c&&{borderRadius:"6px"},...""===c&&{borderRadius:"0px"}}},a>1&&t.createElement(tm,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},a,"x"),t.createElement(nm,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(e.variantId,d)},t.createElement(xt,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((e,r)=>t.createElement(dm,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:r},t.createElement(Co,{size:40,color:"#A0A0A0"}))))),d<e.length-1&&t.createElement(Cm,{className:"yt-byob-tracker-plus-icon-container"},t.createElement(Co,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),Em=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:o,showProductDetailsInTracker:a,loading:i,handleRemoveItem:s,percentageOff:d,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:f,dealAmount:g,isMobile:h=!1,themeColor:x,cornerRadiusType:y,primaryTextColorCta:b,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[k,E]=c(!1),[T,S]=c(0),[$,B]=c([]),[z,I]=c(0),[N,D]=c(0),[_,P]=c(!1),[A,O]=c(null),F=u?.price||0,M=e?.type,R=e=>{if(e<0||!$[e])return F;const t=$[e].discountValue??0;return d?F*(1-t/100):g?t:m?F-t:F};l(()=>{if(e&&"none"!==e.type)if("productTier"===M&&e.productTier){const t=e.productTier||[];B(t);let n=0;e.productTier.map(e=>{n+=e.minimumQuantity}),D(n-p)}else if($.length)z>0&&p<$[z-1]?.minimumQuantity?(I(z-1),O(z-1)):p<$[z]?.minimumQuantity&&O(z-1),S(R(z));else{const t=e.offerTier||[];B(t),I(0),D(t[0]?.minimumQuantity-p||r-p)}else B([]),D(r-p),I(0)},[e,r,p]),l(()=>{$.length&&"productTier"!=M?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===M)for(let r=0;r<$.length&&(n+=$[r].minimumQuantity,p>=n);r++)t=r,e=r+1<$.length?r+1:r;if(I(e),O(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),E(!0),S(R(t))}else P(!1),E(!1),S(F);const r=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;D(r)})():p===r?(E(!0),S(d?F*(1-d/100):g||(m?F-m:F)),P(!0)):(P(!1),E(!1))},[p,$]);const L=k?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=k?T.toFixed(2):u?.price?.toFixed(2),V=L&&j?(L-Number(j)).toFixed(2):0,W=e&&"none"!==M&&e.offerTier?"offerTier"===M?Math.min(p/(p+N)*100,100):void 0:p/r*100;l(()=>{if(k&&f.byob.enableConfetti){console.log("remainingItems",N);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,r=(t.top+t.height/2)/window.innerHeight;ao({particleCount:100,spread:70,origin:{x:n,y:r},zIndex:9999})}},[k,f]),z>=0&&z<$.length&&$[z].tier;const H="number"==typeof A?$[A]?.customText:void 0,q="string"==typeof H&&""!==H.trim();return t.createElement(Uu,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(h?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:h,style:{justifyContent:f.byob.selectedProductsVisibility&&!h?"space-between":"center"}},"offerTier"==M&&null!==A&&A>=0&&t.createElement(Gu,{className:"yt-byob-tracker-offer-tier-tag"},q?t.createElement(t.Fragment,null,H," unlocked"):t.createElement(t.Fragment,null,t.createElement(t.Fragment,null,"Buy "," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||g?t.createElement(t.Fragment,null," ",px(f.general.currencySymbol,C)):""," ",dx($[A]?.discountValue),d?t.createElement(t.Fragment,null,"% "):dx(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied"))),h&&N>=1&&!_&&"offerTier"!==M?t.createElement(Qu,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},"Select ",N," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==M&&t.createElement(Yu,{className:"yt-byob-tracker-tier-progress-container"},t.createElement(Zu,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==M&&$.length>0&&z>=0&&N>0&&t.createElement(t.Fragment,null,q?t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," more to unlock"," ",null!==A&&($[A+1]?.customText||$[A]?.customText||"")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+N," at",m||g?t.createElement(t.Fragment,null,px(f.general.currencySymbol,C)):""," ",dx($[z]?.discountValue),d?t.createElement(t.Fragment,null,"% "):dx(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):"")))),t.createElement(Xu,{className:"yt-byob-tracker-progress-bar-bg"},t.createElement(Ku,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:x??f?.general.primaryColor}," "))),f.byob.selectedProductsVisibility&&t.createElement(Ju,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(h?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:M??"",isMobile:h},"productTier"===M?t.createElement(km,{tiers:$,isMobile:h,selectedProductsByTier:w??{},selectedProducts:o,themeColor:f.general.primaryColor,showProductDetailsInTracker:a,handleRemoveItemProductTier:v,cornerRadius:f.byob.borderRadius,currencySymbol:px(f.general.currencySymbol,C)}):t.createElement(t.Fragment,null,o?.map?.(e=>{const n=e.product.variants?.edges?.find(t=>t.node.id===e.variantId);return a?t.createElement(rm,{className:"yt-byob-tracker-detailed-item-container",borderRadius:f.byob.borderRadius,key:e.variantId},t.createElement(om,{className:"yt-byob-tracker-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(am,{className:"yt-byob-tracker-badge"},e.quantity,"x")),t.createElement(im,{className:"yt-byob-tracker-info-block"},t.createElement(lm,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(cm,{className:"yt-byob-tracker-product-price"},f.general.currencySymbol,n?.node?.price),t.createElement(sm,{className:"yt-byob-tracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(di,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(bm,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:h,borderRadius:f.byob.borderRadius,imageUrl: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(tm,{className:"yt-byob-tracker-quantity-badge",borderRadius:f.byob.borderRadius},e.quantity,"x"),t.createElement(nm,{className:"yt-byob-tracker-remove-btn",onClick:()=>s(e.variantId)},t.createElement(xt,{fontSize:"12px"}))))}),N>=1&&[...Array(N)].map((e,n)=>t.createElement(dm,{className:"yt-byob-tracker-placeholder-box",isMobile:h,borderRadius:f.byob.borderRadius,key:n},t.createElement(Co,{size:40,color:"#A0A0A0"}))))),(!h||_)&&t.createElement(em,{className:"yt-byob-tracker-summary-container bundle-summary "+(h?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:h},Number(j)>0&&t.createElement(pm,{className:"yt-byob-tracker-summary-info summary-info"},t.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},h?t.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},t.createElement(um,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&t.createElement(mm,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",px(f.general.currencySymbol,C),dx(V))):t.createElement(t.Fragment,null,t.createElement(um,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!h&&t.createElement(mm,{className:"yt-byob-tracker-save-label"},"Save:"," ",px(f.general.currencySymbol,C),dx(V)))),t.createElement(fm,{className:"yt-byob-tracker-subtotal-row"},t.createElement(gm,{className:"yt-byob-tracker-final-price"},px(f.general.currencySymbol,C),Number(j)>=0?dx(Number(j).toFixed(2)):0),L&&f.byob.compareAtPriceVisibility&&Number(L)>Number(j)&&t.createElement(hm,{className:"yt-byob-tracker-line-through-price"},px(f.general.currencySymbol,C),dx(Number(L).toFixed(2))))),t.createElement(xm,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:_,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:f.general.ctaBackgroundColor,ctaBorderColor:f.general.ctaBorderColor,ctaHoverBackgroundColor:f.general.ctaHoverBackgroundColor,ctaHoverTextColor:f.general.ctaHoverTextColor},borderRadius:f.general.ctaBorderRadius,disabled:!_&&N>=1,onClick:e=>{i||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},i?t.createElement(fa,{color:"white",loading:i,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!_?t.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:f.general.primaryColor}},"Add ",N," More Item(s)"):t.createElement(ym,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:f.general.ctaTextColor,ctaHoverTextColor:b??f.general.ctaHoverTextColor},f.byob.checkoutCTAText??"Checkout"))))},Tm={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"}}},Sm={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},$m=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&&Tm[e]?Tm[e]:{},r={...Sm,...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-byob-tracker-bar yt-bundle-builder-tracker-bar "+(n?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-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(Em,{...e,isMobile:n}))},Bm=Kt(void 0);function zm(e){return zm="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},zm(e)}function Im(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 Nm(e,t){return Nm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nm(e,t)}function Dm(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=_m(e);if(t){var o=_m(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===zm(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 _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_m(e)}var Pm=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&&Nm(e,t)}(o,h);var e,t,n,r=Dm(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&&Im(e.prototype,t),n&&Im(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),Am=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")},Om=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"}))},Fm=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"}))},Mm=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"}))},Rm=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"}))},Lm=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"}))},jm=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 Vm=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)}))}},Wm=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,s=e.enableZoom,d=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:Vm(n)},t.createElement(Mm,null)),s&&t.createElement("a",{onClick:a},o?t.createElement(Fm,null):t.createElement(Om,null)),d&&t.createElement("a",{onClick:i},t.createElement(jm,null)),t.createElement("a",{onClick:l},t.createElement(Rm,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Hm(e){return Hm="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},Hm(e)}function qm(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 Um(e,t){return Um=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Um(e,t)}function Gm(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=Ym(e);if(t){var o=Ym(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Hm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Qm(e)}(this,n)}}function Qm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ym(e){return Ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ym(e)}function Zm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xm=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&&Um(e,t)}(a,h);var e,n,r,o=Gm(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 Zm(Qm(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),Zm(Qm(e),"handleOnLoad",function(){e.setState({loading:!1})}),Zm(Qm(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(Lm,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&qm(e.prototype,n),r&&qm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Km(e){return Km="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},Km(e)}function Jm(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 ef(e,t){return ef=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ef(e,t)}function tf(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=rf(e);if(t){var o=rf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Km(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nf(e)}(this,n)}}function nf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rf(e){return rf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rf(e)}function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var af=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&&ef(e,t)}(a,h);var e,n,r,o=tf(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 of(nf(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),of(nf(e),"handleKeyDown",function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()}),of(nf(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}}}),of(nf(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}}})}}),of(nf(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}}})}}),of(nf(e),"handleMouseUpOrTouchEnd",function(t){e.setState({moveStart:void 0})}),of(nf(e),"toggleZoom",function(t){t.preventDefault(),e.setState(function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}})}),of(nf(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,s=n.showRotate,d=n.imageBackgroundColor,p=void 0===d?"black":d,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(Pm,{name:"__react_modal_image__lightbox",css:Am({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(Xm,{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(Xm,{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(Wm,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!s})))}}])&&Jm(e.prototype,n),r&&Jm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function lf(e){return lf="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},lf(e)}function cf(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 sf(e,t){return sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sf(e,t)}function df(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=uf(e);if(t){var o=uf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===lf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pf(e)}(this,n)}}function pf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uf(e){return uf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uf(e)}function mf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ff=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&&sf(e,t)}(a,h);var e,n,r,o=df(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 mf(pf(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),mf(pf(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,s=e.hideZoom,d=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(af,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:s,showRotate:d,imageBackgroundColor:p}))}}],n&&cf(e.prototype,n),r&&cf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const gf=x.div`
|
|
3322
|
+
`,km=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:s})=>t.createElement(t.Fragment,null,e.map((a,d)=>{const p=a.minimumQuantity-(r[d]?.length??0),u=o?.filter(e=>r[d]?.includes(e.variantId));return Math.min(r[d]?.length/a.minimumQuantity*100,100),t.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},t.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},t.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(e=>{const o=e.product.variants?.edges?.find(t=>t.node.id===e.variantId),a=r[d]?.filter(e=>e===o?.node.id).length||0;return i?t.createElement(wm,{className:"yt-byob-tracker-detailed-product-item",key:e.variantId},t.createElement(om,{className:"yt-byob-tracker-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?.isFree&&t.createElement("div",{style:{height:"16px",width:"16px",position:"absolute",top:6,left:6,borderRadius:"4px"}},t.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.666172 11.0473C0.666172 11.293 0.864635 11.4915 1.11029 11.4915H5.07956V6.27312H0.666172V11.0473ZM6.0233 11.4915H9.99257C10.2382 11.4915 10.4367 11.293 10.4367 11.0473V6.27312H6.0233V11.4915ZM10.6587 2.94226H8.61027C8.79902 2.64526 8.91005 2.29274 8.91005 1.91524C8.91005 0.859084 8.05096 0 6.9948 0C6.42023 0 5.90256 0.255366 5.55143 0.657844C5.2003 0.255366 4.68263 0 4.10806 0C3.0519 0 2.19282 0.859084 2.19282 1.91524C2.19282 2.29274 2.30246 2.64526 2.49259 2.94226H0.444114C0.198464 2.94226 0 3.14072 0 3.38637V5.32937H5.07956V2.94226H6.0233V5.32937H11.1029V3.38637C11.1029 3.14072 10.9044 2.94226 10.6587 2.94226ZM5.07956 2.88674H4.10806C3.57235 2.88674 3.13656 2.45096 3.13656 1.91524C3.13656 1.37953 3.57235 0.943743 4.10806 0.943743C4.64377 0.943743 5.07956 1.37953 5.07956 1.91524V2.88674ZM6.9948 2.88674H6.0233V1.91524C6.0233 1.37953 6.45909 0.943743 6.9948 0.943743C7.53052 0.943743 7.9663 1.37953 7.9663 1.91524C7.9663 2.45096 7.53052 2.88674 6.9948 2.88674Z",fill:"#4D4D4D"}))),e?.quantity>1&&t.createElement(tm,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},e.quantity,"x")),t.createElement(im,{className:"yt-byob-tracker-info-block"},t.createElement(lm,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(cm,{className:"yt-byob-tracker-product-price"},s,dx(o?.node?.price)),t.createElement(nm,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(e.variantId,d)},t.createElement(di,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(vm,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},e?.isFree&&t.createElement("div",{style:{height:"16px",width:"16px",position:"absolute",top:6,left:6,borderRadius:"4px"}},t.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.666172 11.0473C0.666172 11.293 0.864635 11.4915 1.11029 11.4915H5.07956V6.27312H0.666172V11.0473ZM6.0233 11.4915H9.99257C10.2382 11.4915 10.4367 11.293 10.4367 11.0473V6.27312H6.0233V11.4915ZM10.6587 2.94226H8.61027C8.79902 2.64526 8.91005 2.29274 8.91005 1.91524C8.91005 0.859084 8.05096 0 6.9948 0C6.42023 0 5.90256 0.255366 5.55143 0.657844C5.2003 0.255366 4.68263 0 4.10806 0C3.0519 0 2.19282 0.859084 2.19282 1.91524C2.19282 2.29274 2.30246 2.64526 2.49259 2.94226H0.444114C0.198464 2.94226 0 3.14072 0 3.38637V5.32937H5.07956V2.94226H6.0233V5.32937H11.1029V3.38637C11.1029 3.14072 10.9044 2.94226 10.6587 2.94226ZM5.07956 2.88674H4.10806C3.57235 2.88674 3.13656 2.45096 3.13656 1.91524C3.13656 1.37953 3.57235 0.943743 4.10806 0.943743C4.64377 0.943743 5.07956 1.37953 5.07956 1.91524V2.88674ZM6.9948 2.88674H6.0233V1.91524C6.0233 1.37953 6.45909 0.943743 6.9948 0.943743C7.53052 0.943743 7.9663 1.37953 7.9663 1.91524C7.9663 2.45096 7.53052 2.88674 6.9948 2.88674Z",fill:"#4D4D4D"}))),a>1&&t.createElement(tm,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},a,"x"),t.createElement(nm,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(e.variantId,d)},t.createElement(xt,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((e,r)=>t.createElement(dm,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:r},t.createElement(Co,{size:40,color:"#A0A0A0"}))))),d<e.length-1&&t.createElement(Cm,{className:"yt-byob-tracker-plus-icon-container"},t.createElement(Co,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),Em=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:o,showProductDetailsInTracker:a,loading:i,handleRemoveItem:s,percentageOff:d,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:f,dealAmount:g,isMobile:h=!1,themeColor:x,cornerRadiusType:y,primaryTextColorCta:b,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[k,E]=c(!1),[T,S]=c(0),[$,B]=c([]),[z,I]=c(0),[N,D]=c(0),[_,P]=c(!1),[A,O]=c(null);l(()=>console.log("selectedProductsByTier : ",w),[w]),l(()=>console.log("selectedProducts : ",o),[o]);const F=u?.price||0,M=e?.type,R=e=>{if(e<0||!$[e])return F;const t=$[e].discountValue??0;return d?F*(1-t/100):g?t:m?F-t:F};l(()=>{if(e&&"none"!==e.type)if("productTier"===M&&e.productTier){const t=e.productTier||[];B(t);let n=0;e.productTier.map(e=>{n+=e.minimumQuantity}),D(n-p)}else if($.length)z>0&&p<$[z-1]?.minimumQuantity?(I(z-1),O(z-1)):p<$[z]?.minimumQuantity&&O(z-1),S(R(z));else{const t=e.offerTier||[];B(t),I(0),D(t[0]?.minimumQuantity-p||r-p)}else B([]),D(r-p),I(0)},[e,r,p]),l(()=>{$.length&&"productTier"!=M?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===M)for(let r=0;r<$.length&&(n+=$[r].minimumQuantity,p>=n);r++)t=r,e=r+1<$.length?r+1:r;if(I(e),O(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),E(!0),S(R(t))}else P(!1),E(!1),S(F);const r=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;D(r)})():p===r?(E(!0),S(d?F*(1-d/100):g||(m?F-m:F)),P(!0)):(P(!1),E(!1))},[p,$]);const L=k?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=k?T.toFixed(2):u?.price?.toFixed(2),V=L&&j?(L-Number(j)).toFixed(2):0,W=e&&"none"!==M&&e.offerTier?"offerTier"===M?Math.min(p/(p+N)*100,100):void 0:p/r*100;l(()=>{if(k&&f.byob.enableConfetti){console.log("remainingItems",N);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,r=(t.top+t.height/2)/window.innerHeight;ao({particleCount:100,spread:70,origin:{x:n,y:r},zIndex:9999})}},[k,f]),z>=0&&z<$.length&&$[z].tier;const H="number"==typeof A?$[A]?.customText:void 0,q="string"==typeof H&&""!==H.trim();return t.createElement(Uu,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(h?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:h,style:{justifyContent:f.byob.selectedProductsVisibility&&!h?"space-between":"center"}},"offerTier"==M&&null!==A&&A>=0&&t.createElement(Gu,{className:"yt-byob-tracker-offer-tier-tag"},q?t.createElement(t.Fragment,null,H," unlocked"):t.createElement(t.Fragment,null,t.createElement(t.Fragment,null,"Buy"," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||g?t.createElement(t.Fragment,null," ",px(f.general.currencySymbol,C)):""," ",dx($[A]?.discountValue),d?t.createElement(t.Fragment,null,"% "):dx(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied"))),h&&N>=1&&!_&&"offerTier"!==M?t.createElement(Qu,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},"Select ",N," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==M&&t.createElement(Yu,{className:"yt-byob-tracker-tier-progress-container"},t.createElement(Zu,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==M&&$.length>0&&z>=0&&N>0&&t.createElement(t.Fragment,null,q?t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," more to unlock"," ",null!==A&&($[A+1]?.customText||$[A]?.customText||"")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+N," at",m||g?t.createElement(t.Fragment,null,px(f.general.currencySymbol,C)):""," ",dx($[z]?.discountValue),d?t.createElement(t.Fragment,null,"% "):dx(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):"")))),t.createElement(Xu,{className:"yt-byob-tracker-progress-bar-bg"},t.createElement(Ku,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:x??f?.general.primaryColor}," "))),f.byob.selectedProductsVisibility&&t.createElement(Ju,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(h?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:M??"",isMobile:h},"productTier"===M?t.createElement(km,{tiers:$,isMobile:h,selectedProductsByTier:w??{},selectedProducts:o,themeColor:f.general.primaryColor,showProductDetailsInTracker:a,handleRemoveItemProductTier:v,cornerRadius:f.byob.borderRadius,currencySymbol:px(f.general.currencySymbol,C)}):t.createElement(t.Fragment,null,o?.map?.(e=>{const n=e.product.variants?.edges?.find(t=>t.node.id===e.variantId);return a?t.createElement(rm,{className:"yt-byob-tracker-detailed-item-container",borderRadius:f.byob.borderRadius,key:e.variantId},t.createElement(om,{className:"yt-byob-tracker-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(am,{className:"yt-byob-tracker-badge"},e.quantity,"x")),t.createElement(im,{className:"yt-byob-tracker-info-block"},t.createElement(lm,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(cm,{className:"yt-byob-tracker-product-price"},f.general.currencySymbol,n?.node?.price),t.createElement(sm,{className:"yt-byob-tracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(di,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(bm,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:h,borderRadius:f.byob.borderRadius,imageUrl: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(tm,{className:"yt-byob-tracker-quantity-badge",borderRadius:f.byob.borderRadius},e.quantity,"x"),t.createElement(nm,{className:"yt-byob-tracker-remove-btn",onClick:()=>s(e.variantId)},t.createElement(xt,{fontSize:"12px"}))))}),N>=1&&[...Array(N)].map((e,n)=>t.createElement(dm,{className:"yt-byob-tracker-placeholder-box",isMobile:h,borderRadius:f.byob.borderRadius,key:n},t.createElement(Co,{size:40,color:"#A0A0A0"}))))),(!h||_)&&t.createElement(em,{className:"yt-byob-tracker-summary-container bundle-summary "+(h?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:h},Number(j)>0&&t.createElement(pm,{className:"yt-byob-tracker-summary-info summary-info"},t.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},h?t.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},t.createElement(um,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&t.createElement(mm,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",px(f.general.currencySymbol,C),dx(V))):t.createElement(t.Fragment,null,t.createElement(um,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!h&&t.createElement(mm,{className:"yt-byob-tracker-save-label"},"Save:"," ",px(f.general.currencySymbol,C),dx(V)))),t.createElement(fm,{className:"yt-byob-tracker-subtotal-row"},t.createElement(gm,{className:"yt-byob-tracker-final-price"},px(f.general.currencySymbol,C),Number(j)>=0?dx(Number(j).toFixed(2)):0),L&&f.byob.compareAtPriceVisibility&&Number(L)>Number(j)&&t.createElement(hm,{className:"yt-byob-tracker-line-through-price"},px(f.general.currencySymbol,C),dx(Number(L).toFixed(2))))),t.createElement(xm,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:_,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:f.general.ctaBackgroundColor,ctaBorderColor:f.general.ctaBorderColor,ctaHoverBackgroundColor:f.general.ctaHoverBackgroundColor,ctaHoverTextColor:f.general.ctaHoverTextColor},borderRadius:f.general.ctaBorderRadius,disabled:!_&&N>=1,onClick:e=>{i||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},i?t.createElement(fa,{color:"white",loading:i,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!_?t.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:f.general.primaryColor}},"Add ",N," More Item(s)"):t.createElement(ym,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:f.general.ctaTextColor,ctaHoverTextColor:b??f.general.ctaHoverTextColor},f.byob.checkoutCTAText??"Checkout"))))},Tm={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"}}},Sm={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},$m=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&&Tm[e]?Tm[e]:{},r={...Sm,...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-byob-tracker-bar yt-bundle-builder-tracker-bar "+(n?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-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(Em,{...e,isMobile:n}))},Bm=Kt(void 0);function zm(e){return zm="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},zm(e)}function Im(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 Nm(e,t){return Nm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nm(e,t)}function Dm(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=_m(e);if(t){var o=_m(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===zm(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 _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_m(e)}var Pm=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&&Nm(e,t)}(o,h);var e,t,n,r=Dm(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&&Im(e.prototype,t),n&&Im(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),Am=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")},Om=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"}))},Fm=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"}))},Mm=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"}))},Rm=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"}))},Lm=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"}))},jm=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 Vm=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)}))}},Wm=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,s=e.enableZoom,d=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:Vm(n)},t.createElement(Mm,null)),s&&t.createElement("a",{onClick:a},o?t.createElement(Fm,null):t.createElement(Om,null)),d&&t.createElement("a",{onClick:i},t.createElement(jm,null)),t.createElement("a",{onClick:l},t.createElement(Rm,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Hm(e){return Hm="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},Hm(e)}function qm(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 Um(e,t){return Um=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Um(e,t)}function Gm(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=Ym(e);if(t){var o=Ym(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Hm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Qm(e)}(this,n)}}function Qm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ym(e){return Ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ym(e)}function Zm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xm=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&&Um(e,t)}(a,h);var e,n,r,o=Gm(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 Zm(Qm(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),Zm(Qm(e),"handleOnLoad",function(){e.setState({loading:!1})}),Zm(Qm(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(Lm,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&qm(e.prototype,n),r&&qm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Km(e){return Km="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},Km(e)}function Jm(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 ef(e,t){return ef=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ef(e,t)}function tf(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=rf(e);if(t){var o=rf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Km(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nf(e)}(this,n)}}function nf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rf(e){return rf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rf(e)}function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var af=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&&ef(e,t)}(a,h);var e,n,r,o=tf(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 of(nf(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),of(nf(e),"handleKeyDown",function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()}),of(nf(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}}}),of(nf(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}}})}}),of(nf(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}}})}}),of(nf(e),"handleMouseUpOrTouchEnd",function(t){e.setState({moveStart:void 0})}),of(nf(e),"toggleZoom",function(t){t.preventDefault(),e.setState(function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}})}),of(nf(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,s=n.showRotate,d=n.imageBackgroundColor,p=void 0===d?"black":d,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(Pm,{name:"__react_modal_image__lightbox",css:Am({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(Xm,{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(Xm,{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(Wm,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!s})))}}])&&Jm(e.prototype,n),r&&Jm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function lf(e){return lf="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},lf(e)}function cf(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 sf(e,t){return sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sf(e,t)}function df(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=uf(e);if(t){var o=uf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===lf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pf(e)}(this,n)}}function pf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uf(e){return uf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uf(e)}function mf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ff=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&&sf(e,t)}(a,h);var e,n,r,o=df(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 mf(pf(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),mf(pf(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,s=e.hideZoom,d=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(af,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:s,showRotate:d,imageBackgroundColor:p}))}}],n&&cf(e.prototype,n),r&&cf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const gf=x.div`
|
|
3323
3323
|
position: absolute;
|
|
3324
3324
|
top: 0px;
|
|
3325
3325
|
right: 0px;
|
|
@@ -3538,7 +3538,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3538
3538
|
font-size: 1em;
|
|
3539
3539
|
justify-content: center;
|
|
3540
3540
|
align-items: center;
|
|
3541
|
-
`;const bf=n((e,n)=>{const[r,o]=un(Bm),a=i(()=>e=>e?r?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?1/0:0:1/0:0,[r?.tracksInventory]),s=r?.variants.edges?.filter(e=>a(e.node)>0)||[],[d,p]=c(s?.[0]?.node),[u,m]=c(0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=600),[h,x]=c(1),[y,b]=c("idle"),[w,C]=c(null),[k,E]=c(null);l(()=>{if(r){const e=r.variants.edges?.filter(e=>a(e.node)>0);p(r?.selectedVariant??e[0]?.node)}},[r,a]),l(()=>{const t=e.selectedProducts.find(e=>e.variantId===d?.id);x(t?t.quantity:0)},[h,e.selectedProducts,d]);const T=()=>{d?.id&&r&&(b("check"),e.handleAddToBundle(d?.id,r,1),setTimeout(()=>{b("idle"),o(void 0)},500))};if(l(()=>{const e=()=>g(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!r)return null;const{title:S,descriptionHtml:$,media:B,variants:z}=r,I=B.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0);l(()=>{if(r&&d?.image?.url&&Array.isArray(I)){const e=I.findIndex(e=>e?.url===d?.image?.url);-1!==e&&e!==u&&m(e)}},[d]);const N=e=>{const t=e.target.value,n=s?.find(e=>e.node.id===t)?.node;n&&a(n)>0&&p(n)};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 D=e=>{C(e.targetTouches[0].clientX),E(null)},_=e=>{E(e.targetTouches[0].clientX)},P=()=>{if(null!==w&&null!==k&&I.length>1){const e=w-k,t=50;e>t?m(e=>e<I.length-1?e+1:0):e<-t&&m(e=>e>0?e-1:I.length-1)}C(null),E(null)},A=e.hideAddToBundle||0===a(d)||e?.disableQuantitySelector&&h>=1||"idle"!==y,O=t.createElement(hf,{className:"yt-byob-modal-desktop-overlay"},t.createElement(xf,{$isSmallScreen:f,ref:n},t.createElement(yf,{ref:n,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},t.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement(gf,{className:"yt-byob-modal-desktop-close",onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(ft,{size:"25"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-image-swipe",onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(ff,{small:ux(I[u]?.url),medium:ux(I[u]?.url),large:ux(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-desktop-main-image main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},I.length>1&&I.filter(e=>e?.url.length>0).map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-desktop-gallery-thumb "+(u===r?"active":""),src:ux(n?.url),alt:n.altText||`${S} - Image ${r+1}`,onClick:()=>m(r),style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",{className:"yt-byob-modal-desktop-title"},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-desktop-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{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-byob-modal-desktop-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(fr,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-desktop-variant-selector"},t.createElement("div",{className:"yt-byob-modal-desktop-variant-label",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"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-desktop-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-desktop-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Bo,null)))),t.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},d?.compareAtPrice&&parseFloat(d.compareAtPrice)>parseFloat(d?.price)&&t.createElement("div",{className:"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-desktop-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.price)))),t.createElement("div",{className:"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:"80%"}},t.createElement("button",{className:"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:A?.5:1,cursor:A?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),T()},disabled:A},e.styles.byob.addToBundleCTAText??"Add to bundle")))),t.createElement("div",{className:"yt-byob-modal-desktop-divider",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-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:$}})))))),F=t.createElement(hf,{className:"yt-byob-modal-mobile-overlay"},t.createElement(xf,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:n},t.createElement(yf,{ref:n,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},t.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{o(void 0)}},t.createElement(zo,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},t.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-mobile-image-swipe",style:{position:"relative"},onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(ff,{small:ux(I[u]?.url),medium:ux(I[u]?.url),large:ux(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-mobile-main-image main-image",imageBackgroundColor:"#000"}),t.createElement("div",{className:"yt-byob-modal-mobile-image-indicators",style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},I.length>1&&I.map((e,n)=>t.createElement("span",{key:n,className:"yt-byob-modal-mobile-indicator "+(u===n?"active":""),style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}})))),t.createElement("div",{className:"yt-byob-modal-mobile-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},I.length>1&&I.map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-mobile-gallery-thumb "+(u===r?"active":""),src:ux(n?.url),alt:n.altText||`${S} - Image ${r+1}`,onClick:()=>m(r),style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:"120px"}},t.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-mobile-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{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-byob-modal-mobile-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(fr,{className:"yt-byob-modal-mobile-verified-icon",style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},t.createElement("span",null)),t.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:$}})))),t.createElement("div",{className:"yt-byob-modal-mobile-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}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-mobile-variant-selector"},t.createElement("div",{className:"yt-byob-modal-mobile-variant-label",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"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-mobile-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-mobile-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Bo,null)))),t.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-mobile-price",style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},d?.compareAtPrice&&t.createElement("div",{className:"yt-byob-modal-mobile-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-mobile-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.price)))),!e.hideAddToBundle&&a(d)>0&&(!e?.disableQuantitySelector||h<1)&&t.createElement("div",{className:"yt-byob-modal-mobile-atc-wrapper",style:{width:"100%"}},t.createElement("button",{className:"yt-byob-modal-mobile-atc-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"},onClick:e=>{e.stopPropagation(),e.preventDefault(),T()},disabled:"idle"!==y},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(f?F:O,document.body)}),vf=({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};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):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);return"image"===o?t.createElement("img",{src:Hn(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))})),wf=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:s})=>{const d=i(()=>t=>t?e?.tracksInventory&&t?.inventoryItem?.tracked?t.inventoryQuantity>0?t?.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0,[e?.tracksInventory]),p=i(()=>{const t=e.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map(e=>e.values[0])||[]},[e,d]),[u,m]=c(p),[f,g]=c(window.innerWidth<1024);l(()=>{const e=()=>g(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 h=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,x=h?.image?.url||e.featuredMedia?.preview?.image?.url,y=Hn(x,150,85,"webp"),b=e=>{if(!o?.options)return"text";const t=o.options.find(t=>t.name===e);return t?.type||"text"},w=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}})},C=(e,t)=>{const n=u[t];if(!n)return null;return w(e).find(e=>e.name===n)||null};if(!n)return null;const k=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"},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"}}},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"}},t.createElement("img",{src:y,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},e.title))),t.createElement("div",{style:{padding:"20px"}},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}},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(n,r)?.name||n.values[0])),t.createElement(vf,{options:w(n),selectedValue:C(n,r),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(r,e)},type:b(n.name),isOptionAvailable:t=>((t,n)=>{const r=[...u];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&&d(a)>0})(r,t),isMobile:f}))))),t.createElement("button",{onClick:()=>{const t=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,n=!!t&&d(t)>0;if(t?.id&&n)s(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const t=e.variants.edges.find(e=>d(e.node)>0)?.node.id;t&&(s(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(k,document.body)},Cf=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map(({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""}).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",s=i(c,800)||c,d=[];if(n&&n!==e){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(d.length>0?d.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},d,t.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function kf({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=e<s;return t.createElement(Au,{className:"yt-byob-quantity-selector-container"},t.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:d},"-"),t.createElement(Ou,{className:"yt-byob-quantity-display"},e," added"),t.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1,s);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const Ef=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),s=i(()=>ux(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||"",[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),d=i(()=>e?.media?.edges?.map(e=>ux(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[e?.media?.edges]),p=i(()=>d?.[1]??s??"",[d,s]);l(()=>{if(s){(new Image).src=s}},[s]);const u=i(()=>s||d?.[0],[s,d]);return t.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:u,alt:e.title}),u!==p&&t.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",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,objectPosition:"top"},src:p,alt:e.title})))},Tf=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:i,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:f})=>{const g=pn(Bm),h=n.customizations,x=h?.byob?.variantSelectorType,[y,b]=c(!1),v=h.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(!v||!v.length)return t.createElement(t.Fragment,null);const w=a(t=>{const n=f?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=v?.find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0},[v,f,e.tracksInventory]),C=v?.find(e=>w(e.node.id)>0)?.node?.id;if(!C&&!h.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[k,E]=c(v?.find(e=>w(e.node.id)>0)?.node?.id||v[0]?.node?.id),[T,S]=c(0),[$,B]=c(window.innerWidth<450),[z,I]=c("normal"),N=v?.find(e=>e?.node?.id===k)?.node,D=w(k||"");l(()=>{const e=m.find(e=>e.variantId===k);S(e?e.quantity:0)},[T,m,k]),l(()=>{const e=()=>{B(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{CSS.supports("font-weight","500")?I("500"):CSS.supports("font-weight","400")?I("400"):CSS.supports("font-weight","600")&&I("600")},[]),l(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",z)},[z]),l(()=>{if(k&&!v?.some(e=>e.node.id===k)){const e=v.find(e=>w(e.node.id)>0)?.node.id||v[0]?.node?.id;e&&E(e)}},[k,v,w]);const _=e.variants&&e.variants.edges?.length>1&&"customOptions"!==x,P="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,A="53933408435"===P,O="75851235630"===P,F=(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=F.length>0;return t.createElement(t.Fragment,null,t.createElement(Ru,{borderRadius:h?.byob.borderRadius,borderColor:h?.byob.borderColor,shadowType:h?.byob.shadowType,backgroundColor:h?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(D<=0)return;const t={...e,variants:{...e.variants,edges:v},selectedVariant:N};g(t)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent"}},t.createElement(Lu,{className:"yt-byob-image-wrapper"},t.createElement(Ef,{product:e,styles:h,selectedVariant:N}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:h.byob.borderRadius}},n.productCardBadgeText),_&&t.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},t.createElement(ju,{className:"yt-byob-variant-selector",isCoralHaze:A,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:k||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),E(e.target.value)}},v?.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-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(R,null)))),t.createElement("div",{className:"yt-byob-product-content"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&M&&t.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},F.slice(0,2).map((e,n)=>t.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:$?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1))),F.length>2&&t.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",F.length-2," more"))),t.createElement(Vu,{isMobile:$,showBorder:n?.showBorder??!0,style:{...!h?.byob.productsPriceVisibility&&{padding:"8px"},...h?.byob.productTitleFontSize&&{fontSize:h?.byob.productTitleFontSize}},className:"yt-byob-product-title-wrapper"},t.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},O?String(N?.displayName).replace("- Default Title",""):e.title,N?.commonSuffix?" -"+N?.commonSuffix:""))),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(fr,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),h?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(N?.price??"0")>0?t.createElement("span",{className:"yt-byob-current-price"},px(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",dx(N?.price)):t.createElement("span",{className:"yt-byob-free-price"},"Free"),N?.compareAtPrice&&h?.byob.compareAtPriceVisibility&&parseFloat(N.compareAtPrice)>parseFloat(N?.price)&&t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},px(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",dx(N.compareAtPrice))),(D>0||D===1/0)&&t.createElement(Wu,{borderRadius:h?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===T||void 0===T)&&t.createElement(Fu,{style:{...!o&&{backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),S(1),(()=>{if(!k)return;"customOptions"===x&&v.length>1?b(!0):r(k,e,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},h?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&T>0&&k&&t.createElement(Mu,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},t.createElement(kf,{remainingQuantity:i,setQuantity:S,quantity:T,handleAddToBundle:r,variantId:k,product:e,handleRemoveItem:d,hideAddToBundle:o,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&T>0&&k&&t.createElement(Fu,{style:{backgroundColor:"#747474",color:h?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},t.createElement(Hu,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),t.createElement(qu,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,T-1);S(t),d&&k&&d(k,1)}},t.createElement(Eo,{style:{color:"#fff",fontSize:"20px"}})))),D<=0&&D!==1/0&&t.createElement(Fu,{style:{backgroundColor:h.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},h?.general.outOfStockLabel||"Out of Stock")),"customOptions"===x&&y&&v.length>1&&t.createElement(wf,{product:e,isOpen:y,onClose:()=>b(!1),variantOptions:n.variantOptions,cta:{textColor:h.general.ctaTextColor,backgroundColor:h.general.primaryColor},onConfirm:t=>{E(t),r(t,e,1)}}))},Sf=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>t.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((c,d)=>{const p=d+1,u=o[d].minimumQuantity-(i[d]?.length??0)===0,m=d===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},t.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{className:"yt-byob-stepper-step-circle",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-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),t.createElement("div",{className:"yt-byob-stepper-title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),$f=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,s]=c(!1),[d,p]=c(r);return l(()=>{const e=setTimeout(()=>{n(d)},300);return()=>clearTimeout(e)},[d,n]),t.createElement("div",{className:"yt-byob-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",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",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(ko,{className:"yt-byob-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>s(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-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:d,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(ko,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>s(!1)},"✖")),t.createElement("div",{className:"yt-byob-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",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-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)")))))},Bf=({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",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},t.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...r].map(r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?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",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},t.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?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)))))},zf=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:s,renderingOnPage:d,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal: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,$]=c([]),[B,z]=c(!1),[I,N]=c("All"),[D,_]=c(0),P=o(null);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)))}}),$(Array.from(t)),z(n)},[e.products]);const A=((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?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status),I),O="productTier"===C?E.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===C?T.reduce((e,t)=>e+t.minimumQuantity,0):e.minimumQuantity,[F,M]=c(""),[R,L]=c(""),j=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(A,F),V=((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}}))(j,R),W=((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"),s=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-s;case"price-high-to-low":return s-c;default:return 0}}))(E,V,F,R,y),[H,q]=un(Bm),[U,G]=c(!1),Q="productTier"===C?W:V,Y=Q.slice(0,20*(D+1));l(()=>{setTimeout(()=>{G(!0)},100)},[]);const Z=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=ux(e.coverImageUrl)??"",t.onload=()=>{g(t.width/t.height)}}},[e.coverImageUrl]),l(()=>{G(!1),setTimeout(()=>G(!0),100)},[y]);const X=(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)}u(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(O===p)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(()=>{M("")},[y]),l(()=>{function e(e){if(!Z.current||!e.target)return;!Z.current.contains(e.target)&&q(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const K=(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})),mx(e,t,o,n,r)},J=(()=>{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})(),ee=h&&e.mobileCoverImageUrl?ux(e.mobileCoverImageUrl):ux(e.coverImageUrl??"")||null,te=e.customStoreDetails?.fixedInventoryDetails,ne=a((e,t)=>{const n=te?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0},[te]),re=a(e=>{const t=k?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,r=n?.variants?.edges||[];if(te){if(r.some(e=>te.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>ne(n,e.node.id)>0)},[k?.general?.showOutOfStockProducts,te,ne]),oe="bundles"==e.appName?e.pageHeader?.title:e?.title,ae="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l(()=>{_(0)},[F,R,I,y]);const ie=a(()=>{Y.length<Q.length&&_(e=>e+1)},[Y.length,Q.length]);return l(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&ie()},{threshold:.1});return P.current&&e.observe(P.current),()=>{P.current&&e.unobserve(P.current)}},[ie]),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"}}},ee?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}}},ee&&t.createElement(Cf,{coverImageUrl:ee,alt:"Background",styles:{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)"}},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"},oe),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},ae))):(oe||ae)&&t.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},oe&&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"}},oe),ae&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"}},ae)),t.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(Sf,{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"}},e?.enableSortAndFilter&&t.createElement($f,{isMobile:h,searchTerm:F,setSearchTerm:M,setSortBy:L,styles:k}),e?.customizations?.byob?.enableProductCategories&&B&&t.createElement("div",null,t.createElement(Bf,{styles:k,isMobile:h,categories:S,activeCategory:I,onCategoryChange:e=>{N(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display"},0===Q?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===C&&E.length>0?Y.filter(e=>re(V.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=V.find(e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0])));return i?t.createElement(Tf,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:K,hideAddToBundle:!a,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>X(e,y),selecteditems:n,transitionActive:U,customVariantsQuantity:te}):null}):Y.filter(re).map((r,o)=>t.createElement(Tf,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:K,hideAddToBundle:p>=J,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:U,customVariantsQuantity:te})),Y.length<Q.length&&t.createElement("div",{ref:P,style:{height:"1px",width:"100%",display:"block"}})),!d&&t.createElement($m,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:O,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:X,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:s,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d})),d&&t.createElement($m,{handleAddToCart:i,minimumQuantity:O,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:s,handleRemoveItem:u,handleRemoveItemProductTier:X,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{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}),H&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=p<T.reduce((e,t)=>e+t.minimumQuantity,0)),t.createElement(bf,{handleAddToBundle:K,ref:Z,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,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"})})())},If=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:s,storeCurrencyCode:d})=>{const p=i(()=>t=>{const n=e?.productDetails?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e.productDetails]),u=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;p(n);const m=i(()=>{if(u?.title&&e.productDetails.options){const t=u.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map(e=>e.values[0])||[]},[u,e.productDetails.options]),f=e=>{r(e)};return c?t.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},t.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:ux(u?.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",{className:"yt-comboBundle-product-variant-selector-container-vertical",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",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},e?.productDetails?.variants?.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},px(o.general.currencySymbol,d),dx((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-vertical",style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},px(o.general.currencySymbol,d),dx(u?.compareAtPrice?u?.compareAtPrice:u?.price))))):t.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===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",{className:"yt-comboBundle-product-image-wrapper-horizontal"},t.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:ux(u?.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",{className:"yt-comboBundle-product-info-horizontal",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",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",e?.productDetails?.title," "),"dropdown"!==o.comboBundle.comboVariantTypeSelector&&e.productDetails.variants.edges.length>1&&s&&m&&t.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},m.length>1?m.join(" / "):m)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},px(o.general.currencySymbol,d),dx((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},px(o.general.currencySymbol,d),dx(u?.compareAtPrice?u?.compareAtPrice:u?.price))),e.productDetails.variants.edges.length>1&&("dropdown"===o.comboBundle.comboVariantTypeSelector?t.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},e.productDetails.variants.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null))):e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map((n,r)=>t.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&n?.values?.length>1&&t.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(a=>{const i=[...m];i[r]=a;const l=e.productDetails.options.length>0?i.join(" / "):i[r],c=e.productDetails.variants.edges.find(e=>e.node.title===l)?.node,d=0===(c?p(c.id):0),u=m[r]===a,g=s&&s?.options?.find(e=>e.name===n.name);return g&&"color"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-color ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:d?.5:1,cursor:d?"not-allowed":"pointer"}},g?.values.find(e=>e.name===a)?.value?t.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",borderRadius:"50%",backgroundColor:g?.values.find(e=>e.name===a)?.value}},t.createElement("span",null)):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):g&&"image"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-image ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u&&!d?"#F7F7F7":"transparent",cursor:d?"not-allowed":"pointer",padding:"0px",width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",overflow:"hidden",opacity:d?.5:1}},g?.values.find(e=>e.name===a)?.value?t.createElement("img",{className:"yt-comboBundle-product-option-image",src:ux(g?.values.find(e=>e.name===a)?.value||"/placeholder.svg"),alt:a,style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-text ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",cursor:d?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:d?.5:1}},a)}))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map(e=>{const r=0===p(e?.node?.id);return t.createElement("button",{key:e?.node?.id,className:`yt-comboBundle-product-variant-button ${n===e?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>f(e?.node?.id),disabled:r,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:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},e?.node?.title)}))))))},Nf=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786);l(()=>(n&&(window.ytComboBundle={bundle:e,addToCart:n},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[e,n]);const d=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[p,u]=c(()=>{const t={};return e.products.forEach((e,n)=>{const r=e.productDetails?.variants?.edges?.find(t=>d(e.productDetails,t?.node?.id)>0)?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id}),t}),m=e.products?.every((e,t)=>{const n=p[t];return d(e.productDetails,n)>0}),f=(e,t)=>{u(n=>({...n,[e]:t}))},{originalPrice:g,dealPrice:h,offerValue:x}=i(()=>{const{price:t,compareAtPrice:n}=Object.entries(p).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)}},[p,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l(()=>{const e=()=>{s(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",{className:`yt-comboBundle-bundle-container ${"left"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,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",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{className:"yt-comboBundle-bundle-title",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",{className:"yt-comboBundle-bundle-price-container",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",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},px(y.general.currencySymbol,e.storeCurrencyCode),dx(h)),t.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},px(y.general.currencySymbol,e.storeCurrencyCode),dx(g)),t.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${px(y.general.currencySymbol,e.storeCurrencyCode)}${dx(e?.amountOff)} Off`:`Save ${px(y.general.currencySymbol,e.storeCurrencyCode)}${dx(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",{className:"yt-comboBundle-products-grid-vertical "+(a?"yt-comboBundle-products-grid-mobile":""),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===p[r])?.node;return o?t.createElement(If,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null})):t.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(a?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map((n,r)=>t.createElement(If,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions})))),t.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${m?"":"yt-comboBundle-bundle-cta-button-disabled"} ${a?"yt-comboBundle-bundle-cta-button-mobile":""}`,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 console.error("[ComboBundle.tsx] No addToCartFunction available"),void o(!1);const t=Object.entries(p).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(p);await n(Number(g),r,Number(h),t)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}o(!1)}},r?t.createElement(fa,{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",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},t.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{className:"yt-comboBundle-bundle-description-content",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))))},Df=x.div`
|
|
3541
|
+
`;const bf=n((e,n)=>{const[r,o]=un(Bm),a=i(()=>e=>e?r?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?1/0:0:1/0:0,[r?.tracksInventory]),s=r?.variants.edges?.filter(e=>a(e.node)>0)||[],[d,p]=c(s?.[0]?.node),[u,m]=c(0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=600),[h,x]=c(1),[y,b]=c("idle"),[w,C]=c(null),[k,E]=c(null);l(()=>{if(r){const e=r.variants.edges?.filter(e=>a(e.node)>0);p(r?.selectedVariant??e[0]?.node)}},[r,a]),l(()=>{const t=e.selectedProducts.find(e=>e.variantId===d?.id);x(t?t.quantity:0)},[h,e.selectedProducts,d]);const T=()=>{d?.id&&r&&(b("check"),e.handleAddToBundle(d?.id,r,1),setTimeout(()=>{b("idle"),o(void 0)},500))};if(l(()=>{const e=()=>g(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!r)return null;const{title:S,descriptionHtml:$,media:B,variants:z}=r,I=B.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0);l(()=>{if(r&&d?.image?.url&&Array.isArray(I)){const e=I.findIndex(e=>e?.url===d?.image?.url);-1!==e&&e!==u&&m(e)}},[d]);const N=e=>{const t=e.target.value,n=s?.find(e=>e.node.id===t)?.node;n&&a(n)>0&&p(n)};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 D=e=>{C(e.targetTouches[0].clientX),E(null)},_=e=>{E(e.targetTouches[0].clientX)},P=()=>{if(null!==w&&null!==k&&I.length>1){const e=w-k,t=50;e>t?m(e=>e<I.length-1?e+1:0):e<-t&&m(e=>e>0?e-1:I.length-1)}C(null),E(null)},A=e.hideAddToBundle||0===a(d)||e?.disableQuantitySelector&&h>=1||"idle"!==y,O=t.createElement(hf,{className:"yt-byob-modal-desktop-overlay"},t.createElement(xf,{$isSmallScreen:f,ref:n},t.createElement(yf,{ref:n,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},t.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement(gf,{className:"yt-byob-modal-desktop-close",onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(ft,{size:"25"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-image-swipe",onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(ff,{small:ux(I[u]?.url),medium:ux(I[u]?.url),large:ux(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-desktop-main-image main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},I.length>1&&I.filter(e=>e?.url.length>0).map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-desktop-gallery-thumb "+(u===r?"active":""),src:ux(n?.url),alt:n.altText||`${S} - Image ${r+1}`,onClick:()=>m(r),style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",{className:"yt-byob-modal-desktop-title"},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-desktop-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{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-byob-modal-desktop-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(fr,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-desktop-variant-selector"},t.createElement("div",{className:"yt-byob-modal-desktop-variant-label",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"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-desktop-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-desktop-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Bo,null)))),t.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},d?.compareAtPrice&&parseFloat(d.compareAtPrice)>parseFloat(d?.price)&&t.createElement("div",{className:"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-desktop-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.price)))),t.createElement("div",{className:"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:"80%"}},t.createElement("button",{className:"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:A?.5:1,cursor:A?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),T()},disabled:A},e.styles.byob.addToBundleCTAText??"Add to bundle")))),t.createElement("div",{className:"yt-byob-modal-desktop-divider",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-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:$}})))))),F=t.createElement(hf,{className:"yt-byob-modal-mobile-overlay"},t.createElement(xf,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:n},t.createElement(yf,{ref:n,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},t.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{o(void 0)}},t.createElement(zo,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},t.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-mobile-image-swipe",style:{position:"relative"},onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(ff,{small:ux(I[u]?.url),medium:ux(I[u]?.url),large:ux(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-mobile-main-image main-image",imageBackgroundColor:"#000"}),t.createElement("div",{className:"yt-byob-modal-mobile-image-indicators",style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},I.length>1&&I.map((e,n)=>t.createElement("span",{key:n,className:"yt-byob-modal-mobile-indicator "+(u===n?"active":""),style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}})))),t.createElement("div",{className:"yt-byob-modal-mobile-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},I.length>1&&I.map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-mobile-gallery-thumb "+(u===r?"active":""),src:ux(n?.url),alt:n.altText||`${S} - Image ${r+1}`,onClick:()=>m(r),style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:"120px"}},t.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-mobile-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{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-byob-modal-mobile-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(fr,{className:"yt-byob-modal-mobile-verified-icon",style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},t.createElement("span",null)),t.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:$}})))),t.createElement("div",{className:"yt-byob-modal-mobile-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}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-mobile-variant-selector"},t.createElement("div",{className:"yt-byob-modal-mobile-variant-label",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"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-mobile-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-mobile-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Bo,null)))),t.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-mobile-price",style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},d?.compareAtPrice&&t.createElement("div",{className:"yt-byob-modal-mobile-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-mobile-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},px(e.styles.general.currencySymbol,e.styles.general.currencySymbol),dx(d?.price)))),!e.hideAddToBundle&&a(d)>0&&(!e?.disableQuantitySelector||h<1)&&t.createElement("div",{className:"yt-byob-modal-mobile-atc-wrapper",style:{width:"100%"}},t.createElement("button",{className:"yt-byob-modal-mobile-atc-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"},onClick:e=>{e.stopPropagation(),e.preventDefault(),T()},disabled:"idle"!==y},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(f?F:O,document.body)}),vf=({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};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):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);return"image"===o?t.createElement("img",{src:Hn(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))})),wf=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:s})=>{const d=i(()=>t=>t?e?.tracksInventory&&t?.inventoryItem?.tracked?t.inventoryQuantity>0?t?.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0,[e?.tracksInventory]),p=i(()=>{const t=e.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map(e=>e.values[0])||[]},[e,d]),[u,m]=c(p),[f,g]=c(window.innerWidth<1024);l(()=>{const e=()=>g(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 h=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,x=h?.image?.url||e.featuredMedia?.preview?.image?.url,y=Hn(x,150,85,"webp"),b=e=>{if(!o?.options)return"text";const t=o.options.find(t=>t.name===e);return t?.type||"text"},w=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}})},C=(e,t)=>{const n=u[t];if(!n)return null;return w(e).find(e=>e.name===n)||null};if(!n)return null;const k=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"},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"}}},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"}},t.createElement("img",{src:y,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},e.title))),t.createElement("div",{style:{padding:"20px"}},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}},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(n,r)?.name||n.values[0])),t.createElement(vf,{options:w(n),selectedValue:C(n,r),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(r,e)},type:b(n.name),isOptionAvailable:t=>((t,n)=>{const r=[...u];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&&d(a)>0})(r,t),isMobile:f}))))),t.createElement("button",{onClick:()=>{const t=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,n=!!t&&d(t)>0;if(t?.id&&n)s(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const t=e.variants.edges.find(e=>d(e.node)>0)?.node.id;t&&(s(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(k,document.body)},Cf=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map(({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""}).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",s=i(c,800)||c,d=[];if(n&&n!==e){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(d.length>0?d.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},d,t.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function kf({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=e<s;return t.createElement(Au,{className:"yt-byob-quantity-selector-container"},t.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:d},"-"),t.createElement(Ou,{className:"yt-byob-quantity-display"},e," added"),t.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1,s);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const Ef=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),s=i(()=>ux(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||"",[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),d=i(()=>e?.media?.edges?.map(e=>ux(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[e?.media?.edges]),p=i(()=>d?.[1]??s??"",[d,s]);l(()=>{if(s){(new Image).src=s}},[s]);const u=i(()=>s||d?.[0],[s,d]);return t.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:u,alt:e.title}),u!==p&&t.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",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,objectPosition:"top"},src:p,alt:e.title})))},Tf=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:i,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:f})=>{const g=pn(Bm),h=n.customizations,x=h?.byob?.variantSelectorType,[y,b]=c(!1),v=h.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(!v||!v.length)return t.createElement(t.Fragment,null);const w=a(t=>{const n=f?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=v?.find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0},[v,f,e.tracksInventory]),C=v?.find(e=>w(e.node.id)>0)?.node?.id;if(!C&&!h.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[k,E]=c(v?.find(e=>w(e.node.id)>0)?.node?.id||v[0]?.node?.id),[T,S]=c(0),[$,B]=c(window.innerWidth<450),[z,I]=c("normal"),N=v?.find(e=>e?.node?.id===k)?.node,D=w(k||"");l(()=>{const e=m.find(e=>e.variantId===k);S(e?e.quantity:0)},[T,m,k]),l(()=>{const e=()=>{B(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{CSS.supports("font-weight","500")?I("500"):CSS.supports("font-weight","400")?I("400"):CSS.supports("font-weight","600")&&I("600")},[]),l(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",z)},[z]),l(()=>{if(k&&!v?.some(e=>e.node.id===k)){const e=v.find(e=>w(e.node.id)>0)?.node.id||v[0]?.node?.id;e&&E(e)}},[k,v,w]);const _=e.variants&&e.variants.edges?.length>1&&"customOptions"!==x,P="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,A="53933408435"===P,O="75851235630"===P,F=(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=F.length>0;return t.createElement(t.Fragment,null,t.createElement(Ru,{borderRadius:h?.byob.borderRadius,borderColor:h?.byob.borderColor,shadowType:h?.byob.shadowType,backgroundColor:h?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(D<=0)return;const t={...e,variants:{...e.variants,edges:v},selectedVariant:N};g(t)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent"}},t.createElement(Lu,{className:"yt-byob-image-wrapper"},t.createElement(Ef,{product:e,styles:h,selectedVariant:N}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:h.byob.borderRadius}},n.productCardBadgeText),_&&t.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},t.createElement(ju,{className:"yt-byob-variant-selector",isCoralHaze:A,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:k||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),E(e.target.value)}},v?.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-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(R,null)))),t.createElement("div",{className:"yt-byob-product-content"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&M&&t.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},F.slice(0,2).map((e,n)=>t.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:$?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1))),F.length>2&&t.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",F.length-2," more"))),t.createElement(Vu,{isMobile:$,showBorder:n?.showBorder??!0,style:{...!h?.byob.productsPriceVisibility&&{padding:"8px"},...h?.byob.productTitleFontSize&&{fontSize:h?.byob.productTitleFontSize}},className:"yt-byob-product-title-wrapper"},t.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},O?String(N?.displayName).replace("- Default Title",""):e.title,N?.commonSuffix?" -"+N?.commonSuffix:""))),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(uo,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(fr,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),h?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(N?.price??"0")>0?t.createElement("span",{className:"yt-byob-current-price"},px(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",dx(N?.price)):t.createElement("span",{className:"yt-byob-free-price"},"Free"),N?.compareAtPrice&&h?.byob.compareAtPriceVisibility&&parseFloat(N.compareAtPrice)>parseFloat(N?.price)&&t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},px(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",dx(N.compareAtPrice))),(D>0||D===1/0)&&t.createElement(Wu,{borderRadius:h?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===T||void 0===T)&&t.createElement(Fu,{style:{...!o&&{backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),S(1),(()=>{if(!k)return;"customOptions"===x&&v.length>1?b(!0):r(k,e,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},h?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&T>0&&k&&t.createElement(Mu,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},t.createElement(kf,{remainingQuantity:i,setQuantity:S,quantity:T,handleAddToBundle:r,variantId:k,product:e,handleRemoveItem:d,hideAddToBundle:o,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&T>0&&k&&t.createElement(Fu,{style:{backgroundColor:"#747474",color:h?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},t.createElement(Hu,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),t.createElement(qu,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,T-1);S(t),d&&k&&d(k,1)}},t.createElement(Eo,{style:{color:"#fff",fontSize:"20px"}})))),D<=0&&D!==1/0&&t.createElement(Fu,{style:{backgroundColor:h.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},h?.general.outOfStockLabel||"Out of Stock")),"customOptions"===x&&y&&v.length>1&&t.createElement(wf,{product:e,isOpen:y,onClose:()=>b(!1),variantOptions:n.variantOptions,cta:{textColor:h.general.ctaTextColor,backgroundColor:h.general.primaryColor},onConfirm:t=>{E(t),r(t,e,1)}}))},Sf=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>t.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((c,d)=>{const p=d+1,u=o[d].minimumQuantity-(i[d]?.length??0)===0,m=d===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},t.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{className:"yt-byob-stepper-step-circle",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-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),t.createElement("div",{className:"yt-byob-stepper-title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),$f=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,s]=c(!1),[d,p]=c(r);return l(()=>{const e=setTimeout(()=>{n(d)},300);return()=>clearTimeout(e)},[d,n]),t.createElement("div",{className:"yt-byob-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",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",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(ko,{className:"yt-byob-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>s(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-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:d,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(ko,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>s(!1)},"✖")),t.createElement("div",{className:"yt-byob-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",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-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)")))))},Bf=({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",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},t.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...r].map(r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?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",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},t.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?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)))))},zf=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:s,renderingOnPage:d,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal: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,$]=c([]),[B,z]=c(!1),[I,N]=c("All"),[D,_]=c(0),P=o(null);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)))}}),$(Array.from(t)),z(n)},[e.products]);const A=((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?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status),I),O="productTier"===C?E.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===C?T.reduce((e,t)=>e+t.minimumQuantity,0):e.minimumQuantity,[F,M]=c(""),[R,L]=c(""),j=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(A,F),V=((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}}))(j,R),W=((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"),s=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-s;case"price-high-to-low":return s-c;default:return 0}}))(E,V,F,R,y),[H,q]=un(Bm),[U,G]=c(!1),Q="productTier"===C?W:V,Y=Q.slice(0,20*(D+1));l(()=>{setTimeout(()=>{G(!0)},100)},[]);const Z=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=ux(e.coverImageUrl)??"",t.onload=()=>{g(t.width/t.height)}}},[e.coverImageUrl]),l(()=>{G(!1),setTimeout(()=>G(!0),100)},[y]);const X=(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)}u(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(O===p)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(()=>{M("")},[y]),l(()=>{function e(e){if(!Z.current||!e.target)return;!Z.current.contains(e.target)&&q(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const K=(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}));const i=!0===E[y]?.isFreebieTier;mx(e,t,o,n,r,i)},J=(()=>{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})(),ee=h&&e.mobileCoverImageUrl?ux(e.mobileCoverImageUrl):ux(e.coverImageUrl??"")||null,te=e.customStoreDetails?.fixedInventoryDetails,ne=a((e,t)=>{const n=te?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0},[te]),re=a(e=>{const t=k?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,r=n?.variants?.edges||[];if(te){if(r.some(e=>te.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>ne(n,e.node.id)>0)},[k?.general?.showOutOfStockProducts,te,ne]),oe="bundles"==e.appName?e.pageHeader?.title:e?.title,ae="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l(()=>{_(0)},[F,R,I,y]);const ie=a(()=>{Y.length<Q.length&&_(e=>e+1)},[Y.length,Q.length]);return l(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&ie()},{threshold:.1});return P.current&&e.observe(P.current),()=>{P.current&&e.unobserve(P.current)}},[ie]),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"}}},ee?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}}},ee&&t.createElement(Cf,{coverImageUrl:ee,alt:"Background",styles:{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)"}},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"},oe),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},ae))):(oe||ae)&&t.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},oe&&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"}},oe),ae&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"}},ae)),t.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(Sf,{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"}},e?.enableSortAndFilter&&t.createElement($f,{isMobile:h,searchTerm:F,setSearchTerm:M,setSortBy:L,styles:k}),e?.customizations?.byob?.enableProductCategories&&B&&t.createElement("div",null,t.createElement(Bf,{styles:k,isMobile:h,categories:S,activeCategory:I,onCategoryChange:e=>{N(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display"},0===Q?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===C&&E.length>0?Y.filter(e=>re(V.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=V.find(e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0])));return i?t.createElement(Tf,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:K,hideAddToBundle:!a,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>X(e,y),selecteditems:n,transitionActive:U,customVariantsQuantity:te}):null}):Y.filter(re).map((r,o)=>t.createElement(Tf,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:K,hideAddToBundle:p>=J,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:U,customVariantsQuantity:te})),Y.length<Q.length&&t.createElement("div",{ref:P,style:{height:"1px",width:"100%",display:"block"}})),!d&&t.createElement($m,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:O,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:X,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:s,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d})),d&&t.createElement($m,{handleAddToCart:i,minimumQuantity:O,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:s,handleRemoveItem:u,handleRemoveItemProductTier:X,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{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}),H&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=p<T.reduce((e,t)=>e+t.minimumQuantity,0)),t.createElement(bf,{handleAddToBundle:K,ref:Z,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,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"})})())},If=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:s,storeCurrencyCode:d})=>{const p=i(()=>t=>{const n=e?.productDetails?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e.productDetails]),u=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;p(n);const m=i(()=>{if(u?.title&&e.productDetails.options){const t=u.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map(e=>e.values[0])||[]},[u,e.productDetails.options]),f=e=>{r(e)};return c?t.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},t.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:ux(u?.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",{className:"yt-comboBundle-product-variant-selector-container-vertical",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",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},e?.productDetails?.variants?.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},px(o.general.currencySymbol,d),dx((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-vertical",style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},px(o.general.currencySymbol,d),dx(u?.compareAtPrice?u?.compareAtPrice:u?.price))))):t.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===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",{className:"yt-comboBundle-product-image-wrapper-horizontal"},t.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:ux(u?.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",{className:"yt-comboBundle-product-info-horizontal",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",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",e?.productDetails?.title," "),"dropdown"!==o.comboBundle.comboVariantTypeSelector&&e.productDetails.variants.edges.length>1&&s&&m&&t.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},m.length>1?m.join(" / "):m)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},px(o.general.currencySymbol,d),dx((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},px(o.general.currencySymbol,d),dx(u?.compareAtPrice?u?.compareAtPrice:u?.price))),e.productDetails.variants.edges.length>1&&("dropdown"===o.comboBundle.comboVariantTypeSelector?t.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},e.productDetails.variants.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null))):e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map((n,r)=>t.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&n?.values?.length>1&&t.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(a=>{const i=[...m];i[r]=a;const l=e.productDetails.options.length>0?i.join(" / "):i[r],c=e.productDetails.variants.edges.find(e=>e.node.title===l)?.node,d=0===(c?p(c.id):0),u=m[r]===a,g=s&&s?.options?.find(e=>e.name===n.name);return g&&"color"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-color ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:d?.5:1,cursor:d?"not-allowed":"pointer"}},g?.values.find(e=>e.name===a)?.value?t.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",borderRadius:"50%",backgroundColor:g?.values.find(e=>e.name===a)?.value}},t.createElement("span",null)):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):g&&"image"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-image ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u&&!d?"#F7F7F7":"transparent",cursor:d?"not-allowed":"pointer",padding:"0px",width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",overflow:"hidden",opacity:d?.5:1}},g?.values.find(e=>e.name===a)?.value?t.createElement("img",{className:"yt-comboBundle-product-option-image",src:ux(g?.values.find(e=>e.name===a)?.value||"/placeholder.svg"),alt:a,style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-text ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",cursor:d?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:d?.5:1}},a)}))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map(e=>{const r=0===p(e?.node?.id);return t.createElement("button",{key:e?.node?.id,className:`yt-comboBundle-product-variant-button ${n===e?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>f(e?.node?.id),disabled:r,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:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},e?.node?.title)}))))))},Nf=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786);l(()=>(n&&(window.ytComboBundle={bundle:e,addToCart:n},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[e,n]);const d=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[p,u]=c(()=>{const t={};return e.products.forEach((e,n)=>{const r=e.productDetails?.variants?.edges?.find(t=>d(e.productDetails,t?.node?.id)>0)?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id}),t}),m=e.products?.every((e,t)=>{const n=p[t];return d(e.productDetails,n)>0}),f=(e,t)=>{u(n=>({...n,[e]:t}))},{originalPrice:g,dealPrice:h,offerValue:x}=i(()=>{const{price:t,compareAtPrice:n}=Object.entries(p).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)}},[p,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l(()=>{const e=()=>{s(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",{className:`yt-comboBundle-bundle-container ${"left"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,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",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{className:"yt-comboBundle-bundle-title",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",{className:"yt-comboBundle-bundle-price-container",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",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},px(y.general.currencySymbol,e.storeCurrencyCode),dx(h)),t.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},px(y.general.currencySymbol,e.storeCurrencyCode),dx(g)),t.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${px(y.general.currencySymbol,e.storeCurrencyCode)}${dx(e?.amountOff)} Off`:`Save ${px(y.general.currencySymbol,e.storeCurrencyCode)}${dx(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",{className:"yt-comboBundle-products-grid-vertical "+(a?"yt-comboBundle-products-grid-mobile":""),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===p[r])?.node;return o?t.createElement(If,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null})):t.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(a?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map((n,r)=>t.createElement(If,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions})))),t.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${m?"":"yt-comboBundle-bundle-cta-button-disabled"} ${a?"yt-comboBundle-bundle-cta-button-mobile":""}`,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 console.error("[ComboBundle.tsx] No addToCartFunction available"),void o(!1);const t=Object.entries(p).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(p);await n(Number(g),r,Number(h),t)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}o(!1)}},r?t.createElement(fa,{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",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},t.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{className:"yt-comboBundle-bundle-description-content",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))))},Df=x.div`
|
|
3542
3542
|
max-width: 800px;
|
|
3543
3543
|
container-type: inline-size;
|
|
3544
3544
|
margin-top: ${e=>e.verticalMargin||"0px"};
|
|
@@ -5081,4 +5081,4 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
5081
5081
|
}
|
|
5082
5082
|
`,Zh=x.span`
|
|
5083
5083
|
font-size: 12px;
|
|
5084
|
-
`,Xh=({productsWithIndices:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[f,g]=c({}),[h,x]=c({});l(()=>{const t={},n={};e?.forEach(({product:e,index:r})=>{let o,a=[];if(e.productId===p&&u){const t=e?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;t&&m(e.productDetails,t.id)>0&&(a=t.title.split(" / "),o=t)}if(!a.length){const t=e.productDetails.variants.edges.find(t=>m(e.productDetails,t?.node?.id)>0)?.node||e?.productDetails?.variants?.edges?.[0]?.node;t?(a=t.title.split(" / "),o=t):a=e?.productDetails?.options?.map(e=>e.values[0]??"")}t[r]=a,o&&(n[r]={node:o},s(r,o.id))}),g(t),x(n)},[e,p,u,s,m]),l(()=>{if(!p||!u)return;const t=e?.find(({product:e})=>e?.productId===p);if(!t)return;const{product:n,index:r}=t,o=n?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(n.productDetails,o.id)>0){const e=o.title.split(" / ");g(t=>({...t,[r]:e})),x(e=>({...e,[r]:{node:o}})),s(r,o.id)}},[u,p,e,s,m]);const y=(e,t,n,r)=>{const o=[...f[e]||[]];o[t]=n;const a=o.join(" / "),i=r.productDetails.variants.edges.find(e=>e.node.title===a)?.node;return!!i&&m(r.productDetails,i.id)>0},b=(t,n,r)=>{const{product:o}=e?.find(e=>e.index===t)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!y(t,r,n,o))return;const a={...f};a[t][r]=n,g(a);const i=o?.productDetails?.variants?.edges?.find(e=>e.node.title===a[t].join(" / "))?.node;i&&(s(t,i.id),x(e=>({...e,[t]:{node:i}})))};if(!n)return null;const w=t.createElement(Oh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(Fh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(Mh,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(({product:n,index:r},o)=>t.createElement(t.Fragment,null,t.createElement(Lh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(jh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:h[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(Vh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(Wh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(qh,{className:"yt-fixedBundle-variant-modal_selected-value"},f[r]?.join(" / "))),n.productDetails.options.map((e,o)=>{const i=a&&a?.options?.find(t=>t.name===e.name);return e.values.length<=1?t.createElement(t.Fragment,null):i&&"color"===i?.type?t.createElement(Uh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Zh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i.values.find(t=>t.name===e)?.value?t.createElement(Gh,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(t=>t.name===e)?.value||e,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},t.createElement("span",null)):t.createElement(Qh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):i&&"image"===i?.type?t.createElement(Uh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Zh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i?.values.find(t=>t.name===e)?.value?t.createElement(Yh,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)},src:i.values.find(t=>t.name===e)?.value},t.createElement("span",null)):t.createElement(Qh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):t.createElement(Uh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Zh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const i=!y(r,o,e,n);return t.createElement(Qh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:i,onClick:()=>{b(r,e,o)}},e)}))}))),o<e.length-1&&t.createElement(Hh,{className:"yt-fixedBundle-variant-modal_divider"}))),t.createElement(Rh,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:d},"Add bundle to cart")));return v.createPortal(w,document.body)},Kh=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=e=>"color"===a?t.createElement($h,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(Bh,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(vh,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(wh,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(Ch,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(kh,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(Eh,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map(e=>t.createElement(Th,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(Sh,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name)))))},Jh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l(()=>{if(a&&e.variants.edges.some(e=>e.node.id.includes(a))){const t=e.variants.edges.find(e=>e.node.id.includes(a))?.node;if(t){const e=t.title.split(" / ");p(e)}}},[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map(e=>({name:e,value:e}));const r=n.options.find(t=>t.name===e.name);return e.values.map(e=>{const t=r?.values?.find(t=>t.name===e);return{name:e,value:t?.value||e}})},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find(e=>e.name===n)||null};return t.createElement(zh,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map((n,r)=>t.createElement(Ih,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(Kh,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find(n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t]))?.node.id;o(a||"")})(r,t)},type:u(n.name)}))))},ex=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:s,onCheckChange:d,isMobile:p,isHorizontal:u,index:m,variantOptions:f,productsLength:g,handleOpenModal:h,storeCurrencyCode:x,primaryProductId:y,variantId:b})=>{const v=i(()=>t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e]),[w,C]=c(e?.variants?.edges.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node),[k]=c(e?.options?.map(e=>e?.values?.[0])||[]),E=e?.id===y;l(()=>{if(b&&e.id===y){const t=e?.variants?.edges?.find(e=>e?.node?.id?.includes(b))?.node;t&&v(t.id)>0&&(C(t),s(t.id))}else{const t=e?.variants?.edges?.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node;C(t)}},[e,y,n,b,s,v]);const T="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,S=w?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,u?t.createElement("div",{className:""+(e.id===y?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(Ph,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(Dh,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(_h,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,null))),t.createElement(Ug,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Gg,{className:"yt-fixedBundle-product-card-horizontal_image",src:ux(S),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(Qg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(Yg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Zg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(Xg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},px(a.general.currencySymbol,x)," ",dx(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Kg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},px(a.general.currencySymbol,x),dx(w?.compareAtPrice))),t.createElement(Jh,{product:e,variantOptions:f,selectedVariants:k,onVariantChange:t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t)?.node;n&&v(t)>0&&s(t)},variantId:b,primaryProductId:y})))):t.createElement(t.Fragment,null,t.createElement(lh,{className:""+(e.id===y?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:g,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...T&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(Ah,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:T},t.createElement(Dh,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(_h,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(ch,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(sh,{className:"yt-fixedBundle-product-card_image--vertical",src:ux(S),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(dh,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(ph,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(uh,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(mh,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(fh,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(gh,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(xh,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(hh,{className:"yt-fixedBundle-product-card-vertical_price--new"},px(a.general.currencySymbol,x),dx(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Kg,{className:"yt-fixedBundle-product-card-vertical_price--old"},px(a.general.currencySymbol,x),dx(w.compareAtPrice))))),(g<=3||!p)&&m<g-1&&t.createElement(yh,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(bh,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},tx=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[s,d]=c(window.innerWidth<786),[p,u]=c(null),[m,f]=c(!1),g="undefined"!=typeof window?window.location.href:null,h=e?.products?.find(e=>e.productDetails?.handle===g?.split("/").pop()?.split("?")[0]),x=h?.productId,y=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[b,v]=c(Object.fromEntries(e?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>y(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),w="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),C=e?.showIndividualProductSelector||!0,[k,E]=c(new Set(e.products.reduce((e,t,n)=>(w&&t?.productId!==x&&!C||e.push(n),e),[])));l(()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");u(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),l(()=>{p&&x&&v(t=>{const n={...t};return e?.products?.forEach((e,t)=>{e.productId===x&&(n[t.toString()]=p)}),n})},[p,x,e?.products]),l(()=>{const e=()=>{d(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const T=a((e,t)=>{v(n=>({...n,[e.toString()]:t}))},[]),S=(t,n)=>{const r=e.products[n].productId;w&&C&&r===x||E(e=>{const r=new Set(e);return t?r.add(n):r.delete(n),r})},$=i(()=>(e,t)=>y(e.productDetails,t)>0,[y]),B=i(()=>e.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[e.products,k]),{originalPrice:z,dealPrice:I,offerValue:N}=i(()=>{const{price:t,compareAtPrice:n}=e.products.reduce((e,t,n)=>{if(!k.has(n))return e;const r=b[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);k.size===e.products.length&&(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)}},[e.products,b,k,e.percentageOff,e.dealAmount,e.amountOff]),D=i(()=>e.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[e.products,k]),_=D.every(({product:e,index:t})=>$(e,b[t.toString()])),P=async e=>{if(_){e.preventDefault(),e.stopPropagation(),o(!0),f(!1);try{const e=Object.entries(b).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);n&&await n(Number(z),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)}};if(!n)return t.createElement(t.Fragment,null);const A=e.customizations,O=A.fixedBundle?.cardLayoutStyle||"auto",F="horizontal"===O||"auto"===O&&s,M="bundles"==e.appName?e.pageHeader?.title:e?.title,R="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(Vg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:A.fixedBundle.sectionBackgroundColor,..."transparent"!==A.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&t.createElement(Wg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:A.fixedBundle?.titleBackgroundColor||"none",color:A.fixedBundle?.titleTextColor||"black",textAlign:A.fixedBundle.infoAlignment??"center",fontSize:A.fixedBundle?.titleFontSize,..."transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===A.fixedBundle.infoAlignment&&"transparent"===A.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),R&&t.createElement(Hg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:A.fixedBundle?.subtitleFontSize,textAlign:A.fixedBundle.infoAlignment??"center",..."left"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===A.fixedBundle.infoAlignment&&"transparent"===A.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},R),F?t.createElement(qg,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map((n,r)=>t.createElement(t.Fragment,{key:`${n.productId}-${r}`},t.createElement(ex,{isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:A,onVariantChange:e=>T(r,e),onCheckChange:e=>{S(e,r)},isMobile:s,index:r,isHorizontal:F,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0})))):t.createElement(ah,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(ih,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===A.fixedBundle.infoAlignment?"flex-start":"right"===A.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map((n,r)=>t.createElement(ex,{key:`${n.productId}-${r}`,isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:A,onVariantChange:e=>T(r,e),onCheckChange:e=>S(e,r),isMobile:s,index:r,isHorizontal:F,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0})),B&&t.createElement(Xh,{productsWithIndices:D,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:A.general.ctaTextColor,backgroundColor:A.general.ctaBackgroundColor},onVariantChange:T,handleAddToCart:P,primaryProductId:x,variantId:p||void 0}))),t.createElement(Jg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===A.fixedBundle.infoAlignment?"flex-start":"right"===A.fixedBundle.infoAlignment?"flex-end":"center"}},Number(z)>0&&Number(N)>0&&A.fixedBundle.compareAtPriceVisibility&&t.createElement(eh,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(nh,{className:"yt-fixedBundle-summary_price"},px(A.general.currencySymbol,e?.storeCurrencyCode),dx(z))),0!==k.size&&t.createElement(th,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(nh,{className:"yt-fixedBundle-summary_price"},px(A.general.currencySymbol,e?.storeCurrencyCode),dx(I))," ",Number(N)>0&&t.createElement(rh,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",px(A.general.currencySymbol,e?.storeCurrencyCode),dx(N)))),t.createElement(oh,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),F||!B?P(e):f(!0)},disabled:k.size<1||r||!_,style:{backgroundColor:A.general?.ctaBackgroundColor||"#121212",color:A.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${A.general?.ctaBackgroundColor||"#121212"}`,boxShadow:A.general.ctaShadowType,paddingTop:A.general?.ctaPadding,paddingBottom:A.general?.ctaPadding,borderRadius:A.general.ctaBorderRadius,width:A.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{A.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=A.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=A.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{A.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=A.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=A.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(fa,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):_?t.createElement(t.Fragment,null,A.fixedBundle?.ctaTitle??"Add Bundle to cart"):t.createElement(t.Fragment,null,"Out of Stock")))},nx=()=>t.createElement(t.Fragment,null,t.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),t.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),rx=({product:e,tierIdx:n,isOpen:r,onClose:o,onAddToBundle:a,canAdd:i,isSelected:s,customizations:d,isMobile:p})=>{const[u,m]=c(0),[f,g]=c(e.variants[0].id.toString()),h=e.variants.find(e=>e.id.toString()===f)||e.variants[0],x=e.images.filter(Boolean);if(l(()=>(r&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[r]),l(()=>{if(h&&h?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image");e?.setAttribute("src",h?.featured_image?.src)}},[h]),!r)return null;const y=t.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:d?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px"}},x.length>0&&t.createElement("img",{className:"yt-collection-bundle-modal-image",src:ux(x[u]||e.images[0]),alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px"}}),x.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer",display:"block"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},e?.options?.join(" & "),":"," ",t.createElement("strong",null,h.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(h.compare_at_price/100).toFixed(0))),t.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:h.available?s||!i?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock")),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),b=t.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},x.length>0&&t.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative"}},t.createElement("img",{className:"yt-collection-bundle-modal-image",src:h.featured_image?.src||x[u]||e.images[0],alt:e.title,style:{width:"100%",display:"block",maxHeight:"50vh",objectFit:"cover",objectPosition:"center"}}),x.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},"Variant: ",t.createElement("strong",null,h.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toFixed(0))),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}}))),t.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&i&&h.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return v.createPortal(p?b:y,document.body)},ox=({title:e,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return t.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},t.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},e),i&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},t.createElement(nx,null)," Uploading ",n?.name,"...")),l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:a,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!i&&!l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},t.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),t.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:o,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:r,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},ax=({config:e,bundleAddToCartLoading:n,addCustomBundleToCart:r})=>{const[i,s]=c(1),[d,p]=c([]),[u,m]=c(null),[f,g]=c({}),[h,x]=c(window.innerWidth<640),[y,b]=c({}),v=o(new Map),[w,C]=c(!1),k=o(null),E=o(new Map),[T,S]=c(160),$=h?8:20,{customizations:B}=e,z=e.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),I=!!e.config.form,N=z.length+(I?1:0),D=B.hideSelectedProducts,_=B.allowMultipleQty,P=B.hideOutOfStockProducts,A=e=>z[e-1]?.products||[],O=a(e=>{const t=A(e),n=P?t.filter(e=>e.available).length:t.length;b(t=>{const r=t[e]||0,o=Math.min(r+8,n);return o<=r?t:{...t,[e]:o}})},[8,P]);l(()=>(k.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===i&&O(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[O,i]),l(()=>{if(I&&i===N)return;const e=i,t=A(e);if(0===t.length)return;const n=P?t.filter(e=>e.available).length:t.length;if(0===(y[e]||0)){const t=Math.min($,n);b(n=>({...n,[e]:t}))}},[i,$,P,y]),l(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>x(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const F=a(e=>{S(e+10)},[]),M=d.reduce((e,t)=>e+t.quantity,0),R=d.reduce((e,t)=>e+t.price*t.quantity,0)/100,L=d.reduce((e,t)=>{const n=z.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/100,j=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},V=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const r=n.dataset.selectedVariant||e.variants[0].id.toString(),o=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());p(n=>{const a=`${e.id}-${r}-${t}`,i=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===a);if(i)return n.filter(e=>e!==i);const l=q[t],c=W(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]})},W=e=>{const t=z[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},H=(e,t)=>{const n=W(t);if(n===1/0)return!0;const r=q[t],o=d.some(n=>n.productId===e.id.toString()&&n.tierIndex===t);return!!o||r<n},q=z.map((e,t)=>d.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),U=(e,t,n)=>{const r=W(n);if(r===1/0)return!0;return q[n]<r},G=e=>{if(!v.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");g(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),C(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw C(!1),alert("Upload failed. Try again."),e}finally{C(!1)}})(n);g(r=>({...r,[e]:{url:t,name:n.name}}))}catch{g(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),v.current.set(e,t)}return v.current.get(e)},Q=I&&i===N,Y=(Q?null:z[i-1])?W(i-1):0,Z=z.map((e,t)=>{const n=d.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]);return{tier:e,items:n,count:q[t]}});return t.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},B.headerImage&&!B.headerImage.includes("Liquid error")&&t.createElement("img",{className:"yt-collection-bundle-header-img",src:B.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),B.showTierSteps&&t.createElement("div",{style:{paddingTop:B.headerImage&&!B.headerImage.includes("Liquid error")?"20px":"0"}},t.createElement(ix,{totalSteps:N,isFormStep:Q,currentStep:i,getStepTitle:e=>I&&e===N?"Customize Gift Details":z[e-1]?.title||`Step ${e}`,isMobile:h,formTitle:e?.config?.form?.title,hasForm:I,onStepClick:e=>{if(e>1&&!d.length)return alert("Add at least one product first");s(e),window.scrollTo(0,0)}})),Array.from({length:N},(e,t)=>t+1).map(n=>{const r=I&&n===N,o=r?[]:A(n),a=P?o.filter(e=>e.available):o,l=n-1,c=a.slice(0,y[n]||0);return t.createElement("div",{key:n,className:"yt-collection-bundle-step-content "+(i===n?"yt-collection-bundle-step-content-active":""),style:{display:i===n?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},r&&e.config.form?t.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${T}px`}},e?.config?.form?.sections?.map((e,n)=>t.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},t.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},e?.title),"text"===e.type&&t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n;return t.createElement("textarea",{key:r,className:"yt-collection-bundle-textarea",placeholder:e?.title,rows:3,maxLength:500,onChange:e=>g(t=>({...t,[r]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===e.type&&t.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},t.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n,o=f[r];return t.createElement(ox,{key:r,title:e?.title,uploadState:o,onUpload:()=>G(r).click(),onRemove:()=>g(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>G(r).click()})})))))):t.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:h?"grid":"flex",gridTemplateColumns:h?"repeat(2,1fr)":"",flexWrap:h?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${T}px`}},c.map(e=>t.createElement(lx,{key:e.id,product:e,tierIdx:l,customizations:B,isMobile:h,hoveredCard:u,setHoveredCard:m,selectedProducts:d,handleAddToBundle:V,canAddProduct:H,allowMultipleQty:_,handleVariantChange:j,canIncrement:U,setSelectedProducts:p})),i===n&&(y[n]||0)<a.length&&t.createElement("div",{ref:e=>{const t=E.current.get(n);t&&k.current?.unobserve(t),e?(E.current.set(n,e),k.current?.observe(e)):E.current.delete(n)},"data-sentinel-step":n.toString(),style:{height:"20px",width:"100%",display:"block"}})))}),t.createElement(cx,{config:e,selectedProducts:d,selectedByTier:Z,totalItems:M,totalPrice:R,totalCompareAtPrice:L,currentStep:i,totalSteps:N,currentTierMax:Y,tierSelectedCounts:q,isMobile:h,bundleAddToCartLoading:n,isUploading:w,hoveredCard:u,setHoveredCard:m,hideSelectedProducts:D,getProductStep:e=>{for(let t=0;t<z.length;t++)if(z[t].products.some(t=>t.id.toString()===e))return t+1;return I?N:z.length},setCurrentStep:s,handleRemoveItem:(e,t,n)=>{p(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},handleCheckout:async()=>{if(i!==N||!d.length)return;const e={};I&&Object.entries(f).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)});const t=d.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));r(t)},hasForm:I,onHeightChange:F}))},ix=({totalSteps:e,isFormStep:n,currentStep:r,getStepTitle:o,isMobile:a,formTitle:i,hasForm:l,onStepClick:c})=>t.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:a?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:a?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},t.createElement("div",{className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:"center",gap:a?"0":"2rem",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:e},(e,t)=>t+1).map(n=>t.createElement("div",{key:n,className:"yt-collection-bundle-step-item "+(r===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:"120px",cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>c(n)},t.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},l&&n===e?t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),t.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},o(n))))),i&&l&&n&&t.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},i)),lx=({product:e,tierIdx:n,customizations:r,isMobile:o,hoveredCard:a,setHoveredCard:i,selectedProducts:l,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:f})=>{const[g,h]=c(!1),x=document.querySelector(`[data-product-id="${e.id}"]`),y=x?.dataset.selectedVariant||e.variants[0].id.toString(),b=e.variants.find(e=>e.id.toString()===y)||e.variants[0],v=l.some(t=>t.productId===e.id.toString()&&t.variantId===y&&t.tierIndex===n),w=a===e.id,C=l.filter(t=>t.productId===e.id.toString()&&t.variantId===b.id.toString()&&t.tierIndex===n).reduce((e,t)=>e+t.quantity,0);return t.createElement(t.Fragment,null,t.createElement("div",{key:e.id,className:"yt-collection-bundle-product-item","data-product-id":e.id,"data-selected-variant":b.id,"data-current-price":b.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:o?0:"250px",maxWidth:o?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:o?"100%":""}},t.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>h(!0),onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null)},t.createElement("img",{src:ux(e.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:e.title}),t.createElement("img",{src:ux(e.images[1]||e.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?1:0,transform:"scale(1.05)"},alt:e.title}),e.variants.length>1&&t.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:t=>u(e,t.target.value),defaultValue:b.id,onClick:e=>{e.stopPropagation()}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},t.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:o?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:1}},e.title),t.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},t.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:o?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(b.price/100).toFixed(0)),b.compare_at_price&&b.compare_at_price>b.price&&t.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(b.compare_at_price/100).toFixed(0)))),p&&C>0?t.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o&&o.quantity>1?t.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?t.filter(e=>e!==o):t})}},"-"),t.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},C),t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{b.available&&m(e,b.id.toString(),n)&&f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o?t.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...t,{productId:e.id.toString(),variantId:b.id.toString(),price:b.price,quantity:1,tierIndex:n}]})},disabled:!b.available||!m(e,b.id.toString(),n)},"+")):t.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":d(e,n)&&b.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:o?"6px":"12px",fontSize:o?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:b.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{b.available&&d(e,n)&&s(e,n)},disabled:!b.available||!d(e,n)},v?"Added":b.available?"ADD TO BOX":"Out of Stock")),g&&t.createElement(rx,{product:e,tierIdx:n,isOpen:g,onClose:()=>h(!1),onAddToBundle:(e,t)=>{s(e,t),h(!1)},canAdd:d(e,n),isSelected:v,customizations:r,isMobile:o}))},cx=e=>{const{config:n,selectedProducts:r,selectedByTier:a,totalItems:i,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:f,isMobile:g,bundleAddToCartLoading:h,isUploading:x,hoveredCard:y,setHoveredCard:b,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:k,hasForm:E,onHeightChange:T}=e,{customizations:S}=n,[$,B]=c(!1),z=o(null),I=a.filter(({count:e})=>e>0).map(({tier:e,count:t})=>((e,t)=>{const n=e.discountData;if(!n||!n.tiers?.length)return null;const r=[...n.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),o=r.filter(e=>t>=e.minimumQuantity),a=[];if(o.length>0){const e=o.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t).discountValue,{type:t}=n;let r;switch(t){case"percentage_discount_coupon":r=`${e}% OFF`;break;case"amount_discount_coupon":r=`₹${e} OFF`;break;case"fixed_price_collection":r=`Fixed ₹${e}`;break;case"dummy_coupon":r="Discount Applied";break;default:r=null}r&&a.push(r)}const i=r.find(e=>e.minimumQuantity>t);if(i){const e=i.minimumQuantity-t,r=i.discountValue,{type:o}=n;let l;switch(o){case"percentage_discount_coupon":l=`${r}% OFF`;break;case"amount_discount_coupon":l=`₹${r} OFF`;break;case"fixed_price_collection":l=`Fixed ₹${r}`;break;case"dummy_coupon":l="Discount";break;default:l=null}l&&a.push(`Add ${e} more item${1!==e?"s":""} to get ${l}`)}return a.length>0?a.join(" + "):null})(e,t)).filter(Boolean);return l(()=>{const e=m!==1/0&&f[p-1]===m-2&&m>1;let t=null;return e?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[m,f,p]),l(()=>{if(z.current&&T){const e=z.current.offsetHeight;T(e)}},[g,T,r]),t.createElement("div",{ref:z,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},I.length>0&&t.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},I.join(" + ")),t.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&t.createElement(t.Fragment,null,t.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),t.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",t.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),r.length>0&&t.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},t.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},a.filter(({count:e})=>e>0).map(({items:e},r,o)=>t.createElement(t.Fragment,{key:r},t.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},t.createElement("div",{style:{display:"flex",gap:"4px"}},e.map((e,o)=>{const a=n.config.builderTiers.collectionTier.flatMap(e=>e.products).find(t=>t.id.toString()===e.productId);if(!a)return null;const i=v(e.productId),l=p===i;return t.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},t.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&w(i)},t.createElement("img",{src:ux(a.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),e.quantity>1&&t.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",e.quantity),t.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:t=>{t.stopPropagation(),C(e.productId,e.variantId,r)}},"×")))}))),r<o.length-1&&o[r+1].count>0&&t.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},t.createElement(ut,null)))))),g?t.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:i>0&&(E||n?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:i>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",...0!==i&&{paddingInline:"6px"},alignItems:"center",borderRadius:S?.borderRadius||"8px"}},t.createElement(t.Fragment,null,0===i&&t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===i&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"4px",width:"100%",justifyContent:"center"}},t.createElement("div",{style:{fontSize:"14px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"14px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"14px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`)))),t.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===i||x?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||h||x},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(nx,null)):p===u?"Checkout":"Next"))):t.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===y&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===i&&{padding:"12px 24px"}}},0===i&&t.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"16px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"15px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"16px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`))),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===i||x?.6:1,...-2===y&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||h||x,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(nx,null)):p===u?"Checkout":"Next")))},sx=window?.Shopify?.currency||{rate:1,active:"INR"},dx=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*sx.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},px=(e,t)=>t==sx.active?e:zn(sx.active)||sx.active,ux=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},mx=(e,t,n,r,o)=>{const a=r.findIndex(t=>t.variantId===e);o(0===n?e=>e.filter((e,t)=>t!==a):-1===a?r=>[...r,{product:t,variantId:e,quantity:n}]:e=>e.map((e,t)=>t===a?{...e,quantity:e.quantity+n}:e))},fx=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(zf,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(Nf,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(jg,{bundle:e,addToCartFunction:r}):"collection"===e.type?t.createElement(ax,{config:e,addCustomBundleToCart:o,bundleAddToCartLoading:l}):t.createElement(cg,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(tx,{addToCartFunction:r,bundle:e});q(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const gx=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},""))))),hx=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:o},t.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},t.createElement("img",{src:"https://feature-products-offers.shopify-product-blocks.pages.dev/assets/confetti.jpg",alt:"confetti",style:{width:"100%",height:"clamp(150px, 20vh, 230px)",objectFit:"cover",objectPosition:"top",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",marginBottom:"10px",flexShrink:0}}),t.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"clamp(-150px, -20vh, -200px)",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},n.name),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),t.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),t.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},t.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),t.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e)))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return w(i,document.body)},xx=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:o},t.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),t.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},t.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),t.createElement("div",{style:{overflowY:"auto",flex:1}},t.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},t.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},n.name),t.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage)),t.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},t.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),t.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},t.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e))))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return w(i,document.body)},yx=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:a,setShowPopup:i})=>{const s=o(null),[d,p]=c(!1),[u,m]=c(!0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=768),h=()=>{if(s.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;p(e>0),m(e<t-n-10)}};l(()=>{h();const e=s.current;if(e)return e.addEventListener("scroll",h),()=>e.removeEventListener("scroll",h)},[e]),l(()=>{const e=()=>{g(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const x=e=>{if(s.current){const t=f?280:365,n=16,r="right"===e?t+n:-(t+n);s.current.scrollBy({left:r,behavior:"smooth"})}};return t.createElement("div",{style:{position:"relative"}},t.createElement("svg",{style:{position:"absolute",width:0,height:0}},t.createElement("defs",null,t.createElement("mask",{id:"coupon-cut-mask-desktop"},t.createElement("rect",{width:"365",height:"138",fill:"white"}),t.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),t.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),t.createElement("mask",{id:"coupon-cut-mask-mobile"},t.createElement("rect",{width:"280",height:"120",fill:"white"}),t.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),t.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),d&&t.createElement("button",{onClick:()=>x("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(M,{size:20})),u&&t.createElement("button",{onClick:()=>x("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(j,{size:20})),t.createElement("div",{ref:s,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:f?"110px":"128px"}},e?.map(e=>t.createElement("div",{key:e.discountId,style:{flexShrink:0,width:f?"280px":"365px",minWidth:f?"280px":"365px",minHeight:f?"110px":"128px",backgroundColor:"transparent",borderRadius:`${n?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},t.createElement("div",{style:{width:f?"60px":"80px",minHeight:f?"110px":"128px",backgroundColor:n?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:f?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${n?.roundness||0}px`,borderBottomLeftRadius:`${n?.roundness||0}px`}},t.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),n?.iconVisibility&&t.createElement("div",{style:{position:"absolute",left:f?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:f?"32px":"40px",height:f?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:f?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===e.couponType?t.createElement(W,null):t.createElement(To,null)),t.createElement("div",{style:{flex:1,padding:f?"12px 12px":"15px 15px",paddingLeft:f?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${n?.roundness||0}px`,borderBottomRightRadius:`${n?.roundness||0}px`,overflow:"hidden",backgroundColor:n?.cardBackgroundColor||"#ffffff",minWidth:0}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:f?"4px":"6px",lineHeight:"normal"}},t.createElement("div",{style:{fontSize:f?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===e.couponType?"Free Gift":"Special Deal"),t.createElement("div",{style:{fontSize:f?"13px":"15px",fontWeight:"600",color:n?.textColor||"#2c3e50"}},e.name),t.createElement("div",{style:{fontSize:f?"11px":"12px",color:n?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:f?"28px":"32px"}},r(e))),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},t.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a(e),i(!0)},style:{fontSize:f?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},n?.viewDetailsTitle||"View Details")))))),t.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},bx=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:o,setShowPopup:a})=>{const[i,s]=c("undefined"!=typeof window&&window.innerWidth<=768);return l(()=>{const e=()=>{s(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement("div",{style:{borderRadius:`${n?.roundness||8}px`}},e?.map((l,c)=>t.createElement("div",{key:l.discountId,style:{display:"flex",alignItems:"flex-start",gap:i?"8px":"12px",padding:i?"12px 0":"16px 0",paddingLeft:i?"10px":"20px",backgroundColor:!0===n?.cardBackgroundTransparent||"true"===String(n?.cardBackgroundTransparent)?"transparent":n?.cardBackgroundColor||"#ffffff",borderBottom:c<(e?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${n?.roundness||0}px`}},n?.iconVisibility&&t.createElement("div",{style:{width:i?"40px":"50px",height:i?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:i?"20px":"25px",marginTop:i?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===l.couponType?t.createElement(W,null):t.createElement(To,null)),t.createElement("div",{style:{flex:1}},t.createElement("div",{style:{fontSize:i?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},l.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",t.createElement("span",{style:{fontWeight:600,color:n?.textColor||"#34495e"}},l.name)),t.createElement("div",{style:{fontSize:i?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},r(l)),t.createElement("div",{style:{fontSize:i?"11px":"12px",color:"#000000"}},"offer auto applied",t.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),o(l),a(!0)},style:{color:n?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},n?.viewDetailsTitle||"T&C"))))))},vx=e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const r=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?r.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&r.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&r.push("Combines with other order discounts"),t||r.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:r}},wx=e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available",Cx=({offersConfig:e,offers:n})=>{const[r,a]=c(!1),[i,s]=c(null),[d,p]=c(null),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=768),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=450),h=o(null);l(()=>{const e=()=>{m(window.innerWidth<=768),g(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{h.current&&jn(h.current)},[e?.sectionBgContrastColor]);const x=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",r=-1;Object.keys(t).forEach(e=>{t[e]>r&&(r=t[e],n=e)});const o=e.map((e,t)=>({o:e,idx:t})),a=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return o.sort((e,t)=>{const r=e.o.customCartProgressBarCriteria===n,o=t.o.customCartProgressBarCriteria===n;if(r&&o){const n=a(e.o),r=a(t.o);return n!==r?n-r:e.idx-t.idx}return r&&!o?-1:!r&&o?1:e.idx-t.idx}),o.map(e=>e.o)})(n||[]);return t.createElement("div",null,t.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===e?.sectionType?`${e?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:e?.sectionBackgroundColor||"#fff"}},t.createElement("div",{style:{border:"coupon"===e?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=e?.cardPadding?`${e.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===e?.sectionType?`${e?.roundness||8}px`:"0px"}},t.createElement("span",{ref:h,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"right"===e?.alignment?"auto":"50%",right:"right"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===e?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:e?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},e?.sectionTitle||"Available Deals and Offers"),(()=>{const n=e?.sectionType;return"list"===n?t.createElement(bx,{offersToShow:x,offersConfig:e||{},getOfferCardMessage:wx,setSelectedOffer:e=>{s(e),e&&p(vx(e))},setShowPopup:a}):"coupon"===n?t.createElement(yx,{offersToShow:x,offersConfig:e||{},getOfferCardMessage:wx,setSelectedOffer:e=>{s(e),e&&p(vx(e))},setShowPopup:a}):null})(),f?t.createElement(xx,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}):t.createElement(hx,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}))))};export{fx as Bundle,gx as BundleLoader,Pu as Cart,Sa as CouponFrame,Xe as Nudge,Cx as ProductOffers,ot as SpinnerWheel};
|
|
5084
|
+
`,Xh=({productsWithIndices:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[f,g]=c({}),[h,x]=c({});l(()=>{const t={},n={};e?.forEach(({product:e,index:r})=>{let o,a=[];if(e.productId===p&&u){const t=e?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;t&&m(e.productDetails,t.id)>0&&(a=t.title.split(" / "),o=t)}if(!a.length){const t=e.productDetails.variants.edges.find(t=>m(e.productDetails,t?.node?.id)>0)?.node||e?.productDetails?.variants?.edges?.[0]?.node;t?(a=t.title.split(" / "),o=t):a=e?.productDetails?.options?.map(e=>e.values[0]??"")}t[r]=a,o&&(n[r]={node:o},s(r,o.id))}),g(t),x(n)},[e,p,u,s,m]),l(()=>{if(!p||!u)return;const t=e?.find(({product:e})=>e?.productId===p);if(!t)return;const{product:n,index:r}=t,o=n?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(n.productDetails,o.id)>0){const e=o.title.split(" / ");g(t=>({...t,[r]:e})),x(e=>({...e,[r]:{node:o}})),s(r,o.id)}},[u,p,e,s,m]);const y=(e,t,n,r)=>{const o=[...f[e]||[]];o[t]=n;const a=o.join(" / "),i=r.productDetails.variants.edges.find(e=>e.node.title===a)?.node;return!!i&&m(r.productDetails,i.id)>0},b=(t,n,r)=>{const{product:o}=e?.find(e=>e.index===t)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!y(t,r,n,o))return;const a={...f};a[t][r]=n,g(a);const i=o?.productDetails?.variants?.edges?.find(e=>e.node.title===a[t].join(" / "))?.node;i&&(s(t,i.id),x(e=>({...e,[t]:{node:i}})))};if(!n)return null;const w=t.createElement(Oh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(Fh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(Mh,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(({product:n,index:r},o)=>t.createElement(t.Fragment,null,t.createElement(Lh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(jh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:h[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(Vh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(Wh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(qh,{className:"yt-fixedBundle-variant-modal_selected-value"},f[r]?.join(" / "))),n.productDetails.options.map((e,o)=>{const i=a&&a?.options?.find(t=>t.name===e.name);return e.values.length<=1?t.createElement(t.Fragment,null):i&&"color"===i?.type?t.createElement(Uh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Zh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i.values.find(t=>t.name===e)?.value?t.createElement(Gh,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(t=>t.name===e)?.value||e,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},t.createElement("span",null)):t.createElement(Qh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):i&&"image"===i?.type?t.createElement(Uh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Zh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i?.values.find(t=>t.name===e)?.value?t.createElement(Yh,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)},src:i.values.find(t=>t.name===e)?.value},t.createElement("span",null)):t.createElement(Qh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):t.createElement(Uh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Zh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const i=!y(r,o,e,n);return t.createElement(Qh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:i,onClick:()=>{b(r,e,o)}},e)}))}))),o<e.length-1&&t.createElement(Hh,{className:"yt-fixedBundle-variant-modal_divider"}))),t.createElement(Rh,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:d},"Add bundle to cart")));return v.createPortal(w,document.body)},Kh=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=e=>"color"===a?t.createElement($h,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(Bh,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(vh,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(wh,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(Ch,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(kh,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(Eh,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map(e=>t.createElement(Th,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(Sh,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name)))))},Jh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l(()=>{if(a&&e.variants.edges.some(e=>e.node.id.includes(a))){const t=e.variants.edges.find(e=>e.node.id.includes(a))?.node;if(t){const e=t.title.split(" / ");p(e)}}},[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map(e=>({name:e,value:e}));const r=n.options.find(t=>t.name===e.name);return e.values.map(e=>{const t=r?.values?.find(t=>t.name===e);return{name:e,value:t?.value||e}})},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find(e=>e.name===n)||null};return t.createElement(zh,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map((n,r)=>t.createElement(Ih,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(Kh,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find(n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t]))?.node.id;o(a||"")})(r,t)},type:u(n.name)}))))},ex=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:s,onCheckChange:d,isMobile:p,isHorizontal:u,index:m,variantOptions:f,productsLength:g,handleOpenModal:h,storeCurrencyCode:x,primaryProductId:y,variantId:b})=>{const v=i(()=>t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e]),[w,C]=c(e?.variants?.edges.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node),[k]=c(e?.options?.map(e=>e?.values?.[0])||[]),E=e?.id===y;l(()=>{if(b&&e.id===y){const t=e?.variants?.edges?.find(e=>e?.node?.id?.includes(b))?.node;t&&v(t.id)>0&&(C(t),s(t.id))}else{const t=e?.variants?.edges?.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node;C(t)}},[e,y,n,b,s,v]);const T="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,S=w?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,u?t.createElement("div",{className:""+(e.id===y?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(Ph,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(Dh,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(_h,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,null))),t.createElement(Ug,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Gg,{className:"yt-fixedBundle-product-card-horizontal_image",src:ux(S),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(Qg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(Yg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Zg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(Xg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},px(a.general.currencySymbol,x)," ",dx(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Kg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},px(a.general.currencySymbol,x),dx(w?.compareAtPrice))),t.createElement(Jh,{product:e,variantOptions:f,selectedVariants:k,onVariantChange:t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t)?.node;n&&v(t)>0&&s(t)},variantId:b,primaryProductId:y})))):t.createElement(t.Fragment,null,t.createElement(lh,{className:""+(e.id===y?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:g,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...T&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(Ah,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:T},t.createElement(Dh,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(_h,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(ch,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(sh,{className:"yt-fixedBundle-product-card_image--vertical",src:ux(S),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(dh,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(ph,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(uh,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(mh,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(fh,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(gh,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(xh,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(hh,{className:"yt-fixedBundle-product-card-vertical_price--new"},px(a.general.currencySymbol,x),dx(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Kg,{className:"yt-fixedBundle-product-card-vertical_price--old"},px(a.general.currencySymbol,x),dx(w.compareAtPrice))))),(g<=3||!p)&&m<g-1&&t.createElement(yh,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(bh,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},tx=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[s,d]=c(window.innerWidth<786),[p,u]=c(null),[m,f]=c(!1),g="undefined"!=typeof window?window.location.href:null,h=e?.products?.find(e=>e.productDetails?.handle===g?.split("/").pop()?.split("?")[0]),x=h?.productId,y=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[b,v]=c(Object.fromEntries(e?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>y(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),w="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),C=e?.showIndividualProductSelector||!0,[k,E]=c(new Set(e.products.reduce((e,t,n)=>(w&&t?.productId!==x&&!C||e.push(n),e),[])));l(()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");u(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),l(()=>{p&&x&&v(t=>{const n={...t};return e?.products?.forEach((e,t)=>{e.productId===x&&(n[t.toString()]=p)}),n})},[p,x,e?.products]),l(()=>{const e=()=>{d(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const T=a((e,t)=>{v(n=>({...n,[e.toString()]:t}))},[]),S=(t,n)=>{const r=e.products[n].productId;w&&C&&r===x||E(e=>{const r=new Set(e);return t?r.add(n):r.delete(n),r})},$=i(()=>(e,t)=>y(e.productDetails,t)>0,[y]),B=i(()=>e.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[e.products,k]),{originalPrice:z,dealPrice:I,offerValue:N}=i(()=>{const{price:t,compareAtPrice:n}=e.products.reduce((e,t,n)=>{if(!k.has(n))return e;const r=b[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);k.size===e.products.length&&(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)}},[e.products,b,k,e.percentageOff,e.dealAmount,e.amountOff]),D=i(()=>e.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[e.products,k]),_=D.every(({product:e,index:t})=>$(e,b[t.toString()])),P=async e=>{if(_){e.preventDefault(),e.stopPropagation(),o(!0),f(!1);try{const e=Object.entries(b).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);n&&await n(Number(z),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)}};if(!n)return t.createElement(t.Fragment,null);const A=e.customizations,O=A.fixedBundle?.cardLayoutStyle||"auto",F="horizontal"===O||"auto"===O&&s,M="bundles"==e.appName?e.pageHeader?.title:e?.title,R="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(Vg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:A.fixedBundle.sectionBackgroundColor,..."transparent"!==A.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&t.createElement(Wg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:A.fixedBundle?.titleBackgroundColor||"none",color:A.fixedBundle?.titleTextColor||"black",textAlign:A.fixedBundle.infoAlignment??"center",fontSize:A.fixedBundle?.titleFontSize,..."transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===A.fixedBundle.infoAlignment&&"transparent"===A.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),R&&t.createElement(Hg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:A.fixedBundle?.subtitleFontSize,textAlign:A.fixedBundle.infoAlignment??"center",..."left"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===A.fixedBundle.infoAlignment&&"transparent"!==A.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===A.fixedBundle.infoAlignment&&"transparent"===A.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},R),F?t.createElement(qg,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map((n,r)=>t.createElement(t.Fragment,{key:`${n.productId}-${r}`},t.createElement(ex,{isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:A,onVariantChange:e=>T(r,e),onCheckChange:e=>{S(e,r)},isMobile:s,index:r,isHorizontal:F,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0})))):t.createElement(ah,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(ih,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===A.fixedBundle.infoAlignment?"flex-start":"right"===A.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map((n,r)=>t.createElement(ex,{key:`${n.productId}-${r}`,isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:A,onVariantChange:e=>T(r,e),onCheckChange:e=>S(e,r),isMobile:s,index:r,isHorizontal:F,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0})),B&&t.createElement(Xh,{productsWithIndices:D,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:A.general.ctaTextColor,backgroundColor:A.general.ctaBackgroundColor},onVariantChange:T,handleAddToCart:P,primaryProductId:x,variantId:p||void 0}))),t.createElement(Jg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===A.fixedBundle.infoAlignment?"flex-start":"right"===A.fixedBundle.infoAlignment?"flex-end":"center"}},Number(z)>0&&Number(N)>0&&A.fixedBundle.compareAtPriceVisibility&&t.createElement(eh,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(nh,{className:"yt-fixedBundle-summary_price"},px(A.general.currencySymbol,e?.storeCurrencyCode),dx(z))),0!==k.size&&t.createElement(th,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(nh,{className:"yt-fixedBundle-summary_price"},px(A.general.currencySymbol,e?.storeCurrencyCode),dx(I))," ",Number(N)>0&&t.createElement(rh,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",px(A.general.currencySymbol,e?.storeCurrencyCode),dx(N)))),t.createElement(oh,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),F||!B?P(e):f(!0)},disabled:k.size<1||r||!_,style:{backgroundColor:A.general?.ctaBackgroundColor||"#121212",color:A.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${A.general?.ctaBackgroundColor||"#121212"}`,boxShadow:A.general.ctaShadowType,paddingTop:A.general?.ctaPadding,paddingBottom:A.general?.ctaPadding,borderRadius:A.general.ctaBorderRadius,width:A.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{A.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=A.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=A.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{A.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=A.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=A.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(fa,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):_?t.createElement(t.Fragment,null,A.fixedBundle?.ctaTitle??"Add Bundle to cart"):t.createElement(t.Fragment,null,"Out of Stock")))},nx=()=>t.createElement(t.Fragment,null,t.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),t.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),rx=({product:e,tierIdx:n,isOpen:r,onClose:o,onAddToBundle:a,canAdd:i,isSelected:s,customizations:d,isMobile:p})=>{const[u,m]=c(0),[f,g]=c(e.variants[0].id.toString()),h=e.variants.find(e=>e.id.toString()===f)||e.variants[0],x=e.images.filter(Boolean);if(l(()=>(r&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[r]),l(()=>{if(h&&h?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image");e?.setAttribute("src",h?.featured_image?.src)}},[h]),!r)return null;const y=t.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:d?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px"}},x.length>0&&t.createElement("img",{className:"yt-collection-bundle-modal-image",src:ux(x[u]||e.images[0]),alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px"}}),x.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer",display:"block"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},e?.options?.join(" & "),":"," ",t.createElement("strong",null,h.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(h.compare_at_price/100).toFixed(0))),t.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:h.available?s||!i?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock")),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),b=t.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},x.length>0&&t.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative"}},t.createElement("img",{className:"yt-collection-bundle-modal-image",src:h.featured_image?.src||x[u]||e.images[0],alt:e.title,style:{width:"100%",display:"block",maxHeight:"50vh",objectFit:"cover",objectPosition:"center"}}),x.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},"Variant: ",t.createElement("strong",null,h.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toFixed(0))),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}}))),t.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&i&&h.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return v.createPortal(p?b:y,document.body)},ox=({title:e,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return t.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},t.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},e),i&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},t.createElement(nx,null)," Uploading ",n?.name,"...")),l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:a,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!i&&!l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},t.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),t.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:o,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:r,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},ax=({config:e,bundleAddToCartLoading:n,addCustomBundleToCart:r})=>{const[i,s]=c(1),[d,p]=c([]),[u,m]=c(null),[f,g]=c({}),[h,x]=c(window.innerWidth<640),[y,b]=c({}),v=o(new Map),[w,C]=c(!1),k=o(null),E=o(new Map),[T,S]=c(160),$=h?8:20,{customizations:B}=e,z=e.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),I=!!e.config.form,N=z.length+(I?1:0),D=B.hideSelectedProducts,_=B.allowMultipleQty,P=B.hideOutOfStockProducts,A=e=>z[e-1]?.products||[],O=a(e=>{const t=A(e),n=P?t.filter(e=>e.available).length:t.length;b(t=>{const r=t[e]||0,o=Math.min(r+8,n);return o<=r?t:{...t,[e]:o}})},[8,P]);l(()=>(k.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===i&&O(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[O,i]),l(()=>{if(I&&i===N)return;const e=i,t=A(e);if(0===t.length)return;const n=P?t.filter(e=>e.available).length:t.length;if(0===(y[e]||0)){const t=Math.min($,n);b(n=>({...n,[e]:t}))}},[i,$,P,y]),l(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>x(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const F=a(e=>{S(e+10)},[]),M=d.reduce((e,t)=>e+t.quantity,0),R=d.reduce((e,t)=>e+t.price*t.quantity,0)/100,L=d.reduce((e,t)=>{const n=z.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/100,j=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},V=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const r=n.dataset.selectedVariant||e.variants[0].id.toString(),o=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());p(n=>{const a=`${e.id}-${r}-${t}`,i=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===a);if(i)return n.filter(e=>e!==i);const l=q[t],c=W(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]})},W=e=>{const t=z[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},H=(e,t)=>{const n=W(t);if(n===1/0)return!0;const r=q[t],o=d.some(n=>n.productId===e.id.toString()&&n.tierIndex===t);return!!o||r<n},q=z.map((e,t)=>d.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),U=(e,t,n)=>{const r=W(n);if(r===1/0)return!0;return q[n]<r},G=e=>{if(!v.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");g(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),C(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw C(!1),alert("Upload failed. Try again."),e}finally{C(!1)}})(n);g(r=>({...r,[e]:{url:t,name:n.name}}))}catch{g(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),v.current.set(e,t)}return v.current.get(e)},Q=I&&i===N,Y=(Q?null:z[i-1])?W(i-1):0,Z=z.map((e,t)=>{const n=d.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]);return{tier:e,items:n,count:q[t]}});return t.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},B.headerImage&&!B.headerImage.includes("Liquid error")&&t.createElement("img",{className:"yt-collection-bundle-header-img",src:B.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),B.showTierSteps&&t.createElement("div",{style:{paddingTop:B.headerImage&&!B.headerImage.includes("Liquid error")?"20px":"0"}},t.createElement(ix,{totalSteps:N,isFormStep:Q,currentStep:i,getStepTitle:e=>I&&e===N?"Customize Gift Details":z[e-1]?.title||`Step ${e}`,isMobile:h,formTitle:e?.config?.form?.title,hasForm:I,onStepClick:e=>{if(e>1&&!d.length)return alert("Add at least one product first");s(e),window.scrollTo(0,0)}})),Array.from({length:N},(e,t)=>t+1).map(n=>{const r=I&&n===N,o=r?[]:A(n),a=P?o.filter(e=>e.available):o,l=n-1,c=a.slice(0,y[n]||0);return t.createElement("div",{key:n,className:"yt-collection-bundle-step-content "+(i===n?"yt-collection-bundle-step-content-active":""),style:{display:i===n?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},r&&e.config.form?t.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${T}px`}},e?.config?.form?.sections?.map((e,n)=>t.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},t.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},e?.title),"text"===e.type&&t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n;return t.createElement("textarea",{key:r,className:"yt-collection-bundle-textarea",placeholder:e?.title,rows:3,maxLength:500,onChange:e=>g(t=>({...t,[r]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===e.type&&t.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},t.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n,o=f[r];return t.createElement(ox,{key:r,title:e?.title,uploadState:o,onUpload:()=>G(r).click(),onRemove:()=>g(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>G(r).click()})})))))):t.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:h?"grid":"flex",gridTemplateColumns:h?"repeat(2,1fr)":"",flexWrap:h?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${T}px`}},c.map(e=>t.createElement(lx,{key:e.id,product:e,tierIdx:l,customizations:B,isMobile:h,hoveredCard:u,setHoveredCard:m,selectedProducts:d,handleAddToBundle:V,canAddProduct:H,allowMultipleQty:_,handleVariantChange:j,canIncrement:U,setSelectedProducts:p})),i===n&&(y[n]||0)<a.length&&t.createElement("div",{ref:e=>{const t=E.current.get(n);t&&k.current?.unobserve(t),e?(E.current.set(n,e),k.current?.observe(e)):E.current.delete(n)},"data-sentinel-step":n.toString(),style:{height:"20px",width:"100%",display:"block"}})))}),t.createElement(cx,{config:e,selectedProducts:d,selectedByTier:Z,totalItems:M,totalPrice:R,totalCompareAtPrice:L,currentStep:i,totalSteps:N,currentTierMax:Y,tierSelectedCounts:q,isMobile:h,bundleAddToCartLoading:n,isUploading:w,hoveredCard:u,setHoveredCard:m,hideSelectedProducts:D,getProductStep:e=>{for(let t=0;t<z.length;t++)if(z[t].products.some(t=>t.id.toString()===e))return t+1;return I?N:z.length},setCurrentStep:s,handleRemoveItem:(e,t,n)=>{p(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},handleCheckout:async()=>{if(i!==N||!d.length)return;const e={};I&&Object.entries(f).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)});const t=d.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));r(t)},hasForm:I,onHeightChange:F}))},ix=({totalSteps:e,isFormStep:n,currentStep:r,getStepTitle:o,isMobile:a,formTitle:i,hasForm:l,onStepClick:c})=>t.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:a?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:a?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},t.createElement("div",{className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:"center",gap:a?"0":"2rem",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:e},(e,t)=>t+1).map(n=>t.createElement("div",{key:n,className:"yt-collection-bundle-step-item "+(r===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:"120px",cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>c(n)},t.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},l&&n===e?t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),t.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},o(n))))),i&&l&&n&&t.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},i)),lx=({product:e,tierIdx:n,customizations:r,isMobile:o,hoveredCard:a,setHoveredCard:i,selectedProducts:l,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:f})=>{const[g,h]=c(!1),x=document.querySelector(`[data-product-id="${e.id}"]`),y=x?.dataset.selectedVariant||e.variants[0].id.toString(),b=e.variants.find(e=>e.id.toString()===y)||e.variants[0],v=l.some(t=>t.productId===e.id.toString()&&t.variantId===y&&t.tierIndex===n),w=a===e.id,C=l.filter(t=>t.productId===e.id.toString()&&t.variantId===b.id.toString()&&t.tierIndex===n).reduce((e,t)=>e+t.quantity,0);return t.createElement(t.Fragment,null,t.createElement("div",{key:e.id,className:"yt-collection-bundle-product-item","data-product-id":e.id,"data-selected-variant":b.id,"data-current-price":b.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:o?0:"250px",maxWidth:o?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:o?"100%":""}},t.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>h(!0),onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null)},t.createElement("img",{src:ux(e.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:e.title}),t.createElement("img",{src:ux(e.images[1]||e.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?1:0,transform:"scale(1.05)"},alt:e.title}),e.variants.length>1&&t.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:t=>u(e,t.target.value),defaultValue:b.id,onClick:e=>{e.stopPropagation()}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},t.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:o?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:1}},e.title),t.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},t.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:o?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(b.price/100).toFixed(0)),b.compare_at_price&&b.compare_at_price>b.price&&t.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(b.compare_at_price/100).toFixed(0)))),p&&C>0?t.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o&&o.quantity>1?t.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?t.filter(e=>e!==o):t})}},"-"),t.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},C),t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{b.available&&m(e,b.id.toString(),n)&&f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o?t.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...t,{productId:e.id.toString(),variantId:b.id.toString(),price:b.price,quantity:1,tierIndex:n}]})},disabled:!b.available||!m(e,b.id.toString(),n)},"+")):t.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":d(e,n)&&b.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:o?"6px":"12px",fontSize:o?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:b.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{b.available&&d(e,n)&&s(e,n)},disabled:!b.available||!d(e,n)},v?"Added":b.available?"ADD TO BOX":"Out of Stock")),g&&t.createElement(rx,{product:e,tierIdx:n,isOpen:g,onClose:()=>h(!1),onAddToBundle:(e,t)=>{s(e,t),h(!1)},canAdd:d(e,n),isSelected:v,customizations:r,isMobile:o}))},cx=e=>{const{config:n,selectedProducts:r,selectedByTier:a,totalItems:i,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:f,isMobile:g,bundleAddToCartLoading:h,isUploading:x,hoveredCard:y,setHoveredCard:b,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:k,hasForm:E,onHeightChange:T}=e,{customizations:S}=n,[$,B]=c(!1),z=o(null),I=a.filter(({count:e})=>e>0).map(({tier:e,count:t})=>((e,t)=>{const n=e.discountData;if(!n||!n.tiers?.length)return null;const r=[...n.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),o=r.filter(e=>t>=e.minimumQuantity),a=[];if(o.length>0){const e=o.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t).discountValue,{type:t}=n;let r;switch(t){case"percentage_discount_coupon":r=`${e}% OFF`;break;case"amount_discount_coupon":r=`₹${e} OFF`;break;case"fixed_price_collection":r=`Fixed ₹${e}`;break;case"dummy_coupon":r="Discount Applied";break;default:r=null}r&&a.push(r)}const i=r.find(e=>e.minimumQuantity>t);if(i){const e=i.minimumQuantity-t,r=i.discountValue,{type:o}=n;let l;switch(o){case"percentage_discount_coupon":l=`${r}% OFF`;break;case"amount_discount_coupon":l=`₹${r} OFF`;break;case"fixed_price_collection":l=`Fixed ₹${r}`;break;case"dummy_coupon":l="Discount";break;default:l=null}l&&a.push(`Add ${e} more item${1!==e?"s":""} to get ${l}`)}return a.length>0?a.join(" + "):null})(e,t)).filter(Boolean);return l(()=>{const e=m!==1/0&&f[p-1]===m-2&&m>1;let t=null;return e?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[m,f,p]),l(()=>{if(z.current&&T){const e=z.current.offsetHeight;T(e)}},[g,T,r]),t.createElement("div",{ref:z,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},I.length>0&&t.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},I.join(" + ")),t.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&t.createElement(t.Fragment,null,t.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),t.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",t.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),r.length>0&&t.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},t.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},a.filter(({count:e})=>e>0).map(({items:e},r,o)=>t.createElement(t.Fragment,{key:r},t.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},t.createElement("div",{style:{display:"flex",gap:"4px"}},e.map((e,o)=>{const a=n.config.builderTiers.collectionTier.flatMap(e=>e.products).find(t=>t.id.toString()===e.productId);if(!a)return null;const i=v(e.productId),l=p===i;return t.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},t.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&w(i)},t.createElement("img",{src:ux(a.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),e.quantity>1&&t.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",e.quantity),t.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:t=>{t.stopPropagation(),C(e.productId,e.variantId,r)}},"×")))}))),r<o.length-1&&o[r+1].count>0&&t.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},t.createElement(ut,null)))))),g?t.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:i>0&&(E||n?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:i>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",...0!==i&&{paddingInline:"6px"},alignItems:"center",borderRadius:S?.borderRadius||"8px"}},t.createElement(t.Fragment,null,0===i&&t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===i&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"4px",width:"100%",justifyContent:"center"}},t.createElement("div",{style:{fontSize:"14px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"14px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"14px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`)))),t.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===i||x?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||h||x},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(nx,null)):p===u?"Checkout":"Next"))):t.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===y&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===i&&{padding:"12px 24px"}}},0===i&&t.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"16px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"15px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"16px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`))),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===i||x?.6:1,...-2===y&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||h||x,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(nx,null)):p===u?"Checkout":"Next")))},sx=window?.Shopify?.currency||{rate:1,active:"INR"},dx=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*sx.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},px=(e,t)=>t==sx.active?e:zn(sx.active)||sx.active,ux=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},mx=(e,t,n,r,o,a)=>{const i=r.findIndex(t=>t.variantId===e);o(0===n?e=>e.filter((e,t)=>t!==i):-1===i?r=>[...r,{product:t,variantId:e,quantity:n,isFree:a}]:e=>e.map((e,t)=>t===i?{...e,quantity:e.quantity+n,isFree:a}:e))},fx=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(zf,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(Nf,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(jg,{bundle:e,addToCartFunction:r}):"collection"===e.type?t.createElement(ax,{config:e,addCustomBundleToCart:o,bundleAddToCartLoading:l}):t.createElement(cg,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(tx,{addToCartFunction:r,bundle:e});q(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const gx=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},""))))),hx=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:o},t.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},t.createElement("img",{src:"https://feature-products-offers.shopify-product-blocks.pages.dev/assets/confetti.jpg",alt:"confetti",style:{width:"100%",height:"clamp(150px, 20vh, 230px)",objectFit:"cover",objectPosition:"top",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",marginBottom:"10px",flexShrink:0}}),t.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"clamp(-150px, -20vh, -200px)",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},n.name),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),t.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),t.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},t.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),t.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e)))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return w(i,document.body)},xx=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:o},t.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),t.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},t.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),t.createElement("div",{style:{overflowY:"auto",flex:1}},t.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},t.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},n.name),t.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage)),t.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},t.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),t.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},t.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e))))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return w(i,document.body)},yx=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:a,setShowPopup:i})=>{const s=o(null),[d,p]=c(!1),[u,m]=c(!0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=768),h=()=>{if(s.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;p(e>0),m(e<t-n-10)}};l(()=>{h();const e=s.current;if(e)return e.addEventListener("scroll",h),()=>e.removeEventListener("scroll",h)},[e]),l(()=>{const e=()=>{g(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const x=e=>{if(s.current){const t=f?280:365,n=16,r="right"===e?t+n:-(t+n);s.current.scrollBy({left:r,behavior:"smooth"})}};return t.createElement("div",{style:{position:"relative"}},t.createElement("svg",{style:{position:"absolute",width:0,height:0}},t.createElement("defs",null,t.createElement("mask",{id:"coupon-cut-mask-desktop"},t.createElement("rect",{width:"365",height:"138",fill:"white"}),t.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),t.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),t.createElement("mask",{id:"coupon-cut-mask-mobile"},t.createElement("rect",{width:"280",height:"120",fill:"white"}),t.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),t.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),d&&t.createElement("button",{onClick:()=>x("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(M,{size:20})),u&&t.createElement("button",{onClick:()=>x("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(j,{size:20})),t.createElement("div",{ref:s,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:f?"110px":"128px"}},e?.map(e=>t.createElement("div",{key:e.discountId,style:{flexShrink:0,width:f?"280px":"365px",minWidth:f?"280px":"365px",minHeight:f?"110px":"128px",backgroundColor:"transparent",borderRadius:`${n?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},t.createElement("div",{style:{width:f?"60px":"80px",minHeight:f?"110px":"128px",backgroundColor:n?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:f?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${n?.roundness||0}px`,borderBottomLeftRadius:`${n?.roundness||0}px`}},t.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),n?.iconVisibility&&t.createElement("div",{style:{position:"absolute",left:f?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:f?"32px":"40px",height:f?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:f?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===e.couponType?t.createElement(W,null):t.createElement(To,null)),t.createElement("div",{style:{flex:1,padding:f?"12px 12px":"15px 15px",paddingLeft:f?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${n?.roundness||0}px`,borderBottomRightRadius:`${n?.roundness||0}px`,overflow:"hidden",backgroundColor:n?.cardBackgroundColor||"#ffffff",minWidth:0}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:f?"4px":"6px",lineHeight:"normal"}},t.createElement("div",{style:{fontSize:f?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===e.couponType?"Free Gift":"Special Deal"),t.createElement("div",{style:{fontSize:f?"13px":"15px",fontWeight:"600",color:n?.textColor||"#2c3e50"}},e.name),t.createElement("div",{style:{fontSize:f?"11px":"12px",color:n?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:f?"28px":"32px"}},r(e))),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},t.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a(e),i(!0)},style:{fontSize:f?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},n?.viewDetailsTitle||"View Details")))))),t.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},bx=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:o,setShowPopup:a})=>{const[i,s]=c("undefined"!=typeof window&&window.innerWidth<=768);return l(()=>{const e=()=>{s(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement("div",{style:{borderRadius:`${n?.roundness||8}px`}},e?.map((l,c)=>t.createElement("div",{key:l.discountId,style:{display:"flex",alignItems:"flex-start",gap:i?"8px":"12px",padding:i?"12px 0":"16px 0",paddingLeft:i?"10px":"20px",backgroundColor:!0===n?.cardBackgroundTransparent||"true"===String(n?.cardBackgroundTransparent)?"transparent":n?.cardBackgroundColor||"#ffffff",borderBottom:c<(e?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${n?.roundness||0}px`}},n?.iconVisibility&&t.createElement("div",{style:{width:i?"40px":"50px",height:i?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:i?"20px":"25px",marginTop:i?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===l.couponType?t.createElement(W,null):t.createElement(To,null)),t.createElement("div",{style:{flex:1}},t.createElement("div",{style:{fontSize:i?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},l.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",t.createElement("span",{style:{fontWeight:600,color:n?.textColor||"#34495e"}},l.name)),t.createElement("div",{style:{fontSize:i?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},r(l)),t.createElement("div",{style:{fontSize:i?"11px":"12px",color:"#000000"}},"offer auto applied",t.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),o(l),a(!0)},style:{color:n?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},n?.viewDetailsTitle||"T&C"))))))},vx=e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const r=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?r.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&r.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&r.push("Combines with other order discounts"),t||r.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:r}},wx=e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available",Cx=({offersConfig:e,offers:n})=>{const[r,a]=c(!1),[i,s]=c(null),[d,p]=c(null),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=768),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=450),h=o(null);l(()=>{const e=()=>{m(window.innerWidth<=768),g(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{h.current&&jn(h.current)},[e?.sectionBgContrastColor]);const x=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",r=-1;Object.keys(t).forEach(e=>{t[e]>r&&(r=t[e],n=e)});const o=e.map((e,t)=>({o:e,idx:t})),a=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return o.sort((e,t)=>{const r=e.o.customCartProgressBarCriteria===n,o=t.o.customCartProgressBarCriteria===n;if(r&&o){const n=a(e.o),r=a(t.o);return n!==r?n-r:e.idx-t.idx}return r&&!o?-1:!r&&o?1:e.idx-t.idx}),o.map(e=>e.o)})(n||[]);return t.createElement("div",null,t.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===e?.sectionType?`${e?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:e?.sectionBackgroundColor||"#fff"}},t.createElement("div",{style:{border:"coupon"===e?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=e?.cardPadding?`${e.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===e?.sectionType?`${e?.roundness||8}px`:"0px"}},t.createElement("span",{ref:h,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"right"===e?.alignment?"auto":"50%",right:"right"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===e?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:e?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},e?.sectionTitle||"Available Deals and Offers"),(()=>{const n=e?.sectionType;return"list"===n?t.createElement(bx,{offersToShow:x,offersConfig:e||{},getOfferCardMessage:wx,setSelectedOffer:e=>{s(e),e&&p(vx(e))},setShowPopup:a}):"coupon"===n?t.createElement(yx,{offersToShow:x,offersConfig:e||{},getOfferCardMessage:wx,setSelectedOffer:e=>{s(e),e&&p(vx(e))},setShowPopup:a}):null})(),f?t.createElement(xx,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}):t.createElement(hx,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}))))};export{fx as Bundle,gx as BundleLoader,Pu as Cart,Sa as CouponFrame,Xe as Nudge,Cx as ProductOffers,ot as SpinnerWheel};
|