PageSourceSearch

https://cdn-v2.modernvillagelifestyle.vn/homepage/_next/static/chunks/vendor-73008b5d-f9c51608d53a9154.js

js modernvillagelifestyle.vn collected 2026-10-10 00:33:41 UTC 78,648 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="708c8ee5-8812-4b27-97b4-df5234c8bd76",e._sentryDebugIdIdentifier="sentry-dbid-708c8ee5-8812-4b27-97b4-df5234c8bd76")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1521],{3423:(e,t,n)=>{n.d(t,{S1:()=>c,W6:()=>s,tT:()=>l});var r=n(58006),i=n(63085),o=function(){var e,t=(0,i.m)();return null==(e=null==t?void 0:t.navigator)?void 0:e.locks},s=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,r.Cl)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,o=this;return(0,r.YH)(this,function(s){switch(s.label){case 0:return t="AMP_TEST",n=new e((0,r.Cl)({},this.options)),i=String(Date.now()),[4,n.transaction(t,function(e){var n,r;try{e.set(i);var s=e.get()===i;return!s&&o.config.diagnosticsClient&&(null==(n=o.config.diagnosticsClient)||n.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:i,sync:!0})),s}catch(e){if(o.config.diagnosticsClient){var a=e instanceof Error?e.message:String(e);null==(r=o.config.diagnosticsClient)||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:i,error:a,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,s.sent()]}})})},e.prototype.get=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t;return(0,r.YH)(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=c(t);if(void 0===n)return void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t));return JSON.parse(n)}catch(n){console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t));return}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,n;return(0,r.sH)(this,void 0,void 0,function(){var o,s,a,u,c,h,d,f;return(0,r.YH)(this,function(p){switch(p.label){case 0:o=(0,i.m)(),p.label=1;case 1:if(p.trys.push([1,4,,5]),!(s=null==o?void 0:o.cookieStore))return[3,3];return[4,s.getAll(e)];case 2:if(a=p.sent()){a.length>1&&(null==(t=this.config.diagnosticsClient)||t.recordEvent("cookies.duplicate",{cookies:a.map(function(e){return e.domain})}),null==(n=this.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=(u=(0,r.Ju)(a)).next();!c.done;c=u.next())if(h=c.value,l(h.domain,this.options.domain))return[2,h.value]}catch(e){d={error:e}}finally{try{c&&!c.done&&(f=u.return)&&f.call(u)}finally{if(d)throw d.error}}}p.label=3;case 3:return[3,5];case 4:return p.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,o=(0,i.m)(),s=(null!=(n=null==(t=null==o?void 0:o.document)?void 0:t.cookie.split("; "))?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,u=this.config.duplicateResolverFn;if("function"==typeof u&&s.length>1&&(a=s.find(function(t){var n;try{var i=u(t.substring(e.length+1));return i||null==(n=r.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=s[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=null!=(n=this.options.expirationDays)?n:0,o=null!==t?r:-1,s=void 0;if(o){var a=new Date;a.setTime(a.getTime()+24*o*36e5),s=a}var u="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));s&&(u+="; expires=".concat(s.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite));var c=(0,i.m)();(null==c?void 0:c.document)&&(c.document.cookie=u)}catch(t){var l=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}},e.prototype.remove=function(e){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,r.sH)(this,void 0,void 0,function(){var n,i;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",i=new e({domain:"."+t}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i.transaction(n,function(n){if(e.cac
1hedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!r.sent()];case 3:return r.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return(0,r.sH)(this,void 0,void 0,function(){var n,i,s=this;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(n=o(),i=function(){return t({get:function(){return s.getSync(e)},set:function(t){return s.setSync(e,t)}})},!n)return[2,i()];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),i)];case 2:return[2,r.sent()];case 3:return r.sent(),[2,i()];case 4:return[2]}})})},e.cachedTlds={},e}(),a=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},u=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},c=function(e){var t;return null!=(t=a(e))?t:u(e)},l=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()}},8615:(e,t,n)=>{n.d(t,{kf:()=>p});var r=n(58006),i=n(63085),o={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},s={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},a=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return(null==(e=(0,i.m)())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;
1n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(o.TAGS)||e.createObjectStore(o.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(o.COUNTERS)||e.createObjectStore(o.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(o.HISTOGRAMS)||e.createObjectStore(o.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains(o.EVENTS)||e.createObjectStore(o.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(o.INTERNAL)||e.createObjectStore(o.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,s=this;return(0,r.YH)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=a.sent().transaction([o.TAGS],"readwrite")).objectStore(o.TAGS),[2,new Promise(function(i){var o=Object.entries(e);t.oncomplete=function(){i()},t.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to set tags",e),i()},o.forEach(function(e){var t=(0,r.zs)(e,2),i=t[0],o=t[1];n.put({key:i,value:o}).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to set tag",i,o,e)}})})];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,s=this;return(0,r.YH)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=a.sent().transaction([o.COUNTERS],"readwrite")).objectStore(o.COUNTERS),[2,new Promise(function(i){var o=Object.entries(e);t.oncomplete=function(){i()},t.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to increment counters",e),i()},o.forEach(function(e){var t=(0,r.zs)(e,2),i=t[0],o=t[1],a=n.get(i);a.onsuccess=function(){var e=a.result,t=e?e.value:0;n.put({key:i,value:t+o}).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to update counter",i,e)}},a.onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to read existing counter",i,e)}})})];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,s=this;return(0,r.YH)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=a.sent().transaction([o.HISTOGRAMS],"readwrite")).objectStore(o.HISTOGRAMS),[2,new Promise(function(i){var o=Object.entries(e);t.oncomplete=function(){i()},t.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),i()},o.forEach(function(e){var t=(0,r.zs)(e,2),i=t[0],o=t[1],a=n.get(i);a.onsuccess=function(){var e,t=a.result;e=t?{key:i,count:t.count+o.count,min:Math.min(t.min,o.min),max:Math.max(t.max,o.max),sum:t.sum+o.sum}:{key:i,count:o.count,min:o.min,max:o.max,sum:o.sum},n.put(e).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i,e)}},a.onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",i,e)}})})];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,s=this;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return n=(t=r.sent().transaction([o.EVENTS],"readwrite")).objectStore(o.EVENTS),[2,new Promise(function(r){t.oncomplete=function(){r()},t.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to add event records",e),r()};var i=n.count();i.onsuccess=function(){var t=Math.max(0,10-i.result);t<e.length&&s.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){n.add(e).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},i.onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return i=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,r.sH)(this,void 0,void 0,function(){var n,i,s;return(0,r.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getDB()];case 1:return i=(n=r.sent().transaction([o.INTERNAL],"readwrite")).objectStore(o.INTERNAL),[2,new Promise(function(r,o){n.onabort=function(){return o(Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return r()},s.onerror=function(){return o(Error("Failed to set internal value"))}})];case 2:return s=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",s),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i;return(0,r.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(t=r.sent().transaction([o.INTERNAL],"readonly")).objectStore(o.INTERNAL),[2,new Promise(function(r,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return r(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return i=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,r.sH)(this,void 0,void 0,function(){var e,t;return(0,r.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(s.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t;return(0,r.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(s.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,r.sH)(this,void 0,void 0,function(){var e,t,n,i,s,a,u;return(0,r.YH)(this,function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=c.sent().transaction([o.TAGS,o.COUNTERS,o.HISTOGRAMS,o.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(e,o.TAGS),this.getAllFromStore(e,o.COUNTERS),this.getAllFromStore(e,o.HISTOGRAMS),this.getAllFromStore(e,o.EVENTS)])];case 2:return n=(t=r.zs.apply(void 0,[c.sent(),4]))[0],i=t[1],s=t[2],a=t[3],[4,Promise.all([this.clearTable(e,o.COUNTERS),this.clearTable(e,o.HISTOGRAMS),this.clearTable(e,o.EVENTS)])];case 3:return c.sent(),[2,{tags:n,counters:i,histogramStats:s,events:a}];case 4:return u=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",u),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(Error("Failed to get all from ".concat(t)))}})},e}(),u=n(21956),c=function(){var e=(0,i.m)();if(!e)return[];
1var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},l=function(e){var t=(0,i.m)();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",(0,r.Cl)({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=h({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=d(i),s=h({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!=(t=null==r?void 0:r.message)?t:f(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}},h=function(e){var t,n,i=c();if(0!==i.length)try{for(var o=(0,r.Ju)(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(e.filename&&e.filename.includes(a))return"filename";if(e.stack&&e.stack.includes(a))return"stack"}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},d=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},f=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},p=function(){function e(e,t,n,i){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(i,null,2)),this.config=(0,r.Cl)({enabled:!0,sampleRate:0},i),this.startTimestamp=Date.now(),this.shouldTrack=(0,u.Ss)(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,a.isSupported()?this.storage=new a(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),l(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");this.inMemoryTags[e]=t,this.startTimersIfNeeded()}},e.prototype.increment=function(e,t){if(void 0===t&&(t=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10)return void this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},3e5))},e.prototype.saveAllDataToStorage=function(){return(0,r.sH)(this,void 0,void 0,function(){var e,t,n,i;return(0,r.YH)(this,function(o){switch(o.label){case 0:if(!this.storage)return[2];return e=(0,r.Cl)({},this.inMemoryTags),t=(0,r.Cl)({},this.inMemoryCounters),n=(0,r.Cl)({},this.inMemoryHistograms),i=(0,r.fX)([],(0,r.zs)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(i)])];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return(0,r.sH)(this,void 0,void 0,function(){var e,t,n,i,o,s,a,u,c,l;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return r.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=r.sent()).tags,n=e.counters,i=e.histogramStats,o=e.events,this.storage.setLastFlushTimestamp(Date.now()),s={},t.forEach(function(e){s[e.key]=e.value}),a={}
1,n.forEach(function(e){a[e.key]=e.value}),u={},i.forEach(function(e){u[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),c=o.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(a).length&&0===Object.keys(u).length&&0===c.length)return[2];return l={tags:s,histogram:u,counters:a,events:c},this.fetch(l),[2]}})})},e.prototype.fetch=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t;return(0,r.YH)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!(0,i.m)())throw Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:if(!n.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,r.sH)(this,void 0,void 0,function(){var e,t,n;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=r.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(n=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-n),[2]}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=(0,u.Ss)(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}()},13165:(e,t,n)=>{n.d(t,{t:()=>r});var r=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e}},24512:(e,t,n)=>{n.d(t,{E:()=>s});var r=n(58006),i=n(32302),o=n(5822),s=function(){function e(){}return e.prototype.parse=function(){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(e){return[2,(0,r.Cl)((0,r.Cl)((0,r.Cl)((0,r.Cl)({},o.F3),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=(0,i.v)();return{utm_campaign:e[o._9],utm_content:e[o.fL],utm_id:e[o.Cs],utm_medium:e[o.Jn],utm_source:e[o.VU],utm_term:e[o.Wx]}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=(0,i.v)();return(e={})[o.h2]=t[o.h2],e[o.lT]=t[o.lT],e[o.wX]=t[o.wX],e[o.q2]=t[o.q2],e[o.KY]=t[o.KY],e[o.Ct]=t[o.Ct],e[o.qr]=t[o.qr],e[o.wu]=t[o.wu],e[o.tt]=t[o.tt],e[o.Gp]=t[o.Gp],e[o.SO]=t[o.SO],e},e}()},31274:(e,t,n)=>{n.d(t,{D:()=>g});var r=n(58006),i=n(92011),o=n(60301),s=n(5822),a=n(91766),u=n(17350),c=n(70637),l=n(31654),h=n(71767),d=n(71956),f=new Set([s.mJ,s.bu,s.pL,s.OP]);function p(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var g=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return(0,r.sH)(this,void 0,void 0,function(){var n,i=this;return(0,r.YH)(this,function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(s.fS,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?void 0:t.get(this.storageKey)];case 1:return(n=r.sent())&&n.length>0&&Promise.all(n.map(function(e){return i.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=(0,l.k)()),new Promise(function(n){t.queue.push({event:e,attempts:0,callback:function(e){return n(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})}
1,e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,o.a_),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,r.sH)(this,void 0,void 0,function(){var t,n,i=this;return(0,r.YH)(this,function(o){switch(o.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),[4,(0,a.i)(t,this.config.flushQueueSize).reduce(function(t,n){return(0,r.sH)(i,void 0,void 0,function(){return(0,r.YH)(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())];case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),(0,r.sH)(this,void 0,void 0,function(){var s,a,u,l,h;return(0,r.YH)(this,function(g){var v,m,y;switch(g.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,o.ot)];s={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,r.Tt)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new c.vG,g.label=1;case 1:return g.trys.push([1,3,,4]),v=a=(0,c.Ql)(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(m=this.config.enableRequestBodyCompression)&&(m=!1),u=!!f.has(v)||m,[4,this.config.transportProvider.send(a,s,this.config._enableRequestBodyCompressionExperimental&&u)];case 2:if(null===(l=g.sent()))return this.fulfillRequest(e,0,o.$k),[2];if(!t)return"body"in l?this.fulfillRequest(e,l.statusCode,"".concat(l.status,": ").concat(p(l))):this.fulfillRequest(e,l.statusCode,l.status),[2];return this.handleResponse(l,e),[3,4];case 3:return h=(y=g.sent())instanceof Error?y.message:String(y),this.config.loggerProvider.error(h),null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:h,stack_trace:(0,d.cI)()}),this.handleResponse({status:i.n.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){(0,h.R)(e.statusCode)||null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:p(e),stack_trace:(0,d.cI)()});var n,r=e.status;switch(r){case i.n.Success:this.handleSuccessResponse(e,t);break;case i.n.Invalid:this.handleInvalidResponse(e,t);break;case i.n.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case i.n.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,o.CS)},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith(o.pL))return void this.fulfillRequest(t,e.statusCode,e.body.error);var i=new Set((0,r.fX)((0,r.fX)((0,r.fX)((0,r.fX)([],(0,r.zs)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,r.zs)(Object.values(e.body.eventsWithMissingFields)),!1),(0,r.zs)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,r.zs)(e.body.silencedEvents),!1).flat()),s=t.filter(function(t,r){return!i.has(r)||void n.fulfillRequest([t],e.statusCode,e.body.error)});s.length>0&&this.config.loggerProvider.warn(p(e));
1var a=this.removeEventsExceedFlushMaxRetries(s);this.scheduleEvents(a)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(p(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),u=new Set(o),c=t.filter(function(t,r){return t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)?void n.fulfillRequest([t],e.statusCode,e.body.error):(u.has(r)&&(t.timeout=n.throttleTimeout),!0)});c.length>0&&this.config.loggerProvider.warn(p(e));var l=this.removeEventsExceedFlushMaxRetries(c);this.scheduleEvents(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;(0,h.R)(t)?null==(o=this.diagnosticsClient)||o.increment("analytics.events.sent",e.length):(null==(r=this.diagnosticsClient)||r.increment("analytics.events.dropped",e.length),null==(i=this.diagnosticsClient)||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:(0,d.cI)()})),this.removeEvents(e),e.forEach(function(e){return e.callback((0,u.C)(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}()},32302:(e,t,n)=>{n.d(t,{v:()=>i});var r=n(63085),i=function(){var e,t=(0,r.m)();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=o(n[0]),i=o(n[1]);return i&&(e[r]=i),e},{}):{}},o=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}}},33554:(e,t,n)=>{n.d(t,{X:()=>i});var r=n(58006),i=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t;return(0,r.YH)(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}()},37334:(e,t,n)=>{n.d(t,{n:()=>s});var r,i=n(58006),o=n(15521),s=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));(0,o.a)(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,i.Cl)({},this.properties):{};return e[r.REVENUE_PRODUCT_ID]=this.productId,e[r.REVENUE_QUANTITY]=this.quantity,e[r.REVENUE_PRICE]=this.price,e[r.REVENUE_TYPE]=this.revenueType,e[r.REVENUE_CURRENCY]=this.currency,e[r.REVENUE]=this.revenue,e[r.RECEIPT]=this.receipt,e[r.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(r||(r={}))}
1,38112:(e,t,n)=>{n.d(t,{y:()=>c});var r=n(58006),i=(0,n(63085).m)(),o=null==i?void 0:i.console,s={},a={},u=!1,c={addListener:function(e,t){if(!o||"function"!=typeof o[e]||!a[e]&&(a[e]=o[e],o[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if(s[e]&&!u){u=!0;var r=s[e];r&&r.forEach(function(n){try{n(e,t)}catch(e){}})}}catch(e){}return u=!1,a[e].apply(o,t)},0))return Error("Console override failed");s[e]?s[e].push(t):s[e]=[t]},removeListener:function(e){var t,n;try{for(var i=(0,r.Ju)(Object.values(s)),o=i.next();!o.done;o=i.next())for(var a=o.value,u=a.length-1;u>=0;u--)if(a[u]===e){a.splice(u,1);break}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=(0,r.Ju)(Object.entries(a)),i=n.next();!i.done;i=n.next()){var u=(0,r.zs)(i.value,2),c=u[0],l=u[1];l&&(o[c]=l)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}a={},s={}}}},38135:(e,t,n)=>{n.d(t,{Se:()=>u,T$:()=>a});var r,i=n(58006),o=n(5822),s=n(15521),a=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,i.Cl)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(r.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(r.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(r.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(r.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(r.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(r.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(r.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(r.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(r.UNSET,e,o.mG),this},e.prototype.clearAll=function(){return this._properties={},this._properties[r.CLEAR_ALL]=o.mG,this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[r.CLEAR_ALL]||this._propertySet.has(t))&&(e===r.ADD?"number"==typeof n:e===r.UNSET||e===r.REMOVE||(0,s.E)(t,n))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(r||(r={}));var u=[r.CLEAR_ALL,r.UNSET,r.SET,r.SET_ONCE,r.ADD,r.APPEND,r.PREPEND,r.PREINSERT,r.POSTINSERT,r.REMOVE]},40559:(e,t,n)=>{n.d(t,{I:()=>i,l:()=>o});var r=n(5822),i=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[r.r,t,e.substring(0,n)].filter(Boolean).join("_")},o=function(e){return"".concat(r.r.toLowerCase(),"_").concat(e.substring(0,6))}},46431:(e,t,n)=>{n.d(t,{W0:()=>o,k$:()=>c,sX:()=>i,wS:()=>l});var r=n(58006),i="data-amp-mask",o="*****",s=/\b(?:\d[ -]*?){13,16}\b/,a=/(\d{3}-?\d{2}-?\d{4})/g,u=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,c=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var n,i,c=e;c=(c=(c=c.replace(s,o)).replace(a,o)).replace(u,o);try{for(var l=(0,r.Ju)(t),h=l.next();!h.done;h=l.next()){var d=h.value;try{c=c.replace(d,o)}catch(e){}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return c},l=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(i)?o:e?e(document.title):document.title}},49230:(e,t,n)=>{n.d(t,{n:()=>d});var r=n(58006),i=n(5580),o=n(38135),s=n(60301),a=n(17350),u=n(31654),c=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,i;return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(r){switch(r.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=(0,u.k)(),this.loggerProvider.warn("Plugin name is undefined. \n      Generating a random UUID for plugin name: ".concat(e.name,". \n      Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!=(n=e.type)?n:"enrichment",[4,null==(i=e.setup)?void 0:i.call(e,t,this.client)];case 1:return r.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var n;return(0,r.sH)(this,void 0,void 0,function(){var i,o;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(-1===(i=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return o=this.plugins[i],this.plugins.splice(i,1),[4,null==(n=o.teardown)?void 0:n.call(o)];case 1:return r.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,o,s,u,c,l,h,d,f,p,g,v,m;return(0,r.YH)(this,function(y){switch(y.label){case 0:if(!e)return[2];t=(0,r.zs)(e,1)[0],n=(0,r.zs)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),i=this.plugins.filter(function(e){return"before"===e.type}),y.label=1;case 1:y.trys.push([1,6,7,8]),s=(o=(0,r.Ju)(i)).next(),y.label=2;case 2:if(s.done)return[3,5];if(!(u=s.value).execute)return[3,4];return[4,u.execute((0,r.Cl)({},t))];case 3:if(null===(c=y.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(u.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=c,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(u.name),"', event: ").concat(JSON.stringify(t))),y.label=4;case 4:return s=o.next(),[3,2];case 5:return[3,8];case 6:return p={error:y.sent()},[3,8];case 7:try{s&&!s.done&&(g=o.return)&&g.call(o)}finally{if(p)throw p.error}
1return[7];case 8:l=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),y.label=9;case 9:y.trys.push([9,14,15,16]),d=(h=(0,r.Ju)(l)).next(),y.label=10;case 10:if(d.done)return[3,13];if(!(u=d.value).execute)return[3,12];return[4,u.execute((0,r.Cl)({},t))];case 11:if(null===(c=y.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(u.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=c,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(u.name),"', event: ").concat(JSON.stringify(t))),y.label=12;case 12:return d=h.next(),[3,10];case 13:return[3,16];case 14:return v={error:y.sent()},[3,16];case 15:try{d&&!d.done&&(m=h.return)&&m.call(h)}finally{if(v)throw v.error}return[7];case 16:return f=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(t))),Promise.all(f.map(function(e){var n=(0,r.Cl)({},t);return e.execute(n).catch(function(e){return(0,a.C)(n,0,String(e))})})).then(function(e){var i=(0,r.zs)(e,1)[0]||(0,a.C)(t,100,"Event not tracked, no destination plugins on the instance");n(i)}),[2]}})})},e.prototype.flush=function(){return(0,r.sH)(this,void 0,void 0,function(){var e,t=this;return(0,r.YH)(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onIdentityChanged)||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onSessionIdChanged)||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onOptOutChanged)||n.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,o,s,a;return(0,r.YH)(this,function(u){switch(u.label){case 0:u.trys.push([0,7,8,9]),n=(t=(0,r.Ju)(this._optOutListeners)).next(),u.label=1;case 1:if(n.done)return[3,6];i=n.value,u.label=2;case 2:return u.trys.push([2,4,,5]),[4,i(e)];case 3:return u.sent(),[3,5];case 4:return o=u.sent(),this.loggerProvider.error("Error calling optOut listener",o),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return s={error:u.sent()},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),l=n(16113),h=n(37773),d=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new c(this),this.name=e}return e.prototype._init=function(e){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,o,s,a;return(0,r.YH)(this,function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),i=(n=(0,r.Ju)(t)).next(),u.label=2;case 2:if(i.done)return[3,7];if(!((o=(0,i.value)())&&"promise"in o))return[3,4];return[4,o.promise];case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return s={error:u.sent()},[3,10];case 9:try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(s)throw s.error}
1return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:u.sent(),u.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=(0,l.M1)(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),(0,h.m)(this.dispatch(r))},e.prototype.identify=function(e,t){var n=(0,l.rA)(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),(0,h.m)(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=(0,l.mc)(e,t,n,r);return(0,h.m)(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=(0,l.u4)(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),(0,h.m)(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=(0,l.dG)(e,t);return(0,h.m)(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),(0,h.m)())},e.prototype._addPlugin=function(e){return(0,h.m)(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),(0,h.m)())},e.prototype._removePlugin=function(e){return(0,h.m)(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t((0,a.C)(e,0,s.z7));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t=this;return(0,r.YH)(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!=(t=this.userProperties)?t:{},s=(0,r.Cl)({},n);if(void 0===e)return s;var a={};return Object.keys(e).forEach(function(t){Object.values(i.e).includes(t)||(a[t]=e[t])}),o.Se.forEach(function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case i.e.CLEAR_ALL:Object.keys(s).forEach(function(e){delete s[e]});break;case i.e.UNSET:Object.keys(n).forEach(function(e){delete s[e]});break;case i.e.SET:Object.assign(s,n)}}}),Object.assign(s,a),s},e.prototype.process=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),this.config.optOut)return[2,(0,a.C)(e,0,s.xQ)];return e.event_type===i.S.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)];case 1:return 200===(t=r.sent()).code?this.config.loggerProvider.log(t.message):100===t.code?this.config.loggerProvider.warn(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return n=String(r.sent()),this.config.loggerProvider.error(n),[2,t=(0,a.C)(e,0,n)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){if(!this.isReady)return void this.q.push(this._setOptOut.bind(this,!!e));this._setOptOut(e)},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return(0,h.m)(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}()},50278:(e,t,n)=>{n.d(t,{sr:()=>y,Hw:()=>S});var r,i=n(58006),o=n(63085),s=n(31654),a=n(52902),u=n(5822),c=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,n,r=this.request.headers,o={};if(Array.isArray(r))r.forEach(function(e){var t=(0,i.zs)(e,2),n=t[0],r=t[1];o[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){o[t]=e});else if("object"==typeof r&&null!==r)try{for(var s=(0,i.Ju)(Object.entries(r)),a=s.next();!a.done;a=s.next()){var u=(0,i.zs)(a.value,2),c=u[0],l=u[1];o[c]=l}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return v(o,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=(0,o.m)();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=h(t,100),this._bodySize}}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){return 0===e.length?[2,null]:[2,p(this.body,e,t)]})})},e}(),l=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),v(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return h(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){return 0===e.length?[2,null]:[2,p(this.body,e,t)]})})},e}();function h(e,t){var n,r,s,a,u=(0,o.m)(),c=null==u?void 0:u.TextEncoder;if(c){if("string"==typeof e)a=e,s=new c().encode(a).length;else if(e instanceof Blob)s=(a=e).size;else if(e instanceof URLSearchParams)a=e,s=new c().encode(a.toString()).length;else if(ArrayBuffer.isView(e))s=(a=e).byteLength;else if(e instanceof ArrayBuffer)s=(a=e).byteLength;else if(e instanceof FormData){var l=0,h=0;try{for(var d=(0,i.Ju)(e.entries()),f=d.next();!f.done;f=d.next()){var p=(0,i.zs)(f.value,2),g=p[0],v=p[1];if(l+=g.length,"string"==typeof v)l+=new c().encode(v).length;else{if(!(v instanceof Blob))return;l+=v.size}if(++h>=t)return}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}s=l}else if(e instanceof ReadableStream){a=e;return}return s}}var d=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null==(t=null==n?void 0:n.forEach)||t.call(n,function(e,t){r[t]=e}),v(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,n=null==(t=null==(e=this.response.headers)?void 0:e.get)?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){return(0,i.YH)(this,function(n){switch(n.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,p(n.sent(),e,t)]}})})},e}(),f=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){if(void 0===e&&(e=[]),!this.headersString)return{};var t,n,r={},o=this.headersString.split("\r\n");try{for(var s=(0,i.Ju)(o),a=s.next();!a.done;a=s.next()){var u=a.value,c=(0,i.zs)(u.split(": "),2),l=c[0],h=c[1];l&&h&&(r[l]=h)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return v(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,i.sH)(this,void 0,void 0,function(){var n;return(0,i.YH)(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?((0,a.D7)(n,e,t),[2,n]):[2,null]})})},e}();function p(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return(0,a.D7)(r,t,n),r}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(r||(r={}));var g="[REDACTED]",v=function(e,t){var n,o,s=t.allow,a=void 0===s?[]:s,c=t.strategy,l=void 0===c?r.REMOVE:c,h=(0,i.fX)([],(0,i.zs)(u.L),!1),d={};try{for(var f=(0,i.Ju)(Object.keys(e)),p=f.next();!p.done;p=f.next()){var v=p.value;!function(t){var n=t.toLowerCase();h.find(function(e){return e.toLowerCase()===n})?l===r.REDACT&&(d[t]=g):a.find(function(e){return e.toLowerCase()===n})?d[t]=e[t]:l===r.REDACT&&(d[t]=g)}(v)}}catch(e){n={error:e}}
1finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}return d},m=function(){function e(e,t,n,r,i,o,s,a,u,c,l){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=u,this.error=c,this.endTime=l}return e.prototype.toSerializable=function(){var e,t,n,r;return Object.fromEntries(Object.entries({type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null==(e=this.requestWrapper)?void 0:e.headers((0,i.fX)([],(0,i.zs)(u.j7),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(n=this.responseWrapper)?void 0:n.headers((0,i.fX)([],(0,i.zs)(u.j7),!1)),responseBodySize:null==(r=this.responseWrapper)?void 0:r.bodySize}).filter(function(e){var t=(0,i.zs)(e,2);return void 0!==(t[0],t[1])}))},e}(),y=function(e,t){void 0===t&&(t=(0,s.k)()),this.callback=e,this.id=t};function b(e){try{e()}catch(e){}}var S=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=(0,o.m)();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=(0,o.m)();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,u,c,l,h;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var d=null==(i=null==(r=null==(n=this.globalScope)?void 0:n.XMLHttpRequest)?void 0:r.prototype)?void 0:i.open,f=null==(a=null==(s=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:s.prototype)?void 0:a.send,p=null==(l=null==(c=null==(u=this.globalScope)?void 0:u.XMLHttpRequest)?void 0:c.prototype)?void 0:l.setRequestHeader;d&&f&&p&&this.observeXhr(d,f,p);var g=null==(h=this.globalScope)?void 0:h.fetch;g&&this.observeFetch(g),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(n){try{n.callback(e)}catch(e){b(function(){var n;null==(n=t.logger)||n.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){if(void 0!==o&&void 0!==s){var a,u,c,l,h="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(u=t.url,h=t.method):u=null==(a=null==t?void 0:t.toString)?void 0:a.call(t),u)try{var d=new URL(u);u="".concat(d.protocol,"//").concat(d.host).concat(d.pathname).concat(d.search).concat(d.hash)}catch(e){}h=(null==n?void 0:n.method)||h,r&&(c=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},c=0);var f=Math.floor(performance.now()-s),p=Math.floor(o+f),g=new m(e,h,o,o,u,n,c,f,r,l,p);this.triggerEventCallbacks(g)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null==(e=Date.now)?void 0:e.call(Date),durationStart:null==(t=null==performance?void 0:performance.now)?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return(0,i.sH)(t,void 0,void 0,function(){var t,o,s,a=this;return(0,i.YH)(this,function(i){switch(i.label){case 0:try{t=this.getTimestamps()}catch(e){b(function(){var t;return null==(t=a.logger)?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e(n,r)];case 2:return o=i.sent(),[3,4];case 3:return s=i.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new c(r):void 0,o?new d(o):void 0,s,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){b(function(){var t;return null==(t=a.logger)?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(o)return[2,o];throw s}})})})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null==(n=t.globalScope)?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){n instanceof Error&&"InvalidStateError"===n.name&&b(function(){var n;return null==(n=t.logger)?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var o=this.globalScope.XMLHttpRequest.prototype,s=this;o.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=(0,i.zs)(n,2),a=o[0],u=o[1];try{this.$$AmplitudeAnalyticsEvent=(0,i.Cl)({method:a,url:null==(e=null==u?void 0:u.toString)?void 0:e.call(u),headers:{}},s.getTimestamps())}catch(e){b(function(){var t;return null==(t=s.logger)?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return t.apply(this,n)},o.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,o=e.createXhrJsonParser(this,s),a=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new f(i.status,e,t?parseInt(t,10):void 0,o),r=i.$$AmplitudeAnalyticsEvent.headers,c=new l(a,r);u.status=i.status,s.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},c,n,void 0,u.startTime,u.durationStart)}catch(e){b(function(){var t;return null==(t=s.logger)?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),n.apply(i,t)},o.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(e){b(function(){var t;return null==(t=s.logger)?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}r.apply(this,[e,t])}}},e}())},57567:(e,t,n)=>{n.d(t,{IQ:()=>a});var r=n(58006),i=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}
1(),o=n(31654),s={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},a=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new i(e,t)}return e.prototype.subscribe=function(e,t,n){var r=(0,o.k)(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return -1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return(0,r.sH)(this,void 0,void 0,function(){var e,t=this;return(0,r.YH)(this,function(n){switch(n.label){case 0:if(this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5)return this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2];return[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null})):this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i,o=this;return(0,r.YH)(this,function(r){switch(r.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),o.sendCallback(e,t,"remote"),o.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return void 0!==(i=r.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(i))),null!==i.remoteConfig?this.sendCallback(e,i,"cache"):this.logger.debug("Remote config client skips sending c
1allback because cache is empty (first time user).")),[4,t];case 2:return r.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,r.sH)(this,void 0,void 0,function(){var n,i;return(0,r.YH)(this,function(r){switch(r.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}),r.label=1;case 1:return r.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return i=r.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,i,"remote"),this.storage.setConfig(i),[3,5];case 3:return r.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(i=r.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,i,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,i,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,r.sH)(this,void 0,void 0,function(){var n,i,o,a,u,c,l=this;return(0,r.YH)(this,function(h){switch(h.label){case 0:n=t/e,i={remoteConfig:null,lastFetch:new Date},o=function(i){var o,u,c,h,d,f;return(0,r.YH)(this,function(r){switch(r.label){case 0:o=!0,u=new AbortController,c=setTimeout(function(){return u.abort()},t),r.label=1;case 1:return r.trys.push([1,7,8,9]),[4,fetch(a.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:u.signal})];case 2:if((h=r.sent()).ok)return[3,4];return[4,h.text()];case 3:return d=r.sent(),a.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(h.status,": ").concat(d)),h.status===s.INVALID_API_KEY||h.status===s.FORBIDDEN?(a.logger.error("Remote config client fetch failed with ".concat(h.status,". Invalid API key; future fetches will be skipped.")),a.isLastFetchInvalidApiKey=!0,o=!1):h.status>=400&&h.status<500&&h.status!==s.RATE_LIMIT&&(o=!1),[3,6];case 4:return[4,h.json()];case 5:return[2,{value:{remoteConfig:r.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(f=r.sent())instanceof Error&&"AbortError"===f.name?a.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):a.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),f),[3,9];case 8:return clearTimeout(c),[7];case 9:if(!o)return[2,"break"];if(!(i<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(n))})];case 10:r.sent(),r.label=11;case 11:return[2]}})},a=this,u=0,h.label=1;case 1:if(!(u<e))return[3,4];return[5,o(u)];case 2:if("object"==typeof(c=h.sent()))return[2,c.value];if("break"===c)return[3,4];h.label=3;case 3:return u++,[3,1];case 4:return[2,i]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}()},63085:(e,t,n)=>{n.d(t,{m:()=>r});var r=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0}},63880:(e,t,n)=>{n.d(t,{E:()=>o});var r=n(93056),i="__AMPLITUDE_BACKGROUND_CAPTURE__";function o(e,t){var n;if(!0!==e[i]){e[i]=!0;var o=null!=(n=null==t?void 0:t.scriptUrl)?n:r.O9,s=null,a=function(t,n){var r,i;"background-capture-complete"===t&&(null==(i=null==(r=e.logger)?void 0:r.debug)||i.call(r,"Background capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",function(){null==(n=null==(t=e.logger)?void 0:t.debug)||n.call(t,"Initializing background capture (external script)");
1var t,n,r=new URL(o,e.endpoint).toString();e.loadScriptOnce(r).then(function(){var t,n,r;null==(n=null==(t=e.logger)?void 0:t.debug)||n.call(t,"Background capture script loaded (external)"),s=null==(r=null==window?void 0:window.amplitudeBackgroundCapture)?void 0:r.call(window,{messenger:e,onBackgroundCapture:a}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null==(t=e.logger)||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null==(e=null==s?void 0:s.close)||e.call(s),s=null})}}},64520:(e,t,n)=>{n.d(t,{e:()=>o});var r=n(58006),i=n(98791),o=function(){function e(){this.name="identity",this.type="before",this.identityStore=(0,i.w$)().identityStore}return e.prototype.execute=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t;return(0,r.YH)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(t){return e.instanceName&&(this.identityStore=(0,i.w$)(e.instanceName).identityStore),[2]})})},e}()},66415:(e,t,n)=>{n.d(t,{V:()=>o});var r=n(12949),i="Amplitude Logger ",o=function(){function e(){this.logLevel=r.$.None}return e.prototype.disable=function(){this.logLevel=r.$.None},e.prototype.enable=function(e){void 0===e&&(e=r.$.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.$.Verbose||console.log("".concat(i,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.$.Warn||console.warn("".concat(i,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.$.Error||console.error("".concat(i,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<r.$.Debug||console.log("".concat(i,"[Debug]: ").concat(e.join(" ")))},e}()},70637:(e,t,n)=>{n.d(t,{Ql:()=>u,TS:()=>a,vG:()=>c});var r=n(5822),i=n(66415),o=n(12949),s=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:r.e5,logLevel:o.$.Warn,loggerProvider:new i.V,offline:!1,optOut:!1,serverUrl:r.mJ,serverZone:"US",useBatch:!1}},a=function(){function e(e){this._optOut=!1;var t,n,r,i,o=s();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!=(n=e.logLevel)?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!=(r=e.optOut)?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!=(i=e.useBatch)?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=u(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),u=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=s().serverZone),void 0===n&&(n=s().useBatch),e)return{serverUrl:e,serverZone:void 0};var i,o=["US","EU"].includes(t)?t:s().serverZone;return{serverZone:o,serverUrl:(i=n,"EU"===o?i?r.OP:r.bu:i?r.pL:r.mJ)}},c=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}()},77223:(e,t,n)=>{n.d(t,{s:()=>i});var r=n(58006),i=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,r.sH)(this,void 0,void 0,function(){var t,n,i;return(0,r.YH)(this,function(r){switch(r.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),i="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,n.set(i,t)];case 2:return r.sent(),[4,n.get(i)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,n.remove(i)];case 6:return r.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,r.sH)(this,void 0,void 0,function(){var t;return(0,r.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(n){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(r){try{null==(n=this.storage)||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(n){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,r.sH)(this,void 0,void 0,function(){return(0,r.YH)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}()},80073:(e,t,n)=>{n.d(t,{Z:()=>r});var r=function(){if("undefined"==typeof navigator)return"";var e,t,n,r,i=navigator.userLanguage;return null!=(r=null!=(n=null!=(t=null==(e=navigator.languages)?void 0:e[0])?t:navigator.language)?n:i)?r:""}}
1,82562:(e,t,n)=>{n.d(t,{F:()=>i});var r=n(5822),i=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[r.r,t,e.substring(0,n)].filter(Boolean).join("_")}},88162:(e,t,n)=>{n.d(t,{Z:()=>l});var r,i=n(58006),o=n(63085),s=n(93056),a="__AMPLITUDE_MESSENGER_INSTANCE__",u="__AMPLITUDE_MESSENGER__",c=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?s.l:t;this[r]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(r=window.opener)?void 0:r.postMessage)||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),n.timeout>0&&setTimeout(function(){s(Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.registerActionHandler=function(e,t){this.actionHandlers.has(e)&&(null==(s=null==(o=this.logger)?void 0:o.warn)||s.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var n,r,o,s,a=this.pendingMessages.get(e);if(a){this.pendingMessages.delete(e);try{for(var u=(0,i.Ju)(a),c=u.next();!c.done;c=u.next()){var l=c.value;t(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return(0,i.sH)(this,void 0,void 0,function(){var t,n,r;return(0,i.YH)(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=(document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),null==(r=document.head)||r.appendChild(i)}catch(e){n(e)}})).then(function(){}),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}})})},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,a=i.endpoint;o&&(this.logger=o),a&&this.endpoint===s.l&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Setting up messenger"),this.messageHandler=function(e){if(null==(n=null==(t=r.logger)?void 0:t.debug)||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var t,n,i,o,s,a=e.data,u=null==a?void 0:a.action;if(u)if("id"in a&&a.id)null==(o=null==(i=r.logger)?void 0:i.debug)||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(a);else{if("ping"===u)return void r.notify({action:"pong"});var c=r.actionHandlers.get(u);if(c)c(a.data);else{var l=null!=(s=r.pendingMessages.get(u))?s:[];l.push(a.data),r.pendingMessages.set(u,l)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=(0,o.m)();(null==e?void 0:e[u])===this&&delete e[u]},e}();function l(e){var t=(0,o.m)(),n=null==t?void 0:t[u];
1if("object"==typeof n&&null!==n&&a in n&&!0===n[a])return n;var r=new c(e);return t&&(t[u]=r),r}r=a},93056:(e,t,n)=>{n.d(t,{O9:()=>o,ht:()=>i,l:()=>r});var r="https://app.amplitude.com",i={US:r,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},o="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.2.js.gz"},98791:(e,t,n)=>{n.d(t,{rb:()=>a,w$:()=>o,yo:()=>s});var r=n(64777),i=n(5822),o=function(e){return void 0===e&&(e=i.e5),r.i.getInstance(e)},s=function(e,t){o(t).identityStore.editIdentity().setUserId(e).commit()},a=function(e,t){o(t).identityStore.editIdentity().setDeviceId(e).commit()}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.