yt-uikit 0.8.23-gift-wrap-product-image.2 → 0.8.23-gift-wrap-product-image.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 CHANGED
@@ -1943,7 +1943,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
1943
1943
  font-size: 12px;
1944
1944
  margin-top: 5px;
1945
1945
  padding: 0 20px;
1946
- `,Xd=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Kd({themeColor:e,id:n,showPrice:r,detail:o,errorText:a,customText:i,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,f]=un(Hd),[g,x]=c(null),[h,y]=c(!1),[b,v]=c(null),{setLoading:w}=kn();l(()=>{o?.availableForSale&&y(!0),o?.variants?.nodes&&o?.variants?.nodes.length>0&&x(o?.variants?.nodes[0])},[o]);const C=g?.price?.amount,k=g?.image?.url||o?.featuredImage?.url;return console.log("yt::kit gift wrap showProductImage:",d),h?t.createElement(Ud,null,t.createElement(Qd,null,t.createElement(Yd,null,d&&k?t.createElement(qd,{src:k,alt:"Gift wrap",className:"yt-cart-gift-wrap-product-image"}):s?t.createElement(pt,{size:24,color:e,style:{height:"24px",width:"24px"}}):null,i||"+ Gift-Wrap",r?t.createElement("span",{style:{color:e}},"₹",Number(C).toFixed(0)):""),t.createElement(Gd,{type:"checkbox",checked:m,onChange:async()=>{try{w(!0,!0),v(null),f(!m),!m&&p&&g?await p(Xd(g?.id),1):m&&u&&g&&await u(Xd(g?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),f(m),console.error("Error updating gift wrap:",e)}},$themeColor:e,disabled:!h})),b&&t.createElement(Zd,null,b)):null}const Jd=h.div`
1946
+ `,Xd=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Kd({themeColor:e,id:n,showPrice:r,detail:o,errorText:a,customText:i,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,f]=un(Hd),[g,x]=c(null),[h,y]=c(!1),[b,v]=c(null),{setLoading:w}=kn();l(()=>{o?.availableForSale&&y(!0),o?.variants?.nodes&&o?.variants?.nodes.length>0&&x(o?.variants?.nodes[0])},[o]);const C=g?.price?.amount,k=g?.image?.url||o?.featuredImage?.url;return h?t.createElement(Ud,null,t.createElement(Qd,null,t.createElement(Yd,null,d&&k?t.createElement(qd,{src:k,alt:"Gift wrap",className:"yt-cart-gift-wrap-product-image"}):s?t.createElement(pt,{size:24,color:e,style:{height:"24px",width:"24px"}}):null,i||"+ Gift-Wrap",r?t.createElement("span",{style:{color:e}},"₹",Number(C).toFixed(0)):""),t.createElement(Gd,{type:"checkbox",checked:m,onChange:async()=>{try{w(!0,!0),v(null),f(!m),!m&&p&&g?await p(Xd(g?.id),1):m&&u&&g&&await u(Xd(g?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),f(m),console.error("Error updating gift wrap:",e)}},$themeColor:e,disabled:!h})),b&&t.createElement(Zd,null,b)):null}const Jd=h.div`
1947
1947
  margin-top: 10px;
1948
1948
  margin-bottom: 5px;
1949
1949
  margin-left: 1rem;
@@ -2245,7 +2245,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
2245
2245
  font-weight: 400;
2246
2246
  min-width: 14px;
2247
2247
  line-height: 14px;
2248
- `,Pp=({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:x,handleIncrement:h,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,rewardMultiplier:T,redemptionMultiplier:$,discountApplied:B,removeDiscount:z,applyDiscount:I,checkoutFunction:N,joinNowFunction:D,guestLoyaltyPercentage:_,isDev:P,recProductsList:O,showMultiStepProgressBar:F,cartCheckpoints:A,redemptionRate:M,pointsRewardRate:R,showCartLevelAltPay:L,exploreCtaRedirectLink:j,discountAmountApplied:V,minimumCartValue:W,discountInCheckoutButton:H,isStickyCheckout:q,handleCheckpointCrossed:U,customCartProgressBarCriteria:Q,checkoutButtonColor:Y="#252E69",ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,productRecsCtaButtonText:J,productRecsTitleText:ee,emptyProductRecsTitleText:te,showProductRecsOnDesktop:ne,showProductRecsOnMobile:re,themeColor:oe,themeTextColor:ae,companyName:ie,gstNumber:le,showGSTOption:ce,applyGSTToCart:se,showMOVForProgressTiers:de,freeProduct:pe,showLoyaltyCta:ue=!1,freeProductAdjustedCartTotal:me,minimumOrderValueToAvailDiscount:fe,signinCTAButtonVisible:ge,cartSigninCTAMainText:xe,applyNoteToCart:he,note:ye,showNoteOption:be,inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,cartOfferTermsAndConditionsText:Ce,showEditOptionOnProducts:ke,onSetLoading:Ee,showVariantSelectionDropdownInProductRecs:Se,originalCartSubtotal:Te,freebieProductsInCart:$e,showFreebieClaim:Be,addFreebieToCart:ze,freebiesInCart:Ie,effectiveQuantityForProgressBar:Ne,productPercentageOffMapping:De,removeFreebieFromCart:_e,postalCodeList:Pe,enableGeoLocationDeliveryRestriction:Oe=!1,getProductDetailsByVariantId:Fe,applyPostalCodeAndDeliverySlotToCart:Ae,showDeleteOnFreebies:Me,freebieCouponTemplates:Re,freebieFlowCheckpoints:Le,freebieClaimData:je,postalCodeBasedItemTrackingParameter:Ve,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,giftWrapSetupData:Qe,giftWrapProductDetail:Ye,progressBarFreeProductIconType:Ge,enableCustomCartOnCartPage:Ze,isCartPage:Xe,showCartTimer:Ke,showFreebieMilestone:Je,freebieMilestoneData:et,cartTimerInMinutes:tt,cartTimerCustomText:nt,productRecsCardLayout:rt,productRecsCardListVariant:ot,imageAspectSelector:at,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,cartOffersCarousalData:ct,gstSectionCustomizationData:pt,noteSectionTitle:ut,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,showVariantSelectionDropdownInProductClaim:gt,loyaltyDiscount:ht,brandTokenName:bt,showDiscountOnMRP:vt,switchWidthVariant:wt,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,toggleDecimal:St,cartOffersCarouselHeight:Tt,disableCheckoutButton:$t,showEmptyCartRecommendations:Bt=!1,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,applyCouponCode:Nt,showApplyCoupon:Dt,enableConfetti:_t,checkoutSectionMessageRedirectLink:Pt,showCheckoutButtonPaymentIcons:Ot})=>{const Ft=dn(mn),At=dn(Cn),[Mt,Rt]=c(!1),[Lt,jt]=c(!1),[Vt,Wt]=c(!0),{setLoading:Ht}=kn();t.useEffect(()=>{Ee&&Ee(Ht)},[Ee]);const qt=o(!1);l(()=>{const t=()=>{n(!1)};return e?(qt.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),qt.current=!0):(qt.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),qt.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[Ut,Qt]=c(!1);l(()=>{const t=document.querySelector("body");if(t)return Ze&&Xe?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(Ut?(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,Ze,Xe,Ut]),l(()=>{function e(){const e=window.innerWidth;Qt(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const Yt=Ft?.items?.reduce((e,t)=>e+t?.quantity,0);l(()=>{const e=()=>{Rt(!0),window.setTimeout(()=>Rt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[Gt,Zt]=c("normal"),[Xt,Kt]=c("normal"),[Jt,en]=c("auto");l(()=>{CSS.supports("font-weight","500")?Zt("500"):CSS.supports("font-weight","400")?Zt("400"):CSS.supports("font-weight","600")&&Zt("600"),CSS.supports("font-weight","400")?Kt("400"):CSS.supports("font-weight","300")?Kt("300"):CSS.supports("font-weight","200")&&Kt("200"),CSS.supports("width","-webkit-fill-available")?en("-webkit-fill-available"):CSS.supports("width","-moz-available")&&en("-moz-available")},[]),l(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",Gt),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Xt),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Jt)},[Gt,Xt]);const[tn]=un(yn),[nn]=un(wn),[rn]=un(vn);l(()=>{Wt(!("all-products"!==Ve&&("specific-tags"!==Ve||tn.isPostalCodeValid||We)&&("specific-tags"!==Ve||tn.isPostalCodeValid||nn||!We)&&("specific-tags"===Ve&&"standard"===rn||Lt&&(We?tn.isPostalCodeValid&&nn:tn.isPostalCodeValid))))},[tn.isPostalCodeValid,nn,Lt,Ve,We]),un(En);const[on,an]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&an(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&an(!1)},[]);const ln=new Date("2024-11-01");return zn(Ft?.items_subtotal_price,Ft?.currency),t.createElement(Dp,{className:"yt-cart-drawer",$isDev:P,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:Ze,$isCartPage:Xe,$isLargeScreen:Ut,$switchWidthVariant:wt},At.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},At.showLoader&&!At.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",null,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:X,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ft?.item_count>0&&L&&!(ue&&L)&&R>0&&t.createElement(Ip,{pointsRewardRate:R,loyaltyIcon:E,brandTokenName:bt,themeColor:oe,themeTextColor:ae,rewardMultiplier:T}),Yt>0&&t.createElement(_p,{$backgroundSubdued:a},Yt)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(Ze&&Xe)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(yt,{style:{height:"auto",width:"auto",color:X},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),At&&t.createElement(Tp,{$themeColor:oe,show:At.showLoader}),ct?.enableCartOffersCarousel&&t.createElement(Cp,{themeColor:oe,cartOffersCarousalData:ct,cartOffersCarouselHeight:Tt,cartData:Ft}),Ke&&on&&Ft?.item_count?t.createElement(tp,{minutes:tt,customText:nt,onTimerComplete:()=>{an(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Mt&&_t&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3}}),ve?t.createElement(Bl,{inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,themeColor:oe,tooltipText:Ce,themeTextColor:ae}):null),F&&Ft?.items_subtotal_price>0&&Ft?.currency&&!!A&&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?.[Xr(r)]&&("minimum_order_value"!==r||1!==e?.[Xr(r)])).some((e,i)=>Kr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(A,zn(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),void 0===Ne?Ft?.item_count:Ne,Q??"minimum_order_value",Ft?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Oo,{customCartProgressBarCriteria:Q??"minimum_order_value",handleCheckpointCrossed:U,checkpoints:A,effectiveQuantityForProgressBar:void 0===Ne?Ft?.item_count:Ne,currentCartAmount:zn(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),themeColor:oe,themeTextColor:ae,primaryTextColor:X,secondaryTextColor:K,showMOVForProgressTiers:de,progressBarFreeProductIconType:Ge,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,enableConfetti:_t})),Ft?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ft?.items?.length&&0===Ft?.item_count&&!1===At?.showSkeletonLoader?t.createElement(jo,{showLoyaltyCta:ue,joinNowFunction:D,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:j,themeColor:oe,emptyCartButtons:g,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,themeTextColor:ae,recProductsList:O,addCartItem:b,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,emptyProductRecsTitleText:te,backgroundSubdued:a,showEmptyCartRecommendations:Bt,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ai,{isDev:P,themeColor:oe,handleDecrement:y,handleIncrement:h,removeCartItem:x,addCartItem:b,primaryTextColor:X,secondaryTextColor:K,freeProduct:pe,themeTextColor:ae,showEditOptionOnProducts:ke,productPercentageOffMapping:De,removeFreebieFromCart:_e,showDeleteOnFreebies:Me,freebieCouponTemplates:Re??[],freebieFlowCheckpoints:Le??[],cartCheckpoints:A,freeProductAdjustedCartTotal:me,imageAspectSelector:at,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,giftWrapVariantId:Ye?.variants?.nodes[0]?.id,giftWrapProductId:Qe?.giftProductId,showGiftWrapAsLineItem:Qe?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s,backgroundColor:r,showDiscountOnMRP:vt,checkoutSectionMessage:mt,checkoutSectionMessageRedirectLink:Pt,showFreebieMilestone:Je,freebieMilestoneData:et}),Ut&&ne&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:s}),!Ut&&re&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s})),t.createElement(ra,null,Ft?.item_count>0&&w&&C&&t.createElement(li,{bundleProducts:C}),ce&&!!se&&Ft?.item_count>0&&t.createElement(vi,{companyName:ie,gstNumber:le,themeColor:oe,iconColor:pt?.iconColor,showIcon:pt?.showIcon,backgroundColor:pt?.backgroundColor,textColor:pt?.textColor,title:pt?.title}),!!Ft&&Ft?.item_count>0&&!!ze&&!!$e&&!!Ie&&$e.length>0&&t.createElement($l,{freebieProductsInCart:$e,themeColor:oe,themeTextColor:ae,primaryTextColor:X,addFreebieToCart:ze,freebiesInCart:Ie,imageAspectSelector:at,freebieCouponTemplates:Re,freebieClaimData:je,cartCheckpoints:A,isCartDrawerOpen:e}),Oe&&(Pe?.length??0)>0&&!!Ae&&Ft?.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:()=>Wt(!Vt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(xt,null)),t.createElement("div",{className:"icon-transition"},Vt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Ve&&Vt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):Vt&&(Lt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):t.createElement(Wd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,disabledDates:ln}))),be&&!!he&&Ft?.item_count>0&&t.createElement(wi,{note:ye,noteSectionTitle:ut}),Qe?.showGiftWrapOption&&Ft?.item_count>0&&t.createElement(Kd,{themeColor:oe,id:Qe?.giftProductId,detail:Ye,showPrice:Qe?.showPrice,errorText:Qe?.errorText,customText:Qe?.customText,showGiftIcon:Qe?.showGiftIcon,addCartItem:b,removeCartItem:x}),Ft?.item_count>0&&Dt&&!ue&&Nt&&t.createElement(Np,{backgroundSubdued:a,themeColor:oe,themeTextColor:ae,primaryTextColor:X,cartComponentsCornerRadius:lt,applyCouponCode:Nt,removeDiscount:z,enableConfetti:_t}),Ft?.item_count>0&&t.createElement(t.Fragment,null,v||!ue||ht?!ht&&void 0!==k&&void 0!==S&&!!E&&ue&&!!I&&t.createElement(va,{themeColor:oe,applyDiscount:I,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,minimumOrderValueToAvailDiscount:fe,brandTokenName:bt,showCartLevelAltPay:L,redemptionMultiplier:$}):!!_&&!!D&&t.createElement(ta,{cartSigninCTAMainText:xe,signinCTAButtonVisible:ge,themeColor:oe,joinNowFunction:D,guestLoyaltyPercentage:_,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,showCartLevelAltPay:L})),Ft?.item_count>0&&!!ht&&!!z&&ue&&ht&&void 0!==S&&t.createElement(xa,{themeColor:oe,removeDiscount:z,loyaltyDiscount:ht,isDev:P,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,pointsToBeUsed:S,brandTokenName:bt,showCartLevelAltPay:L}),ue&&L&&M&&E&&Ft?.item_count>0&&t.createElement(Bp,{loyaltyIcon:E,backgroundSubdued:a,primaryTextColor:X,pointsRewardRate:R,rewardMultiplier:T}),ue&&Ft&&Ft.item_count>0&&!!fe&&fe>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:oe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ge?"space-between":"center"}},"Minimum order value to use ",bt,":"," ",fe),Ft&&N&&Ft?.item_count>0&&t.createElement("div",null,t.createElement(Zo,{disableCheckoutButton:!!$t||At.cartLoading,discountApplied:B,checkoutFunction:N,checkoutButtonColor:Y,checkoutFontSize:p,discountInCheckoutButton:H,isStickyCheckout:q,discountAmountApplied:V,minimumCartValue:W,themeTextColor:ae,applyGSTToCart:se,showGSTOption:ce,applyNoteToCart:he,showNoteOption:be,enableGeoLocationDeliveryRestriction:Oe,applyPostalCodeAndDeliverySlotToCart:Ae,enableSlotPicker:We,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,checkoutSectionMessageRedirectLink:Pt,showDiscountOnMRP:vt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:A,toggleDecimal:St,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,showCheckoutButtonPaymentIcons:Ot,primaryTextColor:X}))))))},Op=h.div`
2248
+ `,Pp=({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:x,handleIncrement:h,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,rewardMultiplier:T,redemptionMultiplier:$,discountApplied:B,removeDiscount:z,applyDiscount:I,checkoutFunction:N,joinNowFunction:D,guestLoyaltyPercentage:_,isDev:P,recProductsList:O,showMultiStepProgressBar:F,cartCheckpoints:A,redemptionRate:M,pointsRewardRate:R,showCartLevelAltPay:L,exploreCtaRedirectLink:j,discountAmountApplied:V,minimumCartValue:W,discountInCheckoutButton:H,isStickyCheckout:q,handleCheckpointCrossed:U,customCartProgressBarCriteria:Q,checkoutButtonColor:Y="#252E69",ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,productRecsCtaButtonText:J,productRecsTitleText:ee,emptyProductRecsTitleText:te,showProductRecsOnDesktop:ne,showProductRecsOnMobile:re,themeColor:oe,themeTextColor:ae,companyName:ie,gstNumber:le,showGSTOption:ce,applyGSTToCart:se,showMOVForProgressTiers:de,freeProduct:pe,showLoyaltyCta:ue=!1,freeProductAdjustedCartTotal:me,minimumOrderValueToAvailDiscount:fe,signinCTAButtonVisible:ge,cartSigninCTAMainText:xe,applyNoteToCart:he,note:ye,showNoteOption:be,inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,cartOfferTermsAndConditionsText:Ce,showEditOptionOnProducts:ke,onSetLoading:Ee,showVariantSelectionDropdownInProductRecs:Se,originalCartSubtotal:Te,freebieProductsInCart:$e,showFreebieClaim:Be,addFreebieToCart:ze,freebiesInCart:Ie,effectiveQuantityForProgressBar:Ne,productPercentageOffMapping:De,removeFreebieFromCart:_e,postalCodeList:Pe,enableGeoLocationDeliveryRestriction:Oe=!1,getProductDetailsByVariantId:Fe,applyPostalCodeAndDeliverySlotToCart:Ae,showDeleteOnFreebies:Me,freebieCouponTemplates:Re,freebieFlowCheckpoints:Le,freebieClaimData:je,postalCodeBasedItemTrackingParameter:Ve,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,giftWrapSetupData:Qe,giftWrapProductDetail:Ye,progressBarFreeProductIconType:Ge,enableCustomCartOnCartPage:Ze,isCartPage:Xe,showCartTimer:Ke,showFreebieMilestone:Je,freebieMilestoneData:et,cartTimerInMinutes:tt,cartTimerCustomText:nt,productRecsCardLayout:rt,productRecsCardListVariant:ot,imageAspectSelector:at,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,cartOffersCarousalData:ct,gstSectionCustomizationData:pt,noteSectionTitle:ut,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,showVariantSelectionDropdownInProductClaim:gt,loyaltyDiscount:ht,brandTokenName:bt,showDiscountOnMRP:vt,switchWidthVariant:wt,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,toggleDecimal:St,cartOffersCarouselHeight:Tt,disableCheckoutButton:$t,showEmptyCartRecommendations:Bt=!1,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,applyCouponCode:Nt,showApplyCoupon:Dt,enableConfetti:_t,checkoutSectionMessageRedirectLink:Pt,showCheckoutButtonPaymentIcons:Ot})=>{const Ft=dn(mn),At=dn(Cn),[Mt,Rt]=c(!1),[Lt,jt]=c(!1),[Vt,Wt]=c(!0),{setLoading:Ht}=kn();t.useEffect(()=>{Ee&&Ee(Ht)},[Ee]);const qt=o(!1);l(()=>{const t=()=>{n(!1)};return e?(qt.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),qt.current=!0):(qt.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),qt.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[Ut,Qt]=c(!1);l(()=>{const t=document.querySelector("body");if(t)return Ze&&Xe?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(Ut?(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,Ze,Xe,Ut]),l(()=>{function e(){const e=window.innerWidth;Qt(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const Yt=Ft?.items?.reduce((e,t)=>e+t?.quantity,0);l(()=>{const e=()=>{Rt(!0),window.setTimeout(()=>Rt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[Gt,Zt]=c("normal"),[Xt,Kt]=c("normal"),[Jt,en]=c("auto");l(()=>{CSS.supports("font-weight","500")?Zt("500"):CSS.supports("font-weight","400")?Zt("400"):CSS.supports("font-weight","600")&&Zt("600"),CSS.supports("font-weight","400")?Kt("400"):CSS.supports("font-weight","300")?Kt("300"):CSS.supports("font-weight","200")&&Kt("200"),CSS.supports("width","-webkit-fill-available")?en("-webkit-fill-available"):CSS.supports("width","-moz-available")&&en("-moz-available")},[]),l(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",Gt),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Xt),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Jt)},[Gt,Xt]);const[tn]=un(yn),[nn]=un(wn),[rn]=un(vn);l(()=>{Wt(!("all-products"!==Ve&&("specific-tags"!==Ve||tn.isPostalCodeValid||We)&&("specific-tags"!==Ve||tn.isPostalCodeValid||nn||!We)&&("specific-tags"===Ve&&"standard"===rn||Lt&&(We?tn.isPostalCodeValid&&nn:tn.isPostalCodeValid))))},[tn.isPostalCodeValid,nn,Lt,Ve,We]),un(En);const[on,an]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&an(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&an(!1)},[]);const ln=new Date("2024-11-01");return zn(Ft?.items_subtotal_price,Ft?.currency),t.createElement(Dp,{className:"yt-cart-drawer",$isDev:P,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:Ze,$isCartPage:Xe,$isLargeScreen:Ut,$switchWidthVariant:wt},At.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},At.showLoader&&!At.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",null,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:X,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ft?.item_count>0&&L&&!(ue&&L)&&R>0&&t.createElement(Ip,{pointsRewardRate:R,loyaltyIcon:E,brandTokenName:bt,themeColor:oe,themeTextColor:ae,rewardMultiplier:T}),Yt>0&&t.createElement(_p,{$backgroundSubdued:a},Yt)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(Ze&&Xe)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(yt,{style:{height:"auto",width:"auto",color:X},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),At&&t.createElement(Tp,{$themeColor:oe,show:At.showLoader}),ct?.enableCartOffersCarousel&&t.createElement(Cp,{themeColor:oe,cartOffersCarousalData:ct,cartOffersCarouselHeight:Tt,cartData:Ft}),Ke&&on&&Ft?.item_count?t.createElement(tp,{minutes:tt,customText:nt,onTimerComplete:()=>{an(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Mt&&_t&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3}}),ve?t.createElement(Bl,{inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,themeColor:oe,tooltipText:Ce,themeTextColor:ae}):null),F&&Ft?.items_subtotal_price>0&&Ft?.currency&&!!A&&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?.[Xr(r)]&&("minimum_order_value"!==r||1!==e?.[Xr(r)])).some((e,i)=>Kr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(A,zn(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),void 0===Ne?Ft?.item_count:Ne,Q??"minimum_order_value",Ft?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Oo,{customCartProgressBarCriteria:Q??"minimum_order_value",handleCheckpointCrossed:U,checkpoints:A,effectiveQuantityForProgressBar:void 0===Ne?Ft?.item_count:Ne,currentCartAmount:zn(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),themeColor:oe,themeTextColor:ae,primaryTextColor:X,secondaryTextColor:K,showMOVForProgressTiers:de,progressBarFreeProductIconType:Ge,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,enableConfetti:_t})),Ft?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ft?.items?.length&&0===Ft?.item_count&&!1===At?.showSkeletonLoader?t.createElement(jo,{showLoyaltyCta:ue,joinNowFunction:D,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:j,themeColor:oe,emptyCartButtons:g,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,themeTextColor:ae,recProductsList:O,addCartItem:b,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,emptyProductRecsTitleText:te,backgroundSubdued:a,showEmptyCartRecommendations:Bt,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ai,{isDev:P,themeColor:oe,handleDecrement:y,handleIncrement:h,removeCartItem:x,addCartItem:b,primaryTextColor:X,secondaryTextColor:K,freeProduct:pe,themeTextColor:ae,showEditOptionOnProducts:ke,productPercentageOffMapping:De,removeFreebieFromCart:_e,showDeleteOnFreebies:Me,freebieCouponTemplates:Re??[],freebieFlowCheckpoints:Le??[],cartCheckpoints:A,freeProductAdjustedCartTotal:me,imageAspectSelector:at,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,giftWrapVariantId:Ye?.variants?.nodes[0]?.id,giftWrapProductId:Qe?.giftProductId,showGiftWrapAsLineItem:Qe?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s,backgroundColor:r,showDiscountOnMRP:vt,checkoutSectionMessage:mt,checkoutSectionMessageRedirectLink:Pt,showFreebieMilestone:Je,freebieMilestoneData:et}),Ut&&ne&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:s}),!Ut&&re&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s})),t.createElement(ra,null,Ft?.item_count>0&&w&&C&&t.createElement(li,{bundleProducts:C}),ce&&!!se&&Ft?.item_count>0&&t.createElement(vi,{companyName:ie,gstNumber:le,themeColor:oe,iconColor:pt?.iconColor,showIcon:pt?.showIcon,backgroundColor:pt?.backgroundColor,textColor:pt?.textColor,title:pt?.title}),!!Ft&&Ft?.item_count>0&&!!ze&&!!$e&&!!Ie&&$e.length>0&&t.createElement($l,{freebieProductsInCart:$e,themeColor:oe,themeTextColor:ae,primaryTextColor:X,addFreebieToCart:ze,freebiesInCart:Ie,imageAspectSelector:at,freebieCouponTemplates:Re,freebieClaimData:je,cartCheckpoints:A,isCartDrawerOpen:e}),Oe&&(Pe?.length??0)>0&&!!Ae&&Ft?.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:()=>Wt(!Vt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(xt,null)),t.createElement("div",{className:"icon-transition"},Vt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Ve&&Vt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):Vt&&(Lt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):t.createElement(Wd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,disabledDates:ln}))),be&&!!he&&Ft?.item_count>0&&t.createElement(wi,{note:ye,noteSectionTitle:ut}),Qe?.showGiftWrapOption&&Ft?.item_count>0&&t.createElement(Kd,{themeColor:oe,id:Qe?.giftProductId,detail:Ye,showPrice:Qe?.showPrice,errorText:Qe?.errorText,customText:Qe?.customText,showGiftIcon:Qe?.showGiftIcon,showProductImage:Qe?.showProductImage,addCartItem:b,removeCartItem:x}),Ft?.item_count>0&&Dt&&!ue&&Nt&&t.createElement(Np,{backgroundSubdued:a,themeColor:oe,themeTextColor:ae,primaryTextColor:X,cartComponentsCornerRadius:lt,applyCouponCode:Nt,removeDiscount:z,enableConfetti:_t}),Ft?.item_count>0&&t.createElement(t.Fragment,null,v||!ue||ht?!ht&&void 0!==k&&void 0!==S&&!!E&&ue&&!!I&&t.createElement(va,{themeColor:oe,applyDiscount:I,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,minimumOrderValueToAvailDiscount:fe,brandTokenName:bt,showCartLevelAltPay:L,redemptionMultiplier:$}):!!_&&!!D&&t.createElement(ta,{cartSigninCTAMainText:xe,signinCTAButtonVisible:ge,themeColor:oe,joinNowFunction:D,guestLoyaltyPercentage:_,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,showCartLevelAltPay:L})),Ft?.item_count>0&&!!ht&&!!z&&ue&&ht&&void 0!==S&&t.createElement(xa,{themeColor:oe,removeDiscount:z,loyaltyDiscount:ht,isDev:P,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,pointsToBeUsed:S,brandTokenName:bt,showCartLevelAltPay:L}),ue&&L&&M&&E&&Ft?.item_count>0&&t.createElement(Bp,{loyaltyIcon:E,backgroundSubdued:a,primaryTextColor:X,pointsRewardRate:R,rewardMultiplier:T}),ue&&Ft&&Ft.item_count>0&&!!fe&&fe>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:oe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ge?"space-between":"center"}},"Minimum order value to use ",bt,":"," ",fe),Ft&&N&&Ft?.item_count>0&&t.createElement("div",null,t.createElement(Zo,{disableCheckoutButton:!!$t||At.cartLoading,discountApplied:B,checkoutFunction:N,checkoutButtonColor:Y,checkoutFontSize:p,discountInCheckoutButton:H,isStickyCheckout:q,discountAmountApplied:V,minimumCartValue:W,themeTextColor:ae,applyGSTToCart:se,showGSTOption:ce,applyNoteToCart:he,showNoteOption:be,enableGeoLocationDeliveryRestriction:Oe,applyPostalCodeAndDeliverySlotToCart:Ae,enableSlotPicker:We,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,checkoutSectionMessageRedirectLink:Pt,showDiscountOnMRP:vt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:A,toggleDecimal:St,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,showCheckoutButtonPaymentIcons:Ot,primaryTextColor:X}))))))},Op=h.div`
2249
2249
  position: relative;
2250
2250
  `,Fp=h.button`
2251
2251
  border: 1px solid #ccc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.8.23-gift-wrap-product-image.2",
3
+ "version": "0.8.23-gift-wrap-product-image.3",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",