yt-uikit 0.7.406-scroll-overflow.0 → 0.7.406-scroll-overflow.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -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
|
-
`,sp=({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:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:D,applyDiscount:I,rewardCoupons:_,userTotalPoints:O,checkoutFunction:N,joinNowFunction:P,guestLoyaltyPercentage:A,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:H,guestRewardCoupon:W,showGuestDiscountCoupon:U,applyTemplateDiscount:Q,exploreCtaRedirectLink:G,discountAmountApplied:q,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:K,showDiscountsListToGuestUsers:X,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:Ee,cartSigninCTAMainText:ke,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:De,showEditOptionOnProducts:Ie,onSetLoading:_e,showVariantSelectionDropdownInProductRecs:Oe,originalCartSubtotal:Ne,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:He,enableGeoLocationDeliveryRestriction:We=!1,getProductDetailsByVariantId:Ue,applyPostalCodeAndDeliverySlotToCart:Qe,showDeleteOnFreebies:Ge,freebieCouponTemplates:qe,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Ke,enableSlotPicker:Xe,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:it,enableCustomCartOnCartPage:lt,isCartPage:ct,showCartTimer:st,showFreebieMilestone:ut,freebieMilestoneData:mt,cartTimerInMinutes:ft,cartTimerCustomText:gt,productRecsCardLayout:ht,productRecsCardListVariant:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:Et,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:Dt,prefixMessageText:It,suffixMessageText:_t,successMessageText:Ot,toggleDecimal:Nt,cartOffersCarouselHeight:At,disableCheckoutButton:Rt,showEmptyCartRecommendations:Lt=!1,checkoutButtonBottomSpacing:jt,showPoweredByBadge:Zt,applyCouponCode:Kt,showApplyCoupon:Xt,enableConfetti:Jt,checkoutSectionMessageRedirectLink:tn,showCheckoutButtonPaymentIcons:nn,shouldCheckInventoryQuantity:rn})=>{const on=Pt(Mt),an=Pt(Qt),[ln,cn]=c(!1),[dn,sn]=Ft(Yt),[pn,un]=c(!1),[mn,fn]=c(!0),{setLoading:gn}=Gt();t.useEffect((()=>{_e&&_e(gn)}),[_e]),l((()=>{const t=()=>{n(!1)};return e&&(window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t)),()=>{window.removeEventListener("popstate",t),"open"===window.history.state?.ytCustomCartDrawer&&window.history.back()}}),[e,n]);const[hn,xn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return lt&&ct?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))}),[e,lt,ct]),l((()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const yn=on?.items?.reduce(((e,t)=>e+t?.quantity),0),bn=o(null);l((()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&sn(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{cn(!0),window.setTimeout((()=>cn(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[vn,wn]=c("normal"),[Cn,En]=c("normal"),[kn,Tn]=c("auto");l((()=>{CSS.supports("font-weight","500")?wn("500"):CSS.supports("font-weight","400")?wn("400"):CSS.supports("font-weight","600")&&wn("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")?Tn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Tn("-moz-available")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Cn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",kn)}),[vn,Cn]);const[Sn]=Ft(Vt);Pt(Ht);const[$n]=Ft(Ut),[Bn]=Ft(Wt);l((()=>{const e=on?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));un(e)}),[on?.items,je]);l((()=>{fn(!("all-products"!==Ke&&("specific-tags"!==Ke||Sn.isPostalCodeValid||Xe)&&("specific-tags"!==Ke||Sn.isPostalCodeValid||$n||!Xe)&&("specific-tags"===Ke&&"standard"===Bn||pn&&(Xe?Sn.isPostalCodeValid&&$n:Sn.isPostalCodeValid))))}),[Sn.isPostalCodeValid,$n,pn,Ke,Xe]),Ft(qt);const[zn,Dn]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Dn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Dn(!1)}),[]);const In=new Date("2024-11-01");return en(on?.items_subtotal_price,on?.currency),t.createElement(cp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:lt,$isCartPage:ct,$isLargeScreen:hn,$switchWidthVariant:Dt},an.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},an.showLoader&&!an.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,dn&&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),on?.item_count>0&&H&&!(ve&&H)&&V>0&&t.createElement(ip,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),yn>0&&t.createElement(dp,{$backgroundSubdued:a},yn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(lt&&ct)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(pt,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),an&&t.createElement(np,{$themeColor:ue,show:an.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(Xs,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:At,cartData:on}),st&&zn&&on?.item_count?t.createElement(Is,{minutes:ft,customText:gt,onTimerComplete:()=>{Dn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,ln&&Jt&&t.createElement(Ir,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(ll,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:De,themeTextColor:me}):null),R&&on?.items_subtotal_price>0&&on?.currency&&!!L&&t.createElement(t.Fragment,null,t.createElement(so,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?on?.item_count:Re,currentCartAmount:en(void 0!==Ne?Ne:on?.items_subtotal_price,on.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:it,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:It,suffixMessageText:_t,successMessageText:Ot,enableConfetti:Jt})),on?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===on?.items?.length&&0===on?.item_count&&!1===an?.showSkeletonLoader?t.createElement(ho,{showLoyaltyCta:ve,joinNowFunction:P,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:G,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:Oe,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Lt,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(Ra,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ie,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Ge,freebieCouponTemplates:qe??[],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:kt,checkoutSectionMessageRedirectLink:tn,showFreebieMilestone:ut,freebieMilestoneData:mt}),hn&&se&&!!M&&M?.length>0&&on?.item_count>0&&b&&t.createElement(or,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Oe,cardLayout:ht,variant:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!hn&&pe&&!!M&&M?.length>0&&on?.item_count>0&&b&&t.createElement(or,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Oe,cardLayout:ht,variant:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Io,null,on?.item_count>0&&w&&E&&t.createElement(ja,{bundleProducts:E}),he&&!!xe&&on?.item_count>0&&t.createElement(ei,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!on&&on?.item_count>0&&!!Fe&&!!Pe&&!!Me&&Pe.length>0&&t.createElement(il,{freebieProductsInCart:Pe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:qe,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:rn}),We&&(He?.length??0)>0&&!!Qe&&on?.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:()=>fn(!mn)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(dt,null)),t.createElement("div",{className:"icon-transition"},mn?t.createElement(ot,null):t.createElement(at,null))),"all-products"===Ke&&mn?t.createElement(bs,{postalCodeList:He,themeColor:ue,themeTextColor:me,enableSlotPicker:Xe,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:In}):mn&&(pn?t.createElement(bs,{postalCodeList:He,themeColor:ue,themeTextColor:me,enableSlotPicker:Xe,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:In}):t.createElement(vs,{postalCodeList:He,themeColor:ue,themeTextColor:me,enableSlotPicker:Xe,disabledDates:In}))),$e&&!!Te&&on?.item_count>0&&t.createElement(ti,{note:Se,noteSectionTitle:Et}),nt?.showGiftWrapOption&&on?.item_count>0&&t.createElement(Bs,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),on?.item_count>0&&Xt&&!ve&&Kt&&t.createElement(lp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Kt,removeDiscount:D,enableConfetti:Jt}),on?.item_count>0&&C&&I&&!$t&&Q&&_&&_?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(ea,{themeColor:ue,showGuestDiscountCoupon:U,guestRewardCoupon:W,ref:bn,discountAmountOff:k,userTotalPoints:O??0,applyDiscount:I,applyTemplateDiscount:Q,rewardCoupons:_,isCouponSelectionOpen:dn,setIsCouponSelectionOpen:sn,pointsToBeUsed:S,joinNowFunction:P,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:X}):!!A&&ve&&!!P&&t.createElement(zo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,guestLoyaltyPercentage:A,joinNowFunction:P,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:H})):on?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&on?.item_count>0&&void 0!==k&&void 0!==S&&!!T&&ve&&!!I&&t.createElement(qo,{themeColor:ue,applyDiscount:I,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:H,redemptionMultiplier:B}):on?.item_count>0&&!!A&&!!P&&t.createElement(zo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,themeColor:ue,joinNowFunction:P,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:H})),on?.item_count>0&&!!$t&&!!D&&ve&&$t&&void 0!==S&&t.createElement(Wo,{themeColor:ue,removeDiscount:D,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:H}),ve&&H&&j&&T&&on?.item_count>0&&t.createElement(op,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&on&&on.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:Ee?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),on&&N&&on?.item_count>0&&t.createElement("div",null,t.createElement(ko,{disableCheckoutButton:!!Rt||an.cartLoading,discountApplied:z,checkoutFunction:N,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:K,discountAmountApplied:q,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:Qe,enableSlotPicker:Xe,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:tn,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:Nt,checkoutButtonBottomSpacing:jt,showPoweredByBadge:Zt,showCheckoutButtonPaymentIcons:nn,primaryTextColor:ae}))))))},pp=x.div`
|
|
2238
|
+
`,sp=({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:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:D,applyDiscount:I,rewardCoupons:_,userTotalPoints:O,checkoutFunction:N,joinNowFunction:P,guestLoyaltyPercentage:A,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:H,guestRewardCoupon:W,showGuestDiscountCoupon:U,applyTemplateDiscount:Q,exploreCtaRedirectLink:G,discountAmountApplied:q,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:K,showDiscountsListToGuestUsers:X,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:Ee,cartSigninCTAMainText:ke,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:De,showEditOptionOnProducts:Ie,onSetLoading:_e,showVariantSelectionDropdownInProductRecs:Oe,originalCartSubtotal:Ne,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:He,enableGeoLocationDeliveryRestriction:We=!1,getProductDetailsByVariantId:Ue,applyPostalCodeAndDeliverySlotToCart:Qe,showDeleteOnFreebies:Ge,freebieCouponTemplates:qe,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Ke,enableSlotPicker:Xe,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:it,enableCustomCartOnCartPage:lt,isCartPage:ct,showCartTimer:st,showFreebieMilestone:ut,freebieMilestoneData:mt,cartTimerInMinutes:ft,cartTimerCustomText:gt,productRecsCardLayout:ht,productRecsCardListVariant:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:Et,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:Dt,prefixMessageText:It,suffixMessageText:_t,successMessageText:Ot,toggleDecimal:Nt,cartOffersCarouselHeight:At,disableCheckoutButton:Rt,showEmptyCartRecommendations:Lt=!1,checkoutButtonBottomSpacing:jt,showPoweredByBadge:Zt,applyCouponCode:Kt,showApplyCoupon:Xt,enableConfetti:Jt,checkoutSectionMessageRedirectLink:tn,showCheckoutButtonPaymentIcons:nn,shouldCheckInventoryQuantity:rn})=>{const on=Pt(Mt),an=Pt(Qt),[ln,cn]=c(!1),[dn,sn]=Ft(Yt),[pn,un]=c(!1),[mn,fn]=c(!0),{setLoading:gn}=Gt();t.useEffect((()=>{_e&&_e(gn)}),[_e]),l((()=>{const t=()=>{n(!1)};return e&&(window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t)),()=>{window.removeEventListener("popstate",t),"open"===window.history.state?.ytCustomCartDrawer&&window.history.back()}}),[e,n]);const[hn,xn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return lt&&ct?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(hn?(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,lt,ct,hn]),l((()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const yn=on?.items?.reduce(((e,t)=>e+t?.quantity),0),bn=o(null);l((()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&sn(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{cn(!0),window.setTimeout((()=>cn(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[vn,wn]=c("normal"),[Cn,En]=c("normal"),[kn,Tn]=c("auto");l((()=>{CSS.supports("font-weight","500")?wn("500"):CSS.supports("font-weight","400")?wn("400"):CSS.supports("font-weight","600")&&wn("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")?Tn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Tn("-moz-available")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Cn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",kn)}),[vn,Cn]);const[Sn]=Ft(Vt);Pt(Ht);const[$n]=Ft(Ut),[Bn]=Ft(Wt);l((()=>{const e=on?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));un(e)}),[on?.items,je]);l((()=>{fn(!("all-products"!==Ke&&("specific-tags"!==Ke||Sn.isPostalCodeValid||Xe)&&("specific-tags"!==Ke||Sn.isPostalCodeValid||$n||!Xe)&&("specific-tags"===Ke&&"standard"===Bn||pn&&(Xe?Sn.isPostalCodeValid&&$n:Sn.isPostalCodeValid))))}),[Sn.isPostalCodeValid,$n,pn,Ke,Xe]),Ft(qt);const[zn,Dn]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Dn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Dn(!1)}),[]);const In=new Date("2024-11-01");return en(on?.items_subtotal_price,on?.currency),t.createElement(cp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:lt,$isCartPage:ct,$isLargeScreen:hn,$switchWidthVariant:Dt},an.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},an.showLoader&&!an.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,dn&&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),on?.item_count>0&&H&&!(ve&&H)&&V>0&&t.createElement(ip,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),yn>0&&t.createElement(dp,{$backgroundSubdued:a},yn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(lt&&ct)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(pt,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),an&&t.createElement(np,{$themeColor:ue,show:an.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(Xs,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:At,cartData:on}),st&&zn&&on?.item_count?t.createElement(Is,{minutes:ft,customText:gt,onTimerComplete:()=>{Dn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,ln&&Jt&&t.createElement(Ir,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(ll,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:De,themeTextColor:me}):null),R&&on?.items_subtotal_price>0&&on?.currency&&!!L&&t.createElement(t.Fragment,null,t.createElement(so,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?on?.item_count:Re,currentCartAmount:en(void 0!==Ne?Ne:on?.items_subtotal_price,on.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:it,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:It,suffixMessageText:_t,successMessageText:Ot,enableConfetti:Jt})),on?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===on?.items?.length&&0===on?.item_count&&!1===an?.showSkeletonLoader?t.createElement(ho,{showLoyaltyCta:ve,joinNowFunction:P,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:G,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:Oe,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Lt,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(Ra,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ie,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Ge,freebieCouponTemplates:qe??[],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:kt,checkoutSectionMessageRedirectLink:tn,showFreebieMilestone:ut,freebieMilestoneData:mt}),hn&&se&&!!M&&M?.length>0&&on?.item_count>0&&b&&t.createElement(or,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Oe,cardLayout:ht,variant:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!hn&&pe&&!!M&&M?.length>0&&on?.item_count>0&&b&&t.createElement(or,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Oe,cardLayout:ht,variant:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Io,null,on?.item_count>0&&w&&E&&t.createElement(ja,{bundleProducts:E}),he&&!!xe&&on?.item_count>0&&t.createElement(ei,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!on&&on?.item_count>0&&!!Fe&&!!Pe&&!!Me&&Pe.length>0&&t.createElement(il,{freebieProductsInCart:Pe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:qe,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:rn}),We&&(He?.length??0)>0&&!!Qe&&on?.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:()=>fn(!mn)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(dt,null)),t.createElement("div",{className:"icon-transition"},mn?t.createElement(ot,null):t.createElement(at,null))),"all-products"===Ke&&mn?t.createElement(bs,{postalCodeList:He,themeColor:ue,themeTextColor:me,enableSlotPicker:Xe,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:In}):mn&&(pn?t.createElement(bs,{postalCodeList:He,themeColor:ue,themeTextColor:me,enableSlotPicker:Xe,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:In}):t.createElement(vs,{postalCodeList:He,themeColor:ue,themeTextColor:me,enableSlotPicker:Xe,disabledDates:In}))),$e&&!!Te&&on?.item_count>0&&t.createElement(ti,{note:Se,noteSectionTitle:Et}),nt?.showGiftWrapOption&&on?.item_count>0&&t.createElement(Bs,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),on?.item_count>0&&Xt&&!ve&&Kt&&t.createElement(lp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Kt,removeDiscount:D,enableConfetti:Jt}),on?.item_count>0&&C&&I&&!$t&&Q&&_&&_?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(ea,{themeColor:ue,showGuestDiscountCoupon:U,guestRewardCoupon:W,ref:bn,discountAmountOff:k,userTotalPoints:O??0,applyDiscount:I,applyTemplateDiscount:Q,rewardCoupons:_,isCouponSelectionOpen:dn,setIsCouponSelectionOpen:sn,pointsToBeUsed:S,joinNowFunction:P,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:X}):!!A&&ve&&!!P&&t.createElement(zo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,guestLoyaltyPercentage:A,joinNowFunction:P,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:H})):on?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&on?.item_count>0&&void 0!==k&&void 0!==S&&!!T&&ve&&!!I&&t.createElement(qo,{themeColor:ue,applyDiscount:I,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:H,redemptionMultiplier:B}):on?.item_count>0&&!!A&&!!P&&t.createElement(zo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,themeColor:ue,joinNowFunction:P,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:H})),on?.item_count>0&&!!$t&&!!D&&ve&&$t&&void 0!==S&&t.createElement(Wo,{themeColor:ue,removeDiscount:D,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:H}),ve&&H&&j&&T&&on?.item_count>0&&t.createElement(op,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&on&&on.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:Ee?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),on&&N&&on?.item_count>0&&t.createElement("div",null,t.createElement(ko,{disableCheckoutButton:!!Rt||an.cartLoading,discountApplied:z,checkoutFunction:N,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:K,discountAmountApplied:q,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:Qe,enableSlotPicker:Xe,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:tn,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:Nt,checkoutButtonBottomSpacing:jt,showPoweredByBadge:Zt,showCheckoutButtonPaymentIcons:nn,primaryTextColor:ae}))))))},pp=x.div`
|
|
2239
2239
|
position: relative;
|
|
2240
2240
|
`,up=x.button`
|
|
2241
2241
|
border: 1px solid #ccc;
|