yt-uikit 0.8.56 → 0.8.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js
CHANGED
|
@@ -2146,7 +2146,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2146
2146
|
object-fit: cover;
|
|
2147
2147
|
display: block;
|
|
2148
2148
|
}
|
|
2149
|
-
`,Ia=({imageUrls:t,redirectionLink:n,cartOffersCarouselHeight:o,enableMarquee:r=!0})=>{if(!t||0===t.length)return null;const i=()=>{n&&(window.location.href=n)};if(!r)return e.createElement(Ba,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("img",{src:t[0],alt:"banner"}));const a=[...t,...t];return e.createElement($a,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content"},a.map((t,n)=>e.createElement("img",{key:`marquee-img-${n}`,src:t,alt:`banner ${n+1}`})))))},za=({backgroundColor:o,titleText:r,descriptionText:i,criteria:a=[],pauseTimer:l,textAlignment:c="center",redirectionUrl:d,enableCustomCriteria:s=!0,cartData:p})=>{const[u,m]=t(0),g=e.useRef(null),x=e.useRef([]),f=s?a.filter(e=>{if(!p)return!1;if("mov"===e.type){return Zt(p?.items_subtotal_price??0,p?.currency??"INR")>=e.value}if("moq"===e.type){return p.items.filter(e=>!e.properties?._isYtFreebie).reduce((e,t)=>e+(t.quantity||1),0)>=e.value}return!1}):[],y=Boolean(r&&r.trim()||i&&i.trim()),b=[...y?[{type:"default",titleText:r,descriptionText:i}]:[],...f.map(e=>({type:"criteria",titleText:e.message,descriptionText:"",redirectionUrl:e.redirectionUrl}))],h=b.length,v=h>0,w=h>1,C=e=>{"criteria"===e.type&&e.redirectionUrl?window.location.href=e.redirectionUrl:"default"===e.type&&d&&(window.location.href=d)};let E,k=!1;h>0&&(E=b[u]??b[0],k="criteria"===E.type&&Boolean(E.redirectionUrl)||"default"===E.type&&Boolean(d)),n(()=>{const e=f.filter(e=>!x.current.some(t=>t.id===e.id));if(e.length>0){const t=e[0],n=f.findIndex(e=>e.id===t.id);if(-1!==n){const e=(y?1:0)+n;e<b.length&&m(e)}}x.current=f},[f,b,y]),n(()=>{h>0&&u>=h&&m(h-1)},[u,h]),n(()=>{g.current&&ln(g.current)},[o,b,u]),n(()=>{if(!w)return void m(0);const e=setInterval(()=>{m(e=>(e+1)%h)},1e3*l);return()=>clearInterval(e)},[w,h,l]);return v?e.createElement(ga,{ref:g,$backgroundColor:o},e.createElement(fa,null,w?e.createElement(Ca,null,e.createElement(Ta,{$position:"left",onClick:()=>{m(e=>0===e?h-1:e-1)}},e.createElement(be,null)),e.createElement(Ea,{$currentIndex:u},b.map((t,n)=>e.createElement(ka,{key:n,onClick:()=>C(t),style:{cursor:"criteria"===t.type&&t.redirectionUrl||"default"===t.type&&d?"pointer":"default"}},e.createElement(ba,null,e.createElement(ha,{style:{textAlign:
|
|
2149
|
+
`,Ia=({imageUrls:t,redirectionLink:n,cartOffersCarouselHeight:o,enableMarquee:r=!0})=>{if(!t||0===t.length)return null;const i=()=>{n&&(window.location.href=n)};if(!r)return e.createElement(Ba,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("img",{src:t[0],alt:"banner"}));const a=[...t,...t];return e.createElement($a,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content"},a.map((t,n)=>e.createElement("img",{key:`marquee-img-${n}`,src:t,alt:`banner ${n+1}`})))))},za=({backgroundColor:o,titleText:r,descriptionText:i,criteria:a=[],pauseTimer:l,textAlignment:c="center",redirectionUrl:d,enableCustomCriteria:s=!0,cartData:p})=>{const[u,m]=t(0),g=e.useRef(null),x=e.useRef([]),f=s?a.filter(e=>{if(!p)return!1;if("mov"===e.type){return Zt(p?.items_subtotal_price??0,p?.currency??"INR")>=e.value}if("moq"===e.type){return p.items.filter(e=>!e.properties?._isYtFreebie).reduce((e,t)=>e+(t.quantity||1),0)>=e.value}return!1}):[],y=Boolean(r&&r.trim()||i&&i.trim()),b=[...y?[{type:"default",titleText:r,descriptionText:i}]:[],...f.map(e=>({type:"criteria",titleText:e.message,descriptionText:"",redirectionUrl:e.redirectionUrl}))],h=b.length,v=h>0,w=h>1,C=e=>{"criteria"===e.type&&e.redirectionUrl?window.location.href=e.redirectionUrl:"default"===e.type&&d&&(window.location.href=d)};let E,k=!1;h>0&&(E=b[u]??b[0],k="criteria"===E.type&&Boolean(E.redirectionUrl)||"default"===E.type&&Boolean(d)),n(()=>{const e=f.filter(e=>!x.current.some(t=>t.id===e.id));if(e.length>0){const t=e[0],n=f.findIndex(e=>e.id===t.id);if(-1!==n){const e=(y?1:0)+n;e<b.length&&m(e)}}x.current=f},[f,b,y]),n(()=>{h>0&&u>=h&&m(h-1)},[u,h]),n(()=>{g.current&&ln(g.current)},[o,b,u]),n(()=>{if(!w)return void m(0);const e=setInterval(()=>{m(e=>(e+1)%h)},1e3*l);return()=>clearInterval(e)},[w,h,l]);return v?e.createElement(ga,{ref:g,$backgroundColor:o},e.createElement(fa,null,w?e.createElement(Ca,null,e.createElement(Ta,{$position:"left",onClick:()=>{m(e=>0===e?h-1:e-1)}},e.createElement(be,null)),e.createElement(Ea,{$currentIndex:u},b.map((t,n)=>e.createElement(ka,{key:n,onClick:()=>C(t),style:{cursor:"criteria"===t.type&&t.redirectionUrl||"default"===t.type&&d?"pointer":"default"}},e.createElement(ba,null,e.createElement(ha,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement(va,{style:{textAlign:"center"}},t.descriptionText))))),e.createElement(Ta,{$position:"right",onClick:()=>{m(e=>(e+1)%h)}},e.createElement(he,null))):e.createElement(ba,{onClick:()=>E&&C(E),style:{cursor:k?"pointer":"default"}},(()=>{const t=b[u]??b[0];return e.createElement(e.Fragment,null,e.createElement(ha,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement(va,{style:{textAlign:"center"}},t.descriptionText))})()))):null},Na=({backgroundColor:t,imageUrl:o,titleText:r,descriptionText:i,textAlignment:a,redirectionUrl:l})=>{const c=e.useRef(null);n(()=>{c.current&&ln(c.current)},[t]);return e.createElement(ma,{ref:c,$backgroundColor:t,onClick:()=>{l&&(window.location.href=l)},style:{cursor:l?"pointer":"default"}},e.createElement(xa,null,e.createElement(ya,{$imageUrl:o}),e.createElement(ba,null,e.createElement(ha,{style:{textAlign:"center"}},r),e.createElement(va,{style:{textAlign:"center"}},i))))},Fa=({backgroundColor:t,couponCode:o,copySuccess:r,setCopySuccess:i,titleText:a,descriptionText:l,textAlignment:c="center"})=>{const d=e.useRef(null);n(()=>{d.current&&ln(d.current)},[t]);return e.createElement(ma,{ref:d,$backgroundColor:t,style:{position:"relative"}},e.createElement(xa,{style:{filter:r?"blur(5px)":"none",zIndex:1}},e.createElement(ba,{style:{borderRight:"1px solid #d9d9d9",paddingRight:"5px"}},e.createElement(ha,{style:{textAlign:"center"}},a),e.createElement(va,{style:{textAlign:"center"}},l)),e.createElement(wa,null,e.createElement(ie,{className:"copy-icon",size:24,onClick:()=>(e=>{navigator.clipboard.writeText(e).then(()=>{i(!0)},e=>{i(!1)}),setTimeout(()=>{i(!1)},3e3)})(o),style:{height:"24px",width:"24px"}}))))},Pa=({children:o,autoSlide:r=!0,autoSlideInterval:i,copySuccess:a,themeColor:l})=>{const[c,d]=t(0),s=e.Children.count(o),[p,u]=t(!1),[m,g]=t(r),x=()=>{d(e=>e===s-1?0:e+1)};return n(()=>{if(!m)return;const e=setInterval(x,i);return()=>clearInterval(e)},[m,i]),e.createElement(Sa,null,a&&e.createElement("div",{className:"coupon-code-copied",style:{position:"absolute",top:"20%",left:"50%",transform:"translate(-50%, -20%)",backgroundColor:l,display:"flex",alignItems:"center",justifyContent:"center",gap:"9px",borderRadius:"9px",padding:"12px 30px",color:"#FFF",fontFamily:"Poppins",fontSize:"12px",fontWeight:"400",lineHeight:"118%",zIndex:2,minWidth:"70%"}},e.createElement(j,{size:20,color:"white",style:{height:"24px",width:"24px"}}),"Coupon Code Copied"),e.createElement("div",{onMouseEnter:()=>{u(!0),g(!1)},onMouseLeave:()=>{u(!1),g(!0)},style:{display:"flex",transition:p?"none":"transform 0.5s ease",transform:`translateX(-${100*c}%)`,cursor:"pointer"}},e.Children.toArray(o)))};function Da({cartOffersCarousalData:n,themeColor:o,cartOffersCarouselHeight:r,cartData:i}){const[a,l]=t(!1),{enableCartOffersCarousel:c,pauseTimer:d,backgroundColor:s,slides:p}=n,u=p.filter(e=>"ImageOnly"===e.slideType).map(e=>e.imageUrl).filter(e=>!!e),m=p.findIndex(e=>"ImageOnly"===e.slideType),g=[];let x=!1;return p.forEach((t,n)=>{if("ImageOnly"===t.slideType)n===m&&u.length>0&&!x&&(g.push(e.createElement(Ia,{key:`image-only-marquee-${t.slideNumber}`,imageUrls:u,redirectionLink:t.redirectionUrl||t.carouselRedirectionLink,cartOffersCarouselHeight:r,enableMarquee:!1!==t.enableMarquee})),x=!0);else switch(t.slideType){case"TextFieldOnly":g.push(e.createElement(za,{key:t.slideNumber,backgroundColor:s,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",criteria:t.criteria,pauseTimer:d,textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink,enableCustomCriteria:t.enableCustomCriteria,cartData:i}));break;case"TextImage":g.push(e.createElement(Na,{key:t.slideNumber,backgroundColor:s,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",imageUrl:t.imageUrl||"",textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink}));break;case"TextCode":g.push(e.createElement(Fa,{key:t.slideNumber,backgroundColor:s,couponCode:t.campaignCode??"",titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",copySuccess:a,setCopySuccess:l,textAlignment:t.textAlignment}))}}),c&&0!==g.length?e.createElement(Pa,{copySuccess:a,autoSlideInterval:1e3*d,themeColor:o},g):null}const Aa=d`
|
|
2150
2150
|
0% {
|
|
2151
2151
|
background-position: 200% 0;
|
|
2152
2152
|
}
|
|
@@ -3346,7 +3346,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3346
3346
|
text-align: center;
|
|
3347
3347
|
display: flex;
|
|
3348
3348
|
flex-shrink: 0;
|
|
3349
|
-
`,$c=({tiers:t,isMobile:n=!1,selectedProductsByTier:o,selectedProducts:r,themeColor:i,showProductDetailsInTracker:a,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:d})=>e.createElement(e.Fragment,null,t.map((i,s)=>{const p=i.minimumQuantity-(o[s]?.length??0),u=r?.filter(e=>o[s]?.includes(e.variantId));return Math.min(o[s]?.length/i.minimumQuantity*100,100),e.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},e.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},e.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(t=>{const r=t.product.variants?.edges?.find(e=>e.node.id===t.variantId),p=o[s]?.filter(e=>e===r?.node.id).length||0;return a?e.createElement(Tc,{className:"yt-byob-tracker-detailed-product-item",key:t.variantId},e.createElement(cc,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.isFree&&e.createElement("div",{style:{position:"absolute",bottom:4,left:"30%",background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"40px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},"FREE",e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),t?.quantity>1&&e.createElement(ic,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},t.quantity,"x")),e.createElement(sc,{className:"yt-byob-tracker-info-block"},e.createElement(pc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(uc,{className:"yt-byob-tracker-product-price"},d,Pp(r?.node?.price)),e.createElement(ac,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(t.variantId,s),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[s]?.length?{display:"none"}:{}}},e.createElement(tt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(kc,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},t?.isFree&&e.createElement("div",{style:{position:"absolute",top:4,left:4,background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"8px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},e.createElement(Ze,null),e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),p>1&&e.createElement(ic,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),e.createElement(ac,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(t.variantId,s),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[s]?.length?{display:"none"}:{}}},e.createElement(Y,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((t,o)=>e.createElement(gc,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:o},e.createElement(Se,{size:40,color:"#A0A0A0"}))))),s<t.length-1&&e.createElement(Sc,{className:"yt-byob-tracker-plus-icon-container"},e.createElement(Se,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),Bc=({builderTiers:o,handleAddToCart:r,minimumQuantity:i,selectedProducts:a,showProductDetailsInTracker:l,loading:c,handleRemoveItem:d,percentageOff:s,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:g,dealAmount:x,isMobile:f=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:h,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[E,k]=t(!1),[T,S]=t(0),[$,B]=t([]),[I,z]=t(0),[N,F]=t(0),[P,D]=t(!1),[A,_]=t(null),R=u?.price||0,O=o?.type,L=e=>{if(e<0||!$[e])return R;const t=$[e].discountValue??0;return s?R*(1-t/100):x?t:m?R-t:R};n(()=>{if(o&&"none"!==o.type)if("productTier"===O&&o.productTier){const e=o.productTier||[];B(e);let t=0;o.productTier.map(e=>{t+=e.minimumQuantity}),F(t-p)}else if($.length)I>0&&p<$[I-1]?.minimumQuantity?(z(I-1),_(I-1)):p<$[I]?.minimumQuantity&&_(I-1),S(L(I));else{const e=o.offerTier||[];B(e),z(0),F(e[0]?.minimumQuantity-p||i-p)}else B([]),F(i-p),z(0)},[o,i,p]),n(()=>{$.length&&"productTier"!=O?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===O)for(let o=0;o<$.length&&(n+=$[o].minimumQuantity,p>=n);o++)t=o,e=o+1<$.length?o+1:o;if(z(e),_(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);D(e===p),k(!0),S(L(t))}else D(!1),k(!1),S(R);const o=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;F(o)})():p===i?(k(!0),S(s?R*(1-s/100):x||(m?R-m:R)),D(!0)):(D(!1),k(!1))},[p,$]);const M=E?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=E?T.toFixed(2):u?.price?.toFixed(2),V=M&&j?(M-Number(j)).toFixed(2):0,W=o&&"none"!==O&&o.offerTier?"offerTier"===O?Math.min(p/(p+N)*100,100):void 0:p/i*100;n(()=>{if(E&&g.byob.enableConfetti){console.log("remainingItems",N);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,o=(t.top+t.height/2)/window.innerHeight;ge({particleCount:100,spread:70,origin:{x:n,y:o},zIndex:9999})}},[E,g]),I>=0&&I<$.length&&$[I].tier;const H=e.useMemo(()=>null!==A&&$[A+1]?$[A+1]?.customText||"":o?.offerTier?.[0]?.customText||"",[A,$,o]),q="number"==typeof A?$[A]?.customText:void 0,Q="string"==typeof q&&""!==q.trim();return e.createElement(Xl,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(f?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:f,style:{justifyContent:g.byob.selectedProductsVisibility&&!f?"space-between":"center"}},"offerTier"==O&&null!==A&&A>=0&&e.createElement(Zl,{className:"yt-byob-tracker-offer-tier-tag"},Q?e.createElement(e.Fragment,null,q," unlocked"):e.createElement(e.Fragment,null,e.createElement(e.Fragment,null,"Buy"," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||x?e.createElement(e.Fragment,null," ",Dp(g.general.currencySymbol,C)):""," ",Pp($[A]?.discountValue),s?e.createElement(e.Fragment,null,"% "):Pp(x)?e.createElement(e.Fragment,null):"",s||m?e.createElement(e.Fragment,null," Off"):""),e.createElement("span",{style:{fontStyle:"italic"}}," applied"))),f&&N>=1&&!P&&"offerTier"!==O?e.createElement(Jl,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},0===$.length?e.createElement(e.Fragment,null,"Select ",N," more item(s)"," ",0!==x||0!==s?"to get the bundle at":"",0!==x&&e.createElement(e.Fragment,null,` ${Dp(g.general.currencySymbol,C)}${x}`),0!==s&&e.createElement(e.Fragment,null," ",` ${s}% Off`)):e.createElement(e.Fragment,null," Select ",N," more item(s)")):e.createElement(e.Fragment,null),"productTier"!==O&&e.createElement(Kl,{className:"yt-byob-tracker-tier-progress-container"},e.createElement(ec,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==O&&$.length>0&&N>0&&e.createElement(e.Fragment,null,H?e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," more to unlock ",H):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," More Item(s)",e.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+N," at"," ",m||x?e.createElement(e.Fragment,null,Dp(g.general.currencySymbol,C)):""," ",Pp($[I>=0?I:0]?.discountValue),s?e.createElement(e.Fragment,null,"% "):Pp(x)?e.createElement(e.Fragment,null):"",s||m?e.createElement(e.Fragment,null," Off"):"")))),e.createElement(tc,{className:"yt-byob-tracker-progress-bar-bg"},e.createElement(nc,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:y??g?.general.primaryColor}," "))),g.byob.selectedProductsVisibility&&e.createElement(oc,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(f?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:O??"",isMobile:f},"productTier"===O?e.createElement($c,{tiers:$,isMobile:f,selectedProductsByTier:w??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:l,handleRemoveItemProductTier:v,cornerRadius:g.byob.borderRadius,currencySymbol:Dp(g.general.currencySymbol,C)}):e.createElement(e.Fragment,null,a?.map?.(t=>{const n=t.product.variants?.edges?.find(e=>e.node.id===t.variantId);return l?e.createElement(lc,{className:"yt-byob-tracker-detailed-item-container",borderRadius:g.byob.borderRadius,key:t.variantId},e.createElement(cc,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.quantity>1&&e.createElement(dc,{className:"yt-byob-tracker-badge"},t.quantity,"x")),e.createElement(sc,{className:"yt-byob-tracker-info-block"},e.createElement(pc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(uc,{className:"yt-byob-tracker-product-price"},g.general.currencySymbol,n?.node?.price),e.createElement(mc,{className:"yt-byob-tracker-remove-link",onClick:()=>d(t.variantId)},e.createElement(tt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(Ec,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:f,borderRadius:g.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url},t?.quantity>1&&e.createElement(ic,{className:"yt-byob-tracker-quantity-badge",borderRadius:g.byob.borderRadius},t.quantity,"x"),e.createElement(ac,{className:"yt-byob-tracker-remove-btn",onClick:()=>d(t.variantId)},e.createElement(Y,{fontSize:"12px"}))))}),N>=1&&[...Array(N)].map((t,n)=>e.createElement(gc,{className:"yt-byob-tracker-placeholder-box",isMobile:f,borderRadius:g.byob.borderRadius,key:n},e.createElement(Se,{size:40,color:"#A0A0A0"}))))),(!f||P)&&e.createElement(rc,{className:"yt-byob-tracker-summary-container bundle-summary "+(f?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:f},Number(j)>0&&e.createElement(xc,{className:"yt-byob-tracker-summary-info summary-info"},e.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},f?e.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},e.createElement(fc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&e.createElement(yc,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",Dp(g.general.currencySymbol,C),Pp(V))):e.createElement(e.Fragment,null,e.createElement(fc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!f&&e.createElement(yc,{className:"yt-byob-tracker-save-label"},"Save:"," ",Dp(g.general.currencySymbol,C),Pp(V)))),e.createElement(bc,{className:"yt-byob-tracker-subtotal-row"},e.createElement(hc,{className:"yt-byob-tracker-final-price"},Dp(g.general.currencySymbol,C),Number(j)>=0?Pp(Number(j).toFixed(2)):0),M&&g.byob.compareAtPriceVisibility&&Number(M)>Number(j)&&e.createElement(vc,{className:"yt-byob-tracker-line-through-price"},Dp(g.general.currencySymbol,C),Pp(Number(M).toFixed(2))))),e.createElement(wc,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:P,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:g.general.ctaBackgroundColor,ctaBorderColor:g.general.ctaBorderColor,ctaHoverBackgroundColor:g.general.ctaHoverBackgroundColor,ctaHoverTextColor:g.general.ctaHoverTextColor},borderRadius:g.general.ctaBorderRadius,disabled:!P&&N>=1,onClick:e=>{c||console.log("saving"),r(e.target??e.currentTarget)},id:"checkoutButton"},c?e.createElement(Je,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!P?e.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",N," More Item(s)"):e.createElement(Cc,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:g.general.ctaTextColor,ctaHoverTextColor:h??g.general.ctaHoverTextColor},g.byob.checkoutCTAText??"Checkout"))))},Ic={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},zc={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Nc=o=>{const[r,i]=t(!1);n(()=>{const e=()=>{i(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const a="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,l=((e,t=!1)=>{const n=e&&Ic[e]?Ic[e]:{},o={...zc,...n};return t&&n.mobile?{...o,...n.mobile}:o})(String(a),r);o.renderingOnPage||(l.position="static",l.zIndex=0);const c={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...l};return e.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(r?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...c,width:r?"100%":l.width,...!o.styles.byob.selectedProductsVisibility&&{width:r?"96%":"fit-content",paddingInline:"10px"},...r&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===l.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=l.transform||"translateY(0)"}},e.createElement(Bc,{...o,isMobile:r}))},Fc=J(void 0),Pc=c.div`
|
|
3349
|
+
`,$c=({tiers:t,isMobile:n=!1,selectedProductsByTier:o,selectedProducts:r,themeColor:i,showProductDetailsInTracker:a,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:d})=>e.createElement(e.Fragment,null,t.map((i,s)=>{const p=i.minimumQuantity-(o[s]?.length??0),u=r?.filter(e=>o[s]?.includes(e.variantId));return Math.min(o[s]?.length/i.minimumQuantity*100,100),e.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},e.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},e.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(t=>{const r=t.product.variants?.edges?.find(e=>e.node.id===t.variantId),p=o[s]?.filter(e=>e===r?.node.id).length||0;return a?e.createElement(Tc,{className:"yt-byob-tracker-detailed-product-item",key:t.variantId},e.createElement(cc,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.isFree&&e.createElement("div",{style:{position:"absolute",bottom:4,left:"30%",background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"40px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},"FREE",e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),t?.quantity>1&&e.createElement(ic,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},t.quantity,"x")),e.createElement(sc,{className:"yt-byob-tracker-info-block"},e.createElement(pc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(uc,{className:"yt-byob-tracker-product-price"},d,Pp(r?.node?.price)),e.createElement(ac,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(t.variantId,s),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[s]?.length?{display:"none"}:{}}},e.createElement(tt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(kc,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},t?.isFree&&e.createElement("div",{style:{position:"absolute",top:4,left:4,background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"8px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},e.createElement(Ze,null),e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),p>1&&e.createElement(ic,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),e.createElement(ac,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(t.variantId,s),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[s]?.length?{display:"none"}:{}}},e.createElement(Y,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((t,o)=>e.createElement(gc,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:o},e.createElement(Se,{size:40,color:"#A0A0A0"}))))),s<t.length-1&&e.createElement(Sc,{className:"yt-byob-tracker-plus-icon-container"},e.createElement(Se,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),Bc=({builderTiers:o,handleAddToCart:r,minimumQuantity:i,selectedProducts:a,showProductDetailsInTracker:l,loading:c,handleRemoveItem:d,percentageOff:s,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:g,dealAmount:x,isMobile:f=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:h,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[E,k]=t(!1),[T,S]=t(0),[$,B]=t([]),[I,z]=t(0),[N,F]=t(0),[P,D]=t(!1),[A,_]=t(null),R=u?.price||0,O=o?.type,L=e=>{if(e<0||!$[e])return R;const t=$[e].discountValue??0;return s?R*(1-t/100):x?t:m?R-t:R};n(()=>{if(o&&"none"!==o.type)if("productTier"===O&&o.productTier){const e=o.productTier||[];B(e);let t=0;o.productTier.map(e=>{t+=e.minimumQuantity}),F(t-p)}else if($.length)I>0&&p<$[I-1]?.minimumQuantity?(z(I-1),_(I-1)):p<$[I]?.minimumQuantity&&_(I-1),S(L(I));else{const e=o.offerTier||[];B(e),z(0),F(e[0]?.minimumQuantity-p||i-p)}else B([]),F(i-p),z(0)},[o,i,p]),n(()=>{$.length&&"productTier"!=O?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===O)for(let o=0;o<$.length&&(n+=$[o].minimumQuantity,p>=n);o++)t=o,e=o+1<$.length?o+1:o;if(z(e),_(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);D(e===p),k(!0),S(L(t))}else D(!1),k(!1),S(R);const o=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;F(o)})():p===i?(k(!0),S(s?R*(1-s/100):x||(m?R-m:R)),D(!0)):(D(!1),k(!1))},[p,$]);const M=E?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=E?T.toFixed(2):u?.price?.toFixed(2),V=M&&j?(M-Number(j)).toFixed(2):0,W=o&&"none"!==O&&o.offerTier?"offerTier"===O?Math.min(p/(p+N)*100,100):void 0:p/i*100;n(()=>{if(E&&g.byob.enableConfetti){console.log("remainingItems",N);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,o=(t.top+t.height/2)/window.innerHeight;ge({particleCount:100,spread:70,origin:{x:n,y:o},zIndex:9999})}},[E,g]),I>=0&&I<$.length&&$[I].tier;const H=e.useMemo(()=>null!==A&&$[A+1]?$[A+1]?.customText||"":o?.offerTier?.[0]?.customText||"",[A,$,o]),q="number"==typeof A?$[A]?.customText:void 0,Q="string"==typeof q&&""!==q.trim();return e.createElement(Xl,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(f?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:f,style:{justifyContent:g.byob.selectedProductsVisibility&&!f?"space-between":"center"}},"offerTier"==O&&null!==A&&A>=0&&e.createElement(Zl,{className:"yt-byob-tracker-offer-tier-tag"},Q?e.createElement(e.Fragment,null,q," unlocked"):e.createElement(e.Fragment,null,e.createElement(e.Fragment,null,"Buy"," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||x?e.createElement(e.Fragment,null," ",Dp(g.general.currencySymbol,C)):""," ",Pp($[A]?.discountValue),s?e.createElement(e.Fragment,null,"% "):Pp(x)?e.createElement(e.Fragment,null):"",s||m?e.createElement(e.Fragment,null," Off"):""),e.createElement("span",{style:{fontStyle:"italic"}}," applied"))),f&&N>=1&&!P&&"offerTier"!==O?e.createElement(Jl,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},0===$.length?e.createElement(e.Fragment,null,"Select ",N," more item(s)"," ",0!==x||0!==s?"to get the bundle at":"",0!==x&&e.createElement(e.Fragment,null,` ${Dp(g.general.currencySymbol,C)}${x}`),0!==s&&e.createElement(e.Fragment,null," ",` ${s}% Off`)):e.createElement(e.Fragment,null," Select ",N," more item(s)")):e.createElement(e.Fragment,null),"productTier"!==O&&e.createElement(Kl,{className:"yt-byob-tracker-tier-progress-container"},e.createElement(ec,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==O&&$.length>0&&N>0&&e.createElement(e.Fragment,null,H?e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," more to unlock ",H):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," More Item(s)",e.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+N," at"," ",m||x?e.createElement(e.Fragment,null,Dp(g.general.currencySymbol,C)):""," ",Pp($[I>=0?I:0]?.discountValue),s?e.createElement(e.Fragment,null,"% "):Pp(x)?e.createElement(e.Fragment,null):"",s||m?e.createElement(e.Fragment,null," Off"):"")))),e.createElement(tc,{className:"yt-byob-tracker-progress-bar-bg"},e.createElement(nc,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:y??g?.general.primaryColor}," "))),g.byob.selectedProductsVisibility&&e.createElement(oc,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(f?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:O??"",isMobile:f},"productTier"===O?e.createElement($c,{tiers:$,isMobile:f,selectedProductsByTier:w??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:l,handleRemoveItemProductTier:v,cornerRadius:g.byob.borderRadius,currencySymbol:Dp(g.general.currencySymbol,C)}):e.createElement(e.Fragment,null,a?.map?.(t=>{const n=t.product.variants?.edges?.find(e=>e.node.id===t.variantId);return l?e.createElement(lc,{className:"yt-byob-tracker-detailed-item-container",borderRadius:g.byob.borderRadius,key:t.variantId},e.createElement(cc,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.quantity>1&&e.createElement(dc,{className:"yt-byob-tracker-badge"},t.quantity,"x")),e.createElement(sc,{className:"yt-byob-tracker-info-block"},e.createElement(pc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(uc,{className:"yt-byob-tracker-product-price"},g.general.currencySymbol,n?.node?.price),e.createElement(mc,{className:"yt-byob-tracker-remove-link",onClick:()=>d(t.variantId)},e.createElement(tt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(Ec,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:f,borderRadius:g.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url},t?.quantity>1&&e.createElement(ic,{className:"yt-byob-tracker-quantity-badge",borderRadius:g.byob.borderRadius},t.quantity,"x"),e.createElement(ac,{className:"yt-byob-tracker-remove-btn",onClick:()=>d(t.variantId)},e.createElement(Y,{fontSize:"12px"}))))}),N>=1&&[...Array(N)].map((t,n)=>e.createElement(gc,{className:"yt-byob-tracker-placeholder-box",isMobile:f,borderRadius:g.byob.borderRadius,key:n},e.createElement(Se,{size:40,color:"#A0A0A0"}))))),(!f||P)&&e.createElement(rc,{className:"yt-byob-tracker-summary-container bundle-summary "+(f?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:f},Number(j)>0&&e.createElement(xc,{className:"yt-byob-tracker-summary-info summary-info"},e.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},f?e.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},e.createElement(fc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&e.createElement(yc,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",Dp(g.general.currencySymbol,C),Pp(V))):e.createElement(e.Fragment,null,e.createElement(fc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!f&&e.createElement(yc,{className:"yt-byob-tracker-save-label"},"Save:"," ",Dp(g.general.currencySymbol,C),Pp(V)))),e.createElement(bc,{className:"yt-byob-tracker-subtotal-row"},e.createElement(hc,{className:"yt-byob-tracker-final-price"},Dp(g.general.currencySymbol,C),Number(j)>=0?Pp(Number(j).toFixed(2)):0),M&&g.byob.compareAtPriceVisibility&&Number(M)>Number(j)&&e.createElement(vc,{className:"yt-byob-tracker-line-through-price"},Dp(g.general.currencySymbol,C),Pp(Number(M).toFixed(2))))),e.createElement(wc,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:P,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:g.general.ctaBackgroundColor,ctaBorderColor:g.general.ctaBorderColor,ctaHoverBackgroundColor:g.general.ctaHoverBackgroundColor,ctaHoverTextColor:g.general.ctaHoverTextColor},borderRadius:g.general.ctaBorderRadius,disabled:!P&&N>=1,onClick:e=>{c||console.log("saving"),r(e.target??e.currentTarget)},id:"checkoutButton"},c?e.createElement(Je,{color:"black",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!P?e.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",N," More Item(s)"):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement(Cc,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:g.general.ctaTextColor,ctaHoverTextColor:h??g.general.ctaHoverTextColor},g.byob.checkoutCTAText??"Checkout"),g?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"})))))))},Ic={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},zc={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Nc=o=>{const[r,i]=t(!1);n(()=>{const e=()=>{i(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const a="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,l=((e,t=!1)=>{const n=e&&Ic[e]?Ic[e]:{},o={...zc,...n};return t&&n.mobile?{...o,...n.mobile}:o})(String(a),r);o.renderingOnPage||(l.position="static",l.zIndex=0);const c={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...l};return e.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(r?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...c,width:r?"100%":l.width,...!o.styles.byob.selectedProductsVisibility&&{width:r?"96%":"fit-content",paddingInline:"10px"},...r&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===l.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=l.transform||"translateY(0)"}},e.createElement(Bc,{...o,isMobile:r}))},Fc=J(void 0),Pc=c.div`
|
|
3350
3350
|
position: absolute;
|
|
3351
3351
|
top: 0px;
|
|
3352
3352
|
right: 0px;
|