yt-uikit 0.9.26-progress-bar-ui.11 → 0.9.26-progress-bar-ui.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -985,7 +985,7 @@ import e,{useState as t,useEffect as r,useMemo as n,useRef as o,useCallback as a
|
|
|
985
985
|
flex-wrap: wrap;
|
|
986
986
|
text-align: center;
|
|
987
987
|
}
|
|
988
|
-
`,Tn=({prefixMessageText:t="You are",suffixMessageText:r="away from",successMessageText:n="Best reward unlocked",...o})=>{const a=(n,o)=>e.createElement(kn,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},n)," ",r&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},r," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let i=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,c=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,s=pr(o.cartData,o.cartData?.currency)??"Rs .";if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(l<o.checkpoints?.[e]?.minimumOrderValue){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const t=o.checkpoints?.[i];return a(`${s}${br((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===c&&o.cartData?.item_count>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(c<o.checkpoints?.[e]?.quantityThreshold){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const d=o.checkpoints?.[i];return a(`${d?.quantityThreshold-c}`,d?.name)},Sn=t=>e.createElement(xn,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Tn,{...t})),Nn=({particleCount:t,spread:n,origin:a,checkpointPosition:i=.5})=>{const l=o(null),c=o(!1);return r(()=>{if(l.current&&!c.current){Te.create(l.current,{resize:!0})({particleCount:10*t,spread:n,origin:{x:1,y:.8}}),c.current=!0}},[t,n,a,i]),e.createElement("canvas",{ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},Bn=({prefixMessageText:n,suffixMessageText:a,successMessageText:i,enableConfetti:l,...c})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:m,primaryTextColor:u,effectiveQuantityForProgressBar:g,ctaButtonBackgroundColor:f,ctaButtonTextColor:y}=c,x=se(tr),[h,b]=t(!1),[w,v]=t(-1),C=o({});return r(()=>{d?.forEach((e,t)=>{const r=En(e,0,d??[],x?.item_count,c),n=String(e.couponTemplateId);(C.current[n]||0)<100&&r.progressPercentage>=100&&(v(t),b(!0),setTimeout(()=>b(!1),5e3)),C.current[n]=r.progressPercentage})},[x,d]),e.createElement(e.Fragment,null,e.createElement(Sn,{currentCartAmount:s,checkpoints:d,cartData:x,customCartProgressBarCriteria:m,effectiveQuantityForProgressBar:g,themeColor:p,primaryTextColor:u,showMOVForProgressTiers:!1,prefixMessageText:n,suffixMessageText:a,successMessageText:i,ctaButtonBackgroundColor:f,ctaButtonTextColor:y}),e.createElement(hn,null,h&&l&&e.createElement(Nn,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(w+1)/(d?.length??1)}),e.createElement(bn,null,e.createElement(yn,null,d?.sort((e,t)=>"minimum_order_value"===m?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Cn(m)]&&("minimum_order_value"!==m||1!==e?.[Cn(m)]))?.map((...e)=>En(...e,x?.item_count,c))?.map((t,r)=>e.createElement(wn,{key:t?.couponTemplateId,$numberOfCheckpoints:d?.length??1},e.createElement(vn,null,r<d?.length&&e.createElement(fn,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:f}))))))))},Fn=t=>e.createElement(dn,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Tn,{...t})),zn=(t,r,n,o,a,i)=>{let l;if(l="free_product"===t?$n?.[o]:In?.[t],i)return e.createElement("div",{style:{width:"35px",overflow:"visible",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",marginLeft:"-16px",marginRight:"-16px"}},e.createElement("div",{style:{width:"3px",height:"22px",backgroundColor:"#3C3C3C",zIndex:10,flexShrink:0,borderRadius:"99px"}}));if(!l)return e.createElement(Se,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${nn(n)}px`,width:"24px",height:"24px",marginLeft:"-2px"}});const c=(()=>{try{if("undefined"==typeof window)return!0;const e=window?.Shopify?.shop||window?.ytapp?.storeDomain;return!!e&&new Set(["h1gvdy-t0.myshopify.com","aayush-new-store.myshopify.com"]).has(e)}catch(e){return!1}})();return e.createElement(l,{style:{padding:"4px",border:"2px solid black",backgroundColor:c?"#000":"white",borderColor:c?"#fff":r,color:c?"#fff":r,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${nn(n??3)}px`,marginLeft:"-2px"}})},$n={tshirt:Ae,box:_e,cup:Ze,gift:Pe,emptyCircle:nt},In={percentage_discount_coupon:Ce,amount_discount_coupon:Ce,free_delivery:_,free_gift:Pe,dummy_coupon:nt},Pn=({checkpointWithProgress:t,themeColor:r,checkpointsLength:n,progressBarFreeProductIconType:o,themeTextColor:a,ctaButtonTextColor:i,isTierLineIconVisible:l})=>t?.progressPercentage>=100?e.createElement(Se,{style:{padding:"4px",border:"2px solid black",backgroundColor:r,color:i,borderColor:r,borderRadius:"9999px",fontSize:`${nn(n)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):zn(t?.couponType,"#707070",n,o??"tshirt",0,l),Dn=({showMOVForProgressTiers:t,minimumOrderValue:r,customCartProgressBarCriteria:n,cartData:o,quantityThreshold:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l})=>t?e.createElement(sn,{$visible:r>1||a>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:i},"minimum_order_value"===n?`${pr(o,o?.currency)} ${br(r)}`:`${a} item${a>1?"s":""}`):null,An="undefined"!=typeof window?i:r,_n=({prefixMessageText:n,suffixMessageText:i,successMessageText:l,enableConfetti:c,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:m,themeTextColor:u,customCartProgressBarCriteria:g,primaryTextColor:f,effectiveQuantityForProgressBar:y,progressBarFreeProductIconType:x,ctaButtonBackgroundColor:h,showMOVForProgressTiers:b,ctaButtonTextColor:w,isTierLineIconVisible:v=!1}=s,C=se(tr),[E,k]=t(!1),[T,S]=t(-1),N=o({}),[B,F]=t(0),[z,$]=t(0),I=o(null),P=o([]);P.current.length=0;const D=a(()=>{if("undefined"==typeof window)return;const e=P.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return F(e=>0!==e?0:e),void $(e=>0!==e?0:e);let t=0;e.forEach(e=>{const r=window.getComputedStyle(e),n=parseFloat(r.lineHeight||""),o=parseFloat(r.fontSize||""),a=Number.isNaN(n)?Number.isNaN(o)?0:1.2*o:n,i=e.getBoundingClientRect(),l=a>0?Math.max(0,i.height-a):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const r=t>1?Math.min(32,Math.round(t+6)):0;F(e=>e!==r?r:e);const n=I.current,o=e[e.length-1];if(!n||!o)return void $(e=>0!==e?0:e);const a=n.getBoundingClientRect(),i=o.getBoundingClientRect(),l=Math.ceil(i.right-a.right),c=l>0?l:0;$(e=>e!==c?c:e)},[]);return An(()=>{D()}),r(()=>{if("undefined"==typeof window)return;const e=()=>{D()};window.addEventListener("resize",e);const t=I.current,r="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>D()):null;return r&&t&&r.observe(t),()=>{window.removeEventListener("resize",e),r?.disconnect()}},[D]),r(()=>{s.checkpoints?.forEach((e,t)=>{const r=En(e,0,s.checkpoints??[],C?.item_count,s),n=String(e.couponTemplateId);(N.current[n]||0)<100&&r.progressPercentage>=100&&(S(t),k(!0),setTimeout(()=>k(!1),5e3)),N.current[n]=r.progressPercentage})},[C,s.checkpoints]),e.createElement(e.Fragment,null,e.createElement(Fn,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:C,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:m,primaryTextColor:f,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:h,prefixMessageText:n,suffixMessageText:i,successMessageText:l,ctaButtonTextColor:w}),e.createElement(pn,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:z,ref:I},E&&c&&e.createElement(Nn,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(T+1)/(s.checkpoints?.length??1)}),e.createElement(mn,{className:"yt-cart-progress-bar-content-wrapper",$tagWrapOffsetPx:B},e.createElement(on,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Cn(s.customCartProgressBarCriteria)])?.map((...e)=>En(...e,C?.item_count,s))?.map((t,r)=>e.createElement(un,{className:"yt-cart-progress-bar-checkpoint-wrapper",key:t?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},e.createElement(gn,null,r<s.checkpoints?.length&&e.createElement(ln,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:h}),("minimum_order_value"!==s.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(an,{className:"yt-cart-progress-bar-checkpoint-container",$isDummy:t?.isDummyCouponTemplate},e.createElement(cn,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{P.current[r]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:w,$ctaButtonBackgroundColor:h,$primaryTextColor:f,style:{display:s.checkpoints?.length>1?"block":"none"}},t?.name),s.checkpoints?.length>1&&e.createElement(Pn,{checkpointWithProgress:t,themeColor:h,themeTextColor:u,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:x,ctaButtonTextColor:w,isTierLineIconVisible:v}),e.createElement(Dn,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:C,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:h,ctaButtonTextColor:w})))))))))},Ln=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(Bn,{...t}):e.createElement(_n,{...t}):null,Rn=s(s.span`
|
|
988
|
+
`,Tn=({prefixMessageText:t="You are",suffixMessageText:r="away from",successMessageText:n="Best reward unlocked",...o})=>{const a=(n,o)=>e.createElement(kn,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},n)," ",r&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},r," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let i=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,c=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,s=pr(o.cartData,o.cartData?.currency)??"Rs .";if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(l<o.checkpoints?.[e]?.minimumOrderValue){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const t=o.checkpoints?.[i];return a(`${s}${br((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===c&&o.cartData?.item_count>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(c<o.checkpoints?.[e]?.quantityThreshold){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const d=o.checkpoints?.[i];return a(`${d?.quantityThreshold-c}`,d?.name)},Sn=t=>e.createElement(xn,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Tn,{...t})),Nn=({particleCount:t,spread:n,origin:a,checkpointPosition:i=.5})=>{const l=o(null),c=o(!1);return r(()=>{if(l.current&&!c.current){Te.create(l.current,{resize:!0})({particleCount:10*t,spread:n,origin:{x:1,y:.8}}),c.current=!0}},[t,n,a,i]),e.createElement("canvas",{ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},Bn=({prefixMessageText:n,suffixMessageText:a,successMessageText:i,enableConfetti:l,...c})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:m,primaryTextColor:u,effectiveQuantityForProgressBar:g,ctaButtonBackgroundColor:f,ctaButtonTextColor:y}=c,x=se(tr),[h,b]=t(!1),[w,v]=t(-1),C=o({});return r(()=>{d?.forEach((e,t)=>{const r=En(e,0,d??[],x?.item_count,c),n=String(e.couponTemplateId);(C.current[n]||0)<100&&r.progressPercentage>=100&&(v(t),b(!0),setTimeout(()=>b(!1),5e3)),C.current[n]=r.progressPercentage})},[x,d]),e.createElement(e.Fragment,null,e.createElement(Sn,{currentCartAmount:s,checkpoints:d,cartData:x,customCartProgressBarCriteria:m,effectiveQuantityForProgressBar:g,themeColor:p,primaryTextColor:u,showMOVForProgressTiers:!1,prefixMessageText:n,suffixMessageText:a,successMessageText:i,ctaButtonBackgroundColor:f,ctaButtonTextColor:y}),e.createElement(hn,null,h&&l&&e.createElement(Nn,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(w+1)/(d?.length??1)}),e.createElement(bn,null,e.createElement(yn,null,d?.sort((e,t)=>"minimum_order_value"===m?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Cn(m)]&&("minimum_order_value"!==m||1!==e?.[Cn(m)]))?.map((...e)=>En(...e,x?.item_count,c))?.map((t,r)=>e.createElement(wn,{key:t?.couponTemplateId,$numberOfCheckpoints:d?.length??1},e.createElement(vn,null,r<d?.length&&e.createElement(fn,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:f}))))))))},Fn=t=>e.createElement(dn,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Tn,{...t})),zn=(t,r,n,o,a,i)=>{let l;if(l="free_product"===t?$n?.[o]:In?.[t],i)return e.createElement("div",{style:{width:"35px",overflow:"visible",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",marginLeft:"-16px",marginRight:"-16px"}},e.createElement("svg",{width:"12",height:"26",viewBox:"0 0 12 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{zIndex:10,flexShrink:0,overflow:"visible"}},e.createElement("path",{d:"M6 2 Q5.5 13 6 24",stroke:"#3C3C3C",strokeWidth:"3",strokeLinecap:"round",fill:"none"})));if(!l)return e.createElement(Se,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${nn(n)}px`,width:"24px",height:"24px",marginLeft:"-2px"}});const c=(()=>{try{if("undefined"==typeof window)return!0;const e=window?.Shopify?.shop||window?.ytapp?.storeDomain;return!!e&&new Set(["h1gvdy-t0.myshopify.com","aayush-new-store.myshopify.com"]).has(e)}catch(e){return!1}})();return e.createElement(l,{style:{padding:"4px",border:"2px solid black",backgroundColor:c?"#000":"white",borderColor:c?"#fff":r,color:c?"#fff":r,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${nn(n??3)}px`,marginLeft:"-2px"}})},$n={tshirt:Ae,box:_e,cup:Ze,gift:Pe,emptyCircle:nt},In={percentage_discount_coupon:Ce,amount_discount_coupon:Ce,free_delivery:_,free_gift:Pe,dummy_coupon:nt},Pn=({checkpointWithProgress:t,themeColor:r,checkpointsLength:n,progressBarFreeProductIconType:o,themeTextColor:a,ctaButtonTextColor:i,isTierLineIconVisible:l})=>t?.progressPercentage>=100?e.createElement(Se,{style:{padding:"4px",border:"2px solid black",backgroundColor:r,color:i,borderColor:r,borderRadius:"9999px",fontSize:`${nn(n)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):zn(t?.couponType,"#707070",n,o??"tshirt",0,l),Dn=({showMOVForProgressTiers:t,minimumOrderValue:r,customCartProgressBarCriteria:n,cartData:o,quantityThreshold:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l})=>t?e.createElement(sn,{$visible:r>1||a>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:i},"minimum_order_value"===n?`${pr(o,o?.currency)} ${br(r)}`:`${a} item${a>1?"s":""}`):null,An="undefined"!=typeof window?i:r,_n=({prefixMessageText:n,suffixMessageText:i,successMessageText:l,enableConfetti:c,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:m,themeTextColor:u,customCartProgressBarCriteria:g,primaryTextColor:f,effectiveQuantityForProgressBar:y,progressBarFreeProductIconType:x,ctaButtonBackgroundColor:h,showMOVForProgressTiers:b,ctaButtonTextColor:w,isTierLineIconVisible:v=!1}=s,C=se(tr),[E,k]=t(!1),[T,S]=t(-1),N=o({}),[B,F]=t(0),[z,$]=t(0),I=o(null),P=o([]);P.current.length=0;const D=a(()=>{if("undefined"==typeof window)return;const e=P.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return F(e=>0!==e?0:e),void $(e=>0!==e?0:e);let t=0;e.forEach(e=>{const r=window.getComputedStyle(e),n=parseFloat(r.lineHeight||""),o=parseFloat(r.fontSize||""),a=Number.isNaN(n)?Number.isNaN(o)?0:1.2*o:n,i=e.getBoundingClientRect(),l=a>0?Math.max(0,i.height-a):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const r=t>1?Math.min(32,Math.round(t+6)):0;F(e=>e!==r?r:e);const n=I.current,o=e[e.length-1];if(!n||!o)return void $(e=>0!==e?0:e);const a=n.getBoundingClientRect(),i=o.getBoundingClientRect(),l=Math.ceil(i.right-a.right),c=l>0?l:0;$(e=>e!==c?c:e)},[]);return An(()=>{D()}),r(()=>{if("undefined"==typeof window)return;const e=()=>{D()};window.addEventListener("resize",e);const t=I.current,r="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>D()):null;return r&&t&&r.observe(t),()=>{window.removeEventListener("resize",e),r?.disconnect()}},[D]),r(()=>{s.checkpoints?.forEach((e,t)=>{const r=En(e,0,s.checkpoints??[],C?.item_count,s),n=String(e.couponTemplateId);(N.current[n]||0)<100&&r.progressPercentage>=100&&(S(t),k(!0),setTimeout(()=>k(!1),5e3)),N.current[n]=r.progressPercentage})},[C,s.checkpoints]),e.createElement(e.Fragment,null,e.createElement(Fn,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:C,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:m,primaryTextColor:f,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:h,prefixMessageText:n,suffixMessageText:i,successMessageText:l,ctaButtonTextColor:w}),e.createElement(pn,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:z,ref:I},E&&c&&e.createElement(Nn,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(T+1)/(s.checkpoints?.length??1)}),e.createElement(mn,{className:"yt-cart-progress-bar-content-wrapper",$tagWrapOffsetPx:B},e.createElement(on,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Cn(s.customCartProgressBarCriteria)])?.map((...e)=>En(...e,C?.item_count,s))?.map((t,r)=>e.createElement(un,{className:"yt-cart-progress-bar-checkpoint-wrapper",key:t?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},e.createElement(gn,null,r<s.checkpoints?.length&&e.createElement(ln,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:h}),("minimum_order_value"!==s.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(an,{className:"yt-cart-progress-bar-checkpoint-container",$isDummy:t?.isDummyCouponTemplate},e.createElement(cn,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{P.current[r]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:w,$ctaButtonBackgroundColor:h,$primaryTextColor:f,style:{display:s.checkpoints?.length>1?"block":"none"}},t?.name),s.checkpoints?.length>1&&e.createElement(Pn,{checkpointWithProgress:t,themeColor:h,themeTextColor:u,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:x,ctaButtonTextColor:w,isTierLineIconVisible:v}),e.createElement(Dn,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:C,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:h,ctaButtonTextColor:w})))))))))},Ln=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(Bn,{...t}):e.createElement(_n,{...t}):null,Rn=s(s.span`
|
|
989
989
|
display: flex !important;
|
|
990
990
|
gap: 4px;
|
|
991
991
|
`)`
|