@letscooee/web-sdk 14.0.1 → 14.0.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,13 +1,13 @@
1
1
  var __require=(x=>typeof require!==`undefined`?require:typeof Proxy!==`undefined`?new Proxy(x,{get:(a,b)=>(typeof require!==`undefined`?require:a)[b]}):x)(function(x){if(typeof require!==`undefined`)return require.apply(this,arguments);throw Error('Calling `require` for "'+x+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});var k=Object.create;var g=Object.defineProperty,l$1=Object.defineProperties,m=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var i=(a,b,c)=>b in a?g(a,b,{enumerable:true,configurable:true,writable:true,value:c}):a[b]=c,r=(a,b)=>{for(var c in b||={})h.call(b,c)&&i(a,c,b[c]);if(f)for(var c of f(b))j.call(b,c)&&i(a,c,b[c]);return a},s$1=(a,b)=>l$1(a,n(b));var t=(a=>typeof __require<`u`?__require:typeof Proxy<`u`?new Proxy(a,{get:(b,c)=>(typeof __require<`u`?__require:b)[c]}):a)(function(a){if(typeof __require<`u`)return __require.apply(this,arguments);throw Error(`Dynamic require of "`+a+`" is not supported`)});var u=(a,b)=>{var c={};for(var d in a)h.call(a,d)&&b.indexOf(d)<0&&(c[d]=a[d]);if(a!=null&&f)for(var d of f(a))b.indexOf(d)<0&&j.call(a,d)&&(c[d]=a[d]);return c};var v=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),w=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:true});},q=(a,b,c,d)=>{if(b&&typeof b==`object`||typeof b==`function`)for(let e of o(b))!h.call(a,e)&&e!==c&&g(a,e,{get:()=>b[e],enumerable:!(d=m(b,e))||d.enumerable});return a};var x=(a,b,c)=>(c=a!=null?k(p(a)):{},q(!a||!a.__esModule?g(c,`default`,{value:a,enumerable:true}):c,a));
2
2
 
3
- var mt=v((dt,Fe)=>{(function(s){if(typeof dt==`object`&&typeof Fe<`u`)Fe.exports=s();else if(typeof define==`function`&&define.amd)define([],s);else {var n;typeof window<`u`?n=window:typeof global<`u`?n=global:typeof self<`u`?n=self:n=this,n.localforage=s();}})(function(){return (function c(v,I,w){function R(T,M){if(!I[T]){if(!v[T]){var p=typeof t==`function`&&t;if(!M&&p)return p(T,true);if(b)return b(T,true);var _=new Error(`Cannot find module '`+T+`'`);throw _.code=`MODULE_NOT_FOUND`,_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,c,v,I,w);}return I[T].exports}for(var b=typeof t==`function`&&t,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),M=w.document.createTextNode(``);T.observe(M,{characterData:true}),b=function(){M.data=m=++m%2;};}else if(!w.setImmediate&&typeof w.MessageChannel<`u`){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0);};}else `document`in w&&`onreadystatechange`in w.document.createElement(`script`)?b=function(){var B=w.document.createElement(`script`);B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null;},w.document.documentElement.appendChild(B);}:b=function(){setTimeout(O,0);};var _,C=[];function O(){_=true;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length;}_=false;}v.exports=j;function j(B){C.push(B)===1&&!_&&b();}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{}],2:[function(c,v,I){var w=c(1);function R(){}var b={},m=[`REJECTED`],T=[`FULFILLED`],M=[`PENDING`];v.exports=p;function p(y){if(typeof y!=`function`)throw new TypeError(`resolver must be a function`);this.state=M,this.queue=[],this.outcome=void 0,y!==R&&j(this,y);}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!=`function`&&this.state===T||typeof A!=`function`&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==M)C(D,this.state===T?y:A,this.outcome);else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A==`function`&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D==`function`&&(this.onRejected=D,this.callRejected=this.otherCallRejected);}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y);},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y);},_.prototype.callRejected=function(y){b.reject(this.promise,y);},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y);};function C(y,A,D){w(function(){var L;try{L=A(D);}catch(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError(`Cannot resolve promise with itself`)):b.resolve(y,L);});}b.resolve=function(y,A){var D=B(O,A);if(D.status===`error`)return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else {y.state=T,y.outcome=A;for(var U=-1,k=y.queue.length;++U<k;)y.queue[U].callFulfilled(A);}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y==`object`||typeof y==`function`)&&typeof A==`function`)return function(){A.apply(y,arguments);}}function j(y,A){var D=false;function L(G){D||(D=true,b.reject(y,G));}function U(G){D||(D=true,b.resolve(y,G));}function k(){A(U,L);}var $=B(k);$.status===`error`&&L($.value);}function B(y,A){var D={};try{D.value=y(A),D.status=`success`;}catch(L){D.status=`error`,D.value=L;}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Ie;function Ie(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ae,le){A.resolve(ae).then(Se,function(re){L||(L=true,b.reject(G,re));});function Se(re){U[le]=re,++k===D&&!L&&(L=true,b.resolve(G,U));}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=true,b.resolve(k,q));},function(q){L||(L=true,b.reject(k,q));});}}},{1:1}],3:[function(c,v,I){(function(w){typeof w.Promise!=`function`&&(w.Promise=c(2));}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{2:2}],4:[function(c,v,I){var w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError(`Cannot call a class as a function`)}function b(){try{if(typeof indexedDB<`u`)return indexedDB;if(typeof webkitIndexedDB<`u`)return webkitIndexedDB;if(typeof mozIndexedDB<`u`)return mozIndexedDB;if(typeof OIndexedDB<`u`)return OIndexedDB;if(typeof msIndexedDB<`u`)return msIndexedDB}catch{return}}var m=b();function T(){try{if(!m||!m.open)return !1;var e=typeof openDatabase<`u`&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch==`function`&&fetch.toString().indexOf(`[native code`)!==-1;return (!e||r)&&typeof indexedDB<`u`&&typeof IDBKeyRange<`u`}catch{return false}}function M(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!==`TypeError`)throw o;for(var i=new(typeof BlobBuilder<`u`?BlobBuilder:typeof MSBlobBuilder<`u`?MSBlobBuilder:typeof MozBlobBuilder<`u`?MozBlobBuilder:WebKitBlobBuilder),a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>`u`&&c(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t);},function(t){r(t);});}function C(e,r,t){typeof r==`function`&&e.then(r),typeof t==`function`&&e.catch(t);}function O(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var B=`local-forage-detect-blob-support`,z=void 0,F={},Ie=Object.prototype.toString,Z=`readonly`,y=`readwrite`;function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(B,y),i=M([``]);t.objectStore(B).put(i,`key`),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(false);},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);r(navigator.userAgent.match(/Edge\//)||!a||parseInt(a[1],10)>=43);};}).catch(function(){return false})}function L(e){return typeof z==`boolean`?p.resolve(z):D(e).then(function(r){return z=r,z})}function U(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a;}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise;}function k(e){var t=F[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var i=F[e.name].deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||$e(),e.db)if(r)U(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B);}catch(l){if(l.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+u.oldVersion+` to version `+u.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error);},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close();},t(u),k(e);};})}function q(e){return G(e,false)}function ae(e){return G(e,true)}function le(e,r){if(!e.db)return true;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o);}return true}return false}function Se(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){r({__local_forage_encoded_blob:true,data:btoa(a.target.result||``),type:e.type});},i.readAsBinaryString(e);})}function re(e){return M([A(atob(e.data))],{type:e.type})}function We(e){return e&&e.__local_forage_encoded_blob}function Ct(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function At(e){U(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null);}return e.db=null,q(e).then(function(o){return e.db=o,le(e)?ae(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o;}).catch(function(o){throw $(e,o),o})}function K(e,r,t,i){i===void 0&&(i=1);try{t(null,e.db.transaction(e.storeName,r));}catch(o){if(i>0&&(!e.db||o.name===`InvalidStateError`||o.name===`NotFoundError`))return p.resolve().then(function(){if(!e.db||o.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ae(e)}).then(function(){return At(e).then(function(){K(e,r,t,i-1);})}).catch(t);t(o);}}function $e(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function xt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=$e(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Ct);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u));}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,le(t,r._defaultConfig.version)?ae(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version);}})}function Nt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),We(g)&&(g=re(g)),a(g);},d.onerror=function(){o(d.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Lt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;We(S)&&(S=re(S));var x=e(S,E.key,g++);x!==void 0?a(x):E.continue();}else a();},d.onerror=function(){o(d.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ot(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){var f;i.ready().then(function(){return f=i._dbInfo,Ie.call(r)===`[object Blob]`?L(f.db).then(function(l){return l?r:Se(r)}):r}).then(function(l){K(i._dbInfo,y,function(d,g){if(d)return u(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l);},g.onabort=g.onerror=function(){u(S.error?S.error:S.transaction.error);};}catch(x){u(x);}});}).catch(u);});return _(a,t),a}function Pt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).delete(e);f.oncomplete=function(){a();},f.onerror=function(){o(d.error);},f.onabort=function(){o(d.error?d.error:d.transaction.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Mt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).clear();u.oncomplete=function(){i();},u.onabort=u.onerror=function(){a(l.error?l.error:l.transaction.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Vt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).count();l.onsuccess=function(){i(l.result);},l.onerror=function(){a(l.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Bt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e));},g.onerror=function(){o(g.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ft(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue();},l.onerror=function(){a(l.error);};}catch(g){a(g);}});}).catch(a);});return _(t,e),t}function Ut(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject(`Invalid arguments`);else {var u=e.name===t.name&&i._dbInfo.db?p.resolve(i._dbInfo.db):q(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l;}return new p(function(N,V){var P=m.open(e.name,l);P.onerror=function(H){P.result.close(),V(H);},P.onupgradeneeded=function(){P.result.deleteObjectStore(e.storeName);},P.onsuccess=function(){var H=P.result;H.close(),N(H);};}).then(function(N){d.db=N;for(var V=0;V<g.length;V++){var P=g[V];P._dbInfo.db=N,k(P._dbInfo);}}).catch(function(N){throw ($(e,N)||p.resolve()).catch(function(){}),N})}}):a=u.then(function(f){U(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null;}return new p(function(x,N){var V=m.deleteDatabase(e.name);V.onerror=function(){var P=V.result;P&&P.close(),N(V.error);},V.onblocked=function(){console.warn(`dropInstance blocked for database "`+e.name+`" until all open connections are closed`);},V.onsuccess=function(){var P=V.result;P&&P.close(),x(P);};}).then(function(x){l.db=x;for(var N=0;N<d.length;N++){var V=d[N];k(V._dbInfo);}}).catch(function(x){throw ($(e,x)||p.resolve()).catch(function(){}),x})});}return _(a,r),a}var kt={_driver:`asyncStorage`,_initStorage:xt,_support:T(),iterate:Lt,getItem:Nt,setItem:Ot,removeItem:Pt,clear:Mt,length:Vt,key:Bt,keys:Ft,dropInstance:Ut};function Wt(){return typeof openDatabase==`function`}var X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,$t=`~~local_forage_type~`,Ge=/^~~local_forage_type~([^~]+)~/,de=`__lfsc__:`,De=de.length,Re=`arbf`,Ce=`blob`,He=`si08`,Ye=`ui08`,je=`uic8`,ze=`si16`,qe=`si32`,Ke=`ur16`,Xe=`ui32`,Je=`fl32`,Qe=`fl64`,Ze=De+Re.length,et=Object.prototype.toString;function tt(e){var r=e.length*.75,t=e.length,i,a=0,o,u,f,l;e[e.length-1]===`=`&&(r--,e[e.length-2]===`=`&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Ae(e){var r=new Uint8Array(e),t=``,i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+`=`:r.length%3===1&&(t=t.substring(0,t.length-2)+`==`),t}function Gt(e,r){var t=``;if(e&&(t=et.call(e)),e&&(t===`[object ArrayBuffer]`||e.buffer&&et.call(e.buffer)===`[object ArrayBuffer]`)){var i,a=de;e instanceof ArrayBuffer?(i=e,a+=Re):(i=e.buffer,t===`[object Int8Array]`?a+=He:t===`[object Uint8Array]`?a+=Ye:t===`[object Uint8ClampedArray]`?a+=je:t===`[object Int16Array]`?a+=ze:t===`[object Uint16Array]`?a+=Ke:t===`[object Int32Array]`?a+=qe:t===`[object Uint32Array]`?a+=Xe:t===`[object Float32Array]`?a+=Je:t===`[object Float64Array]`?a+=Qe:r(new Error(`Failed to get type for BinaryArray`))),r(a+Ae(i));}else if(t===`[object Blob]`){var o=new FileReader;o.onload=function(){var u=$t+e.type+`~`+Ae(this.result);r(de+Ce+u);},o.readAsArrayBuffer(e);}else try{r(JSON.stringify(e));}catch(u){console.error(`Couldn't convert value into a JSON string: `,e),r(null,u);}}function Ht(e){if(e.substring(0,De)!==de)return JSON.parse(e);var r=e.substring(Ze),t=e.substring(De,Ze),i;if(t===Ce&&Ge.test(r)){var a=r.match(Ge);i=a[1],r=r.substring(a[0].length);}var o=tt(r);switch(t){case Re:return o;case Ce:return M([o],{type:i});case He:return new Int8Array(o);case Ye:return new Uint8Array(o);case je:return new Uint8ClampedArray(o);case ze:return new Int16Array(o);case Ke:return new Uint16Array(o);case qe:return new Int32Array(o);case Xe:return new Uint32Array(o);case Je:return new Float32Array(o);case Qe:return new Float64Array(o);default:throw new Error(`Unkown type: `+t)}}var xe={serialize:Gt,deserialize:Ht,stringToBuffer:tt,bufferToString:Ae};function rt(e,r,t,i){e.executeSql(`CREATE TABLE IF NOT EXISTS `+r.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],t,i);}function Yt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!=`string`?e[i].toString():e[i];var a=new p(function(o,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size);}catch(f){return u(f)}t.db.transaction(function(f){rt(f,t,function(){r._dbInfo=t,o();},function(l,d){u(d);});},u);});return t.serializer=xe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[r.storeName],function(l,d){d.rows.length?o(l,f):rt(l,r,function(){l.executeSql(t,i,a,o);},o);},o):o(u,f);},o);}function jt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName+` WHERE key = ? LIMIT 1`,[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function zt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var x=g.item(S),N=x.value;if(N&&(N=u.serializer.deserialize(N)),N=e(N,x.key,S+1),N!==void 0){a(N);return}}a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function nt(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,`INSERT OR REPLACE INTO `+d.storeName+` (key, value) VALUES (?, ?)`,[e,g],function(){u(l);},function(x,N){f(N);});},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(nt.apply(a,[e,l,t,i-1]));return}f(S);}});});}).catch(f);});return _(o,t),o}function qt(e,r,t){return nt.apply(this,[e,r,t,1])}function Kt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`DELETE FROM `+u.storeName+` WHERE key = ?`,[e],function(){a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Xt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`DELETE FROM `+o.storeName,[],function(){i();},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Jt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`SELECT COUNT(key) as c FROM `+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Qt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT key FROM `+u.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(l,d){a(d.rows.length?d.rows.item(0).key:null);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Zt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`SELECT key FROM `+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function er(e){return new p(function(r,t){e.transaction(function(i){i.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'`,[],function(a,o){for(var u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u});},function(a,o){t(o);});},function(i){t(i);});})}function tr(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,``,``,0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(er(u));}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(x){return new p(function(N,V){l.executeSql(`DROP TABLE IF EXISTS `+x,[],function(){N();},function(P,H){V(H);});})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u();}).catch(function(x){f(x);});},function(l){f(l);});})}):a=p.reject(`Invalid arguments`),_(a,r),a}var rr={_driver:`webSQLStorage`,_initStorage:Yt,_support:Wt(),iterate:zt,getItem:jt,setItem:qt,removeItem:Kt,clear:Xt,length:Jt,key:Qt,keys:Zt,dropInstance:tr};function nr(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return false}}function ot(e,r){var t=e.name+`/`;return e.storeName!==r.storeName&&(t+=e.storeName+`/`),t}function or(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return true}}function ir(){return !or()||localStorage.length>0}function ar(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=ot(e,r._defaultConfig),ir()?(r._dbInfo=t,t.serializer=xe,p.resolve()):p.reject()}function sr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o);}});return _(t,e),t}function ur(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function cr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(u),l++),E!==void 0)return E}}});return _(i,r),i}function fr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e);}catch{o=null;}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length));}return o});return _(t,e),t}function dr(e){var t=this.keys().then(function(i){return i.length});return _(t,e),t}function mr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e);});return _(i,r),i}function gr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o);}catch(E){(E.name===`QuotaExceededError`||E.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&f(E),f(E);}});})});return _(a,t),a}function pr(e,r){if(r=j.apply(this,arguments),e=typeof e!=`function`&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName;}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(ot(e,i._defaultConfig)):o(e.name+`/`);}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f);}}):a=p.reject(`Invalid arguments`),_(a,r),a}var hr={_driver:`localStorageWrapper`,_initStorage:ar,_support:nr(),iterate:cr,getItem:ur,setItem:gr,removeItem:mr,clear:sr,length:dr,key:fr,keys:lr,dropInstance:pr},vr=function(r,t){return r===t||typeof r==`number`&&typeof t==`number`&&isNaN(r)&&isNaN(t)},yr=function(r,t){for(var i=r.length,a=0;a<i;){if(vr(r[a],t))return true;a++;}return false},it=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},se={},at={},ne={INDEXEDDB:kt,WEBSQL:rr,LOCALSTORAGE:hr},Er=[ne.INDEXEDDB._driver,ne.WEBSQL._driver,ne.LOCALSTORAGE._driver],me=[`dropInstance`],Ne=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(me),_r={description:``,driver:Er.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function br(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})};}function Le(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(it(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t]);}return arguments[0]}v.exports=new((function(){function e(r){R(this,e);for(var t in ne)if(ne.hasOwnProperty(t)){var i=ne[t],a=i._driver;this[t]=a,se[a]||this.defineDriver(i);}this._defaultConfig=Le({},_r),this._config=Le({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=false,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){});}return e.prototype.config=function(t){if((typeof t>`u`?`undefined`:w(t))===`object`){if(this._ready)return new Error(`Can't call config() after localforage has been used.`);for(var i in t){if(i===`storeName`&&(t[i]=t[i].replace(/\W/g,`_`)),i===`version`&&typeof t[i]!=`number`)return new Error(`Database version must be a number.`);this._config[i]=t[i];}return `driver`in t&&t.driver?this.setDriver(this._config.driver):true}else return typeof t==`string`?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(u,f){try{var l=t._driver,d=new Error(`Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver`);if(!t._driver){f(d);return}for(var g=Ne.concat(`_initStorage`),E=0,S=g.length;E<S;E++){var x=g[E];if((!yr(me,x)||t[x])&&typeof t[x]!=`function`){f(d);return}}var V=function(){for(var ue=function(Sr){return function(){var Dr=new Error(`Method `+Sr+` is not implemented by the current driver`),st=p.reject(Dr);return _(st,arguments[arguments.length-1]),st}},Oe=0,Ir=me.length;Oe<Ir;Oe++){var Pe=me[Oe];t[Pe]||(t[Pe]=ue(Pe));}};V();var P=function(ue){se[l]&&console.info(`Redefining LocalForage driver: `+l),se[l]=t,at[l]=ue,u();};`_support`in t?t._support&&typeof t._support==`function`?t._support().then(P,f):P(!!t._support):P(!0);}catch(H){f(H);}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=se[t]?p.resolve(se[t]):p.reject(new Error(`Driver not found.`));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(xe);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;it(t)||(t=[t]);var u=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver();}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function x(){for(;S<E.length;){var N=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(N).then(l).catch(x)}f();var V=new Error(`No available storage method found.`);return o._driverSet=p.reject(V),o._driverSet}return x()}}return this._driverSet=(this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve()).then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u);})}).catch(function(){f();var E=new Error(`No available storage method found.`);return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return !!at[t]},e.prototype._extend=function(t){Le(this,t);},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var u=t[a];this.supports(u)&&i.push(u);}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Ne.length;t<i;t++)br(this,Ne[t]);},e.prototype.createInstance=function(t){return new e(t)},e})());},{3:3}]},{},[4])(4)});});var Et=v((yt,_e)=>{(function(s){var n={};n.VERSION=`1.6.1`;var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],M,p;for(p=1;p<m.length;p++)for(M in m[p])!(M in T)&&m[p].hasOwnProperty(M)&&(T[M]=m[p][M]);return T},w=function(m,T){return {value:m,name:T}};n.TRACE=w(1,`TRACE`),n.DEBUG=w(2,`DEBUG`),n.INFO=w(3,`INFO`),n.TIME=w(4,`TIME`),n.WARN=w(5,`WARN`),n.ERROR=w(8,`ERROR`),n.OFF=w(99,`OFF`);var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info;};R.prototype={setLevel:function(m){m&&`value`in m&&(this.context.filterLevel=m);},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.value},trace:function(){this.invoke(n.TRACE,arguments);},debug:function(){this.invoke(n.DEBUG,arguments);},info:function(){this.invoke(n.INFO,arguments);},warn:function(){this.invoke(n.WARN,arguments);},error:function(){this.invoke(n.ERROR,arguments);},time:function(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`start`]);},timeEnd:function(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`end`]);},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context));}};var b=new R({filterLevel:n.OFF});((function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info;}))(),n.setHandler=function(m){h=m;},n.setLevel=function(m){b.setLevel(m);for(var T in c)c.hasOwnProperty(T)&&c[T].setLevel(m);},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift(`[`+C.name+`]`);};var T={},M=function(p,_){Function.prototype.apply.call(p,console,_);};return typeof console>`u`?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?`[`+_.name+`] `:``)+p[0],p[1]===`start`?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):M(C,[O+`: `+(new Date().getTime()-T[O])+`ms`])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),M(C,p));}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m));},n.setDefaults=n.useDefaults,typeof define==`function`&&define.amd?define(n):typeof _e<`u`&&_e.exports?_e.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n);})(yt);});var Me=`14.0.1`;var Cr=Me.split(`-`)[0].split(`.`).slice(0,3).map(s=>s.padStart(2,`0`)).join(``),Hr=`WEB`,lt=`CooeeSDK`,Q=Me,Yr=parseInt(Cr,10);var jr=[`collection`,`product`,`cart`],zr=[{identifier:`#flo-checkout-wrapper`,gateway:`Shopflow`},{identifier:`#fastrr-main-container`,gateway:`Shiprocket`},{identifier:`#gokwik-modal-wrapper`,gateway:`Gokwik`},{identifier:`#zecpe`,gateway:`Ecom 360`}],qr=[`View Item`,`View Cart`,`View Collection`],Kr=[`CE Screen View`,`View Collection`,`View Item`,`View Cart`],Xr=`https://cdn.jsdelivr.net/npm/swiper@11`;function Qr(s){return `(\u23F0 took: ${Ve(s)})`}function Ve(s){if(s<0)return `${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+`m`),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+`s`),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+`ms`),h.length||h.push(`0ms`),h.join(` `)}function Be(){return window.CooeeSDK.runtimeData}function tn(){return Ve(Date.now()-Be().sdkLoadTime.getTime())}var Ue=x(mt());function ge(s){return Ue.default.createInstance({name:`lc`,storeName:s,driver:Ue.default.LOCALSTORAGE})}var oe=class{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var fe=class extends oe{static storeName=`usr`;static{this.storage=ge(this.storeName);}};var gt=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,te={apiURL:`https://api.sdk.letscooee.com`,debug:false,mode:`production`,baseURL:gt,styleURL:`${gt}/styles.min.css`};var pe=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n==`object`&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:false}static convertObjectToArray(n,h){return h.reduce((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var he=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.widgetCustomisation=n.widgetCustomisation,this}};var ve=class extends oe{static storeName=`ses`;static{this.storage=ge(this.storeName);}};var ye=class{static format(n,h){return h.replace(/{{\s*(\w+)\s*}}/,(v,I)=>{switch(I){case `amount`:return this.formatWithDelimiters(n,2);case `amount_no_decimals`:return this.formatWithDelimiters(n,0);case `amount_with_comma_separator`:return this.formatWithDelimiters(n,2,`.`,`,`);case `amount_no_decimals_with_comma_separator`:return this.formatWithDelimiters(n,0,`.`,`,`);case `amount_with_apostrophe_separator`:return this.formatWithDelimiters(n,2,`'`,`.`);case `amount_no_decimals_with_space_separator`:return this.formatWithDelimiters(n,0,` `);case `amount_with_space_separator`:return this.formatWithDelimiters(n,2,` `,`,`);case `amount_with_period_and_space_separator`:return this.formatWithDelimiters(n,2,` `,`.`);default:return v}})}static formatWithDelimiters(n,h=2,c=`,`,v=`.`){if(isNaN(n)||n==null)return `0`;let w=(n/100).toFixed(h).split(`.`);return w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1`+c)+(w[1]?v+w[1]:``)}};function Rn(s){try{return new URL(s)}catch{return}}function Cn(s){return !s||s===`null`||s===`undefined`}function An(s,n){let h=s.indexOf(n);return h===-1?false:(s.splice(h,1),true)}function xn(s,n,h){return {[s]:Ar(n,h),[s+`_wo_currency`]:n}}function Ar(s,n){if(s==0&&n)return `Free`;let h=Be(),c=he.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn(`Currency code is not set in RuntimeData`);let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=ye.format(s*100,w);else {let b;try{b=new Intl.NumberFormat(pt(),{style:`currency`,currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2});}catch(m){return ke(m,`format-currency`,{extra:{currentCurrency:I,shopCurrency:v}}),``}R=b.format(s),R=R.replace(`₹`,`Rs. `),c.money?.showCurrency&&I!==`INR`&&(R=R.concat(` ${I}`));}return R}function Nn(s){let n=pt();try{return new Intl.NumberFormat(n,{notation:`compact`}).format(s)}catch(h){return ke(h,`format-number`,{extra:{lang:n,value:s}}),s.toString()}}function pt(){let s=`en`;return typeof navigator<`u`&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(`;`)[0],s=s.split(`-`)[0],s||`en`}var Ee;function ht(){if(Ee)return Ee;try{return Ee=Intl.DateTimeFormat().resolvedOptions().timeZone,Ee}catch{return ``}}function vt(s){document.readyState!==`loading`?s():document.addEventListener(`DOMContentLoaded`,s);}function Ln(s){let n=document.createElement(`span`);n.id=`snackbar`,n.innerText=s,document.body.appendChild(n),n.className=`show`,setTimeout(()=>{n.classList.remove(`show`),document.body.removeChild(n);},5e3);}async function xr(s,n=7,h=document){let c=1,v=document.querySelectorAll(`nonexistent-tag`);for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await pe.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++;}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function On(s,n=10,h=document){return (await xr(s,n,h)).item(0)}async function Nr(s){let[n,h,c]=await Promise.all([fe.get(`did`),ve.get(`id`,``),fe.get(`sessionNumber`,1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Pn(s){let n=await Nr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Mn(s,n,h,c=false){Object.defineProperty(s,n,{enumerable:false,configurable:false,writable:c,value:h});}function Vn(s){if(s%100>=11&&s%100<=13)return s+`th`;switch(s%10){case 1:return s+`st`;case 2:return s+`nd`;case 3:return s+`rd`;default:return s+`th`}}function Bn(s,n){return !n?s:n+s}var W=x(Et());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n);}static verbose(...n){W.default.debug(...n);}static error(...n){W.default.error(...n);}static warn(...n){W.default.warn(...n);}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(` `)}),this.addToDebugger();}static trace(...n){W.default.trace(...n);}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector(`cooee-debugger`),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]));}};function $n(s=lt){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`);}}),Lr()&&(localStorage.cooeeLogLevel=`TRACE`),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(W.default.OFF);}function Lr(){let s=_t();return s===`1`||s===`on`}function _t(){return new URL(location.href).searchParams?.get(`cooee-debug`)}function Gn(){let s=[`display: inline-block;`,`font-size: 14px;`,`background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);`,`color: white;`,`padding: 4px;`,`border-radius: 4px;`].join(` `),n=`
3
+ var mt=v((dt,Fe)=>{(function(s){if(typeof dt==`object`&&typeof Fe<`u`)Fe.exports=s();else if(typeof define==`function`&&define.amd)define([],s);else {var n;typeof window<`u`?n=window:typeof global<`u`?n=global:typeof self<`u`?n=self:n=this,n.localforage=s();}})(function(){return (function c(v,I,w){function R(T,M){if(!I[T]){if(!v[T]){var p=typeof t==`function`&&t;if(!M&&p)return p(T,true);if(b)return b(T,true);var _=new Error(`Cannot find module '`+T+`'`);throw _.code=`MODULE_NOT_FOUND`,_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,c,v,I,w);}return I[T].exports}for(var b=typeof t==`function`&&t,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),M=w.document.createTextNode(``);T.observe(M,{characterData:true}),b=function(){M.data=m=++m%2;};}else if(!w.setImmediate&&typeof w.MessageChannel<`u`){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0);};}else `document`in w&&`onreadystatechange`in w.document.createElement(`script`)?b=function(){var B=w.document.createElement(`script`);B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null;},w.document.documentElement.appendChild(B);}:b=function(){setTimeout(O,0);};var _,C=[];function O(){_=true;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length;}_=false;}v.exports=j;function j(B){C.push(B)===1&&!_&&b();}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{}],2:[function(c,v,I){var w=c(1);function R(){}var b={},m=[`REJECTED`],T=[`FULFILLED`],M=[`PENDING`];v.exports=p;function p(y){if(typeof y!=`function`)throw new TypeError(`resolver must be a function`);this.state=M,this.queue=[],this.outcome=void 0,y!==R&&j(this,y);}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!=`function`&&this.state===T||typeof A!=`function`&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==M)C(D,this.state===T?y:A,this.outcome);else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A==`function`&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D==`function`&&(this.onRejected=D,this.callRejected=this.otherCallRejected);}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y);},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y);},_.prototype.callRejected=function(y){b.reject(this.promise,y);},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y);};function C(y,A,D){w(function(){var L;try{L=A(D);}catch(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError(`Cannot resolve promise with itself`)):b.resolve(y,L);});}b.resolve=function(y,A){var D=B(O,A);if(D.status===`error`)return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else {y.state=T,y.outcome=A;for(var U=-1,k=y.queue.length;++U<k;)y.queue[U].callFulfilled(A);}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y==`object`||typeof y==`function`)&&typeof A==`function`)return function(){A.apply(y,arguments);}}function j(y,A){var D=false;function L(G){D||(D=true,b.reject(y,G));}function U(G){D||(D=true,b.resolve(y,G));}function k(){A(U,L);}var $=B(k);$.status===`error`&&L($.value);}function B(y,A){var D={};try{D.value=y(A),D.status=`success`;}catch(L){D.status=`error`,D.value=L;}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Ie;function Ie(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ae,le){A.resolve(ae).then(Se,function(re){L||(L=true,b.reject(G,re));});function Se(re){U[le]=re,++k===D&&!L&&(L=true,b.resolve(G,U));}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=true,b.resolve(k,q));},function(q){L||(L=true,b.reject(k,q));});}}},{1:1}],3:[function(c,v,I){(function(w){typeof w.Promise!=`function`&&(w.Promise=c(2));}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{2:2}],4:[function(c,v,I){var w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError(`Cannot call a class as a function`)}function b(){try{if(typeof indexedDB<`u`)return indexedDB;if(typeof webkitIndexedDB<`u`)return webkitIndexedDB;if(typeof mozIndexedDB<`u`)return mozIndexedDB;if(typeof OIndexedDB<`u`)return OIndexedDB;if(typeof msIndexedDB<`u`)return msIndexedDB}catch{return}}var m=b();function T(){try{if(!m||!m.open)return !1;var e=typeof openDatabase<`u`&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch==`function`&&fetch.toString().indexOf(`[native code`)!==-1;return (!e||r)&&typeof indexedDB<`u`&&typeof IDBKeyRange<`u`}catch{return false}}function M(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!==`TypeError`)throw o;for(var i=new(typeof BlobBuilder<`u`?BlobBuilder:typeof MSBlobBuilder<`u`?MSBlobBuilder:typeof MozBlobBuilder<`u`?MozBlobBuilder:WebKitBlobBuilder),a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>`u`&&c(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t);},function(t){r(t);});}function C(e,r,t){typeof r==`function`&&e.then(r),typeof t==`function`&&e.catch(t);}function O(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var B=`local-forage-detect-blob-support`,z=void 0,F={},Ie=Object.prototype.toString,Z=`readonly`,y=`readwrite`;function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(B,y),i=M([``]);t.objectStore(B).put(i,`key`),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(false);},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);r(navigator.userAgent.match(/Edge\//)||!a||parseInt(a[1],10)>=43);};}).catch(function(){return false})}function L(e){return typeof z==`boolean`?p.resolve(z):D(e).then(function(r){return z=r,z})}function U(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a;}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise;}function k(e){var t=F[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var i=F[e.name].deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||$e(),e.db)if(r)U(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B);}catch(l){if(l.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+u.oldVersion+` to version `+u.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error);},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close();},t(u),k(e);};})}function q(e){return G(e,false)}function ae(e){return G(e,true)}function le(e,r){if(!e.db)return true;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o);}return true}return false}function Se(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){r({__local_forage_encoded_blob:true,data:btoa(a.target.result||``),type:e.type});},i.readAsBinaryString(e);})}function re(e){return M([A(atob(e.data))],{type:e.type})}function We(e){return e&&e.__local_forage_encoded_blob}function Ct(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function At(e){U(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null);}return e.db=null,q(e).then(function(o){return e.db=o,le(e)?ae(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o;}).catch(function(o){throw $(e,o),o})}function K(e,r,t,i){i===void 0&&(i=1);try{t(null,e.db.transaction(e.storeName,r));}catch(o){if(i>0&&(!e.db||o.name===`InvalidStateError`||o.name===`NotFoundError`))return p.resolve().then(function(){if(!e.db||o.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ae(e)}).then(function(){return At(e).then(function(){K(e,r,t,i-1);})}).catch(t);t(o);}}function $e(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function xt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=$e(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Ct);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u));}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,le(t,r._defaultConfig.version)?ae(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version);}})}function Nt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),We(g)&&(g=re(g)),a(g);},d.onerror=function(){o(d.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Lt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;We(S)&&(S=re(S));var x=e(S,E.key,g++);x!==void 0?a(x):E.continue();}else a();},d.onerror=function(){o(d.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ot(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){var f;i.ready().then(function(){return f=i._dbInfo,Ie.call(r)===`[object Blob]`?L(f.db).then(function(l){return l?r:Se(r)}):r}).then(function(l){K(i._dbInfo,y,function(d,g){if(d)return u(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l);},g.onabort=g.onerror=function(){u(S.error?S.error:S.transaction.error);};}catch(x){u(x);}});}).catch(u);});return _(a,t),a}function Pt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).delete(e);f.oncomplete=function(){a();},f.onerror=function(){o(d.error);},f.onabort=function(){o(d.error?d.error:d.transaction.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Mt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).clear();u.oncomplete=function(){i();},u.onabort=u.onerror=function(){a(l.error?l.error:l.transaction.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Vt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).count();l.onsuccess=function(){i(l.result);},l.onerror=function(){a(l.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Bt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e));},g.onerror=function(){o(g.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ft(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue();},l.onerror=function(){a(l.error);};}catch(g){a(g);}});}).catch(a);});return _(t,e),t}function Ut(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject(`Invalid arguments`);else {var u=e.name===t.name&&i._dbInfo.db?p.resolve(i._dbInfo.db):q(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l;}return new p(function(N,V){var P=m.open(e.name,l);P.onerror=function(H){P.result.close(),V(H);},P.onupgradeneeded=function(){P.result.deleteObjectStore(e.storeName);},P.onsuccess=function(){var H=P.result;H.close(),N(H);};}).then(function(N){d.db=N;for(var V=0;V<g.length;V++){var P=g[V];P._dbInfo.db=N,k(P._dbInfo);}}).catch(function(N){throw ($(e,N)||p.resolve()).catch(function(){}),N})}}):a=u.then(function(f){U(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null;}return new p(function(x,N){var V=m.deleteDatabase(e.name);V.onerror=function(){var P=V.result;P&&P.close(),N(V.error);},V.onblocked=function(){console.warn(`dropInstance blocked for database "`+e.name+`" until all open connections are closed`);},V.onsuccess=function(){var P=V.result;P&&P.close(),x(P);};}).then(function(x){l.db=x;for(var N=0;N<d.length;N++){var V=d[N];k(V._dbInfo);}}).catch(function(x){throw ($(e,x)||p.resolve()).catch(function(){}),x})});}return _(a,r),a}var kt={_driver:`asyncStorage`,_initStorage:xt,_support:T(),iterate:Lt,getItem:Nt,setItem:Ot,removeItem:Pt,clear:Mt,length:Vt,key:Bt,keys:Ft,dropInstance:Ut};function Wt(){return typeof openDatabase==`function`}var X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,$t=`~~local_forage_type~`,Ge=/^~~local_forage_type~([^~]+)~/,de=`__lfsc__:`,De=de.length,Re=`arbf`,Ce=`blob`,He=`si08`,Ye=`ui08`,je=`uic8`,ze=`si16`,qe=`si32`,Ke=`ur16`,Xe=`ui32`,Je=`fl32`,Qe=`fl64`,Ze=De+Re.length,et=Object.prototype.toString;function tt(e){var r=e.length*.75,t=e.length,i,a=0,o,u,f,l;e[e.length-1]===`=`&&(r--,e[e.length-2]===`=`&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Ae(e){var r=new Uint8Array(e),t=``,i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+`=`:r.length%3===1&&(t=t.substring(0,t.length-2)+`==`),t}function Gt(e,r){var t=``;if(e&&(t=et.call(e)),e&&(t===`[object ArrayBuffer]`||e.buffer&&et.call(e.buffer)===`[object ArrayBuffer]`)){var i,a=de;e instanceof ArrayBuffer?(i=e,a+=Re):(i=e.buffer,t===`[object Int8Array]`?a+=He:t===`[object Uint8Array]`?a+=Ye:t===`[object Uint8ClampedArray]`?a+=je:t===`[object Int16Array]`?a+=ze:t===`[object Uint16Array]`?a+=Ke:t===`[object Int32Array]`?a+=qe:t===`[object Uint32Array]`?a+=Xe:t===`[object Float32Array]`?a+=Je:t===`[object Float64Array]`?a+=Qe:r(new Error(`Failed to get type for BinaryArray`))),r(a+Ae(i));}else if(t===`[object Blob]`){var o=new FileReader;o.onload=function(){var u=$t+e.type+`~`+Ae(this.result);r(de+Ce+u);},o.readAsArrayBuffer(e);}else try{r(JSON.stringify(e));}catch(u){console.error(`Couldn't convert value into a JSON string: `,e),r(null,u);}}function Ht(e){if(e.substring(0,De)!==de)return JSON.parse(e);var r=e.substring(Ze),t=e.substring(De,Ze),i;if(t===Ce&&Ge.test(r)){var a=r.match(Ge);i=a[1],r=r.substring(a[0].length);}var o=tt(r);switch(t){case Re:return o;case Ce:return M([o],{type:i});case He:return new Int8Array(o);case Ye:return new Uint8Array(o);case je:return new Uint8ClampedArray(o);case ze:return new Int16Array(o);case Ke:return new Uint16Array(o);case qe:return new Int32Array(o);case Xe:return new Uint32Array(o);case Je:return new Float32Array(o);case Qe:return new Float64Array(o);default:throw new Error(`Unkown type: `+t)}}var xe={serialize:Gt,deserialize:Ht,stringToBuffer:tt,bufferToString:Ae};function rt(e,r,t,i){e.executeSql(`CREATE TABLE IF NOT EXISTS `+r.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],t,i);}function Yt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!=`string`?e[i].toString():e[i];var a=new p(function(o,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size);}catch(f){return u(f)}t.db.transaction(function(f){rt(f,t,function(){r._dbInfo=t,o();},function(l,d){u(d);});},u);});return t.serializer=xe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[r.storeName],function(l,d){d.rows.length?o(l,f):rt(l,r,function(){l.executeSql(t,i,a,o);},o);},o):o(u,f);},o);}function jt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName+` WHERE key = ? LIMIT 1`,[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function zt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var x=g.item(S),N=x.value;if(N&&(N=u.serializer.deserialize(N)),N=e(N,x.key,S+1),N!==void 0){a(N);return}}a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function nt(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,`INSERT OR REPLACE INTO `+d.storeName+` (key, value) VALUES (?, ?)`,[e,g],function(){u(l);},function(x,N){f(N);});},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(nt.apply(a,[e,l,t,i-1]));return}f(S);}});});}).catch(f);});return _(o,t),o}function qt(e,r,t){return nt.apply(this,[e,r,t,1])}function Kt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`DELETE FROM `+u.storeName+` WHERE key = ?`,[e],function(){a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Xt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`DELETE FROM `+o.storeName,[],function(){i();},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Jt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`SELECT COUNT(key) as c FROM `+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Qt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT key FROM `+u.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(l,d){a(d.rows.length?d.rows.item(0).key:null);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Zt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`SELECT key FROM `+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function er(e){return new p(function(r,t){e.transaction(function(i){i.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'`,[],function(a,o){for(var u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u});},function(a,o){t(o);});},function(i){t(i);});})}function tr(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,``,``,0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(er(u));}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(x){return new p(function(N,V){l.executeSql(`DROP TABLE IF EXISTS `+x,[],function(){N();},function(P,H){V(H);});})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u();}).catch(function(x){f(x);});},function(l){f(l);});})}):a=p.reject(`Invalid arguments`),_(a,r),a}var rr={_driver:`webSQLStorage`,_initStorage:Yt,_support:Wt(),iterate:zt,getItem:jt,setItem:qt,removeItem:Kt,clear:Xt,length:Jt,key:Qt,keys:Zt,dropInstance:tr};function nr(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return false}}function ot(e,r){var t=e.name+`/`;return e.storeName!==r.storeName&&(t+=e.storeName+`/`),t}function or(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return true}}function ir(){return !or()||localStorage.length>0}function ar(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=ot(e,r._defaultConfig),ir()?(r._dbInfo=t,t.serializer=xe,p.resolve()):p.reject()}function sr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o);}});return _(t,e),t}function ur(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function cr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(u),l++),E!==void 0)return E}}});return _(i,r),i}function fr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e);}catch{o=null;}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length));}return o});return _(t,e),t}function dr(e){var t=this.keys().then(function(i){return i.length});return _(t,e),t}function mr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e);});return _(i,r),i}function gr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o);}catch(E){(E.name===`QuotaExceededError`||E.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&f(E),f(E);}});})});return _(a,t),a}function pr(e,r){if(r=j.apply(this,arguments),e=typeof e!=`function`&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName;}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(ot(e,i._defaultConfig)):o(e.name+`/`);}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f);}}):a=p.reject(`Invalid arguments`),_(a,r),a}var hr={_driver:`localStorageWrapper`,_initStorage:ar,_support:nr(),iterate:cr,getItem:ur,setItem:gr,removeItem:mr,clear:sr,length:dr,key:fr,keys:lr,dropInstance:pr},vr=function(r,t){return r===t||typeof r==`number`&&typeof t==`number`&&isNaN(r)&&isNaN(t)},yr=function(r,t){for(var i=r.length,a=0;a<i;){if(vr(r[a],t))return true;a++;}return false},it=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},se={},at={},ne={INDEXEDDB:kt,WEBSQL:rr,LOCALSTORAGE:hr},Er=[ne.INDEXEDDB._driver,ne.WEBSQL._driver,ne.LOCALSTORAGE._driver],me=[`dropInstance`],Ne=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(me),_r={description:``,driver:Er.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function br(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})};}function Le(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(it(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t]);}return arguments[0]}v.exports=new((function(){function e(r){R(this,e);for(var t in ne)if(ne.hasOwnProperty(t)){var i=ne[t],a=i._driver;this[t]=a,se[a]||this.defineDriver(i);}this._defaultConfig=Le({},_r),this._config=Le({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=false,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){});}return e.prototype.config=function(t){if((typeof t>`u`?`undefined`:w(t))===`object`){if(this._ready)return new Error(`Can't call config() after localforage has been used.`);for(var i in t){if(i===`storeName`&&(t[i]=t[i].replace(/\W/g,`_`)),i===`version`&&typeof t[i]!=`number`)return new Error(`Database version must be a number.`);this._config[i]=t[i];}return `driver`in t&&t.driver?this.setDriver(this._config.driver):true}else return typeof t==`string`?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(u,f){try{var l=t._driver,d=new Error(`Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver`);if(!t._driver){f(d);return}for(var g=Ne.concat(`_initStorage`),E=0,S=g.length;E<S;E++){var x=g[E];if((!yr(me,x)||t[x])&&typeof t[x]!=`function`){f(d);return}}var V=function(){for(var ue=function(Sr){return function(){var Dr=new Error(`Method `+Sr+` is not implemented by the current driver`),st=p.reject(Dr);return _(st,arguments[arguments.length-1]),st}},Oe=0,Ir=me.length;Oe<Ir;Oe++){var Pe=me[Oe];t[Pe]||(t[Pe]=ue(Pe));}};V();var P=function(ue){se[l]&&console.info(`Redefining LocalForage driver: `+l),se[l]=t,at[l]=ue,u();};`_support`in t?t._support&&typeof t._support==`function`?t._support().then(P,f):P(!!t._support):P(!0);}catch(H){f(H);}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=se[t]?p.resolve(se[t]):p.reject(new Error(`Driver not found.`));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(xe);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;it(t)||(t=[t]);var u=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver();}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function x(){for(;S<E.length;){var N=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(N).then(l).catch(x)}f();var V=new Error(`No available storage method found.`);return o._driverSet=p.reject(V),o._driverSet}return x()}}return this._driverSet=(this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve()).then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u);})}).catch(function(){f();var E=new Error(`No available storage method found.`);return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return !!at[t]},e.prototype._extend=function(t){Le(this,t);},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var u=t[a];this.supports(u)&&i.push(u);}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Ne.length;t<i;t++)br(this,Ne[t]);},e.prototype.createInstance=function(t){return new e(t)},e})());},{3:3}]},{},[4])(4)});});var Et=v((yt,_e)=>{(function(s){var n={};n.VERSION=`1.6.1`;var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],M,p;for(p=1;p<m.length;p++)for(M in m[p])!(M in T)&&m[p].hasOwnProperty(M)&&(T[M]=m[p][M]);return T},w=function(m,T){return {value:m,name:T}};n.TRACE=w(1,`TRACE`),n.DEBUG=w(2,`DEBUG`),n.INFO=w(3,`INFO`),n.TIME=w(4,`TIME`),n.WARN=w(5,`WARN`),n.ERROR=w(8,`ERROR`),n.OFF=w(99,`OFF`);var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info;};R.prototype={setLevel:function(m){m&&`value`in m&&(this.context.filterLevel=m);},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.value},trace:function(){this.invoke(n.TRACE,arguments);},debug:function(){this.invoke(n.DEBUG,arguments);},info:function(){this.invoke(n.INFO,arguments);},warn:function(){this.invoke(n.WARN,arguments);},error:function(){this.invoke(n.ERROR,arguments);},time:function(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`start`]);},timeEnd:function(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`end`]);},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context));}};var b=new R({filterLevel:n.OFF});((function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info;}))(),n.setHandler=function(m){h=m;},n.setLevel=function(m){b.setLevel(m);for(var T in c)c.hasOwnProperty(T)&&c[T].setLevel(m);},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift(`[`+C.name+`]`);};var T={},M=function(p,_){Function.prototype.apply.call(p,console,_);};return typeof console>`u`?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?`[`+_.name+`] `:``)+p[0],p[1]===`start`?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):M(C,[O+`: `+(new Date().getTime()-T[O])+`ms`])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),M(C,p));}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m));},n.setDefaults=n.useDefaults,typeof define==`function`&&define.amd?define(n):typeof _e<`u`&&_e.exports?_e.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n);})(yt);});var Me=`14.0.2`;var Cr=Me.split(`-`)[0].split(`.`).slice(0,3).map(s=>s.padStart(2,`0`)).join(``),Hr=`WEB`,lt=`CooeeSDK`,Q=Me,Yr=parseInt(Cr,10);var jr=[`collection`,`product`,`cart`],zr=[{identifier:`#flo-checkout-wrapper`,gateway:`Shopflow`},{identifier:`#fastrr-main-container`,gateway:`Shiprocket`},{identifier:`#gokwik-modal-wrapper`,gateway:`Gokwik`},{identifier:`#zecpe`,gateway:`Ecom 360`}],qr=[`View Item`,`View Cart`,`View Collection`],Kr=[`CE Screen View`,`View Collection`,`View Item`,`View Cart`],Xr=`https://cdn.jsdelivr.net/npm/swiper@11`;function Qr(s){return `(\u23F0 took: ${Ve(s)})`}function Ve(s){if(s<0)return `${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+`m`),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+`s`),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+`ms`),h.length||h.push(`0ms`),h.join(` `)}function Be(){return window.CooeeSDK.runtimeData}function tn(){return Ve(Date.now()-Be().sdkLoadTime.getTime())}var Ue=x(mt());function ge(s){return Ue.default.createInstance({name:`lc`,storeName:s,driver:Ue.default.LOCALSTORAGE})}var oe=class{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var fe=class extends oe{static storeName=`usr`;static{this.storage=ge(this.storeName);}};var gt=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,te={apiURL:`https://api.sdk.letscooee.com`,debug:false,mode:`production`,baseURL:gt,styleURL:`${gt}/styles.min.css`};var pe=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n==`object`&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:false}static convertObjectToArray(n,h){return h.reduce((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var he=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.widgetCustomisation=n.widgetCustomisation,this}};var ve=class extends oe{static storeName=`ses`;static{this.storage=ge(this.storeName);}};var ye=class{static format(n,h){return h.replace(/{{\s*(\w+)\s*}}/,(v,I)=>{switch(I){case `amount`:return this.formatWithDelimiters(n,2);case `amount_no_decimals`:return this.formatWithDelimiters(n,0);case `amount_with_comma_separator`:return this.formatWithDelimiters(n,2,`.`,`,`);case `amount_no_decimals_with_comma_separator`:return this.formatWithDelimiters(n,0,`.`,`,`);case `amount_with_apostrophe_separator`:return this.formatWithDelimiters(n,2,`'`,`.`);case `amount_no_decimals_with_space_separator`:return this.formatWithDelimiters(n,0,` `);case `amount_with_space_separator`:return this.formatWithDelimiters(n,2,` `,`,`);case `amount_with_period_and_space_separator`:return this.formatWithDelimiters(n,2,` `,`.`);default:return v}})}static formatWithDelimiters(n,h=2,c=`,`,v=`.`){if(isNaN(n)||n==null)return `0`;let w=(n/100).toFixed(h).split(`.`);return w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1`+c)+(w[1]?v+w[1]:``)}};function Rn(s){try{return new URL(s)}catch{return}}function Cn(s){return !s||s===`null`||s===`undefined`}function An(s,n){let h=s.indexOf(n);return h===-1?false:(s.splice(h,1),true)}function xn(s,n,h){return {[s]:Ar(n,h),[s+`_wo_currency`]:n}}function Ar(s,n){if(s==0&&n)return `Free`;let h=Be(),c=he.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn(`Currency code is not set in RuntimeData`);let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=ye.format(s*100,w);else {let b;try{b=new Intl.NumberFormat(pt(),{style:`currency`,currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2});}catch(m){return ke(m,`format-currency`,{extra:{currentCurrency:I,shopCurrency:v}}),``}R=b.format(s),R=R.replace(`₹`,`Rs. `),c.money?.showCurrency&&I!==`INR`&&(R=R.concat(` ${I}`));}return R}function Nn(s){let n=pt();try{return new Intl.NumberFormat(n,{notation:`compact`}).format(s)}catch(h){return ke(h,`format-number`,{extra:{lang:n,value:s}}),s.toString()}}function pt(){let s=`en`;return typeof navigator<`u`&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(`;`)[0],s=s.split(`-`)[0],s||`en`}var Ee;function ht(){if(Ee)return Ee;try{return Ee=Intl.DateTimeFormat().resolvedOptions().timeZone,Ee}catch{return ``}}function vt(s){document.readyState!==`loading`?s():document.addEventListener(`DOMContentLoaded`,s);}function Ln(s){let n=document.createElement(`span`);n.id=`snackbar`,n.innerText=s,document.body.appendChild(n),n.className=`show`,setTimeout(()=>{n.classList.remove(`show`),document.body.removeChild(n);},5e3);}async function xr(s,n=7,h=document){let c=1,v=document.querySelectorAll(`nonexistent-tag`);for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await pe.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++;}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function On(s,n=10,h=document){return (await xr(s,n,h)).item(0)}async function Nr(s){let[n,h,c]=await Promise.all([fe.get(`did`),ve.get(`id`,``),fe.get(`sessionNumber`,1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Pn(s){let n=await Nr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Mn(s,n,h,c=false){Object.defineProperty(s,n,{enumerable:false,configurable:false,writable:c,value:h});}function Vn(s){if(s%100>=11&&s%100<=13)return s+`th`;switch(s%10){case 1:return s+`st`;case 2:return s+`nd`;case 3:return s+`rd`;default:return s+`th`}}function Bn(s,n){return !n?s:n+s}var W=x(Et());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n);}static verbose(...n){W.default.debug(...n);}static error(...n){W.default.error(...n);}static warn(...n){W.default.warn(...n);}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(` `)}),this.addToDebugger();}static trace(...n){W.default.trace(...n);}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector(`cooee-debugger`),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]));}};function $n(s=lt){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`);}}),Lr()&&(localStorage.cooeeLogLevel=`TRACE`),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(W.default.OFF);}function Lr(){let s=_t();return s===`1`||s===`on`}function _t(){return new URL(location.href).searchParams?.get(`cooee-debug`)}function Gn(){let s=[`display: inline-block;`,`font-size: 14px;`,`background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);`,`color: white;`,`padding: 4px;`,`border-radius: 4px;`].join(` `),n=`
4
4
  `;n+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
5
5
  `,n+=`\u{1F50D} Track real-time visitor intent & optimize engagement
6
6
  `,n+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
7
7
  `,n+=`\u{1F6CD}\uFE0F Boost purchases & repeat sales effortlessly
8
8
  `,n+=`
9
9
 
10
- `,n+=`Learn more: https://www.letscooee.com`,console.group(`%c Elevate your ecommerce experience with Cooee 🚀 `,s),console.log(`%c${n}`,`font-size: 13px; line-height: 1.8;`),console.log(`SDK v${Q}`),console.groupEnd(),Y.info(`SDK v${Q} loaded`);}function Hn(){let s=localStorage.getItem(`cooeeDebugTill`),n=_t();if(n===`1`||n===`on`){let h=Pr();s||(s=h.toString(),localStorage.setItem(`cooeeDebugTill`,s));}n===`on`?sessionStorage.cooeeDebug=`1`:n===`off`&&sessionStorage.removeItem(`cooeeDebug`),sessionStorage.cooeeDebug&&Or(),s&&new Date(+s)<new Date&&localStorage.removeItem(`cooeeDebugTill`);}function Or(){let s=document.createElement(`cooee-debugger`);vt(()=>{document.body.appendChild(s);});}function Pr(){return new Date().getTime()+360*60*1e3}var bt=5,Mr=500,ie=class extends Error{request;response;status;requestBody;responseText;constructor(n){super(n),this.name=`FetchError`,Object.setPrototypeOf(this,new.target.prototype);}is40x(){return !!this.response&&this.response.status>=400&&this.response.status<500}};async function zn(s,n){let h=Date.now(),c;try{c=await Vr(s,n);}catch{}let v=c?new Request(c.url,{method:n?.method||`GET`}):new Request(s,n);if(!c||!c.ok){let m=`Failed to fetch`;c?.statusText&&(m+=`: ${c.statusText}`);let T=new ie(m);throw T.request=v,T.response=c?.clone(),T.status=c?.status,T.requestBody=n?.body,T.responseText=await Tt(c),T}let I,w=(c.headers.get(`content-type`)||``).toLowerCase(),R=c.headers.get(`content-length`),b=n?.method?.toUpperCase()||`GET`;if(c.status===204||c.status===205||b===`HEAD`||R===`0`)I=void 0;else if(w.includes(`application/json`)||w.includes(`application/problem+json`)||w.includes(`text/javascript`))try{I=await c.clone().json();}catch(m){let T=new ie(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=c.clone(),T.status=c.status,T.requestBody=n?.body,T.responseText=await Tt(c),T}else w.includes(`text/`)||w.includes(`image/svg+xml`)?I=await c.text():I=await c.arrayBuffer();return {data:I,status:c.status,statusText:c.statusText,headers:c.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function Vr(s$1$1,n){let h=null,c;for(let v=0;v<=bt;v++){try{let I=new Headers(n?.headers);(s$1$1.includes(`letscooee.com`)||s$1$1.includes(`localhost`))&&I.set(`Cooee-Retry-Attempt`,v.toString());let w=s$1(r({},n),{headers:I});if(c=await fetch(s$1$1,w),c.ok||c.status>=400&&c.status<500)return c;h=new Error(`Server error: ${c.status} ${c.statusText}`);}catch(I){h=I instanceof Error?I:new Error(String(I));}if(v<bt){let I=Math.pow(2,v)*Mr;Y.info(`Request to ${s$1$1} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I));}}if(c&&!c.ok)return c;throw h||new Error(`Request failed after retries`)}async function Tt(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var be={},Te,we,It,St,wt;async function Dt(){if(!we)return wt??=Br(),wt}async function Br(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:c,makeFetchTransport:v}=await import('./esm-DKhFdjmg-CQZmaNvz.js');St=n;we=new s({dsn:`https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520`,transport:v,stackParser:h,integrations:c({}).filter(w=>![`BrowserApiErrors`,`Breadcrumbs`,`GlobalHandlers`].includes(w.name)),environment:te.mode,release:`web-sdk@${Q}`,debug:te.debug,sampleRate:.5}),we.init();}function ke(s,n,h){Y.error(`${n}:`,s),Dt().then(()=>{let c=Rt(h);if(c.setTag(`operation`,n),s instanceof ie){Fr(c,s,n);return}c.captureException(s);});}function to(s,n,h){Dt().then(()=>{Rt(h).captureMessage(s,n??`error`);});}function Fr(s,n,h){if(Ur(s,n),n.response){let c=n.response,v=n.responseText;s.setTag(`error.message`,n.message),c.status!=null&&s.setTag(`http.status_code`,c.status),c.statusText&&s.setTag(`http.status_text`,c.statusText),v&&typeof v==`object`&&`error`in v&&(s.setTag(`http.error_code`,v.error.code),s.setTag(`http.error_message`,v.error.message)),s.setExtras({responseText:n.responseText,statusText:c.statusText,responseType:c.type,redirected:c.redirected,responseUrl:c.url,originalError:n.message}),s.captureMessage(`${h} failed with ${c.status}`,`error`);return}if(n.request){s.captureMessage(`No response was received for ${h}`,`error`);return}}function Ur(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let c=h.headers?.get(`Cooee-Retry-Attempt`);c!==null&&s.setTag(`retry.attempt`,c);}function ro(s){It=s;}function no(s,n){be[s]=r(r({},be[s]),n);}function oo(s){Te=r(r({},Te),s);}function Rt(s){s??={};let{extra:n,tags:h}=s,c=new St;if(c.setClient(we),c.setUser(It),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;c.setTags({"engagement.id":v.engagementID,"engagement.short_id":v.shortID,"engagement.objective":v.objective,"engagement.delivery_type":v.onsiteDeliveryType,"engagement.content_id":v.contentID,"engagement.variation":v.variation,"engagement.currency":v.currency});}return n&&c.setExtras(n),h&&c.setTags(h),Te&&c.setTags(Te),Object.keys(be).forEach(v=>{c.setContext(v,be[v]);}),c.setTag(`language`,navigator.language),c.setTag(`timezone`,ht()),kr(c),c}function kr(s){window.Shopify&&(s.setTag(`shopify.shop`,window.Shopify.shop),s.setTag(`shopify.currency`,window.Shopify.currency?.active),s.setTag(`shopify.locale`,window.Shopify.locale),s.setTag(`theme.schema_name`,window.Shopify.theme?.schema_name),s.setTag(`theme.schema_version`,window.Shopify.theme?.schema_version));}
10
+ `,n+=`Learn more: https://www.letscooee.com`,console.group(`%c Elevate your ecommerce experience with Cooee 🚀 `,s),console.log(`%c${n}`,`font-size: 13px; line-height: 1.8;`),console.log(`SDK v${Q}`),console.groupEnd(),Y.info(`SDK v${Q} loaded`);}function Hn(){let s=localStorage.getItem(`cooeeDebugTill`),n=_t();if(n===`1`||n===`on`){let h=Pr();s||(s=h.toString(),localStorage.setItem(`cooeeDebugTill`,s));}n===`on`?sessionStorage.cooeeDebug=`1`:n===`off`&&sessionStorage.removeItem(`cooeeDebug`),sessionStorage.cooeeDebug&&Or(),s&&new Date(+s)<new Date&&localStorage.removeItem(`cooeeDebugTill`);}function Or(){let s=document.createElement(`cooee-debugger`);vt(()=>{document.body.appendChild(s);});}function Pr(){return new Date().getTime()+360*60*1e3}var bt=5,Mr=500,ie=class extends Error{request;response;status;requestBody;responseText;constructor(n){super(n),this.name=`FetchError`,Object.setPrototypeOf(this,new.target.prototype);}is40x(){return !!this.response&&this.response.status>=400&&this.response.status<500}};async function zn(s,n){let h=Date.now(),c;try{c=await Vr(s,n);}catch{}let v=c?new Request(c.url,{method:n?.method||`GET`}):new Request(s,n);if(!c||!c.ok){let m=`Failed to fetch`;c?.statusText&&(m+=`: ${c.statusText}`);let T=new ie(m);throw T.request=v,T.response=c?.clone(),T.status=c?.status,T.requestBody=n?.body,T.responseText=await Tt(c),T}let I,w=(c.headers.get(`content-type`)||``).toLowerCase(),R=c.headers.get(`content-length`),b=n?.method?.toUpperCase()||`GET`;if(c.status===204||c.status===205||b===`HEAD`||R===`0`)I=void 0;else if(w.includes(`application/json`)||w.includes(`application/problem+json`)||w.includes(`text/javascript`))try{I=await c.clone().json();}catch(m){let T=new ie(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=c.clone(),T.status=c.status,T.requestBody=n?.body,T.responseText=await Tt(c),T}else w.includes(`text/`)||w.includes(`image/svg+xml`)?I=await c.text():I=await c.arrayBuffer();return {data:I,status:c.status,statusText:c.statusText,headers:c.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function Vr(s$1$1,n){let h=null,c;for(let v=0;v<=bt;v++){try{let I=new Headers(n?.headers);(s$1$1.includes(`letscooee.com`)||s$1$1.includes(`localhost`))&&I.set(`Cooee-Retry-Attempt`,v.toString());let w=s$1(r({},n),{headers:I});if(c=await fetch(s$1$1,w),c.ok||c.status>=400&&c.status<500)return c;h=new Error(`Server error: ${c.status} ${c.statusText}`);}catch(I){h=I instanceof Error?I:new Error(String(I));}if(v<bt){let I=Math.pow(2,v)*Mr;Y.info(`Request to ${s$1$1} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I));}}if(c&&!c.ok)return c;throw h||new Error(`Request failed after retries`)}async function Tt(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var be={},Te,we,It,St,wt;async function Dt(){if(!we)return wt??=Br(),wt}async function Br(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:c,makeFetchTransport:v}=await import('./esm-DKhFdjmg-BDPB_pIu.js');St=n;we=new s({dsn:`https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520`,transport:v,stackParser:h,integrations:c({}).filter(w=>![`BrowserApiErrors`,`Breadcrumbs`,`GlobalHandlers`].includes(w.name)),environment:te.mode,release:`web-sdk@${Q}`,debug:te.debug,sampleRate:.5}),we.init();}function ke(s,n,h){Y.error(`${n}:`,s),Dt().then(()=>{let c=Rt(h);if(c.setTag(`operation`,n),s instanceof ie){Fr(c,s,n);return}c.captureException(s);});}function to(s,n,h){Dt().then(()=>{Rt(h).captureMessage(s,n??`error`);});}function Fr(s,n,h){if(Ur(s,n),n.response){let c=n.response,v=n.responseText;s.setTag(`error.message`,n.message),c.status!=null&&s.setTag(`http.status_code`,c.status),c.statusText&&s.setTag(`http.status_text`,c.statusText),v&&typeof v==`object`&&`error`in v&&(s.setTag(`http.error_code`,v.error.code),s.setTag(`http.error_message`,v.error.message)),s.setExtras({responseText:n.responseText,statusText:c.statusText,responseType:c.type,redirected:c.redirected,responseUrl:c.url,originalError:n.message}),s.captureMessage(`${h} failed with ${c.status}`,`error`);return}if(n.request){s.captureMessage(`No response was received for ${h}`,`error`);return}}function Ur(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let c=h.headers?.get(`Cooee-Retry-Attempt`);c!==null&&s.setTag(`retry.attempt`,c);}function ro(s){It=s;}function no(s,n){be[s]=r(r({},be[s]),n);}function oo(s){Te=r(r({},Te),s);}function Rt(s){s??={};let{extra:n,tags:h}=s,c=new St;if(c.setClient(we),c.setUser(It),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;c.setTags({"engagement.id":v.engagementID,"engagement.short_id":v.shortID,"engagement.objective":v.objective,"engagement.delivery_type":v.onsiteDeliveryType,"engagement.content_id":v.contentID,"engagement.variation":v.variation,"engagement.currency":v.currency});}return n&&c.setExtras(n),h&&c.setTags(h),Te&&c.setTags(Te),Object.keys(be).forEach(v=>{c.setContext(v,be[v]);}),c.setTag(`language`,navigator.language),c.setTag(`timezone`,ht()),kr(c),c}function kr(s){window.Shopify&&(s.setTag(`shopify.shop`,window.Shopify.shop),s.setTag(`shopify.currency`,window.Shopify.currency?.active),s.setTag(`shopify.locale`,window.Shopify.locale),s.setTag(`theme.schema_name`,window.Shopify.theme?.schema_name),s.setTag(`theme.schema_version`,window.Shopify.theme?.schema_version));}
11
11
 
12
12
  var s=`\xA0\xA0\xA0`,l=[`/v1/engagement/cart-widgets`,`/v1/engagement/page-widgets`,`/v1/event/validate-session`];function d(e){if(e===0)return `0 B`;let i=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(i));return `${(e/Math.pow(i,r)).toFixed(2)} ${n[r]}`}function E(e){let i=performance.getEntriesByType?.(`resource`);if(i)return i.filter(n=>n.name.includes(e)).pop()}function R(){let e=performance.getEntriesByType?.(`resource`);return e?e.filter(i=>l.some(n=>i.name.includes(n))):[]}function S(e,i){if(!e){Y.info(`\u{1F4E6} API Resource Metrics for ${i}: Not available`);return}Y.info(`📦 ═══════════ API Resource Metrics ═══════════`),Y.info(`URL: ${i}`),Y.info(`Duration: ${Ve(e.duration)}`);let n=e.transferSize===0;if(Y.info(`Served from: ${n?`💾 Cache (disk/memory)`:`🌐 Network`}`),!n){Y.info(`Transfer size: ${d(e.transferSize)}`),Y.info(`Encoded size: ${d(e.encodedBodySize)}`),Y.info(`Decoded size: ${d(e.decodedBodySize)}`);let c=(1-e.encodedBodySize/e.decodedBodySize)*100;c>0&&Y.info(`Compression ratio: ${c.toFixed(1)}%`);}let r=e.redirectEnd-e.redirectStart,f=e.fetchStart-e.startTime,a=e.domainLookupEnd-e.domainLookupStart,u=e.connectEnd-e.connectStart,m=e.secureConnectionStart>0?e.connectEnd-e.secureConnectionStart:0,g=e.connectEnd===e.connectStart?e.requestStart-e.fetchStart-a:e.requestStart-e.connectEnd,T=e.responseStart-e.requestStart,P=e.responseEnd-e.responseStart;Y.info(`Timing breakdown (${Ve(e.duration)} total):`),r>0&&Y.info(`${s}Redirect: ${Ve(r)}`),f>0&&Y.info(`${s}Queued: ${Ve(f)}`),g>0&&Y.info(`${s}Stalled: ${Ve(g)}`),a>0&&Y.info(`${s}DNS lookup: ${Ve(a)}`),u>0&&Y.info(`${s}TCP connect: ${Ve(u)}`),m>0&&Y.info(`${s}SSL handshake: ${Ve(m)}`),Y.info(`${s}Server waiting (TTFB): ${Ve(T)}`),Y.info(`${s}Content download: ${Ve(P)}`);let $=e.serverTiming;if($?.length){Y.info(`Server-Timing:`);for(let c of $){let p=c.description||c.name;c.duration>0?Y.info(`${s}${p}: ${Ve(c.duration)}`):Y.info(`${s}${p}: ${c.duration}`);}}Y.info(`📦 ═════════════════════════════════════════════`);}function B(){let e=R();return e.length?e.map(n=>JSON.stringify(n.toJSON())).join(`
13
13
  `):``}function z(){let e=new Set;for(let n of l){let r=E(n);r?S(r,n):e.add(n);}if(!e.size||typeof PerformanceObserver>`u`)return;let i=new PerformanceObserver(n=>{for(let r of n.getEntries())for(let f of e)if(r.name.includes(f)){S(r,f),e.delete(f);break}e.size||i.disconnect();});i.observe({type:`resource`,buffered:false});}
@@ -1,6 +1,6 @@
1
- import { B, L as Ln } from './chunk-cN7DAvpe-BbA9dPrS.js';
1
+ import { B, L as Ln } from './chunk-D-gRvo7T-D_Vnuz3Z.js';
2
2
  import { M } from './main.min.js';
3
- import { $ as $b, o as of, a, b as bE, B as Bo, w as wD, I as ID, V as Vo, M as Mf, u as uv, c as ud, _ as _D, i as iD, g as ge, d as Iv, X as Xa, W as Wf, T as Tv, e as _f, f as _v, Y as Yg } from './widgets-DkXU5112-D30WP3Pt.js';
3
+ import { $ as $b, o as of, a, b as bE, B as Bo, w as wD, I as ID, V as Vo, M as Mf, u as uv, c as ud, _ as _D, i as iD, g as ge, d as Iv, X as Xa, W as Wf, T as Tv, e as _f, f as _v, Y as Yg } from './widgets-DtAGUdfa-C7iwoQiT.js';
4
4
 
5
5
  function P(i,t){if(i&1&&(Bo(0,`li`)(1,`span`,1),uv(2),Iv(3,`date`),Vo(),uv(4,`\xA0 `),Xa(5,`span`,2),Iv(6,`safeHtml`),Vo()),i&2){let e=t.$implicit;ud(2),Wf(Tv(3,2,e.time,`hh:mm:ss a`)),ud(3),_f(`innerHTML`,_v(6,5,e.message),Yg);}}var _=class i{logs=$b.required();constructor(){}async shareLogs(){let t=this.logs().map(o=>`[${new Date(o.time).toLocaleString(`en-US`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3,hour12:false,timeZoneName:`short`})}] ${o.message}`).join(`
6
6
  `);t=t.replaceAll(`\xA0`,` `);let e=B();if(e&&(t+=`
@@ -1,4 +1,4 @@
1
- import { r, s, u, w } from './chunk-cN7DAvpe-BbA9dPrS.js';
1
+ import { r, s, u, w } from './chunk-D-gRvo7T-D_Vnuz3Z.js';
2
2
 
3
3
  var T=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;var x=globalThis;var ut=`9.42.0`;function Ve(){return fn(x),x}function fn(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||ut,t[ut]=t[ut]||{}}function Qt(e,t,n=x){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[ut]=r[ut]||{};return o[e]||(o[e]=t())}var Mn=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],tg=`Sentry Logger `,ar={};function Be(e){if(!(`console`in x))return e();let t=x.console,n={},r=Object.keys(ar);r.forEach(o=>{let i=ar[o];n[o]=t[o],t[o]=i;});try{return e()}finally{r.forEach(o=>{t[o]=n[o];});}}function ng(){ma().enabled=true;}function rg(){ma().enabled=false;}function Tl(){return ma().enabled}function og(...e){pa(`log`,...e);}function ig(...e){pa(`warn`,...e);}function sg(...e){pa(`error`,...e);}function pa(e,...t){T&&Tl()&&Be(()=>{x.console[e](`${tg}[${e}]:`,...t);});}function ma(){return T?Qt(`loggerSettings`,()=>({enabled:false})):{enabled:false}}var g={enable:ng,disable:rg,isEnabled:Tl,log:og,warn:ig,error:sg};var Il=/\(error: (.*)\)/,vl=/captureMessage|captureException/;function ti(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return (n,r=0,o=0)=>{let i=[],s=n.split(`
4
4
  `);for(let a=r;a<s.length;a++){let c=s[a];if(c.length>1024)continue;let u=Il.test(c)?c.replace(Il,`$1`):c;if(!u.match(/\S*Error: /)){for(let d of t){let l=d(u);if(l){i.push(l);break}}if(i.length>=50+o)break}}return wl(i.slice(o))}}function wl(e){if(!e.length)return [];let t=Array.from(e);return /sentryWrapped/.test(ei(t).function||``)&&t.pop(),t.reverse(),vl.test(ei(t).function||``)&&(t.pop(),vl.test(ei(t).function||``)&&t.pop()),t.slice(0,50).map(n=>s(r({},n),{filename:n.filename||ei(t).filename,function:n.function||`?`}))}function ei(e){return e[e.length-1]||{}}var ha=`<anonymous>`;function tt(e){try{return !e||typeof e!=`function`?ha:e.name||ha}catch{return ha}}function cr(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames);}),n}catch{return}}}var ni={},Rl={};function He(e,t){ni[e]=ni[e]||[],ni[e].push(t);}function $e(e,t){if(!Rl[e]){Rl[e]=true;try{t();}catch(n){T&&g.error(`Error while instrumenting ${e}`,n);}}}function xe(e,t){let n=e&&ni[e];if(n)for(let r of n)try{r(t);}catch(o){T&&g.error(`Error while triggering instrumentation handler.
package/dist/main.min.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s, r, x as xn, h as he$3, X as Xr$3, t as te$3, c as x$2, Y as Y$1, A as Ar$1, v as v$1, k as ke$2, E as Et$3, f as fe$4, O as On$1, H as Hr$3, d as Yr$3, Q as Q$4, o as oe$5, g as ge$3, e as tn, i as Bn$1, j as Qr$3, l as An$1, a as Be$3, m as Hn$1, M as Mn$1, C as Cn, n as jr$2, N as Nn$2, q as qr$3, p as vt$2, y as pe$4, V as Vn$1, D as ie$4, b as zn$1, F as no$1, G as ro, R as Rn$1, I as to, J as xr$1, K as ve$2, L as Ln$1, P as Pn$1, S as oo$1, T as Kr$3, U as Nr$2, W as z$4, Z as Ve$4, _ as d$3, $ as $n$1, a0 as Gn$1, a1 as Lr$1 } from './chunk-cN7DAvpe-BbA9dPrS.js';
1
+ import { s, r, x as xn, h as he$3, X as Xr$3, t as te$3, c as x$2, Y as Y$1, A as Ar$1, v as v$1, k as ke$2, E as Et$3, f as fe$4, O as On$1, H as Hr$3, d as Yr$3, Q as Q$4, o as oe$5, g as ge$3, e as tn, i as Bn$1, j as Qr$3, l as An$1, a as Be$3, m as Hn$1, M as Mn$1, C as Cn, n as jr$2, N as Nn$2, q as qr$3, p as vt$2, y as pe$4, V as Vn$1, D as ie$4, b as zn$1, F as no$1, G as ro, R as Rn$1, I as to, J as xr$1, K as ve$2, L as Ln$1, P as Pn$1, S as oo$1, T as Kr$3, U as Nr$2, W as z$4, Z as Ve$4, _ as d$3, $ as $n$1, a0 as Gn$1, a1 as Lr$1 } from './chunk-D-gRvo7T-D_Vnuz3Z.js';
2
2
 
3
3
  var o=`a-f\\d`,I$1=`#?[${o}]{3}[${o}]?`,S$3=`#?[${o}]{6}([${o}]{2})?`,R$1=new RegExp(`[^#${o}]`,`gi`),A$4=new RegExp(`^${I$1}$|^${S$3}$`,`i`);function c(e,r={}){if(typeof e!=`string`||R$1.test(e)||!A$4.test(e))throw new TypeError(`Expected a valid hex string`);e=e.replace(/^#/,``);let t=1;e.length===8&&(t=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),e.length===4&&(t=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let l=Number.parseInt(e,16),u=l>>16,p=l>>8&255,m=l&255,s=typeof r.alpha==`number`?r.alpha:t;if(r.format===`array`)return [u,p,m,s];if(r.format===`css`)return `rgb(${u} ${p} ${m}${s===1?``:` / ${Number((s*100).toFixed(2))}%`})`;return {red:u,green:p,blue:m,alpha:s}}var n$1=class n{h;a=100;g;constructor(r){r??={},this.h=r.h,this.a=r.a,this.g=r.g;}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return ``;try{return c(this.hex,{format:`css`,alpha:this.getAlpha()})}catch(r){return console.error(`Invalid hex`,r),`#000000`}}getAlpha(){return (this.a??100)/100}};var h$2=class h{s;g;i;constructor(r){r.s&&(this.s=new n$1(r.s)),r.g&&(this.g=new i(r.g)),this.i=r.i;}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}};var a$2=class a{s;r;w;c;constructor(r){this.s=r.s,this.r=r.r,this.w=r.w,r.c&&(this.c=new n$1(r.c));}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return w$2[this.s??1]}},w$2=(t=>(t[t.SOLID=1]=`SOLID`,t[t.DASHED=2]=`DASHED`,t))(w$2||{});var i=class e{static DEFAULT_FALLBACK=new n$1({h:`#000000`,a:50});r;c;fb;constructor(r){this.r=r.r,r.c&&(this.c=new n$1(r.c)),r.fb&&(this.fb=new n$1(r.fb));}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??e.DEFAULT_FALLBACK}};var g$2=class g{blur;spr;clr;x;y;constructor(r){r=r??{},this.blur=r.blur??0,this.spr=r.spr??0,this.x=r.x??0,this.y=r.y??0,this.clr=new n$1(r.clr);}getStyle(r){return `${this.x*r}px ${this.y*r}px ${this.blur*r}px ${this.spr*r}px ${this.clr.rgba}`}};var b$2=class b{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(r){r=r??{},this.pl=r.pl??0,this.pr=r.pr??0,this.pt=r.pt??0,this.pb=r.pb??0,this.ml=r.ml??0,this.mr=r.mr??0,this.mt=r.mt??0,this.mb=r.mb??0,this.cent=r.cent??false;}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return `${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}};var f$1=class f{rot;constructor(r){r?.rot&&(this.rot=r.rot);}get rotate(){return this.rot}};var y$1=class y{enabled;type;color;constructor(r){r??={},this.enabled=r.enabled,this.type=r.type,this.color=new n$1(r.color);}},d$2=class d{size;enabled;color;constructor(r){r??={},this.enabled=r.enabled,this.size=r.size,this.color=new n$1(r.color);}},x$1=class x{enabled;delay;constructor(r={}){this.enabled=r.enabled,r.delay&&(this.delay=r.delay>100?r.delay:r.delay*1e3);}},C$4=class C{navigation;pagination;autoplay;loop;maxInRow;gap;maxInRowSm;gapSm;speed;marquee;constructor(r){r??={},this.navigation=new d$2(r.navigation),this.pagination=new y$1(r.pagination),this.autoplay=new x$1(r.autoplay),this.loop=r.loop??false,this.maxInRow=r.maxInRow??4,this.gap=r.gap??0,this.maxInRowSm=r.maxInRowSm??this.maxInRow,this.gapSm=r.gapSm??this.gap,r.speed&&(this.speed=r.speed*1e3),this.marquee=r.marquee;}};
4
4
 
@@ -58,17 +58,17 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
58
58
  style="background-color: ${e.pagination.color?.rgba};">
59
59
  </span>
60
60
  `},navigation:{nextEl:r.querySelector(`.swiper-button-next`),prevEl:r.querySelector(`.swiper-button-prev`)},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:false,pauseOnMouseEnter:false}:false,autoHeight:true};e.marquee&&t.autoplay&&typeof t.autoplay==`object`&&(t.speed=e.speed,t.autoplay.pauseOnMouseEnter=true,r.style.setProperty(`--swiper-wrapper-transition-timing-function`,`linear`));let i=new window.CooeeSDK.Swiper(r,t);return r.style.setProperty(`--swiper-navigation-size`,`${e.navigation.size}px`),i}function Si(r,e,t){let i={color:r.navigation.color?.rgba};return r.pagination.enabled&&(i.transform=`translateY(-25%)`),f(`div`,{class:`swiper-container`,ref:e,style:`max-width: 100%`,children:[f(`div`,{class:`swiper-wrapper`,children:t()}),r.navigation.enabled&&f(`div`,{class:`swiper-button-next`,style:i,children:f(`span`,{})}),r.navigation.enabled&&f(`div`,{class:`swiper-button-prev`,style:i,children:f(`span`,{})}),r.pagination.enabled&&f(`div`,{className:`swiper-pagination`,style:{bottom:0,top:`unset`,position:`relative`,color:r.pagination.color?.rgba}})]})}var Qt=class extends _{componentDidMount(){W$2(()=>{this.setState(()=>({checked:this.props.item.selected.value}));});}render(){return f(`div`,{style:this.getCompiledStyles(),className:`lc-checkbox`,children:f(`input`,{type:`checkbox`,checked:this.state.checked,onChange:this.onChange.bind(this),style:{appearance:`auto`}})})}onChange(e){let{checked:t}=e.target;this.props.item.selected.value=t;}getTypoStyles(){let e={},t=this.mediaStyle.typo??new H;return e.textAlign=t.alignment,e.justifyContent=t.alignment,e}getComponentStyles(){return s(r({},this.getTypoStyles()),{display:`flex`})}};var Ae=class extends _{constructor(e,t){super(e,t);}render(){let e=this.props.element[this.deviceTypeKey],t=e?.src||this.props.element.src||this.props.element.lg?.src;return f(`img`,{onClick:this.customOnClick.bind(this),className:`lc-image`,alt:e?.name||`Image`,onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave.bind(this),src:t,style:this.getCompiledStyles()})}customOnClick(e){this.props.element.clc?.at===He$3.ADD_TO_CART&&this.props.triggerContext.triggerData.items[0]&&this.onClick(e,{item:this.props.triggerContext.triggerData.items[0]}),this.props.onClick&&this.props.onClick(`image`);}getComponentStyles(){let e=this.mediaStyle.lout;if(!e||e.pos!==`absolute`)return {};let t={zIndex:e.zIndex,cursor:this.props.element.clc?.at?`pointer`:`auto`};return this.mediaStyle.size?.w&&(t.width=this.mediaStyle.size.w),this.mediaStyle.size?.h&&(t.height=this.mediaStyle.size.h),t}handleMouseEnter(e){let t=this.props.element[this.deviceTypeKey]?.secondarySrc;t&&(e.currentTarget.src=t);}handleMouseLeave(e){e.currentTarget.src=this.props.element[this.deviceTypeKey]?.src;}};var ke=class extends _{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return f(`div`,{style:this.getCompiledStyles(),class:`lc-flexbox`,children:f(je,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new It,t={display:`flex`,gap:e.gap+`px`,flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai};return e.wrap===`nowrap`&&e.scroll&&(e.dir===`column`?t[`overflow-y`]=`auto`:t[`overflow-x`]=`auto`),t}};var Zt=class extends ke{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return f(`div`,{style:this.getCompiledStyles(),class:`lc-flexbox`,children:f(_t,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.props.noLinks})})}};var er=class extends _{render(){return f(`select`,{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??``,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:`lc-dropdown`,children:this.createSelectItems()})}componentDidMount(){W$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getTypoStyles(){let e={},t=this.mediaStyle.typo??new H;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+`px`,e.lineHeight=t.lh,e.fontFamily=`inherit`,e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,`color`,e),e.boxShadow=`none`,e}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility=`hidden`),r(r({},e),this.getTypoStyles())}createSelectItems(){let e=[],t=this.props.selectedVariant;if(!t.sellingPlans?.length)return [];this.props.triggerContext.triggerData.skipSubscribedItems?t.selectedSellingPlan.value||(t.sellingPlans[0].isSelected=true,t.changeSellingPlan(t.sellingPlans[0])):e.push(f(`option`,{value:``,selected:!t.selectedSellingPlan,children:`One time purchase`}));for(let i of t.sellingPlans??[])e.push(f(`option`,{value:i.mID,selected:i.isSelected,children:i.name}));return e}onChange(e){let t=e.target.value;t?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(i=>i.mID===t):this.props.selectedVariant.selectedSellingPlan.value=void 0;}};var Ha=new RegExp(`fill="#[a-zA-Z0-9]+"`),tr=class extends _{constructor(){super();}render(){let e=this.getCompiledStyles(),t=this.getRating();return t||(e.display=`none`,t=``),f(`div`,{style:e,className:`lc-star-rating`,dangerouslySetInnerHTML:{__html:t}})}getRating(){let e={size:this.props.element.iconSize,color:this.props.element.c.hex},t=qe$1(this.props.element.fullStar,{svg:e},this.props.triggerContext),i=qe$1(this.props.element.halfStart,{svg:e},this.props.triggerContext),o=this.props.review;if(!o?.rating)return ``;let n=``;if(this.props.element.showSingleStar)n=t;else {let s=5,c=`${o.rating}`.split(`.`);for(let m=0;m<+c[0];m++)n+=t,s--;c[1]&&(n+=i,s--);for(let m=0;m<s;m++)n+=t.replace(Ha,`fill="#f1f1f1"`);}return n}getComponentStyles(){return {display:`flex`,alignItems:`center`}}};var rr=class extends _{render(){return f(`select`,{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:`lc-dropdown`,children:this.createSelectItems()})}componentDidMount(){W$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getTypoStyles(){let e={},t=this.mediaStyle.typo??new H;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+`px`,e.lineHeight=t.lh,e.fontFamily=`inherit`,e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,`color`,e),e.boxShadow=`none`,e}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name===`Default Title`&&(e.visibility=`hidden`),r(r({},e),this.getTypoStyles())}createSelectItems(){let e=[];for(let t of this.props.item.vars)e.push(f(`option`,{value:t.mID,disabled:!t.isAvailable,children:t.name}));return e}onChange(e){let t=e.target.value,i=this.props.item.vars.find(o=>o.mID===t);this.props.item.setSelectedVariant(i);}};var os=()=>{let r=window.ShopifyAnalytics?.meta??{},e=r.selectedVariantId;if(e)return e;if(r.product?.variants?.length>0)return r.product.variants[0].id},ho=r=>{if(!r)return;let e;try{e=new URL(r);}catch{return}if(e.hostname!==`cdn.shopify.com`)return r;let t=e.pathname.split(`.`);return t.length!==2?r:(e.pathname=t[0]+`_large.`+t[1],e.toString())};var _t=class extends _{constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`}));}renderElement(e){if(!(e.hide||!this.matchWhenCondition(e.when))){if(e.t===4){let t=e;return t.l===`Star Rating`&&!this.props.item.reviews?.rating?void 0:f(Zt,{element:t,triggerContext:this.props.triggerContext,elements:t.elems,item:this.props.item,noLinks:this.props.noLinks})}if(e.t===6)return this.props.triggerContext.triggerData.isBundle()?f(Qt,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):void 0;if(e.t===13){let t=e,i=this.props.item,o=ho(i.variantImage??i.firstImageURL),n=ho(i.variantSecondaryImage??i.secondaryImageURL);t.lg=t.sm={src:o,name:i.name,secondarySrc:n};let s=f(Ae,{element:t,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:f(`a`,{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:`block`},children:s})}if(e.t===14)return this.renderProductTitle(e);if(e.t===15){let t=e;return this.props.triggerContext.triggerData.isCartEmbed()&&this.props.item.vars?.length===1&&this.props.item.vars[0].name===`Default Title`?void 0:t.showChips?f(`cooee-product-options-picker`,{item:this.props.item}):f(rr,{element:t,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?f(er,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?f(tr,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?f(at,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):f(je,{elements:[e],element:this.props.element,triggerContext:this.props.triggerContext})}}render(){return this.attachListener(),this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return {}}renderProductTitle(e){let t=f(oe,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?t:f(`a`,{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:`block`,textDecoration:this.state.decoration},onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),children:t})}customOnClick(e){this.sendTriggerClicked([this.props.item.toEmbed()],{from:e});}onMouseEnter(){this.setState(()=>({decoration:`underline`}));}onMouseLeave(){this.setState(()=>({decoration:`unset`}));}attachListener(){document.addEventListener(`letscooee:variant-change`,e=>{let t=e;if(!t.detail||this.props.item.mID!==t.detail.productID)return;let i=t.detail.variantID;this.props.item.setSelectedVariantByID(i);});}};var ct=class extends _{productElement;constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`}));}render(){if(this.productElement=new $e(Ve$2(this.props.element,this.getProductData(),this.props.triggerContext)),!(this.productElement.hide||!this.matchWhenCondition(this.productElement.when)))return f(`div`,{style:r({},this.getCompiledStyles()),class:`lc-single-product`,children:f(_t,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.productElement.noLinks})})}getComponentStyles(){return {flexShrink:0}}getProductData(){if(!this.props.item)return {};let e=this.props.item,t=e.selectedOrFirstVariant.value,i=e.getTemplateVariables();i.product.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(this.props.item.quantity):this.props.item.quantity;let o=this.props.triggerContext.triggerData.discount?.type===ce.BXGY;return !t.hasEffectivePrice()&&o&&(i.product=s(r(r({},i.product),xn(`effective_price`,t.effectivePrice.value)),{price:``})),i.variant.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(t.quantity):t.quantity,{product:i.product,variant:i.variant,svg:{color:`{{ svg.color }}`,size:`{{ svg.size }}`}}}};var ir=class extends _{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,t){super(e,t),this.configuration=M$1()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+`px`;}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&Vi$1().then(()=>{this.swiperInstance=Ei(this.swiperRef,this.props.element.conf[this.deviceTypeKey]);});}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy();}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let t;if(this.configuration.disp===2){let i=n=>{this.swiperRef=n;},o=()=>e?.map(n=>f(`div`,{class:`swiper-slide`,children:this.getProductFragment(n)}));t=f(`div`,{style:s(r({},this.getCompiledStyles()),{display:`block`}),class:`lc-product-swiper-list`,children:Si(this.configuration,i,o)});}else t=f(`div`,{style:this.getCompiledStyles(),class:`lc-product-list`,children:e?.map((i,o)=>this.getProductFragment(i,o!==e.length-1))});return t}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),t={display:e?`flex`:`grid`,justifyContent:`safe `+(this.mediaStyle.flex?.jc??`center`),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??`row`};if(t.flexDirection===`row`){if(e)t.maxWidth=`100%`,t.overflowY=`auto`;else if(this.configuration.disp===1){let i=this.props.triggerContext.triggerData,o=i.items.length,n;i.isBundle()?n=this.props.element.prod.symbol?.hide!==true?o*2-1:o:n=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${n}, auto)`;}}return t}getProductFragment(e,t=false){return f(j$1,{children:[f(ct,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&t&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&f(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:f(oe,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var or=class extends _{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t);}componentDidMount(){Vi$1().then(()=>{this.swiperInstance=Ei(this.swiperRef,this.props.element.conf);});}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy();}render(){let e=this.props.element,t=o=>{this.swiperRef=o;},i=()=>{let o=e.values?.map(c=>f(`div`,{class:`swiper-slide`,onClick:m=>this.onClick(m,{clickAction:this.getClickAction(c)}),children:this.renderElement(c)}));if(!o?.length)return [];let n=e.conf,s=o.length;if(n.marquee&&s<=Number(n.maxInRow)){let c=Number(n.maxInRow)-s+1;for(let m=0;m<c;m++)o.push(o[m%s]);}return o};return Si(e.conf,t,i)}getComponentStyles(){return {}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return f(Ae,{element:t,triggerContext:this.props.triggerContext});case 4:return f(ke,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:Y$1.warn(`Unknown slide type for carousal`);}}valueAddedSlide(e,t){let i=Ve$2(e,{form:t},this.props.triggerContext);return ie.getParsedElement(i)}getClickAction(e){return Ve$2(this.props.element.clc??{},{form:e},this.props.triggerContext)}};var je=class extends _{constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`})),W$2(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}));});}renderElement(e){if(!e.hide){if(e.t===4){let t=e;return f(ke,{element:t,triggerContext:this.props.triggerContext,elements:t.elems})}if(e.t===61)return f(Jt,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?f(at,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return f(oe,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return f(Ae,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return f(ir,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return f(ct,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return f(or,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return {}}};var nr=class extends _{clickAction;isClickable;constructor(e,t){super(e,t),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===He$3.GO_TO_URL&&!!Rn$1(this.clickAction.gu?.u)||this.clickAction?.at===He$3.OPEN_CART||this.clickAction?.at===He$3.INITIATE_CHECKOUT;}componentDidMount(){W$2(()=>{let e=this.props.triggerContext.triggerData,t=this.props.triggerContext.selectedItems;e.calculateDiscountData(t,this.props.triggerContext.shouldGiveFBTDiscount);});}render(){return f(j$1,{children:[f(`div`,{style:this.getCompiledStyles(),class:`lc-container`,onClick:e=>{this.onClick(e,{clickAction:this.clickAction});},children:f(je,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id===`preview`&&f(`div`,{class:`letscooee-preview-badge`,children:[`#`,this.props.triggerContext.triggerData.shortID,` preview`]})]})}getComponentStyles(){let e={position:`relative`,overflow:`hidden`,display:`block`};return this.isClickable&&(e.cursor=`pointer`),e}};var X=class r$8{constructor(e){this.engagementTrigger=e;this.triggerContext=new Be(new Date,this.engagementTrigger);}static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;triggerContext;observers=[];renderedCount=0;scrollSubscription;isExclusionWithBVariation;isProcessing=false;renderSilently(){this.acquireProcessingLock()||this.render().finally(()=>this.releaseProcessingLock()).catch(e=>{ke$2(e,`render-widget`,{triggerContext:this.triggerContext});});}destroy(){Y$1.verbose(`${this.engagementTrigger} will be destroyed`),this.preDestroy(),this.removeFromRendered(),this.rootContainer?.remove(),r$8.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID),xi$1(this.engagementTrigger.content?.afterDeleteJS);}matches(e){return this.engagementTrigger.shortID===e.shortID}async render(){if(this.engagementTrigger.shouldGetVariationImmediately()){let e=await this.getVariation();this.handleVariationResponse(e);}if(this.rootContainer=await this.getWidgetContainer(true),!this.rootContainer){Y$1.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.afterRootContainerCreated(),await this.getVariationIfRequired(),await this.runChoresBeforeRender(),this.attachScroll(),this.checkAndSendEvent(),this.triggerContext.renderer=this,xi$1(this.engagementTrigger.content?.afterRenderJS);}async updateAndReRender(e){if(!this.acquireProcessingLock())try{this.updateItems(e.items,this.engagementTrigger.items),await this.update(e),await this.render();}finally{this.releaseProcessingLock();}}async update(e){this.engagementTrigger.variation=e.variation;}async rerenderIfDeleted(){if(!this.rootContainer?.isConnected&&!this.acquireProcessingLock()){Y$1.info(`${this.engagementTrigger} deleted. Will be re-rendered`);try{this.preDestroy(),await this.render();}finally{this.releaseProcessingLock();}}}updateAngularWidget(){return this.widgetElement?.isConnected?(this.widgetElement.update(),true):false}preDestroy(){this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect();});}acquireProcessingLock(){return this.isProcessing?(Y$1.verbose(`Lock could not be acquired for ${this.engagementTrigger}`),true):(Y$1.verbose(`Acquiring rendering lock for ${this.engagementTrigger}`),this.isProcessing=true,false)}releaseProcessingLock(){Y$1.verbose(`Releasing rendering lock for ${this.engagementTrigger}`),this.isProcessing=false;}afterRootContainerCreated(){}isAllOkToRender(){return !!this.engagementTrigger.widget}async getVariationIfRequired(){if(this.engagementTrigger.shouldSkipVariation()){Y$1.verbose(`${this.engagementTrigger} already has necessary data to render`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e);}handleVariationResponse(e){if(!e)return;let t=this.engagementTrigger;Y$1.log(`${t} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(t.items=e.items.map(i=>new ot$2(i)),t.nonMutableItems=e.items.map(i=>new ot$2(i))),e.bundleFrom&&(t.bundleFrom=new ot$2(e.bundleFrom)),e.discount&&(t.discount=e.discount),e.placement&&(t.placement=e.placement),e.props&&pe$4.hasKeys(e.props)&&(t.props=r(r({},t.props),e.props)),e.content&&(t.content=new Kt(e.content)),t.widget=new Pt(e.widget),t.contentID=e.contentID,t.variation=e.variation,t.placement=e.placement,t.manipulation=e.manipulation,t.entryAnimation=e.entryAnimation??`NONE`,this.isExclusionWithBVariation=t.isExclusionTesting()&&t.variation===`b`,this.isExclusionWithBVariation&&(this.rootContainer.style.height=`0.5px`);}addToRendered(){this.renderedCount++,Y$1.info(`${this.engagementTrigger} rendered \u2705 ${Vn$1(this.renderedCount)} time`);}removeFromRendered(){this instanceof pe?lt.delete(this):At.delete(this);}async getVariation(){Y$1.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id===`preview`};try{return (await ns(e)).data}catch(t){if(t instanceof ie$4&&t.response?.status===400)return;ke$2(t,`get-variation`,{engagementTrigger:this.engagementTrigger});return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){Y$1.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,t={root:null,rootMargin:`${e}px 0px ${e}px 0px`,threshold:0};return this.isInViewport()?this.getVariation():new Promise(i=>{let o=new IntersectionObserver((n,s)=>{n.forEach(async c=>{if(c.isIntersecting){Y$1.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);i(await this.getVariation()),s.unobserve(this.rootContainer);}});},t);o.observe(this.rootContainer),this.observers.push(o);})}attachScroll(){this.scrollSubscription=Tr(window,`scroll`).pipe(Fe(r$8.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent();});}checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(r$8.engagementIDsWithTrackedDisplay.has(e)||!this.isInViewport())return;let i={};this.triggerContext.triggerData.items?.length&&(i.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let n=new Ir$1(this.isExclusionWithBVariation?`CE Campaign Holdout`:`CE Trigger Displayed`,i,this.engagementTrigger);n.name===`CE Campaign Holdout`&&(n.trigger.holdout=true),fe(n),r$8.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription.unsubscribe();}generateParentElementID(){return `letscooee-${this.engagementTrigger.shortID}`}createAngularWidget(e){let t=this.widgetElement=document.createElement(e);return t.cart=S.getCurrent(),t.triggerContext=this.triggerContext,t.engagementTrigger=this.engagementTrigger,t.setAttribute(`engagement`,this.engagementTrigger.shortID),this.rootContainer.appendChild(t),this.addToRendered(),this.injectOuterCSSOnly(),t}getParentElement(e,t=document){let i=t.getElementById(e);if(i)return i;let o=this.engagementTrigger.objective.toLowerCase().replaceAll(`_`,`-`),n=this.engagementTrigger.shortID;return i=document.createElement(`div`),i.id=e,i.className=`letscooee letscooee-engagement engagement-${n} lc-${o}`,i.dataset.engagementId=n,this.engagementTrigger.id===`preview`&&(i.className+=` letscooee-preview`),i.style.display=`block`,i.style.minHeight=`0.5px`,i.style.minWidth=`0.5px`,i}async startRendering(){let e=this.rootContainer,t=this.triggerContext.triggerData.hasSwiperElement();t&&(e=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:`open`}),Mi$1(e)),this.injectCampaignCSS(t,e);let i=this.engagementTrigger.widget;ze$1(pe$3(nr,{element:i.cont,triggerContext:this.triggerContext,elements:i.elems}),e),this.addToRendered();}injectCampaignCSS(e,t){let i=this.engagementTrigger.content?.outerCSS?.trim()??``,o=this.engagementTrigger.content?.innerCSS?.trim()??``;if(!i&&!o)return;let n=this.rootContainer.id;if(e){Ce$1(o,t),this.injectOuterCSSOnly();return}Ce$1(`#${n} { ${i+`
61
- ${o}`} }`);}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let t=this.rootContainer.id;Ce$1(`#${t} { ${e} }`);}isInViewport(){let e=this.rootContainer?.getBoundingClientRect();if(!e)return false;let t=window.innerHeight||document.documentElement.clientHeight,s=(Math.min(e.bottom,t)-Math.max(e.top,0))*e.width/(e.width*e.height)*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let t=await this.createParentElementWithPlacement(e);if(t)return t;let i=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(i)}async createParentElementWithPlacement(e){let t=this.engagementTrigger.placement;if(!t?.selector)return Y$1.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let i=t.selector,o;if(i.includes(`:shadow`)){let m=i.split(`:shadow`);o=(await On$1(m[0].trim()))?.shadowRoot,i=m[1].trim(),o&&Mi$1(o,false);}Y$1.verbose(`${this.engagementTrigger} attempt to render "${t.position}" "${i}"`);let n=await On$1(i,3,o??document);if(!n)return Y$1.warn(`${this.engagementTrigger} no placement found with ${i}`),null;let s=this.generateParentElementID(),c=this.getParentElement(s);if(!e)return c;switch(t.position){case Ve$3.BEFORE1:case Ve$3.BEFORE:n.parentElement?.insertBefore(c,n);break;case Ve$3.INSIDE_FIRST1:case Ve$3.INSIDE_FIRST:n.insertBefore(c,n.firstChild);break;case Ve$3.INSIDE_LAST1:case Ve$3.INSIDE_LAST:n.appendChild(c);break;case Ve$3.AFTER1:case Ve$3.AFTER:default:n.parentElement?.insertBefore(c,n.nextSibling);}return c}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){Y$1.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}Y$1.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await wi(this.engagementTrigger);}catch(t){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,t);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`);return}this.engagementTrigger.items=e,await this.startRendering();}updateItems(e,t){let i=this.getItemDiff(e,t),o=this.getItemDiff(t,e);t.push(...i);for(let n of o)Re.remove(t,n);}getItemDiff(e,t){return e.filter(i=>!t.some(o=>o.selectedOrFirstVariant.value.mID===i.selectedOrFirstVariant.value.mID))}};var pe=class extends X{constructor(e){super(e);}rerenderAfterCartOpened(){this.rerenderIfDeleted(),this.checkAndSendEvent();}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!V.get().isOpen()&&Be$3().pageName!==`cart`){Y$1.log(`Do not send display event as neither the cart drawer nor the cart page is open.`);return}return super.checkAndSendEvent()}};var Ii=class r{constructor(e,t){this.engagementTrigger=e;this.element=t;this.cartItems=S.getCurrent().items;}cartItems;static renderCartUpsell(e){let t=e.placement;if(!t?.selector){Y$1.warn(`No placement available for ${e.objective}`,e.shortID);return}let i=Array.from(document.querySelectorAll(t.selector));if(!i?.length){Y$1.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let o of i)new r(e,o).render();}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let t=this.engagementTrigger.items.find(w=>w.mID===e.product_id.toString());if(!t)return;let i=t.vars.find(w=>w.mID===e.id.toString());if(!i)return;let o=new nt$1(i),n=e.selling_plan_allocation?.selling_plan;if(n)for(let w of o.sellingPlans??[])w.mID===n.id.toString()&&(w.isSelected=true,o.changeSellingPlan(w));let s=new ot$2(t);s.vars=[o],s.selectedOrFirstVariant.value=o;let c=`lc-cart-item-${this.engagementTrigger.shortID}-${t.mID}`;this.element.classList.add(c);let m=new G(this.engagementTrigger);m.placement.selector=`.${c}`,m.items=[s];let C=new pe(m);C.renderSilently(),this.watchForCartItemDeletion(C,c);}watchForCartItemDeletion(e,t){let i=new MutationObserver(o=>{o.forEach(n=>{n.removedNodes.forEach(s=>{s===this.element&&(Y$1.verbose(`${t} has been removed`),e.destroy(),i.disconnect());});});});i.observe(this.element.parentElement,{childList:true,subtree:true});}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(t=>{if(!(e.includes(t.url)||e.includes(t.variant_id))&&(!e.includes(t.product_title)||t.variant_title&&!e.includes(t.variant_title)))return false;let i=t.selling_plan_allocation?.selling_plan?.name;return !(i&&!e.includes(i))})}};var Ti=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-collection-filter`);}};var xi=class extends pe{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.progressBarConfig.update(e.progressBarConfig),await this.checkMilestoneTryCatch(),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.progressBarConfig}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-progressbar`),await this.checkMilestoneTryCatch();}async checkMilestoneTryCatch(){try{await this.checkMilestone();}catch(e){ke$2(e,`apply-milestones`,{engagementTrigger:this.engagementTrigger});}}async checkMilestone(){let e=await S.getCurrent().getNormalisedCart(),t=this.engagementTrigger.progressBarConfig,i=[],o=[],n=[],s,c,m=[...t.milestones];for(let v of m){if(v.rewardType!==Fe$1.FREE_AUTO_GIFT)continue;if(v.isUIOnly&&!v.allowATC){Y$1.verbose(`Skipping milestone ${v.label} as it is UI only and does not allow ATC`);continue}let L=v.items[0],k=v.reached,b=e.items.find(Qe=>(Qe.vID===L.vID||Qe.mID===L.mID)&&Qe.properties._letscooee_campaign===this.engagementTrigger.shortID);k&&(s=v,c=b),b&&i.push(b),!k&&b&&t.removeIneligibleItem?(Y$1.verbose(`Removing free gift ${b.vID} from cart`),n.push(b)):k&&!b&&(Y$1.verbose(`Adding free gift ${L.vID} to cart`),o.push(L));}t.restrictToLatestFreebie&&s&&(c?(i=i.filter(v=>v.vID!==c.vID),o=[]):o=[s.items[0]],n.push(...i));let C={},w={};n.length&&n.forEach(v=>w[v.key??v.vID]=0),o.length&&o.forEach(v=>w[v.vID]=1);let O=t.coupons,M=[];if(O?.length){M=O.map(k=>k.couponCode);let v=S.getCurrent().discount_codes?.map(k=>k.code)??[];M.every(k=>v.some(b=>b===k))||(C.discount=M.join(`,`));}if(pe$4.hasKeys(w)&&(C.updates=w),!pe$4.hasKeys(C))return;let y=await ts(C,this.engagementTrigger),P=y?.items,x=[];for(let v of o){let L=P?.find(k=>M?.length?k.id+``===v.vID&&k.discounts?.some(b=>M.includes(b.title)):k.id+``===v.vID);L&&x.push(L);}if(!x.length){V.get().refreshUI(y,false);return}try{await Promise.all(x.map(v=>rs(v,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})));}catch(v){ke$2(v,`add-private-attribute`,{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:x}});}finally{V.get().refreshUI(y,false);}}};var sr=class extends pe{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.content.update(e.content),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.content}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-savings-bar`);}};var Di=class extends X{constructor(e){super(e);}isAllOkToRender(){return !!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e,t=this.engagementTrigger.content.videoConfig;t.template===`FLOATING_POPUP`?e=`cooee-video-popup`:t.template===`STORY`?e=`cooee-video-stories`:e=`cooee-video-playlist`,this.createAngularWidget(e);}};var Pi=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-sticky-atc`);}};var Ri=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(`letscooee:inbound:cta:add-bundle`,this.inboundCTAListener.bind(this),false);}async inboundCTAListener(e){let t=this.engagementTrigger,i=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,o=e.detail;if(!pe$4.hasKeys(o)){Y$1.error(`No detail received for ${i}`);return}Y$1.log(`Detail received for BYOB`,o);let n=o.campaignID??o.campaignId??o.campaign_id;if(n!==t.shortID&&n!==t.engagementID){Y$1.warn(`Current ${i} is not BYOB. Received: ${n}`);return}let s=o.items;if(!s?.length)return;let c=s.map(m=>new et({mID:m.product_id,vID:m.variant_id,quantity:m.quantity||1}));await new _e(this.triggerContext).execute({embeddedItems:c,clickAction:{at:He$3.ADD_BUNDLE,applyDiscount:true}});}};var wo=false,vo=false,_i=null,Ai=null,ss=false,lt=new Set,At=new Set;function as(){ss||(ss=true,vt$2(()=>{Nn(document.body,{childList:true,subtree:true},500,Ln).subscribe(()=>{At.forEach(r=>r.rerenderIfDeleted()),lt.forEach(r=>r.rerenderIfDeleted());});}));}function ar(r){if(r.length>0&&ps(),as(),wo){Y$1.verbose(`Cart widget processing in progress, queuing latest triggers`),_i=r;return}wo=true;try{$a(r);}finally{if(wo=false,_i){let e=_i;_i=null,Y$1.verbose(`Processing queued cart triggers`),ar(e);}}}function cr(r){if(r.length>0&&ps(),as(),vo){Y$1.verbose(`Page widget processing in progress, queuing latest triggers`),Ai=r;return}vo=true;try{qa(r);}finally{if(vo=false,Ai){let e=Ai;Ai=null,Y$1.verbose(`Processing queued page triggers`),cr(e);}}}function cs(){lt.forEach(r=>r.rerenderAfterCartOpened());}function $a(r){ms(lt,r);for(let e of r){Y$1.info(`${e} received as cart embed`);let t=ls(lt,e);if(t&&!e.isSubscriptionUpsell()){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;if(e.isProgressBar())i=new xi(e);else if(e.isSubscriptionUpsell()){Ii.renderCartUpsell(e);continue}else e.isSavingsBar()?i=new sr(e):i=new pe(e);lt.add(i),i.renderSilently();}}function qa(r){ms(At,r);for(let e of r){Y$1.info(`${e} received as page embed`);let t=ls(At,e);if(t){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;e.isShoppableVideo()?i=new Di(e):e.isBYOB()?i=new Ri(e):e.isStickyATC()?i=new Pi(e):e.isSavingsBar()?i=new sr(e):e.isCollectionFilter()?i=new Ti(e):i=new X(e),At.add(i),i.renderSilently();}}function ls(r,e){for(let t of r)if(t.matches(e))return t}function ms(r,e){let t=new Set(e.map(i=>i.shortID));for(let i of r)t.has(i.engagementTrigger.shortID)||i.destroy();}function ps(){import('./widgets-DkXU5112-D30WP3Pt.js').then(function (n) { return n.ad; }).then(({loadAngularWidgets:r})=>{r();});}var ki=class extends oe$5{static storeName=`app`;static{this.storage=ge$3(this.storeName);}};var Ga=` daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/`,ja=/bot|crawl|http|lighthouse|scan|search|spider/i,lr;function za(){if(lr instanceof RegExp)return lr;try{lr=new RegExp(Ga,`i`);}catch{lr=ja;}return lr}function ds(r){return !!r&&za().test(r)}var Ka=`2.0.4`,_o=500,us=`user-agent`,Ut=``,gs=`?`,Fi=`function`,Xe=`undefined`,Mt=`object`,Ao=`string`,Q=`browser`,Oe=`cpu`,Ie=`device`,he=`engine`,de=`os`,Lt=`result`,u=`name`,l=`type`,d=`vendor`,g=`version`,Z=`architecture`,br=`major`,p=`model`,wr=`console`,E=`mobile`,A=`tablet`,W=`smarttv`,Ee=`wearable`,Oi=`xr`,vr=`embedded`,mr=`inapp`,Lo=`brands`,pt=`formFactors`,No=`fullVersionList`,Nt=`platform`,Uo=`platformVersion`,Wi=`bitness`,Ye=`sec-ch-ua`,Xa=Ye+`-full-version-list`,Ya=Ye+`-arch`,Ja=Ye+`-`+Wi,Qa=Ye+`-form-factors`,Za=Ye+`-`+E,ec=Ye+`-`+p,Ps=Ye+`-`+Nt,tc=Ps+`-version`,Rs=[Lo,No,E,p,Nt,Uo,Z,pt,Wi],Li=`Amazon`,kt=`Apple`,fs=`ASUS`,hs=`BlackBerry`,mt=`Google`,ws=`Huawei`,bo=`Lenovo`,vs=`Honor`,Ni=`LG`,Co=`Microsoft`,yo=`Motorola`,Eo=`Nvidia`,bs=`OnePlus`,So=`OPPO`,pr=`Samsung`,Cs=`Sharp`,dr=`Sony`,Io=`Xiaomi`,To=`Zebra`,ys=`Chrome`,Es=`Chromium`,ze=`Chromecast`,Mi=`Edge`,ur=`Firefox`,gr=`Opera`,xo=`Facebook`,Ss=`Sogou`,Ot=`Mobile `,fr=` Browser`,ko=`Windows`,ee=typeof window!==Xe&&window.navigator?window.navigator:void 0,Ke=ee&&ee.userAgentData?ee.userAgentData:void 0,ic=function(r,e){var t={},i=e;if(!Bi(e)){i={};for(var o in e)for(var n in e[o])i[n]=e[o][n].concat(i[n]?i[n]:[]);}for(var s in r)t[s]=i[s]&&i[s].length%2===0?i[s].concat(r[s]):r[s];return t},Hi=function(r){for(var e={},t=0;t<r.length;t++)e[r[t].toUpperCase()]=r[t];return e},Oo=function(r,e){if(typeof r===Mt&&r.length>0){for(var t in r)if(Le(e)==Le(r[t]))return true;return false}return Bt(r)?Le(e)==Le(r):false},Bi=function(r,e){for(var t in r)return /^(browser|cpu|device|engine|os)$/.test(t)||(e?Bi(r[t]):false)},Bt=function(r){return typeof r===Ao},Do=function(r){if(r){for(var e=[],t=Ft(/\\?\"/g,r).split(`,`),i=0;i<t.length;i++)if(t[i].indexOf(`;`)>-1){var o=Vi(t[i]).split(`;v=`);e[i]={brand:o[0],version:o[1]};}else e[i]=Vi(t[i]);return e}},Le=function(r){return Bt(r)?r.toLowerCase():r},Po=function(r){return Bt(r)?Ft(/[^\d\.]/g,r).split(`.`)[0]:void 0},Ne=function(r){for(var e in r){var t=r[e];typeof t==Mt&&t.length==2?this[t[0]]=t[1]:this[t]=void 0;}return this},Ft=function(r,e){return Bt(e)?e.replace(r,Ut):e},hr=function(r){return Ft(/\\?\"/g,r)},Vi=function(r,e){if(Bt(r))return r=Ft(/^\s\s*/,r),typeof e===Xe?r:r.substring(0,_o)},Ro=function(r,e){if(!(!r||!e))for(var t=0,i,o,n,s,c,m;t<e.length&&!c;){var C=e[t],w=e[t+1];for(i=o=0;i<C.length&&!c&&C[i];)if(c=C[i++].exec(r),c)for(n=0;n<w.length;n++)m=c[++o],s=w[n],typeof s===Mt&&s.length>0?s.length===2?typeof s[1]==Fi?this[s[0]]=s[1].call(this,m):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Fi&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=m?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=m?s[1].call(this,m,s[2]):void 0:s.length==3?this[s[0]]=m?m.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=m?s[3].call(this,m.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=m?s[3].apply(this,[m.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=m||void 0;t+=2;}},Se=function(r,e){for(var t in e)if(typeof e[t]===Mt&&e[t].length>0){for(var i=0;i<e[t].length;i++)if(Oo(e[t][i],r))return t===gs?void 0:t}else if(Oo(e[t],r))return t===gs?void 0:t;return e.hasOwnProperty(`*`)?e[`*`]:r},Is={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},Ts={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},oc={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},xs={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[u,Ot+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[g,[u,Mi+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[u,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,g],[/opios[\/ ]+([\w\.]+)/i],[g,[u,gr+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[u,gr+` GX`]],[/\bopr\/([\w\.]+)/i],[g,[u,gr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[u,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[u,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[u,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[u,`Quark`]],[/\bddg\/([\w\.]+)/i],[g,[u,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[u,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[u,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[u,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[u,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[u,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[g,[u,`Smart `+bo+fr]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,`$1 Secure`+fr],g],[/\bfocus\/([\w\.]+)/i],[g,[u,ur+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[u,gr+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[u,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[u,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[u,gr+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[u,`MIUI`+fr]],[/fxios\/([\w\.-]+)/i],[g,[u,Ot+ur]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[u,`360`]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,`$1Browser`],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,`$1`+fr],g],[/samsungbrowser\/([\w\.]+)/i],[g,[u,pr+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[g,[u,Ss+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,Ss+` Mobile`],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[u,g],[/(lbbrowser|rekonq)/i],[u],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,xo],g,[l,mr]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[u,g,[l,mr]],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[u,`GSA`],[l,mr]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[u,`TikTok`],[l,mr]],[/\[(linkedin)app\]/i],[u,[l,mr]],[/(chromium)[\/ ]([-\w\.]+)/i],[u,g],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[u,ys+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[g,[u,Mi+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,ys+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[u,`Android`+fr]],[/chrome\/([\w\.]+) mobile/i],[g,[u,Ot+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,g],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[g,[u,Ot+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[u,Ot+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[g,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[g,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[u,g],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[u,Ot+ur],g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,`Netscape`],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[u,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[u,ur+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[u,[g,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[u,[g,/[^\d\.]+./,Ut]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[Z,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[Z,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[Z,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[Z,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[Z,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[Z,/ower/,Ut,Le]],[/ sun4\w[;\)]/i],[[Z,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[Z,Le]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[d,pr],[l,A]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[p,[d,pr],[l,E]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[d,kt],[l,E]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[d,kt],[l,A]],[/(macintosh);/i],[p,[d,kt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[d,Cs],[l,E]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[d,vs],[l,A]],[/honor([-\w ]+)[;\)]/i],[p,[d,vs],[l,E]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[p,[d,ws],[l,A]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[d,ws],[l,E]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g,` `],[d,Io],[l,A]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[p,/_/g,` `],[d,Io],[l,E]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[d,bs],[l,E]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[d,So],[l,E]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[d,Se,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":So}],[l,A]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[p,[d,`BLU`],[l,E]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[d,`Vivo`],[l,E]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[d,`Realme`],[l,E]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[p,[d,bo],[l,A]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[p,[d,bo],[l,E]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[p,[d,yo],[l,E]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[d,yo],[l,A]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[d,Ni],[l,A]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[d,Ni],[l,E]],[/(nokia) (t[12][01])/i],[d,p,[l,A]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g,` `],[l,E],[d,`Nokia`]],[/(pixel (c|tablet))\b/i],[p,[d,mt],[l,A]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[p,[d,mt],[l,E]],[/(google) (pixelbook( go)?)/i],[d,p],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[d,dr],[l,E]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,`Xperia Tablet`],[d,dr],[l,A]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[d,Li],[l,A]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,`Fire Phone $1`],[d,Li],[l,E]],[/(playbook);[-\w\),; ]+(rim)/i],[p,d,[l,A]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[d,hs],[l,E]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[d,fs],[l,A]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[d,fs],[l,E]],[/(nexus 9)/i],[p,[d,`HTC`],[l,A]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[p,/_/g,` `],[l,E]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[p,[d,`TCL`],[l,A]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[p,[d,`TCL`],[l,E]],[/(itel) ((\w+))/i],[[d,Le],p,[l,Se,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[d,`Acer`],[l,A]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[d,`Meizu`],[l,E]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[d,`Ulefone`],[l,E]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[d,`Energizer`],[l,E]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[d,`Cat`],[l,E]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[d,`Smartfren`],[l,E]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[p,[d,`Nothing`],[l,E]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[d,`Archos`],[l,A]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[d,`Archos`],[l,E]],[/; (n159v)/i],[p,[d,`HMD`],[l,E]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[d,p,[l,A]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[d,p,[l,E]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[d,p,[l,A]],[/(surface duo)/i],[p,[d,Co],[l,A]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[d,`Fairphone`],[l,E]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[d,Eo],[l,A]],[/(sprint) (\w+)/i],[d,p,[l,E]],[/(kin\.[onetw]{3})/i],[[p,/\./g,` `],[d,Co],[l,E]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[d,To],[l,A]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[d,To],[l,E]],[/smart-tv.+(samsung)/i],[d,[l,W]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,`SmartTV`],[d,pr],[l,W]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[d,p,[l,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,Ni],[l,W]],[/(apple) ?tv/i],[d,[p,kt+` TV`],[l,W]],[/crkey.*devicetype\/chromecast/i],[[p,ze+` Third Generation`],[d,mt],[l,W]],[/crkey.*devicetype\/([^/]*)/i],[[p,/^/,`Chromecast `],[d,mt],[l,W]],[/fuchsia.*crkey/i],[[p,ze+` Nest Hub`],[d,mt],[l,W]],[/crkey/i],[[p,ze],[d,mt],[l,W]],[/(portaltv)/i],[p,[d,xo],[l,W]],[/droid.+aft(\w+)( bui|\))/i],[p,[d,Li],[l,W]],[/(shield \w+ tv)/i],[p,[d,Eo],[l,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[d,Cs],[l,W]],[/(bravia[\w ]+)( bui|\))/i],[p,[d,dr],[l,W]],[/(mi(tv|box)-?\w+) bui/i],[p,[d,Io],[l,W]],[/Hbbtv.*(technisat) (.*);/i],[d,p,[l,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,/.+\/(\w+)/,`$1`,Se,{LG:`lge`}],[p,Vi],[l,W]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[p,[l,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[l,W]],[/(playstation \w+)/i],[p,[d,dr],[l,wr]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[d,Co],[l,wr]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[d,p,[l,wr]],[/droid.+; (shield)( bui|\))/i],[p,[d,Eo],[l,wr]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[d,pr],[l,Ee]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,p,[l,Ee]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[d,So],[l,Ee]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[d,kt],[l,Ee]],[/(opwwe\d{3})/i],[p,[d,bs],[l,Ee]],[/(moto 360)/i],[p,[d,yo],[l,Ee]],[/(smartwatch 3)/i],[p,[d,dr],[l,Ee]],[/(g watch r)/i],[p,[d,Ni],[l,Ee]],[/droid.+; (wt63?0{2,3})\)/i],[p,[d,To],[l,Ee]],[/droid.+; (glass) \d/i],[p,[d,mt],[l,Oi]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,p,[l,Oi]],[/(quest( \d| pro)?s?).+vr/i],[p,[d,xo],[l,Oi]],[/mobile vr; rv.+firefox/i],[[l,Oi]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,vr]],[/(aeobc)\b/i],[p,[d,Li],[l,vr]],[/(homepod).+mac os/i],[p,[d,kt],[l,vr]],[/windows iot/i],[[l,vr]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[p,[l,Se,{mobile:`Mobile`,xr:`VR`,"*":A}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,A]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,E]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[d,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[u,Mi+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[u,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[u,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,g],[/ladybird\//i],[[u,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,u]],os:[[/(windows nt) (6\.[23]); arm/i],[[u,/N/,`R`],[g,Se,Is]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[u,g],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[g,/(;|\))/g,``,Se,Is],[u,ko]],[/(windows ce)\/?([\d\.]*)/i],[u,g],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[u,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[u,`macOS`],[g,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[g,[u,ze+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[g,[u,ze+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[g,[u,ze+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[g,[u,ze+` Linux`]],[/crkey\/([\d\.]+)/i],[g,[u,ze]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[g,u],[/(ubuntu) ([\w\.]+) like android/i],[[u,/(.+)/,`$1 Touch`],g],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[u,g],[/\(bb(10);/i],[g,[u,hs]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[u,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[u,ur+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[g,[u,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[g,Se,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[u,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[u,`watchOS`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,`Chrome OS`],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[u,g],[/(sunos) ?([\d\.]*)/i],[[u,`Solaris`],g],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,g]]},Ui=(function(){var r={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return Ne.call(r.init,[[Q,[u,g,br,l]],[Oe,[Z]],[Ie,[l,p,d]],[he,[u,g]],[de,[u,g]]]),Ne.call(r.isIgnore,[[Q,[g,br]],[he,[g]],[de,[g]]]),Ne.call(r.isIgnoreRgx,[[Q,/ ?browser$/i],[de,/ ?os$/i]]),Ne.call(r.toString,[[Q,[u,g]],[Oe,[Z]],[Ie,[d,p]],[he,[u,g]],[de,[u,g]]]),r})(),nc=function(r,e){var t=Ui.init[e],i=Ui.isIgnore[e]||0,o=Ui.isIgnoreRgx[e]||0,n=Ui.toString[e]||0;function s(){Ne.call(this,t);}return s.prototype.getItem=function(){return r},s.prototype.withClientHints=function(){return Ke?Ke.getHighEntropyValues(Rs).then(function(c){return r.setCH(new _s(c,false)).parseCH().get()}):r.parseCH().get()},s.prototype.withFeatureCheck=function(){return r.detectFeature().get()},e!=Lt&&(s.prototype.is=function(c){var m=false;for(var C in this)if(this.hasOwnProperty(C)&&!Oo(i,C)&&Le(o?Ft(o,this[C]):this[C])==Le(o?Ft(o,c):c)){if(m=true,c!=Xe)break}else if(c==Xe&&m){m=!m;break}return m},s.prototype.toString=function(){var c=Ut;for(var m in n)typeof this[n[m]]!==Xe&&(c+=(c?` `:Ut)+this[n[m]]);return c||Xe}),Ke||(s.prototype.then=function(c){var m=this,C=function(){for(var O in m)m.hasOwnProperty(O)&&(this[O]=m[O]);};C.prototype={is:s.prototype.is,toString:s.prototype.toString};var w=new C;return c(w),w}),new s};function _s(r,e){if(r=r||{},Ne.call(this,Rs),e)Ne.call(this,[[Lo,Do(r[Ye])],[No,Do(r[Xa])],[E,/\?1/.test(r[Za])],[p,hr(r[ec])],[Nt,hr(r[Ps])],[Uo,hr(r[tc])],[Z,hr(r[Ya])],[pt,Do(r[Qa])],[Wi,hr(r[Ja])]]);else for(var t in r)this.hasOwnProperty(t)&&typeof r[t]!==Xe&&(this[t]=r[t]);}function Ds(r,e,t,i){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,n){return this.data[o]=n,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(ee&&ee.userAgent==this.ua)switch(this.itemType){case Q:ee.brave&&typeof ee.brave.isBrave==Fi&&this.set(u,`Brave`);break;case Ie:!this.get(l)&&Ke&&Ke[E]&&this.set(l,E),this.get(p)==`Macintosh`&&ee&&typeof ee.standalone!==Xe&&ee.maxTouchPoints&&ee.maxTouchPoints>2&&this.set(p,`iPad`).set(l,A);break;case de:!this.get(u)&&Ke&&Ke[Nt]&&this.set(u,Ke[Nt]);break;case Lt:var o=this.data,n=function(s){return o[s].getItem().detectFeature().get()};this.set(Q,n(Q)).set(Oe,n(Oe)).set(Ie,n(Ie)).set(he,n(he)).set(de,n(de));}return this},this.parseUA=function(){return this.itemType!=Lt&&Ro.call(this.data,this.ua,this.rgxMap),this.itemType==Q&&this.set(br,Po(this.get(g))),this},this.parseCH=function(){var o=this.uaCH,n=this.rgxMap;switch(this.itemType){case Q:case he:var s=o[No]||o[Lo],c;if(s)for(var m in s){var C=s[m].brand||s[m],w=s[m].version;this.itemType==Q&&!/not.a.brand/i.test(C)&&(!c||/Chrom/.test(c)&&C!=Es||c==Mi&&/WebView2/.test(C))&&(C=Se(C,oc),c=this.get(u),c&&!/Chrom/.test(c)&&/Chrom/.test(C)||this.set(u,C).set(g,w).set(br,Po(w)),c=C),this.itemType==he&&C==Es&&this.set(g,w);}break;case Oe:var O=o[Z];O&&(O&&o[Wi]==`64`&&(O+=`64`),Ro.call(this.data,O+`;`,n));break;case Ie:if(o[E]&&this.set(l,E),o[p]&&(this.set(p,o[p]),!this.get(l)||!this.get(d))){var M={};Ro.call(M,`droid 9; `+o[p]+`)`,n),!this.get(l)&&M.type&&this.set(l,M.type),!this.get(d)&&M.vendor&&this.set(d,M.vendor);}if(o[pt]){var y;if(typeof o[pt]!=`string`)for(var P=0;!y&&P<o[pt].length;)y=Se(o[pt][P++],Ts);else y=Se(o[pt],Ts);this.set(l,y);}break;case de:var x=o[Nt];if(x){var v=o[Uo];x==ko&&(v=parseInt(Po(v),10)>=13?`11`:`10`),this.set(u,x).set(g,v);}this.get(u)==ko&&o[p]==`Xbox`&&this.set(u,`Xbox`).set(g,void 0);break;case Lt:var L=this.data,k=function(b){return L[b].getItem().setCH(o).parseCH().get()};this.set(Q,k(Q)).set(Oe,k(Oe)).set(Ie,k(Ie)).set(he,k(he)).set(de,k(de));}return this},Ne.call(this,[[`itemType`,r],[`ua`,e],[`uaCH`,i],[`rgxMap`,t],[`data`,nc(this,r)]]),this}function we(r,e,t){if(typeof r===Mt?(Bi(r,true)?(typeof e===Mt&&(t=e),e=r):(t=r,e=void 0),r=void 0):typeof r===Ao&&!Bi(e,true)&&(t=e,e=void 0),t&&typeof t.append===Fi){var i={};t.forEach(function(m,C){i[C]=m;}),t=i;}if(!(this instanceof we))return new we(r,e,t).getResult();var o=typeof r===Ao?r:t&&t[us]?t[us]:ee&&ee.userAgent?ee.userAgent:Ut,n=new _s(t,true),s=e?ic(xs,e):xs,c=function(m){return m==Lt?function(){return new Ds(m,o,s,n).set(`ua`,o).set(Q,this.getBrowser()).set(Oe,this.getCPU()).set(Ie,this.getDevice()).set(he,this.getEngine()).set(de,this.getOS()).get()}:function(){return new Ds(m,o,s[m],n).parseUA().get()}};return Ne.call(this,[[`getBrowser`,c(Q)],[`getCPU`,c(Oe)],[`getDevice`,c(Ie)],[`getEngine`,c(he)],[`getOS`,c(de)],[`getResult`,c(Lt)],[`getUA`,function(){return o}],[`setUA`,function(m){return Bt(m)&&(o=m.length>_o?Vi(m,_o):m),this}]]).setUA(o),this}we.VERSION=Ka;we.BROWSER=Hi([u,g,br,l]);we.CPU=Hi([Z]);we.DEVICE=Hi([p,d,l,wr,E,W,A,Ee,vr]);we.ENGINE=we.OS=Hi([u,g]);var $i=class{modifications=[];constructor(){Ce$1(`.lc-hide {display: none !important;height: 0 !important;}
61
+ ${o}`} }`);}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let t=this.rootContainer.id;Ce$1(`#${t} { ${e} }`);}isInViewport(){let e=this.rootContainer?.getBoundingClientRect();if(!e)return false;let t=window.innerHeight||document.documentElement.clientHeight,s=(Math.min(e.bottom,t)-Math.max(e.top,0))*e.width/(e.width*e.height)*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let t=await this.createParentElementWithPlacement(e);if(t)return t;let i=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(i)}async createParentElementWithPlacement(e){let t=this.engagementTrigger.placement;if(!t?.selector)return Y$1.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let i=t.selector,o;if(i.includes(`:shadow`)){let m=i.split(`:shadow`);o=(await On$1(m[0].trim()))?.shadowRoot,i=m[1].trim(),o&&Mi$1(o,false);}Y$1.verbose(`${this.engagementTrigger} attempt to render "${t.position}" "${i}"`);let n=await On$1(i,3,o??document);if(!n)return Y$1.warn(`${this.engagementTrigger} no placement found with ${i}`),null;let s=this.generateParentElementID(),c=this.getParentElement(s);if(!e)return c;switch(t.position){case Ve$3.BEFORE1:case Ve$3.BEFORE:n.parentElement?.insertBefore(c,n);break;case Ve$3.INSIDE_FIRST1:case Ve$3.INSIDE_FIRST:n.insertBefore(c,n.firstChild);break;case Ve$3.INSIDE_LAST1:case Ve$3.INSIDE_LAST:n.appendChild(c);break;case Ve$3.AFTER1:case Ve$3.AFTER:default:n.parentElement?.insertBefore(c,n.nextSibling);}return c}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){Y$1.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}Y$1.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await wi(this.engagementTrigger);}catch(t){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,t);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`);return}this.engagementTrigger.items=e,await this.startRendering();}updateItems(e,t){let i=this.getItemDiff(e,t),o=this.getItemDiff(t,e);t.push(...i);for(let n of o)Re.remove(t,n);}getItemDiff(e,t){return e.filter(i=>!t.some(o=>o.selectedOrFirstVariant.value.mID===i.selectedOrFirstVariant.value.mID))}};var pe=class extends X{constructor(e){super(e);}rerenderAfterCartOpened(){this.rerenderIfDeleted(),this.checkAndSendEvent();}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!V.get().isOpen()&&Be$3().pageName!==`cart`){Y$1.log(`Do not send display event as neither the cart drawer nor the cart page is open.`);return}return super.checkAndSendEvent()}};var Ii=class r{constructor(e,t){this.engagementTrigger=e;this.element=t;this.cartItems=S.getCurrent().items;}cartItems;static renderCartUpsell(e){let t=e.placement;if(!t?.selector){Y$1.warn(`No placement available for ${e.objective}`,e.shortID);return}let i=Array.from(document.querySelectorAll(t.selector));if(!i?.length){Y$1.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let o of i)new r(e,o).render();}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let t=this.engagementTrigger.items.find(w=>w.mID===e.product_id.toString());if(!t)return;let i=t.vars.find(w=>w.mID===e.id.toString());if(!i)return;let o=new nt$1(i),n=e.selling_plan_allocation?.selling_plan;if(n)for(let w of o.sellingPlans??[])w.mID===n.id.toString()&&(w.isSelected=true,o.changeSellingPlan(w));let s=new ot$2(t);s.vars=[o],s.selectedOrFirstVariant.value=o;let c=`lc-cart-item-${this.engagementTrigger.shortID}-${t.mID}`;this.element.classList.add(c);let m=new G(this.engagementTrigger);m.placement.selector=`.${c}`,m.items=[s];let C=new pe(m);C.renderSilently(),this.watchForCartItemDeletion(C,c);}watchForCartItemDeletion(e,t){let i=new MutationObserver(o=>{o.forEach(n=>{n.removedNodes.forEach(s=>{s===this.element&&(Y$1.verbose(`${t} has been removed`),e.destroy(),i.disconnect());});});});i.observe(this.element.parentElement,{childList:true,subtree:true});}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(t=>{if(!(e.includes(t.url)||e.includes(t.variant_id))&&(!e.includes(t.product_title)||t.variant_title&&!e.includes(t.variant_title)))return false;let i=t.selling_plan_allocation?.selling_plan?.name;return !(i&&!e.includes(i))})}};var Ti=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-collection-filter`);}};var xi=class extends pe{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.progressBarConfig.update(e.progressBarConfig),await this.checkMilestoneTryCatch(),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.progressBarConfig}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-progressbar`),await this.checkMilestoneTryCatch();}async checkMilestoneTryCatch(){try{await this.checkMilestone();}catch(e){ke$2(e,`apply-milestones`,{engagementTrigger:this.engagementTrigger});}}async checkMilestone(){let e=await S.getCurrent().getNormalisedCart(),t=this.engagementTrigger.progressBarConfig,i=[],o=[],n=[],s,c,m=[...t.milestones];for(let v of m){if(v.rewardType!==Fe$1.FREE_AUTO_GIFT)continue;if(v.isUIOnly&&!v.allowATC){Y$1.verbose(`Skipping milestone ${v.label} as it is UI only and does not allow ATC`);continue}let L=v.items[0],k=v.reached,b=e.items.find(Qe=>(Qe.vID===L.vID||Qe.mID===L.mID)&&Qe.properties._letscooee_campaign===this.engagementTrigger.shortID);k&&(s=v,c=b),b&&i.push(b),!k&&b&&t.removeIneligibleItem?(Y$1.verbose(`Removing free gift ${b.vID} from cart`),n.push(b)):k&&!b&&(Y$1.verbose(`Adding free gift ${L.vID} to cart`),o.push(L));}t.restrictToLatestFreebie&&s&&(c?(i=i.filter(v=>v.vID!==c.vID),o=[]):o=[s.items[0]],n.push(...i));let C={},w={};n.length&&n.forEach(v=>w[v.key??v.vID]=0),o.length&&o.forEach(v=>w[v.vID]=1);let O=t.coupons,M=[];if(O?.length){M=O.map(k=>k.couponCode);let v=S.getCurrent().discount_codes?.map(k=>k.code)??[];M.every(k=>v.some(b=>b===k))||(C.discount=M.join(`,`));}if(pe$4.hasKeys(w)&&(C.updates=w),!pe$4.hasKeys(C))return;let y=await ts(C,this.engagementTrigger),P=y?.items,x=[];for(let v of o){let L=P?.find(k=>M?.length?k.id+``===v.vID&&k.discounts?.some(b=>M.includes(b.title)):k.id+``===v.vID);L&&x.push(L);}if(!x.length){V.get().refreshUI(y,false);return}try{await Promise.all(x.map(v=>rs(v,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})));}catch(v){ke$2(v,`add-private-attribute`,{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:x}});}finally{V.get().refreshUI(y,false);}}};var sr=class extends pe{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.content.update(e.content),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.content}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-savings-bar`);}};var Di=class extends X{constructor(e){super(e);}isAllOkToRender(){return !!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e,t=this.engagementTrigger.content.videoConfig;t.template===`FLOATING_POPUP`?e=`cooee-video-popup`:t.template===`STORY`?e=`cooee-video-stories`:e=`cooee-video-playlist`,this.createAngularWidget(e);}};var Pi=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-sticky-atc`);}};var Ri=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(`letscooee:inbound:cta:add-bundle`,this.inboundCTAListener.bind(this),false);}async inboundCTAListener(e){let t=this.engagementTrigger,i=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,o=e.detail;if(!pe$4.hasKeys(o)){Y$1.error(`No detail received for ${i}`);return}Y$1.log(`Detail received for BYOB`,o);let n=o.campaignID??o.campaignId??o.campaign_id;if(n!==t.shortID&&n!==t.engagementID){Y$1.warn(`Current ${i} is not BYOB. Received: ${n}`);return}let s=o.items;if(!s?.length)return;let c=s.map(m=>new et({mID:m.product_id,vID:m.variant_id,quantity:m.quantity||1}));await new _e(this.triggerContext).execute({embeddedItems:c,clickAction:{at:He$3.ADD_BUNDLE,applyDiscount:true}});}};var wo=false,vo=false,_i=null,Ai=null,ss=false,lt=new Set,At=new Set;function as(){ss||(ss=true,vt$2(()=>{Nn(document.body,{childList:true,subtree:true},500,Ln).subscribe(()=>{At.forEach(r=>r.rerenderIfDeleted()),lt.forEach(r=>r.rerenderIfDeleted());});}));}function ar(r){if(r.length>0&&ps(),as(),wo){Y$1.verbose(`Cart widget processing in progress, queuing latest triggers`),_i=r;return}wo=true;try{$a(r);}finally{if(wo=false,_i){let e=_i;_i=null,Y$1.verbose(`Processing queued cart triggers`),ar(e);}}}function cr(r){if(r.length>0&&ps(),as(),vo){Y$1.verbose(`Page widget processing in progress, queuing latest triggers`),Ai=r;return}vo=true;try{qa(r);}finally{if(vo=false,Ai){let e=Ai;Ai=null,Y$1.verbose(`Processing queued page triggers`),cr(e);}}}function cs(){lt.forEach(r=>r.rerenderAfterCartOpened());}function $a(r){ms(lt,r);for(let e of r){Y$1.info(`${e} received as cart embed`);let t=ls(lt,e);if(t&&!e.isSubscriptionUpsell()){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;if(e.isProgressBar())i=new xi(e);else if(e.isSubscriptionUpsell()){Ii.renderCartUpsell(e);continue}else e.isSavingsBar()?i=new sr(e):i=new pe(e);lt.add(i),i.renderSilently();}}function qa(r){ms(At,r);for(let e of r){Y$1.info(`${e} received as page embed`);let t=ls(At,e);if(t){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;e.isShoppableVideo()?i=new Di(e):e.isBYOB()?i=new Ri(e):e.isStickyATC()?i=new Pi(e):e.isSavingsBar()?i=new sr(e):e.isCollectionFilter()?i=new Ti(e):i=new X(e),At.add(i),i.renderSilently();}}function ls(r,e){for(let t of r)if(t.matches(e))return t}function ms(r,e){let t=new Set(e.map(i=>i.shortID));for(let i of r)t.has(i.engagementTrigger.shortID)||i.destroy();}function ps(){import('./widgets-DtAGUdfa-C7iwoQiT.js').then(function (n) { return n.ad; }).then(({loadAngularWidgets:r})=>{r();});}var ki=class extends oe$5{static storeName=`app`;static{this.storage=ge$3(this.storeName);}};var Ga=` daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/`,ja=/bot|crawl|http|lighthouse|scan|search|spider/i,lr;function za(){if(lr instanceof RegExp)return lr;try{lr=new RegExp(Ga,`i`);}catch{lr=ja;}return lr}function ds(r){return !!r&&za().test(r)}var Ka=`2.0.4`,_o=500,us=`user-agent`,Ut=``,gs=`?`,Fi=`function`,Xe=`undefined`,Mt=`object`,Ao=`string`,Q=`browser`,Oe=`cpu`,Ie=`device`,he=`engine`,de=`os`,Lt=`result`,u=`name`,l=`type`,d=`vendor`,g=`version`,Z=`architecture`,br=`major`,p=`model`,wr=`console`,E=`mobile`,A=`tablet`,W=`smarttv`,Ee=`wearable`,Oi=`xr`,vr=`embedded`,mr=`inapp`,Lo=`brands`,pt=`formFactors`,No=`fullVersionList`,Nt=`platform`,Uo=`platformVersion`,Wi=`bitness`,Ye=`sec-ch-ua`,Xa=Ye+`-full-version-list`,Ya=Ye+`-arch`,Ja=Ye+`-`+Wi,Qa=Ye+`-form-factors`,Za=Ye+`-`+E,ec=Ye+`-`+p,Ps=Ye+`-`+Nt,tc=Ps+`-version`,Rs=[Lo,No,E,p,Nt,Uo,Z,pt,Wi],Li=`Amazon`,kt=`Apple`,fs=`ASUS`,hs=`BlackBerry`,mt=`Google`,ws=`Huawei`,bo=`Lenovo`,vs=`Honor`,Ni=`LG`,Co=`Microsoft`,yo=`Motorola`,Eo=`Nvidia`,bs=`OnePlus`,So=`OPPO`,pr=`Samsung`,Cs=`Sharp`,dr=`Sony`,Io=`Xiaomi`,To=`Zebra`,ys=`Chrome`,Es=`Chromium`,ze=`Chromecast`,Mi=`Edge`,ur=`Firefox`,gr=`Opera`,xo=`Facebook`,Ss=`Sogou`,Ot=`Mobile `,fr=` Browser`,ko=`Windows`,ee=typeof window!==Xe&&window.navigator?window.navigator:void 0,Ke=ee&&ee.userAgentData?ee.userAgentData:void 0,ic=function(r,e){var t={},i=e;if(!Bi(e)){i={};for(var o in e)for(var n in e[o])i[n]=e[o][n].concat(i[n]?i[n]:[]);}for(var s in r)t[s]=i[s]&&i[s].length%2===0?i[s].concat(r[s]):r[s];return t},Hi=function(r){for(var e={},t=0;t<r.length;t++)e[r[t].toUpperCase()]=r[t];return e},Oo=function(r,e){if(typeof r===Mt&&r.length>0){for(var t in r)if(Le(e)==Le(r[t]))return true;return false}return Bt(r)?Le(e)==Le(r):false},Bi=function(r,e){for(var t in r)return /^(browser|cpu|device|engine|os)$/.test(t)||(e?Bi(r[t]):false)},Bt=function(r){return typeof r===Ao},Do=function(r){if(r){for(var e=[],t=Ft(/\\?\"/g,r).split(`,`),i=0;i<t.length;i++)if(t[i].indexOf(`;`)>-1){var o=Vi(t[i]).split(`;v=`);e[i]={brand:o[0],version:o[1]};}else e[i]=Vi(t[i]);return e}},Le=function(r){return Bt(r)?r.toLowerCase():r},Po=function(r){return Bt(r)?Ft(/[^\d\.]/g,r).split(`.`)[0]:void 0},Ne=function(r){for(var e in r){var t=r[e];typeof t==Mt&&t.length==2?this[t[0]]=t[1]:this[t]=void 0;}return this},Ft=function(r,e){return Bt(e)?e.replace(r,Ut):e},hr=function(r){return Ft(/\\?\"/g,r)},Vi=function(r,e){if(Bt(r))return r=Ft(/^\s\s*/,r),typeof e===Xe?r:r.substring(0,_o)},Ro=function(r,e){if(!(!r||!e))for(var t=0,i,o,n,s,c,m;t<e.length&&!c;){var C=e[t],w=e[t+1];for(i=o=0;i<C.length&&!c&&C[i];)if(c=C[i++].exec(r),c)for(n=0;n<w.length;n++)m=c[++o],s=w[n],typeof s===Mt&&s.length>0?s.length===2?typeof s[1]==Fi?this[s[0]]=s[1].call(this,m):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Fi&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=m?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=m?s[1].call(this,m,s[2]):void 0:s.length==3?this[s[0]]=m?m.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=m?s[3].call(this,m.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=m?s[3].apply(this,[m.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=m||void 0;t+=2;}},Se=function(r,e){for(var t in e)if(typeof e[t]===Mt&&e[t].length>0){for(var i=0;i<e[t].length;i++)if(Oo(e[t][i],r))return t===gs?void 0:t}else if(Oo(e[t],r))return t===gs?void 0:t;return e.hasOwnProperty(`*`)?e[`*`]:r},Is={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},Ts={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},oc={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},xs={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[u,Ot+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[g,[u,Mi+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[u,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,g],[/opios[\/ ]+([\w\.]+)/i],[g,[u,gr+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[u,gr+` GX`]],[/\bopr\/([\w\.]+)/i],[g,[u,gr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[u,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[u,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[u,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[u,`Quark`]],[/\bddg\/([\w\.]+)/i],[g,[u,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[u,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[u,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[u,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[u,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[u,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[g,[u,`Smart `+bo+fr]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,`$1 Secure`+fr],g],[/\bfocus\/([\w\.]+)/i],[g,[u,ur+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[u,gr+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[u,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[u,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[u,gr+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[u,`MIUI`+fr]],[/fxios\/([\w\.-]+)/i],[g,[u,Ot+ur]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[u,`360`]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,`$1Browser`],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,`$1`+fr],g],[/samsungbrowser\/([\w\.]+)/i],[g,[u,pr+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[g,[u,Ss+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,Ss+` Mobile`],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[u,g],[/(lbbrowser|rekonq)/i],[u],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,xo],g,[l,mr]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[u,g,[l,mr]],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[u,`GSA`],[l,mr]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[u,`TikTok`],[l,mr]],[/\[(linkedin)app\]/i],[u,[l,mr]],[/(chromium)[\/ ]([-\w\.]+)/i],[u,g],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[u,ys+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[g,[u,Mi+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,ys+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[u,`Android`+fr]],[/chrome\/([\w\.]+) mobile/i],[g,[u,Ot+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,g],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[g,[u,Ot+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[u,Ot+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[g,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[g,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[u,g],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[u,Ot+ur],g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,`Netscape`],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[u,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[u,ur+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[u,[g,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[u,[g,/[^\d\.]+./,Ut]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[Z,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[Z,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[Z,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[Z,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[Z,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[Z,/ower/,Ut,Le]],[/ sun4\w[;\)]/i],[[Z,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[Z,Le]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[d,pr],[l,A]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[p,[d,pr],[l,E]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[d,kt],[l,E]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[d,kt],[l,A]],[/(macintosh);/i],[p,[d,kt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[d,Cs],[l,E]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[d,vs],[l,A]],[/honor([-\w ]+)[;\)]/i],[p,[d,vs],[l,E]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[p,[d,ws],[l,A]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[d,ws],[l,E]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g,` `],[d,Io],[l,A]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[p,/_/g,` `],[d,Io],[l,E]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[d,bs],[l,E]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[d,So],[l,E]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[d,Se,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":So}],[l,A]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[p,[d,`BLU`],[l,E]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[d,`Vivo`],[l,E]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[d,`Realme`],[l,E]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[p,[d,bo],[l,A]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[p,[d,bo],[l,E]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[p,[d,yo],[l,E]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[d,yo],[l,A]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[d,Ni],[l,A]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[d,Ni],[l,E]],[/(nokia) (t[12][01])/i],[d,p,[l,A]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g,` `],[l,E],[d,`Nokia`]],[/(pixel (c|tablet))\b/i],[p,[d,mt],[l,A]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[p,[d,mt],[l,E]],[/(google) (pixelbook( go)?)/i],[d,p],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[d,dr],[l,E]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,`Xperia Tablet`],[d,dr],[l,A]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[d,Li],[l,A]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,`Fire Phone $1`],[d,Li],[l,E]],[/(playbook);[-\w\),; ]+(rim)/i],[p,d,[l,A]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[d,hs],[l,E]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[d,fs],[l,A]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[d,fs],[l,E]],[/(nexus 9)/i],[p,[d,`HTC`],[l,A]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[p,/_/g,` `],[l,E]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[p,[d,`TCL`],[l,A]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[p,[d,`TCL`],[l,E]],[/(itel) ((\w+))/i],[[d,Le],p,[l,Se,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[d,`Acer`],[l,A]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[d,`Meizu`],[l,E]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[d,`Ulefone`],[l,E]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[d,`Energizer`],[l,E]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[d,`Cat`],[l,E]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[d,`Smartfren`],[l,E]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[p,[d,`Nothing`],[l,E]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[d,`Archos`],[l,A]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[d,`Archos`],[l,E]],[/; (n159v)/i],[p,[d,`HMD`],[l,E]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[d,p,[l,A]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[d,p,[l,E]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[d,p,[l,A]],[/(surface duo)/i],[p,[d,Co],[l,A]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[d,`Fairphone`],[l,E]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[d,Eo],[l,A]],[/(sprint) (\w+)/i],[d,p,[l,E]],[/(kin\.[onetw]{3})/i],[[p,/\./g,` `],[d,Co],[l,E]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[d,To],[l,A]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[d,To],[l,E]],[/smart-tv.+(samsung)/i],[d,[l,W]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,`SmartTV`],[d,pr],[l,W]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[d,p,[l,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,Ni],[l,W]],[/(apple) ?tv/i],[d,[p,kt+` TV`],[l,W]],[/crkey.*devicetype\/chromecast/i],[[p,ze+` Third Generation`],[d,mt],[l,W]],[/crkey.*devicetype\/([^/]*)/i],[[p,/^/,`Chromecast `],[d,mt],[l,W]],[/fuchsia.*crkey/i],[[p,ze+` Nest Hub`],[d,mt],[l,W]],[/crkey/i],[[p,ze],[d,mt],[l,W]],[/(portaltv)/i],[p,[d,xo],[l,W]],[/droid.+aft(\w+)( bui|\))/i],[p,[d,Li],[l,W]],[/(shield \w+ tv)/i],[p,[d,Eo],[l,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[d,Cs],[l,W]],[/(bravia[\w ]+)( bui|\))/i],[p,[d,dr],[l,W]],[/(mi(tv|box)-?\w+) bui/i],[p,[d,Io],[l,W]],[/Hbbtv.*(technisat) (.*);/i],[d,p,[l,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,/.+\/(\w+)/,`$1`,Se,{LG:`lge`}],[p,Vi],[l,W]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[p,[l,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[l,W]],[/(playstation \w+)/i],[p,[d,dr],[l,wr]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[d,Co],[l,wr]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[d,p,[l,wr]],[/droid.+; (shield)( bui|\))/i],[p,[d,Eo],[l,wr]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[d,pr],[l,Ee]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,p,[l,Ee]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[d,So],[l,Ee]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[d,kt],[l,Ee]],[/(opwwe\d{3})/i],[p,[d,bs],[l,Ee]],[/(moto 360)/i],[p,[d,yo],[l,Ee]],[/(smartwatch 3)/i],[p,[d,dr],[l,Ee]],[/(g watch r)/i],[p,[d,Ni],[l,Ee]],[/droid.+; (wt63?0{2,3})\)/i],[p,[d,To],[l,Ee]],[/droid.+; (glass) \d/i],[p,[d,mt],[l,Oi]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,p,[l,Oi]],[/(quest( \d| pro)?s?).+vr/i],[p,[d,xo],[l,Oi]],[/mobile vr; rv.+firefox/i],[[l,Oi]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,vr]],[/(aeobc)\b/i],[p,[d,Li],[l,vr]],[/(homepod).+mac os/i],[p,[d,kt],[l,vr]],[/windows iot/i],[[l,vr]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[p,[l,Se,{mobile:`Mobile`,xr:`VR`,"*":A}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,A]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,E]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[d,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[u,Mi+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[u,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[u,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,g],[/ladybird\//i],[[u,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,u]],os:[[/(windows nt) (6\.[23]); arm/i],[[u,/N/,`R`],[g,Se,Is]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[u,g],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[g,/(;|\))/g,``,Se,Is],[u,ko]],[/(windows ce)\/?([\d\.]*)/i],[u,g],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[u,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[u,`macOS`],[g,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[g,[u,ze+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[g,[u,ze+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[g,[u,ze+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[g,[u,ze+` Linux`]],[/crkey\/([\d\.]+)/i],[g,[u,ze]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[g,u],[/(ubuntu) ([\w\.]+) like android/i],[[u,/(.+)/,`$1 Touch`],g],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[u,g],[/\(bb(10);/i],[g,[u,hs]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[u,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[u,ur+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[g,[u,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[g,Se,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[u,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[u,`watchOS`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,`Chrome OS`],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[u,g],[/(sunos) ?([\d\.]*)/i],[[u,`Solaris`],g],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,g]]},Ui=(function(){var r={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return Ne.call(r.init,[[Q,[u,g,br,l]],[Oe,[Z]],[Ie,[l,p,d]],[he,[u,g]],[de,[u,g]]]),Ne.call(r.isIgnore,[[Q,[g,br]],[he,[g]],[de,[g]]]),Ne.call(r.isIgnoreRgx,[[Q,/ ?browser$/i],[de,/ ?os$/i]]),Ne.call(r.toString,[[Q,[u,g]],[Oe,[Z]],[Ie,[d,p]],[he,[u,g]],[de,[u,g]]]),r})(),nc=function(r,e){var t=Ui.init[e],i=Ui.isIgnore[e]||0,o=Ui.isIgnoreRgx[e]||0,n=Ui.toString[e]||0;function s(){Ne.call(this,t);}return s.prototype.getItem=function(){return r},s.prototype.withClientHints=function(){return Ke?Ke.getHighEntropyValues(Rs).then(function(c){return r.setCH(new _s(c,false)).parseCH().get()}):r.parseCH().get()},s.prototype.withFeatureCheck=function(){return r.detectFeature().get()},e!=Lt&&(s.prototype.is=function(c){var m=false;for(var C in this)if(this.hasOwnProperty(C)&&!Oo(i,C)&&Le(o?Ft(o,this[C]):this[C])==Le(o?Ft(o,c):c)){if(m=true,c!=Xe)break}else if(c==Xe&&m){m=!m;break}return m},s.prototype.toString=function(){var c=Ut;for(var m in n)typeof this[n[m]]!==Xe&&(c+=(c?` `:Ut)+this[n[m]]);return c||Xe}),Ke||(s.prototype.then=function(c){var m=this,C=function(){for(var O in m)m.hasOwnProperty(O)&&(this[O]=m[O]);};C.prototype={is:s.prototype.is,toString:s.prototype.toString};var w=new C;return c(w),w}),new s};function _s(r,e){if(r=r||{},Ne.call(this,Rs),e)Ne.call(this,[[Lo,Do(r[Ye])],[No,Do(r[Xa])],[E,/\?1/.test(r[Za])],[p,hr(r[ec])],[Nt,hr(r[Ps])],[Uo,hr(r[tc])],[Z,hr(r[Ya])],[pt,Do(r[Qa])],[Wi,hr(r[Ja])]]);else for(var t in r)this.hasOwnProperty(t)&&typeof r[t]!==Xe&&(this[t]=r[t]);}function Ds(r,e,t,i){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,n){return this.data[o]=n,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(ee&&ee.userAgent==this.ua)switch(this.itemType){case Q:ee.brave&&typeof ee.brave.isBrave==Fi&&this.set(u,`Brave`);break;case Ie:!this.get(l)&&Ke&&Ke[E]&&this.set(l,E),this.get(p)==`Macintosh`&&ee&&typeof ee.standalone!==Xe&&ee.maxTouchPoints&&ee.maxTouchPoints>2&&this.set(p,`iPad`).set(l,A);break;case de:!this.get(u)&&Ke&&Ke[Nt]&&this.set(u,Ke[Nt]);break;case Lt:var o=this.data,n=function(s){return o[s].getItem().detectFeature().get()};this.set(Q,n(Q)).set(Oe,n(Oe)).set(Ie,n(Ie)).set(he,n(he)).set(de,n(de));}return this},this.parseUA=function(){return this.itemType!=Lt&&Ro.call(this.data,this.ua,this.rgxMap),this.itemType==Q&&this.set(br,Po(this.get(g))),this},this.parseCH=function(){var o=this.uaCH,n=this.rgxMap;switch(this.itemType){case Q:case he:var s=o[No]||o[Lo],c;if(s)for(var m in s){var C=s[m].brand||s[m],w=s[m].version;this.itemType==Q&&!/not.a.brand/i.test(C)&&(!c||/Chrom/.test(c)&&C!=Es||c==Mi&&/WebView2/.test(C))&&(C=Se(C,oc),c=this.get(u),c&&!/Chrom/.test(c)&&/Chrom/.test(C)||this.set(u,C).set(g,w).set(br,Po(w)),c=C),this.itemType==he&&C==Es&&this.set(g,w);}break;case Oe:var O=o[Z];O&&(O&&o[Wi]==`64`&&(O+=`64`),Ro.call(this.data,O+`;`,n));break;case Ie:if(o[E]&&this.set(l,E),o[p]&&(this.set(p,o[p]),!this.get(l)||!this.get(d))){var M={};Ro.call(M,`droid 9; `+o[p]+`)`,n),!this.get(l)&&M.type&&this.set(l,M.type),!this.get(d)&&M.vendor&&this.set(d,M.vendor);}if(o[pt]){var y;if(typeof o[pt]!=`string`)for(var P=0;!y&&P<o[pt].length;)y=Se(o[pt][P++],Ts);else y=Se(o[pt],Ts);this.set(l,y);}break;case de:var x=o[Nt];if(x){var v=o[Uo];x==ko&&(v=parseInt(Po(v),10)>=13?`11`:`10`),this.set(u,x).set(g,v);}this.get(u)==ko&&o[p]==`Xbox`&&this.set(u,`Xbox`).set(g,void 0);break;case Lt:var L=this.data,k=function(b){return L[b].getItem().setCH(o).parseCH().get()};this.set(Q,k(Q)).set(Oe,k(Oe)).set(Ie,k(Ie)).set(he,k(he)).set(de,k(de));}return this},Ne.call(this,[[`itemType`,r],[`ua`,e],[`uaCH`,i],[`rgxMap`,t],[`data`,nc(this,r)]]),this}function we(r,e,t){if(typeof r===Mt?(Bi(r,true)?(typeof e===Mt&&(t=e),e=r):(t=r,e=void 0),r=void 0):typeof r===Ao&&!Bi(e,true)&&(t=e,e=void 0),t&&typeof t.append===Fi){var i={};t.forEach(function(m,C){i[C]=m;}),t=i;}if(!(this instanceof we))return new we(r,e,t).getResult();var o=typeof r===Ao?r:t&&t[us]?t[us]:ee&&ee.userAgent?ee.userAgent:Ut,n=new _s(t,true),s=e?ic(xs,e):xs,c=function(m){return m==Lt?function(){return new Ds(m,o,s,n).set(`ua`,o).set(Q,this.getBrowser()).set(Oe,this.getCPU()).set(Ie,this.getDevice()).set(he,this.getEngine()).set(de,this.getOS()).get()}:function(){return new Ds(m,o,s[m],n).parseUA().get()}};return Ne.call(this,[[`getBrowser`,c(Q)],[`getCPU`,c(Oe)],[`getDevice`,c(Ie)],[`getEngine`,c(he)],[`getOS`,c(de)],[`getResult`,c(Lt)],[`getUA`,function(){return o}],[`setUA`,function(m){return Bt(m)&&(o=m.length>_o?Vi(m,_o):m),this}]]).setUA(o),this}we.VERSION=Ka;we.BROWSER=Hi([u,g,br,l]);we.CPU=Hi([Z]);we.DEVICE=Hi([p,d,l,wr,E,W,A,Ee,vr]);we.ENGINE=we.OS=Hi([u,g]);var $i=class{modifications=[];constructor(){Ce$1(`.lc-hide {display: none !important;height: 0 !important;}
62
62
  .lc-display-block {display: block !important;}
63
- .lc-display-inline {display: inline !important;}`,document.body);}execute(e){for(let t of e){if(!t.experimentConfig)continue;this.executeExperiment(t)&&this.trackExperimentRan(t);}if(document.querySelector(`#lc-hide-body`)?.remove(),!document.body){to(`No body element found`,`error`);return}this.setupMutationObserver();}executeExperiment(e){let t=e.experimentConfig?.modifications;if(!t?.length)return Y$1.log(`Nothing to experiment`,e.toString()),true;let i=false;for(let o of t){if(!o.cssSelector){Y$1.verbose(`No CSS Selector available`,e?.toString());continue}this.modifications.push(o);let n=Array.from(document.querySelectorAll(o.cssSelector));n?.length&&(this.executeSingleModification(o,n),i=true);}return i}executeSingleModification(e,t){if(t?.length)for(let i of t)Object.assign(i.style,e.style),e.display===`HIDE`?i.classList.add(`lc-hide`):e.display===`BLOCK`?i.classList.add(`lc-display-block`):e.display===`INLINE`&&i.classList.add(`lc-display-inline`),e.type===`TEXT`&&e.text?i.innerHTML=e.text:e.type===`IMAGE`&&this.updateImage(e,i),e.moveTo?.selector&&this.changePlacement(e,i).catch(console.error);}async changePlacement(e,t){let i=await On$1(e.moveTo.selector);if(i)switch(e.moveTo.position){case Ve$3.BEFORE1:t.nextElementSibling!==i&&i.parentElement?.insertBefore(t,i);break;case Ve$3.INSIDE_FIRST1:i.firstChild!==t&&i.insertBefore(t,i.firstChild);break;case Ve$3.INSIDE_LAST1:i.lastChild!==t&&i.appendChild(t);break;case Ve$3.AFTER1:default:t.previousElementSibling!==i&&i.parentElement?.insertBefore(t,i.nextSibling);}}trackExperimentRan(e){if(e.id===`preview`){Y$1.warn(`Skipping experiment attribution as its preview`,e.toString());return}As({name:`CE Experiment Start`,experiment:new mt$1(e)}).catch(t=>{Y$1.error(`Fail to track experiment`,t);});}setupMutationObserver(){new MutationObserver(t=>{t.forEach(i=>{i.addedNodes.forEach(o=>{o instanceof HTMLElement&&this.modifications.forEach(n=>{if(o.matches&&o.matches(n.cssSelector))Y$1.verbose(`1. Re-applying experiment`,n.toString()),this.executeSingleModification(n,[o]);else if(o.querySelectorAll){let s=Array.from(o.querySelectorAll(n.cssSelector));if(!s.length)return;Y$1.verbose(`2. Re-applying experiment`,n.toString()),this.executeSingleModification(n,s);}});});});}).observe(document.body,{childList:true,subtree:true});}updateImage(e,t){let i=e.image?.lg?.src,o=e.image?.sm?.src;!i&&!o||(t instanceof HTMLPictureElement?this.updatePictureElement({desktop:i,mobile:o},t):this.updateImageElement({desktop:i,mobile:o},t));}updateImageElement(e,t){M$1()&&e.mobile?(t.setAttribute(`src`,e.mobile),t.removeAttribute(`srcset`)):e.desktop&&(t.setAttribute(`src`,e.desktop),t.removeAttribute(`srcset`));}updatePictureElement(e,t){if(t.innerHTML=``,e.mobile){let o=document.createElement(`source`);o.srcset=e.mobile,o.media=`(max-width: 767px)`,t.append(o);}if(e.desktop){let o=document.createElement(`source`);o.srcset=e.desktop,o.media=`(min-width: 768px)`,t.append(o);}let i=document.createElement(`img`);i.src=e.desktop??e.mobile??``,t.append(i);}};async function As(r$9){let e=await qe();await me(`/v1/event/experiment`,r(r({},r$9),e));}function qi(){sc().catch(r=>ke$2(r,`fetch-experiments`));}async function sc(){Be$3().activeExperiments&&(await le$1(le),await ac());}async function ac(){Y$1.info(`Fetch experiments after ⏰`,tn()+` of SDK load`);me(`/v1/engagement/experiments`,r({},await qe())).then(async t=>{Y$1.info(`Experiments fetched ${Qr$3(t.timeTakenMs)}`);let i=t.data.experiments.map(o=>new G(o));new $i().execute(i);}).catch(t=>{Y$1.error(`Error sending experiment getter`,t);});}function ks(){let r=he$3.get();!r.gaMeasurementID||!r.gaEnabled||lc();}async function cc(){let r=await fe$4.get(`gacid`),e=await mc();if(r!==e)return await fe$4.set(`gacid`,e),e}async function lc(){let r=await cc();r&&Kn({gaClientID:r});}async function mc(){let e=he$3.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(t=>{window.gtag(`get`,e,`client_id`,i=>{t(i);});})}async function Os(r){Y$1.verbose(`Received app configuration`,r),r.currencyCount=r.currencies?.length;let e=D.globalRef.config.update(r);ks(),V.initialize(),e.website&&(Ui$1(e.website.commonJS),Ce$1(e.website.commonCSS)),window.CooeeSDK.cartDrawerToggle$.pipe(Fe(10)).subscribe(async({open:t})=>{Y$1.info(`Cart drawer is now`,t?`open`:`closed`),t&&(cs(),await pc());});}function Ls(r){D.globalRef.apiURLs=r;}async function pc(){let r=await S.getCurrent().getNormalisedCart(),e={value:r.amount,currency:r.currency};z(new Ir$1(`View Cart`,{items:r.items,amount:e,drawer:true}));}var Gi=class{runtimeData=Be$3();meddle(){let e=D.globalRef;e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods();}exposeMethods(){let e=D.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{Vt();},e.loadExperiments=()=>{qi();},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=D.previewWidget.bind(D),e.previewPopup=D.previewPopup.bind(D),e.executeCTA=(t,i)=>{new _e(t).execute(i);},e.sendEvent=t=>{z(t);};}overwritePush(e,t){Mn$1(e,`push`,t);}meddleEvents(){this.overwritePush(D.globalRef.events,(...e)=>{this.processEvent(e[0]);}),D.globalRef.events.forEach(this.processEvent.bind(this));}meddleProfile(){this.overwritePush(D.globalRef.profile,(...e)=>{this.processProfile(e[0]);}),D.globalRef.profile.forEach(this.processProfile.bind(this));}processEvent(e){e&&(qr$3.includes(e[0])?D.sendEvent(e[0],e[1],r({occurred:this.runtimeData.jsLoadTime},e[2])):D.sendEvent(e[0],e[1],e[2]));}processProfile(e){e&&D.updateProfile(e);}meddlePage(){this.overwritePush(D.globalRef.page,(...e)=>{this.processPage(e[0]);}),D.globalRef.page.forEach(this.processPage.bind(this));}processPage(e){e.appID&&D.authenticate(e),e.currentItem&&dc(e.currentItem),e.currency&&(Be$3().currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&D.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&S.getCurrent().update(e.cart),e.configurations&&Os(e.configurations),e.apiURLs&&Ls(e.apiURLs),e.customContext&&(this.runtimeData.customContext=r(r({},this.runtimeData.customContext),e.customContext));}async testCartUpdate(){if(Be$3().pageName!==`product`){window.alert(`This feature is only available on a product page`);return}let e=os();if(e||(e=Be$3().currentItem?.vID),!e){window.alert(`Could not find a variant to test. Please try a different product page`);return}let t=new G({id:`preview`,shortID:`1`,redirectBehaviour:Me$1.CART_DRAWER});await new _e(new Be(new Date,t)).execute({clickAction:{at:He$3.ADD_TO_CART},embeddedItem:new et({vID:e})});}};function dc(r){let e=Be$3();if(e.currentItem&&e.currentItem.vID!==r.vID){let t=new CustomEvent(`letscooee:variant-change`,{detail:{variantID:r.vID,productID:r.mID}});document.dispatchEvent(t);}e.currentItem=new et(r);}var Wt=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=`cooee`.concat(`-`);static getString(e,t){return this.getItem(e)||t}static setString(e,t){this.setItem(e,t);}static remove(e){this.removeItem(e);}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,t){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),t);}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e));}};var uc=1e3,gc=10,Mo=0,Fo=new Date;function Bo(r){Wt.remove(`sleid`),Fo=r??new Date;}function Ns(){if(window.scrollY){let r=Fs();Us(r)&&Ms(r);}vt$2(()=>{fc();});}function fc(){Tr(window,`scroll`).pipe(Fe(uc),q$1(()=>{let r=Fs();if(r>100){Y$1.warn(`Received scroll percent is more than 100`,r);return}if(Us(r))return r})).subscribe(r=>{Ms(r);});}function Us(r){return Math.abs(Mo-r)>=gc||Mo!==r&&r===100}function Ms(r){if(r==null)return;let e={percent:r,timeMS:new Date().getTime()-Fo.getTime()};Mo=r;let i=new Ir$1(`CE Scroll`,e,null,Wt.getString(`sleid`,``));z(i),Wt.setString(`sleid`,i.id.toHexString()),Fo=new Date(i.occurred);}function Fs(){let r=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/r*100)}function Bs(){document.onvisibilitychange=()=>{document.visibilityState===`visible`?hc():document.visibilityState===`hidden`&&wc();};}async function hc(){}async function wc(){let r=await vc();if(r===0){Y$1.info(`Not sending duration as user was inactive on website`);return}Ws(r);}async function vc(){let r=Be$3();return r.inInactive?0:(r.inInactive=true,r.lastEnterInactive=new Date,Math.max(r.lastEnterInactive.getTime()-r.lastEnterActive.getTime(),0))}function Vs(){let r=Be$3();return r.inInactive?(r.inInactive=false,r.lastEnterActive=new Date,Math.max((r.lastEnterActive.getTime()-r.lastEnterInactive.getTime())/1e3,0)):0}function Hs(){bc();}function bc(){let r=window.fetch;try{window.fetch=async function(e,t){try{await Cc(e,t);}catch(i){ke$2(i,`modify-graphql-request`,{extra:{body:JSON.stringify(t?.body)}});}return r(e,t)};}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Buy Now Clicked" KPI.`),Y$1.error(e);}Y$1.verbose(`Securely overwritten window.fetch method for graphql query`);}async function Cc(r,e){let t=typeof r==`string`?r:r instanceof Request?r.url:``;if(!(t.includes(`graphql.json`)&&e?.method===`POST`)||!e.body)return;let i;if(typeof e.body==`string`)try{i=JSON.parse(e.body);}catch{return}else i=e.body;i?.variables?.input&&(Y$1.verbose(`Intercepted fetch request of:`,t),i?.query.includes(`cartCreate`)&&(e.body=await yc(i),Ec()));}async function yc(r){let e=r.variables.input.attributes??[],t=await Pn$1(`Buy Now`);return r.variables.input.attributes=[...e,...t],JSON.stringify(r)}function Ec(){let r=Be$3().currentItem;if(!r)return;z(new Ir$1(`Buy Now Clicked`,{items:[r]}));}var Ht=class{constructor(e,t){this.selectors=e;this.eventName=t;this.selectorString=e.join(`,`);}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let t=e.currentTarget;z(new Ir$1(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0})),this.removeClickListener(this.clickListenerCallback);};listenSilently(){this.listen().catch(e=>Y$1.error(e));}async listen(){this.elements=await xr$1(this.selectorString),this.elements.forEach(e=>{e.addEventListener(`click`,this.clickListenerCallback);});}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener(`click`,e);});}};var ji=class r extends Ht{static selectors=[`.product__thumbnail-list-inner > button`,`product-gallery-navigation > button`,`.product-media--thumb-container`,`.product-images-inner > img`,`.m-product-media`,`.swiper-button-control`,`.media__thumb`,`.slick-arrow`,`.productView-img-container.product-single__media`,`.product-gallery__thumbnail_item_inner`];constructor(){super(r.selectors,`Item Thumbnail Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var zi=class r extends Ht{static selectors=[`.jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup`,`reviewsio-product-ratings`,`.ruk_rating_snippet.tracked:not(.hidden)`,`a > .loox-rating`,`.yotpo-reviews-star-ratings-widget`,`.yotpo.lp-hero__reviews`,`.pr-rating > a`,`.rivyoReviewWidget`];constructor(){super(r.selectors,`Review Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var Sc=[`.gokwik-checkout button`,`button.cart__checkout-button`,`button.cart__checkout`,`button#checkout`,`button#checkout2`,`button[id*="checkout" i]`,`button[name*="checkout" i]`,`button[class*="checkout" i]`].join(`,`);function $s(){vt$2(()=>{Y$1.verbose(`Execution order:`,`document ready`),Ic();});}function Ic(){let r=window.location.hash?.substring(1);if(r)if(r.includes(`initiate-checkout`)){document.dispatchEvent(new Event(`letscooee:outbound:third-party-initiate-checkout`));let e=document.querySelector(Sc);if(!e){Y$1.verbose(`No clickable cart checkout button found`);return}Y$1.verbose(`Clickable cart checkout button found`,e),e.click();}else r.includes(`open-cart-drawer`)&&V.get().open();}function Gs(){window.addEventListener(`kp-modal:opened`,()=>{Be$3().isGoKwikPopupOpen=true;}),window.addEventListener(`user-loggedin`,r=>{let{token:e}=r.detail;e&&Rt({goKwikToken:e});}),window.gokwikSdk?qs():window.addEventListener(`gokwikLoaded`,qs);}function qs(){window.gokwikSdk&&window.gokwikSdk.on(`checkout_initiated`,async()=>{let r=await S.getCurrent().getNormalisedCart();z(new Ir$1(`Checkout Started`,{via:`GoKwik`,items:r.items,cartToken:r.token,amount:{value:r.amount,currency:r.currency}}));});}var D=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(e){if(!window.cooeeSDKPreview){if(Y$1.info(`Initialising SDK`),ds(navigator.userAgent)){Y$1.info(`This seems to be a bot. Disabling SDK`);return}this.initGlobalReference(e),await zs(),this.autoAuthenticate(),new Gi().meddle(),Gn(),qi(),Tc(),Bs(),Vn(),Hs(),$s(),Ns(),zi.getInstance().listenSilently(),ji.getInstance().listenSilently(),Gs(),xc(),Hn$1(),ki.remove(`conf`).catch(t=>{Y$1.error(`Fail to remove App Config from local storage`,t);});}}static initGlobalReference(e){window.CooeeSDK||Mn$1(window,`CooeeSDK`,{}),this.globalRef=window.CooeeSDK,Mn$1(this.globalRef,`config`,new he$3),Mn$1(this.globalRef,`runtimeData`,{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),Mn$1(this.globalRef,`uaParser`,new we,true),Mn$1(this.globalRef,`cart`,S.getCurrent()),Mn$1(this.globalRef,`cartChange$`,Bn()),Mn$1(this.globalRef,`cartDrawerToggle$`,V.cartDrawerToggle$.asObservable()),Y$1.verbose(`Global reference initialised`),new le$3(()=>{this.globalRef.uaParser=new we;});}static autoAuthenticate(){let e=Xr();e&&this.authenticate({shopifyShop:e});}static authenticate(e){if(this.authenticated)return;Y$1.info(`Begin auth after ⏰`,tn(),`of SDK load`);let t=e.appID?.trim(),i=e.shopifyShop;if((Cn(t)||t.length!==24)&&Cn(i)){Y$1.warn(`Cooee App ID or Shop name is not configured`);return}this.authenticated=true,js(e);}static sendEvent(e,t,i){let o=new Ir$1(e,t,i?.triggerData);i?.occurred&&(o.occurred=i.occurred),z(o);}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith(`ce `))throw new Error(`User property name cannot start with 'CE '`);Rt(e);}static setPageName(e){if(!e)return;let t=Be$3(),i=t.pageName;if(e===i)return;if(t.pageName=e,jr$2.some(s=>e.includes(s))){Bo();return}let o={};i&&(o.ps=i);let n=new Ir$1(`CE Screen View`,o);n.occurred=t.jsLoadTime,z(n),Bo(n.occurred);}static previewPopup(e,t){import('./renderer-8BzVq4fY-CykIBgo7.js').then(({FreeformRenderer:i})=>{new i(t).render(e);});}static previewWidget(e){new X(new G(e)).renderSilently();}};function Tc(){window.CooeeSDK.cartChange$.subscribe(()=>{Vt();});}function xc(){if(window.opener){try{window.opener.postMessage({action:`COOEE_READY_FOR_PREVIEW`},`*`);}catch(r){Y$1.error(r);}window.addEventListener(`message`,r=>{if(Y$1.verbose(`Received event`,r),!r.origin.includes(`letscooee.com`)&&!r.origin.includes(`localhost`))return;let e=r.data;typeof e==`object`&&(e.action===`POPUP_PREVIEW`?(D.previewPopup(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)):e.action===`WIDGET_PREVIEW`&&(D.previewWidget(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)));});}}var Xs=new U,Ks=0;Xs.pipe(Fe(50)).subscribe(async r=>{Dc(await qe()).catch(t=>{ke$2(t,`load-page-widgets`,{extra:{firstLoad:r}});});});function Vt(r=false){le$1(le).then(()=>{Xs.next(r);});}async function ns(r){let e=await qe();return Object.assign(r,e),me(`/v1/engagement/get-variant`,r)}async function Dc(r$10){Ks++,Ks===1?Y$1.info(`Fetch widgets (after ⏰`,tn()+` of SDK load)`):Y$1.info(`Fetch widgets`);let e=r({},r$10),t=Bn$1(`/v1/engagement/eligible`,D.globalRef.apiURLs?.engagementsURL);try{let i=await me(t,e);if(Y$1.info(`Widgets fetched ${Qr$3(i.timeTakenMs)}`),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new G(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new G(n)));}catch(i){Y$1.error(`Error sending widget getter`,i);}}var Ys=x$2(dr$2()),Ki=class r{static META_REQUIRED_FIELDS=[`ad_id`];static GOOGLE_REQUIRED_FIELDS=[`gad_source`,`gclid`];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source;}static getAdParams(){let e;try{e=new Ys.URLBuilder(location.href);}catch{return {}}let t={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return t={source:`META`,adID:e.getQueryParam(`ad_id`)?.trim(),campaignID:e.getQueryParam(`campaign_id`)?.trim()},new r(t);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return t={source:`GOOGLE`},new r(t)}};var Vo={d:(r,e)=>{for(var t in e)Vo.o(e,t)&&!Vo.o(r,t)&&Object.defineProperty(r,t,{enumerable:true,get:e[t]});},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},Wo={};Vo.d(Wo,{A:()=>Pc,k:()=>Ho});var Cr=function(r,e,t,i){return new(t||(t=Promise))(function(o,n){function s(C){try{m(i.next(C));}catch(w){n(w);}}function c(C){try{m(i.throw(C));}catch(w){n(w);}}function m(C){var w;C.done?o(C.value):(w=C.value,w instanceof t?w:new t(function(O){O(w);})).then(s,c);}m((i=i.apply(r,[])).next());})},yr=function(r,e){var t,i,o,n,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol==`function`&&(n[Symbol.iterator]=function(){return this}),n;function c(m){return function(C){return (function(w){if(t)throw new TypeError(`Generator is already executing.`);for(;n&&(n=0,w[0]&&(s=0)),s;)try{if(t=1,i&&(o=2&w[0]?i.return:w[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,w[1])).done)return o;switch(i=0,o&&(w=[2&w[0],o.value]),w[0]){case 0:case 1:o=w;break;case 4:return s.label++,{value:w[1],done:!1};case 5:s.label++,i=w[1],w=[0];continue;case 7:w=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||w[0]!==6&&w[0]!==2)){s=0;continue}if(w[0]===3&&(!o||w[1]>o[0]&&w[1]<o[3])){s.label=w[1];break}if(w[0]===6&&s.label<o[1]){s.label=o[1],o=w;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(w);break}o[2]&&s.ops.pop(),s.trys.pop();continue}w=e.call(r,s);}catch(O){w=[6,O],i=0;}finally{t=o=0;}if(5&w[0])throw w[1];return {value:w[0]?w[1]:void 0,done:true}})([m,C])}}};function Ho(){return Cr(this,void 0,Promise,function(){return yr(this,function(r){switch(r.label){case 0:return [4,new Promise(function(e,t){var i=`Unknown`,o=false;function n(y){o||(o=true,e({isPrivate:y,browserName:i}));}function s(){var y=0,P=parseInt(`-1`);try{P.toFixed(P);}catch(x){y=x.message.length;}return y}function c(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return false}})(39)}function m(){var y;return Cr(this,void 0,void 0,function(){var P,x;return yr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),n(false),[3,3];case 2:return P=v.sent(),x=P,P instanceof Error&&(x=(y=P.message)!==null&&y!==void 0?y:P),typeof x!=`string`?(n(false),[2]):(n(!!x.includes(`unknown transient reason`)),[3,3]);case 3:return [2]}})})}function C(){var y;return Cr(this,void 0,Promise,function(){return yr(this,function(P){switch(P.label){case 0:return ((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,m()];case 1:return P.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var x=String(Math.random());try{var v=indexedDB.open(x,1);v.onupgradeneeded=function(L){var k=L.target.result,b=function(Qe){n(Qe);};try{k.createObjectStore(`t`,{autoIncrement:!0}).put(new Blob),b(!1);}catch(Qe){(Qe.message||``).includes(`are not yet supported`)?b(!0):b(!1);}finally{k.close(),indexedDB.deleteDatabase(x);}},v.onerror=function(){return n(!1)};}catch{n(false);}})():(function(){var x=window.openDatabase,v=window.localStorage;try{x(null,null,null,null);}catch{n(true);return}try{v.setItem(`test`,`1`),v.removeItem(`test`);}catch{n(true);return}n(false);})(),P.label=3;case 3:return [2]}})})}function w(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,P){var x;n(Math.round(P/1048576)<2*Math.round(((x=window).performance!==void 0&&x.performance.memory!==void 0&&x.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576));},function(y){t(new Error(`detectIncognito somehow failed to query storage quota: `+y.message));});}function O(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?w():(0, window.webkitRequestFileSystem)(0,1,function(){n(false);},function(){n(true);});}function M(){return Cr(this,void 0,Promise,function(){var y,P;return yr(this,function(x){switch(x.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return [3,4];x.label=1;case 1:return x.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return x.sent(),n(false),[3,4];case 3:return y=x.sent(),typeof(P=y instanceof Error&&typeof y.message==`string`?y.message:String(y))!=`string`?(n(false),[2]):(n(P.includes(`Security error`)),[2]);case 4:return n(navigator.serviceWorker===void 0),[2]}})})}(function(){return Cr(this,void 0,Promise,function(){return yr(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(i=`Safari`,[4,C()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(P=navigator.userAgent,i=P.match(/Chrome/)?navigator.brave!==void 0?`Brave`:P.match(/Edg/)?`Edge`:P.match(/OPR/)?`Opera`:`Chrome`:`Chromium`,O(),[3,6]);case 3:return s()!==25?[3,5]:(i=`Firefox`,[4,M()]);case 4:return y.sent(),[3,6];case 5:c()?(i=`Internet Explorer`,n(window.indexedDB===void 0)):t(new Error(`detectIncognito cannot determine the browser`)),y.label=6;case 6:return [2]}var P;})})})().catch(t);})];case 1:return [2,r.sent()]}})})}typeof window<`u`&&(window.detectIncognito=Ho);var Pc=Ho,Js=Wo.A;Wo.k;var Qs=x$2(Et$3()),Zs=async()=>{let r={};try{return await Rc(r)}catch(e){return ke$2(e,`device-properties`),r}},Rc=async r=>{let e=window.CooeeSDK.uaParser;_c(r),Ac(r),kc(r),r.referrer=document.referrer,r.host=location.origin,r.path=location.pathname,r.qs=location.search,r.locale=navigator.language,r.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:Oc()},r.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(r.headless=true,oo$1({headless:true}));let t=e.getResult();return r.browser=t.browser,r.device=t.device,r.engine=t.engine,r.cpu=t.cpu,r.os=t.os,r.navigatorUA=navigator.userAgent,await Promise.all([Uc(r),Lc(r),Mc(r)]),r},_c=r=>{let e=navigator;if(!e.deviceMemory)return;r.mem={tot:e.deviceMemory*1024};},Ac=r=>{let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(r.net={type:t.effectiveType});},kc=r=>{let e=screen.orientation?.type;e&&(r.orientation=e);},Oc=()=>{if(!document.body)return;let r=document.createElement(`div`);r.setAttribute(`style`,`height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;`),document.body.appendChild(r);let e=window.devicePixelRatio||1,t=r.offsetWidth*e;return document.body.removeChild(r),t},Lc=async r=>{try{await Nc(r);}catch(e){Y$1.error(`Unable to get location`,e);}},Nc=async r=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:`geolocation`})).state!=`granted`))return new Promise(t=>{navigator.geolocation.getCurrentPosition(i=>{r.coords=[i.coords.latitude,i.coords.longitude],t();},()=>t());})},Uc=async r=>{if(`getBattery`in navigator)try{let t=await navigator.getBattery();r.bat={l:t.level*100,c:t.charging},oo$1({"battery.level":r.bat.l,"battery.charging":r.bat.c});}catch{}},Mc=async r=>{try{(await Js())?.isPrivate&&(r.incognito=!0,oo$1({incognito:!0}));}catch(e){Qs.default.error(`Unable to detect private/incognito window`,e);}};function ta(r){if(!ra())return;let e=Ye$2[r]?.toLowerCase();e&&(Y$1.verbose(`Sending ${e} intent to MS Clarity`),window.clarity(`set`,`Cooee Intent`,e));}function ra(){return window.clarity&&typeof window.clarity==`function`}var le=new gr$1(1),oa=`App ID or Shopify shop is not set`,$o=``,Je=``,qo=``,Xi;async function js(r){$o=r.appID,qo=r.shopifyShop;try{await Fc(),le.next(!0),le.complete();}catch(e){e?.message?.includes(oa)&&ke$2(e,`initiate-session`,{extra:r}),Y$1.error(`Unable to initiate session`,e);}}async function jn(){return await na(false),Xi}async function zs(){let r=Date.now();await fi.request(`gen_did`,async()=>{Je=await fe$4.get(`did`),Je||(Je=new $$2().toHexString(),await fe$4.set(`did`,Je)),Y$1.info(`Device ID:`,Je),aa(Je);}),Y$1.info(`Device ID set/get done ${Qr$3(Date.now()-r)}`);}async function ia(){if(Xi)return;let[r,e,t]=await Promise.all([ve$2.get(`id`,``),fe$4.get(`sessionNumber`,1),ve$2.get(`landing`,{})]);sa(r,e,t);}async function Fc(){await na(true);}async function na(r){let e=false;return await Vc()?(await Bc(),e=true):await Wc()?(await ia(),e=true):await ia(),e?await $c():r&&Vt(),e}async function Bc(){Y$1.info(`Starting new session`),await ve$2.clear();let r=new Date,e=new $$2().toHexString(),t=await fe$4.get(`sessionNumber`,0)+1,i=bi();await Promise.all([fe$4.set(`sessionNumber`,t),ve$2.set(`id`,e),ve$2.set(`lastUsedTime`,r.getTime()),ve$2.set(`landing`,i)]),sa(e,t,i);}async function Vc(){let r=await ve$2.get(`lastUsedTime`,0);return r?(new Date().getTime()-r)/1e3>1800:true}async function Wc(){return !await ve$2.get(`synced`,false)}async function Hc(){if(!$o&&!qo)throw new Error(oa);let r$11=await Zs(),e=Ci();return s(r(r({deviceID:Je,deviceProps:r$11,appID:$o,shopifyShop:qo},Xi),e),{sdk:Hr$3,ad:Ki.getAdParams(),occurred:Gc(Be$3().jsLoadTime),properties:{},uuid:await fe$4.get(`uuid`)})}async function $c(){Y$1.info(`Ensuring session on server`),await qc();let r=Date.now(),e=await Hc();Y$1.info(`Session data generated ${Qr$3(Date.now()-r)}`);let t=Bn$1(`/v1/event/validate-session`,D.globalRef.apiURLs?.baseURL);try{let i=await me(t,e);if(Y$1.info(`Auth finished ${Qr$3(i.timeTakenMs)}`),await ve$2.set(`synced`,!0),i.data.deviceID&&(await fe$4.set(`did`,Je),aa(i.data.deviceID)),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new G(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new G(n)));}catch(i){throw Y$1.error(i),i}}async function qc(){let r=await fe$4.get(`firstSeen`),e=r?new Date(r):new Date;r||await fe$4.set(`firstSeen`,e.toISOString()),Yn(e),no$1(`Visitor Info`,{first_seen:e.toISOString()});}function sa(r,e,t){oo$1({"cooee_session.number":e}),no$1(`Visitor Session`,{id:r,number:e,landing_page:t}),Y$1.info(`Session number: ${e}, id: ${r}`),Xi={sessionID:r,sessionNumber:e,landingPage:t};}function aa(r){Xn(r);no$1(`Visitor Info`,{device_id:r,[`device_id_${Math.floor(Math.random()*1e4)}`]:r}),ro({id:r});}function Gc(r){return (new Date().getTime()-r.getTime())/1e3>1800?new Date:r}var Yi=class{triggerData;render(e){e.contentSource===Be$2.KLAVIYO&&(this.triggerData=e,window.addEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push([`openForm`,e.klaviyoFormID]));}handleKlaviyoEvents(e){if(e.type!==`klaviyoForms`)return;let t=e.detail;if(t.formId!==this.triggerData.klaviyoFormID){Y$1.warn(`Received invalid trigger callback`);return}switch(t.type){case `open`:fe(new Ir$1(`CE Trigger Displayed`,{form:{id:t.formId}},this.triggerData));break;case `stepSubmit`:{let i=this.getFormDetails(t);fe(new Ir$1(`CE Form Submitted`,{form:i},this.triggerData)),Rt(i);break}case `close`:window.removeEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),fe(new Ir$1(`CE Trigger Closed`,{form:{id:t.formId}},this.triggerData));break}}getFormDetails(e){let t={id:e.formId},i=e.metaData;if(pe$4.hasKeys(i)){let o=[`email`,`phone_number`,`first_name`,`last_name`,`$email`,`$phone_number`,`$first_name`,`$last_name`];Object.keys(i).forEach(c=>{o.includes(c)||(t[c]=i[c]);}),t.email=i.$email??i.email,t.mobile=i.$phone_number??i.phone_number;let n=i.$first_name??i.first_name,s=i.$last_name??i.last_name;(n?.length||s?.length)&&(t.name=n+` `+s);}return t}};function ca(r){if(!jc()||!he$3.get().pixelPush)return;let t=Ye$2[r.intent]?.toLowerCase();t&&(Y$1.verbose(`Sending ${t} intent to Facebook Pixel`),window.fbq(`trackCustom`,`CooeeIntent`,{intent_value:t}));}function jc(){return window.fbq&&typeof window.fbq==`function`}var go=`/v1/event/track-page-unload`;function z(r){Y$1.verbose(`Waiting for auth to send event ${r.name}`),le$1(le).then(()=>fe(r));}function Ws(r){le$1(le).then(()=>{zc(r);});}async function zc(r){let e=Be$3().currentPageViewEvent;if(!e){Y$1.warn(`No page view event was stored previously`);return}let t={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:r};Y$1.verbose(`Sending page unload`,t);let i=Bn$1(go,D.globalRef.apiURLs?.eventURL);try{await me(i,t);}catch(o){throw Y$1.error(`Error sending page unload for ${e} to server`,o),o}}function fe(r){Kc(r);}async function Kc(r){if(Y$1.verbose(`Sending event: ${r.name}`,r),el(r)){Y$1.warn(`Rejecting event ${r.name}`);return}On();let e=await qe();Object.assign(r,e),Vs(),ve$2.set(`lastUsedTime`,new Date().getTime());let t=Zc(r.name),o=Bn$1(`/v1/event/track/${t.toLowerCase().replace(/\s+/g,`-`)}`,D.globalRef.apiURLs?.eventURL);try{let n=await me(o,r);Y$1.info(`Event tracked:`,t),Xc(r)&&(Be$3().currentPageViewEvent={id:r.id,name:r.name}),Yc(r,n.data);}catch(n){throw Y$1.error(`Error sending event ${r.name} to server`,n),n}}function Xc(r){return Kr$3.includes(r.name)?r.name===`View Cart`?!r.properties.drawer:true:false}function Yc(r,e){Jc(r,e).catch(t=>{ke$2(t,`process-popup-response`,{extra:{event:r,response:e}});}),Qc(e);}async function Jc(r,e){if(!e.triggerData)return;let t=new G(e.triggerData);t.occurred=r.occurred,Y$1.log(`${t} will be shown`);let i;try{i=await wi(t);}catch(n){Y$1.error(`Failed to refresh the products`,n);return}if(t.items=i,t.contentSource===Be$2.KLAVIYO){new Yi().render(t);return}new(await(import('./renderer-8BzVq4fY-CykIBgo7.js'))).FreeformRenderer().renderEngagement(t).catch(n=>{ke$2(n,`render-popup`,{extra:{event:r},engagementTrigger:t});});}function Qc(r){r.intent&&(ta(r.intent),ca(r),Y$1.info(`Intent is ${Ye$2[r.intent]}`));}function Zc(r){return r.replace(`CE `,``).replace(`Trigger`,`Campaign`).replace(`Screen`,`Page`).replace(`App `,``)}function el(r){return r.trigger?.triggerID===`test`||r.trigger?.triggerID===`preview`?(Y$1.warn(`Not sending event as this is a test trigger`),true):false}
63
+ .lc-display-inline {display: inline !important;}`,document.body);}execute(e){for(let t of e){if(!t.experimentConfig)continue;this.executeExperiment(t)&&this.trackExperimentRan(t);}if(document.querySelector(`#lc-hide-body`)?.remove(),!document.body){to(`No body element found`,`error`);return}this.setupMutationObserver();}executeExperiment(e){let t=e.experimentConfig?.modifications;if(!t?.length)return Y$1.log(`Nothing to experiment`,e.toString()),true;let i=false;for(let o of t){if(!o.cssSelector){Y$1.verbose(`No CSS Selector available`,e?.toString());continue}this.modifications.push(o);let n=Array.from(document.querySelectorAll(o.cssSelector));n?.length&&(this.executeSingleModification(o,n),i=true);}return i}executeSingleModification(e,t){if(t?.length)for(let i of t)Object.assign(i.style,e.style),e.display===`HIDE`?i.classList.add(`lc-hide`):e.display===`BLOCK`?i.classList.add(`lc-display-block`):e.display===`INLINE`&&i.classList.add(`lc-display-inline`),e.type===`TEXT`&&e.text?i.innerHTML=e.text:e.type===`IMAGE`&&this.updateImage(e,i),e.moveTo?.selector&&this.changePlacement(e,i).catch(console.error);}async changePlacement(e,t){let i=await On$1(e.moveTo.selector);if(i)switch(e.moveTo.position){case Ve$3.BEFORE1:t.nextElementSibling!==i&&i.parentElement?.insertBefore(t,i);break;case Ve$3.INSIDE_FIRST1:i.firstChild!==t&&i.insertBefore(t,i.firstChild);break;case Ve$3.INSIDE_LAST1:i.lastChild!==t&&i.appendChild(t);break;case Ve$3.AFTER1:default:t.previousElementSibling!==i&&i.parentElement?.insertBefore(t,i.nextSibling);}}trackExperimentRan(e){if(e.id===`preview`){Y$1.warn(`Skipping experiment attribution as its preview`,e.toString());return}As({name:`CE Experiment Start`,experiment:new mt$1(e)}).catch(t=>{Y$1.error(`Fail to track experiment`,t);});}setupMutationObserver(){new MutationObserver(t=>{t.forEach(i=>{i.addedNodes.forEach(o=>{o instanceof HTMLElement&&this.modifications.forEach(n=>{if(o.matches&&o.matches(n.cssSelector))Y$1.verbose(`1. Re-applying experiment`,n.toString()),this.executeSingleModification(n,[o]);else if(o.querySelectorAll){let s=Array.from(o.querySelectorAll(n.cssSelector));if(!s.length)return;Y$1.verbose(`2. Re-applying experiment`,n.toString()),this.executeSingleModification(n,s);}});});});}).observe(document.body,{childList:true,subtree:true});}updateImage(e,t){let i=e.image?.lg?.src,o=e.image?.sm?.src;!i&&!o||(t instanceof HTMLPictureElement?this.updatePictureElement({desktop:i,mobile:o},t):this.updateImageElement({desktop:i,mobile:o},t));}updateImageElement(e,t){M$1()&&e.mobile?(t.setAttribute(`src`,e.mobile),t.removeAttribute(`srcset`)):e.desktop&&(t.setAttribute(`src`,e.desktop),t.removeAttribute(`srcset`));}updatePictureElement(e,t){if(t.innerHTML=``,e.mobile){let o=document.createElement(`source`);o.srcset=e.mobile,o.media=`(max-width: 767px)`,t.append(o);}if(e.desktop){let o=document.createElement(`source`);o.srcset=e.desktop,o.media=`(min-width: 768px)`,t.append(o);}let i=document.createElement(`img`);i.src=e.desktop??e.mobile??``,t.append(i);}};async function As(r$9){let e=await qe();await me(`/v1/event/experiment`,r(r({},r$9),e));}function qi(){sc().catch(r=>ke$2(r,`fetch-experiments`));}async function sc(){Be$3().activeExperiments&&(await le$1(le),await ac());}async function ac(){Y$1.info(`Fetch experiments after ⏰`,tn()+` of SDK load`);me(`/v1/engagement/experiments`,r({},await qe())).then(async t=>{Y$1.info(`Experiments fetched ${Qr$3(t.timeTakenMs)}`);let i=t.data.experiments.map(o=>new G(o));new $i().execute(i);}).catch(t=>{Y$1.error(`Error sending experiment getter`,t);});}function ks(){let r=he$3.get();!r.gaMeasurementID||!r.gaEnabled||lc();}async function cc(){let r=await fe$4.get(`gacid`),e=await mc();if(r!==e)return await fe$4.set(`gacid`,e),e}async function lc(){let r=await cc();r&&Kn({gaClientID:r});}async function mc(){let e=he$3.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(t=>{window.gtag(`get`,e,`client_id`,i=>{t(i);});})}async function Os(r){Y$1.verbose(`Received app configuration`,r),r.currencyCount=r.currencies?.length;let e=D.globalRef.config.update(r);ks(),V.initialize(),e.website&&(Ui$1(e.website.commonJS),Ce$1(e.website.commonCSS)),window.CooeeSDK.cartDrawerToggle$.pipe(Fe(10)).subscribe(async({open:t})=>{Y$1.info(`Cart drawer is now`,t?`open`:`closed`),t&&(cs(),await pc());});}function Ls(r){D.globalRef.apiURLs=r;}async function pc(){let r=await S.getCurrent().getNormalisedCart(),e={value:r.amount,currency:r.currency};z(new Ir$1(`View Cart`,{items:r.items,amount:e,drawer:true}));}var Gi=class{runtimeData=Be$3();meddle(){let e=D.globalRef;e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods();}exposeMethods(){let e=D.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{Vt();},e.loadExperiments=()=>{qi();},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=D.previewWidget.bind(D),e.previewPopup=D.previewPopup.bind(D),e.executeCTA=(t,i)=>{new _e(t).execute(i);},e.sendEvent=t=>{z(t);};}overwritePush(e,t){Mn$1(e,`push`,t);}meddleEvents(){this.overwritePush(D.globalRef.events,(...e)=>{this.processEvent(e[0]);}),D.globalRef.events.forEach(this.processEvent.bind(this));}meddleProfile(){this.overwritePush(D.globalRef.profile,(...e)=>{this.processProfile(e[0]);}),D.globalRef.profile.forEach(this.processProfile.bind(this));}processEvent(e){e&&(qr$3.includes(e[0])?D.sendEvent(e[0],e[1],r({occurred:this.runtimeData.jsLoadTime},e[2])):D.sendEvent(e[0],e[1],e[2]));}processProfile(e){e&&D.updateProfile(e);}meddlePage(){this.overwritePush(D.globalRef.page,(...e)=>{this.processPage(e[0]);}),D.globalRef.page.forEach(this.processPage.bind(this));}processPage(e){e.appID&&D.authenticate(e),e.currentItem&&dc(e.currentItem),e.currency&&(Be$3().currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&D.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&S.getCurrent().update(e.cart),e.configurations&&Os(e.configurations),e.apiURLs&&Ls(e.apiURLs),e.customContext&&(this.runtimeData.customContext=r(r({},this.runtimeData.customContext),e.customContext));}async testCartUpdate(){if(Be$3().pageName!==`product`){window.alert(`This feature is only available on a product page`);return}let e=os();if(e||(e=Be$3().currentItem?.vID),!e){window.alert(`Could not find a variant to test. Please try a different product page`);return}let t=new G({id:`preview`,shortID:`1`,redirectBehaviour:Me$1.CART_DRAWER});await new _e(new Be(new Date,t)).execute({clickAction:{at:He$3.ADD_TO_CART},embeddedItem:new et({vID:e})});}};function dc(r){let e=Be$3();if(e.currentItem&&e.currentItem.vID!==r.vID){let t=new CustomEvent(`letscooee:variant-change`,{detail:{variantID:r.vID,productID:r.mID}});document.dispatchEvent(t);}e.currentItem=new et(r);}var Wt=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=`cooee`.concat(`-`);static getString(e,t){return this.getItem(e)||t}static setString(e,t){this.setItem(e,t);}static remove(e){this.removeItem(e);}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,t){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),t);}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e));}};var uc=1e3,gc=10,Mo=0,Fo=new Date;function Bo(r){Wt.remove(`sleid`),Fo=r??new Date;}function Ns(){if(window.scrollY){let r=Fs();Us(r)&&Ms(r);}vt$2(()=>{fc();});}function fc(){Tr(window,`scroll`).pipe(Fe(uc),q$1(()=>{let r=Fs();if(r>100){Y$1.warn(`Received scroll percent is more than 100`,r);return}if(Us(r))return r})).subscribe(r=>{Ms(r);});}function Us(r){return Math.abs(Mo-r)>=gc||Mo!==r&&r===100}function Ms(r){if(r==null)return;let e={percent:r,timeMS:new Date().getTime()-Fo.getTime()};Mo=r;let i=new Ir$1(`CE Scroll`,e,null,Wt.getString(`sleid`,``));z(i),Wt.setString(`sleid`,i.id.toHexString()),Fo=new Date(i.occurred);}function Fs(){let r=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/r*100)}function Bs(){document.onvisibilitychange=()=>{document.visibilityState===`visible`?hc():document.visibilityState===`hidden`&&wc();};}async function hc(){}async function wc(){let r=await vc();if(r===0){Y$1.info(`Not sending duration as user was inactive on website`);return}Ws(r);}async function vc(){let r=Be$3();return r.inInactive?0:(r.inInactive=true,r.lastEnterInactive=new Date,Math.max(r.lastEnterInactive.getTime()-r.lastEnterActive.getTime(),0))}function Vs(){let r=Be$3();return r.inInactive?(r.inInactive=false,r.lastEnterActive=new Date,Math.max((r.lastEnterActive.getTime()-r.lastEnterInactive.getTime())/1e3,0)):0}function Hs(){bc();}function bc(){let r=window.fetch;try{window.fetch=async function(e,t){try{await Cc(e,t);}catch(i){ke$2(i,`modify-graphql-request`,{extra:{body:JSON.stringify(t?.body)}});}return r(e,t)};}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Buy Now Clicked" KPI.`),Y$1.error(e);}Y$1.verbose(`Securely overwritten window.fetch method for graphql query`);}async function Cc(r,e){let t=typeof r==`string`?r:r instanceof Request?r.url:``;if(!(t.includes(`graphql.json`)&&e?.method===`POST`)||!e.body)return;let i;if(typeof e.body==`string`)try{i=JSON.parse(e.body);}catch{return}else i=e.body;i?.variables?.input&&(Y$1.verbose(`Intercepted fetch request of:`,t),i?.query.includes(`cartCreate`)&&(e.body=await yc(i),Ec()));}async function yc(r){let e=r.variables.input.attributes??[],t=await Pn$1(`Buy Now`);return r.variables.input.attributes=[...e,...t],JSON.stringify(r)}function Ec(){let r=Be$3().currentItem;if(!r)return;z(new Ir$1(`Buy Now Clicked`,{items:[r]}));}var Ht=class{constructor(e,t){this.selectors=e;this.eventName=t;this.selectorString=e.join(`,`);}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let t=e.currentTarget;z(new Ir$1(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0})),this.removeClickListener(this.clickListenerCallback);};listenSilently(){this.listen().catch(e=>Y$1.error(e));}async listen(){this.elements=await xr$1(this.selectorString),this.elements.forEach(e=>{e.addEventListener(`click`,this.clickListenerCallback);});}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener(`click`,e);});}};var ji=class r extends Ht{static selectors=[`.product__thumbnail-list-inner > button`,`product-gallery-navigation > button`,`.product-media--thumb-container`,`.product-images-inner > img`,`.m-product-media`,`.swiper-button-control`,`.media__thumb`,`.slick-arrow`,`.productView-img-container.product-single__media`,`.product-gallery__thumbnail_item_inner`];constructor(){super(r.selectors,`Item Thumbnail Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var zi=class r extends Ht{static selectors=[`.jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup`,`reviewsio-product-ratings`,`.ruk_rating_snippet.tracked:not(.hidden)`,`a > .loox-rating`,`.yotpo-reviews-star-ratings-widget`,`.yotpo.lp-hero__reviews`,`.pr-rating > a`,`.rivyoReviewWidget`];constructor(){super(r.selectors,`Review Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var Sc=[`.gokwik-checkout button`,`button.cart__checkout-button`,`button.cart__checkout`,`button#checkout`,`button#checkout2`,`button[id*="checkout" i]`,`button[name*="checkout" i]`,`button[class*="checkout" i]`].join(`,`);function $s(){vt$2(()=>{Y$1.verbose(`Execution order:`,`document ready`),Ic();});}function Ic(){let r=window.location.hash?.substring(1);if(r)if(r.includes(`initiate-checkout`)){document.dispatchEvent(new Event(`letscooee:outbound:third-party-initiate-checkout`));let e=document.querySelector(Sc);if(!e){Y$1.verbose(`No clickable cart checkout button found`);return}Y$1.verbose(`Clickable cart checkout button found`,e),e.click();}else r.includes(`open-cart-drawer`)&&V.get().open();}function Gs(){window.addEventListener(`kp-modal:opened`,()=>{Be$3().isGoKwikPopupOpen=true;}),window.addEventListener(`user-loggedin`,r=>{let{token:e}=r.detail;e&&Rt({goKwikToken:e});}),window.gokwikSdk?qs():window.addEventListener(`gokwikLoaded`,qs);}function qs(){window.gokwikSdk&&window.gokwikSdk.on(`checkout_initiated`,async()=>{let r=await S.getCurrent().getNormalisedCart();z(new Ir$1(`Checkout Started`,{via:`GoKwik`,items:r.items,cartToken:r.token,amount:{value:r.amount,currency:r.currency}}));});}var D=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(e){if(!window.cooeeSDKPreview){if(Y$1.info(`Initialising SDK`),ds(navigator.userAgent)){Y$1.info(`This seems to be a bot. Disabling SDK`);return}this.initGlobalReference(e),await zs(),this.autoAuthenticate(),new Gi().meddle(),Gn(),qi(),Tc(),Bs(),Vn(),Hs(),$s(),Ns(),zi.getInstance().listenSilently(),ji.getInstance().listenSilently(),Gs(),xc(),Hn$1(),ki.remove(`conf`).catch(t=>{Y$1.error(`Fail to remove App Config from local storage`,t);});}}static initGlobalReference(e){window.CooeeSDK||Mn$1(window,`CooeeSDK`,{}),this.globalRef=window.CooeeSDK,Mn$1(this.globalRef,`config`,new he$3),Mn$1(this.globalRef,`runtimeData`,{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),Mn$1(this.globalRef,`uaParser`,new we,true),Mn$1(this.globalRef,`cart`,S.getCurrent()),Mn$1(this.globalRef,`cartChange$`,Bn()),Mn$1(this.globalRef,`cartDrawerToggle$`,V.cartDrawerToggle$.asObservable()),Y$1.verbose(`Global reference initialised`),new le$3(()=>{this.globalRef.uaParser=new we;});}static autoAuthenticate(){let e=Xr();e&&this.authenticate({shopifyShop:e});}static authenticate(e){if(this.authenticated)return;Y$1.info(`Begin auth after ⏰`,tn(),`of SDK load`);let t=e.appID?.trim(),i=e.shopifyShop;if((Cn(t)||t.length!==24)&&Cn(i)){Y$1.warn(`Cooee App ID or Shop name is not configured`);return}this.authenticated=true,js(e);}static sendEvent(e,t,i){let o=new Ir$1(e,t,i?.triggerData);i?.occurred&&(o.occurred=i.occurred),z(o);}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith(`ce `))throw new Error(`User property name cannot start with 'CE '`);Rt(e);}static setPageName(e){if(!e)return;let t=Be$3(),i=t.pageName;if(e===i)return;if(t.pageName=e,jr$2.some(s=>e.includes(s))){Bo();return}let o={};i&&(o.ps=i);let n=new Ir$1(`CE Screen View`,o);n.occurred=t.jsLoadTime,z(n),Bo(n.occurred);}static previewPopup(e,t){import('./renderer-BBWv42Ys-Cowf_vnb.js').then(({FreeformRenderer:i})=>{new i(t).render(e);});}static previewWidget(e){new X(new G(e)).renderSilently();}};function Tc(){window.CooeeSDK.cartChange$.subscribe(()=>{Vt();});}function xc(){if(window.opener){try{window.opener.postMessage({action:`COOEE_READY_FOR_PREVIEW`},`*`);}catch(r){Y$1.error(r);}window.addEventListener(`message`,r=>{if(Y$1.verbose(`Received event`,r),!r.origin.includes(`letscooee.com`)&&!r.origin.includes(`localhost`))return;let e=r.data;typeof e==`object`&&(e.action===`POPUP_PREVIEW`?(D.previewPopup(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)):e.action===`WIDGET_PREVIEW`&&(D.previewWidget(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)));});}}var Xs=new U,Ks=0;Xs.pipe(Fe(50)).subscribe(async r=>{Dc(await qe()).catch(t=>{ke$2(t,`load-page-widgets`,{extra:{firstLoad:r}});});});function Vt(r=false){le$1(le).then(()=>{Xs.next(r);});}async function ns(r){let e=await qe();return Object.assign(r,e),me(`/v1/engagement/get-variant`,r)}async function Dc(r$10){Ks++,Ks===1?Y$1.info(`Fetch widgets (after ⏰`,tn()+` of SDK load)`):Y$1.info(`Fetch widgets`);let e=r({},r$10),t=Bn$1(`/v1/engagement/eligible`,D.globalRef.apiURLs?.engagementsURL);try{let i=await me(t,e);if(Y$1.info(`Widgets fetched ${Qr$3(i.timeTakenMs)}`),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new G(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new G(n)));}catch(i){Y$1.error(`Error sending widget getter`,i);}}var Ys=x$2(dr$2()),Ki=class r{static META_REQUIRED_FIELDS=[`ad_id`];static GOOGLE_REQUIRED_FIELDS=[`gad_source`,`gclid`];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source;}static getAdParams(){let e;try{e=new Ys.URLBuilder(location.href);}catch{return {}}let t={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return t={source:`META`,adID:e.getQueryParam(`ad_id`)?.trim(),campaignID:e.getQueryParam(`campaign_id`)?.trim()},new r(t);if(this.GOOGLE_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))return t={source:`GOOGLE`},new r(t)}};var Vo={d:(r,e)=>{for(var t in e)Vo.o(e,t)&&!Vo.o(r,t)&&Object.defineProperty(r,t,{enumerable:true,get:e[t]});},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},Wo={};Vo.d(Wo,{A:()=>Pc,k:()=>Ho});var Cr=function(r,e,t,i){return new(t||(t=Promise))(function(o,n){function s(C){try{m(i.next(C));}catch(w){n(w);}}function c(C){try{m(i.throw(C));}catch(w){n(w);}}function m(C){var w;C.done?o(C.value):(w=C.value,w instanceof t?w:new t(function(O){O(w);})).then(s,c);}m((i=i.apply(r,[])).next());})},yr=function(r,e){var t,i,o,n,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol==`function`&&(n[Symbol.iterator]=function(){return this}),n;function c(m){return function(C){return (function(w){if(t)throw new TypeError(`Generator is already executing.`);for(;n&&(n=0,w[0]&&(s=0)),s;)try{if(t=1,i&&(o=2&w[0]?i.return:w[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,w[1])).done)return o;switch(i=0,o&&(w=[2&w[0],o.value]),w[0]){case 0:case 1:o=w;break;case 4:return s.label++,{value:w[1],done:!1};case 5:s.label++,i=w[1],w=[0];continue;case 7:w=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||w[0]!==6&&w[0]!==2)){s=0;continue}if(w[0]===3&&(!o||w[1]>o[0]&&w[1]<o[3])){s.label=w[1];break}if(w[0]===6&&s.label<o[1]){s.label=o[1],o=w;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(w);break}o[2]&&s.ops.pop(),s.trys.pop();continue}w=e.call(r,s);}catch(O){w=[6,O],i=0;}finally{t=o=0;}if(5&w[0])throw w[1];return {value:w[0]?w[1]:void 0,done:true}})([m,C])}}};function Ho(){return Cr(this,void 0,Promise,function(){return yr(this,function(r){switch(r.label){case 0:return [4,new Promise(function(e,t){var i=`Unknown`,o=false;function n(y){o||(o=true,e({isPrivate:y,browserName:i}));}function s(){var y=0,P=parseInt(`-1`);try{P.toFixed(P);}catch(x){y=x.message.length;}return y}function c(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return false}})(39)}function m(){var y;return Cr(this,void 0,void 0,function(){var P,x;return yr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),n(false),[3,3];case 2:return P=v.sent(),x=P,P instanceof Error&&(x=(y=P.message)!==null&&y!==void 0?y:P),typeof x!=`string`?(n(false),[2]):(n(!!x.includes(`unknown transient reason`)),[3,3]);case 3:return [2]}})})}function C(){var y;return Cr(this,void 0,Promise,function(){return yr(this,function(P){switch(P.label){case 0:return ((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,m()];case 1:return P.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var x=String(Math.random());try{var v=indexedDB.open(x,1);v.onupgradeneeded=function(L){var k=L.target.result,b=function(Qe){n(Qe);};try{k.createObjectStore(`t`,{autoIncrement:!0}).put(new Blob),b(!1);}catch(Qe){(Qe.message||``).includes(`are not yet supported`)?b(!0):b(!1);}finally{k.close(),indexedDB.deleteDatabase(x);}},v.onerror=function(){return n(!1)};}catch{n(false);}})():(function(){var x=window.openDatabase,v=window.localStorage;try{x(null,null,null,null);}catch{n(true);return}try{v.setItem(`test`,`1`),v.removeItem(`test`);}catch{n(true);return}n(false);})(),P.label=3;case 3:return [2]}})})}function w(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,P){var x;n(Math.round(P/1048576)<2*Math.round(((x=window).performance!==void 0&&x.performance.memory!==void 0&&x.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576));},function(y){t(new Error(`detectIncognito somehow failed to query storage quota: `+y.message));});}function O(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?w():(0, window.webkitRequestFileSystem)(0,1,function(){n(false);},function(){n(true);});}function M(){return Cr(this,void 0,Promise,function(){var y,P;return yr(this,function(x){switch(x.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return [3,4];x.label=1;case 1:return x.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return x.sent(),n(false),[3,4];case 3:return y=x.sent(),typeof(P=y instanceof Error&&typeof y.message==`string`?y.message:String(y))!=`string`?(n(false),[2]):(n(P.includes(`Security error`)),[2]);case 4:return n(navigator.serviceWorker===void 0),[2]}})})}(function(){return Cr(this,void 0,Promise,function(){return yr(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(i=`Safari`,[4,C()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(P=navigator.userAgent,i=P.match(/Chrome/)?navigator.brave!==void 0?`Brave`:P.match(/Edg/)?`Edge`:P.match(/OPR/)?`Opera`:`Chrome`:`Chromium`,O(),[3,6]);case 3:return s()!==25?[3,5]:(i=`Firefox`,[4,M()]);case 4:return y.sent(),[3,6];case 5:c()?(i=`Internet Explorer`,n(window.indexedDB===void 0)):t(new Error(`detectIncognito cannot determine the browser`)),y.label=6;case 6:return [2]}var P;})})})().catch(t);})];case 1:return [2,r.sent()]}})})}typeof window<`u`&&(window.detectIncognito=Ho);var Pc=Ho,Js=Wo.A;Wo.k;var Qs=x$2(Et$3()),Zs=async()=>{let r={};try{return await Rc(r)}catch(e){return ke$2(e,`device-properties`),r}},Rc=async r=>{let e=window.CooeeSDK.uaParser;_c(r),Ac(r),kc(r),r.referrer=document.referrer,r.host=location.origin,r.path=location.pathname,r.qs=location.search,r.locale=navigator.language,r.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:Oc()},r.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(r.headless=true,oo$1({headless:true}));let t=e.getResult();return r.browser=t.browser,r.device=t.device,r.engine=t.engine,r.cpu=t.cpu,r.os=t.os,r.navigatorUA=navigator.userAgent,await Promise.all([Uc(r),Lc(r),Mc(r)]),r},_c=r=>{let e=navigator;if(!e.deviceMemory)return;r.mem={tot:e.deviceMemory*1024};},Ac=r=>{let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(r.net={type:t.effectiveType});},kc=r=>{let e=screen.orientation?.type;e&&(r.orientation=e);},Oc=()=>{if(!document.body)return;let r=document.createElement(`div`);r.setAttribute(`style`,`height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;`),document.body.appendChild(r);let e=window.devicePixelRatio||1,t=r.offsetWidth*e;return document.body.removeChild(r),t},Lc=async r=>{try{await Nc(r);}catch(e){Y$1.error(`Unable to get location`,e);}},Nc=async r=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:`geolocation`})).state!=`granted`))return new Promise(t=>{navigator.geolocation.getCurrentPosition(i=>{r.coords=[i.coords.latitude,i.coords.longitude],t();},()=>t());})},Uc=async r=>{if(`getBattery`in navigator)try{let t=await navigator.getBattery();r.bat={l:t.level*100,c:t.charging},oo$1({"battery.level":r.bat.l,"battery.charging":r.bat.c});}catch{}},Mc=async r=>{try{(await Js())?.isPrivate&&(r.incognito=!0,oo$1({incognito:!0}));}catch(e){Qs.default.error(`Unable to detect private/incognito window`,e);}};function ta(r){if(!ra())return;let e=Ye$2[r]?.toLowerCase();e&&(Y$1.verbose(`Sending ${e} intent to MS Clarity`),window.clarity(`set`,`Cooee Intent`,e));}function ra(){return window.clarity&&typeof window.clarity==`function`}var le=new gr$1(1),oa=`App ID or Shopify shop is not set`,$o=``,Je=``,qo=``,Xi;async function js(r){$o=r.appID,qo=r.shopifyShop;try{await Fc(),le.next(!0),le.complete();}catch(e){e?.message?.includes(oa)&&ke$2(e,`initiate-session`,{extra:r}),Y$1.error(`Unable to initiate session`,e);}}async function jn(){return await na(false),Xi}async function zs(){let r=Date.now();await fi.request(`gen_did`,async()=>{Je=await fe$4.get(`did`),Je||(Je=new $$2().toHexString(),await fe$4.set(`did`,Je)),Y$1.info(`Device ID:`,Je),aa(Je);}),Y$1.info(`Device ID set/get done ${Qr$3(Date.now()-r)}`);}async function ia(){if(Xi)return;let[r,e,t]=await Promise.all([ve$2.get(`id`,``),fe$4.get(`sessionNumber`,1),ve$2.get(`landing`,{})]);sa(r,e,t);}async function Fc(){await na(true);}async function na(r){let e=false;return await Vc()?(await Bc(),e=true):await Wc()?(await ia(),e=true):await ia(),e?await $c():r&&Vt(),e}async function Bc(){Y$1.info(`Starting new session`),await ve$2.clear();let r=new Date,e=new $$2().toHexString(),t=await fe$4.get(`sessionNumber`,0)+1,i=bi();await Promise.all([fe$4.set(`sessionNumber`,t),ve$2.set(`id`,e),ve$2.set(`lastUsedTime`,r.getTime()),ve$2.set(`landing`,i)]),sa(e,t,i);}async function Vc(){let r=await ve$2.get(`lastUsedTime`,0);return r?(new Date().getTime()-r)/1e3>1800:true}async function Wc(){return !await ve$2.get(`synced`,false)}async function Hc(){if(!$o&&!qo)throw new Error(oa);let r$11=await Zs(),e=Ci();return s(r(r({deviceID:Je,deviceProps:r$11,appID:$o,shopifyShop:qo},Xi),e),{sdk:Hr$3,ad:Ki.getAdParams(),occurred:Gc(Be$3().jsLoadTime),properties:{},uuid:await fe$4.get(`uuid`)})}async function $c(){Y$1.info(`Ensuring session on server`),await qc();let r=Date.now(),e=await Hc();Y$1.info(`Session data generated ${Qr$3(Date.now()-r)}`);let t=Bn$1(`/v1/event/validate-session`,D.globalRef.apiURLs?.baseURL??`https://cdn.sdk-api1.letscooee.com`);try{let i=await me(t,e);if(Y$1.info(`Auth finished ${Qr$3(i.timeTakenMs)}`),await ve$2.set(`synced`,!0),i.data.deviceID&&(await fe$4.set(`did`,Je),aa(i.data.deviceID)),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new G(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new G(n)));}catch(i){throw Y$1.error(i),i}}async function qc(){let r=await fe$4.get(`firstSeen`),e=r?new Date(r):new Date;r||await fe$4.set(`firstSeen`,e.toISOString()),Yn(e),no$1(`Visitor Info`,{first_seen:e.toISOString()});}function sa(r,e,t){oo$1({"cooee_session.number":e}),no$1(`Visitor Session`,{id:r,number:e,landing_page:t}),Y$1.info(`Session number: ${e}, id: ${r}`),Xi={sessionID:r,sessionNumber:e,landingPage:t};}function aa(r){Xn(r);no$1(`Visitor Info`,{device_id:r,[`device_id_${Math.floor(Math.random()*1e4)}`]:r}),ro({id:r});}function Gc(r){return (new Date().getTime()-r.getTime())/1e3>1800?new Date:r}var Yi=class{triggerData;render(e){e.contentSource===Be$2.KLAVIYO&&(this.triggerData=e,window.addEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push([`openForm`,e.klaviyoFormID]));}handleKlaviyoEvents(e){if(e.type!==`klaviyoForms`)return;let t=e.detail;if(t.formId!==this.triggerData.klaviyoFormID){Y$1.warn(`Received invalid trigger callback`);return}switch(t.type){case `open`:fe(new Ir$1(`CE Trigger Displayed`,{form:{id:t.formId}},this.triggerData));break;case `stepSubmit`:{let i=this.getFormDetails(t);fe(new Ir$1(`CE Form Submitted`,{form:i},this.triggerData)),Rt(i);break}case `close`:window.removeEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),fe(new Ir$1(`CE Trigger Closed`,{form:{id:t.formId}},this.triggerData));break}}getFormDetails(e){let t={id:e.formId},i=e.metaData;if(pe$4.hasKeys(i)){let o=[`email`,`phone_number`,`first_name`,`last_name`,`$email`,`$phone_number`,`$first_name`,`$last_name`];Object.keys(i).forEach(c=>{o.includes(c)||(t[c]=i[c]);}),t.email=i.$email??i.email,t.mobile=i.$phone_number??i.phone_number;let n=i.$first_name??i.first_name,s=i.$last_name??i.last_name;(n?.length||s?.length)&&(t.name=n+` `+s);}return t}};function ca(r){if(!jc()||!he$3.get().pixelPush)return;let t=Ye$2[r.intent]?.toLowerCase();t&&(Y$1.verbose(`Sending ${t} intent to Facebook Pixel`),window.fbq(`trackCustom`,`CooeeIntent`,{intent_value:t}));}function jc(){return window.fbq&&typeof window.fbq==`function`}var go=`/v1/event/track-page-unload`;function z(r){Y$1.verbose(`Waiting for auth to send event ${r.name}`),le$1(le).then(()=>fe(r));}function Ws(r){le$1(le).then(()=>{zc(r);});}async function zc(r){let e=Be$3().currentPageViewEvent;if(!e){Y$1.warn(`No page view event was stored previously`);return}let t={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:r};Y$1.verbose(`Sending page unload`,t);let i=Bn$1(go,D.globalRef.apiURLs?.eventURL);try{await me(i,t);}catch(o){throw Y$1.error(`Error sending page unload for ${e} to server`,o),o}}function fe(r){Kc(r);}async function Kc(r){if(Y$1.verbose(`Sending event: ${r.name}`,r),el(r)){Y$1.warn(`Rejecting event ${r.name}`);return}On();let e=await qe();Object.assign(r,e),Vs(),ve$2.set(`lastUsedTime`,new Date().getTime());let t=Zc(r.name),o=Bn$1(`/v1/event/track/${t.toLowerCase().replace(/\s+/g,`-`)}`,D.globalRef.apiURLs?.eventURL);try{let n=await me(o,r);Y$1.info(`Event tracked:`,t),Xc(r)&&(Be$3().currentPageViewEvent={id:r.id,name:r.name}),Yc(r,n.data);}catch(n){throw Y$1.error(`Error sending event ${r.name} to server`,n),n}}function Xc(r){return Kr$3.includes(r.name)?r.name===`View Cart`?!r.properties.drawer:true:false}function Yc(r,e){Jc(r,e).catch(t=>{ke$2(t,`process-popup-response`,{extra:{event:r,response:e}});}),Qc(e);}async function Jc(r,e){if(!e.triggerData)return;let t=new G(e.triggerData);t.occurred=r.occurred,Y$1.log(`${t} will be shown`);let i;try{i=await wi(t);}catch(n){Y$1.error(`Failed to refresh the products`,n);return}if(t.items=i,t.contentSource===Be$2.KLAVIYO){new Yi().render(t);return}new(await(import('./renderer-BBWv42Ys-Cowf_vnb.js'))).FreeformRenderer().renderEngagement(t).catch(n=>{ke$2(n,`render-popup`,{extra:{event:r},engagementTrigger:t});});}function Qc(r){r.intent&&(ta(r.intent),ca(r),Y$1.info(`Intent is ${Ye$2[r.intent]}`));}function Zc(r){return r.replace(`CE `,``).replace(`Trigger`,`Campaign`).replace(`Screen`,`Page`).replace(`App `,``)}function el(r){return r.trigger?.triggerID===`test`||r.trigger?.triggerID===`preview`?(Y$1.warn(`Not sending event as this is a test trigger`),true):false}
64
64
 
65
65
  function a(i){return i?new Date(i).toLocaleString(`en-US`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3,hour12:false,timeZoneName:`short`}):`N/A`}function M(){let i=performance.getEntriesByType?.(`resource`);if(i)return i.find(o=>o.name.includes(`@letscooee/web-sdk`)&&o.name.includes(`main.min.js`))}function x(i){window.cooeeSDKPreview||(document.readyState===`complete`?setTimeout(()=>L(i),100):window.addEventListener(`load`,()=>{setTimeout(()=>L(i),100);}));}function L(i){try{N(i),z$4();}catch(o){console.error(`Failed to print debugging logs`,o);}}function N(i){let o=performance.getEntriesByType?.(`navigation`)?.[0],f=window.CooeeSDK?.pageLoadTime,l=M(),s=performance.timeOrigin||0,n=o?.responseEnd?s+o.responseEnd:void 0,d=s,c=o?.domContentLoadedEventEnd||0,m=o?.loadEventEnd||0,u=n&&n>0?n:f?f.getTime():0,T=n&&n>0?`HTML download complete`:`inline script execution`,S=c>0?d+c:void 0,$=m>0?d+m:void 0;Y$1.info(`⏱️ ═══════════════ Performance Timing Report ═══════════════`),Y$1.info(`📅 Absolute Timestamps (Local Time):`),Y$1.info(` Note: Inline script can execute during HTML download (incremental parsing)`),Y$1.info(``),Y$1.info(` 1. Navigation started: ${a(d)}`);let r=f?f.getTime():0;if(n&&n>0&&r?r<n?(Y$1.info(` 2. Inline script executed: ${a(r)} (during HTML parsing)`),Y$1.info(` 3. HTML download complete: ${a(n)}`)):(Y$1.info(` 2. HTML download complete: ${a(n)}`),Y$1.info(` 3. Inline script executed: ${a(r)}`)):n&&n>0?Y$1.info(` 2. HTML download complete: ${a(n)}`):r&&Y$1.info(` 2. Inline script executed: ${a(r)}`),Y$1.info(` 4. SDK module loaded: ${a(i.getTime())} (from CDN)`),S&&Y$1.info(` 5. DOMContentLoaded: ${a(S)}`),$&&Y$1.info(` 6. Page fully loaded: ${a($)}`),Y$1.info(``),Y$1.info(`⏱️ Relative Timings:`),n&&n>0&&d){let g=n-d;Y$1.info(` Shopify backend + HTML download: ${Ve$4(g)} (not Cooee SDK)`);}if(u){let g=i.getTime()-u;if(g<0){let w=r>0?r:d,b=r>0?`inline script execution`:`navigation start`,K=i.getTime()-w;Y$1.info(` SDK module load time: ${Ve$4(K)} after ${b}`),Y$1.info(` (Note: Using earlier baseline because SDK loaded before ${T})`);}else Y$1.info(` SDK module load time: ${Ve$4(g)} after ${T}`),Y$1.info(` (Baseline: ${T} at ${a(u)})`);let v=i.getTime()-d;Y$1.info(` \u{1F3AF} Total SDK load time: ${Ve$4(v)} (from navigation start to SDK ready)`);}c&&c>0&&Y$1.info(` DOMContentLoaded: ${Ve$4(c)} after navigation start`),m&&m>0&&Y$1.info(` Page fully loaded: ${Ve$4(m)} after navigation start`),C(l),Y$1.info(`⏱️ ═══════════════════════════════════════════════════════`);}function C(i){if(!i){Y$1.info(``),Y$1.info(`📦 SDK Resource Metrics: Not available`);return}Y$1.info(``),Y$1.info(`📦 SDK Resource Metrics:`),Y$1.info(` URL: ${i.name}`),Y$1.info(` Download duration: ${Ve$4(i.duration)}`);let o=i.transferSize===0;if(Y$1.info(` Served from: ${o?`💾 Cache (disk/memory)`:`🌐 Network`}`),!o){Y$1.info(` Transfer size: ${d$3(i.transferSize)}`),Y$1.info(` Encoded size: ${d$3(i.encodedBodySize)}`),Y$1.info(` Decoded size: ${d$3(i.decodedBodySize)}`);let f=(1-i.encodedBodySize/i.decodedBodySize)*100;f>0&&Y$1.info(` Compression ratio: ${f.toFixed(1)}%`);}if(i.domainLookupEnd>0){let f=i.domainLookupEnd-i.domainLookupStart,l=i.connectEnd-i.connectStart,s=i.responseStart-i.requestStart,n=i.responseEnd-i.responseStart;Y$1.info(` Timing breakdown:`),f>0&&Y$1.info(` DNS lookup: ${Ve$4(f)}`),l>0&&Y$1.info(` TCP connect: ${Ve$4(l)}`),s>0&&Y$1.info(` Request: ${Ve$4(s)}`),n>0&&Y$1.info(` Response: ${Ve$4(n)}`);}}
66
66
 
67
- var sdkDebugLogsTfVO9AIV = /*#__PURE__*/Object.freeze({
67
+ var sdkDebugLogsDEcPNvfG = /*#__PURE__*/Object.freeze({
68
68
  __proto__: null,
69
69
  printAllDebugLogs: x
70
70
  });
71
71
 
72
- performance.mark(`cooee-sdk-start`);var n=new Date;window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=true,$n$1(),Gn$1(),await D.initForMerchantWebsiteOnly(n),be$2(),performance.measure(`cooee-sdk-init`,`cooee-sdk-start`),Lr$1()&&Promise.resolve().then(function () { return sdkDebugLogsTfVO9AIV; }).then(({printAllDebugLogs:a})=>a(n)));
72
+ performance.mark(`cooee-sdk-start`);var n=new Date;window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=true,$n$1(),Gn$1(),await D.initForMerchantWebsiteOnly(n),be$2(),performance.measure(`cooee-sdk-init`,`cooee-sdk-start`),Lr$1()&&Promise.resolve().then(function () { return sdkDebugLogsDEcPNvfG; }).then(({printAllDebugLogs:a})=>a(n)));
73
73
 
74
74
  export { $r as $, A$1 as A, Be as B, Sr as C, m as D, vs$1 as E, Fr as F, G, He$1 as H, Ir$1 as I, ve as J, pi$1 as K, bi$1 as L, M$1 as M, Nn$1 as N, ii$1 as O, Fs$1 as P, Ps$1 as Q, Se$1 as R, S$1 as S, ye$1 as T, U, Ve$1 as V, Ce$1 as W, Me$1 as X, De as Y, Vi$1 as Z, _e$1 as _, Mi$1 as a, $e$1 as a0, gr$1 as a1, He$2 as a2, qe$1 as a3, Re$1 as a4, Fe$1 as a5, We$1 as a6, Je$1 as a7, Ae$2 as a8, ge$2 as a9, V$1 as b, H$1 as c, d$2 as d, V as e, fe as f, yt as g, Gr as h, it as i, qt as j, Vr as k, le$3 as l, mt$1 as m, n$1 as n, Hr as o, nt$1 as p, qr as q, Ve as r, f$1 as s, He$3 as t, ue$2 as u, vi as v, yi as w, v as x, ye$3 as y, q$1 as z };
@@ -1,4 +1,4 @@
1
- import { k as ke, a as Be$1, z as zr, Y, r, s, R as Rn, L as Ln } from './chunk-cN7DAvpe-BbA9dPrS.js';
1
+ import { k as ke, a as Be$1, z as zr, Y, r, s, R as Rn, L as Ln } from './chunk-D-gRvo7T-D_Vnuz3Z.js';
2
2
  import { G, c as H$1, B as Be, M, e as V, m as mt, f as fe, I as Ir, $ as $r, q as qr, g as yt, h as Gr, i as it, j as qt, k as Vr, o as Hr, A as A$1, S as S$1, p as nt, r as Ve, v as vi, s as f$1, F as Fr, t as He, w as yi } from './main.min.js';
3
3
 
4
4
  var L=class{loadedFonts=[];async loadAllFonts(e){e.elems?.forEach(t=>{t instanceof Ve&&this.loadFamily(t.typography?.fam);});}async loadFamily(e){if(!e?.fonts||this.loadedFonts.indexOf(e.name)>-1)return;let t=[];e.fonts.forEach(n=>{if(n.url){let l=new FontFace(`cooee`+e.name,n.getURL(),n.getFontDescriptor());t.push(l.load());}}),this.loadedFonts.push(e.name),(await Promise.all(t)).forEach(n=>{document.fonts.add(n);});}};var S=class{static updateIdentity(e){if(!this.isInstalled())return;let t={};e.email&&(t.email=e.email),e.mobile&&(t.phone_number=e.mobile),Y.verbose(`Sending email/mobile to Klaviyo`),window.klaviyo.push([`identify`,t]);}static isInstalled(){return window.klaviyo&&typeof window.klaviyo==`object`}};var H=class{action;triggerContext;constructor(e,t){this.action=e,this.triggerContext=t;}async execute(){let e=this.containsCTA()?`CE Trigger Clicked`:`CE Trigger Closed`;switch(this.action.at!==He.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(e),this.action.at){case He.ACCEPT_POPUP:break;case He.GO_TO_URL:this.gotoURLAction();break;case He.SHARE:this.shareAction();break;case He.SUBMIT_FORM:await this.collectFormData();break;case void 0:case He.OPEN_CART:break;default:Y.error(`Received an invalid ClickActionType: `,this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,`_blank`)?.focus();}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;Rn(e)||(e=`//${e}`),window.open(e,`_self`);}}async closeTriggerAndSendEvent(e,t){this.triggerContext.closeInApp(e,t),await this.dispatchEvent();}shareAction(){if(!this.action.share)return;if(!navigator.share){Y.warn(`Navigator.share is not compatible with this browser`);return}navigator.share({text:this.action.share.text,title:`Share`}).then(t=>console.log(t)).catch(t=>console.error(t));}containsCTA(){return this.action.at&&this.action.at!==He.REJECT_POPUP?true:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:true}async collectFormData(){let e={};for(let t of this.triggerContext.inputs){if(!t.isValid)return;let n=document.getElementById(t.id).value;t.type===51?e.email=n:t.type===52&&(e.mobile=n);}await this.closeTriggerAndSendEvent(`CE Form Submitted`,{form:e}),this.action.applyDiscount&&Ln(`Coupon applied on cart`),S.updateIdentity(e);}async dispatchEvent(){let e=this.triggerContext.triggerData,t={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new yi().process(t);let r={action:this.containsCTA()?`CLICKED`:`CLOSED`};document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:r}));}};var a=class{renderer=I.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,t,r){this.parentHTMLEl=e,this.inappElement=t,this.triggerContext=r,this.stylesConverter=new vi(this.renderer.getScalingFactor());}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl);}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=s(r(r(r(r({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:`border-box`,outline:`none`});S$1(this.inappHTMLEl,e);}getDisplayStyles(){return {display:`block`}}processWidthAndHeight(){this.inappElement.w&&H$1(this.inappHTMLEl,`width`,this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&H$1(this.inappHTMLEl,`height`,this.stylesConverter.getSizePx(this.inappElement.h));}processPositionBlock(){let e={position:`absolute`,left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};S$1(this.inappHTMLEl,e);}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let t=(e/100).toFixed(2);H$1(this.inappHTMLEl,`opacity`,t);}}processShadow(){let e=this.inappElement.shd;e?H$1(this.inappHTMLEl,`box-shadow`,e.getStyle(this.scalingFactor)):H$1(this.inappHTMLEl,`box-shadow`,`unset`);}processTransformBlock(){let e=new f$1(this.inappElement.trf);e&&e.rotate&&H$1(this.inappHTMLEl,`transform`,`rotate(${e.rotate}deg)`);}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener(`click`,t=>{t.stopPropagation(),new H(e,this.triggerContext).execute();}),H$1(this.inappHTMLEl,`cursor`,`pointer`));}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}};var p=class extends a{constructor(e,t,r){super(e,t,r);}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment();}processFontBlock(){let e={},t=this.inappElement.typography;return t&&(e.fontSize=this.stylesConverter.getSizePx(t.fs),e.fontFamily=`cooee`+t.fam?.name,e.lineHeight=`${t.lh}`,e.letterSpacing=t.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,`color`,e),S$1(this.inappHTMLEl,e),e}processPart(e,t){let r=[];t.u&&r.push(`underline`),t.st&&r.push(`line-through`),r.length||r.push(`normal`),H$1(e,`font-weight`,t.b?`bold`:`normal`),H$1(e,`font-style`,t.i?`italic`:`normal`),H$1(e,`text-decoration`,r.join(` `)),H$1(e,`color`,t.c??`inherit`),H$1(e,`font-family`,`inherit`);}processAlignment(){let e=this.inappElement.typography.ta,t=e?Fr[e]?.toLowerCase():this.inappElement.typography.alignment;t||(t=`start`),H$1(this.inappHTMLEl,`text-align`,t);}};var u=class extends p{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.inappElement.parts?.forEach(e=>{let t=document.createElement(`span`);t.innerHTML=e.txt?.toString()?.replace(/\n/g,`<br />`),this.processPart(t,e),this.inappHTMLEl.appendChild(t);}),this.processCommonBlocks();}};var f=class extends a{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.processCommonBlocks();}};var E=class extends a{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`img`),this.insertElement();}render(){this.inappHTMLEl.setAttribute(`src`,this.inappElement.src),H$1(this.inappHTMLEl,`max-width`,`none`),H$1(this.inappHTMLEl,`max-height`,`none`),H$1(this.inappHTMLEl,`margin`,`0 auto`),this.processCommonBlocks();}};var v=class o extends a{constructor(t,r,n){super(t,r,n);this.parent=t;this.inappHTMLEl=document.createElement(`div`);}static MAX_Z_INDEX=`2147483647`;render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(`cooee-wrapper`),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),H$1(this.inappHTMLEl,`z-index`,o.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let t=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(H$1(this.inappHTMLEl,`width`,`100%`),H$1(this.inappHTMLEl,`height`,`100%`)):(H$1(this.inappHTMLEl,`width`,`100vw`),H$1(this.inappHTMLEl,`height`,`100vh`)),H$1(this.inappHTMLEl,`top`,`0`),H$1(this.inappHTMLEl,`left`,`0`);else {let r=this.inappElement.spc,n=this.stylesConverter.getScaledSize(t.w)+r.getHorizontal(),l=this.stylesConverter.getScaledSize(t.h)+r.getVertical();H$1(this.inappHTMLEl,`width`,n+`px`),H$1(this.inappHTMLEl,`height`,l+`px`);}}getSpaceStyles(){return {padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return r(r({display:`flex`},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?H$1(this.inappHTMLEl,`position`,`absolute`):H$1(this.inappHTMLEl,`position`,`fixed`);}getBorderStyles(){return {}}processTransparency(){}processTransformBlock(){}processShadow(){}};var se=`cooee-container`,w=class extends a{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){return this.processCommonBlocks(),H$1(this.inappHTMLEl,`position`,`relative`),H$1(this.inappHTMLEl,`overflow`,`hidden`),this.inappHTMLEl.classList.add(se),this}};var A=class o extends p{static DAYS=`Days`;static HOURS=`Hours`;static MINUTES=`Minutes`;static SECONDS=`Seconds`;elements;spans=[];constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=s(r(r(r({flex:`1 1 0`},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e);}getBackgroundStyles(){return {}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,`color`,e),this.addStylesToTimer(e),e}getSpaceStyles(){return {}}getBorderStyles(){return {}}getDisplayStyles(){return {display:`flex`,flexWrap:`nowrap`,justifyContent:`center`}}addStylesToTimer(e){this.elements.forEach(t=>S$1(t,e));}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(o.DAYS)),e.hour&&this.elements.push(this.getChild(o.HOURS)),e.minute&&this.elements.push(this.getChild(o.MINUTES)),e.second&&this.elements.push(this.getChild(o.SECONDS)),this.elements.forEach(t=>this.inappHTMLEl.appendChild(t));}getChild(e){let t=document.createElement(`div`),r=document.createElement(`span`),n=document.createElement(`span`);return n.innerText=e,r.innerText=`00`,r.id=`lc-${e}`,H$1(n,`font-size`,`0.5em`),H$1(n,`text-align`,`center`),H$1(n,`font-family`,`inherit`),H$1(r,`text-align`,`center`),H$1(r,`font-family`,`inherit`),this.inappElement.lblPos===`start`?(t.appendChild(n),t.appendChild(r)):(t.appendChild(r),t.appendChild(n)),H$1(t,`display`,`flex`),H$1(t,`flex-direction`,this.inappElement.horizontal?``:`column`),H$1(t,`justify-content`,`center`),H$1(t,`align-items`,`center`),H$1(t,`gap`,`5px`),this.spans.push(r),t}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,t=>{this.spans.forEach(r=>{r.id===`lc-${o.DAYS}`?r.innerText=String(t.days).padStart(2,`0`):r.id===`lc-${o.HOURS}`?r.innerText=String(t.hours).padStart(2,`0`):r.id===`lc-${o.MINUTES}`?r.innerText=String(t.minutes).padStart(2,`0`):r.id===`lc-${o.SECONDS}`&&(r.innerText=String(t.seconds).padStart(2,`0`));});});this.triggerContext.intervals.push(e);}};var b=class extends p{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`select`),this.insertElement();}render(){H$1(this.inappHTMLEl,`background`,`#ffffff00`),H$1(this.inappHTMLEl,`outline`,`none`),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions();}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener(`click`,t=>{t.stopPropagation();}),e.addEventListener(`change`,()=>{let t=new nt(JSON.parse(e.value));this.updateItems(t);});}updateItems(e){let t=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[t.toEmbed(e)];let r=this.parentHTMLEl.querySelector(`#coo-13`);if(!r)return;let n=e.imgs[0]??t.imgs?.at(0);n?.url&&r.setAttribute(`src`,n.url);}addOptions(){let e=this.triggerContext.triggerData.items,t=this.inappHTMLEl;if(!e?.length){t.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(n=>{t.add(this.createOption(n.name??`Default`,n,n.mID===r?.vID));});}createOption(e,t,r){let n=document.createElement(`option`);return n.text=e,n.value=JSON.stringify(t),r&&(n.selected=true),t||(n.disabled=true),n}};var T=class extends p{borderColor=``;constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`input`),this.insertElement();}render(){let e=this.setInputType();this.inappHTMLEl.setAttribute(`placeholder`,this.inappElement.placeholderText),H$1(this.inappHTMLEl,`background`,`#ffffff00`),H$1(this.inappHTMLEl,`outline`,`none`),this.inappHTMLEl.addEventListener(`click`,t=>{t.stopPropagation();}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t);}};var R=class o extends T{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,t,r){super(e,t,r);}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`email`),this.inappHTMLEl.setAttribute(`id`,e),e}addListener(e,t){e.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(o.EMAIL_REGEX)?(H$1(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(t,true)):(H$1(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(t,false)),r.stopPropagation();});}};var D=class o extends T{static MOBILE_REGEX=/^\d+$/;constructor(e,t,r){super(e,t,r);}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`tel`),this.inappHTMLEl.setAttribute(`id`,e),e}addListener(e,t){e.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(o.MOBILE_REGEX)?(H$1(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(t,true)):(H$1(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(t,false)),r.stopPropagation();});}};var P=class extends E{constructor(e,t,r){super(e,t,r);}render(){super.render(),this.inappHTMLEl.setAttribute(`id`,`coo-${this.inappElement.type}`);}};var I=class o{static DOCUMENT_STANDARD_MODE=`CSS1Compat`;static ACTIVE_TRIGGER_DATA;static _instance;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.resizeListener=()=>this.screenResized(),this.setParentContainer(e);}static get(){return o._instance}render(e){this.renderEngagement(new G(e));}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(e){let t=e.max,r=e.cont.w,n=e.cont.h,l=e.spc,c=this.getWidth(),h=this.getHeight();t&&(c=c?Math.min(c,t):t,h=h?Math.min(h,t):t),h&&(c-=l.getHorizontal(),h-=l.getVertical(),c/h<r/n?this.scalingFactor=c/r:this.scalingFactor=h/n,this.scalingFactor=Math.min(this.scalingFactor,1));}setParentContainer(e){this.parent=e||document.body,this.isParentNotBody()&&H$1(this.parent,`position`,`relative`);}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(e){this.triggerContext=new Be(new Date,e),this.triggerContext.onClose(t=>{this.closeInApp(t);}),this.ian=e.ian,(M()||e.previewType===`mobile`)&&this.ian.overrideForMobileView(),await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed();},e.getDelaySeconds()):this.withCartDrawerClosed();}withCartDrawerClosed(){if(!V.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:t})=>{!t&&this.startRenderingOnce();});}startRenderingOnce(){if(!this.shouldSkipCampaign()){o.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,o._instance=this;try{this.startRendering();}catch(e){ke(e,`render-popup`,{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),M()||window.addEventListener(`resize`,this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe();}}shouldSkipCampaign(){let e=this.triggerContext.triggerData;if(!e.previewType&&o.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mt(o.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(e,r),true}if(Be$1().isGoKwikPopupOpen)return this.skipTrigger(e,{reason:`GoKwik popup is open`}),true;let t=zr.find(r=>!!document.querySelector(r.identifier));return t?(this.skipTrigger(e,{reason:`${t.gateway} modal is open`}),true):false}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new v(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext);}catch(e){throw Y.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(n=>n.mID));fe(new Ir(`CE Trigger Displayed`,e,this.triggerContext.triggerData));document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:{action:`DISPLAYED`}}));}sendTriggerClosed(e){let t=e.eventName;delete e.eventName;let r=new Ir(t,e,this.triggerContext.triggerData);r.name===`CE Trigger Clicked`&&(r.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(n=>n.toEmbed())),fe(r);}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500});}renderElement(e,t,r){t instanceof $r?new R(e,t,r).render():t instanceof qr?new D(e,t,r).render():t instanceof yt?new u(e,t,r).render():t instanceof Gr?new P(e,t,r).render():t instanceof it?new E(e,t,r).render():t instanceof qt?new f(e,t,r).render():t instanceof Vr?new A(e,t,r).render():t instanceof Hr?new b(e,t,r).render():Y.error(`Unsupported element type- `+t.type);}renderContainer(e){let t=this.ian?.cont;t&&(this.containerHTMLElement=new w(this.rootContainer,t,e).render().getHTMLElement(),new L().loadAllFonts(this.ian),this.ian.elems?.forEach(async r=>{await this.renderElement(this.containerHTMLElement,r,e);}),this.addEnterAnimation(this.ian.anim));}closeInApp(e){let t=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),o.ACTIVE_TRIGGER_DATA=void 0;let r=this.containerHTMLElement.animate(t,{duration:500,easing:`ease-in-out`});r.onfinish=()=>{this.removeInApp(),window.removeEventListener(`resize`,this.resizeListener);};}screenResized(){this.removeInApp(),this.startRendering();}removeInApp(){let e=document.querySelector(`.${this.triggerContext.rootClassName}`);e&&e.parentElement.removeChild(e);}skipTrigger(e,t){fe(new Ir(`CE Campaign Rejected`,t,e));}async preloadImages(e){let t=e.ian;if(!t)return;let r=[];t.elems.forEach(n=>{let l=n.bg?.img?.src;if(l&&r.push(l),n.t===1){let c=n.src;if(!c)return;r.push(c);}}),t.bg?.img?.src&&r.push(t.bg.img.src),t.cont.bg?.img?.src&&r.push(t.cont.bg.img.src),await Promise.all(r.map(n=>A$1(n)));}};
@@ -1,7 +1,7 @@
1
- import './chunk-cN7DAvpe-BbA9dPrS.js';
1
+ import './chunk-D-gRvo7T-D_Vnuz3Z.js';
2
2
  import './main.min.js';
3
- import { h as g, j as W, G as Ge, K as Ke, o as of, y as ye, k as Ka, u as uv, J as Ja, S as Sf, D as Df } from './widgets-DkXU5112-D30WP3Pt.js';
4
- import { l, f } from './video-detail-dialog.component-CXwW6KbY-CCLwK_4I.js';
3
+ import { h as g, j as W, G as Ge, K as Ke, o as of, y as ye, k as Ka, u as uv, J as Ja, S as Sf, D as Df } from './widgets-DtAGUdfa-C7iwoQiT.js';
4
+ import { l, f } from './video-detail-dialog.component-B8nbvQ40-DIHRne-r.js';
5
5
 
6
6
  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=of({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&&(Ka(0,`div`,0)(1,`div`,1)(2,`h3`),uv(3,`Share`),Ja(),Ka(4,`button`,2),Sf(`click`,function(e){return t.onShareAndClose(e)}),Df(5,`cooee-icon`,3),Ja()(),Ka(6,`div`,4)(7,`button`,5),Sf(`click`,function(e){return t.onShareAndClose(e,`Whatsapp`)}),Df(8,`cooee-icon`,6),Ka(9,`span`),uv(10,`Whatsapp`),Ja()(),Ka(11,`button`,7),Sf(`click`,function(e){return t.onShareAndClose(e,`X(Twitter)`)}),Df(12,`cooee-icon`,8),Ka(13,`span`),uv(14,`X`),Ja()(),Ka(15,`button`,9),Sf(`click`,function(e){return t.onShareAndClose(e,`Clipboard`)}),Df(16,`cooee-icon`,10),Ka(17,`span`),uv(18,`Copy link`),Ja()()()());},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}`]})};
7
7
 
@@ -1,15 +1,15 @@
1
- import { f as fe, Y } from './chunk-cN7DAvpe-BbA9dPrS.js';
1
+ import { f as fe, Y } from './chunk-D-gRvo7T-D_Vnuz3Z.js';
2
2
  import { I as Ir, V as Ve, H as He, y as ye, M, l as le, u as ue, d, n, a as Mi, b as V } from './main.min.js';
3
- import { l as Mt, h as g, m as Ye, n as Se$1, G as Ge, j as W, o as of, p as ht, q as ut, r as ft, s as TE, t as wE, v as mt, x as pt, y as ye$1, k as Ka, S as Sf, z as ec, w as wD, I as ID, H as Ho, J as Ja, A as lf, C as jD, E as yf, c as ud, _ as _D, F as nc, R as Rf, L as xf, N as Hb, O as Ro, K as Ke, P as Ft, D as Df, $ as $b, Q as Es, B as Bo, X as Xa, V as Vo, U as rc, Z as mf, a0 as ND, a1 as vD, a2 as fu, a3 as pu, a4 as kD, a5 as ED, a6 as Ef, a7 as gv, a8 as Zf, a9 as qf, aa as fv, ab as Sv, ac as Kg } from './widgets-DkXU5112-D30WP3Pt.js';
3
+ import { l as Mt, h as g, m as Ye, n as Se$1, G as Ge, j as W, o as of, p as ht, q as ut, r as ft, s as TE, t as wE, v as mt, x as pt, y as ye$1, k as Ka, S as Sf, z as ec, w as wD, I as ID, H as Ho, J as Ja, A as lf, C as jD, E as yf, c as ud, _ as _D, F as nc, R as Rf, L as xf, N as Hb, O as Ro, K as Ke, P as Ft, D as Df, $ as $b, Q as Es, B as Bo, X as Xa, V as Vo, U as rc, Z as mf, a0 as ND, a1 as vD, a2 as fu, a3 as pu, a4 as kD, a5 as ED, a6 as Ef, a7 as gv, a8 as Zf, a9 as qf, aa as fv, ab as Sv, ac as Kg } from './widgets-DtAGUdfa-C7iwoQiT.js';
4
4
 
5
5
  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)};
6
6
 
7
- var S=class n{video=$b.required();progress=Mt(0);constructor(){Es(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=of({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&&(Bo(0,`div`,0)(1,`div`,1),Xa(2,`div`),Vo()()),e&2&&(ud(),rc(`width`,i.progress(),`%`),mf(`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=Hb();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(Ft);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-DW70EFA1-7Yurj28Q.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=of({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&&(Ka(0,`button`,0),Sf(`click`,function(r){return i.share(r)}),Df(1,`cooee-icon`,1),Ja());},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)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}`]})};var Ie=[`swiperComp`],Se=[`videoEl`],Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Ka(0,`div`,11),Df(1,`div`,15),Ja());}function Me(n,t){if(n&1&&Df(0,`source`,13),n&2){let e=t.$implicit;yf(`type`,gv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&Ef(0);}function Ne(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,24),Sf(`cardClick`,function(o){fu(e);let r=kD(2).$implicit;return pu(kD().productCardClicked(o,r))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items);}}function ze(n,t){if(n&1&&Df(0,`cooee-video-card`,23),n&2){let e=kD(2).$implicit;yf(`card`,e.card);}}function Fe(n,t){if(n&1){let e=ND();Df(0,`cooee-video-progress-bar`,16),Ka(1,`div`,17)(2,`cooee-mute-toggle`,18),Zf(`mutedChange`,function(o){fu(e);let r=kD(2);return fv(r.muted,o)||(r.muted=o),pu(o)}),Sf(`toggled`,function(){fu(e);return pu(kD(2).muteToggled())}),Ja(),lf(3,Oe,1,0,`ng-container`,8),Ja(),Ka(4,`div`,19)(5,`cooee-share-button`,20),Sf(`dialogState`,function(o){fu(e);return pu(kD(2).shareDialogOpen.set(o))}),Ja()(),Ka(6,`div`,21),vD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),Ja();}if(n&2){let e=kD().$implicit,i=jD(5),o=kD(),r=jD(9);yf(`video`,i),ud(2),qf(`muted`,o.muted),yf(`videoEl`,i),ud(),yf(`ngTemplateOutlet`,r),ud(4),ED(e.items.length&&o.videoConfig.showItems()?7:e.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-detail`,25),Sf(`closeClick`,function(){fu(e);return pu(kD(2).productModalClosed())}),Ja();}if(n&2){let e=kD(2);yf(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=ND();Ka(0,`div`,6)(1,`div`,9)(2,`div`,10),vD(3,ke,2,0,`div`,11),Ka(4,`video`,12,2),Sf(`click`,function(){let o=fu(e).$index,r=kD();return pu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){fu(e);let o=jD(5);return pu(kD().onVideoEnded(o))})(`loadstart`,function(){let o=fu(e).$index;return pu(kD().onVideoLoadStart(o))})(`canplay`,function(){let o=fu(e).$index;return pu(kD().onVideoCanPlay(o))}),wD(6,Me,1,3,`source`,13,Pe),Ja(),vD(8,Fe,9,5),Ja(),vD(9,Le,1,3,`cooee-item-detail`,14),Ja()();}if(n&2){let e=t.$implicit,i=t.$index,o=kD();ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(o.shouldShowVideoSpinner(i)?3:-1),ud(),yf(`ngClass`,o.viewTemplateClassName)(`muted`,true),mf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.id)(`autoplay`,null),ud(2),_D(e.sources),ud(2),ED(o.currentIndex===i?8:-1),ud(),ED(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&Ef(0);}function Be(n,t){if(n&1){let e=ND();Ka(0,`button`,26),Sf(`click`,function(){fu(e);return pu(kD().close())}),Df(1,`cooee-icon`,27),Ja();}}var Te=class n$1{swiperComponent;videoElements;VideoConfigFooterContent=ye;currentIndex=0;muted=Mt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Mt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Mt(false);swiperOptions=Mt(null);videos=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new le(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new ue,this.navigationConfig=new d({enabled:true,size:50,color:new n({h:`#000000`})}),this.cssLoadedPromise=Mi(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await fe.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.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:t?.currentTime});}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1);}productModalClosed(){this.selectedItem=null;}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause());}toggleMute(){this.muted.update(t=>!t);}async muteToggled(){await fe.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.videos.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.videos[this.currentIndex],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.videos[this.currentIndex]),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.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null;}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height);}calculateOptimalVideoDimensions(){let t=this.videos.map(h=>h.sources?.[0]).filter(h=>h?.width&&h?.height).map(h=>({width:h.width,height:h.height,aspectRatio:h.width/h.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,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$1)};static ɵcmp=of({type:n$1,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&nc(Ie,7)(Se,5),e&2){let o;Rf(o=xf())&&(i.swiperComponent=o.first),Rf(o=xf())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Sf(`keydown.escape`,function(r){return i.onKeyDown(r)},Kg);},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&&(Ka(0,`div`,3)(1,`cooee-swiper`,4,0),Sf(`slideChange`,function(r){return i.onSlideChange(r)}),ec(3,5),wD(4,Re,10,10,`div`,6,ID),Ho(),Ja(),Ka(6,`div`,7),lf(7,Ae,1,0,`ng-container`,8),Ja()(),lf(8,Be,2,0,`ng-template`,null,1,Sv)),e&2){let o=jD(9);yf(`ngClass`,i.viewTemplateClassName),ud(),yf(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),ud(3),_D(i.videos),ud(3),yf(`ngTemplateOutlet`,o);}},dependencies:[ht,ut,ft,P,S,TE,wE,mt,pt,ye$1],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
+ var S=class n{video=$b.required();progress=Mt(0);constructor(){Es(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=of({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&&(Bo(0,`div`,0)(1,`div`,1),Xa(2,`div`),Vo()()),e&2&&(ud(),rc(`width`,i.progress(),`%`),mf(`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=Hb();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(Ft);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-DtXoBDfB-CEX8HzL4.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=of({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&&(Ka(0,`button`,0),Sf(`click`,function(r){return i.share(r)}),Df(1,`cooee-icon`,1),Ja());},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)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}`]})};var Ie=[`swiperComp`],Se=[`videoEl`],Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Ka(0,`div`,11),Df(1,`div`,15),Ja());}function Me(n,t){if(n&1&&Df(0,`source`,13),n&2){let e=t.$implicit;yf(`type`,gv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&Ef(0);}function Ne(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,24),Sf(`cardClick`,function(o){fu(e);let r=kD(2).$implicit;return pu(kD().productCardClicked(o,r))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items);}}function ze(n,t){if(n&1&&Df(0,`cooee-video-card`,23),n&2){let e=kD(2).$implicit;yf(`card`,e.card);}}function Fe(n,t){if(n&1){let e=ND();Df(0,`cooee-video-progress-bar`,16),Ka(1,`div`,17)(2,`cooee-mute-toggle`,18),Zf(`mutedChange`,function(o){fu(e);let r=kD(2);return fv(r.muted,o)||(r.muted=o),pu(o)}),Sf(`toggled`,function(){fu(e);return pu(kD(2).muteToggled())}),Ja(),lf(3,Oe,1,0,`ng-container`,8),Ja(),Ka(4,`div`,19)(5,`cooee-share-button`,20),Sf(`dialogState`,function(o){fu(e);return pu(kD(2).shareDialogOpen.set(o))}),Ja()(),Ka(6,`div`,21),vD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),Ja();}if(n&2){let e=kD().$implicit,i=jD(5),o=kD(),r=jD(9);yf(`video`,i),ud(2),qf(`muted`,o.muted),yf(`videoEl`,i),ud(),yf(`ngTemplateOutlet`,r),ud(4),ED(e.items.length&&o.videoConfig.showItems()?7:e.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-detail`,25),Sf(`closeClick`,function(){fu(e);return pu(kD(2).productModalClosed())}),Ja();}if(n&2){let e=kD(2);yf(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=ND();Ka(0,`div`,6)(1,`div`,9)(2,`div`,10),vD(3,ke,2,0,`div`,11),Ka(4,`video`,12,2),Sf(`click`,function(){let o=fu(e).$index,r=kD();return pu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){fu(e);let o=jD(5);return pu(kD().onVideoEnded(o))})(`loadstart`,function(){let o=fu(e).$index;return pu(kD().onVideoLoadStart(o))})(`canplay`,function(){let o=fu(e).$index;return pu(kD().onVideoCanPlay(o))}),wD(6,Me,1,3,`source`,13,Pe),Ja(),vD(8,Fe,9,5),Ja(),vD(9,Le,1,3,`cooee-item-detail`,14),Ja()();}if(n&2){let e=t.$implicit,i=t.$index,o=kD();ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(o.shouldShowVideoSpinner(i)?3:-1),ud(),yf(`ngClass`,o.viewTemplateClassName)(`muted`,true),mf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.id)(`autoplay`,null),ud(2),_D(e.sources),ud(2),ED(o.currentIndex===i?8:-1),ud(),ED(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&Ef(0);}function Be(n,t){if(n&1){let e=ND();Ka(0,`button`,26),Sf(`click`,function(){fu(e);return pu(kD().close())}),Df(1,`cooee-icon`,27),Ja();}}var Te=class n$1{swiperComponent;videoElements;VideoConfigFooterContent=ye;currentIndex=0;muted=Mt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Mt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Mt(false);swiperOptions=Mt(null);videos=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new le(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new ue,this.navigationConfig=new d({enabled:true,size:50,color:new n({h:`#000000`})}),this.cssLoadedPromise=Mi(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await fe.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.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:t?.currentTime});}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1);}productModalClosed(){this.selectedItem=null;}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause());}toggleMute(){this.muted.update(t=>!t);}async muteToggled(){await fe.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.videos.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.videos[this.currentIndex],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.videos[this.currentIndex]),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.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null;}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height);}calculateOptimalVideoDimensions(){let t=this.videos.map(h=>h.sources?.[0]).filter(h=>h?.width&&h?.height).map(h=>({width:h.width,height:h.height,aspectRatio:h.width/h.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,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$1)};static ɵcmp=of({type:n$1,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&nc(Ie,7)(Se,5),e&2){let o;Rf(o=xf())&&(i.swiperComponent=o.first),Rf(o=xf())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Sf(`keydown.escape`,function(r){return i.onKeyDown(r)},Kg);},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&&(Ka(0,`div`,3)(1,`cooee-swiper`,4,0),Sf(`slideChange`,function(r){return i.onSlideChange(r)}),ec(3,5),wD(4,Re,10,10,`div`,6,ID),Ho(),Ja(),Ka(6,`div`,7),lf(7,Ae,1,0,`ng-container`,8),Ja()(),lf(8,Be,2,0,`ng-template`,null,1,Sv)),e&2){let o=jD(9);yf(`ngClass`,i.viewTemplateClassName),ud(),yf(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),ud(3),_D(i.videos),ud(3),yf(`ngTemplateOutlet`,o);}},dependencies:[ht,ut,ft,P,S,TE,wE,mt,pt,ye$1],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}
8
8
  `],encapsulation:3})};
9
9
 
10
- var videoDetailDialog_componentCXwW6KbY = /*#__PURE__*/Object.freeze({
10
+ var videoDetailDialog_componentB8nbvQ40 = /*#__PURE__*/Object.freeze({
11
11
  __proto__: null,
12
12
  VideoDetailDialogComponent: Te
13
13
  });
14
14
 
15
- export { f, l, videoDetailDialog_componentCXwW6KbY as v };
15
+ export { f, l, videoDetailDialog_componentB8nbvQ40 as v };
@@ -1,4 +1,4 @@
1
- import { s, r, Y as Y$1, b as zn$1, t as te$1, h as he$2, A as Ar$1, x as xn$2, f as fe$2 } from './chunk-cN7DAvpe-BbA9dPrS.js';
1
+ import { s, r, Y as Y$1, b as zn$1, t as te$1, h as he$2, A as Ar$1, x as xn$2, f as fe$2 } from './chunk-D-gRvo7T-D_Vnuz3Z.js';
2
2
  import { x as v$1, U as U$1, z as q, C as Sr$1, D as m$1, E as vs$1, J as ve$2, K as pi$1, N as Nn$1, L as bi$1, O as ii, _ as _e$2, P as Fs$1, Q as Ps$1, R as Se$2, T as ye$2, a as Mi$1, W as Ce$2, t as He$3, X as Me$2, I as Ir$1, Y as De$2, l as le$2, M as M$3, Z as Vi$1, a0 as $e$2, a1 as gr$1, a2 as He$4, a3 as qe$2, a4 as Re$2, a5 as Fe$2, a6 as We$3, a7 as Je$1, a8 as Ae$2, y as ye$3, a9 as ge$3 } from './main.min.js';
3
3
 
4
4
  var Y=null,mr=false,di=1,G=Symbol(`SIGNAL`);function v(e){let t=Y;return Y=e,t}function Dr(){return Y}var Pt$2={version:0,lastCleanEpoch:0,dirty:false,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:false,consumerAllowSignalWrites:false,consumerIsAlwaysLive:false,kind:`unknown`,producerMustRecompute:()=>false,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function jt$1(e){if(mr)throw new Error(``);if(Y===null)return;Y.consumerOnSignalRead(e);let t=Y.producersTail;if(t!==void 0&&t.producer===e)return;let n,r=Y.recomputing;if(r&&(n=t!==void 0?t.nextProducer:Y.producers,n!==void 0&&n.producer===e)){Y.producersTail=n,n.lastReadVersion=e.version;return}let o=e.consumersTail;if(o!==void 0&&o.consumer===Y&&(!r||Qp(o,Y)))return;let i=Vt$2(Y),s={producer:e,consumer:Y,nextProducer:n,prevConsumer:o,lastReadVersion:e.version,nextConsumer:void 0};Y.producersTail=s,t!==void 0?t.nextProducer=s:Y.producers=s,i&&Oc(e,s);}function Ac(){di++;}function fi$1(e){if(!(Vt$2(e)&&!e.dirty)&&!(!e.dirty&&e.lastCleanEpoch===di)){if(!e.producerMustRecompute(e)&&!Dn$1(e)){li(e);return}e.producerRecomputeValue(e),li(e);}}function pi(e){if(e.consumers===void 0)return;let t=mr;mr=true;try{for(let n=e.consumers;n!==void 0;n=n.nextConsumer){let r=n.consumer;r.dirty||Yp(r);}}finally{mr=t;}}function hi$1(){return Y?.consumerAllowSignalWrites!==false}function Yp(e){e.dirty=true,pi(e),e.consumerMarkedDirty?.(e);}function li(e){e.dirty=false,e.lastCleanEpoch=di;}function Bt$2(e){return e&&Rc(e),v(e)}function Rc(e){e.producersTail=void 0,e.recomputing=true;}function yn$1(e,t){v(t),e&&xc(e);}function xc(e){e.recomputing=false;let t=e.producersTail,n=t!==void 0?t.nextProducer:e.producers;if(n!==void 0){if(Vt$2(e))do n=gi(n);while(n!==void 0);t!==void 0?t.nextProducer=void 0:e.producers=void 0;}}function Dn$1(e){for(let t=e.producers;t!==void 0;t=t.nextProducer){let n=t.producer,r=t.lastReadVersion;if(r!==n.version||(fi$1(n),r!==n.version))return true}return false}function lt$2(e){if(Vt$2(e)){let t=e.producers;for(;t!==void 0;)t=gi(t);}e.producers=void 0,e.producersTail=void 0,e.consumers=void 0,e.consumersTail=void 0;}function Oc(e,t){let n=e.consumersTail,r=Vt$2(e);if(n!==void 0?(t.nextConsumer=n.nextConsumer,n.nextConsumer=t):(t.nextConsumer=void 0,e.consumers=t),t.prevConsumer=n,e.consumersTail=t,!r)for(let o=e.producers;o!==void 0;o=o.nextProducer)Oc(o.producer,o);}function gi(e){let t=e.producer,n=e.nextProducer,r=e.nextConsumer,o=e.prevConsumer;if(e.nextConsumer=void 0,e.prevConsumer=void 0,r!==void 0?r.prevConsumer=o:t.consumersTail=o,o!==void 0)o.nextConsumer=r;else if(t.consumers=r,!Vt$2(t)){let i=t.producers;for(;i!==void 0;)i=gi(i);}return n}function Vt$2(e){return e.consumerIsAlwaysLive||e.consumers!==void 0}function Qp(e,t){let n=t.producersTail;if(n!==void 0){let r=t.producers;do{if(r===e)return true;if(r===n)break;r=r.nextProducer;}while(r!==void 0)}return false}function yi(e,t){return Object.is(e,t)}function vn$1(e,t){let n=Object.create(Kp);n.computation=e;let r=()=>{if(fi$1(n),jt$1(n),n.value===yr)throw n.error;return n.value};return r[G]=n,r}var ci=Symbol(`UNSET`),ui$1=Symbol(`COMPUTING`),yr=Symbol(`ERRORED`),Kp=s(r({},Pt$2),{value:ci,dirty:true,error:null,equal:yi,kind:`computed`,producerMustRecompute(e){return e.value===ci||e.value===ui$1},producerRecomputeValue(e){if(e.value===ui$1)throw new Error(``);let t=e.value;e.value=ui$1;let n=Bt$2(e),r,o=false;try{r=e.computation(),v(null),o=t!==ci&&t!==yr&&r!==yr&&e.equal(t,r);}catch(i){r=yr,e.error=i;}finally{yn$1(e,n);}if(o){e.value=t;return}e.value=r,e.version++;}});function Jp(){throw new Error}var kc=Jp;function Fc(e){kc(e);}function Di(e){kc=e;}function vi$1(e,t){let n=Object.create(vr);n.value=e;let r=()=>Lc(n);return r[G]=n,[r,s=>Ht$2(n,s),s=>Pc(n,s)]}function Lc(e){return jt$1(e),e.value}function Ht$2(e,t){hi$1()||Fc(e),e.equal(e.value,t)||(e.value=t,eh(e));}function Pc(e,t){hi$1()||Fc(e),Ht$2(e,t(e.value));}var vr=s(r({},Pt$2),{equal:yi,value:void 0,kind:`signal`});function eh(e){e.version++,Ac(),pi(e);}var Ei=s(r({},Pt$2),{consumerIsAlwaysLive:true,consumerAllowSignalWrites:true,dirty:true,kind:`effect`});function Ci(e){if(e.dirty=false,e.version>0&&!Dn$1(e))return;e.version++;let t=Bt$2(e);try{e.cleanup(),e.fn();}finally{yn$1(e,t);}}var Ii;function Er(){return Ii}function Ae$1(e){let t=Ii;return Ii=e,t}var jc=Symbol(`NotFound`);function $t$1(e){return e===jc||e?.name===`ɵNotFound`}var Mr=`https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss`,m=class extends Error{code;constructor(t,n){super(gt$2(t,n)),this.code=t;}};function th(e){return `NG0${Math.abs(e)}`}function gt$2(e,t){return `${th(e)}${t?`: `+t:``}`}var de$2=globalThis;function A$1(e){for(let t in e)if(e[t]===A$1)return t;throw Error(``)}function Uc(e,t){for(let n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);}function br(e){if(typeof e==`string`)return e;if(Array.isArray(e))return `[${e.map(br).join(`, `)}]`;if(e==null)return ``+e;let t=e.overriddenName||e.name;if(t)return `${t}`;let n=e.toString();if(n==null)return ``+n;let r=n.indexOf(`
@@ -32,14 +32,14 @@ var Ui={schedule(n,t){let e=setTimeout(n,t);return ()=>clearTimeout(e)}};functio
32
32
  `],encapsulation:3})};var ze=class n extends xe{item;data=g(Ye);dialogRef=g(W);ItemDetailLayout=$e$2;constructor(){super(),this.triggerContext=this.data.triggerContext,this.item=this.data.item;}close(){this.dialogRef.close();}engagementTriggerReceived(t){}update(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-item-quick-view`]],features:[Xf(lt()),za],decls:1,vars:2,consts:[[3,`closeClick`,`item`,`layout`]],template:function(e,i){e&1&&(Ka(0,`cooee-item-detail`,0),Sf(`closeClick`,function(){return i.close()}),Ja()),e&2&&yf(`item`,i.item)(`layout`,i.ItemDetailLayout.TWO_PANE);},dependencies:[ut],styles:[`:host{display:flex;align-items:center;justify-content:center;height:100%}@media(min-width:768px){cooee-item-detail{max-width:900px;max-height:80vh;border-radius:var(--lc-card-radius)}}
33
33
  `],encapsulation:3})};var Ue=class n{dialog=g(Ro);dialogRef;constructor(){}showItemQuickView(t,e){this.dialogRef=this.dialog.open(ze,{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 uo=(n,t)=>({enter:n,exit:t});function fo(n,t){if(n&1&&(Ka(0,`div`,7),uv(1),Ja(),Ka(2,`div`,8),uv(3),Ja()),n&2){let e=kD(2);ud(),ic(` `,e.getCurrency(e.selectedVariant().price.cmp),` `),ud(2),ic(` `,e.getDiscountPercentage(e.selectedVariant().price),`% off `);}}function go(n,t){if(n&1&&(Ka(0,`div`,6),uv(1),Ja()),n&2){let e=kD(2);ud(),ic(` `,e.stickyATCConfig.leftText,` `);}}function ho(n,t){if(n&1&&(Ka(0,`div`,1)(1,`div`,5),uv(2),Ja(),vD(3,fo,4,2),vD(4,go,2,1,`div`,6),Ja()),n&2){let e=kD();ud(2),ic(` `,e.getCurrency(e.selectedVariant().price.d),` `),ud(),ED(e.selectedVariant().price.cmp?3:-1),ud(),ED(e.stickyATCConfig.leftText?4:-1);}}function vo(n,t){if(n&1&&(Ka(0,`div`,9),uv(1),Ja()),n&2){let e=t.$implicit,i=t.$index;kD(2);let r=hv(5);yf(`ngClass`,Cv(2,uo,i===r.currentIndex,i===r.previousIndex)),ud(),ic(` `,e,` `);}}function Co(n,t){if(n&1&&(Ka(0,`div`,4),wD(1,vo,2,5,`div`,9,ID),Ja()),n&2){kD();let e=hv(5);ud(),_D(e.features);}}var Qe=class n extends xe{currentItem;stickyATCConfig;selectedVariant=Mt$2(void 0);featureSlider=Mt$2({features:[],currentIndex:0});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],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation();}update(){}getCurrency(t){return Ar$1(t)}getDiscountPercentage(t){return ((t.cmp-t.d)/t.cmp*100).toFixed(0)}addToCart(){this.engagementService.executeCTA(He$3.ADD_TO_CART,{item:this.currentItem});}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?qe$2(t,this.currentItem.getTemplateVariables(),this.triggerContext):``}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-sticky-atc`]],hostBindings:function(e,i){e&1&&Sf(`letscooee:variant-change`,function(s){return i.onVariantChange(s)},Jg);},features:[Xf(lt()),za],decls:7,vars:3,consts:[[1,`lc-wrapper`],[1,`lc-prices`],[1,`lc-button-wrapper`],[`type`,`button`,1,`lc-button`,`lc-button-atc`,3,`click`],[1,`lc-features`],[1,`lc-sale-price`],[1,`lc-additional-text`],[1,`lc-compare-price`],[1,`lc-discount-label`],[1,`lc-feature`,3,`ngClass`]],template:function(e,i){if(e&1&&(Ka(0,`div`,0),vD(1,ho,5,3,`div`,1),Ka(2,`div`,2)(3,`button`,3),Sf(`click`,function(){return i.addToCart()}),uv(4,`Add To Cart`),Ja(),Qf(5),vD(6,Co,3,0,`div`,4),Ja()()),e&2){ud(),ED(i.selectedVariant()&&i.stickyATCConfig.showProductInfo?1:-1),ud(4);let r=pv(i.featureSlider());ud(),ED(r.features.length?6:-1);}},dependencies:[wE],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media(min-width:768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
35
- `],encapsulation:3})};var yo=[`videoEl`];async function vi(){return (await import('./video-detail-dialog.component-CXwW6KbY-CCLwK_4I.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var me=class n extends xe{videoElements;videos;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),vi();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videos=this.videoConfig.videos;}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,r,s){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){r&&(r.muted=false,r.play(),this.onMuteToggled(false,r));return}await this.openDialog(e,i,s);}sendEvent(t,e,i,r){let s=new Ir$1(t,e,this.engagementTrigger);s.setVideos(i),r&&(s.items=[r.toEmbed()]),window.CooeeSDK.sendEvent(s);}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(r=>{let s=r.target,l=s.dataset.videoId;l&&(r.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(s,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(s,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$3();if(!t||!this.videos)return;let e=Je$1();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$2)return;let i=this.videos.findIndex(r=>r.shortID===+t);if(i!==-1){let r=this.videos[i];await fe$2.set(`muted`,true),await this.openDialog(r,i);}}async openDialog(t,e,i){await Vi$1();let r={videos:this.videos,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let s=await vi();this.dialogRef=this.dialog.open(s,{width:`100vw`,height:`100vh`,data:r,providers:bt(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(c=>{if(this.dialogRef=null,!c)return;let f=c.lastVideoDuration*1e3,w={videoID:c.lastVideo.id,videoIndex:c.lastVideoIndex,playedTillMS:f,playedTillPercent:f/c.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:w},c.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&nc(yo,5),e&2){let r;Rf(r=xf())&&(i.videoElements=r);}},features:[za],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var ue=class n{video=$b.required({alias:`cooeeVideoSources`});prioritySource=$b(`high`);elementRef=g(Se$1);constructor(){Es(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(s=>s.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=hn$1({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var _o=(n,t)=>t.id;function xo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function bo(n,t){n&1&&(Ka(0,`div`,6),Df(1,`div`,12),Ja());}function wo(n,t){if(n&1){let e=ND();Ka(0,`cooee-mute-toggle`,13),Sf(`toggled`,function(r){fu(e),kD();let s=jD(6);return pu(kD().onMuteToggled(r,s))}),Ja();}if(n&2){kD();let e=jD(6);yf(`muted`,e.muted)(`videoEl`,e);}}function Vo(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,16),Sf(`cardClick`,function(r){fu(e);let s=kD(2),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onItemCardClick(r,l,c,f))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items)(`centeredSlides`,false);}}function To(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-card`,17),Sf(`buttonClick`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6);return pu(kD().addToCartClicked(null,s,l,c))})(`click`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6),f=hv(0);return pu(kD().onItemCardClick(f,s,l,c))}),Ja();}if(n&2){kD(2);yf(`item`,hv(0));}}function Eo(n,t){if(n&1&&vD(0,Vo,1,2,`cooee-video-promoted-items`,14)(1,To,1,1,`cooee-item-card`,15),n&2){let e=kD().$implicit,i=kD();ED(hv(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function So(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-card`,18),Sf(`linkClicked`,function(){fu(e);let r=kD().$implicit;return pu(kD().sendTriggerClicked(r))}),Ja();}if(n&2){kD();yf(`card`,hv(1));}}function Io(n,t){if(n&1){let e=ND();Qf(0)(1),Ka(2,`div`,4)(3,`div`,5),Sf(`click`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.enter`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.space`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))}),vD(4,bo,2,0,`div`,6),Ka(5,`video`,7,0),Sf(`mouseenter`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.play())})(`mouseleave`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.pause())})(`loadstart`,function(){let r=fu(e).$implicit;return pu(kD().onVideoLoadStart(r.id))})(`canplay`,function(){let r=fu(e).$implicit;return pu(kD().onVideoCanPlay(r.id))}),Ja(),Ka(7,`div`,8),vD(8,wo,1,2,`cooee-mute-toggle`,9),Ja()(),Ka(9,`div`,10),vD(10,Eo,2,1)(11,So,1,1,`cooee-video-card`,11),Ja()();}if(n&2){let e=t.$implicit,i=kD(),r=hv(0),s=hv(2);pv(e.items[0]),ud();let c=pv(e.card)&&s===i.VideoConfigFooterContent.CARD;ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(i.isVideoLoading(e.id)?4:-1),ud(),yf(`cooeeVideoSources`,e)(`muted`,true),mf(`preload`,r?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,e.id),ud(3),ED(i.videoConfig.showMuteButton?8:-1),ud(2),ED(i.videoConfig.showItems()?10:c?11:-1);}}var Ze=class n extends me{VideoConfigFooterContent=ye$3;VideoConfigAutoPlay=ge$3;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,r){let s=e.items?.[0],l=he$2.get().website?.canChangeVariantInCart;if(e.items?.length>1||s?.hasVariants()&&!l){this.onItemCardClick(s,e,i,r);return}this.engagementService.executeCTA(He$3.ADD_TO_CART,{item:s,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(He$3.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,r){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,r,t):this.onVideoTap(null,e,i,r);}update(){}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=of({type:n,selectors:[[`cooee-video-playlist`]],features:[Xf(lt()),za],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&&(Qf(0)(1)(2),vD(3,xo,2,3,`div`,1),Ka(4,`cooee-swiper`,2),ec(5,3),wD(6,Io,12,12,`div`,4,_o),Ho(),Ja()),e&2){pv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),ud(),pv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),ud(),pv(i.videoConfig.footerContent),ud(),ED(i.videoConfig.heading?3:-1);let r=i.videoConfig.playlistConfig.videoSwiper;ud(),yf(`options`,i.swiperOptions)(`navigationConfig`,r==null?null:r.navigation)(`paginationConfig`,r==null?null:r.pagination),ud(2),_D(i.videos);}},dependencies:[ft,mt,pt,re,ue,ht,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 yo=[`videoEl`];async function vi(){return (await import('./video-detail-dialog.component-B8nbvQ40-DIHRne-r.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var me=class n extends xe{videoElements;videos;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),vi();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videos=this.videoConfig.videos;}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,r,s){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){r&&(r.muted=false,r.play(),this.onMuteToggled(false,r));return}await this.openDialog(e,i,s);}sendEvent(t,e,i,r){let s=new Ir$1(t,e,this.engagementTrigger);s.setVideos(i),r&&(s.items=[r.toEmbed()]),window.CooeeSDK.sendEvent(s);}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(r=>{let s=r.target,l=s.dataset.videoId;l&&(r.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(s,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(s,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$3();if(!t||!this.videos)return;let e=Je$1();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$2)return;let i=this.videos.findIndex(r=>r.shortID===+t);if(i!==-1){let r=this.videos[i];await fe$2.set(`muted`,true),await this.openDialog(r,i);}}async openDialog(t,e,i){await Vi$1();let r={videos:this.videos,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let s=await vi();this.dialogRef=this.dialog.open(s,{width:`100vw`,height:`100vh`,data:r,providers:bt(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(c=>{if(this.dialogRef=null,!c)return;let f=c.lastVideoDuration*1e3,w={videoID:c.lastVideo.id,videoIndex:c.lastVideoIndex,playedTillMS:f,playedTillPercent:f/c.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:w},c.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&nc(yo,5),e&2){let r;Rf(r=xf())&&(i.videoElements=r);}},features:[za],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var ue=class n{video=$b.required({alias:`cooeeVideoSources`});prioritySource=$b(`high`);elementRef=g(Se$1);constructor(){Es(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(s=>s.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=hn$1({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var _o=(n,t)=>t.id;function xo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function bo(n,t){n&1&&(Ka(0,`div`,6),Df(1,`div`,12),Ja());}function wo(n,t){if(n&1){let e=ND();Ka(0,`cooee-mute-toggle`,13),Sf(`toggled`,function(r){fu(e),kD();let s=jD(6);return pu(kD().onMuteToggled(r,s))}),Ja();}if(n&2){kD();let e=jD(6);yf(`muted`,e.muted)(`videoEl`,e);}}function Vo(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,16),Sf(`cardClick`,function(r){fu(e);let s=kD(2),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onItemCardClick(r,l,c,f))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items)(`centeredSlides`,false);}}function To(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-card`,17),Sf(`buttonClick`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6);return pu(kD().addToCartClicked(null,s,l,c))})(`click`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6),f=hv(0);return pu(kD().onItemCardClick(f,s,l,c))}),Ja();}if(n&2){kD(2);yf(`item`,hv(0));}}function Eo(n,t){if(n&1&&vD(0,Vo,1,2,`cooee-video-promoted-items`,14)(1,To,1,1,`cooee-item-card`,15),n&2){let e=kD().$implicit,i=kD();ED(hv(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function So(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-card`,18),Sf(`linkClicked`,function(){fu(e);let r=kD().$implicit;return pu(kD().sendTriggerClicked(r))}),Ja();}if(n&2){kD();yf(`card`,hv(1));}}function Io(n,t){if(n&1){let e=ND();Qf(0)(1),Ka(2,`div`,4)(3,`div`,5),Sf(`click`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.enter`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.space`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))}),vD(4,bo,2,0,`div`,6),Ka(5,`video`,7,0),Sf(`mouseenter`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.play())})(`mouseleave`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.pause())})(`loadstart`,function(){let r=fu(e).$implicit;return pu(kD().onVideoLoadStart(r.id))})(`canplay`,function(){let r=fu(e).$implicit;return pu(kD().onVideoCanPlay(r.id))}),Ja(),Ka(7,`div`,8),vD(8,wo,1,2,`cooee-mute-toggle`,9),Ja()(),Ka(9,`div`,10),vD(10,Eo,2,1)(11,So,1,1,`cooee-video-card`,11),Ja()();}if(n&2){let e=t.$implicit,i=kD(),r=hv(0),s=hv(2);pv(e.items[0]),ud();let c=pv(e.card)&&s===i.VideoConfigFooterContent.CARD;ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(i.isVideoLoading(e.id)?4:-1),ud(),yf(`cooeeVideoSources`,e)(`muted`,true),mf(`preload`,r?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,e.id),ud(3),ED(i.videoConfig.showMuteButton?8:-1),ud(2),ED(i.videoConfig.showItems()?10:c?11:-1);}}var Ze=class n extends me{VideoConfigFooterContent=ye$3;VideoConfigAutoPlay=ge$3;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,r){let s=e.items?.[0],l=he$2.get().website?.canChangeVariantInCart;if(e.items?.length>1||s?.hasVariants()&&!l){this.onItemCardClick(s,e,i,r);return}this.engagementService.executeCTA(He$3.ADD_TO_CART,{item:s,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(He$3.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,r){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,r,t):this.onVideoTap(null,e,i,r);}update(){}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=of({type:n,selectors:[[`cooee-video-playlist`]],features:[Xf(lt()),za],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&&(Qf(0)(1)(2),vD(3,xo,2,3,`div`,1),Ka(4,`cooee-swiper`,2),ec(5,3),wD(6,Io,12,12,`div`,4,_o),Ho(),Ja()),e&2){pv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),ud(),pv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),ud(),pv(i.videoConfig.footerContent),ud(),ED(i.videoConfig.heading?3:-1);let r=i.videoConfig.playlistConfig.videoSwiper;ud(),yf(`options`,i.swiperOptions)(`navigationConfig`,r==null?null:r.navigation)(`paginationConfig`,r==null?null:r.pagination),ud(2),_D(i.videos);}},dependencies:[ft,mt,pt,re,ue,ht,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 Mo=[`videoElement`],ko=n=>({"cursor-grab":n}),We=class n extends me{videoElement;video;isDragging=false;hidden=false;cdkDrag=g(ge$1,{self:true});untilDestroyed=dt();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.videos[0];}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=of({type:n,selectors:[[`cooee-video-popup`]],viewQuery:function(e,i){if(e&1&&nc(Mo,5),e&2){let r;Rf(r=xf())&&(i.videoElement=r.first);}},hostAttrs:[`role`,`button`,`tabindex`,`0`,`aria-label`,`Open video popup `,`cdkDragBoundary`,`body`],hostVars:2,hostBindings:function(e,i){e&1&&Sf(`keydown.enter`,function(s){return i.onClick(s)})(`keydown.space`,function(s){return i.onClick(s)})(`click`,function(s){return i.onClick(s)}),e&2&&XD(i.popupClasses);},features:[Xf(lt()),iD([{directive:ge$1,inputs:[`cdkDragBoundary`,`cdkDragBoundary`]}]),za],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 r=ND();Ka(0,`div`,1)(1,`button`,2),Sf(`click`,function(l){return fu(r),l.stopPropagation(),pu(i.close())}),Df(2,`cooee-icon`,3),Ja(),Ka(3,`div`,4),Df(4,`cooee-icon`,5),Ka(5,`div`,6),uv(6,`Tap to unmute`),Ja()(),Df(7,`video`,7,0),Ja();}e&2&&(yf(`ngClass`,Ev(3,ko,i.isDragging)),ud(7),yf(`muted`,true)(`cooeeVideoSources`,i.video));},dependencies:[wE,ye,ue],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 Po=(n,t)=>t.id;function Fo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function Do(n,t){n&1&&(Ka(0,`div`,9),Df(1,`div`,11),Ja());}function Ao(n,t){if(n&1){let e=ND();Ka(0,`div`,4),Sf(`click`,function(r){let s=fu(e),l=s.$implicit,c=s.$index;return pu(kD().onVideoTap(r,l,c))})(`keydown.enter`,function(r){let s=fu(e),l=s.$implicit,c=s.$index;return pu(kD().onVideoTap(r,l,c))})(`keydown.space`,function(r){let s=fu(e),l=s.$implicit,c=s.$index;return pu(kD().onVideoTap(r,l,c))}),_u(),Ka(1,`svg`,5),Df(2,`circle`,6)(3,`circle`,7),Ja(),Tu(),Ka(4,`div`,8),vD(5,Do,2,0,`div`,9),Ka(6,`video`,10,0),Sf(`loadstart`,function(){let r=fu(e).$implicit;return pu(kD().onVideoLoadStart(r.id))})(`canplay`,function(){let r=fu(e).$implicit;return pu(kD().onVideoCanPlay(r.id))}),Ja()()();}if(n&2){let e=t.$implicit,i=t.$index,r=kD();mf(`aria-label`,`Open video story `+(i+1)),ud(5),ED(r.isVideoLoading(e.id)?5:-1),ud(),yf(`poster`,e.thumbnail)(`cooeeVideoSources`,e)(`prioritySource`,`low`)(`muted`,true),mf(`data-video-id`,e.id);}}var qe=class n extends me{constructor(){super();}ngAfterViewInit(){super.ngAfterViewInit(),this.setupIntersectionObserver();}ngOnDestroy(){super.ngOnDestroy();}update(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-stories`]],features:[Xf(lt()),za],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,`loading-spinner`]],template:function(e,i){e&1&&(vD(0,Fo,2,3,`div`,1),Ka(1,`div`,2),wD(2,Ao,8,7,`div`,3,Po),Ja()),e&2&&(ED(i.videoConfig.heading?0:-1),ud(2),_D(i.videos));},dependencies:[ue,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;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{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 Ba(){let n=await $E(fi),t=(e,i)=>{let r=ui(e,{injector:n.injector});customElements.define(i,r);};t(Qe,`cooee-sticky-atc`),t($e,`cooee-savings-bar`),t(je,`cooee-progressbar`),t(Ze,`cooee-video-playlist`),t(We,`cooee-video-popup`),t(qe,`cooee-video-stories`),t(Ve,`cooee-product-options-picker`),t(Be,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-ggvhl60P-CNpH_9jJ.js').then(e=>{t(e.DebuggerComponent,`cooee-debugger`);}),window.cooeeShowQuickItem=(e,i)=>{n.injector.get(Ue).showItemQuickView(e,i);};}
38
+ `],encapsulation:3})};async function Ba(){let n=await $E(fi),t=(e,i)=>{let r=ui(e,{injector:n.injector});customElements.define(i,r);};t(Qe,`cooee-sticky-atc`),t($e,`cooee-savings-bar`),t(je,`cooee-progressbar`),t(Ze,`cooee-video-playlist`),t(We,`cooee-video-popup`),t(qe,`cooee-video-stories`),t(Ve,`cooee-product-options-picker`),t(Be,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-DoczY0Gg-xiwwOLV2.js').then(e=>{t(e.DebuggerComponent,`cooee-debugger`);}),window.cooeeShowQuickItem=(e,i)=>{n.injector.get(Ue).showItemQuickView(e,i);};}
39
39
 
40
- var widgetsDkXU5112 = /*#__PURE__*/Object.freeze({
40
+ var widgetsDtAGUdfa = /*#__PURE__*/Object.freeze({
41
41
  __proto__: null,
42
42
  loadAngularWidgets: Ba
43
43
  });
44
44
 
45
- export { $b as $, lf as A, Bo as B, jD as C, Df as D, yf as E, nc as F, Ge as G, Ho as H, ID as I, Ja as J, Ke as K, xf as L, Mf as M, Hb as N, Ro as O, Ft$2 as P, Es as Q, Rf as R, Sf as S, Tv as T, rc as U, Vo$1 as V, Wf as W, Xa as X, Yg as Y, mf as Z, _D as _, a, ND as a0, vD as a1, fu as a2, pu as a3, kD as a4, ED as a5, Ef as a6, gv as a7, Zf as a8, qf as a9, fv as aa, Sv as ab, Kg as ac, widgetsDkXU5112 as ad, bE as b, ud as c, Iv as d, _f as e, _v as f, ge$1 as g, g as h, iD as i, W as j, Ka as k, Mt$2 as l, Ye as m, Se$1 as n, of as o, ht as p, ut as q, ft as r, TE as s, wE as t, uv as u, mt as v, wD as w, pt as x, ye as y, ec as z };
45
+ export { $b as $, lf as A, Bo as B, jD as C, Df as D, yf as E, nc as F, Ge as G, Ho as H, ID as I, Ja as J, Ke as K, xf as L, Mf as M, Hb as N, Ro as O, Ft$2 as P, Es as Q, Rf as R, Sf as S, Tv as T, rc as U, Vo$1 as V, Wf as W, Xa as X, Yg as Y, mf as Z, _D as _, a, ND as a0, vD as a1, fu as a2, pu as a3, kD as a4, ED as a5, Ef as a6, gv as a7, Zf as a8, qf as a9, fv as aa, Sv as ab, Kg as ac, widgetsDtAGUdfa as ad, bE as b, ud as c, Iv as d, _f as e, _v as f, ge$1 as g, g as h, iD as i, W as j, Ka as k, Mt$2 as l, Ye as m, Se$1 as n, of as o, ht as p, ut as q, ft as r, TE as s, wE as t, uv as u, mt as v, wD as w, pt as x, ye as y, ec 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.0.1",
4
+ "version": "14.0.2",
5
5
  "scripts": {
6
6
  "lint": "ng lint",
7
7
  "integrity": "./scripts/validate-integrity.sh",