@letscooee/web-sdk 11.1.0 → 11.2.1

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.
@@ -0,0 +1 @@
1
+ import{a as C,b}from"./chunk-NQMQZQTJ.js";import{e as g,f as h,i as u,l as f}from"./chunk-32IK45BI.js";import{Ba as l,Qa as c,X as m,na as n,oa as i,pa as r,v as s}from"./chunk-KHVPWQ5E.js";import"./chunk-V7UGKYBN.js";var _=class d{dialogRef=s(u);eventData=s(h);triggerData=s(g)().triggerData;onShareAndClose(p,o){p.stopPropagation();let{url:t,text:a}=b(this.triggerData,this.eventData.video,o!=="Clipboard");switch(o){case"Whatsapp":window.open(`https://wa.me/?text=${a}%20${t}`,"_blank","noopener,noreferrer");break;case"X(Twitter)":window.open(`https://x.com/intent/post?text=${a}&url=${t}`,"_blank","noopener,noreferrer");break;case"Clipboard":navigator.clipboard.writeText(t).catch(()=>{let e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)});break;default:}o&&C(this.triggerData,this.eventData.video,this.eventData.index,o),this.dialogRef.close()}static \u0275fac=function(o){return new(o||d)};static \u0275cmp=m({type:d,selectors:[["cooee-share-dialog"]],decls:19,vars:0,consts:[[1,"share-dialog"],[1,"share-dialog-header"],["type","button","aria-label","Close",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"share-options"],["type","button","aria-label","Share on WhatsApp",1,"share-option",3,"click"],["name","whatsapp","aria-hidden","true"],["type","button","aria-label","Share on X",1,"share-option",3,"click"],["name","x-twitter","aria-hidden","true"],["type","button","aria-label","Copy link",1,"share-option",3,"click"],["name","copy","aria-hidden","true"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"h3"),c(3,"Share"),i(),n(4,"button",2),l("click",function(e){return t.onShareAndClose(e)}),r(5,"cooee-icon",3),i()(),n(6,"div",4)(7,"button",5),l("click",function(e){return t.onShareAndClose(e,"Whatsapp")}),r(8,"cooee-icon",6),n(9,"span"),c(10,"Whatsapp"),i()(),n(11,"button",7),l("click",function(e){return t.onShareAndClose(e,"X(Twitter)")}),r(12,"cooee-icon",8),n(13,"span"),c(14,"X"),i()(),n(15,"button",9),l("click",function(e){return t.onShareAndClose(e,"Clipboard")}),r(16,"cooee-icon",10),n(17,"span"),c(18,"Copy link"),i()()()())},dependencies:[f],styles:["@keyframes _ngcontent-%COMP%_slideInScale{0%{opacity:0;transform:scale(.9) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}.share-dialog[_ngcontent-%COMP%]{background:#fff;border-radius:12px;padding:20px;min-width:280px;box-shadow:0 8px 32px #00000026;color:#333;animation:_ngcontent-%COMP%_slideInScale .25s ease-out}.share-dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.share-dialog-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-family:var(--lc-heading-family),serif;margin:0;font-size:18px;font-weight:600}.share-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;font-family:var(--lc-text-family),serif}.share-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#0002;border:1px solid #e9ecef;border-radius:8px;color:#333;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease}.share-option[_ngcontent-%COMP%]:hover{background:#0004;border-color:#dee2e6;transform:translateY(-1px)}.share-option[_ngcontent-%COMP%]:active{transform:translateY(0)}.share-option[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{width:24px;height:24px}.share-option[_ngcontent-%COMP%] cooee-icon[name=whatsapp][_ngcontent-%COMP%]{color:#25d366}.share-option[_ngcontent-%COMP%] cooee-icon[name=x-twitter][_ngcontent-%COMP%], .share-option[_ngcontent-%COMP%] cooee-icon[name=copy][_ngcontent-%COMP%]{color:#000}.share-option[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;text-align:left}button.close-button[_ngcontent-%COMP%]{background-color:transparent;border:none}button.close-button[_ngcontent-%COMP%] cooee-icon[name=close][_ngcontent-%COMP%]{border-radius:100%;color:#000}"]})};export{_ as ShareDialogComponent};
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px">
2
+ <path
3
+ d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px">
2
+ <path d="M0 0h24v24H0V0z" fill="none"/>
3
+ <path
4
+ d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92c0-1.61-1.31-2.92-2.92-2.92zM18 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 13c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm12 7.02c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px">
2
+ <path
3
+ d="M19.05 4.91A9.816 9.816 0 0 0 12.04 2c-5.46 0-9.91 4.45-9.91 9.91 0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21 5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.9-7.01zM12.04 20.15c-1.48 0-2.93-.4-4.2-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.264 8.264 0 0 1-1.26-4.38c0-4.54 3.7-8.24 8.24-8.24 2.2 0 4.27.86 5.82 2.42a8.183 8.183 0 0 1 2.41 5.83c.02 4.54-3.68 8.23-8.22 8.23zm4.52-6.16c-.25-.12-1.47-.72-1.69-.81-.23-.08-.39-.12-.56.12-.17.25-.64.81-.78.97-.14.17-.29.19-.54.06-.25-.12-1.05-.39-1.99-1.23-.74-.66-1.23-1.47-1.38-1.72-.14-.25-.02-.38.11-.51.11-.11.25-.29.37-.43.12-.14.16-.25.25-.41.08-.17.04-.31-.02-.43-.06-.12-.56-1.34-.76-1.84-.2-.48-.4-.42-.56-.43-.14-.01-.3-.01-.46-.01a.875.875 0 0 0-.64.3c-.22.25-.84.82-.84 2.01 0 1.19.86 2.34.98 2.5.12.17 1.75 2.67 4.23 3.74.59.26 1.05.41 1.41.53.59.19 1.13.16 1.56.1.48-.07 1.47-.6 1.67-1.18.21-.58.21-1.07.14-1.18s-.22-.16-.47-.28z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px">
2
+ <path
3
+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ import{A as Me,B as Re,a as _e,c as O,d as Ce,f as U,k as Q,q as R,r as De,s as be,t as Te,u as Ie,v as Ee,x as Se,y as ke,z as Pe}from"./chunk-WRON7UOR.js";import{a as Oe,b as Ne}from"./chunk-NQMQZQTJ.js";import{c as we,e as fe,f as N,g as H,i as xe,j as Ve,k as ye,l as F}from"./chunk-32IK45BI.js";import"./chunk-74XS3G6Q.js";import{$a as me,Ba as g,D as Y,Da as a,E as f,Ga as $,Ha as j,I as T,Ia as W,Ja as ae,Ka as de,L as J,La as b,M as X,Ma as S,O as s,Ta as se,Ua as le,V as Z,Va as ce,X as w,Za as pe,ba as I,fb as ue,ga as E,ha as x,ia as V,ib as k,ja as ee,jb as P,ka as y,kb as M,la as D,lb as ge,ma as u,na as l,oa as d,pa as _,qa as te,ra as ie,sa as oe,sb as he,ta as ne,ua as re,ub as ve,v as m,va as B,x as c,y as p,za as v}from"./chunk-KHVPWQ5E.js";import"./chunk-V7UGKYBN.js";var z=class n{dialogState=P();dialog=m(ye);triggerData=m(fe)().triggerData;eventData=m(N);containerRef=m(Z);async share(t){t.stopPropagation(),t.preventDefault(),R()&&De()?await this.shareNative():await this.shareWithDialog()}async shareNative(){let t=Ne(this.triggerData,this.eventData.video,!1);await navigator.share(t),Oe(this.triggerData,this.eventData.video,this.eventData.index,"Native")}async shareWithDialog(){let t=await import("./share-dialog.component-6ZT5Z2R2.js");this.dialogState.emit(!0),this.dialog.open(t.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(!1))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=w({type:n,selectors:[["cooee-share-button"]],outputs:{dialogState:"dialogState"},decls:2,vars:0,consts:[["type","button","aria-label","Share video",3,"click"],["name","share"]],template:function(e,i){e&1&&(l(0,"button",0),g("click",function(r){return i.share(r)}),_(1,"cooee-icon",1),d())},dependencies:[F],styles:["button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}"]})};var A=class n{video=M.required();progress=f(0);constructor(){k(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100)};e.addEventListener("timeupdate",i),t(()=>{e.removeEventListener("timeupdate",i)})})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=w({type:n,selectors:[["cooee-video-progress-bar"]],inputs:{video:[1,"video"]},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(e,i){e&1&&(te(0,"div",0)(1,"div",1),oe(2,"div"),ie()()),e&2&&(s(),S("width",i.progress(),"%"),E("aria-valuenow",i.progress()))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media (prefers-reduced-motion: reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}"]})};var ze=["swiperContainer"],Ae=(n,t)=>t.id;function Le(n,t){if(n&1){let e=v();l(0,"div",3)(1,"cooee-item-card",4),g("buttonClick",function(o){c(e);let r=a();return p(r.onButtonClick(o))})("click",function(){let o=c(e).$implicit,r=a();return p(r.cardClick.emit(o))}),d()()}if(n&2){let e=t.$implicit;s(),u("item",e)}}var L=class n{items=M.required();cardClick=P();destroyRef=m(Y);elementRef=m(T);engagementService=m(U);swiperContainerRef=ge.required("swiperContainer");swiperInstance;constructor(){k(()=>{this.initSwiper()}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy()})}ngOnInit(){O(this.elementRef.nativeElement.shadowRoot)}onButtonClick(t){let e=_e.get().website?.canChangeVariantInCart;if(this.items()?.length>1||t.hasVariants()&&!e){this.cardClick.emit(t);return}this.engagementService.executeCTA(Ce.ADD_TO_CART,{item:t})}initSwiper(){this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:"horizontal",effect:"slide",slidesPerView:1.2,nested:!0,centeredSlides:!0,spaceBetween:12,mousewheel:{enabled:!0,thresholdDelta:10,thresholdTime:200}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=w({type:n,selectors:[["cooee-video-promoted-items"]],viewQuery:function(e,i){e&1&&ae(i.swiperContainerRef,ze,5),e&2&&de()},hostAttrs:[1,"letscooee-widget"],inputs:{items:[1,"items"]},outputs:{cardClick:"cardClick"},features:[me([U])],decls:5,vars:0,consts:[["swiperContainer",""],[1,"swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide"],["tabindex","0",3,"buttonClick","click","item"]],template:function(e,i){e&1&&(l(0,"div",1,0)(2,"div",2),y(3,Le,2,1,"div",3,Ae),d()()),e&2&&(s(3),D(i.items()))},dependencies:[Re],styles:[`:host{display:block;width:100%}cooee-item-card{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:rgba(var(--lc-card-bg-color));cursor:pointer;border-radius:var(--lc-card-radius)}
2
+ `],encapsulation:3})};var Be=["swiperComp"],$e=["videoEl"],je=(n,t)=>t.url;function We(n,t){n&1&&(l(0,"div",11),_(1,"div",15),d())}function He(n,t){if(n&1&&_(0,"source",13),n&2){let e=t.$implicit;u("type",pe(e.mimeType))("src",e.url,J)}}function Ue(n,t){n&1&&B(0)}function Qe(n,t){if(n&1){let e=v();l(0,"cooee-video-promoted-items",24),g("cardClick",function(o){c(e);let r=a(2).$implicit,C=a();return p(C.productCardClicked(o,r))}),d()}if(n&2){let e=a(2).$implicit;u("items",e.items)}}function Ke(n,t){if(n&1&&_(0,"cooee-video-card",23),n&2){let e=a(2).$implicit;u("card",e.card)}}function qe(n,t){if(n&1){let e=v();_(0,"cooee-video-progress-bar",16),l(1,"div",17)(2,"cooee-mute-toggle",18),ce("mutedChange",function(o){c(e);let r=a(2);return le(r.muted,o)||(r.muted=o),p(o)}),g("toggled",function(){c(e);let o=a(2);return p(o.muteToggled())}),d(),I(3,Ue,1,0,"ng-container",8),d(),l(4,"div",19)(5,"cooee-share-button",20),g("dialogState",function(o){c(e);let r=a(2);return p(r.shareDialogOpen.set(o))}),d()(),l(6,"div",21),x(7,Qe,1,1,"cooee-video-promoted-items",22)(8,Ke,1,1,"cooee-video-card",23),d()}if(n&2){let e=a().$implicit,i=b(5),o=a(),r=b(9);u("video",i),s(2),se("muted",o.muted),u("videoEl",i),s(),u("ngTemplateOutlet",r),s(4),V(e.items.length&&o.footerContent===o.VideoConfigFooterContent.FIRST_ITEM?7:e.card&&o.footerContent===o.VideoConfigFooterContent.CARD?8:-1)}}function Ge(n,t){if(n&1){let e=v();l(0,"cooee-item-detail",25),g("closeClick",function(){c(e);let o=a(2);return p(o.productModalClosed())}),d()}if(n&2){let e=a(2);u("item",e.selectedItem)("similarItems",e.selectedVideo.items)}}function Ye(n,t){if(n&1){let e=v();l(0,"div",6)(1,"div",9)(2,"div",10),x(3,We,2,0,"div",11),l(4,"video",12,2),g("click",function(){let o=c(e).$index,r=a();return p(r.currentIndex===o&&r.toggleMute())})("ended",function(){c(e);let o=b(5),r=a();return p(r.onVideoEnded(o))})("loadstart",function(){let o=c(e).$index,r=a();return p(r.onVideoLoadStart(o))})("canplay",function(){let o=c(e).$index,r=a();return p(r.onVideoCanPlay(o))}),y(6,He,1,3,"source",13,je),d(),x(8,qe,9,5),d(),x(9,Ge,1,2,"cooee-item-detail",14),d()()}if(n&2){let e=t.$implicit,i=t.$index,o=a();s(2),S("background-image",e.thumbnail?"url("+e.thumbnail+")":null),s(),V(o.shouldShowVideoSpinner(i)?3:-1),s(),u("ngClass",o.viewTemplateClassName),E("preload",o.isVideoVisible(i)?"metadata":"none")("data-video-id",e.id)("autoplay",o.currentIndex===i||null)("muted",o.muted||null),s(2),D(e.sources),s(2),V(o.currentIndex===i?8:-1),s(),V(o.selectedItem&&o.currentIndex===i?9:-1)}}function Je(n,t){n&1&&B(0)}function Xe(n,t){if(n&1){let e=v();l(0,"button",26),g("click",function(){c(e);let o=a();return p(o.close())}),_(1,"cooee-icon",27),d()}}var Fe=class n{swiperComponent;videoElements;VideoConfigFooterContent=Se;currentIndex=0;muted=f(!1);selectedItem=null;selectedVideo;detailPopupTemplate;footerContent;viewTemplateClassName="lc-video-only-view";shareDialogOpen=f(!1);data=m(Ve);elementRef=m(T);eventData=m(N);dialogRef=m(xe);swiperInitialized=f(!1);swiperOptions=f(null);videos=[];triggerContext;engagementTrigger;isMobile=R();navigationConfig;cssLoadedPromise;resizeDebouncer=new be(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.navigationConfig=new Ee({enabled:!0,size:50,color:new Ie({h:"#000000"})}),this.cssLoadedPromise=O(this.elementRef.nativeElement.shadowRoot)}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close()}async ngOnInit(){this.muted.set(await Q.get("muted",!1));let t=this.engagementTrigger?.content?.videoConfig;switch(this.detailPopupTemplate=t?.detailPopup.template??"VIDEO_ONLY_VIEW",this.footerContent=t?.footerContent??"FIRST_ITEM",this.detailPopupTemplate){case"PRODUCT_DETAIL_VIEW":this.selectItemForDetailView(),this.viewTemplateClassName="lc-product-detail-view";break;case"VIDEO_ONLY_VIEW":this.viewTemplateClassName="lc-video-only-view";break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions()}ngOnDestroy(){this.resizeDebouncer?.destroy()}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions()}close(){let t=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:t?.currentTime})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause())}toggleMute(){this.muted.update(t=>!t)}async muteToggled(){await Q.set("muted",this.muted());let e=[this.muted()?"CE Video Muted":"CE Video Unmuted",{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e)}playActiveVideo(){this.pauseAll();let t=this.getCurrentVideoElement();t&&this.playVideo(t)}playVideo(t){t.currentTime=0,t.play().catch(e=>we.error(e))}onVideoEnded(t){if(this.currentIndex<this.videos.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(t):this.moveToNextVideo();else{let e=this.getPreviousVideoDataForEvent(),i=["CE Last Video Ended",{previous:e},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t)}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.selectedVideo=this.videos[this.currentIndex],this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"?this.selectItemForDetailView():this.selectedItem=null;let i=this.currentVideoProps(),o={previous:e,current:i},r=new H("CE Video Changed",o,this.engagementTrigger);r.setVideos(this.videos[this.currentIndex]),window.CooeeSDK.sendEvent(r)}productCardClicked(t,e){let i={videoID:e.id,videoIndex:this.currentIndex},o=new H("CE More Item Info Clicked",{current:i},this.engagementTrigger);o.setVideos(e),window.CooeeSDK.sendEvent(o),this.selectedItem=t}onVideoLoadStart(t){this.videoLoadingStates.set(t,!0)}onVideoCanPlay(t){this.videoLoadingStates.set(t,!1)}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===!0&&this.isVideoVisible(t):this.isVideoVisible(t)}isVideoVisible(t){let e=this.currentIndex-1,i=this.currentIndex+1;return t===this.currentIndex||t===e||t===i}async initSwiperOptions(){await this.cssLoadedPromise;let t=this.isMobile?1:"auto",e=0;this.isProductDetailView()&&(t="auto",e=10),this.swiperOptions.set({direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},on:{init:i=>{this.swiperInitialized.set(!0),setTimeout(()=>{i.update()},100)}},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20}})}isProductDetailView(){return this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height)}calculateOptimalVideoDimensions(){let t=this.videos.map(h=>h.sources?.[0]).filter(h=>h?.width&&h?.height).map(h=>({width:h.width,height:h.height,aspectRatio:h.width/h.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,C=o/e.height,G=Math.min(r,C);return{width:Math.floor(e.width*G),height:Math.floor(e.height*G)}}setVideoContainerDimensions(t,e){let i=this.elementRef.nativeElement;i.style.setProperty("--video-container-width",`${t}px`),i.style.setProperty("--video-container-height",`${e}px`)}onResize(){this.applyOptimalVideoDimensions()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=w({type:n,selectors:[["cooee-video-detail-dialog"]],viewQuery:function(e,i){if(e&1&&($(Be,7),$($e,5)),e&2){let o;j(o=W())&&(i.swiperComponent=o.first),j(o=W())&&(i.videoElements=o)}},hostAttrs:[1,"letscooee-widget"],hostBindings:function(e,i){e&1&&g("keydown.escape",function(r){return i.onKeyDown(r)},X)},decls:10,vars:4,consts:[["swiperComp",""],["closeButtonTemplate",""],["videoEl",""],[1,"lc-shadow-inner",3,"ngClass"],[1,"video-swiper",3,"slideChange","options","navigationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-slide"],[1,"lc-desktop-controls"],[4,"ngTemplateOutlet"],[1,"lc-video-modal-row"],[1,"lc-video-container"],[1,"video-loading-overlay"],["playsinline","",1,"lc-video-el",3,"click","ended","loadstart","canplay","ngClass"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems"],[1,"loading-spinner"],[3,"video"],[1,"lc-video-controls"],[3,"mutedChange","toggled","muted","videoEl"],[1,"share-controls"],[3,"dialogState"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"closeClick","item","similarItems"],["type","button","aria-label","Close",1,"lc-close-button",3,"click"],["name","close","aria-hidden","true"]],template:function(e,i){if(e&1){let o=v();l(0,"div",3)(1,"cooee-swiper",4,0),g("slideChange",function(C){return c(o),p(i.onSlideChange(C))}),ne(3,5),y(4,Ye,10,10,"div",6,ee),re(),d(),l(6,"div",7),I(7,Je,1,0,"ng-container",8),d()(),I(8,Xe,2,0,"ng-template",null,1,ue)}if(e&2){let o=b(9);u("ngClass",i.viewTemplateClassName),s(),u("options",i.swiperOptions())("navigationConfig",i.navigationConfig),s(3),D(i.videos),s(3),u("ngTemplateOutlet",o)}},dependencies:[L,Te,Me,z,A,ve,he,Pe,ke,F],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media (min-width: 768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media (min-width: 768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper>.swiper-button-prev,.video-swiper>.swiper-button-next{display:none!important}}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media (min-width: 768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media (max-width: 768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media (min-width: 768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media (min-width: 768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media (max-width: 768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media (min-width: 768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media (min-width: 768px){.lc-product-detail-view .lc-video-container{width:50%}}@media (min-width: 768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media (max-width: 768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media (max-width: 768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
3
+ `],encapsulation:3})};export{Fe as VideoDetailDialogComponent};
@@ -1,19 +1,19 @@
1
- import{A as Ei,D as Vi,E as Dt,F as Ii,G as Mi,H as Si,I as ki,a as re,b as ui,c as pi,d as mi,g as Ke,h as ut,i as fi,k as Me,l as gi,m as ge,n as hi,p as vi,q as yi,r as $e,s as Ci,t as bi,u as xi,v as pt,w as _i,x as wi,z as Ti}from"./chunk-HUUMC22E.js";import{a as mt}from"./chunk-46SWCOIM.js";import{$ as Yt,$a as ai,A as zt,Aa as Y,B as kt,Ba as ni,Ca as M,D as qt,E as ye,F as Zt,Fa as st,Ga as lt,Ha as ct,K as ae,Ka as me,L as Ee,La as Je,M as Wt,N as I,O as Qt,Oa as ri,P as Gt,Pa as le,Qa as oi,R as Pt,Ra as je,Va as Ye,W as B,Wa as Ae,Xa as be,Ya as He,Z as Jt,_ as j,_a as Ie,ab as si,b as ot,bb as fe,ca as Kt,cb as xe,db as li,e as St,ea as Xt,fa as at,fb as ci,ga as z,ha as q,ia as ei,ja as te,k as Bt,ka as ie,la as H,ma as P,na as F,oa as Ve,p as jt,pa as se,q as Ht,qa as pe,ra as ne,rb as dt,s as $t,sa as ti,ta as ii,v as oe,wb as di,x as N,y as L,ya as Ce,yb as Ue,z as Ut,za as J}from"./chunk-WCCK4F5X.js";import{a as ue,b as Mt,e as Bi,f as ji}from"./chunk-V7UGKYBN.js";var Ai=Bi((ft,Fi)=>{"use strict";(function(r,e){typeof ft=="object"&&typeof Fi<"u"?e(ft):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis<"u"?globalThis:r||self).Sqrl={})})(ft,function(r){"use strict";function e(a){var s,d,p=new Error(a);return s=p,d=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(s,d):s.__proto__=d,p}function t(a,s,d){var p=s.slice(0,d).split(/\n/),n=p.length,i=p[n-1].length+1;throw e(a+=" at line "+n+" col "+i+`:
1
+ import{A as Fi,B as Ai,a as pi,b as mi,d as Ke,e as ut,g as ae,h as gi,i as ve,j as hi,k as vi,l as yi,m as Ci,n as $e,o as bi,p as wi,q as Ti,t as Ei,w as Ii,x as Dt,y as Pi,z as Di}from"./chunk-WRON7UOR.js";import{c as oe,d as ui,g as fi,i as xi,j as _i,k as pt,l as Vi,m as Mi,n as Si,q as ki}from"./chunk-32IK45BI.js";import{a as mt}from"./chunk-VS6KZOKA.js";import{a as Ue}from"./chunk-74XS3G6Q.js";import{$ as j,$a as re,A as zt,Aa as J,B as kt,Ba as Y,Ca as ni,D as qt,Da as M,E as be,F as Zt,Ga as st,Ha as lt,Ia as ct,K as le,L as Ie,La as ge,Ma as Je,N as Wt,O as I,P as Qt,Pa as ri,Q as Gt,Qa as de,Ra as oi,S as Pt,Sa as je,Wa as Ye,X as B,Xa as Ae,Ya as _e,Za as He,_ as Jt,aa as Yt,ab as ai,b as ot,bb as si,cb as he,da as Kt,db as we,e as St,eb as li,fa as Xt,ga as at,gb as ci,ha as z,ia as q,ja as ei,k as Bt,ka as te,la as ie,ma as H,na as P,oa as F,p as jt,pa as Me,q as Ht,qa as ce,ra as fe,s as $t,sa as ne,sb as dt,ta as ti,ua as ii,v as se,x as N,xb as di,y as L,z as Ut,za as xe}from"./chunk-KHVPWQ5E.js";import{a as me,b as Mt,e as Ui,f as zi}from"./chunk-V7UGKYBN.js";var Li=Ui((ft,Ni)=>{"use strict";(function(r,e){typeof ft=="object"&&typeof Ni<"u"?e(ft):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis<"u"?globalThis:r||self).Sqrl={})})(ft,function(r){"use strict";function e(a){var s,d,p=new Error(a);return s=p,d=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(s,d):s.__proto__=d,p}function t(a,s,d){var p=s.slice(0,d).split(/\n/),n=p.length,i=p[n-1].length+1;throw e(a+=" at line "+n+" col "+i+`:
2
2
 
3
3
  `+s.split(/\n/)[n-1]+`
4
- `+Array(i).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var o=new Function("return this")().Promise,l=!1;try{l=new Function("return (async function(){}).constructor")()}catch(a){if(!(a instanceof SyntaxError))throw a}function c(a,s){return Object.prototype.hasOwnProperty.call(a,s)}function h(a,s,d){for(var p in s)c(s,p)&&(s[p]==null||typeof s[p]!="object"||p!=="storage"&&p!=="prefixes"||d?a[p]=s[p]:a[p]=h({},s[p]));return a}var f=/^async +/,_=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,D=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,W=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,we=/[.*+\-?^${}()|[\]\\]/g;function Te(a){return we.test(a)?a.replace(we,"\\$&"):a}function Xe(a,s){s.rmWhitespace&&(a=a.replace(/[\r\n]+/g,`
5
- `).replace(/^\s+|\s+$/gm,"")),_.lastIndex=0,D.lastIndex=0,W.lastIndex=0;var d=s.prefixes,p=[d.h,d.b,d.i,d.r,d.c,d.e].reduce(function(b,v){return b&&v?b+"|"+Te(v):v?Te(v):b},""),n=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+Te(s.tags[1])+")","g"),i=new RegExp("([^]*?)"+Te(s.tags[0])+"(-|_)?\\s*("+p+")?\\s*","g"),u=0,m=!1;function y(b,v){var T,w={f:[]},k=0,V="c";function E(Pe){var De=a.slice(u,Pe),U=De.trim();if(V==="f")U==="safe"?w.raw=!0:s.async&&f.test(U)?(U=U.replace(f,""),w.f.push([U,"",!0])):w.f.push([U,""]);else if(V==="fp")w.f[w.f.length-1][1]+=U;else if(V==="err"){if(U){var ce=De.search(/\S/);t("invalid syntax",a,u+ce)}}else w[V]=U;u=Pe+1}for(v==="h"||v==="b"||v==="c"?V="n":v==="r"&&(w.raw=!0,v="i"),n.lastIndex=u;(T=n.exec(a))!==null;){var A=T[1],O=T[2],$=T[3],Q=T[4],X=T[5],S=T.index;if(A)A==="("?(k===0&&(V==="n"?(E(S),V="p"):V==="f"&&(E(S),V="fp")),k++):A===")"?--k===0&&V!=="c"&&(E(S),V="err"):k===0&&A==="|"?(E(S),V="f"):A==="=>"&&(E(S),u+=1,V="res");else if(O)if(O==="/*"){var ve=a.indexOf("*/",n.lastIndex);ve===-1&&t("unclosed comment",a,T.index),n.lastIndex=ve+2}else O==="'"?(D.lastIndex=T.index,D.exec(a)?n.lastIndex=D.lastIndex:t("unclosed string",a,T.index)):O==='"'?(W.lastIndex=T.index,W.exec(a)?n.lastIndex=W.lastIndex:t("unclosed string",a,T.index)):O==="`"&&(_.lastIndex=T.index,_.exec(a)?n.lastIndex=_.lastIndex:t("unclosed string",a,T.index));else if($)return E(S),u=S+T[0].length,i.lastIndex=u,m=X,Q&&v==="h"&&(v="s"),w.t=v,w}return t("unclosed tag",a,b),w}var C=(function b(v,T){v.b=[],v.d=[];var w,k=!1,V=[];function E(ce,rt){ce&&(ce=(function(G,Fe,Le,Be){var ee,de;return typeof Fe.autoTrim=="string"?ee=de=Fe.autoTrim:Array.isArray(Fe.autoTrim)&&(ee=Fe.autoTrim[1],de=Fe.autoTrim[0]),(Le||Le===!1)&&(ee=Le),(Be||Be===!1)&&(de=Be),ee==="slurp"&&de==="slurp"?G.trim():(ee==="_"||ee==="slurp"?G=String.prototype.trimLeft?G.trimLeft():G.replace(/^[\s\uFEFF\xA0]+/,""):ee!=="-"&&ee!=="nl"||(G=G.replace(/^(?:\n|\r|\r\n)/,"")),de==="_"||de==="slurp"?G=String.prototype.trimRight?G.trimRight():G.replace(/[\s\uFEFF\xA0]+$/,""):de!=="-"&&de!=="nl"||(G=G.replace(/(?:\n|\r|\r\n)$/,"")),G)})(ce,s,m,rt))&&(ce=ce.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),V.push(ce))}for(;(w=i.exec(a))!==null;){var A,O=w[1],$=w[2],Q=w[3]||"";for(var X in d)if(d[X]===Q){A=X;break}E(O,$),u=w.index+w[0].length,A||t("unrecognized tag type: "+Q,a,u);var S=y(w.index,A),ve=S.t;if(ve==="h"){var Pe=S.n||"";s.async&&f.test(Pe)&&(S.a=!0,S.n=Pe.replace(f,"")),S=b(S),V.push(S)}else if(ve==="c"){if(v.n===S.n)return k?(k.d=V,v.b.push(k)):v.d=V,v;t("Helper start and end don't match",a,w.index+w[0].length)}else if(ve==="b"){k?(k.d=V,v.b.push(k)):v.d=V;var De=S.n||"";s.async&&f.test(De)&&(S.a=!0,S.n=De.replace(f,"")),k=S,V=[]}else if(ve==="s"){var U=S.n||"";s.async&&f.test(U)&&(S.a=!0,S.n=U.replace(f,"")),V.push(S)}else V.push(S)}if(!T)throw e('unclosed helper "'+v.n+'"');return E(a.slice(u,a.length),!1),v.d=V,v})({f:[]},!0);if(s.plugins)for(var x=0;x<s.plugins.length;x++){var g=s.plugins[x];g.processAST&&(C.d=g.processAST(C.d,s))}return C.d}function qe(a,s){var d=Xe(a,s),p="var tR='';"+(s.useWith?"with("+s.varName+"||{}){":"")+K(d,s)+"if(cb){cb(null,tR)} return tR"+(s.useWith?"}":"");if(s.plugins)for(var n=0;n<s.plugins.length;n++){var i=s.plugins[n];i.processFnString&&(p=i.processFnString(p,s))}return p}function Ze(a,s){for(var d=0;d<s.length;d++){var p=s[d][0],n=s[d][1];a=(s[d][2]?"await ":"")+"c.l('F','"+p+"')("+a,n&&(a+=","+n),a+=")"}return a}function R(a,s,d,p,n,i){var u="{exec:"+(n?"async ":"")+We(d,s,a)+",params:["+p+"]";return i&&(u+=",name:'"+i+"'"),n&&(u+=",async:true"),u+="}"}function Et(a,s){for(var d="[",p=0;p<a.length;p++){var n=a[p];d+=R(s,n.res||"",n.d,n.p||"",n.a,n.n),p<a.length&&(d+=",")}return d+="]"}function We(a,s,d){return"function("+s+"){var tR='';"+K(a,d)+"return tR}"}function K(a,s){for(var d=0,p=a.length,n="";d<p;d++){var i=a[d];if(typeof i=="string")n+="tR+='"+i+"';";else{var u=i.t,m=i.c||"",y=i.f,C=i.n||"",x=i.p||"",g=i.res||"",b=i.b,v=!!i.a;if(u==="i"){s.defaultFilter&&(m="c.l('F','"+s.defaultFilter+"')("+m+")");var T=Ze(m,y);!i.raw&&s.autoEscape&&(T="c.l('F','e')("+T+")"),n+="tR+="+T+";"}else if(u==="h")if(s.storage.nativeHelpers.get(C))n+=s.storage.nativeHelpers.get(C)(i,s);else{var w=(v?"await ":"")+"c.l('H','"+C+"')("+R(s,g,i.d,x,v);w+=b?","+Et(b,s):",[]",n+="tR+="+Ze(w+=",c)",y)+";"}else u==="s"?n+="tR+="+Ze((v?"await ":"")+"c.l('H','"+C+"')({params:["+x+"]},[],c)",y)+";":u==="e"&&(n+=m+`
6
- `)}}return n}var Oe=(function(){function a(s){this.cache=s}return a.prototype.define=function(s,d){this.cache[s]=d},a.prototype.get=function(s){return this.cache[s]},a.prototype.remove=function(s){delete this.cache[s]},a.prototype.reset=function(){this.cache={}},a.prototype.load=function(s){h(this.cache,s,!0)},a})();function he(a,s,d,p){if(s&&s.length>0)throw e((p?"Native":"")+"Helper '"+a+"' doesn't accept blocks");if(d&&d.length>0)throw e((p?"Native":"")+"Helper '"+a+"' doesn't accept filters")}var Vt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function It(a){return Vt[a]}var et=new Oe({}),tt=new Oe({each:function(a,s){var d="",p=a.params[0];if(he("each",s,!1),a.async)return new Promise(function(i){(function u(m,y,C,x,g){C(m[y],y).then(function(b){x+=b,y===m.length-1?g(x):u(m,y+1,C,x,g)})})(p,0,a.exec,d,i)});for(var n=0;n<p.length;n++)d+=a.exec(p[n],n);return d},foreach:function(a,s){var d=a.params[0];if(he("foreach",s,!1),a.async)return new Promise(function(i){(function u(m,y,C,x,g,b){x(y[C],m[y[C]]).then(function(v){g+=v,C===y.length-1?b(g):u(m,y,C+1,x,g,b)})})(d,Object.keys(d),0,a.exec,"",i)});var p="";for(var n in d)c(d,n)&&(p+=a.exec(n,d[n]));return p},include:function(a,s,d){he("include",s,!1);var p=d.storage.templates.get(a.params[0]);if(!p)throw e('Could not fetch template "'+a.params[0]+'"');return p(a.params[1],d)},extends:function(a,s,d){var p=a.params[1]||{};p.content=a.exec();for(var n=0;n<s.length;n++){var i=s[n];p[i.name]=i.exec()}var u=d.storage.templates.get(a.params[0]);if(!u)throw e('Could not fetch template "'+a.params[0]+'"');return u(p,d)},useScope:function(a,s){return he("useScope",s,!1),a.exec(a.params[0])}}),it=new Oe({if:function(a,s){he("if",!1,a.f,!0);var d="if("+a.p+"){"+K(a.d,s)+"}";if(a.b)for(var p=0;p<a.b.length;p++){var n=a.b[p];n.n==="else"?d+="else{"+K(n.d,s)+"}":n.n==="elif"&&(d+="else if("+n.p+"){"+K(n.d,s)+"}")}return d},try:function(a,s){if(he("try",!1,a.f,!0),!a.b||a.b.length!==1||a.b[0].n!=="catch")throw e("native helper 'try' only accepts 1 block, 'catch'");var d="try{"+K(a.d,s)+"}",p=a.b[0];return d+="catch"+(p.res?"("+p.res+")":"")+"{"+K(p.d,s)+"}"},block:function(a,s){return he("block",a.b,a.f,!0),"if(!"+s.varName+"["+a.p+"]){tR+=("+We(a.d,"",s)+")()}else{tR+="+s.varName+"["+a.p+"]}"}}),nt=new Oe({e:function(a){var s=String(a);return/[&<>"']/.test(s)?s.replace(/[&<>"']/g,It):s}}),Ne={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(a,s){if(a==="H"){var d=this.storage.helpers.get(s);if(d)return d;throw e("Can't find helper '"+s+"'")}if(a==="F"){var p=this.storage.filters.get(s);if(p)return p;throw e("Can't find filter '"+s+"'")}},async:!1,storage:{helpers:tt,nativeHelpers:it,filters:nt,templates:et},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function Qe(a,s){var d={};return h(d,Ne),s&&h(d,s),a&&h(d,a),d.l.bind(d),d}function Ge(a,s){var d,p=Qe(s||{}),n=Function;if(p.async){if(!l)throw e("This environment doesn't support async/await");n=l}if(p.varName&&(d=p.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(d)===!1))throw e("options.varName must be a valid JS identifier");try{return new n(p.varName,"c","cb",qe(a,p))}catch(i){throw i instanceof SyntaxError?e(`Bad template syntax
4
+ `+Array(i).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var o=new Function("return this")().Promise,l=!1;try{l=new Function("return (async function(){}).constructor")()}catch(a){if(!(a instanceof SyntaxError))throw a}function c(a,s){return Object.prototype.hasOwnProperty.call(a,s)}function h(a,s,d){for(var p in s)c(s,p)&&(s[p]==null||typeof s[p]!="object"||p!=="storage"&&p!=="prefixes"||d?a[p]=s[p]:a[p]=h({},s[p]));return a}var f=/^async +/,_=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,D=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,W=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,Ve=/[.*+\-?^${}()|[\]\\]/g;function Ee(a){return Ve.test(a)?a.replace(Ve,"\\$&"):a}function Xe(a,s){s.rmWhitespace&&(a=a.replace(/[\r\n]+/g,`
5
+ `).replace(/^\s+|\s+$/gm,"")),_.lastIndex=0,D.lastIndex=0,W.lastIndex=0;var d=s.prefixes,p=[d.h,d.b,d.i,d.r,d.c,d.e].reduce(function(b,v){return b&&v?b+"|"+Ee(v):v?Ee(v):b},""),n=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+Ee(s.tags[1])+")","g"),i=new RegExp("([^]*?)"+Ee(s.tags[0])+"(-|_)?\\s*("+p+")?\\s*","g"),u=0,m=!1;function y(b,v){var T,w={f:[]},k=0,E="c";function V(Pe){var De=a.slice(u,Pe),U=De.trim();if(E==="f")U==="safe"?w.raw=!0:s.async&&f.test(U)?(U=U.replace(f,""),w.f.push([U,"",!0])):w.f.push([U,""]);else if(E==="fp")w.f[w.f.length-1][1]+=U;else if(E==="err"){if(U){var ue=De.search(/\S/);t("invalid syntax",a,u+ue)}}else w[E]=U;u=Pe+1}for(v==="h"||v==="b"||v==="c"?E="n":v==="r"&&(w.raw=!0,v="i"),n.lastIndex=u;(T=n.exec(a))!==null;){var A=T[1],O=T[2],$=T[3],Q=T[4],X=T[5],S=T.index;if(A)A==="("?(k===0&&(E==="n"?(V(S),E="p"):E==="f"&&(V(S),E="fp")),k++):A===")"?--k===0&&E!=="c"&&(V(S),E="err"):k===0&&A==="|"?(V(S),E="f"):A==="=>"&&(V(S),u+=1,E="res");else if(O)if(O==="/*"){var Ce=a.indexOf("*/",n.lastIndex);Ce===-1&&t("unclosed comment",a,T.index),n.lastIndex=Ce+2}else O==="'"?(D.lastIndex=T.index,D.exec(a)?n.lastIndex=D.lastIndex:t("unclosed string",a,T.index)):O==='"'?(W.lastIndex=T.index,W.exec(a)?n.lastIndex=W.lastIndex:t("unclosed string",a,T.index)):O==="`"&&(_.lastIndex=T.index,_.exec(a)?n.lastIndex=_.lastIndex:t("unclosed string",a,T.index));else if($)return V(S),u=S+T[0].length,i.lastIndex=u,m=X,Q&&v==="h"&&(v="s"),w.t=v,w}return t("unclosed tag",a,b),w}var C=(function b(v,T){v.b=[],v.d=[];var w,k=!1,E=[];function V(ue,rt){ue&&(ue=(function(G,Fe,Le,Be){var ee,pe;return typeof Fe.autoTrim=="string"?ee=pe=Fe.autoTrim:Array.isArray(Fe.autoTrim)&&(ee=Fe.autoTrim[1],pe=Fe.autoTrim[0]),(Le||Le===!1)&&(ee=Le),(Be||Be===!1)&&(pe=Be),ee==="slurp"&&pe==="slurp"?G.trim():(ee==="_"||ee==="slurp"?G=String.prototype.trimLeft?G.trimLeft():G.replace(/^[\s\uFEFF\xA0]+/,""):ee!=="-"&&ee!=="nl"||(G=G.replace(/^(?:\n|\r|\r\n)/,"")),pe==="_"||pe==="slurp"?G=String.prototype.trimRight?G.trimRight():G.replace(/[\s\uFEFF\xA0]+$/,""):pe!=="-"&&pe!=="nl"||(G=G.replace(/(?:\n|\r|\r\n)$/,"")),G)})(ue,s,m,rt))&&(ue=ue.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),E.push(ue))}for(;(w=i.exec(a))!==null;){var A,O=w[1],$=w[2],Q=w[3]||"";for(var X in d)if(d[X]===Q){A=X;break}V(O,$),u=w.index+w[0].length,A||t("unrecognized tag type: "+Q,a,u);var S=y(w.index,A),Ce=S.t;if(Ce==="h"){var Pe=S.n||"";s.async&&f.test(Pe)&&(S.a=!0,S.n=Pe.replace(f,"")),S=b(S),E.push(S)}else if(Ce==="c"){if(v.n===S.n)return k?(k.d=E,v.b.push(k)):v.d=E,v;t("Helper start and end don't match",a,w.index+w[0].length)}else if(Ce==="b"){k?(k.d=E,v.b.push(k)):v.d=E;var De=S.n||"";s.async&&f.test(De)&&(S.a=!0,S.n=De.replace(f,"")),k=S,E=[]}else if(Ce==="s"){var U=S.n||"";s.async&&f.test(U)&&(S.a=!0,S.n=U.replace(f,"")),E.push(S)}else E.push(S)}if(!T)throw e('unclosed helper "'+v.n+'"');return V(a.slice(u,a.length),!1),v.d=E,v})({f:[]},!0);if(s.plugins)for(var x=0;x<s.plugins.length;x++){var g=s.plugins[x];g.processAST&&(C.d=g.processAST(C.d,s))}return C.d}function qe(a,s){var d=Xe(a,s),p="var tR='';"+(s.useWith?"with("+s.varName+"||{}){":"")+K(d,s)+"if(cb){cb(null,tR)} return tR"+(s.useWith?"}":"");if(s.plugins)for(var n=0;n<s.plugins.length;n++){var i=s.plugins[n];i.processFnString&&(p=i.processFnString(p,s))}return p}function Ze(a,s){for(var d=0;d<s.length;d++){var p=s[d][0],n=s[d][1];a=(s[d][2]?"await ":"")+"c.l('F','"+p+"')("+a,n&&(a+=","+n),a+=")"}return a}function R(a,s,d,p,n,i){var u="{exec:"+(n?"async ":"")+We(d,s,a)+",params:["+p+"]";return i&&(u+=",name:'"+i+"'"),n&&(u+=",async:true"),u+="}"}function Vt(a,s){for(var d="[",p=0;p<a.length;p++){var n=a[p];d+=R(s,n.res||"",n.d,n.p||"",n.a,n.n),p<a.length&&(d+=",")}return d+="]"}function We(a,s,d){return"function("+s+"){var tR='';"+K(a,d)+"return tR}"}function K(a,s){for(var d=0,p=a.length,n="";d<p;d++){var i=a[d];if(typeof i=="string")n+="tR+='"+i+"';";else{var u=i.t,m=i.c||"",y=i.f,C=i.n||"",x=i.p||"",g=i.res||"",b=i.b,v=!!i.a;if(u==="i"){s.defaultFilter&&(m="c.l('F','"+s.defaultFilter+"')("+m+")");var T=Ze(m,y);!i.raw&&s.autoEscape&&(T="c.l('F','e')("+T+")"),n+="tR+="+T+";"}else if(u==="h")if(s.storage.nativeHelpers.get(C))n+=s.storage.nativeHelpers.get(C)(i,s);else{var w=(v?"await ":"")+"c.l('H','"+C+"')("+R(s,g,i.d,x,v);w+=b?","+Vt(b,s):",[]",n+="tR+="+Ze(w+=",c)",y)+";"}else u==="s"?n+="tR+="+Ze((v?"await ":"")+"c.l('H','"+C+"')({params:["+x+"]},[],c)",y)+";":u==="e"&&(n+=m+`
6
+ `)}}return n}var Oe=(function(){function a(s){this.cache=s}return a.prototype.define=function(s,d){this.cache[s]=d},a.prototype.get=function(s){return this.cache[s]},a.prototype.remove=function(s){delete this.cache[s]},a.prototype.reset=function(){this.cache={}},a.prototype.load=function(s){h(this.cache,s,!0)},a})();function ye(a,s,d,p){if(s&&s.length>0)throw e((p?"Native":"")+"Helper '"+a+"' doesn't accept blocks");if(d&&d.length>0)throw e((p?"Native":"")+"Helper '"+a+"' doesn't accept filters")}var Et={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function It(a){return Et[a]}var et=new Oe({}),tt=new Oe({each:function(a,s){var d="",p=a.params[0];if(ye("each",s,!1),a.async)return new Promise(function(i){(function u(m,y,C,x,g){C(m[y],y).then(function(b){x+=b,y===m.length-1?g(x):u(m,y+1,C,x,g)})})(p,0,a.exec,d,i)});for(var n=0;n<p.length;n++)d+=a.exec(p[n],n);return d},foreach:function(a,s){var d=a.params[0];if(ye("foreach",s,!1),a.async)return new Promise(function(i){(function u(m,y,C,x,g,b){x(y[C],m[y[C]]).then(function(v){g+=v,C===y.length-1?b(g):u(m,y,C+1,x,g,b)})})(d,Object.keys(d),0,a.exec,"",i)});var p="";for(var n in d)c(d,n)&&(p+=a.exec(n,d[n]));return p},include:function(a,s,d){ye("include",s,!1);var p=d.storage.templates.get(a.params[0]);if(!p)throw e('Could not fetch template "'+a.params[0]+'"');return p(a.params[1],d)},extends:function(a,s,d){var p=a.params[1]||{};p.content=a.exec();for(var n=0;n<s.length;n++){var i=s[n];p[i.name]=i.exec()}var u=d.storage.templates.get(a.params[0]);if(!u)throw e('Could not fetch template "'+a.params[0]+'"');return u(p,d)},useScope:function(a,s){return ye("useScope",s,!1),a.exec(a.params[0])}}),it=new Oe({if:function(a,s){ye("if",!1,a.f,!0);var d="if("+a.p+"){"+K(a.d,s)+"}";if(a.b)for(var p=0;p<a.b.length;p++){var n=a.b[p];n.n==="else"?d+="else{"+K(n.d,s)+"}":n.n==="elif"&&(d+="else if("+n.p+"){"+K(n.d,s)+"}")}return d},try:function(a,s){if(ye("try",!1,a.f,!0),!a.b||a.b.length!==1||a.b[0].n!=="catch")throw e("native helper 'try' only accepts 1 block, 'catch'");var d="try{"+K(a.d,s)+"}",p=a.b[0];return d+="catch"+(p.res?"("+p.res+")":"")+"{"+K(p.d,s)+"}"},block:function(a,s){return ye("block",a.b,a.f,!0),"if(!"+s.varName+"["+a.p+"]){tR+=("+We(a.d,"",s)+")()}else{tR+="+s.varName+"["+a.p+"]}"}}),nt=new Oe({e:function(a){var s=String(a);return/[&<>"']/.test(s)?s.replace(/[&<>"']/g,It):s}}),Ne={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(a,s){if(a==="H"){var d=this.storage.helpers.get(s);if(d)return d;throw e("Can't find helper '"+s+"'")}if(a==="F"){var p=this.storage.filters.get(s);if(p)return p;throw e("Can't find filter '"+s+"'")}},async:!1,storage:{helpers:tt,nativeHelpers:it,filters:nt,templates:et},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function Qe(a,s){var d={};return h(d,Ne),s&&h(d,s),a&&h(d,a),d.l.bind(d),d}function Ge(a,s){var d,p=Qe(s||{}),n=Function;if(p.async){if(!l)throw e("This environment doesn't support async/await");n=l}if(p.varName&&(d=p.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(d)===!1))throw e("options.varName must be a valid JS identifier");try{return new n(p.varName,"c","cb",qe(a,p))}catch(i){throw i instanceof SyntaxError?e(`Bad template syntax
7
7
 
8
8
  `+i.message+`
9
9
  `+Array(i.message.length+1).join("=")+`
10
- `+qe(a,p)):i}}function ke(a,s){var d;return s.cache&&s.name&&s.storage.templates.get(s.name)?s.storage.templates.get(s.name):(d=typeof a=="function"?a:Ge(a,s),s.cache&&s.name&&s.storage.templates.define(s.name,d),d)}Ne.l.bind(Ne),r.compile=Ge,r.compileScope=K,r.compileScopeIntoFunction=We,r.compileToString=qe,r.defaultConfig=Ne,r.filters=nt,r.getConfig=Qe,r.helpers=tt,r.nativeHelpers=it,r.parse=Xe,r.render=function(a,s,d,p){var n=Qe(d||{});if(!n.async)return ke(a,n)(s,n);if(!p){if(typeof o=="function")return new o(function(i,u){try{i(ke(a,n)(s,n))}catch(m){u(m)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{ke(a,n)(s,n,p)}catch(i){return p(i)}},r.templates=et,Object.defineProperty(r,"__esModule",{value:!0})})});var Hi={schedule(r,e){let t=setTimeout(r,e);return()=>clearTimeout(t)}};function $i(r){return r.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Ui(r){return!!r&&r.nodeType===Node.ELEMENT_NODE}var Ft;function zi(r,e){if(!Ft){let t=Element.prototype;Ft=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return r.nodeType===Node.ELEMENT_NODE?Ft.call(r,e):!1}function qi(r){let e={};return r.forEach(({propName:t,templateName:o,transform:l})=>{e[$i(o)]=[t,l]}),e}function Zi(r,e){return e.get(Pt).resolveComponentFactory(r).inputs}function Wi(r,e){let t=r.childNodes,o=e.map(()=>[]),l=-1;e.some((c,h)=>c==="*"?(l=h,!0):!1);for(let c=0,h=t.length;c<h;++c){let f=t[c],_=Qi(f,e,l);_!==-1&&o[_].push(f)}return o}function Qi(r,e,t){let o=t;return Ui(r)&&e.some((l,c)=>l!=="*"&&zi(r,l)?(o=c,!0):!1),o}var Gi=10,At=class{componentFactory;inputMap=new Map;constructor(e,t){this.componentFactory=t.get(Pt).resolveComponentFactory(e);for(let o of this.componentFactory.inputs)this.inputMap.set(o.propName,o.templateName)}create(e){return new Rt(this.componentFactory,e,this.inputMap)}},Rt=class{componentFactory;injector;inputMap;eventEmitters=new St(1);events=this.eventEmitters.pipe(jt(e=>Bt(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,t,o){this.componentFactory=e,this.injector=t,this.inputMap=o,this.ngZone=this.injector.get(Kt),this.appRef=this.injector.get(Xt),this.cdScheduler=t.get(Zt),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=Hi.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},Gi))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){if(this.componentRef===null){this.initialInputValues.set(e,t);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,t),Qt(this.componentRef.hostView)&&(Gt(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(e){let t=kt.create({providers:[],parent:this.injector}),o=Wi(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(t,o,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,t]of this.initialInputValues)this.setInputValue(e,t);this.initialInputValues.clear()}initializeOutputs(e){let t=this.componentFactory.outputs.map(({propName:o,templateName:l})=>{let c=e.instance[o];return new ot(h=>{let f=c.subscribe(_=>h.next({name:l,value:_}));return()=>f.unsubscribe()})});this.eventEmitters.next(t)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},Ot=class extends HTMLElement{ngElementEventsSubscription=null};function Pi(r,e){let t=Zi(r,e.injector),o=e.strategyFactory||new At(r,e.injector),l=qi(t);class c extends Ot{injector;static observedAttributes=Object.keys(l);get ngElementStrategy(){if(!this._ngElementStrategy){let f=this._ngElementStrategy=o.create(this.injector||e.injector);t.forEach(({propName:_,transform:D})=>{if(!this.hasOwnProperty(_))return;let W=this[_];delete this[_],f.setInputValue(_,W,D)})}return this._ngElementStrategy}_ngElementStrategy;constructor(f){super(),this.injector=f}attributeChangedCallback(f,_,D,W){let[we,Te]=l[f];this.ngElementStrategy.setInputValue(we,D,Te)}connectedCallback(){let f=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),f=!0),this.ngElementStrategy.connect(this),f||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(f=>{let _=new CustomEvent(f.name,{detail:f.value});this.dispatchEvent(_)})}}return t.forEach(({propName:h,transform:f})=>{Object.defineProperty(c.prototype,h,{get(){return this.ngElementStrategy.getInputValue(h)},set(_){this.ngElementStrategy.setInputValue(h,_,f)},configurable:!0,enumerable:!0})}),c}var Di={providers:[ci()]};var Nt=(t=>(t.CART_AMOUNT="CART_AMOUNT",t.ITEM_COUNT="ITEM_COUNT",t))(Nt||{});var Z=ji(Ai());Z.filters.define("default",function(r){return typeof r>"u"||r==null?"":Yi(r)});+Z.filters.define("max",(r,e)=>{let t=Number(r),o=Number(e);return isNaN(t)||isNaN(o)?r:t>o?e:r});Z.filters.define("min",(r,e)=>{let t=Number(r),o=Number(e);return isNaN(t)||isNaN(o)?r:t<o?e:r});Z.filters.define("fallback",(r,e)=>r==null||r===""?e:r);Z.filters.define("manipulate_quantity",(r,e,t)=>{if(e??=1,t??=100,e>t)return re.error("Invalid range: min should be less than or equal to max."),r;if(r>=e&&r<=t)return r;let o=r%t;return o<e?e:o});Z.filters.define("apply_discount_perc",(r,e,t=1/0)=>{if(r=+r,isNaN(r))return re.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return re.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let o=r*e/100;return r-Math.min(t,o)});Z.filters.define("apply_discount_fixed",(r,e)=>(r=+r,isNaN(r)?(re.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,r-e)));Z.filters.define("currency",r=>(r=+r,isNaN(r)?(re.error("Need value as a number for `currency` filter"),NaN):$e(r)));Z.defaultConfig.defaultFilter="default";Z.defaultConfig.useWith=!0;Z.defaultConfig.autoEscape=!1;var Ji={'"':"&quot;","\\":"&bsol;","\n":"\\n"};function Yi(r){return String(r).replace(/["\\\n]/g,e=>Ji[e])}function Ki(r){if(!r)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return r.replace(e,(t,o,l,c)=>`{{ ${(l||c||"").trim()} }}`)}var ze=(r,e,t)=>{e=ue({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Z.render(Ki(r),e)}catch(o){throw vi(o,"squirrelly-render",{extra:{template:r,values:e},triggerContext:t}),o}};var gt=class r{transform(e,t){return e?ze(e,ue({},t)):null}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=Jt({name:"cooeeDynamicVariables",type:r,pure:!0})};var Lt={};(function r(e,t,o,l){var c=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),h=typeof Path2D=="function"&&typeof DOMMatrix=="function",f=(function(){if(!e.OffscreenCanvas)return!1;var n=new OffscreenCanvas(1,1),i=n.getContext("2d");i.fillRect(0,0,1,1);var u=n.transferToImageBitmap();try{i.createPattern(u,"no-repeat")}catch{return!1}return!0})();function _(){}function D(n){var i=t.exports.Promise,u=i!==void 0?i:e.Promise;return typeof u=="function"?new u(n):(n(_,_),null)}var W=(function(n,i){return{transform:function(u){if(n)return u;if(i.has(u))return i.get(u);var m=new OffscreenCanvas(u.width,u.height),y=m.getContext("2d");return y.drawImage(u,0,0),i.set(u,m),m},clear:function(){i.clear()}}})(f,new Map),we=(function(){var n=Math.floor(16.666666666666668),i,u,m={},y=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(i=function(C){var x=Math.random();return m[x]=requestAnimationFrame(function g(b){y===b||y+n-1<b?(y=b,delete m[x],C()):m[x]=requestAnimationFrame(g)}),x},u=function(C){m[C]&&cancelAnimationFrame(m[C])}):(i=function(C){return setTimeout(C,n)},u=function(C){return clearTimeout(C)}),{frame:i,cancel:u}})(),Te=(function(){var n,i,u={};function m(y){function C(x,g){y.postMessage({options:x||{},callback:g})}y.init=function(g){var b=g.transferControlToOffscreen();y.postMessage({canvas:b},[b])},y.fire=function(g,b,v){if(i)return C(g,null),i;var T=Math.random().toString(36).slice(2);return i=D(function(w){function k(V){V.data.callback===T&&(delete u[T],y.removeEventListener("message",k),i=null,W.clear(),v(),w())}y.addEventListener("message",k),C(g,T),u[T]=k.bind(null,{data:{callback:T}})}),i},y.reset=function(){y.postMessage({reset:!0});for(var g in u)u[g](),delete u[g]}}return function(){if(n)return n;if(!o&&c){var y=["var CONFETTI, SIZE = {}, module = {};","("+r.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
11
- `);try{n=new Worker(URL.createObjectURL(new Blob([y])))}catch(C){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",C),null}m(n)}return n}})(),Xe={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function qe(n,i){return i?i(n):n}function Ze(n){return n!=null}function R(n,i,u){return qe(n&&Ze(n[i])?n[i]:Xe[i],u)}function Et(n){return n<0?0:Math.floor(n)}function We(n,i){return Math.floor(Math.random()*(i-n))+n}function K(n){return parseInt(n,16)}function Oe(n){return n.map(he)}function he(n){var i=String(n).replace(/[^0-9a-f]/gi,"");return i.length<6&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),{r:K(i.substring(0,2)),g:K(i.substring(2,4)),b:K(i.substring(4,6))}}function Vt(n){var i=R(n,"origin",Object);return i.x=R(i,"x",Number),i.y=R(i,"y",Number),i}function It(n){n.width=document.documentElement.clientWidth,n.height=document.documentElement.clientHeight}function et(n){var i=n.getBoundingClientRect();n.width=i.width,n.height=i.height}function tt(n){var i=document.createElement("canvas");return i.style.position="fixed",i.style.top="0px",i.style.left="0px",i.style.pointerEvents="none",i.style.zIndex=n,i}function it(n,i,u,m,y,C,x,g,b){n.save(),n.translate(i,u),n.rotate(C),n.scale(m,y),n.arc(0,0,1,x,g,b),n.restore()}function nt(n){var i=n.angle*(Math.PI/180),u=n.spread*(Math.PI/180);return{x:n.x,y:n.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:n.startVelocity*.5+Math.random()*n.startVelocity,angle2D:-i+(.5*u-Math.random()*u),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:n.color,shape:n.shape,tick:0,totalTicks:n.ticks,decay:n.decay,drift:n.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:n.gravity*3,ovalScalar:.6,scalar:n.scalar,flat:n.flat}}function Ne(n,i){i.x+=Math.cos(i.angle2D)*i.velocity+i.drift,i.y+=Math.sin(i.angle2D)*i.velocity+i.gravity,i.velocity*=i.decay,i.flat?(i.wobble=0,i.wobbleX=i.x+10*i.scalar,i.wobbleY=i.y+10*i.scalar,i.tiltSin=0,i.tiltCos=0,i.random=1):(i.wobble+=i.wobbleSpeed,i.wobbleX=i.x+10*i.scalar*Math.cos(i.wobble),i.wobbleY=i.y+10*i.scalar*Math.sin(i.wobble),i.tiltAngle+=.1,i.tiltSin=Math.sin(i.tiltAngle),i.tiltCos=Math.cos(i.tiltAngle),i.random=Math.random()+2);var u=i.tick++/i.totalTicks,m=i.x+i.random*i.tiltCos,y=i.y+i.random*i.tiltSin,C=i.wobbleX+i.random*i.tiltCos,x=i.wobbleY+i.random*i.tiltSin;if(n.fillStyle="rgba("+i.color.r+", "+i.color.g+", "+i.color.b+", "+(1-u)+")",n.beginPath(),h&&i.shape.type==="path"&&typeof i.shape.path=="string"&&Array.isArray(i.shape.matrix))n.fill(s(i.shape.path,i.shape.matrix,i.x,i.y,Math.abs(C-m)*.1,Math.abs(x-y)*.1,Math.PI/10*i.wobble));else if(i.shape.type==="bitmap"){var g=Math.PI/10*i.wobble,b=Math.abs(C-m)*.1,v=Math.abs(x-y)*.1,T=i.shape.bitmap.width*i.scalar,w=i.shape.bitmap.height*i.scalar,k=new DOMMatrix([Math.cos(g)*b,Math.sin(g)*b,-Math.sin(g)*v,Math.cos(g)*v,i.x,i.y]);k.multiplySelf(new DOMMatrix(i.shape.matrix));var V=n.createPattern(W.transform(i.shape.bitmap),"no-repeat");V.setTransform(k),n.globalAlpha=1-u,n.fillStyle=V,n.fillRect(i.x-T/2,i.y-w/2,T,w),n.globalAlpha=1}else if(i.shape==="circle")n.ellipse?n.ellipse(i.x,i.y,Math.abs(C-m)*i.ovalScalar,Math.abs(x-y)*i.ovalScalar,Math.PI/10*i.wobble,0,2*Math.PI):it(n,i.x,i.y,Math.abs(C-m)*i.ovalScalar,Math.abs(x-y)*i.ovalScalar,Math.PI/10*i.wobble,0,2*Math.PI);else if(i.shape==="star")for(var E=Math.PI/2*3,A=4*i.scalar,O=8*i.scalar,$=i.x,Q=i.y,X=5,S=Math.PI/X;X--;)$=i.x+Math.cos(E)*O,Q=i.y+Math.sin(E)*O,n.lineTo($,Q),E+=S,$=i.x+Math.cos(E)*A,Q=i.y+Math.sin(E)*A,n.lineTo($,Q),E+=S;else n.moveTo(Math.floor(i.x),Math.floor(i.y)),n.lineTo(Math.floor(i.wobbleX),Math.floor(y)),n.lineTo(Math.floor(C),Math.floor(x)),n.lineTo(Math.floor(m),Math.floor(i.wobbleY));return n.closePath(),n.fill(),i.tick<i.totalTicks}function Qe(n,i,u,m,y){var C=i.slice(),x=n.getContext("2d"),g,b,v=D(function(T){function w(){g=b=null,x.clearRect(0,0,m.width,m.height),W.clear(),y(),T()}function k(){o&&!(m.width===l.width&&m.height===l.height)&&(m.width=n.width=l.width,m.height=n.height=l.height),!m.width&&!m.height&&(u(n),m.width=n.width,m.height=n.height),x.clearRect(0,0,m.width,m.height),C=C.filter(function(V){return Ne(x,V)}),C.length?g=we.frame(k):w()}g=we.frame(k),b=w});return{addFettis:function(T){return C=C.concat(T),v},canvas:n,promise:v,reset:function(){g&&we.cancel(g),b&&b()}}}function Ge(n,i){var u=!n,m=!!R(i||{},"resize"),y=!1,C=R(i,"disableForReducedMotion",Boolean),x=c&&!!R(i||{},"useWorker"),g=x?Te():null,b=u?It:et,v=n&&g?!!n.__confetti_initialized:!1,T=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,w;function k(E,A,O){for(var $=R(E,"particleCount",Et),Q=R(E,"angle",Number),X=R(E,"spread",Number),S=R(E,"startVelocity",Number),ve=R(E,"decay",Number),Pe=R(E,"gravity",Number),De=R(E,"drift",Number),U=R(E,"colors",Oe),ce=R(E,"ticks",Number),rt=R(E,"shapes"),G=R(E,"scalar"),Fe=!!R(E,"flat"),Le=Vt(E),Be=$,ee=[],de=n.width*Le.x,Li=n.height*Le.y;Be--;)ee.push(nt({x:de,y:Li,angle:Q,spread:X,startVelocity:S,color:U[Be%U.length],shape:rt[We(0,rt.length)],ticks:ce,decay:ve,gravity:Pe,drift:De,scalar:G,flat:Fe}));return w?w.addFettis(ee):(w=Qe(n,ee,b,A,O),w.promise)}function V(E){var A=C||R(E,"disableForReducedMotion",Boolean),O=R(E,"zIndex",Number);if(A&&T)return D(function(S){S()});u&&w?n=w.canvas:u&&!n&&(n=tt(O),document.body.appendChild(n)),m&&!v&&b(n);var $={width:n.width,height:n.height};g&&!v&&g.init(n),v=!0,g&&(n.__confetti_initialized=!0);function Q(){if(g){var S={getBoundingClientRect:function(){if(!u)return n.getBoundingClientRect()}};b(S),g.postMessage({resize:{width:S.width,height:S.height}});return}$.width=$.height=null}function X(){w=null,m&&(y=!1,e.removeEventListener("resize",Q)),u&&n&&(document.body.contains(n)&&document.body.removeChild(n),n=null,v=!1)}return m&&!y&&(y=!0,e.addEventListener("resize",Q,!1)),g?g.fire(E,$,X):k(E,$,X)}return V.reset=function(){g&&g.reset(),w&&w.reset()},V}var ke;function a(){return ke||(ke=Ge(null,{useWorker:!0,resize:!0})),ke}function s(n,i,u,m,y,C,x){var g=new Path2D(n),b=new Path2D;b.addPath(g,new DOMMatrix(i));var v=new Path2D;return v.addPath(b,new DOMMatrix([Math.cos(x)*y,Math.sin(x)*y,-Math.sin(x)*C,Math.cos(x)*C,u,m])),v}function d(n){if(!h)throw new Error("path confetti are not supported in this browser");var i,u;typeof n=="string"?i=n:(i=n.path,u=n.matrix);var m=new Path2D(i),y=document.createElement("canvas"),C=y.getContext("2d");if(!u){for(var x=1e3,g=x,b=x,v=0,T=0,w,k,V=0;V<x;V+=2)for(var E=0;E<x;E+=2)C.isPointInPath(m,V,E,"nonzero")&&(g=Math.min(g,V),b=Math.min(b,E),v=Math.max(v,V),T=Math.max(T,E));w=v-g,k=T-b;var A=10,O=Math.min(A/w,A/k);u=[O,0,0,O,-Math.round(w/2+g)*O,-Math.round(k/2+b)*O]}return{type:"path",path:i,matrix:u}}function p(n){var i,u=1,m="#000000",y='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof n=="string"?i=n:(i=n.text,u="scalar"in n?n.scalar:u,y="fontFamily"in n?n.fontFamily:y,m="color"in n?n.color:m);var C=10*u,x=""+C+"px "+y,g=new OffscreenCanvas(C,C),b=g.getContext("2d");b.font=x;var v=b.measureText(i),T=Math.ceil(v.actualBoundingBoxRight+v.actualBoundingBoxLeft),w=Math.ceil(v.actualBoundingBoxAscent+v.actualBoundingBoxDescent),k=2,V=v.actualBoundingBoxLeft+k,E=v.actualBoundingBoxAscent+k;T+=k+k,w+=k+k,g=new OffscreenCanvas(T,w),b=g.getContext("2d"),b.font=x,b.fillStyle=m,b.fillText(i,V,E);var A=1/u;return{type:"bitmap",bitmap:g.transferToImageBitmap(),matrix:[A,0,0,A,-T*A/2,-w*A/2]}}t.exports=function(){return a().apply(this,arguments)},t.exports.reset=function(){a().reset()},t.exports.create=Ge,t.exports.shapeFromPath=d,t.exports.shapeFromText=p})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),Lt,!1);var Ri=Lt.exports,Jn=Lt.exports.create;var ht=class{static DEFAULTS={scalar:1.4,zIndex:1e4,shapes:["circle","circle","square"],colors:["#f51c8f","#2179e2","#d52dc8","#01a9d9","#78ff44","#fdff6a"]};static async basic(){await this.fire({particleCount:100,spread:70,origin:{y:.6}})}static async leftRight(e=100){let t=[],o=Date.now()+2e3,l=()=>{t.push(this.fire({angle:60,spread:55,origin:{x:0}}),this.fire({angle:120,spread:55,origin:{x:1}})),Date.now()<o&&e>0&&(requestAnimationFrame(l),e--)};l(),await Promise.all(t)}static async realistic(){await Promise.all([this.realisticFire(.25,{spread:26,startVelocity:55}),this.realisticFire(.2,{spread:60}),this.realisticFire(.35,{spread:100,decay:.91,scalar:.8}),this.realisticFire(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),this.realisticFire(.1,{spread:120,startVelocity:45})])}static async fire(e){Object.assign(e,this.DEFAULTS,e),e.particleCount=e.particleCount??this.DEFAULTS.colors.length,await Ri(e)}static async realisticFire(e,t){let l={origin:{y:.7}};await this.fire(Object.assign({},l,t,{particleCount:Math.floor(200*e)}))}};var Xi=(r,e)=>e.minValue;function en(r,e){if(r&1&&(ne(0,"div",7),fe(1,"safeHtml")),r&2){let t=M().$implicit;J("innerHTML",xe(1,1,t.minValue+" Products"),ae)}}function tn(r,e){if(r&1&&(ne(0,"div",7),fe(1,"cooeeCurrency"),fe(2,"safeHtml")),r&2){let t=M().$implicit;J("innerHTML",xe(2,3,xe(1,1,t.minValue)),ae)}}function nn(r,e){if(r&1&&(se(0,"li",6)(1,"div"),z(2,en,2,3,"div",7)(3,tn,3,5,"div",7),ne(4,"img",8),se(5,"div",9),le(6),pe()()()),r&2){let t=e.$implicit,o=M(2);Je("left",t.calculatedAlignment+"%"),I(2),q((o.progressBarConfig==null?null:o.progressBarConfig.rewardBasis)===o.RewardBasis.ITEM_COUNT?2:3),I(2),J("src",o.getIconURL(t),Ee),I(2),oi(t.label)}}function rn(r,e){if(r&1&&(ne(0,"div",0),fe(1,"cooeeDynamicVariables"),fe(2,"safeHtml"),se(3,"div",1)(4,"ul",2)(5,"div",3),ne(6,"div",4),pe(),te(7,nn,7,5,"li",5,Xi),pe()()),r&2){let t=M(),o=t.calculatedState(),l=o.nextMilestone?o.nextMilestone.reachingText:o.lastMilestone.reachedText;J("innerHTML",xe(2,6,li(1,3,l,t.localDynamicVariables())),ae),I(6),Je("width",o.cartValuePercentage+"%"),I(),ie(o.milestones)}}var vt=class r extends ge{cart;localDynamicVariables=ye({});calculatedState=ye({});progressBarConfig;RewardBasis=Nt;constructor(){super()}engagementTriggerReceived(e){this.progressBarConfig=e.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(e){return e.rewardType===ut.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":e.rewardType===ut.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":e.rewardType===ut.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(e=>re.error(e))}async calculateMilestones(){let e=this.engagementTrigger,t=this.progressBarConfig;if(!t?.milestones?.length){re.warn("Milestones not available in progress bar config",e);return}let o=await this.cart.getNormalisedCart(),l=t.milestones.at(-1),c=t?.reachedAmountOrCount??o.originalAmount,h=t.totalProgress??0;re.verbose("Cart value:",c,`, percentage: ${h}%`),this.celebrate(e,c);let f={milestonesReady:!0,cartValuePercentage:h,milestones:t.milestones},_=t.milestones.find(D=>!D.reached);if(_){let D=$e(_.minValue-c);if(t.rewardBasis==="ITEM_COUNT"){let W=_.minValue-c;D=`${W} ${W===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:D}),f.nextMilestone=_,this.calculatedState.set(f);return}f.lastMilestone=l,this.calculatedState.set(f)}celebrate(e,t){let c=[...e.progressBarConfig.milestones].reverse().find(_=>_.minValue<t);if(!c)return;let h=`lc/en/${e.shortID}/${c.minValue}`;sessionStorage.getItem(h)||(sessionStorage.setItem(h,"1"),this.progressBarConfig?.noConfetti||ht.realistic())}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[Ie(Me()),j],decls:1,vars:1,consts:[[1,"heading",3,"innerHTML"],[1,"milestone-container"],[1,"milestone-list"],[1,"untracked-path"],[1,"tracked-path"],[1,"milestone-list-item",3,"left"],[1,"milestone-list-item"],[1,"milestone-value",3,"innerHTML"],["width","20","height","20","alt","milestone icon",1,"milestone-icon",3,"src"],[1,"milestone-label"]],template:function(t,o){t&1&&z(0,rn,9,8),t&2&&q(o.calculatedState().milestonesReady?0:-1)},dependencies:[gt,Ue,Ci],styles:[`:host{display:block;padding:10px;background:linear-gradient(0deg,rgba(var(--lc-primary-color),.1) 0%,transparent 100%)}.milestone-container{width:95%;margin:8px 0}.heading{font-weight:500;text-align:center;font-size:12px}.milestone-list{display:flex;align-items:center;position:relative;font-size:10px;font-weight:500}.untracked-path{width:100%;background-color:#e5e7eb;height:4px;position:absolute}.tracked-path{background-color:rgba(var(--lc-primary-color));height:100%;display:block;transition:width .5s ease-in-out}.milestone-list{padding:0;margin:0}.milestone-list-item{position:relative;display:flex;flex-direction:column;align-items:center;height:75px}.milestone-list-item>div{display:flex;flex-direction:column;align-items:center;justify-content:space-between;position:absolute;height:100%;width:100px}.milestone-icon{padding:5px;border-radius:1000px;background-color:rgba(var(--lc-primary-color))}
12
- `],encapsulation:3})};var on=["numberVariable"],yt=class r extends ge{numberSlot;savingsBarConfig;textParts=ye({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(e){this.savingsBarConfig=e.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+e.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let e=ue(ue({},this.engagementTrigger.getCartMagicVariables()),yi("total_savings",this.savingsBarConfig.totalSavings)),t=ze(this.savingsBarConfig.text,{cart:e},this.triggerContext),o=t.match(/[\d.,]+/)?.[0];if(!o){re.error("No amount found in text",t);return}let[l,c]=t.split(o);this.textParts.set({start:l,end:c}),this.savingsBarConfig.animateNumber?this.runAnimation(o):this.numberSlot.nativeElement.innerHTML=o}runSlotMachineAnimation(e="0"){let t=this.numberSlot.nativeElement;t.innerHTML="";let o=this.savingsBarConfig.animationDuration/e.length;this.clearPreviousIntervals();for(let l=0;l<e.length;l++){let c=document.createElement("div");c.className="digit",c.style.display="inline-block",t.appendChild(c);let h=setInterval(()=>{let f=Math.floor(Math.random()*10);c.innerHTML=`<div>${f}</div>`},50);this.globalIntervals.push(h),setTimeout(()=>{clearInterval(h);let f=e?.[l]??Math.floor(Math.random()*10);c.innerHTML=`${f}`},(l+1)*o)}}clearPreviousIntervals(){this.globalIntervals.forEach(clearInterval),this.globalIntervals=[]}runIncrementalAnimation(e){let t=performance.now(),o=l=>{let c=Math.min((l-t)/this.savingsBarConfig.animationDuration,1);this.numberSlot.nativeElement.innerHTML=Math.floor(e*c).toString(),c<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}runAnimation(e){this.savingsBarConfig.animation==="SLOT_MACHINE"?this.runSlotMachineAnimation(e):this.savingsBarConfig.animation==="INCREMENTAL"&&this.runIncrementalAnimation(Number(e))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-savings-bar"]],viewQuery:function(t,o){if(t&1&&st(on,5),t&2){let l;lt(l=ct())&&(o.numberSlot=l.first)}},features:[j],decls:6,vars:2,consts:[["numberVariable",""],[1,"container"],[1,"icon"],[1,"primary-text",3,"innerHTML"],[1,"counter-text"],[1,"final-text",3,"innerHTML"]],template:function(t,o){t&1&&(se(0,"div",1),ne(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),pe()),t&2&&(I(2),J("innerHTML",o.textParts().start,ae),I(3),J("innerHTML",o.textParts().end,ae))},styles:[`:host{display:block}.container{white-space:pre;display:flex;justify-content:center;align-items:center;background-color:rgba(var(--lc-primary-button-bg-color, 0 162 81));color:rgba(var(--lc-primary-button-color, 255 255 255));padding:8px;border-radius:4px 4px 0 0;overflow:hidden}.container .icon{background-image:var(--lc-discount-icon, url(https://img.icons8.com/ios-glyphs/30/FFFFFF/discount--v1.png));background-position:center;background-size:cover;height:20px;width:20px;margin-right:2px}
13
- `],encapsulation:3})};var Ct=class r extends ge{item;data=oe(xi);dialogRef=oe(bi);ItemDetailLayout=_i;constructor(){super(),this.triggerContext=this.data.triggerContext,this.item=this.data.item}close(){this.dialogRef.close()}engagementTriggerReceived(e){}update(){}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-item-quick-view"]],features:[Ie(Me()),j],decls:1,vars:2,consts:[[3,"closeClick","item","layout"]],template:function(t,o){t&1&&(P(0,"cooee-item-detail",0),Y("closeClick",function(){return o.close()}),F()),t&2&&H("item",o.item)("layout",o.ItemDetailLayout.TWO_PANE)},dependencies:[Ei],styles:[`:host{display:flex;align-items:center;justify-content:center;height:100%}@media (min-width: 768px){cooee-item-detail{max-width:900px;max-height:80vh;border-radius:var(--lc-card-radius)}}
14
- `],encapsulation:3})};var bt=class r{dialog=oe(pt);dialogRef;constructor(){}showItemQuickView(e,t){this.dialogRef=this.dialog.open(Ct,{width:"100vw",height:"100dvh",backdropClass:["letscooee-backdrop"],data:{item:t,triggerContext:e}})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=$t({token:r,factory:r.\u0275fac,providedIn:"root"})};var an=(r,e)=>({enter:r,exit:e});function sn(r,e){if(r&1&&(P(0,"div",7),le(1),F(),P(2,"div",8),le(3),F()),r&2){let t=M(2);I(),je(" ",t.getCurrency(t.selectedVariant().price.cmp)," "),I(2),je(" ",t.getDiscountPercentage(t.selectedVariant().price),"% off ")}}function ln(r,e){if(r&1&&(P(0,"div",6),le(1),F()),r&2){let t=M(2);I(),je(" ",t.stickyATCConfig.leftText," ")}}function cn(r,e){if(r&1&&(P(0,"div",1)(1,"div",5),le(2),F(),z(3,sn,4,2),z(4,ln,2,1,"div",6),F()),r&2){let t=M();I(2),je(" ",t.getCurrency(t.selectedVariant().price.d)," "),I(),q(t.selectedVariant().price.cmp?3:-1),I(),q(t.stickyATCConfig.leftText?4:-1)}}function dn(r,e){if(r&1&&(P(0,"div",9),le(1),F()),r&2){let t=e.$implicit,o=e.$index;M(2);let l=be(5);H("ngClass",si(2,an,o===l.currentIndex,o===l.previousIndex)),I(),je(" ",t," ")}}function un(r,e){if(r&1&&(P(0,"div",4),te(1,dn,2,5,"div",9,ei),F()),r&2){M();let t=be(5);I(),ie(t.features)}}var xt=class r extends ge{currentItem;stickyATCConfig;selectedVariant=ye(void 0);featureSlider=ye({features:[],currentIndex:0});constructor(){super()}onVariantChange(e){this.currentItem&&(this.currentItem.setSelectedVariantByID(e.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value))}engagementTriggerReceived(e){this.stickyATCConfig=e.stickyATCConfig??{},this.currentItem=e.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation()}update(){}getCurrency(e){return $e(e)}getDiscountPercentage(e){return((e.cmp-e.d)/e.cmp*100).toFixed(0)}addToCart(){this.engagementService.executeCTA(Ke.ADD_TO_CART,{item:this.currentItem})}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let e=this.stickyATCConfig.rightText.split(`
15
- `),t=e.length===1?null:setInterval(()=>{this.featureSlider.update(o=>Mt(ue({},o),{previousIndex:o.currentIndex,currentIndex:(o.currentIndex+1)%o.features.length}))},3e3);this.featureSlider.set({intervalRef:t,currentIndex:0,features:e})}replaceVariables(e){return e?ze(e,this.currentItem.getTemplateVariables(),this.triggerContext):""}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-sticky-atc"]],hostBindings:function(t,o){t&1&&Y("letscooee:variant-change",function(c){return o.onVariantChange(c)},Wt)},features:[Ie(Me()),j],decls:7,vars:3,consts:[[1,"lc-wrapper"],[1,"lc-prices"],[1,"lc-button-wrapper"],["type","button",1,"lc-button","lc-button-atc",3,"click"],[1,"lc-features"],[1,"lc-sale-price"],[1,"lc-additional-text"],[1,"lc-compare-price"],[1,"lc-discount-label"],[1,"lc-feature",3,"ngClass"]],template:function(t,o){if(t&1){let l=Ce();P(0,"div",0),z(1,cn,5,3,"div",1),P(2,"div",2)(3,"button",3),Y("click",function(){return N(l),L(o.addToCart())}),le(4,"Add To Cart"),F(),Ye(5),z(6,un,3,0,"div",4),F()()}if(t&2){I(),q(o.selectedVariant()&&o.stickyATCConfig.showProductInfo?1:-1),I(4);let l=Ae(o.featureSlider());I(),q(l.features.length?6:-1)}},dependencies:[dt],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media (min-width: 768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
16
- `],encapsulation:3})};var mn=["videoEl"];async function Oi(){return(await import("./video-detail-dialog.component-ME6ASA7O.js")).VideoDetailDialogComponent}var Se=class r extends ge{videoElements;videos;videoConfig;dialogRef=null;dialog=oe(pt);isMobile=wi();constructor(){super(),Oi()}engagementTriggerReceived(e){this.videoConfig=e.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(e,t){e||this.videoElements.forEach(o=>{o.nativeElement!==t&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(e,t){this.sendEvent("CE Trigger Clicked",{},e,t)}onVideoTap(e,t,o,l){e?.stopPropagation(),e?.preventDefault();let c=t.items?.[0];if(this.sendTriggerClicked(t,c),this.videoConfig.footerContent==="NONE"){l&&(l.muted=!1,l.play(),this.onMuteToggled(!1,l));return}mi().then(()=>this.openDialog(t,o))}sendEvent(e,t,o,l){let c=new fi(e,t,this.engagementTrigger);c.setVideos(o),l&&(c.items=[l.toEmbed()]),window.CooeeSDK.sendEvent(c)}onDialogClosed(){}async openDialog(e,t){let o={videos:this.videos,currentIndex:t,triggerContext:this.triggerContext};this.dialogRef&&this.dialogRef.close();let l=await Oi();this.dialogRef=this.dialog.open(l,{width:"100vw",height:"100vh",data:o,providers:gi(this.triggerContext,{video:e})});let c={videoID:e.id,videoIndex:t};this.sendEvent("CE Video Dialog Opened",{current:c},e),this.dialogRef.closed.subscribe(h=>{if(this.dialogRef=null,!h)return;let f=h.lastVideoDuration*1e3,_={videoID:h.lastVideo.id,videoIndex:h.lastVideoIndex,playedTillMS:f,playedTillPercent:f/h.lastVideo.durationMS};this.sendEvent("CE Video Dialog Closed",{current:_},h.lastVideo),this.onDialogClosed()})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-abstract-video"]],viewQuery:function(t,o){if(t&1&&st(mn,5),t&2){let l;lt(l=ct())&&(o.videoElements=l)}},features:[j],decls:0,vars:0,template:function(t,o){},encapsulation:2})};var fn=(r,e)=>e.id,gn=(r,e)=>e.url;function hn(r,e){if(r&1&&(Ve(0,"div",1),fe(1,"safeHtml")),r&2){let t=M();H("innerHTML",xe(1,1,t.videoConfig.heading),ae)}}function vn(r,e){r&1&&(P(0,"div",6),Ve(1,"div",14),F())}function yn(r,e){if(r&1&&Ve(0,"source",8),r&2){let t=e.$implicit;H("type",He(t.mimeType))("src",t.url,Ee)}}function Cn(r,e){if(r&1){let t=Ce();P(0,"cooee-mute-toggle",15),Y("toggled",function(l){N(t),M();let c=me(6),h=M();return L(h.onMuteToggled(l,c))}),F()}if(r&2){M();let t=me(6);H("muted",t.muted)("videoEl",t)}}function bn(r,e){if(r&1){let t=Ce();P(0,"cooee-item-card",16),Y("buttonClick",function(){N(t);let l=M(),c=l.$implicit,h=l.$index,f=me(6),_=M();return L(_.addToCartClicked(null,c,h,f))})("click",function(l){N(t);let c=M(),h=c.$implicit,f=c.$index,_=me(6),D=M();return L(D.onVideoTap(l,h,f,_))}),F()}if(r&2){M();let t=be(0);H("item",t)}}function xn(r,e){if(r&1){let t=Ce();P(0,"cooee-video-card",17),Y("linkClicked",function(){N(t);let l=M().$implicit,c=M();return L(c.sendTriggerClicked(l))}),F()}if(r&2){M();let t=be(1);H("card",t)}}function _n(r,e){if(r&1){let t=Ce();Ye(0)(1),P(2,"div",4)(3,"div",5),Y("click",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=me(6),D=M();return L(D.onVideoTap(l,h,f,_))})("keydown.enter",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=me(6),D=M();return L(D.onVideoTap(l,h,f,_))})("keydown.space",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=me(6),D=M();return L(D.onVideoTap(l,h,f,_))}),z(4,vn,2,0,"div",6),P(5,"video",7,0),Y("mouseenter",function(){N(t);let l=me(6);M();let c=be(1);return L(c&&l.play())})("mouseleave",function(){N(t);let l=me(6);M();let c=be(1);return L(c&&l.pause())})("loadstart",function(){let l=N(t).$implicit,c=M();return L(c.onVideoLoadStart(l.id))})("canplay",function(){let l=N(t).$implicit,c=M();return L(c.onVideoCanPlay(l.id))}),te(7,yn,1,3,"source",8,gn),F(),P(9,"div",9),z(10,Cn,1,2,"cooee-mute-toggle",10),F()(),P(11,"div",11),z(12,bn,1,1,"cooee-item-card",12)(13,xn,1,1,"cooee-video-card",13),F()()}if(r&2){let t=e.$implicit,o=M(),l=be(0),c=Ae(t.items[0]);I();let h=Ae(t.card),f=c&&o.videoConfig.footerContent==o.VideoConfigFooterContent.FIRST_ITEM,_=h&&o.videoConfig.footerContent==o.VideoConfigFooterContent.CARD;I(2),Je("background-image",t.thumbnail?"url("+t.thumbnail+")":null),I(),q(o.isVideoLoading(t.id)?4:-1),I(),H("muted",!0),at("preload",l?"metadata":"none")("autoplay",null)("data-video-id",t.id),I(2),ie(t.sources),I(3),q(o.videoConfig.showMuteButton?10:-1),I(2),q(f?12:_?13:-1)}}var _t=class r extends Se{VideoConfigFooterContent=Dt;VideoConfigAutoPlay=Vi;swiperOptions=null;videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),this.hasSwiper=!0}ngAfterViewInit(){let e=this.videoConfig.playlistConfig?.videoSwiper,t=e?(this.isMobile?e.gapSm:e.gap)+"px":window.cooeePlaylistGap??24,o=e?this.isMobile?e.maxInRowSm:e.maxInRow:"auto";this.swiperOptions={direction:"horizontal",effect:"slide",loop:e?.loop,freeMode:!0,spaceBetween:t,slidesPerView:o,mousewheel:{enabled:!0,forceToAxis:!0},autoplay:e?.autoplay?.enabled?{delay:e?.autoplay?.delay,disableOnInteraction:!1}:!1},this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}addToCartClicked(e,t,o,l){let c=t.items?.[0],h=pi.get().website?.canChangeVariantInCart;if(t.items?.length>1||c?.hasVariants()&&!h){this.onVideoTap(e,t,o,l);return}this.engagementService.executeCTA(Ke.ADD_TO_CART,{item:c,video:t})}goToPDP(e,t){e?.stopPropagation(),e?.preventDefault();let o=t.items?.[0];this.engagementService.executeCTA(Ke.GO_TO_PRODUCT,{item:o,video:t})}update(){}isVideoLoading(e){return this.videoLoadingStates.get(e)??!0}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(t=>{let o=t.target,l=o.dataset.videoId;l&&(t.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(o,!0)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(o,!1)))})},{threshold:.5,rootMargin:"50px"}),setTimeout(()=>{this.videoElements.forEach(e=>{this.intersectionObserver?.observe(e.nativeElement)})},100)}handleVideoVisibilityChange(e,t){t?this.shouldAutoPlay()&&e.play().catch(()=>{}):e.pause()}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-video-playlist"]],features:[Ie(Me()),j],decls:7,vars:6,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options","navigationConfig","paginationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","muted"],[3,"src","type"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(t,o){if(t&1&&(Ye(0)(1),z(2,hn,2,3,"div",1),P(3,"cooee-swiper",2),ti(4,3),te(5,_n,14,11,"div",4,fn),ii(),F()),t&2){Ae(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),I(),Ae(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),I(),q(o.videoConfig.heading?2:-1);let l=o.videoConfig.playlistConfig==null?null:o.videoConfig.playlistConfig.videoSwiper;I(),H("options",o.swiperOptions)("navigationConfig",l==null?null:l.navigation)("paginationConfig",l==null?null:l.pagination),I(2),ie(o.videos)}},dependencies:[Si,Mi,Ii,ki,Ue],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-info{font-size:14px;line-height:normal}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
17
- `],encapsulation:3})};function Ni(r){r||(r=oe(qt));let e=new ot(t=>{if(r.destroyed){t.next();return}return r.onDestroy(t.next.bind(t))});return t=>t.pipe(Ht(e))}var wn=r=>({"cursor-grab":r}),Tn=(r,e)=>e.url;function En(r,e){if(r&1&&Ve(0,"source",7),r&2){let t=e.$implicit;H("type",He(t.mimeType))("src",t.url,Ee)}}var wt=class r extends Se{video;isDragging=!1;hidden=!1;cdkDrag=oe(mt,{self:!0});untilDestroyed=Ni();constructor(){super()}get popupClasses(){return this.hidden?["hidden"]:["visible"]}onClick(e){e.stopPropagation(),e.preventDefault(),this.onVideoClick()}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.closest(".letscooee-engagement");e&&(e.style.zIndex="10000"),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=!0)}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.hidden=!0,this.onVideoTap(null,this.video,0)}close(){this.hidden=!0;let e=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent("CE Trigger Closed",{duration:e})}engagementTriggerReceived(e){super.engagementTriggerReceived(e),this.video=this.videos[0]}update(){}onDialogClosed(){this.hidden=!1}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-video-popup"]],hostAttrs:["role","button","tabindex","0","aria-label","Open video popup "],hostVars:3,hostBindings:function(t,o){t&1&&Y("keydown.enter",function(c){return o.onClick(c)})("keydown.space",function(c){return o.onClick(c)})("click",function(c){return o.onClick(c)}),t&2&&(J("cdkDragBoundary","body"),ri(o.popupClasses))},features:[Yt([{directive:mt,inputs:["cdkDragBoundary","cdkDragBoundary"]}]),j],decls:10,vars:4,consts:[[1,"popup-inner",3,"ngClass"],["type","button","aria-label","Close video popup",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"play-button"],["name","unmute","aria-hidden","true"],[1,"text"],["loop","","preload","auto","playsinline","","autoplay","",3,"muted"],[3,"src","type"]],template:function(t,o){t&1&&(P(0,"div",0)(1,"button",1),Y("click",function(c){return c.stopPropagation(),o.close()}),Ve(2,"cooee-icon",2),F(),P(3,"div",3),Ve(4,"cooee-icon",4),P(5,"div",5),le(6,"Tap to unmute"),F()(),P(7,"video",6),te(8,En,1,3,"source",7,Tn),F()()),t&2&&(H("ngClass",ai(2,wn,o.isDragging)),I(7),H("muted",!0),I(),ie(o.video.sources))},dependencies:[dt,Ti],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
18
- `],encapsulation:3})};var Vn=(r,e)=>e.id,In=(r,e)=>e.url;function Mn(r,e){if(r&1&&(ne(0,"div",0),fe(1,"safeHtml")),r&2){let t=M();J("innerHTML",xe(1,1,t.videoConfig.heading),ae)}}function Sn(r,e){if(r&1&&ne(0,"source",9),r&2){let t=e.$implicit;J("type",He(t.mimeType))("src",t.url,Ee)}}function kn(r,e){if(r&1){let t=Ce();se(0,"div",3),ni("click",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=M();return L(_.onVideoTap(l,h,f))})("keydown.enter",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=M();return L(_.onVideoTap(l,h,f))})("keydown.space",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=M();return L(_.onVideoTap(l,h,f))}),Ut(),se(1,"svg",4),ne(2,"circle",5)(3,"circle",6),pe(),zt(),se(4,"div",7)(5,"video",8),te(6,Sn,1,3,"source",9,In),pe()()()}if(r&2){let t=e.$implicit,o=e.$index;at("aria-label","Open video story "+(o+1)),I(5),J("muted",!0),I(),ie(t.sources)}}var Tt=class r extends Se{constructor(){super()}update(){}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-video-stories"]],features:[j],decls:4,vars:1,consts:[[1,"heading-text",3,"innerHTML"],[1,"video-stories"],["role","button","tabindex","0",1,"video-story"],["role","button","tabindex","0",1,"video-story",3,"click","keydown.enter","keydown.space"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6",1,"video-story-circle"],[1,"video-wrapper"],["autoplay","","loop","","playsinline","","preload","metadata",3,"muted"],[3,"src","type"]],template:function(t,o){t&1&&(z(0,Mn,2,3,"div",0),se(1,"div",1),te(2,kn,8,2,"div",2,Vn),pe()),t&2&&(q(o.videoConfig.heading?0:-1),I(2),ie(o.videos))},dependencies:[Ue],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media (max-width: 768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px}
19
- `],encapsulation:3})};ui("CooeeWidgetSDK");(async()=>{let r=await di(Di),e=(t,o)=>{let l=Pi(t,{injector:r.injector});customElements.define(o,l)};e(xt,"cooee-sticky-atc"),e(yt,"cooee-savings-bar"),e(vt,"cooee-progressbar"),e(_t,"cooee-video-playlist"),e(wt,"cooee-video-popup"),e(Tt,"cooee-video-stories"),e(hi,"cooee-product-options-picker"),sessionStorage.cooeeDebug&&import("./debugger.component-LLFZ2DEA.js").then(t=>{e(t.DebuggerComponent,"cooee-debugger")}),window.cooeeShowQuickItem=(t,o)=>{r.injector.get(bt).showItemQuickView(t,o)}})();
10
+ `+qe(a,p)):i}}function ke(a,s){var d;return s.cache&&s.name&&s.storage.templates.get(s.name)?s.storage.templates.get(s.name):(d=typeof a=="function"?a:Ge(a,s),s.cache&&s.name&&s.storage.templates.define(s.name,d),d)}Ne.l.bind(Ne),r.compile=Ge,r.compileScope=K,r.compileScopeIntoFunction=We,r.compileToString=qe,r.defaultConfig=Ne,r.filters=nt,r.getConfig=Qe,r.helpers=tt,r.nativeHelpers=it,r.parse=Xe,r.render=function(a,s,d,p){var n=Qe(d||{});if(!n.async)return ke(a,n)(s,n);if(!p){if(typeof o=="function")return new o(function(i,u){try{i(ke(a,n)(s,n))}catch(m){u(m)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{ke(a,n)(s,n,p)}catch(i){return p(i)}},r.templates=et,Object.defineProperty(r,"__esModule",{value:!0})})});var qi={schedule(r,e){let t=setTimeout(r,e);return()=>clearTimeout(t)}};function Zi(r){return r.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Wi(r){return!!r&&r.nodeType===Node.ELEMENT_NODE}var Ft;function Qi(r,e){if(!Ft){let t=Element.prototype;Ft=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return r.nodeType===Node.ELEMENT_NODE?Ft.call(r,e):!1}function Gi(r){let e={};return r.forEach(({propName:t,templateName:o,transform:l})=>{e[Zi(o)]=[t,l]}),e}function Ji(r,e){return e.get(Pt).resolveComponentFactory(r).inputs}function Yi(r,e){let t=r.childNodes,o=e.map(()=>[]),l=-1;e.some((c,h)=>c==="*"?(l=h,!0):!1);for(let c=0,h=t.length;c<h;++c){let f=t[c],_=Ki(f,e,l);_!==-1&&o[_].push(f)}return o}function Ki(r,e,t){let o=t;return Wi(r)&&e.some((l,c)=>l!=="*"&&Qi(r,l)?(o=c,!0):!1),o}var Xi=10,At=class{componentFactory;inputMap=new Map;constructor(e,t){this.componentFactory=t.get(Pt).resolveComponentFactory(e);for(let o of this.componentFactory.inputs)this.inputMap.set(o.propName,o.templateName)}create(e){return new Rt(this.componentFactory,e,this.inputMap)}},Rt=class{componentFactory;injector;inputMap;eventEmitters=new St(1);events=this.eventEmitters.pipe(jt(e=>Bt(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,t,o){this.componentFactory=e,this.injector=t,this.inputMap=o,this.ngZone=this.injector.get(Kt),this.appRef=this.injector.get(Xt),this.cdScheduler=t.get(Zt),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=qi.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},Xi))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){if(this.componentRef===null){this.initialInputValues.set(e,t);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,t),Qt(this.componentRef.hostView)&&(Gt(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(e){let t=kt.create({providers:[],parent:this.injector}),o=Yi(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(t,o,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,t]of this.initialInputValues)this.setInputValue(e,t);this.initialInputValues.clear()}initializeOutputs(e){let t=this.componentFactory.outputs.map(({propName:o,templateName:l})=>{let c=e.instance[o];return new ot(h=>{let f=c.subscribe(_=>h.next({name:l,value:_}));return()=>f.unsubscribe()})});this.eventEmitters.next(t)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},Ot=class extends HTMLElement{ngElementEventsSubscription=null};function Ri(r,e){let t=Ji(r,e.injector),o=e.strategyFactory||new At(r,e.injector),l=Gi(t);class c extends Ot{injector;static observedAttributes=Object.keys(l);get ngElementStrategy(){if(!this._ngElementStrategy){let f=this._ngElementStrategy=o.create(this.injector||e.injector);t.forEach(({propName:_,transform:D})=>{if(!this.hasOwnProperty(_))return;let W=this[_];delete this[_],f.setInputValue(_,W,D)})}return this._ngElementStrategy}_ngElementStrategy;constructor(f){super(),this.injector=f}attributeChangedCallback(f,_,D,W){let[Ve,Ee]=l[f];this.ngElementStrategy.setInputValue(Ve,D,Ee)}connectedCallback(){let f=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),f=!0),this.ngElementStrategy.connect(this),f||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(f=>{let _=new CustomEvent(f.name,{detail:f.value});this.dispatchEvent(_)})}}return t.forEach(({propName:h,transform:f})=>{Object.defineProperty(c.prototype,h,{get(){return this.ngElementStrategy.getInputValue(h)},set(_){this.ngElementStrategy.setInputValue(h,_,f)},configurable:!0,enumerable:!0})}),c}var Oi={providers:[ci()]};var Nt=(t=>(t.CART_AMOUNT="CART_AMOUNT",t.ITEM_COUNT="ITEM_COUNT",t))(Nt||{});var Z=zi(Li());Z.filters.define("default",function(r){return typeof r>"u"||r==null?"":tn(r)});+Z.filters.define("max",(r,e)=>{let t=Number(r),o=Number(e);return isNaN(t)||isNaN(o)?r:t>o?e:r});Z.filters.define("min",(r,e)=>{let t=Number(r),o=Number(e);return isNaN(t)||isNaN(o)?r:t<o?e:r});Z.filters.define("fallback",(r,e)=>r==null||r===""?e:r);Z.filters.define("manipulate_quantity",(r,e,t)=>{if(e??=1,t??=100,e>t)return oe.error("Invalid range: min should be less than or equal to max."),r;if(r>=e&&r<=t)return r;let o=r%t;return o<e?e:o});Z.filters.define("apply_discount_perc",(r,e,t=1/0)=>{if(r=+r,isNaN(r))return oe.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return oe.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let o=r*e/100;return r-Math.min(t,o)});Z.filters.define("apply_discount_fixed",(r,e)=>(r=+r,isNaN(r)?(oe.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,r-e)));Z.filters.define("currency",r=>(r=+r,isNaN(r)?(oe.error("Need value as a number for `currency` filter"),NaN):$e(r)));Z.defaultConfig.defaultFilter="default";Z.defaultConfig.useWith=!0;Z.defaultConfig.autoEscape=!1;var en={'"':"&quot;","\\":"&bsol;","\n":"\\n"};function tn(r){return String(r).replace(/["\\\n]/g,e=>en[e])}function nn(r){if(!r)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return r.replace(e,(t,o,l,c)=>`{{ ${(l||c||"").trim()} }}`)}var ze=(r,e,t)=>{e=me({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Z.render(nn(r),e)}catch(o){throw yi(o,"squirrelly-render",{extra:{template:r,values:e},triggerContext:t}),o}};var gt=class r{transform(e,t){return e?ze(e,me({},t)):null}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=Jt({name:"cooeeDynamicVariables",type:r,pure:!0})};var Lt={};(function r(e,t,o,l){var c=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),h=typeof Path2D=="function"&&typeof DOMMatrix=="function",f=(function(){if(!e.OffscreenCanvas)return!1;var n=new OffscreenCanvas(1,1),i=n.getContext("2d");i.fillRect(0,0,1,1);var u=n.transferToImageBitmap();try{i.createPattern(u,"no-repeat")}catch{return!1}return!0})();function _(){}function D(n){var i=t.exports.Promise,u=i!==void 0?i:e.Promise;return typeof u=="function"?new u(n):(n(_,_),null)}var W=(function(n,i){return{transform:function(u){if(n)return u;if(i.has(u))return i.get(u);var m=new OffscreenCanvas(u.width,u.height),y=m.getContext("2d");return y.drawImage(u,0,0),i.set(u,m),m},clear:function(){i.clear()}}})(f,new Map),Ve=(function(){var n=Math.floor(16.666666666666668),i,u,m={},y=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(i=function(C){var x=Math.random();return m[x]=requestAnimationFrame(function g(b){y===b||y+n-1<b?(y=b,delete m[x],C()):m[x]=requestAnimationFrame(g)}),x},u=function(C){m[C]&&cancelAnimationFrame(m[C])}):(i=function(C){return setTimeout(C,n)},u=function(C){return clearTimeout(C)}),{frame:i,cancel:u}})(),Ee=(function(){var n,i,u={};function m(y){function C(x,g){y.postMessage({options:x||{},callback:g})}y.init=function(g){var b=g.transferControlToOffscreen();y.postMessage({canvas:b},[b])},y.fire=function(g,b,v){if(i)return C(g,null),i;var T=Math.random().toString(36).slice(2);return i=D(function(w){function k(E){E.data.callback===T&&(delete u[T],y.removeEventListener("message",k),i=null,W.clear(),v(),w())}y.addEventListener("message",k),C(g,T),u[T]=k.bind(null,{data:{callback:T}})}),i},y.reset=function(){y.postMessage({reset:!0});for(var g in u)u[g](),delete u[g]}}return function(){if(n)return n;if(!o&&c){var y=["var CONFETTI, SIZE = {}, module = {};","("+r.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
11
+ `);try{n=new Worker(URL.createObjectURL(new Blob([y])))}catch(C){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",C),null}m(n)}return n}})(),Xe={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function qe(n,i){return i?i(n):n}function Ze(n){return n!=null}function R(n,i,u){return qe(n&&Ze(n[i])?n[i]:Xe[i],u)}function Vt(n){return n<0?0:Math.floor(n)}function We(n,i){return Math.floor(Math.random()*(i-n))+n}function K(n){return parseInt(n,16)}function Oe(n){return n.map(ye)}function ye(n){var i=String(n).replace(/[^0-9a-f]/gi,"");return i.length<6&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),{r:K(i.substring(0,2)),g:K(i.substring(2,4)),b:K(i.substring(4,6))}}function Et(n){var i=R(n,"origin",Object);return i.x=R(i,"x",Number),i.y=R(i,"y",Number),i}function It(n){n.width=document.documentElement.clientWidth,n.height=document.documentElement.clientHeight}function et(n){var i=n.getBoundingClientRect();n.width=i.width,n.height=i.height}function tt(n){var i=document.createElement("canvas");return i.style.position="fixed",i.style.top="0px",i.style.left="0px",i.style.pointerEvents="none",i.style.zIndex=n,i}function it(n,i,u,m,y,C,x,g,b){n.save(),n.translate(i,u),n.rotate(C),n.scale(m,y),n.arc(0,0,1,x,g,b),n.restore()}function nt(n){var i=n.angle*(Math.PI/180),u=n.spread*(Math.PI/180);return{x:n.x,y:n.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:n.startVelocity*.5+Math.random()*n.startVelocity,angle2D:-i+(.5*u-Math.random()*u),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:n.color,shape:n.shape,tick:0,totalTicks:n.ticks,decay:n.decay,drift:n.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:n.gravity*3,ovalScalar:.6,scalar:n.scalar,flat:n.flat}}function Ne(n,i){i.x+=Math.cos(i.angle2D)*i.velocity+i.drift,i.y+=Math.sin(i.angle2D)*i.velocity+i.gravity,i.velocity*=i.decay,i.flat?(i.wobble=0,i.wobbleX=i.x+10*i.scalar,i.wobbleY=i.y+10*i.scalar,i.tiltSin=0,i.tiltCos=0,i.random=1):(i.wobble+=i.wobbleSpeed,i.wobbleX=i.x+10*i.scalar*Math.cos(i.wobble),i.wobbleY=i.y+10*i.scalar*Math.sin(i.wobble),i.tiltAngle+=.1,i.tiltSin=Math.sin(i.tiltAngle),i.tiltCos=Math.cos(i.tiltAngle),i.random=Math.random()+2);var u=i.tick++/i.totalTicks,m=i.x+i.random*i.tiltCos,y=i.y+i.random*i.tiltSin,C=i.wobbleX+i.random*i.tiltCos,x=i.wobbleY+i.random*i.tiltSin;if(n.fillStyle="rgba("+i.color.r+", "+i.color.g+", "+i.color.b+", "+(1-u)+")",n.beginPath(),h&&i.shape.type==="path"&&typeof i.shape.path=="string"&&Array.isArray(i.shape.matrix))n.fill(s(i.shape.path,i.shape.matrix,i.x,i.y,Math.abs(C-m)*.1,Math.abs(x-y)*.1,Math.PI/10*i.wobble));else if(i.shape.type==="bitmap"){var g=Math.PI/10*i.wobble,b=Math.abs(C-m)*.1,v=Math.abs(x-y)*.1,T=i.shape.bitmap.width*i.scalar,w=i.shape.bitmap.height*i.scalar,k=new DOMMatrix([Math.cos(g)*b,Math.sin(g)*b,-Math.sin(g)*v,Math.cos(g)*v,i.x,i.y]);k.multiplySelf(new DOMMatrix(i.shape.matrix));var E=n.createPattern(W.transform(i.shape.bitmap),"no-repeat");E.setTransform(k),n.globalAlpha=1-u,n.fillStyle=E,n.fillRect(i.x-T/2,i.y-w/2,T,w),n.globalAlpha=1}else if(i.shape==="circle")n.ellipse?n.ellipse(i.x,i.y,Math.abs(C-m)*i.ovalScalar,Math.abs(x-y)*i.ovalScalar,Math.PI/10*i.wobble,0,2*Math.PI):it(n,i.x,i.y,Math.abs(C-m)*i.ovalScalar,Math.abs(x-y)*i.ovalScalar,Math.PI/10*i.wobble,0,2*Math.PI);else if(i.shape==="star")for(var V=Math.PI/2*3,A=4*i.scalar,O=8*i.scalar,$=i.x,Q=i.y,X=5,S=Math.PI/X;X--;)$=i.x+Math.cos(V)*O,Q=i.y+Math.sin(V)*O,n.lineTo($,Q),V+=S,$=i.x+Math.cos(V)*A,Q=i.y+Math.sin(V)*A,n.lineTo($,Q),V+=S;else n.moveTo(Math.floor(i.x),Math.floor(i.y)),n.lineTo(Math.floor(i.wobbleX),Math.floor(y)),n.lineTo(Math.floor(C),Math.floor(x)),n.lineTo(Math.floor(m),Math.floor(i.wobbleY));return n.closePath(),n.fill(),i.tick<i.totalTicks}function Qe(n,i,u,m,y){var C=i.slice(),x=n.getContext("2d"),g,b,v=D(function(T){function w(){g=b=null,x.clearRect(0,0,m.width,m.height),W.clear(),y(),T()}function k(){o&&!(m.width===l.width&&m.height===l.height)&&(m.width=n.width=l.width,m.height=n.height=l.height),!m.width&&!m.height&&(u(n),m.width=n.width,m.height=n.height),x.clearRect(0,0,m.width,m.height),C=C.filter(function(E){return Ne(x,E)}),C.length?g=Ve.frame(k):w()}g=Ve.frame(k),b=w});return{addFettis:function(T){return C=C.concat(T),v},canvas:n,promise:v,reset:function(){g&&Ve.cancel(g),b&&b()}}}function Ge(n,i){var u=!n,m=!!R(i||{},"resize"),y=!1,C=R(i,"disableForReducedMotion",Boolean),x=c&&!!R(i||{},"useWorker"),g=x?Ee():null,b=u?It:et,v=n&&g?!!n.__confetti_initialized:!1,T=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,w;function k(V,A,O){for(var $=R(V,"particleCount",Vt),Q=R(V,"angle",Number),X=R(V,"spread",Number),S=R(V,"startVelocity",Number),Ce=R(V,"decay",Number),Pe=R(V,"gravity",Number),De=R(V,"drift",Number),U=R(V,"colors",Oe),ue=R(V,"ticks",Number),rt=R(V,"shapes"),G=R(V,"scalar"),Fe=!!R(V,"flat"),Le=Et(V),Be=$,ee=[],pe=n.width*Le.x,$i=n.height*Le.y;Be--;)ee.push(nt({x:pe,y:$i,angle:Q,spread:X,startVelocity:S,color:U[Be%U.length],shape:rt[We(0,rt.length)],ticks:ue,decay:Ce,gravity:Pe,drift:De,scalar:G,flat:Fe}));return w?w.addFettis(ee):(w=Qe(n,ee,b,A,O),w.promise)}function E(V){var A=C||R(V,"disableForReducedMotion",Boolean),O=R(V,"zIndex",Number);if(A&&T)return D(function(S){S()});u&&w?n=w.canvas:u&&!n&&(n=tt(O),document.body.appendChild(n)),m&&!v&&b(n);var $={width:n.width,height:n.height};g&&!v&&g.init(n),v=!0,g&&(n.__confetti_initialized=!0);function Q(){if(g){var S={getBoundingClientRect:function(){if(!u)return n.getBoundingClientRect()}};b(S),g.postMessage({resize:{width:S.width,height:S.height}});return}$.width=$.height=null}function X(){w=null,m&&(y=!1,e.removeEventListener("resize",Q)),u&&n&&(document.body.contains(n)&&document.body.removeChild(n),n=null,v=!1)}return m&&!y&&(y=!0,e.addEventListener("resize",Q,!1)),g?g.fire(V,$,X):k(V,$,X)}return E.reset=function(){g&&g.reset(),w&&w.reset()},E}var ke;function a(){return ke||(ke=Ge(null,{useWorker:!0,resize:!0})),ke}function s(n,i,u,m,y,C,x){var g=new Path2D(n),b=new Path2D;b.addPath(g,new DOMMatrix(i));var v=new Path2D;return v.addPath(b,new DOMMatrix([Math.cos(x)*y,Math.sin(x)*y,-Math.sin(x)*C,Math.cos(x)*C,u,m])),v}function d(n){if(!h)throw new Error("path confetti are not supported in this browser");var i,u;typeof n=="string"?i=n:(i=n.path,u=n.matrix);var m=new Path2D(i),y=document.createElement("canvas"),C=y.getContext("2d");if(!u){for(var x=1e3,g=x,b=x,v=0,T=0,w,k,E=0;E<x;E+=2)for(var V=0;V<x;V+=2)C.isPointInPath(m,E,V,"nonzero")&&(g=Math.min(g,E),b=Math.min(b,V),v=Math.max(v,E),T=Math.max(T,V));w=v-g,k=T-b;var A=10,O=Math.min(A/w,A/k);u=[O,0,0,O,-Math.round(w/2+g)*O,-Math.round(k/2+b)*O]}return{type:"path",path:i,matrix:u}}function p(n){var i,u=1,m="#000000",y='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof n=="string"?i=n:(i=n.text,u="scalar"in n?n.scalar:u,y="fontFamily"in n?n.fontFamily:y,m="color"in n?n.color:m);var C=10*u,x=""+C+"px "+y,g=new OffscreenCanvas(C,C),b=g.getContext("2d");b.font=x;var v=b.measureText(i),T=Math.ceil(v.actualBoundingBoxRight+v.actualBoundingBoxLeft),w=Math.ceil(v.actualBoundingBoxAscent+v.actualBoundingBoxDescent),k=2,E=v.actualBoundingBoxLeft+k,V=v.actualBoundingBoxAscent+k;T+=k+k,w+=k+k,g=new OffscreenCanvas(T,w),b=g.getContext("2d"),b.font=x,b.fillStyle=m,b.fillText(i,E,V);var A=1/u;return{type:"bitmap",bitmap:g.transferToImageBitmap(),matrix:[A,0,0,A,-T*A/2,-w*A/2]}}t.exports=function(){return a().apply(this,arguments)},t.exports.reset=function(){a().reset()},t.exports.create=Ge,t.exports.shapeFromPath=d,t.exports.shapeFromText=p})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),Lt,!1);var Bi=Lt.exports,er=Lt.exports.create;var ht=class{static DEFAULTS={scalar:1.4,zIndex:1e4,shapes:["circle","circle","square"],colors:["#f51c8f","#2179e2","#d52dc8","#01a9d9","#78ff44","#fdff6a"]};static async basic(){await this.fire({particleCount:100,spread:70,origin:{y:.6}})}static async leftRight(e=100){let t=[],o=Date.now()+2e3,l=()=>{t.push(this.fire({angle:60,spread:55,origin:{x:0}}),this.fire({angle:120,spread:55,origin:{x:1}})),Date.now()<o&&e>0&&(requestAnimationFrame(l),e--)};l(),await Promise.all(t)}static async realistic(){await Promise.all([this.realisticFire(.25,{spread:26,startVelocity:55}),this.realisticFire(.2,{spread:60}),this.realisticFire(.35,{spread:100,decay:.91,scalar:.8}),this.realisticFire(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),this.realisticFire(.1,{spread:120,startVelocity:45})])}static async fire(e){Object.assign(e,this.DEFAULTS,e),e.particleCount=e.particleCount??this.DEFAULTS.colors.length,await Bi(e)}static async realisticFire(e,t){let l={origin:{y:.7}};await this.fire(Object.assign({},l,t,{particleCount:Math.floor(200*e)}))}};var rn=(r,e)=>e.minValue;function on(r,e){if(r&1&&(ne(0,"div",7),he(1,"safeHtml")),r&2){let t=M().$implicit;J("innerHTML",we(1,1,t.minValue+" Products"),le)}}function an(r,e){if(r&1&&(ne(0,"div",7),he(1,"cooeeCurrency"),he(2,"safeHtml")),r&2){let t=M().$implicit;J("innerHTML",we(2,3,we(1,1,t.minValue)),le)}}function sn(r,e){if(r&1&&(ce(0,"li",6)(1,"div"),z(2,on,2,3,"div",7)(3,an,3,5,"div",7),ne(4,"img",8),ce(5,"div",9),de(6),fe()()()),r&2){let t=e.$implicit,o=M(2);Je("left",t.calculatedAlignment+"%"),I(2),q((o.progressBarConfig==null?null:o.progressBarConfig.rewardBasis)===o.RewardBasis.ITEM_COUNT?2:3),I(2),J("src",o.getIconURL(t),Ie),I(2),oi(t.label)}}function ln(r,e){if(r&1&&(ne(0,"div",0),he(1,"cooeeDynamicVariables"),he(2,"safeHtml"),ce(3,"div",1)(4,"ul",2)(5,"div",3),ne(6,"div",4),fe(),te(7,sn,7,5,"li",5,rn),fe()()),r&2){let t=M(),o=t.calculatedState(),l=o.nextMilestone?o.nextMilestone.reachingText:o.lastMilestone.reachedText;J("innerHTML",we(2,6,li(1,3,l,t.localDynamicVariables())),le),I(6),Je("width",o.cartValuePercentage+"%"),I(),ie(o.milestones)}}var vt=class r extends ve{cart;localDynamicVariables=be({});calculatedState=be({});progressBarConfig;RewardBasis=Nt;constructor(){super()}engagementTriggerReceived(e){this.progressBarConfig=e.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(e){return e.rewardType===ut.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":e.rewardType===ut.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":e.rewardType===ut.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(e=>oe.error(e))}async calculateMilestones(){let e=this.engagementTrigger,t=this.progressBarConfig;if(!t?.milestones?.length){oe.warn("Milestones not available in progress bar config",e);return}let o=await this.cart.getNormalisedCart(),l=t.milestones.at(-1),c=t?.reachedAmountOrCount??o.originalAmount,h=t.totalProgress??0;oe.verbose("Cart value:",c,`, percentage: ${h}%`),this.celebrate(e,c);let f={milestonesReady:!0,cartValuePercentage:h,milestones:t.milestones},_=t.milestones.find(D=>!D.reached);if(_){let D=$e(_.minValue-c);if(t.rewardBasis==="ITEM_COUNT"){let W=_.minValue-c;D=`${W} ${W===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:D}),f.nextMilestone=_,this.calculatedState.set(f);return}f.lastMilestone=l,this.calculatedState.set(f)}celebrate(e,t){let c=[...e.progressBarConfig.milestones].reverse().find(_=>_.minValue<t);if(!c)return;let h=`lc/en/${e.shortID}/${c.minValue}`;sessionStorage.getItem(h)||(sessionStorage.setItem(h,"1"),this.progressBarConfig?.noConfetti||ht.realistic())}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[re(ae()),j],decls:1,vars:1,consts:[[1,"heading",3,"innerHTML"],[1,"milestone-container"],[1,"milestone-list"],[1,"untracked-path"],[1,"tracked-path"],[1,"milestone-list-item",3,"left"],[1,"milestone-list-item"],[1,"milestone-value",3,"innerHTML"],["width","20","height","20","alt","milestone icon",1,"milestone-icon",3,"src"],[1,"milestone-label"]],template:function(t,o){t&1&&z(0,ln,9,8),t&2&&q(o.calculatedState().milestonesReady?0:-1)},dependencies:[gt,Ue,bi],styles:[`:host{display:block;padding:10px;background:linear-gradient(0deg,rgba(var(--lc-primary-color),.1) 0%,transparent 100%)}.milestone-container{width:95%;margin:8px 0}.heading{font-weight:500;text-align:center;font-size:12px}.milestone-list{display:flex;align-items:center;position:relative;font-size:10px;font-weight:500}.untracked-path{width:100%;background-color:#e5e7eb;height:4px;position:absolute}.tracked-path{background-color:rgba(var(--lc-primary-color));height:100%;display:block;transition:width .5s ease-in-out}.milestone-list{padding:0;margin:0}.milestone-list-item{position:relative;display:flex;flex-direction:column;align-items:center;height:75px}.milestone-list-item>div{display:flex;flex-direction:column;align-items:center;justify-content:space-between;position:absolute;height:100%;width:100px}.milestone-icon{padding:5px;border-radius:1000px;background-color:rgba(var(--lc-primary-color))}
12
+ `],encapsulation:3})};var cn=["numberVariable"],yt=class r extends ve{numberSlot;savingsBarConfig;textParts=be({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(e){this.savingsBarConfig=e.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+e.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let e=me(me({},this.engagementTrigger.getCartMagicVariables()),Ci("total_savings",this.savingsBarConfig.totalSavings)),t=ze(this.savingsBarConfig.text,{cart:e},this.triggerContext),o=t.match(/[\d.,]+/)?.[0];if(!o){oe.error("No amount found in text",t);return}let[l,c]=t.split(o);this.textParts.set({start:l,end:c}),this.savingsBarConfig.animateNumber?this.runAnimation(o):this.numberSlot.nativeElement.innerHTML=o}runSlotMachineAnimation(e="0"){let t=this.numberSlot.nativeElement;t.innerHTML="";let o=this.savingsBarConfig.animationDuration/e.length;this.clearPreviousIntervals();for(let l=0;l<e.length;l++){let c=document.createElement("div");c.className="digit",c.style.display="inline-block",t.appendChild(c);let h=setInterval(()=>{let f=Math.floor(Math.random()*10);c.innerHTML=`<div>${f}</div>`},50);this.globalIntervals.push(h),setTimeout(()=>{clearInterval(h);let f=e?.[l]??Math.floor(Math.random()*10);c.innerHTML=`${f}`},(l+1)*o)}}clearPreviousIntervals(){this.globalIntervals.forEach(clearInterval),this.globalIntervals=[]}runIncrementalAnimation(e){let t=performance.now(),o=l=>{let c=Math.min((l-t)/this.savingsBarConfig.animationDuration,1);this.numberSlot.nativeElement.innerHTML=Math.floor(e*c).toString(),c<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}runAnimation(e){this.savingsBarConfig.animation==="SLOT_MACHINE"?this.runSlotMachineAnimation(e):this.savingsBarConfig.animation==="INCREMENTAL"&&this.runIncrementalAnimation(Number(e))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-savings-bar"]],viewQuery:function(t,o){if(t&1&&st(cn,5),t&2){let l;lt(l=ct())&&(o.numberSlot=l.first)}},features:[j],decls:6,vars:2,consts:[["numberVariable",""],[1,"container"],[1,"icon"],[1,"primary-text",3,"innerHTML"],[1,"counter-text"],[1,"final-text",3,"innerHTML"]],template:function(t,o){t&1&&(ce(0,"div",1),ne(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),fe()),t&2&&(I(2),J("innerHTML",o.textParts().start,le),I(3),J("innerHTML",o.textParts().end,le))},styles:[`:host{display:block}.container{white-space:pre;display:flex;justify-content:center;align-items:center;background-color:rgba(var(--lc-primary-button-bg-color, 0 162 81));color:rgba(var(--lc-primary-button-color, 255 255 255));padding:8px;border-radius:4px 4px 0 0;overflow:hidden}.container .icon{background-image:var(--lc-discount-icon, url(https://img.icons8.com/ios-glyphs/30/FFFFFF/discount--v1.png));background-position:center;background-size:cover;height:20px;width:20px;margin-right:2px}
13
+ `],encapsulation:3})};var Ct=class r extends ve{item;data=se(_i);dialogRef=se(xi);ItemDetailLayout=wi;constructor(){super(),this.triggerContext=this.data.triggerContext,this.item=this.data.item}close(){this.dialogRef.close()}engagementTriggerReceived(e){}update(){}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-item-quick-view"]],features:[re(ae()),j],decls:1,vars:2,consts:[[3,"closeClick","item","layout"]],template:function(t,o){t&1&&(P(0,"cooee-item-detail",0),Y("closeClick",function(){return o.close()}),F()),t&2&&H("item",o.item)("layout",o.ItemDetailLayout.TWO_PANE)},dependencies:[Ei],styles:[`:host{display:flex;align-items:center;justify-content:center;height:100%}@media (min-width: 768px){cooee-item-detail{max-width:900px;max-height:80vh;border-radius:var(--lc-card-radius)}}
14
+ `],encapsulation:3})};var bt=class r{dialog=se(pt);dialogRef;constructor(){}showItemQuickView(e,t){this.dialogRef=this.dialog.open(Ct,{width:"100vw",height:"100dvh",backdropClass:["letscooee-backdrop"],data:{item:t,triggerContext:e}})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=$t({token:r,factory:r.\u0275fac,providedIn:"root"})};var dn=(r,e)=>({enter:r,exit:e});function un(r,e){if(r&1&&(P(0,"div",7),de(1),F(),P(2,"div",8),de(3),F()),r&2){let t=M(2);I(),je(" ",t.getCurrency(t.selectedVariant().price.cmp)," "),I(2),je(" ",t.getDiscountPercentage(t.selectedVariant().price),"% off ")}}function pn(r,e){if(r&1&&(P(0,"div",6),de(1),F()),r&2){let t=M(2);I(),je(" ",t.stickyATCConfig.leftText," ")}}function mn(r,e){if(r&1&&(P(0,"div",1)(1,"div",5),de(2),F(),z(3,un,4,2),z(4,pn,2,1,"div",6),F()),r&2){let t=M();I(2),je(" ",t.getCurrency(t.selectedVariant().price.d)," "),I(),q(t.selectedVariant().price.cmp?3:-1),I(),q(t.stickyATCConfig.leftText?4:-1)}}function fn(r,e){if(r&1&&(P(0,"div",9),de(1),F()),r&2){let t=e.$implicit,o=e.$index;M(2);let l=_e(5);H("ngClass",si(2,dn,o===l.currentIndex,o===l.previousIndex)),I(),je(" ",t," ")}}function gn(r,e){if(r&1&&(P(0,"div",4),te(1,fn,2,5,"div",9,ei),F()),r&2){M();let t=_e(5);I(),ie(t.features)}}var xt=class r extends ve{currentItem;stickyATCConfig;selectedVariant=be(void 0);featureSlider=be({features:[],currentIndex:0});constructor(){super()}onVariantChange(e){this.currentItem&&(this.currentItem.setSelectedVariantByID(e.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value))}engagementTriggerReceived(e){this.stickyATCConfig=e.stickyATCConfig??{},this.currentItem=e.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation()}update(){}getCurrency(e){return $e(e)}getDiscountPercentage(e){return((e.cmp-e.d)/e.cmp*100).toFixed(0)}addToCart(){this.engagementService.executeCTA(Ke.ADD_TO_CART,{item:this.currentItem})}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let e=this.stickyATCConfig.rightText.split(`
15
+ `),t=e.length===1?null:setInterval(()=>{this.featureSlider.update(o=>Mt(me({},o),{previousIndex:o.currentIndex,currentIndex:(o.currentIndex+1)%o.features.length}))},3e3);this.featureSlider.set({intervalRef:t,currentIndex:0,features:e})}replaceVariables(e){return e?ze(e,this.currentItem.getTemplateVariables(),this.triggerContext):""}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-sticky-atc"]],hostBindings:function(t,o){t&1&&Y("letscooee:variant-change",function(c){return o.onVariantChange(c)},Wt)},features:[re(ae()),j],decls:7,vars:3,consts:[[1,"lc-wrapper"],[1,"lc-prices"],[1,"lc-button-wrapper"],["type","button",1,"lc-button","lc-button-atc",3,"click"],[1,"lc-features"],[1,"lc-sale-price"],[1,"lc-additional-text"],[1,"lc-compare-price"],[1,"lc-discount-label"],[1,"lc-feature",3,"ngClass"]],template:function(t,o){if(t&1){let l=xe();P(0,"div",0),z(1,mn,5,3,"div",1),P(2,"div",2)(3,"button",3),Y("click",function(){return N(l),L(o.addToCart())}),de(4,"Add To Cart"),F(),Ye(5),z(6,gn,3,0,"div",4),F()()}if(t&2){I(),q(o.selectedVariant()&&o.stickyATCConfig.showProductInfo?1:-1),I(4);let l=Ae(o.featureSlider());I(),q(l.features.length?6:-1)}},dependencies:[dt],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media (min-width: 768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
16
+ `],encapsulation:3})};var vn=["videoEl"];async function ji(){return(await import("./video-detail-dialog.component-64NTQ4F4.js")).VideoDetailDialogComponent}var Se=class r extends ve{videoElements;videos;videoConfig;dialogRef=null;dialog=se(pt);isMobile=Ti();pausedVideos=[];constructor(){super(),ji()}ngAfterViewInit(){this.checkAndOpenVideoFromUrl()}engagementTriggerReceived(e){this.videoConfig=e.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(e,t){e||this.videoElements.forEach(o=>{o.nativeElement!==t&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(e,t){this.sendEvent("CE Trigger Clicked",{},e,t)}async onVideoTap(e,t,o,l){e?.stopPropagation(),e?.preventDefault();let c=t.items?.[0];if(this.sendTriggerClicked(t,c),this.videoConfig.footerContent==="NONE"){l&&(l.muted=!1,l.play(),this.onMuteToggled(!1,l));return}await this.openDialog(t,o)}sendEvent(e,t,o,l){let c=new fi(e,t,this.engagementTrigger);c.setVideos(o),l&&(c.items=[l.toEmbed()]),window.CooeeSDK.sendEvent(c)}onDialogClosed(){this.resumePlaylistVideos()}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(e=>{let t=e.nativeElement;t.paused||(this.pausedVideos.push(t),t.pause())})}resumePlaylistVideos(){this.pausedVideos.forEach(e=>{e.play().catch(()=>{})}),this.pausedVideos=[]}async checkAndOpenVideoFromUrl(){let e=ki();if(!e||!this.videos)return;let t=Si();if(t.utm_campaign?.toLowerCase()!=="shoppable_video"||t.utm_source?.toLowerCase()!==Mi)return;let o=this.videos.findIndex(l=>l.shortID===+e);if(o!==-1){let l=this.videos[o];await vi.set("muted",!0),await this.openDialog(l,o)}}async openDialog(e,t){await mi();let o={videos:this.videos,currentIndex:t,triggerContext:this.triggerContext};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let l=await ji();this.dialogRef=this.dialog.open(l,{width:"100vw",height:"100vh",data:o,providers:gi(this.triggerContext,{video:e,index:t}),disableClose:!0});let c={videoID:e.id,videoIndex:t};this.sendEvent("CE Video Dialog Opened",{current:c},e),this.dialogRef.closed.subscribe(h=>{if(this.dialogRef=null,!h)return;let f=h.lastVideoDuration*1e3,_={videoID:h.lastVideo.id,videoIndex:h.lastVideoIndex,playedTillMS:f,playedTillPercent:f/h.lastVideo.durationMS};this.sendEvent("CE Video Dialog Closed",{current:_},h.lastVideo),this.onDialogClosed()})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-abstract-video"]],viewQuery:function(t,o){if(t&1&&st(vn,5),t&2){let l;lt(l=ct())&&(o.videoElements=l)}},features:[j],decls:0,vars:0,template:function(t,o){},encapsulation:2})};var yn=(r,e)=>e.id,Cn=(r,e)=>e.url;function bn(r,e){if(r&1&&(Me(0,"div",1),he(1,"safeHtml")),r&2){let t=M();H("innerHTML",we(1,1,t.videoConfig.heading),le)}}function xn(r,e){r&1&&(P(0,"div",6),Me(1,"div",14),F())}function _n(r,e){if(r&1&&Me(0,"source",8),r&2){let t=e.$implicit;H("type",He(t.mimeType))("src",t.url,Ie)}}function wn(r,e){if(r&1){let t=xe();P(0,"cooee-mute-toggle",15),Y("toggled",function(l){N(t),M();let c=ge(6),h=M();return L(h.onMuteToggled(l,c))}),F()}if(r&2){M();let t=ge(6);H("muted",t.muted)("videoEl",t)}}function Tn(r,e){if(r&1){let t=xe();P(0,"cooee-item-card",16),Y("buttonClick",function(){N(t);let l=M(),c=l.$implicit,h=l.$index,f=ge(6),_=M();return L(_.addToCartClicked(null,c,h,f))})("click",function(l){N(t);let c=M(),h=c.$implicit,f=c.$index,_=ge(6),D=M();return L(D.onVideoTap(l,h,f,_))}),F()}if(r&2){M();let t=_e(0);H("item",t)}}function Vn(r,e){if(r&1){let t=xe();P(0,"cooee-video-card",17),Y("linkClicked",function(){N(t);let l=M().$implicit,c=M();return L(c.sendTriggerClicked(l))}),F()}if(r&2){M();let t=_e(1);H("card",t)}}function En(r,e){if(r&1){let t=xe();Ye(0)(1),P(2,"div",4)(3,"div",5),Y("click",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=ge(6),D=M();return L(D.onVideoTap(l,h,f,_))})("keydown.enter",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=ge(6),D=M();return L(D.onVideoTap(l,h,f,_))})("keydown.space",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=ge(6),D=M();return L(D.onVideoTap(l,h,f,_))}),z(4,xn,2,0,"div",6),P(5,"video",7,0),Y("mouseenter",function(){N(t);let l=ge(6);M();let c=_e(1);return L(c&&l.play())})("mouseleave",function(){N(t);let l=ge(6);M();let c=_e(1);return L(c&&l.pause())})("loadstart",function(){let l=N(t).$implicit,c=M();return L(c.onVideoLoadStart(l.id))})("canplay",function(){let l=N(t).$implicit,c=M();return L(c.onVideoCanPlay(l.id))}),te(7,_n,1,3,"source",8,Cn),F(),P(9,"div",9),z(10,wn,1,2,"cooee-mute-toggle",10),F()(),P(11,"div",11),z(12,Tn,1,1,"cooee-item-card",12)(13,Vn,1,1,"cooee-video-card",13),F()()}if(r&2){let t=e.$implicit,o=M(),l=_e(0),c=Ae(t.items[0]);I();let h=Ae(t.card),f=c&&o.videoConfig.footerContent==o.VideoConfigFooterContent.FIRST_ITEM,_=h&&o.videoConfig.footerContent==o.VideoConfigFooterContent.CARD;I(2),Je("background-image",t.thumbnail?"url("+t.thumbnail+")":null),I(),q(o.isVideoLoading(t.id)?4:-1),I(),H("muted",!0),at("preload",l?"metadata":"none")("autoplay",null)("data-video-id",t.id),I(2),ie(t.sources),I(3),q(o.videoConfig.showMuteButton?10:-1),I(2),q(f?12:_?13:-1)}}var _t=class r extends Se{VideoConfigFooterContent=Dt;VideoConfigAutoPlay=Ii;swiperOptions=null;videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),this.hasSwiper=!0}ngAfterViewInit(){super.ngAfterViewInit();let e=this.videoConfig.playlistConfig?.videoSwiper,t=e?(this.isMobile?e.gapSm:e.gap)+"px":window.cooeePlaylistGap??24,o=e?this.isMobile?e.maxInRowSm:e.maxInRow:"auto";this.swiperOptions={direction:"horizontal",effect:"slide",loop:e?.loop,freeMode:!0,spaceBetween:t,slidesPerView:o,mousewheel:{enabled:!0,forceToAxis:!0},autoplay:e?.autoplay?.enabled?{delay:e?.autoplay?.delay,disableOnInteraction:!1}:!1},this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}addToCartClicked(e,t,o,l){let c=t.items?.[0],h=pi.get().website?.canChangeVariantInCart;if(t.items?.length>1||c?.hasVariants()&&!h){this.onVideoTap(e,t,o,l);return}this.engagementService.executeCTA(Ke.ADD_TO_CART,{item:c,video:t})}goToPDP(e,t){e?.stopPropagation(),e?.preventDefault();let o=t.items?.[0];this.engagementService.executeCTA(Ke.GO_TO_PRODUCT,{item:o,video:t})}update(){}isVideoLoading(e){return this.videoLoadingStates.get(e)??!0}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(t=>{let o=t.target,l=o.dataset.videoId;l&&(t.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(o,!0)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(o,!1)))})},{threshold:.5,rootMargin:"50px"}),setTimeout(()=>{this.videoElements.forEach(e=>{this.intersectionObserver?.observe(e.nativeElement)})},100)}handleVideoVisibilityChange(e,t){t?this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(e):e.play().catch(()=>{})):e.pause()}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-video-playlist"]],features:[re(ae()),j],decls:7,vars:6,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options","navigationConfig","paginationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","muted"],[3,"src","type"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(t,o){if(t&1&&(Ye(0)(1),z(2,bn,2,3,"div",1),P(3,"cooee-swiper",2),ti(4,3),te(5,En,14,11,"div",4,yn),ii(),F()),t&2){Ae(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),I(),Ae(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),I(),q(o.videoConfig.heading?2:-1);let l=o.videoConfig.playlistConfig==null?null:o.videoConfig.playlistConfig.videoSwiper;I(),H("options",o.swiperOptions)("navigationConfig",l==null?null:l.navigation)("paginationConfig",l==null?null:l.pagination),I(2),ie(o.videos)}},dependencies:[Fi,Di,Pi,Ai,Ue],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-info{font-size:14px;line-height:normal}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
17
+ `],encapsulation:3})};function Hi(r){r||(r=se(qt));let e=new ot(t=>{if(r.destroyed){t.next();return}return r.onDestroy(t.next.bind(t))});return t=>t.pipe(Ht(e))}var In=r=>({"cursor-grab":r}),Mn=(r,e)=>e.url;function Sn(r,e){if(r&1&&Me(0,"source",7),r&2){let t=e.$implicit;H("type",He(t.mimeType))("src",t.url,Ie)}}var wt=class r extends Se{video;isDragging=!1;hidden=!1;cdkDrag=se(mt,{self:!0});untilDestroyed=Hi();constructor(){super()}get popupClasses(){return this.hidden?["hidden"]:["visible"]}onClick(e){e.stopPropagation(),e.preventDefault(),this.onVideoClick()}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.closest(".letscooee-engagement");e&&(e.style.zIndex="10000"),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=!0)}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.hidden=!0,this.onVideoTap(null,this.video,0)}close(){this.hidden=!0;let e=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent("CE Trigger Closed",{duration:e})}engagementTriggerReceived(e){super.engagementTriggerReceived(e),this.video=this.videos[0]}update(){}onDialogClosed(){this.hidden=!1}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-video-popup"]],hostAttrs:["role","button","tabindex","0","aria-label","Open video popup "],hostVars:3,hostBindings:function(t,o){t&1&&Y("keydown.enter",function(c){return o.onClick(c)})("keydown.space",function(c){return o.onClick(c)})("click",function(c){return o.onClick(c)}),t&2&&(J("cdkDragBoundary","body"),ri(o.popupClasses))},features:[re(ae()),Yt([{directive:mt,inputs:["cdkDragBoundary","cdkDragBoundary"]}]),j],decls:10,vars:4,consts:[[1,"popup-inner",3,"ngClass"],["type","button","aria-label","Close video popup",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"play-button"],["name","unmute","aria-hidden","true"],[1,"text"],["loop","","preload","auto","playsinline","","autoplay","",3,"muted"],[3,"src","type"]],template:function(t,o){t&1&&(P(0,"div",0)(1,"button",1),Y("click",function(c){return c.stopPropagation(),o.close()}),Me(2,"cooee-icon",2),F(),P(3,"div",3),Me(4,"cooee-icon",4),P(5,"div",5),de(6,"Tap to unmute"),F()(),P(7,"video",6),te(8,Sn,1,3,"source",7,Mn),F()()),t&2&&(H("ngClass",ai(2,In,o.isDragging)),I(7),H("muted",!0),I(),ie(o.video.sources))},dependencies:[dt,Vi],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
18
+ `],encapsulation:3})};var kn=(r,e)=>e.id,Pn=(r,e)=>e.url;function Dn(r,e){if(r&1&&(ne(0,"div",0),he(1,"safeHtml")),r&2){let t=M();J("innerHTML",we(1,1,t.videoConfig.heading),le)}}function Fn(r,e){if(r&1&&ne(0,"source",9),r&2){let t=e.$implicit;J("type",He(t.mimeType))("src",t.url,Ie)}}function An(r,e){if(r&1){let t=xe();ce(0,"div",3),ni("click",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=M();return L(_.onVideoTap(l,h,f))})("keydown.enter",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=M();return L(_.onVideoTap(l,h,f))})("keydown.space",function(l){let c=N(t),h=c.$implicit,f=c.$index,_=M();return L(_.onVideoTap(l,h,f))}),Ut(),ce(1,"svg",4),ne(2,"circle",5)(3,"circle",6),fe(),zt(),ce(4,"div",7)(5,"video",8),te(6,Fn,1,3,"source",9,Pn),fe()()()}if(r&2){let t=e.$implicit,o=e.$index;at("aria-label","Open video story "+(o+1)),I(5),J("muted",!0),I(),ie(t.sources)}}var Tt=class r extends Se{constructor(){super()}update(){}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=B({type:r,selectors:[["cooee-video-stories"]],features:[re(ae()),j],decls:4,vars:1,consts:[[1,"heading-text",3,"innerHTML"],[1,"video-stories"],["role","button","tabindex","0",1,"video-story"],["role","button","tabindex","0",1,"video-story",3,"click","keydown.enter","keydown.space"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6",1,"video-story-circle"],[1,"video-wrapper"],["autoplay","","loop","","playsinline","","preload","metadata",3,"muted"],[3,"src","type"]],template:function(t,o){t&1&&(z(0,Dn,2,3,"div",0),ce(1,"div",1),te(2,An,8,2,"div",2,kn),fe()),t&2&&(q(o.videoConfig.heading?0:-1),I(2),ie(o.videos))},dependencies:[Ue],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media (max-width: 768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px}
19
+ `],encapsulation:3})};ui("CooeeWidgetSDK");(async()=>{let r=await di(Oi),e=(t,o)=>{let l=Ri(t,{injector:r.injector});customElements.define(o,l)};e(xt,"cooee-sticky-atc"),e(yt,"cooee-savings-bar"),e(vt,"cooee-progressbar"),e(_t,"cooee-video-playlist"),e(wt,"cooee-video-popup"),e(Tt,"cooee-video-stories"),e(hi,"cooee-product-options-picker"),sessionStorage.cooeeDebug&&import("./debugger.component-E5DA6AOW.js").then(t=>{e(t.DebuggerComponent,"cooee-debugger")}),window.cooeeShowQuickItem=(t,o)=>{r.injector.get(bt).showItemQuickView(t,o)}})();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@letscooee/web-sdk",
3
3
  "description": "Engage uniquely and boost conversions with AI-powered customer journeys driven by real-time intent",
4
- "version": "11.1.0",
4
+ "version": "11.2.1",
5
5
  "scripts": {
6
6
  "lint": "ng lint",
7
7
  "integrity": "./scripts/validate-integrity.sh",