@letscooee/web-sdk 14.8.1 → 14.8.2

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.
@@ -1,6 +1,6 @@
1
1
  import './main.min.js';
2
- import { m as g, W, G as Ge, K as Ke, c as cf, y as ye, X as Xa, g as gv, n as ec, o as Nf, C as Cf } from './widgets-DEkPTYjN-BbY8nZ9i.js';
3
- import { l, f } from './video-detail-dialog.component-B40xi2X7-Dl8Eur82.js';
2
+ import { m as g, W, G as Ge, K as Ke, c as cf, y as ye, X as Xa, g as gv, n as ec, o as Nf, C as Cf } from './widgets-DzNSeZS7-Cp6QSkhN.js';
3
+ import { l, f } from './video-detail-dialog.component-DPuSEux7-3AFSfkG7.js';
4
4
 
5
5
  var _=class d{dialogRef=g(W);eventData=g(Ge);triggerData=g(Ke)().triggerData;onShareAndClose(p,o){p.stopPropagation();let{url:t,text:a}=l(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;}o&&f(this.triggerData,this.eventData.video,this.eventData.index,o),this.dialogRef.close();}static ɵfac=function(o){return new(o||d)};static ɵcmp=cf({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&&(Xa(0,`div`,0)(1,`div`,1)(2,`h3`),gv(3,`Share`),ec(),Xa(4,`button`,2),Nf(`click`,function(e){return t.onShareAndClose(e)}),Cf(5,`cooee-icon`,3),ec()(),Xa(6,`div`,4)(7,`button`,5),Nf(`click`,function(e){return t.onShareAndClose(e,`Whatsapp`)}),Cf(8,`cooee-icon`,6),Xa(9,`span`),gv(10,`Whatsapp`),ec()(),Xa(11,`button`,7),Nf(`click`,function(e){return t.onShareAndClose(e,`X(Twitter)`)}),Cf(12,`cooee-icon`,8),Xa(13,`span`),gv(14,`X`),ec()(),Xa(15,`button`,9),Nf(`click`,function(e){return t.onShareAndClose(e,`Clipboard`)}),Cf(16,`cooee-icon`,10),Xa(17,`span`),gv(18,`Copy link`),ec()()()());},dependencies:[ye],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}`]})};
6
6
 
@@ -1,14 +1,14 @@
1
1
  import { I as Ir, V as Ve, H as He, s as se, M, t, D as Dr, l as l$1, O, a as Vi, c as ce, Y, b as V } from './main.min.js';
2
- import { L as Lt, m as g, p as Ye, S as Se$1, G as Ge, W, c as cf, r as Wt, s as Gt, z as zt, x as xE, u as AE, $ as $t, U as Ut, y as ye, X as Xa, o as Nf, v as nc, N as ND, w as Yo, n as ec, B as pf, D as zD, E as Ef, f as fd, e as AD, H as oc, I as kf, J as Ff, O as oN, P as Ro, K as Ke, Q as zt$1, C as Cf, i as iN, T as ws, q as qo, t as tc, Z as Zo, V as ic, _ as vf, a0 as FD, a1 as TD, a2 as gu, a3 as mu, a4 as VD, a5 as SD, a6 as wf, a7 as Cv, a8 as Kf, a9 as Qf, aa as Dv, ab as xv, ac as rm } from './widgets-DEkPTYjN-BbY8nZ9i.js';
2
+ import { L as Lt, m as g, p as Ye, S as Se$1, G as Ge, W, c as cf, r as Wt, s as Gt, z as zt, x as xE, u as AE, $ as $t, U as Ut, y as ye, X as Xa, o as Nf, v as nc, N as ND, w as Yo, n as ec, B as pf, D as zD, E as Ef, f as fd, e as AD, H as oc, I as kf, J as Ff, O as oN, P as Ro, K as Ke, Q as zt$1, C as Cf, i as iN, T as ws, q as qo, t as tc, Z as Zo, V as ic, _ as vf, a0 as FD, a1 as TD, a2 as gu, a3 as mu, a4 as VD, a5 as SD, a6 as wf, a7 as Cv, a8 as Kf, a9 as Qf, aa as Dv, ab as xv, ac as rm } from './widgets-DzNSeZS7-Cp6QSkhN.js';
3
3
 
4
4
  var f=(t,e,o,r)=>{if(!e)return;let i=new Ir(`CE Video Shared`,{current:{videoID:e.id,videoIndex:o},platform:r},t);window.CooeeSDK.sendEvent(i);},l=(t,e,o=true)=>{let r=o?encodeURIComponent(m(t,e)):m(t,e),n=`Hey! Check out this video for an amazing product -`;return {url:r,text:o?encodeURIComponent(n):n}},m=(t,e)=>{return Ve(He(window.location.href,t),e)};
5
5
 
6
- var S=class n{video=iN.required();progress=Lt(0);constructor(){ws(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100);};e.addEventListener(`timeupdate`,i),t(()=>{e.removeEventListener(`timeupdate`,i);});});}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({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&&(qo(0,`div`,0)(1,`div`,1),tc(2,`div`),Zo()()),e&2&&(fd(),ic(`width`,i.progress(),`%`),vf(`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 P=class n{dialogState=oN();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(zt$1);async share(t){t.stopPropagation(),t.preventDefault(),M()&&V()?await this.shareNative():await this.shareWithDialog();}async shareNative(){let t=l(this.triggerData,this.eventData.video,false);await navigator.share(t),f(this.triggerData,this.eventData.video,this.eventData.index,`Native`);}async shareWithDialog(){let t=await import('./share-dialog.component-BTyg3HVy-B6S-IH-D.js');this.dialogState.emit(true),this.dialog.open(t.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(false));}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({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&&(Xa(0,`button`,0),Nf(`click`,function(r){return i.share(r)}),Cf(1,`cooee-icon`,1),ec());},dependencies:[ye],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 Te=[`swiperComp`],Ie=[`videoEl`],Se=(n,t)=>t.video.id,Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Xa(0,`div`,11),Cf(1,`div`,15),ec());}function Me(n,t){if(n&1&&Cf(0,`source`,13),n&2){let e=t.$implicit;Ef(`type`,Cv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&wf(0);}function Ne(n,t){if(n&1){let e=FD();Xa(0,`cooee-video-promoted-items`,24),Nf(`cardClick`,function(o){gu(e);let r=VD(2).$implicit;return mu(VD().productCardClicked(o,r.video))}),ec();}if(n&2){let e=VD(2).$implicit;Ef(`items`,e.video.items);}}function ze(n,t){if(n&1&&Cf(0,`cooee-video-card`,23),n&2){let e=VD(2).$implicit;Ef(`card`,e.video.card);}}function Fe(n,t){if(n&1){let e=FD();Cf(0,`cooee-video-progress-bar`,16),Xa(1,`div`,17)(2,`cooee-mute-toggle`,18),Kf(`mutedChange`,function(o){gu(e);let r=VD(2);return Dv(r.muted,o)||(r.muted=o),mu(o)}),Nf(`toggled`,function(){gu(e);return mu(VD(2).muteToggled())}),ec(),pf(3,Oe,1,0,`ng-container`,8),ec(),Xa(4,`div`,19)(5,`cooee-share-button`,20),Nf(`dialogState`,function(o){gu(e);return mu(VD(2).shareDialogOpen.set(o))}),ec()(),Xa(6,`div`,21),TD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),ec();}if(n&2){let e=VD().$implicit,i=zD(5),o=VD(),r=zD(9);Ef(`video`,i),fd(2),Qf(`muted`,o.muted),Ef(`videoEl`,i),fd(),Ef(`ngTemplateOutlet`,r),fd(4),SD(e.video.items.length&&o.videoConfig.showItems()?7:e.video.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=FD();Xa(0,`cooee-item-detail`,25),Nf(`closeClick`,function(){gu(e);return mu(VD(2).productModalClosed())}),ec();}if(n&2){let e=VD(2);Ef(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=FD();Xa(0,`div`,6)(1,`div`,9)(2,`div`,10),TD(3,ke,2,0,`div`,11),Xa(4,`video`,12,2),Nf(`click`,function(){let o=gu(e).$index,r=VD();return mu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){gu(e);let o=zD(5);return mu(VD().onVideoEnded(o))})(`loadstart`,function(){let o=gu(e).$index;return mu(VD().onVideoLoadStart(o))})(`canplay`,function(){let o=gu(e).$index;return mu(VD().onVideoCanPlay(o))}),ND(6,Me,1,3,`source`,13,Pe),ec(),TD(8,Fe,9,5),ec(),TD(9,Le,1,3,`cooee-item-detail`,14),ec()();}if(n&2){let e=t.$implicit,i=t.$index,o=VD();fd(2),ic(`background-image`,e.video.thumbnail?`url(`+e.video.thumbnail+`)`:null),fd(),SD(o.shouldShowVideoSpinner(i)?3:-1),fd(),Ef(`ngClass`,o.viewTemplateClassName)(`muted`,true),vf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.video.id)(`autoplay`,null),fd(2),AD(e.video.sources),fd(2),SD(o.currentIndex===i?8:-1),fd(),SD(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&wf(0);}function Be(n,t){if(n&1){let e=FD();Xa(0,`button`,26),Nf(`click`,function(){gu(e);return mu(VD().close())}),Cf(1,`cooee-icon`,27),ec();}}var Ee=class n{swiperComponent;videoElements;VideoConfigFooterContent=se;currentIndex=0;muted=Lt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Lt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Lt(false);swiperOptions=Lt(null);videoEntries=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new t(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videoEntries=this.data.videoEntries,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videoEntries[this.currentIndex]?.video,this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new Dr,this.navigationConfig=new l$1({enabled:true,size:50,color:new O({h:`#000000`})}),this.cssLoadedPromise=Vi(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await ce.get(`muted`,false)),this.videoConfig.detailPopup.template){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(),this.playActiveVideo(false);}close(){let t=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videoEntries[this.currentIndex].video,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 ce.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(t=true){t&&this.pauseAll();let e=this.getCurrentVideoElement();e&&this.playVideo(e);}playVideo(t){t.currentTime=0,t.play().catch(e=>Y.error(e));}onVideoEnded(t){if(this.currentIndex<this.videoEntries.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(t):this.moveToNextVideo();else {let i=[`CE Last Video Ended`,{previous:this.getPreviousVideoDataForEvent()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t);}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.selectedVideo=this.videoEntries[this.currentIndex].video,this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let r=new Ir(`CE Video Changed`,{previous:e,current:this.currentVideoProps()},this.engagementTrigger);r.setVideos(this.videoEntries[this.currentIndex].video),window.CooeeSDK.sendEvent(r);}productCardClicked(t,e){let o=new Ir(`CE More Item Info Clicked`,{current:{videoID:e.id,videoIndex:this.currentIndex}},this.engagementTrigger);o.setVideos(e),window.CooeeSDK.sendEvent(o),this.selectedItem=t;}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===true&&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:true,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:false},on:{init:i=>{this.swiperInitialized.set(true),setTimeout(()=>{i.update();},100);}},mousewheel:{enabled:!this.isMobile,invert:false,thresholdDelta:20}});}isProductDetailView(){return this.videoConfig.detailPopup.template===`PRODUCT_DETAIL_VIEW`}currentVideoProps(){return {videoID:this.videoEntries[this.currentIndex].video.id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videoEntries[this.currentIndex].video.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.videoEntries.map(u=>u.video.sources?.[0]).filter(u=>u?.width&&u?.height).map(u=>({width:u.width,height:u.height,aspectRatio:u.width/u.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,k=o/e.height,A=Math.min(r,k);return {width:Math.floor(e.width*A),height:Math.floor(e.height*A)}}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 ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&oc(Te,7)(Ie,5),e&2){let o;kf(o=Ff())&&(i.swiperComponent=o.first),kf(o=Ff())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Nf(`keydown.escape`,function(r){return i.onKeyDown(r)},rm);},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`,`muted`],[3,`src`,`type`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`item`,`similarItems`,`template`],[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`,`template`],[`type`,`button`,`aria-label`,`Close`,1,`lc-close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`]],template:function(e,i){if(e&1&&(Xa(0,`div`,3)(1,`cooee-swiper`,4,0),Nf(`slideChange`,function(r){return i.onSlideChange(r)}),nc(3,5),ND(4,Re,10,10,`div`,6,Se),Yo(),ec(),Xa(6,`div`,7),pf(7,Ae,1,0,`ng-container`,8),ec()(),pf(8,Be,2,0,`ng-template`,null,1,xv)),e&2){let o=zD(9);Ef(`ngClass`,i.viewTemplateClassName),fd(),Ef(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),fd(3),AD(i.videoEntries),fd(3),Ef(`ngTemplateOutlet`,o);}},dependencies:[Wt,Gt,zt,P,S,xE,AE,$t,Ut,ye],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%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media(max-width:768px){.video-swiper>.swiper-button-prev{display:none!important}}@media(max-width:768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;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);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.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}
6
+ var S=class n{video=iN.required();progress=Lt(0);constructor(){ws(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100);};e.addEventListener(`timeupdate`,i),t(()=>{e.removeEventListener(`timeupdate`,i);});});}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({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&&(qo(0,`div`,0)(1,`div`,1),tc(2,`div`),Zo()()),e&2&&(fd(),ic(`width`,i.progress(),`%`),vf(`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 P=class n{dialogState=oN();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(zt$1);async share(t){t.stopPropagation(),t.preventDefault(),M()&&V()?await this.shareNative():await this.shareWithDialog();}async shareNative(){let t=l(this.triggerData,this.eventData.video,false);await navigator.share(t),f(this.triggerData,this.eventData.video,this.eventData.index,`Native`);}async shareWithDialog(){let t=await import('./share-dialog.component-DCRMOwnf-HaukMvzU.js');this.dialogState.emit(true),this.dialog.open(t.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(false));}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({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&&(Xa(0,`button`,0),Nf(`click`,function(r){return i.share(r)}),Cf(1,`cooee-icon`,1),ec());},dependencies:[ye],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 Te=[`swiperComp`],Ie=[`videoEl`],Se=(n,t)=>t.video.id,Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Xa(0,`div`,11),Cf(1,`div`,15),ec());}function Me(n,t){if(n&1&&Cf(0,`source`,13),n&2){let e=t.$implicit;Ef(`type`,Cv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&wf(0);}function Ne(n,t){if(n&1){let e=FD();Xa(0,`cooee-video-promoted-items`,24),Nf(`cardClick`,function(o){gu(e);let r=VD(2).$implicit;return mu(VD().productCardClicked(o,r.video))}),ec();}if(n&2){let e=VD(2).$implicit;Ef(`items`,e.video.items);}}function ze(n,t){if(n&1&&Cf(0,`cooee-video-card`,23),n&2){let e=VD(2).$implicit;Ef(`card`,e.video.card);}}function Fe(n,t){if(n&1){let e=FD();Cf(0,`cooee-video-progress-bar`,16),Xa(1,`div`,17)(2,`cooee-mute-toggle`,18),Kf(`mutedChange`,function(o){gu(e);let r=VD(2);return Dv(r.muted,o)||(r.muted=o),mu(o)}),Nf(`toggled`,function(){gu(e);return mu(VD(2).muteToggled())}),ec(),pf(3,Oe,1,0,`ng-container`,8),ec(),Xa(4,`div`,19)(5,`cooee-share-button`,20),Nf(`dialogState`,function(o){gu(e);return mu(VD(2).shareDialogOpen.set(o))}),ec()(),Xa(6,`div`,21),TD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),ec();}if(n&2){let e=VD().$implicit,i=zD(5),o=VD(),r=zD(9);Ef(`video`,i),fd(2),Qf(`muted`,o.muted),Ef(`videoEl`,i),fd(),Ef(`ngTemplateOutlet`,r),fd(4),SD(e.video.items.length&&o.videoConfig.showItems()?7:e.video.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=FD();Xa(0,`cooee-item-detail`,25),Nf(`closeClick`,function(){gu(e);return mu(VD(2).productModalClosed())}),ec();}if(n&2){let e=VD(2);Ef(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=FD();Xa(0,`div`,6)(1,`div`,9)(2,`div`,10),TD(3,ke,2,0,`div`,11),Xa(4,`video`,12,2),Nf(`click`,function(){let o=gu(e).$index,r=VD();return mu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){gu(e);let o=zD(5);return mu(VD().onVideoEnded(o))})(`loadstart`,function(){let o=gu(e).$index;return mu(VD().onVideoLoadStart(o))})(`canplay`,function(){let o=gu(e).$index;return mu(VD().onVideoCanPlay(o))}),ND(6,Me,1,3,`source`,13,Pe),ec(),TD(8,Fe,9,5),ec(),TD(9,Le,1,3,`cooee-item-detail`,14),ec()();}if(n&2){let e=t.$implicit,i=t.$index,o=VD();fd(2),ic(`background-image`,e.video.thumbnail?`url(`+e.video.thumbnail+`)`:null),fd(),SD(o.shouldShowVideoSpinner(i)?3:-1),fd(),Ef(`ngClass`,o.viewTemplateClassName)(`muted`,true),vf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.video.id)(`autoplay`,null),fd(2),AD(e.video.sources),fd(2),SD(o.currentIndex===i?8:-1),fd(),SD(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&wf(0);}function Be(n,t){if(n&1){let e=FD();Xa(0,`button`,26),Nf(`click`,function(){gu(e);return mu(VD().close())}),Cf(1,`cooee-icon`,27),ec();}}var Ee=class n{swiperComponent;videoElements;VideoConfigFooterContent=se;currentIndex=0;muted=Lt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Lt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Lt(false);swiperOptions=Lt(null);videoEntries=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new t(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videoEntries=this.data.videoEntries,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videoEntries[this.currentIndex]?.video,this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new Dr,this.navigationConfig=new l$1({enabled:true,size:50,color:new O({h:`#000000`})}),this.cssLoadedPromise=Vi(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await ce.get(`muted`,false)),this.videoConfig.detailPopup.template){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(),this.playActiveVideo(false);}close(){let t=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videoEntries[this.currentIndex].video,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 ce.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(t=true){t&&this.pauseAll();let e=this.getCurrentVideoElement();e&&this.playVideo(e);}playVideo(t){t.currentTime=0,t.play().catch(e=>Y.error(e));}onVideoEnded(t){if(this.currentIndex<this.videoEntries.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(t):this.moveToNextVideo();else {let i=[`CE Last Video Ended`,{previous:this.getPreviousVideoDataForEvent()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t);}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.selectedVideo=this.videoEntries[this.currentIndex].video,this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let r=new Ir(`CE Video Changed`,{previous:e,current:this.currentVideoProps()},this.engagementTrigger);r.setVideos(this.videoEntries[this.currentIndex].video),window.CooeeSDK.sendEvent(r);}productCardClicked(t,e){let o=new Ir(`CE More Item Info Clicked`,{current:{videoID:e.id,videoIndex:this.currentIndex}},this.engagementTrigger);o.setVideos(e),window.CooeeSDK.sendEvent(o),this.selectedItem=t;}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===true&&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:true,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:false},on:{init:i=>{this.swiperInitialized.set(true),setTimeout(()=>{i.update();},100);}},mousewheel:{enabled:!this.isMobile,invert:false,thresholdDelta:20}});}isProductDetailView(){return this.videoConfig.detailPopup.template===`PRODUCT_DETAIL_VIEW`}currentVideoProps(){return {videoID:this.videoEntries[this.currentIndex].video.id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videoEntries[this.currentIndex].video.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.videoEntries.map(u=>u.video.sources?.[0]).filter(u=>u?.width&&u?.height).map(u=>({width:u.width,height:u.height,aspectRatio:u.width/u.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,k=o/e.height,A=Math.min(r,k);return {width:Math.floor(e.width*A),height:Math.floor(e.height*A)}}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 ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&oc(Te,7)(Ie,5),e&2){let o;kf(o=Ff())&&(i.swiperComponent=o.first),kf(o=Ff())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Nf(`keydown.escape`,function(r){return i.onKeyDown(r)},rm);},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`,`muted`],[3,`src`,`type`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`item`,`similarItems`,`template`],[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`,`template`],[`type`,`button`,`aria-label`,`Close`,1,`lc-close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`]],template:function(e,i){if(e&1&&(Xa(0,`div`,3)(1,`cooee-swiper`,4,0),Nf(`slideChange`,function(r){return i.onSlideChange(r)}),nc(3,5),ND(4,Re,10,10,`div`,6,Se),Yo(),ec(),Xa(6,`div`,7),pf(7,Ae,1,0,`ng-container`,8),ec()(),pf(8,Be,2,0,`ng-template`,null,1,xv)),e&2){let o=zD(9);Ef(`ngClass`,i.viewTemplateClassName),fd(),Ef(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),fd(3),AD(i.videoEntries),fd(3),Ef(`ngTemplateOutlet`,o);}},dependencies:[Wt,Gt,zt,P,S,xE,AE,$t,Ut,ye],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%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media(max-width:768px){.video-swiper>.swiper-button-prev{display:none!important}}@media(max-width:768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;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);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.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}
7
7
  `],encapsulation:3})};
8
8
 
9
- var videoDetailDialog_componentB40xi2X7 = /*#__PURE__*/Object.freeze({
9
+ var videoDetailDialog_componentDPuSEux7 = /*#__PURE__*/Object.freeze({
10
10
  __proto__: null,
11
11
  VideoDetailDialogComponent: Ee
12
12
  });
13
13
 
14
- export { f, l, videoDetailDialog_componentB40xi2X7 as v };
14
+ export { f, l, videoDetailDialog_componentDPuSEux7 as v };
@@ -22,7 +22,7 @@ var Zt=(()=>{class t{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};const
22
22
  style="background-color: ${o?.color?.rgba};">
23
23
  </span>
24
24
  `};this.swiperInstance=new window.CooeeSDK.Swiper(e,r({navigation:i,pagination:a},this.options())),this.swiperInstance.on(`slideChange`,l=>{this.slideChange.emit(l);});}onResize(){this.swiperInstance?(Y$1.verbose(`Updating swiper`),this.swiperInstance.update()):(Y$1.verbose(`Reinitialising swiper`),this.reInitSwiper());}reInitSwiper(){this.initToken++;let n=this.initToken;this.swiperInstance?.destroy?.(),this.swiperInstance=void 0,this.initSwiper(n);}static ɵfac=function(e){return new(e||t$2)};static ɵcmp=cf({type:t$2,selectors:[[`cooee-swiper`]],hostAttrs:[1,`swiper`],inputs:{options:[1,`options`],navigationConfig:[1,`navigationConfig`],paginationConfig:[1,`paginationConfig`]},outputs:{slideChange:`slideChange`},ngContentSelectors:ni,decls:4,vars:2,consts:[[1,`swiper-wrapper`],[1,`swiper-pagination`,3,`style`],[1,`swiper-button-prev`],[1,`swiper-button-next`],[1,`swiper-pagination`]],template:function(e,i){if(e&1&&(xf(ti),qo(0,`div`,0),Of(1),Zo(),TD(2,ri,4,7),TD(3,ai,2,4,`div`,1)),e&2){let o,a;fd(2),SD((o=i.navigationConfig())!=null&&o.enabled?2:-1),fd(),SD((a=i.paginationConfig())!=null&&a.enabled?3:-1);}},styles:[`:host{display:block}.swiper-wrapper{scrollbar-width:none}.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-wrapper{display:flex}.swiper .swiper-button-prev,.swiper .swiper-button-next{background:rgba(var(--lc-icon-button-bg-color));width:var(--lc-icon-button-size);height:var(--lc-icon-button-size);border-radius:100%}.swiper .swiper-button-prev:after,.swiper .swiper-button-next:after{font-size:20px;color:rgba(var(--lc-icon-button-color))}
25
- `],encapsulation:2})};function si(t,n){if(t&1&&(qo(0,`span`,1),gv(1),Zo()),t&2){VD();let e=Ev(0);fd(),Yf(e.heading);}}function li(t,n){if(t&1&&(qo(0,`span`,2),gv(1),Zo()),t&2){VD();let e=Ev(0);fd(),Yf(e.subHeading);}}var $t=class t{card=iN.required();linkClicked=oN();linkAfterSanity(){return this.card()?.buttonLink?.startsWith(`https`)?this.card().buttonLink:null}clickLink(n){n.stopPropagation(),this.linkClicked.emit();}static ɵfac=function(e){return new(e||t)};static ɵcmp=cf({type:t,selectors:[[`cooee-video-card`]],inputs:{card:[1,`card`]},outputs:{linkClicked:`linkClicked`},decls:6,vars:6,consts:[[1,`video-card-details`],[1,`heading`],[1,`subheading`],[`rel`,`noopener noreferrer`,1,`cta-button`,3,`click`,`href`,`target`]],template:function(e,i){if(e&1&&(Xf(0),qo(1,`div`,0),TD(2,si,2,1,`span`,1),TD(3,li,2,1,`span`,2),qo(4,`a`,3),Af(`click`,function(a){return i.clickLink(a)}),gv(5),Zo()()),e&2){let o=vv(i.card());fd(2),SD(o!=null&&o.heading?2:-1),fd(),SD(o!=null&&o.subHeading?3:-1),fd(),Mf(`href`,i.linkAfterSanity(),nm)(`target`,o.newTab?`_blank`:`_self`),fd(),ac(` `,o==null?null:o.buttonTitle,` `);}},styles:[`[_nghost-%COMP%]{display:block}.video-card-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3.75px;font-size:14px;line-height:normal}.video-card-details[_ngcontent-%COMP%] .cta-button[_ngcontent-%COMP%]{text-align:center;background-color:#fff;border-radius:var(--lc-button-radius);padding:7.5px 15px;font-weight:var(--lc-primary-button-weight);color:rgba(var(--lc-primary-button-bg-color));font-size:var(--lc-button-size);border-width:var(--lc-primary-button-border-width, 0);text-decoration:none}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%], .video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{text-align:start;color:#000;font-weight:600;overflow:hidden}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%]{font-size:18px}.video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{font-size:16px}`],changeDetection:0})};function ci(t,n){t&1&&Cf(0,`cooee-icon`,1);}function di(t,n){t&1&&Cf(0,`cooee-icon`,2);}var zt=class t{muted=aN.required();videoEl=iN.required();toggled=oN();constructor(){ws(()=>{this.videoEl().muted=this.muted(),this.muted()||this.videoEl().play();});}toggle(n){n.stopPropagation(),n.preventDefault(),this.muted.update(e=>!e),this.toggled.emit(this.muted());}static ɵfac=function(e){return new(e||t)};static ɵcmp=cf({type:t,selectors:[[`cooee-mute-toggle`]],inputs:{muted:[1,`muted`],videoEl:[1,`videoEl`]},outputs:{muted:`mutedChange`,toggled:`toggled`},decls:3,vars:5,consts:[[`type`,`button`,3,`click`],[`name`,`unmute`],[`name`,`mute`]],template:function(e,i){e&1&&(Xa(0,`button`,0),Nf(`click`,function(a){return i.toggle(a)}),TD(1,ci,1,0,`cooee-icon`,1)(2,di,1,0,`cooee-icon`,2),ec()),e&2&&(sc(`unmute`,!i.muted()),vf(`aria-label`,i.muted()?`Unmute video`:`Mute video`)(`aria-pressed`,i.muted()),fd(),SD(i.muted()?1:2));},dependencies:[ye$1],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)}`]})};var ui=[`swiperContainer`],pi=(t,n)=>n.id;function mi(t,n){if(t&1){let e=FD();Xa(0,`div`,3)(1,`cooee-item-card`,4),Nf(`buttonClick`,function(o){gu(e);return mu(VD().onButtonClick(o))})(`click`,function(){let o=gu(e).$implicit;return mu(VD().cardClick.emit(o))}),ec()();}if(t&2){let e=n.$implicit;fd(),Ef(`item`,e);}}var Wt=class t{items=iN.required();centeredSlides=iN(true);cardClick=oN();destroyRef=g(ze);elementRef=g(Se$1);engagementService=g(B);swiperContainerRef=sN.required(`swiperContainer`);swiperInstance;constructor(){ws(()=>{this.swiperContainerRef()&&this.initSwiper();}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy();});}ngOnInit(){Vi$1(this.elementRef.nativeElement.shadowRoot);}onButtonClick(n){let e=he$3.get().website?.canChangeVariantInCart;if(this.items()?.length>1||n.hasVariants()&&!e){this.cardClick.emit(n);return}this.engagementService.executeCTA(he$2.ADD_TO_CART,{item:n});}async initSwiper(){await Mi$1(),this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:`horizontal`,effect:`slide`,slidesPerView:1.2,nested:true,centeredSlides:this.centeredSlides(),spaceBetween:12,mousewheel:{enabled:true,thresholdDelta:10,thresholdTime:200}});}static ɵfac=function(e){return new(e||t)};static ɵcmp=cf({type:t,selectors:[[`cooee-video-promoted-items`]],viewQuery:function(e,i){e&1&&Lf(i.swiperContainerRef,ui,5),e&2&&UD();},hostAttrs:[1,`letscooee-widget`],inputs:{items:[1,`items`],centeredSlides:[1,`centeredSlides`]},outputs:{cardClick:`cardClick`},features:[np([B])],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&&(Xa(0,`div`,1,0)(2,`div`,2),ND(3,mi,2,1,`div`,3,pi),ec()()),e&2&&(fd(3),AD(i.items()));},dependencies:[me],styles:[`[_nghost-%COMP%]{display:block;width:100%}cooee-item-card[_ngcontent-%COMP%]{-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)}`]})};
25
+ `],encapsulation:2})};function si(t,n){if(t&1&&(qo(0,`span`,1),gv(1),Zo()),t&2){VD();let e=Ev(0);fd(),Yf(e.heading);}}function li(t,n){if(t&1&&(qo(0,`span`,2),gv(1),Zo()),t&2){VD();let e=Ev(0);fd(),Yf(e.subHeading);}}var $t=class t{card=iN.required();linkClicked=oN();linkAfterSanity(){return this.card()?.buttonLink?.startsWith(`https`)?this.card().buttonLink:null}clickLink(n){n.stopPropagation(),this.linkClicked.emit();}static ɵfac=function(e){return new(e||t)};static ɵcmp=cf({type:t,selectors:[[`cooee-video-card`]],inputs:{card:[1,`card`]},outputs:{linkClicked:`linkClicked`},decls:6,vars:6,consts:[[1,`video-card-details`],[1,`heading`],[1,`subheading`],[`rel`,`noopener noreferrer`,1,`cta-button`,3,`click`,`href`,`target`]],template:function(e,i){if(e&1&&(Xf(0),qo(1,`div`,0),TD(2,si,2,1,`span`,1),TD(3,li,2,1,`span`,2),qo(4,`a`,3),Af(`click`,function(a){return i.clickLink(a)}),gv(5),Zo()()),e&2){let o=vv(i.card());fd(2),SD(o!=null&&o.heading?2:-1),fd(),SD(o!=null&&o.subHeading?3:-1),fd(),Mf(`href`,i.linkAfterSanity(),nm)(`target`,o.newTab?`_blank`:`_self`),fd(),ac(` `,o==null?null:o.buttonTitle,` `);}},styles:[`[_nghost-%COMP%]{display:block}.video-card-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3.75px;font-size:14px;line-height:normal}.video-card-details[_ngcontent-%COMP%] .cta-button[_ngcontent-%COMP%]{text-align:center;background-color:#fff;border-radius:var(--lc-button-radius);padding:7.5px 15px;font-weight:var(--lc-primary-button-weight);color:rgba(var(--lc-primary-button-bg-color));font-size:var(--lc-button-size);border-width:var(--lc-primary-button-border-width, 0);text-decoration:none}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%], .video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{text-align:start;color:#000;font-weight:600;overflow:hidden}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%]{font-size:18px}.video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{font-size:16px}`],changeDetection:0})};function ci(t,n){t&1&&Cf(0,`cooee-icon`,1);}function di(t,n){t&1&&Cf(0,`cooee-icon`,2);}var zt=class t{muted=aN.required();videoEl=iN.required();toggled=oN();constructor(){ws(()=>{this.videoEl().muted=this.muted(),this.muted()||this.videoEl().play();});}toggle(n){n.stopPropagation(),n.preventDefault(),this.muted.update(e=>!e),this.toggled.emit(this.muted());}static ɵfac=function(e){return new(e||t)};static ɵcmp=cf({type:t,selectors:[[`cooee-mute-toggle`]],inputs:{muted:[1,`muted`],videoEl:[1,`videoEl`]},outputs:{muted:`mutedChange`,toggled:`toggled`},decls:3,vars:5,consts:[[`type`,`button`,3,`click`],[`name`,`unmute`],[`name`,`mute`]],template:function(e,i){e&1&&(Xa(0,`button`,0),Nf(`click`,function(a){return i.toggle(a)}),TD(1,ci,1,0,`cooee-icon`,1)(2,di,1,0,`cooee-icon`,2),ec()),e&2&&(sc(`unmute`,!i.muted()),vf(`aria-label`,i.muted()?`Unmute video`:`Mute video`)(`aria-pressed`,i.muted()),fd(),SD(i.muted()?1:2));},dependencies:[ye$1],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)}`]})};var ui=[`swiperContainer`],pi=(t,n)=>n.id;function mi(t,n){if(t&1){let e=FD();Xa(0,`div`,3)(1,`cooee-item-card`,4),Nf(`buttonClick`,function(o){gu(e);return mu(VD().onButtonClick(o))})(`click`,function(){let o=gu(e).$implicit;return mu(VD().cardClick.emit(o))}),ec()();}if(t&2){let e=n.$implicit;fd(),Ef(`item`,e);}}var Wt=class t{items=iN.required();centeredSlides=iN(true);cardClick=oN();destroyRef=g(ze);elementRef=g(Se$1);engagementService=g(B);swiperContainerRef=sN.required(`swiperContainer`);swiperInstance;constructor(){ws(()=>{this.swiperContainerRef()&&this.initSwiper();}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy();});}ngOnInit(){Vi$1(this.elementRef.nativeElement.shadowRoot);}onButtonClick(n){let e=he$3.get().website?.canChangeVariantInCart;if(this.items()?.length>1||n.hasVariants()&&!e){this.cardClick.emit(n);return}this.engagementService.executeCTA(he$2.ADD_TO_CART,{item:n});}async initSwiper(){await Mi$1(),this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:`horizontal`,effect:`slide`,slidesPerView:1.2,nested:true,centeredSlides:this.centeredSlides(),spaceBetween:12,mousewheel:{enabled:true,thresholdDelta:10,thresholdTime:200}});}static ɵfac=function(e){return new(e||t)};static ɵcmp=cf({type:t,selectors:[[`cooee-video-promoted-items`]],viewQuery:function(e,i){e&1&&Lf(i.swiperContainerRef,ui,5),e&2&&UD();},hostAttrs:[1,`letscooee-widget`],inputs:{items:[1,`items`],centeredSlides:[1,`centeredSlides`]},outputs:{cardClick:`cardClick`},features:[np([B])],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&&(Xa(0,`div`,1,0)(2,`div`,2),ND(3,mi,2,1,`div`,3,pi),ec()()),e&2&&(fd(3),AD(i.items()));},dependencies:[me],styles:[`[_nghost-%COMP%]{display:block;width:100%}cooee-item-card[_ngcontent-%COMP%]{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:rgb(var(--lc-card-bg-color)/var(--lc-card-bg-opacity, 1));cursor:pointer;border-radius:var(--lc-card-radius)}`]})};
26
26
 
27
27
  var rn={schedule(n,t){let e=setTimeout(n,t);return ()=>clearTimeout(e)}};function an(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function sn(n){return !!n&&n.nodeType===Node.ELEMENT_NODE}var ut;function ln(n,t){if(!ut){let e=Element.prototype;ut=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;}return n.nodeType===Node.ELEMENT_NODE?ut.call(n,t):false}function cn(n){let t={};return n.forEach(({propName:e,templateName:i,transform:o})=>{t[an(i)]=[e,o];}),t}function dn(n,t){return t.get(zo).resolveComponentFactory(n).inputs}function pn(n,t){let e=n.childNodes,i=t.map(()=>[]),o=-1;t.some((a,l)=>a===`*`?(o=l,true):false);for(let a=0,l=e.length;a<l;++a){let p=e[a],f=mn(p,t,o);f!==-1&&i[f].push(p);}return i}function mn(n,t,e){let i=e;return sn(n)&&t.some((o,a)=>o!==`*`&&ln(n,o)?(i=a,true):false),i}var un=10,ft=class{componentFactory;inputMap=new Map;constructor(t,e){this.componentFactory=e.get(zo).resolveComponentFactory(t);for(let i of this.componentFactory.inputs)this.inputMap.set(i.propName,i.templateName);}create(t){return new gt(this.componentFactory,t,this.inputMap)}},gt=class{componentFactory;injector;inputMap;eventEmitters=new gr$1(1);events=this.eventEmitters.pipe(ii$2(t=>ve$2(...t)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(t,e,i){this.componentFactory=t,this.injector=e,this.inputMap=i,this.ngZone=this.injector.get(X),this.appRef=this.injector.get(ht$1),this.cdScheduler=e.get(at),this.elementZone=typeof Zone>`u`?null:this.ngZone.run(()=>Zone.current);}connect(t){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(t);});}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=rn.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null);},un));});}getInputValue(t){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,e){if(this.componentRef===null){this.initialInputValues.set(t,e);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(t)??t,e),py(this.componentRef.hostView)&&(hy(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6));});}initializeComponent(t){let e=Z.create({providers:[],parent:this.injector}),i=pn(t,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(e,i,t),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges();}initializeInputs(){for(let[t,e]of this.initialInputValues)this.setInputValue(t,e);this.initialInputValues.clear();}initializeOutputs(t){let e=this.componentFactory.outputs.map(({propName:i,templateName:o})=>{let a=t.instance[i];return new m$1(l=>{let p=a.subscribe(f=>l.next({name:o,value:f}));return ()=>p.unsubscribe()})});this.eventEmitters.next(e);}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}},vt=class extends HTMLElement{ngElementEventsSubscription=null};function Ii(n,t){let e=dn(n,t.injector),i=t.strategyFactory||new ft(n,t.injector),o=cn(e);class a extends vt{injector;static observedAttributes=Object.keys(o);get ngElementStrategy(){if(!this._ngElementStrategy){let p=this._ngElementStrategy=i.create(this.injector||t.injector);e.forEach(({propName:f,transform:M})=>{if(!this.hasOwnProperty(f))return;let Z=this[f];delete this[f],p.setInputValue(f,Z,M);});}return this._ngElementStrategy}_ngElementStrategy;constructor(p){super(),this.injector=p;}attributeChangedCallback(p,f,M,Z){let[De,rt]=o[p];this.ngElementStrategy.setInputValue(De,M,rt);}connectedCallback(){let p=false;this.ngElementStrategy.events&&(this.subscribeToEvents(),p=true),this.ngElementStrategy.connect(this),p||this.subscribeToEvents();}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null);}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(p=>{let f=new CustomEvent(p.name,{detail:p.value});this.dispatchEvent(f);});}}return e.forEach(({propName:l,transform:p,isSignal:f})=>{Object.defineProperty(a.prototype,l,{get(){let M=this.ngElementStrategy.getInputValue(l);return f&&qa(M)?M():M},set(M){this.ngElementStrategy.setInputValue(l,M,p);},configurable:true,enumerable:true});}),a}var Pi={providers:[Ov()]};var ht=n=>({active:n});function fn(n,t){if(n&1&&(Xa(0,`span`,4),gv(1),ec()),n&2){let e=VD(2);fd(),Yf(e.collectionFilterConfig.subtitle);}}function gn(n,t){if(n&1&&(Xa(0,`div`,1)(1,`span`,3),gv(2),ec(),TD(3,fn,2,1,`span`,4),ec()),n&2){let e=VD();fd(2),Yf(e.collectionFilterConfig.title),fd(),SD(e.collectionFilterConfig.subtitle?3:-1);}}function vn(n,t){if(n&1&&(Xa(0,`span`,9),gv(1),ec()),n&2){let e=VD(2).$implicit;Ef(`ngClass`,Sv(2,ht,Ev(0))),fd(),ac(``,e.label,` `);}}function hn(n,t){if(n&1){let e=FD();Xa(0,`div`,7),Nf(`mousedown`,function(){gu(e);let o=VD().$implicit,a=Ev(0);return mu(VD(2).filterClick(o,a))}),Cf(1,`img`,8),TD(2,vn,2,4,`span`,9),ec();}if(n&2){let e=VD().$implicit,i=Ev(0);fd(),Ef(`src`,e.imageSrc,nm)(`ngClass`,Sv(3,ht,i)),fd(),SD(e.label?2:-1);}}function Cn(n,t){if(n&1){let e=FD();Xa(0,`button`,10),Nf(`click`,function(){gu(e);let o=VD().$implicit,a=Ev(0);return mu(VD(2).filterClick(o,a))}),gv(1),ec();}if(n&2){let e=VD().$implicit;Ef(`ngClass`,Sv(2,ht,Ev(0))),fd(),ac(``,e.label,` `);}}function yn(n,t){if(n&1&&(Xf(0),TD(1,hn,3,5,`div`,5)(2,Cn,2,4,`button`,6)),n&2){let e=t.$implicit,i=VD(2);vv(e.value===i.currentActiveParams()[e.key]),fd(),SD(i.collectionFilterConfig.template===i.CollectionFilterTemplate.IMAGE?1:i.collectionFilterConfig.template===i.CollectionFilterTemplate.BUTTON?2:-1);}}function _n(n,t){if(n&1&&ND(0,yn,3,2,null,null,bD),n&2)AD(VD().collectionFilterConfig.options);}var Qe=class n extends Pe{currentActiveParams=Lt$2({});collectionFilterConfig;CollectionFilterTemplate=Re$2;originalPushState;constructor(){super(),this.attachedURLStateChecker();}engagementTriggerReceived(t){this.collectionFilterConfig=t.content.collectionFilterConfig;}update(){}ngOnDestroy(){this.originalPushState&&(window.history.pushState=this.originalPushState);}filterClick(t,e=false){let i=new URL(window.location.href),o=e?`removed`:`applied`;if(e?i.searchParams.delete(t.key):i.searchParams.set(t.key,t.value),this.collectionFilterConfig.refreshPage){this.sendEvent(t,o),window.location.href=i.href;return}window.history.replaceState({path:i.href},``,i),this.sendEvent(t,o),this.checkAndUpdateParams();}sendEvent(t,e){let i=new Ir$1(`CE Trigger Clicked`,{filterApplication:e,filter:{key:t.key,value:t.value}},this.engagementTrigger);window.CooeeSDK.sendEvent(i);}attachedURLStateChecker(){this.checkAndUpdateParams(),this.originalPushState=window.history.pushState,window.history.pushState=new Proxy(window.history.pushState,{apply:(t,e,i)=>{t.apply(e,i),this.checkAndUpdateParams();}});}checkAndUpdateParams(){let t=new URL(window.location.href),e={};t.searchParams.forEach((i,o)=>{e[o]=i;}),this.currentActiveParams.set(e);}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-collection-filter`]],features:[np(Lt()),Wa],decls:4,vars:2,consts:[[1,`wrapper`],[1,`filter-title-container`],[1,`options-container`],[1,`filter-title`],[1,`filter-subtitle`],[1,`image-filter-wrapper`],[`type`,`button`,1,`filter-button`,3,`ngClass`],[1,`image-filter-wrapper`,3,`mousedown`],[`alt`,`collection filter image`,1,`filter-image`,3,`src`,`ngClass`],[1,`filter-label`,3,`ngClass`],[`type`,`button`,1,`filter-button`,3,`click`,`ngClass`]],template:function(e,i){e&1&&(Xa(0,`div`,0),TD(1,gn,4,2,`div`,1),Xa(2,`div`,2),TD(3,_n,2,0),ec()()),e&2&&(fd(),SD(i.collectionFilterConfig.title?1:-1),fd(2),SD(i.collectionFilterConfig.options.length?3:-1));},dependencies:[AE],styles:[`.wrapper{display:flex;flex-direction:column;gap:10px;padding:10px;justify-content:center;align-items:center}.filter-title-container{display:flex;flex-direction:column;gap:5px;align-items:center}.filter-title-container .filter-title{color:rgba(var(--lc-heading-color));font-family:var(--lc-heading-family),serif;font-weight:var(--lc-heading-weight);font-size:var(--lc-heading-size);transform:var(--lc-heading-transform);letter-spacing:var(--lc-heading-letter-spacing);text-align:var(--lc-heading-align)}.filter-title-container .filter-subtitle{color:rgba(var(--lc-subheading-color));font-weight:var(--lc-subheading-weight);font-size:var(--lc-subheading-size)}.options-container{display:flex;gap:35px;align-items:center;flex-wrap:wrap;justify-content:center}.options-container .image-filter-wrapper{display:flex;gap:10px;flex-direction:column;align-items:center;cursor:pointer}.options-container .image-filter-wrapper .filter-image{width:var(--lc-image-width, 80px);height:var(--lc-image-height, 80px);border-radius:40px}.options-container .image-filter-wrapper .filter-image.active{border:2px solid rgba(var(--lc-primary-color));padding:2px}.options-container .image-filter-wrapper .filter-label{font-size:var(--lc-text-size, 14px);color:rgba(var(--lc-text-color));font-weight:var(--lc-text-weight)}.options-container .image-filter-wrapper .filter-label.active{color:rgba(var(--lc-primary-color))}.options-container .filter-button{background-color:rgba(var(--lc-secondary-button-bg-color));font-size:var(--lc-button-size, 14px);color:rgba(var(--lc-secondary-button-color));border-color:rgba(var(--lc-secondary-button-border-color));font-weight:var(--lc-secondary-button-weight);border-radius:var(--lc-button-radius);font-family:var(--lc-button-family),serif;height:var(--lc-button-height, 36px);padding:0 16px}.options-container .filter-button:hover,.options-container .filter-button.active{background-color:rgba(var(--lc-primary-button-bg-color));color:rgba(var(--lc-primary-button-color));border-color:rgba(var(--lc-primary-button-border-color));font-weight:var(--lc-primary-button-weight)}
28
28
  `],encapsulation:3})};var We=class n{transform(t,e){return t?Fe$2(t,r({},e)):null}static ɵfac=function(e){return new(e||n)};static ɵpipe=Go({name:`cooeeDynamicVariables`,type:n,pure:true})};var Ct={};(function n(t,e,i,o){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),l=typeof Path2D==`function`&&typeof DOMMatrix==`function`,p=(function(){if(!t.OffscreenCanvas)return false;var s=new OffscreenCanvas(1,1),r=s.getContext(`2d`);r.fillRect(0,0,1,1);var g=s.transferToImageBitmap();try{r.createPattern(g,`no-repeat`);}catch{return false}return true})();function f(){}function M(s){var r=e.exports.Promise,g=r!==void 0?r:t.Promise;return typeof g==`function`?new g(s):(s(f,f),null)}var Z=(function(s,r){return {transform:function(g){if(s)return g;if(r.has(g))return r.get(g);var h=new OffscreenCanvas(g.width,g.height);return h.getContext(`2d`).drawImage(g,0,0),r.set(g,h),h},clear:function(){r.clear();}}})(p,new Map),De=(function(){var s=Math.floor(16.666666666666668),r,g,h={},C=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(r=function(y){var _=Math.random();return h[_]=requestAnimationFrame(function v(x){C===x||C+s-1<x?(C=x,delete h[_],y()):h[_]=requestAnimationFrame(v);}),_},g=function(y){h[y]&&cancelAnimationFrame(h[y]);}):(r=function(y){return setTimeout(y,s)},g=function(y){return clearTimeout(y)}),{frame:r,cancel:g}})(),rt=(function(){var s,r,g={};function h(C){function y(_,v){C.postMessage({options:_||{},callback:v});}C.init=function(v){var x=v.transferControlToOffscreen();C.postMessage({canvas:x},[x]);},C.fire=function(v,x,D){if(r)return y(v,null),r;var O=Math.random().toString(36).slice(2);return r=M(function(F){function A(z){z.data.callback===O&&(delete g[O],C.removeEventListener(`message`,A),r=null,Z.clear(),D(),F());}C.addEventListener(`message`,A),y(v,O),g[O]=A.bind(null,{data:{callback:O}});}),r},C.reset=function(){C.postMessage({reset:true});for(var v in g)g[v](),delete g[v];};}return function(){if(s)return s;if(!i&&a){var C=[`var CONFETTI, SIZE = {}, module = {};`,`(`+n.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(`
@@ -32,14 +32,14 @@ var rn={schedule(n,t){let e=setTimeout(n,t);return ()=>clearTimeout(e)}};functio
32
32
  `],encapsulation:3})};var Je=class n{dialog=g(Ro);dialogRef;constructor(){}showItemQuickView(t,e){this.dialogRef=this.dialog.open(Ye,{width:`100vw`,height:`100dvh`,backdropClass:[`letscooee-backdrop`],data:{item:e,triggerContext:t}});}static ɵfac=function(e){return new(e||n)};static ɵprov=C({token:n,factory:n.ɵfac,providedIn:`root`})};var Xe=(i=>(i.SINGLE_DROPDOWN=`SINGLE_DROPDOWN`,i.MULTIPLE_DROPDOWNS=`MULTIPLE_DROPDOWNS`,i.CHIPS=`CHIPS`,i))(Xe||{});var En=n=>({row:n}),yt=(n,t)=>t.id,In=(n,t)=>t.mID;function Pn(n,t){if(n&1&&(Xa(0,`option`,7),gv(1),ec()),n&2){let e=t.$implicit,i=t.$index,o=VD().$implicit,a=VD(2);Ef(`value`,i)(`selected`,a.selectedOptions()[o.name]===e.name)(`disabled`,!!e.disabled),fd(),ac(` `,e.name,` `);}}function kn(n,t){if(n&1){let e=FD();Xa(0,`select`,6,0),Nf(`change`,function(){let o=gu(e).$implicit,a=zD(1);return mu(VD(2).onDropdownChange(o,a.value))}),ND(2,Pn,2,4,`option`,7,bD),ec();}if(n&2){let e=t.$implicit;Ef(`name`,e.name),vf(`aria-label`,e.name),fd(2),AD(e.optionValues);}}function Dn(n,t){if(n&1&&(Xa(0,`div`,2),ND(1,kn,4,2,`select`,5,yt),ec()),n&2){let e=VD();Ef(`ngClass`,Sv(1,En,e.horizontal())),fd(),AD(e.options());}}function Mn(n,t){if(n&1&&(Xa(0,`option`,7),gv(1),ec()),n&2){let e=t.$implicit,i=VD(2);Ef(`value`,e.mID)(`selected`,i.item().selectedOrFirstVariant.value.mID===e.mID)(`disabled`,!e.isAvailable),fd(),ac(` `,e.name,` `);}}function Fn(n,t){if(n&1){let e=FD();Xa(0,`div`,3)(1,`select`,8,1),Nf(`change`,function(){gu(e);let o=zD(2);return mu(VD().onVariantChange(o.value))}),ND(3,Mn,2,4,`option`,7,In),ec()();}if(n&2){let e=VD();fd(),vf(`aria-label`,`Select variant`),fd(2),AD(e.item().vars);}}function On(n,t){if(n&1&&(Xa(0,`div`,11),gv(1),Xa(2,`span`,14),gv(3),ec()()),n&2){let e=VD().$implicit,i=VD(2);fd(),ac(` `,e.name),fd(2),ac(`: `,i.selectedOptions()[e.name]);}}function An(n,t){if(n&1&&(Xa(0,`span`,16),gv(1),ec()),n&2){VD();let e=Ev(0);fd(),Yf(e);}}function Ln(n,t){if(n&1){let e=FD();Xf(0),Xa(1,`button`,15),Nf(`click`,function(){let o=gu(e).$implicit,a=VD().$implicit;return mu(VD(2).onOptionSelect(a,o))}),TD(2,An,2,1,`span`,16),ec();}if(n&2){let e=t.$implicit,i=VD().$implicit,o=Ev(0),a=VD(2),l=e.name,p=vv(e.displayName||e.name),f=e.swatch,M=o?e.hexColor??l:``,Z=a.selectedOptions()[i.name]===l;fd(),sc(`option-value--swatch`,o)(`option-value--selected`,Z)(`option-value--disabled`,e.disabled),Ef(`title`,p)(`ngStyle`,a.getSwatchStyles(f,M)),vf(`aria-checked`,Z)(`aria-label`,p)(`aria-disabled`,e.disabled||null),fd(),SD(o?-1:2);}}function Rn(n,t){if(n&1&&(Xf(0),Xa(1,`div`,10),TD(2,On,4,2,`div`,11),Xa(3,`div`,12),ND(4,Ln,3,13,`button`,13,yt),ec()()),n&2){let e=t.$implicit,i=VD(2);vv(i.isColorSwatch(e)),fd(2),SD(i.hideOptionNames()?-1:2),fd(),vf(`aria-label`,e.name),fd(),AD(e.optionValues);}}function Nn(n,t){if(n&1&&(Xa(0,`div`,9),ND(1,Rn,6,3,`div`,10,yt),ec()),n&2){let e=VD();sc(`options-list--horizontal`,e.horizontal()),fd(),AD(e.options());}}var Ae=n=>n.trim().toLowerCase(),et=class n{item=iN.required();selectorType=iN();horizontal=iN(false);hideOptionNames=iN(false);variantSelected=oN();selectedOptions=Pv(()=>{let t=this.item(),e=t.vars.find(o=>o.isAvailable)??t.vars[0],i={};return t.options?.forEach(o=>{let a=e?.selectedOptions.find(l=>l.name===o.name)?.value;a&&(i[o.name]=a);}),i});availabilityIndex=Fv(()=>{let t=this.item(),e=new Map;return t?.vars?.length&&t.vars.forEach((i,o)=>{if(i.isAvailable)for(let a of i.selectedOptions){let l=Ae(a.name),p=e.get(l);p||e.set(l,p=new Map);let f=p.get(a.value);f||p.set(a.value,f=new Set),f.add(o);}}),e});options=Fv(()=>{let t=this.item();return !t.options||t.vars.length===1?[]:(t.options.forEach(e=>{e.optionValues.forEach(i=>{i.disabled=this.isOptionValueDisabledFast(e,i);});}),t.options)});matchedVariant=Fv(()=>{let t=this.item(),e=this.selectedOptions();return t.vars.find(i=>t.options.every(o=>{let a=i.selectedOptions.find(l=>l.name===o.name)?.value;return e[o.name]===a}))});constructor(){ws(()=>{let t=this.matchedVariant();t&&(this.item().setSelectedVariant(t),this.variantSelected.emit(t));}),ws(()=>{let t=this.item();if(!t.options)return;try{window.cooeeManipulateProduct&&window.cooeeManipulateProduct(t);}catch(a){Y$1.error(a);}let e=We$3(),o=(e?.currentItem?.vID?this.item().vars.find(a=>a.mID===e.currentItem.vID):void 0)||t.vars.find(a=>a.isAvailable)||t.vars[0];o&&this.syncSelectedOptions(o);});}onPDPVariantChange(t){if(this.item()){this.item().setSelectedVariantByID(t.detail.variantID);let e=this.item().selectedOrFirstVariant.value;this.syncSelectedOptions(e);}}onOptionSelect(t,e){if(e.disabled)return;this.selectedOptions.set(s(r({},this.selectedOptions()),{[t.name]:e.name}));let i=this.matchedVariant();i&&(this.item().setSelectedVariant(i),this.notifyProductChange({product:this.item(),variant:i}));}onDropdownChange(t,e){let i=t.optionValues[Number(e)];i&&this.onOptionSelect(t,i);}isColorSwatch(t){return t.optionValues.some(e=>!!e.swatch||/#[a-f0-9]{6}\b/i.test(e.name))}getSwatchStyles(t,e){return !t&&e?{"--swatch-color":e}:t?.image?.url?{"background-image":`url("${t.image.url}")`}:t?.color?{"--swatch-color":t.color}:{}}showSingleDropdown(){return this.item().vars?.length<=1?false:!this.selectorType()||this.selectorType()===`SINGLE_DROPDOWN`}showMultipleDropdowns(){return this.item().vars?.length<=1?false:this.selectorType()===`MULTIPLE_DROPDOWNS`}showChips(){return this.item().vars?.length<=1?false:this.selectorType()===`CHIPS`}onVariantChange(t){let e=this.item().vars.find(i=>i.mID===t);e&&(this.item().setSelectedVariant(e),this.notifyProductChange({product:this.item(),variant:e}),this.variantSelected.emit(e));}notifyProductChange(t){document.dispatchEvent(new CustomEvent(`letscooee:outbound:variant-change`,{detail:t}));}syncSelectedOptions(t){let e={};t.selectedOptions.forEach(i=>{e[i.name]=i.value;}),this.selectedOptions.set(e);}getCandidateVariantsExcluding(t){let e=this.item(),i=this.availabilityIndex(),o=new Set;e.vars.forEach((l,p)=>{l.isAvailable&&o.add(p);});let a=o;for(let[l,p]of Object.entries(this.selectedOptions())){if(Ae(l)===Ae(t))continue;let f=i.get(Ae(l));if(!f)return new Set;let M=f.get(String(p));if(!M)return new Set;if(a=new Set([...a].filter(Z=>M.has(Z))),a.size===0)return a}return a}isOptionValueDisabledFast(t,e){let o=this.availabilityIndex().get(Ae(t.name));if(!o)return true;let a=e.name,l=o.get(a);if(!l||l.size===0)return true;let p=this.getCandidateVariantsExcluding(t.name);if(p.size===0)return true;for(let f of p)if(l.has(f))return false;return true}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-product-variant-selector`]],hostBindings:function(e,i){e&1&&Nf(`letscooee:variant-change`,function(a){return i.onPDPVariantChange(a)},om);},inputs:{item:[1,`item`],selectorType:[1,`selectorType`],horizontal:[1,`horizontal`],hideOptionNames:[1,`hideOptionNames`]},outputs:{variantSelected:`variantSelected`},decls:3,vars:1,consts:[[`sel`,``],[`variantSelect`,``],[1,`dropdowns-wrapper`,3,`ngClass`],[1,`dropdown-wrapper`],[1,`options-list`,3,`options-list--horizontal`],[1,`option-selector`,3,`name`],[1,`option-selector`,3,`change`,`name`],[3,`value`,`selected`,`disabled`],[1,`option-selector`,3,`change`],[1,`options-list`],[1,`option-group`],[1,`option-label`],[`role`,`radiogroup`,1,`option-values`],[`type`,`button`,`role`,`radio`,1,`option-value`,3,`option-value--swatch`,`option-value--selected`,`option-value--disabled`,`title`,`ngStyle`],[1,`option-selected-name`],[`type`,`button`,`role`,`radio`,1,`option-value`,3,`click`,`title`,`ngStyle`],[1,`option-value__label`]],template:function(e,i){e&1&&TD(0,Dn,3,3,`div`,2)(1,Fn,5,1,`div`,3)(2,Nn,3,2,`div`,4),e&2&&SD(i.showMultipleDropdowns()?0:i.showSingleDropdown()?1:i.showChips()?2:-1);},dependencies:[AE,RE],styles:[`:host{display:block}.options-list{display:flex;flex-direction:column;gap:var(--lc-spacing-sm, 8px)}.options-list--horizontal{flex-direction:row;flex-wrap:wrap;align-items:flex-start}.option-group{display:flex;flex-direction:column;gap:var(--lc-spacing-xs, 4px)}.option-label{font-family:var(--lc-text-family, inherit);font-size:var(--lc-text-size, 14px);color:rgb(var(--lc-text-color, 0 0 0));line-height:1.4}.option-selected-name{font-weight:500}.option-values{display:flex;flex-wrap:wrap;gap:var(--lc-spacing-xs, 4px)}.option-value{display:inline-flex;align-items:center;justify-content:center;padding:4px var(--lc-spacing-sm, 8px);min-width:36px;min-height:32px;border:1px solid rgb(var(--lc-text-color, 0 0 0)/.2);border-radius:var(--lc-button-radius, 4px);background:transparent;color:rgb(var(--lc-text-color, 0 0 0));font-family:var(--lc-text-family, inherit);font-size:var(--lc-text-size, 14px);line-height:1;cursor:pointer;transition:background .15s,color .15s,border-color .15s}.option-value--selected{background:rgb(var(--lc-primary-color));color:rgb(var(--lc-primary-button-color, 255 255 255));border-color:rgb(var(--lc-primary-color))}.option-value--disabled{opacity:.4;cursor:not-allowed;pointer-events:none}.option-value--disabled .option-value__label{text-decoration:line-through}.option-value--swatch{width:var(--lc-swatch-size, 28px);height:var(--lc-swatch-size, 28px);min-width:unset;min-height:unset;padding:0;border-radius:var(--lc-swatch-radius, 50%);border:2px solid transparent;outline:2px solid transparent;outline-offset:0;background-color:var(--swatch-color, transparent);background-size:cover;background-position:center;transition:outline-color .15s,outline-offset .15s}.option-value--swatch.option-value--selected{border-color:rgb(var(--lc-card-bg-color, 255 255 255));outline-color:rgb(var(--lc-primary-color));outline-offset:2px}.option-value--swatch.option-value--disabled{position:relative;overflow:hidden}.option-value--swatch.option-value--disabled:after{content:"";position:absolute;inset:0;background:linear-gradient(to bottom right,transparent calc(50% - .5px),rgba(0,0,0,.4) calc(50% - .5px) calc(50% + .5px),transparent calc(50% + .5px));border-radius:inherit}.dropdowns-wrapper,.dropdown-wrapper{display:flex;gap:8px;width:100%}.option-selector{width:100%;padding:8px 24px 8px 8px;border:1px solid black;border-radius:var(--lc-button-radius);font-size:var(--lc-text-size)}@media(min-width:768px){.option-selector:hover{border-color:rgba(var(--lc-primary-color))}}.option-selector:focus{outline:none}.option-selector{flex:0 0 130px}@media(max-width:768px){.option-selector{flex:1 1 0;min-width:0}}
33
33
  `],encapsulation:2})};var Bn=(n,t)=>({enter:n,exit:t}),zn=(n,t)=>t.id;function Hn(n,t){if(n&1&&(Xa(0,`div`,3),Cf(1,`img`,10),ec()),n&2){let e,i,o=VD();fd(),Ef(`src`,((e=o.selectedVariant())==null?null:e.getOneImage())||o.currentItem.firstImageURL,nm),vf(`alt`,((i=o.selectedVariant())==null?null:i.name)||o.currentItem.name||`Product image`);}}function jn(n,t){if(n&1&&(Xa(0,`div`,13),gv(1),ec(),Xa(2,`div`,14),gv(3),ec()),n&2){let e=VD(2);fd(),ac(` `,e.getCurrency(e.selectedVariant().price.cmp),` `),fd(2),ac(` `,e.getDiscountPercentage(e.selectedVariant().price),`% off `);}}function $n(n,t){if(n&1&&(Xa(0,`div`,12),gv(1),ec()),n&2){let e=VD(2);fd(),ac(` `,e.stickyATCConfig.leftText,` `);}}function Un(n,t){if(n&1&&(Xa(0,`div`,4)(1,`div`,11),gv(2),ec(),TD(3,jn,4,2),TD(4,$n,2,1,`div`,12),ec()),n&2){let e=VD();fd(2),ac(` `,e.getCurrency(e.selectedVariant().price.d),` `),fd(),SD(e.selectedVariant().price.cmp?3:-1),fd(),SD(e.stickyATCConfig.leftText?4:-1);}}function Qn(n,t){n&1&&wf(0);}function qn(n,t){if(n&1&&(Xa(0,`div`,15),gv(1),ec()),n&2){let e=t.$implicit,i=t.$index;VD(2);let o=Ev(9);Ef(`ngClass`,Mv(2,Bn,i===o.currentIndex,i===o.previousIndex)),fd(),ac(` `,e,` `);}}function Wn(n,t){if(n&1&&(Xa(0,`div`,9),ND(1,qn,2,5,`div`,15,bD),ec()),n&2){VD();let e=Ev(9);fd(),AD(e.features);}}function Zn(n,t){if(n&1&&Cf(0,`cooee-product-variant-selector`,16),n&2){let e=VD(2);Ef(`item`,e.currentItem)(`horizontal`,true)(`hideOptionNames`,true)(`selectorType`,e.stickyATCConfig.variantSelectorConfig==null?null:e.stickyATCConfig.variantSelectorConfig.type);}}function Gn(n,t){if(n&1&&(Xa(0,`option`,21),gv(1),ec()),n&2){let e,i=t.$implicit,o=VD(3);Ef(`value`,i.id)(`selected`,((e=o.selectedVariant())==null||e.selectedSellingPlan==null||e.selectedSellingPlan.value==null?null:e.selectedSellingPlan.value.id)===i.id),fd(),ac(` `,i.name,` `);}}function Kn(n,t){if(n&1){let e=FD();Xa(0,`div`,17)(1,`select`,19,1),Nf(`change`,function(){gu(e);let o=zD(2);return mu(VD(2).onSubscriptionChange(o.value))}),Xa(3,`option`,20),gv(4,`Select Subscription`),ec(),ND(5,Gn,2,3,`option`,21,zn),ec()();}if(n&2){let e=VD(2);fd(5),AD(e.selectedVariant().sellingPlans);}}function Yn(n,t){if(n&1){let e=FD();Xa(0,`div`,18)(1,`button`,22),Nf(`click`,function(){gu(e);return mu(VD(2).onQuantityDecrement())}),gv(2,`− `),ec(),Xa(3,`span`,23),gv(4),ec(),Xa(5,`button`,24),Nf(`click`,function(){gu(e);return mu(VD(2).onQuantityIncrement())}),gv(6,`+ `),ec()();}if(n&2){let e=VD(2);fd(4),Yf(e.currentItem.selectedQty.value);}}function Jn(n,t){if(n&1&&(TD(0,Zn,1,4,`cooee-product-variant-selector`,16),TD(1,Kn,7,0,`div`,17),TD(2,Yn,7,1,`div`,18)),n&2){let e,i=VD();SD(i.currentItem.options.length&&i.stickyATCConfig.variantSelectorConfig!=null&&i.stickyATCConfig.variantSelectorConfig.show?0:-1),fd(),SD(!((e=i.selectedVariant())==null||e.sellingPlans==null)&&e.sellingPlans.length&&i.stickyATCConfig.showSubscriptionSelector?1:-1),fd(),SD(i.stickyATCConfig.showQuantitySelector?2:-1);}}var tt=class n extends Pe{currentItem;stickyATCConfig;selectedVariant=Lt$2(void 0);featureSlider=Lt$2({features:[],currentIndex:0});VariantSelectorType=Xe;constructor(){super();}onVariantChange(t){this.currentItem&&(this.currentItem.setSelectedVariantByID(t.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value));}engagementTriggerReceived(t){this.stickyATCConfig=t.stickyATCConfig??{},this.currentItem=t.items[0];let e=We$3(),i=this.currentItem.vars.find(o=>o.mID===e.currentItem.vID);i&&this.currentItem.setSelectedVariantByID(i.mID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation();}update(){}getCurrency(t){return Vr$1(t)}getDiscountPercentage(t){return ((t.cmp-t.d)/t.cmp*100).toFixed(0)}onSubscriptionChange(t){if(!t)return;let e=this.selectedVariant()?.sellingPlans?.find(i=>i.id===t);e&&(this.selectedVariant()?.changeSellingPlan(e),this.notifyProductChange({product:this.currentItem,sellingPlan:e}));}shouldShowImage(){return !!(this.stickyATCConfig.showImage&&(this.selectedVariant()?.getOneImage()||this.currentItem.firstImageURL))}onQuantityIncrement(){this.updateQuantity(this.currentItem.selectedQty.value+1);}onQuantityDecrement(){this.updateQuantity(Math.max(1,this.currentItem.selectedQty.value-1));}updateQuantity(t){this.currentItem.selectedQuantity=t,this.notifyProductChange({product:this.currentItem,quantity:t});}addToCart(){this.engagementService.executeCTA(he$2.ADD_TO_CART,{item:this.currentItem});}notifyProductChange(t){document.dispatchEvent(new CustomEvent(`letscooee:outbound:variant-change`,{detail:t}));}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let t=this.stickyATCConfig.rightText.split(`
34
34
  `),e=t.length===1?null:setInterval(()=>{this.featureSlider.update(i=>s(r({},i),{previousIndex:i.currentIndex,currentIndex:(i.currentIndex+1)%i.features.length}));},3e3);this.featureSlider.set({intervalRef:e,currentIndex:0,features:t});}replaceVariables(t){return t?Fe$2(t,this.currentItem.getTemplateVariables(),this.triggerContext):``}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-sticky-atc`]],hostBindings:function(e,i){e&1&&Nf(`letscooee:variant-change`,function(a){return i.onVariantChange(a)},om);},features:[np(Lt()),Wa],decls:13,vars:6,consts:[[`selectorsTemplate`,``],[`subscriptionSelect`,``],[1,`lc-wrapper`],[1,`image-wrapper`],[1,`lc-prices`],[4,`ngTemplateOutlet`],[1,`lc-button-wrapper`],[`type`,`button`,1,`lc-button`,`lc-button-atc`,3,`click`],[1,`atc-sale-price`],[1,`lc-features`],[`loading`,`lazy`,3,`src`],[1,`lc-sale-price`],[1,`lc-additional-text`],[1,`lc-compare-price`],[1,`lc-discount-label`],[1,`lc-feature`,3,`ngClass`],[3,`item`,`horizontal`,`hideOptionNames`,`selectorType`],[1,`subscription-selector-wrapper`],[1,`quantity-selector`],[`aria-label`,`Subscription`,1,`subscription-selector`,3,`change`],[`value`,``],[3,`value`,`selected`],[`type`,`button`,`aria-label`,`Decrease quantity`,1,`qty-btn`,3,`click`],[1,`qty-value`],[`type`,`button`,`aria-label`,`Increase quantity`,1,`qty-btn`,3,`click`]],template:function(e,i){if(e&1&&(Xa(0,`div`,2),TD(1,Hn,2,2,`div`,3),TD(2,Un,5,3,`div`,4),pf(3,Qn,1,0,`ng-container`,5),Xa(4,`div`,6)(5,`button`,7),Nf(`click`,function(){return i.addToCart()}),gv(6,` Add To Cart `),Xa(7,`span`,8),gv(8),ec()(),Xf(9),TD(10,Wn,3,0,`div`,9),ec()(),pf(11,Jn,3,3,`ng-template`,null,0,xv)),e&2){let o=zD(12);fd(),SD(i.shouldShowImage()?1:-1),fd(),SD(i.selectedVariant()&&i.stickyATCConfig.showProductInfo?2:-1),fd(),Ef(`ngTemplateOutlet`,o),fd(5),ac(` `,i.getCurrency(i.selectedVariant().price.d*i.currentItem.selectedQty.value),` `),fd();let a=vv(i.featureSlider());fd(),SD(a.features.length?10:-1);}},dependencies:[AE,xE,et],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%;margin:0 auto}.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:rgba(var(--lc-primary-button-bg-color));color:rgba(var(--lc-primary-button-color));font-weight:var(--lc-primary-button-weight);text-transform:var(--lc-primary-button-transform);border-radius:var(--lc-button-radius);font-size:var(--lc-button-size);font-family:var(--lc-button-family),serif;height:var(--lc-button-height);letter-spacing:var(--lc-button-letter-spacing);transition:filter .12s ease,background-color .2s ease,color .2s ease;border-width:1px;border-style:solid;border-color:rgba(var(--lc-primary-button-border-color));display:flex;align-items:center;justify-content:center;gap:8px}.lc-button cooee-icon,.lc-button>svg,.lc-button>img{width:var(--lc-button-icon-size);height:var(--lc-button-icon-size);color:inherit}.lc-button:hover{filter:brightness(.95)}.lc-button:active{filter:brightness(.9)}.lc-button:focus-visible{outline:2px solid rgba(var(--lc-primary-color, 0, 0, 0));outline-offset:2px}.lc-button{min-width:150px;width:100%;padding:8px}.lc-button .atc-sale-price{display:none}.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}.image-wrapper{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:70px;height:70px;border-radius:4px}.image-wrapper img{width:100%;height:100%;object-fit:cover;border-radius:4px}.selectors-wrapper{display:flex;gap:8px;flex:1 1 100%;min-width:0}cooee-product-variant-selector{flex:0 1 auto}@media(max-width:768px){cooee-product-variant-selector{flex:1 1 0}}.subscription-selector-wrapper{flex:0 0 130px;display:flex}@media(max-width:768px){.subscription-selector-wrapper{flex:1 1 auto;min-width:0}}.subscription-selector-wrapper .subscription-selector{width:100%;padding:8px 24px 8px 8px;border:1px solid black;border-radius:var(--lc-button-radius);font-size:var(--lc-text-size)}@media(min-width:768px){.subscription-selector-wrapper .subscription-selector:hover{border-color:rgba(var(--lc-primary-color))}}.subscription-selector-wrapper .subscription-selector:focus{outline:none}.quantity-selector{flex:0 0 auto;display:flex;align-items:stretch;border:1px solid black;border-radius:var(--lc-button-radius)}.quantity-selector .qty-btn{display:flex;align-items:center;justify-content:center;flex:0 0 28px;border:none;cursor:pointer;font-size:18px;font-weight:600;padding:4px;border-radius:var(--lc-button-radius)}.quantity-selector .qty-btn:active{background-color:#f0f0f0}@media(min-width:768px){.quantity-selector .qty-btn:hover{background-color:#f5f5f5}}.quantity-selector .qty-value{display:flex;place-content:center;justify-content:center;flex:0 0 28px;padding:8px 0;text-align:center;font-size:14px;font-weight:500}@media(max-width:768px){.lc-wrapper{flex-wrap:wrap;align-items:start}.lc-prices,.lc-button-wrapper{flex-basis:auto;flex-grow:1}cooee-product-variant-selector{order:1;flex-basis:100%}.quantity-selector{order:4}.lc-button-wrapper{order:5}}
35
- `],encapsulation:3})};var Xn=[`videoEl`];async function Di(){return (await import('./video-detail-dialog.component-B40xi2X7-Dl8Eur82.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var ye=class n extends Pe{videoElements;videoEntries;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),Di();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videoEntries=this.videoConfig.videoEntries;}onMuteToggled(t,e){t||this.videoElements.forEach(i=>{i.nativeElement!==e&&(i.nativeElement.muted=true,i.nativeElement.pause());});}sendTriggerClicked(t,e){this.sendEvent(`CE Trigger Clicked`,{},t,e);}async onVideoTap(t,e,i,o,a){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){o&&(o.muted=false,o.play(),this.onMuteToggled(false,o));return}await this.openDialog(e,i,a);}sendEvent(t,e,i,o){let a=new Ir$1(t,e,this.engagementTrigger);a.setVideos(i),o&&(a.items=[o.toEmbed()]),window.CooeeSDK.sendEvent(a);}onDialogClosed(){this.resumePlaylistVideos();}isVideoLoading(t){return this.videoLoadingStates.get(t)??true}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}playVideo(t){t.play().catch(e=>{Y$1.error(`Failed to play video:`,e);});}setupIntersectionObserver(t=.5,e=`50px`){this.intersectionObserver=new IntersectionObserver(i=>{i.forEach(o=>{let a=o.target,l=a.dataset.videoId;l&&(o.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(a,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(a,false)));});},{threshold:t,rootMargin:e}),setTimeout(()=>{this.videoElements.forEach(i=>{this.intersectionObserver?.observe(i.nativeElement);});},100);}handleVideoVisibilityChange(t,e){e?this.onVideoBecameVisible(t):t.pause();}onVideoBecameVisible(t){this.playVideo(t);}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(t=>{let e=t.nativeElement;e.paused||(this.pausedVideos.push(e),e.pause());});}resumePlaylistVideos(){this.pausedVideos.forEach(t=>{t.play().catch(()=>{});}),this.pausedVideos=[];}async checkAndOpenVideoFromUrl(){let t=We$4();if(!t||!this.videoEntries)return;let e=Je$2();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$3)return;let i=this.videoEntries.findIndex(o=>o.video.shortID===+t);if(i!==-1){let o=this.videoEntries[i].video;await ce$2.set(`muted`,true),await this.openDialog(o,i);}}async openDialog(t,e,i){await Mi$1();let o={videoEntries:this.videoEntries,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let a=await Di();this.dialogRef=this.dialog.open(a,{width:`100vw`,height:`100vh`,data:o,providers:on(this.triggerContext,{video:t,index:e}),disableClose:true});let l={videoID:t.id,videoIndex:e};this.sendEvent(`CE Video Dialog Opened`,{current:l},t),this.dialogRef.closed.subscribe(p=>{if(this.dialogRef=null,!p)return;let f=p.lastVideoDuration*1e3,M={videoID:p.lastVideo.id,videoIndex:p.lastVideoIndex,playedTillMS:f,playedTillPercent:f/p.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:M},p.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&oc(Xn,5),e&2){let o;kf(o=Ff())&&(i.videoElements=o);}},features:[Wa],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var _e=class n{video=iN.required({alias:`cooeeVideoSources`});prioritySource=iN(`high`);elementRef=g(Se$1);constructor(){ws(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(a=>a.remove()),i===`best`?(this.addSource(e.bestSource),this.addSource(e.highSource),this.addSource(e.lowSource)):i===`low`?(this.addSource(e.lowSource),this.addSource(e.highSource),this.addSource(e.bestSource)):(this.addSource(e.highSource),this.addSource(e.bestSource),this.addSource(e.lowSource)),this.addSource(e.m3u8Source),t.load();}addSource(t){if(!t)return;let e=document.createElement(`source`);e.src=t.url,e.type=t.mimeType,this.elementRef.nativeElement.appendChild(e);}static ɵfac=function(e){return new(e||n)};static ɵdir=En$2({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var eo=(n,t)=>t.video.id;function to(n,t){if(n&1&&(Cf(0,`div`,1),bv(1,`safeHtml`)),n&2)Ef(`innerHTML`,Av(1,1,VD().videoConfig.heading),tm);}function io(n,t){n&1&&(Xa(0,`div`,6),Cf(1,`div`,12),ec());}function no(n,t){if(n&1){let e=FD();Xa(0,`cooee-mute-toggle`,13),Nf(`toggled`,function(o){gu(e),VD();let a=zD(7);return mu(VD().onMuteToggled(o,a))}),ec();}if(n&2){VD();let e=zD(7);Ef(`muted`,e.muted)(`videoEl`,e);}}function oo(n,t){if(n&1){let e=FD();Xa(0,`cooee-video-promoted-items`,16),Nf(`cardClick`,function(o){gu(e);let a=VD(2).$index,l=zD(7),p=Ev(0);return mu(VD().onItemCardClick(o,p,a,l))}),ec();}if(n&2){VD(2);Ef(`items`,Ev(0).items)(`centeredSlides`,false);}}function ro(n,t){if(n&1){let e=FD();Xa(0,`cooee-item-card`,17),Nf(`buttonClick`,function(){gu(e);let o=VD(2).$index,a=zD(7),l=Ev(0);return mu(VD().addToCartClicked(null,l,o,a))})(`click`,function(){gu(e);let o=VD(2).$index,a=zD(7),l=Ev(0),p=Ev(1);return mu(VD().onItemCardClick(p,l,o,a))}),ec();}if(n&2){VD(2);Ef(`item`,Ev(1));}}function ao(n,t){if(n&1&&TD(0,oo,1,2,`cooee-video-promoted-items`,14)(1,ro,1,1,`cooee-item-card`,15),n&2){VD();let e=Ev(0),i=VD();SD(Ev(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function so(n,t){if(n&1){let e=FD();Xa(0,`cooee-video-card`,18),Nf(`linkClicked`,function(){gu(e),VD();let o=Ev(0);return mu(VD().sendTriggerClicked(o))}),ec();}if(n&2){VD();Ef(`card`,Ev(2));}}function lo(n,t){if(n&1){let e=FD();Xf(0)(1)(2),Xa(3,`div`,4)(4,`div`,5),Nf(`click`,function(o){let a=gu(e).$index,l=zD(7),p=Ev(0);return mu(VD().onVideoTap(o,p,a,l))})(`keydown.enter`,function(o){let a=gu(e).$index,l=zD(7),p=Ev(0);return mu(VD().onVideoTap(o,p,a,l))})(`keydown.space`,function(o){let a=gu(e).$index,l=zD(7),p=Ev(0);return mu(VD().onVideoTap(o,p,a,l))}),TD(5,io,2,0,`div`,6),Xa(6,`video`,7,0),Nf(`mouseenter`,function(){gu(e);let o=zD(7);VD();return mu(Ev(1)&&o.play())})(`mouseleave`,function(){gu(e);let o=zD(7);VD();return mu(Ev(1)&&o.pause())})(`loadstart`,function(){gu(e);let o=Ev(0);return mu(VD().onVideoLoadStart(o.id))})(`canplay`,function(){gu(e);let o=Ev(0);return mu(VD().onVideoCanPlay(o.id))}),ec(),Xa(8,`div`,8),TD(9,no,1,2,`cooee-mute-toggle`,9),ec()(),Xa(10,`div`,10),TD(11,ao,2,1)(12,so,1,1,`cooee-video-card`,11),ec()();}if(n&2){let e=t.$implicit,i=VD(),o=Ev(0),a=Ev(2),l=vv(e.video);fd(),vv(l.items[0]),fd();let f=vv(l.card)&&a===i.VideoConfigFooterContent.CARD;fd(2),ic(`background-image`,l.thumbnail?`url(`+l.thumbnail+`)`:null),fd(),SD(i.isVideoLoading(l.id)?5:-1),fd(),Ef(`cooeeVideoSources`,l)(`muted`,true),vf(`poster`,l.thumbnail)(`preload`,o?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,l.id),fd(3),SD(i.videoConfig.showMuteButton?9:-1),fd(2),SD(i.videoConfig.showItems()?11:f?12:-1);}}var it=class n extends ye{VideoConfigFooterContent=se$2;VideoConfigAutoPlay=oe$2;swiperOptions=null;constructor(){super(),this.hasSwiper=true;}ngAfterViewInit(){super.ngAfterViewInit();let t=this.videoConfig.playlistConfig.videoSwiper,e=t?(this.isMobile?t.gapSm:t.gap)+`px`:window.cooeePlaylistGap??24,i=t?this.isMobile?t.maxInRowSm:t.maxInRow:`auto`;this.swiperOptions={direction:`horizontal`,effect:`slide`,loop:t?.loop,freeMode:true,spaceBetween:e,slidesPerView:i,mousewheel:{enabled:true,forceToAxis:true},autoplay:t?.autoplay?.enabled?{delay:t?.autoplay?.delay,disableOnInteraction:false}:false},this.setupIntersectionObserver(),this.playFirstVideo();}ngOnDestroy(){super.ngOnDestroy();}addToCartClicked(t,e,i,o){let a=e.items?.[0],l=he$3.get().website?.canChangeVariantInCart;if(e.items?.length>1||a?.hasVariants()&&!l){this.onItemCardClick(a,e,i,o);return}this.engagementService.executeCTA(he$2.ADD_TO_CART,{item:a,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(he$2.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,o){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,o,t):this.onVideoTap(null,e,i,o);}update(){}onVideoCanPlay(t){if(super.onVideoCanPlay(t),!this.shouldAutoPlay()||this.dialogRef||!this.visibleVideos.has(t))return;let e=this.videoElements.find(i=>i.nativeElement.dataset.videoId===t)?.nativeElement;e&&this.playVideo(e);}onVideoBecameVisible(t){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(t):this.playVideo(t));}shouldAutoPlay(){return this.videoConfig.autoPlay===`ON`||this.videoConfig.autoPlay===`ON_HOVER`&&this.isMobile}playFirstVideo(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-video-playlist`]],features:[np(Lt()),Wa],decls:8,vars:7,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`,`cooeeVideoSources`,`muted`],[1,`video-controls`],[3,`muted`,`videoEl`],[`role`,`region`,`aria-label`,`Video details`,1,`video-footer`],[3,`card`],[1,`loading-spinner`],[3,`toggled`,`muted`,`videoEl`],[3,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`item`],[3,`cardClick`,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`buttonClick`,`click`,`item`],[3,`linkClicked`,`card`]],template:function(e,i){if(e&1&&(Xf(0)(1)(2),TD(3,to,2,3,`div`,1),Xa(4,`cooee-swiper`,2),nc(5,3),ND(6,lo,13,14,`div`,4,eo),Yo(),ec()),e&2){vv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),fd(),vv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),fd(),vv(i.videoConfig.footerContent),fd(),SD(i.videoConfig.heading?3:-1);let o=i.videoConfig.playlistConfig.videoSwiper;fd(),Ef(`options`,i.swiperOptions)(`navigationConfig`,o==null?null:o.navigation)(`paginationConfig`,o==null?null:o.pagination),fd(2),AD(i.videoEntries);}},dependencies:[zt,$t,Ut,me,_e,Wt,a],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}.video-footer{overflow-x:hidden}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-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
35
+ `],encapsulation:3})};var Xn=[`videoEl`];async function Di(){return (await import('./video-detail-dialog.component-DPuSEux7-3AFSfkG7.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var ye=class n extends Pe{videoElements;videoEntries;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),Di();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videoEntries=this.videoConfig.videoEntries;}onMuteToggled(t,e){t||this.videoElements.forEach(i=>{i.nativeElement!==e&&(i.nativeElement.muted=true,i.nativeElement.pause());});}sendTriggerClicked(t,e){this.sendEvent(`CE Trigger Clicked`,{},t,e);}async onVideoTap(t,e,i,o,a){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){o&&(o.muted=false,o.play(),this.onMuteToggled(false,o));return}await this.openDialog(e,i,a);}sendEvent(t,e,i,o){let a=new Ir$1(t,e,this.engagementTrigger);a.setVideos(i),o&&(a.items=[o.toEmbed()]),window.CooeeSDK.sendEvent(a);}onDialogClosed(){this.resumePlaylistVideos();}isVideoLoading(t){return this.videoLoadingStates.get(t)??true}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}playVideo(t){t.play().catch(e=>{Y$1.error(`Failed to play video:`,e);});}setupIntersectionObserver(t=.5,e=`50px`){this.intersectionObserver=new IntersectionObserver(i=>{i.forEach(o=>{let a=o.target,l=a.dataset.videoId;l&&(o.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(a,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(a,false)));});},{threshold:t,rootMargin:e}),setTimeout(()=>{this.videoElements.forEach(i=>{this.intersectionObserver?.observe(i.nativeElement);});},100);}handleVideoVisibilityChange(t,e){e?this.onVideoBecameVisible(t):t.pause();}onVideoBecameVisible(t){this.playVideo(t);}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(t=>{let e=t.nativeElement;e.paused||(this.pausedVideos.push(e),e.pause());});}resumePlaylistVideos(){this.pausedVideos.forEach(t=>{t.play().catch(()=>{});}),this.pausedVideos=[];}async checkAndOpenVideoFromUrl(){let t=We$4();if(!t||!this.videoEntries)return;let e=Je$2();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$3)return;let i=this.videoEntries.findIndex(o=>o.video.shortID===+t);if(i!==-1){let o=this.videoEntries[i].video;await ce$2.set(`muted`,true),await this.openDialog(o,i);}}async openDialog(t,e,i){await Mi$1();let o={videoEntries:this.videoEntries,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let a=await Di();this.dialogRef=this.dialog.open(a,{width:`100vw`,height:`100vh`,data:o,providers:on(this.triggerContext,{video:t,index:e}),disableClose:true});let l={videoID:t.id,videoIndex:e};this.sendEvent(`CE Video Dialog Opened`,{current:l},t),this.dialogRef.closed.subscribe(p=>{if(this.dialogRef=null,!p)return;let f=p.lastVideoDuration*1e3,M={videoID:p.lastVideo.id,videoIndex:p.lastVideoIndex,playedTillMS:f,playedTillPercent:f/p.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:M},p.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&oc(Xn,5),e&2){let o;kf(o=Ff())&&(i.videoElements=o);}},features:[Wa],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var _e=class n{video=iN.required({alias:`cooeeVideoSources`});prioritySource=iN(`high`);elementRef=g(Se$1);constructor(){ws(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(a=>a.remove()),i===`best`?(this.addSource(e.bestSource),this.addSource(e.highSource),this.addSource(e.lowSource)):i===`low`?(this.addSource(e.lowSource),this.addSource(e.highSource),this.addSource(e.bestSource)):(this.addSource(e.highSource),this.addSource(e.bestSource),this.addSource(e.lowSource)),this.addSource(e.m3u8Source),t.load();}addSource(t){if(!t)return;let e=document.createElement(`source`);e.src=t.url,e.type=t.mimeType,this.elementRef.nativeElement.appendChild(e);}static ɵfac=function(e){return new(e||n)};static ɵdir=En$2({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var eo=(n,t)=>t.video.id;function to(n,t){if(n&1&&(Cf(0,`div`,1),bv(1,`safeHtml`)),n&2)Ef(`innerHTML`,Av(1,1,VD().videoConfig.heading),tm);}function io(n,t){n&1&&(Xa(0,`div`,6),Cf(1,`div`,12),ec());}function no(n,t){if(n&1){let e=FD();Xa(0,`cooee-mute-toggle`,13),Nf(`toggled`,function(o){gu(e),VD();let a=zD(7);return mu(VD().onMuteToggled(o,a))}),ec();}if(n&2){VD();let e=zD(7);Ef(`muted`,e.muted)(`videoEl`,e);}}function oo(n,t){if(n&1){let e=FD();Xa(0,`cooee-video-promoted-items`,16),Nf(`cardClick`,function(o){gu(e);let a=VD(2).$index,l=zD(7),p=Ev(0);return mu(VD().onItemCardClick(o,p,a,l))}),ec();}if(n&2){VD(2);Ef(`items`,Ev(0).items)(`centeredSlides`,false);}}function ro(n,t){if(n&1){let e=FD();Xa(0,`cooee-item-card`,17),Nf(`buttonClick`,function(){gu(e);let o=VD(2).$index,a=zD(7),l=Ev(0);return mu(VD().addToCartClicked(null,l,o,a))})(`click`,function(){gu(e);let o=VD(2).$index,a=zD(7),l=Ev(0),p=Ev(1);return mu(VD().onItemCardClick(p,l,o,a))}),ec();}if(n&2){VD(2);Ef(`item`,Ev(1));}}function ao(n,t){if(n&1&&TD(0,oo,1,2,`cooee-video-promoted-items`,14)(1,ro,1,1,`cooee-item-card`,15),n&2){VD();let e=Ev(0),i=VD();SD(Ev(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function so(n,t){if(n&1){let e=FD();Xa(0,`cooee-video-card`,18),Nf(`linkClicked`,function(){gu(e),VD();let o=Ev(0);return mu(VD().sendTriggerClicked(o))}),ec();}if(n&2){VD();Ef(`card`,Ev(2));}}function lo(n,t){if(n&1){let e=FD();Xf(0)(1)(2),Xa(3,`div`,4)(4,`div`,5),Nf(`click`,function(o){let a=gu(e).$index,l=zD(7),p=Ev(0);return mu(VD().onVideoTap(o,p,a,l))})(`keydown.enter`,function(o){let a=gu(e).$index,l=zD(7),p=Ev(0);return mu(VD().onVideoTap(o,p,a,l))})(`keydown.space`,function(o){let a=gu(e).$index,l=zD(7),p=Ev(0);return mu(VD().onVideoTap(o,p,a,l))}),TD(5,io,2,0,`div`,6),Xa(6,`video`,7,0),Nf(`mouseenter`,function(){gu(e);let o=zD(7);VD();return mu(Ev(1)&&o.play())})(`mouseleave`,function(){gu(e);let o=zD(7);VD();return mu(Ev(1)&&o.pause())})(`loadstart`,function(){gu(e);let o=Ev(0);return mu(VD().onVideoLoadStart(o.id))})(`canplay`,function(){gu(e);let o=Ev(0);return mu(VD().onVideoCanPlay(o.id))}),ec(),Xa(8,`div`,8),TD(9,no,1,2,`cooee-mute-toggle`,9),ec()(),Xa(10,`div`,10),TD(11,ao,2,1)(12,so,1,1,`cooee-video-card`,11),ec()();}if(n&2){let e=t.$implicit,i=VD(),o=Ev(0),a=Ev(2),l=vv(e.video);fd(),vv(l.items[0]),fd();let f=vv(l.card)&&a===i.VideoConfigFooterContent.CARD;fd(2),ic(`background-image`,l.thumbnail?`url(`+l.thumbnail+`)`:null),fd(),SD(i.isVideoLoading(l.id)?5:-1),fd(),Ef(`cooeeVideoSources`,l)(`muted`,true),vf(`poster`,l.thumbnail)(`preload`,o?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,l.id),fd(3),SD(i.videoConfig.showMuteButton?9:-1),fd(2),SD(i.videoConfig.showItems()?11:f?12:-1);}}var it=class n extends ye{VideoConfigFooterContent=se$2;VideoConfigAutoPlay=oe$2;swiperOptions=null;constructor(){super(),this.hasSwiper=true;}ngAfterViewInit(){super.ngAfterViewInit();let t=this.videoConfig.playlistConfig.videoSwiper,e=t?(this.isMobile?t.gapSm:t.gap)+`px`:window.cooeePlaylistGap??24,i=t?this.isMobile?t.maxInRowSm:t.maxInRow:`auto`;this.swiperOptions={direction:`horizontal`,effect:`slide`,loop:t?.loop,freeMode:true,spaceBetween:e,slidesPerView:i,mousewheel:{enabled:true,forceToAxis:true},autoplay:t?.autoplay?.enabled?{delay:t?.autoplay?.delay,disableOnInteraction:false}:false},this.setupIntersectionObserver(),this.playFirstVideo();}ngOnDestroy(){super.ngOnDestroy();}addToCartClicked(t,e,i,o){let a=e.items?.[0],l=he$3.get().website?.canChangeVariantInCart;if(e.items?.length>1||a?.hasVariants()&&!l){this.onItemCardClick(a,e,i,o);return}this.engagementService.executeCTA(he$2.ADD_TO_CART,{item:a,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(he$2.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,o){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,o,t):this.onVideoTap(null,e,i,o);}update(){}onVideoCanPlay(t){if(super.onVideoCanPlay(t),!this.shouldAutoPlay()||this.dialogRef||!this.visibleVideos.has(t))return;let e=this.videoElements.find(i=>i.nativeElement.dataset.videoId===t)?.nativeElement;e&&this.playVideo(e);}onVideoBecameVisible(t){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(t):this.playVideo(t));}shouldAutoPlay(){return this.videoConfig.autoPlay===`ON`||this.videoConfig.autoPlay===`ON_HOVER`&&this.isMobile}playFirstVideo(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-video-playlist`]],features:[np(Lt()),Wa],decls:8,vars:7,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`,`cooeeVideoSources`,`muted`],[1,`video-controls`],[3,`muted`,`videoEl`],[`role`,`region`,`aria-label`,`Video details`,1,`video-footer`],[3,`card`],[1,`loading-spinner`],[3,`toggled`,`muted`,`videoEl`],[3,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`item`],[3,`cardClick`,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`buttonClick`,`click`,`item`],[3,`linkClicked`,`card`]],template:function(e,i){if(e&1&&(Xf(0)(1)(2),TD(3,to,2,3,`div`,1),Xa(4,`cooee-swiper`,2),nc(5,3),ND(6,lo,13,14,`div`,4,eo),Yo(),ec()),e&2){vv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),fd(),vv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),fd(),vv(i.videoConfig.footerContent),fd(),SD(i.videoConfig.heading?3:-1);let o=i.videoConfig.playlistConfig.videoSwiper;fd(),Ef(`options`,i.swiperOptions)(`navigationConfig`,o==null?null:o.navigation)(`paginationConfig`,o==null?null:o.pagination),fd(2),AD(i.videoEntries);}},dependencies:[zt,$t,Ut,me,_e,Wt,a],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}.video-footer{overflow-x:hidden}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-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
36
36
  `],encapsulation:3})};var co=[`videoElement`],po=n=>({"cursor-grab":n}),nt=class n extends ye{videoElement;video;isDragging=false;hidden=false;cdkDrag=g(ge$1,{self:true});untilDestroyed=Ht();constructor(){super();}get popupClasses(){return this.hidden?[`hidden`]:[`visible`]}onClick(t){t.stopPropagation(),t.preventDefault(),this.onVideoClick();}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.closest(`.letscooee-engagement`);t&&(t.style.zIndex=`10000`),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=true);}ngAfterViewInit(){super.ngAfterViewInit(),setTimeout(()=>{this.autoPlay();},100);}onVideoClick(){if(this.isDragging){this.isDragging=false;return}this.hidden=true,this.onVideoTap(null,this.video,0);}close(){this.hidden=true;let t=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent(`CE Trigger Closed`,{duration:t});}engagementTriggerReceived(t){super.engagementTriggerReceived(t),this.video=this.videoEntries[0].video;}update(){}onDialogClosed(){this.hidden=false;}autoPlay(){let t=this.videoElement.nativeElement;this.hidden||this.playVideo(t);}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-video-popup`]],viewQuery:function(e,i){if(e&1&&oc(co,5),e&2){let o;kf(o=Ff())&&(i.videoElement=o.first);}},hostAttrs:[`role`,`button`,`tabindex`,`0`,`aria-label`,`Open video popup `,`cdkDragBoundary`,`body`],hostVars:2,hostBindings:function(e,i){e&1&&Nf(`keydown.enter`,function(a){return i.onClick(a)})(`keydown.space`,function(a){return i.onClick(a)})(`click`,function(a){return i.onClick(a)}),e&2&&iv(i.popupClasses);},features:[np(Lt()),dD([{directive:ge$1,inputs:[`cdkDragBoundary`,`cdkDragBoundary`]}]),Wa],decls:9,vars:5,consts:[[`videoElement`,``],[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`,`metadata`,`playsinline`,``,3,`muted`,`cooeeVideoSources`]],template:function(e,i){if(e&1){let o=FD();Xa(0,`div`,1)(1,`button`,2),Nf(`click`,function(l){return gu(o),l.stopPropagation(),mu(i.close())}),Cf(2,`cooee-icon`,3),ec(),Xa(3,`div`,4),Cf(4,`cooee-icon`,5),Xa(5,`div`,6),gv(6,`Tap to unmute`),ec()(),Cf(7,`video`,7,0),ec();}e&2&&(Ef(`ngClass`,Sv(3,po,i.isDragging)),fd(7),Ef(`muted`,true)(`cooeeVideoSources`,i.video));},dependencies:[AE,ye$1,_e],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;background-color:#fff}.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}
37
37
  `],encapsulation:3})};var mo=(n,t)=>t.video.id;function uo(n,t){if(n&1&&(Cf(0,`div`,1),bv(1,`safeHtml`)),n&2)Ef(`innerHTML`,Av(1,1,VD().videoConfig.heading),tm);}function fo(n,t){n&1&&(Xa(0,`div`,9),Cf(1,`div`,12),ec());}function go(n,t){if(n&1&&(Xa(0,`div`,11),gv(1),ec()),n&2){let e=VD().$implicit;fd(),Yf(e.title);}}function vo(n,t){if(n&1){let e=FD();Xa(0,`div`,4),Nf(`click`,function(o){let a=gu(e),l=a.$implicit,p=a.$index;return mu(VD().onVideoTap(o,l.video,p))})(`keydown.enter`,function(o){let a=gu(e),l=a.$implicit,p=a.$index;return mu(VD().onVideoTap(o,l.video,p))})(`keydown.space`,function(o){let a=gu(e),l=a.$implicit,p=a.$index;return mu(VD().onVideoTap(o,l.video,p))}),Mu(),Xa(1,`svg`,5),Cf(2,`circle`,6)(3,`circle`,7),ec(),bu(),Xa(4,`div`,8),TD(5,fo,2,0,`div`,9),Xa(6,`video`,10,0),Nf(`loadstart`,function(){let o=gu(e).$implicit;return mu(VD().onVideoLoadStart(o.video.id))})(`canplay`,function(){let o=gu(e).$implicit;return mu(VD().onVideoCanPlay(o.video.id))}),ec()(),TD(8,go,2,1,`div`,11),ec();}if(n&2){let e=t.$implicit,i=t.$index,o=VD();vf(`aria-label`,`Open video story `+(i+1)),fd(5),SD(o.isVideoLoading(e.video.id)?5:-1),fd(),Ef(`poster`,e.video.thumbnail)(`cooeeVideoSources`,e.video)(`prioritySource`,`low`)(`muted`,true),vf(`data-video-id`,e.video.id),fd(2),SD(e.title?8:-1);}}var ot=class n extends ye{constructor(){super();}ngAfterViewInit(){super.ngAfterViewInit(),this.setupIntersectionObserver();}ngOnDestroy(){super.ngOnDestroy();}update(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=cf({type:n,selectors:[[`cooee-video-stories`]],features:[np(Lt()),Wa],decls:4,vars:1,consts:[[`videoEl`,``],[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`],[1,`video-loading-overlay`],[`loop`,``,`playsinline`,``,`preload`,`metadata`,3,`loadstart`,`canplay`,`poster`,`cooeeVideoSources`,`prioritySource`,`muted`],[1,`video-story-title`],[1,`loading-spinner`]],template:function(e,i){e&1&&(TD(0,uo,2,3,`div`,1),Xa(1,`div`,2),ND(2,vo,9,8,`div`,3,mo),ec()),e&2&&(SD(i.videoConfig.heading?0:-1),fd(2),AD(i.videoEntries));},dependencies:[_e,a],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;cursor:pointer;flex-shrink:0}.video-story .video-story-title{margin-top:.25rem;font-size:.7rem;line-height:1.1;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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{position:relative;width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px;position:relative;z-index:1}.video-story .video-wrapper .video-loading-overlay{border-radius:9999px}
38
- `],encapsulation:3})};async function Rs(){let n=await QE(Pi),t=(e,i)=>{let o=Ii(e,{injector:n.injector});customElements.get(i)||customElements.define(i,o);};t(tt,`cooee-sticky-atc`),t(Ke,`cooee-savings-bar`),t(Ge,`cooee-progressbar`),t(it,`cooee-video-playlist`),t(nt,`cooee-video-popup`),t(ot,`cooee-video-stories`),t(Ne,`cooee-product-options-picker`),t(Qe,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-C-HYppnD-CeE47XPS.js').then(e=>{t(e.DebuggerComponent,`cooee-debugger`);}),window.cooeeShowQuickItem=(e,i)=>{n.injector.get(Je).showItemQuickView(e,i);};}
38
+ `],encapsulation:3})};async function Rs(){let n=await QE(Pi),t=(e,i)=>{let o=Ii(e,{injector:n.injector});customElements.get(i)||customElements.define(i,o);};t(tt,`cooee-sticky-atc`),t(Ke,`cooee-savings-bar`),t(Ge,`cooee-progressbar`),t(it,`cooee-video-playlist`),t(nt,`cooee-video-popup`),t(ot,`cooee-video-stories`),t(Ne,`cooee-product-options-picker`),t(Qe,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-DSlPLf0C-B47mfLwp.js').then(e=>{t(e.DebuggerComponent,`cooee-debugger`);}),window.cooeeShowQuickItem=(e,i)=>{n.injector.get(Je).showItemQuickView(e,i);};}
39
39
 
40
- var widgetsDEkPTYjN = /*#__PURE__*/Object.freeze({
40
+ var widgetsDzNSeZS7 = /*#__PURE__*/Object.freeze({
41
41
  __proto__: null,
42
42
  loadAngularWidgets: Rs
43
43
  });
44
44
 
45
- export { $t as $, Af as A, pf as B, Cf as C, zD as D, Ef as E, FE as F, Ge$2 as G, oc as H, kf as I, Ff as J, Ke$1 as K, Lt$2 as L, Mf as M, ND as N, oN as O, Ro as P, zt$2 as Q, Rv as R, Se$1 as S, ws as T, Ut as U, ic as V, W, Xa as X, Yf as Y, Zo as Z, vf as _, a, FD as a0, TD as a1, gu as a2, mu as a3, VD as a4, SD as a5, wf as a6, Cv as a7, Kf as a8, Qf as a9, Dv as aa, xv as ab, rm as ac, widgetsDEkPTYjN as ad, bD as b, cf as c, dD as d, AD as e, fd as f, gv as g, ge$1 as h, iN as i, bv as j, Av as k, tm as l, g as m, ec as n, Nf as o, Ye$1 as p, qo as q, Wt as r, Gt as s, tc as t, AE as u, nc as v, Yo as w, xE as x, ye$1 as y, zt as z };
45
+ export { $t as $, Af as A, pf as B, Cf as C, zD as D, Ef as E, FE as F, Ge$2 as G, oc as H, kf as I, Ff as J, Ke$1 as K, Lt$2 as L, Mf as M, ND as N, oN as O, Ro as P, zt$2 as Q, Rv as R, Se$1 as S, ws as T, Ut as U, ic as V, W, Xa as X, Yf as Y, Zo as Z, vf as _, a, FD as a0, TD as a1, gu as a2, mu as a3, VD as a4, SD as a5, wf as a6, Cv as a7, Kf as a8, Qf as a9, Dv as aa, xv as ab, rm as ac, widgetsDzNSeZS7 as ad, bD as b, cf as c, dD as d, AD as e, fd as f, gv as g, ge$1 as h, iN as i, bv as j, Av as k, tm as l, g as m, ec as n, Nf as o, Ye$1 as p, qo as q, Wt as r, Gt as s, tc as t, AE as u, nc as v, Yo as w, xE as x, ye$1 as y, zt as z };
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": "14.8.1",
4
+ "version": "14.8.2",
5
5
  "scripts": {
6
6
  "postinstall": "bash .dev/setup.sh",
7
7
  "lint": "ng lint",