yt-uikit 0.8.12-fix-flash.2 → 0.8.12-fix-flash.3
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
|
@@ -2236,7 +2236,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2236
2236
|
font-weight: 400;
|
|
2237
2237
|
min-width: 14px;
|
|
2238
2238
|
line-height: 14px;
|
|
2239
|
-
`,Vp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,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:S,pointsToBeUsed:T,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:D,rewardCoupons:N,userTotalPoints:_,checkoutFunction:P,joinNowFunction:O,guestLoyaltyPercentage:A,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:G,discountAmountApplied:Y,minimumCartValue:Q,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:se,showProductRecsOnDesktop:de,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:Se,note:Te,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:De,onSetLoading:Ne,showVariantSelectionDropdownInProductRecs:_e,originalCartSubtotal:Pe,freebieProductsInCart:Oe,showFreebieClaim:Ae,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Ge,freebieCouponTemplates:Ye,freebieFlowCheckpoints:Qe,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:St,showVariantSelectionDropdownInProductClaim:Tt,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Dt,suffixMessageText:Nt,successMessageText:_t,toggleDecimal:Pt,cartOffersCarouselHeight:Ot,disableCheckoutButton:At,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht})=>{const qt=sn(un),Ut=sn(wn),[Gt,Yt]=c(!1),[Qt,Zt]=pn(En),[Xt,Kt]=c(!1),[Jt,en]=c(!0),{setLoading:tn}=Cn();t.useEffect(()=>{Ne&&Ne(tn)},[Ne]);const nn=o(!1),rn=o(null),on=o(null);l(()=>{console.debug("[CartDrawer dbg] state snapshot",{runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:316",isOpen:e,historyState:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length,totalItemsDerived:cn,cartLoading:Ut?.cartLoading,showLoader:Ut?.showLoader,showSkeletonLoader:Ut?.showSkeletonLoader,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:316",message:"CartDrawer state snapshot",data:{isOpen:e,historyState:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length,totalItemsDerived:cn,cartLoading:Ut?.cartLoading,showLoader:Ut?.showLoader,showSkeletonLoader:Ut?.showSkeletonLoader},timestamp:Date.now()})}).catch(()=>{})},[e,qt?.item_count,qt?.items?.length,Ut?.cartLoading,Ut?.showLoader,Ut?.showSkeletonLoader]);l(()=>{const t=()=>{console.debug("[CartDrawer dbg] popstate -> forcing closed",{runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:363",isOpen_before:e,historyState:window?.history?.state,wasDrawerOpenRef:nn.current,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:363",message:"popstate -> forcing drawer closed",data:{isOpen_before:e,historyState:window?.history?.state,wasDrawerOpenRef:nn.current},timestamp:Date.now()})}).catch(()=>{}),n(!1)};return e?(nn.current||(rn.current=window.history.state,on.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",t),nn.current=!0):(nn.current&&"open"===window.history.state?.ytCustomCartDrawer&&(fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:replaceState",message:"Closing drawer uses history.replaceState (no history.back)",data:{isOpen:e,historyState_beforeReplace:window?.history?.state,wasDrawerOpenRef:nn.current},timestamp:Date.now()})}).catch(()=>{}),console.debug("[CartDrawer dbg] closing uses history.replaceState (no back)",{runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:replaceState",isOpen:e,historyState_beforeReplace:window?.history?.state,wasDrawerOpenRef:nn.current,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:394",message:"Closing drawer would trigger history.back() (disabled; using replaceState)",data:{isOpen:e,historyState_beforeBack:window?.history?.state,wasDrawerOpenRef:nn.current},timestamp:Date.now()})}).catch(()=>{}),window.history.replaceState(rn.current,"",on.current??window.location.href)),nn.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[an,ln]=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(an?(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,an]),l(()=>{function e(){const e=window.innerWidth;ln(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const cn=qt?.items?.reduce((e,t)=>e+t?.quantity,0),dn=o(null);l(()=>{function e(e){dn.current&&!dn.current.contains(e.target)&&Zt(!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[mn,fn]=c("normal"),[gn,hn]=c("normal"),[Sn,Tn]=c("auto");l(()=>{CSS.supports("font-weight","500")?fn("500"):CSS.supports("font-weight","400")?fn("400"):CSS.supports("font-weight","600")&&fn("600"),CSS.supports("font-weight","400")?hn("400"):CSS.supports("font-weight","300")?hn("300"):CSS.supports("font-weight","200")&&hn("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",mn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",gn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Sn)},[mn,gn]);const[$n]=pn(xn);sn(yn);const[Bn]=pn(vn),[In]=pn(bn);l(()=>{const e=qt?.items.some(e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR"));Kt(e)},[qt?.items,je]);l(()=>{en(!("all-products"!==Xe&&("specific-tags"!==Xe||$n.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||$n.isPostalCodeValid||Bn||!Ke)&&("specific-tags"===Xe&&"standard"===In||Xt&&(Ke?$n.isPostalCodeValid&&Bn:$n.isPostalCodeValid))))},[$n.isPostalCodeValid,Bn,Xt,Xe,Ke]),pn(kn);const[Dn,Nn]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Nn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Nn(!1)},[]);const _n=new Date("2024-11-01");return zn(qt?.items_subtotal_price,qt?.currency),t.createElement(Lp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:an,$switchWidthVariant:It},Ut.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Ut.showLoader&&!Ut.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Qt&&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),qt?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(Mp,{pointsRewardRate:V,loyaltyIcon:S,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),cn>0&&t.createElement(jp,{$backgroundSubdued:a},cn)),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:()=>{console.debug("[CartDrawer dbg] close icon clicked",{runId:"pre-fix",hypothesisId:"D",location:"src/components/Cart/CartDrawer.tsx:349",isOpen_before:e,nextIsOpen_ifToggle:!e,historyState_before:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"D",location:"src/components/Cart/CartDrawer.tsx:349",message:"Close icon clicked",data:{isOpen_before:e,nextIsOpen_ifToggle:!e,historyState_before:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length},timestamp:Date.now()})}).catch(()=>{}),n(!e)}})))),Ut&&t.createElement(Pp,{$themeColor:ue,show:Ut.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(Ip,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:Ot,cartData:qt}),lt&&Dn&&qt?.item_count?t.createElement(sp,{minutes:ut,customText:mt,onTimerComplete:()=>{Nn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(ao,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(Fl,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&qt?.items_subtotal_price>0&&qt?.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?.[Kr(r)]&&("minimum_order_value"!==r||1!==e?.[Kr(r)])).some((e,i)=>Jr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(L,zn(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),void 0===Re?qt?.item_count:Re,te??"minimum_order_value",qt?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Ro,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?qt?.item_count:Re,currentCartAmount:zn(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Dt,suffixMessageText:Nt,successMessageText:_t,enableConfetti:Vt})),qt?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e?0===qt?.items?.length&&0===qt?.item_count&&!1===Ut?.showSkeletonLoader?t.createElement(qo,{showLoyaltyCta:ve,joinNowFunction:O,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,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:_e,emptyProductRecsTitleText:se,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(fi,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:De,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Ge,freebieCouponTemplates:Ye??[],freebieFlowCheckpoints:Qe??[],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:s,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:ct,freebieMilestoneData:pt}),an&&de&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(Nr,{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:s}),!an&&pe&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(Nr,{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:s})):null,t.createElement(ia,null,qt?.item_count>0&&w&&k&&t.createElement(hi,{bundleProducts:k}),he&&!!xe&&qt?.item_count>0&&t.createElement(zi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!qt&&qt?.item_count>0&&!!Fe&&!!Oe&&!!Me&&Oe.length>0&&t.createElement(Al,{freebieProductsInCart:Oe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:Ye,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e}),He&&(We?.length??0)>0&&!!Ue&&qt?.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:()=>en(!Jt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(gt,null)),t.createElement("div",{className:"icon-transition"},Jt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Xe&&Jt?t.createElement(Xd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:_n}):Jt&&(Xt?t.createElement(Xd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:_n}):t.createElement(Kd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:_n}))),$e&&!!Se&&qt?.item_count>0&&t.createElement(Ii,{note:Te,noteSectionTitle:kt}),nt?.showGiftWrapOption&&qt?.item_count>0&&t.createElement(ip,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),qt?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Rp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),qt?.item_count>0&&C&&D&&!$t&&U&&N&&N?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(za,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:dn,discountAmountOff:E,userTotalPoints:_??0,applyDiscount:D,applyTemplateDiscount:U,rewardCoupons:N,isCouponSelectionOpen:Qt,setIsCouponSelectionOpen:Zt,pointsToBeUsed:T,joinNowFunction:O,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!A&&ve&&!!O&&t.createElement(oa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:A,joinNowFunction:O,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):qt?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&qt?.item_count>0&&void 0!==E&&void 0!==T&&!!S&&ve&&!!D&&t.createElement(ka,{themeColor:ue,applyDiscount:D,discountAmountOff:E,loyaltyIcon:S,pointsToBeUsed:T,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):qt?.item_count>0&&!!A&&!!O&&t.createElement(oa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:O,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),qt?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==T&&t.createElement(ba,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:T,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&S&&qt?.item_count>0&&t.createElement(Ap,{loyaltyIcon:S,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&qt&&qt.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),qt&&P&&qt?.item_count>0&&t.createElement("div",null,t.createElement(Jo,{disableCheckoutButton:!!At||Ut.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:Y,minimumCartValue:Q,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Se,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:St,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},Wp=x.div`
|
|
2239
|
+
`,Vp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,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:S,pointsToBeUsed:T,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:D,rewardCoupons:N,userTotalPoints:_,checkoutFunction:P,joinNowFunction:O,guestLoyaltyPercentage:A,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:G,discountAmountApplied:Y,minimumCartValue:Q,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:se,showProductRecsOnDesktop:de,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:Se,note:Te,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:De,onSetLoading:Ne,showVariantSelectionDropdownInProductRecs:_e,originalCartSubtotal:Pe,freebieProductsInCart:Oe,showFreebieClaim:Ae,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Ge,freebieCouponTemplates:Ye,freebieFlowCheckpoints:Qe,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:St,showVariantSelectionDropdownInProductClaim:Tt,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Dt,suffixMessageText:Nt,successMessageText:_t,toggleDecimal:Pt,cartOffersCarouselHeight:Ot,disableCheckoutButton:At,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht})=>{const qt=sn(un),Ut=sn(wn),[Gt,Yt]=c(!1),[Qt,Zt]=pn(En),[Xt,Kt]=c(!1),[Jt,en]=c(!0),{setLoading:tn}=Cn();t.useEffect(()=>{Ne&&Ne(tn)},[Ne]);const nn=o(!1),rn=o(null),on=o(null),an=e?0===qt?.items?.length&&0===qt?.item_count&&!1===Ut?.showSkeletonLoader?"empty":"content":"closed";l(()=>{console.debug("[CartDrawer dbg] state snapshot",{runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:316",isOpen:e,renderBranch:an,historyState:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length,totalItemsDerived:dn,cartLoading:Ut?.cartLoading,showLoader:Ut?.showLoader,showSkeletonLoader:Ut?.showSkeletonLoader,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:316",message:"CartDrawer state snapshot",data:{isOpen:e,renderBranch:an,historyState:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length,totalItemsDerived:dn,cartLoading:Ut?.cartLoading,showLoader:Ut?.showLoader,showSkeletonLoader:Ut?.showSkeletonLoader},timestamp:Date.now()})}).catch(()=>{})},[e,an,qt?.item_count,qt?.items?.length,Ut?.cartLoading,Ut?.showLoader,Ut?.showSkeletonLoader]);l(()=>{const t=()=>{console.debug("[CartDrawer dbg] popstate -> forcing closed",{runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:363",isOpen_before:e,historyState:window?.history?.state,wasDrawerOpenRef:nn.current,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:363",message:"popstate -> forcing drawer closed",data:{isOpen_before:e,historyState:window?.history?.state,wasDrawerOpenRef:nn.current},timestamp:Date.now()})}).catch(()=>{}),n(!1)};return e?(nn.current||(rn.current=window.history.state,on.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",t),nn.current=!0):(nn.current&&"open"===window.history.state?.ytCustomCartDrawer&&(fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:replaceState",message:"Closing drawer uses history.replaceState (no history.back)",data:{isOpen:e,historyState_beforeReplace:window?.history?.state,wasDrawerOpenRef:nn.current},timestamp:Date.now()})}).catch(()=>{}),console.debug("[CartDrawer dbg] closing uses history.replaceState (no back)",{runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:replaceState",isOpen:e,historyState_beforeReplace:window?.history?.state,wasDrawerOpenRef:nn.current,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"A",location:"src/components/Cart/CartDrawer.tsx:394",message:"Closing drawer would trigger history.back() (disabled; using replaceState)",data:{isOpen:e,historyState_beforeBack:window?.history?.state,wasDrawerOpenRef:nn.current},timestamp:Date.now()})}).catch(()=>{}),window.history.replaceState(rn.current,"",on.current??window.location.href)),nn.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[ln,cn]=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(ln?(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,ln]),l(()=>{function e(){const e=window.innerWidth;cn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const dn=qt?.items?.reduce((e,t)=>e+t?.quantity,0),mn=o(null);l(()=>{function e(e){mn.current&&!mn.current.contains(e.target)&&Zt(!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[fn,gn]=c("normal"),[hn,Sn]=c("normal"),[Tn,$n]=c("auto");l(()=>{CSS.supports("font-weight","500")?gn("500"):CSS.supports("font-weight","400")?gn("400"):CSS.supports("font-weight","600")&&gn("600"),CSS.supports("font-weight","400")?Sn("400"):CSS.supports("font-weight","300")?Sn("300"):CSS.supports("font-weight","200")&&Sn("200"),CSS.supports("width","-webkit-fill-available")?$n("-webkit-fill-available"):CSS.supports("width","-moz-available")&&$n("-moz-available")},[]),l(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",fn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",hn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Tn)},[fn,hn]);const[Bn]=pn(xn);sn(yn);const[In]=pn(vn),[Dn]=pn(bn);l(()=>{const e=qt?.items.some(e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR"));Kt(e)},[qt?.items,je]);l(()=>{en(!("all-products"!==Xe&&("specific-tags"!==Xe||Bn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||Bn.isPostalCodeValid||In||!Ke)&&("specific-tags"===Xe&&"standard"===Dn||Xt&&(Ke?Bn.isPostalCodeValid&&In:Bn.isPostalCodeValid))))},[Bn.isPostalCodeValid,In,Xt,Xe,Ke]),pn(kn);const[Nn,_n]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&_n(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&_n(!1)},[]);const Pn=new Date("2024-11-01");return zn(qt?.items_subtotal_price,qt?.currency),t.createElement(Lp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:ln,$switchWidthVariant:It},Ut.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Ut.showLoader&&!Ut.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Qt&&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),qt?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(Mp,{pointsRewardRate:V,loyaltyIcon:S,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),dn>0&&t.createElement(jp,{$backgroundSubdued:a},dn)),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:()=>{console.debug("[CartDrawer dbg] close icon clicked",{runId:"pre-fix",hypothesisId:"D",location:"src/components/Cart/CartDrawer.tsx:349",isOpen_before:e,nextIsOpen_ifToggle:!e,historyState_before:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length,ts:Date.now()}),fetch("http://127.0.0.1:7242/ingest/f4c699a3-34a2-44db-9967-e255352f8719",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:"debug-session",runId:"pre-fix",hypothesisId:"D",location:"src/components/Cart/CartDrawer.tsx:349",message:"Close icon clicked",data:{isOpen_before:e,nextIsOpen_ifToggle:!e,historyState_before:window?.history?.state,wasDrawerOpenRef:nn.current,itemCount:qt?.item_count,itemsLen:qt?.items?.length},timestamp:Date.now()})}).catch(()=>{}),n(!e)}})))),Ut&&t.createElement(Pp,{$themeColor:ue,show:Ut.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(Ip,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:Ot,cartData:qt}),lt&&Nn&&qt?.item_count?t.createElement(sp,{minutes:ut,customText:mt,onTimerComplete:()=>{_n(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(ao,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(Fl,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&qt?.items_subtotal_price>0&&qt?.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?.[Kr(r)]&&("minimum_order_value"!==r||1!==e?.[Kr(r)])).some((e,i)=>Jr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(L,zn(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),void 0===Re?qt?.item_count:Re,te??"minimum_order_value",qt?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Ro,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?qt?.item_count:Re,currentCartAmount:zn(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Dt,suffixMessageText:Nt,successMessageText:_t,enableConfetti:Vt})),qt?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e?0===qt?.items?.length&&0===qt?.item_count&&!1===Ut?.showSkeletonLoader?t.createElement(qo,{showLoyaltyCta:ve,joinNowFunction:O,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,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:_e,emptyProductRecsTitleText:se,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(fi,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:De,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Ge,freebieCouponTemplates:Ye??[],freebieFlowCheckpoints:Qe??[],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:s,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:ct,freebieMilestoneData:pt}),ln&&de&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(Nr,{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:s}),!ln&&pe&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(Nr,{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:s})):null,t.createElement(ia,null,qt?.item_count>0&&w&&k&&t.createElement(hi,{bundleProducts:k}),he&&!!xe&&qt?.item_count>0&&t.createElement(zi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!qt&&qt?.item_count>0&&!!Fe&&!!Oe&&!!Me&&Oe.length>0&&t.createElement(Al,{freebieProductsInCart:Oe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:Ye,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e}),He&&(We?.length??0)>0&&!!Ue&&qt?.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:()=>en(!Jt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(gt,null)),t.createElement("div",{className:"icon-transition"},Jt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Xe&&Jt?t.createElement(Xd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Pn}):Jt&&(Xt?t.createElement(Xd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Pn}):t.createElement(Kd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Pn}))),$e&&!!Se&&qt?.item_count>0&&t.createElement(Ii,{note:Te,noteSectionTitle:kt}),nt?.showGiftWrapOption&&qt?.item_count>0&&t.createElement(ip,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),qt?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Rp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),qt?.item_count>0&&C&&D&&!$t&&U&&N&&N?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(za,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:mn,discountAmountOff:E,userTotalPoints:_??0,applyDiscount:D,applyTemplateDiscount:U,rewardCoupons:N,isCouponSelectionOpen:Qt,setIsCouponSelectionOpen:Zt,pointsToBeUsed:T,joinNowFunction:O,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!A&&ve&&!!O&&t.createElement(oa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:A,joinNowFunction:O,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):qt?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&qt?.item_count>0&&void 0!==E&&void 0!==T&&!!S&&ve&&!!D&&t.createElement(ka,{themeColor:ue,applyDiscount:D,discountAmountOff:E,loyaltyIcon:S,pointsToBeUsed:T,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):qt?.item_count>0&&!!A&&!!O&&t.createElement(oa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:O,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),qt?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==T&&t.createElement(ba,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:T,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&S&&qt?.item_count>0&&t.createElement(Ap,{loyaltyIcon:S,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&qt&&qt.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),qt&&P&&qt?.item_count>0&&t.createElement("div",null,t.createElement(Jo,{disableCheckoutButton:!!At||Ut.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:Y,minimumCartValue:Q,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Se,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:St,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},Wp=x.div`
|
|
2240
2240
|
position: relative;
|
|
2241
2241
|
`,Hp=x.button`
|
|
2242
2242
|
border: 1px solid #ccc;
|