@letscooee/web-sdk 2.4.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/sdk-preview.min.js +1 -1
- package/dist/sdk.min.js +1 -1
- package/dist/shopify-sdk.min.js +1 -1
- package/package.json +1 -1
package/dist/sdk-preview.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see sdk-preview.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={716:(t,e)=>{"use strict";e.U=void 0;var n=function(){function t(t){try{this.base=new URL(t),this.params=new URLSearchParams(this.base.search.slice(1))}catch(t){console.error("Un-parsable URL",t)}}return t.prototype.appendQueryParam=function(t,e){this.params.append(t,e?e.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(t){this.params.delete(t)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(t){if(!this.params)return"";var e=this.params.get(t);return e&&"undefined"!==e&&"null"!==e?e:void 0},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(t){return this.base.pathname=t,this},t.prototype.setQueryParam=function(t,e){return this.params.set(t,e?e.toString():""),this},t.prototype.setQueryString=function(t){if(t)return"?"===t[0]&&(t=t.slice(1)),this.params=new URLSearchParams(t),this},t.prototype.toString=function(){var t=this.params.toString();return this.base.search=""===t?"":"?"+t,this.base.toString()},t}();e.U=n},145:(t,e)=>{"use strict";e.r=void 0,e.r=function(){return new Promise((function(t,e){var n,r,o="Unknown";function i(e){t({isPrivate:e,browserName:o})}function s(t){return t===eval.toString().length}void 0!==(r=navigator.vendor)&&0===r.indexOf("Apple")&&s(37)?(o="Safari",void 0!==navigator.maxTouchPoints?function(){var t=String(Math.random());try{window.indexedDB.open(t,1).onupgradeneeded=function(e){var n,r,o=null===(n=e.target)||void 0===n?void 0:n.result;try{o.createObjectStore("test",{autoIncrement:!0}).put(new Blob),i(!1)}catch(t){var s=t;return t instanceof Error&&(s=null!==(r=t.message)&&void 0!==r?r:t),i("string"==typeof s&&/BlobURLs are not yet supported/.test(s))}finally{o.close(),window.indexedDB.deleteDatabase(t)}}}catch(t){return i(!1)}}():function(){var t=window.openDatabase,e=window.localStorage;try{t(null,null,null,null)}catch(t){return i(!0)}try{e.setItem("test","1"),e.removeItem("test")}catch(t){return i(!0)}i(!1)}()):function(){var t=navigator.vendor;return void 0!==t&&0===t.indexOf("Google")&&s(33)}()?(n=navigator.userAgent,o=n.match(/Chrome/)?void 0!==navigator.brave?"Brave":n.match(/Edg/)?"Edge":n.match(/OPR/)?"Opera":"Chrome":"Chromium",void 0!==self.Promise&&void 0!==self.Promise.allSettled?navigator.webkitTemporaryStorage.queryUsageAndQuota((function(t,e){var n;i(e<(void 0!==(n=window).performance&&void 0!==n.performance.memory&&void 0!==n.performance.memory.jsHeapSizeLimit?performance.memory.jsHeapSizeLimit:1073741824))}),(function(t){e(new Error("detectIncognito somehow failed to query storage quota: "+t.message))})):(0,window.webkitRequestFileSystem)(0,1,(function(){i(!1)}),(function(){i(!0)}))):void 0!==document.documentElement&&void 0!==document.documentElement.style.MozAppearance&&s(37)?(o="Firefox",i(void 0===navigator.serviceWorker)):void 0!==navigator.msSaveBlob&&s(39)?(o="Internet Explorer",i(void 0===window.indexedDB)):e(new Error("detectIncognito cannot determine the browser"))}))}},139:function(t){t.exports=function(){"use strict";function t(t){return Number.isInteger(t)&&t>=0}function e(t){this.name="ArgumentError",this.message=t}return function(n,r){if(r=r||{},"function"!=typeof n)throw new e("fetch must be a function");if("object"!=typeof r)throw new e("defaults must be an object");if(void 0!==r.retries&&!t(r.retries))throw new e("retries must be a positive integer");if(void 0!==r.retryDelay&&!t(r.retryDelay)&&"function"!=typeof r.retryDelay)throw new e("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==r.retryOn&&!Array.isArray(r.retryOn)&&"function"!=typeof r.retryOn)throw new e("retryOn property expects an array or function");return r=Object.assign({retries:3,retryDelay:1e3,retryOn:[]},r),function(o,i){var s=r.retries,a=r.retryDelay,u=r.retryOn;if(i&&void 0!==i.retries){if(!t(i.retries))throw new e("retries must be a positive integer");s=i.retries}if(i&&void 0!==i.retryDelay){if(!t(i.retryDelay)&&"function"!=typeof i.retryDelay)throw new e("retryDelay must be a positive integer or a function returning a positive integer");a=i.retryDelay}if(i&&i.retryOn){if(!Array.isArray(i.retryOn)&&"function"!=typeof i.retryOn)throw new e("retryOn property expects an array or function");u=i.retryOn}return new Promise((function(t,e){var r=function(r){var a="undefined"!=typeof Request&&o instanceof Request?o.clone():o;n(a,i).then((function(n){if(Array.isArray(u)&&-1===u.indexOf(n.status))t(n);else if("function"==typeof u)try{return Promise.resolve(u(r,null,n)).then((function(e){e?c(r,null,n):t(n)})).catch(e)}catch(t){e(t)}else r<s?c(r,null,n):t(n)})).catch((function(t){if("function"==typeof u)try{Promise.resolve(u(r,t,null)).then((function(n){n?c(r,t,null):e(t)})).catch((function(t){e(t)}))}catch(t){e(t)}else r<s?c(r,t,null):e(t)}))};function c(t,e,n){var o="function"==typeof a?a(t,e,n):a;setTimeout((function(){r(++t)}),o)}r(0)}))}}}()},901:function(t,e,n){var r,o;!function(i){"use strict";var s,a={VERSION:"1.6.1"},u={},c=function(t,e){return function(){return e.apply(t,arguments)}},f=function(){var t,e,n=arguments,r=n[0];for(e=1;e<n.length;e++)for(t in n[e])!(t in r)&&n[e].hasOwnProperty(t)&&(r[t]=n[e][t]);return r},l=function(t,e){return{value:t,name:e}};a.TRACE=l(1,"TRACE"),a.DEBUG=l(2,"DEBUG"),a.INFO=l(3,"INFO"),a.TIME=l(4,"TIME"),a.WARN=l(5,"WARN"),a.ERROR=l(8,"ERROR"),a.OFF=l(99,"OFF");var p=function(t){this.context=t,this.setLevel(t.filterLevel),this.log=this.info};p.prototype={setLevel:function(t){t&&"value"in t&&(this.context.filterLevel=t)},getLevel:function(){return this.context.filterLevel},enabledFor:function(t){var e=this.context.filterLevel;return t.value>=e.value},trace:function(){this.invoke(a.TRACE,arguments)},debug:function(){this.invoke(a.DEBUG,arguments)},info:function(){this.invoke(a.INFO,arguments)},warn:function(){this.invoke(a.WARN,arguments)},error:function(){this.invoke(a.ERROR,arguments)},time:function(t){"string"==typeof t&&t.length>0&&this.invoke(a.TIME,[t,"start"])},timeEnd:function(t){"string"==typeof t&&t.length>0&&this.invoke(a.TIME,[t,"end"])},invoke:function(t,e){s&&this.enabledFor(t)&&s(e,f({level:t},this.context))}};var h,d=new p({filterLevel:a.OFF});(h=a).enabledFor=c(d,d.enabledFor),h.trace=c(d,d.trace),h.debug=c(d,d.debug),h.time=c(d,d.time),h.timeEnd=c(d,d.timeEnd),h.info=c(d,d.info),h.warn=c(d,d.warn),h.error=c(d,d.error),h.log=h.info,a.setHandler=function(t){s=t},a.setLevel=function(t){for(var e in d.setLevel(t),u)u.hasOwnProperty(e)&&u[e].setLevel(t)},a.getLevel=function(){return d.getLevel()},a.get=function(t){return u[t]||(u[t]=new p(f({name:t},d.context)))},a.createDefaultHandler=function(t){(t=t||{}).formatter=t.formatter||function(t,e){e.name&&t.unshift("["+e.name+"]")};var e={},n=function(t,e){Function.prototype.apply.call(t,console,e)};return"undefined"==typeof console?function(){}:function(r,o){r=Array.prototype.slice.call(r);var i,s=console.log;o.level===a.TIME?(i=(o.name?"["+o.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(i):e[i]=(new Date).getTime():console.timeEnd?console.timeEnd(i):n(s,[i+": "+((new Date).getTime()-e[i])+"ms"])):(o.level===a.WARN&&console.warn?s=console.warn:o.level===a.ERROR&&console.error?s=console.error:o.level===a.INFO&&console.info?s=console.info:o.level===a.DEBUG&&console.debug?s=console.debug:o.level===a.TRACE&&console.trace&&(s=console.trace),t.formatter(r,o),n(s,r))}},a.useDefaults=function(t){a.setLevel(t&&t.defaultLevel||a.DEBUG),a.setHandler(a.createDefaultHandler(t))},a.setDefaults=a.useDefaults,void 0===(o="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=o)}()},483:(t,e,n)=>{t.exports=function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,(function(t){return o(e[s][1][t]||t)}),c,c.exports,t,e,n,r)}return n[s].exports}for(var i=void 0,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,r){(function(t){"use strict";var n,r,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,s=new o(f),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){f(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(f,0)};else{var u=new t.MessageChannel;u.port1.onmessage=f,n=function(){u.port2.postMessage(0)}}var c=[];function f(){var t,e;r=!0;for(var n=c.length;n;){for(e=c,c=[],t=-1;++t<n;)e[t]();n=c.length}r=!1}e.exports=function(t){1!==c.push(t)||r||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){"use strict";var r=t(1);function o(){}var i={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&h(this,t)}function f(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(t,e,n){r((function(){var r;try{r=e(n)}catch(e){return i.reject(t,e)}r===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,r)}))}function p(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function h(t,e){var n=!1;function r(e){n||(n=!0,i.reject(t,e))}function o(e){n||(n=!0,i.resolve(t,e))}var s=d((function(){e(o,r)}));"error"===s.status&&r(s.value)}function d(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}e.exports=c,c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var n=new this.constructor(o);return this.state!==u?l(n,this.state===a?t:e,this.outcome):this.queue.push(new f(n,t,e)),n},f.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},f.prototype.otherCallFulfilled=function(t){l(this.promise,this.onFulfilled,t)},f.prototype.callRejected=function(t){i.reject(this.promise,t)},f.prototype.otherCallRejected=function(t){l(this.promise,this.onRejected,t)},i.resolve=function(t,e){var n=d(p,e);if("error"===n.status)return i.reject(t,n.value);var r=n.value;if(r)h(t,r);else{t.state=a,t.outcome=e;for(var o=-1,s=t.queue.length;++o<s;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=s,t.outcome=e;for(var n=-1,r=t.queue.length;++n<r;)t.queue[n].callRejected(e);return t},c.resolve=function(t){return t instanceof this?t:i.resolve(new this(o),t)},c.reject=function(t){var e=new this(o);return i.reject(e,t)},c.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,r=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,u=-1,c=new this(o);++u<n;)f(t[u],u);return c;function f(t,o){e.resolve(t).then((function(t){s[o]=t,++a!==n||r||(r=!0,i.resolve(c,s))}),(function(t){r||(r=!0,i.reject(c,t))}))}},c.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n,r=t.length,s=!1;if(!r)return this.resolve([]);for(var a=-1,u=new this(o);++a<r;)n=t[a],e.resolve(n).then((function(t){s||(s=!0,i.resolve(u,t))}),(function(t){s||(s=!0,i.reject(u,t))}));return u}},{1:1}],3:[function(t,e,r){(function(e){"use strict";"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}();function i(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<t.length;r+=1)n.append(t[r]);return n.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var s=Promise;function a(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function u(t,e,n){"function"==typeof e&&t.then(e),"function"==typeof n&&t.catch(n)}function c(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",p=void 0,h={},d=Object.prototype.toString,y="readonly",g="readwrite";function v(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n),o=0;o<e;o++)r[o]=t.charCodeAt(o);return n}function b(t){return"boolean"==typeof p?s.resolve(p):function(t){return new s((function(e){var n=t.transaction(l,g),r=i([""]);n.objectStore(l).put(r,"key"),n.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},n.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);e(n||!t||parseInt(t[1],10)>=43)}})).catch((function(){return!1}))}(t).then((function(t){return p=t}))}function m(t){var e=h[t.name],n={};n.promise=new s((function(t,e){n.resolve=t,n.reject=e})),e.deferredOperations.push(n),e.dbReady?e.dbReady=e.dbReady.then((function(){return n.promise})):e.dbReady=n.promise}function w(t){var e=h[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function E(t,e){var n=h[t.name].deferredOperations.pop();if(n)return n.reject(e),n.promise}function S(t,e){return new s((function(n,r){if(h[t.name]=h[t.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},t.db){if(!e)return n(t.db);m(t),t.db.close()}var i=[t.name];e&&i.push(t.version);var s=o.open.apply(o,i);e&&(s.onupgradeneeded=function(e){var n=s.result;try{n.createObjectStore(t.storeName),e.oldVersion<=1&&n.createObjectStore(l)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),s.onerror=function(t){t.preventDefault(),r(s.error)},s.onsuccess=function(){var e=s.result;e.onversionchange=function(t){t.target.close()},n(e),w(t)}}))}function _(t){return S(t,!1)}function T(t){return S(t,!0)}function O(t,e){if(!t.db)return!0;var n=!t.db.objectStoreNames.contains(t.storeName),r=t.version<t.db.version,o=t.version>t.db.version;if(r&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||n){if(n){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function I(t){return i([v(atob(t.data))],{type:t.type})}function x(t){return t&&t.__local_forage_encoded_blob}function N(t){var e=this,n=e._initReady().then((function(){var t=h[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady}));return u(n,t,t),n}function A(t,e,n,r){void 0===r&&(r=1);try{var o=t.db.transaction(t.storeName,e);n(null,o)}catch(o){if(r>0&&(!t.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return s.resolve().then((function(){if(!t.db||"NotFoundError"===o.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),T(t)})).then((function(){return function(t){m(t);for(var e=h[t.name],n=e.forages,r=0;r<n.length;r++){var o=n[r];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,_(t).then((function(e){return t.db=e,O(t)?T(t):e})).then((function(r){t.db=e.db=r;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=r})).catch((function(e){throw E(t,e),e}))}(t).then((function(){A(t,e,n,r-1)}))})).catch(n);n(o)}}var D={_driver:"asyncStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var r in t)n[r]=t[r];var o=h[n.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},h[n.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=N);var i=[];function a(){return s.resolve()}for(var u=0;u<o.forages.length;u++){var c=o.forages[u];c!==e&&i.push(c._initReady().catch(a))}var f=o.forages.slice(0);return s.all(i).then((function(){return n.db=o.db,_(n)})).then((function(t){return n.db=t,O(n,e._defaultConfig.version)?T(n):t})).then((function(t){n.db=o.db=t,e._dbInfo=n;for(var r=0;r<f.length;r++){var i=f[r];i!==e&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}}))},_support:function(){try{if(!o||!o.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}(),iterate:function(t,e){var n=this,r=new s((function(e,r){n.ready().then((function(){A(n._dbInfo,y,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var n=s.result;if(n){var r=n.value;x(r)&&(r=I(r));var o=t(r,n.key,a++);void 0!==o?e(o):n.continue()}else e()},s.onerror=function(){r(s.error)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},getItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){A(n._dbInfo,y,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName).get(t);s.onsuccess=function(){var t=s.result;void 0===t&&(t=null),x(t)&&(t=I(t)),e(t)},s.onerror=function(){r(s.error)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},setItem:function(t,e,n){var r=this;t=c(t);var o=new s((function(n,o){var i;r.ready().then((function(){return i=r._dbInfo,"[object Blob]"===d.call(e)?b(i.db).then((function(t){return t?e:(n=e,new s((function(t,e){var r=new FileReader;r.onerror=e,r.onloadend=function(e){var r=btoa(e.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)})));var n})):e})).then((function(e){A(r._dbInfo,g,(function(i,s){if(i)return o(i);try{var a=s.objectStore(r._dbInfo.storeName);null===e&&(e=void 0);var u=a.put(e,t);s.oncomplete=function(){void 0===e&&(e=null),n(e)},s.onabort=s.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(t){o(t)}}))})).catch(o)}));return a(o,n),o},removeItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){A(n._dbInfo,g,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){r(s.error)},i.onabort=function(){var t=s.error?s.error:s.transaction.error;r(t)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},clear:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){A(e._dbInfo,g,(function(r,o){if(r)return n(r);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;n(t)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},length:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){A(e._dbInfo,y,(function(r,o){if(r)return n(r);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){n(i.error)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},key:function(t,e){var n=this,r=new s((function(e,r){t<0?e(null):n.ready().then((function(){A(n._dbInfo,y,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName),a=!1,u=s.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===t||a?e(n.key):(a=!0,n.advance(t)):e(null)},u.onerror=function(){r(u.error)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},keys:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){A(e._dbInfo,y,(function(r,o){if(r)return n(r);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),s=[];i.onsuccess=function(){var e=i.result;e?(s.push(e.key),e.continue()):t(s)},i.onerror=function(){n(i.error)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},dropInstance:function(t,e){e=f.apply(this,arguments);var n=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName);var r,i=this;if(t.name){var u=t.name===n.name&&i._dbInfo.db?s.resolve(i._dbInfo.db):_(t).then((function(e){var n=h[t.name],r=n.forages;n.db=e;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=e;return e}));r=t.storeName?u.then((function(e){if(e.objectStoreNames.contains(t.storeName)){var n=e.version+1;m(t);var r=h[t.name],i=r.forages;e.close();for(var a=0;a<i.length;a++){var u=i[a];u._dbInfo.db=null,u._dbInfo.version=n}var c=new s((function(e,r){var i=o.open(t.name,n);i.onerror=function(t){i.result.close(),r(t)},i.onupgradeneeded=function(){i.result.deleteObjectStore(t.storeName)},i.onsuccess=function(){var t=i.result;t.close(),e(t)}}));return c.then((function(t){r.db=t;for(var e=0;e<i.length;e++){var n=i[e];n._dbInfo.db=t,w(n._dbInfo)}})).catch((function(e){throw(E(t,e)||s.resolve()).catch((function(){})),e}))}})):u.then((function(e){m(t);var n=h[t.name],r=n.forages;e.close();for(var i=0;i<r.length;i++)r[i]._dbInfo.db=null;var a=new s((function(e,n){var r=o.deleteDatabase(t.name);r.onerror=function(){var t=r.result;t&&t.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},r.onsuccess=function(){var t=r.result;t&&t.close(),e(t)}}));return a.then((function(t){n.db=t;for(var e=0;e<r.length;e++)w(r[e]._dbInfo)})).catch((function(e){throw(E(t,e)||s.resolve()).catch((function(){})),e}))}))}else r=s.reject("Invalid arguments");return a(r,e),r}};var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P=/^~~local_forage_type~([^~]+)~/,C="__lfsc__:",k=C.length,R="arbf",B="blob",U="si08",j="ui08",M="uic8",H="si16",F="si32",G="ur16",V="ui32",$="fl32",z="fl64",q=k+R.length,W=Object.prototype.toString;function J(t){var e,n,r,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),f=new Uint8Array(c);for(e=0;e<a;e+=4)n=L.indexOf(t[e]),r=L.indexOf(t[e+1]),o=L.indexOf(t[e+2]),i=L.indexOf(t[e+3]),f[u++]=n<<2|r>>4,f[u++]=(15&r)<<4|o>>2,f[u++]=(3&o)<<6|63&i;return c}function Y(t){var e,n=new Uint8Array(t),r="";for(e=0;e<n.length;e+=3)r+=L[n[e]>>2],r+=L[(3&n[e])<<4|n[e+1]>>4],r+=L[(15&n[e+1])<<2|n[e+2]>>6],r+=L[63&n[e+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var K={serialize:function(t,e){var n="";if(t&&(n=W.call(t)),t&&("[object ArrayBuffer]"===n||t.buffer&&"[object ArrayBuffer]"===W.call(t.buffer))){var r,o=C;t instanceof ArrayBuffer?(r=t,o+=R):(r=t.buffer,"[object Int8Array]"===n?o+=U:"[object Uint8Array]"===n?o+=j:"[object Uint8ClampedArray]"===n?o+=M:"[object Int16Array]"===n?o+=H:"[object Uint16Array]"===n?o+=G:"[object Int32Array]"===n?o+=F:"[object Uint32Array]"===n?o+=V:"[object Float32Array]"===n?o+=$:"[object Float64Array]"===n?o+=z:e(new Error("Failed to get type for BinaryArray"))),e(o+Y(r))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n="~~local_forage_type~"+t.type+"~"+Y(this.result);e("__lfsc__:blob"+n)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(n){console.error("Couldn't convert value into a JSON string: ",t),e(null,n)}},deserialize:function(t){if(t.substring(0,k)!==C)return JSON.parse(t);var e,n=t.substring(q),r=t.substring(k,q);if(r===B&&P.test(n)){var o=n.match(P);e=o[1],n=n.substring(o[0].length)}var s=J(n);switch(r){case R:return s;case B:return i([s],{type:e});case U:return new Int8Array(s);case j:return new Uint8Array(s);case M:return new Uint8ClampedArray(s);case H:return new Int16Array(s);case G:return new Uint16Array(s);case F:return new Int32Array(s);case V:return new Uint32Array(s);case $:return new Float32Array(s);case z:return new Float64Array(s);default:throw new Error("Unkown type: "+r)}},stringToBuffer:J,bufferToString:Y};function X(t,e,n,r){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function Z(t,e,n,r,o,i){t.executeSql(n,r,o,(function(t,s){s.code===s.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],(function(t,a){a.rows.length?i(t,s):X(t,e,(function(){t.executeSql(n,r,o,i)}),i)}),i):i(t,s)}),i)}function Q(t,e,n,r){var o=this;t=c(t);var i=new s((function(i,s){o.ready().then((function(){void 0===e&&(e=null);var a=e,u=o._dbInfo;u.serializer.serialize(e,(function(e,c){c?s(c):u.db.transaction((function(n){Z(n,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],(function(){i(a)}),(function(t,e){s(e)}))}),(function(e){if(e.code===e.QUOTA_ERR){if(r>0)return void i(Q.apply(o,[t,a,n,r-1]));s(e)}}))}))})).catch(s)}));return a(i,n),i}function tt(t){return new s((function(e,n){t.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var o=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name);e({db:t,storeNames:o})}),(function(t,e){n(e)}))}),(function(t){n(t)}))}))}var et={_driver:"webSQLStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var r in t)n[r]="string"!=typeof t[r]?t[r].toString():t[r];var o=new s((function(t,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(t){return r(t)}n.db.transaction((function(o){X(o,n,(function(){e._dbInfo=n,t()}),(function(t,e){r(e)}))}),r)}));return n.serializer=K,o},_support:"function"==typeof openDatabase,iterate:function(t,e){var n=this,r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"SELECT * FROM "+o.storeName,[],(function(n,r){for(var i=r.rows,s=i.length,a=0;a<s;a++){var u=i.item(a),c=u.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=t(c,u.key,a+1)))return void e(c)}e()}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},getItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],(function(t,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),e(r)}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},setItem:function(t,e,n){return Q.apply(this,[t,e,n,1])},removeItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],(function(){e()}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},clear:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){Z(e,r,"DELETE FROM "+r.storeName,[],(function(){t()}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},length:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){Z(e,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(e,n){var r=n.rows.item(0).c;t(r)}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},key:function(t,e){var n=this,r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],(function(t,n){var r=n.rows.length?n.rows.item(0).key:null;e(r)}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},keys:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){Z(e,r,"SELECT key FROM "+r.storeName,[],(function(e,n){for(var r=[],o=0;o<n.rows.length;o++)r.push(n.rows.item(o).key);t(r)}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},dropInstance:function(t,e){e=f.apply(this,arguments);var n=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName);var r,o=this;return a(r=t.name?new s((function(e){var r;r=t.name===n.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:r,storeNames:[t.storeName]}):e(tt(r))})).then((function(t){return new s((function(e,n){t.db.transaction((function(r){function o(t){return new s((function(e,n){r.executeSql("DROP TABLE IF EXISTS "+t,[],(function(){e()}),(function(t,e){n(e)}))}))}for(var i=[],a=0,u=t.storeNames.length;a<u;a++)i.push(o(t.storeNames[a]));s.all(i).then((function(){e()})).catch((function(t){n(t)}))}),(function(t){n(t)}))}))})):s.reject("Invalid arguments"),e),r}};function nt(t,e){var n=t.name+"/";return t.storeName!==e.storeName&&(n+=t.storeName+"/"),n}function rt(){return!function(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(t){return!0}}()||localStorage.length>0}var ot={_driver:"localStorageWrapper",_initStorage:function(t){var e={};if(t)for(var n in t)e[n]=t[n];return e.keyPrefix=nt(t,this._defaultConfig),rt()?(this._dbInfo=e,e.serializer=K,s.resolve()):s.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}(),iterate:function(t,e){var n=this,r=n.ready().then((function(){for(var e=n._dbInfo,r=e.keyPrefix,o=r.length,i=localStorage.length,s=1,a=0;a<i;a++){var u=localStorage.key(a);if(0===u.indexOf(r)){var c=localStorage.getItem(u);if(c&&(c=e.serializer.deserialize(c)),void 0!==(c=t(c,u.substring(o),s++)))return c}}}));return a(r,e),r},getItem:function(t,e){var n=this;t=c(t);var r=n.ready().then((function(){var e=n._dbInfo,r=localStorage.getItem(e.keyPrefix+t);return r&&(r=e.serializer.deserialize(r)),r}));return a(r,e),r},setItem:function(t,e,n){var r=this;t=c(t);var o=r.ready().then((function(){void 0===e&&(e=null);var n=e;return new s((function(o,i){var s=r._dbInfo;s.serializer.serialize(e,(function(e,r){if(r)i(r);else try{localStorage.setItem(s.keyPrefix+t,e),o(n)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||i(t),i(t)}}))}))}));return a(o,n),o},removeItem:function(t,e){var n=this;t=c(t);var r=n.ready().then((function(){var e=n._dbInfo;localStorage.removeItem(e.keyPrefix+t)}));return a(r,e),r},clear:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(t)&&localStorage.removeItem(r)}}));return a(n,t),n},length:function(t){var e=this.keys().then((function(t){return t.length}));return a(e,t),e},key:function(t,e){var n=this,r=n.ready().then((function(){var e,r=n._dbInfo;try{e=localStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(r.keyPrefix.length)),e}));return a(r,e),r},keys:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo,n=localStorage.length,r=[],o=0;o<n;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&r.push(i.substring(t.keyPrefix.length))}return r}));return a(n,t),n},dropInstance:function(t,e){if(e=f.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var n=this.config();t.name=t.name||n.name,t.storeName=t.storeName||n.storeName}var r,o=this;return r=t.name?new s((function(e){t.storeName?e(nt(t,o._defaultConfig)):e(t.name+"/")})).then((function(t){for(var e=localStorage.length-1;e>=0;e--){var n=localStorage.key(e);0===n.indexOf(t)&&localStorage.removeItem(n)}})):s.reject("Invalid arguments"),a(r,e),r}},it=function(t,e){for(var n=t.length,r=0;r<n;){if((o=t[r])===(i=e)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;r++}var o,i;return!1},st=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},at={},ut={},ct={INDEXEDDB:D,WEBSQL:et,LOCALSTORAGE:ot},ft=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],lt=["dropInstance"],pt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(lt),ht={description:"",driver:ft.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function dt(t,e){t[e]=function(){var n=arguments;return t.ready().then((function(){return t[e].apply(t,n)}))}}function yt(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var n in e)e.hasOwnProperty(n)&&(st(e[n])?arguments[0][n]=e[n].slice():arguments[0][n]=e[n])}return arguments[0]}var gt=function(){function t(e){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ct)if(ct.hasOwnProperty(n)){var r=ct[n],o=r._driver;this[n]=o,at[o]||this.defineDriver(r)}this._defaultConfig=yt({},ht),this._config=yt({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":r(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,n){var r=new s((function(e,n){try{var r=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void n(o);for(var i=pt.concat("_initStorage"),u=0,c=i.length;u<c;u++){var f=i[u];if((!it(lt,f)||t[f])&&"function"!=typeof t[f])return void n(o)}!function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),n=s.reject(e);return a(n,arguments[arguments.length-1]),n}},n=0,r=lt.length;n<r;n++){var o=lt[n];t[o]||(t[o]=e(o))}}();var l=function(n){at[r]&&console.info("Redefining LocalForage driver: "+r),at[r]=t,ut[r]=n,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(l,n):l(!!t._support):l(!0)}catch(t){n(t)}}));return u(r,e,n),r},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,n){var r=at[t]?s.resolve(at[t]):s.reject(new Error("Driver not found."));return u(r,e,n),r},t.prototype.getSerializer=function(t){var e=s.resolve(K);return u(e,t),e},t.prototype.ready=function(t){var e=this,n=e._driverSet.then((function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready}));return u(n,t,t),n},t.prototype.setDriver=function(t,e,n){var r=this;st(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){r._config.driver=r.driver()}function a(t){return r._extend(t),i(),r._ready=r._initStorage(r._config),r._ready}var c=null!==this._driverSet?this._driverSet.catch((function(){return s.resolve()})):s.resolve();return this._driverSet=c.then((function(){var t=o[0];return r._dbInfo=null,r._ready=null,r.getDriver(t).then((function(t){r._driver=t._driver,i(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(t){return function(){var e=0;return function n(){for(;e<t.length;){var o=t[e];return e++,r._dbInfo=null,r._ready=null,r.getDriver(o).then(a).catch(n)}i();var u=new Error("No available storage method found.");return r._driverSet=s.reject(u),r._driverSet}()}}(o)}))})).catch((function(){i();var t=new Error("No available storage method found.");return r._driverSet=s.reject(t),r._driverSet})),u(this._driverSet,e,n),this._driverSet},t.prototype.supports=function(t){return!!ut[t]},t.prototype._extend=function(t){yt(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=pt.length;t<e;t++)dt(this,pt[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),vt=new gt;e.exports=vt},{3:3}]},{},[4])(4)},238:function(t,e,n){var r;!function(o,i){"use strict";var s="function",a="undefined",u="object",c="string",f="model",l="name",p="type",h="vendor",d="version",y="architecture",g="console",v="mobile",b="tablet",m="smarttv",w="wearable",E="embedded",S="Amazon",_="Apple",T="ASUS",O="BlackBerry",I="Google",x="Huawei",N="LG",A="Microsoft",D="Motorola",L="Samsung",P="Sharp",C="Sony",k="Xiaomi",R="Zebra",B="Facebook",U=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},j=function(t,e){return typeof t===c&&-1!==M(e).indexOf(M(t))},M=function(t){return t.toLowerCase()},H=function(t,e){if(typeof t===c)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===a?t:t.substring(0,350)},F=function(t,e){for(var n,r,o,a,c,f,l=0;l<e.length&&!c;){var p=e[l],h=e[l+1];for(n=r=0;n<p.length&&!c;)if(c=p[n++].exec(t))for(o=0;o<h.length;o++)f=c[++r],typeof(a=h[o])===u&&a.length>0?2===a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,f):this[a[0]]=a[1]:3===a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=f?f.replace(a[1],a[2]):i:this[a[0]]=f?a[1].call(this,f,a[2]):i:4===a.length&&(this[a[0]]=f?a[3].call(this,f.replace(a[1],a[2])):i):this[a]=f||i;l+=2}},G=function(t,e){for(var n in e)if(typeof e[n]===u&&e[n].length>0){for(var r=0;r<e[n].length;r++)if(j(e[n][r],t))return"?"===n?i:n}else if(j(e[n],t))return"?"===n?i:n;return t},V={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure Browser"],d],[/\bfocus\/([\w\.]+)/i],[d,[l,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[d,[l,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 Browser"]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,"Chrome WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,M]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,"",M]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,M]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,L],[p,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,L],[p,v]],[/\((ip(?:hone|od)[\w ]*);/i],[f,[h,_],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,_],[p,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[h,x],[p,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[h,x],[p,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[h,k],[p,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[h,k],[p,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,"OPPO"],[p,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,"Vivo"],[p,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[h,"Realme"],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[h,D],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,D],[p,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,N],[p,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,N],[p,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[h,"Lenovo"],[p,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[h,"Nokia"],[p,v]],[/(pixel c)\b/i],[f,[h,I],[p,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,I],[p,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,C],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[h,C],[p,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,"OnePlus"],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,S],[p,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[h,S],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[p,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,O],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,T],[p,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,T],[p,v]],[/(nexus 9)/i],[f,[h,"HTC"],[p,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[f,/_/g," "],[p,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,"Acer"],[p,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,"Meizu"],[p,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,P],[p,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[p,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,f,[p,b]],[/(surface duo)/i],[f,[h,A],[p,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,"Fairphone"],[p,v]],[/(u304aa)/i],[f,[h,"AT&T"],[p,v]],[/\bsie-(\w*)/i],[f,[h,"Siemens"],[p,v]],[/\b(rct\w+) b/i],[f,[h,"RCA"],[p,b]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,"Dell"],[p,b]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,"Verizon"],[p,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,"Barnes & Noble"],[p,b]],[/\b(tm\d{3}\w+) b/i],[f,[h,"NuVision"],[p,b]],[/\b(k88) b/i],[f,[h,"ZTE"],[p,b]],[/\b(nx\d{3}j) b/i],[f,[h,"ZTE"],[p,v]],[/\b(gen\d{3}) b.+49h/i],[f,[h,"Swiss"],[p,v]],[/\b(zur\d{3}) b/i],[f,[h,"Swiss"],[p,b]],[/\b((zeki)?tb.*\b) b/i],[f,[h,"Zeki"],[p,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],f,[p,b]],[/\b(ns-?\w{0,9}) b/i],[f,[h,"Insignia"],[p,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,"NextBook"],[p,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],f,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],f,[p,v]],[/\b(ph-1) /i],[f,[h,"Essential"],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,"Envizen"],[p,b]],[/\b(trio[-\w\. ]+) b/i],[f,[h,"MachSpeed"],[p,b]],[/\btu_(1491) b/i],[f,[h,"Rotor"],[p,b]],[/(shield[\w ]+) b/i],[f,[h,"Nvidia"],[p,b]],[/(sprint) (\w+)/i],[h,f,[p,v]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[h,A],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,R],[p,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,R],[p,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[p,g]],[/droid.+; (shield) bui/i],[f,[h,"Nvidia"],[p,g]],[/(playstation [345portablevi]+)/i],[f,[h,C],[p,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,A],[p,g]],[/smart-tv.+(samsung)/i],[h,[p,m]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[h,L],[p,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,N],[p,m]],[/(apple) ?tv/i],[h,[f,"Apple TV"],[p,m]],[/crkey/i],[[f,"Chromecast"],[h,I],[p,m]],[/droid.+aft(\w)( bui|\))/i],[f,[h,S],[p,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[h,P],[p,m]],[/(bravia[\w ]+)( bui|\))/i],[f,[h,C],[p,m]],[/(mitv-\w{5}) bui/i],[f,[h,k],[p,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,H],[f,H],[p,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,m]],[/((pebble))app/i],[h,f,[p,w]],[/droid.+; (glass) \d/i],[f,[h,I],[p,w]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,R],[p,w]],[/(quest( 2)?)/i],[f,[h,B],[p,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[p,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[p,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,G,V]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,G,V]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,O]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[l,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,d]]},z=function(t,e){if(typeof t===u&&(e=t,t=i),!(this instanceof z))return new z(t,e).getResult();var n=t||(typeof o!==a&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),r=e?function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n}($,e):$;return this.getBrowser=function(){var t,e={};return e.name=i,e.version=i,F.call(e,n,r.browser),e.major=typeof(t=e.version)===c?t.replace(/[^\d\.]/g,"").split(".")[0]:i,e},this.getCPU=function(){var t={};return t.architecture=i,F.call(t,n,r.cpu),t},this.getDevice=function(){var t={};return t.vendor=i,t.model=i,t.type=i,F.call(t,n,r.device),t},this.getEngine=function(){var t={};return t.name=i,t.version=i,F.call(t,n,r.engine),t},this.getOS=function(){var t={};return t.name=i,t.version=i,F.call(t,n,r.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n=typeof t===c&&t.length>350?H(t,350):t,this},this.setUA(n),this};z.VERSION="1.0.32",z.BROWSER=U([l,d,"major"]),z.CPU=U([y]),z.DEVICE=U([f,h,p,g,v,m,b,w,E]),z.ENGINE=z.OS=U([l,d]),typeof e!==a?(t.exports&&(e=t.exports=z),e.UAParser=z):n.amdO?(r=function(){return z}.call(e,n,e,t))===i||(t.exports=r):typeof o!==a&&(o.UAParser=z);var q=typeof o!==a&&(o.jQuery||o.Zepto);if(q&&!q.ua){var W=new z;q.ua=W.getResult(),q.ua.get=function(){return W.getUA()},q.ua.set=function(t){W.setUA(t);var e=W.getResult();for(var n in e)q.ua[n]=e[n]}}}("object"==typeof window?window:this)},147:t=>{"use strict";t.exports={i8:"2.4.0"}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.amdO={},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};(()=>{"use strict";n.d(r,{default:()=>Ur});for(var t=function(){function t(){}var e,r;return e=t,t.SDK_VERSION=n(147).i8,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.SHOPIFY_LOG_PREFIX="CooeeShopify",t.COOEE="cooee",t.SESSION_STORAGE_TAB_OPENED="tabop",t.SESSION_STORAGE_SCROLL_ID="sleid",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_WRAPPER_NAME="cooee-wrapper",t.IN_APP_CONTAINER_NAME="cooee-container",t.IN_APP_DEFAULT_PADDING=15,t.EVENT_SCREEN_VIEW="CE Screen View",t.EVENT_APP_INSTALLED="CE App Installed",t.EVENT_APP_LAUNCHED="CE App Launched",t.EVENT_SESSION_CONCLUDED="CE Session Concluded",t.EVENT_SESSION_STARTED="CE Session Started",t.EVENT_APP_FOREGROUND="CE App Foreground",t.EVENT_APP_BACKGROUND="CE App Background",t.EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed",t.EVENT_TRIGGER_REJECTED="CE Trigger Rejected",t.EVENT_TRIGGER_CLOSED="CE Trigger Closed",t.EVENT_SCROLL="CE Scroll",t.EVENT_TRIGGER_CLICKED="CE Trigger Clicked",t.EVENT_ADD_TO_CART="Add To Cart",t.EVENT_VIEW_ITEM="View Item",t.EVENT_VIEW_CART="View Cart",t.blackListedScreenName=["collection","product","cart"],t.BOT_USER_AGENTS_PATTERN="(googlebot/|bot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)",t.BOT_UA_REGEX=new RegExp(e.BOT_USER_AGENTS_PATTERN,"i"),t.API_CALL_MAX_ATTEMPTS=3,t.API_CALL_RETRY_DELAY=1e3,r=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(r,10),t}(),e=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)e[a]=s[a],o[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,n,r){for(var o,i,s=[],a=n;a<r;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(e[(i=o)>>18&63]+e[i>>12&63]+e[i>>6&63]+e[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;var l,p,h=function(t){var e,n,r=c(t),s=r[0],a=r[1],u=new i(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),f=0,l=a>0?s-4:s;for(n=0;n<l;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,u[f++]=255&e),1===a&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},d=function(t){for(var n,r=t.length,o=r%3,i=[],s=16383,a=0,u=r-o;a<u;a+=s)i.push(f(t,a,a+s>u?u:a+s));return 1===o?(n=t[r-1],i.push(e[n>>2]+e[n<<4&63]+"==")):2===o&&(n=(t[r-2]<<8)+t[r-1],i.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"=")),i.join("")},y=function(t,e,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,f=-7,l=n?o-1:0,p=n?-1:1,h=t[e+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=p,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=r;f>0;s=256*s+t[e+l],l+=p,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),i-=c}return(h?-1:1)*s*Math.pow(2,i-r)},g=function(t,e,n,r,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[n+h]=255&a,h+=d,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[n+h]=255&s,h+=d,s/=256,c-=8);t[n+h-d]|=128*y},v=(l=function(t,e){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},e.INSPECT_MAX_BYTES=50;var r=2147483647;function o(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return s(t,e,n)}function s(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|p(t,e),r=o(n),s=r.write(t,e);return s!==n&&(r=r.slice(0,s)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t));if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return f(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return f(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return i.from(r,e,n);var s=function(t){if(i.isBuffer(t)){var e=0|l(t.length),n=o(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||V(t.length)?o(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t))}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return a(t),o(t<0?0:0|l(t))}function c(t){for(var e=t.length<0?0:0|l(t.length),n=o(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function f(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,i.prototype),r}function l(t){if(t>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function p(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(t));var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(o)return r?-1:M(t).length;e=(""+e).toLowerCase(),o=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return x(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return I(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,o){var i,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=n;i<a;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(n+u>a&&(n=a-u),i=n;i>=0;i--){for(var l=!0,p=0;p<u;p++)if(c(t,i+p)!==c(e,p)){l=!1;break}if(l)return i}return-1}function E(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(V(a))return s;t[n+s]=a}return s}function S(t,e,n,r){return F(M(e,t.length-n),t,n,r)}function _(t,e,n,r){return F(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function T(t,e,n,r){return F(H(e),t,n,r)}function O(t,e,n,r){return F(function(t,e){for(var n,r,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=(n=t.charCodeAt(s))>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function I(t,e,n){return 0===e&&n===t.length?d(t):d(t.slice(e,n))}function x(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,s,a,u,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),o+=l}return function(t){var e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=N));return n}(r)}e.kMaxLength=r,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(t,e,n){return s(t,e,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(t,e,n){return function(t,e,n){return a(t),t<=0?o(t):void 0!==e?"string"==typeof n?o(t).fill(e,n):o(t).fill(e):o(t)}(t,e,n)},i.allocUnsafe=function(t){return u(t)},i.allocUnsafeSlow=function(t){return u(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(G(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,o=0,s=Math.min(n,r);o<s;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=i.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(G(s,Uint8Array))o+s.length>r.length?i.from(s).copy(r,o):Uint8Array.prototype.set.call(r,s,o);else{if(!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o)}o+=s.length}return r},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)b(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):v.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(t,e,n,r,o){if(G(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(t));if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),u=Math.min(s,a),c=this.slice(r,o),f=t.slice(e,n),l=0;l<u;++l)if(c[l]!==f[l]){s=c[l],a=f[l];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},i.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},i.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},i.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return S(this,t,e,n);case"ascii":case"latin1":case"binary":return _(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function D(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function L(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=$[t[i]];return o}function P(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length-1;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,n,r,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function R(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(t,e,n,r,o){return e=+e,n>>>=0,o||R(t,0,n,4),g(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return e=+e,n>>>=0,o||R(t,0,n,8),g(t,e,n,r,52,8),n+8}i.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return Object.setPrototypeOf(r,i.prototype),r},i.prototype.readUintLE=i.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),y(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),y(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),y(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),y(this,t,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||k(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||k(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);k(this,t,e,n,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);k(this,t,e,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,n){return B(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return B(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),o},i.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var o=t.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var a=i.isBuffer(t)?t:i.from(t,r),u=a.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-e;++s)this[s+e]=a[s%u]}return this};var j=/[^+/0-9A-Za-z-_]/g;function M(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function H(t){return h(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}var $=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)e[r+o]=t[n]+t[o];return e}()},l(p={exports:{}},p.exports),p.exports),b=v.Buffer;v.SlowBuffer,v.INSPECT_MAX_BYTES,v.kMaxLength;var m=function(t,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},m(t,e)};function w(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var E=function(t){function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return w(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),S=function(t){function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return w(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function _(t){return t&&t.Math==Math&&t}function T(){return _("object"==typeof globalThis&&globalThis)||_("object"==typeof window&&window)||_("object"==typeof self&&self)||_("object"==typeof n.g&&n.g)||Function("return this")()}var O=function(t){var e,n="object"==typeof(e=T()).navigator&&"ReactNative"===e.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(n);for(var r=b.alloc(t),o=0;o<t;++o)r[o]=Math.floor(256*Math.random());return r},I=function(){if("undefined"!=typeof window){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(b.alloc(e))}}return void 0!==n.g&&n.g.crypto&&n.g.crypto.getRandomValues?function(t){return n.g.crypto.getRandomValues(b.alloc(t))}:O}();function x(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function N(t){return"object"==typeof t&&null!==t}function A(t,e){var n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(console.warn(e),n=!0),t.apply(this,r)}}function D(t){if(ArrayBuffer.isView(t))return b.from(t.buffer,t.byteOffset,t.byteLength);if(e=t,["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e)))return b.from(t);var e;throw new S("Must use either Buffer or TypedArray")}var L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,P=function(t){return"string"==typeof t&&L.test(t)},C=function(t){if(!P(t))throw new S('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return b.from(e,"hex")},k=function(t,e){return void 0===e&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")},R=Symbol("id"),B=function(){function t(e){if(void 0===e)this.id=t.generate();else if(e instanceof t)this[R]=b.from(e.id),this.__id=e.__id;else if(ArrayBuffer.isView(e)&&16===e.byteLength)this.id=D(e);else{if("string"!=typeof e)throw new S("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");this.id=C(e)}}return Object.defineProperty(t.prototype,"id",{get:function(){return this[R]},set:function(e){this[R]=e,t.cacheHexString&&(this.__id=k(e))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(e){if(void 0===e&&(e=!0),t.cacheHexString&&this.__id)return this.__id;var n=k(this.id,e);return t.cacheHexString&&(this.__id=n),n},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(!e)return!1;if(e instanceof t)return e.id.equals(this.id);try{return new t(e).id.equals(this.id)}catch(t){return!1}},t.prototype.toBinary=function(){return new U(this.id,U.SUBTYPE_UUID)},t.generate=function(){var t=I(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,b.from(t)},t.isValid=function(e){if(!e)return!1;if(e instanceof t)return!0;if("string"==typeof e)return P(e);if(x(e)){if(16!==e.length)return!1;try{return parseInt(e[6].toString(16)[0],10)===U.SUBTYPE_UUID}catch(t){return!1}}return!1},t.createFromHexString=function(e){return new t(C(e))},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}();Object.defineProperty(B.prototype,"_bsontype",{value:"UUID"});var U=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);if(!(null==e||"string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Array.isArray(e)))throw new S("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=n?n:t.BSON_BINARY_SUBTYPE_DEFAULT,null==e?(this.buffer=b.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof e?this.buffer=b.from(e,"binary"):Array.isArray(e)?this.buffer=b.from(e):this.buffer=D(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if("string"==typeof e&&1!==e.length)throw new S("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new S("only accepts single character Uint8Array or Array");var n;if((n="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0])<0||n>255)throw new S("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=n;else{var r=b.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r,this.buffer[this.position++]=n}},t.prototype.write=function(t,e){if(e="number"==typeof e?e:this.position,this.buffer.length<e+t.length){var n=b.alloc(this.buffer.length+t.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(t)?(this.buffer.set(D(t),e),this.position=e+t.byteLength>this.position?e+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,e,t.length,"binary"),this.position=e+t.length>this.position?e+t.length:this.position)},t.prototype.read=function(t,e){return e=e&&e>0?e:this.position,this.buffer.slice(t,t+e)},t.prototype.value=function(t){return(t=!!t)&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(t){return this.buffer.toString(t)},t.prototype.toExtendedJSON=function(t){t=t||{};var e=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return t.legacy?{$binary:e,$type:1===n.length?"0"+n:n}:{$binary:{base64:e,subType:1===n.length?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new B(this.buffer.slice(0,this.position));throw new E('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,n){var r,o;if(n=n||{},"$binary"in e?n.legacy&&"string"==typeof e.$binary&&"$type"in e?(o=e.$type?parseInt(e.$type,16):0,r=b.from(e.$binary,"base64")):"string"!=typeof e.$binary&&(o=e.$binary.subType?parseInt(e.$binary.subType,16):0,r=b.from(e.$binary.base64,"base64")):"$uuid"in e&&(o=4,r=C(e.$uuid)),!r)throw new S("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return new t(r,o)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(U.prototype,"_bsontype",{value:"Binary"});var j=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);this.code=e,this.scope=n}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},t}();Object.defineProperty(j.prototype,"_bsontype",{value:"Code"});var M=function(){function t(e,n,r,o){if(!(this instanceof t))return new t(e,n,r,o);var i=e.split(".");2===i.length&&(r=i.shift(),e=i.shift()),this.collection=e,this.oid=n,this.db=r,this.fields=o||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(t.$db=this.db),t},t.prototype.toExtendedJSON=function(t){t=t||{};var e={$ref:this.collection,$id:this.oid};return t.legacy?e:(this.db&&(e.$db=this.db),e=Object.assign(e,this.fields))},t.fromExtendedJSON=function(e){var n=Object.assign({},e);return delete n.$ref,delete n.$id,delete n.$db,new t(e.$ref,e.$id,e.$db,n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t}();Object.defineProperty(M.prototype,"_bsontype",{value:"DBRef"});var H=void 0;try{H=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}var F=4294967296,G=0x10000000000000000,V=G/2,$={},z={},q=function(){function t(e,n,r){if(void 0===e&&(e=0),!(this instanceof t))return new t(e,n,r);"bigint"==typeof e?Object.assign(this,t.fromBigInt(e,!!n)):"string"==typeof e?Object.assign(this,t.fromString(e,!!n)):(this.low=0|e,this.high=0|n,this.unsigned=!!r),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,n,r){return new t(e,n,r)},t.fromInt=function(e,n){var r,o,i;return n?(i=0<=(e>>>=0)&&e<256)&&(o=z[e])?o:(r=t.fromBits(e,(0|e)<0?-1:0,!0),i&&(z[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(o=$[e])?o:(r=t.fromBits(e,e<0?-1:0,!1),i&&($[e]=r),r)},t.fromNumber=function(e,n){if(isNaN(e))return n?t.UZERO:t.ZERO;if(n){if(e<0)return t.UZERO;if(e>=G)return t.MAX_UNSIGNED_VALUE}else{if(e<=-V)return t.MIN_VALUE;if(e+1>=V)return t.MAX_VALUE}return e<0?t.fromNumber(-e,n).neg():t.fromBits(e%F|0,e/F|0,n)},t.fromBigInt=function(e,n){return t.fromString(e.toString(),n)},t.fromString=function(e,n,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t.ZERO;if("number"==typeof n?(r=n,n=!1):n=!!n,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return t.fromString(e.substring(1),n,r).neg();for(var i=t.fromNumber(Math.pow(r,8)),s=t.ZERO,a=0;a<e.length;a+=8){var u=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+u),r);if(u<8){var f=t.fromNumber(Math.pow(r,u));s=s.mul(f).add(t.fromNumber(c))}else s=(s=s.mul(i)).add(t.fromNumber(c))}return s.unsigned=n,s},t.fromBytes=function(e,n,r){return r?t.fromBytesLE(e,n):t.fromBytesBE(e,n)},t.fromBytesLE=function(e,n){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)},t.fromBytesBE=function(e,n){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)},t.isLong=function(t){return N(t)&&!0===t.__isLong__},t.fromValue=function(e,n){return"number"==typeof e?t.fromNumber(e,n):"string"==typeof e?t.fromString(e,n):t.fromBits(e.low,e.high,"boolean"==typeof n?n:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,c=0,f=0,l=0,p=0;return l+=(p+=i+(65535&e.low))>>>16,p&=65535,f+=(l+=o+u)>>>16,l&=65535,c+=(f+=r+a)>>>16,f&=65535,c+=n+s,c&=65535,t.fromBits(l<<16|p,c<<16|f,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(t){return this.compare(t)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(H){if(!this.unsigned&&-2147483648===this.high&&-1===e.low&&-1===e.high)return this;var n=(this.unsigned?H.div_u:H.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(n,H.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var r,o,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;i=t.UZERO}else{if(this.eq(t.MIN_VALUE))return e.eq(t.ONE)||e.eq(t.NEG_ONE)?t.MIN_VALUE:e.eq(t.MIN_VALUE)?t.ONE:(r=this.shr(1).div(e).shl(1)).eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(o=this.sub(e.mul(r)),i=r.add(o.div(e)));if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=t.ZERO}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),a=s<=48?1:Math.pow(2,s-48),u=t.fromNumber(r),c=u.mul(e);c.isNegative()||c.gt(o);)r-=a,c=(u=t.fromNumber(r,this.unsigned)).mul(e);u.isZero()&&(u=t.ONE),i=i.add(u),o=o.sub(c)}return i},t.prototype.div=function(t){return this.divide(t)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},t.prototype.eq=function(t){return this.equals(t)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e,n=0!==this.high?this.high:this.low;for(e=31;e>0&&0==(n&1<<e);e--);return 0!==this.high?e+33:e+1},t.prototype.greaterThan=function(t){return this.comp(t)>0},t.prototype.gt=function(t){return this.greaterThan(t)},t.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},t.prototype.gte=function(t){return this.greaterThanOrEqual(t)},t.prototype.ge=function(t){return this.greaterThanOrEqual(t)},t.prototype.isEven=function(){return 0==(1&this.low)},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return 1==(1&this.low)},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return 0===this.high&&0===this.low},t.prototype.lessThan=function(t){return this.comp(t)<0},t.prototype.lt=function(t){return this.lessThan(t)},t.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},t.prototype.lte=function(t){return this.lessThanOrEqual(t)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),H){var n=(this.unsigned?H.rem_u:H.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(n,H.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(t){return this.modulo(t)},t.prototype.rem=function(t){return this.modulo(t)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),H){var n=H.mul(this.low,this.high,e.low,e.high);return t.fromBits(n,H.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=65535&this.high,i=this.low>>>16,s=65535&this.low,a=e.high>>>16,u=65535&e.high,c=e.low>>>16,f=65535&e.low,l=0,p=0,h=0,d=0;return h+=(d+=s*f)>>>16,d&=65535,p+=(h+=i*f)>>>16,h&=65535,p+=(h+=s*c)>>>16,h&=65535,l+=(p+=o*f)>>>16,p&=65535,l+=(p+=i*c)>>>16,p&=65535,l+=(p+=s*u)>>>16,p&=65535,l+=r*f+o*c+i*u+s*a,l&=65535,t.fromBits(h<<16|d,l<<16|p,this.unsigned)},t.prototype.mul=function(t){return this.multiply(t)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(t){return!this.equals(t)},t.prototype.neq=function(t){return this.notEquals(t)},t.prototype.ne=function(t){return this.notEquals(t)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(t){return this.shiftLeft(t)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(t){return this.shiftRight(t)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;if(e<32){var r=this.low;return t.fromBits(r>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?t.fromBits(n,0,this.unsigned):t.fromBits(n>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},t.prototype.shru=function(t){return this.shiftRightUnsigned(t)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(t){return this.subtract(t)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*F+(this.low>>>0):this.high*F+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},t.prototype.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(t.MIN_VALUE)){var n=t.fromNumber(e),r=this.div(n),o=r.mul(n).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,a="";;){var u=s.div(i),c=(s.sub(u.mul(i)).toInt()>>>0).toString(e);if((s=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(t){return this.lessThanOrEqual(t)},t.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,n){var r=t.fromString(e.$numberLong);return n&&n.relaxed?r.toNumber():r},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(16777216),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t}();Object.defineProperty(q.prototype,"__isLong__",{value:!0}),Object.defineProperty(q.prototype,"_bsontype",{value:"Long"});var W=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,J=/^(\+|-)?(Infinity|inf)$/i,Y=/^(\+|-)?NaN$/i,K=6111,X=-6176,Z=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Q=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),tt=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),et=/^([-+])?(\d+)?$/;function nt(t){return!isNaN(parseInt(t,10))}function rt(t){var e=q.fromNumber(1e9),n=q.fromNumber(0);if(!(t.parts[0]||t.parts[1]||t.parts[2]||t.parts[3]))return{quotient:t,rem:n};for(var r=0;r<=3;r++)n=(n=n.shiftLeft(32)).add(new q(t.parts[r],0)),t.parts[r]=n.div(e).low,n=n.modulo(e);return{quotient:t,rem:n}}function ot(t,e){throw new S('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var it=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!x(e))throw new S("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new S("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(e){var n,r=!1,o=!1,i=!1,s=0,a=0,u=0,c=0,f=0,l=[0],p=0,h=0,d=0,y=0,g=0,v=0,m=new q(0,0),w=new q(0,0),E=0;if(e.length>=7e3)throw new S(e+" not a valid Decimal128 string");var _=e.match(W),T=e.match(J),O=e.match(Y);if(!_&&!T&&!O||0===e.length)throw new S(e+" not a valid Decimal128 string");if(_){var I=_[2],x=_[4],N=_[5],A=_[6];x&&void 0===A&&ot(e,"missing exponent power"),x&&void 0===I&&ot(e,"missing exponent base"),void 0===x&&(N||A)&&ot(e,"missing e before exponent")}if("+"!==e[E]&&"-"!==e[E]||(r="-"===e[E++]),!nt(e[E])&&"."!==e[E]){if("i"===e[E]||"I"===e[E])return new t(b.from(r?Q:tt));if("N"===e[E])return new t(b.from(Z))}for(;nt(e[E])||"."===e[E];)"."!==e[E]?(p<34&&("0"!==e[E]||i)&&(i||(f=a),i=!0,l[h++]=parseInt(e[E],10),p+=1),i&&(u+=1),o&&(c+=1),a+=1,E+=1):(o&&ot(e,"contains multiple periods"),o=!0,E+=1);if(o&&!a)throw new S(e+" not a valid Decimal128 string");if("e"===e[E]||"E"===e[E]){var D=e.substr(++E).match(et);if(!D||!D[2])return new t(b.from(Z));g=parseInt(D[0],10),E+=D[0].length}if(e[E])return new t(b.from(Z));if(d=0,p){if(y=p-1,1!==(s=u))for(;0===l[f+s-1];)s-=1}else d=0,y=0,l[0]=0,u=1,p=1,s=0;for(g<=c&&c-g>16384?g=X:g-=c;g>K;){if((y+=1)-d>34){if(l.join("").match(/^0+$/)){g=K;break}ot(e,"overflow")}g-=1}for(;g<X||p<u;){if(0===y&&s<p){g=X,s=0;break}if(p<u?u-=1:y-=1,g<K)g+=1;else{if(l.join("").match(/^0+$/)){g=K;break}ot(e,"overflow")}}if(y-d+1<s){var L=a;o&&(f+=1,L+=1),r&&(f+=1,L+=1);var P=parseInt(e[f+y+1],10),C=0;if(P>=5&&(C=1,5===P))for(C=l[y]%2==1?1:0,v=f+y+2;v<L;v++)if(parseInt(e[v],10)){C=1;break}if(C)for(var k=y;k>=0;k--)if(++l[k]>9&&(l[k]=0,0===k)){if(!(g<K))return new t(b.from(r?Q:tt));g+=1,l[k]=1}}if(m=q.fromNumber(0),w=q.fromNumber(0),0===s)m=q.fromNumber(0),w=q.fromNumber(0);else if(y-d<17)for(k=d,w=q.fromNumber(l[k++]),m=new q(0,0);k<=y;k++)w=(w=w.multiply(q.fromNumber(10))).add(q.fromNumber(l[k]));else{for(k=d,m=q.fromNumber(l[k++]);k<=y-17;k++)m=(m=m.multiply(q.fromNumber(10))).add(q.fromNumber(l[k]));for(w=q.fromNumber(l[k++]);k<=y;k++)w=(w=w.multiply(q.fromNumber(10))).add(q.fromNumber(l[k]))}var R,B,U,j,M=function(t,e){if(!t&&!e)return{high:q.fromNumber(0),low:q.fromNumber(0)};var n=t.shiftRightUnsigned(32),r=new q(t.getLowBits(),0),o=e.shiftRightUnsigned(32),i=new q(e.getLowBits(),0),s=n.multiply(o),a=n.multiply(i),u=r.multiply(o),c=r.multiply(i);return s=s.add(a.shiftRightUnsigned(32)),a=new q(a.getLowBits(),0).add(u).add(c.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:c=a.shiftLeft(32).add(new q(c.getLowBits(),0))}}(m,q.fromString("100000000000000000"));M.low=M.low.add(w),B=w,((U=(R=M.low).high>>>0)<(j=B.high>>>0)||U===j&&R.low>>>0<B.low>>>0)&&(M.high=M.high.add(q.fromNumber(1))),n=g+6176;var H={low:q.fromNumber(0),high:q.fromNumber(0)};M.high.shiftRightUnsigned(49).and(q.fromNumber(1)).equals(q.fromNumber(1))?(H.high=H.high.or(q.fromNumber(3).shiftLeft(61)),H.high=H.high.or(q.fromNumber(n).and(q.fromNumber(16383).shiftLeft(47))),H.high=H.high.or(M.high.and(q.fromNumber(0x7fffffffffff)))):(H.high=H.high.or(q.fromNumber(16383&n).shiftLeft(49)),H.high=H.high.or(M.high.and(q.fromNumber(562949953421311)))),H.low=M.low,r&&(H.high=H.high.or(q.fromString("9223372036854775808")));var F=b.alloc(16);return E=0,F[E++]=255&H.low.low,F[E++]=H.low.low>>8&255,F[E++]=H.low.low>>16&255,F[E++]=H.low.low>>24&255,F[E++]=255&H.low.high,F[E++]=H.low.high>>8&255,F[E++]=H.low.high>>16&255,F[E++]=H.low.high>>24&255,F[E++]=255&H.high.low,F[E++]=H.high.low>>8&255,F[E++]=H.high.low>>16&255,F[E++]=H.high.low>>24&255,F[E++]=255&H.high.high,F[E++]=H.high.high>>8&255,F[E++]=H.high.high>>16&255,F[E++]=H.high.high>>24&255,new t(F)},t.prototype.toString=function(){for(var t,e=0,n=new Array(36),r=0;r<n.length;r++)n[r]=0;var o,i,s,a=0,u=!1,c={parts:[0,0,0,0]},f=[];a=0;var l=this.bytes,p=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,h=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,d=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,y=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24;a=0,(new q(p,h),new q(d,y)).lessThan(q.ZERO)&&f.push("-");var g=y>>26&31;if(g>>3==3){if(30===g)return f.join("")+"Infinity";if(31===g)return"NaN";t=y>>15&16383,o=8+(y>>14&1)}else o=y>>14&7,t=y>>17&16383;var v=t-6176;if(c.parts[0]=(16383&y)+((15&o)<<14),c.parts[1]=d,c.parts[2]=h,c.parts[3]=p,0===c.parts[0]&&0===c.parts[1]&&0===c.parts[2]&&0===c.parts[3])u=!0;else for(s=3;s>=0;s--){var b=0,m=rt(c);if(c=m.quotient,b=m.rem.low)for(i=8;i>=0;i--)n[9*s+i]=b%10,b=Math.floor(b/10)}if(u)e=1,n[a]=0;else for(e=36;!n[a];)e-=1,a+=1;var w=e-1+v;if(w>=34||w<=-7||v>0){if(e>34)return f.push("".concat(0)),v>0?f.push("E+".concat(v)):v<0&&f.push("E".concat(v)),f.join("");for(f.push("".concat(n[a++])),(e-=1)&&f.push("."),r=0;r<e;r++)f.push("".concat(n[a++]));f.push("E"),w>0?f.push("+".concat(w)):f.push("".concat(w))}else if(v>=0)for(r=0;r<e;r++)f.push("".concat(n[a++]));else{var E=e+v;if(E>0)for(r=0;r<E;r++)f.push("".concat(n[a++]));else f.push("0");for(f.push(".");E++<0;)f.push("0");for(r=0;r<e-Math.max(E-1,0);r++)f.push("".concat(n[a++]))}return f.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t}();Object.defineProperty(it.prototype,"_bsontype",{value:"Decimal128"});var st=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:(Number.isInteger(this.value)?(e=this.value.toFixed(1)).length>=13&&(e=this.value.toExponential(13).toUpperCase()):e=this.value.toString(),{$numberDouble:e});var e},t.fromExtendedJSON=function(e,n){var r=parseFloat(e.$numberDouble);return n&&n.relaxed?r:new t(r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},t}();Object.defineProperty(st.prototype,"_bsontype",{value:"Double"});var at=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=0|+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,n){return n&&n.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t}();Object.defineProperty(at.prototype,"_bsontype",{value:"Int32"});var ut=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t}();Object.defineProperty(ut.prototype,"_bsontype",{value:"MaxKey"});var ct=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t}();Object.defineProperty(ct.prototype,"_bsontype",{value:"MinKey"});var ft=new RegExp("^[0-9a-fA-F]{24}$"),lt=null,pt=Symbol("id"),ht=function(){function t(e){if(!(this instanceof t))return new t(e);var n;if("object"==typeof e&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new S("Argument passed in must have an id that is of type string or Buffer");n="toHexString"in e&&"function"==typeof e.toHexString?b.from(e.toHexString(),"hex"):e.id}else n=e;if(null==n||"number"==typeof n)this[pt]=t.generate("number"==typeof n?n:void 0);else if(ArrayBuffer.isView(n)&&12===n.byteLength)this[pt]=n instanceof b?n:D(n);else{if("string"!=typeof n)throw new S("Argument passed in does not match the accepted types");if(12===n.length){var r=b.from(n);if(12!==r.byteLength)throw new S("Argument passed in must be a string of 12 bytes");this[pt]=r}else{if(24!==n.length||!ft.test(n))throw new S("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[pt]=b.from(n,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[pt]},set:function(e){this[pt]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));var n=t.getInc(),r=b.alloc(12);return r.writeUInt32BE(e,0),null===lt&&(lt=I(5)),r[4]=lt[0],r[5]=lt[1],r[6]=lt[2],r[7]=lt[3],r[8]=lt[4],r[11]=255&n,r[10]=n>>8&255,r[9]=n>>16&255,r},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(null==e)return!1;if(e instanceof t)return this[pt][11]===e[pt][11]&&this[pt].equals(e[pt]);if("string"==typeof e&&t.isValid(e)&&12===e.length&&x(this.id))return e===b.prototype.toString.call(this.id,"latin1");if("string"==typeof e&&t.isValid(e)&&24===e.length)return e.toLowerCase()===this.toHexString();if("string"==typeof e&&t.isValid(e)&&12===e.length)return b.from(e).equals(this.id);if("object"==typeof e&&"toHexString"in e&&"function"==typeof e.toHexString){var n=e.toHexString(),r=this.toHexString().toLowerCase();return"string"==typeof n&&n.toLowerCase()===r}return!1},t.prototype.getTimestamp=function(){var t=new Date,e=this.id.readUInt32BE(0);return t.setTime(1e3*Math.floor(e)),t},t.createPk=function(){return new t},t.createFromTime=function(e){var n=b.from([0,0,0,0,0,0,0,0,0,0,0,0]);return n.writeUInt32BE(e,0),new t(n)},t.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new S("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(b.from(e,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(t){return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(16777215*Math.random()),t}();Object.defineProperty(ht.prototype,"generate",{value:A((function(t){return ht.generate(t)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(ht.prototype,"getInc",{value:A((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht.prototype,"get_inc",{value:A((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht,"get_inc",{value:A((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht.prototype,"_bsontype",{value:"ObjectID"});var dt=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);if(this.pattern=e,this.options=(null!=n?n:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new E("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new E("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var r=0;r<this.options.length;r++)if("i"!==this.options[r]&&"m"!==this.options[r]&&"x"!==this.options[r]&&"l"!==this.options[r]&&"s"!==this.options[r]&&"u"!==this.options[r])throw new E("The regular expression option [".concat(this.options[r],"] is not supported"))}return t.parseOptions=function(t){return t?t.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(t){return(t=t||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e){if("string"==typeof e.$regex)return new t(e.$regex,t.parseOptions(e.$options));if("BSONRegExp"===e.$regex._bsontype)return e}if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new S("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(dt.prototype,"_bsontype",{value:"BSONRegExp"});var yt=function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t}();Object.defineProperty(yt.prototype,"_bsontype",{value:"Symbol"});var gt=function(t){function e(n,r){var o=this;return o instanceof e?(o=q.isLong(n)?t.call(this,n.low,n.high,!0)||this:N(n)&&void 0!==n.t&&void 0!==n.i?t.call(this,n.i,n.t,!0)||this:t.call(this,n,r,!0)||this,Object.defineProperty(o,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),o):new e(n,r)}return w(e,t),e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(t){return new e(q.fromInt(t,!0))},e.fromNumber=function(t){return new e(q.fromNumber(t,!0))},e.fromBits=function(t,n){return new e(t,n)},e.fromString=function(t,n){return new e(q.fromString(t,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(t){return new e(t.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=q.MAX_UNSIGNED_VALUE,e}(q);var vt=2147483647,bt=-2147483648,mt=0x8000000000000000,wt=-0x8000000000000000,Et={$oid:ht,$binary:U,$uuid:U,$symbol:yt,$numberInt:at,$numberDecimal:it,$numberDouble:st,$numberLong:q,$minKey:ct,$maxKey:ut,$regex:dt,$regularExpression:dt,$timestamp:gt};function St(t,e){if(void 0===e&&(e={}),"number"==typeof t){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=bt&&t<=vt)return new at(t);if(t>=wt&&t<=mt)return q.fromNumber(t)}return new st(t)}if(null==t||"object"!=typeof t)return t;if(t.$undefined)return null;for(var n=Object.keys(t).filter((function(e){return e.startsWith("$")&&null!=t[e]})),r=0;r<n.length;r++){var o=Et[n[r]];if(o)return o.fromExtendedJSON(t,e)}if(null!=t.$date){var i=t.$date,s=new Date;return e.legacy?"number"==typeof i?s.setTime(i):"string"==typeof i&&s.setTime(Date.parse(i)):"string"==typeof i?s.setTime(Date.parse(i)):q.isLong(i)?s.setTime(i.toNumber()):"number"==typeof i&&e.relaxed&&s.setTime(i),s}if(null!=t.$code){var a=Object.assign({},t);return t.$scope&&(a.$scope=St(t.$scope)),j.fromExtendedJSON(t)}if(function(t){return N(t)&&null!=t.$id&&"string"==typeof t.$ref&&(null==t.$db||"string"==typeof t.$db)}(t)||t.$dbPointer){var u=t.$ref?t:t.$dbPointer;if(u instanceof M)return u;var c=Object.keys(u).filter((function(t){return t.startsWith("$")})),f=!0;if(c.forEach((function(t){-1===["$ref","$id","$db"].indexOf(t)&&(f=!1)})),f)return M.fromExtendedJSON(u)}return t}function _t(t){var e=t.toISOString();return 0!==t.getUTCMilliseconds()?e:e.slice(0,-5)+"Z"}function Tt(t,e){if(("object"==typeof t||"function"==typeof t)&&null!==t){var n=e.seenObjects.findIndex((function(e){return e.obj===t}));if(-1!==n){var r=e.seenObjects.map((function(t){return t.propertyName})),o=r.slice(0,n).map((function(t){return"".concat(t," -> ")})).join(""),i=r[n],s=" -> "+r.slice(n+1,r.length-1).map((function(t){return"".concat(t," -> ")})).join(""),a=r[r.length-1],u=" ".repeat(o.length+i.length/2),c="-".repeat(s.length+(i.length+a.length)/2-1);throw new S("Converting circular structure to EJSON:\n"+" ".concat(o).concat(i).concat(s).concat(a,"\n")+" ".concat(u,"\\").concat(c,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return function(t,e){return t.map((function(t,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Tt(t,e)}finally{e.seenObjects.pop()}}))}(t,e);if(void 0===t)return null;if(t instanceof Date||N(p=t)&&"[object Date]"===Object.prototype.toString.call(p)){var f=t.getTime(),l=f>-1&&f<2534023188e5;return e.legacy?e.relaxed&&l?{$date:t.getTime()}:{$date:_t(t)}:e.relaxed&&l?{$date:_t(t)}:{$date:{$numberLong:t.getTime().toString()}}}var p;if(!("number"!=typeof t||e.relaxed&&isFinite(t))){if(Math.floor(t)===t){var h=t>=wt&&t<=mt;if(t>=bt&&t<=vt)return{$numberInt:t.toString()};if(h)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(t)){var d=t.flags;if(void 0===d){var y=t.toString().match(/[gimuy]*$/);y&&(d=y[0])}return new dt(t.source,d).toExtendedJSON(e)}return null!=t&&"object"==typeof t?function(t,e){if(null==t||"object"!=typeof t)throw new E("not an object instance");var n=t._bsontype;if(void 0===n){var r={};for(var o in t){e.seenObjects.push({propertyName:o,obj:null});try{var i=Tt(t[o],e);"__proto__"===o?Object.defineProperty(r,o,{value:i,writable:!0,enumerable:!0,configurable:!0}):r[o]=i}finally{e.seenObjects.pop()}}return r}if(function(t){return N(t)&&Reflect.has(t,"_bsontype")&&"string"==typeof t._bsontype}(t)){var s=t;if("function"!=typeof s.toExtendedJSON){var a=It[t._bsontype];if(!a)throw new S("Unrecognized or invalid _bsontype: "+t._bsontype);s=a(s)}return"Code"===n&&s.scope?s=new j(s.code,Tt(s.scope,e)):"DBRef"===n&&s.oid&&(s=new M(Tt(s.collection,e),Tt(s.oid,e),Tt(s.db,e),Tt(s.fields,e))),s.toExtendedJSON(e)}throw new E("_bsontype must be a string, but was: "+typeof n)}(t,e):t}var Ot,It={Binary:function(t){return new U(t.value(),t.sub_type)},Code:function(t){return new j(t.code,t.scope)},DBRef:function(t){return new M(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new it(t.bytes)},Double:function(t){return new st(t.value)},Int32:function(t){return new at(t.value)},Long:function(t){return q.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_)},MaxKey:function(){return new ut},MinKey:function(){return new ct},ObjectID:function(t){return new ht(t)},ObjectId:function(t){return new ht(t)},BSONRegExp:function(t){return new dt(t.pattern,t.options)},Symbol:function(t){return new yt(t.value)},Timestamp:function(t){return gt.fromBits(t.low,t.high)}};!function(t){function e(t,e){var n=Object.assign({},{relaxed:!0,legacy:!1},e);return"boolean"==typeof n.relaxed&&(n.strict=!n.relaxed),"boolean"==typeof n.strict&&(n.relaxed=!n.strict),JSON.parse(t,(function(t,e){if(-1!==t.indexOf("\0"))throw new E("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(t)));return St(e,n)}))}function n(t,e,n,r){null!=n&&"object"==typeof n&&(r=n,n=0),null==e||"object"!=typeof e||Array.isArray(e)||(r=e,e=void 0,n=0);var o=Tt(t,Object.assign({relaxed:!0,legacy:!1},r,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(o,e,n)}t.parse=e,t.stringify=n,t.serialize=function(t,e){return e=e||{},JSON.parse(n(t,e))},t.deserialize=function(t,n){return n=n||{},e(JSON.stringify(t),n)}}(Ot||(Ot={}));var xt=T();xt.Map?xt.Map:function(){function t(t){void 0===t&&(t=[]),this._keys=[],this._values={};for(var e=0;e<t.length;e++)if(null!=t[e]){var n=t[e],r=n[0],o=n[1];this._keys.push(r),this._values[r]={v:o,i:this._keys.length-1}}}t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(t){var e=this._values[t];return null!=e&&(delete this._values[t],this._keys.splice(e.i,1),!0)},t.prototype.entries=function(){var t=this,e=0;return{next:function(){var n=t._keys[e++];return{value:void 0!==n?[n,t._values[n].v]:void 0,done:void 0===n}}}},t.prototype.forEach=function(t,e){e=e||this;for(var n=0;n<this._keys.length;n++){var r=this._keys[n];t.call(e,this._values[r].v,r,e)}},t.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},t.prototype.has=function(t){return null!=this._values[t]},t.prototype.keys=function(){var t=this,e=0;return{next:function(){var n=t._keys[e++];return{value:void 0!==n?n:void 0,done:void 0===n}}}},t.prototype.set=function(t,e){return this._values[t]?(this._values[t].v=e,this):(this._keys.push(t),this._values[t]={v:e,i:this._keys.length-1},this)},t.prototype.values=function(){var t=this,e=0;return{next:function(){var n=t._keys[e++];return{value:void 0!==n?t._values[n].v:void 0,done:void 0===n}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0})}(),Math.pow(2,63),Math.pow(2,63);var Nt=Math.pow(2,53),At=-Math.pow(2,53);q.fromNumber(Nt),q.fromNumber(At),new Set(["$db","$ref","$id","$clusterTime"]);var Dt=new Uint8Array(8);new DataView(Dt.buffer,Dt.byteOffset,Dt.byteLength);b.alloc(17825792);var Lt=function(){function t(t){t=t||{},this.triggerID=t.id||t.triggerID,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.variation=t.variation,this.props=t.props}return t.prototype.isExpired=function(){return this.expireAt<(new Date).getTime()},t}(),Pt=function(t,e,n,r){void 0===e&&(e={}),this.name=t,this.properties=e,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.id=r?new ht(r):new ht,this.occurred=(new Date).toISOString(),n&&(this.trigger=new Lt(n)),this.newEvent=!r},Ct=function(){function t(t){t.s&&(this.s=new Ut(t.s)),t.g&&(this.g=new $t(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const kt=new RegExp("[^#a-f\\d]","gi"),Rt=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var Bt,Ut=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||kt.test(t)||!Rt.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const r=Number.parseInt(t,16),o=r>>16,i=r>>8&255,s=255&r,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[o,i,s,a]:"css"===e.format?`rgb(${o} ${i} ${s}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:o,green:i,blue:s,alpha:a}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),jt=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new Ut(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return Bt[null!==(t=this.s)&&void 0!==t?t:Bt.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(Bt||(Bt={}));var Mt,Ht=function(t){var e;t=null!=t?t:{},this.name=t.name,this.fonts=null===(e=t.fonts)||void 0===e?void 0:e.map((function(t){return new Ft(t)}))},Ft=function(){function t(t){t=null!=t?t:{},this.style=t.style,this.url=t.url}return t.prototype.getFontDescriptor=function(){return{style:this.style===Mt.ITALICS||this.style===Mt.BOLD_ITALICS?"italic":"normal",weight:this.style===Mt.BOLD_ITALICS||this.style===Mt.BOLD?"700":"400"}},t.prototype.getURL=function(){return"url('".concat(this.url,"') format('truetype')")},t}();!function(t){t[t.REGULAR=1]="REGULAR",t[t.ITALICS=2]="ITALICS",t[t.BOLD=3]="BOLD",t[t.BOLD_ITALICS=4]="BOLD_ITALICS"}(Mt||(Mt={}));var Gt,Vt=function(){function t(t){t=null!=t?t:{},this.s=t.s,this.lh=t.lh,t.fmly&&(this.fmly=new Ht(t.fmly))}return Object.defineProperty(t.prototype,"family",{get:function(){return this.fmly},enumerable:!1,configurable:!0}),t}(),$t=function(){function t(t){this.r=t.r,t.c&&(this.c=new Ut(t.c)),t.fb&&(this.fb=new Ut(t.fb))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fallback",{get:function(){var e;return null!==(e=this.fb)&&void 0!==e?e:t.DEFAULT_FALLBACK},enumerable:!1,configurable:!0}),t.DEFAULT_FALLBACK=new Ut({h:"#000000",a:50}),t}(),zt=function(){function t(t){var e,n,r,o;t=null!=t?t:{},this.blur=null!==(e=t.blur)&&void 0!==e?e:0,this.spr=null!==(n=t.spr)&&void 0!==n?n:0,this.x=null!==(r=t.x)&&void 0!==r?r:0,this.y=null!==(o=t.y)&&void 0!==o?o:0,this.clr=new Ut(t.clr)}return t.prototype.getStyle=function(t){return"".concat(this.x*t,"px ").concat(this.y*t,"px ")+"".concat(this.blur*t,"px ").concat(this.spr*t,"px ").concat(this.clr.rgba)},t}(),qt=function(){function t(t){var e,n,r,o;t=null!=t?t:{},this.pl=null!==(e=t.pl)&&void 0!==e?e:0,this.pr=null!==(n=t.pr)&&void 0!==n?n:0,this.pt=null!==(r=t.pt)&&void 0!==r?r:0,this.pb=null!==(o=t.pb)&&void 0!==o?o:0}return t.prototype.getHorizontal=function(){return this.pl+this.pr},t.prototype.getVertical=function(){return this.pt+this.pb},t.prototype.getPaddingCSS=function(){return"".concat(this.pt,"px ").concat(this.pr,"px ").concat(this.pb,"px ").concat(this.pl,"px")},t}(),Wt=function(){function t(t){(null==t?void 0:t.rot)&&(this.rot=t.rot)}return Object.defineProperty(t.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),t}(),Jt=function(){function t(t){this.t=t.t,t.bg&&(this.bg=new Ct(t.bg)),t.br&&(this.br=new jt(t.br)),t.shd&&(this.shd=new zt(t.shd)),t.spc&&(this.spc=new qt(t.spc)),this.trf=new Wt(t.trf),this.clc=t.clc,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y,this.a=t.a}return Object.defineProperty(t.prototype,"alpha",{get:function(){var t;return null!==(t=this.a)&&void 0!==t?t:100},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return Gt[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}();!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(Gt||(Gt={}));var Yt,Kt,Xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zt=function(t){function e(e){return t.call(this,e)||this}return Xt(e,t),e}(Jt),Qt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),te=function(t){function e(e){var n=t.call(this,e)||this;return n.src=e.src,n}return Qt(e,t),e}(Jt),ee=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ne=function(t){function e(e){var n=t.call(this,e)||this;return n.alg=Yt.START,n.prs=e.prs,n.alg=e.alg,e.f&&(n.f=new Vt(e.f)),e.c&&(n.c=new Ut(e.c)),n}return ee(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(Jt);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(Yt||(Yt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(Kt||(Kt={}));var re,oe,ie,se=function(){function e(t,e){this._startTime=t,this._triggerData=e}return Object.defineProperty(e.prototype,"startTime",{get:function(){return this._startTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"triggerData",{get:function(){return this._triggerData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootClassName",{get:function(){var e=this.triggerData.id.slice(-6);return"test"===e&&(e=this.startTime.getTime().toString()),t.IN_APP_WRAPPER_NAME+"-"+e},enumerable:!1,configurable:!0}),e.prototype.onClose=function(t){this.closeCallback=t},e.prototype.closeInApp=function(t){var e={eventName:t,duration:((new Date).getTime()-this.startTime.getTime())/1e3};this.closeCallback&&this.closeCallback(e)},e}(),ae=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue=function(t){function e(e){var n,r,o,i=this;return(i=t.call(this,e)||this).o=null!==(n=e.o)&&void 0!==n?n:re.C,i.w=null!==(r=i.w)&&void 0!==r?r:1080,i.h=null!==(o=i.h)&&void 0!==o?o:1920,i}return ae(e,t),e.prototype.getOrigin=function(){return this.o},e}(Jt);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(re||(re={})),function(t){t[t.ABOVE_PAGE=1]="ABOVE_PAGE",t[t.EMBEDDED=2]="EMBEDDED"}(oe||(oe={})),function(t){t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH"}(ie||(ie={}));var ce,fe,le=function(){function t(t){t=null!=t?t:{},this.en=t.en,this.ex=t.ex}return t.prototype.getEnterAnimation=function(){switch(this.en){case ce.SLIDE_IN_TOP:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case ce.SLIDE_IN_DOWN:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case ce.SLIDE_IN_LEFT:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case ce.SLIDE_IN_RIGHT:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case ce.SLIDE_IN_TOP_LEFT:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case ce.SLIDE_IN_TOP_RIGHT:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case ce.SLIDE_IN_BOTTOM_LEFT:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case ce.SLIDE_IN_BOTTOM_RIGHT:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case ce.POP:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}},t.prototype.getExitAnimation=function(){switch(this.ex){case fe.SLIDE_OUT_TOP:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case fe.SLIDE_OUT_DOWN:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case fe.SLIDE_OUT_LEFT:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case fe.SLIDE_OUT_RIGHT:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case fe.SLIDE_OUT_TOP_LEFT:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case fe.SLIDE_OUT_TOP_RIGHT:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case fe.SLIDE_OUT_BOTTOM_LEFT:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case fe.SLIDE_OUT_BOTTOM_RIGHT:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case fe.POP:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}},t}();!function(t){t[t.NONE=1]="NONE",t[t.SLIDE_IN_TOP=2]="SLIDE_IN_TOP",t[t.SLIDE_IN_DOWN=3]="SLIDE_IN_DOWN",t[t.SLIDE_IN_LEFT=4]="SLIDE_IN_LEFT",t[t.SLIDE_IN_RIGHT=5]="SLIDE_IN_RIGHT",t[t.SLIDE_IN_TOP_LEFT=6]="SLIDE_IN_TOP_LEFT",t[t.SLIDE_IN_TOP_RIGHT=7]="SLIDE_IN_TOP_RIGHT",t[t.SLIDE_IN_BOTTOM_LEFT=8]="SLIDE_IN_BOTTOM_LEFT",t[t.SLIDE_IN_BOTTOM_RIGHT=9]="SLIDE_IN_BOTTOM_RIGHT",t[t.POP=10]="POP"}(ce||(ce={})),function(t){t[t.NONE=1]="NONE",t[t.SLIDE_OUT_TOP=2]="SLIDE_OUT_TOP",t[t.SLIDE_OUT_DOWN=3]="SLIDE_OUT_DOWN",t[t.SLIDE_OUT_LEFT=4]="SLIDE_OUT_LEFT",t[t.SLIDE_OUT_RIGHT=5]="SLIDE_OUT_RIGHT",t[t.SLIDE_OUT_TOP_LEFT=6]="SLIDE_OUT_TOP_LEFT",t[t.SLIDE_OUT_TOP_RIGHT=7]="SLIDE_OUT_TOP_RIGHT",t[t.SLIDE_OUT_BOTTOM_LEFT=8]="SLIDE_OUT_BOTTOM_LEFT",t[t.SLIDE_OUT_BOTTOM_RIGHT=9]="SLIDE_OUT_BOTTOM_RIGHT",t[t.POP=10]="POP"}(fe||(fe={}));var pe,he=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),de=function(e){function n(n){var r,o,i,s=this;return n=null!=n?n:{},(s=e.call(this,n)||this).gvt=null!==(r=n.gvt)&&void 0!==r?r:pe.C,s.max=n.max,s.cover=null===(o=n.cover)||void 0===o||o,s.anim=new le(n.anim),s.embedded=n.embedded,s.position=null!==(i=n.position)&&void 0!==i?i:oe.ABOVE_PAGE,s.spc||(s.spc=new qt({pl:t.IN_APP_DEFAULT_PADDING,pr:t.IN_APP_DEFAULT_PADDING,pt:t.IN_APP_DEFAULT_PADDING,pb:t.IN_APP_DEFAULT_PADDING})),s}return he(n,e),n.prototype.isEmbedded=function(){return this.position===oe.EMBEDDED&&!!this.embedded},n.prototype.getEmbeddedSelector=function(){return".letscooee-engagement.container-".concat(this.embedded)},n}(Jt),ye=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ge=function(t){function e(e){var n=this;return e=null!=e?e:{},(n=t.call(this,e)||this).elems=[],n.cont=new ue(e.cont),n.mob=new de(e.mob),n.bg||(n.bg=n.cont.bg,delete n.cont.bg),e.elems.forEach((function(t){t.t===Gt.IMAGE?n.elems.push(new te(t)):t.t===Gt.TEXT||t.t===Gt.BUTTON?n.elems.push(new ne(t)):t.t===Gt.SHAPE&&n.elems.push(new Zt(t))})),n}return ye(e,t),e.prototype.getStylesForWrapper=function(){return this.cover?{}:((t=this.gvt===pe.NW?{top:0,left:0}:this.gvt===pe.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===pe.NE?{top:0,right:0}:this.gvt===pe.E?{top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===pe.SE?{bottom:0,right:0}:this.gvt===pe.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===pe.SW?{bottom:0,left:0}:this.gvt===pe.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).overflow="visible",t);var t},e.prototype.getFlexStylesForContainer=function(){var t,e,n={display:"flex",flexDirection:"row"};return this.gvt===pe.NW?(t="flex-start",e="flex-start"):this.gvt===pe.N?(t="center",e="flex-start"):this.gvt===pe.NE?(t="flex-end",e="flex-start"):this.gvt===pe.W?(t="flex-start",e="center"):this.gvt===pe.E?(t="flex-end",e="center"):this.gvt===pe.SW?(t="flex-start",e="flex-end"):this.gvt===pe.S?(t="center",e="flex-end"):this.gvt===pe.SE?(t="flex-end",e="flex-end"):(t="center",e="center"),n.alignItems=e,n.justifyContent=t,n.overflow="visible",n},e.prototype.overrideForMobileView=function(){var t,e,n,r,o,i,s,a;this.max=null!==(t=this.mob.max)&&void 0!==t?t:this.max,this.cover=null!==(e=this.mob.cover)&&void 0!==e?e:this.cover,this.gvt=null!==(n=this.mob.gvt)&&void 0!==n?n:this.gvt,this.bg=null!==(r=this.mob.bg)&&void 0!==r?r:this.bg,this.spc=null!==(o=this.mob.spc)&&void 0!==o?o:this.spc,this.anim=null!==(i=this.mob.anim)&&void 0!==i?i:this.anim,this.position=null!==(s=this.mob.position)&&void 0!==s?s:this.position,this.embedded=null!==(a=this.mob.embedded)&&void 0!==a?a:this.embedded},e}(de);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(pe||(pe={}));var ve=function(){function t(t){var e,n;this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.variation=t.variation,this.ian=t.ian?new ge(t.ian):void 0,this.previewType=t.previewType,this.delay=null!==(e=t.delay)&&void 0!==e?e:0,this.occurred=null!==(n=t.occurred)&&void 0!==n?n:(new Date).toISOString(),this.props=t.props}return t.prototype.shouldDelay=function(){return this.delay>0},t.prototype.getDelaySeconds=function(){var t=new Date(this.occurred),e=(new Date).getTime()-t.getTime();return 1e3*this.delay-e},t}(),be=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},me=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},we=function(){function t(){this.loadedFonts=[]}return t.prototype.loadAllFonts=function(t){var e;return be(this,void 0,void 0,(function(){var n=this;return me(this,(function(r){return null===(e=t.elems)||void 0===e||e.forEach((function(t){t instanceof ne&&n.loadFamily(t.font.family)})),[2]}))}))},t.prototype.loadFamily=function(t){return be(this,void 0,void 0,(function(){var e;return me(this,(function(n){switch(n.label){case 0:return(null==t?void 0:t.fonts)?this.loadedFonts.indexOf(t.name)>-1?[2]:(e=[],t.fonts.forEach((function(n){if(n.url){var r=new FontFace(t.name,n.getURL(),n.getFontDescriptor());e.push(r.load())}})),this.loadedFonts.push(t.name),[4,Promise.all(e)]):[2];case 1:return n.sent().forEach((function(t){document.fonts.add(t)})),[2]}}))}))},t}(),Ee=function(t,e){return Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ee(t,e)};function Se(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ee(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function _e(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Te(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function Oe(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function Ie(t){return"function"==typeof t}function xe(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var Ne=xe((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Ae(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var De=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var s=_e(i),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else i.remove(this);var u=this.initialTeardown;if(Ie(u))try{u()}catch(t){o=t instanceof Ne?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var f=_e(c),l=f.next();!l.done;l=f.next()){var p=l.value;try{Ce(p)}catch(t){o=null!=o?o:[],t instanceof Ne?o=Oe(Oe([],Te(o)),Te(t.errors)):o.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(o)throw new Ne(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Ce(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Ae(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Ae(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Le=De.EMPTY;function Pe(t){return t instanceof De||t&&"closed"in t&&Ie(t.remove)&&Ie(t.add)&&Ie(t.unsubscribe)}function Ce(t){Ie(t)?t():t.unsubscribe()}var ke=null,Re=null,Be=void 0,Ue=!1,je=!1,Me={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=Me.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,Oe([t,e],Te(n))):setTimeout.apply(void 0,Oe([t,e],Te(n)))},clearTimeout:function(t){var e=Me.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function He(){}var Fe=Ge("C",void 0,void 0);function Ge(t,e,n){return{kind:t,value:e,error:n}}var Ve=null;function $e(t){if(Ue){var e=!Ve;if(e&&(Ve={errorThrown:!1,error:null}),t(),e){var n=Ve,r=n.errorThrown,o=n.error;if(Ve=null,r)throw o}}else t()}var ze=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Pe(e)&&e.add(n)):n.destination=Ze,n}return Se(e,t),e.create=function(t,e,n){return new Ye(t,e,n)},e.prototype.next=function(t){this.isStopped?Xe(function(t){return Ge("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Xe(Ge("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Xe(Fe,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(De),qe=Function.prototype.bind;function We(t,e){return qe.call(t,e)}var Je=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ke(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ke(t)}else Ke(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ke(t)}},t}(),Ye=function(t){function e(e,n,r){var o,i,s=t.call(this)||this;return Ie(e)||!e?o={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&je?((i=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},o={next:e.next&&We(e.next,i),error:e.error&&We(e.error,i),complete:e.complete&&We(e.complete,i)}):o=e,s.destination=new Je(o),s}return Se(e,t),e}(ze);function Ke(t){var e;Ue?(e=t,Ue&&Ve&&(Ve.errorThrown=!0,Ve.error=e)):function(t){Me.setTimeout((function(){if(!ke)throw t;ke(t)}))}(t)}function Xe(t,e){var n=Re;n&&Me.setTimeout((function(){return n(t,e)}))}var Ze={closed:!0,next:He,error:function(t){throw t},complete:He},Qe="function"==typeof Symbol&&Symbol.observable||"@@observable";function tn(t){return t}function en(t){return 0===t.length?tn:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var nn=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,o=this,i=(r=t)&&r instanceof ze||function(t){return t&&Ie(t.next)&&Ie(t.error)&&Ie(t.complete)}(r)&&Pe(r)?t:new Ye(t,e,n);return $e((function(){var t=o,e=t.operator,n=t.source;i.add(e?e.call(i,n):n?o._subscribe(i):o._trySubscribe(i))})),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=rn(e))((function(e,r){var o=new Ye({next:function(e){try{t(e)}catch(t){r(t),o.unsubscribe()}},error:r,complete:e});n.subscribe(o)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Qe]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return en(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=rn(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function rn(t){var e;return null!==(e=null!=t?t:Be)&&void 0!==e?e:Promise}var on=xe((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),sn=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Se(e,t),e.prototype.lift=function(t){var e=new an(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new on},e.prototype.next=function(t){var e=this;$e((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var o=_e(e.currentObservers),i=o.next();!i.done;i=o.next())i.value.next(t)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;$e((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;$e((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?Le:(this.currentObservers=null,i.push(t),new De((function(){e.currentObservers=null,Ae(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,o=e.isStopped;n?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new nn;return t.source=this,t},e.create=function(t,e){return new an(t,e)},e}(nn),an=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Se(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Le},e}(sn),un={now:function(){return(un.delegate||Date).now()},delegate:void 0},cn=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=un);var o=t.call(this)||this;return o._bufferSize=e,o._windowTime=n,o._timestampProvider=r,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,n),o}return Se(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,o=n._buffer,i=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(o.push(e),!i&&o.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),o=0;o<r.length&&!t.closed;o+=n?1:2)t.next(r[o]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,o=t._infiniteTimeWindow,i=(o?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!o){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}},e}(sn),fn=n(238),ln=n.n(fn),pn=function(){function t(){this.scalingFactor=1,this.doc=document,this.parser=new(ln())}return t.get=function(){return t._instance||(t._instance=new t),t._instance},t.prototype.getUAParser=function(){return this.parser},t.prototype.getWidth=function(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth},t.prototype.getHeight=function(){return this.isParentNotBody()?this.parentContainer.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight},t.prototype.isMobile=function(){return"mobile"===this.parser.getDevice().type},t.prototype.calculateScalingFactor=function(e){var n=e.max,r=e.cont.w,o=e.cont.h,i=e.spc,s=t.get().getWidth(),a=t.get().getHeight();n&&(s=s?Math.min(s,n):n,a=a?Math.min(a,n):n),a&&(s-=i.getHorizontal(),a-=i.getVertical(),this.scalingFactor=s/a<r/o?s/r:a/o,this.scalingFactor=Math.min(this.scalingFactor,1))},t.prototype.getScalingFactor=function(){return this.scalingFactor},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,n){e&&(n?t.style.setProperty(e,n,"important"):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},t.prototype.removeInApp=function(t){var e=document.querySelector(".".concat(t.rootClassName));e&&e.parentElement.removeChild(e)},t.prototype.setParentContainer=function(t){this.parentContainer=t,this.parentContainer&&this.isParentNotBody()&&this.setStyle(this.parentContainer,"position","relative")},t.prototype.isParentNotBody=function(){return this.parentContainer!==document.body},t.DOCUMENT_STANDARD_MODE="CSS1Compat",t}(),hn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},dn=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yn=function(){function t(){this.result={},this.parser=pn.get().getUAParser()}return t.prototype.get=function(){return hn(this,void 0,void 0,(function(){var t;return dn(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,n=t.offsetWidth*e;return document.body.removeChild(t),n},t.prototype.getLocation=function(){return hn(this,void 0,void 0,(function(){var t=this;return dn(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(n){t.result.coords=[n.coords.latitude,n.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return hn(this,void 0,void 0,(function(){var t;return dn(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),gn=n(145),vn=n(901),bn=n.n(vn),mn=function(){function e(){}return e.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().info.apply(bn(),t)},e.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().debug.apply(bn(),t)},e.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().error.apply(bn(),t)},e.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().warn.apply(bn(),t)},e.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().info.apply(bn(),t)},e.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().trace.apply(bn(),t)},e.configure=function(e){void 0===e&&(e=t.LOG_PREFIX),bn().useDefaults({formatter:function(n){n.unshift("".concat(e," (v").concat(t.SDK_VERSION,"):"))}}),localStorage.cooeeLogLevel?bn().setLevel(bn()[localStorage.cooeeLogLevel]):bn().setLevel(bn().OFF)},e}(),wn=n(483),En=n.n(wn);function Sn(t){return En().createInstance({name:"letscooee",storeName:t})}var _n,Tn,On=function(){function t(){}return t.get=function(t,e){var n,r,o,i,s;return r=this,o=void 0,s=function(){var r;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(o){switch(o.label){case 0:return[4,null===(n=this.storage)||void 0===n?void 0:n.getItem(t)];case 1:return[2,null!=(r=o.sent())?r:e]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{u(s.next(t))}catch(t){e(t)}}function a(t){try{u(s.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,a)}u((s=s.apply(r,o||[])).next())}))},t.set=function(t,e){var n;return null===(n=this.storage)||void 0===n?void 0:n.setItem(t,e)},t.remove=function(t){var e;null===(e=this.storage)||void 0===e||e.removeItem(t)},t.clear=function(){var t;return null===(t=this.storage)||void 0===t?void 0:t.clear()},t.getForage=function(){return this.storage},t}(),In=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return In(e,t),n=e,e.storeName="user",n.storage=Sn(n.storeName),e}(On),Nn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),An=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return Nn(e,t),n=e,e.storeName="app",n.storage=Sn(n.storeName),e}(On),Dn=function(){function t(){}return t.OLD_APP_ID="cooaid",t.OLD_USER_ID="uid",t.OLD_DEVICE_ID="coodid",t.OLD_SDK_TOKEN="st",t.DEVICE_UUID="uuid",t.OLD_SESSION_ID="sid",t.OLD_SESSION_NUMBER="sn",t.OLD_SESSION_START_TIME="sst",t.OLD_FIRST_TIME_LAUNCH="ifl",t.OLD_LAST_ACTIVE="la",t.OLD_ACTIVE_TRIGGER="at",t.OLD_SHOPIFY_CART_TOKEN="coosct",t.SESSION_ID="id",t.DEVICE_ID="did",t.USER_ID="id",t.APP_ID="id",t.SHOPIFY_CART_TOKEN="cartToken",t.SESSION_LAST_USED_TIME="lastUsedTime",t.LAST_ACTIVE="lastActive",t.ACTIVE_TRIGGER="activeTrigger",t.SDK_TOKEN="token",t.FIRST_TIME_LAUNCH="isFirstLaunch",t.FIRST_SEEN="firstSeen",t.SESSION_NUMBER="sessionNumber",t.GA_ENABLED="gae",t.GA_CLIENT_ID="gacid",t.GA_MEASUREMENT_ID="gamid",t}(),Ln=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Pn=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Cn=function(){function t(){}return t.processConfiguration=function(t){this.saveConfiguration(t).then((function(){mn.log("Google Analytics configuration processed")})).catch((function(t){mn.error(t)}))},t.saveConfiguration=function(t){return Ln(this,void 0,void 0,(function(){var e;return Pn(this,(function(n){switch(n.label){case 0:return t.gaMeasurementID&&t.gaEnabled?[4,An.get(Dn.GA_MEASUREMENT_ID,"")]:[2];case 1:return e=n.sent(),[4,An.get(Dn.GA_ENABLED,!1)];case 2:return n.sent()===t.gaEnabled&&e===t.gaMeasurementID?[3,6]:[4,xn.remove(Dn.GA_CLIENT_ID)];case 3:return n.sent(),[4,An.set(Dn.GA_MEASUREMENT_ID,t.gaMeasurementID)];case 4:return n.sent(),[4,An.set(Dn.GA_ENABLED,t.gaEnabled)];case 5:n.sent(),n.label=6;case 6:return[4,this.sendClientID()];case 7:return n.sent(),[2]}}))}))},t.sendClientID=function(){return Ln(this,void 0,void 0,(function(){var t;return Pn(this,(function(e){switch(e.label){case 0:return[4,An.get(Dn.GA_ENABLED,!1)];case 1:return e.sent()?[4,this.getClientID()]:[2];case 2:return(t=e.sent())?(gr.getInstance().updateDeviceProps({gaClientID:t}),[2]):[2]}}))}))},t.getClientID=function(){return Ln(this,void 0,void 0,(function(){var t,e;return Pn(this,(function(n){switch(n.label){case 0:return[4,xn.get(Dn.GA_CLIENT_ID)];case 1:return t=n.sent(),[4,this.getClientIDViaGTag()];case 2:return e=n.sent(),t===e?[2]:[4,xn.set(Dn.GA_CLIENT_ID,e)];case 3:return n.sent(),[2,e]}}))}))},t.getClientIDViaGTag=function(){return Ln(this,void 0,void 0,(function(){var t;return Pn(this,(function(e){switch(e.label){case 0:return[4,An.get(Dn.GA_MEASUREMENT_ID,"")];case 1:return t=e.sent(),[4,An.get(Dn.GA_ENABLED,"")];case 2:return e.sent()&&t&&window.gtag?[2,new Promise((function(e){window.gtag("get",t,"client_id",(function(t){e(t)}))}))]:[2]}}))}))},t}(),kn=function(e,n,r,o){this.appID=e,this.shopifyShop=n,this.uuid=r,this.props=o,this.sdk=t.SDK},Rn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return Rn(e,t),n=e,e.storeName="global",n.storage=Sn(n.storeName),e}(On),Un=function(){function t(){}return t.trackDeviceID=function(t){this.isInstalled()},t.trackIntent=function(t){var e;if(this.isInstalled()){var n=null===(e=ie[t])||void 0===e?void 0:e.toLowerCase();n&&(mn.debug("Sending ".concat(n," intent to MS Clarity")),window.clarity("set","Cooee Intent",n))}},t.isInstalled=function(){return window.clarity&&"function"==typeof window.clarity},t}(),jn=function(){function t(){}return t.watch=function(){var t=this.getDebugParam();"1"!==t&&"on"!==t||(localStorage.cooeeLogLevel="TRACE"),"on"===t?sessionStorage.cooeeDebug="1":"off"===t&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&(this.isOn=!0,this.renderDebugBar())},t.prepend=function(t){if(this.isOn){var e=document.createElement("div");e.innerHTML="• "+(new Date).toLocaleString()+" - "+t,this.element.prepend(e)}},t.renderDebugBar=function(){this.element=document.createElement("div"),this.element.id="cooee-debugger",this.element.setAttribute("draggable","true"),document.body.appendChild(this.element)},t.getDebugParam=function(){var t;return null===(t=new URL(location.href).searchParams)||void 0===t?void 0:t.get("cooee-debug")},t.dragElement=function(){var t=this,e=0,n=0,r=0,o=0,i=function(i){(i=i||window.event).preventDefault(),e=r-i.clientX,n=o-i.clientY,r=i.clientX,o=i.clientY,t.element.style.top=t.element.offsetTop-n+"px",t.element.style.left=t.element.offsetLeft-e+"px"},s=function(){document.onmouseup=null,document.onmousemove=null};this.element.onmousedown=function(t){(t=t||window.event).preventDefault(),r=t.clientX,o=t.clientY,document.onmouseup=s,document.onmousemove=i}},t.isOn=!1,t}(),Mn=n(716),Hn=function(){function t(){}return t.addReferralData=function(t){Object.assign(t,this.getUTMParams()),t.referrer=this.getReferrer()},t.getReferrer=function(){if(document.referrer&&"".concat(location.origin,"/")!==document.referrer)return document.referrer.replace(location.origin,"")},t.getUTMParams=function(){var t;try{t=new Mn.U(location.href)}catch(t){return{}}var e={};return this.UTM_PARAMS.forEach((function(n){var r=t.getQueryParam(n);r&&(e[n]=r)})),e},t.UTM_PARAMS=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],t}(),Fn=n(139),Gn=n.n(Fn),Vn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return Vn(e,t),e.getActiveTrigger=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,this.get(Dn.ACTIVE_TRIGGER)];case 1:return t=e.sent(),[2,new Lt(t)]}}))},new((n=void 0)||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}));var t,e,n,r},n=e,e.storeName="session",n.storage=Sn(n.storeName),e}(On),zn=function(){function t(){this.isLocked=!1,this.queue=[]}return t.prototype.acquire=function(){return t=this,e=void 0,r=function(){var t=this;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return this.isLocked?[3,1]:(this.isLocked=!0,[2]);case 1:return[4,new Promise((function(e){return t.queue.push(e)}))];case 2:e.sent(),e.label=3;case 3:return[2]}}))},new((n=void 0)||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}));var t,e,n,r},t.prototype.release=function(){if(this.queue.length>0){var t=this.queue.shift();t&&t()}else this.isLocked=!1},t}(),qn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Wn=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Jn=function(){function e(){this.lock=new zn}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.getCurrentSessionID=function(){return $n.set(Dn.SESSION_LAST_USED_TIME,(new Date).getTime()),$n.get(Dn.SESSION_ID,"")},e.prototype.checkForNewSession=function(){return qn(this,void 0,void 0,(function(){return Wn(this,(function(t){switch(t.label){case 0:return[4,this.lock.acquire()];case 1:return t.sent(),[4,this.isNewSessionRequired()];case 2:return t.sent()?[4,this.startNewSession()]:[3,4];case 3:return t.sent(),[3,6];case 4:return[4,this.initializeSessionFromStorage()];case 5:t.sent(),t.label=6;case 6:return this.lock.release(),[2]}}))}))},e.prototype.startNewSession=function(){return qn(this,void 0,void 0,(function(){var e,n;return Wn(this,(function(r){switch(r.label){case 0:return[4,$n.clear()];case 1:return r.sent(),e=new Date,n=(new ht).toHexString(),jn.prepend("New Session ID: <strong>".concat(n,"</strong>")),[4,$n.set(Dn.SESSION_LAST_USED_TIME,e.getTime())];case 2:return r.sent(),[4,$n.set(Dn.SESSION_ID,n)];case 3:return r.sent(),[4,this.bumpSessionNumber()];case 4:return r.sent(),gr.getInstance().sendEvent(new Pt(t.EVENT_SESSION_STARTED)),[2]}}))}))},e.prototype.bumpSessionNumber=function(){return qn(this,void 0,void 0,(function(){var t;return Wn(this,(function(e){switch(e.label){case 0:return[4,xn.get(Dn.SESSION_NUMBER)];case 1:return t=e.sent()||0,t+=1,[4,xn.set(Dn.SESSION_NUMBER,t)];case 2:return e.sent(),[2]}}))}))},e.prototype.getCurrentSessionNumber=function(){return xn.get(Dn.SESSION_NUMBER,1)},e.prototype.isNewSessionRequired=function(){return qn(this,void 0,void 0,(function(){var e,n;return Wn(this,(function(r){switch(r.label){case 0:return[4,$n.get(Dn.SESSION_ID)];case 1:return r.sent()?[4,$n.get("startTime",0)]:[2,!0];case 2:return e=r.sent(),[4,$n.get(Dn.SESSION_LAST_USED_TIME,null!=e?e:0)];case 3:return(n=r.sent())?[2,((new Date).getTime()-n)/1e3>t.IDLE_TIME_IN_SECONDS]:[2,!0]}}))}))},e.prototype.initializeSessionFromStorage=function(){return qn(this,void 0,void 0,(function(){var t;return Wn(this,(function(e){switch(e.label){case 0:return[4,$n.get(Dn.SESSION_ID,"")];case 1:return t=e.sent(),jn.prepend("Session ID: <strong>".concat(t,"</strong>")),[2]}}))}))},e}(),Yn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return Yn(e,t),n=e,e.storeName="shopify",n.storage=Sn(n.storeName),e}(On),Xn=function(){function t(){this.inInactive=!1,this.lastEnterActive=new Date,this.lastEnterInactive=null}return t.getInstance=function(){return this.INSTANCE},t.prototype.isInactive=function(){return this.inInactive},t.prototype.setInactive=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(t){switch(t.label){case 0:return this.inInactive?[2,0]:(this.inInactive=!0,this.lastEnterInactive=new Date,[4,$n.set(Dn.LAST_ACTIVE,this.lastEnterInactive.getTime())]);case 1:return t.sent(),[2,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0)]}}))},new((n=void 0)||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}));var t,e,n,r},t.prototype.setActive=function(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0},t.prototype.isFirstActive=function(){return null==this.lastEnterInactive},t.prototype.setScreen=function(t){this.screen=t},t.prototype.getScreen=function(){return this.screen},t.INSTANCE=new t,t}(),Zn=function(){return Zn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zn.apply(this,arguments)},Qn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},tr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},er=Gn()(fetch),nr={retryDelay:t.API_CALL_RETRY_DELAY,retryOn:function(e,n,r){return!(e>=t.API_CALL_MAX_ATTEMPTS||!(null!==n||(null==r?void 0:r.status)&&(null==r?void 0:r.status)>=500))}},rr=function(){function e(){this.apiToken="",this.uuid="",this.firstSeen=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.registerDevice=function(t){return Qn(this,void 0,void 0,(function(){return tr(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",this.getDefaultHeaders(),t)]}))}))},e.prototype.sendEvent=function(e){return Qn(this,void 0,void 0,(function(){var n,r,o=this;return tr(this,(function(i){switch(i.label){case 0:return e.name===t.EVENT_SCREEN_VIEW&&t.blackListedScreenName.includes(e.screenName)?[2]:(jn.prepend("Sending event <strong>".concat(e.name.replace("CE ",""),"</strong> with id ").concat(e.id)),n=this.getDefaultHeaders(),[4,$n.getActiveTrigger()]);case 1:return r=i.sent(),!e.trigger&&r&&(e.trigger=r,"test"===r.triggerID)||(e.name!==t.EVENT_APP_BACKGROUND&&Xn.getInstance().setActive(),this.doHTTP("POST","/v1/event/track",n,e).then((function(t){return Qn(o,void 0,void 0,(function(){var n;return tr(this,(function(r){switch(r.label){case 0:return mn.log("Sent",e.name),t.triggerData&&(t.triggerData.occurred=e.occurred,(new Br).render(t.triggerData)),[4,this.updateUserIDAndToken(t)];case 1:return r.sent(),n="Event <strong>".concat(t.eventName,"</strong> tracked"),t.intent&&(n+=" and <strong>".concat(ie[t.intent],"</strong> intent calculated"),Un.trackIntent(t.intent)),jn.prepend(n),[2]}}))}))})).catch((function(t){mn.error("Error sending event",t)}))),[2]}}))}))},e.prototype.updateUserData=function(t){var e=this,n=this.getDefaultHeaders();this.doHTTP("PUT","/v1/user/update",n,t).then((function(t){return Qn(e,void 0,void 0,(function(){return tr(this,(function(e){switch(e.label){case 0:return mn.log("Updated user profile"),[4,this.updateUserIDAndToken(t)];case 1:return e.sent(),[2]}}))}))})).catch((function(t){mn.error("Error saving user profile",t)}))},e.prototype.trackOrder=function(t){var e=this.getDefaultHeaders();this.doHTTP("POST","/v1/event/track-order",e,t).then((function(){mn.log("Sent Order")})).catch((function(t){mn.error("Error saving user profile",t)}))},e.prototype.updateUserIDAndToken=function(t){return Qn(this,void 0,void 0,(function(){return tr(this,(function(e){switch(e.label){case 0:return t&&Object.keys(t).length?t.userID?[4,xn.set(Dn.USER_ID,t.userID)]:[3,2]:[2];case 1:e.sent(),e.label=2;case 2:return t.deviceID?[4,xn.set(Dn.DEVICE_ID,t.deviceID)]:[3,4];case 3:e.sent(),e.label=4;case 4:return t.sdkToken?(this.setAPIToken(t.sdkToken),[4,xn.set(Dn.SDK_TOKEN,t.sdkToken)]):[3,6];case 5:e.sent(),e.label=6;case 6:return[2]}}))}))},e.prototype.updateDeviceProps=function(t){var e=this,n=this.getDefaultHeaders();this.doHTTP("PUT","/v1/device/update",n,t).then((function(){mn.log("Updated device property")})).catch((function(n){return Qn(e,void 0,void 0,(function(){var e;return tr(this,(function(r){switch(r.label){case 0:return mn.error("Error saving device property",n),(null===(e=null==t?void 0:t.cart)||void 0===e?void 0:e.token)?[4,Kn.remove(Dn.SHOPIFY_CART_TOKEN)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))}))},e.prototype.logout=function(){var t=this,e=this.getDefaultHeaders();this.doHTTP("GET","/v1/user/logout",e).then((function(e){return Qn(t,void 0,void 0,(function(){return tr(this,(function(t){switch(t.label){case 0:return mn.log("User logged out"),[4,this.updateUserIDAndToken(e)];case 1:return t.sent(),Jn.getInstance().startNewSession(),[2]}}))}))})).catch((function(t){mn.error(t)}))},e.prototype.getAppConfigurations=function(){return Qn(this,void 0,void 0,(function(){var t,e;return tr(this,(function(n){switch(n.label){case 0:return t=this.getDefaultHeaders(),[4,An.get(Dn.APP_ID)];case 1:return e=n.sent(),this.doHTTP("GET","/v1/app/configuration/".concat(e),t).then((function(t){mn.log("Received app configuration"),Cn.processConfiguration(t)})).catch((function(t){mn.error(t)})),[2]}}))}))},e.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},e.prototype.setUUID=function(t){this.uuid=null!=t?t:""},e.prototype.setFirstSeen=function(t){var e;this.firstSeen=null!==(e=null==t?void 0:t.toUTCString())&&void 0!==e?e:""},e.prototype.doHTTP=function(t,e,n,r){return Qn(this,void 0,void 0,(function(){var o,i,s;return tr(this,(function(a){switch(a.label){case 0:return e.startsWith("http")||(e="https://api.sdk.letscooee.com"+e),o="keepalive"in new Request(""),r&&!o&&JSON.stringify(r).includes("CE App Background")?[2,this.performXMLHttpRequest(e,n,r)]:(i={method:t,headers:n,keepalive:!0},r&&(i.body=JSON.stringify(r)),[4,er(e,Zn(Zn({},nr),i))]);case 1:if(!(s=a.sent()).ok)throw s;return[2,s.json()]}}))}))},e.prototype.performXMLHttpRequest=function(t,e,n){var r=new XMLHttpRequest;return r.open("POST",t,!1),e.forEach((function(t,e){r.setRequestHeader(e,t)})),r.send(JSON.stringify(n)),r.response.json()},e.prototype.getDefaultHeaders=function(){var e=new Headers;return e.set("content-type","application/json"),e.set("cooee-sdk",t.SDK),e.set("cooee-sdk-code",t.SDK_VERSION_CODE.toString()),e.set("cooee-sdk-version",t.SDK_VERSION),e.set("cooee-uuid",this.uuid),e.set("cooee-first-seen",this.firstSeen),e.set("sdk-version",t.SDK_VERSION),e.set("sdk-version-code",t.SDK_VERSION_CODE.toString()),this.apiToken&&(e.append("x-sdk-token",this.apiToken),e.append("cooee-sdk-token",this.apiToken)),e},e.INSTANCE=new e,e}(),or=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},ir=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},sr=function(){function t(){this.apiService=rr.getInstance(),this.sdkToken="",this.userID="",this.deviceID="",this.uuid="",this.appID="",this.shopifyShop=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.init=function(t){return this.appID=t.appID,this.shopifyShop=t.shopifyShop,this.acquireSDKToken()},t.prototype.hasToken=function(){return or(this,void 0,void 0,(function(){return ir(this,(function(t){switch(t.label){case 0:return[4,xn.get(Dn.SDK_TOKEN)];case 1:return[2,!!t.sent()]}}))}))},t.prototype.getUserID=function(){return this.userID},t.prototype.getDeviceID=function(){return this.deviceID},t.prototype.acquireSDKToken=function(){return or(this,void 0,void 0,(function(){var t;return ir(this,(function(e){switch(e.label){case 0:return t=this,[4,this.getOrCreateUUID()];case 1:return t.uuid=e.sent(),this.apiService.setUUID(this.uuid),[4,this.populateFirstSeen()];case 2:return e.sent(),[4,this.hasToken()];case 3:return e.sent()?[2,this.populateUserDataFromStorage()]:(mn.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}}))}))},t.prototype.saveUserDataInStorage=function(t){return or(this,void 0,void 0,(function(){return ir(this,(function(e){switch(e.label){case 0:return this.sdkToken=t.sdkToken,this.userID=t.userID,this.deviceID=t.deviceID,this.updateAPIClient(),[4,xn.set(Dn.SDK_TOKEN,this.sdkToken)];case 1:return e.sent(),[4,xn.set(Dn.USER_ID,this.userID)];case 2:return e.sent(),[4,xn.set(Dn.DEVICE_ID,this.deviceID)];case 3:return e.sent(),t.appID?[4,An.set(Dn.APP_ID,t.appID)]:[3,5];case 4:e.sent(),e.label=5;case 5:return[2]}}))}))},t.prototype.populateUserDataFromStorage=function(){return or(this,void 0,void 0,(function(){var t,e,n;return ir(this,(function(r){switch(r.label){case 0:return t=this,[4,xn.get(Dn.SDK_TOKEN)];case 1:return t.sdkToken=r.sent(),this.sdkToken||mn.warn("No SDK token found in local storage"),e=this,[4,xn.get(Dn.USER_ID)];case 2:return e.userID=r.sent(),this.userID||mn.warn("No user ID found in local storage"),n=this,[4,xn.get(Dn.DEVICE_ID)];case 3:return n.deviceID=r.sent(),this.deviceID||mn.warn("No device ID found in local storage"),this.updateAPIClient(),[2]}}))}))},t.prototype.updateAPIClient=function(){mn.log("SDK Token:",this.sdkToken),mn.log("Device ID:",this.deviceID),mn.log("User ID:",this.userID),Un.trackDeviceID(this.deviceID),jn.prepend("Device ID: <strong>".concat(this.deviceID,"</strong>")),this.apiService.setAPIToken(this.sdkToken)},t.prototype.getSDKTokenFromServer=function(){return or(this,void 0,void 0,(function(){var t,e,n,r;return ir(this,(function(o){switch(o.label){case 0:return[4,this.getDeviceAuthRequest()];case 1:t=o.sent(),e=this.apiService.registerDevice(t),o.label=2;case 2:return o.trys.push([2,5,,6]),[4,e];case 3:return n=o.sent(),mn.log("Register Device Response",n),[4,this.saveUserDataInStorage(n)];case 4:return o.sent(),Cn.processConfiguration(n),[3,6];case 5:throw r=o.sent(),mn.error(r),r;case 6:return[2]}}))}))},t.prototype.getDeviceAuthRequest=function(){return or(this,void 0,void 0,(function(){var t,e;return ir(this,(function(n){switch(n.label){case 0:return[4,(new yn).get()];case 1:t=n.sent(),Hn.addReferralData(t),t.host=location.origin,n.label=2;case 2:return n.trys.push([2,4,,5]),[4,(0,gn.r)()];case 3:return(null==(e=n.sent())?void 0:e.isPrivate)&&(t.private=!0),[3,5];case 4:return n.sent(),[3,5];case 5:return[2,new kn(this.appID,this.shopifyShop,this.uuid,t)]}}))}))},t.prototype.getOrCreateUUID=function(){return or(this,void 0,void 0,(function(){var t;return ir(this,(function(e){switch(e.label){case 0:return[4,Bn.get(Dn.DEVICE_UUID,"")];case 1:return(t=e.sent())?[3,3]:(t=(new ht).toHexString(),[4,Bn.set(Dn.DEVICE_UUID,t)]);case 2:e.sent(),e.label=3;case 3:return[2,t]}}))}))},t.prototype.populateFirstSeen=function(){return or(this,void 0,void 0,(function(){var t;return ir(this,(function(e){switch(e.label){case 0:return[4,xn.get(Dn.FIRST_SEEN)];case 1:return(t=e.sent())?[3,3]:(t=new Date,[4,xn.set(Dn.FIRST_SEEN,t)]);case 2:e.sent(),e.label=3;case 3:return this.apiService.setFirstSeen(t),[2]}}))}))},t.INSTANCE=new t,t}(),ar=function(){function e(){}return e.getString=function(t,e){return this.getItem(t)||e},e.setString=function(t,e){this.setItem(t,e)},e.remove=function(t){this.removeItem(t)},e.getItem=function(t){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t))},e.setItem=function(t,e){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t),e)},e.removeItem=function(t){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t))},e.SESSION_STORAGE=window.sessionStorage,e.SESSION_STORAGE_KEY_PREFIX=t.COOEE.concat("-"),e}(),ur=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},cr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},fr=function(){function e(){this.sessionManager=Jn.getInstance(),this.safeHttpCallService=gr.getInstance(),this.deviceAuthService=sr.getInstance()}return e.prototype.init=function(n){return ur(this,void 0,void 0,(function(){var r=this;return cr(this,(function(o){return t.BOT_UA_REGEX.test(navigator.userAgent)?(mn.log("This seems to be a bot. Disabling SDK"),[2]):(this.deviceAuthService.init(n).then((function(){return ur(r,void 0,void 0,(function(){return cr(this,(function(t){switch(t.label){case 0:return[4,this.execute()];case 1:return t.sent(),e.replaySubject.next(!0),e.replaySubject.complete(),[2]}}))}))})),[2])}))}))},e.prototype.execute=function(){return ur(this,void 0,void 0,(function(){return cr(this,(function(t){switch(t.label){case 0:return[4,this.sessionManager.checkForNewSession()];case 1:return t.sent(),[4,this.isAppFirstTimeLaunch()];case 2:return t.sent()?this.sendFirstLaunchEvent():(this.sendSuccessiveLaunchEvent(),this.safeHttpCallService.getAppConfigurations()),[2]}}))}))},e.prototype.isAppFirstTimeLaunch=function(){return ur(this,void 0,void 0,(function(){return cr(this,(function(t){switch(t.label){case 0:return[4,xn.get(Dn.FIRST_TIME_LAUNCH,!0)];case 1:return t.sent()?[4,xn.set(Dn.FIRST_TIME_LAUNCH,!1)]:[3,3];case 2:return t.sent(),[2,!0];case 3:return[2,!1]}}))}))},e.prototype.sendFirstLaunchEvent=function(){return ur(this,void 0,void 0,(function(){var e,n;return cr(this,(function(r){switch(r.label){case 0:return e=new Pt(t.EVENT_APP_INSTALLED,{}),n=e,[4,(new yn).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return ur(this,void 0,void 0,(function(){var e,n;return cr(this,(function(r){switch(r.label){case 0:return this.isNewTabOpened()?(e=new Pt(t.EVENT_APP_LAUNCHED),n=e,[4,(new yn).get()]):[2];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.isNewTabOpened=function(){return!ar.getString(t.SESSION_STORAGE_TAB_OPENED,"")&&(ar.setString(t.SESSION_STORAGE_TAB_OPENED,"1"),!0)},e.replaySubject=new cn(1),e}(),lr=function(){function t(){}return t.isShopify=function(){return!!window.Shopify},t.getShopName=function(){var t,e;if(this.isShopify())return null===(e=null===(t=window.Shopify.shop)||void 0===t?void 0:t.split("."))||void 0===e?void 0:e[0]},t.getScreenName=function(){if(this.isShopify()){var t=new URL(window.location.href).pathname.slice(1).split("/")[0];return""===t?"home":"collections"===t?"collection":"products"===t?"product":"cart"===t?"cart":void 0}},t}(),pr=function(){function t(){}return t.isDukaan=function(){return!!window.DukaanData},t}(),hr=function(){function t(){}return t.isECommerceApp=function(){return lr.isShopify()||pr.isDukaan()},t}(),dr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},yr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gr=function(){function e(){this.httpApiService=rr.getInstance(),this.sessionManager=Jn.getInstance(),this.rejectEvents=[t.EVENT_SCREEN_VIEW,t.EVENT_APP_LAUNCHED]}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.sendEvent=function(t){var e=this;this.shouldReject(t)||fr.replaySubject.subscribe((function(){return dr(e,void 0,void 0,(function(){return yr(this,(function(e){switch(e.label){case 0:return[4,this.addEventData(t)];case 1:return e.sent(),this.httpApiService.sendEvent(t),[2]}}))}))}))},e.prototype.updateProfile=function(t){var e=this;t=null!=t?t:{},fr.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},e.prototype.trackOrder=function(t){var e=this;t?fr.replaySubject.subscribe((function(){e.httpApiService.trackOrder(t)})):mn.warn("No order data found")},e.prototype.updateDeviceProps=function(t,e){var n=this;fr.replaySubject.subscribe((function(){n.httpApiService.updateDeviceProps({props:t,cart:e})}))},e.prototype.logout=function(){var t=this;fr.replaySubject.subscribe((function(){t.httpApiService.logout()}))},e.prototype.getAppConfigurations=function(){var t=this;fr.replaySubject.subscribe((function(){return dr(t,void 0,void 0,(function(){return yr(this,(function(t){switch(t.label){case 0:return[4,this.httpApiService.getAppConfigurations()];case 1:return t.sent(),[2]}}))}))}))},e.prototype.addEventData=function(t){return dr(this,void 0,void 0,(function(){var e,n;return yr(this,(function(r){switch(r.label){case 0:return t.screenName=Xn.getInstance().getScreen(),t.properties.path=location.pathname,location.search&&(t.properties.qs=location.search),[4,this.sessionManager.checkForNewSession()];case 1:return r.sent(),e=t,[4,this.sessionManager.getCurrentSessionID()];case 2:return e.sessionID=r.sent(),n=t,[4,this.sessionManager.getCurrentSessionNumber()];case 3:return n.sessionNumber=r.sent(),Hn.addReferralData(t.properties),[2]}}))}))},e.prototype.shouldReject=function(t){return!(hr.isECommerceApp()||!this.rejectEvents.includes(t.name)&&t.name.startsWith("CE ")||(mn.log("Rejecting ".concat(t.name," as this is not e-commerce app")),0))},e}();!function(t){t[t.CAMERA=1]="CAMERA",t[t.LOCATION=2]="LOCATION",t[t.PUSH=3]="PUSH"}(_n||(_n={})),function(t){t[t.NONE=0]="NONE",t[t.IAB=1]="IAB",t[t.EXTERNAL=2]="EXTERNAL",t[t.PROMPT=3]="PROMPT",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION"}(Tn||(Tn={}));var vr=function(){function t(){}return t.storeActiveTrigger=function(t){return e=this,n=void 0,o=function(){var e;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(n){switch(n.label){case 0:return(null==t?void 0:t.id)&&"test"!==t.id?(e=new Lt(t),[4,$n.set(Dn.ACTIVE_TRIGGER,e)]):[2];case 1:return n.sent(),[2,e]}}))},new((r=void 0)||(r=Promise))((function(t,i){function s(t){try{u(o.next(t))}catch(t){i(t)}}function a(t){try{u(o.throw(t))}catch(t){i(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}u((o=o.apply(e,n||[])).next())}));var e,n,r,o},t}(),br=function(){return br=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},br.apply(this,arguments)},mr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},wr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Er=function(){function e(t,e){this.action=t,this.apiService=gr.getInstance(),this.triggerContext=e}return e.prototype.execute=function(){return mr(this,void 0,void 0,(function(){var t;return wr(this,(function(e){switch(e.label){case 0:return[4,this.closeAction()];case 1:switch(e.sent(),this.action.at){case Tn.EXTERNAL:this.externalAction();break;case Tn.IAB:this.iabAction();break;case Tn.GO_TO_URL:this.gotoURLAction();break;case Tn.SHARE:this.shareAction();break;case Tn.PROMPT:this.prompt();break;case Tn.ADD_TO_CART:case Tn.COPY_COUPON_CODE:case Tn.GO_TO_COLLECTION:case Tn.GO_TO_PRODUCT:case void 0:break;default:return mn.error("Received an invalid ClickActionType: ",this.action.at),[2]}return t=br(br(br({},this.action.custKV),this.action.kv),this.action),document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:t})),[2]}}))}))},e.prototype.externalAction=function(){var t,e;if(null===(t=this.action.ext)||void 0===t?void 0:t.u){var n=this.action.ext.u;this.isValidURL(n)||(n="//".concat(n)),null===(e=window.open(n,"_blank"))||void 0===e||e.focus()}},e.prototype.isValidURL=function(t){try{new URL(t)}catch(t){return!1}return!0},e.prototype.gotoURLAction=function(){var t;if(null===(t=this.action.gu)||void 0===t?void 0:t.u){var e=this.action.gu.u;this.isValidURL(e)||(e="//".concat(e)),window.open(e,"_self")}},e.prototype.iabAction=function(){var t;if(null===(t=this.action.iab)||void 0===t?void 0:t.u){var e=this.action.iab.u;this.isValidURL(e)||(e="//".concat(e)),(new Cr).render(e)}},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.prompt=function(){var t=this.action.pmpt;t&&(t===_n.LOCATION&&this.promptLocationPermission(),t===_n.PUSH&&this.promptPushNotificationPermission(),t===_n.CAMERA&&this.promptCameraPermission())},e.prototype.closeAction=function(){return mr(this,void 0,void 0,(function(){var e;return wr(this,(function(n){switch(n.label){case 0:return this.containsCTA()?(e=t.EVENT_TRIGGER_CLICKED,[4,vr.storeActiveTrigger(this.triggerContext.triggerData)]):[3,2];case 1:return n.sent(),[3,3];case 2:e=t.EVENT_TRIGGER_CLOSED,n.label=3;case 3:return this.action.close&&this.triggerContext.closeInApp(e),[2]}}))}))},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):mn.warn("Navigator.share is not compatible with this browser"))},e.prototype.containsCTA=function(){return!!this.action.at||!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))},e.prototype.isEmpty=function(t){return!t||0===Object.keys(t).length},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateDeviceProps({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateDeviceProps({pnPerm:Notification.permission}):mn.warn("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return mr(this,void 0,void 0,(function(){var t,e,n;return wr(this,(function(r){switch(r.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=r.sent(),[4,this.checkPermission("geolocation")];case 2:return e=r.sent(),n=Notification.permission,[2,{camera:t,location:e,notification:n}]}}))}))},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateDeviceProps({perm:e})}))},e}(),Sr=function(){function t(t,e,n){this.renderer=pn.get(),this.screenWidth=0,this.screenHeight=0,this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=n,this.scalingFactor=this.renderer.getScalingFactor(),this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return t.prototype.getHTMLElement=function(){return this.inappHTMLEl},t.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},t.prototype.processCommonBlocks=function(){this.processDisplay(),this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},t.prototype.processDisplay=function(){this.renderer.setStyle(this.inappHTMLEl,"display","block")},t.prototype.processWidthAndHeight=function(){this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},t.prototype.getSizePx=function(t){return this.getScaledSize(t)+"px"},t.prototype.getScaledSize=function(t){return t*this.scalingFactor},t.prototype.processPositionBlock=function(){this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y))},t.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},t.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},t.prototype.processTransparency=function(){var t=this.inappElement.alpha;if(!isNaN(t)){var e=(t/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",e)}},t.prototype.processShadow=function(){var t=this.inappElement.shd;t&&this.renderer.setStyle(this.inappHTMLEl,"box-shadow",t.getStyle(this.scalingFactor))},t.prototype.processTransformBlock=function(){var t=new Wt(this.inappElement.trf);t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate(".concat(t.rotate,"deg)"))},t.prototype.registerAction=function(){var t=this,e=this.inappElement.clc;e&&0!==Object.keys(e).length&&(this.inappHTMLEl.addEventListener("click",(function(n){n.stopPropagation(),new Er(e,t.triggerContext).execute()})),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))},t.prototype.processBackgroundBlock=function(){var t=this.inappElement.bg;if(t){var e=this.inappHTMLEl;if(t.glossy){var n="backdrop-filter",r="-webkit-"+n,o="blur(".concat(t.glossy.radius,"px)");if(!CSS.supports(r,o)&&!CSS.supports(n,o))return void this.renderer.setStyle(e,"background",t.glossy.fallback.rgba);this.renderer.setStyle(e,r,o),this.renderer.setStyle(e,n,o),t.glossy.color&&this.processColourBlock(t.glossy.color,"background",e)}else if(t.solid)t.solid.grad?this.processGradient(t.solid.grad,"background"):t.solid.hex&&this.renderer.setStyle(e,"background",t.solid.rgba);else if(t.img){if(!t.img.src)return;var i='url("'.concat(t.img.src,'") no-repeat center');this.renderer.setStyle(e,"background",i),this.renderer.setStyle(e,"background-size","cover"),t.img.a&&(this.renderer.setStyle(e,"-webkit-backdrop-filter","opacity(".concat(t.img.a,")")),this.renderer.setStyle(e,"backdrop-filter","opacity(".concat(t.img.a,")")))}}},t.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var n="linear-gradient(".concat(t.ang,"deg, ").concat(t.c1,", ").concat(t.c2);t.c3&&(n+=", ".concat(t.c3)),n+=")",this.renderer.setStyle(this.inappHTMLEl,e,n)}},t.prototype.processColourBlock=function(t,e,n){void 0===e&&(e="color"),void 0===n&&(n=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(n,e,t.rgba))},t}(),_r=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tr=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return _r(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t;this.renderer.setStyle(this.inappHTMLEl,"letter-spacing","normal");var e=this.inappElement.font;e&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(e.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",null===(t=e.family)||void 0===t?void 0:t.name),this.renderer.setStyle(this.inappHTMLEl,"line-height",e.lh))},e.prototype.processPart=function(t,e){var n,r=[];e.u&&r.push("underline"),e.st&&r.push("line-through"),r.length||r.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",r.join(" ")),this.renderer.setStyle(t,"color",null!==(n=e.c)&&void 0!==n?n:"inherit"),this.renderer.setStyle(t,"font-family","inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=Yt[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(Sr),Or=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ir=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("div"),o.insertElement(),o}return Or(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var n,r,o=e.renderer.createElement("span");o.innerHTML=null===(r=null===(n=t.txt)||void 0===n?void 0:n.toString())||void 0===r?void 0:r.replace(/\n/g,"<br />"),e.processPart(o,t),e.renderer.appendChild(e.inappHTMLEl,o)})),this.processCommonBlocks()},e}(Tr),xr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nr=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("div"),o.insertElement(),o}return xr(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(Sr),Ar=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dr=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("img"),o.insertElement(),o}return Ar(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(Sr),Lr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pr=function(e){function n(t,n,r){var o=e.call(this,t,n,r)||this;return o.parent=t,o.inappHTMLEl=o.renderer.createElement("div"),o}return Lr(n,e),n.prototype.render=function(){return this.parent||this.renderer.removeInApp(this.triggerContext),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(t.IN_APP_WRAPPER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",n.MAX_Z_INDEX),this.inappHTMLEl},n.prototype.processBackgroundBlock=function(){this.inappElement.cover&&e.prototype.processBackgroundBlock.call(this)},n.prototype.processWidthAndHeight=function(){var t=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width","100vw"),this.renderer.setStyle(this.inappHTMLEl,"height","100vh")),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0");else{var e=this.inappElement.spc,n=this.getScaledSize(t.w)+e.getHorizontal(),r=this.getScaledSize(t.h)+e.getVertical();this.renderer.setStyle(this.inappHTMLEl,"width",n+"px"),this.renderer.setStyle(this.inappHTMLEl,"height",r+"px")}},n.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;this.renderer.setStyle(this.inappHTMLEl,"padding",t.getPaddingCSS())},n.prototype.processDisplay=function(){this.renderer.setStyle(this.inappHTMLEl,"display","flex"),Object.assign(this.inappHTMLEl.style,this.inappElement.getStylesForWrapper()),Object.assign(this.inappHTMLEl.style,this.inappElement.getFlexStylesForContainer())},n.prototype.processPositionBlock=function(){var t;if(this.renderer.isParentNotBody()){if(null===(t=this.triggerContext.triggerData.ian)||void 0===t?void 0:t.isEmbedded())return void this.renderer.setStyle(this.inappHTMLEl,"position","block");this.renderer.setStyle(this.inappHTMLEl,"position","absolute")}else this.renderer.setStyle(this.inappHTMLEl,"position","fixed")},n.prototype.processBorderBlock=function(){},n.prototype.processTransparency=function(){},n.prototype.processTransformBlock=function(){},n.prototype.processGradient=function(){},n.prototype.processShadow=function(){},n.prototype.registerAction=function(){var t=this;this.inappHTMLEl.addEventListener("click",(function(){new Er({close:!0},t.triggerContext).execute()}))},n.MAX_Z_INDEX="2147483647",n}(Sr),Cr=function(){function e(){this.renderer=pn.get()}return e.prototype.render=function(e){var n=document.querySelector(".".concat(t.IN_APP_WRAPPER_NAME)),r=this.createIFrameContainer();return this.createIFrameElement(r,e),this.createAnchorElement(n,r),this.renderer.appendChild(n,r),r},e.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},e.prototype.createIFrameElement=function(t,e){var n=this.renderer.createElement("iframe");return this.renderer.setStyle(n,"width","100%"),this.renderer.setStyle(n,"height","100%"),this.renderer.setAttribute(n,"src",e),this.renderer.setAttribute(n,"frameBorder","0"),this.renderer.appendChild(t,n),n},e.prototype.createAnchorElement=function(t,e){var n=this.renderer.createElement("a");return this.renderer.setStyle(n,"position","absolute"),this.renderer.setStyle(n,"top","0px"),this.renderer.setStyle(n,"right","0px"),n.href="#",n.innerHTML="Close",n.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,n),n},e}(),kr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rr=function(e){function n(t,n,r){var o=e.call(this,t,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("div"),o.insertElement(),o}return kr(n,e),n.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this.renderer.setStyle(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(t.IN_APP_CONTAINER_NAME),this},n}(Sr),Br=function(){function e(t){var e=this;this.renderer=pn.get(),this.safeHTTP=gr.getInstance(),this.resizeListener=function(){return e.screenResized()},this.setParentContainer(t)}return e.prototype.setParentContainer=function(t){this.parent=null!=t?t:document.body,this.renderer.setParentContainer(this.parent)},e.prototype.render=function(t){var n=this,r=new ve(t);if(t.previewType||!e.ACTIVE_TRIGGER_DATA){if(e.ACTIVE_TRIGGER_DATA=r,this.triggerContext=new se(new Date,r),this.triggerContext.onClose((function(t){n.closeInApp(t)})),this.ian=r.ian,(this.renderer.isMobile()||"mobile"===r.previewType)&&this.ian.overrideForMobileView(),this.ian.isEmbedded()){var o=document.querySelector(this.ian.getEmbeddedSelector());this.setParentContainer(o)}r.shouldDelay()?window.setTimeout((function(){n.startRenderingOnce()}),r.getDelaySeconds()):this.startRenderingOnce()}else this.skipTrigger(r)},e.prototype.startRenderingOnce=function(){try{this.startRendering()}catch(t){return}this.sendTriggerDisplayed(),this.renderer.isMobile()||window.addEventListener("resize",this.resizeListener)},e.prototype.startRendering=function(){this.renderer.calculateScalingFactor(this.ian),this.rootContainer=new Pr(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(t){throw mn.error(t),t}},e.prototype.sendTriggerDisplayed=function(){var e=new Pt(t.EVENT_TRIGGER_DISPLAYED,{},this.triggerContext.triggerData);this.safeHTTP.sendEvent(e)},e.prototype.sendTriggerClosed=function(t){var e=t.eventName;delete t.eventName;var n=new Pt(e,t,this.triggerContext.triggerData);this.safeHTTP.sendEvent(n)},e.prototype.addEnterAnimation=function(t){this.containerHTMLElement.animate(t.getEnterAnimation(),{duration:500})},e.prototype.renderElement=function(t,e,n){e instanceof ne?new Ir(t,e,n).render():e instanceof te?new Dr(t,e,n).render():e instanceof Zt?new Nr(t,e,n).render():mn.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(t){var e,n,r=this,o=null===(e=this.ian)||void 0===e?void 0:e.cont;o&&(this.containerHTMLElement=new Rr(this.rootContainer,o,t).render().getHTMLElement(),(new we).loadAllFonts(this.ian),null===(n=this.ian.elems)||void 0===n||n.forEach((function(e){return n=r,o=void 0,s=function(){return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(n){switch(n.label){case 0:return[4,this.renderElement(this.containerHTMLElement,e,t)];case 1:return n.sent(),[2]}}))},new((i=void 0)||(i=Promise))((function(t,e){function r(t){try{u(s.next(t))}catch(t){e(t)}}function a(t){try{u(s.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,a)}u((s=s.apply(n,o||[])).next())}));var n,o,i,s})),this.addEnterAnimation(this.ian.anim))},e.prototype.closeInApp=function(t){var n=this,r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(t),e.ACTIVE_TRIGGER_DATA=void 0,this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"}).onfinish=function(){n.removeInApp(),window.removeEventListener("resize",n.resizeListener)}},e.prototype.screenResized=function(){this.removeInApp(),this.startRendering()},e.prototype.removeInApp=function(){pn.get().removeInApp(this.triggerContext)},e.prototype.skipTrigger=function(n){var r,o={triggerShown:new Lt(null!==(r=e.ACTIVE_TRIGGER_DATA)&&void 0!==r?r:{})},i=new Pt(t.EVENT_TRIGGER_REJECTED,o,n);this.safeHTTP.sendEvent(i)},e}();const Ur=Br})(),CooeePreview=r.default})();
|
|
2
|
+
(()=>{var t={716:(t,e)=>{"use strict";e.U=void 0;var n=function(){function t(t){try{this.base=new URL(t),this.params=new URLSearchParams(this.base.search.slice(1))}catch(t){console.error("Un-parsable URL",t)}}return t.prototype.appendQueryParam=function(t,e){this.params.append(t,e?e.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(t){this.params.delete(t)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(t){if(!this.params)return"";var e=this.params.get(t);return e&&"undefined"!==e&&"null"!==e?e:void 0},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(t){return this.base.pathname=t,this},t.prototype.setQueryParam=function(t,e){return this.params.set(t,e?e.toString():""),this},t.prototype.setQueryString=function(t){if(t)return"?"===t[0]&&(t=t.slice(1)),this.params=new URLSearchParams(t),this},t.prototype.toString=function(){var t=this.params.toString();return this.base.search=""===t?"":"?"+t,this.base.toString()},t}();e.U=n},145:(t,e)=>{"use strict";e.r=void 0,e.r=function(){return new Promise((function(t,e){var n,r,o="Unknown";function i(e){t({isPrivate:e,browserName:o})}function s(t){return t===eval.toString().length}void 0!==(r=navigator.vendor)&&0===r.indexOf("Apple")&&s(37)?(o="Safari",void 0!==navigator.maxTouchPoints?function(){var t=String(Math.random());try{window.indexedDB.open(t,1).onupgradeneeded=function(e){var n,r,o=null===(n=e.target)||void 0===n?void 0:n.result;try{o.createObjectStore("test",{autoIncrement:!0}).put(new Blob),i(!1)}catch(t){var s=t;return t instanceof Error&&(s=null!==(r=t.message)&&void 0!==r?r:t),i("string"==typeof s&&/BlobURLs are not yet supported/.test(s))}finally{o.close(),window.indexedDB.deleteDatabase(t)}}}catch(t){return i(!1)}}():function(){var t=window.openDatabase,e=window.localStorage;try{t(null,null,null,null)}catch(t){return i(!0)}try{e.setItem("test","1"),e.removeItem("test")}catch(t){return i(!0)}i(!1)}()):function(){var t=navigator.vendor;return void 0!==t&&0===t.indexOf("Google")&&s(33)}()?(n=navigator.userAgent,o=n.match(/Chrome/)?void 0!==navigator.brave?"Brave":n.match(/Edg/)?"Edge":n.match(/OPR/)?"Opera":"Chrome":"Chromium",void 0!==self.Promise&&void 0!==self.Promise.allSettled?navigator.webkitTemporaryStorage.queryUsageAndQuota((function(t,e){var n;i(e<(void 0!==(n=window).performance&&void 0!==n.performance.memory&&void 0!==n.performance.memory.jsHeapSizeLimit?performance.memory.jsHeapSizeLimit:1073741824))}),(function(t){e(new Error("detectIncognito somehow failed to query storage quota: "+t.message))})):(0,window.webkitRequestFileSystem)(0,1,(function(){i(!1)}),(function(){i(!0)}))):void 0!==document.documentElement&&void 0!==document.documentElement.style.MozAppearance&&s(37)?(o="Firefox",i(void 0===navigator.serviceWorker)):void 0!==navigator.msSaveBlob&&s(39)?(o="Internet Explorer",i(void 0===window.indexedDB)):e(new Error("detectIncognito cannot determine the browser"))}))}},139:function(t){t.exports=function(){"use strict";function t(t){return Number.isInteger(t)&&t>=0}function e(t){this.name="ArgumentError",this.message=t}return function(n,r){if(r=r||{},"function"!=typeof n)throw new e("fetch must be a function");if("object"!=typeof r)throw new e("defaults must be an object");if(void 0!==r.retries&&!t(r.retries))throw new e("retries must be a positive integer");if(void 0!==r.retryDelay&&!t(r.retryDelay)&&"function"!=typeof r.retryDelay)throw new e("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==r.retryOn&&!Array.isArray(r.retryOn)&&"function"!=typeof r.retryOn)throw new e("retryOn property expects an array or function");return r=Object.assign({retries:3,retryDelay:1e3,retryOn:[]},r),function(o,i){var s=r.retries,a=r.retryDelay,u=r.retryOn;if(i&&void 0!==i.retries){if(!t(i.retries))throw new e("retries must be a positive integer");s=i.retries}if(i&&void 0!==i.retryDelay){if(!t(i.retryDelay)&&"function"!=typeof i.retryDelay)throw new e("retryDelay must be a positive integer or a function returning a positive integer");a=i.retryDelay}if(i&&i.retryOn){if(!Array.isArray(i.retryOn)&&"function"!=typeof i.retryOn)throw new e("retryOn property expects an array or function");u=i.retryOn}return new Promise((function(t,e){var r=function(r){var a="undefined"!=typeof Request&&o instanceof Request?o.clone():o;n(a,i).then((function(n){if(Array.isArray(u)&&-1===u.indexOf(n.status))t(n);else if("function"==typeof u)try{return Promise.resolve(u(r,null,n)).then((function(e){e?c(r,null,n):t(n)})).catch(e)}catch(t){e(t)}else r<s?c(r,null,n):t(n)})).catch((function(t){if("function"==typeof u)try{Promise.resolve(u(r,t,null)).then((function(n){n?c(r,t,null):e(t)})).catch((function(t){e(t)}))}catch(t){e(t)}else r<s?c(r,t,null):e(t)}))};function c(t,e,n){var o="function"==typeof a?a(t,e,n):a;setTimeout((function(){r(++t)}),o)}r(0)}))}}}()},901:function(t,e,n){var r,o;!function(i){"use strict";var s,a={VERSION:"1.6.1"},u={},c=function(t,e){return function(){return e.apply(t,arguments)}},f=function(){var t,e,n=arguments,r=n[0];for(e=1;e<n.length;e++)for(t in n[e])!(t in r)&&n[e].hasOwnProperty(t)&&(r[t]=n[e][t]);return r},l=function(t,e){return{value:t,name:e}};a.TRACE=l(1,"TRACE"),a.DEBUG=l(2,"DEBUG"),a.INFO=l(3,"INFO"),a.TIME=l(4,"TIME"),a.WARN=l(5,"WARN"),a.ERROR=l(8,"ERROR"),a.OFF=l(99,"OFF");var p=function(t){this.context=t,this.setLevel(t.filterLevel),this.log=this.info};p.prototype={setLevel:function(t){t&&"value"in t&&(this.context.filterLevel=t)},getLevel:function(){return this.context.filterLevel},enabledFor:function(t){var e=this.context.filterLevel;return t.value>=e.value},trace:function(){this.invoke(a.TRACE,arguments)},debug:function(){this.invoke(a.DEBUG,arguments)},info:function(){this.invoke(a.INFO,arguments)},warn:function(){this.invoke(a.WARN,arguments)},error:function(){this.invoke(a.ERROR,arguments)},time:function(t){"string"==typeof t&&t.length>0&&this.invoke(a.TIME,[t,"start"])},timeEnd:function(t){"string"==typeof t&&t.length>0&&this.invoke(a.TIME,[t,"end"])},invoke:function(t,e){s&&this.enabledFor(t)&&s(e,f({level:t},this.context))}};var h,d=new p({filterLevel:a.OFF});(h=a).enabledFor=c(d,d.enabledFor),h.trace=c(d,d.trace),h.debug=c(d,d.debug),h.time=c(d,d.time),h.timeEnd=c(d,d.timeEnd),h.info=c(d,d.info),h.warn=c(d,d.warn),h.error=c(d,d.error),h.log=h.info,a.setHandler=function(t){s=t},a.setLevel=function(t){for(var e in d.setLevel(t),u)u.hasOwnProperty(e)&&u[e].setLevel(t)},a.getLevel=function(){return d.getLevel()},a.get=function(t){return u[t]||(u[t]=new p(f({name:t},d.context)))},a.createDefaultHandler=function(t){(t=t||{}).formatter=t.formatter||function(t,e){e.name&&t.unshift("["+e.name+"]")};var e={},n=function(t,e){Function.prototype.apply.call(t,console,e)};return"undefined"==typeof console?function(){}:function(r,o){r=Array.prototype.slice.call(r);var i,s=console.log;o.level===a.TIME?(i=(o.name?"["+o.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(i):e[i]=(new Date).getTime():console.timeEnd?console.timeEnd(i):n(s,[i+": "+((new Date).getTime()-e[i])+"ms"])):(o.level===a.WARN&&console.warn?s=console.warn:o.level===a.ERROR&&console.error?s=console.error:o.level===a.INFO&&console.info?s=console.info:o.level===a.DEBUG&&console.debug?s=console.debug:o.level===a.TRACE&&console.trace&&(s=console.trace),t.formatter(r,o),n(s,r))}},a.useDefaults=function(t){a.setLevel(t&&t.defaultLevel||a.DEBUG),a.setHandler(a.createDefaultHandler(t))},a.setDefaults=a.useDefaults,void 0===(o="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=o)}()},483:(t,e,n)=>{t.exports=function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,(function(t){return o(e[s][1][t]||t)}),c,c.exports,t,e,n,r)}return n[s].exports}for(var i=void 0,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,r){(function(t){"use strict";var n,r,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,s=new o(f),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){f(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(f,0)};else{var u=new t.MessageChannel;u.port1.onmessage=f,n=function(){u.port2.postMessage(0)}}var c=[];function f(){var t,e;r=!0;for(var n=c.length;n;){for(e=c,c=[],t=-1;++t<n;)e[t]();n=c.length}r=!1}e.exports=function(t){1!==c.push(t)||r||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){"use strict";var r=t(1);function o(){}var i={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&h(this,t)}function f(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(t,e,n){r((function(){var r;try{r=e(n)}catch(e){return i.reject(t,e)}r===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,r)}))}function p(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function h(t,e){var n=!1;function r(e){n||(n=!0,i.reject(t,e))}function o(e){n||(n=!0,i.resolve(t,e))}var s=d((function(){e(o,r)}));"error"===s.status&&r(s.value)}function d(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}e.exports=c,c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var n=new this.constructor(o);return this.state!==u?l(n,this.state===a?t:e,this.outcome):this.queue.push(new f(n,t,e)),n},f.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},f.prototype.otherCallFulfilled=function(t){l(this.promise,this.onFulfilled,t)},f.prototype.callRejected=function(t){i.reject(this.promise,t)},f.prototype.otherCallRejected=function(t){l(this.promise,this.onRejected,t)},i.resolve=function(t,e){var n=d(p,e);if("error"===n.status)return i.reject(t,n.value);var r=n.value;if(r)h(t,r);else{t.state=a,t.outcome=e;for(var o=-1,s=t.queue.length;++o<s;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=s,t.outcome=e;for(var n=-1,r=t.queue.length;++n<r;)t.queue[n].callRejected(e);return t},c.resolve=function(t){return t instanceof this?t:i.resolve(new this(o),t)},c.reject=function(t){var e=new this(o);return i.reject(e,t)},c.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,r=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,u=-1,c=new this(o);++u<n;)f(t[u],u);return c;function f(t,o){e.resolve(t).then((function(t){s[o]=t,++a!==n||r||(r=!0,i.resolve(c,s))}),(function(t){r||(r=!0,i.reject(c,t))}))}},c.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n,r=t.length,s=!1;if(!r)return this.resolve([]);for(var a=-1,u=new this(o);++a<r;)n=t[a],e.resolve(n).then((function(t){s||(s=!0,i.resolve(u,t))}),(function(t){s||(s=!0,i.reject(u,t))}));return u}},{1:1}],3:[function(t,e,r){(function(e){"use strict";"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}();function i(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<t.length;r+=1)n.append(t[r]);return n.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var s=Promise;function a(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function u(t,e,n){"function"==typeof e&&t.then(e),"function"==typeof n&&t.catch(n)}function c(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",p=void 0,h={},d=Object.prototype.toString,y="readonly",g="readwrite";function v(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n),o=0;o<e;o++)r[o]=t.charCodeAt(o);return n}function b(t){return"boolean"==typeof p?s.resolve(p):function(t){return new s((function(e){var n=t.transaction(l,g),r=i([""]);n.objectStore(l).put(r,"key"),n.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},n.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);e(n||!t||parseInt(t[1],10)>=43)}})).catch((function(){return!1}))}(t).then((function(t){return p=t}))}function m(t){var e=h[t.name],n={};n.promise=new s((function(t,e){n.resolve=t,n.reject=e})),e.deferredOperations.push(n),e.dbReady?e.dbReady=e.dbReady.then((function(){return n.promise})):e.dbReady=n.promise}function w(t){var e=h[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function E(t,e){var n=h[t.name].deferredOperations.pop();if(n)return n.reject(e),n.promise}function S(t,e){return new s((function(n,r){if(h[t.name]=h[t.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},t.db){if(!e)return n(t.db);m(t),t.db.close()}var i=[t.name];e&&i.push(t.version);var s=o.open.apply(o,i);e&&(s.onupgradeneeded=function(e){var n=s.result;try{n.createObjectStore(t.storeName),e.oldVersion<=1&&n.createObjectStore(l)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),s.onerror=function(t){t.preventDefault(),r(s.error)},s.onsuccess=function(){var e=s.result;e.onversionchange=function(t){t.target.close()},n(e),w(t)}}))}function _(t){return S(t,!1)}function T(t){return S(t,!0)}function O(t,e){if(!t.db)return!0;var n=!t.db.objectStoreNames.contains(t.storeName),r=t.version<t.db.version,o=t.version>t.db.version;if(r&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||n){if(n){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function I(t){return i([v(atob(t.data))],{type:t.type})}function x(t){return t&&t.__local_forage_encoded_blob}function N(t){var e=this,n=e._initReady().then((function(){var t=h[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady}));return u(n,t,t),n}function A(t,e,n,r){void 0===r&&(r=1);try{var o=t.db.transaction(t.storeName,e);n(null,o)}catch(o){if(r>0&&(!t.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return s.resolve().then((function(){if(!t.db||"NotFoundError"===o.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),T(t)})).then((function(){return function(t){m(t);for(var e=h[t.name],n=e.forages,r=0;r<n.length;r++){var o=n[r];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,_(t).then((function(e){return t.db=e,O(t)?T(t):e})).then((function(r){t.db=e.db=r;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=r})).catch((function(e){throw E(t,e),e}))}(t).then((function(){A(t,e,n,r-1)}))})).catch(n);n(o)}}var D={_driver:"asyncStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var r in t)n[r]=t[r];var o=h[n.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},h[n.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=N);var i=[];function a(){return s.resolve()}for(var u=0;u<o.forages.length;u++){var c=o.forages[u];c!==e&&i.push(c._initReady().catch(a))}var f=o.forages.slice(0);return s.all(i).then((function(){return n.db=o.db,_(n)})).then((function(t){return n.db=t,O(n,e._defaultConfig.version)?T(n):t})).then((function(t){n.db=o.db=t,e._dbInfo=n;for(var r=0;r<f.length;r++){var i=f[r];i!==e&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}}))},_support:function(){try{if(!o||!o.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}(),iterate:function(t,e){var n=this,r=new s((function(e,r){n.ready().then((function(){A(n._dbInfo,y,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var n=s.result;if(n){var r=n.value;x(r)&&(r=I(r));var o=t(r,n.key,a++);void 0!==o?e(o):n.continue()}else e()},s.onerror=function(){r(s.error)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},getItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){A(n._dbInfo,y,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName).get(t);s.onsuccess=function(){var t=s.result;void 0===t&&(t=null),x(t)&&(t=I(t)),e(t)},s.onerror=function(){r(s.error)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},setItem:function(t,e,n){var r=this;t=c(t);var o=new s((function(n,o){var i;r.ready().then((function(){return i=r._dbInfo,"[object Blob]"===d.call(e)?b(i.db).then((function(t){return t?e:(n=e,new s((function(t,e){var r=new FileReader;r.onerror=e,r.onloadend=function(e){var r=btoa(e.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)})));var n})):e})).then((function(e){A(r._dbInfo,g,(function(i,s){if(i)return o(i);try{var a=s.objectStore(r._dbInfo.storeName);null===e&&(e=void 0);var u=a.put(e,t);s.oncomplete=function(){void 0===e&&(e=null),n(e)},s.onabort=s.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(t){o(t)}}))})).catch(o)}));return a(o,n),o},removeItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){A(n._dbInfo,g,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){r(s.error)},i.onabort=function(){var t=s.error?s.error:s.transaction.error;r(t)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},clear:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){A(e._dbInfo,g,(function(r,o){if(r)return n(r);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;n(t)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},length:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){A(e._dbInfo,y,(function(r,o){if(r)return n(r);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){n(i.error)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},key:function(t,e){var n=this,r=new s((function(e,r){t<0?e(null):n.ready().then((function(){A(n._dbInfo,y,(function(o,i){if(o)return r(o);try{var s=i.objectStore(n._dbInfo.storeName),a=!1,u=s.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===t||a?e(n.key):(a=!0,n.advance(t)):e(null)},u.onerror=function(){r(u.error)}}catch(t){r(t)}}))})).catch(r)}));return a(r,e),r},keys:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){A(e._dbInfo,y,(function(r,o){if(r)return n(r);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),s=[];i.onsuccess=function(){var e=i.result;e?(s.push(e.key),e.continue()):t(s)},i.onerror=function(){n(i.error)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},dropInstance:function(t,e){e=f.apply(this,arguments);var n=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName);var r,i=this;if(t.name){var u=t.name===n.name&&i._dbInfo.db?s.resolve(i._dbInfo.db):_(t).then((function(e){var n=h[t.name],r=n.forages;n.db=e;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=e;return e}));r=t.storeName?u.then((function(e){if(e.objectStoreNames.contains(t.storeName)){var n=e.version+1;m(t);var r=h[t.name],i=r.forages;e.close();for(var a=0;a<i.length;a++){var u=i[a];u._dbInfo.db=null,u._dbInfo.version=n}var c=new s((function(e,r){var i=o.open(t.name,n);i.onerror=function(t){i.result.close(),r(t)},i.onupgradeneeded=function(){i.result.deleteObjectStore(t.storeName)},i.onsuccess=function(){var t=i.result;t.close(),e(t)}}));return c.then((function(t){r.db=t;for(var e=0;e<i.length;e++){var n=i[e];n._dbInfo.db=t,w(n._dbInfo)}})).catch((function(e){throw(E(t,e)||s.resolve()).catch((function(){})),e}))}})):u.then((function(e){m(t);var n=h[t.name],r=n.forages;e.close();for(var i=0;i<r.length;i++)r[i]._dbInfo.db=null;var a=new s((function(e,n){var r=o.deleteDatabase(t.name);r.onerror=function(){var t=r.result;t&&t.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},r.onsuccess=function(){var t=r.result;t&&t.close(),e(t)}}));return a.then((function(t){n.db=t;for(var e=0;e<r.length;e++)w(r[e]._dbInfo)})).catch((function(e){throw(E(t,e)||s.resolve()).catch((function(){})),e}))}))}else r=s.reject("Invalid arguments");return a(r,e),r}};var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P=/^~~local_forage_type~([^~]+)~/,C="__lfsc__:",R=C.length,k="arbf",B="blob",U="si08",j="ui08",M="uic8",H="si16",F="si32",G="ur16",V="ui32",$="fl32",z="fl64",q=R+k.length,W=Object.prototype.toString;function J(t){var e,n,r,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),f=new Uint8Array(c);for(e=0;e<a;e+=4)n=L.indexOf(t[e]),r=L.indexOf(t[e+1]),o=L.indexOf(t[e+2]),i=L.indexOf(t[e+3]),f[u++]=n<<2|r>>4,f[u++]=(15&r)<<4|o>>2,f[u++]=(3&o)<<6|63&i;return c}function Y(t){var e,n=new Uint8Array(t),r="";for(e=0;e<n.length;e+=3)r+=L[n[e]>>2],r+=L[(3&n[e])<<4|n[e+1]>>4],r+=L[(15&n[e+1])<<2|n[e+2]>>6],r+=L[63&n[e+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var K={serialize:function(t,e){var n="";if(t&&(n=W.call(t)),t&&("[object ArrayBuffer]"===n||t.buffer&&"[object ArrayBuffer]"===W.call(t.buffer))){var r,o=C;t instanceof ArrayBuffer?(r=t,o+=k):(r=t.buffer,"[object Int8Array]"===n?o+=U:"[object Uint8Array]"===n?o+=j:"[object Uint8ClampedArray]"===n?o+=M:"[object Int16Array]"===n?o+=H:"[object Uint16Array]"===n?o+=G:"[object Int32Array]"===n?o+=F:"[object Uint32Array]"===n?o+=V:"[object Float32Array]"===n?o+=$:"[object Float64Array]"===n?o+=z:e(new Error("Failed to get type for BinaryArray"))),e(o+Y(r))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n="~~local_forage_type~"+t.type+"~"+Y(this.result);e("__lfsc__:blob"+n)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(n){console.error("Couldn't convert value into a JSON string: ",t),e(null,n)}},deserialize:function(t){if(t.substring(0,R)!==C)return JSON.parse(t);var e,n=t.substring(q),r=t.substring(R,q);if(r===B&&P.test(n)){var o=n.match(P);e=o[1],n=n.substring(o[0].length)}var s=J(n);switch(r){case k:return s;case B:return i([s],{type:e});case U:return new Int8Array(s);case j:return new Uint8Array(s);case M:return new Uint8ClampedArray(s);case H:return new Int16Array(s);case G:return new Uint16Array(s);case F:return new Int32Array(s);case V:return new Uint32Array(s);case $:return new Float32Array(s);case z:return new Float64Array(s);default:throw new Error("Unkown type: "+r)}},stringToBuffer:J,bufferToString:Y};function X(t,e,n,r){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function Z(t,e,n,r,o,i){t.executeSql(n,r,o,(function(t,s){s.code===s.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],(function(t,a){a.rows.length?i(t,s):X(t,e,(function(){t.executeSql(n,r,o,i)}),i)}),i):i(t,s)}),i)}function Q(t,e,n,r){var o=this;t=c(t);var i=new s((function(i,s){o.ready().then((function(){void 0===e&&(e=null);var a=e,u=o._dbInfo;u.serializer.serialize(e,(function(e,c){c?s(c):u.db.transaction((function(n){Z(n,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],(function(){i(a)}),(function(t,e){s(e)}))}),(function(e){if(e.code===e.QUOTA_ERR){if(r>0)return void i(Q.apply(o,[t,a,n,r-1]));s(e)}}))}))})).catch(s)}));return a(i,n),i}function tt(t){return new s((function(e,n){t.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var o=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name);e({db:t,storeNames:o})}),(function(t,e){n(e)}))}),(function(t){n(t)}))}))}var et={_driver:"webSQLStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var r in t)n[r]="string"!=typeof t[r]?t[r].toString():t[r];var o=new s((function(t,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(t){return r(t)}n.db.transaction((function(o){X(o,n,(function(){e._dbInfo=n,t()}),(function(t,e){r(e)}))}),r)}));return n.serializer=K,o},_support:"function"==typeof openDatabase,iterate:function(t,e){var n=this,r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"SELECT * FROM "+o.storeName,[],(function(n,r){for(var i=r.rows,s=i.length,a=0;a<s;a++){var u=i.item(a),c=u.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=t(c,u.key,a+1)))return void e(c)}e()}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},getItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],(function(t,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),e(r)}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},setItem:function(t,e,n){return Q.apply(this,[t,e,n,1])},removeItem:function(t,e){var n=this;t=c(t);var r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],(function(){e()}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},clear:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){Z(e,r,"DELETE FROM "+r.storeName,[],(function(){t()}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},length:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){Z(e,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(e,n){var r=n.rows.item(0).c;t(r)}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},key:function(t,e){var n=this,r=new s((function(e,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){Z(n,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],(function(t,n){var r=n.rows.length?n.rows.item(0).key:null;e(r)}),(function(t,e){r(e)}))}))})).catch(r)}));return a(r,e),r},keys:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){Z(e,r,"SELECT key FROM "+r.storeName,[],(function(e,n){for(var r=[],o=0;o<n.rows.length;o++)r.push(n.rows.item(o).key);t(r)}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},dropInstance:function(t,e){e=f.apply(this,arguments);var n=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName);var r,o=this;return a(r=t.name?new s((function(e){var r;r=t.name===n.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:r,storeNames:[t.storeName]}):e(tt(r))})).then((function(t){return new s((function(e,n){t.db.transaction((function(r){function o(t){return new s((function(e,n){r.executeSql("DROP TABLE IF EXISTS "+t,[],(function(){e()}),(function(t,e){n(e)}))}))}for(var i=[],a=0,u=t.storeNames.length;a<u;a++)i.push(o(t.storeNames[a]));s.all(i).then((function(){e()})).catch((function(t){n(t)}))}),(function(t){n(t)}))}))})):s.reject("Invalid arguments"),e),r}};function nt(t,e){var n=t.name+"/";return t.storeName!==e.storeName&&(n+=t.storeName+"/"),n}function rt(){return!function(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(t){return!0}}()||localStorage.length>0}var ot={_driver:"localStorageWrapper",_initStorage:function(t){var e={};if(t)for(var n in t)e[n]=t[n];return e.keyPrefix=nt(t,this._defaultConfig),rt()?(this._dbInfo=e,e.serializer=K,s.resolve()):s.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}(),iterate:function(t,e){var n=this,r=n.ready().then((function(){for(var e=n._dbInfo,r=e.keyPrefix,o=r.length,i=localStorage.length,s=1,a=0;a<i;a++){var u=localStorage.key(a);if(0===u.indexOf(r)){var c=localStorage.getItem(u);if(c&&(c=e.serializer.deserialize(c)),void 0!==(c=t(c,u.substring(o),s++)))return c}}}));return a(r,e),r},getItem:function(t,e){var n=this;t=c(t);var r=n.ready().then((function(){var e=n._dbInfo,r=localStorage.getItem(e.keyPrefix+t);return r&&(r=e.serializer.deserialize(r)),r}));return a(r,e),r},setItem:function(t,e,n){var r=this;t=c(t);var o=r.ready().then((function(){void 0===e&&(e=null);var n=e;return new s((function(o,i){var s=r._dbInfo;s.serializer.serialize(e,(function(e,r){if(r)i(r);else try{localStorage.setItem(s.keyPrefix+t,e),o(n)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||i(t),i(t)}}))}))}));return a(o,n),o},removeItem:function(t,e){var n=this;t=c(t);var r=n.ready().then((function(){var e=n._dbInfo;localStorage.removeItem(e.keyPrefix+t)}));return a(r,e),r},clear:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(t)&&localStorage.removeItem(r)}}));return a(n,t),n},length:function(t){var e=this.keys().then((function(t){return t.length}));return a(e,t),e},key:function(t,e){var n=this,r=n.ready().then((function(){var e,r=n._dbInfo;try{e=localStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(r.keyPrefix.length)),e}));return a(r,e),r},keys:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo,n=localStorage.length,r=[],o=0;o<n;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&r.push(i.substring(t.keyPrefix.length))}return r}));return a(n,t),n},dropInstance:function(t,e){if(e=f.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var n=this.config();t.name=t.name||n.name,t.storeName=t.storeName||n.storeName}var r,o=this;return r=t.name?new s((function(e){t.storeName?e(nt(t,o._defaultConfig)):e(t.name+"/")})).then((function(t){for(var e=localStorage.length-1;e>=0;e--){var n=localStorage.key(e);0===n.indexOf(t)&&localStorage.removeItem(n)}})):s.reject("Invalid arguments"),a(r,e),r}},it=function(t,e){for(var n=t.length,r=0;r<n;){if((o=t[r])===(i=e)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;r++}var o,i;return!1},st=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},at={},ut={},ct={INDEXEDDB:D,WEBSQL:et,LOCALSTORAGE:ot},ft=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],lt=["dropInstance"],pt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(lt),ht={description:"",driver:ft.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function dt(t,e){t[e]=function(){var n=arguments;return t.ready().then((function(){return t[e].apply(t,n)}))}}function yt(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var n in e)e.hasOwnProperty(n)&&(st(e[n])?arguments[0][n]=e[n].slice():arguments[0][n]=e[n])}return arguments[0]}var gt=function(){function t(e){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ct)if(ct.hasOwnProperty(n)){var r=ct[n],o=r._driver;this[n]=o,at[o]||this.defineDriver(r)}this._defaultConfig=yt({},ht),this._config=yt({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":r(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,n){var r=new s((function(e,n){try{var r=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void n(o);for(var i=pt.concat("_initStorage"),u=0,c=i.length;u<c;u++){var f=i[u];if((!it(lt,f)||t[f])&&"function"!=typeof t[f])return void n(o)}!function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),n=s.reject(e);return a(n,arguments[arguments.length-1]),n}},n=0,r=lt.length;n<r;n++){var o=lt[n];t[o]||(t[o]=e(o))}}();var l=function(n){at[r]&&console.info("Redefining LocalForage driver: "+r),at[r]=t,ut[r]=n,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(l,n):l(!!t._support):l(!0)}catch(t){n(t)}}));return u(r,e,n),r},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,n){var r=at[t]?s.resolve(at[t]):s.reject(new Error("Driver not found."));return u(r,e,n),r},t.prototype.getSerializer=function(t){var e=s.resolve(K);return u(e,t),e},t.prototype.ready=function(t){var e=this,n=e._driverSet.then((function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready}));return u(n,t,t),n},t.prototype.setDriver=function(t,e,n){var r=this;st(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){r._config.driver=r.driver()}function a(t){return r._extend(t),i(),r._ready=r._initStorage(r._config),r._ready}var c=null!==this._driverSet?this._driverSet.catch((function(){return s.resolve()})):s.resolve();return this._driverSet=c.then((function(){var t=o[0];return r._dbInfo=null,r._ready=null,r.getDriver(t).then((function(t){r._driver=t._driver,i(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(t){return function(){var e=0;return function n(){for(;e<t.length;){var o=t[e];return e++,r._dbInfo=null,r._ready=null,r.getDriver(o).then(a).catch(n)}i();var u=new Error("No available storage method found.");return r._driverSet=s.reject(u),r._driverSet}()}}(o)}))})).catch((function(){i();var t=new Error("No available storage method found.");return r._driverSet=s.reject(t),r._driverSet})),u(this._driverSet,e,n),this._driverSet},t.prototype.supports=function(t){return!!ut[t]},t.prototype._extend=function(t){yt(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=pt.length;t<e;t++)dt(this,pt[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),vt=new gt;e.exports=vt},{3:3}]},{},[4])(4)},238:function(t,e,n){var r;!function(o,i){"use strict";var s="function",a="undefined",u="object",c="string",f="model",l="name",p="type",h="vendor",d="version",y="architecture",g="console",v="mobile",b="tablet",m="smarttv",w="wearable",E="embedded",S="Amazon",_="Apple",T="ASUS",O="BlackBerry",I="Google",x="Huawei",N="LG",A="Microsoft",D="Motorola",L="Samsung",P="Sharp",C="Sony",R="Xiaomi",k="Zebra",B="Facebook",U=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},j=function(t,e){return typeof t===c&&-1!==M(e).indexOf(M(t))},M=function(t){return t.toLowerCase()},H=function(t,e){if(typeof t===c)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===a?t:t.substring(0,350)},F=function(t,e){for(var n,r,o,a,c,f,l=0;l<e.length&&!c;){var p=e[l],h=e[l+1];for(n=r=0;n<p.length&&!c;)if(c=p[n++].exec(t))for(o=0;o<h.length;o++)f=c[++r],typeof(a=h[o])===u&&a.length>0?2===a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,f):this[a[0]]=a[1]:3===a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=f?f.replace(a[1],a[2]):i:this[a[0]]=f?a[1].call(this,f,a[2]):i:4===a.length&&(this[a[0]]=f?a[3].call(this,f.replace(a[1],a[2])):i):this[a]=f||i;l+=2}},G=function(t,e){for(var n in e)if(typeof e[n]===u&&e[n].length>0){for(var r=0;r<e[n].length;r++)if(j(e[n][r],t))return"?"===n?i:n}else if(j(e[n],t))return"?"===n?i:n;return t},V={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure Browser"],d],[/\bfocus\/([\w\.]+)/i],[d,[l,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[d,[l,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 Browser"]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,"Chrome WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,M]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,"",M]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,M]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,L],[p,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,L],[p,v]],[/\((ip(?:hone|od)[\w ]*);/i],[f,[h,_],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,_],[p,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[h,x],[p,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[h,x],[p,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[h,R],[p,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[h,R],[p,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,"OPPO"],[p,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,"Vivo"],[p,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[h,"Realme"],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[h,D],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,D],[p,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,N],[p,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,N],[p,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[h,"Lenovo"],[p,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[h,"Nokia"],[p,v]],[/(pixel c)\b/i],[f,[h,I],[p,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,I],[p,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,C],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[h,C],[p,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,"OnePlus"],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,S],[p,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[h,S],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[p,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,O],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,T],[p,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,T],[p,v]],[/(nexus 9)/i],[f,[h,"HTC"],[p,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[f,/_/g," "],[p,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,"Acer"],[p,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,"Meizu"],[p,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,P],[p,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[p,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,f,[p,b]],[/(surface duo)/i],[f,[h,A],[p,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,"Fairphone"],[p,v]],[/(u304aa)/i],[f,[h,"AT&T"],[p,v]],[/\bsie-(\w*)/i],[f,[h,"Siemens"],[p,v]],[/\b(rct\w+) b/i],[f,[h,"RCA"],[p,b]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,"Dell"],[p,b]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,"Verizon"],[p,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,"Barnes & Noble"],[p,b]],[/\b(tm\d{3}\w+) b/i],[f,[h,"NuVision"],[p,b]],[/\b(k88) b/i],[f,[h,"ZTE"],[p,b]],[/\b(nx\d{3}j) b/i],[f,[h,"ZTE"],[p,v]],[/\b(gen\d{3}) b.+49h/i],[f,[h,"Swiss"],[p,v]],[/\b(zur\d{3}) b/i],[f,[h,"Swiss"],[p,b]],[/\b((zeki)?tb.*\b) b/i],[f,[h,"Zeki"],[p,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],f,[p,b]],[/\b(ns-?\w{0,9}) b/i],[f,[h,"Insignia"],[p,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,"NextBook"],[p,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],f,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],f,[p,v]],[/\b(ph-1) /i],[f,[h,"Essential"],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,"Envizen"],[p,b]],[/\b(trio[-\w\. ]+) b/i],[f,[h,"MachSpeed"],[p,b]],[/\btu_(1491) b/i],[f,[h,"Rotor"],[p,b]],[/(shield[\w ]+) b/i],[f,[h,"Nvidia"],[p,b]],[/(sprint) (\w+)/i],[h,f,[p,v]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[h,A],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,k],[p,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,k],[p,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[p,g]],[/droid.+; (shield) bui/i],[f,[h,"Nvidia"],[p,g]],[/(playstation [345portablevi]+)/i],[f,[h,C],[p,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,A],[p,g]],[/smart-tv.+(samsung)/i],[h,[p,m]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[h,L],[p,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,N],[p,m]],[/(apple) ?tv/i],[h,[f,"Apple TV"],[p,m]],[/crkey/i],[[f,"Chromecast"],[h,I],[p,m]],[/droid.+aft(\w)( bui|\))/i],[f,[h,S],[p,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[h,P],[p,m]],[/(bravia[\w ]+)( bui|\))/i],[f,[h,C],[p,m]],[/(mitv-\w{5}) bui/i],[f,[h,R],[p,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,H],[f,H],[p,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,m]],[/((pebble))app/i],[h,f,[p,w]],[/droid.+; (glass) \d/i],[f,[h,I],[p,w]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,k],[p,w]],[/(quest( 2)?)/i],[f,[h,B],[p,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[p,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[p,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,G,V]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,G,V]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,O]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[l,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,d]]},z=function(t,e){if(typeof t===u&&(e=t,t=i),!(this instanceof z))return new z(t,e).getResult();var n=t||(typeof o!==a&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),r=e?function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n}($,e):$;return this.getBrowser=function(){var t,e={};return e.name=i,e.version=i,F.call(e,n,r.browser),e.major=typeof(t=e.version)===c?t.replace(/[^\d\.]/g,"").split(".")[0]:i,e},this.getCPU=function(){var t={};return t.architecture=i,F.call(t,n,r.cpu),t},this.getDevice=function(){var t={};return t.vendor=i,t.model=i,t.type=i,F.call(t,n,r.device),t},this.getEngine=function(){var t={};return t.name=i,t.version=i,F.call(t,n,r.engine),t},this.getOS=function(){var t={};return t.name=i,t.version=i,F.call(t,n,r.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n=typeof t===c&&t.length>350?H(t,350):t,this},this.setUA(n),this};z.VERSION="1.0.32",z.BROWSER=U([l,d,"major"]),z.CPU=U([y]),z.DEVICE=U([f,h,p,g,v,m,b,w,E]),z.ENGINE=z.OS=U([l,d]),typeof e!==a?(t.exports&&(e=t.exports=z),e.UAParser=z):n.amdO?(r=function(){return z}.call(e,n,e,t))===i||(t.exports=r):typeof o!==a&&(o.UAParser=z);var q=typeof o!==a&&(o.jQuery||o.Zepto);if(q&&!q.ua){var W=new z;q.ua=W.getResult(),q.ua.get=function(){return W.getUA()},q.ua.set=function(t){W.setUA(t);var e=W.getResult();for(var n in e)q.ua[n]=e[n]}}}("object"==typeof window?window:this)},147:t=>{"use strict";t.exports={i8:"2.5.1"}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.amdO={},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};(()=>{"use strict";n.d(r,{default:()=>Mr});for(var t=function(){function t(){}var e,r;return e=t,t.SDK_VERSION=n(147).i8,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.SHOPIFY_LOG_PREFIX="CooeeShopify",t.COOEE="cooee",t.SESSION_STORAGE_TAB_OPENED="tabop",t.SESSION_STORAGE_SCROLL_ID="sleid",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_WRAPPER_NAME="cooee-wrapper",t.IN_APP_CONTAINER_NAME="cooee-container",t.IN_APP_DEFAULT_PADDING=15,t.EVENT_SCREEN_VIEW="CE Screen View",t.EVENT_APP_INSTALLED="CE App Installed",t.EVENT_APP_LAUNCHED="CE App Launched",t.EVENT_SESSION_CONCLUDED="CE Session Concluded",t.EVENT_SESSION_STARTED="CE Session Started",t.EVENT_APP_FOREGROUND="CE App Foreground",t.EVENT_APP_BACKGROUND="CE App Background",t.EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed",t.EVENT_TRIGGER_REJECTED="CE Trigger Rejected",t.EVENT_TRIGGER_CLOSED="CE Trigger Closed",t.EVENT_SCROLL="CE Scroll",t.EVENT_TRIGGER_CLICKED="CE Trigger Clicked",t.EVENT_ADD_TO_CART="Add To Cart",t.EVENT_VIEW_ITEM="View Item",t.EVENT_VIEW_CART="View Cart",t.blackListedScreenName=["collection","product","cart"],t.BOT_USER_AGENTS_PATTERN="(googlebot/|bot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)",t.BOT_UA_REGEX=new RegExp(e.BOT_USER_AGENTS_PATTERN,"i"),t.API_CALL_MAX_ATTEMPTS=3,t.API_CALL_RETRY_DELAY=1e3,r=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(r,10),t}(),e=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)e[a]=s[a],o[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,n,r){for(var o,i,s=[],a=n;a<r;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(e[(i=o)>>18&63]+e[i>>12&63]+e[i>>6&63]+e[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;var l,p,h=function(t){var e,n,r=c(t),s=r[0],a=r[1],u=new i(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),f=0,l=a>0?s-4:s;for(n=0;n<l;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,u[f++]=255&e),1===a&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},d=function(t){for(var n,r=t.length,o=r%3,i=[],s=16383,a=0,u=r-o;a<u;a+=s)i.push(f(t,a,a+s>u?u:a+s));return 1===o?(n=t[r-1],i.push(e[n>>2]+e[n<<4&63]+"==")):2===o&&(n=(t[r-2]<<8)+t[r-1],i.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"=")),i.join("")},y=function(t,e,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,f=-7,l=n?o-1:0,p=n?-1:1,h=t[e+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=p,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=r;f>0;s=256*s+t[e+l],l+=p,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),i-=c}return(h?-1:1)*s*Math.pow(2,i-r)},g=function(t,e,n,r,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[n+h]=255&a,h+=d,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[n+h]=255&s,h+=d,s/=256,c-=8);t[n+h-d]|=128*y},v=(l=function(t,e){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},e.INSPECT_MAX_BYTES=50;var r=2147483647;function o(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return s(t,e,n)}function s(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|p(t,e),r=o(n),s=r.write(t,e);return s!==n&&(r=r.slice(0,s)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t));if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return f(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return f(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return i.from(r,e,n);var s=function(t){if(i.isBuffer(t)){var e=0|l(t.length),n=o(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||V(t.length)?o(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t))}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return a(t),o(t<0?0:0|l(t))}function c(t){for(var e=t.length<0?0:0|l(t.length),n=o(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function f(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,i.prototype),r}function l(t){if(t>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function p(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(t));var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(o)return r?-1:M(t).length;e=(""+e).toLowerCase(),o=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return x(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return I(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,o){var i,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=n;i<a;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(n+u>a&&(n=a-u),i=n;i>=0;i--){for(var l=!0,p=0;p<u;p++)if(c(t,i+p)!==c(e,p)){l=!1;break}if(l)return i}return-1}function E(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(V(a))return s;t[n+s]=a}return s}function S(t,e,n,r){return F(M(e,t.length-n),t,n,r)}function _(t,e,n,r){return F(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function T(t,e,n,r){return F(H(e),t,n,r)}function O(t,e,n,r){return F(function(t,e){for(var n,r,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=(n=t.charCodeAt(s))>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function I(t,e,n){return 0===e&&n===t.length?d(t):d(t.slice(e,n))}function x(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,s,a,u,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),o+=l}return function(t){var e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=N));return n}(r)}e.kMaxLength=r,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(t,e,n){return s(t,e,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(t,e,n){return function(t,e,n){return a(t),t<=0?o(t):void 0!==e?"string"==typeof n?o(t).fill(e,n):o(t).fill(e):o(t)}(t,e,n)},i.allocUnsafe=function(t){return u(t)},i.allocUnsafeSlow=function(t){return u(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(G(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,o=0,s=Math.min(n,r);o<s;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=i.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(G(s,Uint8Array))o+s.length>r.length?i.from(s).copy(r,o):Uint8Array.prototype.set.call(r,s,o);else{if(!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o)}o+=s.length}return r},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)b(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):v.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(t,e,n,r,o){if(G(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(t));if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),u=Math.min(s,a),c=this.slice(r,o),f=t.slice(e,n),l=0;l<u;++l)if(c[l]!==f[l]){s=c[l],a=f[l];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},i.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},i.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},i.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return S(this,t,e,n);case"ascii":case"latin1":case"binary":return _(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function D(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function L(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=$[t[i]];return o}function P(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length-1;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,r,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function k(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(t,e,n,r,o){return e=+e,n>>>=0,o||k(t,0,n,4),g(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return e=+e,n>>>=0,o||k(t,0,n,8),g(t,e,n,r,52,8),n+8}i.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return Object.setPrototypeOf(r,i.prototype),r},i.prototype.readUintLE=i.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),y(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),y(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),y(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),y(this,t,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||R(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||R(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);R(this,t,e,n,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);R(this,t,e,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,n){return B(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return B(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),o},i.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var o=t.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var a=i.isBuffer(t)?t:i.from(t,r),u=a.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-e;++s)this[s+e]=a[s%u]}return this};var j=/[^+/0-9A-Za-z-_]/g;function M(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function H(t){return h(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}var $=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)e[r+o]=t[n]+t[o];return e}()},l(p={exports:{}},p.exports),p.exports),b=v.Buffer;v.SlowBuffer,v.INSPECT_MAX_BYTES,v.kMaxLength;var m=function(t,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},m(t,e)};function w(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var E=function(t){function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return w(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),S=function(t){function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return w(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function _(t){return t&&t.Math==Math&&t}function T(){return _("object"==typeof globalThis&&globalThis)||_("object"==typeof window&&window)||_("object"==typeof self&&self)||_("object"==typeof n.g&&n.g)||Function("return this")()}var O=function(t){var e,n="object"==typeof(e=T()).navigator&&"ReactNative"===e.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(n);for(var r=b.alloc(t),o=0;o<t;++o)r[o]=Math.floor(256*Math.random());return r},I=function(){if("undefined"!=typeof window){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(b.alloc(e))}}return void 0!==n.g&&n.g.crypto&&n.g.crypto.getRandomValues?function(t){return n.g.crypto.getRandomValues(b.alloc(t))}:O}();function x(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function N(t){return"object"==typeof t&&null!==t}function A(t,e){var n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(console.warn(e),n=!0),t.apply(this,r)}}function D(t){if(ArrayBuffer.isView(t))return b.from(t.buffer,t.byteOffset,t.byteLength);if(e=t,["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e)))return b.from(t);var e;throw new S("Must use either Buffer or TypedArray")}var L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,P=function(t){return"string"==typeof t&&L.test(t)},C=function(t){if(!P(t))throw new S('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return b.from(e,"hex")},R=function(t,e){return void 0===e&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")},k=Symbol("id"),B=function(){function t(e){if(void 0===e)this.id=t.generate();else if(e instanceof t)this[k]=b.from(e.id),this.__id=e.__id;else if(ArrayBuffer.isView(e)&&16===e.byteLength)this.id=D(e);else{if("string"!=typeof e)throw new S("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");this.id=C(e)}}return Object.defineProperty(t.prototype,"id",{get:function(){return this[k]},set:function(e){this[k]=e,t.cacheHexString&&(this.__id=R(e))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(e){if(void 0===e&&(e=!0),t.cacheHexString&&this.__id)return this.__id;var n=R(this.id,e);return t.cacheHexString&&(this.__id=n),n},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(!e)return!1;if(e instanceof t)return e.id.equals(this.id);try{return new t(e).id.equals(this.id)}catch(t){return!1}},t.prototype.toBinary=function(){return new U(this.id,U.SUBTYPE_UUID)},t.generate=function(){var t=I(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,b.from(t)},t.isValid=function(e){if(!e)return!1;if(e instanceof t)return!0;if("string"==typeof e)return P(e);if(x(e)){if(16!==e.length)return!1;try{return parseInt(e[6].toString(16)[0],10)===U.SUBTYPE_UUID}catch(t){return!1}}return!1},t.createFromHexString=function(e){return new t(C(e))},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}();Object.defineProperty(B.prototype,"_bsontype",{value:"UUID"});var U=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);if(!(null==e||"string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Array.isArray(e)))throw new S("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=n?n:t.BSON_BINARY_SUBTYPE_DEFAULT,null==e?(this.buffer=b.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof e?this.buffer=b.from(e,"binary"):Array.isArray(e)?this.buffer=b.from(e):this.buffer=D(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if("string"==typeof e&&1!==e.length)throw new S("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new S("only accepts single character Uint8Array or Array");var n;if((n="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0])<0||n>255)throw new S("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=n;else{var r=b.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r,this.buffer[this.position++]=n}},t.prototype.write=function(t,e){if(e="number"==typeof e?e:this.position,this.buffer.length<e+t.length){var n=b.alloc(this.buffer.length+t.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(t)?(this.buffer.set(D(t),e),this.position=e+t.byteLength>this.position?e+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,e,t.length,"binary"),this.position=e+t.length>this.position?e+t.length:this.position)},t.prototype.read=function(t,e){return e=e&&e>0?e:this.position,this.buffer.slice(t,t+e)},t.prototype.value=function(t){return(t=!!t)&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(t){return this.buffer.toString(t)},t.prototype.toExtendedJSON=function(t){t=t||{};var e=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return t.legacy?{$binary:e,$type:1===n.length?"0"+n:n}:{$binary:{base64:e,subType:1===n.length?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new B(this.buffer.slice(0,this.position));throw new E('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,n){var r,o;if(n=n||{},"$binary"in e?n.legacy&&"string"==typeof e.$binary&&"$type"in e?(o=e.$type?parseInt(e.$type,16):0,r=b.from(e.$binary,"base64")):"string"!=typeof e.$binary&&(o=e.$binary.subType?parseInt(e.$binary.subType,16):0,r=b.from(e.$binary.base64,"base64")):"$uuid"in e&&(o=4,r=C(e.$uuid)),!r)throw new S("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return new t(r,o)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(U.prototype,"_bsontype",{value:"Binary"});var j=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);this.code=e,this.scope=n}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},t}();Object.defineProperty(j.prototype,"_bsontype",{value:"Code"});var M=function(){function t(e,n,r,o){if(!(this instanceof t))return new t(e,n,r,o);var i=e.split(".");2===i.length&&(r=i.shift(),e=i.shift()),this.collection=e,this.oid=n,this.db=r,this.fields=o||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(t.$db=this.db),t},t.prototype.toExtendedJSON=function(t){t=t||{};var e={$ref:this.collection,$id:this.oid};return t.legacy?e:(this.db&&(e.$db=this.db),e=Object.assign(e,this.fields))},t.fromExtendedJSON=function(e){var n=Object.assign({},e);return delete n.$ref,delete n.$id,delete n.$db,new t(e.$ref,e.$id,e.$db,n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t}();Object.defineProperty(M.prototype,"_bsontype",{value:"DBRef"});var H=void 0;try{H=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}var F=4294967296,G=0x10000000000000000,V=G/2,$={},z={},q=function(){function t(e,n,r){if(void 0===e&&(e=0),!(this instanceof t))return new t(e,n,r);"bigint"==typeof e?Object.assign(this,t.fromBigInt(e,!!n)):"string"==typeof e?Object.assign(this,t.fromString(e,!!n)):(this.low=0|e,this.high=0|n,this.unsigned=!!r),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,n,r){return new t(e,n,r)},t.fromInt=function(e,n){var r,o,i;return n?(i=0<=(e>>>=0)&&e<256)&&(o=z[e])?o:(r=t.fromBits(e,(0|e)<0?-1:0,!0),i&&(z[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(o=$[e])?o:(r=t.fromBits(e,e<0?-1:0,!1),i&&($[e]=r),r)},t.fromNumber=function(e,n){if(isNaN(e))return n?t.UZERO:t.ZERO;if(n){if(e<0)return t.UZERO;if(e>=G)return t.MAX_UNSIGNED_VALUE}else{if(e<=-V)return t.MIN_VALUE;if(e+1>=V)return t.MAX_VALUE}return e<0?t.fromNumber(-e,n).neg():t.fromBits(e%F|0,e/F|0,n)},t.fromBigInt=function(e,n){return t.fromString(e.toString(),n)},t.fromString=function(e,n,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t.ZERO;if("number"==typeof n?(r=n,n=!1):n=!!n,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return t.fromString(e.substring(1),n,r).neg();for(var i=t.fromNumber(Math.pow(r,8)),s=t.ZERO,a=0;a<e.length;a+=8){var u=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+u),r);if(u<8){var f=t.fromNumber(Math.pow(r,u));s=s.mul(f).add(t.fromNumber(c))}else s=(s=s.mul(i)).add(t.fromNumber(c))}return s.unsigned=n,s},t.fromBytes=function(e,n,r){return r?t.fromBytesLE(e,n):t.fromBytesBE(e,n)},t.fromBytesLE=function(e,n){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)},t.fromBytesBE=function(e,n){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)},t.isLong=function(t){return N(t)&&!0===t.__isLong__},t.fromValue=function(e,n){return"number"==typeof e?t.fromNumber(e,n):"string"==typeof e?t.fromString(e,n):t.fromBits(e.low,e.high,"boolean"==typeof n?n:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,c=0,f=0,l=0,p=0;return l+=(p+=i+(65535&e.low))>>>16,p&=65535,f+=(l+=o+u)>>>16,l&=65535,c+=(f+=r+a)>>>16,f&=65535,c+=n+s,c&=65535,t.fromBits(l<<16|p,c<<16|f,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(t){return this.compare(t)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(H){if(!this.unsigned&&-2147483648===this.high&&-1===e.low&&-1===e.high)return this;var n=(this.unsigned?H.div_u:H.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(n,H.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var r,o,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;i=t.UZERO}else{if(this.eq(t.MIN_VALUE))return e.eq(t.ONE)||e.eq(t.NEG_ONE)?t.MIN_VALUE:e.eq(t.MIN_VALUE)?t.ONE:(r=this.shr(1).div(e).shl(1)).eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(o=this.sub(e.mul(r)),i=r.add(o.div(e)));if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=t.ZERO}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),a=s<=48?1:Math.pow(2,s-48),u=t.fromNumber(r),c=u.mul(e);c.isNegative()||c.gt(o);)r-=a,c=(u=t.fromNumber(r,this.unsigned)).mul(e);u.isZero()&&(u=t.ONE),i=i.add(u),o=o.sub(c)}return i},t.prototype.div=function(t){return this.divide(t)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},t.prototype.eq=function(t){return this.equals(t)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e,n=0!==this.high?this.high:this.low;for(e=31;e>0&&0==(n&1<<e);e--);return 0!==this.high?e+33:e+1},t.prototype.greaterThan=function(t){return this.comp(t)>0},t.prototype.gt=function(t){return this.greaterThan(t)},t.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},t.prototype.gte=function(t){return this.greaterThanOrEqual(t)},t.prototype.ge=function(t){return this.greaterThanOrEqual(t)},t.prototype.isEven=function(){return 0==(1&this.low)},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return 1==(1&this.low)},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return 0===this.high&&0===this.low},t.prototype.lessThan=function(t){return this.comp(t)<0},t.prototype.lt=function(t){return this.lessThan(t)},t.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},t.prototype.lte=function(t){return this.lessThanOrEqual(t)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),H){var n=(this.unsigned?H.rem_u:H.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(n,H.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(t){return this.modulo(t)},t.prototype.rem=function(t){return this.modulo(t)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),H){var n=H.mul(this.low,this.high,e.low,e.high);return t.fromBits(n,H.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=65535&this.high,i=this.low>>>16,s=65535&this.low,a=e.high>>>16,u=65535&e.high,c=e.low>>>16,f=65535&e.low,l=0,p=0,h=0,d=0;return h+=(d+=s*f)>>>16,d&=65535,p+=(h+=i*f)>>>16,h&=65535,p+=(h+=s*c)>>>16,h&=65535,l+=(p+=o*f)>>>16,p&=65535,l+=(p+=i*c)>>>16,p&=65535,l+=(p+=s*u)>>>16,p&=65535,l+=r*f+o*c+i*u+s*a,l&=65535,t.fromBits(h<<16|d,l<<16|p,this.unsigned)},t.prototype.mul=function(t){return this.multiply(t)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(t){return!this.equals(t)},t.prototype.neq=function(t){return this.notEquals(t)},t.prototype.ne=function(t){return this.notEquals(t)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(t){return this.shiftLeft(t)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(t){return this.shiftRight(t)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;if(e<32){var r=this.low;return t.fromBits(r>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?t.fromBits(n,0,this.unsigned):t.fromBits(n>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},t.prototype.shru=function(t){return this.shiftRightUnsigned(t)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(t){return this.subtract(t)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*F+(this.low>>>0):this.high*F+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},t.prototype.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(t.MIN_VALUE)){var n=t.fromNumber(e),r=this.div(n),o=r.mul(n).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,a="";;){var u=s.div(i),c=(s.sub(u.mul(i)).toInt()>>>0).toString(e);if((s=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(t){return this.lessThanOrEqual(t)},t.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,n){var r=t.fromString(e.$numberLong);return n&&n.relaxed?r.toNumber():r},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(16777216),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t}();Object.defineProperty(q.prototype,"__isLong__",{value:!0}),Object.defineProperty(q.prototype,"_bsontype",{value:"Long"});var W=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,J=/^(\+|-)?(Infinity|inf)$/i,Y=/^(\+|-)?NaN$/i,K=6111,X=-6176,Z=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Q=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),tt=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),et=/^([-+])?(\d+)?$/;function nt(t){return!isNaN(parseInt(t,10))}function rt(t){var e=q.fromNumber(1e9),n=q.fromNumber(0);if(!(t.parts[0]||t.parts[1]||t.parts[2]||t.parts[3]))return{quotient:t,rem:n};for(var r=0;r<=3;r++)n=(n=n.shiftLeft(32)).add(new q(t.parts[r],0)),t.parts[r]=n.div(e).low,n=n.modulo(e);return{quotient:t,rem:n}}function ot(t,e){throw new S('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var it=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!x(e))throw new S("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new S("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(e){var n,r=!1,o=!1,i=!1,s=0,a=0,u=0,c=0,f=0,l=[0],p=0,h=0,d=0,y=0,g=0,v=0,m=new q(0,0),w=new q(0,0),E=0;if(e.length>=7e3)throw new S(e+" not a valid Decimal128 string");var _=e.match(W),T=e.match(J),O=e.match(Y);if(!_&&!T&&!O||0===e.length)throw new S(e+" not a valid Decimal128 string");if(_){var I=_[2],x=_[4],N=_[5],A=_[6];x&&void 0===A&&ot(e,"missing exponent power"),x&&void 0===I&&ot(e,"missing exponent base"),void 0===x&&(N||A)&&ot(e,"missing e before exponent")}if("+"!==e[E]&&"-"!==e[E]||(r="-"===e[E++]),!nt(e[E])&&"."!==e[E]){if("i"===e[E]||"I"===e[E])return new t(b.from(r?Q:tt));if("N"===e[E])return new t(b.from(Z))}for(;nt(e[E])||"."===e[E];)"."!==e[E]?(p<34&&("0"!==e[E]||i)&&(i||(f=a),i=!0,l[h++]=parseInt(e[E],10),p+=1),i&&(u+=1),o&&(c+=1),a+=1,E+=1):(o&&ot(e,"contains multiple periods"),o=!0,E+=1);if(o&&!a)throw new S(e+" not a valid Decimal128 string");if("e"===e[E]||"E"===e[E]){var D=e.substr(++E).match(et);if(!D||!D[2])return new t(b.from(Z));g=parseInt(D[0],10),E+=D[0].length}if(e[E])return new t(b.from(Z));if(d=0,p){if(y=p-1,1!==(s=u))for(;0===l[f+s-1];)s-=1}else d=0,y=0,l[0]=0,u=1,p=1,s=0;for(g<=c&&c-g>16384?g=X:g-=c;g>K;){if((y+=1)-d>34){if(l.join("").match(/^0+$/)){g=K;break}ot(e,"overflow")}g-=1}for(;g<X||p<u;){if(0===y&&s<p){g=X,s=0;break}if(p<u?u-=1:y-=1,g<K)g+=1;else{if(l.join("").match(/^0+$/)){g=K;break}ot(e,"overflow")}}if(y-d+1<s){var L=a;o&&(f+=1,L+=1),r&&(f+=1,L+=1);var P=parseInt(e[f+y+1],10),C=0;if(P>=5&&(C=1,5===P))for(C=l[y]%2==1?1:0,v=f+y+2;v<L;v++)if(parseInt(e[v],10)){C=1;break}if(C)for(var R=y;R>=0;R--)if(++l[R]>9&&(l[R]=0,0===R)){if(!(g<K))return new t(b.from(r?Q:tt));g+=1,l[R]=1}}if(m=q.fromNumber(0),w=q.fromNumber(0),0===s)m=q.fromNumber(0),w=q.fromNumber(0);else if(y-d<17)for(R=d,w=q.fromNumber(l[R++]),m=new q(0,0);R<=y;R++)w=(w=w.multiply(q.fromNumber(10))).add(q.fromNumber(l[R]));else{for(R=d,m=q.fromNumber(l[R++]);R<=y-17;R++)m=(m=m.multiply(q.fromNumber(10))).add(q.fromNumber(l[R]));for(w=q.fromNumber(l[R++]);R<=y;R++)w=(w=w.multiply(q.fromNumber(10))).add(q.fromNumber(l[R]))}var k,B,U,j,M=function(t,e){if(!t&&!e)return{high:q.fromNumber(0),low:q.fromNumber(0)};var n=t.shiftRightUnsigned(32),r=new q(t.getLowBits(),0),o=e.shiftRightUnsigned(32),i=new q(e.getLowBits(),0),s=n.multiply(o),a=n.multiply(i),u=r.multiply(o),c=r.multiply(i);return s=s.add(a.shiftRightUnsigned(32)),a=new q(a.getLowBits(),0).add(u).add(c.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:c=a.shiftLeft(32).add(new q(c.getLowBits(),0))}}(m,q.fromString("100000000000000000"));M.low=M.low.add(w),B=w,((U=(k=M.low).high>>>0)<(j=B.high>>>0)||U===j&&k.low>>>0<B.low>>>0)&&(M.high=M.high.add(q.fromNumber(1))),n=g+6176;var H={low:q.fromNumber(0),high:q.fromNumber(0)};M.high.shiftRightUnsigned(49).and(q.fromNumber(1)).equals(q.fromNumber(1))?(H.high=H.high.or(q.fromNumber(3).shiftLeft(61)),H.high=H.high.or(q.fromNumber(n).and(q.fromNumber(16383).shiftLeft(47))),H.high=H.high.or(M.high.and(q.fromNumber(0x7fffffffffff)))):(H.high=H.high.or(q.fromNumber(16383&n).shiftLeft(49)),H.high=H.high.or(M.high.and(q.fromNumber(562949953421311)))),H.low=M.low,r&&(H.high=H.high.or(q.fromString("9223372036854775808")));var F=b.alloc(16);return E=0,F[E++]=255&H.low.low,F[E++]=H.low.low>>8&255,F[E++]=H.low.low>>16&255,F[E++]=H.low.low>>24&255,F[E++]=255&H.low.high,F[E++]=H.low.high>>8&255,F[E++]=H.low.high>>16&255,F[E++]=H.low.high>>24&255,F[E++]=255&H.high.low,F[E++]=H.high.low>>8&255,F[E++]=H.high.low>>16&255,F[E++]=H.high.low>>24&255,F[E++]=255&H.high.high,F[E++]=H.high.high>>8&255,F[E++]=H.high.high>>16&255,F[E++]=H.high.high>>24&255,new t(F)},t.prototype.toString=function(){for(var t,e=0,n=new Array(36),r=0;r<n.length;r++)n[r]=0;var o,i,s,a=0,u=!1,c={parts:[0,0,0,0]},f=[];a=0;var l=this.bytes,p=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,h=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,d=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24,y=l[a++]|l[a++]<<8|l[a++]<<16|l[a++]<<24;a=0,(new q(p,h),new q(d,y)).lessThan(q.ZERO)&&f.push("-");var g=y>>26&31;if(g>>3==3){if(30===g)return f.join("")+"Infinity";if(31===g)return"NaN";t=y>>15&16383,o=8+(y>>14&1)}else o=y>>14&7,t=y>>17&16383;var v=t-6176;if(c.parts[0]=(16383&y)+((15&o)<<14),c.parts[1]=d,c.parts[2]=h,c.parts[3]=p,0===c.parts[0]&&0===c.parts[1]&&0===c.parts[2]&&0===c.parts[3])u=!0;else for(s=3;s>=0;s--){var b=0,m=rt(c);if(c=m.quotient,b=m.rem.low)for(i=8;i>=0;i--)n[9*s+i]=b%10,b=Math.floor(b/10)}if(u)e=1,n[a]=0;else for(e=36;!n[a];)e-=1,a+=1;var w=e-1+v;if(w>=34||w<=-7||v>0){if(e>34)return f.push("".concat(0)),v>0?f.push("E+".concat(v)):v<0&&f.push("E".concat(v)),f.join("");for(f.push("".concat(n[a++])),(e-=1)&&f.push("."),r=0;r<e;r++)f.push("".concat(n[a++]));f.push("E"),w>0?f.push("+".concat(w)):f.push("".concat(w))}else if(v>=0)for(r=0;r<e;r++)f.push("".concat(n[a++]));else{var E=e+v;if(E>0)for(r=0;r<E;r++)f.push("".concat(n[a++]));else f.push("0");for(f.push(".");E++<0;)f.push("0");for(r=0;r<e-Math.max(E-1,0);r++)f.push("".concat(n[a++]))}return f.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t}();Object.defineProperty(it.prototype,"_bsontype",{value:"Decimal128"});var st=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:(Number.isInteger(this.value)?(e=this.value.toFixed(1)).length>=13&&(e=this.value.toExponential(13).toUpperCase()):e=this.value.toString(),{$numberDouble:e});var e},t.fromExtendedJSON=function(e,n){var r=parseFloat(e.$numberDouble);return n&&n.relaxed?r:new t(r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},t}();Object.defineProperty(st.prototype,"_bsontype",{value:"Double"});var at=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=0|+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,n){return n&&n.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t}();Object.defineProperty(at.prototype,"_bsontype",{value:"Int32"});var ut=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t}();Object.defineProperty(ut.prototype,"_bsontype",{value:"MaxKey"});var ct=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t}();Object.defineProperty(ct.prototype,"_bsontype",{value:"MinKey"});var ft=new RegExp("^[0-9a-fA-F]{24}$"),lt=null,pt=Symbol("id"),ht=function(){function t(e){if(!(this instanceof t))return new t(e);var n;if("object"==typeof e&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new S("Argument passed in must have an id that is of type string or Buffer");n="toHexString"in e&&"function"==typeof e.toHexString?b.from(e.toHexString(),"hex"):e.id}else n=e;if(null==n||"number"==typeof n)this[pt]=t.generate("number"==typeof n?n:void 0);else if(ArrayBuffer.isView(n)&&12===n.byteLength)this[pt]=n instanceof b?n:D(n);else{if("string"!=typeof n)throw new S("Argument passed in does not match the accepted types");if(12===n.length){var r=b.from(n);if(12!==r.byteLength)throw new S("Argument passed in must be a string of 12 bytes");this[pt]=r}else{if(24!==n.length||!ft.test(n))throw new S("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[pt]=b.from(n,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[pt]},set:function(e){this[pt]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));var n=t.getInc(),r=b.alloc(12);return r.writeUInt32BE(e,0),null===lt&&(lt=I(5)),r[4]=lt[0],r[5]=lt[1],r[6]=lt[2],r[7]=lt[3],r[8]=lt[4],r[11]=255&n,r[10]=n>>8&255,r[9]=n>>16&255,r},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(null==e)return!1;if(e instanceof t)return this[pt][11]===e[pt][11]&&this[pt].equals(e[pt]);if("string"==typeof e&&t.isValid(e)&&12===e.length&&x(this.id))return e===b.prototype.toString.call(this.id,"latin1");if("string"==typeof e&&t.isValid(e)&&24===e.length)return e.toLowerCase()===this.toHexString();if("string"==typeof e&&t.isValid(e)&&12===e.length)return b.from(e).equals(this.id);if("object"==typeof e&&"toHexString"in e&&"function"==typeof e.toHexString){var n=e.toHexString(),r=this.toHexString().toLowerCase();return"string"==typeof n&&n.toLowerCase()===r}return!1},t.prototype.getTimestamp=function(){var t=new Date,e=this.id.readUInt32BE(0);return t.setTime(1e3*Math.floor(e)),t},t.createPk=function(){return new t},t.createFromTime=function(e){var n=b.from([0,0,0,0,0,0,0,0,0,0,0,0]);return n.writeUInt32BE(e,0),new t(n)},t.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new S("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(b.from(e,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(t){return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(16777215*Math.random()),t}();Object.defineProperty(ht.prototype,"generate",{value:A((function(t){return ht.generate(t)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(ht.prototype,"getInc",{value:A((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht.prototype,"get_inc",{value:A((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht,"get_inc",{value:A((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht.prototype,"_bsontype",{value:"ObjectID"});var dt=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);if(this.pattern=e,this.options=(null!=n?n:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new E("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new E("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var r=0;r<this.options.length;r++)if("i"!==this.options[r]&&"m"!==this.options[r]&&"x"!==this.options[r]&&"l"!==this.options[r]&&"s"!==this.options[r]&&"u"!==this.options[r])throw new E("The regular expression option [".concat(this.options[r],"] is not supported"))}return t.parseOptions=function(t){return t?t.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(t){return(t=t||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e){if("string"==typeof e.$regex)return new t(e.$regex,t.parseOptions(e.$options));if("BSONRegExp"===e.$regex._bsontype)return e}if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new S("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(dt.prototype,"_bsontype",{value:"BSONRegExp"});var yt=function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t}();Object.defineProperty(yt.prototype,"_bsontype",{value:"Symbol"});var gt=function(t){function e(n,r){var o=this;return o instanceof e?(o=q.isLong(n)?t.call(this,n.low,n.high,!0)||this:N(n)&&void 0!==n.t&&void 0!==n.i?t.call(this,n.i,n.t,!0)||this:t.call(this,n,r,!0)||this,Object.defineProperty(o,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),o):new e(n,r)}return w(e,t),e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(t){return new e(q.fromInt(t,!0))},e.fromNumber=function(t){return new e(q.fromNumber(t,!0))},e.fromBits=function(t,n){return new e(t,n)},e.fromString=function(t,n){return new e(q.fromString(t,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(t){return new e(t.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=q.MAX_UNSIGNED_VALUE,e}(q);var vt=2147483647,bt=-2147483648,mt=0x8000000000000000,wt=-0x8000000000000000,Et={$oid:ht,$binary:U,$uuid:U,$symbol:yt,$numberInt:at,$numberDecimal:it,$numberDouble:st,$numberLong:q,$minKey:ct,$maxKey:ut,$regex:dt,$regularExpression:dt,$timestamp:gt};function St(t,e){if(void 0===e&&(e={}),"number"==typeof t){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=bt&&t<=vt)return new at(t);if(t>=wt&&t<=mt)return q.fromNumber(t)}return new st(t)}if(null==t||"object"!=typeof t)return t;if(t.$undefined)return null;for(var n=Object.keys(t).filter((function(e){return e.startsWith("$")&&null!=t[e]})),r=0;r<n.length;r++){var o=Et[n[r]];if(o)return o.fromExtendedJSON(t,e)}if(null!=t.$date){var i=t.$date,s=new Date;return e.legacy?"number"==typeof i?s.setTime(i):"string"==typeof i&&s.setTime(Date.parse(i)):"string"==typeof i?s.setTime(Date.parse(i)):q.isLong(i)?s.setTime(i.toNumber()):"number"==typeof i&&e.relaxed&&s.setTime(i),s}if(null!=t.$code){var a=Object.assign({},t);return t.$scope&&(a.$scope=St(t.$scope)),j.fromExtendedJSON(t)}if(function(t){return N(t)&&null!=t.$id&&"string"==typeof t.$ref&&(null==t.$db||"string"==typeof t.$db)}(t)||t.$dbPointer){var u=t.$ref?t:t.$dbPointer;if(u instanceof M)return u;var c=Object.keys(u).filter((function(t){return t.startsWith("$")})),f=!0;if(c.forEach((function(t){-1===["$ref","$id","$db"].indexOf(t)&&(f=!1)})),f)return M.fromExtendedJSON(u)}return t}function _t(t){var e=t.toISOString();return 0!==t.getUTCMilliseconds()?e:e.slice(0,-5)+"Z"}function Tt(t,e){if(("object"==typeof t||"function"==typeof t)&&null!==t){var n=e.seenObjects.findIndex((function(e){return e.obj===t}));if(-1!==n){var r=e.seenObjects.map((function(t){return t.propertyName})),o=r.slice(0,n).map((function(t){return"".concat(t," -> ")})).join(""),i=r[n],s=" -> "+r.slice(n+1,r.length-1).map((function(t){return"".concat(t," -> ")})).join(""),a=r[r.length-1],u=" ".repeat(o.length+i.length/2),c="-".repeat(s.length+(i.length+a.length)/2-1);throw new S("Converting circular structure to EJSON:\n"+" ".concat(o).concat(i).concat(s).concat(a,"\n")+" ".concat(u,"\\").concat(c,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return function(t,e){return t.map((function(t,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Tt(t,e)}finally{e.seenObjects.pop()}}))}(t,e);if(void 0===t)return null;if(t instanceof Date||N(p=t)&&"[object Date]"===Object.prototype.toString.call(p)){var f=t.getTime(),l=f>-1&&f<2534023188e5;return e.legacy?e.relaxed&&l?{$date:t.getTime()}:{$date:_t(t)}:e.relaxed&&l?{$date:_t(t)}:{$date:{$numberLong:t.getTime().toString()}}}var p;if(!("number"!=typeof t||e.relaxed&&isFinite(t))){if(Math.floor(t)===t){var h=t>=wt&&t<=mt;if(t>=bt&&t<=vt)return{$numberInt:t.toString()};if(h)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(t)){var d=t.flags;if(void 0===d){var y=t.toString().match(/[gimuy]*$/);y&&(d=y[0])}return new dt(t.source,d).toExtendedJSON(e)}return null!=t&&"object"==typeof t?function(t,e){if(null==t||"object"!=typeof t)throw new E("not an object instance");var n=t._bsontype;if(void 0===n){var r={};for(var o in t){e.seenObjects.push({propertyName:o,obj:null});try{var i=Tt(t[o],e);"__proto__"===o?Object.defineProperty(r,o,{value:i,writable:!0,enumerable:!0,configurable:!0}):r[o]=i}finally{e.seenObjects.pop()}}return r}if(function(t){return N(t)&&Reflect.has(t,"_bsontype")&&"string"==typeof t._bsontype}(t)){var s=t;if("function"!=typeof s.toExtendedJSON){var a=It[t._bsontype];if(!a)throw new S("Unrecognized or invalid _bsontype: "+t._bsontype);s=a(s)}return"Code"===n&&s.scope?s=new j(s.code,Tt(s.scope,e)):"DBRef"===n&&s.oid&&(s=new M(Tt(s.collection,e),Tt(s.oid,e),Tt(s.db,e),Tt(s.fields,e))),s.toExtendedJSON(e)}throw new E("_bsontype must be a string, but was: "+typeof n)}(t,e):t}var Ot,It={Binary:function(t){return new U(t.value(),t.sub_type)},Code:function(t){return new j(t.code,t.scope)},DBRef:function(t){return new M(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new it(t.bytes)},Double:function(t){return new st(t.value)},Int32:function(t){return new at(t.value)},Long:function(t){return q.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_)},MaxKey:function(){return new ut},MinKey:function(){return new ct},ObjectID:function(t){return new ht(t)},ObjectId:function(t){return new ht(t)},BSONRegExp:function(t){return new dt(t.pattern,t.options)},Symbol:function(t){return new yt(t.value)},Timestamp:function(t){return gt.fromBits(t.low,t.high)}};!function(t){function e(t,e){var n=Object.assign({},{relaxed:!0,legacy:!1},e);return"boolean"==typeof n.relaxed&&(n.strict=!n.relaxed),"boolean"==typeof n.strict&&(n.relaxed=!n.strict),JSON.parse(t,(function(t,e){if(-1!==t.indexOf("\0"))throw new E("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(t)));return St(e,n)}))}function n(t,e,n,r){null!=n&&"object"==typeof n&&(r=n,n=0),null==e||"object"!=typeof e||Array.isArray(e)||(r=e,e=void 0,n=0);var o=Tt(t,Object.assign({relaxed:!0,legacy:!1},r,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(o,e,n)}t.parse=e,t.stringify=n,t.serialize=function(t,e){return e=e||{},JSON.parse(n(t,e))},t.deserialize=function(t,n){return n=n||{},e(JSON.stringify(t),n)}}(Ot||(Ot={}));var xt=T();xt.Map?xt.Map:function(){function t(t){void 0===t&&(t=[]),this._keys=[],this._values={};for(var e=0;e<t.length;e++)if(null!=t[e]){var n=t[e],r=n[0],o=n[1];this._keys.push(r),this._values[r]={v:o,i:this._keys.length-1}}}t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(t){var e=this._values[t];return null!=e&&(delete this._values[t],this._keys.splice(e.i,1),!0)},t.prototype.entries=function(){var t=this,e=0;return{next:function(){var n=t._keys[e++];return{value:void 0!==n?[n,t._values[n].v]:void 0,done:void 0===n}}}},t.prototype.forEach=function(t,e){e=e||this;for(var n=0;n<this._keys.length;n++){var r=this._keys[n];t.call(e,this._values[r].v,r,e)}},t.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},t.prototype.has=function(t){return null!=this._values[t]},t.prototype.keys=function(){var t=this,e=0;return{next:function(){var n=t._keys[e++];return{value:void 0!==n?n:void 0,done:void 0===n}}}},t.prototype.set=function(t,e){return this._values[t]?(this._values[t].v=e,this):(this._keys.push(t),this._values[t]={v:e,i:this._keys.length-1},this)},t.prototype.values=function(){var t=this,e=0;return{next:function(){var n=t._keys[e++];return{value:void 0!==n?t._values[n].v:void 0,done:void 0===n}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0})}(),Math.pow(2,63),Math.pow(2,63);var Nt=Math.pow(2,53),At=-Math.pow(2,53);q.fromNumber(Nt),q.fromNumber(At),new Set(["$db","$ref","$id","$clusterTime"]);var Dt=new Uint8Array(8);new DataView(Dt.buffer,Dt.byteOffset,Dt.byteLength);b.alloc(17825792);var Lt=function(){function t(t){t=t||{},this.triggerID=t.id||t.triggerID,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.variation=t.variation,this.props=t.props}return t.prototype.isExpired=function(){return this.expireAt<(new Date).getTime()},t}(),Pt=function(t,e,n,r){void 0===e&&(e={}),this.name=t,this.properties=e,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.id=r?new ht(r):new ht,this.occurred=(new Date).toISOString(),n&&(this.trigger=new Lt(n)),this.newEvent=!r},Ct=function(){function t(t){t.s&&(this.s=new Ut(t.s)),t.g&&(this.g=new $t(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const Rt=new RegExp("[^#a-f\\d]","gi"),kt=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var Bt,Ut=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||Rt.test(t)||!kt.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const r=Number.parseInt(t,16),o=r>>16,i=r>>8&255,s=255&r,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[o,i,s,a]:"css"===e.format?`rgb(${o} ${i} ${s}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:o,green:i,blue:s,alpha:a}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),jt=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new Ut(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return Bt[null!==(t=this.s)&&void 0!==t?t:Bt.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(Bt||(Bt={}));var Mt,Ht=function(t){var e;t=null!=t?t:{},this.name=t.name,this.fonts=null===(e=t.fonts)||void 0===e?void 0:e.map((function(t){return new Ft(t)}))},Ft=function(){function t(t){t=null!=t?t:{},this.style=t.style,this.url=t.url}return t.prototype.getFontDescriptor=function(){return{style:this.style===Mt.ITALICS||this.style===Mt.BOLD_ITALICS?"italic":"normal",weight:this.style===Mt.BOLD_ITALICS||this.style===Mt.BOLD?"700":"400"}},t.prototype.getURL=function(){return"url('".concat(this.url,"') format('truetype')")},t}();!function(t){t[t.REGULAR=1]="REGULAR",t[t.ITALICS=2]="ITALICS",t[t.BOLD=3]="BOLD",t[t.BOLD_ITALICS=4]="BOLD_ITALICS"}(Mt||(Mt={}));var Gt,Vt=function(){function t(t){t=null!=t?t:{},this.s=t.s,this.lh=t.lh,t.fmly&&(this.fmly=new Ht(t.fmly))}return Object.defineProperty(t.prototype,"family",{get:function(){return this.fmly},enumerable:!1,configurable:!0}),t}(),$t=function(){function t(t){this.r=t.r,t.c&&(this.c=new Ut(t.c)),t.fb&&(this.fb=new Ut(t.fb))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fallback",{get:function(){var e;return null!==(e=this.fb)&&void 0!==e?e:t.DEFAULT_FALLBACK},enumerable:!1,configurable:!0}),t.DEFAULT_FALLBACK=new Ut({h:"#000000",a:50}),t}(),zt=function(){function t(t){var e,n,r,o;t=null!=t?t:{},this.blur=null!==(e=t.blur)&&void 0!==e?e:0,this.spr=null!==(n=t.spr)&&void 0!==n?n:0,this.x=null!==(r=t.x)&&void 0!==r?r:0,this.y=null!==(o=t.y)&&void 0!==o?o:0,this.clr=new Ut(t.clr)}return t.prototype.getStyle=function(t){return"".concat(this.x*t,"px ").concat(this.y*t,"px ")+"".concat(this.blur*t,"px ").concat(this.spr*t,"px ").concat(this.clr.rgba)},t}(),qt=function(){function t(t){var e,n,r,o;t=null!=t?t:{},this.pl=null!==(e=t.pl)&&void 0!==e?e:0,this.pr=null!==(n=t.pr)&&void 0!==n?n:0,this.pt=null!==(r=t.pt)&&void 0!==r?r:0,this.pb=null!==(o=t.pb)&&void 0!==o?o:0}return t.prototype.getHorizontal=function(){return this.pl+this.pr},t.prototype.getVertical=function(){return this.pt+this.pb},t.prototype.getPaddingCSS=function(){return"".concat(this.pt,"px ").concat(this.pr,"px ").concat(this.pb,"px ").concat(this.pl,"px")},t}(),Wt=function(){function t(t){(null==t?void 0:t.rot)&&(this.rot=t.rot)}return Object.defineProperty(t.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),t}(),Jt=function(){function t(t){this.t=t.t,t.bg&&(this.bg=new Ct(t.bg)),t.br&&(this.br=new jt(t.br)),t.shd&&(this.shd=new zt(t.shd)),t.spc&&(this.spc=new qt(t.spc)),this.trf=new Wt(t.trf),this.clc=t.clc,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y,this.a=t.a}return Object.defineProperty(t.prototype,"alpha",{get:function(){var t;return null!==(t=this.a)&&void 0!==t?t:100},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return Gt[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}();!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(Gt||(Gt={}));var Yt,Kt,Xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zt=function(t){function e(e){return t.call(this,e)||this}return Xt(e,t),e}(Jt),Qt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),te=function(t){function e(e){var n=t.call(this,e)||this;return n.src=e.src,n}return Qt(e,t),e}(Jt),ee=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ne=function(t){function e(e){var n=t.call(this,e)||this;return n.alg=Yt.START,n.prs=e.prs,n.alg=e.alg,e.f&&(n.f=new Vt(e.f)),e.c&&(n.c=new Ut(e.c)),n}return ee(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(Jt);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(Yt||(Yt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(Kt||(Kt={}));var re,oe,ie,se=function(){function e(t,e){this._startTime=t,this._triggerData=e}return Object.defineProperty(e.prototype,"startTime",{get:function(){return this._startTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"triggerData",{get:function(){return this._triggerData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootClassName",{get:function(){var e=this.triggerData.id.slice(-6);return"test"===e&&(e=this.startTime.getTime().toString()),t.IN_APP_WRAPPER_NAME+"-"+e},enumerable:!1,configurable:!0}),e.prototype.onClose=function(t){this.closeCallback=t},e.prototype.closeInApp=function(t){var e={eventName:t,duration:((new Date).getTime()-this.startTime.getTime())/1e3};this.closeCallback&&this.closeCallback(e)},e}(),ae=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue=function(t){function e(e){var n,r,o,i=this;return(i=t.call(this,e)||this).o=null!==(n=e.o)&&void 0!==n?n:re.C,i.w=null!==(r=i.w)&&void 0!==r?r:1080,i.h=null!==(o=i.h)&&void 0!==o?o:1920,i}return ae(e,t),e.prototype.getOrigin=function(){return this.o},e}(Jt);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(re||(re={})),function(t){t[t.ABOVE_PAGE=1]="ABOVE_PAGE",t[t.EMBEDDED=2]="EMBEDDED"}(oe||(oe={})),function(t){t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH"}(ie||(ie={}));var ce,fe,le=function(){function t(t){t=null!=t?t:{},this.en=t.en,this.ex=t.ex}return t.prototype.getEnterAnimation=function(){switch(this.en){case ce.SLIDE_IN_TOP:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case ce.SLIDE_IN_DOWN:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case ce.SLIDE_IN_LEFT:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case ce.SLIDE_IN_RIGHT:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case ce.SLIDE_IN_TOP_LEFT:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case ce.SLIDE_IN_TOP_RIGHT:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case ce.SLIDE_IN_BOTTOM_LEFT:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case ce.SLIDE_IN_BOTTOM_RIGHT:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case ce.POP:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}},t.prototype.getExitAnimation=function(){switch(this.ex){case fe.SLIDE_OUT_TOP:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case fe.SLIDE_OUT_DOWN:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case fe.SLIDE_OUT_LEFT:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case fe.SLIDE_OUT_RIGHT:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case fe.SLIDE_OUT_TOP_LEFT:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case fe.SLIDE_OUT_TOP_RIGHT:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case fe.SLIDE_OUT_BOTTOM_LEFT:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case fe.SLIDE_OUT_BOTTOM_RIGHT:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case fe.POP:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}},t}();!function(t){t[t.NONE=1]="NONE",t[t.SLIDE_IN_TOP=2]="SLIDE_IN_TOP",t[t.SLIDE_IN_DOWN=3]="SLIDE_IN_DOWN",t[t.SLIDE_IN_LEFT=4]="SLIDE_IN_LEFT",t[t.SLIDE_IN_RIGHT=5]="SLIDE_IN_RIGHT",t[t.SLIDE_IN_TOP_LEFT=6]="SLIDE_IN_TOP_LEFT",t[t.SLIDE_IN_TOP_RIGHT=7]="SLIDE_IN_TOP_RIGHT",t[t.SLIDE_IN_BOTTOM_LEFT=8]="SLIDE_IN_BOTTOM_LEFT",t[t.SLIDE_IN_BOTTOM_RIGHT=9]="SLIDE_IN_BOTTOM_RIGHT",t[t.POP=10]="POP"}(ce||(ce={})),function(t){t[t.NONE=1]="NONE",t[t.SLIDE_OUT_TOP=2]="SLIDE_OUT_TOP",t[t.SLIDE_OUT_DOWN=3]="SLIDE_OUT_DOWN",t[t.SLIDE_OUT_LEFT=4]="SLIDE_OUT_LEFT",t[t.SLIDE_OUT_RIGHT=5]="SLIDE_OUT_RIGHT",t[t.SLIDE_OUT_TOP_LEFT=6]="SLIDE_OUT_TOP_LEFT",t[t.SLIDE_OUT_TOP_RIGHT=7]="SLIDE_OUT_TOP_RIGHT",t[t.SLIDE_OUT_BOTTOM_LEFT=8]="SLIDE_OUT_BOTTOM_LEFT",t[t.SLIDE_OUT_BOTTOM_RIGHT=9]="SLIDE_OUT_BOTTOM_RIGHT",t[t.POP=10]="POP"}(fe||(fe={}));var pe,he=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),de=function(e){function n(n){var r,o,i,s=this;return n=null!=n?n:{},(s=e.call(this,n)||this).gvt=null!==(r=n.gvt)&&void 0!==r?r:pe.C,s.max=n.max,s.cover=null===(o=n.cover)||void 0===o||o,s.anim=new le(n.anim),s.embedded=n.embedded,s.position=null!==(i=n.position)&&void 0!==i?i:oe.ABOVE_PAGE,s.spc||(s.spc=new qt({pl:t.IN_APP_DEFAULT_PADDING,pr:t.IN_APP_DEFAULT_PADDING,pt:t.IN_APP_DEFAULT_PADDING,pb:t.IN_APP_DEFAULT_PADDING})),s}return he(n,e),n.prototype.isEmbedded=function(){return this.position===oe.EMBEDDED&&!!this.embedded},n.prototype.getEmbeddedSelector=function(){return".letscooee-engagement.container-".concat(this.embedded)},n}(Jt),ye=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ge=function(t){function e(e){var n=this;return e=null!=e?e:{},(n=t.call(this,e)||this).elems=[],n.cont=new ue(e.cont),n.mob=new de(e.mob),n.bg||(n.bg=n.cont.bg,delete n.cont.bg),e.elems.forEach((function(t){t.t===Gt.IMAGE?n.elems.push(new te(t)):t.t===Gt.TEXT||t.t===Gt.BUTTON?n.elems.push(new ne(t)):t.t===Gt.SHAPE&&n.elems.push(new Zt(t))})),n}return ye(e,t),e.prototype.getStylesForWrapper=function(){return this.cover?{}:((t=this.gvt===pe.NW?{top:0,left:0}:this.gvt===pe.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===pe.NE?{top:0,right:0}:this.gvt===pe.E?{top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===pe.SE?{bottom:0,right:0}:this.gvt===pe.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===pe.SW?{bottom:0,left:0}:this.gvt===pe.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).overflow="visible",t);var t},e.prototype.getFlexStylesForContainer=function(){var t,e,n={display:"flex",flexDirection:"row"};return this.gvt===pe.NW?(t="flex-start",e="flex-start"):this.gvt===pe.N?(t="center",e="flex-start"):this.gvt===pe.NE?(t="flex-end",e="flex-start"):this.gvt===pe.W?(t="flex-start",e="center"):this.gvt===pe.E?(t="flex-end",e="center"):this.gvt===pe.SW?(t="flex-start",e="flex-end"):this.gvt===pe.S?(t="center",e="flex-end"):this.gvt===pe.SE?(t="flex-end",e="flex-end"):(t="center",e="center"),n.alignItems=e,n.justifyContent=t,n.overflow="visible",n},e.prototype.overrideForMobileView=function(){var t,e,n,r,o,i,s,a;this.max=null!==(t=this.mob.max)&&void 0!==t?t:this.max,this.cover=null!==(e=this.mob.cover)&&void 0!==e?e:this.cover,this.gvt=null!==(n=this.mob.gvt)&&void 0!==n?n:this.gvt,this.bg=null!==(r=this.mob.bg)&&void 0!==r?r:this.bg,this.spc=null!==(o=this.mob.spc)&&void 0!==o?o:this.spc,this.anim=null!==(i=this.mob.anim)&&void 0!==i?i:this.anim,this.position=null!==(s=this.mob.position)&&void 0!==s?s:this.position,this.embedded=null!==(a=this.mob.embedded)&&void 0!==a?a:this.embedded},e}(de);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(pe||(pe={}));var ve=function(){function t(t){var e,n;this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.variation=t.variation,this.ian=t.ian?new ge(t.ian):void 0,this.previewType=t.previewType,this.delay=null!==(e=t.delay)&&void 0!==e?e:0,this.occurred=null!==(n=t.occurred)&&void 0!==n?n:(new Date).toISOString(),this.props=t.props}return t.prototype.shouldDelay=function(){return this.delay>0},t.prototype.getDelaySeconds=function(){var t=new Date(this.occurred),e=(new Date).getTime()-t.getTime();return 1e3*this.delay-e},t}(),be=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},me=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},we=function(){function t(){this.loadedFonts=[]}return t.prototype.loadAllFonts=function(t){var e;return be(this,void 0,void 0,(function(){var n=this;return me(this,(function(r){return null===(e=t.elems)||void 0===e||e.forEach((function(t){t instanceof ne&&n.loadFamily(t.font.family)})),[2]}))}))},t.prototype.loadFamily=function(t){return be(this,void 0,void 0,(function(){var e;return me(this,(function(n){switch(n.label){case 0:return(null==t?void 0:t.fonts)?this.loadedFonts.indexOf(t.name)>-1?[2]:(e=[],t.fonts.forEach((function(n){if(n.url){var r=new FontFace(t.name,n.getURL(),n.getFontDescriptor());e.push(r.load())}})),this.loadedFonts.push(t.name),[4,Promise.all(e)]):[2];case 1:return n.sent().forEach((function(t){document.fonts.add(t)})),[2]}}))}))},t}(),Ee=function(t,e){return Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ee(t,e)};function Se(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ee(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function _e(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Te(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function Oe(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function Ie(t){return"function"==typeof t}function xe(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var Ne=xe((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Ae(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var De=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var s=_e(i),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else i.remove(this);var u=this.initialTeardown;if(Ie(u))try{u()}catch(t){o=t instanceof Ne?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var f=_e(c),l=f.next();!l.done;l=f.next()){var p=l.value;try{Ce(p)}catch(t){o=null!=o?o:[],t instanceof Ne?o=Oe(Oe([],Te(o)),Te(t.errors)):o.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(o)throw new Ne(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Ce(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Ae(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Ae(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Le=De.EMPTY;function Pe(t){return t instanceof De||t&&"closed"in t&&Ie(t.remove)&&Ie(t.add)&&Ie(t.unsubscribe)}function Ce(t){Ie(t)?t():t.unsubscribe()}var Re=null,ke=null,Be=void 0,Ue=!1,je=!1,Me={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=Me.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,Oe([t,e],Te(n))):setTimeout.apply(void 0,Oe([t,e],Te(n)))},clearTimeout:function(t){var e=Me.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function He(){}var Fe=Ge("C",void 0,void 0);function Ge(t,e,n){return{kind:t,value:e,error:n}}var Ve=null;function $e(t){if(Ue){var e=!Ve;if(e&&(Ve={errorThrown:!1,error:null}),t(),e){var n=Ve,r=n.errorThrown,o=n.error;if(Ve=null,r)throw o}}else t()}var ze=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Pe(e)&&e.add(n)):n.destination=Ze,n}return Se(e,t),e.create=function(t,e,n){return new Ye(t,e,n)},e.prototype.next=function(t){this.isStopped?Xe(function(t){return Ge("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Xe(Ge("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Xe(Fe,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(De),qe=Function.prototype.bind;function We(t,e){return qe.call(t,e)}var Je=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ke(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ke(t)}else Ke(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ke(t)}},t}(),Ye=function(t){function e(e,n,r){var o,i,s=t.call(this)||this;return Ie(e)||!e?o={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&je?((i=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},o={next:e.next&&We(e.next,i),error:e.error&&We(e.error,i),complete:e.complete&&We(e.complete,i)}):o=e,s.destination=new Je(o),s}return Se(e,t),e}(ze);function Ke(t){var e;Ue?(e=t,Ue&&Ve&&(Ve.errorThrown=!0,Ve.error=e)):function(t){Me.setTimeout((function(){if(!Re)throw t;Re(t)}))}(t)}function Xe(t,e){var n=ke;n&&Me.setTimeout((function(){return n(t,e)}))}var Ze={closed:!0,next:He,error:function(t){throw t},complete:He},Qe="function"==typeof Symbol&&Symbol.observable||"@@observable";function tn(t){return t}function en(t){return 0===t.length?tn:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var nn=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,o=this,i=(r=t)&&r instanceof ze||function(t){return t&&Ie(t.next)&&Ie(t.error)&&Ie(t.complete)}(r)&&Pe(r)?t:new Ye(t,e,n);return $e((function(){var t=o,e=t.operator,n=t.source;i.add(e?e.call(i,n):n?o._subscribe(i):o._trySubscribe(i))})),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=rn(e))((function(e,r){var o=new Ye({next:function(e){try{t(e)}catch(t){r(t),o.unsubscribe()}},error:r,complete:e});n.subscribe(o)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Qe]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return en(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=rn(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function rn(t){var e;return null!==(e=null!=t?t:Be)&&void 0!==e?e:Promise}var on=xe((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),sn=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Se(e,t),e.prototype.lift=function(t){var e=new an(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new on},e.prototype.next=function(t){var e=this;$e((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var o=_e(e.currentObservers),i=o.next();!i.done;i=o.next())i.value.next(t)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;$e((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;$e((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?Le:(this.currentObservers=null,i.push(t),new De((function(){e.currentObservers=null,Ae(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,o=e.isStopped;n?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new nn;return t.source=this,t},e.create=function(t,e){return new an(t,e)},e}(nn),an=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Se(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Le},e}(sn),un={now:function(){return(un.delegate||Date).now()},delegate:void 0},cn=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=un);var o=t.call(this)||this;return o._bufferSize=e,o._windowTime=n,o._timestampProvider=r,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,n),o}return Se(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,o=n._buffer,i=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(o.push(e),!i&&o.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),o=0;o<r.length&&!t.closed;o+=n?1:2)t.next(r[o]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,o=t._infiniteTimeWindow,i=(o?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!o){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}},e}(sn),fn=n(238),ln=n.n(fn),pn=function(){function t(){this.scalingFactor=1,this.doc=document,this.parser=new(ln())}return t.get=function(){return t._instance||(t._instance=new t),t._instance},t.prototype.getUAParser=function(){return this.parser},t.prototype.getWidth=function(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth},t.prototype.getHeight=function(){return this.isParentNotBody()?this.parentContainer.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight},t.prototype.isMobile=function(){return"mobile"===this.parser.getDevice().type},t.prototype.calculateScalingFactor=function(e){var n=e.max,r=e.cont.w,o=e.cont.h,i=e.spc,s=t.get().getWidth(),a=t.get().getHeight();n&&(s=s?Math.min(s,n):n,a=a?Math.min(a,n):n),a&&(s-=i.getHorizontal(),a-=i.getVertical(),this.scalingFactor=s/a<r/o?s/r:a/o,this.scalingFactor=Math.min(this.scalingFactor,1))},t.prototype.getScalingFactor=function(){return this.scalingFactor},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,n){e&&(n?t.style.setProperty(e,n,"important"):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},t.prototype.removeInApp=function(t){var e=document.querySelector(".".concat(t.rootClassName));e&&e.parentElement.removeChild(e)},t.prototype.setParentContainer=function(t){this.parentContainer=t,this.parentContainer&&this.isParentNotBody()&&this.setStyle(this.parentContainer,"position","relative")},t.prototype.isParentNotBody=function(){return this.parentContainer!==document.body},t.DOCUMENT_STANDARD_MODE="CSS1Compat",t}(),hn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},dn=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yn=function(){function t(){this.result={},this.parser=pn.get().getUAParser()}return t.prototype.get=function(){return hn(this,void 0,void 0,(function(){var t;return dn(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,n=t.offsetWidth*e;return document.body.removeChild(t),n},t.prototype.getLocation=function(){return hn(this,void 0,void 0,(function(){var t=this;return dn(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(n){t.result.coords=[n.coords.latitude,n.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return hn(this,void 0,void 0,(function(){var t;return dn(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),gn=n(145),vn=n(901),bn=n.n(vn),mn=function(){function e(){}return e.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().info.apply(bn(),t)},e.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().debug.apply(bn(),t)},e.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().error.apply(bn(),t)},e.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().warn.apply(bn(),t)},e.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().info.apply(bn(),t)},e.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bn().trace.apply(bn(),t)},e.configure=function(e){void 0===e&&(e=t.LOG_PREFIX),bn().useDefaults({formatter:function(n){n.unshift("".concat(e," (v").concat(t.SDK_VERSION,"):"))}}),localStorage.cooeeLogLevel?bn().setLevel(bn()[localStorage.cooeeLogLevel]):bn().setLevel(bn().OFF)},e}(),wn=n(483),En=n.n(wn);function Sn(t){return En().createInstance({name:"letscooee",storeName:t})}var _n,Tn,On=function(){function t(){}return t.get=function(t,e){var n,r,o,i,s;return r=this,o=void 0,s=function(){var r;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(o){switch(o.label){case 0:return[4,null===(n=this.storage)||void 0===n?void 0:n.getItem(t)];case 1:return[2,null!=(r=o.sent())?r:e]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{u(s.next(t))}catch(t){e(t)}}function a(t){try{u(s.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,a)}u((s=s.apply(r,o||[])).next())}))},t.set=function(t,e){var n;return null===(n=this.storage)||void 0===n?void 0:n.setItem(t,e)},t.remove=function(t){var e;null===(e=this.storage)||void 0===e||e.removeItem(t)},t.clear=function(){var t;return null===(t=this.storage)||void 0===t?void 0:t.clear()},t.getForage=function(){return this.storage},t}(),In=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return In(e,t),n=e,e.storeName="user",n.storage=Sn(n.storeName),e}(On),Nn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),An=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return Nn(e,t),n=e,e.storeName="app",n.storage=Sn(n.storeName),e}(On),Dn=function(){function t(){}return t.OLD_APP_ID="cooaid",t.OLD_USER_ID="uid",t.OLD_DEVICE_ID="coodid",t.OLD_SDK_TOKEN="st",t.DEVICE_UUID="uuid",t.OLD_SESSION_ID="sid",t.OLD_SESSION_NUMBER="sn",t.OLD_SESSION_START_TIME="sst",t.OLD_FIRST_TIME_LAUNCH="ifl",t.OLD_LAST_ACTIVE="la",t.OLD_ACTIVE_TRIGGER="at",t.OLD_SHOPIFY_CART_TOKEN="coosct",t.SESSION_ID="id",t.DEVICE_ID="did",t.USER_ID="id",t.APP_ID="id",t.SHOPIFY_CART_TOKEN="cartToken",t.SESSION_LAST_USED_TIME="lastUsedTime",t.LAST_ACTIVE="lastActive",t.ACTIVE_TRIGGER="activeTrigger",t.SDK_TOKEN="token",t.FIRST_TIME_LAUNCH="isFirstLaunch",t.FIRST_SEEN="firstSeen",t.SESSION_NUMBER="sessionNumber",t.GA_ENABLED="gae",t.GA_CLIENT_ID="gacid",t.GA_MEASUREMENT_ID="gamid",t}(),Ln=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Pn=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Cn=function(){function t(){}return t.processConfiguration=function(t){this.saveConfiguration(t).then((function(){mn.log("Google Analytics configuration processed")})).catch((function(t){mn.error(t)}))},t.saveConfiguration=function(t){return Ln(this,void 0,void 0,(function(){var e;return Pn(this,(function(n){switch(n.label){case 0:return t.gaMeasurementID&&t.gaEnabled?[4,An.get(Dn.GA_MEASUREMENT_ID,"")]:[2];case 1:return e=n.sent(),[4,An.get(Dn.GA_ENABLED,!1)];case 2:return n.sent()===t.gaEnabled&&e===t.gaMeasurementID?[3,6]:[4,xn.remove(Dn.GA_CLIENT_ID)];case 3:return n.sent(),[4,An.set(Dn.GA_MEASUREMENT_ID,t.gaMeasurementID)];case 4:return n.sent(),[4,An.set(Dn.GA_ENABLED,t.gaEnabled)];case 5:n.sent(),n.label=6;case 6:return[4,this.sendClientID()];case 7:return n.sent(),[2]}}))}))},t.sendClientID=function(){return Ln(this,void 0,void 0,(function(){var t;return Pn(this,(function(e){switch(e.label){case 0:return[4,An.get(Dn.GA_ENABLED,!1)];case 1:return e.sent()?[4,this.getClientID()]:[2];case 2:return(t=e.sent())?(gr.getInstance().updateDeviceProps({gaClientID:t}),[2]):[2]}}))}))},t.getClientID=function(){return Ln(this,void 0,void 0,(function(){var t,e;return Pn(this,(function(n){switch(n.label){case 0:return[4,xn.get(Dn.GA_CLIENT_ID)];case 1:return t=n.sent(),[4,this.getClientIDViaGTag()];case 2:return e=n.sent(),t===e?[2]:[4,xn.set(Dn.GA_CLIENT_ID,e)];case 3:return n.sent(),[2,e]}}))}))},t.getClientIDViaGTag=function(){return Ln(this,void 0,void 0,(function(){var t;return Pn(this,(function(e){switch(e.label){case 0:return[4,An.get(Dn.GA_MEASUREMENT_ID,"")];case 1:return t=e.sent(),[4,An.get(Dn.GA_ENABLED,"")];case 2:return e.sent()&&t&&window.gtag?[2,new Promise((function(e){window.gtag("get",t,"client_id",(function(t){e(t)}))}))]:[2]}}))}))},t}(),Rn=function(e,n,r,o){this.appID=e,this.shopifyShop=n,this.uuid=r,this.props=o,this.sdk=t.SDK},kn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return kn(e,t),n=e,e.storeName="global",n.storage=Sn(n.storeName),e}(On),Un=function(){function t(){}return t.trackDeviceID=function(t){this.isInstalled()},t.trackIntent=function(t){var e;if(this.isInstalled()){var n=null===(e=ie[t])||void 0===e?void 0:e.toLowerCase();n&&(mn.debug("Sending ".concat(n," intent to MS Clarity")),window.clarity("set","Cooee Intent",n))}},t.isInstalled=function(){return window.clarity&&"function"==typeof window.clarity},t}(),jn=function(){function t(){}return t.watch=function(){var t=this.getDebugParam();"1"!==t&&"on"!==t||(localStorage.cooeeLogLevel="TRACE"),"on"===t?sessionStorage.cooeeDebug="1":"off"===t&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&(this.isOn=!0,this.renderDebugBar())},t.prepend=function(t){if(this.isOn){var e=document.createElement("div");e.innerHTML="• "+(new Date).toLocaleString()+" - "+t,this.element.prepend(e)}},t.renderDebugBar=function(){this.element=document.createElement("div"),this.element.id="cooee-debugger",this.element.setAttribute("draggable","true"),document.body.appendChild(this.element)},t.getDebugParam=function(){var t;return null===(t=new URL(location.href).searchParams)||void 0===t?void 0:t.get("cooee-debug")},t.dragElement=function(){var t=this,e=0,n=0,r=0,o=0,i=function(i){(i=i||window.event).preventDefault(),e=r-i.clientX,n=o-i.clientY,r=i.clientX,o=i.clientY,t.element.style.top=t.element.offsetTop-n+"px",t.element.style.left=t.element.offsetLeft-e+"px"},s=function(){document.onmouseup=null,document.onmousemove=null};this.element.onmousedown=function(t){(t=t||window.event).preventDefault(),r=t.clientX,o=t.clientY,document.onmouseup=s,document.onmousemove=i}},t.isOn=!1,t}(),Mn=n(716),Hn=function(){function t(){}return t.addReferralData=function(t){Object.assign(t,this.getUTMParams()),t.referrer=this.getReferrer()},t.getReferrer=function(){if(document.referrer&&"".concat(location.origin,"/")!==document.referrer)return document.referrer.replace(location.origin,"")},t.getUTMParams=function(){var t;try{t=new Mn.U(location.href)}catch(t){return{}}var e={};return this.UTM_PARAMS.forEach((function(n){var r=t.getQueryParam(n);r&&(e[n]=r)})),e},t.UTM_PARAMS=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],t}(),Fn=n(139),Gn=n.n(Fn),Vn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return Vn(e,t),e.getActiveTrigger=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return[4,this.get(Dn.ACTIVE_TRIGGER)];case 1:return t=e.sent(),[2,new Lt(t)]}}))},new((n=void 0)||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}));var t,e,n,r},n=e,e.storeName="session",n.storage=Sn(n.storeName),e}(On),zn=function(){function t(){this.isLocked=!1,this.queue=[]}return t.prototype.acquire=function(){return t=this,e=void 0,r=function(){var t=this;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(e){switch(e.label){case 0:return this.isLocked?[3,1]:(this.isLocked=!0,[2]);case 1:return[4,new Promise((function(e){return t.queue.push(e)}))];case 2:e.sent(),e.label=3;case 3:return[2]}}))},new((n=void 0)||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}));var t,e,n,r},t.prototype.release=function(){if(this.queue.length>0){var t=this.queue.shift();t&&t()}else this.isLocked=!1},t}(),qn=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Wn=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Jn=function(){function e(){this.lock=new zn}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.getCurrentSessionID=function(){return $n.set(Dn.SESSION_LAST_USED_TIME,(new Date).getTime()),$n.get(Dn.SESSION_ID,"")},e.prototype.checkForNewSession=function(){return qn(this,void 0,void 0,(function(){return Wn(this,(function(t){switch(t.label){case 0:return[4,this.lock.acquire()];case 1:return t.sent(),[4,this.isNewSessionRequired()];case 2:return t.sent()?[4,this.startNewSession()]:[3,4];case 3:return t.sent(),[3,6];case 4:return[4,this.initializeSessionFromStorage()];case 5:t.sent(),t.label=6;case 6:return this.lock.release(),[2]}}))}))},e.prototype.startNewSession=function(){return qn(this,void 0,void 0,(function(){var e,n;return Wn(this,(function(r){switch(r.label){case 0:return[4,$n.clear()];case 1:return r.sent(),e=new Date,n=(new ht).toHexString(),jn.prepend("New Session ID: <strong>".concat(n,"</strong>")),[4,$n.set(Dn.SESSION_LAST_USED_TIME,e.getTime())];case 2:return r.sent(),[4,$n.set(Dn.SESSION_ID,n)];case 3:return r.sent(),[4,this.bumpSessionNumber()];case 4:return r.sent(),gr.getInstance().sendEvent(new Pt(t.EVENT_SESSION_STARTED)),[2]}}))}))},e.prototype.bumpSessionNumber=function(){return qn(this,void 0,void 0,(function(){var t;return Wn(this,(function(e){switch(e.label){case 0:return[4,xn.get(Dn.SESSION_NUMBER)];case 1:return t=e.sent()||0,t+=1,[4,xn.set(Dn.SESSION_NUMBER,t)];case 2:return e.sent(),[2]}}))}))},e.prototype.getCurrentSessionNumber=function(){return xn.get(Dn.SESSION_NUMBER,1)},e.prototype.isNewSessionRequired=function(){return qn(this,void 0,void 0,(function(){var e,n;return Wn(this,(function(r){switch(r.label){case 0:return[4,$n.get(Dn.SESSION_ID)];case 1:return r.sent()?[4,$n.get("startTime",0)]:[2,!0];case 2:return e=r.sent(),[4,$n.get(Dn.SESSION_LAST_USED_TIME,null!=e?e:0)];case 3:return(n=r.sent())?[2,((new Date).getTime()-n)/1e3>t.IDLE_TIME_IN_SECONDS]:[2,!0]}}))}))},e.prototype.initializeSessionFromStorage=function(){return qn(this,void 0,void 0,(function(){var t;return Wn(this,(function(e){switch(e.label){case 0:return[4,$n.get(Dn.SESSION_ID,"")];case 1:return t=e.sent(),jn.prepend("Session ID: <strong>".concat(t,"</strong>")),[2]}}))}))},e}(),Yn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return Yn(e,t),n=e,e.storeName="shopify",n.storage=Sn(n.storeName),e}(On),Xn=function(){function t(){this.inInactive=!1,this.lastEnterActive=new Date,this.lastEnterInactive=null}return t.getInstance=function(){return this.INSTANCE},t.prototype.isInactive=function(){return this.inInactive},t.prototype.setInactive=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(t){switch(t.label){case 0:return this.inInactive?[2,0]:(this.inInactive=!0,this.lastEnterInactive=new Date,[4,$n.set(Dn.LAST_ACTIVE,this.lastEnterInactive.getTime())]);case 1:return t.sent(),[2,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0)]}}))},new((n=void 0)||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}));var t,e,n,r},t.prototype.setActive=function(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0},t.prototype.isFirstActive=function(){return null==this.lastEnterInactive},t.prototype.setScreen=function(t){this.screen=t},t.prototype.getScreen=function(){return this.screen},t.INSTANCE=new t,t}(),Zn=function(){function t(){}return t.isShopify=function(){return!!window.Shopify},t.getShopName=function(){var t,e;if(this.isShopify())return null===(e=null===(t=window.Shopify.shop)||void 0===t?void 0:t.split("."))||void 0===e?void 0:e[0]},t.getScreenName=function(){if(this.isShopify()){var t=new URL(window.location.href).pathname.slice(1).split("/")[0];return""===t?"home":"collections"===t?"collection":"products"===t?"product":"cart"===t?"cart":void 0}},t}(),Qn=function(){return Qn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qn.apply(this,arguments)},tr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},er=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},nr=Gn()(fetch),rr={retryDelay:t.API_CALL_RETRY_DELAY,retryOn:function(e,n,r){return!(e>=t.API_CALL_MAX_ATTEMPTS||!(null!==n||(null==r?void 0:r.status)&&(null==r?void 0:r.status)>=500))}},or=function(){function e(){this.apiToken="",this.uuid="",this.firstSeen=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.registerDevice=function(t){return tr(this,void 0,void 0,(function(){return er(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",this.getDefaultHeaders(),t)]}))}))},e.prototype.sendEvent=function(e){return tr(this,void 0,void 0,(function(){var n,r,o,i=this;return er(this,(function(s){switch(s.label){case 0:return e.name===t.EVENT_SCREEN_VIEW&&t.blackListedScreenName.includes(e.screenName)?[2]:(jn.prepend("Sending event <strong>".concat(e.name.replace("CE ",""),"</strong> with id ").concat(e.id)),n=this.getDefaultHeaders(),[4,$n.getActiveTrigger()]);case 1:return r=s.sent(),!e.trigger&&r&&(e.trigger=r,"test"===r.triggerID)?[2]:(e.name!==t.EVENT_APP_BACKGROUND&&Xn.getInstance().setActive(),Zn.isShopify()?(o=e,[4,fetch("/cart.js?from=cws")]):[3,4]);case 2:return[4,s.sent().json()];case 3:o.cart=s.sent(),s.label=4;case 4:return this.doHTTP("POST","/v1/event/track",n,e).then((function(t){return tr(i,void 0,void 0,(function(){var n;return er(this,(function(r){switch(r.label){case 0:return mn.log("Sent",e.name),t.triggerData&&(t.triggerData.occurred=e.occurred,(new jr).render(t.triggerData).catch((function(t){mn.error(t.message)}))),[4,this.updateUserIDAndToken(t)];case 1:return r.sent(),n="Event <strong>".concat(t.eventName,"</strong> tracked"),t.intent&&(n+=" and <strong>".concat(ie[t.intent],"</strong> intent calculated"),Un.trackIntent(t.intent)),jn.prepend(n),[2]}}))}))})).catch((function(t){mn.error("Error sending event",t)})),[2]}}))}))},e.prototype.updateUserData=function(t){var e=this,n=this.getDefaultHeaders();this.doHTTP("PUT","/v1/user/update",n,t).then((function(t){return tr(e,void 0,void 0,(function(){return er(this,(function(e){switch(e.label){case 0:return mn.log("Updated user profile"),[4,this.updateUserIDAndToken(t)];case 1:return e.sent(),[2]}}))}))})).catch((function(t){mn.error("Error saving user profile",t)}))},e.prototype.trackOrder=function(t){var e=this.getDefaultHeaders();this.doHTTP("POST","/v1/event/track-order",e,t).then((function(){mn.log("Sent Order")})).catch((function(t){mn.error("Error saving user profile",t)}))},e.prototype.updateUserIDAndToken=function(t){return tr(this,void 0,void 0,(function(){return er(this,(function(e){switch(e.label){case 0:return t&&Object.keys(t).length?t.userID?[4,xn.set(Dn.USER_ID,t.userID)]:[3,2]:[2];case 1:e.sent(),e.label=2;case 2:return t.deviceID?[4,xn.set(Dn.DEVICE_ID,t.deviceID)]:[3,4];case 3:e.sent(),e.label=4;case 4:return t.sdkToken?(this.setAPIToken(t.sdkToken),[4,xn.set(Dn.SDK_TOKEN,t.sdkToken)]):[3,6];case 5:e.sent(),e.label=6;case 6:return[2]}}))}))},e.prototype.updateDeviceProps=function(t){var e=this,n=this.getDefaultHeaders();this.doHTTP("PUT","/v1/device/update",n,t).then((function(){mn.log("Updated device property")})).catch((function(n){return tr(e,void 0,void 0,(function(){var e;return er(this,(function(r){switch(r.label){case 0:return mn.error("Error saving device property",n),(null===(e=null==t?void 0:t.cart)||void 0===e?void 0:e.token)?[4,Kn.remove(Dn.SHOPIFY_CART_TOKEN)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))}))},e.prototype.logout=function(){var t=this,e=this.getDefaultHeaders();this.doHTTP("GET","/v1/user/logout",e).then((function(e){return tr(t,void 0,void 0,(function(){return er(this,(function(t){switch(t.label){case 0:return mn.log("User logged out"),[4,this.updateUserIDAndToken(e)];case 1:return t.sent(),Jn.getInstance().startNewSession(),[2]}}))}))})).catch((function(t){mn.error(t)}))},e.prototype.getAppConfigurations=function(){return tr(this,void 0,void 0,(function(){var t,e;return er(this,(function(n){switch(n.label){case 0:return t=this.getDefaultHeaders(),[4,An.get(Dn.APP_ID)];case 1:return e=n.sent(),this.doHTTP("GET","/v1/app/configuration/".concat(e),t).then((function(t){mn.log("Received app configuration"),Cn.processConfiguration(t)})).catch((function(t){mn.error(t)})),[2]}}))}))},e.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},e.prototype.setUUID=function(t){this.uuid=null!=t?t:""},e.prototype.setFirstSeen=function(t){var e;this.firstSeen=null!==(e=null==t?void 0:t.toUTCString())&&void 0!==e?e:""},e.prototype.doHTTP=function(t,e,n,r){return tr(this,void 0,void 0,(function(){var o,i,s;return er(this,(function(a){switch(a.label){case 0:return e.startsWith("http")||(e="https://api.sdk.letscooee.com"+e),o="keepalive"in new Request(""),r&&!o&&JSON.stringify(r).includes("CE App Background")?[2,this.performXMLHttpRequest(e,n,r)]:(i={method:t,headers:n,keepalive:!0},r&&(i.body=JSON.stringify(r)),[4,nr(e,Qn(Qn({},rr),i))]);case 1:if(!(s=a.sent()).ok)throw s;return[2,s.json()]}}))}))},e.prototype.performXMLHttpRequest=function(t,e,n){var r=new XMLHttpRequest;return r.open("POST",t,!1),e.forEach((function(t,e){r.setRequestHeader(e,t)})),r.send(JSON.stringify(n)),r.response.json()},e.prototype.getDefaultHeaders=function(){var e=new Headers;return e.set("content-type","application/json"),e.set("cooee-sdk",t.SDK),e.set("cooee-sdk-code",t.SDK_VERSION_CODE.toString()),e.set("cooee-sdk-version",t.SDK_VERSION),e.set("cooee-uuid",this.uuid),e.set("cooee-first-seen",this.firstSeen),e.set("sdk-version",t.SDK_VERSION),e.set("sdk-version-code",t.SDK_VERSION_CODE.toString()),this.apiToken&&(e.append("x-sdk-token",this.apiToken),e.append("cooee-sdk-token",this.apiToken)),e},e.INSTANCE=new e,e}(),ir=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},sr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ar=function(){function t(){this.apiService=or.getInstance(),this.sdkToken="",this.userID="",this.deviceID="",this.uuid="",this.appID="",this.shopifyShop=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.init=function(t){return this.appID=t.appID,this.shopifyShop=t.shopifyShop,this.acquireSDKToken()},t.prototype.hasToken=function(){return ir(this,void 0,void 0,(function(){return sr(this,(function(t){switch(t.label){case 0:return[4,xn.get(Dn.SDK_TOKEN)];case 1:return[2,!!t.sent()]}}))}))},t.prototype.getUserID=function(){return this.userID},t.prototype.getDeviceID=function(){return this.deviceID},t.prototype.acquireSDKToken=function(){return ir(this,void 0,void 0,(function(){var t;return sr(this,(function(e){switch(e.label){case 0:return t=this,[4,this.getOrCreateUUID()];case 1:return t.uuid=e.sent(),this.apiService.setUUID(this.uuid),[4,this.populateFirstSeen()];case 2:return e.sent(),[4,this.hasToken()];case 3:return e.sent()?[2,this.populateUserDataFromStorage()]:(mn.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}}))}))},t.prototype.saveUserDataInStorage=function(t){return ir(this,void 0,void 0,(function(){return sr(this,(function(e){switch(e.label){case 0:return this.sdkToken=t.sdkToken,this.userID=t.userID,this.deviceID=t.deviceID,this.updateAPIClient(),[4,xn.set(Dn.SDK_TOKEN,this.sdkToken)];case 1:return e.sent(),[4,xn.set(Dn.USER_ID,this.userID)];case 2:return e.sent(),[4,xn.set(Dn.DEVICE_ID,this.deviceID)];case 3:return e.sent(),t.appID?[4,An.set(Dn.APP_ID,t.appID)]:[3,5];case 4:e.sent(),e.label=5;case 5:return[2]}}))}))},t.prototype.populateUserDataFromStorage=function(){return ir(this,void 0,void 0,(function(){var t,e,n;return sr(this,(function(r){switch(r.label){case 0:return t=this,[4,xn.get(Dn.SDK_TOKEN)];case 1:return t.sdkToken=r.sent(),this.sdkToken||mn.warn("No SDK token found in local storage"),e=this,[4,xn.get(Dn.USER_ID)];case 2:return e.userID=r.sent(),this.userID||mn.warn("No user ID found in local storage"),n=this,[4,xn.get(Dn.DEVICE_ID)];case 3:return n.deviceID=r.sent(),this.deviceID||mn.warn("No device ID found in local storage"),this.updateAPIClient(),[2]}}))}))},t.prototype.updateAPIClient=function(){mn.log("SDK Token:",this.sdkToken),mn.log("Device ID:",this.deviceID),mn.log("User ID:",this.userID),Un.trackDeviceID(this.deviceID),jn.prepend("Device ID: <strong>".concat(this.deviceID,"</strong>")),this.apiService.setAPIToken(this.sdkToken)},t.prototype.getSDKTokenFromServer=function(){return ir(this,void 0,void 0,(function(){var t,e,n,r;return sr(this,(function(o){switch(o.label){case 0:return[4,this.getDeviceAuthRequest()];case 1:t=o.sent(),e=this.apiService.registerDevice(t),o.label=2;case 2:return o.trys.push([2,5,,6]),[4,e];case 3:return n=o.sent(),mn.log("Register Device Response",n),[4,this.saveUserDataInStorage(n)];case 4:return o.sent(),Cn.processConfiguration(n),[3,6];case 5:throw r=o.sent(),mn.error(r),r;case 6:return[2]}}))}))},t.prototype.getDeviceAuthRequest=function(){return ir(this,void 0,void 0,(function(){var t,e;return sr(this,(function(n){switch(n.label){case 0:return[4,(new yn).get()];case 1:t=n.sent(),Hn.addReferralData(t),t.host=location.origin,n.label=2;case 2:return n.trys.push([2,4,,5]),[4,(0,gn.r)()];case 3:return(null==(e=n.sent())?void 0:e.isPrivate)&&(t.private=!0),[3,5];case 4:return n.sent(),[3,5];case 5:return[2,new Rn(this.appID,this.shopifyShop,this.uuid,t)]}}))}))},t.prototype.getOrCreateUUID=function(){return ir(this,void 0,void 0,(function(){var t;return sr(this,(function(e){switch(e.label){case 0:return[4,Bn.get(Dn.DEVICE_UUID,"")];case 1:return(t=e.sent())?[3,3]:(t=(new ht).toHexString(),[4,Bn.set(Dn.DEVICE_UUID,t)]);case 2:e.sent(),e.label=3;case 3:return[2,t]}}))}))},t.prototype.populateFirstSeen=function(){return ir(this,void 0,void 0,(function(){var t;return sr(this,(function(e){switch(e.label){case 0:return[4,xn.get(Dn.FIRST_SEEN)];case 1:return(t=e.sent())?[3,3]:(t=new Date,[4,xn.set(Dn.FIRST_SEEN,t)]);case 2:e.sent(),e.label=3;case 3:return this.apiService.setFirstSeen(t),[2]}}))}))},t.INSTANCE=new t,t}(),ur=function(){function e(){}return e.getString=function(t,e){return this.getItem(t)||e},e.setString=function(t,e){this.setItem(t,e)},e.remove=function(t){this.removeItem(t)},e.getItem=function(t){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t))},e.setItem=function(t,e){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t),e)},e.removeItem=function(t){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t))},e.SESSION_STORAGE=window.sessionStorage,e.SESSION_STORAGE_KEY_PREFIX=t.COOEE.concat("-"),e}(),cr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},fr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},lr=function(){function e(){this.sessionManager=Jn.getInstance(),this.safeHttpCallService=gr.getInstance(),this.deviceAuthService=ar.getInstance()}return e.prototype.init=function(n){return cr(this,void 0,void 0,(function(){var r=this;return fr(this,(function(o){return t.BOT_UA_REGEX.test(navigator.userAgent)?(mn.log("This seems to be a bot. Disabling SDK"),[2]):(this.deviceAuthService.init(n).then((function(){return cr(r,void 0,void 0,(function(){return fr(this,(function(t){switch(t.label){case 0:return[4,this.execute()];case 1:return t.sent(),e.replaySubject.next(!0),e.replaySubject.complete(),[2]}}))}))})),[2])}))}))},e.prototype.execute=function(){return cr(this,void 0,void 0,(function(){return fr(this,(function(t){switch(t.label){case 0:return[4,this.sessionManager.checkForNewSession()];case 1:return t.sent(),[4,this.isAppFirstTimeLaunch()];case 2:return t.sent()?this.sendFirstLaunchEvent():(this.sendSuccessiveLaunchEvent(),this.safeHttpCallService.getAppConfigurations()),[2]}}))}))},e.prototype.isAppFirstTimeLaunch=function(){return cr(this,void 0,void 0,(function(){return fr(this,(function(t){switch(t.label){case 0:return[4,xn.get(Dn.FIRST_TIME_LAUNCH,!0)];case 1:return t.sent()?[4,xn.set(Dn.FIRST_TIME_LAUNCH,!1)]:[3,3];case 2:return t.sent(),[2,!0];case 3:return[2,!1]}}))}))},e.prototype.sendFirstLaunchEvent=function(){return cr(this,void 0,void 0,(function(){var e,n;return fr(this,(function(r){switch(r.label){case 0:return e=new Pt(t.EVENT_APP_INSTALLED,{}),n=e,[4,(new yn).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return cr(this,void 0,void 0,(function(){var e,n;return fr(this,(function(r){switch(r.label){case 0:return this.isNewTabOpened()?(e=new Pt(t.EVENT_APP_LAUNCHED),n=e,[4,(new yn).get()]):[2];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.isNewTabOpened=function(){return!ur.getString(t.SESSION_STORAGE_TAB_OPENED,"")&&(ur.setString(t.SESSION_STORAGE_TAB_OPENED,"1"),!0)},e.replaySubject=new cn(1),e}(),pr=function(){function t(){}return t.isDukaan=function(){return!!window.DukaanData},t}(),hr=function(){function t(){}return t.isECommerceApp=function(){return Zn.isShopify()||pr.isDukaan()},t}(),dr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},yr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gr=function(){function e(){this.httpApiService=or.getInstance(),this.sessionManager=Jn.getInstance(),this.rejectEvents=[t.EVENT_SCREEN_VIEW,t.EVENT_APP_LAUNCHED]}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.sendEvent=function(t){var e=this;this.shouldReject(t)||lr.replaySubject.subscribe((function(){return dr(e,void 0,void 0,(function(){return yr(this,(function(e){switch(e.label){case 0:return[4,this.addEventData(t)];case 1:return e.sent(),this.httpApiService.sendEvent(t),[2]}}))}))}))},e.prototype.updateProfile=function(t){var e=this;t=null!=t?t:{},lr.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},e.prototype.trackOrder=function(t){var e=this;t?lr.replaySubject.subscribe((function(){e.httpApiService.trackOrder(t)})):mn.warn("No order data found")},e.prototype.updateDeviceProps=function(t,e){var n=this;lr.replaySubject.subscribe((function(){n.httpApiService.updateDeviceProps({props:t,cart:e})}))},e.prototype.logout=function(){var t=this;lr.replaySubject.subscribe((function(){t.httpApiService.logout()}))},e.prototype.getAppConfigurations=function(){var t=this;lr.replaySubject.subscribe((function(){return dr(t,void 0,void 0,(function(){return yr(this,(function(t){switch(t.label){case 0:return[4,this.httpApiService.getAppConfigurations()];case 1:return t.sent(),[2]}}))}))}))},e.prototype.addEventData=function(t){return dr(this,void 0,void 0,(function(){var e,n;return yr(this,(function(r){switch(r.label){case 0:return t.screenName=Xn.getInstance().getScreen(),t.properties.path=location.pathname,location.search&&(t.properties.qs=location.search),[4,this.sessionManager.checkForNewSession()];case 1:return r.sent(),e=t,[4,this.sessionManager.getCurrentSessionID()];case 2:return e.sessionID=r.sent(),n=t,[4,this.sessionManager.getCurrentSessionNumber()];case 3:return n.sessionNumber=r.sent(),Hn.addReferralData(t.properties),[2]}}))}))},e.prototype.shouldReject=function(t){return!(hr.isECommerceApp()||!this.rejectEvents.includes(t.name)&&t.name.startsWith("CE ")||(mn.log("Rejecting ".concat(t.name," as this is not e-commerce app")),0))},e}();!function(t){t[t.CAMERA=1]="CAMERA",t[t.LOCATION=2]="LOCATION",t[t.PUSH=3]="PUSH"}(_n||(_n={})),function(t){t[t.NONE=0]="NONE",t[t.IAB=1]="IAB",t[t.EXTERNAL=2]="EXTERNAL",t[t.PROMPT=3]="PROMPT",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART"}(Tn||(Tn={}));var vr=function(){function t(){}return t.storeActiveTrigger=function(t){return e=this,n=void 0,o=function(){var e;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(n){switch(n.label){case 0:return(null==t?void 0:t.id)&&"test"!==t.id?(e=new Lt(t),[4,$n.set(Dn.ACTIVE_TRIGGER,e)]):[2];case 1:return n.sent(),[2,e]}}))},new((r=void 0)||(r=Promise))((function(t,i){function s(t){try{u(o.next(t))}catch(t){i(t)}}function a(t){try{u(o.throw(t))}catch(t){i(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}u((o=o.apply(e,n||[])).next())}));var e,n,r,o},t}(),br=function(){return br=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},br.apply(this,arguments)},mr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},wr=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Er=function(){function e(t,e){this.action=t,this.apiService=gr.getInstance(),this.triggerContext=e}return e.prototype.execute=function(){return mr(this,void 0,void 0,(function(){var t;return wr(this,(function(e){switch(e.label){case 0:return[4,this.closeAction()];case 1:switch(e.sent(),this.action.at){case Tn.EXTERNAL:this.externalAction();break;case Tn.IAB:this.iabAction();break;case Tn.GO_TO_URL:this.gotoURLAction();break;case Tn.SHARE:this.shareAction();break;case Tn.PROMPT:this.prompt();break;case Tn.ADD_TO_CART:case Tn.COPY_COUPON_CODE:case Tn.GO_TO_COLLECTION:case Tn.GO_TO_PRODUCT:case Tn.OPEN_CART:case void 0:break;default:return mn.error("Received an invalid ClickActionType: ",this.action.at),[2]}return t=br(br(br({},this.action.custKV),this.action.kv),this.action),document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:t})),[2]}}))}))},e.prototype.externalAction=function(){var t,e;if(null===(t=this.action.ext)||void 0===t?void 0:t.u){var n=this.action.ext.u;this.isValidURL(n)||(n="//".concat(n)),null===(e=window.open(n,"_blank"))||void 0===e||e.focus()}},e.prototype.isValidURL=function(t){try{new URL(t)}catch(t){return!1}return!0},e.prototype.gotoURLAction=function(){var t;if(null===(t=this.action.gu)||void 0===t?void 0:t.u){var e=this.action.gu.u;this.isValidURL(e)||(e="//".concat(e)),window.open(e,"_self")}},e.prototype.iabAction=function(){var t;if(null===(t=this.action.iab)||void 0===t?void 0:t.u){var e=this.action.iab.u;this.isValidURL(e)||(e="//".concat(e)),(new Cr).render(e)}},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.prompt=function(){var t=this.action.pmpt;t&&(t===_n.LOCATION&&this.promptLocationPermission(),t===_n.PUSH&&this.promptPushNotificationPermission(),t===_n.CAMERA&&this.promptCameraPermission())},e.prototype.closeAction=function(){return mr(this,void 0,void 0,(function(){var e;return wr(this,(function(n){switch(n.label){case 0:return this.containsCTA()?(e=t.EVENT_TRIGGER_CLICKED,[4,vr.storeActiveTrigger(this.triggerContext.triggerData)]):[3,2];case 1:return n.sent(),[3,3];case 2:e=t.EVENT_TRIGGER_CLOSED,n.label=3;case 3:return this.action.close&&this.triggerContext.closeInApp(e),[2]}}))}))},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):mn.warn("Navigator.share is not compatible with this browser"))},e.prototype.containsCTA=function(){return!!this.action.at||!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))},e.prototype.isEmpty=function(t){return!t||0===Object.keys(t).length},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateDeviceProps({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateDeviceProps({pnPerm:Notification.permission}):mn.warn("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return mr(this,void 0,void 0,(function(){var t,e,n;return wr(this,(function(r){switch(r.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=r.sent(),[4,this.checkPermission("geolocation")];case 2:return e=r.sent(),n=Notification.permission,[2,{camera:t,location:e,notification:n}]}}))}))},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateDeviceProps({perm:e})}))},e}(),Sr=function(){function t(t,e,n){this.renderer=pn.get(),this.screenWidth=0,this.screenHeight=0,this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=n,this.scalingFactor=this.renderer.getScalingFactor(),this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return t.prototype.getHTMLElement=function(){return this.inappHTMLEl},t.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},t.prototype.processCommonBlocks=function(){this.processDisplay(),this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},t.prototype.processDisplay=function(){this.renderer.setStyle(this.inappHTMLEl,"display","block")},t.prototype.processWidthAndHeight=function(){this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},t.prototype.getSizePx=function(t){return this.getScaledSize(t)+"px"},t.prototype.getScaledSize=function(t){return t*this.scalingFactor},t.prototype.processPositionBlock=function(){this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y))},t.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},t.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},t.prototype.processTransparency=function(){var t=this.inappElement.alpha;if(!isNaN(t)){var e=(t/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",e)}},t.prototype.processShadow=function(){var t=this.inappElement.shd;t&&this.renderer.setStyle(this.inappHTMLEl,"box-shadow",t.getStyle(this.scalingFactor))},t.prototype.processTransformBlock=function(){var t=new Wt(this.inappElement.trf);t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate(".concat(t.rotate,"deg)"))},t.prototype.registerAction=function(){var t=this,e=this.inappElement.clc;e&&0!==Object.keys(e).length&&(this.inappHTMLEl.addEventListener("click",(function(n){n.stopPropagation(),new Er(e,t.triggerContext).execute()})),this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))},t.prototype.processBackgroundBlock=function(){var t=this.inappElement.bg;if(t){var e=this.inappHTMLEl;if(t.glossy){var n="backdrop-filter",r="-webkit-"+n,o="blur(".concat(t.glossy.radius,"px)");if(!CSS.supports(r,o)&&!CSS.supports(n,o))return void this.renderer.setStyle(e,"background",t.glossy.fallback.rgba);this.renderer.setStyle(e,r,o),this.renderer.setStyle(e,n,o),t.glossy.color&&this.processColourBlock(t.glossy.color,"background",e)}else if(t.solid)t.solid.grad?this.processGradient(t.solid.grad,"background"):t.solid.hex&&this.renderer.setStyle(e,"background",t.solid.rgba);else if(t.img){if(!t.img.src)return;var i='url("'.concat(t.img.src,'") no-repeat center');this.renderer.setStyle(e,"background",i),this.renderer.setStyle(e,"background-size","cover"),t.img.a&&(this.renderer.setStyle(e,"-webkit-backdrop-filter","opacity(".concat(t.img.a,")")),this.renderer.setStyle(e,"backdrop-filter","opacity(".concat(t.img.a,")")))}}},t.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var n="linear-gradient(".concat(t.ang,"deg, ").concat(t.c1,", ").concat(t.c2);t.c3&&(n+=", ".concat(t.c3)),n+=")",this.renderer.setStyle(this.inappHTMLEl,e,n)}},t.prototype.processColourBlock=function(t,e,n){void 0===e&&(e="color"),void 0===n&&(n=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(n,e,t.rgba))},t}(),_r=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tr=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return _r(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t;this.renderer.setStyle(this.inappHTMLEl,"letter-spacing","normal");var e=this.inappElement.font;e&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(e.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",null===(t=e.family)||void 0===t?void 0:t.name),this.renderer.setStyle(this.inappHTMLEl,"line-height",e.lh))},e.prototype.processPart=function(t,e){var n,r=[];e.u&&r.push("underline"),e.st&&r.push("line-through"),r.length||r.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",r.join(" ")),this.renderer.setStyle(t,"color",null!==(n=e.c)&&void 0!==n?n:"inherit"),this.renderer.setStyle(t,"font-family","inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=Yt[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(Sr),Or=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ir=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("div"),o.insertElement(),o}return Or(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var n,r,o=e.renderer.createElement("span");o.innerHTML=null===(r=null===(n=t.txt)||void 0===n?void 0:n.toString())||void 0===r?void 0:r.replace(/\n/g,"<br />"),e.processPart(o,t),e.renderer.appendChild(e.inappHTMLEl,o)})),this.processCommonBlocks()},e}(Tr),xr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nr=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("div"),o.insertElement(),o}return xr(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(Sr),Ar=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dr=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("img"),o.insertElement(),o}return Ar(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(Sr),Lr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pr=function(e){function n(t,n,r){var o=e.call(this,t,n,r)||this;return o.parent=t,o.inappHTMLEl=o.renderer.createElement("div"),o}return Lr(n,e),n.prototype.render=function(){return this.parent||this.renderer.removeInApp(this.triggerContext),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(t.IN_APP_WRAPPER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",n.MAX_Z_INDEX),this.inappHTMLEl},n.prototype.processBackgroundBlock=function(){this.inappElement.cover&&e.prototype.processBackgroundBlock.call(this)},n.prototype.processWidthAndHeight=function(){var t=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width","100vw"),this.renderer.setStyle(this.inappHTMLEl,"height","100vh")),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0");else{var e=this.inappElement.spc,n=this.getScaledSize(t.w)+e.getHorizontal(),r=this.getScaledSize(t.h)+e.getVertical();this.renderer.setStyle(this.inappHTMLEl,"width",n+"px"),this.renderer.setStyle(this.inappHTMLEl,"height",r+"px")}},n.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;this.renderer.setStyle(this.inappHTMLEl,"padding",t.getPaddingCSS())},n.prototype.processDisplay=function(){this.renderer.setStyle(this.inappHTMLEl,"display","flex"),Object.assign(this.inappHTMLEl.style,this.inappElement.getStylesForWrapper()),Object.assign(this.inappHTMLEl.style,this.inappElement.getFlexStylesForContainer())},n.prototype.processPositionBlock=function(){var t;if(this.renderer.isParentNotBody()){if(null===(t=this.triggerContext.triggerData.ian)||void 0===t?void 0:t.isEmbedded())return void this.renderer.setStyle(this.inappHTMLEl,"position","block");this.renderer.setStyle(this.inappHTMLEl,"position","absolute")}else this.renderer.setStyle(this.inappHTMLEl,"position","fixed")},n.prototype.processBorderBlock=function(){},n.prototype.processTransparency=function(){},n.prototype.processTransformBlock=function(){},n.prototype.processGradient=function(){},n.prototype.processShadow=function(){},n.prototype.registerAction=function(){var t=this;this.inappHTMLEl.addEventListener("click",(function(){new Er({close:!0},t.triggerContext).execute()}))},n.MAX_Z_INDEX="2147483647",n}(Sr),Cr=function(){function e(){this.renderer=pn.get()}return e.prototype.render=function(e){var n=document.querySelector(".".concat(t.IN_APP_WRAPPER_NAME)),r=this.createIFrameContainer();return this.createIFrameElement(r,e),this.createAnchorElement(n,r),this.renderer.appendChild(n,r),r},e.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},e.prototype.createIFrameElement=function(t,e){var n=this.renderer.createElement("iframe");return this.renderer.setStyle(n,"width","100%"),this.renderer.setStyle(n,"height","100%"),this.renderer.setAttribute(n,"src",e),this.renderer.setAttribute(n,"frameBorder","0"),this.renderer.appendChild(t,n),n},e.prototype.createAnchorElement=function(t,e){var n=this.renderer.createElement("a");return this.renderer.setStyle(n,"position","absolute"),this.renderer.setStyle(n,"top","0px"),this.renderer.setStyle(n,"right","0px"),n.href="#",n.innerHTML="Close",n.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,n),n},e}(),Rr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kr=function(e){function n(t,n,r){var o=e.call(this,t,n,r)||this;return o.inappHTMLEl=o.renderer.createElement("div"),o.insertElement(),o}return Rr(n,e),n.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this.renderer.setStyle(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(t.IN_APP_CONTAINER_NAME),this},n}(Sr),Br=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},Ur=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},jr=function(){function e(t){var e=this;this.renderer=pn.get(),this.safeHTTP=gr.getInstance(),this.resizeListener=function(){return e.screenResized()},this.setParentContainer(t)}return e.prototype.setParentContainer=function(t){this.parent=null!=t?t:document.body,this.renderer.setParentContainer(this.parent)},e.prototype.render=function(t){return Br(this,void 0,void 0,(function(){var n,r,o=this;return Ur(this,(function(i){switch(i.label){case 0:return n=new ve(t),!t.previewType&&e.ACTIVE_TRIGGER_DATA?(this.skipTrigger(n),[2]):(e.ACTIVE_TRIGGER_DATA=n,this.triggerContext=new se(new Date,n),this.triggerContext.onClose((function(t){o.closeInApp(t)})),this.ian=n.ian,(this.renderer.isMobile()||"mobile"===n.previewType)&&this.ian.overrideForMobileView(),this.ian.isEmbedded()&&(r=document.querySelector(this.ian.getEmbeddedSelector()),this.setParentContainer(r)),[4,this.preloadImages(n)]);case 1:return i.sent(),n.shouldDelay()?window.setTimeout((function(){o.startRenderingOnce()}),n.getDelaySeconds()):this.startRenderingOnce(),[2]}}))}))},e.prototype.startRenderingOnce=function(){try{this.startRendering()}catch(t){return}this.sendTriggerDisplayed(),this.renderer.isMobile()||window.addEventListener("resize",this.resizeListener)},e.prototype.startRendering=function(){this.renderer.calculateScalingFactor(this.ian),this.rootContainer=new Pr(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(t){throw mn.error(t),t}},e.prototype.sendTriggerDisplayed=function(){var e=new Pt(t.EVENT_TRIGGER_DISPLAYED,{},this.triggerContext.triggerData);this.safeHTTP.sendEvent(e)},e.prototype.sendTriggerClosed=function(t){var e=t.eventName;delete t.eventName;var n=new Pt(e,t,this.triggerContext.triggerData);this.safeHTTP.sendEvent(n)},e.prototype.addEnterAnimation=function(t){this.containerHTMLElement.animate(t.getEnterAnimation(),{duration:500})},e.prototype.renderElement=function(t,e,n){e instanceof ne?new Ir(t,e,n).render():e instanceof te?new Dr(t,e,n).render():e instanceof Zt?new Nr(t,e,n).render():mn.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(t){var e,n,r=this,o=null===(e=this.ian)||void 0===e?void 0:e.cont;o&&(this.containerHTMLElement=new kr(this.rootContainer,o,t).render().getHTMLElement(),(new we).loadAllFonts(this.ian),null===(n=this.ian.elems)||void 0===n||n.forEach((function(e){return Br(r,void 0,void 0,(function(){return Ur(this,(function(n){switch(n.label){case 0:return[4,this.renderElement(this.containerHTMLElement,e,t)];case 1:return n.sent(),[2]}}))}))})),this.addEnterAnimation(this.ian.anim))},e.prototype.closeInApp=function(t){var n=this,r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(t),e.ACTIVE_TRIGGER_DATA=void 0,this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"}).onfinish=function(){n.removeInApp(),window.removeEventListener("resize",n.resizeListener)}},e.prototype.screenResized=function(){this.removeInApp(),this.startRendering()},e.prototype.removeInApp=function(){pn.get().removeInApp(this.triggerContext)},e.prototype.skipTrigger=function(n){var r,o={triggerShown:new Lt(null!==(r=e.ACTIVE_TRIGGER_DATA)&&void 0!==r?r:{})},i=new Pt(t.EVENT_TRIGGER_REJECTED,o,n);this.safeHTTP.sendEvent(i)},e.prototype.preloadImages=function(t){var e,n,r,o;return Br(this,void 0,void 0,(function(){var i,s,a=this;return Ur(this,(function(u){switch(u.label){case 0:return(i=t.ian)?[3,2]:[4,Promise.resolve()];case 1:case 3:return u.sent(),[2];case 2:return s=[],i.elems.forEach((function(t){var e,n,r=null===(n=null===(e=t.bg)||void 0===e?void 0:e.img)||void 0===n?void 0:n.src;if(r&&s.push(a.getPromise(r)),t.t===Gt.IMAGE){var o=t.src;if(!o)return;s.push(a.getPromise(o))}})),(null===(n=null===(e=i.bg)||void 0===e?void 0:e.img)||void 0===n?void 0:n.src)&&s.push(this.getPromise(i.bg.img.src)),(null===(o=null===(r=i.cont.bg)||void 0===r?void 0:r.img)||void 0===o?void 0:o.src)&&s.push(this.getPromise(i.cont.bg.img.src)),[4,Promise.all(s)]}}))}))},e.prototype.getPromise=function(t){return new Promise((function(e){var n=new Image;n.onload=e,n.src=t,n.style.display="none"}))},e}();const Mr=jr})(),CooeePreview=r.default})();
|