yt-uikit 0.8.2-mixandmatchmodalheightfix.0.3 → 0.8.2

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.
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { Checkpoint } from "./Cart";
3
+ export interface FloatingCartProps {
4
+ setIsCartOpen: (isOpen: boolean) => void;
5
+ isCartOpen?: boolean;
6
+ cartCheckpoints?: Checkpoint[];
7
+ customCartProgressBarCriteria?: string;
8
+ floatingCartData?: FloatingCartDataProps;
9
+ effectiveQuantityForProgressBar?: number;
10
+ cartComponentsCornerType?: "rounded" | "sharp";
11
+ cartComponentsCornerRadius?: number;
12
+ }
13
+ export type FloatingCartDataProps = {
14
+ enableFloatingCart: boolean;
15
+ backgroundColor: string;
16
+ bannerBackgroundColor: string;
17
+ textColor: string;
18
+ buttonColor: string;
19
+ bannerFooterText: string;
20
+ showOnPages: string[];
21
+ };
22
+ declare const FloatingCart: React.FC<FloatingCartProps>;
23
+ export default FloatingCart;
package/dist/esm/index.js CHANGED
@@ -2235,7 +2235,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
2235
2235
  font-weight: 400;
2236
2236
  min-width: 14px;
2237
2237
  line-height: 14px;
2238
- `,Bp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:N,rewardCoupons:D,userTotalPoints:_,checkoutFunction:P,joinNowFunction:A,guestLoyaltyPercentage:O,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:Q,discountAmountApplied:G,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:de,showProductRecsOnDesktop:se,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:ke,cartSigninCTAMainText:Ee,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:Ne,onSetLoading:De,showVariantSelectionDropdownInProductRecs:_e,originalCartSubtotal:Pe,freebieProductsInCart:Ae,showFreebieClaim:Oe,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:ct,freebieMilestoneData:pt,cartTimerInMinutes:ut,cartTimerCustomText:mt,productRecsCardLayout:ft,productRecsCardListVariant:ht,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:kt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,toggleDecimal:Pt,cartOffersCarouselHeight:At,disableCheckoutButton:Ot,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht,shouldCheckInventoryQuantity:qt})=>{const Ut=Zt(Jt),Qt=Zt(cn),[Gt,Yt]=c(!1),[Xt,en]=Kt(pn),[tn,nn]=c(!1),[un,mn]=c(!0),{setLoading:fn}=dn();t.useEffect((()=>{De&&De(fn)}),[De]);const gn=o(!1);l((()=>{const t=()=>{n(!1)};return e?(gn.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),gn.current=!0):(gn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),gn.current=!1),()=>{window.removeEventListener("popstate",t)}}),[e,n]);const[xn,yn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return at&&it?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(xn?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))}),[e,at,it,xn]),l((()=>{function e(){const e=window.innerWidth;yn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const bn=Ut?.items?.reduce(((e,t)=>e+t?.quantity),0),vn=o(null);l((()=>{function e(e){vn.current&&!vn.current.contains(e.target)&&en(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{Yt(!0),window.setTimeout((()=>Yt(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[wn,Cn]=c("normal"),[kn,En]=c("normal"),[Tn,Sn]=c("auto");l((()=>{CSS.supports("font-weight","500")?Cn("500"):CSS.supports("font-weight","400")?Cn("400"):CSS.supports("font-weight","600")&&Cn("600"),CSS.supports("font-weight","400")?En("400"):CSS.supports("font-weight","300")?En("300"):CSS.supports("font-weight","200")&&En("200"),CSS.supports("width","-webkit-fill-available")?Sn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Sn("-moz-available")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",wn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",kn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Tn)}),[wn,kn]);const[$n]=Kt(rn);Zt(on);const[Bn]=Kt(ln),[zn]=Kt(an);l((()=>{const e=Ut?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));nn(e)}),[Ut?.items,je]);l((()=>{mn(!("all-products"!==Xe&&("specific-tags"!==Xe||$n.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||$n.isPostalCodeValid||Bn||!Ke)&&("specific-tags"===Xe&&"standard"===zn||tn&&(Ke?$n.isPostalCodeValid&&Bn:$n.isPostalCodeValid))))}),[$n.isPostalCodeValid,Bn,tn,Xe,Ke]),Kt(sn);const[In,Nn]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Nn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Nn(!1)}),[]);const Dn=new Date("2024-11-01");return hn(Ut?.items_subtotal_price,Ut?.currency),t.createElement(Sp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:xn,$switchWidthVariant:It},Qt.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Qt.showLoader&&!Qt.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Xt&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},"‎"),t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ut?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(Ep,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),bn>0&&t.createElement($p,{$backgroundSubdued:a},bn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(xt,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),Qt&&t.createElement(vp,{$themeColor:ue,show:Qt.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(hp,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:At,cartData:Ut}),lt&&In&&Ut?.item_count?t.createElement(Ys,{minutes:ut,customText:mt,onTimerComplete:()=>{Nn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(Qr,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(El,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&Ut?.items_subtotal_price>0&&Ut?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort(((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold));return a.filter((e=>0!==e?.[Lr(r)]&&("minimum_order_value"!==r||1!==e?.[Lr(r)]))).some(((e,i)=>jr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0))}(L,hn(void 0!==Pe?Pe:Ut?.items_subtotal_price,Ut.currency),void 0===Re?Ut?.item_count:Re,te??"minimum_order_value",Ut?.item_count)&&t.createElement(t.Fragment,null,t.createElement($o,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?Ut?.item_count:Re,currentCartAmount:hn(void 0!==Pe?Pe:Ut?.items_subtotal_price,Ut.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,enableConfetti:Vt})),Ut?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ut?.items?.length&&0===Ut?.item_count&&!1===Qt?.showSkeletonLoader?t.createElement(_o,{showLoyaltyCta:ve,joinNowFunction:A,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:Q,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:M,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ni,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ne,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:yt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:ct,freebieMilestoneData:pt}),xn&&se&&!!M&&M?.length>0&&Ut?.item_count>0&&b&&t.createElement(vr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:ht,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!xn&&pe&&!!M&&M?.length>0&&Ut?.item_count>0&&b&&t.createElement(vr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:ht,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Go,null,Ut?.item_count>0&&w&&k&&t.createElement(oi,{bundleProducts:k}),he&&!!xe&&Ut?.item_count>0&&t.createElement(xi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!Ut&&Ut?.item_count>0&&!!Fe&&!!Ae&&!!Me&&Ae.length>0&&t.createElement(kl,{freebieProductsInCart:Ae,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:Ge,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:qt}),He&&(We?.length??0)>0&&!!Ue&&Ut?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>mn(!un)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(gt,null)),t.createElement("div",{className:"icon-transition"},un?t.createElement(dt,null):t.createElement(st,null))),"all-products"===Xe&&un?t.createElement(Fs,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):un&&(tn?t.createElement(Fs,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):t.createElement(Ms,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Dn}))),$e&&!!Te&&Ut?.item_count>0&&t.createElement(yi,{note:Se,noteSectionTitle:kt}),nt?.showGiftWrapOption&&Ut?.item_count>0&&t.createElement(Us,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),Ut?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Tp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),Ut?.item_count>0&&C&&N&&!$t&&U&&D&&D?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(xa,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:vn,discountAmountOff:E,userTotalPoints:_??0,applyDiscount:N,applyTemplateDiscount:U,rewardCoupons:D,isCouponSelectionOpen:Xt,setIsCouponSelectionOpen:en,pointsToBeUsed:S,joinNowFunction:A,guestLoyaltyPercentage:O,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!O&&ve&&!!A&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:O,joinNowFunction:A,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):Ut?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&Ut?.item_count>0&&void 0!==E&&void 0!==S&&!!T&&ve&&!!N&&t.createElement(pa,{themeColor:ue,applyDiscount:N,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):Ut?.item_count>0&&!!O&&!!A&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:A,guestLoyaltyPercentage:O,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),Ut?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==S&&t.createElement(la,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&T&&Ut?.item_count>0&&t.createElement(Cp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&Ut&&Ut.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),Ut&&P&&Ut?.item_count>0&&t.createElement("div",null,t.createElement(jo,{disableCheckoutButton:!!Ot||Qt.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:G,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},zp=x.div`
2238
+ `,Bp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:N,rewardCoupons:D,userTotalPoints:_,checkoutFunction:P,joinNowFunction:A,guestLoyaltyPercentage:O,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:Q,discountAmountApplied:G,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:de,showProductRecsOnDesktop:se,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:ke,cartSigninCTAMainText:Ee,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:Ne,onSetLoading:De,showVariantSelectionDropdownInProductRecs:_e,originalCartSubtotal:Pe,freebieProductsInCart:Ae,showFreebieClaim:Oe,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:ct,freebieMilestoneData:pt,cartTimerInMinutes:ut,cartTimerCustomText:mt,productRecsCardLayout:ft,productRecsCardListVariant:ht,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:kt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,toggleDecimal:Pt,cartOffersCarouselHeight:At,disableCheckoutButton:Ot,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht,shouldCheckInventoryQuantity:qt})=>{const Ut=Zt(Jt),Qt=Zt(cn),[Gt,Yt]=c(!1),[Xt,en]=Kt(pn),[tn,nn]=c(!1),[un,mn]=c(!0),{setLoading:fn}=dn();t.useEffect((()=>{De&&De(fn)}),[De]);const gn=o(!1);l((()=>{const t=()=>{n(!1)};return e?(gn.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),gn.current=!0):(gn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),gn.current=!1),()=>{window.removeEventListener("popstate",t)}}),[e,n]);const[xn,yn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return at&&it?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(xn?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))}),[e,at,it,xn]),l((()=>{function e(){const e=window.innerWidth;yn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const bn=Ut?.items?.reduce(((e,t)=>e+t?.quantity),0),vn=o(null);l((()=>{function e(e){vn.current&&!vn.current.contains(e.target)&&en(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{Yt(!0),window.setTimeout((()=>Yt(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[wn,Cn]=c("normal"),[kn,En]=c("normal"),[Tn,Sn]=c("auto");l((()=>{CSS.supports("font-weight","500")?Cn("500"):CSS.supports("font-weight","400")?Cn("400"):CSS.supports("font-weight","600")&&Cn("600"),CSS.supports("font-weight","400")?En("400"):CSS.supports("font-weight","300")?En("300"):CSS.supports("font-weight","200")&&En("200"),CSS.supports("width","-webkit-fill-available")?Sn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Sn("-moz-available")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",wn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",kn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Tn)}),[wn,kn]);const[$n]=Kt(rn);Zt(on);const[Bn]=Kt(ln),[zn]=Kt(an);l((()=>{const e=Ut?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));nn(e)}),[Ut?.items,je]);l((()=>{mn(!("all-products"!==Xe&&("specific-tags"!==Xe||$n.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||$n.isPostalCodeValid||Bn||!Ke)&&("specific-tags"===Xe&&"standard"===zn||tn&&(Ke?$n.isPostalCodeValid&&Bn:$n.isPostalCodeValid))))}),[$n.isPostalCodeValid,Bn,tn,Xe,Ke]),Kt(sn);const[In,Nn]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Nn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Nn(!1)}),[]);const Dn=new Date("2024-11-01");return hn(Ut?.items_subtotal_price,Ut?.currency),t.createElement(Sp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:xn,$switchWidthVariant:It},Qt.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Qt.showLoader&&!Qt.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Xt&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},"‎"),t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ut?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(Ep,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),bn>0&&t.createElement($p,{$backgroundSubdued:a},bn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(xt,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),Qt&&t.createElement(vp,{$themeColor:ue,show:Qt.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(hp,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:At,cartData:Ut}),lt&&In&&Ut?.item_count?t.createElement(Ys,{minutes:ut,customText:mt,onTimerComplete:()=>{Nn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(Qr,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(El,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&Ut?.items_subtotal_price>0&&Ut?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort(((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold));return a.filter((e=>0!==e?.[Lr(r)]&&("minimum_order_value"!==r||1!==e?.[Lr(r)]))).some(((e,i)=>jr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0))}(L,hn(void 0!==Pe?Pe:Ut?.items_subtotal_price,Ut.currency),void 0===Re?Ut?.item_count:Re,te??"minimum_order_value",Ut?.item_count)&&t.createElement(t.Fragment,null,t.createElement($o,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?Ut?.item_count:Re,currentCartAmount:hn(void 0!==Pe?Pe:Ut?.items_subtotal_price,Ut.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,enableConfetti:Vt})),Ut?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ut?.items?.length&&0===Ut?.item_count&&!1===Qt?.showSkeletonLoader?t.createElement(_o,{showLoyaltyCta:ve,joinNowFunction:A,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:Q,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:M,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ni,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ne,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:yt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:ct,freebieMilestoneData:pt}),xn&&se&&!!M&&M?.length>0&&Ut?.item_count>0&&b&&t.createElement(vr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:ht,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!xn&&pe&&!!M&&M?.length>0&&Ut?.item_count>0&&b&&t.createElement(vr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:ht,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Go,null,Ut?.item_count>0&&w&&k&&t.createElement(oi,{bundleProducts:k}),he&&!!xe&&Ut?.item_count>0&&t.createElement(xi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!Ut&&Ut?.item_count>0&&!!Fe&&!!Ae&&!!Me&&Ae.length>0&&t.createElement(kl,{freebieProductsInCart:Ae,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:Ge,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:qt}),He&&(We?.length??0)>0&&!!Ue&&Ut?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>mn(!un)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(gt,null)),t.createElement("div",{className:"icon-transition"},un?t.createElement(dt,null):t.createElement(st,null))),"all-products"===Xe&&un?t.createElement(Fs,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):un&&(tn?t.createElement(Fs,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):t.createElement(Ms,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Dn}))),$e&&!!Te&&Ut?.item_count>0&&t.createElement(yi,{note:Se,noteSectionTitle:kt}),nt?.showGiftWrapOption&&Ut?.item_count>0&&t.createElement(Us,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),Ut?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Tp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),Ut?.item_count>0&&C&&N&&!$t&&U&&D&&D?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(xa,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:vn,discountAmountOff:E,userTotalPoints:_??0,applyDiscount:N,applyTemplateDiscount:U,rewardCoupons:D,isCouponSelectionOpen:Xt,setIsCouponSelectionOpen:en,pointsToBeUsed:S,joinNowFunction:A,guestLoyaltyPercentage:O,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!O&&ve&&!!A&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:O,joinNowFunction:A,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):Ut?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&Ut?.item_count>0&&void 0!==E&&void 0!==S&&!!T&&ve&&!!N&&t.createElement(pa,{themeColor:ue,applyDiscount:N,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):Ut?.item_count>0&&!!O&&!!A&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:A,guestLoyaltyPercentage:O,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),Ut?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==S&&t.createElement(la,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&T&&Ut?.item_count>0&&t.createElement(Cp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&Ut&&Ut.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),Ut&&P&&Ut?.item_count>0&&t.createElement("div",null,t.createElement(jo,{disableCheckoutButton:!!Ot||Qt.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:G,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},zp=x.div`
2239
2239
  position: relative;
2240
2240
  `,Ip=x.button`
2241
2241
  border: 1px solid #ccc;
@@ -3957,7 +3957,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
3957
3957
  }
3958
3958
 
3959
3959
  @media (max-width: 400px) {
3960
- grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
3960
+ grid-template-columns: repeat(auto-fit, minmax(109px, 1fr));
3961
3961
  gap: 6px;
3962
3962
  }
3963
3963
  `,tg=x.div`
@@ -4240,7 +4240,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4240
4240
  @media (max-width: 600px) {
4241
4241
  box-sizing: border-box;
4242
4242
  width: 100% ;
4243
- max-height: 57%;
4243
+ max-height: 37vh;
4244
4244
  position: absolute;
4245
4245
  left: 0;
4246
4246
  right: 0;
@@ -4308,7 +4308,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4308
4308
  flex-direction: column;
4309
4309
  gap: 12px;
4310
4310
  @media (max-width: 600px) {
4311
- max-height: 100%;
4311
+ max-height: calc(37vh - 80px);
4312
4312
  }
4313
4313
 
4314
4314
  `,hg=x.div`
@@ -4411,7 +4411,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4411
4411
  font-size: 11px;
4412
4412
  padding: 4px 8px;
4413
4413
  }
4414
- `,Tg=({bundle:e,addToCartFunction:n})=>{const[r,a]=c({}),[d,s]=c(!1),[p,u]=c(0),[m,f]=c(0),[g,h]=c(""),[x,y]=c([]),[b,v]=c({}),[w,C]=c(!1),[k,E]=c(window.innerWidth<450),T=e.builderTiers?.productTier||[],{originalPrice:S,dealPrice:$,offerValue:B}=i((()=>{const t=[];let n=0;Object.values(r).forEach((e=>{e.productId&&e.variantId&&(t.push({productId:e.productId,variantId:e.variantId}),n++)}));let o=0,a=0;for(const{productId:n,variantId:r}of t){const t=e.products.find((e=>e.productId===n));if(!t)continue;const i=t.productDetails.variants.edges.find((e=>e.node.id===r))?.node;if(!i)continue;const l=Number.parseFloat(i.price||"0"),c=Number.parseFloat(i.compareAtPrice||"0");o+=l,a+=c>0?c:l}let i=o;(n===T.length||e?.dealAmount)&&(e?.percentageOff?i=o*(1-e.percentageOff/100):e?.dealAmount?i=e.dealAmount:e?.amountOff&&e.amountOff<o&&(i=o-e.amountOff));const l=a||o,c=l-i;return{originalPrice:l.toFixed(2),dealPrice:i.toFixed(2),offerValue:c.toFixed(2)}}),[e,r,T.length]);l((()=>{u(T.length-Object.keys(r).length)}),[r]),l((()=>{const e={};let t=!1;T.forEach(((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o.variantIds?.[0]||I(o.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}})),t&&a((t=>({...t,...e})))}),[T]),l((()=>{if(null===m||0===T.length)return;const t=T[m].products.map((e=>e.productId)),n=new Map;e.products.forEach((e=>{t.includes(e.productId)&&!n.has(e.productId)&&n.set(e.productId,e)}));let r=Array.from(n.values());if(""!==g.trim()){const e=g.toLowerCase();r=r.filter((t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some((t=>t.node.title.toLowerCase().includes(e)))))}y(r)}),[g,e.products,m,T]);const z=t=>{const n=e.products.find((e=>e.productId===t));return n?.productDetails},I=t=>{const n=e.products.find((e=>e.productId===t));if(!n||!n.productDetails.variants.edges.length)return"";const r=n.productDetails.variants.edges.find((e=>e.node.inventoryQuantity>0))?.node;return r?r.id:n.productDetails.variants.edges[0].node.id},N=(e,t)=>{if(null==m)return;const n=t||I(e);a((t=>({...t,[m]:{productId:e,variantId:n}}))),s(!1),h("")},D=e=>{a((t=>{const n={...t};return delete n[e],n})),v({})};console.log("version 8 ");const _=t=>{const n=T[t];if(console.log("Opening product selection for tier:",t,n),n.isFixed)return;f(t),s(!0),h("");const r=n.products.map((e=>e.productId)),o=e.products.filter((e=>r.includes(e.productId))),a=new Map;o.forEach((e=>{a.has(e.productId)||a.set(e.productId,e)})),console.log("Filtered products for tier:",Array.from(a.values())),y(Array.from(a.values()))};l((()=>{const e=()=>{E(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const P=e.customizations,A=k,O="bundles"===e.appName?e.pageHeader?.title:e?.title,F="bundles"===e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(Qf,{verticalMargin:P.comboBundle.verticalMargin,borderRadius:"20px"},P.comboBundle.embedContentVisibility&&t.createElement(Gf,null,P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:P.comboBundle.infoAlignment||"left"}},t.createElement("h2",{style:{fontSize:"28px",color:P.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},O)),P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number($)>1&&t.createElement(t.Fragment,null,t.createElement(Yf,{infoAlignment:P.comboBundle.infoAlignment},t.createElement(Zf,null,Yh(P.general.currencySymbol,e.storeCurrencyCode),Gh($)),Number($)<Number(S)&&t.createElement(Xf,{style:{minWidth:"fit-content"}},Yh(P.general.currencySymbol,e.storeCurrencyCode)," ",Gh(S)),t.createElement(Kf,{style:{minWidth:"fit-content"}},"In Stock")),t.createElement(Jf,{style:{textAlign:P.comboBundle.infoAlignment||"left",fontSize:P.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),t.createElement(eg,{gridSize:T.length,isHorizontal:A},T.map(((e,n)=>{const a=(e=>!!r[e]&&!!r[e].productId)(n),{product:i,variantId:c}=(e=>{const t=r?.[e];return t?{product:z(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(n),d=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find((e=>e.node.id===t));return n?.node})(i,c):null,s=e.isFixed,p=o(null);return l((()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")}),[d?.displayName,d?.title]),a&&i?t.createElement(tg,{key:`tier-${n}`,onClick:()=>!s&&_(n),style:{borderRadius:"20px",cursor:s?"default":"pointer"},isHorizontal:A,infoAlignment:P.comboBundle.infoAlignment},!s&&t.createElement(lg,{onClick:e=>{e.stopPropagation(),D(n)}},"×"),t.createElement(rg,{src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,style:{aspectRatio:P?.general.imageAspectRatio||"1/1"},isHorizontal:A}),t.createElement(og,{style:{color:"#1e1e1e",textAlign:"center",...A&&"right"===P.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...A&&"left"===P.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!A&&"left"===P.comboBundle.infoAlignment&&{padding:"0 10px"},...A&&"center"===P.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:A},t.createElement(ig,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},t.createElement("span",null,i?.title," - ",d?.title)))):t.createElement(ng,{key:`tier-${n}`,onClick:()=>!s&&_(n),isHorizontal:A,infoAlignment:P.comboBundle.infoAlignment,style:{cursor:s?"default":"pointer"}},s?t.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),t.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},e.title||`Product ${n+1}`)):t.createElement(t.Fragment,null,t.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},t.createElement(cg,null,"+")),t.createElement(ag,{style:{fontSize:"15px",fontWeight:"600",color:P.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:A,infoAlignment:P.comboBundle.infoAlignment},t.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},e.title?`${e.title}`:`Select Product ${n+1}`))))}))),t.createElement(dg,{hoverProperties:{customizeHoverState:P.general.customizeHoverState,backgroundColor:P.general.ctaHoverBackgroundColor,textColor:P.general.ctaHoverTextColor},borderRadius:P.general.ctaBorderRadius,primaryBgColor:P.general.ctaBackgroundColor,onClick:async()=>{C(!0);try{if(p>0)return console.log("Please select all products"),void C(!1);const t=Object.values(r).map((e=>e.variantId)),o=Object.values(r).map((t=>{const n=e.products.find((e=>e.productId===t.productId));if(!n)return null;const r=n?.productDetails?.variants?.edges?.find((e=>e.node.id===t.variantId))?.node;return r?{variantId:t.variantId,price:Number(r.price)}:null})).filter(Boolean);await n(t.length,t,Number($),o)}catch(e){console.log("Add to cart error:",e)}finally{C(!1)}},textColor:P.general.ctaTextColor,borderColor:P.general.ctaBorderColor},0===p?w?t.createElement(ta,{color:"white",loading:w,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,P.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${p} more item(s)`),P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:P.general.primaryColor+"20",textAlign:P.comboBundle.infoAlignment||"left"}},"Description"),t.createElement("div",{style:{fontSize:P.comboBundle.productDescriptionFontSize||"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:P.general.primaryColor+"08",textAlign:P.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:F}})),d&&t.createElement(sg,{onClick:()=>s(!1)},t.createElement(pg,{onClick:e=>e.stopPropagation()},t.createElement(ug,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},t.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},t.createElement(mg,{placeholder:"Search",value:g,onChange:e=>{h(e.target.value)}}),t.createElement(fg,{onClick:()=>s(!1)},"Cancel")),t.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),t.createElement("div",{style:{marginBottom:k?"20px":"5px"}},t.createElement(gg,null,x.length>0?x.map((n=>{const o=n.productDetails,a=(e=>{if(null==m)return!1;const t=r?.[m];return!!t&&t.productId===e})(n.productId),i=I(n.productId);let l=i||"";return l=a&&null!==m?r?.[m]?.variantId||l:b[n.productId]||i,t.createElement(hg,{className:"mixAndMatch-product-item",primaryBgColor:P.general.primaryColor||"#1e1e1e",key:o.id,isSelected:a,onClick:()=>{N(n.productId,l)}},t.createElement(xg,{className:"mixAndMatch-vendor-image",src:o.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:o.title}),t.createElement(yg,{className:"mixAndMatch-vendor-info"},t.createElement(bg,{className:"mixAndMatch-vendor-name"},o.title),t.createElement(kg,{className:"mixAndMatch-variant-options"},o.variants.edges.map((({node:e})=>e.inventoryQuantity>0&&t.createElement(Eg,{className:"mixAndMatch-variant-button "+(l===e.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:P.general?.primaryColor,disabled:!!a,key:e.id,isSelected:l===e.id,tierHasProductId:!!a,onClick:t=>{var r,o;t.stopPropagation(),r=n.productId,o=e.id,v((e=>({...e,[r]:o})))}},e.title))))),t.createElement(vg,{cornerRadiusType:e?.cornerRadiusType??"",primaryBgColor:P.general?.primaryColor||"#1e1e1e",onClick:()=>a?D(m||0):N(n.productId,l)},a?t.createElement(wg,null,"Added"):" + Add"))})):t.createElement(Cg,null,'No products found matching "',g,'"'))))))},Sg=x.div`
4414
+ `,Tg=({bundle:e,addToCartFunction:n})=>{const[r,a]=c({}),[d,s]=c(!1),[p,u]=c(0),[m,f]=c(0),[g,h]=c(""),[x,y]=c([]),[b,v]=c({}),[w,C]=c(!1),[k,E]=c(window.innerWidth<450),T=e.builderTiers?.productTier||[],{originalPrice:S,dealPrice:$,offerValue:B}=i((()=>{const t=[];let n=0;Object.values(r).forEach((e=>{e.productId&&e.variantId&&(t.push({productId:e.productId,variantId:e.variantId}),n++)}));let o=0,a=0;for(const{productId:n,variantId:r}of t){const t=e.products.find((e=>e.productId===n));if(!t)continue;const i=t.productDetails.variants.edges.find((e=>e.node.id===r))?.node;if(!i)continue;const l=Number.parseFloat(i.price||"0"),c=Number.parseFloat(i.compareAtPrice||"0");o+=l,a+=c>0?c:l}let i=o;(n===T.length||e?.dealAmount)&&(e?.percentageOff?i=o*(1-e.percentageOff/100):e?.dealAmount?i=e.dealAmount:e?.amountOff&&e.amountOff<o&&(i=o-e.amountOff));const l=a||o,c=l-i;return{originalPrice:l.toFixed(2),dealPrice:i.toFixed(2),offerValue:c.toFixed(2)}}),[e,r,T.length]);l((()=>{u(T.length-Object.keys(r).length)}),[r]),l((()=>{const e={};let t=!1;T.forEach(((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o.variantIds?.[0]||I(o.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}})),t&&a((t=>({...t,...e})))}),[T]),l((()=>{if(null===m||0===T.length)return;const t=T[m].products.map((e=>e.productId)),n=new Map;e.products.forEach((e=>{t.includes(e.productId)&&!n.has(e.productId)&&n.set(e.productId,e)}));let r=Array.from(n.values());if(""!==g.trim()){const e=g.toLowerCase();r=r.filter((t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some((t=>t.node.title.toLowerCase().includes(e)))))}y(r)}),[g,e.products,m,T]);const z=t=>{const n=e.products.find((e=>e.productId===t));return n?.productDetails},I=t=>{const n=e.products.find((e=>e.productId===t));if(!n||!n.productDetails.variants.edges.length)return"";const r=n.productDetails.variants.edges.find((e=>e.node.inventoryQuantity>0))?.node;return r?r.id:n.productDetails.variants.edges[0].node.id},N=(e,t)=>{if(null==m)return;const n=t||I(e);a((t=>({...t,[m]:{productId:e,variantId:n}}))),s(!1),h("")},D=e=>{a((t=>{const n={...t};return delete n[e],n})),v({})};console.log("version 8 ");const _=t=>{const n=T[t];if(console.log("Opening product selection for tier:",t,n),n.isFixed)return;f(t),s(!0),h("");const r=n.products.map((e=>e.productId)),o=e.products.filter((e=>r.includes(e.productId))),a=new Map;o.forEach((e=>{a.has(e.productId)||a.set(e.productId,e)})),console.log("Filtered products for tier:",Array.from(a.values())),y(Array.from(a.values()))};l((()=>{const e=()=>{E(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const P=e.customizations,A=k,O="bundles"===e.appName?e.pageHeader?.title:e?.title,F="bundles"===e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(Qf,{verticalMargin:P.comboBundle.verticalMargin,borderRadius:"20px"},P.comboBundle.embedContentVisibility&&t.createElement(Gf,null,P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:P.comboBundle.infoAlignment||"left"}},t.createElement("h2",{style:{fontSize:"28px",color:P.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},O)),P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number($)>1&&t.createElement(t.Fragment,null,t.createElement(Yf,{infoAlignment:P.comboBundle.infoAlignment},t.createElement(Zf,null,Yh(P.general.currencySymbol,e.storeCurrencyCode),Gh($)),Number($)<Number(S)&&t.createElement(Xf,{style:{minWidth:"fit-content"}},Yh(P.general.currencySymbol,e.storeCurrencyCode)," ",Gh(S)),t.createElement(Kf,{style:{minWidth:"fit-content"}},"In Stock")),t.createElement(Jf,{style:{textAlign:P.comboBundle.infoAlignment||"left",fontSize:P.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),t.createElement(eg,{gridSize:T.length,isHorizontal:A},T.map(((e,n)=>{const a=(e=>!!r[e]&&!!r[e].productId)(n),{product:i,variantId:c}=(e=>{const t=r?.[e];return t?{product:z(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(n),d=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find((e=>e.node.id===t));return n?.node})(i,c):null,s=e.isFixed,p=o(null);return l((()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")}),[d?.displayName,d?.title]),a&&i?t.createElement(tg,{key:`tier-${n}`,onClick:()=>!s&&_(n),style:{borderRadius:"20px",cursor:s?"default":"pointer"},isHorizontal:A,infoAlignment:P.comboBundle.infoAlignment},!s&&t.createElement(lg,{onClick:e=>{e.stopPropagation(),D(n)}},"×"),t.createElement(rg,{src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,style:{aspectRatio:P?.general.imageAspectRatio||"1/1"},isHorizontal:A}),t.createElement(og,{style:{color:"#1e1e1e",textAlign:"center",...A&&"right"===P.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...A&&"left"===P.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!A&&"left"===P.comboBundle.infoAlignment&&{padding:"0 10px"},...A&&"center"===P.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:A},t.createElement(ig,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},t.createElement("span",null,i?.title," - ",d?.title)))):t.createElement(ng,{key:`tier-${n}`,onClick:()=>!s&&_(n),isHorizontal:A,infoAlignment:P.comboBundle.infoAlignment,style:{cursor:s?"default":"pointer"}},s?t.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),t.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},e.title||`Product ${n+1}`)):t.createElement(t.Fragment,null,t.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},t.createElement(cg,null,"+")),t.createElement(ag,{style:{fontSize:"15px",fontWeight:"600",color:P.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:A,infoAlignment:P.comboBundle.infoAlignment},t.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},e.title?`${e.title}`:`Select Product ${n+1}`))))}))),t.createElement(dg,{hoverProperties:{customizeHoverState:P.general.customizeHoverState,backgroundColor:P.general.ctaHoverBackgroundColor,textColor:P.general.ctaHoverTextColor},borderRadius:P.general.ctaBorderRadius,primaryBgColor:P.general.ctaBackgroundColor,onClick:async()=>{C(!0);try{if(p>0)return console.log("Please select all products"),void C(!1);const t=Object.values(r).map((e=>e.variantId)),o=Object.values(r).map((t=>{const n=e.products.find((e=>e.productId===t.productId));if(!n)return null;const r=n?.productDetails?.variants?.edges?.find((e=>e.node.id===t.variantId))?.node;return r?{variantId:t.variantId,price:Number(r.price)}:null})).filter(Boolean);await n(t.length,t,Number($),o)}catch(e){console.log("Add to cart error:",e)}finally{C(!1)}},textColor:P.general.ctaTextColor,borderColor:P.general.ctaBorderColor},0===p?w?t.createElement(ta,{color:"white",loading:w,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,P.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${p} more item(s)`),P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:P.general.primaryColor+"20",textAlign:P.comboBundle.infoAlignment||"left"}},"Description"),t.createElement("div",{style:{fontSize:P.comboBundle.productDescriptionFontSize||"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:P.general.primaryColor+"08",textAlign:P.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:F}})),d&&t.createElement(sg,{onClick:()=>s(!1)},t.createElement(pg,{onClick:e=>e.stopPropagation()},t.createElement(ug,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},t.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},t.createElement(mg,{placeholder:"Search",value:g,onChange:e=>{h(e.target.value)}}),t.createElement(fg,{onClick:()=>s(!1)},"Cancel")),t.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),t.createElement(gg,null,x.length>0?x.map((n=>{const o=n.productDetails,a=(e=>{if(null==m)return!1;const t=r?.[m];return!!t&&t.productId===e})(n.productId),i=I(n.productId);let l=i||"";return l=a&&null!==m?r?.[m]?.variantId||l:b[n.productId]||i,t.createElement(hg,{className:"mixAndMatch-product-item",primaryBgColor:P.general.primaryColor||"#1e1e1e",key:o.id,isSelected:a,onClick:()=>{N(n.productId,l)}},t.createElement(xg,{className:"mixAndMatch-vendor-image",src:o.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:o.title}),t.createElement(yg,{className:"mixAndMatch-vendor-info"},t.createElement(bg,{className:"mixAndMatch-vendor-name"},o.title),t.createElement(kg,{className:"mixAndMatch-variant-options"},o.variants.edges.map((({node:e})=>e.inventoryQuantity>0&&t.createElement(Eg,{className:"mixAndMatch-variant-button "+(l===e.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:P.general?.primaryColor,disabled:!!a,key:e.id,isSelected:l===e.id,tierHasProductId:!!a,onClick:t=>{var r,o;t.stopPropagation(),r=n.productId,o=e.id,v((e=>({...e,[r]:o})))}},e.title))))),t.createElement(vg,{cornerRadiusType:e?.cornerRadiusType??"",primaryBgColor:P.general?.primaryColor||"#1e1e1e",onClick:()=>a?D(m||0):N(n.productId,l)},a?t.createElement(wg,null,"Added"):" + Add"))})):t.createElement(Cg,null,'No products found matching "',g,'"')))))},Sg=x.div`
4415
4415
  border-radius: 8px;
4416
4416
  container-type: inline-size;
4417
4417
  `,$g=x.div`
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { Checkpoint } from "./Cart";
3
+ export interface FloatingCartProps {
4
+ setIsCartOpen: (isOpen: boolean) => void;
5
+ isCartOpen?: boolean;
6
+ cartCheckpoints?: Checkpoint[];
7
+ customCartProgressBarCriteria?: string;
8
+ floatingCartData?: FloatingCartDataProps;
9
+ effectiveQuantityForProgressBar?: number;
10
+ cartComponentsCornerType?: "rounded" | "sharp";
11
+ cartComponentsCornerRadius?: number;
12
+ }
13
+ export type FloatingCartDataProps = {
14
+ enableFloatingCart: boolean;
15
+ backgroundColor: string;
16
+ bannerBackgroundColor: string;
17
+ textColor: string;
18
+ buttonColor: string;
19
+ bannerFooterText: string;
20
+ showOnPages: string[];
21
+ };
22
+ declare const FloatingCart: React.FC<FloatingCartProps>;
23
+ export default FloatingCart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.8.2-mixandmatchmodalheightfix.0.3",
3
+ "version": "0.8.2",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import "./ProductGridSkeleton.css";
3
- type ProductGridSkeletonProps = {};
4
- declare const ProductGridSkeleton: React.FC<ProductGridSkeletonProps>;
5
- export default ProductGridSkeleton;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { BundleProps } from "../Bundle";
3
- export default function VolumeBundle({ bundle, addToCartFunction, currentProductId, }: BundleProps): React.JSX.Element;
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- type FreebieClaimProps = {
3
- freebieProductsInCart: any;
4
- freebieSectionTitle?: string;
5
- themeColor?: string;
6
- themeTextColor?: string;
7
- checkpoints?: any;
8
- addFreebieToCart?: (variantId: string, originalAllowedVariantIds?: string[]) => Promise<void>;
9
- freebiesInCart: string[];
10
- showFreebieClaimAsPopup?: boolean;
11
- productClaimCtaButtonText?: string;
12
- imageAspectSelector?: "square" | "portrait";
13
- freebieCouponTemplates?: any;
14
- };
15
- export declare const FreebieClaimPopup: React.ForwardRefExoticComponent<FreebieClaimProps & React.RefAttributes<HTMLDivElement>>;
16
- declare const FreebieClaim: React.FC<FreebieClaimProps>;
17
- export default FreebieClaim;
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const VariantSelectionPopupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const ModalContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
- $themeColor?: string | undefined;
5
- $cornerRadius?: number | undefined;
6
- $backgroundColor?: string | undefined;
7
- }>> & string;
8
- export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
- export declare const ProductDetails: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const ProductImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
11
- export declare const ProductInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
- export declare const ProductTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
13
- $themeColor?: string | undefined;
14
- }>> & string;
15
- export declare const ProductPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
- primaryTextColor?: string | undefined;
17
- }>> & string;
18
- export declare const OriginalPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
19
- export declare const ViewDetailsLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
20
- export declare const OptionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- export declare const OptionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
22
- export declare const OptionsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
23
- export declare const VariantOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
24
- $isSelected?: boolean | undefined;
25
- $isDisabled?: boolean | undefined;
26
- $themeColor?: string | undefined;
27
- backgroundColor?: string | undefined;
28
- }>> & string;
29
- export declare const CartButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
30
- $themeColor: string;
31
- }>> & string;
32
- export declare const LoaderContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
- export declare const QuantitySelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
34
- export declare const MainSelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
- $backgroundColor: string;
36
- }>> & string;
37
- export declare const FlexContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
38
- export declare const DetailsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
39
- export declare const PriceSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
40
- export declare const LinkSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
41
- export declare const ActionsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
42
- export declare const ReplaceButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
43
- export declare const ReplaceButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
44
- $themeColor?: string | undefined;
45
- $cornerRadius?: number | undefined;
46
- $cornerType?: string | undefined;
47
- $disabled?: boolean | undefined;
48
- }>> & string;
49
- export declare const ReplaceButtonContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1 +0,0 @@
1
- export declare function useShadowConfetti(): (options: any) => void;
@@ -1 +0,0 @@
1
- export declare const ytBundleShadowCss: string;
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import "./ProductGridSkeleton.css";
3
- type ProductGridSkeletonProps = {};
4
- declare const ProductGridSkeleton: React.FC<ProductGridSkeletonProps>;
5
- export default ProductGridSkeleton;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { BundleProps } from "../Bundle";
3
- export default function VolumeBundle({ bundle, addToCartFunction, currentProductId, }: BundleProps): React.JSX.Element;
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- type FreebieClaimProps = {
3
- freebieProductsInCart: any;
4
- freebieSectionTitle?: string;
5
- themeColor?: string;
6
- themeTextColor?: string;
7
- checkpoints?: any;
8
- addFreebieToCart?: (variantId: string, originalAllowedVariantIds?: string[]) => Promise<void>;
9
- freebiesInCart: string[];
10
- showFreebieClaimAsPopup?: boolean;
11
- productClaimCtaButtonText?: string;
12
- imageAspectSelector?: "square" | "portrait";
13
- freebieCouponTemplates?: any;
14
- };
15
- export declare const FreebieClaimPopup: React.ForwardRefExoticComponent<FreebieClaimProps & React.RefAttributes<HTMLDivElement>>;
16
- declare const FreebieClaim: React.FC<FreebieClaimProps>;
17
- export default FreebieClaim;
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const VariantSelectionPopupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const ModalContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
- $themeColor?: string | undefined;
5
- $cornerRadius?: number | undefined;
6
- $backgroundColor?: string | undefined;
7
- }>> & string;
8
- export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
- export declare const ProductDetails: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const ProductImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
11
- export declare const ProductInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
- export declare const ProductTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
13
- $themeColor?: string | undefined;
14
- }>> & string;
15
- export declare const ProductPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
- primaryTextColor?: string | undefined;
17
- }>> & string;
18
- export declare const OriginalPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
19
- export declare const ViewDetailsLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
20
- export declare const OptionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- export declare const OptionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
22
- export declare const OptionsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
23
- export declare const VariantOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
24
- $isSelected?: boolean | undefined;
25
- $isDisabled?: boolean | undefined;
26
- $themeColor?: string | undefined;
27
- backgroundColor?: string | undefined;
28
- }>> & string;
29
- export declare const CartButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
30
- $themeColor: string;
31
- }>> & string;
32
- export declare const LoaderContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
- export declare const QuantitySelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
34
- export declare const MainSelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
- $backgroundColor: string;
36
- }>> & string;
37
- export declare const FlexContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
38
- export declare const DetailsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
39
- export declare const PriceSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
40
- export declare const LinkSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
41
- export declare const ActionsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
42
- export declare const ReplaceButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
43
- export declare const ReplaceButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
44
- $themeColor?: string | undefined;
45
- $cornerRadius?: number | undefined;
46
- $cornerType?: string | undefined;
47
- $disabled?: boolean | undefined;
48
- }>> & string;
49
- export declare const ReplaceButtonContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1 +0,0 @@
1
- export declare function useShadowConfetti(): (options: any) => void;
@@ -1 +0,0 @@
1
- export declare const ytBundleShadowCss: string;