@letscooee/web-sdk 12.2.21 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-5PGZJPN4.js → chunk-4EBKD5OK.js} +1 -1
- package/dist/{chunk-3DJ333JW.js → chunk-7THB3JNS.js} +1 -1
- package/dist/{chunk-VYXGZONF.js → chunk-GP5WF6VO.js} +1 -1
- package/dist/chunk-LUGFMRZ3.js +6 -0
- package/dist/{debug-logs-33M555YC.js → debug-logs-VHOA7RF2.js} +1 -1
- package/dist/main.min.js +21 -21
- package/dist/{share-dialog.component-63AOXQV4.js → share-dialog.component-DI43W4SS.js} +1 -1
- package/dist/{video-detail-dialog.component-4Y27ATOK.js → video-detail-dialog.component-ZYDCMJWT.js} +1 -1
- package/dist/widget.min.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-KUWURWCS.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as D,f as A}from"./chunk-V7UGKYBN.js";var V=D((C,m)=>{"use strict";(function(r){"use strict";var e={};e.VERSION="1.6.1";var s,f={},E=function(o,t){return function(){return t.apply(o,arguments)}},h=function(){var o=arguments,t=o[0],u,n;for(n=1;n<o.length;n++)for(u in o[n])!(u in t)&&o[n].hasOwnProperty(u)&&(t[u]=o[n][u]);return t},g=function(o,t){return{value:o,name:t}};e.TRACE=g(1,"TRACE"),e.DEBUG=g(2,"DEBUG"),e.INFO=g(3,"INFO"),e.TIME=g(4,"TIME"),e.WARN=g(5,"WARN"),e.ERROR=g(8,"ERROR"),e.OFF=g(99,"OFF");var _=function(o){this.context=o,this.setLevel(o.filterLevel),this.log=this.info};_.prototype={setLevel:function(o){o&&"value"in o&&(this.context.filterLevel=o)},getLevel:function(){return this.context.filterLevel},enabledFor:function(o){var t=this.context.filterLevel;return o.value>=t.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"start"])},timeEnd:function(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"end"])},invoke:function(o,t){s&&this.enabledFor(o)&&s(t,h({level:o},this.context))}};var i=new _({filterLevel:e.OFF});(function(){var o=e;o.enabledFor=E(i,i.enabledFor),o.trace=E(i,i.trace),o.debug=E(i,i.debug),o.time=E(i,i.time),o.timeEnd=E(i,i.timeEnd),o.info=E(i,i.info),o.warn=E(i,i.warn),o.error=E(i,i.error),o.log=o.info})(),e.setHandler=function(o){s=o},e.setLevel=function(o){i.setLevel(o);for(var t in f)f.hasOwnProperty(t)&&f[t].setLevel(o)},e.getLevel=function(){return i.getLevel()},e.get=function(o){return f[o]||(f[o]=new _(h({name:o},i.context)))},e.createDefaultHandler=function(o){o=o||{},o.formatter=o.formatter||function(l,c){c.name&&l.unshift("["+c.name+"]")};var t={},u=function(n,l){Function.prototype.apply.call(n,console,l)};return typeof console>"u"?function(){}:function(n,l){n=Array.prototype.slice.call(n);var c=console.log,d;l.level===e.TIME?(d=(l.name?"["+l.name+"] ":"")+n[0],n[1]==="start"?console.time?console.time(d):t[d]=new Date().getTime():console.timeEnd?console.timeEnd(d):u(c,[d+": "+(new Date().getTime()-t[d])+"ms"])):(l.level===e.WARN&&console.warn?c=console.warn:l.level===e.ERROR&&console.error?c=console.error:l.level===e.INFO&&console.info?c=console.info:l.level===e.DEBUG&&console.debug?c=console.debug:l.level===e.TRACE&&console.trace&&(c=console.trace),o.formatter(n,l),u(c,n))}},e.useDefaults=function(o){e.setLevel(o&&o.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(o))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof m<"u"&&m.exports?m.exports=e:(e._prevLogger=r.Logger,e.noConflict=function(){return r.Logger=e._prevLogger,e},r.Logger=e)})(C)});var I="
|
|
1
|
+
import{e as D,f as A}from"./chunk-V7UGKYBN.js";var V=D((C,m)=>{"use strict";(function(r){"use strict";var e={};e.VERSION="1.6.1";var s,f={},E=function(o,t){return function(){return t.apply(o,arguments)}},h=function(){var o=arguments,t=o[0],u,n;for(n=1;n<o.length;n++)for(u in o[n])!(u in t)&&o[n].hasOwnProperty(u)&&(t[u]=o[n][u]);return t},g=function(o,t){return{value:o,name:t}};e.TRACE=g(1,"TRACE"),e.DEBUG=g(2,"DEBUG"),e.INFO=g(3,"INFO"),e.TIME=g(4,"TIME"),e.WARN=g(5,"WARN"),e.ERROR=g(8,"ERROR"),e.OFF=g(99,"OFF");var _=function(o){this.context=o,this.setLevel(o.filterLevel),this.log=this.info};_.prototype={setLevel:function(o){o&&"value"in o&&(this.context.filterLevel=o)},getLevel:function(){return this.context.filterLevel},enabledFor:function(o){var t=this.context.filterLevel;return o.value>=t.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"start"])},timeEnd:function(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"end"])},invoke:function(o,t){s&&this.enabledFor(o)&&s(t,h({level:o},this.context))}};var i=new _({filterLevel:e.OFF});(function(){var o=e;o.enabledFor=E(i,i.enabledFor),o.trace=E(i,i.trace),o.debug=E(i,i.debug),o.time=E(i,i.time),o.timeEnd=E(i,i.timeEnd),o.info=E(i,i.info),o.warn=E(i,i.warn),o.error=E(i,i.error),o.log=o.info})(),e.setHandler=function(o){s=o},e.setLevel=function(o){i.setLevel(o);for(var t in f)f.hasOwnProperty(t)&&f[t].setLevel(o)},e.getLevel=function(){return i.getLevel()},e.get=function(o){return f[o]||(f[o]=new _(h({name:o},i.context)))},e.createDefaultHandler=function(o){o=o||{},o.formatter=o.formatter||function(l,c){c.name&&l.unshift("["+c.name+"]")};var t={},u=function(n,l){Function.prototype.apply.call(n,console,l)};return typeof console>"u"?function(){}:function(n,l){n=Array.prototype.slice.call(n);var c=console.log,d;l.level===e.TIME?(d=(l.name?"["+l.name+"] ":"")+n[0],n[1]==="start"?console.time?console.time(d):t[d]=new Date().getTime():console.timeEnd?console.timeEnd(d):u(c,[d+": "+(new Date().getTime()-t[d])+"ms"])):(l.level===e.WARN&&console.warn?c=console.warn:l.level===e.ERROR&&console.error?c=console.error:l.level===e.INFO&&console.info?c=console.info:l.level===e.DEBUG&&console.debug?c=console.debug:l.level===e.TRACE&&console.trace&&(c=console.trace),o.formatter(n,l),u(c,n))}},e.useDefaults=function(o){e.setLevel(o&&o.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(o))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof m<"u"&&m.exports?m.exports=e:(e._prevLogger=r.Logger,e.noConflict=function(){return r.Logger=e._prevLogger,e},r.Logger=e)})(C)});var I="13.0.0";var b=I.split("-")[0].split(".").slice(0,3).map(r=>r.padStart(2,"0")).join(""),S="WEB",N="CooeeSDK",p=I,M=parseInt(b,10);var P=["collection","product","cart"],U=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],x=["View Item","View Cart","View Collection"],F=["CE Screen View","View Collection","View Item","View Cart"];var T=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${p}/dist`,L={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:T,styleURL:`${T}/widget.min.css`,widgetURL:`${T}/widget.min.js`,swiperStyleURL:`${T}/swiper-bundle.min.css`};var a=A(V());var v=class{static debuggerEl;static infoLogs=[];static log(...e){a.default.info(...e)}static verbose(...e){a.default.debug(...e)}static error(...e){a.default.error(...e)}static warn(...e){a.default.warn(...e)}static info(...e){a.default.info(...e),this.infoLogs.push({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){a.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function K(r=N){a.default.useDefaults({formatter:function(e){e.unshift(`${r} (v${p}):`)}}),w()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?a.default.setLevel(a.default[localStorage.cooeeLogLevel]):a.default.setLevel(L.debug?a.default.TRACE:a.default.OFF)}function w(){let r=O();return r==="1"||r==="on"}function O(){return new URL(location.href).searchParams?.get("cooee-debug")}function $(){let r=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),e=`
|
|
2
2
|
`;e+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
|
|
3
3
|
`,e+=`\u{1F50D} Track real-time visitor intent & optimize engagement
|
|
4
4
|
`,e+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,o as d,p as g}from"./chunk-
|
|
1
|
+
import{g as p,o as d,p as g}from"./chunk-LUGFMRZ3.js";var f=(t,e,o,r)=>{if(!e)return;let n={videoID:e.id,videoIndex:o},i=new p("CE Video Shared",{current:n,platform:r},t);window.CooeeSDK.sendEvent(i)},l=(t,e,o=!0)=>{let r=o?encodeURIComponent(m(t,e)):m(t,e),n="Hey! Check out this video for an amazing product -",i=o?encodeURIComponent(n):n;return{url:r,text:i}},m=(t,e)=>{let o=d(window.location.href,t);return g(o,e)};export{f as a,l as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Gs,b as jt,c as he,e as Sn,f as tr,g as $s,h as js,l as Wt}from"./chunk-KUWURWCS.js";import{a as nr}from"./chunk-OG6WZFOM.js";import{$ as di,$a as er,Aa as Se,Ba as Ms,Ca as G,D as hn,Da as Ps,E as et,Ea as Ls,I as gn,K as Dt,Ka as rt,L as gt,Ma as vn,Na as Jn,O as D,Oa as Qn,Pa as te,Qa as it,Ra as wt,Va as Fe,Wa as ke,X as be,Xa as _e,Y as li,Ya as Vs,Za as Zn,_ as Ds,_a as yn,ab as Fs,b as Cs,ba as _t,bb as Ue,ca as _n,cb as Be,eb as En,ga as ws,gb as ot,ha as Ht,hb as At,ia as Z,ib as vt,ja as ee,jb as Ce,la as Gt,lb as bn,ma as $t,na as K,o as Is,oa as U,pa as H,q as Ts,qa as fe,ra as $e,rb as ks,s as ci,sa as tt,sb as Us,t as ui,ta as Xn,tb as Bs,u as xs,ua as As,v as ge,va as Ns,vb as Hs,wa as nt,x as Te,xa as Os,y as xe,ya as je,za as Rs}from"./chunk-I4NX4HQ6.js";import{a as _,b as V,c as mn,d as Ss,e as Pl,f as Ll,g as Kn}from"./chunk-V7UGKYBN.js";var ea=Pl((Zs,pi)=>{"use strict";(function(e){if(typeof Zs=="object"&&typeof pi<"u")pi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return(function r(i,o,s){function u(y,p){if(!o[y]){if(!i[y]){var E=typeof mn=="function"&&mn;if(!p&&E)return E(y,!0);if(l)return l(y,!0);var v=new Error("Cannot find module '"+y+"'");throw v.code="MODULE_NOT_FOUND",v}var N=o[y]={exports:{}};i[y][0].call(N.exports,function(B){var M=i[y][1][B];return u(M||B)},N,N.exports,r,i,o,s)}return o[y].exports}for(var l=typeof mn=="function"&&mn,h=0;h<s.length;h++)u(s[h]);return u})({1:[function(r,i,o){(function(s){"use strict";var u=s.MutationObserver||s.WebKitMutationObserver,l;if(u){var h=0,y=new u(B),p=s.document.createTextNode("");y.observe(p,{characterData:!0}),l=function(){p.data=h=++h%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=B,l=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var O=s.document.createElement("script");O.onreadystatechange=function(){B(),O.onreadystatechange=null,O.parentNode.removeChild(O),O=null},s.document.documentElement.appendChild(O)}:l=function(){setTimeout(B,0)};var v,N=[];function B(){v=!0;for(var O,F,J=N.length;J;){for(F=N,N=[],O=-1;++O<J;)F[O]();J=N.length}v=!1}i.exports=M;function M(O){N.push(O)===1&&!v&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,i,o){"use strict";var s=r(1);function u(){}var l={},h=["REJECTED"],y=["FULFILLED"],p=["PENDING"];i.exports=E;function E(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,x!==u&&M(this,x)}E.prototype.catch=function(x){return this.then(null,x)},E.prototype.then=function(x,$){if(typeof x!="function"&&this.state===y||typeof $!="function"&&this.state===h)return this;var L=new this.constructor(u);if(this.state!==p){var j=this.state===y?x:$;N(L,j,this.outcome)}else this.queue.push(new v(L,x,$));return L};function v(x,$,L){this.promise=x,typeof $=="function"&&(this.onFulfilled=$,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(x){l.resolve(this.promise,x)},v.prototype.otherCallFulfilled=function(x){N(this.promise,this.onFulfilled,x)},v.prototype.callRejected=function(x){l.reject(this.promise,x)},v.prototype.otherCallRejected=function(x){N(this.promise,this.onRejected,x)};function N(x,$,L){s(function(){var j;try{j=$(L)}catch(re){return l.reject(x,re)}j===x?l.reject(x,new TypeError("Cannot resolve promise with itself")):l.resolve(x,j)})}l.resolve=function(x,$){var L=O(B,$);if(L.status==="error")return l.reject(x,L.value);var j=L.value;if(j)M(x,j);else{x.state=y,x.outcome=$;for(var re=-1,Q=x.queue.length;++re<Q;)x.queue[re].callFulfilled($)}return x},l.reject=function(x,$){x.state=h,x.outcome=$;for(var L=-1,j=x.queue.length;++L<j;)x.queue[L].callRejected($);return x};function B(x){var $=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof $=="function")return function(){$.apply(x,arguments)}}function M(x,$){var L=!1;function j(Oe){L||(L=!0,l.reject(x,Oe))}function re(Oe){L||(L=!0,l.resolve(x,Oe))}function Q(){$(re,j)}var de=O(Q);de.status==="error"&&j(de.value)}function O(x,$){var L={};try{L.value=x($),L.status="success"}catch(j){L.status="error",L.value=j}return L}E.resolve=F;function F(x){return x instanceof this?x:l.resolve(new this(u),x)}E.reject=J;function J(x){var $=new this(u);return l.reject($,x)}E.all=Ae;function Ae(x){var $=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=x.length,j=!1;if(!L)return this.resolve([]);for(var re=new Array(L),Q=0,de=-1,Oe=new this(u);++de<L;)Qe(x[de],de);return Oe;function Qe(dn,zn){$.resolve(dn).then(Qr,function(Ut){j||(j=!0,l.reject(Oe,Ut))});function Qr(Ut){re[zn]=Ut,++Q===L&&!j&&(j=!0,l.resolve(Oe,re))}}}E.race=Ne;function Ne(x){var $=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=x.length,j=!1;if(!L)return this.resolve([]);for(var re=-1,Q=new this(u);++re<L;)de(x[re]);return Q;function de(Oe){$.resolve(Oe).then(function(Qe){j||(j=!0,l.resolve(Q,Qe))},function(Qe){j||(j=!0,l.reject(Q,Qe))})}}},{1:1}],3:[function(r,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function u(a,d){if(!(a instanceof d))throw new TypeError("Cannot call a class as a function")}function l(){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 h=l();function y(){try{if(!h||!h.open)return!1;var a=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||d)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function p(a,d){a=a||[],d=d||{};try{return new Blob(a,d)}catch(f){if(f.name!=="TypeError")throw f;for(var c=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,m=new c,g=0;g<a.length;g+=1)m.append(a[g]);return m.getBlob(d.type)}}typeof Promise>"u"&&r(3);var E=Promise;function v(a,d){d&&a.then(function(c){d(null,c)},function(c){d(c)})}function N(a,d,c){typeof d=="function"&&a.then(d),typeof c=="function"&&a.catch(c)}function B(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function M(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var O="local-forage-detect-blob-support",F=void 0,J={},Ae=Object.prototype.toString,Ne="readonly",x="readwrite";function $(a){for(var d=a.length,c=new ArrayBuffer(d),m=new Uint8Array(c),g=0;g<d;g++)m[g]=a.charCodeAt(g);return c}function L(a){return new E(function(d){var c=a.transaction(O,x),m=p([""]);c.objectStore(O).put(m,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),d(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),f=navigator.userAgent.match(/Edge\//);d(f||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function j(a){return typeof F=="boolean"?E.resolve(F):L(a).then(function(d){return F=d,F})}function re(a){var d=J[a.name],c={};c.promise=new E(function(m,g){c.resolve=m,c.reject=g}),d.deferredOperations.push(c),d.dbReady?d.dbReady=d.dbReady.then(function(){return c.promise}):d.dbReady=c.promise}function Q(a){var d=J[a.name],c=d.deferredOperations.pop();if(c)return c.resolve(),c.promise}function de(a,d){var c=J[a.name],m=c.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Oe(a,d){return new E(function(c,m){if(J[a.name]=J[a.name]||ns(),a.db)if(d)re(a),a.db.close();else return c(a.db);var g=[a.name];d&&g.push(a.version);var f=h.open.apply(h,g);d&&(f.onupgradeneeded=function(b){var S=f.result;try{S.createObjectStore(a.storeName),b.oldVersion<=1&&S.createObjectStore(O)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+a.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+a.storeName+'" already exists.');else throw C}}),f.onerror=function(b){b.preventDefault(),m(f.error)},f.onsuccess=function(){var b=f.result;b.onversionchange=function(S){S.target.close()},c(b),Q(a)}})}function Qe(a){return Oe(a,!1)}function dn(a){return Oe(a,!0)}function zn(a,d){if(!a.db)return!0;var c=!a.db.objectStoreNames.contains(a.storeName),m=a.version<a.db.version,g=a.version>a.db.version;if(m&&(a.version!==d&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),g||c){if(c){var f=a.db.version+1;f>a.version&&(a.version=f)}return!0}return!1}function Qr(a){return new E(function(d,c){var m=new FileReader;m.onerror=c,m.onloadend=function(g){var f=btoa(g.target.result||"");d({__local_forage_encoded_blob:!0,data:f,type:a.type})},m.readAsBinaryString(a)})}function Ut(a){var d=$(atob(a.data));return p([d],{type:a.type})}function ts(a){return a&&a.__local_forage_encoded_blob}function Lu(a){var d=this,c=d._initReady().then(function(){var m=J[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return N(c,a,a),c}function Vu(a){re(a);for(var d=J[a.name],c=d.forages,m=0;m<c.length;m++){var g=c[m];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return a.db=null,Qe(a).then(function(f){return a.db=f,zn(a)?dn(a):f}).then(function(f){a.db=d.db=f;for(var b=0;b<c.length;b++)c[b]._dbInfo.db=f}).catch(function(f){throw de(a,f),f})}function Ze(a,d,c,m){m===void 0&&(m=1);try{var g=a.db.transaction(a.storeName,d);c(null,g)}catch(f){if(m>0&&(!a.db||f.name==="InvalidStateError"||f.name==="NotFoundError"))return E.resolve().then(function(){if(!a.db||f.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),dn(a)}).then(function(){return Vu(a).then(function(){Ze(a,d,c,m-1)})}).catch(c);c(f)}}function ns(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Fu(a){var d=this,c={db:null};if(a)for(var m in a)c[m]=a[m];var g=J[c.name];g||(g=ns(),J[c.name]=g),g.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=Lu);var f=[];function b(){return E.resolve()}for(var S=0;S<g.forages.length;S++){var C=g.forages[S];C!==d&&f.push(C._initReady().catch(b))}var I=g.forages.slice(0);return E.all(f).then(function(){return c.db=g.db,Qe(c)}).then(function(T){return c.db=T,zn(c,d._defaultConfig.version)?dn(c):T}).then(function(T){c.db=g.db=T,d._dbInfo=c;for(var A=0;A<I.length;A++){var k=I[A];k!==d&&(k._dbInfo.db=c.db,k._dbInfo.version=c.version)}})}function ku(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){Ze(c._dbInfo,Ne,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=C.get(a);I.onsuccess=function(){var T=I.result;T===void 0&&(T=null),ts(T)&&(T=Ut(T)),g(T)},I.onerror=function(){f(I.error)}}catch(T){f(T)}})}).catch(f)});return v(m,d),m}function Uu(a,d){var c=this,m=new E(function(g,f){c.ready().then(function(){Ze(c._dbInfo,Ne,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=C.openCursor(),T=1;I.onsuccess=function(){var A=I.result;if(A){var k=A.value;ts(k)&&(k=Ut(k));var W=a(k,A.key,T++);W!==void 0?g(W):A.continue()}else g()},I.onerror=function(){f(I.error)}}catch(A){f(A)}})}).catch(f)});return v(m,d),m}function Bu(a,d,c){var m=this;a=B(a);var g=new E(function(f,b){var S;m.ready().then(function(){return S=m._dbInfo,Ae.call(d)==="[object Blob]"?j(S.db).then(function(C){return C?d:Qr(d)}):d}).then(function(C){Ze(m._dbInfo,x,function(I,T){if(I)return b(I);try{var A=T.objectStore(m._dbInfo.storeName);C===null&&(C=void 0);var k=A.put(C,a);T.oncomplete=function(){C===void 0&&(C=null),f(C)},T.onabort=T.onerror=function(){var W=k.error?k.error:k.transaction.error;b(W)}}catch(W){b(W)}})}).catch(b)});return v(g,c),g}function Hu(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){Ze(c._dbInfo,x,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=C.delete(a);S.oncomplete=function(){g()},S.onerror=function(){f(I.error)},S.onabort=function(){var T=I.error?I.error:I.transaction.error;f(T)}}catch(T){f(T)}})}).catch(f)});return v(m,d),m}function Gu(a){var d=this,c=new E(function(m,g){d.ready().then(function(){Ze(d._dbInfo,x,function(f,b){if(f)return g(f);try{var S=b.objectStore(d._dbInfo.storeName),C=S.clear();b.oncomplete=function(){m()},b.onabort=b.onerror=function(){var I=C.error?C.error:C.transaction.error;g(I)}}catch(I){g(I)}})}).catch(g)});return v(c,a),c}function $u(a){var d=this,c=new E(function(m,g){d.ready().then(function(){Ze(d._dbInfo,Ne,function(f,b){if(f)return g(f);try{var S=b.objectStore(d._dbInfo.storeName),C=S.count();C.onsuccess=function(){m(C.result)},C.onerror=function(){g(C.error)}}catch(I){g(I)}})}).catch(g)});return v(c,a),c}function ju(a,d){var c=this,m=new E(function(g,f){if(a<0){g(null);return}c.ready().then(function(){Ze(c._dbInfo,Ne,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=!1,T=C.openKeyCursor();T.onsuccess=function(){var A=T.result;if(!A){g(null);return}a===0||I?g(A.key):(I=!0,A.advance(a))},T.onerror=function(){f(T.error)}}catch(A){f(A)}})}).catch(f)});return v(m,d),m}function Wu(a){var d=this,c=new E(function(m,g){d.ready().then(function(){Ze(d._dbInfo,Ne,function(f,b){if(f)return g(f);try{var S=b.objectStore(d._dbInfo.storeName),C=S.openKeyCursor(),I=[];C.onsuccess=function(){var T=C.result;if(!T){m(I);return}I.push(T.key),T.continue()},C.onerror=function(){g(C.error)}}catch(T){g(T)}})}).catch(g)});return v(c,a),c}function zu(a,d){d=M.apply(this,arguments);var c=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var m=this,g;if(!a.name)g=E.reject("Invalid arguments");else{var f=a.name===c.name&&m._dbInfo.db,b=f?E.resolve(m._dbInfo.db):Qe(a).then(function(S){var C=J[a.name],I=C.forages;C.db=S;for(var T=0;T<I.length;T++)I[T]._dbInfo.db=S;return S});a.storeName?g=b.then(function(S){if(S.objectStoreNames.contains(a.storeName)){var C=S.version+1;re(a);var I=J[a.name],T=I.forages;S.close();for(var A=0;A<T.length;A++){var k=T[A];k._dbInfo.db=null,k._dbInfo.version=C}var W=new E(function(z,oe){var ie=h.open(a.name,C);ie.onerror=function(Re){var pn=ie.result;pn.close(),oe(Re)},ie.onupgradeneeded=function(){var Re=ie.result;Re.deleteObjectStore(a.storeName)},ie.onsuccess=function(){var Re=ie.result;Re.close(),z(Re)}});return W.then(function(z){I.db=z;for(var oe=0;oe<T.length;oe++){var ie=T[oe];ie._dbInfo.db=z,Q(ie._dbInfo)}}).catch(function(z){throw(de(a,z)||E.resolve()).catch(function(){}),z})}}):g=b.then(function(S){re(a);var C=J[a.name],I=C.forages;S.close();for(var T=0;T<I.length;T++){var A=I[T];A._dbInfo.db=null}var k=new E(function(W,z){var oe=h.deleteDatabase(a.name);oe.onerror=function(){var ie=oe.result;ie&&ie.close(),z(oe.error)},oe.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},oe.onsuccess=function(){var ie=oe.result;ie&&ie.close(),W(ie)}});return k.then(function(W){C.db=W;for(var z=0;z<I.length;z++){var oe=I[z];Q(oe._dbInfo)}}).catch(function(W){throw(de(a,W)||E.resolve()).catch(function(){}),W})})}return v(g,d),g}var Yu={_driver:"asyncStorage",_initStorage:Fu,_support:y(),iterate:Uu,getItem:ku,setItem:Bu,removeItem:Hu,clear:Gu,length:$u,key:ju,keys:Wu,dropInstance:zu};function qu(){return typeof openDatabase=="function"}var mt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ku="~~local_forage_type~",rs=/^~~local_forage_type~([^~]+)~/,Yn="__lfsc__:",Zr=Yn.length,ei="arbf",ti="blob",is="si08",os="ui08",ss="uic8",as="si16",cs="si32",us="ur16",ls="ui32",ds="fl32",fs="fl64",ps=Zr+ei.length,ms=Object.prototype.toString;function hs(a){var d=a.length*.75,c=a.length,m,g=0,f,b,S,C;a[a.length-1]==="="&&(d--,a[a.length-2]==="="&&d--);var I=new ArrayBuffer(d),T=new Uint8Array(I);for(m=0;m<c;m+=4)f=mt.indexOf(a[m]),b=mt.indexOf(a[m+1]),S=mt.indexOf(a[m+2]),C=mt.indexOf(a[m+3]),T[g++]=f<<2|b>>4,T[g++]=(b&15)<<4|S>>2,T[g++]=(S&3)<<6|C&63;return I}function ni(a){var d=new Uint8Array(a),c="",m;for(m=0;m<d.length;m+=3)c+=mt[d[m]>>2],c+=mt[(d[m]&3)<<4|d[m+1]>>4],c+=mt[(d[m+1]&15)<<2|d[m+2]>>6],c+=mt[d[m+2]&63];return d.length%3===2?c=c.substring(0,c.length-1)+"=":d.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Xu(a,d){var c="";if(a&&(c=ms.call(a)),a&&(c==="[object ArrayBuffer]"||a.buffer&&ms.call(a.buffer)==="[object ArrayBuffer]")){var m,g=Yn;a instanceof ArrayBuffer?(m=a,g+=ei):(m=a.buffer,c==="[object Int8Array]"?g+=is:c==="[object Uint8Array]"?g+=os:c==="[object Uint8ClampedArray]"?g+=ss:c==="[object Int16Array]"?g+=as:c==="[object Uint16Array]"?g+=us:c==="[object Int32Array]"?g+=cs:c==="[object Uint32Array]"?g+=ls:c==="[object Float32Array]"?g+=ds:c==="[object Float64Array]"?g+=fs:d(new Error("Failed to get type for BinaryArray"))),d(g+ni(m))}else if(c==="[object Blob]"){var f=new FileReader;f.onload=function(){var b=Ku+a.type+"~"+ni(this.result);d(Yn+ti+b)},f.readAsArrayBuffer(a)}else try{d(JSON.stringify(a))}catch(b){console.error("Couldn't convert value into a JSON string: ",a),d(null,b)}}function Ju(a){if(a.substring(0,Zr)!==Yn)return JSON.parse(a);var d=a.substring(ps),c=a.substring(Zr,ps),m;if(c===ti&&rs.test(d)){var g=d.match(rs);m=g[1],d=d.substring(g[0].length)}var f=hs(d);switch(c){case ei:return f;case ti:return p([f],{type:m});case is:return new Int8Array(f);case os:return new Uint8Array(f);case ss:return new Uint8ClampedArray(f);case as:return new Int16Array(f);case us:return new Uint16Array(f);case cs:return new Int32Array(f);case ls:return new Uint32Array(f);case ds:return new Float32Array(f);case fs:return new Float64Array(f);default:throw new Error("Unkown type: "+c)}}var ri={serialize:Xu,deserialize:Ju,stringToBuffer:hs,bufferToString:ni};function gs(a,d,c,m){a.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function Qu(a){var d=this,c={db:null};if(a)for(var m in a)c[m]=typeof a[m]!="string"?a[m].toString():a[m];var g=new E(function(f,b){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(S){return b(S)}c.db.transaction(function(S){gs(S,c,function(){d._dbInfo=c,f()},function(C,I){b(I)})},b)});return c.serializer=ri,g}function ht(a,d,c,m,g,f){a.executeSql(c,m,g,function(b,S){S.code===S.SYNTAX_ERR?b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(C,I){I.rows.length?f(C,S):gs(C,d,function(){C.executeSql(c,m,g,f)},f)},f):f(b,S)},f)}function Zu(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"SELECT * FROM "+b.storeName+" WHERE key = ? LIMIT 1",[a],function(C,I){var T=I.rows.length?I.rows.item(0).value:null;T&&(T=b.serializer.deserialize(T)),g(T)},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function el(a,d){var c=this,m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"SELECT * FROM "+b.storeName,[],function(C,I){for(var T=I.rows,A=T.length,k=0;k<A;k++){var W=T.item(k),z=W.value;if(z&&(z=b.serializer.deserialize(z)),z=a(z,W.key,k+1),z!==void 0){g(z);return}}g()},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function _s(a,d,c,m){var g=this;a=B(a);var f=new E(function(b,S){g.ready().then(function(){d===void 0&&(d=null);var C=d,I=g._dbInfo;I.serializer.serialize(d,function(T,A){A?S(A):I.db.transaction(function(k){ht(k,I,"INSERT OR REPLACE INTO "+I.storeName+" (key, value) VALUES (?, ?)",[a,T],function(){b(C)},function(W,z){S(z)})},function(k){if(k.code===k.QUOTA_ERR){if(m>0){b(_s.apply(g,[a,C,c,m-1]));return}S(k)}})})}).catch(S)});return v(f,c),f}function tl(a,d,c){return _s.apply(this,[a,d,c,1])}function nl(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"DELETE FROM "+b.storeName+" WHERE key = ?",[a],function(){g()},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function rl(a){var d=this,c=new E(function(m,g){d.ready().then(function(){var f=d._dbInfo;f.db.transaction(function(b){ht(b,f,"DELETE FROM "+f.storeName,[],function(){m()},function(S,C){g(C)})})}).catch(g)});return v(c,a),c}function il(a){var d=this,c=new E(function(m,g){d.ready().then(function(){var f=d._dbInfo;f.db.transaction(function(b){ht(b,f,"SELECT COUNT(key) as c FROM "+f.storeName,[],function(S,C){var I=C.rows.item(0).c;m(I)},function(S,C){g(C)})})}).catch(g)});return v(c,a),c}function ol(a,d){var c=this,m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"SELECT key FROM "+b.storeName+" WHERE id = ? LIMIT 1",[a+1],function(C,I){var T=I.rows.length?I.rows.item(0).key:null;g(T)},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function sl(a){var d=this,c=new E(function(m,g){d.ready().then(function(){var f=d._dbInfo;f.db.transaction(function(b){ht(b,f,"SELECT key FROM "+f.storeName,[],function(S,C){for(var I=[],T=0;T<C.rows.length;T++)I.push(C.rows.item(T).key);m(I)},function(S,C){g(C)})})}).catch(g)});return v(c,a),c}function al(a){return new E(function(d,c){a.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,f){for(var b=[],S=0;S<f.rows.length;S++)b.push(f.rows.item(S).name);d({db:a,storeNames:b})},function(g,f){c(f)})},function(m){c(m)})})}function cl(a,d){d=M.apply(this,arguments);var c=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var m=this,g;return a.name?g=new E(function(f){var b;a.name===c.name?b=m._dbInfo.db:b=openDatabase(a.name,"","",0),a.storeName?f({db:b,storeNames:[a.storeName]}):f(al(b))}).then(function(f){return new E(function(b,S){f.db.transaction(function(C){function I(W){return new E(function(z,oe){C.executeSql("DROP TABLE IF EXISTS "+W,[],function(){z()},function(ie,Re){oe(Re)})})}for(var T=[],A=0,k=f.storeNames.length;A<k;A++)T.push(I(f.storeNames[A]));E.all(T).then(function(){b()}).catch(function(W){S(W)})},function(C){S(C)})})}):g=E.reject("Invalid arguments"),v(g,d),g}var ul={_driver:"webSQLStorage",_initStorage:Qu,_support:qu(),iterate:el,getItem:Zu,setItem:tl,removeItem:nl,clear:rl,length:il,key:ol,keys:sl,dropInstance:cl};function ll(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function vs(a,d){var c=a.name+"/";return a.storeName!==d.storeName&&(c+=a.storeName+"/"),c}function dl(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function fl(){return!dl()||localStorage.length>0}function pl(a){var d=this,c={};if(a)for(var m in a)c[m]=a[m];return c.keyPrefix=vs(a,d._defaultConfig),fl()?(d._dbInfo=c,c.serializer=ri,E.resolve()):E.reject()}function ml(a){var d=this,c=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var f=localStorage.key(g);f.indexOf(m)===0&&localStorage.removeItem(f)}});return v(c,a),c}function hl(a,d){var c=this;a=B(a);var m=c.ready().then(function(){var g=c._dbInfo,f=localStorage.getItem(g.keyPrefix+a);return f&&(f=g.serializer.deserialize(f)),f});return v(m,d),m}function gl(a,d){var c=this,m=c.ready().then(function(){for(var g=c._dbInfo,f=g.keyPrefix,b=f.length,S=localStorage.length,C=1,I=0;I<S;I++){var T=localStorage.key(I);if(T.indexOf(f)===0){var A=localStorage.getItem(T);if(A&&(A=g.serializer.deserialize(A)),A=a(A,T.substring(b),C++),A!==void 0)return A}}});return v(m,d),m}function _l(a,d){var c=this,m=c.ready().then(function(){var g=c._dbInfo,f;try{f=localStorage.key(a)}catch{f=null}return f&&(f=f.substring(g.keyPrefix.length)),f});return v(m,d),m}function vl(a){var d=this,c=d.ready().then(function(){for(var m=d._dbInfo,g=localStorage.length,f=[],b=0;b<g;b++){var S=localStorage.key(b);S.indexOf(m.keyPrefix)===0&&f.push(S.substring(m.keyPrefix.length))}return f});return v(c,a),c}function yl(a){var d=this,c=d.keys().then(function(m){return m.length});return v(c,a),c}function El(a,d){var c=this;a=B(a);var m=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+a)});return v(m,d),m}function bl(a,d,c){var m=this;a=B(a);var g=m.ready().then(function(){d===void 0&&(d=null);var f=d;return new E(function(b,S){var C=m._dbInfo;C.serializer.serialize(d,function(I,T){if(T)S(T);else try{localStorage.setItem(C.keyPrefix+a,I),b(f)}catch(A){(A.name==="QuotaExceededError"||A.name==="NS_ERROR_DOM_QUOTA_REACHED")&&S(A),S(A)}})})});return v(g,c),g}function Sl(a,d){if(d=M.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var c=this.config();a.name=a.name||c.name,a.storeName=a.storeName||c.storeName}var m=this,g;return a.name?g=new E(function(f){a.storeName?f(vs(a,m._defaultConfig)):f(a.name+"/")}).then(function(f){for(var b=localStorage.length-1;b>=0;b--){var S=localStorage.key(b);S.indexOf(f)===0&&localStorage.removeItem(S)}}):g=E.reject("Invalid arguments"),v(g,d),g}var Cl={_driver:"localStorageWrapper",_initStorage:pl,_support:ll(),iterate:gl,getItem:hl,setItem:bl,removeItem:El,clear:ml,length:yl,key:_l,keys:vl,dropInstance:Sl},Il=function(d,c){return d===c||typeof d=="number"&&typeof c=="number"&&isNaN(d)&&isNaN(c)},Tl=function(d,c){for(var m=d.length,g=0;g<m;){if(Il(d[g],c))return!0;g++}return!1},ys=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},fn={},Es={},Bt={INDEXEDDB:Yu,WEBSQL:ul,LOCALSTORAGE:Cl},xl=[Bt.INDEXEDDB._driver,Bt.WEBSQL._driver,Bt.LOCALSTORAGE._driver],qn=["dropInstance"],ii=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(qn),Dl={description:"",driver:xl.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function wl(a,d){a[d]=function(){var c=arguments;return a.ready().then(function(){return a[d].apply(a,c)})}}function oi(){for(var a=1;a<arguments.length;a++){var d=arguments[a];if(d)for(var c in d)d.hasOwnProperty(c)&&(ys(d[c])?arguments[0][c]=d[c].slice():arguments[0][c]=d[c])}return arguments[0]}var Al=(function(){function a(d){u(this,a);for(var c in Bt)if(Bt.hasOwnProperty(c)){var m=Bt[c],g=m._driver;this[c]=g,fn[g]||this.defineDriver(m)}this._defaultConfig=oi({},Dl),this._config=oi({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.prototype.config=function(c){if((typeof c>"u"?"undefined":s(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in c){if(m==="storeName"&&(c[m]=c[m].replace(/\W/g,"_")),m==="version"&&typeof c[m]!="number")return new Error("Database version must be a number.");this._config[m]=c[m]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},a.prototype.defineDriver=function(c,m,g){var f=new E(function(b,S){try{var C=c._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){S(I);return}for(var T=ii.concat("_initStorage"),A=0,k=T.length;A<k;A++){var W=T[A],z=!Tl(qn,W);if((z||c[W])&&typeof c[W]!="function"){S(I);return}}var oe=function(){for(var pn=function(Rl){return function(){var Ml=new Error("Method "+Rl+" is not implemented by the current driver"),bs=E.reject(Ml);return v(bs,arguments[arguments.length-1]),bs}},si=0,Ol=qn.length;si<Ol;si++){var ai=qn[si];c[ai]||(c[ai]=pn(ai))}};oe();var ie=function(pn){fn[C]&&console.info("Redefining LocalForage driver: "+C),fn[C]=c,Es[C]=pn,b()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,S):ie(!!c._support):ie(!0)}catch(Re){S(Re)}});return N(f,m,g),f},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(c,m,g){var f=fn[c]?E.resolve(fn[c]):E.reject(new Error("Driver not found."));return N(f,m,g),f},a.prototype.getSerializer=function(c){var m=E.resolve(ri);return N(m,c),m},a.prototype.ready=function(c){var m=this,g=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return N(g,c,c),g},a.prototype.setDriver=function(c,m,g){var f=this;ys(c)||(c=[c]);var b=this._getSupportedDrivers(c);function S(){f._config.driver=f.driver()}function C(A){return f._extend(A),S(),f._ready=f._initStorage(f._config),f._ready}function I(A){return function(){var k=0;function W(){for(;k<A.length;){var z=A[k];return k++,f._dbInfo=null,f._ready=null,f.getDriver(z).then(C).catch(W)}S();var oe=new Error("No available storage method found.");return f._driverSet=E.reject(oe),f._driverSet}return W()}}var T=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=T.then(function(){var A=b[0];return f._dbInfo=null,f._ready=null,f.getDriver(A).then(function(k){f._driver=k._driver,S(),f._wrapLibraryMethodsWithReady(),f._initDriver=I(b)})}).catch(function(){S();var A=new Error("No available storage method found.");return f._driverSet=E.reject(A),f._driverSet}),N(this._driverSet,m,g),this._driverSet},a.prototype.supports=function(c){return!!Es[c]},a.prototype._extend=function(c){oi(this,c)},a.prototype._getSupportedDrivers=function(c){for(var m=[],g=0,f=c.length;g<f;g++){var b=c[g];this.supports(b)&&m.push(b)}return m},a.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,m=ii.length;c<m;c++)wl(this,ii[c])},a.prototype.createInstance=function(c){return new a(c)},a})(),Nl=new Al;i.exports=Nl},{3:3}]},{},[4])(4)})});var yt=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(t){return t??={},this.gaEnabled=t.gaEnabled,this.gaMeasurementID=t.gaMeasurementID,this.pixelPush=t.pixelPush,this.website=t.website??{},this.currencyCount=t.currencyCount??0,this.money=t.money,this.currency=t.currency,this.storefrontToken=t.storefrontToken,this.skipItemAttribute=t.skipItemAttribute,this}};var Ws=0;function Vl(e=document.head){return zs(jt.styleURL,e,"cooee-global-styles")}function Fl(e=document.head){return zs(jt.swiperStyleURL,e,"cooee-swiper-styles")}function zs(e,t=document.head,n){return new Promise(r=>{if(t.querySelector(`#${n}`)){r();return}let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.id=n,o.onload=()=>{r()},o.onerror=()=>{console.error("Failed to load stylesheet:",e),r()},t.appendChild(o)})}function Cn(e,t=document.head){if(!e)return;Ws++;let n=document.createElement("style");n.id=`cooee-app-css-${Ws}`,n.textContent=e,t.appendChild(n)}async function Ys(){let e=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=e}async function qs(e,t=!0){if(!e)return;let n=[];t&&n.push(Fl(e)),n.push(Vl(e)),await Promise.all(n);let r=yt.get().website.commonCSS;Cn(r,e)}var Bl={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Bh=V(_({},Bl),{"[class.ng-submitted]":"isSubmitted"});var Hl=new xs("",{providedIn:"root",factory:()=>Ks}),Ks="always";var Gl=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=li({type:e});static \u0275inj=ui({})}return e})();var Xs=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:Hl,useValue:n.callSetDisabledState??Ks}]}}static \u0275fac=function(r){return new(r||e)};static \u0275mod=li({type:e});static \u0275inj=ui({imports:[Gl]})}return e})();var fi=(function(e){return e.SHOPIFY_CHECKOUT="shopify_checkout",e.THIRD_PARTY_CHECKOUT="third_party_checkout",e.CART_PAGE="cart_page",e.CART_DRAWER="cart_drawer",e})(fi||{});var at=(function(e){return e[e.NONE=0]="NONE",e[e.REJECT_POPUP=1]="REJECT_POPUP",e[e.ACCEPT_POPUP=2]="ACCEPT_POPUP",e[e.GO_TO_URL=4]="GO_TO_URL",e[e.SHARE=5]="SHARE",e[e.KEY_VALUE=100]="KEY_VALUE",e[e.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",e[e.ADD_TO_CART=102]="ADD_TO_CART",e[e.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",e[e.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",e[e.OPEN_CART=105]="OPEN_CART",e[e.SUBMIT_FORM=106]="SUBMIT_FORM",e[e.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",e[e.ADD_BUNDLE=108]="ADD_BUNDLE",e[e.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",e[e.BUY_NOW=110]="BUY_NOW",e[e.QUICK_VIEW=111]="QUICK_VIEW",e})(at||{});var $l=(function(e){return e.FREE_SHIPPING="FREE_SHIPPING",e.DISCOUNT="DISCOUNT",e.FREE_AUTO_GIFT="FREE_AUTO_GIFT",e.FREE_GIFT_SELECT="FREE_GIFT_SELECT",e.UI_ONLY="UI_ONLY",e})($l||{});var Et=class e{engagementContext=ge(Sn);eventData=ge(tr);constructor(){}executeCTA(t,n){let r,i=this.engagementContext();if(!i){he.error("Engagement context is not available; aborting executeCTA.");return}if(t===at.ADD_TO_CART)r="CE Add To Cart Clicked";else if(t===at.GO_TO_PRODUCT)r="CE View Item Clicked";else if(t===at.OPEN_CART)r="CE Open Cart Clicked",i.triggerData.redirectBehaviour=fi.CART_DRAWER;else{he.warn(`Unsupported CTA type: ${t}`);return}window.CooeeSDK.executeCTA(i,_({clickAction:{at:t}},n));let o=new $s(r,this.eventData.props,i.triggerData);n?.video?o.setVideos(n.video):this.eventData.video&&o.setVideos(this.eventData.video),window.CooeeSDK.sendEvent(o)}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ci({token:e,factory:e.\u0275fac})};function Js(e,t){return[Et,...jl(e,t)]}function jl(e,t){return[{provide:Sn,useValue:et(e)},{provide:tr,useValue:_({},t)}]}var rr=class e{elementRef=ge(gn);engagementService=ge(Et);hasSwiper=!1;_engagementTrigger=et(null);_triggerContext=ge(Sn);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let t=["letscooee-widget"],n=this._engagementTrigger();return t.push(`widget-${n?.shortID}`),t}get triggerContext(){return this._triggerContext()}set triggerContext(t){this._triggerContext.set(t),this._engagementTrigger.set(t.triggerData),this.engagementTriggerReceived(t.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){he.verbose("Init",this.constructor.name);let t=this.elementRef.nativeElement.shadowRoot;t&&(qs(t,this.hasSwiper),Cn(this.engagementTrigger?.content?.innerCSS,t))}ngOnDestroy(){he.verbose("Destroying",this.constructor.name)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=be({type:e,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&Qn(r.classes)},inputs:{triggerContext:"triggerContext"},decls:1,vars:0,template:function(n,r){n&1&&Os(0)},encapsulation:2})};var Qs=(e,t)=>t.id;function Wl(e,t){if(e&1&&(U(0,"span",6),te(1),H()),e&2){G();let n=_e(0);D(),it(n)}}function zl(e,t){if(e&1){let n=je();Fe(0),U(1,"button",5),Se("click",function(){let i=Te(n).$implicit,o=G().$implicit,s=G();return xe(s.onOptionChange(o,i))}),Z(2,Wl,2,1,"span",6),H()}if(e&2){let n=t.$implicit,r=G().$implicit,i=_e(1),o=G(),s=n.name,u=ke(n.displayName||n.name),l=n.swatch,h=i?n.hexColor??s:"",y=o.selectedOptions()[r.name]===s,p=!!(l!=null&&l.color),E=!!(!(l==null||l.image==null)&&l.image.url);D(),vn("swatch-color-type",p)("swatch-image-type",E)("selected",y)("disabled",n.disabled),K("title",u)("ngStyle",o.getSwatchStyles(l,h)),Ht("aria-checked",y?"true":"false")("data-value",s)("aria-disabled",n.disabled?"true":null)("aria-label",u),D(),ee(!i&&!p&&!E?2:-1)}}function Yl(e,t){if(e&1&&(U(0,"div"),Fe(1),U(2,"div",1),te(3),H(),U(4,"div",2),te(5),H(),U(6,"div",3),Gt(7,zl,3,16,"button",4,Qs),H()()),e&2){let n=t.$implicit,r=G();Qn(Zn("option-group ",n.name.toLowerCase())),D(),ke(r.hasHexColors(n)),D(2),wt("",n.name,":"),D(2),it(r.selectedOptions()[n.name]),D(),Ht("aria-label",n.name),D(),$t(n.optionValues)}}var In=e=>e.trim().toLowerCase(),ir=class e extends rr{selectedVariant=new _n;item=Ce.required();selectedOptions=et({});options=ot(()=>{let t=this.item();if(!t.options||t.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(t,this.engagementTrigger)}catch(n){he.error(n)}return t.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),t.options});matchedVariant=ot(()=>{let t=this.item(),n=this.selectedOptions();return t.vars.find(r=>t.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=ot(()=>{let t=this.item(),n=new Map;return t?.vars?.length&&t.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=In(o.name),u=o.value,l=n.get(s);l||n.set(s,l=new Map);let h=l.get(u);h||l.set(u,h=new Set),h.add(i)}}),n});constructor(){super(),At(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let t=At(()=>{let n=this.item();if(!n?.options)return;let r=_({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(u=>u.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),t.destroy()})}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.shadowRoot;if(!t)return;let n=yt.get().website?.itemSwatchMapping;n&&Cn(n,t)}onOptionChange(t,n){let r=_({},this.selectedOptions());r[t.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(t){return!!t.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getSwatchStyles(t,n){let r={};return!t&&n?(r["--option-color"]=n,r["background-color"]=n,r):(t?.image?.url?r["background-image"]=`url("${t.image.url}")`:t?.color&&(r["--option-color"]=t.color,r["background-color"]=t.color),r)}getCandidateVariantsExcluding(t){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,u)=>{s.isAvailable&&i.add(u)});let o=i;for(let[s,u]of Object.entries(this.selectedOptions())){if(In(s)===In(t))continue;let l=r.get(In(s));if(!l)return new Set;let h=l.get(String(u));if(!h)return new Set;if(o=new Set([...o].filter(y=>h.has(y))),o.size===0)return o}return o}isOptionValueDisabledFast(t,n){let i=this.availabilityIndex().get(In(t.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let u=this.getCandidateVariantsExcluding(t.name);if(u.size===0)return!0;for(let l of u)if(s.has(l))return!1;return!0}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=be({type:e,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[yn(Js()),di],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"swatch-color-type","swatch-image-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&Gt(0,Yl,9,7,"div",0,Qs),n&2&&$t(r.options())},dependencies:[Hs,Us,Xs],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px;scrollbar-gutter:stable both-edges;scrollbar-width:none}.option-values::-webkit-scrollbar{display:none}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;flex-shrink:0;--selected-color: var(--option-color, rgba(var(--lc-primary-button-bg-color, 0 0 0)));background-size:cover;background-position:center;background-repeat:no-repeat}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}.option-value.disabled{opacity:.5;pointer-events:none}
|
|
1
|
+
import{a as Gs,b as jt,c as he,e as Sn,f as tr,g as $s,h as js,l as Wt}from"./chunk-LUGFMRZ3.js";import{a as nr}from"./chunk-OG6WZFOM.js";import{$ as di,$a as er,Aa as Se,Ba as Ms,Ca as G,D as hn,Da as Ps,E as et,Ea as Ls,I as gn,K as Dt,Ka as rt,L as gt,Ma as vn,Na as Jn,O as D,Oa as Qn,Pa as te,Qa as it,Ra as wt,Va as Fe,Wa as ke,X as be,Xa as _e,Y as li,Ya as Vs,Za as Zn,_ as Ds,_a as yn,ab as Fs,b as Cs,ba as _t,bb as Ue,ca as _n,cb as Be,eb as En,ga as ws,gb as ot,ha as Ht,hb as At,ia as Z,ib as vt,ja as ee,jb as Ce,la as Gt,lb as bn,ma as $t,na as K,o as Is,oa as U,pa as H,q as Ts,qa as fe,ra as $e,rb as ks,s as ci,sa as tt,sb as Us,t as ui,ta as Xn,tb as Bs,u as xs,ua as As,v as ge,va as Ns,vb as Hs,wa as nt,x as Te,xa as Os,y as xe,ya as je,za as Rs}from"./chunk-I4NX4HQ6.js";import{a as _,b as V,c as mn,d as Ss,e as Pl,f as Ll,g as Kn}from"./chunk-V7UGKYBN.js";var ea=Pl((Zs,pi)=>{"use strict";(function(e){if(typeof Zs=="object"&&typeof pi<"u")pi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return(function r(i,o,s){function u(y,p){if(!o[y]){if(!i[y]){var E=typeof mn=="function"&&mn;if(!p&&E)return E(y,!0);if(l)return l(y,!0);var v=new Error("Cannot find module '"+y+"'");throw v.code="MODULE_NOT_FOUND",v}var N=o[y]={exports:{}};i[y][0].call(N.exports,function(B){var M=i[y][1][B];return u(M||B)},N,N.exports,r,i,o,s)}return o[y].exports}for(var l=typeof mn=="function"&&mn,h=0;h<s.length;h++)u(s[h]);return u})({1:[function(r,i,o){(function(s){"use strict";var u=s.MutationObserver||s.WebKitMutationObserver,l;if(u){var h=0,y=new u(B),p=s.document.createTextNode("");y.observe(p,{characterData:!0}),l=function(){p.data=h=++h%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=B,l=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var O=s.document.createElement("script");O.onreadystatechange=function(){B(),O.onreadystatechange=null,O.parentNode.removeChild(O),O=null},s.document.documentElement.appendChild(O)}:l=function(){setTimeout(B,0)};var v,N=[];function B(){v=!0;for(var O,F,J=N.length;J;){for(F=N,N=[],O=-1;++O<J;)F[O]();J=N.length}v=!1}i.exports=M;function M(O){N.push(O)===1&&!v&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,i,o){"use strict";var s=r(1);function u(){}var l={},h=["REJECTED"],y=["FULFILLED"],p=["PENDING"];i.exports=E;function E(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,x!==u&&M(this,x)}E.prototype.catch=function(x){return this.then(null,x)},E.prototype.then=function(x,$){if(typeof x!="function"&&this.state===y||typeof $!="function"&&this.state===h)return this;var L=new this.constructor(u);if(this.state!==p){var j=this.state===y?x:$;N(L,j,this.outcome)}else this.queue.push(new v(L,x,$));return L};function v(x,$,L){this.promise=x,typeof $=="function"&&(this.onFulfilled=$,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(x){l.resolve(this.promise,x)},v.prototype.otherCallFulfilled=function(x){N(this.promise,this.onFulfilled,x)},v.prototype.callRejected=function(x){l.reject(this.promise,x)},v.prototype.otherCallRejected=function(x){N(this.promise,this.onRejected,x)};function N(x,$,L){s(function(){var j;try{j=$(L)}catch(re){return l.reject(x,re)}j===x?l.reject(x,new TypeError("Cannot resolve promise with itself")):l.resolve(x,j)})}l.resolve=function(x,$){var L=O(B,$);if(L.status==="error")return l.reject(x,L.value);var j=L.value;if(j)M(x,j);else{x.state=y,x.outcome=$;for(var re=-1,Q=x.queue.length;++re<Q;)x.queue[re].callFulfilled($)}return x},l.reject=function(x,$){x.state=h,x.outcome=$;for(var L=-1,j=x.queue.length;++L<j;)x.queue[L].callRejected($);return x};function B(x){var $=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof $=="function")return function(){$.apply(x,arguments)}}function M(x,$){var L=!1;function j(Oe){L||(L=!0,l.reject(x,Oe))}function re(Oe){L||(L=!0,l.resolve(x,Oe))}function Q(){$(re,j)}var de=O(Q);de.status==="error"&&j(de.value)}function O(x,$){var L={};try{L.value=x($),L.status="success"}catch(j){L.status="error",L.value=j}return L}E.resolve=F;function F(x){return x instanceof this?x:l.resolve(new this(u),x)}E.reject=J;function J(x){var $=new this(u);return l.reject($,x)}E.all=Ae;function Ae(x){var $=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=x.length,j=!1;if(!L)return this.resolve([]);for(var re=new Array(L),Q=0,de=-1,Oe=new this(u);++de<L;)Qe(x[de],de);return Oe;function Qe(dn,zn){$.resolve(dn).then(Qr,function(Ut){j||(j=!0,l.reject(Oe,Ut))});function Qr(Ut){re[zn]=Ut,++Q===L&&!j&&(j=!0,l.resolve(Oe,re))}}}E.race=Ne;function Ne(x){var $=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=x.length,j=!1;if(!L)return this.resolve([]);for(var re=-1,Q=new this(u);++re<L;)de(x[re]);return Q;function de(Oe){$.resolve(Oe).then(function(Qe){j||(j=!0,l.resolve(Q,Qe))},function(Qe){j||(j=!0,l.reject(Q,Qe))})}}},{1:1}],3:[function(r,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function u(a,d){if(!(a instanceof d))throw new TypeError("Cannot call a class as a function")}function l(){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 h=l();function y(){try{if(!h||!h.open)return!1;var a=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||d)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function p(a,d){a=a||[],d=d||{};try{return new Blob(a,d)}catch(f){if(f.name!=="TypeError")throw f;for(var c=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,m=new c,g=0;g<a.length;g+=1)m.append(a[g]);return m.getBlob(d.type)}}typeof Promise>"u"&&r(3);var E=Promise;function v(a,d){d&&a.then(function(c){d(null,c)},function(c){d(c)})}function N(a,d,c){typeof d=="function"&&a.then(d),typeof c=="function"&&a.catch(c)}function B(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function M(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var O="local-forage-detect-blob-support",F=void 0,J={},Ae=Object.prototype.toString,Ne="readonly",x="readwrite";function $(a){for(var d=a.length,c=new ArrayBuffer(d),m=new Uint8Array(c),g=0;g<d;g++)m[g]=a.charCodeAt(g);return c}function L(a){return new E(function(d){var c=a.transaction(O,x),m=p([""]);c.objectStore(O).put(m,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),d(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),f=navigator.userAgent.match(/Edge\//);d(f||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function j(a){return typeof F=="boolean"?E.resolve(F):L(a).then(function(d){return F=d,F})}function re(a){var d=J[a.name],c={};c.promise=new E(function(m,g){c.resolve=m,c.reject=g}),d.deferredOperations.push(c),d.dbReady?d.dbReady=d.dbReady.then(function(){return c.promise}):d.dbReady=c.promise}function Q(a){var d=J[a.name],c=d.deferredOperations.pop();if(c)return c.resolve(),c.promise}function de(a,d){var c=J[a.name],m=c.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Oe(a,d){return new E(function(c,m){if(J[a.name]=J[a.name]||ns(),a.db)if(d)re(a),a.db.close();else return c(a.db);var g=[a.name];d&&g.push(a.version);var f=h.open.apply(h,g);d&&(f.onupgradeneeded=function(b){var S=f.result;try{S.createObjectStore(a.storeName),b.oldVersion<=1&&S.createObjectStore(O)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+a.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+a.storeName+'" already exists.');else throw C}}),f.onerror=function(b){b.preventDefault(),m(f.error)},f.onsuccess=function(){var b=f.result;b.onversionchange=function(S){S.target.close()},c(b),Q(a)}})}function Qe(a){return Oe(a,!1)}function dn(a){return Oe(a,!0)}function zn(a,d){if(!a.db)return!0;var c=!a.db.objectStoreNames.contains(a.storeName),m=a.version<a.db.version,g=a.version>a.db.version;if(m&&(a.version!==d&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),g||c){if(c){var f=a.db.version+1;f>a.version&&(a.version=f)}return!0}return!1}function Qr(a){return new E(function(d,c){var m=new FileReader;m.onerror=c,m.onloadend=function(g){var f=btoa(g.target.result||"");d({__local_forage_encoded_blob:!0,data:f,type:a.type})},m.readAsBinaryString(a)})}function Ut(a){var d=$(atob(a.data));return p([d],{type:a.type})}function ts(a){return a&&a.__local_forage_encoded_blob}function Lu(a){var d=this,c=d._initReady().then(function(){var m=J[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return N(c,a,a),c}function Vu(a){re(a);for(var d=J[a.name],c=d.forages,m=0;m<c.length;m++){var g=c[m];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return a.db=null,Qe(a).then(function(f){return a.db=f,zn(a)?dn(a):f}).then(function(f){a.db=d.db=f;for(var b=0;b<c.length;b++)c[b]._dbInfo.db=f}).catch(function(f){throw de(a,f),f})}function Ze(a,d,c,m){m===void 0&&(m=1);try{var g=a.db.transaction(a.storeName,d);c(null,g)}catch(f){if(m>0&&(!a.db||f.name==="InvalidStateError"||f.name==="NotFoundError"))return E.resolve().then(function(){if(!a.db||f.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),dn(a)}).then(function(){return Vu(a).then(function(){Ze(a,d,c,m-1)})}).catch(c);c(f)}}function ns(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Fu(a){var d=this,c={db:null};if(a)for(var m in a)c[m]=a[m];var g=J[c.name];g||(g=ns(),J[c.name]=g),g.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=Lu);var f=[];function b(){return E.resolve()}for(var S=0;S<g.forages.length;S++){var C=g.forages[S];C!==d&&f.push(C._initReady().catch(b))}var I=g.forages.slice(0);return E.all(f).then(function(){return c.db=g.db,Qe(c)}).then(function(T){return c.db=T,zn(c,d._defaultConfig.version)?dn(c):T}).then(function(T){c.db=g.db=T,d._dbInfo=c;for(var A=0;A<I.length;A++){var k=I[A];k!==d&&(k._dbInfo.db=c.db,k._dbInfo.version=c.version)}})}function ku(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){Ze(c._dbInfo,Ne,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=C.get(a);I.onsuccess=function(){var T=I.result;T===void 0&&(T=null),ts(T)&&(T=Ut(T)),g(T)},I.onerror=function(){f(I.error)}}catch(T){f(T)}})}).catch(f)});return v(m,d),m}function Uu(a,d){var c=this,m=new E(function(g,f){c.ready().then(function(){Ze(c._dbInfo,Ne,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=C.openCursor(),T=1;I.onsuccess=function(){var A=I.result;if(A){var k=A.value;ts(k)&&(k=Ut(k));var W=a(k,A.key,T++);W!==void 0?g(W):A.continue()}else g()},I.onerror=function(){f(I.error)}}catch(A){f(A)}})}).catch(f)});return v(m,d),m}function Bu(a,d,c){var m=this;a=B(a);var g=new E(function(f,b){var S;m.ready().then(function(){return S=m._dbInfo,Ae.call(d)==="[object Blob]"?j(S.db).then(function(C){return C?d:Qr(d)}):d}).then(function(C){Ze(m._dbInfo,x,function(I,T){if(I)return b(I);try{var A=T.objectStore(m._dbInfo.storeName);C===null&&(C=void 0);var k=A.put(C,a);T.oncomplete=function(){C===void 0&&(C=null),f(C)},T.onabort=T.onerror=function(){var W=k.error?k.error:k.transaction.error;b(W)}}catch(W){b(W)}})}).catch(b)});return v(g,c),g}function Hu(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){Ze(c._dbInfo,x,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=C.delete(a);S.oncomplete=function(){g()},S.onerror=function(){f(I.error)},S.onabort=function(){var T=I.error?I.error:I.transaction.error;f(T)}}catch(T){f(T)}})}).catch(f)});return v(m,d),m}function Gu(a){var d=this,c=new E(function(m,g){d.ready().then(function(){Ze(d._dbInfo,x,function(f,b){if(f)return g(f);try{var S=b.objectStore(d._dbInfo.storeName),C=S.clear();b.oncomplete=function(){m()},b.onabort=b.onerror=function(){var I=C.error?C.error:C.transaction.error;g(I)}}catch(I){g(I)}})}).catch(g)});return v(c,a),c}function $u(a){var d=this,c=new E(function(m,g){d.ready().then(function(){Ze(d._dbInfo,Ne,function(f,b){if(f)return g(f);try{var S=b.objectStore(d._dbInfo.storeName),C=S.count();C.onsuccess=function(){m(C.result)},C.onerror=function(){g(C.error)}}catch(I){g(I)}})}).catch(g)});return v(c,a),c}function ju(a,d){var c=this,m=new E(function(g,f){if(a<0){g(null);return}c.ready().then(function(){Ze(c._dbInfo,Ne,function(b,S){if(b)return f(b);try{var C=S.objectStore(c._dbInfo.storeName),I=!1,T=C.openKeyCursor();T.onsuccess=function(){var A=T.result;if(!A){g(null);return}a===0||I?g(A.key):(I=!0,A.advance(a))},T.onerror=function(){f(T.error)}}catch(A){f(A)}})}).catch(f)});return v(m,d),m}function Wu(a){var d=this,c=new E(function(m,g){d.ready().then(function(){Ze(d._dbInfo,Ne,function(f,b){if(f)return g(f);try{var S=b.objectStore(d._dbInfo.storeName),C=S.openKeyCursor(),I=[];C.onsuccess=function(){var T=C.result;if(!T){m(I);return}I.push(T.key),T.continue()},C.onerror=function(){g(C.error)}}catch(T){g(T)}})}).catch(g)});return v(c,a),c}function zu(a,d){d=M.apply(this,arguments);var c=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var m=this,g;if(!a.name)g=E.reject("Invalid arguments");else{var f=a.name===c.name&&m._dbInfo.db,b=f?E.resolve(m._dbInfo.db):Qe(a).then(function(S){var C=J[a.name],I=C.forages;C.db=S;for(var T=0;T<I.length;T++)I[T]._dbInfo.db=S;return S});a.storeName?g=b.then(function(S){if(S.objectStoreNames.contains(a.storeName)){var C=S.version+1;re(a);var I=J[a.name],T=I.forages;S.close();for(var A=0;A<T.length;A++){var k=T[A];k._dbInfo.db=null,k._dbInfo.version=C}var W=new E(function(z,oe){var ie=h.open(a.name,C);ie.onerror=function(Re){var pn=ie.result;pn.close(),oe(Re)},ie.onupgradeneeded=function(){var Re=ie.result;Re.deleteObjectStore(a.storeName)},ie.onsuccess=function(){var Re=ie.result;Re.close(),z(Re)}});return W.then(function(z){I.db=z;for(var oe=0;oe<T.length;oe++){var ie=T[oe];ie._dbInfo.db=z,Q(ie._dbInfo)}}).catch(function(z){throw(de(a,z)||E.resolve()).catch(function(){}),z})}}):g=b.then(function(S){re(a);var C=J[a.name],I=C.forages;S.close();for(var T=0;T<I.length;T++){var A=I[T];A._dbInfo.db=null}var k=new E(function(W,z){var oe=h.deleteDatabase(a.name);oe.onerror=function(){var ie=oe.result;ie&&ie.close(),z(oe.error)},oe.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},oe.onsuccess=function(){var ie=oe.result;ie&&ie.close(),W(ie)}});return k.then(function(W){C.db=W;for(var z=0;z<I.length;z++){var oe=I[z];Q(oe._dbInfo)}}).catch(function(W){throw(de(a,W)||E.resolve()).catch(function(){}),W})})}return v(g,d),g}var Yu={_driver:"asyncStorage",_initStorage:Fu,_support:y(),iterate:Uu,getItem:ku,setItem:Bu,removeItem:Hu,clear:Gu,length:$u,key:ju,keys:Wu,dropInstance:zu};function qu(){return typeof openDatabase=="function"}var mt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ku="~~local_forage_type~",rs=/^~~local_forage_type~([^~]+)~/,Yn="__lfsc__:",Zr=Yn.length,ei="arbf",ti="blob",is="si08",os="ui08",ss="uic8",as="si16",cs="si32",us="ur16",ls="ui32",ds="fl32",fs="fl64",ps=Zr+ei.length,ms=Object.prototype.toString;function hs(a){var d=a.length*.75,c=a.length,m,g=0,f,b,S,C;a[a.length-1]==="="&&(d--,a[a.length-2]==="="&&d--);var I=new ArrayBuffer(d),T=new Uint8Array(I);for(m=0;m<c;m+=4)f=mt.indexOf(a[m]),b=mt.indexOf(a[m+1]),S=mt.indexOf(a[m+2]),C=mt.indexOf(a[m+3]),T[g++]=f<<2|b>>4,T[g++]=(b&15)<<4|S>>2,T[g++]=(S&3)<<6|C&63;return I}function ni(a){var d=new Uint8Array(a),c="",m;for(m=0;m<d.length;m+=3)c+=mt[d[m]>>2],c+=mt[(d[m]&3)<<4|d[m+1]>>4],c+=mt[(d[m+1]&15)<<2|d[m+2]>>6],c+=mt[d[m+2]&63];return d.length%3===2?c=c.substring(0,c.length-1)+"=":d.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Xu(a,d){var c="";if(a&&(c=ms.call(a)),a&&(c==="[object ArrayBuffer]"||a.buffer&&ms.call(a.buffer)==="[object ArrayBuffer]")){var m,g=Yn;a instanceof ArrayBuffer?(m=a,g+=ei):(m=a.buffer,c==="[object Int8Array]"?g+=is:c==="[object Uint8Array]"?g+=os:c==="[object Uint8ClampedArray]"?g+=ss:c==="[object Int16Array]"?g+=as:c==="[object Uint16Array]"?g+=us:c==="[object Int32Array]"?g+=cs:c==="[object Uint32Array]"?g+=ls:c==="[object Float32Array]"?g+=ds:c==="[object Float64Array]"?g+=fs:d(new Error("Failed to get type for BinaryArray"))),d(g+ni(m))}else if(c==="[object Blob]"){var f=new FileReader;f.onload=function(){var b=Ku+a.type+"~"+ni(this.result);d(Yn+ti+b)},f.readAsArrayBuffer(a)}else try{d(JSON.stringify(a))}catch(b){console.error("Couldn't convert value into a JSON string: ",a),d(null,b)}}function Ju(a){if(a.substring(0,Zr)!==Yn)return JSON.parse(a);var d=a.substring(ps),c=a.substring(Zr,ps),m;if(c===ti&&rs.test(d)){var g=d.match(rs);m=g[1],d=d.substring(g[0].length)}var f=hs(d);switch(c){case ei:return f;case ti:return p([f],{type:m});case is:return new Int8Array(f);case os:return new Uint8Array(f);case ss:return new Uint8ClampedArray(f);case as:return new Int16Array(f);case us:return new Uint16Array(f);case cs:return new Int32Array(f);case ls:return new Uint32Array(f);case ds:return new Float32Array(f);case fs:return new Float64Array(f);default:throw new Error("Unkown type: "+c)}}var ri={serialize:Xu,deserialize:Ju,stringToBuffer:hs,bufferToString:ni};function gs(a,d,c,m){a.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function Qu(a){var d=this,c={db:null};if(a)for(var m in a)c[m]=typeof a[m]!="string"?a[m].toString():a[m];var g=new E(function(f,b){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(S){return b(S)}c.db.transaction(function(S){gs(S,c,function(){d._dbInfo=c,f()},function(C,I){b(I)})},b)});return c.serializer=ri,g}function ht(a,d,c,m,g,f){a.executeSql(c,m,g,function(b,S){S.code===S.SYNTAX_ERR?b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(C,I){I.rows.length?f(C,S):gs(C,d,function(){C.executeSql(c,m,g,f)},f)},f):f(b,S)},f)}function Zu(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"SELECT * FROM "+b.storeName+" WHERE key = ? LIMIT 1",[a],function(C,I){var T=I.rows.length?I.rows.item(0).value:null;T&&(T=b.serializer.deserialize(T)),g(T)},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function el(a,d){var c=this,m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"SELECT * FROM "+b.storeName,[],function(C,I){for(var T=I.rows,A=T.length,k=0;k<A;k++){var W=T.item(k),z=W.value;if(z&&(z=b.serializer.deserialize(z)),z=a(z,W.key,k+1),z!==void 0){g(z);return}}g()},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function _s(a,d,c,m){var g=this;a=B(a);var f=new E(function(b,S){g.ready().then(function(){d===void 0&&(d=null);var C=d,I=g._dbInfo;I.serializer.serialize(d,function(T,A){A?S(A):I.db.transaction(function(k){ht(k,I,"INSERT OR REPLACE INTO "+I.storeName+" (key, value) VALUES (?, ?)",[a,T],function(){b(C)},function(W,z){S(z)})},function(k){if(k.code===k.QUOTA_ERR){if(m>0){b(_s.apply(g,[a,C,c,m-1]));return}S(k)}})})}).catch(S)});return v(f,c),f}function tl(a,d,c){return _s.apply(this,[a,d,c,1])}function nl(a,d){var c=this;a=B(a);var m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"DELETE FROM "+b.storeName+" WHERE key = ?",[a],function(){g()},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function rl(a){var d=this,c=new E(function(m,g){d.ready().then(function(){var f=d._dbInfo;f.db.transaction(function(b){ht(b,f,"DELETE FROM "+f.storeName,[],function(){m()},function(S,C){g(C)})})}).catch(g)});return v(c,a),c}function il(a){var d=this,c=new E(function(m,g){d.ready().then(function(){var f=d._dbInfo;f.db.transaction(function(b){ht(b,f,"SELECT COUNT(key) as c FROM "+f.storeName,[],function(S,C){var I=C.rows.item(0).c;m(I)},function(S,C){g(C)})})}).catch(g)});return v(c,a),c}function ol(a,d){var c=this,m=new E(function(g,f){c.ready().then(function(){var b=c._dbInfo;b.db.transaction(function(S){ht(S,b,"SELECT key FROM "+b.storeName+" WHERE id = ? LIMIT 1",[a+1],function(C,I){var T=I.rows.length?I.rows.item(0).key:null;g(T)},function(C,I){f(I)})})}).catch(f)});return v(m,d),m}function sl(a){var d=this,c=new E(function(m,g){d.ready().then(function(){var f=d._dbInfo;f.db.transaction(function(b){ht(b,f,"SELECT key FROM "+f.storeName,[],function(S,C){for(var I=[],T=0;T<C.rows.length;T++)I.push(C.rows.item(T).key);m(I)},function(S,C){g(C)})})}).catch(g)});return v(c,a),c}function al(a){return new E(function(d,c){a.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,f){for(var b=[],S=0;S<f.rows.length;S++)b.push(f.rows.item(S).name);d({db:a,storeNames:b})},function(g,f){c(f)})},function(m){c(m)})})}function cl(a,d){d=M.apply(this,arguments);var c=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||c.name,a.storeName=a.storeName||c.storeName);var m=this,g;return a.name?g=new E(function(f){var b;a.name===c.name?b=m._dbInfo.db:b=openDatabase(a.name,"","",0),a.storeName?f({db:b,storeNames:[a.storeName]}):f(al(b))}).then(function(f){return new E(function(b,S){f.db.transaction(function(C){function I(W){return new E(function(z,oe){C.executeSql("DROP TABLE IF EXISTS "+W,[],function(){z()},function(ie,Re){oe(Re)})})}for(var T=[],A=0,k=f.storeNames.length;A<k;A++)T.push(I(f.storeNames[A]));E.all(T).then(function(){b()}).catch(function(W){S(W)})},function(C){S(C)})})}):g=E.reject("Invalid arguments"),v(g,d),g}var ul={_driver:"webSQLStorage",_initStorage:Qu,_support:qu(),iterate:el,getItem:Zu,setItem:tl,removeItem:nl,clear:rl,length:il,key:ol,keys:sl,dropInstance:cl};function ll(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function vs(a,d){var c=a.name+"/";return a.storeName!==d.storeName&&(c+=a.storeName+"/"),c}function dl(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function fl(){return!dl()||localStorage.length>0}function pl(a){var d=this,c={};if(a)for(var m in a)c[m]=a[m];return c.keyPrefix=vs(a,d._defaultConfig),fl()?(d._dbInfo=c,c.serializer=ri,E.resolve()):E.reject()}function ml(a){var d=this,c=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var f=localStorage.key(g);f.indexOf(m)===0&&localStorage.removeItem(f)}});return v(c,a),c}function hl(a,d){var c=this;a=B(a);var m=c.ready().then(function(){var g=c._dbInfo,f=localStorage.getItem(g.keyPrefix+a);return f&&(f=g.serializer.deserialize(f)),f});return v(m,d),m}function gl(a,d){var c=this,m=c.ready().then(function(){for(var g=c._dbInfo,f=g.keyPrefix,b=f.length,S=localStorage.length,C=1,I=0;I<S;I++){var T=localStorage.key(I);if(T.indexOf(f)===0){var A=localStorage.getItem(T);if(A&&(A=g.serializer.deserialize(A)),A=a(A,T.substring(b),C++),A!==void 0)return A}}});return v(m,d),m}function _l(a,d){var c=this,m=c.ready().then(function(){var g=c._dbInfo,f;try{f=localStorage.key(a)}catch{f=null}return f&&(f=f.substring(g.keyPrefix.length)),f});return v(m,d),m}function vl(a){var d=this,c=d.ready().then(function(){for(var m=d._dbInfo,g=localStorage.length,f=[],b=0;b<g;b++){var S=localStorage.key(b);S.indexOf(m.keyPrefix)===0&&f.push(S.substring(m.keyPrefix.length))}return f});return v(c,a),c}function yl(a){var d=this,c=d.keys().then(function(m){return m.length});return v(c,a),c}function El(a,d){var c=this;a=B(a);var m=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+a)});return v(m,d),m}function bl(a,d,c){var m=this;a=B(a);var g=m.ready().then(function(){d===void 0&&(d=null);var f=d;return new E(function(b,S){var C=m._dbInfo;C.serializer.serialize(d,function(I,T){if(T)S(T);else try{localStorage.setItem(C.keyPrefix+a,I),b(f)}catch(A){(A.name==="QuotaExceededError"||A.name==="NS_ERROR_DOM_QUOTA_REACHED")&&S(A),S(A)}})})});return v(g,c),g}function Sl(a,d){if(d=M.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var c=this.config();a.name=a.name||c.name,a.storeName=a.storeName||c.storeName}var m=this,g;return a.name?g=new E(function(f){a.storeName?f(vs(a,m._defaultConfig)):f(a.name+"/")}).then(function(f){for(var b=localStorage.length-1;b>=0;b--){var S=localStorage.key(b);S.indexOf(f)===0&&localStorage.removeItem(S)}}):g=E.reject("Invalid arguments"),v(g,d),g}var Cl={_driver:"localStorageWrapper",_initStorage:pl,_support:ll(),iterate:gl,getItem:hl,setItem:bl,removeItem:El,clear:ml,length:yl,key:_l,keys:vl,dropInstance:Sl},Il=function(d,c){return d===c||typeof d=="number"&&typeof c=="number"&&isNaN(d)&&isNaN(c)},Tl=function(d,c){for(var m=d.length,g=0;g<m;){if(Il(d[g],c))return!0;g++}return!1},ys=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},fn={},Es={},Bt={INDEXEDDB:Yu,WEBSQL:ul,LOCALSTORAGE:Cl},xl=[Bt.INDEXEDDB._driver,Bt.WEBSQL._driver,Bt.LOCALSTORAGE._driver],qn=["dropInstance"],ii=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(qn),Dl={description:"",driver:xl.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function wl(a,d){a[d]=function(){var c=arguments;return a.ready().then(function(){return a[d].apply(a,c)})}}function oi(){for(var a=1;a<arguments.length;a++){var d=arguments[a];if(d)for(var c in d)d.hasOwnProperty(c)&&(ys(d[c])?arguments[0][c]=d[c].slice():arguments[0][c]=d[c])}return arguments[0]}var Al=(function(){function a(d){u(this,a);for(var c in Bt)if(Bt.hasOwnProperty(c)){var m=Bt[c],g=m._driver;this[c]=g,fn[g]||this.defineDriver(m)}this._defaultConfig=oi({},Dl),this._config=oi({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.prototype.config=function(c){if((typeof c>"u"?"undefined":s(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in c){if(m==="storeName"&&(c[m]=c[m].replace(/\W/g,"_")),m==="version"&&typeof c[m]!="number")return new Error("Database version must be a number.");this._config[m]=c[m]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},a.prototype.defineDriver=function(c,m,g){var f=new E(function(b,S){try{var C=c._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){S(I);return}for(var T=ii.concat("_initStorage"),A=0,k=T.length;A<k;A++){var W=T[A],z=!Tl(qn,W);if((z||c[W])&&typeof c[W]!="function"){S(I);return}}var oe=function(){for(var pn=function(Rl){return function(){var Ml=new Error("Method "+Rl+" is not implemented by the current driver"),bs=E.reject(Ml);return v(bs,arguments[arguments.length-1]),bs}},si=0,Ol=qn.length;si<Ol;si++){var ai=qn[si];c[ai]||(c[ai]=pn(ai))}};oe();var ie=function(pn){fn[C]&&console.info("Redefining LocalForage driver: "+C),fn[C]=c,Es[C]=pn,b()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,S):ie(!!c._support):ie(!0)}catch(Re){S(Re)}});return N(f,m,g),f},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(c,m,g){var f=fn[c]?E.resolve(fn[c]):E.reject(new Error("Driver not found."));return N(f,m,g),f},a.prototype.getSerializer=function(c){var m=E.resolve(ri);return N(m,c),m},a.prototype.ready=function(c){var m=this,g=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return N(g,c,c),g},a.prototype.setDriver=function(c,m,g){var f=this;ys(c)||(c=[c]);var b=this._getSupportedDrivers(c);function S(){f._config.driver=f.driver()}function C(A){return f._extend(A),S(),f._ready=f._initStorage(f._config),f._ready}function I(A){return function(){var k=0;function W(){for(;k<A.length;){var z=A[k];return k++,f._dbInfo=null,f._ready=null,f.getDriver(z).then(C).catch(W)}S();var oe=new Error("No available storage method found.");return f._driverSet=E.reject(oe),f._driverSet}return W()}}var T=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=T.then(function(){var A=b[0];return f._dbInfo=null,f._ready=null,f.getDriver(A).then(function(k){f._driver=k._driver,S(),f._wrapLibraryMethodsWithReady(),f._initDriver=I(b)})}).catch(function(){S();var A=new Error("No available storage method found.");return f._driverSet=E.reject(A),f._driverSet}),N(this._driverSet,m,g),this._driverSet},a.prototype.supports=function(c){return!!Es[c]},a.prototype._extend=function(c){oi(this,c)},a.prototype._getSupportedDrivers=function(c){for(var m=[],g=0,f=c.length;g<f;g++){var b=c[g];this.supports(b)&&m.push(b)}return m},a.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,m=ii.length;c<m;c++)wl(this,ii[c])},a.prototype.createInstance=function(c){return new a(c)},a})(),Nl=new Al;i.exports=Nl},{3:3}]},{},[4])(4)})});var yt=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(t){return t??={},this.gaEnabled=t.gaEnabled,this.gaMeasurementID=t.gaMeasurementID,this.pixelPush=t.pixelPush,this.website=t.website??{},this.currencyCount=t.currencyCount??0,this.money=t.money,this.currency=t.currency,this.storefrontToken=t.storefrontToken,this.skipItemAttribute=t.skipItemAttribute,this}};var Ws=0;function Vl(e=document.head){return zs(jt.styleURL,e,"cooee-global-styles")}function Fl(e=document.head){return zs(jt.swiperStyleURL,e,"cooee-swiper-styles")}function zs(e,t=document.head,n){return new Promise(r=>{if(t.querySelector(`#${n}`)){r();return}let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.id=n,o.onload=()=>{r()},o.onerror=()=>{console.error("Failed to load stylesheet:",e),r()},t.appendChild(o)})}function Cn(e,t=document.head){if(!e)return;Ws++;let n=document.createElement("style");n.id=`cooee-app-css-${Ws}`,n.textContent=e,t.appendChild(n)}async function Ys(){let e=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=e}async function qs(e,t=!0){if(!e)return;let n=[];t&&n.push(Fl(e)),n.push(Vl(e)),await Promise.all(n);let r=yt.get().website.commonCSS;Cn(r,e)}var Bl={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Bh=V(_({},Bl),{"[class.ng-submitted]":"isSubmitted"});var Hl=new xs("",{providedIn:"root",factory:()=>Ks}),Ks="always";var Gl=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=li({type:e});static \u0275inj=ui({})}return e})();var Xs=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:Hl,useValue:n.callSetDisabledState??Ks}]}}static \u0275fac=function(r){return new(r||e)};static \u0275mod=li({type:e});static \u0275inj=ui({imports:[Gl]})}return e})();var fi=(function(e){return e.SHOPIFY_CHECKOUT="shopify_checkout",e.THIRD_PARTY_CHECKOUT="third_party_checkout",e.CART_PAGE="cart_page",e.CART_DRAWER="cart_drawer",e})(fi||{});var at=(function(e){return e[e.NONE=0]="NONE",e[e.REJECT_POPUP=1]="REJECT_POPUP",e[e.ACCEPT_POPUP=2]="ACCEPT_POPUP",e[e.GO_TO_URL=4]="GO_TO_URL",e[e.SHARE=5]="SHARE",e[e.KEY_VALUE=100]="KEY_VALUE",e[e.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",e[e.ADD_TO_CART=102]="ADD_TO_CART",e[e.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",e[e.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",e[e.OPEN_CART=105]="OPEN_CART",e[e.SUBMIT_FORM=106]="SUBMIT_FORM",e[e.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",e[e.ADD_BUNDLE=108]="ADD_BUNDLE",e[e.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",e[e.BUY_NOW=110]="BUY_NOW",e[e.QUICK_VIEW=111]="QUICK_VIEW",e})(at||{});var $l=(function(e){return e.FREE_SHIPPING="FREE_SHIPPING",e.DISCOUNT="DISCOUNT",e.FREE_AUTO_GIFT="FREE_AUTO_GIFT",e.FREE_GIFT_SELECT="FREE_GIFT_SELECT",e.UI_ONLY="UI_ONLY",e})($l||{});var Et=class e{engagementContext=ge(Sn);eventData=ge(tr);constructor(){}executeCTA(t,n){let r,i=this.engagementContext();if(!i){he.error("Engagement context is not available; aborting executeCTA.");return}if(t===at.ADD_TO_CART)r="CE Add To Cart Clicked";else if(t===at.GO_TO_PRODUCT)r="CE View Item Clicked";else if(t===at.OPEN_CART)r="CE Open Cart Clicked",i.triggerData.redirectBehaviour=fi.CART_DRAWER;else{he.warn(`Unsupported CTA type: ${t}`);return}window.CooeeSDK.executeCTA(i,_({clickAction:{at:t}},n));let o=new $s(r,this.eventData.props,i.triggerData);n?.video?o.setVideos(n.video):this.eventData.video&&o.setVideos(this.eventData.video),window.CooeeSDK.sendEvent(o)}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ci({token:e,factory:e.\u0275fac})};function Js(e,t){return[Et,...jl(e,t)]}function jl(e,t){return[{provide:Sn,useValue:et(e)},{provide:tr,useValue:_({},t)}]}var rr=class e{elementRef=ge(gn);engagementService=ge(Et);hasSwiper=!1;_engagementTrigger=et(null);_triggerContext=ge(Sn);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let t=["letscooee-widget"],n=this._engagementTrigger();return t.push(`widget-${n?.shortID}`),t}get triggerContext(){return this._triggerContext()}set triggerContext(t){this._triggerContext.set(t),this._engagementTrigger.set(t.triggerData),this.engagementTriggerReceived(t.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){he.verbose("Init",this.constructor.name);let t=this.elementRef.nativeElement.shadowRoot;t&&(qs(t,this.hasSwiper),Cn(this.engagementTrigger?.content?.innerCSS,t))}ngOnDestroy(){he.verbose("Destroying",this.constructor.name)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=be({type:e,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&Qn(r.classes)},inputs:{triggerContext:"triggerContext"},decls:1,vars:0,template:function(n,r){n&1&&Os(0)},encapsulation:2})};var Qs=(e,t)=>t.id;function Wl(e,t){if(e&1&&(U(0,"span",6),te(1),H()),e&2){G();let n=_e(0);D(),it(n)}}function zl(e,t){if(e&1){let n=je();Fe(0),U(1,"button",5),Se("click",function(){let i=Te(n).$implicit,o=G().$implicit,s=G();return xe(s.onOptionChange(o,i))}),Z(2,Wl,2,1,"span",6),H()}if(e&2){let n=t.$implicit,r=G().$implicit,i=_e(1),o=G(),s=n.name,u=ke(n.displayName||n.name),l=n.swatch,h=i?n.hexColor??s:"",y=o.selectedOptions()[r.name]===s,p=!!(l!=null&&l.color),E=!!(!(l==null||l.image==null)&&l.image.url);D(),vn("swatch-color-type",p)("swatch-image-type",E)("selected",y)("disabled",n.disabled),K("title",u)("ngStyle",o.getSwatchStyles(l,h)),Ht("aria-checked",y?"true":"false")("data-value",s)("aria-disabled",n.disabled?"true":null)("aria-label",u),D(),ee(!i&&!p&&!E?2:-1)}}function Yl(e,t){if(e&1&&(U(0,"div"),Fe(1),U(2,"div",1),te(3),H(),U(4,"div",2),te(5),H(),U(6,"div",3),Gt(7,zl,3,16,"button",4,Qs),H()()),e&2){let n=t.$implicit,r=G();Qn(Zn("option-group ",n.name.toLowerCase())),D(),ke(r.hasHexColors(n)),D(2),wt("",n.name,":"),D(2),it(r.selectedOptions()[n.name]),D(),Ht("aria-label",n.name),D(),$t(n.optionValues)}}var In=e=>e.trim().toLowerCase(),ir=class e extends rr{selectedVariant=new _n;item=Ce.required();selectedOptions=et({});options=ot(()=>{let t=this.item();if(!t.options||t.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(t,this.engagementTrigger)}catch(n){he.error(n)}return t.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),t.options});matchedVariant=ot(()=>{let t=this.item(),n=this.selectedOptions();return t.vars.find(r=>t.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=ot(()=>{let t=this.item(),n=new Map;return t?.vars?.length&&t.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=In(o.name),u=o.value,l=n.get(s);l||n.set(s,l=new Map);let h=l.get(u);h||l.set(u,h=new Set),h.add(i)}}),n});constructor(){super(),At(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let t=At(()=>{let n=this.item();if(!n?.options)return;let r=_({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(u=>u.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),t.destroy()})}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.shadowRoot;if(!t)return;let n=yt.get().website?.itemSwatchMapping;n&&Cn(n,t)}onOptionChange(t,n){let r=_({},this.selectedOptions());r[t.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(t){return!!t.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getSwatchStyles(t,n){let r={};return!t&&n?(r["--option-color"]=n,r["background-color"]=n,r):(t?.image?.url?r["background-image"]=`url("${t.image.url}")`:t?.color&&(r["--option-color"]=t.color,r["background-color"]=t.color),r)}getCandidateVariantsExcluding(t){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,u)=>{s.isAvailable&&i.add(u)});let o=i;for(let[s,u]of Object.entries(this.selectedOptions())){if(In(s)===In(t))continue;let l=r.get(In(s));if(!l)return new Set;let h=l.get(String(u));if(!h)return new Set;if(o=new Set([...o].filter(y=>h.has(y))),o.size===0)return o}return o}isOptionValueDisabledFast(t,n){let i=this.availabilityIndex().get(In(t.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let u=this.getCandidateVariantsExcluding(t.name);if(u.size===0)return!0;for(let l of u)if(s.has(l))return!1;return!0}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=be({type:e,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[yn(Js()),di],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"swatch-color-type","swatch-image-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&Gt(0,Yl,9,7,"div",0,Qs),n&2&&$t(r.options())},dependencies:[Hs,Us,Xs],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px;scrollbar-gutter:stable both-edges;scrollbar-width:none}.option-values::-webkit-scrollbar{display:none}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;flex-shrink:0;--selected-color: var(--option-color, rgba(var(--lc-primary-button-bg-color, 0 0 0)));background-size:cover;background-position:center;background-repeat:no-repeat}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}.option-value.disabled{opacity:.5;pointer-events:none}
|
|
2
2
|
`],encapsulation:3})};var mi=Ll(ea());function or(e){return mi.default.createInstance({name:"lc",storeName:e,driver:mi.default.LOCALSTORAGE})}var Yt=class{static storage;static async get(t,n){return await this.storage?.getItem(t)??n}static set(t,n){return this.storage?.setItem(t,n)}static remove(t){return this.storage?.removeItem(t)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var Tn=class Tn extends Yt{};Kn(Tn,"storeName","usr"),Tn.storage=or(Tn.storeName);var hi=Tn;function gi(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}var Fg=()=>typeof navigator<"u"&&"share"in navigator;var qt=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(t){this.onResizeCallback=t,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener("resize",this.debouncedResize),window.addEventListener("orientationchange",this.handleImmediateResize)}destroy(){window.removeEventListener("resize",this.debouncedResize),window.removeEventListener("orientationchange",this.handleImmediateResize)}handleImmediateResize=()=>{this.triggerResize()};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize()},this.debounceDelay)};triggerResize(){let t=window.innerWidth,n=window.innerHeight;(n!==this.lastHeight||t!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=t,this.lastHeight=n)}};function ta(e){e||(e=ge(hn));let t=new Cs(n=>{if(e.destroyed){n.next();return}return e.onDestroy(n.next.bind(n))});return n=>n.pipe(Ts(t))}var na=(n=>(n.SINGLE_PANE="SINGLE_PANE",n.TWO_PANE="TWO_PANE",n))(na||{});var xn=class xn extends Yt{};Kn(xn,"storeName","ses"),xn.storage=or(xn.storeName);var _i=xn;var R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var P=globalThis;var We="9.42.0";function Nt(){return Ot(P),P}function Ot(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||We,t[We]=t[We]||{}}function ct(e,t,n=P){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[We]=r[We]||{};return i[e]||(i[e]=t())}var vi=["debug","info","warn","error","log","assert","trace"],ql="Sentry Logger ",Kt={};function bt(e){if(!("console"in P))return e();let t=P.console,n={},r=Object.keys(Kt);r.forEach(i=>{let o=Kt[i];n[i]=t[i],t[i]=o});try{return e()}finally{r.forEach(i=>{t[i]=n[i]})}}function Kl(){Ei().enabled=!0}function Xl(){Ei().enabled=!1}function ra(){return Ei().enabled}function Jl(...e){yi("log",...e)}function Ql(...e){yi("warn",...e)}function Zl(...e){yi("error",...e)}function yi(e,...t){R&&ra()&&bt(()=>{P.console[e](`${ql}[${e}]:`,...t)})}function Ei(){return R?ct("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var w={enable:Kl,disable:Xl,isEnabled:ra,log:Jl,warn:Ql,error:Zl};var ia=/\(error: (.*)\)/,oa=/captureMessage|captureException/;function Si(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{let o=[],s=n.split(`
|
|
3
3
|
`);for(let u=r;u<s.length;u++){let l=s[u];if(l.length>1024)continue;let h=ia.test(l)?l.replace(ia,"$1"):l;if(!h.match(/\S*Error: /)){for(let y of t){let p=y(h);if(p){o.push(p);break}}if(o.length>=50+i)break}}return sa(o.slice(i))}}function sa(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(sr(t).function||"")&&t.pop(),t.reverse(),oa.test(sr(t).function||"")&&(t.pop(),oa.test(sr(t).function||"")&&t.pop()),t.slice(0,50).map(n=>V(_({},n),{filename:n.filename||sr(t).filename,function:n.function||"?"}))}function sr(e){return e[e.length-1]||{}}var bi="<anonymous>";function Me(e){try{return!e||typeof e!="function"?bi:e.name||bi}catch{return bi}}function ar(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 cr={},aa={};function ve(e,t){cr[e]=cr[e]||[],cr[e].push(t)}function ye(e,t){if(!aa[e]){aa[e]=!0;try{t()}catch(n){R&&w.error(`Error while instrumenting ${e}`,n)}}}function se(e,t){let n=e&&cr[e];if(n)for(let r of n)try{r(t)}catch(i){R&&w.error(`Error while triggering instrumentation handler.
|
|
4
4
|
Type: ${e}
|