yt-uikit 0.8.70-general-bugs.0 → 0.8.70-line-level.0
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.
|
@@ -226,7 +226,6 @@ export interface CartProps {
|
|
|
226
226
|
showCheckoutButtonPaymentIcons?: boolean;
|
|
227
227
|
showCouponOptions?: boolean;
|
|
228
228
|
rewardCoupons?: RewardCoupon[];
|
|
229
|
-
applyTemplateDiscount?: (templateId?: number) => Promise<any>;
|
|
230
229
|
comboBundleData?: BundlePayload;
|
|
231
230
|
comboBundleAddToCartFunction?: (selectedItemsSubtotal: number, variantIds?: string[], finalBundlePrice?: number, variantIdPriceMap?: {
|
|
232
231
|
variantId: string;
|
|
@@ -18,7 +18,6 @@ interface CartDrawerProps extends CartProps {
|
|
|
18
18
|
showCheckoutButtonPaymentIcons?: boolean;
|
|
19
19
|
showCouponOptions?: boolean;
|
|
20
20
|
rewardCoupons?: RewardCoupon[];
|
|
21
|
-
applyTemplateDiscount?: (templateId?: number) => Promise<any>;
|
|
22
21
|
}
|
|
23
22
|
declare const CartDrawer: React.FC<CartDrawerProps>;
|
|
24
23
|
export default CartDrawer;
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { RewardCoupon } from './Cart';
|
|
3
3
|
interface CouponSelectionProps {
|
|
4
4
|
rewardCoupons: RewardCoupon[];
|
|
5
|
-
applyTemplateDiscount: (templateId?: number) => Promise<any>;
|
|
6
5
|
applyCouponCode?: (code: string) => Promise<void>;
|
|
7
6
|
removeDiscount?: () => Promise<void>;
|
|
8
7
|
enableConfetti?: boolean;
|
package/dist/esm/index.js
CHANGED
|
@@ -1361,7 +1361,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1361
1361
|
padding: 2px 0px 4px 0px;
|
|
1362
1362
|
border-bottom-left-radius: 8px;
|
|
1363
1363
|
border-bottom-right-radius: 8px;
|
|
1364
|
-
`,Br=({imageUrl:t,overlayText:n,themeColor:o,themeTextColor:r})=>e.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},e.createElement("img",{src:t,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),e.createElement($r,{$themeColor:o,$themeTextColor:r},n)),Ir=({product:o,handleDecrement:i,handleIncrement:a,removeCartItem:l,addCartItem:c,isDev:d,themeColor:s,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:g,showQtySelector:x=!0,themeTextColor:f,showEditOptionOnProducts:y,percentageOff:b,removeFreebieFromCart:h,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k,backgroundColor:T,showDiscountOnMRP:S})=>{const{setLoading:$}=Jt(),B=re(Ut),[I,z]=oe(Jo),[F,N]=t(!1),P=ie(en),D=ir(),R=!!o.properties?._isYtFreebie,O=!!o.properties?._isStealDeal,L=R&&"number"==typeof o.final_line_price&&o.final_line_price>0&&"number"==typeof o.original_line_price&&o.original_line_price>o.final_line_price;n(()=>{function e(){const e=window.innerWidth;N(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const M=r(null),[j,V]=t(0);n(()=>{let e=null;return M.current&&(e=new ResizeObserver(e=>{e[0]&&V(e[0].contentRect.width)}),e.observe(M.current)),()=>{e&&e.disconnect()}},[]),n(()=>{const e=setTimeout(()=>{M.current&&V(M.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const W=an(o.product_title,j<200?100:120,j,"","16px"),H=()=>{if(o.line_level_discount_allocations&&o.line_level_discount_allocations.length>0&&o.line_level_discount_allocations[0].discount_application){const e=o.line_level_discount_allocations[0].discount_application.title,t=xn(e);switch(o.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${t})`;case"percentage":case"fixed_amount":return t;default:return""}}};let q=on(B,B?.currency);const Q=["__Added with Frequently Bought Together button","_has_gpo","_y"],U=o?.options_with_values&&o.options_with_values.filter(e=>"Title"!==e.name).length>0||o?.properties&&Object.keys(o.properties).filter(e=>!Q.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||y,Y=j?70/j*100:100,G=H(),X=G&&(G.length>25||!F)?an(G,Y,j,"","10px"):G,Z=(()=>{const e=o?.properties?._bundleImage;if(!e||"string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0})(),ee=!!Z,te=(()=>{const e=o?.properties?.itemsInBundle;return"string"!=typeof e?[]:e.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),ne=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}let t=0;for(const e of te){const n=e.match(/^(\d+)\s*x\s*/i);t+=n?parseInt(n[1],10)||0:1}return t})(),[ae,le]=t(!0),ce=F?"250px":"190px";return e.createElement(ur,{$hasVariantInfo:U||ee,$backgroundColor:T,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},e.createElement(gr,{$isBundle:ee},e.createElement(mr,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:ee},x?e.createElement("img",{style:{height:"100%",width:"100%",opacity:0===o.quantity?.5:1},src:gn(Z??o.image,200,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(o),loading:"lazy"}):e.createElement(Br,{imageUrl:gn(Z??o.image??o?.featuredImage?.url??"/placeholder.svg",200,85,"webp"),overlayText:O?"Steal Deal":L||b?"Special Offer":"Free Gift",themeColor:s,themeTextColor:f})),(x||o?.quantity>1)&&e.createElement(xr,null,o.quantity)),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},e.createElement(pr,{$themeColor:s,$primaryTextColor:p,href:`${window.location.origin}${o.url}`,ref:M},W),e.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(x||v)&&e.createElement(br,{onClick:x?async()=>{$&&$(!0,!0);try{l&&await l(o.key)}catch(e){}$&&$(!1,!1)}:async()=>{$&&$(!0,!0);try{h&&await h(o.key)}catch(e){}$&&$(!1,!1)}},e.createElement(fr,null,e.createElement(K,{className:"outline"}),e.createElement(J,{className:"filled"})))))),ee?e.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement("div",{role:"button",onClick:()=>le(!ae),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"4px 6px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},e.createElement("span",null,`Contain ${ne} Items`),ae?e.createElement(A,null):e.createElement(_,null)),ae&&te.length>0&&e.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:ce,width:"fit-content"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:ce}},te.map((t,n)=>e.createElement("div",{key:`${t}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:ce},title:t},t))))):U&&e.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement(ar,null,o?.options_with_values?.filter(e=>"Title"!==e.name).map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=rr(n,t.value);return"color"===n?.type?.toLowerCase()&&o?e.createElement(lr,{key:t.name,$colorValue:o.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&o?e.createElement(cr,{key:t.name,src:gn(o.value,36,85,"webp"),alt:t.value}):t.value.length>15||t.value.includes("#")?null:e.createElement(yr,{className:"yt-cart-variant-text",key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},t.value)}),o?.properties&&Object.entries(o.properties).filter(([e])=>!Q.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([t,n])=>{const o=String(n);return o.includes("#")||(D?.options??[]).some(e=>e.name.trim().toLowerCase()===t.trim().toLowerCase()&&e.values.some(e=>e.name.trim().toLowerCase()===o.trim().toLowerCase()))?null:e.createElement(yr,{key:t,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},o)}),y&&!o?.product_has_only_default_variant&&e.createElement(br,{onClick:()=>{const e=!!o.properties?._isYtFreebie;let t;if(e){const e=o.properties?._yt_allowed_variants;if(e&&"string"==typeof e)try{t=JSON.parse(e)}catch(n){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${o.key}:`,e,n),t=[String(o.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${o.key}. Defaulting to current variant.`),t=[String(o.variant_id)]}P({open:!0,variantId:String(o.variant_id),quantity:o.quantity,handle:o.handle,lineItemKey:o.key,freebieSelection:e,productId:String(o.product_id),allowedVariantIds:t})},style:{display:"flex",alignItems:"center"}},e.createElement($e,null))),o?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());if(rr(n,t.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(t.value.includes("#"))return null;const o=F?t.value:an(t.value,j?120/j*100:100,j,"","10px");return e.createElement(yr,{key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},o)})),e.createElement(hr,null,e.createElement("div",{style:{display:"flex",flexDirection:F?"row":"column",alignItems:F?"center":"flex-start",gap:F?"0px":"4px"}},e.createElement(vr,null,ee?e.createElement(e.Fragment,null,e.createElement(wr,{$primaryTextColor:p},q,un(Number(o?.properties?._finalBundlePrice)??0)),o?.properties?._originalBundlePrice&&e.createElement(Cr,null,q,un(Number(o?.properties?._originalBundlePrice)??0))):e.createElement(wr,{$primaryTextColor:p},0===tn(o.final_line_price,B?.currency)?e.createElement(Sr,{$primaryColor:p,$themeColor:s,$backgroundSubdued:k},"FREE"):e.createElement(e.Fragment,null,q,un(tn(o.final_line_price,B?.currency)))),(o.compare_at_price&&Number(o.compare_at_price)*o.quantity>Number(o.final_line_price)||!o.compare_at_price&&H()&&o.original_line_price)&&S&&e.createElement(Cr,null,q,o.compare_at_price?un(tn(Number(o.compare_at_price)*o.quantity,B?.currency)):un(tn(o.original_line_price,B?.currency))),F&&(x||L)&&H()&&e.createElement(kr,{$tertiaryColor:m},e.createElement(we,{size:14,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},X))),!F&&(x||L)&&H()&&e.createElement(kr,{$tertiaryColor:m},e.createElement(we,{size:12,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},X))),e.createElement(Er,null,x?e.createElement(Ko,{handleItemQuantityDecrement:async()=>{$&&$(!0,!0);try{i&&await i(o.key,o.quantity-1)}catch(e){}$&&$(!1,!1)},handleItemQuantityIncrement:async()=>{$&&$(!0,!0);try{if(a){-1===await a(o.id,o.quantity+1,o.properties)&&(z(o?.key),setTimeout(()=>z(void 0),3e3))}}catch(e){}$&&$(!1,!1)},value:o.quantity,isDev:d,themeColor:s,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k}):!O||L||b?e.createElement("span",{className:"yt-cart-line-item-freebie-badge",style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:g??"#000",borderRadius:"4px"}},L&&o.original_line_price?`${((o.original_line_price-o.final_line_price)/o.original_line_price*100).toFixed(0)}% off`:b&&o?.properties?._isYtFreebie?`${b}% Off`:"Freebie"):null)),I&&I===o?.key&&e.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))},zr=c.div`
|
|
1364
|
+
`,Br=({imageUrl:t,overlayText:n,themeColor:o,themeTextColor:r})=>e.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},e.createElement("img",{src:t,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),e.createElement($r,{$themeColor:o,$themeTextColor:r},n)),Ir=({product:o,handleDecrement:i,handleIncrement:a,removeCartItem:l,addCartItem:c,isDev:d,themeColor:s,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:g,showQtySelector:x=!0,themeTextColor:f,showEditOptionOnProducts:y,percentageOff:b,removeFreebieFromCart:h,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k,backgroundColor:T,showDiscountOnMRP:S})=>{const{setLoading:$}=Jt(),B=re(Ut),[I,z]=oe(Jo),[F,N]=t(!1),P=ie(en),D=ir(),R=!!o.properties?._isYtFreebie,O=!!o.properties?._isStealDeal,L=R&&"number"==typeof o.final_line_price&&o.final_line_price>0&&"number"==typeof o.original_line_price&&o.original_line_price>o.final_line_price;n(()=>{function e(){const e=window.innerWidth;N(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const M=r(null),[j,V]=t(0);n(()=>{let e=null;return M.current&&(e=new ResizeObserver(e=>{e[0]&&V(e[0].contentRect.width)}),e.observe(M.current)),()=>{e&&e.disconnect()}},[]),n(()=>{const e=setTimeout(()=>{M.current&&V(M.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const W=an(o.product_title,j<200?100:120,j,"","16px"),H=()=>{if(o.line_level_discount_allocations&&o.line_level_discount_allocations.length>0&&o.line_level_discount_allocations[0].discount_application){const e=o.line_level_discount_allocations[0].discount_application.title,t=xn(e);switch(o.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${t})`;case"percentage":case"fixed_amount":return t;default:return""}}};let q=on(B,B?.currency);const Q=["__Added with Frequently Bought Together button","_has_gpo","_y"],U=o?.options_with_values&&o.options_with_values.filter(e=>"Title"!==e.name).length>0||o?.properties&&Object.keys(o.properties).filter(e=>!Q.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||y,Y=j?70/j*100:100,G=H(),X=G&&(G.length>25||!F)?an(G,Y,j,"","10px"):G,Z=(()=>{const e=o?.properties?._bundleImage;if(!e||"string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0})(),ee=!!Z,te=(()=>{const e=o?.properties?.itemsInBundle;return"string"!=typeof e?[]:e.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),ne=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}let t=0;for(const e of te){const n=e.match(/^(\d+)\s*x\s*/i);t+=n?parseInt(n[1],10)||0:1}return t})(),[ae,le]=t(!0),ce=F?"250px":"190px";return e.createElement(ur,{$hasVariantInfo:U||ee,$backgroundColor:T,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem",opacity:o?.isOptimistic?.5:1,pointerEvents:o?.isOptimistic?"none":"auto",transition:"opacity 0.2s ease"}},e.createElement(gr,{$isBundle:ee},e.createElement(mr,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:ee},x?e.createElement("img",{style:{height:"100%",width:"100%",opacity:0===o.quantity?.5:1},src:gn(Z??o.image,200,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(o),loading:"lazy"}):e.createElement(Br,{imageUrl:gn(Z??o.image??o?.featuredImage?.url??"/placeholder.svg",200,85,"webp"),overlayText:O?"Steal Deal":L||b?"Special Offer":"Free Gift",themeColor:s,themeTextColor:f})),(x||o?.quantity>1)&&e.createElement(xr,null,o.quantity)),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},e.createElement(pr,{$themeColor:s,$primaryTextColor:p,href:`${window.location.origin}${o.url}`,ref:M},W),e.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(x||v)&&e.createElement(br,{onClick:x?async()=>{$&&$(!0,!0);try{l&&await l(o.key)}catch(e){}$&&$(!1,!1)}:async()=>{$&&$(!0,!0);try{h&&await h(o.key)}catch(e){}$&&$(!1,!1)}},e.createElement(fr,null,e.createElement(K,{className:"outline"}),e.createElement(J,{className:"filled"})))))),ee?e.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement("div",{role:"button",onClick:()=>le(!ae),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"4px 6px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},e.createElement("span",null,`Contain ${ne} Items`),ae?e.createElement(A,null):e.createElement(_,null)),ae&&te.length>0&&e.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:ce,width:"fit-content"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:ce}},te.map((t,n)=>e.createElement("div",{key:`${t}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:ce},title:t},t))))):U&&e.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement(ar,null,o?.options_with_values?.filter(e=>"Title"!==e.name).map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=rr(n,t.value);return"color"===n?.type?.toLowerCase()&&o?e.createElement(lr,{key:t.name,$colorValue:o.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&o?e.createElement(cr,{key:t.name,src:gn(o.value,36,85,"webp"),alt:t.value}):t.value.length>15||t.value.includes("#")?null:e.createElement(yr,{className:"yt-cart-variant-text",key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},t.value)}),o?.properties&&Object.entries(o.properties).filter(([e])=>!Q.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([t,n])=>{const o=String(n);return o.includes("#")||(D?.options??[]).some(e=>e.name.trim().toLowerCase()===t.trim().toLowerCase()&&e.values.some(e=>e.name.trim().toLowerCase()===o.trim().toLowerCase()))?null:e.createElement(yr,{key:t,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},o)}),y&&!o?.product_has_only_default_variant&&e.createElement(br,{onClick:()=>{const e=!!o.properties?._isYtFreebie;let t;if(e){const e=o.properties?._yt_allowed_variants;if(e&&"string"==typeof e)try{t=JSON.parse(e)}catch(n){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${o.key}:`,e,n),t=[String(o.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${o.key}. Defaulting to current variant.`),t=[String(o.variant_id)]}P({open:!0,variantId:String(o.variant_id),quantity:o.quantity,handle:o.handle,lineItemKey:o.key,freebieSelection:e,productId:String(o.product_id),allowedVariantIds:t})},style:{display:"flex",alignItems:"center"}},e.createElement($e,null))),o?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());if(rr(n,t.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(t.value.includes("#"))return null;const o=F?t.value:an(t.value,j?120/j*100:100,j,"","10px");return e.createElement(yr,{key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},o)})),e.createElement(hr,null,e.createElement("div",{style:{display:"flex",flexDirection:F?"row":"column",alignItems:F?"center":"flex-start",gap:F?"0px":"4px"}},e.createElement(vr,null,ee?e.createElement(e.Fragment,null,e.createElement(wr,{$primaryTextColor:p},q,un(Number(o?.properties?._finalBundlePrice)??0)),o?.properties?._originalBundlePrice&&e.createElement(Cr,null,q,un(Number(o?.properties?._originalBundlePrice)??0))):e.createElement(wr,{$primaryTextColor:p},0===tn(o.final_line_price,B?.currency)?e.createElement(Sr,{$primaryColor:p,$themeColor:s,$backgroundSubdued:k},"FREE"):e.createElement(e.Fragment,null,q,un(tn(o.final_line_price,B?.currency)))),(o.compare_at_price&&Number(o.compare_at_price)*o.quantity>Number(o.final_line_price)||!o.compare_at_price&&H()&&o.original_line_price)&&S&&e.createElement(Cr,null,q,o.compare_at_price?un(tn(Number(o.compare_at_price)*o.quantity,B?.currency)):un(tn(o.original_line_price,B?.currency))),F&&(x||L)&&H()&&e.createElement(kr,{$tertiaryColor:m},e.createElement(we,{size:14,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},X))),!F&&(x||L)&&H()&&e.createElement(kr,{$tertiaryColor:m},e.createElement(we,{size:12,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},X))),e.createElement(Er,null,x?e.createElement(Ko,{handleItemQuantityDecrement:async()=>{$&&$(!0,!0);try{i&&await i(o.key,o.quantity-1)}catch(e){}$&&$(!1,!1)},handleItemQuantityIncrement:async()=>{$&&$(!0,!0);try{if(a){-1===await a(o.id,o.quantity+1,o.properties)&&(z(o?.key),setTimeout(()=>z(void 0),3e3))}}catch(e){}$&&$(!1,!1)},value:o.quantity,isDev:d,themeColor:s,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k}):!O||L||b?e.createElement("span",{className:"yt-cart-line-item-freebie-badge",style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:g??"#000",borderRadius:"4px"}},L&&o.original_line_price?`${((o.original_line_price-o.final_line_price)/o.original_line_price*100).toFixed(0)}% off`:b&&o?.properties?._isYtFreebie?`${b}% Off`:"Freebie"):null)),I&&I===o?.key&&e.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))},zr=c.div`
|
|
1365
1365
|
margin: 8px 0 6px 0;
|
|
1366
1366
|
padding: 12px;
|
|
1367
1367
|
background: ${e=>e.$backgroundColor??"rgba(0,0,0,0.04)"};
|
|
@@ -1398,7 +1398,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1398
1398
|
border-bottom: 0.8px solid rgb(135 135 135 / 50%);
|
|
1399
1399
|
width: calc(100% + 2rem);
|
|
1400
1400
|
}
|
|
1401
|
-
`,Dr=({addCartItem:t,handleDecrement:n,handleIncrement:o,removeCartItem:r,isDev:i,themeColor:a,primaryTextColor:l,secondaryTextColor:c,freeProduct:d,themeTextColor:s,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:g,freeProductAdjustedCartTotal:x,freebieCouponTemplates:f,cartCheckpoints:y,freebieFlowCheckpoints:b,imageAspectSelector:h,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:E,showGiftWrapAsLineItem:k=!1,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:I,checkoutSectionMessage:z,checkoutSectionMessageRedirectLink:F,showFreebieMilestone:N,freebieMilestoneData:P})=>{const D=re(Ut),{cartLoading:A}=Jt(),_=!A.cartLoading&&D?.items,R=(x??Number(D?.items_subtotal_price))/100;let O=!0,L=0;if(D?.items?.length>0)for(const e of D.items)e?.properties?._isYtFreebie&&(L+=e?.quantity);if(L===D?.item_count&&(O=!1),!_&&0===D?.item_count)return e.createElement(Nr,null);if(!(_&&0!==D?.item_count||D?.items))return null;const M=P?.campaignFilter??"all_campaigns";let j=[];"all_campaigns"===M?j=f??[]:"progress_bar_tiers"===M?j=y??[]:"freebie_campaigns"===M&&(j=b??[]);const V=Array.isArray(j)?j.filter(e=>"free_product"===e?.couponType).slice().sort((e,t)=>e.minimumOrderValue-t.minimumOrderValue).find(e=>e.minimumOrderValue>R):void 0,W=on(D,D?.currency);return e.createElement(e.Fragment,null,D.items.filter(e=>!!k||!(String(e?.id)===sn(String(C))||String(e?.id)===sn(String(E)))).map(d=>{const x=u?.[d?.key],y=f?.find(e=>e?._allVariantIds?.includes(String(d.id)));let b=!1;if(y&&R>=y.minimumOrderValue&&0===d?.line_price&&(b=!0),!k&&(String(d?.id)===sn(String(C))||sn(String(E))===String(d?.id)))return null;const z=d.discounts&&d.discounts.length>0;return d.properties?._isYtFreebie&&(x||b)&&z&&O?e.createElement(e.Fragment,null,e.createElement(Pr,{key:d?.key??d?.id},e.createElement(Ir,{product:d,themeColor:a,isDev:i,primaryTextColor:l,secondaryTextColor:c,themeTextColor:s,showQtySelector:!1,showEditOptionOnProducts:p,percentageOff:x,imageAspectSelector:h,showDeleteOnFreebies:g,removeFreebieFromCart:m,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:!0}))):e.createElement(Pr,{key:d?.key??d?.id},e.createElement(Ir,{themeColor:a,handleDecrement:n,handleIncrement:o,removeCartItem:r,addCartItem:t,product:d,isDev:i,primaryTextColor:l,secondaryTextColor:c,showQtySelector:!d.properties?._isYtFreebie,showEditOptionOnProducts:p,removeFreebieFromCart:m,showDeleteOnFreebies:g,imageAspectSelector:h,cartComponentsCornerRadius:w,cartComponentsCornerType:v,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:I}))}),N&&O&&V&&e.createElement(Fr,{name:V.name,minimumOrderValue:V.minimumOrderValue,currency:W,themeColor:a,tertiaryColor:S,imageUrl:P?.milestoneImage?.path}),mn()&&z&&z.length>0?e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:S,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:$,marginBottom:"4px",cursor:F?"pointer":"default"},onClick:()=>{F&&(window.location.href=F)}},z):e.createElement("div",{style:{display:"list-item",height:"12px",background:"#87878717"}}))};const Ar=({bundleProducts:t})=>{const n=re(Ut);return e.createElement("div",{className:"flex flex-col gap-y-2"},e.createElement("div",{className:"flex items-center justify-center"},e.createElement("span",{className:"font-semibold"},"Save more with Bundle!")),e.createElement("div",{className:"flex items-center justify-center gap-2 relative"},e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[0].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[0].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[0].price)),t[0]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[1].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[1].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[1].price)),t[1]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"absolute",style:{left:"50%",transform:"translateX(-50%)"}},e.createElement("img",{src:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<circle cx="17.2797" cy="18.7208" r="15.5219" fill="#3A3A3A" stroke="#767676" stroke-width="1.51433"/>\r\n<path d="M15.5903 25.9172V12.1037H19.0827V25.9172H15.5903ZM10.4297 20.7566V17.2642H24.2433V20.7566H10.4297Z" fill="white"/>\r\n</svg>',alt:"Delivery Truck",height:"25px",width:"42px"}))),e.createElement("div",{className:"flex flex-row justify-between items-center"},e.createElement("div",{className:"flex flex-row gap-x-4 items-center"},e.createElement("span",{className:"text-[#667085] text-[13px]"},"Total Price"),e.createElement("span",null,e.createElement("span",{className:"font-bold text-black"},on(n,n?.currency),t[0].price+t[1].price)," ",e.createElement("span",{className:"text-[#868E96] text-[12px] line-through"},on(n,n?.currency),t[0].original_price+t[1].original_price))),e.createElement("span",{className:"text-[#1ADF5D] text-[10px]"},"save extra"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].original_price-t[0].price+(t[1].original_price-t[1].price)))),e.createElement("button",{className:"flex flex-row items-center bg-[#333333] gap-x-3 justify-center w-full py-1.5"},e.createElement(at,{color:"white"}),e.createElement("span",{className:"text-white uppercase text-[14px]"},"Buy Bundle at"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].price+t[1].price))))},_r=({backgroundSubdued:o,themeColor:i,themeTextColor:a,primaryTextColor:l,cartComponentsCornerRadius:c,applyCouponCode:d,removeDiscount:s,enableConfetti:p,hideAppliedCodes:u})=>{const m=re(Ut),[g,x]=t(""),[f,y]=t(null),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),{setLoading:k}=Jt(),[T,S]=t(null),[$,B]=t(!1),[I,z]=t(!1),F=r(null);n(()=>{if(T){B(!0);const e=setTimeout(()=>{B(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}B(!1)},[T]),n(()=>{if(m&&m.discount_codes&&f){const e=m.discount_codes.find(e=>e.code===f);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(z(!0),setTimeout(()=>z(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),y(null))}},[m,f]);const N=async()=>{if(d&&g&&!b){S(null),h(!0),y(g);try{await d(g),x("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),y(null)}finally{h(!1)}}},P=async()=>{if(s&&!C){S(null),E(!0),k&&k(!0,!1,!1,!0);try{await s()}catch(e){S({message:"Failed to remove coupon.",type:"error"})}finally{k&&k(!1,!1,!1,!1),E(!1)}}},D="error"===T?.type,A=m?.discount_codes?.filter(e=>!1!==e?.applicable);return e.createElement("div",{ref:F,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},I&&p&&e.createElement(vo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),e.createElement("div",{style:{display:"flex",alignItems:"stretch",border:D?"0.5px solid #FF4E4E":v?`1px solid ${i||"#007bff"}`:"1px solid #e0e0e0",borderRadius:c??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},e.createElement("input",{type:"text",placeholder:"Have a Coupon Code?",value:g,disabled:b,onFocus:()=>{w(!0),setTimeout(()=>{F.current&&window.innerWidth<=768&&F.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>w(!1),onChange:e=>{x(e.target.value),T&&S(null)},onKeyDown:e=>{"Enter"===e.key&&N()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:c??4,borderBottomLeftRadius:c??4,backgroundColor:o,color:l,boxShadow:"none",cursor:b?"not-allowed":"auto",margin:"0"}}),e.createElement("button",{onClick:N,disabled:!g||b,style:{padding:"10px 15px",border:"none",backgroundColor:D?"#D98181":g?i||"#007bff":"#cccccc",color:g||D?a||"#ffffff":"#666666",cursor:!g||b?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:c??4,borderBottomRightRadius:c??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:b?.7:1}},b?e.createElement(nt,{color:a||"#ffffff",size:18}):"Apply")),T&&e.createElement("div",{style:{color:"success"===T.type?"#28a745":"#dc3545",fontSize:"12px",marginTop:"4px",fontStyle:"italic",transition:"opacity 0.5s ease-in-out, transform 0.5s ease-in-out, max-height 0.5s ease-in-out",opacity:$?1:0,transform:$?"translateY(0)":"translateY(-10px)",maxHeight:$?"50px":"0",overflow:"hidden"}},T.message),!u&&A&&A.length>0&&e.createElement("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},A.map(t=>e.createElement("div",{key:t.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},e.createElement("div",{style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:o,paddingInlineStart:"6px",gap:"4px"}},e.createElement(Xe,{size:12,color:"#4D4D4D"}),e.createElement("span",{style:{fontWeight:"bold",fontStyle:"normal"}},t.code)," applied!",e.createElement("button",{onClick:P,disabled:C,style:{background:"#E2E2E2",border:"0.5px solid #B5B5B5",cursor:"pointer",marginLeft:"4px",padding:"0",display:"flex",alignItems:"center"}},C?e.createElement(nt,{color:i||"#007bff",size:14}):e.createElement(fe,{size:16})))))))},Rr="yt-coupon-selection-animations",Or=({rewardCoupons:o,applyTemplateDiscount:r,applyCouponCode:i,removeDiscount:a,enableConfetti:l,backgroundSubdued:c,themeColor:d,themeTextColor:s,primaryTextColor:p,cartComponentsCornerRadius:u})=>{const m=re(Ut),[g,x]=t(!1),[f,y]=t(!1),[b,h]=t(null),[v,w]=t(null),[C,E]=t(!1),[k,T]=t(null);n(()=>{(()=>{if(document.getElementById(Rr))return;const e=document.createElement("style");e.id=Rr,e.textContent="\n @keyframes ytSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes ytSlideDown {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n }\n @keyframes ytSuccessPulse {\n 0% { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }\n 50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }\n 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }\n }\n @keyframes ytCheckFade {\n 0% { opacity: 0; transform: scale(0.5); }\n 50% { opacity: 1; transform: scale(1.2); }\n 100% { opacity: 1; transform: scale(1); }\n }\n ",document.head.appendChild(e)})()},[]);const S=m?.discount_codes?.filter(e=>!1!==e?.applicable),$=S?.[0],B=v?o.find(e=>e.couponTemplateId===v):null,I=o;n(()=>{const e=m?.discount_codes?.filter(e=>!1!==e?.applicable)??[];if(null!==v){const t=o.find(e=>e.couponTemplateId===v);return void(t&&e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase())||w(null))}if(e.length>0){const t=o.find(t=>e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase()));t&&w(t.couponTemplateId)}},[m?.discount_codes,o,v]),n(()=>{if(g){window.history.pushState({couponSelectionOpen:!0},"");const e=()=>F();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}},[g]);const z=()=>{y(!1),x(!0)},F=()=>{y(!0),setTimeout(()=>{x(!1),y(!1)},280)},N=async()=>{if(a&&!C){E(!0);try{await a(),w(null)}catch(e){console.error("Failed to remove coupon:",e)}finally{E(!1)}}},P=()=>{if(B){if("percentage_discount_coupon"===B.couponType&&B.discountPercentage)return`saved extra ${B.discountPercentage}% off`;if("fixed_amount_coupon"===B.couponType&&B.discountValue)return`saved extra ₹${B.discountValue} off`}return""},D=(t,n=!1)=>{const o=b===t.couponTemplateId,i=k===t.couponTemplateId,a=!n&&!1===t.isEligible;return e.createElement("div",{key:t.couponTemplateId,style:{border:n?`1.5px solid ${d||"#4A7C59"}`:"1px solid #E8E8E8",borderRadius:u??8,overflow:"hidden",marginBottom:"12px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",animation:i?"ytSuccessPulse 0.6s ease-out":void 0,transition:"border-color 0.3s ease, box-shadow 0.3s ease"}},e.createElement("div",{style:{padding:"14px 16px",background:"linear-gradient(135deg, #FFFFFF 60%, #FFF5F5 100%)",position:"relative"}},i&&e.createElement("div",{style:{position:"absolute",top:"10px",right:"10px",width:24,height:24,borderRadius:"50%",backgroundColor:"#2E7D32",display:"flex",alignItems:"center",justifyContent:"center",animation:"ytCheckFade 0.4s ease-out forwards"}},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:700}},"✓")),e.createElement("div",{style:{display:"flex",alignItems:"flex-start",gap:"10px"}},e.createElement("div",{style:{width:32,height:32,borderRadius:4,backgroundColor:"#FDE8E8",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},e.createElement(ee,{size:18,color:a?"#6b7280":"#8B0000"})),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:"14px",fontWeight:600,color:p||"#1A1A1A",marginBottom:"2px"}},(e=>"percentage_discount_coupon"===e.couponType&&e.discountPercentage?`Get an additional ${e.discountPercentage}% off`:"fixed_amount_coupon"===e.couponType&&e.discountValue?`Get an additional ₹${e.discountValue} off`:e.name)(t)),e.createElement("div",{style:{fontSize:"12px",color:a?"#6b7280":"#2E7D32",fontWeight:500}},(e=>{if("minimum_quantity"===e.customCartProgressBarCriteria){if(e.quantityThreshold)return`On orders with ${e.quantityThreshold}+ items.`}else if(e.minimumOrderValue)return`On purchases above ₹${e.minimumOrderValue.toLocaleString("en-IN")}.`;return""})(t)))),e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"12px",border:"1px solid #E0E0E0",borderRadius:u??6,padding:"8px 12px",backgroundColor:"#FAFAFA"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:700,color:p||"#1A1A1A",letterSpacing:"0.5px"}},t.name),e.createElement("button",{onClick:e=>{e.stopPropagation(),n?N():(async e=>{if(null===b){h(e.couponTemplateId);try{await r(e.couponTemplateId),w(e.couponTemplateId),T(e.couponTemplateId),setTimeout(()=>T(null),1200)}catch(e){console.error("Failed to collect coupon:",e)}finally{h(null)}}})(t)},disabled:o||C||a,style:{background:"none",border:"none",color:a?"#6b7280":"#8B0000",fontSize:"14px",fontWeight:600,cursor:o||C||a?"not-allowed":"pointer",padding:0,display:"flex",alignItems:"center",gap:"4px"}},o||n&&C?e.createElement(nt,{color:"#8B0000",size:14}):n?"Remove":"Collect"))),e.createElement("div",{style:{padding:"6px 16px",fontSize:"11px",fontWeight:500,textAlign:"center",backgroundColor:"#FFF0F0",color:a?"#6b7280":"#8B0000",borderTop:"1px solid '#FECACA'"}},(e=>{const t=e.resolvedCollectionNames;return t&&t.length>0?1===t.length?`Applicable on '${t[0]}' collection only.`:`Applicable on '${t.join("', '")}' collections.`:e.allowedCollections?.ids&&e.allowedCollections.ids.length>0?"Applicable on select collections.":"Applicable storewide"})(t)))};return e.createElement(e.Fragment,null,(()=>{const t=!!B||!!$,n=B?.name??$?.code??"",r=B?"#F0FFF4":$?"#F3E8FF":"#FDE8E8",i=B?"#2E7D32":"#C53030",a=B?"#2E7D32":"#666666";return e.createElement("div",{style:{padding:"0 16px",marginTop:"10px",marginBottom:"10px"}},e.createElement("div",{onClick:z,style:{display:"flex",alignItems:"center",padding:"12px 14px",border:"1px solid #E8E8E8",borderRadius:u??8,cursor:"pointer",backgroundColor:"#FFFFFF",transition:"box-shadow 0.2s ease"}},e.createElement("div",{style:{width:36,height:36,borderRadius:6,backgroundColor:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"12px",transition:"background-color 0.3s ease"}},B?e.createElement(Xe,{size:20,color:i}):e.createElement(ee,{size:20,color:i})),e.createElement("div",{style:{flex:1}},t?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:p||"#1A1A1A"}},e.createElement("span",{style:{fontWeight:600}},n),e.createElement("span",{style:{fontStyle:"italic"}}," applied!")),e.createElement("div",{style:{fontSize:"12px",color:a,marginTop:"1px",fontStyle:B?"italic":"normal"}},(()=>{if(B){if("percentage_discount_coupon"===B.couponType&&B.discountPercentage)return`saved additional ${B.discountPercentage}% on your purchase`;if("fixed_amount_coupon"===B.couponType&&B.discountValue)return`saved additional ₹${B.discountValue} on your purchase`}return"coupon applied on your purchase"})())):e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",fontWeight:700,color:p||"#1A1A1A"}},"Coupons and Offers"),e.createElement("div",{style:{fontSize:"12px",color:"#888888",marginTop:"1px"}},"collect and save more"))),e.createElement(R,{size:14,color:"#888888"})),!t&&o.length>0&&e.createElement("div",{style:{textAlign:"center",fontSize:"12px",fontWeight:600,color:"#2E7D32",backgroundColor:"#F0FFF4",padding:"6px 0",borderRadius:`0 0 ${u??8}px ${u??8}px`,marginTop:"-1px",border:"1px solid #C6F6D5",borderTop:"none"}},o.length,"+ coupons eligible for your order"))})(),g&&e.createElement("div",{style:{position:"fixed",top:0,right:0,bottom:0,width:"457px",maxWidth:"100vw",backgroundColor:"#FFFFFF",zIndex:2147483645,display:"flex",flexDirection:"column",animation:f?"ytSlideDown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards":"ytSlideUp 0.32s cubic-bezier(0, 0, 0.2, 1) forwards"}},e.createElement("div",{style:{display:"flex",alignItems:"center",padding:"16px",flexShrink:0}},e.createElement("button",{onClick:F,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",marginRight:"12px"}},e.createElement(O,{size:18,color:p||"#1A1A1A"})),e.createElement("span",{style:{fontSize:"18px",fontWeight:700,color:p||"#1A1A1A"}},"Coupons and Offers")),e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{style:{flex:1,overflowY:"auto"}},$&&e.createElement("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"8px",flexWrap:"wrap"}},e.createElement(Xe,{size:16,color:"#333333"}),e.createElement("span",{style:{fontWeight:700,fontSize:"14px",color:p||"#1A1A1A"}},$.code),e.createElement("span",{style:{fontStyle:"italic",fontSize:"14px",color:p||"#1A1A1A"}},"applied!"),e.createElement("button",{onClick:N,disabled:C,style:{background:"none",border:"none",cursor:C?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center"}},C?e.createElement(nt,{color:"#666",size:14}):e.createElement(fe,{size:18,color:"#666666"})),P()&&e.createElement("span",{style:{fontSize:"14px",color:"#2E7D32",fontStyle:"italic"}},P())),e.createElement(_r,{backgroundSubdued:c,themeColor:d,themeTextColor:s,primaryTextColor:p,cartComponentsCornerRadius:u,applyCouponCode:i,removeDiscount:a,enableConfetti:l,hideAppliedCodes:!0}),e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{style:{padding:"16px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:700,color:p||"#1A1A1A",marginBottom:"4px"}},"Collect Coupon"),e.createElement("div",{style:{fontSize:"13px",color:"#888888",marginBottom:"16px"}},"Pick any one coupon deal"),I.map(e=>D(e,e.couponTemplateId===v))))))},Lr=ae("showGSTInput",!1),Mr=c.div`
|
|
1401
|
+
`,Dr=({addCartItem:t,handleDecrement:n,handleIncrement:o,removeCartItem:r,isDev:i,themeColor:a,primaryTextColor:l,secondaryTextColor:c,freeProduct:d,themeTextColor:s,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:g,freeProductAdjustedCartTotal:x,freebieCouponTemplates:f,cartCheckpoints:y,freebieFlowCheckpoints:b,imageAspectSelector:h,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:E,showGiftWrapAsLineItem:k=!1,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:I,checkoutSectionMessage:z,checkoutSectionMessageRedirectLink:F,showFreebieMilestone:N,freebieMilestoneData:P})=>{const D=re(Ut),{cartLoading:A}=Jt(),_=!A.cartLoading&&D?.items,R=(x??Number(D?.items_subtotal_price))/100;let O=!0,L=0;if(D?.items?.length>0)for(const e of D.items)e?.properties?._isYtFreebie&&(L+=e?.quantity);if(L===D?.item_count&&(O=!1),!_&&0===D?.item_count)return e.createElement(Nr,null);if(!(_&&0!==D?.item_count||D?.items))return null;const M=P?.campaignFilter??"all_campaigns";let j=[];"all_campaigns"===M?j=f??[]:"progress_bar_tiers"===M?j=y??[]:"freebie_campaigns"===M&&(j=b??[]);const V=Array.isArray(j)?j.filter(e=>"free_product"===e?.couponType).slice().sort((e,t)=>e.minimumOrderValue-t.minimumOrderValue).find(e=>e.minimumOrderValue>R):void 0,W=on(D,D?.currency);return e.createElement(e.Fragment,null,D.items.filter(e=>!!k||!(String(e?.id)===sn(String(C))||String(e?.id)===sn(String(E)))).map(d=>{const x=u?.[d?.key],y=f?.find(e=>e?._allVariantIds?.includes(String(d.id)));let b=!1;if(y&&R>=y.minimumOrderValue&&0===d?.line_price&&(b=!0),!k&&(String(d?.id)===sn(String(C))||sn(String(E))===String(d?.id)))return null;const z=d.discounts&&d.discounts.length>0;return d.properties?._isYtFreebie&&(x||b)&&z&&O?e.createElement(e.Fragment,null,e.createElement(Pr,{key:d?.key??d?.id},e.createElement(Ir,{product:d,themeColor:a,isDev:i,primaryTextColor:l,secondaryTextColor:c,themeTextColor:s,showQtySelector:!1,showEditOptionOnProducts:p,percentageOff:x,imageAspectSelector:h,showDeleteOnFreebies:g,removeFreebieFromCart:m,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:!0}))):e.createElement(Pr,{key:d?.key??d?.id},e.createElement(Ir,{themeColor:a,handleDecrement:n,handleIncrement:o,removeCartItem:r,addCartItem:t,product:d,isDev:i,primaryTextColor:l,secondaryTextColor:c,showQtySelector:!d.properties?._isYtFreebie,showEditOptionOnProducts:p,removeFreebieFromCart:m,showDeleteOnFreebies:g,imageAspectSelector:h,cartComponentsCornerRadius:w,cartComponentsCornerType:v,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:I}))}),N&&O&&V&&e.createElement(Fr,{name:V.name,minimumOrderValue:V.minimumOrderValue,currency:W,themeColor:a,tertiaryColor:S,imageUrl:P?.milestoneImage?.path}),mn()&&z&&z.length>0?e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:S,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:$,marginBottom:"4px",cursor:F?"pointer":"default"},onClick:()=>{F&&(window.location.href=F)}},z):e.createElement("div",{style:{display:"list-item",height:"12px",background:"#87878717"}}))};const Ar=({bundleProducts:t})=>{const n=re(Ut);return e.createElement("div",{className:"flex flex-col gap-y-2"},e.createElement("div",{className:"flex items-center justify-center"},e.createElement("span",{className:"font-semibold"},"Save more with Bundle!")),e.createElement("div",{className:"flex items-center justify-center gap-2 relative"},e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[0].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[0].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[0].price)),t[0]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[1].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[1].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[1].price)),t[1]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"absolute",style:{left:"50%",transform:"translateX(-50%)"}},e.createElement("img",{src:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<circle cx="17.2797" cy="18.7208" r="15.5219" fill="#3A3A3A" stroke="#767676" stroke-width="1.51433"/>\r\n<path d="M15.5903 25.9172V12.1037H19.0827V25.9172H15.5903ZM10.4297 20.7566V17.2642H24.2433V20.7566H10.4297Z" fill="white"/>\r\n</svg>',alt:"Delivery Truck",height:"25px",width:"42px"}))),e.createElement("div",{className:"flex flex-row justify-between items-center"},e.createElement("div",{className:"flex flex-row gap-x-4 items-center"},e.createElement("span",{className:"text-[#667085] text-[13px]"},"Total Price"),e.createElement("span",null,e.createElement("span",{className:"font-bold text-black"},on(n,n?.currency),t[0].price+t[1].price)," ",e.createElement("span",{className:"text-[#868E96] text-[12px] line-through"},on(n,n?.currency),t[0].original_price+t[1].original_price))),e.createElement("span",{className:"text-[#1ADF5D] text-[10px]"},"save extra"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].original_price-t[0].price+(t[1].original_price-t[1].price)))),e.createElement("button",{className:"flex flex-row items-center bg-[#333333] gap-x-3 justify-center w-full py-1.5"},e.createElement(at,{color:"white"}),e.createElement("span",{className:"text-white uppercase text-[14px]"},"Buy Bundle at"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].price+t[1].price))))},_r=({backgroundSubdued:o,themeColor:i,themeTextColor:a,primaryTextColor:l,cartComponentsCornerRadius:c,applyCouponCode:d,removeDiscount:s,enableConfetti:p,hideAppliedCodes:u})=>{const m=re(Ut),[g,x]=t(""),[f,y]=t(null),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),{setLoading:k}=Jt(),[T,S]=t(null),[$,B]=t(!1),[I,z]=t(!1),F=r(null);n(()=>{if(T){B(!0);const e=setTimeout(()=>{B(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}B(!1)},[T]),n(()=>{if(m&&m.discount_codes&&f){const e=m.discount_codes.find(e=>e.code===f);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(z(!0),setTimeout(()=>z(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),y(null))}},[m,f]);const N=async()=>{if(d&&g&&!b){S(null),h(!0),y(g);try{await d(g),x("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),y(null)}finally{h(!1)}}},P=async()=>{if(s&&!C){S(null),E(!0),k&&k(!0,!1,!1,!0);try{await s()}catch(e){S({message:"Failed to remove coupon.",type:"error"})}finally{k&&k(!1,!1,!1,!1),E(!1)}}},D="error"===T?.type,A=m?.discount_codes?.filter(e=>!1!==e?.applicable);return e.createElement("div",{ref:F,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},I&&p&&e.createElement(vo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),e.createElement("div",{style:{display:"flex",alignItems:"stretch",border:D?"0.5px solid #FF4E4E":v?`1px solid ${i||"#007bff"}`:"1px solid #e0e0e0",borderRadius:c??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},e.createElement("input",{type:"text",placeholder:"Have a Coupon Code?",value:g,disabled:b,onFocus:()=>{w(!0),setTimeout(()=>{F.current&&window.innerWidth<=768&&F.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>w(!1),onChange:e=>{x(e.target.value),T&&S(null)},onKeyDown:e=>{"Enter"===e.key&&N()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:c??4,borderBottomLeftRadius:c??4,backgroundColor:o,color:l,boxShadow:"none",cursor:b?"not-allowed":"auto",margin:"0"}}),e.createElement("button",{onClick:N,disabled:!g||b,style:{padding:"10px 15px",border:"none",backgroundColor:D?"#D98181":g?i||"#007bff":"#cccccc",color:g||D?a||"#ffffff":"#666666",cursor:!g||b?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:c??4,borderBottomRightRadius:c??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:b?.7:1}},b?e.createElement(nt,{color:a||"#ffffff",size:18}):"Apply")),T&&e.createElement("div",{style:{color:"success"===T.type?"#28a745":"#dc3545",fontSize:"12px",marginTop:"4px",fontStyle:"italic",transition:"opacity 0.5s ease-in-out, transform 0.5s ease-in-out, max-height 0.5s ease-in-out",opacity:$?1:0,transform:$?"translateY(0)":"translateY(-10px)",maxHeight:$?"50px":"0",overflow:"hidden"}},T.message),!u&&A&&A.length>0&&e.createElement("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},A.map(t=>e.createElement("div",{key:t.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},e.createElement("div",{style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:o,paddingInlineStart:"6px",gap:"4px"}},e.createElement(Xe,{size:12,color:"#4D4D4D"}),e.createElement("span",{style:{fontWeight:"bold",fontStyle:"normal"}},t.code)," applied!",e.createElement("button",{onClick:P,disabled:C,style:{background:"#E2E2E2",border:"0.5px solid #B5B5B5",cursor:"pointer",marginLeft:"4px",padding:"0",display:"flex",alignItems:"center"}},C?e.createElement(nt,{color:i||"#007bff",size:14}):e.createElement(fe,{size:16})))))))},Rr="yt-coupon-selection-animations",Or=({rewardCoupons:o,applyCouponCode:r,removeDiscount:i,enableConfetti:a,backgroundSubdued:l,themeColor:c,themeTextColor:d,primaryTextColor:s,cartComponentsCornerRadius:p})=>{const u=re(Ut),[m,g]=t(!1),[x,f]=t(!1),[y,b]=t(null),[h,v]=t(null),[w,C]=t(!1),[E,k]=t(null);n(()=>{(()=>{if(document.getElementById(Rr))return;const e=document.createElement("style");e.id=Rr,e.textContent="\n @keyframes ytSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes ytSlideDown {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n }\n @keyframes ytSuccessPulse {\n 0% { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }\n 50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }\n 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }\n }\n @keyframes ytCheckFade {\n 0% { opacity: 0; transform: scale(0.5); }\n 50% { opacity: 1; transform: scale(1.2); }\n 100% { opacity: 1; transform: scale(1); }\n }\n ",document.head.appendChild(e)})()},[]);const T=u?.discount_codes?.filter(e=>!1!==e?.applicable),S=T?.[0],$=h?o.find(e=>e.couponTemplateId===h):null,B=o;n(()=>{const e=u?.discount_codes?.filter(e=>!1!==e?.applicable)??[];if(null!==h){const t=o.find(e=>e.couponTemplateId===h);return void(t&&e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase())||v(null))}if(e.length>0){const t=o.find(t=>e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase()));t&&v(t.couponTemplateId)}},[u?.discount_codes,o,h]),n(()=>{if(m){window.history.pushState({couponSelectionOpen:!0},"");const e=()=>z();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}},[m]);const I=()=>{f(!1),g(!0)},z=()=>{f(!0),setTimeout(()=>{g(!1),f(!1)},280)},F=async()=>{if(i&&!w){C(!0);try{await i(),v(null)}catch(e){console.error("Failed to remove coupon:",e)}finally{C(!1)}}},N=()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved extra ${$.discountPercentage}% off`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved extra ₹${$.discountValue} off`}return""},P=(t,n=!1)=>{const o=y===t.couponTemplateId,i=E===t.couponTemplateId,a=!n&&!1===t.isEligible;return e.createElement("div",{key:t.couponTemplateId,style:{border:n?`1.5px solid ${c||"#4A7C59"}`:"1px solid #E8E8E8",borderRadius:p??8,overflow:"hidden",marginBottom:"12px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",animation:i?"ytSuccessPulse 0.6s ease-out":void 0,transition:"border-color 0.3s ease, box-shadow 0.3s ease"}},e.createElement("div",{style:{padding:"14px 16px",background:"linear-gradient(135deg, #FFFFFF 60%, #FFF5F5 100%)",position:"relative"}},i&&e.createElement("div",{style:{position:"absolute",top:"10px",right:"10px",width:24,height:24,borderRadius:"50%",backgroundColor:"#2E7D32",display:"flex",alignItems:"center",justifyContent:"center",animation:"ytCheckFade 0.4s ease-out forwards"}},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:700}},"✓")),e.createElement("div",{style:{display:"flex",alignItems:"flex-start",gap:"10px"}},e.createElement("div",{style:{width:32,height:32,borderRadius:4,backgroundColor:"#FDE8E8",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},e.createElement(ee,{size:18,color:a?"#6b7280":"#8B0000"})),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:"14px",fontWeight:600,color:s||"#1A1A1A",marginBottom:"2px"}},(e=>"percentage_discount_coupon"===e.couponType&&e.discountPercentage?`Get an additional ${e.discountPercentage}% off`:"fixed_amount_coupon"===e.couponType&&e.discountValue?`Get an additional ₹${e.discountValue} off`:e.name)(t)),e.createElement("div",{style:{fontSize:"12px",color:a?"#6b7280":"#2E7D32",fontWeight:500}},(e=>{if("minimum_quantity"===e.customCartProgressBarCriteria){if(e.quantityThreshold)return`On orders with ${e.quantityThreshold}+ items.`}else if(e.minimumOrderValue)return`On purchases above ₹${e.minimumOrderValue.toLocaleString("en-IN")}.`;return""})(t)))),e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"12px",border:"1px solid #E0E0E0",borderRadius:p??6,padding:"8px 12px",backgroundColor:"#FAFAFA"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:700,color:s||"#1A1A1A",letterSpacing:"0.5px"}},t.name),e.createElement("button",{onClick:e=>{e.stopPropagation(),n?F():(async e=>{if(null===y){b(e.couponTemplateId);try{r&&e.name&&await r(e.name),v(e.couponTemplateId),k(e.couponTemplateId),setTimeout(()=>k(null),1200)}catch(e){console.error("Failed to collect coupon:",e)}finally{b(null)}}})(t)},disabled:o||w||a,style:{background:"none",border:"none",color:a?"#6b7280":"#8B0000",fontSize:"14px",fontWeight:600,cursor:o||w||a?"not-allowed":"pointer",padding:0,display:"flex",alignItems:"center",gap:"4px"}},o||n&&w?e.createElement(nt,{color:"#8B0000",size:14}):n?"Remove":"Collect"))),e.createElement("div",{style:{padding:"6px 16px",fontSize:"11px",fontWeight:500,textAlign:"center",backgroundColor:"#FFF0F0",color:a?"#6b7280":"#8B0000",borderTop:"1px solid '#FECACA'"}},(e=>{const t=e.resolvedCollectionNames;return t&&t.length>0?1===t.length?`Applicable on '${t[0]}' collection only.`:`Applicable on '${t.join("', '")}' collections.`:e.allowedCollections?.ids&&e.allowedCollections.ids.length>0?"Applicable on select collections.":"Applicable storewide"})(t)))};return e.createElement(e.Fragment,null,(()=>{const t=!!$||!!S,n=$?.name??S?.code??"",r=$?"#F0FFF4":S?"#F3E8FF":"#FDE8E8",i=$?"#2E7D32":"#C53030",a=$?"#2E7D32":"#666666";return e.createElement("div",{style:{padding:"0 16px",marginTop:"10px",marginBottom:"10px"}},e.createElement("div",{onClick:I,style:{display:"flex",alignItems:"center",padding:"12px 14px",border:"1px solid #E8E8E8",borderRadius:p??8,cursor:"pointer",backgroundColor:"#FFFFFF",transition:"box-shadow 0.2s ease"}},e.createElement("div",{style:{width:36,height:36,borderRadius:6,backgroundColor:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"12px",transition:"background-color 0.3s ease"}},$?e.createElement(Xe,{size:20,color:i}):e.createElement(ee,{size:20,color:i})),e.createElement("div",{style:{flex:1}},t?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:s||"#1A1A1A"}},e.createElement("span",{style:{fontWeight:600}},n),e.createElement("span",{style:{fontStyle:"italic"}}," applied!")),e.createElement("div",{style:{fontSize:"12px",color:a,marginTop:"1px",fontStyle:$?"italic":"normal"}},(()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved additional ${$.discountPercentage}% on your purchase`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved additional ₹${$.discountValue} on your purchase`}return"coupon applied on your purchase"})())):e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",fontWeight:700,color:s||"#1A1A1A"}},"Coupons and Offers"),e.createElement("div",{style:{fontSize:"12px",color:"#888888",marginTop:"1px"}},"collect and save more"))),e.createElement(R,{size:14,color:"#888888"})),!t&&o.length>0&&e.createElement("div",{style:{textAlign:"center",fontSize:"12px",fontWeight:600,color:"#2E7D32",backgroundColor:"#F0FFF4",padding:"6px 0",borderRadius:`0 0 ${p??8}px ${p??8}px`,marginTop:"-1px",border:"1px solid #C6F6D5",borderTop:"none"}},o.length,"+ coupons eligible for your order"))})(),m&&e.createElement("div",{style:{position:"fixed",top:0,right:0,bottom:0,width:"457px",maxWidth:"100vw",backgroundColor:"#FFFFFF",zIndex:2147483645,display:"flex",flexDirection:"column",animation:x?"ytSlideDown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards":"ytSlideUp 0.32s cubic-bezier(0, 0, 0.2, 1) forwards"}},e.createElement("div",{style:{display:"flex",alignItems:"center",padding:"16px",flexShrink:0}},e.createElement("button",{onClick:z,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",marginRight:"12px"}},e.createElement(O,{size:18,color:s||"#1A1A1A"})),e.createElement("span",{style:{fontSize:"18px",fontWeight:700,color:s||"#1A1A1A"}},"Coupons and Offers")),e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{style:{flex:1,overflowY:"auto"}},S&&e.createElement("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"8px",flexWrap:"wrap"}},e.createElement(Xe,{size:16,color:"#333333"}),e.createElement("span",{style:{fontWeight:700,fontSize:"14px",color:s||"#1A1A1A"}},S.code),e.createElement("span",{style:{fontStyle:"italic",fontSize:"14px",color:s||"#1A1A1A"}},"applied!"),e.createElement("button",{onClick:F,disabled:w,style:{background:"none",border:"none",cursor:w?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center"}},w?e.createElement(nt,{color:"#666",size:14}):e.createElement(fe,{size:18,color:"#666666"})),N()&&e.createElement("span",{style:{fontSize:"14px",color:"#2E7D32",fontStyle:"italic"}},N())),e.createElement(_r,{backgroundSubdued:l,themeColor:c,themeTextColor:d,primaryTextColor:s,cartComponentsCornerRadius:p,applyCouponCode:r,removeDiscount:i,enableConfetti:a,hideAppliedCodes:!0}),e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{style:{padding:"16px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:700,color:s||"#1A1A1A",marginBottom:"4px"}},"Collect Coupon"),e.createElement("div",{style:{fontSize:"13px",color:"#888888",marginBottom:"16px"}},"Pick any one coupon deal"),B.map(e=>P(e,e.couponTemplateId===h))))))},Lr=ae("showGSTInput",!1),Mr=c.div`
|
|
1402
1402
|
width: 95%;
|
|
1403
1403
|
background: white;
|
|
1404
1404
|
border-radius: 2px;
|
|
@@ -2468,7 +2468,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2468
2468
|
font-weight: 400;
|
|
2469
2469
|
min-width: 14px;
|
|
2470
2470
|
line-height: 14px;
|
|
2471
|
-
`,Il=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:B,removeDiscount:I,applyDiscount:z,checkoutFunction:F,joinNowFunction:N,guestLoyaltyPercentage:P,isDev:D,recProductsList:A,showMultiStepProgressBar:_,cartCheckpoints:R,redemptionRate:O,pointsRewardRate:j,showCartLevelAltPay:V,exploreCtaRedirectLink:W,discountAmountApplied:H,minimumCartValue:q,discountInCheckoutButton:Q,isStickyCheckout:U,handleCheckpointCrossed:Y,customCartProgressBarCriteria:G,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,productRecsCtaButtonText:ie,productRecsTitleText:ae,emptyProductRecsTitleText:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be=!1,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:Ee,note:ke,showNoteOption:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Ne,freebieProductsInCart:Pe,showFreebieClaim:De,addFreebieToCart:Ae,freebiesInCart:_e,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Oe,removeFreebieFromCart:Le,postalCodeList:Me,enableGeoLocationDeliveryRestriction:je=!1,getProductDetailsByVariantId:Ve,applyPostalCodeAndDeliverySlotToCart:We,showDeleteOnFreebies:He,freebieCouponTemplates:qe,freebieFlowCheckpoints:Qe,freebieClaimData:Ue,postalCodeBasedItemTrackingParameter:Ye,enableSlotPicker:Ge,deliveryHeaderTitle:Xe,deliveryAvailableText:Ze,deliveryNotAvailableText:Ke,giftWrapSetupData:Je,giftWrapProductDetail:et,progressBarFreeProductIconType:tt,enableCustomCartOnCartPage:nt,isCartPage:ot,showCartTimer:rt,showFreebieMilestone:it,freebieMilestoneData:at,cartTimerInMinutes:lt,cartTimerCustomText:ct,productRecsCardLayout:dt,productRecsCardListVariant:st,imageAspectSelector:pt,cartComponentsCornerType:ut,cartComponentsCornerRadius:mt,cartOffersCarousalData:gt,gstSectionCustomizationData:xt,noteSectionTitle:ft,checkoutSectionMessage:yt,checkoutSectionMessageDisplay:bt,showVariantSelectionDropdownInProductClaim:ht,loyaltyDiscount:vt,brandTokenName:wt,showDiscountOnMRP:Ct,switchWidthVariant:Et,prefixMessageText:kt,suffixMessageText:Tt,successMessageText:St,toggleDecimal:$t,cartOffersCarouselHeight:Bt,disableCheckoutButton:It,showEmptyCartRecommendations:zt=!1,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Nt,applyCouponCode:Pt,showApplyCoupon:Dt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Ot,stealDealProducts:Lt,stealDealAddToCart:Mt,showCouponOptions:jt,rewardCoupons:Vt,applyTemplateDiscount:Wt})=>{const Ht=re(Ut),qt=re(Kt),[Qt,Gt]=t(!1),[nn,on]=t(!1),[rn,an]=t(!0),{setLoading:ln}=Jt();e.useEffect(()=>{ze&&ze(ln)},[ze]);const cn=r(!1),dn=r(null),sn=r(null);n(()=>{const e=()=>{i(!1)};return o?(cn.current||(dn.current=window.history.state,sn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),cn.current=!0):(cn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(dn.current,"",sn.current??window.location.href),cn.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[pn,un]=t(!1);n(()=>{const e=document.querySelector("body");e&&(nt&&ot?e.classList.remove("drawer-open"):!pn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,nt,ot,pn]),n(()=>{function e(){const e=window.innerWidth;un(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const mn=Ht?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{Gt(!0),window.setTimeout(()=>Gt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[gn,xn]=t("normal"),[fn,yn]=t("normal"),[bn,hn]=t("auto");n(()=>{CSS.supports("font-weight","500")?xn("500"):CSS.supports("font-weight","400")?xn("400"):CSS.supports("font-weight","600")&&xn("600"),CSS.supports("font-weight","400")?yn("400"):CSS.supports("font-weight","300")?yn("300"):CSS.supports("font-weight","200")&&yn("200"),CSS.supports("width","-webkit-fill-available")?hn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&hn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",gn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",fn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",bn)},[gn,fn]);const[vn]=oe(Yt),[wn]=oe(Zt),[Cn]=oe(Xt);n(()=>{an(!("all-products"!==Ye&&("specific-tags"!==Ye||vn.isPostalCodeValid||Ge)&&("specific-tags"!==Ye||vn.isPostalCodeValid||wn||!Ge)&&("specific-tags"===Ye&&"standard"===Cn||nn&&(Ge?vn.isPostalCodeValid&&wn:vn.isPostalCodeValid))))},[vn.isPostalCodeValid,wn,nn,Ye,Ge]),oe(en);const[En,kn]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&kn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&kn(!1)},[]);const Tn=new Date("2024-11-01");return tn(Ht?.items_subtotal_price,Ht?.currency),e.createElement($l,{className:"yt-cart-drawer",$isDev:D,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:nt,$isCartPage:ot,$isLargeScreen:pn,$switchWidthVariant:Et},qt.cartLoading?e.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},qt.showLoader&&!qt.showSkeletonLoader&&e.createElement("div",{className:"loader"},"")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",null,e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ee,fontSize:"16px"}},e.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ht?.item_count>0&&V&&!(be&&V)&&j>0&&e.createElement(Ga,{pointsRewardRate:j,loyaltyIcon:k,brandTokenName:wt,themeColor:se,themeTextColor:pe,rewardMultiplier:S}),mn>0&&e.createElement(Bl,{$backgroundSubdued:l},mn)),e.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(nt&&ot)&&e.createElement("div",{className:"close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(te,{style:{height:"auto",width:"auto",color:ee},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),qt&&e.createElement(qa,{$themeColor:se,show:qt.showLoader}),gt?.enableCartOffersCarousel&&e.createElement(ja,{themeColor:se,cartOffersCarousalData:gt,cartOffersCarouselHeight:Bt,cartData:Ht}),rt&&En&&Ht?.item_count?e.createElement(ha,{minutes:lt,customText:ct,onTimerComplete:()=>{kn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Qt&&At&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3}}),Se?e.createElement(oa,{inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,themeColor:se,tooltipText:Be,themeTextColor:pe}):null),_&&Ht?.items_subtotal_price>0&&Ht?.currency&&!!R&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[xo(o)]&&("minimum_order_value"!==o||1!==e?.[xo(o)])).some((e,a)=>fo(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(R,tn(void 0!==Ne?Ne:Ht?.items_subtotal_price,Ht.currency),void 0===Re?Ht?.item_count:Re,G??"minimum_order_value",Ht?.item_count)&&e.createElement(e.Fragment,null,e.createElement(zo,{customCartProgressBarCriteria:G??"minimum_order_value",handleCheckpointCrossed:Y,checkpoints:R,effectiveQuantityForProgressBar:void 0===Re?Ht?.item_count:Re,currentCartAmount:tn(void 0!==Ne?Ne:Ht?.items_subtotal_price,Ht.currency),themeColor:se,themeTextColor:pe,primaryTextColor:ee,secondaryTextColor:ne,showMOVForProgressTiers:fe,progressBarFreeProductIconType:tt,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,prefixMessageText:kt,suffixMessageText:Tt,successMessageText:St,enableConfetti:At})),Ht?.item_count>0&&e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ht?.items?.length&&0===Ht?.item_count&&!1===qt?.showSkeletonLoader?e.createElement(Po,{showLoyaltyCta:be,joinNowFunction:N,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:W,themeColor:se,emptyCartButtons:x,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,themeTextColor:pe,recProductsList:A,addCartItem:h,productRecsCtaButtonText:ie,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,emptyProductRecsTitleText:le,backgroundSubdued:l,showEmptyCartRecommendations:zt,tertiaryColor:c,tertiaryTextColor:d}):e.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},e.createElement(Dr,{isDev:D,themeColor:se,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:ee,secondaryTextColor:ne,freeProduct:ye,themeTextColor:pe,showEditOptionOnProducts:Ie,productPercentageOffMapping:Oe,removeFreebieFromCart:Le,showDeleteOnFreebies:He,freebieCouponTemplates:qe??[],freebieFlowCheckpoints:Qe??[],cartCheckpoints:R,freeProductAdjustedCartTotal:he,imageAspectSelector:pt,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,giftWrapVariantId:et?.variants?.nodes[0]?.id,giftWrapProductId:Je?.giftProductId,showGiftWrapAsLineItem:Je?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:d,backgroundColor:a,showDiscountOnMRP:Ct,checkoutSectionMessage:yt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:it,freebieMilestoneData:at}),Ot&&Ot.length>0&&Lt&&Lt.length>0&&Ht?.item_count>0&&e.createElement(Sl,{stealDealCheckpoints:Ot,stealDealProducts:Lt,freeProductAdjustedCartTotal:he,effectiveQuantityForProgressBar:Re,addFreebieToCart:Mt??Ae,freebiesInCart:_e??[],themeColor:se,primaryTextColor:ee,secondaryTextColor:ne}),pn&&ce&&!!A&&A?.length>0&&Ht?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:A,productRecsCtaButtonText:ie,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:ae,themeColor:se,primaryTextColor:ee,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:st,cartComponentsCornerType:ut,cartComponentsCornerRadius:mt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:d}),!pn&&de&&!!A&&A?.length>0&&Ht?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:A,productRecsCtaButtonText:ie,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:ae,themeColor:se,primaryTextColor:ee,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:st,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:d}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Xa,{showDiscountOnMRP:Ct,cartCheckpoints:R,toggleDecimal:$t,primaryTextColor:ee,discountApplied:B,showPoweredByBadge:Nt,discountAmountApplied:H})),e.createElement(qo,null,Ht?.item_count>0&&w&&C&&e.createElement(Ar,{bundleProducts:C}),ge&&!!xe&&Ht?.item_count>0&&e.createElement(Zr,{companyName:ue,gstNumber:me,themeColor:se,iconColor:xt?.iconColor,showIcon:xt?.showIcon,backgroundColor:xt?.backgroundColor,textColor:xt?.textColor,title:xt?.title}),!!Ht&&Ht?.item_count>0&&!!Ae&&!!Pe&&!!_e&&Pe.length>0&&e.createElement(na,{freebieProductsInCart:Pe,themeColor:se,themeTextColor:pe,primaryTextColor:ee,addFreebieToCart:Ae,freebiesInCart:_e,imageAspectSelector:pt,freebieCouponTemplates:qe,freebieClaimData:Ue,cartCheckpoints:R,isCartDrawerOpen:o}),je&&(Me?.length??0)>0&&!!We&&Ht?.item_count>0&&e.createElement("div",{className:"form-group"},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>an(!rn)},e.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(X,null)),e.createElement("div",{className:"icon-transition"},rn?e.createElement(L,null):e.createElement(M,null))),"all-products"===Ye&&rn?e.createElement(aa,{postalCodeList:Me,themeColor:se,themeTextColor:pe,enableSlotPicker:Ge,deliveryHeaderTitle:Xe,deliveryAvailableText:Ze,deliveryNotAvailableText:Ke,disabledDates:Tn}):rn&&(nn?e.createElement(aa,{postalCodeList:Me,themeColor:se,themeTextColor:pe,enableSlotPicker:Ge,deliveryHeaderTitle:Xe,deliveryAvailableText:Ze,deliveryNotAvailableText:Ke,disabledDates:Tn}):e.createElement(la,{postalCodeList:Me,themeColor:se,themeTextColor:pe,enableSlotPicker:Ge,disabledDates:Tn}))),Te&&!!Ee&&Ht?.item_count>0&&e.createElement(Kr,{note:ke,noteSectionTitle:ft}),Je?.showGiftWrapOption&&Ht?.item_count>0&&e.createElement(fa,{themeColor:se,id:Je?.giftProductId,detail:et,showPrice:Je?.showPrice,errorText:Je?.errorText,customText:Je?.customText,showGiftIcon:Je?.showGiftIcon,showProductImage:Je?.showProductImage,addCartItem:h,removeCartItem:f}),Ht?.item_count>0&&jt&&Vt&&Wt&&!be&&e.createElement(Or,{rewardCoupons:Vt,applyTemplateDiscount:Wt,applyCouponCode:Pt,removeDiscount:I,enableConfetti:At,backgroundSubdued:l,themeColor:se,themeTextColor:pe,primaryTextColor:ee,cartComponentsCornerRadius:mt}),Ht?.item_count>0&&Dt&&!jt&&!be&&Pt&&e.createElement(_r,{backgroundSubdued:l,themeColor:se,themeTextColor:pe,primaryTextColor:ee,cartComponentsCornerRadius:mt,applyCouponCode:Pt,removeDiscount:I,enableConfetti:At}),e.createElement("div",null,Ht?.item_count>0&&e.createElement(e.Fragment,null,v||!be||vt?!vt&&void 0!==E&&void 0!==T&&!!k&&be&&!!z&&e.createElement(Zo,{themeColor:se,applyDiscount:z,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:ve,brandTokenName:wt,showCartLevelAltPay:V,redemptionMultiplier:$}):!!P&&!!N&&e.createElement(Wo,{cartSigninCTAMainText:Ce,signinCTAButtonVisible:we,themeColor:se,joinNowFunction:N,guestLoyaltyPercentage:P,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,showCartLevelAltPay:V})),Ht?.item_count>0&&!!vt&&!!I&&be&&vt&&void 0!==T&&e.createElement(Uo,{themeColor:se,removeDiscount:I,loyaltyDiscount:vt,isDev:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:wt,showCartLevelAltPay:V}),be&&V&&O&&k&&Ht?.item_count>0&&e.createElement(Ua,{loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:ee,pointsRewardRate:j,rewardMultiplier:S})),be&&Ht&&Ht.item_count>0&&!!ve&&ve>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:se??"#50D1AA",fontWeight:600,display:"flex",justifyContent:we?"space-between":"center"}},"Minimum order value to use ",wt,":"," ",ve),Ht&&F&&Ht?.item_count>0&&e.createElement("div",null,e.createElement(Oo,{disableCheckoutButton:!!It||qt.cartLoading,discountApplied:B,checkoutFunction:F,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:Q,isStickyCheckout:U,discountAmountApplied:H,minimumCartValue:q,themeTextColor:pe,applyGSTToCart:xe,showGSTOption:ge,applyNoteToCart:Ee,showNoteOption:Te,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:We,enableSlotPicker:Ge,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,checkoutSectionMessage:yt,checkoutSectionMessageDisplay:bt,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Ct,tertiaryColor:c,tertiaryTextColor:d,cartCheckpoints:R,toggleDecimal:$t,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Nt,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:ee,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain}))))))};gt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const zl=c.div`
|
|
2471
|
+
`,Il=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:B,removeDiscount:I,applyDiscount:z,checkoutFunction:F,joinNowFunction:N,guestLoyaltyPercentage:P,isDev:D,recProductsList:A,showMultiStepProgressBar:_,cartCheckpoints:R,redemptionRate:O,pointsRewardRate:j,showCartLevelAltPay:V,exploreCtaRedirectLink:W,discountAmountApplied:H,minimumCartValue:q,discountInCheckoutButton:Q,isStickyCheckout:U,handleCheckpointCrossed:Y,customCartProgressBarCriteria:G,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,productRecsCtaButtonText:ie,productRecsTitleText:ae,emptyProductRecsTitleText:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be=!1,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:Ee,note:ke,showNoteOption:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Ne,freebieProductsInCart:Pe,showFreebieClaim:De,addFreebieToCart:Ae,freebiesInCart:_e,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Oe,removeFreebieFromCart:Le,postalCodeList:Me,enableGeoLocationDeliveryRestriction:je=!1,getProductDetailsByVariantId:Ve,applyPostalCodeAndDeliverySlotToCart:We,showDeleteOnFreebies:He,freebieCouponTemplates:qe,freebieFlowCheckpoints:Qe,freebieClaimData:Ue,postalCodeBasedItemTrackingParameter:Ye,enableSlotPicker:Ge,deliveryHeaderTitle:Xe,deliveryAvailableText:Ze,deliveryNotAvailableText:Ke,giftWrapSetupData:Je,giftWrapProductDetail:et,progressBarFreeProductIconType:tt,enableCustomCartOnCartPage:nt,isCartPage:ot,showCartTimer:rt,showFreebieMilestone:it,freebieMilestoneData:at,cartTimerInMinutes:lt,cartTimerCustomText:ct,productRecsCardLayout:dt,productRecsCardListVariant:st,imageAspectSelector:pt,cartComponentsCornerType:ut,cartComponentsCornerRadius:mt,cartOffersCarousalData:gt,gstSectionCustomizationData:xt,noteSectionTitle:ft,checkoutSectionMessage:yt,checkoutSectionMessageDisplay:bt,showVariantSelectionDropdownInProductClaim:ht,loyaltyDiscount:vt,brandTokenName:wt,showDiscountOnMRP:Ct,switchWidthVariant:Et,prefixMessageText:kt,suffixMessageText:Tt,successMessageText:St,toggleDecimal:$t,cartOffersCarouselHeight:Bt,disableCheckoutButton:It,showEmptyCartRecommendations:zt=!1,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Nt,applyCouponCode:Pt,showApplyCoupon:Dt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Ot,stealDealProducts:Lt,stealDealAddToCart:Mt,showCouponOptions:jt,rewardCoupons:Vt})=>{const Wt=re(Ut),Ht=re(Kt),[qt,Qt]=t(!1),[Gt,nn]=t(!1),[on,rn]=t(!0),{setLoading:an}=Jt();e.useEffect(()=>{ze&&ze(an)},[ze]);const ln=r(!1),cn=r(null),dn=r(null);n(()=>{const e=()=>{i(!1)};return o?(ln.current||(cn.current=window.history.state,dn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),ln.current=!0):(ln.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(cn.current,"",dn.current??window.location.href),ln.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[sn,pn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(nt&&ot?e.classList.remove("drawer-open"):!sn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,nt,ot,sn]),n(()=>{function e(){const e=window.innerWidth;pn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const un=Wt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{Qt(!0),window.setTimeout(()=>Qt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[mn,gn]=t("normal"),[xn,fn]=t("normal"),[yn,bn]=t("auto");n(()=>{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")?fn("400"):CSS.supports("font-weight","300")?fn("300"):CSS.supports("font-weight","200")&&fn("200"),CSS.supports("width","-webkit-fill-available")?bn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&bn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",mn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",xn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",yn)},[mn,xn]);const[hn]=oe(Yt),[vn]=oe(Zt),[wn]=oe(Xt);n(()=>{rn(!("all-products"!==Ye&&("specific-tags"!==Ye||hn.isPostalCodeValid||Ge)&&("specific-tags"!==Ye||hn.isPostalCodeValid||vn||!Ge)&&("specific-tags"===Ye&&"standard"===wn||Gt&&(Ge?hn.isPostalCodeValid&&vn:hn.isPostalCodeValid))))},[hn.isPostalCodeValid,vn,Gt,Ye,Ge]),oe(en);const[Cn,En]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&En(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&En(!1)},[]);const kn=new Date("2024-11-01");return tn(Wt?.items_subtotal_price,Wt?.currency),e.createElement($l,{className:"yt-cart-drawer",$isDev:D,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:nt,$isCartPage:ot,$isLargeScreen:sn,$switchWidthVariant:Et},Ht.cartLoading?e.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Ht.showLoader&&!Ht.showSkeletonLoader&&e.createElement("div",{className:"loader"},"")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",null,e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ee,fontSize:"16px"}},e.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Wt?.item_count>0&&V&&!(be&&V)&&j>0&&e.createElement(Ga,{pointsRewardRate:j,loyaltyIcon:k,brandTokenName:wt,themeColor:se,themeTextColor:pe,rewardMultiplier:S}),un>0&&e.createElement(Bl,{$backgroundSubdued:l},un)),e.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(nt&&ot)&&e.createElement("div",{className:"close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(te,{style:{height:"auto",width:"auto",color:ee},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),Ht&&e.createElement(qa,{$themeColor:se,show:Ht.showLoader}),gt?.enableCartOffersCarousel&&e.createElement(ja,{themeColor:se,cartOffersCarousalData:gt,cartOffersCarouselHeight:Bt,cartData:Wt}),rt&&Cn&&Wt?.item_count?e.createElement(ha,{minutes:lt,customText:ct,onTimerComplete:()=>{En(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,qt&&At&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3}}),Se?e.createElement(oa,{inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,themeColor:se,tooltipText:Be,themeTextColor:pe}):null),_&&Wt?.items_subtotal_price>0&&Wt?.currency&&!!R&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[xo(o)]&&("minimum_order_value"!==o||1!==e?.[xo(o)])).some((e,a)=>fo(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(R,tn(void 0!==Ne?Ne:Wt?.items_subtotal_price,Wt.currency),void 0===Re?Wt?.item_count:Re,G??"minimum_order_value",Wt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(zo,{customCartProgressBarCriteria:G??"minimum_order_value",handleCheckpointCrossed:Y,checkpoints:R,effectiveQuantityForProgressBar:void 0===Re?Wt?.item_count:Re,currentCartAmount:tn(void 0!==Ne?Ne:Wt?.items_subtotal_price,Wt.currency),themeColor:se,themeTextColor:pe,primaryTextColor:ee,secondaryTextColor:ne,showMOVForProgressTiers:fe,progressBarFreeProductIconType:tt,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,prefixMessageText:kt,suffixMessageText:Tt,successMessageText:St,enableConfetti:At})),Wt?.item_count>0&&e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Wt?.items?.length&&0===Wt?.item_count&&!1===Ht?.showSkeletonLoader?e.createElement(Po,{showLoyaltyCta:be,joinNowFunction:N,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:W,themeColor:se,emptyCartButtons:x,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,themeTextColor:pe,recProductsList:A,addCartItem:h,productRecsCtaButtonText:ie,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,emptyProductRecsTitleText:le,backgroundSubdued:l,showEmptyCartRecommendations:zt,tertiaryColor:c,tertiaryTextColor:d}):e.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},e.createElement(Dr,{isDev:D,themeColor:se,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:ee,secondaryTextColor:ne,freeProduct:ye,themeTextColor:pe,showEditOptionOnProducts:Ie,productPercentageOffMapping:Oe,removeFreebieFromCart:Le,showDeleteOnFreebies:He,freebieCouponTemplates:qe??[],freebieFlowCheckpoints:Qe??[],cartCheckpoints:R,freeProductAdjustedCartTotal:he,imageAspectSelector:pt,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,giftWrapVariantId:et?.variants?.nodes[0]?.id,giftWrapProductId:Je?.giftProductId,showGiftWrapAsLineItem:Je?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:d,backgroundColor:a,showDiscountOnMRP:Ct,checkoutSectionMessage:yt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:it,freebieMilestoneData:at}),Ot&&Ot.length>0&&Lt&&Lt.length>0&&Wt?.item_count>0&&e.createElement(Sl,{stealDealCheckpoints:Ot,stealDealProducts:Lt,freeProductAdjustedCartTotal:he,effectiveQuantityForProgressBar:Re,addFreebieToCart:Mt??Ae,freebiesInCart:_e??[],themeColor:se,primaryTextColor:ee,secondaryTextColor:ne}),sn&&ce&&!!A&&A?.length>0&&Wt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:A,productRecsCtaButtonText:ie,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:ae,themeColor:se,primaryTextColor:ee,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:st,cartComponentsCornerType:ut,cartComponentsCornerRadius:mt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:d}),!sn&&de&&!!A&&A?.length>0&&Wt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:A,productRecsCtaButtonText:ie,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:ae,themeColor:se,primaryTextColor:ee,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:st,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:d}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Xa,{showDiscountOnMRP:Ct,cartCheckpoints:R,toggleDecimal:$t,primaryTextColor:ee,discountApplied:B,showPoweredByBadge:Nt,discountAmountApplied:H})),e.createElement(qo,null,Wt?.item_count>0&&w&&C&&e.createElement(Ar,{bundleProducts:C}),ge&&!!xe&&Wt?.item_count>0&&e.createElement(Zr,{companyName:ue,gstNumber:me,themeColor:se,iconColor:xt?.iconColor,showIcon:xt?.showIcon,backgroundColor:xt?.backgroundColor,textColor:xt?.textColor,title:xt?.title}),!!Wt&&Wt?.item_count>0&&!!Ae&&!!Pe&&!!_e&&Pe.length>0&&e.createElement(na,{freebieProductsInCart:Pe,themeColor:se,themeTextColor:pe,primaryTextColor:ee,addFreebieToCart:Ae,freebiesInCart:_e,imageAspectSelector:pt,freebieCouponTemplates:qe,freebieClaimData:Ue,cartCheckpoints:R,isCartDrawerOpen:o}),je&&(Me?.length??0)>0&&!!We&&Wt?.item_count>0&&e.createElement("div",{className:"form-group"},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>rn(!on)},e.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(X,null)),e.createElement("div",{className:"icon-transition"},on?e.createElement(L,null):e.createElement(M,null))),"all-products"===Ye&&on?e.createElement(aa,{postalCodeList:Me,themeColor:se,themeTextColor:pe,enableSlotPicker:Ge,deliveryHeaderTitle:Xe,deliveryAvailableText:Ze,deliveryNotAvailableText:Ke,disabledDates:kn}):on&&(Gt?e.createElement(aa,{postalCodeList:Me,themeColor:se,themeTextColor:pe,enableSlotPicker:Ge,deliveryHeaderTitle:Xe,deliveryAvailableText:Ze,deliveryNotAvailableText:Ke,disabledDates:kn}):e.createElement(la,{postalCodeList:Me,themeColor:se,themeTextColor:pe,enableSlotPicker:Ge,disabledDates:kn}))),Te&&!!Ee&&Wt?.item_count>0&&e.createElement(Kr,{note:ke,noteSectionTitle:ft}),Je?.showGiftWrapOption&&Wt?.item_count>0&&e.createElement(fa,{themeColor:se,id:Je?.giftProductId,detail:et,showPrice:Je?.showPrice,errorText:Je?.errorText,customText:Je?.customText,showGiftIcon:Je?.showGiftIcon,showProductImage:Je?.showProductImage,addCartItem:h,removeCartItem:f}),Wt?.item_count>0&&jt&&Vt&&Pt&&!be&&e.createElement(Or,{rewardCoupons:Vt,applyCouponCode:Pt,removeDiscount:I,enableConfetti:At,backgroundSubdued:l,themeColor:se,themeTextColor:pe,primaryTextColor:ee,cartComponentsCornerRadius:mt}),Wt?.item_count>0&&Dt&&!jt&&!be&&Pt&&e.createElement(_r,{backgroundSubdued:l,themeColor:se,themeTextColor:pe,primaryTextColor:ee,cartComponentsCornerRadius:mt,applyCouponCode:Pt,removeDiscount:I,enableConfetti:At}),e.createElement("div",null,Wt?.item_count>0&&e.createElement(e.Fragment,null,v||!be||vt?!vt&&void 0!==E&&void 0!==T&&!!k&&be&&!!z&&e.createElement(Zo,{themeColor:se,applyDiscount:z,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:ve,brandTokenName:wt,showCartLevelAltPay:V,redemptionMultiplier:$}):!!P&&!!N&&e.createElement(Wo,{cartSigninCTAMainText:Ce,signinCTAButtonVisible:we,themeColor:se,joinNowFunction:N,guestLoyaltyPercentage:P,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,showCartLevelAltPay:V})),Wt?.item_count>0&&!!vt&&!!I&&be&&vt&&void 0!==T&&e.createElement(Uo,{themeColor:se,removeDiscount:I,loyaltyDiscount:vt,isDev:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:ee,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:wt,showCartLevelAltPay:V}),be&&V&&O&&k&&Wt?.item_count>0&&e.createElement(Ua,{loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:ee,pointsRewardRate:j,rewardMultiplier:S})),be&&Wt&&Wt.item_count>0&&!!ve&&ve>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:se??"#50D1AA",fontWeight:600,display:"flex",justifyContent:we?"space-between":"center"}},"Minimum order value to use ",wt,":"," ",ve),Wt&&F&&Wt?.item_count>0&&e.createElement("div",null,e.createElement(Oo,{disableCheckoutButton:!!It||Ht.cartLoading,discountApplied:B,checkoutFunction:F,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:Q,isStickyCheckout:U,discountAmountApplied:H,minimumCartValue:q,themeTextColor:pe,applyGSTToCart:xe,showGSTOption:ge,applyNoteToCart:Ee,showNoteOption:Te,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:We,enableSlotPicker:Ge,cartComponentsCornerRadius:mt,cartComponentsCornerType:ut,checkoutSectionMessage:yt,checkoutSectionMessageDisplay:bt,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Ct,tertiaryColor:c,tertiaryTextColor:d,cartCheckpoints:R,toggleDecimal:$t,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Nt,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:ee,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain}))))))};gt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const zl=c.div`
|
|
2472
2472
|
display: flex;
|
|
2473
2473
|
flex-direction: row;
|
|
2474
2474
|
height: 100%;
|
|
@@ -5320,4 +5320,4 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
5320
5320
|
&:hover {
|
|
5321
5321
|
border-color: ${({$themeColor:e})=>e||"#000"};
|
|
5322
5322
|
}
|
|
5323
|
-
`,bu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=oe(en),w=re(Ut),C=r(null),[E,k]=t(null),[T,S]=t(!1),[$,B]=t({}),[I,z]=t(h?.variantId),[F,N]=t(h?.quantity||1),[P,D]=t(!1),A=ir();n(()=>{h?.open?setTimeout(()=>{D(!0)},10):D(!1)},[h?.open]);n(()=>{(async()=>{if(!E&&l&&h?.variantId&&h?.handle){const e=await l(h.handle,h.variantId);if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){z(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),B(n)}else z(void 0),B({})}k(e)}})()},[E,l,h]);const _=(e,t)=>{const n={...$,[e]:t};B(n);const o=E?.variants?.find(e=>E.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&z(String(o.id))}},R=E?.variants?.find(e=>String(e.id)===String(I)),O=on(w,w?.currency),L=o(()=>{const e={};if(!E)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return E.options.forEach(n=>{e[n.name]=n.values.filter(e=>E.variants.filter(o=>{const r=E.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!E.options.every((e,t)=>{if(e.name===n.name)return!0;const r=$[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[E,$,h]);return E?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{D(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Kp,{ref:C,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??E?.featured_image,alt:R?.featured_image?.alt??E?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${E?.url}?variant=${R?.id}`},E?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:F,handleItemQuantityIncrement:async()=>{N(e=>e+1)},handleItemQuantityDecrement:async()=>{F>1&&N(e=>e-1)},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:f})))),E?.options?.map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(su,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name),$[t.name]&&e.createElement(mu,null,$[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=$[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(du,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(I&&a){S(!0);try{await a(I,F,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!I)return;const e=!!h?.lineItemKey,t=String(I)!==String(h?.variantId);if(!e||t){S(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(I,h.allowedVariantIds):e&&m?await m(I,h.allowedVariantIds):a&&I&&await a(I,F,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!I||T},T?e.createElement(nt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Kp,{style:{backgroundColor:p||"white"}},e.createElement(Jp,null,e.createElement(ot,{color:c||"#868E96"}))))});bu.displayName="DesktopVariantPopup";const hu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=oe(en),w=re(Ut),[C,E]=t(null),[k,T]=t(!1),[S,$]=t({}),[B,I]=t(h?.variantId),[z,F]=t(h?.quantity||1),N=r(null),P=ir(),[D,A]=t(!1);n(()=>{h?.open?setTimeout(()=>{A(!0)},10):A(!1)},[h?.open]);n(()=>{(async()=>{if(!C&&l&&h?.variantId&&h?.handle)try{const e=await l(h.handle,h.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){I(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),$(n)}else I(void 0),$({})}E(e)}catch(e){}})()},[C,l,h]),n(()=>{},[p,i,a,l]);const _=(e,t)=>{const n={...S,[e]:t};$(n);const o=C?.variants?.find(e=>C.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&I(String(o.id))}},R=C?.variants?.find(e=>String(e.id)===String(B)),O=on(w,w?.currency),L=o(()=>{const e={};if(!C)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(o=>{const r=C.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const r=S[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,h]);return C?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{A(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Kp,{ref:N,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??C?.featured_image,alt:R?.featured_image?.alt??C?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${C?.url}?variant=${R?.id}`},C?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:z,handleItemQuantityIncrement:async()=>{F(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&F(e=>e-1)},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:f})))),C?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(su,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name,":"),S[t.name]&&e.createElement(mu,null,S[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=S[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(du,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(B&&a){T(!0);try{await a(B,z,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!B)return;const e=!!h?.lineItemKey,t=String(B)!==String(h?.variantId);if(!e||t){T(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(B,h.allowedVariantIds):e&&m?await m(B,h.allowedVariantIds):a&&B&&await a(B,z,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||k},k?e.createElement(nt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Kp,{style:{backgroundColor:p||"white"}},e.createElement(Jp,null,e.createElement(ot,{color:c||"#868E96"}))))});const vu=({setIsCartOpen:t,isCartOpen:n,cartCheckpoints:o,customCartProgressBarCriteria:r,floatingCartData:i,effectiveQuantityForProgressBar:a,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const d=re(Ut),s=i?.bannerFooterText,p="string"==typeof s&&s.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const o=t.toLowerCase(),r=o.endsWith("/")?o:`${o}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return r.includes(n)})}catch{return!1}})(i),m=d?.item_count??0,g=tn(d?.items_subtotal_price??0,d?.currency??"INR"),x=on(d),f=function(e,t,n,o,r){if(!e||0===e.length)return{deltaValue:0,show:!1};const i=(t??"minimum_order_value").toLowerCase(),a="quantity_threshold"===i?"number"==typeof r?r:o:n,l=[...e].sort((e,t)=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===i?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)>a);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===i?l.quantityThreshold:l.minimumOrderValue,d=Math.max(0,c-a);return{deltaValue:d,show:d>0,isQuantity:"quantity_threshold"===i}}(o,r,g,m,a),y="sharp"===l?0:c??12,h=i?.textColor??"#111",v=i?.backgroundColor??"#FF7E6E",w=i?.bannerBackgroundColor??"#FFE0DC",C=i?.buttonColor??"#E8513F",E=e.useRef(null);e.useEffect(()=>{pn(E.current)},[C]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},T={background:"#FFFFFF",color:"#111",padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:h,borderRadius:y,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},$={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:w,color:h,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},B={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:v,cursor:"pointer"},I={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:h},z={fontSize:12,color:h,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},F={padding:"5px 10px",background:C,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!f.show)return null;const t=f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} to get freebie`;return e.createElement("div",{style:k},e.createElement("div",{style:T},e.createElement(b,{"aria-hidden":!0}),e.createElement("span",null,t)))}const N=1===m?"1 item":`${m} items`,P=i?.lastTierUnlockedText||"Best tier unlocked",A=f.show?f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} more to get freebie`:P;return e.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},e.createElement("div",{style:{position:"relative"}},(f.show||o&&o.length>0)&&e.createElement("div",{style:$},e.createElement(b,{"aria-hidden":!0,style:{marginBottom:7}}),e.createElement("span",{style:{display:"inline-block",marginBottom:7}},A)),e.createElement("div",{style:S},e.createElement("div",{style:B,onClick:()=>t(!0)},e.createElement(D,{width:24,height:24,color:h}),e.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},e.createElement("div",{style:I},e.createElement("span",null,x,un(g.toFixed(0))),e.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},N)),p?e.createElement("span",{style:z,title:s},s):null),e.createElement("button",{ref:E,style:F,onClick:()=>t(!0),"aria-label":"View Cart"},"View Cart")))))},wu=({exploreCTAColor:o,checkoutFontSize:i,handleDecrement:l,handleIncrement:c,removeCartItem:d,addCartItem:s,cartTitle:p,emptyCartTitle:u,emptyCartDescription:m,emptyCartButtons:g,backgroundColor:x,backgroundSubdued:f,tertiaryColor:y,tertiaryTextColor:b,backdrop:h=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:I,applyDiscount:z,discountApplied:F,checkoutFunction:N,joinNowFunction:P,guestLoyaltyPercentage:D,showToggleButton:A,isOpen:_,setIsOpen:R,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K,checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:ae,secondaryTextColor:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,showNoteOption:Ee,applyNoteToCart:ke,note:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,getProductDetailsByVariantId:ze,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:Pe,currentTier:De,freebieProductsInCart:Ae,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,showStickyAddToCart:Ge,stickyCartLineItem:Xe,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,enableCustomCartOnCartPage:rt,isCartPage:it,progressBarFreeProductIconType:at,addToStickyCart:lt,productRecsCardLayout:ct,productRecsCardListVariant:dt,showCartTimer:st,showFreebieMilestone:pt,showFloatingCart:ut,floatingCartData:mt,freebieMilestoneData:gt,cartTimerInMinutes:xt,cartTimerCustomText:ft,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:vt,cartOffersCarousalData:wt,stickyBarBuyNowFunction:Ct,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:It,brandTokenName:zt,showDiscountOnMRP:Ft,prefixMessageText:Nt,suffixMessageText:Pt,successMessageText:Dt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:jt=!0,applyCouponCode:Vt,showApplyCoupon:Wt,enableConfetti:Ht,showCheckoutButtonPaymentIcons:qt=!0,showCouponOptions:Qt,rewardCoupons:Yt,applyTemplateDiscount:Gt,comboBundleData:Xt,comboBundleAddToCartFunction:Zt,stealDealCheckpoints:Kt,stealDealProducts:Jt,stealDealAddToCart:tn})=>{const nn=ie(Ut),[on,rn]=oe(en),[an,ln]=oe(ji),cn=()=>R(!_),[dn,sn]=t(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});n(()=>{const e=e=>{const t=e.detail;sn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const pn=dn.comboBundleData??Xt,un=dn.comboBundleAddToCartFunction??Zt,[mn,gn]=t(()=>{const e=window.ytVolumeBundle;return{bundle:e?.bundle??void 0,currentTier:e?.currentTier??void 0,volumeBundleAddToCartFunction:e?.addToCart??void 0}});n(()=>{const e=e=>{const t=e.detail;gn({bundle:t?.bundle??void 0,currentTier:t?.tierData??void 0,volumeBundleAddToCartFunction:t?.addToCart??void 0})};return window.addEventListener("yt-volume-bundle-updated",e),()=>window.removeEventListener("yt-volume-bundle-updated",e)},[]);const xn=r(null),fn=r(0);a(()=>{if(v){const e=v?.token??null,t="number"==typeof v?.cartUpdatedAtMs?v.cartUpdatedAtMs:void 0;e!==xn.current&&(xn.current=e,fn.current=t??0);const n=fn.current;if(!(void 0===t||t>=n))return;void 0!==t&&(fn.current=t),nn(v)}},[v]);const yn=r(null);n(()=>{function e(e){yn.current&&!yn.current.contains(e.target)&&(rn({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),ln({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[bn,hn]=t(!1);return n(()=>{const e=()=>{hn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement(e.Fragment,null,e.createElement("div",{style:{position:rt&&it?"relative":"absolute",width:"100%",display:rt&&it?"flex":"block",alignItems:"center",justifyContent:"center"}},A&&!(rt&&it)&&e.createElement("button",{style:{margin:"16px"},onClick:cn},_?"Close Drawer":"Open Drawer"),_&&h&&!(rt&&it)&&e.createElement("div",{onClick:cn,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),e.createElement(Il,{isCartPage:it,enableCustomCartOnCartPage:rt,isOpen:_,setIsOpen:R,backgroundColor:x,backgroundSubdued:f??"#F5F5F5",tertiaryColor:y,tertiaryTextColor:b,exploreCTAColor:o,checkoutFontSize:i,cartTitle:p,handleDecrement:l,handleIncrement:c,removeCartItem:d,addCartItem:s,emptyCartTitle:u,emptyCartButtons:g,emptyCartDescription:m,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:I,applyDiscount:z,discountApplied:F,checkoutFunction:N,joinNowFunction:P,guestLoyaltyPercentage:D,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K??"minimum_order_value",checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:ae,secondaryTextColor:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:ke,note:Te,showNoteOption:Ee,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:Pe,currentTier:De,freebieProductsInCart:Ae,cartOffersCarousalData:wt,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,progressBarFreeProductIconType:at,productRecsCardLayout:ct,productRecsCardListVariant:dt,showCartTimer:st,showFreebieMilestone:pt,freebieMilestoneData:gt,cartTimerCustomText:ft,cartTimerInMinutes:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:It,getProductDetailsByVariantId:ze,brandTokenName:zt,showDiscountOnMRP:Ft??!0,prefixMessageText:Nt,suffixMessageText:Pt,successMessageText:Dt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:jt,applyCouponCode:Vt,showApplyCoupon:Wt,enableConfetti:Ht,showCheckoutButtonPaymentIcons:qt,stealDealCheckpoints:Kt,stealDealProducts:Jt,stealDealAddToCart:tn,showCouponOptions:Qt,rewardCoupons:Yt,applyTemplateDiscount:Gt}),Ge&&Xe&&s&&e.createElement(Gp,{showStickyCart:Ge,stickyCartCustomizationData:vt,product:Xe,addCartItem:s,onSetLoading:Fe,themeColor:se,themeTextColor:pe,cartData:v,isCartOpen:_,setIsCartOpen:R,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:lt,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,checkoutFunction:Ct,backgroundColor:x,primaryTextColor:ne,comboBundleData:pn,comboBundleAddToCartFunction:un,volumeBundleCurrentTier:mn.currentTier,volumeBundleData:mn.bundle,volumeBundleAddToCartFunction:mn.volumeBundleAddToCartFunction}),bn&&on.open&&e.createElement(bu,{backgroundColor:x,ref:yn,isDev:O,removeCartItem:d,addCartItem:s,getProductDetailsByVariantId:ze,themeColor:se,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:tn,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne}),!bn&&on.open&&e.createElement(hu,{ref:yn,isDev:O,removeCartItem:d,addCartItem:s,getProductDetailsByVariantId:ze,themeColor:se,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,backgroundColor:x,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:tn,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne})),!bn&&ut&&e.createElement(vu,{isCartOpen:_,setIsCartOpen:R,cartCheckpoints:V,customCartProgressBarCriteria:K,floatingCartData:mt,effectiveQuantityForProgressBar:Le,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt}))};gt(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Cu=()=>e.createElement("div",{className:"scene"},e.createElement("div",{className:"floating"},e.createElement("div",{className:"cube"},e.createElement("div",{className:"side front"},""),e.createElement("div",{className:"side back"},""),e.createElement("div",{className:"side left"},""),e.createElement("div",{className:"side right"},""),e.createElement("div",{className:"side bottom"},""),e.createElement("div",{className:"lid"},e.createElement("div",{className:"flap north"},""),e.createElement("div",{className:"flap south"},""),e.createElement("div",{className:"flap east"},""),e.createElement("div",{className:"flap west"},""))))),Eu=({config:t,brandConfig:n})=>{const{heroDesktopImage:o,heroMobileImage:r,heroTitle:i="ZERO WASTE PREMIUM PET CARE",heroSubtitle:a="Earn Doglycoins for exclusive rewards every time you shop.",heroTextAlignment:l="left",heroSubtitleFontSize:c="18px",heroSubtitleColor:d="#000000",heroSubtitleFontWeight:s="400",heroTitleFontSize:p="48px",heroTitleColor:u="#000000",heroRegistrationCTAVisibility:m=!0,primaryColor:g="#1C1C1D",primaryContrastColor:x="#FFFFFF",secondaryColor:f="#FFFFFF",secondaryContrastColor:y="#000000",accentColor:b="#FFFFFF",borderColor:I="#E5E5E5",themeRoundness:z="0px",heroBannerVisibility:F="show",stepsVisibility:N="show",waysToEarnVisibility:P="show",waysToEarnCustomText:D="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",customSectionVisibility:A="show",footerSignupVisibility:_="show",customSectionImagePosition:R="left",customSectionTitle:O="Earn Doglycoins every time you shop",customSectionSubtitle:L="Collect more Doglycoins by entering your birthday, following us on social or referring a friend (details below)\n\nRedeem your Doglycoins for cash off at checkout by signing in or creating an account. Did you shop without registering? No worries, your Credits have been saved for you",customSectionTitleFontSize:M="36px",customSectionSubtitleFontSize:j="18px",customSectionImage:V,customSectionTextAlignment:W="left",customSectionTitleColor:H="#000000",customSectionSubtitleColor:q="#000000",stepsTitle:Q="Getting started is easy",stepsSubtitle:U="Earn Stars and get rewarded in a few easy steps.",step1Title:Y="CREATE AN ACCOUNT",step1Description:G="To get started, Join Now. You can also register on the mobile app to get access to the full range of reward benefits",step2Title:X="ORDER AND EARN REWARDS POINTS",step2Description:Z="Use cash, credit/debit card or save some time and pay right through the app. You'll collect Stars all ways.",step3Title:K="UNLOCK REWARDS AND OFFERS",step3Description:J="As you earn Stars, you can redeem them for Rewards—like free food, drinks, and more. Start redeeming with as little as 25 Stars!",footerCustomText:ee="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",footerSignupSubtext:te="Use your points to redeem samples and more."}=t||{},ne="undefined"!=typeof window&&window.innerWidth<=768,oe=e=>e&&e.startsWith("//")?`https:${e}`:e,re={padding:"12px 32px",borderRadius:"30px",fontSize:"14px",fontWeight:600,cursor:"pointer",textTransform:"uppercase",border:`1px solid ${g}`,transition:"all 0.3s ease"},ie={...re,backgroundColor:g,color:x,borderColor:g},ae={...re,backgroundColor:f,color:y,borderColor:I},{newSignupTokens:le,firstOrderTokens:ce,instagramFollowPoints:de,twitterFollowPoints:se,facebookFollowPoints:pe,youtubeSubscriptionPoints:ue,rewardToLeaveReview:me,birthdayPoints:ge,referralPointsForReferrer:xe,tokenCreditPercentage:fe,brandTokenName:ye}=n||{},be=[...le?[{icon:e.createElement(h,null),title:`${le} ${ye}`,subtitle:"Create an account"}]:[],...ce?[{icon:e.createElement(v,null),title:`${ce} ${ye}`,subtitle:"Place your first order"}]:[],...fe?[{icon:e.createElement(v,null),title:`${fe}% ${ye}`,subtitle:`Earn ${fe}% back on every order`}]:[],...xe?[{icon:e.createElement(w,null),title:`${xe} ${ye}`,subtitle:"Refer a friend and get"}]:[],...ge?[{icon:e.createElement(C,null),title:`${ge} ${ye}`,subtitle:"Get on your birthday to spend"}]:[],...me?[{icon:e.createElement(E,null),title:`${me} ${ye}`,subtitle:"Write a Review"}]:[],...pe?[{icon:e.createElement(k,null),title:`${pe} ${ye}`,subtitle:"Like on Facebook"}]:[],...de?[{icon:e.createElement(T,null),title:`${de} ${ye}`,subtitle:"Follow on Instagram"}]:[],...se?[{icon:e.createElement(S,null),title:`${se} ${ye}`,subtitle:"Follow on Twitter"}]:[],...ue?[{icon:e.createElement($,null),title:`${ue} ${ye}`,subtitle:"Subscribe on YouTube"}]:[]];return e.createElement("div",{className:"yt-loyalty-page-container",style:{fontFamily:"'Poppins', sans-serif",width:"100%",overflow:"hidden"}},"show"===F&&e.createElement("div",{className:"yt-loyalty-page-hero",style:{position:"relative",minHeight:"500px",display:"flex",alignItems:"center",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start",backgroundImage:`url(${oe(ne&&r?r:o)})`,backgroundSize:"cover",backgroundPosition:"center",padding:ne?"40px 20px":"60px 80px"}},e.createElement("div",{className:"yt-loyalty-page-hero-content",style:{maxWidth:"600px",zIndex:2,textAlign:l}},e.createElement("h1",{className:"yt-loyalty-page-hero-title",style:{fontSize:ne?"32px":p,color:u,marginBottom:"16px",lineHeight:1.1,fontWeight:800,textTransform:"uppercase"}},i),e.createElement("p",{className:"yt-loyalty-page-hero-subtitle",style:{fontSize:c,color:d,fontWeight:Number(s)||400,marginBottom:"32px"}},a),m&&e.createElement("div",{className:"yt-loyalty-page-hero-button-wrapper",style:{display:"flex",gap:"16px",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start"}},e.createElement("button",{className:"yt-loyalty-page-hero-button",style:ie,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"Join Now")))),"show"===N&&e.createElement("div",{className:"yt-loyalty-page-steps",style:{padding:"40px 20px",position:"relative",textAlign:"center"}},e.createElement("div",{className:"yt-loyalty-page-steps-background-text",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"GETTING STARTED"),e.createElement("div",{className:"yt-loyalty-page-steps-content",style:{position:"relative",zIndex:1}},e.createElement("h2",{className:"yt-loyalty-page-steps-title",style:{fontSize:"32px",fontWeight:700,marginBottom:"8px",color:"#000"}},Q),e.createElement("p",{className:"yt-loyalty-page-steps-subtitle",style:{color:g,marginBottom:"24px"}},U),e.createElement("div",{className:"yt-loyalty-page-steps-grid",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"center",gap:"40px",maxWidth:"1200px",margin:"0 auto"}},[{icon:e.createElement(v,null),title:Y,desc:G},{icon:e.createElement(B,null),title:X,desc:Z},{icon:e.createElement(C,null),title:K,desc:J}].map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-step-item",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{className:"yt-loyalty-page-step-icon",style:{width:"80px",height:"80px",borderRadius:"50%",border:"4px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"32px",color:"#666",marginBottom:"12px"}},t.icon),e.createElement("div",{className:"yt-loyalty-page-step-title",style:{fontSize:"16px",fontWeight:700,color:g,textTransform:"uppercase",lineHeight:"normal"}},t.title),e.createElement("p",{className:"yt-loyalty-page-step-description",style:{fontSize:"13px",color:g,lineHeight:1.2,maxWidth:"300px"}},t.desc)))))),"show"===P&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn",style:{padding:"40px 20px",position:"relative",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-background-text",style:{position:"absolute",top:ne?"10%":"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"WAYS TO EARN"),e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-grid",style:{position:"relative",zIndex:1,maxWidth:"1000px",margin:"0 auto",display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"12px"}},be.map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-ways-to-earn-item",style:{width:ne?"100%":"220px",border:"2px solid #ddd",padding:"12px 8px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",borderRadius:z,boxShadow:"-1px 2px 3px rgba(0,0,0,0.1)"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-icon",style:{fontSize:"32px",marginBottom:"4px",color:"#1a1a2e"}},t.icon),e.createElement("h3",{className:"yt-loyalty-page-ways-to-earn-title",style:{fontSize:"13px",fontWeight:700,marginBottom:"2px",textTransform:"uppercase",color:"#000"}},t.title),e.createElement("p",{className:"yt-loyalty-page-ways-to-earn-subtitle",style:{fontSize:"11px",color:"#666"}},t.subtitle)))),D&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-custom-text",style:{maxWidth:"1000px",margin:"24px auto 0",backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},D)),"show"===A&&e.createElement("div",{className:"yt-loyalty-page-custom-section",style:{padding:ne?"40px 0px":"40px 20px",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-container",style:{maxWidth:"1200px",margin:"0 auto",display:"flex",flexDirection:ne?"column":"row",alignItems:"center",gap:"40px",borderRadius:z,overflow:"hidden",backgroundColor:"#F9F9F9"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image-wrapper",style:{flex:1,width:"100%",order:ne||"left"===R?0:1}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image",style:{display:"flex",width:"100%",height:"300px",backgroundColor:"#ddd",backgroundImage:V?`url(${oe(V)})`:o?`url(${oe(o)})`:void 0,backgroundSize:"cover",backgroundPosition:"center"}})),e.createElement("div",{className:"yt-loyalty-page-custom-section-content",style:{flex:1,paddingInline:ne?"20px":"10px",textAlign:ne?"center":W,order:ne||"left"===R?1:0,marginBottom:ne?"20px":"0px"}},e.createElement("h2",{className:"yt-loyalty-page-custom-section-title",style:{fontSize:M,fontWeight:700,marginBottom:"16px",color:H}},O),e.createElement("p",{className:"yt-loyalty-page-custom-section-subtitle",style:{fontSize:j,color:q,marginBottom:"24px",lineHeight:1.6,whiteSpace:"pre-line"}},L)))),"show"===_&&e.createElement("div",{className:"yt-loyalty-page-footer",style:{marginBottom:"20px"}},e.createElement("div",{className:"yt-loyalty-page-footer-container",style:{maxWidth:"1200px",margin:"0 auto"}},e.createElement("div",{className:"yt-loyalty-page-footer-custom-text",style:{backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},ee),e.createElement("div",{className:"yt-loyalty-page-footer-signup",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"space-between",alignItems:"center",marginTop:"40px",padding:"20px",border:"1px solid #eee",borderRadius:"4px",gap:"20px",textAlign:ne?"center":"left"}},e.createElement("div",{className:"yt-loyalty-page-footer-signup-content"},e.createElement("h3",{style:{fontSize:"20px",fontWeight:700,marginBottom:"4px",color:"#000",textAlign:ne?"center":"left"}},"Rewards Program"),e.createElement("p",{style:{fontSize:"14px",color:"#666"}},te)),e.createElement("button",{className:"yt-loyalty-page-footer-signup-button",style:ae,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"JOIN NOW")))))},ku=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const d=o._customOffer,s=d?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:i},e.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"16px",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},o.name),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),s&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"16px",padding:"12px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"clamp(16px, 4vw, 18px)",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},s),e.createElement("button",{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"20px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(I,null):e.createElement(z,null))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),e.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},e.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),e.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return ct(p,document.body)},Tu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const d=o._customOffer,s=d?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:i},e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),e.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),e.createElement("div",{style:{overflowY:"auto",flex:1}},e.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},e.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},o.name),e.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),s&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"20px",padding:"14px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"18px",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},s),e.createElement("button",{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"22px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(I,null):e.createElement(z,null)))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),e.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},e.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t)))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return ct(p,document.body)},Su=({offersToShow:o,offersConfig:i,getOfferCardMessage:a,setSelectedOffer:l,setShowPopup:c})=>{const d=r(null),[s,p]=t(!1),[u,m]=t(!0),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=768),f=()=>{if(d.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=d.current;p(e>0),m(e<t-n-10)}};n(()=>{f();const e=d.current;if(e)return e.addEventListener("scroll",f),()=>e.removeEventListener("scroll",f)},[o]),n(()=>{const e=()=>{x(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const y=e=>{if(d.current){const t=g?280:365,n=16,o="right"===e?t+n:-(t+n);d.current.scrollBy({left:o,behavior:"smooth"})}};return e.createElement("div",{style:{position:"relative"}},e.createElement("svg",{style:{position:"absolute",width:0,height:0}},e.createElement("defs",null,e.createElement("mask",{id:"coupon-cut-mask-desktop"},e.createElement("rect",{width:"365",height:"138",fill:"white"}),e.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),e.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),e.createElement("mask",{id:"coupon-cut-mask-mobile"},e.createElement("rect",{width:"280",height:"120",fill:"white"}),e.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),e.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),s&&e.createElement("button",{onClick:()=>y("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(F,{size:20})),u&&e.createElement("button",{onClick:()=>y("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(N,{size:20})),e.createElement("div",{ref:d,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:g?"110px":"128px"}},o?.map(t=>e.createElement("div",{key:t.discountId,style:{flexShrink:0,width:g?"280px":"365px",minWidth:g?"280px":"365px",minHeight:g?"110px":"128px",backgroundColor:"transparent",borderRadius:`${i?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},e.createElement("div",{style:{width:g?"60px":"80px",minHeight:g?"110px":"128px",backgroundColor:i?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:g?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${i?.roundness||0}px`,borderBottomLeftRadius:`${i?.roundness||0}px`}},e.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),i?.iconVisibility&&e.createElement("div",{style:{position:"absolute",left:g?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:g?"32px":"40px",height:g?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:g?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{flex:1,padding:g?"12px 12px":"15px 15px",paddingLeft:g?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${i?.roundness||0}px`,borderBottomRightRadius:`${i?.roundness||0}px`,overflow:"hidden",backgroundColor:i?.cardBackgroundColor||"#ffffff",minWidth:0}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:g?"4px":"6px",lineHeight:"normal"}},e.createElement("div",{style:{fontSize:g?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===t.couponType?"Free Gift":t._customOffer?.code?"Coupon":"Special Deal"),e.createElement("div",{style:{fontSize:g?"13px":"15px",fontWeight:"600",color:i?.textColor||"#2c3e50"}},t.name),e.createElement("div",{style:{fontSize:g?"11px":"12px",color:i?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:g?"28px":"32px"}},a(t))),e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),l(t),c(!0)},style:{fontSize:g?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},i?.viewDetailsTitle||"View Details")))))),e.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},$u=({offersToShow:o,offersConfig:r,getOfferCardMessage:i,setSelectedOffer:a,setShowPopup:l})=>{const[c,d]=t("undefined"!=typeof window&&window.innerWidth<=768);return n(()=>{const e=()=>{d(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement("div",{style:{borderRadius:`${r?.roundness||8}px`}},o?.map((t,n)=>e.createElement("div",{key:t.discountId,style:{display:"flex",alignItems:"flex-start",gap:c?"8px":"12px",padding:c?"12px 0":"16px 0",paddingLeft:c?"10px":"20px",backgroundColor:!0===r?.cardBackgroundTransparent||"true"===String(r?.cardBackgroundTransparent)?"transparent":r?.cardBackgroundColor||"#ffffff",borderBottom:n<(o?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${r?.roundness||0}px`}},r?.iconVisibility&&e.createElement("div",{style:{width:c?"40px":"50px",height:c?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:c?"20px":"25px",marginTop:c?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:c?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},t.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",e.createElement("span",{style:{fontWeight:600,color:r?.textColor||"#34495e"}},t.name)),e.createElement("div",{style:{fontSize:c?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},i(t)),e.createElement("div",{style:{fontSize:c?"11px":"12px",color:"#000000"}},"offer auto applied",e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),a(t),l(!0)},style:{color:r?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},r?.viewDetailsTitle||"T&C"))))))},Bu=({offersConfig:o,offers:i})=>{const[a,l]=t(!1),[c,d]=t(null),[s,p]=t(null),[u,m]=t("undefined"!=typeof window&&window.innerWidth<=768),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=450),f=r(null);n(()=>{const e=()=>{m(window.innerWidth<=768),x(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{f.current&&pn(f.current)},[o?.sectionBgContrastColor]);const y=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",o=-1;Object.keys(t).forEach(e=>{t[e]>o&&(o=t[e],n=e)});const r=e.map((e,t)=>({o:e,idx:t})),i=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return r.sort((e,t)=>{const o=e.o.customCartProgressBarCriteria===n,r=t.o.customCartProgressBarCriteria===n;if(o&&r){const n=i(e.o),o=i(t.o);return n!==o?n-o:e.idx-t.idx}return o&&!r?-1:!o&&r?1:e.idx-t.idx}),r.map(e=>e.o)})((!1===o?.showBackendOffers&&o?.customOffers&&o.customOffers.length>0?o.customOffers.map((e,t)=>{return{discountId:-(t+1),name:(n=e).title,couponType:n.code?"discount_code":"special_deal",customCartProgressBarCriteria:null,discountPercentage:null,couponTemplateId:0,minimumOrderValue:0,quantityThreshold:0,_allVariantIds:[],description:n.description,_customOffer:n};var n}):i)||[]),b=e=>{if(d(e),e){const t=e._customOffer;p(t?(e=>({offerMessage:e.description||"Special offer available",terms:e.terms?e.terms.split("\n").filter(e=>""!==e.trim()):[]}))(t):(e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const o=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?o.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&o.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&o.push("Combines with other order discounts"),t||o.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:o}})(e))}},h=e=>{const t=e._customOffer;return t?t.description||"Special offer available":(e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available")(e)};return e.createElement("div",null,e.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===o?.sectionType?`${o?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:o?.sectionBackgroundColor||"#fff"}},e.createElement("div",{style:{border:"coupon"===o?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=o?.cardPadding?`${o.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===o?.sectionType?`${o?.roundness||8}px`:"0px"}},e.createElement("span",{ref:f,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"right"===o?.alignment?"auto":"50%",right:"right"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===o?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:o?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},o?.sectionTitle||"Available Deals and Offers"),(()=>{const t=o?.sectionType;return"list"===t?e.createElement($u,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):"coupon"===t?e.createElement(Su,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):null})(),g?e.createElement(Tu,{selectedOffer:c,selectedOfferTerms:s,showPopup:a,offersConfig:o,onClose:()=>{l(!1),d(null),p(null)}}):e.createElement(ku,{selectedOffer:c,selectedOfferTerms:s,showPopup:a,offersConfig:o,onClose:()=>{l(!1),d(null),p(null)}}))))};export{zp as Bundle,Cu as BundleLoader,wu as Cart,Eu as LoyaltyPageBlock,Lt as Nudge,Bu as ProductOffers,Qt as SpinnerWheel};
|
|
5323
|
+
`,bu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=oe(en),w=re(Ut),C=r(null),[E,k]=t(null),[T,S]=t(!1),[$,B]=t({}),[I,z]=t(h?.variantId),[F,N]=t(h?.quantity||1),[P,D]=t(!1),A=ir();n(()=>{h?.open?setTimeout(()=>{D(!0)},10):D(!1)},[h?.open]);n(()=>{(async()=>{if(!E&&l&&h?.variantId&&h?.handle){const e=await l(h.handle,h.variantId);if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){z(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),B(n)}else z(void 0),B({})}k(e)}})()},[E,l,h]);const _=(e,t)=>{const n={...$,[e]:t};B(n);const o=E?.variants?.find(e=>E.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&z(String(o.id))}},R=E?.variants?.find(e=>String(e.id)===String(I)),O=on(w,w?.currency),L=o(()=>{const e={};if(!E)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return E.options.forEach(n=>{e[n.name]=n.values.filter(e=>E.variants.filter(o=>{const r=E.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!E.options.every((e,t)=>{if(e.name===n.name)return!0;const r=$[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[E,$,h]);return E?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{D(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Kp,{ref:C,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??E?.featured_image,alt:R?.featured_image?.alt??E?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${E?.url}?variant=${R?.id}`},E?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:F,handleItemQuantityIncrement:async()=>{N(e=>e+1)},handleItemQuantityDecrement:async()=>{F>1&&N(e=>e-1)},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:f})))),E?.options?.map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(su,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name),$[t.name]&&e.createElement(mu,null,$[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=$[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(du,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(I&&a){S(!0);try{await a(I,F,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!I)return;const e=!!h?.lineItemKey,t=String(I)!==String(h?.variantId);if(!e||t){S(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(I,h.allowedVariantIds):e&&m?await m(I,h.allowedVariantIds):a&&I&&await a(I,F,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!I||T},T?e.createElement(nt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Kp,{style:{backgroundColor:p||"white"}},e.createElement(Jp,null,e.createElement(ot,{color:c||"#868E96"}))))});bu.displayName="DesktopVariantPopup";const hu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=oe(en),w=re(Ut),[C,E]=t(null),[k,T]=t(!1),[S,$]=t({}),[B,I]=t(h?.variantId),[z,F]=t(h?.quantity||1),N=r(null),P=ir(),[D,A]=t(!1);n(()=>{h?.open?setTimeout(()=>{A(!0)},10):A(!1)},[h?.open]);n(()=>{(async()=>{if(!C&&l&&h?.variantId&&h?.handle)try{const e=await l(h.handle,h.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){I(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),$(n)}else I(void 0),$({})}E(e)}catch(e){}})()},[C,l,h]),n(()=>{},[p,i,a,l]);const _=(e,t)=>{const n={...S,[e]:t};$(n);const o=C?.variants?.find(e=>C.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&I(String(o.id))}},R=C?.variants?.find(e=>String(e.id)===String(B)),O=on(w,w?.currency),L=o(()=>{const e={};if(!C)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(o=>{const r=C.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const r=S[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,h]);return C?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{A(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Kp,{ref:N,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??C?.featured_image,alt:R?.featured_image?.alt??C?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${C?.url}?variant=${R?.id}`},C?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:z,handleItemQuantityIncrement:async()=>{F(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&F(e=>e-1)},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:f})))),C?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(su,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name,":"),S[t.name]&&e.createElement(mu,null,S[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=S[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(du,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(B&&a){T(!0);try{await a(B,z,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!B)return;const e=!!h?.lineItemKey,t=String(B)!==String(h?.variantId);if(!e||t){T(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(B,h.allowedVariantIds):e&&m?await m(B,h.allowedVariantIds):a&&B&&await a(B,z,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||k},k?e.createElement(nt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Kp,{style:{backgroundColor:p||"white"}},e.createElement(Jp,null,e.createElement(ot,{color:c||"#868E96"}))))});const vu=({setIsCartOpen:t,isCartOpen:n,cartCheckpoints:o,customCartProgressBarCriteria:r,floatingCartData:i,effectiveQuantityForProgressBar:a,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const d=re(Ut),s=i?.bannerFooterText,p="string"==typeof s&&s.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const o=t.toLowerCase(),r=o.endsWith("/")?o:`${o}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return r.includes(n)})}catch{return!1}})(i),m=d?.item_count??0,g=tn(d?.items_subtotal_price??0,d?.currency??"INR"),x=on(d),f=function(e,t,n,o,r){if(!e||0===e.length)return{deltaValue:0,show:!1};const i=(t??"minimum_order_value").toLowerCase(),a="quantity_threshold"===i?"number"==typeof r?r:o:n,l=[...e].sort((e,t)=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===i?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)>a);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===i?l.quantityThreshold:l.minimumOrderValue,d=Math.max(0,c-a);return{deltaValue:d,show:d>0,isQuantity:"quantity_threshold"===i}}(o,r,g,m,a),y="sharp"===l?0:c??12,h=i?.textColor??"#111",v=i?.backgroundColor??"#FF7E6E",w=i?.bannerBackgroundColor??"#FFE0DC",C=i?.buttonColor??"#E8513F",E=e.useRef(null);e.useEffect(()=>{pn(E.current)},[C]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},T={background:"#FFFFFF",color:"#111",padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:h,borderRadius:y,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},$={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:w,color:h,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},B={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:v,cursor:"pointer"},I={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:h},z={fontSize:12,color:h,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},F={padding:"5px 10px",background:C,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!f.show)return null;const t=f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} to get freebie`;return e.createElement("div",{style:k},e.createElement("div",{style:T},e.createElement(b,{"aria-hidden":!0}),e.createElement("span",null,t)))}const N=1===m?"1 item":`${m} items`,P=i?.lastTierUnlockedText||"Best tier unlocked",A=f.show?f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} more to get freebie`:P;return e.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},e.createElement("div",{style:{position:"relative"}},(f.show||o&&o.length>0)&&e.createElement("div",{style:$},e.createElement(b,{"aria-hidden":!0,style:{marginBottom:7}}),e.createElement("span",{style:{display:"inline-block",marginBottom:7}},A)),e.createElement("div",{style:S},e.createElement("div",{style:B,onClick:()=>t(!0)},e.createElement(D,{width:24,height:24,color:h}),e.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},e.createElement("div",{style:I},e.createElement("span",null,x,un(g.toFixed(0))),e.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},N)),p?e.createElement("span",{style:z,title:s},s):null),e.createElement("button",{ref:E,style:F,onClick:()=>t(!0),"aria-label":"View Cart"},"View Cart")))))},wu=({exploreCTAColor:o,checkoutFontSize:i,handleDecrement:l,handleIncrement:c,removeCartItem:d,addCartItem:s,cartTitle:p,emptyCartTitle:u,emptyCartDescription:m,emptyCartButtons:g,backgroundColor:x,backgroundSubdued:f,tertiaryColor:y,tertiaryTextColor:b,backdrop:h=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:I,applyDiscount:z,discountApplied:F,checkoutFunction:N,joinNowFunction:P,guestLoyaltyPercentage:D,showToggleButton:A,isOpen:_,setIsOpen:R,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K,checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:ae,secondaryTextColor:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,showNoteOption:Ee,applyNoteToCart:ke,note:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,getProductDetailsByVariantId:ze,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:Pe,currentTier:De,freebieProductsInCart:Ae,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,showStickyAddToCart:Ge,stickyCartLineItem:Xe,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,enableCustomCartOnCartPage:rt,isCartPage:it,progressBarFreeProductIconType:at,addToStickyCart:lt,productRecsCardLayout:ct,productRecsCardListVariant:dt,showCartTimer:st,showFreebieMilestone:pt,showFloatingCart:ut,floatingCartData:mt,freebieMilestoneData:gt,cartTimerInMinutes:xt,cartTimerCustomText:ft,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:vt,cartOffersCarousalData:wt,stickyBarBuyNowFunction:Ct,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:It,brandTokenName:zt,showDiscountOnMRP:Ft,prefixMessageText:Nt,suffixMessageText:Pt,successMessageText:Dt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:jt=!0,applyCouponCode:Vt,showApplyCoupon:Wt,enableConfetti:Ht,showCheckoutButtonPaymentIcons:qt=!0,showCouponOptions:Qt,rewardCoupons:Yt,comboBundleData:Gt,comboBundleAddToCartFunction:Xt,stealDealCheckpoints:Zt,stealDealProducts:Kt,stealDealAddToCart:Jt})=>{const tn=ie(Ut),[nn,on]=oe(en),[rn,an]=oe(ji),ln=()=>R(!_),[cn,dn]=t(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});n(()=>{const e=e=>{const t=e.detail;dn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const sn=cn.comboBundleData??Gt,pn=cn.comboBundleAddToCartFunction??Xt,[un,mn]=t(()=>{const e=window.ytVolumeBundle;return{bundle:e?.bundle??void 0,currentTier:e?.currentTier??void 0,volumeBundleAddToCartFunction:e?.addToCart??void 0}});n(()=>{const e=e=>{const t=e.detail;mn({bundle:t?.bundle??void 0,currentTier:t?.tierData??void 0,volumeBundleAddToCartFunction:t?.addToCart??void 0})};return window.addEventListener("yt-volume-bundle-updated",e),()=>window.removeEventListener("yt-volume-bundle-updated",e)},[]);const gn=r(null),xn=r(0);a(()=>{if(v){const e=v?.token??null,t="number"==typeof v?.cartUpdatedAtMs?v.cartUpdatedAtMs:void 0;e!==gn.current&&(gn.current=e,xn.current=t??0);const n=xn.current;if(!(void 0===t||t>=n))return;void 0!==t&&(xn.current=t),tn(v)}},[v]);const fn=r(null);n(()=>{function e(e){fn.current&&!fn.current.contains(e.target)&&(on({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),an({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[yn,bn]=t(!1);return n(()=>{const e=()=>{bn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement(e.Fragment,null,e.createElement("div",{style:{position:rt&&it?"relative":"absolute",width:"100%",display:rt&&it?"flex":"block",alignItems:"center",justifyContent:"center"}},A&&!(rt&&it)&&e.createElement("button",{style:{margin:"16px"},onClick:ln},_?"Close Drawer":"Open Drawer"),_&&h&&!(rt&&it)&&e.createElement("div",{onClick:ln,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),e.createElement(Il,{isCartPage:it,enableCustomCartOnCartPage:rt,isOpen:_,setIsOpen:R,backgroundColor:x,backgroundSubdued:f??"#F5F5F5",tertiaryColor:y,tertiaryTextColor:b,exploreCTAColor:o,checkoutFontSize:i,cartTitle:p,handleDecrement:l,handleIncrement:c,removeCartItem:d,addCartItem:s,emptyCartTitle:u,emptyCartButtons:g,emptyCartDescription:m,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:I,applyDiscount:z,discountApplied:F,checkoutFunction:N,joinNowFunction:P,guestLoyaltyPercentage:D,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K??"minimum_order_value",checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:ae,secondaryTextColor:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:ke,note:Te,showNoteOption:Ee,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:Pe,currentTier:De,freebieProductsInCart:Ae,cartOffersCarousalData:wt,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,progressBarFreeProductIconType:at,productRecsCardLayout:ct,productRecsCardListVariant:dt,showCartTimer:st,showFreebieMilestone:pt,freebieMilestoneData:gt,cartTimerCustomText:ft,cartTimerInMinutes:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:It,getProductDetailsByVariantId:ze,brandTokenName:zt,showDiscountOnMRP:Ft??!0,prefixMessageText:Nt,suffixMessageText:Pt,successMessageText:Dt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:jt,applyCouponCode:Vt,showApplyCoupon:Wt,enableConfetti:Ht,showCheckoutButtonPaymentIcons:qt,stealDealCheckpoints:Zt,stealDealProducts:Kt,stealDealAddToCart:Jt,showCouponOptions:Qt,rewardCoupons:Yt}),Ge&&Xe&&s&&e.createElement(Gp,{showStickyCart:Ge,stickyCartCustomizationData:vt,product:Xe,addCartItem:s,onSetLoading:Fe,themeColor:se,themeTextColor:pe,cartData:v,isCartOpen:_,setIsCartOpen:R,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:lt,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,checkoutFunction:Ct,backgroundColor:x,primaryTextColor:ne,comboBundleData:sn,comboBundleAddToCartFunction:pn,volumeBundleCurrentTier:un.currentTier,volumeBundleData:un.bundle,volumeBundleAddToCartFunction:un.volumeBundleAddToCartFunction}),yn&&nn.open&&e.createElement(bu,{backgroundColor:x,ref:fn,isDev:O,removeCartItem:d,addCartItem:s,getProductDetailsByVariantId:ze,themeColor:se,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:Jt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne}),!yn&&nn.open&&e.createElement(hu,{ref:fn,isDev:O,removeCartItem:d,addCartItem:s,getProductDetailsByVariantId:ze,themeColor:se,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,backgroundColor:x,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:Jt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne})),!yn&&ut&&e.createElement(vu,{isCartOpen:_,setIsCartOpen:R,cartCheckpoints:V,customCartProgressBarCriteria:K,floatingCartData:mt,effectiveQuantityForProgressBar:Le,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt}))};gt(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Cu=()=>e.createElement("div",{className:"scene"},e.createElement("div",{className:"floating"},e.createElement("div",{className:"cube"},e.createElement("div",{className:"side front"},""),e.createElement("div",{className:"side back"},""),e.createElement("div",{className:"side left"},""),e.createElement("div",{className:"side right"},""),e.createElement("div",{className:"side bottom"},""),e.createElement("div",{className:"lid"},e.createElement("div",{className:"flap north"},""),e.createElement("div",{className:"flap south"},""),e.createElement("div",{className:"flap east"},""),e.createElement("div",{className:"flap west"},""))))),Eu=({config:t,brandConfig:n})=>{const{heroDesktopImage:o,heroMobileImage:r,heroTitle:i="ZERO WASTE PREMIUM PET CARE",heroSubtitle:a="Earn Doglycoins for exclusive rewards every time you shop.",heroTextAlignment:l="left",heroSubtitleFontSize:c="18px",heroSubtitleColor:d="#000000",heroSubtitleFontWeight:s="400",heroTitleFontSize:p="48px",heroTitleColor:u="#000000",heroRegistrationCTAVisibility:m=!0,primaryColor:g="#1C1C1D",primaryContrastColor:x="#FFFFFF",secondaryColor:f="#FFFFFF",secondaryContrastColor:y="#000000",accentColor:b="#FFFFFF",borderColor:I="#E5E5E5",themeRoundness:z="0px",heroBannerVisibility:F="show",stepsVisibility:N="show",waysToEarnVisibility:P="show",waysToEarnCustomText:D="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",customSectionVisibility:A="show",footerSignupVisibility:_="show",customSectionImagePosition:R="left",customSectionTitle:O="Earn Doglycoins every time you shop",customSectionSubtitle:L="Collect more Doglycoins by entering your birthday, following us on social or referring a friend (details below)\n\nRedeem your Doglycoins for cash off at checkout by signing in or creating an account. Did you shop without registering? No worries, your Credits have been saved for you",customSectionTitleFontSize:M="36px",customSectionSubtitleFontSize:j="18px",customSectionImage:V,customSectionTextAlignment:W="left",customSectionTitleColor:H="#000000",customSectionSubtitleColor:q="#000000",stepsTitle:Q="Getting started is easy",stepsSubtitle:U="Earn Stars and get rewarded in a few easy steps.",step1Title:Y="CREATE AN ACCOUNT",step1Description:G="To get started, Join Now. You can also register on the mobile app to get access to the full range of reward benefits",step2Title:X="ORDER AND EARN REWARDS POINTS",step2Description:Z="Use cash, credit/debit card or save some time and pay right through the app. You'll collect Stars all ways.",step3Title:K="UNLOCK REWARDS AND OFFERS",step3Description:J="As you earn Stars, you can redeem them for Rewards—like free food, drinks, and more. Start redeeming with as little as 25 Stars!",footerCustomText:ee="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",footerSignupSubtext:te="Use your points to redeem samples and more."}=t||{},ne="undefined"!=typeof window&&window.innerWidth<=768,oe=e=>e&&e.startsWith("//")?`https:${e}`:e,re={padding:"12px 32px",borderRadius:"30px",fontSize:"14px",fontWeight:600,cursor:"pointer",textTransform:"uppercase",border:`1px solid ${g}`,transition:"all 0.3s ease"},ie={...re,backgroundColor:g,color:x,borderColor:g},ae={...re,backgroundColor:f,color:y,borderColor:I},{newSignupTokens:le,firstOrderTokens:ce,instagramFollowPoints:de,twitterFollowPoints:se,facebookFollowPoints:pe,youtubeSubscriptionPoints:ue,rewardToLeaveReview:me,birthdayPoints:ge,referralPointsForReferrer:xe,tokenCreditPercentage:fe,brandTokenName:ye}=n||{},be=[...le?[{icon:e.createElement(h,null),title:`${le} ${ye}`,subtitle:"Create an account"}]:[],...ce?[{icon:e.createElement(v,null),title:`${ce} ${ye}`,subtitle:"Place your first order"}]:[],...fe?[{icon:e.createElement(v,null),title:`${fe}% ${ye}`,subtitle:`Earn ${fe}% back on every order`}]:[],...xe?[{icon:e.createElement(w,null),title:`${xe} ${ye}`,subtitle:"Refer a friend and get"}]:[],...ge?[{icon:e.createElement(C,null),title:`${ge} ${ye}`,subtitle:"Get on your birthday to spend"}]:[],...me?[{icon:e.createElement(E,null),title:`${me} ${ye}`,subtitle:"Write a Review"}]:[],...pe?[{icon:e.createElement(k,null),title:`${pe} ${ye}`,subtitle:"Like on Facebook"}]:[],...de?[{icon:e.createElement(T,null),title:`${de} ${ye}`,subtitle:"Follow on Instagram"}]:[],...se?[{icon:e.createElement(S,null),title:`${se} ${ye}`,subtitle:"Follow on Twitter"}]:[],...ue?[{icon:e.createElement($,null),title:`${ue} ${ye}`,subtitle:"Subscribe on YouTube"}]:[]];return e.createElement("div",{className:"yt-loyalty-page-container",style:{fontFamily:"'Poppins', sans-serif",width:"100%",overflow:"hidden"}},"show"===F&&e.createElement("div",{className:"yt-loyalty-page-hero",style:{position:"relative",minHeight:"500px",display:"flex",alignItems:"center",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start",backgroundImage:`url(${oe(ne&&r?r:o)})`,backgroundSize:"cover",backgroundPosition:"center",padding:ne?"40px 20px":"60px 80px"}},e.createElement("div",{className:"yt-loyalty-page-hero-content",style:{maxWidth:"600px",zIndex:2,textAlign:l}},e.createElement("h1",{className:"yt-loyalty-page-hero-title",style:{fontSize:ne?"32px":p,color:u,marginBottom:"16px",lineHeight:1.1,fontWeight:800,textTransform:"uppercase"}},i),e.createElement("p",{className:"yt-loyalty-page-hero-subtitle",style:{fontSize:c,color:d,fontWeight:Number(s)||400,marginBottom:"32px"}},a),m&&e.createElement("div",{className:"yt-loyalty-page-hero-button-wrapper",style:{display:"flex",gap:"16px",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start"}},e.createElement("button",{className:"yt-loyalty-page-hero-button",style:ie,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"Join Now")))),"show"===N&&e.createElement("div",{className:"yt-loyalty-page-steps",style:{padding:"40px 20px",position:"relative",textAlign:"center"}},e.createElement("div",{className:"yt-loyalty-page-steps-background-text",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"GETTING STARTED"),e.createElement("div",{className:"yt-loyalty-page-steps-content",style:{position:"relative",zIndex:1}},e.createElement("h2",{className:"yt-loyalty-page-steps-title",style:{fontSize:"32px",fontWeight:700,marginBottom:"8px",color:"#000"}},Q),e.createElement("p",{className:"yt-loyalty-page-steps-subtitle",style:{color:g,marginBottom:"24px"}},U),e.createElement("div",{className:"yt-loyalty-page-steps-grid",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"center",gap:"40px",maxWidth:"1200px",margin:"0 auto"}},[{icon:e.createElement(v,null),title:Y,desc:G},{icon:e.createElement(B,null),title:X,desc:Z},{icon:e.createElement(C,null),title:K,desc:J}].map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-step-item",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{className:"yt-loyalty-page-step-icon",style:{width:"80px",height:"80px",borderRadius:"50%",border:"4px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"32px",color:"#666",marginBottom:"12px"}},t.icon),e.createElement("div",{className:"yt-loyalty-page-step-title",style:{fontSize:"16px",fontWeight:700,color:g,textTransform:"uppercase",lineHeight:"normal"}},t.title),e.createElement("p",{className:"yt-loyalty-page-step-description",style:{fontSize:"13px",color:g,lineHeight:1.2,maxWidth:"300px"}},t.desc)))))),"show"===P&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn",style:{padding:"40px 20px",position:"relative",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-background-text",style:{position:"absolute",top:ne?"10%":"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"WAYS TO EARN"),e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-grid",style:{position:"relative",zIndex:1,maxWidth:"1000px",margin:"0 auto",display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"12px"}},be.map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-ways-to-earn-item",style:{width:ne?"100%":"220px",border:"2px solid #ddd",padding:"12px 8px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",borderRadius:z,boxShadow:"-1px 2px 3px rgba(0,0,0,0.1)"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-icon",style:{fontSize:"32px",marginBottom:"4px",color:"#1a1a2e"}},t.icon),e.createElement("h3",{className:"yt-loyalty-page-ways-to-earn-title",style:{fontSize:"13px",fontWeight:700,marginBottom:"2px",textTransform:"uppercase",color:"#000"}},t.title),e.createElement("p",{className:"yt-loyalty-page-ways-to-earn-subtitle",style:{fontSize:"11px",color:"#666"}},t.subtitle)))),D&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-custom-text",style:{maxWidth:"1000px",margin:"24px auto 0",backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},D)),"show"===A&&e.createElement("div",{className:"yt-loyalty-page-custom-section",style:{padding:ne?"40px 0px":"40px 20px",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-container",style:{maxWidth:"1200px",margin:"0 auto",display:"flex",flexDirection:ne?"column":"row",alignItems:"center",gap:"40px",borderRadius:z,overflow:"hidden",backgroundColor:"#F9F9F9"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image-wrapper",style:{flex:1,width:"100%",order:ne||"left"===R?0:1}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image",style:{display:"flex",width:"100%",height:"300px",backgroundColor:"#ddd",backgroundImage:V?`url(${oe(V)})`:o?`url(${oe(o)})`:void 0,backgroundSize:"cover",backgroundPosition:"center"}})),e.createElement("div",{className:"yt-loyalty-page-custom-section-content",style:{flex:1,paddingInline:ne?"20px":"10px",textAlign:ne?"center":W,order:ne||"left"===R?1:0,marginBottom:ne?"20px":"0px"}},e.createElement("h2",{className:"yt-loyalty-page-custom-section-title",style:{fontSize:M,fontWeight:700,marginBottom:"16px",color:H}},O),e.createElement("p",{className:"yt-loyalty-page-custom-section-subtitle",style:{fontSize:j,color:q,marginBottom:"24px",lineHeight:1.6,whiteSpace:"pre-line"}},L)))),"show"===_&&e.createElement("div",{className:"yt-loyalty-page-footer",style:{marginBottom:"20px"}},e.createElement("div",{className:"yt-loyalty-page-footer-container",style:{maxWidth:"1200px",margin:"0 auto"}},e.createElement("div",{className:"yt-loyalty-page-footer-custom-text",style:{backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},ee),e.createElement("div",{className:"yt-loyalty-page-footer-signup",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"space-between",alignItems:"center",marginTop:"40px",padding:"20px",border:"1px solid #eee",borderRadius:"4px",gap:"20px",textAlign:ne?"center":"left"}},e.createElement("div",{className:"yt-loyalty-page-footer-signup-content"},e.createElement("h3",{style:{fontSize:"20px",fontWeight:700,marginBottom:"4px",color:"#000",textAlign:ne?"center":"left"}},"Rewards Program"),e.createElement("p",{style:{fontSize:"14px",color:"#666"}},te)),e.createElement("button",{className:"yt-loyalty-page-footer-signup-button",style:ae,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"JOIN NOW")))))},ku=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const d=o._customOffer,s=d?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:i},e.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"16px",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},o.name),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),s&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"16px",padding:"12px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"clamp(16px, 4vw, 18px)",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},s),e.createElement("button",{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"20px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(I,null):e.createElement(z,null))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),e.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},e.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),e.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return ct(p,document.body)},Tu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const d=o._customOffer,s=d?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:i},e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),e.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),e.createElement("div",{style:{overflowY:"auto",flex:1}},e.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},e.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},o.name),e.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),s&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"20px",padding:"14px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"18px",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},s),e.createElement("button",{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"22px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(I,null):e.createElement(z,null)))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),e.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},e.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t)))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return ct(p,document.body)},Su=({offersToShow:o,offersConfig:i,getOfferCardMessage:a,setSelectedOffer:l,setShowPopup:c})=>{const d=r(null),[s,p]=t(!1),[u,m]=t(!0),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=768),f=()=>{if(d.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=d.current;p(e>0),m(e<t-n-10)}};n(()=>{f();const e=d.current;if(e)return e.addEventListener("scroll",f),()=>e.removeEventListener("scroll",f)},[o]),n(()=>{const e=()=>{x(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const y=e=>{if(d.current){const t=g?280:365,n=16,o="right"===e?t+n:-(t+n);d.current.scrollBy({left:o,behavior:"smooth"})}};return e.createElement("div",{style:{position:"relative"}},e.createElement("svg",{style:{position:"absolute",width:0,height:0}},e.createElement("defs",null,e.createElement("mask",{id:"coupon-cut-mask-desktop"},e.createElement("rect",{width:"365",height:"138",fill:"white"}),e.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),e.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),e.createElement("mask",{id:"coupon-cut-mask-mobile"},e.createElement("rect",{width:"280",height:"120",fill:"white"}),e.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),e.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),s&&e.createElement("button",{onClick:()=>y("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(F,{size:20})),u&&e.createElement("button",{onClick:()=>y("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(N,{size:20})),e.createElement("div",{ref:d,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:g?"110px":"128px"}},o?.map(t=>e.createElement("div",{key:t.discountId,style:{flexShrink:0,width:g?"280px":"365px",minWidth:g?"280px":"365px",minHeight:g?"110px":"128px",backgroundColor:"transparent",borderRadius:`${i?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},e.createElement("div",{style:{width:g?"60px":"80px",minHeight:g?"110px":"128px",backgroundColor:i?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:g?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${i?.roundness||0}px`,borderBottomLeftRadius:`${i?.roundness||0}px`}},e.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),i?.iconVisibility&&e.createElement("div",{style:{position:"absolute",left:g?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:g?"32px":"40px",height:g?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:g?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{flex:1,padding:g?"12px 12px":"15px 15px",paddingLeft:g?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${i?.roundness||0}px`,borderBottomRightRadius:`${i?.roundness||0}px`,overflow:"hidden",backgroundColor:i?.cardBackgroundColor||"#ffffff",minWidth:0}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:g?"4px":"6px",lineHeight:"normal"}},e.createElement("div",{style:{fontSize:g?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===t.couponType?"Free Gift":t._customOffer?.code?"Coupon":"Special Deal"),e.createElement("div",{style:{fontSize:g?"13px":"15px",fontWeight:"600",color:i?.textColor||"#2c3e50"}},t.name),e.createElement("div",{style:{fontSize:g?"11px":"12px",color:i?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:g?"28px":"32px"}},a(t))),e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),l(t),c(!0)},style:{fontSize:g?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},i?.viewDetailsTitle||"View Details")))))),e.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},$u=({offersToShow:o,offersConfig:r,getOfferCardMessage:i,setSelectedOffer:a,setShowPopup:l})=>{const[c,d]=t("undefined"!=typeof window&&window.innerWidth<=768);return n(()=>{const e=()=>{d(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement("div",{style:{borderRadius:`${r?.roundness||8}px`}},o?.map((t,n)=>e.createElement("div",{key:t.discountId,style:{display:"flex",alignItems:"flex-start",gap:c?"8px":"12px",padding:c?"12px 0":"16px 0",paddingLeft:c?"10px":"20px",backgroundColor:!0===r?.cardBackgroundTransparent||"true"===String(r?.cardBackgroundTransparent)?"transparent":r?.cardBackgroundColor||"#ffffff",borderBottom:n<(o?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${r?.roundness||0}px`}},r?.iconVisibility&&e.createElement("div",{style:{width:c?"40px":"50px",height:c?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:c?"20px":"25px",marginTop:c?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(Le,null)),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:c?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},t.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",e.createElement("span",{style:{fontWeight:600,color:r?.textColor||"#34495e"}},t.name)),e.createElement("div",{style:{fontSize:c?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},i(t)),e.createElement("div",{style:{fontSize:c?"11px":"12px",color:"#000000"}},"offer auto applied",e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),a(t),l(!0)},style:{color:r?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},r?.viewDetailsTitle||"T&C"))))))},Bu=({offersConfig:o,offers:i})=>{const[a,l]=t(!1),[c,d]=t(null),[s,p]=t(null),[u,m]=t("undefined"!=typeof window&&window.innerWidth<=768),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=450),f=r(null);n(()=>{const e=()=>{m(window.innerWidth<=768),x(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{f.current&&pn(f.current)},[o?.sectionBgContrastColor]);const y=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",o=-1;Object.keys(t).forEach(e=>{t[e]>o&&(o=t[e],n=e)});const r=e.map((e,t)=>({o:e,idx:t})),i=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return r.sort((e,t)=>{const o=e.o.customCartProgressBarCriteria===n,r=t.o.customCartProgressBarCriteria===n;if(o&&r){const n=i(e.o),o=i(t.o);return n!==o?n-o:e.idx-t.idx}return o&&!r?-1:!o&&r?1:e.idx-t.idx}),r.map(e=>e.o)})((!1===o?.showBackendOffers&&o?.customOffers&&o.customOffers.length>0?o.customOffers.map((e,t)=>{return{discountId:-(t+1),name:(n=e).title,couponType:n.code?"discount_code":"special_deal",customCartProgressBarCriteria:null,discountPercentage:null,couponTemplateId:0,minimumOrderValue:0,quantityThreshold:0,_allVariantIds:[],description:n.description,_customOffer:n};var n}):i)||[]),b=e=>{if(d(e),e){const t=e._customOffer;p(t?(e=>({offerMessage:e.description||"Special offer available",terms:e.terms?e.terms.split("\n").filter(e=>""!==e.trim()):[]}))(t):(e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const o=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?o.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&o.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&o.push("Combines with other order discounts"),t||o.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:o}})(e))}},h=e=>{const t=e._customOffer;return t?t.description||"Special offer available":(e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available")(e)};return e.createElement("div",null,e.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===o?.sectionType?`${o?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:o?.sectionBackgroundColor||"#fff"}},e.createElement("div",{style:{border:"coupon"===o?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=o?.cardPadding?`${o.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===o?.sectionType?`${o?.roundness||8}px`:"0px"}},e.createElement("span",{ref:f,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"right"===o?.alignment?"auto":"50%",right:"right"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===o?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:o?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},o?.sectionTitle||"Available Deals and Offers"),(()=>{const t=o?.sectionType;return"list"===t?e.createElement($u,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):"coupon"===t?e.createElement(Su,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):null})(),g?e.createElement(Tu,{selectedOffer:c,selectedOfferTerms:s,showPopup:a,offersConfig:o,onClose:()=>{l(!1),d(null),p(null)}}):e.createElement(ku,{selectedOffer:c,selectedOfferTerms:s,showPopup:a,offersConfig:o,onClose:()=>{l(!1),d(null),p(null)}}))))};export{zp as Bundle,Cu as BundleLoader,wu as Cart,Eu as LoyaltyPageBlock,Lt as Nudge,Bu as ProductOffers,Qt as SpinnerWheel};
|