PageSourceSearch

https://osmaps.com/_next/static/chunks/827-f43a1de41e584215.js

js osmaps.com collected 2026-09-24 09:00:09 UTC 900,436 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[827],{8743:(e,t,r)=>{"use strict";let n;r.r(t),r.d(t,{AmplitudeBrowser:()=>oM,Identify:()=>ew.T$,Revenue:()=>eT,Types:()=>b,_enableRequestBodyCompressionExperimental:()=>o8,_setDiagnosticsSampleRate:()=>o6,add:()=>oU,createInstance:()=>oD,extendSession:()=>oq,flush:()=>oH,getDeviceId:()=>oF,getIdentity:()=>oj,getOptOut:()=>oz,getSessionId:()=>oB,getUserId:()=>oK,groupIdentify:()=>oG,identify:()=>oY,init:()=>oV,logEvent:()=>oW,remove:()=>oJ,reset:()=>o$,revenue:()=>oQ,runQueuedFunctions:()=>eG,setDeviceId:()=>oX,setGroup:()=>oZ,setIdentity:()=>o0,setOptOut:()=>o1,setSessionId:()=>o2,setTransport:()=>o3,setUserId:()=>o4,track:()=>o5});var o,i,a,s,c,l,u,d,p,h,f,g,v,m,y,b={};r.r(b),r.d(b,{DEFAULT_ACTION_CLICK_ALLOWLIST:()=>rs,DEFAULT_CSS_SELECTOR_ALLOWLIST:()=>ri,DEFAULT_DATA_ATTRIBUTE_PREFIX:()=>ra,EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:()=>tS,IdentifyOperation:()=>a,LogLevel:()=>o,OfflineDisabled:()=>ec,RevenueProperty:()=>c,ServerZone:()=>y,SpecialEventType:()=>s});var w=r(72881);!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(o||(o={}));var E=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},S=function(e){return function(){var t=(0,w.Cl)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},C=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var o=(0,w.Ju)(t.split(".")),i=o.next();!i.done;i=o.next()){var a=i.value;if(!(a in e))return;e=e[a]}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return e},_=function(e,t){return function(){var r,n,o={};try{for(var i=(0,w.Ju)(t),a=i.next();!a.done;a=i.next()){var s=a.value;o[s]=C(e,s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o}},T=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var c=r(),l=c.logger,u=c.logLevel;if(u&&u<o.Debug||!u||!l)return e.apply(i,a);var d={type:"invoke public method",name:t,args:a,stacktrace:E(1),time:{start:new Date().toISOString()},states:{}};n&&d.states&&(d.states.before=n());var p=e.apply(i,a);return p&&p.promise?p.promise.then(function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))}):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))),p}},I=function(e,t){return(I=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function k(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var A=function(){return(A=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function x(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function R(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function P(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function O(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function M(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create;var D=("function"==typeof SuppressedError&&SuppressedError,function(e){return{promise:e||Promise.resolve()}}),L="Amplitude Logger ",U=function(){function e(){this.logLevel=o.None}return e.prototype.disable=function(){this.logLevel=o.None},e.prototype.enable=function(e){void 0===e&&(e=o.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<o.Verbose||console.log("".concat(L,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<o.Warn||console.warn("".concat(L,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<o.Error||console.error("".concat(L,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<o.Debug||console.log("".concat(L,"[Debug]: ").concat(e.join(" ")))},e}(),q=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 r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.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}(),H=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!==r.g?r.g:void 0},F=(0,w.fX)([],(0,w.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),j=function(e){var t,r=H();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,j);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,(0,w.fX)([],(0,w.zs)(n.entries()),!1).map(function(e){var t=(0,w.zs)(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(F[n]):F[n]}).join("")},z={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},B=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new q(e,t)}return e.prototype.subscribe=function(e,t,r){var n=j(),o={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(o),"all"===t?this.subscribeAll(o):this.subscribeWaitForRemote(o,t.timeout),n},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,w.sH)(this,void 0,void 0,function(){var e,t=this;return(0,w.YH)(this,function(r){switch(r.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=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;
1return 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,w.sH)(this,void 0,void 0,function(){var t,r,n,o=this;return(0,w.YH)(this,function(i){switch(i.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)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending c
1allback because cache is empty (first time user).")),[4,t];case 2:return i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,w.sH)(this,void 0,void 0,function(){var r,n;return(0,w.YH)(this,function(o){switch(o.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),o.label=1;case 1:return o.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=o.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return o.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!==(n=o.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=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(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,w.sH)(this,void 0,void 0,function(){var r,n,o,i,a,s,c=this;return(0,w.YH)(this,function(l){switch(l.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},o=function(n){var o,a,s,l,u,d;return(0,w.YH)(this,function(p){switch(p.label){case 0:o=!0,a=new AbortController,s=setTimeout(function(){return a.abort()},t),p.label=1;case 1:return p.trys.push([1,7,8,9]),[4,fetch(i.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:a.signal})];case 2:if((l=p.sent()).ok)return[3,4];return[4,l.text()];case 3:return u=p.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(u)),l.status===z.INVALID_API_KEY||l.status===z.FORBIDDEN?(i.logger.error("Remote config client fetch failed with ".concat(l.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,o=!1):l.status>=400&&l.status<500&&l.status!==z.RATE_LIMIT&&(o=!1),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:p.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=p.sent())instanceof Error&&"AbortError"===d.name?i.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):i.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(s),[7];case 9:if(!o)return[2,"break"];if(!(n<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})];case 10:p.sent(),p.label=11;case 11:return[2]}})},i=this,a=0,l.label=1;case 1:if(!(a<e))return[3,4];return[5,o(a)];case 2:if("object"==typeof(s=l.sent()))return[2,s.value];if("break"===s)return[3,4];l.label=3;case 3:return a++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}(),K={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},G={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Y=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=H())||void 0===e?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.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,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(K.TAGS)||e.createObjectStore(K.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(K.COUNTERS)||e.createObjectStore(K.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(K.HISTOGRAMS)||e.createObjectStore(K.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains(K.EVENTS)||e.createObjectStore(K.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(K.INTERNAL)||e.createObjectStore(K.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n,o=this;return(0,w.YH)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=i.sent().transaction([K.TAGS],"readwrite")).objectStore(K.TAGS),[2,new Promise(function(n){var i=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),n()}
1,i.forEach(function(e){var t=(0,w.zs)(e,2),n=t[0],i=t[1];r.put({key:n,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",n,i,e)}})})];case 2:return n=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",n),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n,o=this;return(0,w.YH)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=i.sent().transaction([K.COUNTERS],"readwrite")).objectStore(K.COUNTERS),[2,new Promise(function(n){var i=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),n()},i.forEach(function(e){var t=(0,w.zs)(e,2),n=t[0],i=t[1],a=r.get(n);a.onsuccess=function(){var e=a.result,t=e?e.value:0;r.put({key:n,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},a.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}})})];case 2:return n=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",n),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n,o=this;return(0,w.YH)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=i.sent().transaction([K.HISTOGRAMS],"readwrite")).objectStore(K.HISTOGRAMS),[2,new Promise(function(n){var i=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),n()},i.forEach(function(e){var t=(0,w.zs)(e,2),n=t[0],i=t[1],a=r.get(n);a.onsuccess=function(){var e,t=a.result;e=t?{key:n,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:n,count:i.count,min:i.min,max:i.max,sum:i.sum},r.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},a.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}})})];case 2:return n=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n,o=this;return(0,w.YH)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return r=(t=i.sent().transaction([K.EVENTS],"readwrite")).objectStore(K.EVENTS),[2,new Promise(function(n){t.oncomplete=function(){n()},t.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),n()};var i=r.count();i.onsuccess=function(){var t=Math.max(0,10-i.result);t<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){r.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return n=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",n),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,w.sH)(this,void 0,void 0,function(){var r,n,o;return(0,w.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(r=i.sent().transaction([K.INTERNAL],"readwrite")).objectStore(K.INTERNAL),[2,new Promise(function(o,i){r.onabort=function(){return i(Error("Failed to set internal value"))};var a=n.put({key:e,value:t});a.onsuccess=function(){return o()},a.onerror=function(){return i(Error("Failed to set internal value"))}})];case 2:return o=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n;return(0,w.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(t=o.sent().transaction([K.INTERNAL],"readonly")).objectStore(K.INTERNAL),[2,new Promise(function(n,o){t.onabort=function(){return o(Error("Failed to get internal value"))};var i=r.get(e);i.onsuccess=function(){return n(i.result)},i.onerror=function(){return o(Error("Failed to get internal value"))}})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",n),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,w.sH)(this,void 0,void 0,function(){var e,t;return(0,w.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(G.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.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,w.sH)(this,void 0,void 0,function(){var t;return(0,w.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(G.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.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(r,n){var o=e.objectStore(t).clear();o.onsuccess=function(){return r()},o.onerror=function(){return n(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,w.sH)(this,void 0,void 0,function(){var e,t,r,n,o,i,a;return(0,w.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=s.sent().transaction([K.TAGS,K.COUNTERS,K.HISTOGRAMS,K.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(e,K.TAGS),this.getAllFromStore(e,K.COUNTERS),this.getAllFromStore(e,K.HISTOGRAMS),this.getAllFromStore(e,K.EVENTS)])];case 2:return r=(t=w.zs.apply(void 0,[s.sent(),4]))[0],n=t[1],o=t[2],i=t[3],[4,Promise.all([this.clearTable(e,K.COUNTERS),this.clearTable(e,K.HISTOGRAMS),this.clearTable(e,K.EVENTS)])];case 3:return s.sent(),[2,{tags:r,counters:n,histogramStats:o,events:i}];case 4:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(r,n){var o=e.objectStore(t).getAll();o.onsuccess=function(){return r(o.result)},o.onerror=function(){return n(Error("Failed to get all from ".concat(t)))}})},e}(),V=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t}
1,W=function(e,t){return 31*Math.abs(V(e.toString()))%1e5/1e5<t},J=function(){var e=H();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},$=function(e){var t=H();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent("sdk.error.uncaught",(0,w.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,n=null==t?void 0:t.stack,o=Q({filename:e.filename,stack:n});o&&r({type:"error",message:e.message,stack:n,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:o}})},!0),t.addEventListener("unhandledrejection",function(e){var t,n=e.reason instanceof Error?e.reason:void 0,o=null==n?void 0:n.stack,i=X(o),a=Q({filename:i,stack:o});a&&r({type:"unhandledrejection",message:null!==(t=null==n?void 0:n.message)&&void 0!==t?t:Z(e.reason),stack:o,filename:i,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:a}})},!0)}},Q=function(e){var t,r,n=J();if(0!==n.length)try{for(var o=(0,w.Ju)(n),i=o.next();!i.done;i=o.next()){var a=i.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{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},X=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Z=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},ee=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?"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(n,null,2)),this.config=(0,w.Cl)({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=W(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Y.isSupported()?this.storage=new Y(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),$(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){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}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){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}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){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.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){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}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,w.sH)(this,void 0,void 0,function(){var e,t,r,n;return(0,w.YH)(this,function(o){switch(o.label){case 0:if(!this.storage)return[2];return e=(0,w.Cl)({},this.inMemoryTags),t=(0,w.Cl)({},this.inMemoryCounters),r=(0,w.Cl)({},this.inMemoryHistograms),n=(0,w.fX)([],(0,w.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(r),this.storage.addEventRecords(n)])];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return(0,w.sH)(this,void 0,void 0,function(){var e,t,r,n,o,i,a,s,c,l;return(0,w.YH)(this,function(u){switch(u.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return u.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=u.sent()).tags,r=e.counters,n=e.histogramStats,o=e.events,this.storage.setLastFlushTimestamp(Date.now()),i={},t.forEach(function(e){i[e.key]=e.value}),a={},r.forEach(function(e){a[e.key]=e.value}),s={}
1,n.forEach(function(e){s[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(s).length&&0===c.length)return[2];return l={tags:i,histogram:s,counters:a,events:c},this.fetch(l),[2]}})})},e.prototype.fetch=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t;return(0,w.YH)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!H())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(!r.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=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,w.sH)(this,void 0,void 0,function(){var e,t,r;return(0,w.YH)(this,function(n){switch(n.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=n.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(r=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-r),[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=W(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),et=function(){var e,t=H();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var r=t.split("=",2),n=er(r[0]),o=er(r[1]);return o&&(e[n]=o),e},{}):{}},er=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},en=r(10280),eo=r(24739),ei=function(e){return void 0===e&&(e=eo.e5),en.i.getInstance(e)},ea=function(e,t){ei(t).identityStore.editIdentity().setUserId(e).commit()},es=function(e,t){ei(t).identityStore.editIdentity().setDeviceId(e).commit()},ec=null;!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(i||(i={}));var el=function(e,t){var r=Math.max(t,1);return e.reduce(function(e,t,n){var o=Math.floor(n/r);return e[o]||(e[o]=[]),e[o].push(t),e},[])},eu=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=i.Unknown),{event:e,code:t,message:r}},ed=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:eo.e5,logLevel:o.Warn,loggerProvider:new U,offline:!1,optOut:!1,serverUrl:eo.mJ,serverZone:"US",useBatch:!1}},ep=function(){function e(e){this._optOut=!1;var t,r,n,o,i=ed();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:i.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||i.flushQueueSize,this.instanceName=e.instanceName||i.instanceName,this.loggerProvider=e.loggerProvider||i.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:i.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:i.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||i.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(o=e.useBatch)&&void 0!==o?o:i.useBatch,this.loggerProvider.enable(this.logLevel);var a=eh(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}
1,enumerable:!1,configurable:!0}),e}(),eh=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=ed().serverZone),void 0===r&&(r=ed().useBatch),e)return{serverUrl:e,serverZone:void 0};var n,o=["US","EU"].includes(t)?t:ed().serverZone;return{serverZone:o,serverUrl:(n=r,"EU"===o?n?eo.OP:eo.bu:n?eo.pL:eo.mJ)}},ef=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function eg(e){return e>=200&&e<300}var ev=new Set([eo.mJ,eo.bu,eo.pL,eo.OP]);function em(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var ey=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,w.sH)(this,void 0,void 0,function(){var r,n=this;return(0,w.YH)(this,function(o){switch(o.label){case 0:return this.config=e,this.storageKey="".concat(eo.fS,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=o.sent())&&r.length>0&&Promise.all(r.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=j()),new Promise(function(r){t.queue.push({event:e,attempts:0,callback:function(e){return r(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},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,"Event rejected due to exceeded retry count"),!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,w.sH)(this,void 0,void 0,function(){var t,r,n=this;return(0,w.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=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),[4,el(t,this.config.flushQueueSize).reduce(function(t,r){return(0,w.sH)(n,void 0,void 0,function(){return(0,w.YH)(this,function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}})})},Promise.resolve())];case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),(0,w.sH)(this,void 0,void 0,function(){var n,o,a,s,c;return(0,w.YH)(this,function(l){var u,d,p;switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,w.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 ef,l.label=1;case 1:return l.trys.push([1,3,,4]),u=o=eh(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(d=this.config.enableRequestBodyCompression)&&(d=!1),a=!!ev.has(u)||d,[4,this.config.transportProvider.send(o,n,this.config._enableRequestBodyCompressionExperimental&&a)];case 2:if(null===(s=l.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(em(s))):this.fulfillRequest(e,s.statusCode,s.status),[2];return this.handleResponse(s,e),[3,4];case 3:return c=(p=l.sent())instanceof Error?p.message:String(p),this.config.loggerProvider.error(c),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:c,stack_trace:E()}),this.handleResponse({status:i.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){eg(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:em(e),stack_trace:E()});var r,n=e.status;switch(n){case i.Success:this.handleSuccessResponse(e,t);break;case i.Invalid:this.handleInvalidResponse(e,t);break;case i.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case i.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key")){this.fulfillRequest(t,e.statusCode,e.body.error);return}var n=new Set((0,w.fX)((0,w.fX)((0,w.fX)((0,w.fX)([],(0,w.zs)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,w.zs)(Object.values(e.body.eventsWithMissingFields)),!1),(0,w.zs)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,w.zs)(e.body.silencedEvents),!1).flat()),o=t.filter(function(t,o){if(n.has(o)){r.fulfillRequest([t],e.statusCode,e.body.error);return}return!0});o.length>0&&this.config.loggerProvider.warn(em(e));
1var i=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(i)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length){this.fulfillRequest(t,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(em(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),o=Object.keys(e.body.exceededDailyQuotaDevices),i=e.body.throttledEvents,a=new Set(n),s=new Set(o),c=new Set(i),l=t.filter(function(t,n){if(t.event.user_id&&a.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)){r.fulfillRequest([t],e.statusCode,e.body.error);return}return c.has(n)&&(t.timeout=r.throttleTimeout),!0});l.length>0&&this.config.loggerProvider.warn(em(e));var u=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(u)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){var n,o,i;eg(t)?null===(i=this.diagnosticsClient)||void 0===i||i.increment("analytics.events.sent",e.length):(null===(n=this.diagnosticsClient)||void 0===n||n.increment("analytics.events.dropped",e.length),null===(o=this.diagnosticsClient)||void 0===o||o.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:r,stack_trace:E()})),this.removeEvents(e),e.forEach(function(e){return e.callback(eu(e.event,t,r))})},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}(),eb=function(){function e(){this.name="identity",this.type="before",this.identityStore=ei().identityStore}return e.prototype.execute=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t;return(0,w.YH)(this,function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(t){return e.instanceName&&(this.identityStore=ei(e.instanceName).identityStore),[2]})})},e}(),ew=r(80048);!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"}(a||(a={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={}));var eE=function(e,t){return(0,w.Cl)((0,w.Cl)({},t),{event_type:s.IDENTIFY,user_properties:e.getUserProperties()})},eS=function(e,t,r,n){var o;return(0,w.Cl)((0,w.Cl)({},n),{event_type:s.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:((o={})[e]=t,o)})},eC=function(e,t,r){var n,o=new ew.T$;return o.set(e,t),(0,w.Cl)((0,w.Cl)({},r),{event_type:s.IDENTIFY,user_properties:o.getUserProperties(),groups:((n={})[e]=t,n)})},e_=r(75754),eT=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,e_.a)(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,w.Cl)({},this.properties):{};return e[c.REVENUE_PRODUCT_ID]=this.productId,e[c.REVENUE_QUANTITY]=this.quantity,e[c.REVENUE_PRICE]=this.price,e[c.REVENUE_TYPE]=this.revenueType,e[c.REVENUE_CURRENCY]=this.currency,e[c.REVENUE]=this.revenue,e[c.RECEIPT]=this.receipt,e[c.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"}(c||(c={}));var eI=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},ek=r(32280),eA=r.n(ek)()||ek,ex=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var r,n;return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(o){switch(o.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=j(),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!==(r=e.type)&&void 0!==r?r:"enrichment",[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)];case 1:return o.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var r;return(0,w.sH)(this,void 0,void 0,function(){var n,o;return(0,w.YH)(this,function(i){switch(i.label){case 0:if(-1===(n=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[n],this.plugins.splice(n,1),[4,null===(r=o.teardown)||void 0===r?void 0:r.call(o)];case 1:return i.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?void 0:t.call(e)}),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(r){t.queue.push([e,r]),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,w.sH)(this,void 0,void 0,function(){var t,r,n,o,i,a,s,c,l,u,d,p,h,f,g;return(0,w.YH)(this,function(v){switch(v.label){case 0:if(!e)return[2];t=(0,w.zs)(e,1)[0],r=(0,w.zs)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),n=this.plugins.filter(function(e){return"before"===e.type}),v.label=1;case 1:v.trys.push([1,6,7,8]),i=(o=(0,w.Ju)(n)).next(),v.label=2;case 2:if(i.done)return[3,5];if(!(a=i.value).execute)return[3,4];return[4,a.execute((0,w.Cl)({},t))];case 3:if(null===(s=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),v.label=4;case 4:return i=o.next(),[3,2];case 5:return[3,8];case 6:return p={error:v.sent()},[3,8];case 7:try{i&&!i.done&&(h=o.return)&&h.call(o)}finally{if(p)throw p.error}
1return[7];case 8:c=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),v.label=9;case 9:v.trys.push([9,14,15,16]),u=(l=(0,w.Ju)(c)).next(),v.label=10;case 10:if(u.done)return[3,13];if(!(a=u.value).execute)return[3,12];return[4,a.execute((0,w.Cl)({},t))];case 11:if(null===(s=v.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),v.label=12;case 12:return u=l.next(),[3,10];case 13:return[3,16];case 14:return f={error:v.sent()},[3,16];case 15:try{u&&!u.done&&(g=l.return)&&g.call(l)}finally{if(f)throw f.error}return[7];case 16:return d=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(d.map(function(e){var r=(0,w.Cl)({},t);return e.execute(r).catch(function(e){return eu(r,0,String(e))})})).then(function(e){var n=(0,w.zs)(e,1)[0]||eu(t,100,"Event not tracked, no destination plugins on the instance");r(n)}),[2]}})})},e.prototype.flush=function(){return(0,w.sH)(this,void 0,void 0,function(){var e,t=this;return(0,w.YH)(this,function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return r.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return r.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 r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n,o,i,a;return(0,w.YH)(this,function(s){switch(s.label){case 0:s.trys.push([0,7,8,9]),r=(t=(0,w.Ju)(this._optOutListeners)).next(),s.label=1;case 1:if(r.done)return[3,6];n=r.value,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n(e)];case 3:return s.sent(),[3,5];case 4:return o=s.sent(),this.loggerProvider.error("Error calling optOut listener",o),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return i={error:s.sent()},[3,9];case 8:try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)})},e}(),eR=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 ex(this),this.name=e}return e.prototype._init=function(e){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.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,w.sH)(this,void 0,void 0,function(){var t,r,n,o,i,a;return(0,w.YH)(this,function(s){switch(s.label){case 0:t=this[e],this[e]=[],s.label=1;case 1:s.trys.push([1,8,9,10]),n=(r=(0,w.Ju)(t)).next(),s.label=2;case 2:if(n.done)return[3,7];if(!((o=(0,n.value)())&&"promise"in o))return[3,4];return[4,o.promise];case 3:return s.sent(),[3,6];case 4:return[4,o];case 5:s.sent(),s.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return i={error:s.sent()},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}
1return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:s.sent(),s.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,r){var n=(0,w.Cl)((0,w.Cl)((0,w.Cl)({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t});return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),D(this.dispatch(n))},e.prototype.identify=function(e,t){var r=eE(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),D(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var o=eS(e,t,r,n);return D(this.dispatch(o))},e.prototype.setGroup=function(e,t,r){var n=eC(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),D(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=(0,w.Cl)((0,w.Cl)({},t),{event_type:s.REVENUE,event_properties:e.getEventProperties()});return D(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),D())},e.prototype._addPlugin=function(e){return D(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)),D())},e.prototype._removePlugin=function(e){return D(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(eu(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t=this;return(0,w.YH)(this,function(r){return this.isReady?[2,this.process(e)]:[2,new Promise(function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,r=null!==(t=this.userProperties)&&void 0!==t?t:{},n=(0,w.Cl)({},r);if(void 0===e)return n;var o={};return Object.keys(e).forEach(function(t){Object.values(a).includes(t)||(o[t]=e[t])}),ew.Se.forEach(function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case a.CLEAR_ALL:Object.keys(n).forEach(function(e){delete n[e]});break;case a.UNSET:Object.keys(r).forEach(function(e){delete n[e]});break;case a.SET:Object.assign(n,r)}}}),Object.assign(n,o),n},e.prototype.process=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r;return(0,w.YH)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),this.config.optOut)return[2,eu(e,0,"Event skipped due to optOut config")];return e.event_type===s.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)];case 1:return 200===(t=n.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 r=String(n.sent()),this.config.loggerProvider.error(r),[2,t=eu(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!e));return}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 D(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});if(void 0===t){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e));return}return t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),eP=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},eO=function(e){return eP(e,"attribution")},eN=function(e){return eP(e,"formInteractions")},eM=function(e){return eP(e,"pageViews")},eD=function(e){return eP(e,"sessions")},eL=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},eU=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},eq=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},eH=function(e){if(eU(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},eF=function(e){if(eq(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},ej=function(e){var t;if(eL(e.autocapture)){var r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.
1networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),A(A({},r),{captureRules:null===(t=null==r?void 0:r.captureRules)||void 0===t?void 0:t.map(function(t){var r,n,o;if((null===(r=t.urls)||void 0===r?void 0:r.length)&&(null===(n=t.hosts)||void 0===n?void 0:n.length)){var i=JSON.stringify(t.hosts),a=JSON.stringify(t.urls);return null===(o=e.loggerProvider)||void 0===o||o.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(i,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),A(A({},t),{hosts:void 0})}return t})})}},ez=function(e){var t,r=function(){return!1},n=void 0,o=e.pageCounter;return eM(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:o}},eB=function(e){return eO(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?A({},e.defaultTracking.attribution):{}},eK=function(e){if(eN(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},eG=function(e,t){eY(e,t)},eY=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],o=n.name,i=n.args,a=n.resolve,s=e&&e[o];if("function"==typeof s){var c=s.apply(e,i);"function"==typeof a&&a(null==c?void 0:c.promise)}}return e},eV=function(e){return e&&void 0!==e._q},eW=function(){if("undefined"==typeof navigator)return"";var e,t,r,n,o=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:o)&&void 0!==n?n:""},eJ="2.36.9",e$="amplitude-ts",eQ=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(e$,"/").concat(eJ),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,r;return R(this,void 0,void 0,function(){var n,o,i;return P(this,function(a){return n=new Date().getTime(),o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,i=null!==(r=e.event_id)&&void 0!==r?r:o+1,this.config.lastEventId=i,e.time||(this.config.lastEventTime=n),[2,A(A(A(A(A(A(A(A({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:eW()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:j(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:i,library:this.library,user_agent:this.userAgent})]})})},e}(),eX=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t;return(0,w.YH)(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(r){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),eZ=function(){var e,t=H();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks},e0=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,w.Cl)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n,o=this;return(0,w.YH)(this,function(i){switch(i.label){case 0:return t="AMP_TEST",r=new e((0,w.Cl)({},this.options)),n=String(Date.now()),[4,r.transaction(t,function(e){var r,i;try{e.set(n);var a=e.get()===n;return!a&&o.config.diagnosticsClient&&(null===(r=o.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:n,sync:!0})),a}catch(e){if(o.config.diagnosticsClient){var s=e instanceof Error?e.message:String(e);null===(i=o.config.diagnosticsClient)||void 0===i||i.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:n,error:s,sync:!0})}return!1}
1finally{e.set(null)}})];case 1:return[2,i.sent()]}})})},e.prototype.get=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t;return(0,w.YH)(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:return t=r.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var r=e3(t);if(void 0===r){console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t));return}return JSON.parse(r)}catch(r){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,r;return(0,w.sH)(this,void 0,void 0,function(){var n,o,i,a,s,c,l,u;return(0,w.YH)(this,function(d){switch(d.label){case 0:n=H(),d.label=1;case 1:if(d.trys.push([1,4,,5]),!(o=null==n?void 0:n.cookieStore))return[3,3];return[4,o.getAll(e)];case 2:if(i=d.sent()){i.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:i.map(function(e){return e.domain})}),null===(r=this.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(s=(a=(0,w.Ju)(i)).next();!s.done;s=a.next())if(c=s.value,e4(c.domain,this.options.domain))return[2,c.value]}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=a.return)&&u.call(a)}finally{if(l)throw l.error}}}d.label=3;case 3:return[3,5];case 4:return d.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,r,n=this,o=H(),i=(null!==(r=null===(t=null==o?void 0:o.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==r?r:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&i.length>1&&(a=i.find(function(t){var r;try{var o=s(t.substring(e.length+1));return o||null===(r=n.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.document.cookie"),o}catch(e){return!1}})),a||(a=i[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(r){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var r;try{var n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,o=null!==t?n:-1,i=void 0;if(o){var a=new Date;a.setTime(a.getTime()+864e5*o),i=a}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));i&&(s+="; expires=".concat(i.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite));var c=H();(null==c?void 0:c.document)&&(c.document.cookie=s)}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,w.sH)(this,void 0,void 0,function(){return(0,w.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,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,w.sH)(this,void 0,void 0,function(){var r,n;return(0,w.YH)(this,function(o){switch(o.label){case 0:if(e.cachedTlds[t])return[2,!0];r="AMP_TLDTEST",n=new e({domain:"."+t}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.transaction(r,function(r){if(e.cachedTlds[t])return!0;try{r.set(1);var n=!!r.get();return n&&(e.cachedTlds[t]=!0),n}finally{r.set(null)}})];case 2:return[2,!!o.sent()];case 3:return o.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return(0,w.sH)(this,void 0,void 0,function(){var r,n,o=this;return(0,w.YH)(this,function(i){switch(i.label){case 0:if(r=eZ(),n=function(){return t({get:function(){return o.getSync(e)},set:function(t){return o.setSync(e,t)}})},!r)return[2,n()];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.request("com.amplitude:cookie-lock:".concat(e),n)];case 2:return[2,i.sent()];case 3:return i.sent(),[2,n()];case 4:return[2]}})})},e.cachedTlds={},e}(),e1=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},e2=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},e3=function(e){var t;return null!==(t=e1(e))&&void 0!==t?t:e2(e)},e4=function(e,t){if(""===e&&""===t)return!0;
1if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},e5=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[eo.r,t,e.substring(0,r)].filter(Boolean).join("_")},e6=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n;return(0,w.YH)(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return o.sent(),[4,r.get(n)];case 3:return[2,o.sent()===t];case 4:return o.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return o.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t;return(0,w.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=r.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return r.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,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var r;return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},e}(),e8=function(e){function t(t){var r,n,o,i=this;try{o=null===(r=H())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),o=void 0}return(i=e.call(this,o)||this).loggerProvider=null==t?void 0:t.loggerProvider,i}return k(t,e),t.prototype.set=function(t,r){var n;return R(this,void 0,void 0,function(){var o;return P(this,function(i){switch(i.label){case 0:if(!(Array.isArray(r)&&r.length>1e3))return[3,2];return o=r.length-1e3,[4,e.prototype.set.call(this,t,r.slice(0,1e3))];case 1:return i.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:i.sent(),i.label=4;case 4:return[2]}})})},t}(e6),e7=function(e){function t(){var t;return e.call(this,null===(t=H())||void 0===t?void 0:t.sessionStorage)||this}return k(t,e),t}(e6);function e9(){return"undefined"!=typeof CompressionStream}function te(e){return(0,w.sH)(this,void 0,void 0,function(){var t;return(0,w.YH)(this,function(r){switch(r.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,new Response(new Blob([e]).stream().pipeThrough(new t("gzip"))).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var tt=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,r,n,o,a,s,c,l,u,d,p,h,f,g,v,m,y,b,w,E,S,C,_=e.code||0,T=this.buildStatus(_);switch(T){case i.Success:return{status:T,statusCode:_,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case i.Invalid:return{status:T,statusCode:_,body:{error:null!==(o=e.error)&&void 0!==o?o:"",missingField:null!==(a=e.missing_field)&&void 0!==a?a:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(c=e.events_with_missing_fields)&&void 0!==c?c:{}
1,eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(d=e.exceeded_daily_quota_devices)&&void 0!==d?d:{},silencedDevices:null!==(p=e.silenced_devices)&&void 0!==p?p:[],silencedEvents:null!==(h=e.silenced_events)&&void 0!==h?h:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case i.PayloadTooLarge:return{status:T,statusCode:_,body:{error:null!==(v=e.error)&&void 0!==v?v:""}};case i.RateLimit:return{status:T,statusCode:_,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(E=e.exceeded_daily_quota_devices)&&void 0!==E?E:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(C=e.throttled_events)&&void 0!==C?C:[]}};case i.Timeout:default:return{status:T,statusCode:_}}},e.prototype.buildStatus=function(e){return eg(e)?i.Success:429===e?i.RateLimit:413===e?i.PayloadTooLarge:408===e?i.Timeout:e>=400&&e<500?i.Invalid:e>=500?i.Failed:i.Unknown},e}(),tr=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}return k(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),R(this,void 0,void 0,function(){var n=this;return P(this,function(o){return[2,new Promise(function(o,i){"undefined"==typeof XMLHttpRequest&&i(Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===n.state.done){var e=a.responseText;try{o(n.buildResponse(JSON.parse(e)))}catch(e){o(n.buildResponse({code:a.status}))}}};var s={"Content-Type":"application/json",Accept:"*/*"},c=JSON.stringify(t),l=r&&c.length>=2048&&e9(),u=function(e){var t,r;s=A(A({},n.customHeaders),s);try{for(var o=O(Object.entries(s)),i=o.next();!i.done;i=o.next()){var c=N(i.value,2),l=c[0],u=c[1];a.setRequestHeader(l,u)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}a.send(e)};R(n,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:if(!l)return[3,2];return[4,te(c)];case 1:return(e=t.sent())?(s["Content-Encoding"]="gzip",u(e)):u(c),[3,3];case 2:u(c),t.label=3;case 3:return[2]}})}).catch(i)})]})})},t}(tt),tn=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return k(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),R(this,void 0,void 0,function(){var n,o,i,a,s,c,l;return P(this,function(u){switch(u.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");if(n=JSON.stringify(t),o=r&&n.length>=2048&&e9(),i=n,a={"Content-Type":"application/json",Accept:"*/*"},!o)return[3,2];return[4,te(n)];case 1:(s=u.sent())&&(a["Content-Encoding"]="gzip",i=s),u.label=2;case 2:return[4,fetch(e,{headers:a=A(A({},this.customHeaders),a),body:i,method:"POST"})];case 3:return[4,(c=u.sent()).text()];case 4:l=u.sent();try{return[2,this.buildResponse(JSON.parse(l))]}catch(e){return[2,this.buildResponse({code:c.status})]}return[2]}})})},t}(tt),to=function(e){function t(){return e.call(this)||this}return k(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),R(this,void 0,void 0,function(){var r=this;return P(this,function(n){return[2,new Promise(function(n,o){var i=H();if(!(null==i?void 0:i.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var a=JSON.stringify(t);if(i.navigator.sendBeacon(e,a))return n(r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:a.length,server_upload_time:Date.now()}));return n(r.buildResponse({code:500}))}catch(e){o(e)}})]})})},t}(tt),ti=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},ta=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},ts="[Amplitude]",tc="".concat(ts," Form Started"),tl="".concat(ts," Form Submitted"),tu="".concat(ts," File Downloaded"),td="session_start",tp="session_end",th="".concat(ts," File Extension"),tf="".concat(ts," File Name"),tg="".concat(ts," Link ID"),tv="".concat(ts," Link Text"),tm="".concat(ts," Link URL"),ty="".concat(ts," Form ID"),tb="".concat(ts," Form Name"),tw="".concat(ts," Form Destination"),tE="cookie",tS={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},tC=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},t_=function(e,t,r,n,o,i){void 0===o&&(o=!0),e.referrer;var a=e.referring_domain,s=x(e,["referrer","referring_domain"]),c=t||{},l=(c.referrer,c.referring_domain),u=x(c,["referrer","referring_domain"]),d=r.excludeInternalReferrers;if(d){var p=tA(d,n);if(!(p instanceof TypeError)&&e.referring_domain&&tP(e.referring_domain,i)&&("always"===p||"ifEmptyCampaign"===p&&Object.values(A(A({},e),{referring_domain:void 0,referrer:void 0})).every(function(e){return!e})))return function(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?r.debug(n):"ifEmptyCampaign"===e&&r.debug("".concat(n," with empty campaign parameters"))}(p,e.referring_domain,n),!1}if(tT(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!o&&Object.values(e).every(function(e){return!e})&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var h=JSON.stringify(s)!==JSON.stringify(u),f=tC(a||"")!==tC(l||""),g=!t||h||f;return g?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),g},tT=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},tI=function(e,t){var r=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(r)},tk=function(e){var t=e;
1return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},tA=function(e,t){if(!0===e)return tS.always;if("object"==typeof e){var r=e.condition;if("string"==typeof r&&Object.keys(tS).includes(r))return r;if(void 0===r)return tS.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),TypeError(n)},tx=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],tR=function(e){var t,r,n=e||(null===(r=null===(t=H())||void 0===t?void 0:t.location)||void 0===r?void 0:r.hostname);if(!n)return"";var o=n.split("."),i=o[o.length-1],a=o[o.length-2];return(tx.find(function(e){return n.endsWith(".".concat(e))})&&(i=o[o.length-2]+"."+o[o.length-1],a=o[o.length-3]),a)?"".concat(a,".").concat(i):i},tP=function(e,t){var r=H();return!!r&&tI(e,(t||"").trim()||tR(r.location.hostname))},tO=function(e){function t(t,r,n,i,a,s,c,l,u,d,p,h,f,g,v,m,y,b,w,E,S,C,_,T,I,k,A,x,R,P,O,N,M,D,L,q,H,F,j,z,B,K,G,Y){void 0===n&&(n=new eX),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===d&&(d=30),void 0===p&&(p=tE),void 0===m&&(m=new U),void 0===y&&(y=o.Warn),void 0===w&&(w=!1),void 0===E&&(E=!1),void 0===_&&(_=""),void 0===T&&(T="US"),void 0===A&&(A=18e5),void 0===x&&(x=new e8({loggerProvider:m})),void 0===R&&(R={ipAddress:!0,language:!0,platform:!0}),void 0===P&&(P="fetch"),void 0===O&&(O=!1),void 0===N&&(N=!0),void 0===F&&(F=!0),void 0===j&&(j=0),void 0===G&&(G=!1),void 0===Y&&(Y=!1);var V,W=this;(W=e.call(this,{apiKey:t,storageProvider:x,transportProvider:tD(P)})||this).apiKey=t,W.appVersion=r,W.cookieOptions=i,W.defaultTracking=a,W.autocapture=s,W.flushIntervalMillis=l,W.flushMaxRetries=u,W.flushQueueSize=d,W.identityStorage=p,W.ingestionMetadata=h,W.instanceName=f,W.loggerProvider=m,W.logLevel=y,W.minIdLength=b,W.offline=w,W.partnerId=S,W.plan=C,W.serverUrl=_,W.serverZone=T,W.sessionTimeout=A,W.storageProvider=x,W.trackingOptions=R,W.transport=P,W.useBatch=O,W.fetchRemoteConfig=N,W.networkTrackingOptions=q,W.identify=H,W.enableDiagnostics=F,W.diagnosticsSampleRate=j,W.diagnosticsClient=z,W.remoteConfig=B,W.topLevelDomain=K,W.enableRequestBodyCompression=G,W._enableRequestBodyCompressionExperimental=Y,W.version=eJ,W._optOut=!1,W._cookieStorage=n,W.deviceId=c,W.lastEventId=g,W.lastEventTime=v,W.optOut=E,W.deferredSessionId=k,W.sessionId=I,W.pageCounter=D,W.userId=M,W.debugLogsEnabled=L,W.loggerProvider.enable(L?o.Debug:W.logLevel),W.networkTrackingOptions=q,W.identify=H,W.enableDiagnostics=F,W.diagnosticsSampleRate=j,W.diagnosticsClient=z;var J=null!==(V=null==B?void 0:B.fetchRemoteConfig)&&void 0!==V?V:N;return W.remoteConfig=W.remoteConfig||{},W.remoteConfig.fetchRemoteConfig=J,W.fetchRemoteConfig=J,W.topLevelDomain=K||tR(),W}return k(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof e0&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(e5(this.apiKey),e)},t}(ep),tN=function(e,t,r){switch(void 0===e&&(e=tE),void 0===t&&(t={}),e){case"localStorage":return new e8;case"sessionStorage":return new e7;case"none":return new eX;default:return new e0(A(A({},t),{expirationDays:t.expiration}),r)}},tM=function(e){var t,r;return void 0===e&&(e={}),(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)===!0||(null===(r=e.remoteConfig)||void 0===r?void 0:r.fetchRemoteConfig)!==!1&&!1!==e.fetchRemoteConfig},tD=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new tr(r):"beacon"===t?new to:new tn(r)},tL=function(){return(tL=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function tU(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function tq(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function tH(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function tF(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create;var tj=("function"==typeof SuppressedError&&SuppressedError,"data-amp-mask"),tz="*****",tB=/\b(?:\d[ -]*?){13,16}\b/,tK=/(\d{3}-?\d{2}-?\d{4})/g,tG=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,tY=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var r,n,o=e;o=(o=(o=o.replace(tB,tz)).replace(tK,tz)).replace(tG,tz);try{for(var i=(0,w.Ju)(t),a=i.next();!a.done;a=i.next()){var s=a.value;try{o=o.replace(s,tz)}catch(e){}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},tV=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(tj)?tz:e?e(document.title):document.title},tW=function(){function e(){}return e.prototype.parse=function(){return(0,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(e){return[2,(0,w.Cl)((0,w.Cl)((0,w.Cl)((0,w.Cl)({},eo.F3),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=et();return{utm_campaign:e[eo._9],utm_content:e[eo.fL],utm_id:e[eo.Cs],utm_medium:e[eo.Jn],utm_source:e[eo.VU],utm_term:e[eo.Wx]}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=et();return(e={})[eo.h2]=t[eo.h2],e[eo.lT]=t[eo.lT],e[eo.wX]=t[eo.wX],e[eo.q2]=t[eo.q2],e[eo.KY]=t[eo.KY],e[eo.Ct]=t[eo.Ct],e[eo.qr]=t[eo.qr],e[eo.wu]=t[eo.wu],e[eo.tt]=t[eo.tt],e[eo.Gp]=t[eo.Gp],e[eo.SO]=t[eo.SO],e},e}(),tJ=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},t$="AMP_PAGE_VIEW",tQ=function(e){void 0===e&&(e={});var t,r,n,o=H(),i=void 0,a=!1,s=e.trackOn,c=e.trackHistoryChanges,l=e.eventType,u=void 0===l?"[Amplitude] Page Viewed":l,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},p=function(e){return tU(void 0,void 0,void 0,function(){var t,r,n;return tq(this,function(o){switch(o.label){case 0:return t=d("undefined"!=typeof location&&location.href||""),n={event_type:u},r=[{}],[4,tX()];case 1:return[2,(n.event_properties=tL.apply(void 0,[tL.apply(void 0,r.concat([o.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"undefined"!=typeof location&&d(location.pathname)||"","[Amplitude] Page Title":tV(tY),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),n)]}})})},h=function(){return void 0===s||"function"==typeof s&&s()},f="undefined"!=typeof location?location.href:null,g=function(){tU(void 0,void 0,void 0,function(){var e,r,o,a,s;return tq(this,function(l){switch(l.label){case 0:if(r=t0(c,e=location.href,f||"")&&h(),f=e,!r)return[3,4];if(o=void 0,n&&(o=j(),n.set(t$,{pageViewId:o})),null==i||i.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return s=(a=t).track,[4,p(o)];case 2:s.apply(a,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return tU(void 0,void 0,void 0,function(){var c,l,u;return tq(this,function(d){switch(d.label){case 0:if(t=s,r=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,o&&(n=new e6(o.sessionStorage),o.addEventListener("popstate",g),o.history.pushState=new Proxy(o.history.pushState,{apply:function(e,t,r){var n=tH(r,3),o=n[0],i=n[1],s=n[2];e.apply(t,[o,i,s]),a&&g()}})),!h())return[3,2];return i.log("Tracking page view event"),c=void 0,n&&(c=j(),n.set(t$,{pageViewId:c})),u=(l=t).track,[4,p(c)];case 1:u.apply(l,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return tU(void 0,void 0,void 0,function(){var t,o,a;return tq(this,function(c){switch(c.label){case 0:if(!("attribution"===s&&tZ(e)))return[3,4];
1if(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,!n)return[3,2];return[4,n.get(t$)];case 1:t=null==(o=c.sent())?void 0:o.pageViewId,c.label=2;case 2:return[4,p(t)];case 3:a=c.sent(),e.event_type=a.event_type,e.event_properties=tL(tL({},e.event_properties),a.event_properties),c.label=4;case 4:return r&&e.event_type===u&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=tL(tL({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}})})},teardown:function(){return tU(void 0,void 0,void 0,function(){return tq(this,function(e){return o&&(o.removeEventListener("popstate",g),a=!1),[2]})})}}},tX=function(){return tU(void 0,void 0,void 0,function(){var e;return tq(this,function(t){switch(t.label){case 0:return e=tJ,[4,new tW().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},tZ=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[a.SET]||{},n=t[a.UNSET]||{},o=tF(tF([],tH(Object.keys(r)),!1),tH(Object.keys(n)),!1);return Object.keys(eo.F3).every(function(e){return o.includes(e)})}return!1},t0=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),o=new URL(r);return n.origin+n.pathname!==o.origin+o.pathname}return t!==r},t1=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})},o=function(){r.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),r=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,o){return R(void 0,void 0,void 0,function(){var i,a;return P(this,function(s){return t=eK(r),i=function(){if(!o){r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if("undefined"!=typeof document){var i=new WeakSet,a=function(e){if(!i.has(e)){i.add(e);var a=!1;n(e,"change",function(){var t,r=t3(e);a||o.track(tc,((t={})[ty]=t2(e.id),t[tb]=t2(e.name),t[tw]=r,t)),a=!0}),n(e,"submit",function(n){var i,s,c=t3(e);if(a||o.track(tc,((i={})[ty]=t2(e.id),i[tb]=t2(e.name),i[tw]=c,i)),a=!0,(null==t?void 0:t.shouldTrackSubmit)!==void 0){if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.")}o.track(tl,((s={})[ty]=t2(e.id),s[tb]=t2(e.name),s[tw]=c,s)),a=!1})}};Array.from(document.getElementsByTagName("form")).forEach(a),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&a(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(a)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(a=H())?a.addEventListener("load",i):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return R(void 0,void 0,void 0,function(){return P(this,function(t){return[2,e]})})},teardown:function(){return R(void 0,void 0,void 0,function(){return P(this,function(t){return null==e||e.disconnect(),o(),[2]})})}}},t2=function(e){if("string"==typeof e)return e},t3=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},t4=function(){var e,t=[],r=function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})},n=function(){t.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,n){return R(void 0,void 0,void 0,function(){var o,i;return P(this,function(a){return o=function(){if(!n){t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if("undefined"!=typeof document){var o=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,o=i.exec(t.href),a=null==o?void 0:o[1];a&&r(e,"click",function(){var r;a&&n.track(tu,((r={})[th]=a,r[tf]=t.pathname,r[tg]=e.id,r[tv]=e.text,r[tm]=e.href,r))})},i=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;
1Array.from(document.getElementsByTagName("a")).forEach(o),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&o(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(o)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(i=H())?i.addEventListener("load",o):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return R(void 0,void 0,void 0,function(){return P(this,function(t){return[2,e]})})},teardown:function(){return R(void 0,void 0,void 0,function(){return P(this,function(t){return null==e||e.disconnect(),n(),[2]})})}}},t5=!1,t6=function(e){t5||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n  defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),t5=!0)},t8=function(){var e=H(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))},n=function(){t.forEach(function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return R(void 0,void 0,void 0,function(){return P(this,function(n){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,r("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),r("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return R(void 0,void 0,void 0,function(){return P(this,function(e){return n(),[2]})})}}};function t7(e,t,r){var n,o,i=[];try{for(var a=O(null!=t?t:[]),s=a.next();!s.done;s=a.next()){var c=s.value;try{i.push(new RegExp(c))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(c),e)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return e.concat(i)}var t9=function(){return(t9=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function re(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function rt(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function rr(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function rn(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function ro(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create;var ri=("function"==typeof SuppressedError&&SuppressedError,["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"]),ra="data-amp-track-",rs=["div","span","h1","h2","h3","h4","h5","h6"],rc=r(79417),rl=r.n(rc);function ru(e,t){return new(rl())(function(r){e.subscribe({next:function(e){t(e).then(function(e){return r.next(e)}).catch(function(e){return r.error(e)})},error:function(e){r.error(e)},complete:function(){r.complete()}})})}function rd(e,t){return new(rl())(function(r){var n=!1,o=new Set,i=function(){var e,t;n=!0;try{for(var r=(0,w.Ju)(o),i=r.next();!i.done;i=r.next()){var a=i.value;try{a.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}o.clear()},a=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),i())},complete:function(){o.delete(t),n||0!==o.size||(r.complete(),i(),n=!0)}});o.add(t)};return a(e),a(t),i})}function rp(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new(rl())(function(o){return t.add(o),null===r&&(r=e.subscribe({next:function(e){try{for(var r,n,o,i=(0,w.Ju)(t),a=i.next();!a.done;a=i.next()){var s=a.value;null===(o=s.next)||void 0===o||o.call(s,e)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},error:function(e){try{for(var r,o,i,a=(0,w.Ju)(t),s=a.next();!s.done;s=a.next()){var c=s.value;null===(i=c.error)||void 0===i||i.call(c,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}n()},complete:function(){try{for(var e,r,o,i=(0,w.Ju)(t),a=i.next();!a.done;a=i.next()){var s=a.value;null===(o=s.complete)||void 0===o||o.call(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}n()}})),function(){t.delete(o),0===t.size&&r&&(r.unsubscribe(),r=null)}})}var rh="https://app.amplitude.com",rf={US:rh,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},rg="__AMPLITUDE_MESSENGER_INSTANCE__",rv="__AMPLITUDE_MESSENGER__",rm=function(){function e(e){var t=(void 0===e?{}:e).origin;this[l]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=void 0===t?rh:t}return e.prototype.notify=function(e){var t,r,n,o;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(o=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===o||o.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var o="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),i={id:o,action:e,args:t};return new Promise(function(t,a){n.requestCallbacks[o]={resolve:t,reject:a},n.notify(i),r.timeout>0&&setTimeout(function(){a(Error("".concat(e," timed out (id: ").concat(o,")"))),delete n.requestCallbacks[o]},r.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null===(t=this.logger)||void 0===t||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===(i=null===(o=this.logger)||void 0===o?void 0:o.warn)||void 0===i||i.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var r,n,o,i,a=this.pendingMessages.get(e);if(a){this.pendingMessages.delete(e);try{for(var s=(0,w.Ju)(a),c=s.next();!c.done;c=s.next()){var l=c.value;t(l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return(0,w.sH)(this,void 0,void 0,function(){var t,r,n;return(0,w.YH)(this,function(o){switch(o.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=(document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=e,o.addEventListener("load",function(){t({status:!0})},{once:!0}),o.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(o)}catch(e){r(e)}})).then(function(){}),this.scriptLoadPromises.set(e,r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r];case 2:return o.sent(),[3,4];case 3:throw n=o.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,o=void 0===e?{}:e,i=o.logger,a=o.endpoint;i&&(this.logger=i),a&&this.endpoint===rh&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var t,r,o,i,a,s=e.data,c=null==s?void 0:s.action;if(c){if("id"in s&&s.id)null===(i=null===(o=n.logger)||void 0===o?void 0:o.debug)||void 0===i||i.call(o,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(s);else{if("ping"===c){n.notify({action:"pong"});return}var l=n.actionHandlers.get(c);if(l)l(s.data);else{var u=null!==(a=n.pendingMessages.get(c))&&void 0!==a?a:[];u.push(s.data),n.pendingMessages.set(c,u)}}}}},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=H();(null==e?void 0:e[rv])===this&&delete e[rv]},e}();l=rg;var ry="__AMPLITUDE_BACKGROUND_CAPTURE__",rb="1.24.0",rw="[Amplitude] Element Clicked",rE="[Amplitude] Element Tag",rS="[Amplitude] Element Text",rC="[Amplitude] Page URL",r_="[Amplitude] Viewport Height",rT="[Amplitude] Viewport Width",rI="[Amplitude] Page View ID",rk="data-amp-mask-attributes",rA=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},rx=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},rR=["input","select","textarea"],rP=function(e,t){var r,n=null===(r=null==window?void 0:window.getComputedStyle)||void 0===r?void 0:r.call(window,e);return(null==n?void 0:n.getPropertyValue("cursor"))==="pointer"&&"click"===t},rO=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&rA(window.location.href,r))&&!!rA(window.location.href,t)},rN=function(e,t,r){return void 0===r&&(r=!1),function(n,o){var i,a,s=e.shouldTrackEventResolver,c=null===(a=null===(i=null==o?void 0:o.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===a?void 0:a.call(i);if(!c)return!1;if(s)return s(n,o);if(!rO(e))return!1;var l=String(null==o?void 0:o.getAttribute("type"))||"";if("string"==typeof l)switch(l.toLowerCase()){case"hidden":case"password":return!1}var u=rP(o,n);if(r&&u)return!0;
1if(t&&!t.some(function(e){var t;return!!(null===(t=null==o?void 0:o.matches)||void 0===t?void 0:t.call(o,e))}))return!1;switch(c){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:if(u)return!0;return"click"===n}}},rM=function(e){var t,r,n,o=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),i=e instanceof HTMLElement&&(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase())==="true";return!rR.includes(o)&&!i},rD=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return null==n||"object"==typeof n&&0===Object.keys(n).length||"string"==typeof n&&0===n.trim().length||(t[r]=n),t},{})},rL=function(){var e;try{var t=H(),r=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},rU=function(e,t){return e?t.some(function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)})?e:rU(null==e?void 0:e.parentElement,t):null},rq=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(u||(u={}));var rH="__AMPLITUDE_VISUAL_TAGGING__",rF=H(),rj=null==rF?void 0:rF.console,rz={},rB={},rK=!1,rG={addListener:function(e,t){if(!rj||"function"!=typeof rj[e]||!rB[e]&&(rB[e]=rj[e],rj[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(rz[e]&&!rK){rK=!0;var n=rz[e];n&&n.forEach(function(r){try{r(e,t)}catch(e){}})}}catch(e){}return rK=!1,rB[e].apply(rj,t)},0))return Error("Console override failed");rz[e]?rz[e].push(t):rz[e]=[t]},removeListener:function(e){var t,r;try{for(var n=(0,w.Ju)(Object.values(rz)),o=n.next();!o.done;o=n.next())for(var i=o.value,a=i.length-1;a>=0;a--)if(i[a]===e){i.splice(a,1);break}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}},rY=H(),rV=function(){return new(rl())(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},rW=function(e){return void 0===e&&(e="click"),new(rl())(function(t){var r,n=function(e){t.next(e)};return null===(r=H())||void 0===r||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null===(t=H())||void 0===t||t.document.removeEventListener(e,n,{capture:!0})}})},rJ=function(){var e=rd(new(rl())(function(e){var t=function(t){if(t instanceof ErrorEvent){var r={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?r=t9(t9({},r),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(r.message=t.error),e.next(r)}};return rY.addEventListener("error",t),function(){rY.removeEventListener("error",t)}}),new(rl())(function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return rY.addEventListener("unhandledrejection",t),function(){rY.removeEventListener("unhandledrejection",t)}}));return rd(e,new(rl())(function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(o=r[0][0]),e.next({kind:"console",message:o})};return rG.addListener("error",t),function(){rG.removeListener(t)}}))},r$=function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){console.error("Error matching event to filter",e)}return!1},rQ=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;if(e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector)return r.querySelector(e.selector);return r}}catch(e){}},rX=function(e,t,r){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}})},rZ={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},r0=function(e){var t,r,n,o,i=Object.values(rZ).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return i;try{for(var a=rr(e),s=a.next();!s.done;s=a.next()){var c=s.value;try{try{for(var l=(n=void 0,rr(c.definition)),u=l.next();!u.done;u=l.next()){var d=rZ[u.value.event_type];d&&i[d].add(c.id)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},r1=function(e){var t,r,n,o,i=new Map;try{for(var a=rr(e),s=a.next();!s.done;s=a.next()){var c=s.value;try{for(var l=(n=void 0,rr(c.conditions)),u=l.next();!u.done;u=l.next()){var d=u.value;if("LABELED_EVENT"===d.type){var p=d.match.eventId,h=i.get(p);h||(h=[],i.set(p,h)),h.push(c)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},r2=function(e,t){var r,n,o,i,a=new Set;try{for(var s=rr(e),c=s.next();!c.done;c=s.next()){var l=c.value,u=t.get(l.id);if(u)try{for(var d=(o=void 0,rr(u)),p=d.next();!p.done;p=d.next()){var h=p.value;a.add(h)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},r3=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var o=r2(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return n.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return rZ[t.event_type]===e.type&&t.filters.every(function(t){return r$(e,t)})})}),this.labeledEventToTriggerMap);try{for(var i=rr(o),a=i.next();!a.done;a=i.next()){var s=a.value;rX(s.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}(),r4=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",rk,tj]),r5=["type"],r6=["svg","path","g"],r8=["password","hidden"],r7=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),r9=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var o=ne(n,!!t,n===e);if(!o||(r.push(o),o.optimized))break;n=n.parentElement}return r.reverse(),r.join(" > ")},ne=function(e,t,r){if(e.nodeType!==Node.ELEMENT_NODE)return null;var n,o,i=e.getAttribute("id");if(t){if(i)return new r7(u(i),!0);var a=e.tagName.toLowerCase();if("body"===a||"head"===a||"html"===a)return new r7(a,!0)}var s=e.tagName.toLowerCase();if(i)return new r7(s+u(i),!0);var c=e.parentNode;if(!c||c.nodeType===Node.DOCUMENT_NODE)return new r7(s,!0);function l(e){var t=e.getAttribute("class");
1return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]}function u(e){return"#"+CSS.escape(e)}for(var d=l(e),p=!1,h=!1,f=-1,g=-1,v=c.children,m=0;v&&(-1===f||!h)&&m<v.length;++m){var y=v[m];if(y.nodeType===Node.ELEMENT_NODE){if(g+=1,y===e){f=g;continue}if(!h&&y.tagName.toLowerCase()===s){p=!0;var b=new Set(d);if(!b.size){h=!0;continue}for(var w=l(y),E=0;E<w.length;++E){var S=w[E];if(b.has(S)&&(b.delete(S),!b.size)){h=!0;break}}}}}var C=s;if(r&&"input"===s.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(C+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),h)C+=":nth-child("+String(f+1)+")";else if(p)try{for(var _=rr(d),T=_.next();!T.done;T=_.next()){var I=T.value;C+="."+CSS.escape(I.slice(1))}}catch(e){n={error:e}}finally{try{T&&!T.done&&(o=_.return)&&o.call(_)}finally{if(n)throw n.error}}return new r7(C,!1)},nt=function(e,t){var r,n,o,i=this;this.replaceSensitiveString=function(e){return tY(e,i.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,o,a=performance.now(),s=[];if(!e)return[];for(var c=function(e){var t=[];if(!e)return t;
1t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e),l=new Map,u=c.length-1;u>=0;u--){var d=c[u];if(d){var p,h=(p=d.getAttribute(rk))?p.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],f=new Set(ro(ro([],rn(u===c.length-1?[]:null!==(n=l.get(c[u+1]))&&void 0!==n?n:new Set),!1),rn(h),!1));l.set(d,f)}}s=c.map(function(e){var t;return function(e,t){if(null===e)return null;var r,n,o,i,a,s,c=String(e.tagName).toLowerCase(),l={tag:c},u=Array.from(null!==(i=null===(o=e.parentElement)||void 0===o?void 0:o.children)&&void 0!==i?i:[]);u.length&&(l.index=u.indexOf(e),l.indexOfType=u.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null===(s=null===(a=e.previousElementSibling)||void 0===a?void 0:a.tagName)||void 0===s?void 0:s.toLowerCase();d&&(l.prevSib=String(d));var p=e.getAttribute("id");p&&(l.id=String(p));var h=Array.from(e.classList);h.length&&(l.classes=h);var f={},g=Array.from(e.attributes).filter(function(e){return!r4.has(e.name)}),v=!rM(e);if(!r8.includes(String(e.getAttribute("type")))&&!r6.includes(c))try{for(var m=rr(g),y=m.next();!y.done;y=m.next()){var b=y.value;if(!v||r5.includes(b.name)){if(t.has(b.name)){f[b.name]=tz;continue}f[b.name]=String(b.value).substring(0,128)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}return Object.keys(f).length&&(l.attrs=f),l}(e,null!==(t=l.get(e))&&void 0!==t?t:new Set)});var g=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=rn(t,2),n=r[0],o=r[1];e.attrs&&(e.attrs[n]=i.replaceSensitiveString(o))})};try{for(var v=rr(s),m=v.next();!m.done;m=v.next()){var y=m.value;g(y)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}var b=performance.now();return null===(o=i.diagnosticsClient)||void 0===o||o.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?i.getText(t):i.getNearestLabel(r)},this.getElementPath=function(e){if(!e)return"";var t,r=performance.now(),n=r9(e),o=performance.now();return null===(t=i.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",o-r),n},this.getEventProperties=function(e,t,r){var n,o,a,s,c=null===(a=null===(o=null==t?void 0:t.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===a?void 0:a.call(o),l="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},u=i.getHierarchy(t),d=null===(s=u[0])||void 0===s?void 0:s.attrs,p=i.getNearestLabel(t),h=Object.entries(null!=d?d:{}).reduce(function(e,t){var n=rn(t,2),o=n[0],i=n[1];if(o.startsWith(r)){var a=o.replace(r,"");a&&(e[a]=i||"")}return e},{}),f=((n={})["[Amplitude] Element Hierarchy"]=u,n[rE]=c,n[rS]=i.getText(t),n["[Amplitude] Element Position Left"]=null==l.left?null:Math.round(l.left),n["[Amplitude] Element Position Top"]=null==l.top?null:Math.round(l.top),n["[Amplitude] Element Attributes"]=h,n["[Amplitude] Element Path"]=i.getElementPath(t),n["[Amplitude] Element Parent Label"]=p,n[rC]=rx(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=tV(i.replaceSensitiveString),n[r_]=window.innerHeight,n[rT]=window.innerWidth,n),g=rL();if(g&&(f[rI]=g),f["[Amplitude] Element ID"]=t.getAttribute("id")||"",f["[Amplitude] Element Class"]=t.getAttribute("class"),f["[Amplitude] Element Aria Label"]=null==d?void 0:d["aria-label"],"a"===c&&"click"===e&&t instanceof HTMLAnchorElement){var v=t.href.substring(0,128);f["[Amplitude] Element Href"]=i.replaceSensitiveString(v)}return rD(f)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,o){void 0===o&&(o=!1);var a=i.addTypeAndTimestamp(e,t);if(("click"===a.type||"change"===a.type)&&null!==a.event.target){if(o&&rP(a.event.target,a.type))return a.closestTrackedAncestor=a.event.target,a.targetElementProperties=i.getEventProperties(a.type,a.closestTrackedAncestor,n),a;var s=rU(a.event.target,r);s&&(a.closestTrackedAncestor=s,a.targetElementProperties=i.getEventProperties(a.type,s,n))}return a},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=rQ(e,t);if(r){if("TEXT"===e.elementExtractType)return i.getText(r);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return r.getAttribute(e.attribute)}}},this.getTextWithMaskedDescendants=function(e){var t,r,n="[".concat(tj,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var o="",a=Array.from(e.childNodes);try{for(var s=rr(a),c=s.next();!c.done;c=s.next()){var l=c.value;if(l.nodeType===Node.TEXT_NODE){o+=l.textContent||"";continue}if(l instanceof Element){if(l.hasAttribute(tj)||l.hasAttribute("contenteditable")){o+=tz;continue}o+=i.getTextWithMaskedDescendants(l)}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o},this.getText=function(e){if(null!==e.closest("[".concat(tj,"]")))return tz;var t="";return t=e.querySelector("[".concat(tj,"], [contenteditable]"))?i.getTextWithMaskedDescendants(e):e.innerText||"",i.replaceSensitiveStr
1ing(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var t,r,n,o=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r);return rD(((t={})[rE]=o,t[rS]=i.getText(e),t[rC]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var a=null!==(o=e.maskTextRegex)&&void 0!==o?o:[],s=[];try{for(var c=rr(a),l=c.next();!l.done;l=c.next()){var u=l.value;if(s.length>=25)break;if(u instanceof RegExp)s.push(u);else if("pattern"in u&&"string"==typeof u.pattern)try{s.push(RegExp(u.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=s};!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(d||(d={}));var nr=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",rb);var r,n,o,i,a,s,c,l,u,p,h,f,g=e.dataAttributePrefix,v=void 0===g?ra:g,m=e.visualTaggingOptions,y=void 0===m?{enabled:!0}:m;e.cssSelectorAllowlist=null!==(r=e.cssSelectorAllowlist)&&void 0!==r?r:ri,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:rs,e.debounceTime=null!==(o=e.debounceTime)&&void 0!==o?o:0;var b=null!==(s=null!==(a=null===(i=e.viewportContentUpdated)||void 0===i?void 0:i.exposureDuration)&&void 0!==a?a:e.exposureDuration)&&void 0!==s?s:150;e.viewportContentUpdated=t9(t9({},e.viewportContentUpdated),{exposureDuration:b}),e.pageUrlExcludelist=null===(c=e.pageUrlExcludelist)||void 0===c?void 0:c.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(e){console.warn("Invalid regex pattern: ".concat(t.pattern),e)}return e},[]);var w="@amplitude/plugin-autocapture-browser",E=[],S=new nt(e,t),C=new Set,_=new Set,T=function(){var t,r,n,o=rp(rW().map(function(t){return S.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),i=rp(new(rl())(function(t){var r,n=function(r){var n=S.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,v);t.next(n)};return null===(r=H())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=H())||void 0===e?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(n=rp(new(rl())(function(t){var r=function(r){var n=S.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,v);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var a=rp(rV().map(function(t){return S.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)})),s=new(rl())(function(e){var t,r=function(t){e.next(t)};return null===(t=H())||void 0===t||t.addEventListener("scroll",r),function(){var e;null===(e=H())||void 0===e||e.removeEventListener("scroll",r)}}),c=(t=e.cssSelectorAllowlist,new(rl())(function(e){var r,n=H();if(!(null==n?void 0:n.IntersectionObserver))return function(){};var o=new IntersectionObserver(function(t){t.forEach(function(t){e.next(t)})},{root:null,rootMargin:"0px",threshold:1}),i=t.join(",");(null!==(r=null==n?void 0:n.document.querySelectorAll(i))&&void 0!==r?r:[]).forEach(function(e){o.observe(e)});var s=a.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(i)&&o.observe(e),e.querySelectorAll(i).forEach(function(e){o.observe(e)}))})})});return function(){s.unsubscribe(),o.disconnect()}}));return(r={})[d.ChangeObservable]=i,r[d.ClickObservable]=o,r[d.MutationObservable]=a,r[d.NavigateObservable]=n,r[d.ScrollObservable]=s,r[d.ExposureObservable]=c,r},I=r0(Object.values(null!==(u=null===(l=e.pageActions)||void 0===l?void 0:l.labeledEvents)&&void 0!==u?u:{})),k=r1(null!==(h=null===(p=e.pageActions)||void 0===p?void 0:p.triggers)&&void 0!==h?h:[]),A=new r3(I,k,S,e),x=function(t){var r,n;t&&(e.pageActions=t9(t9({},e.pageActions),t),I=r0(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),k=r1(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),A.update(I,k,e))};return{name:w,type:"enrichment",setup:function(t,r){return re(void 0,void 0,void 0,function(){var n,o,i,a,s,c,l,u,p,h,g,m,I,k,R,P,O,N,M,D,L;return rt(this,function(U){var q,F,j,z,B,K,G,Y,V,W,J,$,Q,X,Z,ee,et,er,en,eo,ei,ea,es,ec,el,eu,ed,ep,eh,ef,eg,ev,em,ey,eb,ew,eE,eS,eC;return"undefined"==typeof document||(n=!1,o={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(e){x(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),i=rN(e,e.cssSelectorAllowlist),a=rN(e,e.actionClickAllowlist),F=(q={allObservables:s=T(),amplitude:r,shouldTrackEvent:i,evaluateTriggers:A.evaluate.bind(A)}).amplitude,j=q.allObservables,z=q.shouldTrackEvent,B=q.evaluateTriggers,c=j.clickObservable.filter(rq).filter(function(e){return z("click",e.closestTrackedAncestor)}).map(function(e){return B(e)}).subscribe(function(e){null==F||F.track(rw,e.targetElementProperties)}),E.push(c),G=(K={allObservables:s,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S.getEventProperties.apply(S,ro(ro([],rn(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:i,evaluateTriggers:A.evaluate.bind(A)}).amplitude,Y=K.allObservables,V=K.getEventProperties,W=K.shouldTrackEvent,J=K.evaluateTriggers,l=Y.changeObservable.filter(rq).filter(function(e){return W("change",e.closestTrackedAncestor)}).map(function(e){return J(e)}).subscribe(function(e){null==G||G.track("[Amplitude] Element Changed",V("change",e.closestTrackedAncestor))}),E.push(l),Q=($={allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S.getEventProperties.apply(S,ro(ro([],rn(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:i,shouldTrackActionClick:a}).amplitude,X=$.allObservables,Z=$.options,ee=$.getEventProperties,et=$.shouldTrackEvent,er=$.shouldTrackActionClick,en=X.clickObservable,eo=X.mutationObservable,ei=X.navigateObservable,ea=en.filter(function(e){return!et("click",e.closestTrackedAncestor)}).map(function(e){var t=rU(e.event.target,Z.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=ee(e.type,e.closestTrackedAncestor)),e}).filter(rq).filter(function(e){return er("click",e.closestTrackedAncestor)}),es=ei?rd(eo,ei):eo,ec=rd(ea,es),el=null,eu=null,(u=ru(ec,function(e){if(el&&(clearTimeout(el),el=null),"click"===e.type)eu=e,el=setTimeout(function(){el=null,eu=null},500);else if(eu){var t=eu;return eu=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==Q||Q.track(rw,ee("click",e.closestTrackedAncestor)))}))&&E.push(u),(ed={allObservables:s,amplitude:r}).amplitude,ep=ed.allObservables.scrollObservable,eh={maxX:0,maxY:0},ef=ep.subscribe(function(){var e,t,r,n,o=H(),i=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(n=null!==(r=null==o?void 0:o.scrollY)&&void 0!==r?r:null==o?void 0:o.pageYOffset)&&void 0!==n?n:0);eh.maxX=Math.max(eh.maxX,i),eh.maxY=Math.max(eh.maxY,a)}),p={unsubscribe:function(){ef.unsubscribe()},getState:function(){return eh},reset:function(){eh.maxX=0,eh.maxY=0}},E.push(p),h={},g=H(),m=function(e){e&&n||(setTimeout(function(){n=!1},100),n=!0,function(e){var t,r,n,o,i=e.amplitude,a=e.scrollTracker,s=e.currentElementExposed,c=e.elementExposedForPage,l=e.exposureTracker,u=e.isPageEnd,d=e.lastScroll,p=a.getState(),h=H(),f=null!==(r=null==h?void 0:h.innerWidth)&&void 0!==r?r:0,g=null!==(n=null==h?void 0:h.innerHeight)&&void 0!==n?n:0,v=((t={})[rC]=null===(o=null==h?void 0:h.location)||void 0===o?void 0:o.href,t["[Amplitude] Max Page X"]=p.maxX+f,t["[Amplitude] Max Page Y"]=p.maxY+g,t[r_]=g,t[rT]=f,t["[Amplitude] Element Exposed"]=Array.from(s),t),m=rL();if(m&&(v[rI]=m),0===s.size&&p.maxX===d.maxX&&p.maxY===d.maxY){u&&(a.reset(),c.clear(),null==l||l.reset());return}null==i||i.track("[Amplitude] Viewport Content Updated",v),d.maxX=p.maxX,d.maxY=p.maxY,s.clear(),u&&(a.reset(),c.clear(),null==l||l.reset())}({amplitude:r,scrollTracker:p,currentElementExposed:_,elementExposedForPage:C,exposureTracker:h.exposure,isPageEnd:e,lastScroll:o}))},I=function(e){!C.has(e)&&(C.add(e),_.add(e),JSON.stringify(Array.from(_)).length>=18e3&&m(!1))},h.exposure=(ev=(eg={allObservables:s,onExposure:I,dataExtractor:S,exposureDuration:b}).allObservables,em=eg.onExposure,ey=eg.dataExtractor,ew=void 0===(eb=eg.exposureDuration)?150:eb,eE=new Map,eS=new Map,eC=ev.exposureObservable.subscribe(function(e){var t=e.target;if(e.isIntersecting){if(!eE.get(t)){var r=setTimeout(function(){eE.set(t,!0),em(ey.getElementPath(t)),eS.set(t,null)},ew);eS.set(t,r)}}else if(!e.isIntersecting&&e.intersectionRatio<1){var r=eS.get(t);r&&(clearTimeout(r),eS.set(t,null))}}),{unsubscribe:function(){eC.unsubscribe()}
1,reset:function(){eS.forEach(function(e){e&&clearTimeout(e)}),eS.clear(),eE.clear()}}),h.exposure&&E.push(h.exposure),k=function(){m(!0)},null==g||g.addEventListener("beforeunload",k),f=function(){null==g||g.removeEventListener("beforeunload",k)},E.push({unsubscribe:function(){return f()}}),(R=s[d.NavigateObservable])?E.push(R.subscribe(function(){m(!0)})):g&&(P=function(){m(!0)},g.addEventListener("popstate",P),O=g.history.pushState,g.history&&O&&(g.history.pushState=new Proxy(O,{apply:function(e,t,r){var n=rn(r,3),o=n[0],i=n[1],a=n[2];e.apply(t,[o,i,a]),m(!0)}})),E.push({unsubscribe:function(){g.removeEventListener("popstate",P),g.history&&O&&(g.history.pushState=O)}})),null===(L=null==t?void 0:t.loggerProvider)||void 0===L||L.log("".concat(w," has been successfully added.")),window.opener&&y.enabled&&(N=e.cssSelectorAllowlist,M=e.actionClickAllowlist,function(e,t){if(!0!==e[rH]){e[rH]=!0;var r=t.dataExtractor,n=t.isElementSelectable,o=t.cssSelectorAllowlist,i=t.actionClickAllowlist,a=null,s=function(t){e.notify({action:"element-selected",data:t})},c=function(t,r){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:r}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:r})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var l;a=null===(l=null==window?void 0:window.amplitudeVisualTaggingSelector)||void 0===l?void 0:l.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!n||n((null==t?void 0:t.actionType)||"click",e)},onTrack:c,onSelect:s,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:i,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:rb}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a)})}}(D=function(e){var t=H(),r=null==t?void 0:t[rv];if("object"==typeof r&&null!==r&&rg in r&&!0===r[rg])return r;var n=new rm(void 0);return t&&(t[rv]=n),n}(),{dataExtractor:S,isElementSelectable:rN(e,ro(ro([],rn(N),!1),rn(M),!1)),cssSelectorAllowlist:N,actionClickAllowlist:M}),function(e,t){if(!0!==e[ry]){e[ry]=!0;var r=null,n=function(t,r){var n,o;"background-capture-complete"===t&&(null===(o=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===o||o.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(){null===(o=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===o||o.call(t,"Initializing background capture (external script)");var t,o,i=new URL("https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.2.js.gz",e.endpoint).toString();e.loadScriptOnce(i).then(function(){var t,o,i;null===(o=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===o||o.call(t,"Background capture script loaded (external)"),r=null===(i=null==window?void 0:window.amplitudeBackgroundCapture)||void 0===i?void 0:i.call(window,{messenger:e,onBackgroundCapture:n}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==r?void 0:r.close)||void 0===e||e.call(r),r=null})}}(D),D.setup(t9({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:rf[t.serverZone]})))),[2]})})},execute:function(e){return re(void 0,void 0,void 0,function(){return rt(this,function(t){return[2,e]})})},teardown:function(){return re(void 0,void 0,void 0,function(){var e,t,r,n;return rt(this,function(o){try{for(t=(e=rr(E)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}},nn=(0,w.fX)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,w.zs)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),no=["*"],ni=["mutation","navigate"];function na(e,t){var r,n,o,i,a=t.event,s=a.pageX,c=a.pageY;e.yMin=Math.min(null!==(r=e.yMin)&&void 0!==r?r:c,c),e.yMax=Math.max(null!==(n=e.yMax)&&void 0!==n?n:c,c),e.xMin=Math.min(null!==(o=e.xMin)&&void 0!==o?o:s,s),e.xMax=Math.max(null!==(i=e.xMax)&&void 0!==i?i:s,s),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function ns(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:t9({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(p||(p={})),function(e){e.X="x",e.Y="y"}(h||(h={}));var nc=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new(rl())(function(e){var r=null,n=null,o=null;return t.subscribe(function(t){var i={x:t.clientX,y:t.clientY};if(null===r){r=i;return}i.x>r.x?(n===p.DECREASING&&e.next(h.X),n=p.INCREASING):i.x<r.x&&(n===p.INCREASING&&e.next(h.X),n=p.DECREASING),i.y>r.y?(o===p.DECREASING&&e.next(h.Y),o=p.INCREASING):i.y<r.y&&(o===p.INCREASING&&e.next(h.Y),o=p.DECREASING),r=i})})};function nl(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;return!(t.length<r)&&t[t.length-1]-t[0]<n}function nu(e){e.changes=[],e.startTime=void 0}
1function nd(e){for(var t=e.changes,r=e.thresholdMs,n=0,o=t[t.length-1];n<t.length&&!(o-t[n]<r);n++);0!==n&&(e.startTime=t[n],e.changes.splice(0,n))}var np=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=void 0===r?10:r,o=e.thresholdMs,i=void 0===o?2e3:o;return new(rl())(function(e){var r={changes:[],changesThreshold:n,thresholdMs:i},o={changes:[],changesThreshold:n,thresholdMs:i},a=void 0,s=null;function c(){void 0!==a&&(e.next(a),a=void 0,null!==s&&clearTimeout(s),nu(r),nu(o))}return t.subscribe(function(e){null!==s&&clearTimeout(s),t=e===h.X?r:o,n=+Date.now(),t.startTime=t.startTime||n,l=t.changes,u=t.changesThreshold,l.push(n),l.length>u&&l.shift();var t,n,l,u,d=function(e,t){var r=void 0;if(nl(e)&&(r=e.startTime),nl(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}(r,o);return d?(a=a||d,s=setTimeout(function(){c(),s=null},i)):c(),nd(r),nd(o),function(){null!==s&&(clearTimeout(s),s=null)}})})},nh=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,o=e.directionChanges,i=e.thresholdMs;return np({mouseDirectionChangeObservable:nc({allWindowObservables:n}),directionChanges:void 0===o?10:o,thresholdMs:void 0===i?2e3:i}).subscribe(function(e){rO(r)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function nf(e,t,r,n){if(!n)return[];var o=e[t];return"object"==typeof o&&null!==o&&"cssSelectorAllowlist"in o&&Array.isArray(o.cssSelectorAllowlist)?o.cssSelectorAllowlist:r}var ng=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-frustration-browser",n=[],o=!1!==e.errorClicks;e.errorClicks||(o=!1);var i=!1!==e.deadClicks&&null!==e.deadClicks,a=!1!==e.rageClicks&&null!==e.rageClicks,s=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(s=!1);var c=nf(e,"rageClicks",no,a),l=nf(e,"deadClicks",nn,i),p=nf(e,"errorClicks",nn,o),h=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:ra,f=new nt(e),g=ro([],rn(new Set(ro(ro(ro([],rn(c),!1),rn(l),!1),rn(p),!1))),!1),v=function(){var e,t,r=rp(rW("pointerdown").map(function(e){return f.addAdditionalEventProperties(e,"click",g,h,!0)})),n=rp(rJ().map(function(e){return f.addTypeAndTimestamp(e,"error")})),o=rp(rV().map(function(e){return f.addAdditionalEventProperties(e,"mutation",g,h)}));window.navigation&&(t=rp(new(rl())(function(e){var t=function(t){e.next(t9(t9({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return f.addAdditionalEventProperties(e,"navigate",g,h)})));var i=rp(new(rl())(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){var r=void 0,n=void 0;try{if(r=t.selectionStart,n=t.selectionEnd,r===n)return}catch(e){return}return e.next()}var o=window.getSelection();if(o&&!o.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),a=rp(new(rl())(function(e){var t=function(t){e.next(t)},r={capture:!0};return rY.document.addEventListener("mousemove",t,r),function(){rY.document.removeEventListener("mousemove",t,r)}}));return(e={})[d.ClickObservable]=r,e[d.MutationObservable]=o,e[d.NavigateObservable]=t,e[d.BrowserErrorObservable]=n,e[d.SelectionObservable]=i,e[d.MouseMoveObservable]=a,e};return{name:r,type:"enrichment",setup:function(t,d){return re(void 0,void 0,void 0,function(){var g,m,y,b,w,E,S,C;return rt(this,function(_){var T,I,k,A,x,R,P,O,N,M,D,L,U,q,H,F,j,z,B,K,G,Y;return"undefined"==typeof document||(g=v(),a&&(m=function(e){var t=this,r=e.amplitude,n=e.allObservables,o=e.shouldTrackRageClick,i=n.clickObservable,a=n.selectionObservable,s=[],c={},l=null;function u(e){s=[],c={},e&&(na(c,e),s.push(e))}var d=ru(i.filter(function(e){return o("click",e.closestTrackedAncestor)}),function(e){return re(t,void 0,void 0,function(){var t;return rt(this,function(r){var n,o,i,a;return(na(c,e),t=null,0===s.length||(n=s).length>0&&n[n.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(i=Math.max(0,(o=s).length-4+1),a=o[i],e.timestamp-a.timestamp>=1e3)||c.isOutOfBounds)?(l&&(t=ns(s)),u(e)):s.push(e),(l&&(clearTimeout(l.timerId),l.resolve(t),l=null),s.length>=4)?[2,new Promise(function(e){l={resolve:e,timerId:setTimeout(function(){e(ns(s))},1e3)}})]:[2,null]})})}),p=null==a?void 0:a.subscribe(function(){u()}),h=d.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){h.unsubscribe(),null==p||p.unsubscribe()}}}({allObservables:g,amplitude:d,shouldTrackRageClick:rN(e,c)}),n.push(m)),i&&(I=(T={amplitude:d,allObservables:g,getEventProperties:function(e,t){return f.getEventProperties(e,t,h)},shouldTrackDeadClick:rN(e,l)}).amplitude,k=T.allObservables,A=T.getEventProperties,x=T.shouldTrackDeadClick,R=k.clickObservable,P=k.mutationObservable,O=k.navigateObservable,N=R.filter(function(e){return rq(e)&&x("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===u.LE
1FT_OR_TOUCH_CONTACT}),M=O?rd(P,O):P,D=rd(N,M),L=null,y=ru(D,function(e){if(L&&ni.includes(e.type))clearTimeout(L),L=null;else if("click"===e.type)return L?Promise.resolve(null):new Promise(function(t){L=setTimeout(function(){t(e),L=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};I.track("[Amplitude] Dead Click",t9(t9({},A("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),n.push(y)),o&&(q=(U={amplitude:d,allObservables:g,shouldTrackErrorClick:rN(e,p)}).amplitude,H=U.allObservables,F=U.shouldTrackErrorClick,j=H.clickObservable,z=H.browserErrorObservable,B=j.filter(function(e){return rq(e)&&F("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===u.LEFT_OR_TOUCH_CONTACT}),K=null,G=null,Y=function(){null!==K&&(clearTimeout(K),K=null),G=null},b=rd(B,z).subscribe(function(e){var t;if("click"===e.type){Y(),G=e,K=setTimeout(Y,2e3);return}"error"===e.type&&G&&(q.track("[Amplitude] Error Click",t9(((t={})["[Amplitude] Kind"]=e.event.kind,t["[Amplitude] Message"]=e.event.message,t["[Amplitude] Stack"]=e.event.stack,t["[Amplitude] Filename"]=e.event.filename,t["[Amplitude] Line Number"]=e.event.lineNumber,t["[Amplitude] Column Number"]=e.event.columnNumber,t),G.targetElementProperties)),Y())}),n.push(b)),s&&(w=void 0,E=void 0,"object"==typeof e.thrashedCursor&&(w=e.thrashedCursor.directionChanges,E=e.thrashedCursor.threshold,w&&w<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(w," is below the minimum of ").concat(5,", setting to ").concat(5)),w=5),E&&E>4e3&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(E," is above the maximum of ").concat(4e3,", setting to ").concat(4e3)),E=4e3)),S=nh({amplitude:d,options:e,allObservables:g,directionChanges:w,thresholdMs:E}),n.push(S)),null===(C=null==t?void 0:t.loggerProvider)||void 0===C||C.log("".concat(r," has been successfully added."))),[2]})})},execute:function(e){return re(void 0,void 0,void 0,function(){return rt(this,function(t){return[2,e]})})},teardown:function(){return re(void 0,void 0,void 0,function(){var e,t,r,o;return rt(this,function(i){try{for(t=(e=rr(n)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(r)throw r.error}}return[2]})})}}};function nv(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function nm(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function ny(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function nb(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function nw(e,t,r){e&&function e(t){var r,n,o=t.json,i=t.targetObject,a=t.allowlist,s=t.excludelist,c=t.ancestors,l=t.parentObject,u=t.targetKey;
1i||(i=o);var d=Object.keys(i);try{for(var p=(0,w.Ju)(d),h=p.next();!h.done;h=p.next()){var f,g=h.value,v=(0,w.fX)((0,w.fX)([],(0,w.zs)(c),!1),[g],!1);(f=i[g],"string"==typeof f||"number"==typeof f||"boolean"==typeof f||null==f)?(!nS(v,a)||nS(v,s))&&delete i[g]:e({json:o,targetObject:i[g],allowlist:a,excludelist:s,ancestors:v,parentObject:i,targetKey:g})}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}0===Object.keys(i).length&&l&&u&&delete l[u]}({json:e,allowlist:t.map(nE),excludelist:r.map(nE),ancestors:[]})}function nE(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function nS(e,t){return t.some(function(t){return function e(t,r,n,o){if(void 0===n&&(n=0),void 0===o&&(o=0),o===r.length)return n===t.length;if(n===t.length){for(;o<r.length&&"**"===r[o];)o++;return o===r.length}var i=r[o];if("**"===i){if(o+1===r.length)return!0;for(var a=n;a<=t.length;a++)if(e(t,r,a,o+1))return!0;return!1}return("*"===i||i===t[n])&&e(t,r,n+1,o+1)}(e,t)})}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var nC=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,r,n=this.request.headers,o={};if(Array.isArray(n))n.forEach(function(e){var t=(0,w.zs)(e,2),r=t[0],n=t[1];o[r]=n});else if(n instanceof Headers)n.forEach(function(e,t){o[t]=e});else if("object"==typeof n&&null!==n)try{for(var i=(0,w.Ju)(Object.entries(n)),a=i.next();!a.done;a=i.next()){var s=(0,w.zs)(a.value,2),c=s[0],l=s[1];o[c]=l}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return nR(o,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=H();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=nT(t,100),this._bodySize}},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,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(r){return 0===e.length?[2,null]:[2,nA(this.body,e,t)]})})},e}(),n_=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),nR(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return nT(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,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(r){return 0===e.length?[2,null]:[2,nA(this.body,e,t)]})})},e}();function nT(e,t){var r,n,o,i,a=H(),s=null==a?void 0:a.TextEncoder;if(s){if("string"==typeof e)i=e,o=new s().encode(i).length;else if(e instanceof Blob)o=(i=e).size;else if(e instanceof URLSearchParams)i=e,o=new s().encode(i.toString()).length;else if(ArrayBuffer.isView(e))o=(i=e).byteLength;else if(e instanceof ArrayBuffer)o=(i=e).byteLength;else if(e instanceof FormData){var c=0,l=0;try{for(var u=(0,w.Ju)(e.entries()),d=u.next();!d.done;d=u.next()){var p=(0,w.zs)(d.value,2),h=p[0],f=p[1];if(c+=h.length,"string"==typeof f)c+=new s().encode(f).length;else{if(!(f instanceof Blob))return;c+=f.size}if(++l>=t)return}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}o=c}else if(e instanceof ReadableStream){i=e;return}return o}}var nI=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 r=this.response.headers,n={};return null===(t=null==r?void 0:r.forEach)||void 0===t||t.call(r,function(e,t){n[t]=e}),nR(n,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,r=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n}
1,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,w.sH)(this,void 0,void 0,function(){return(0,w.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,w.sH)(this,void 0,void 0,function(){return(0,w.YH)(this,function(r){switch(r.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,nA(r.sent(),e,t)]}})})},e}(),nk=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}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,r,n={},o=this.headersString.split("\r\n");try{for(var i=(0,w.Ju)(o),a=i.next();!a.done;a=i.next()){var s=a.value,c=(0,w.zs)(s.split(": "),2),l=c[0],u=c[1];l&&u&&(n[l]=u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return nR(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,w.sH)(this,void 0,void 0,function(){var r;return(0,w.YH)(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(nw(r,e,t),[2,r]):[2,null]})})},e}();function nA(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return nw(n,t,r),n}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(f||(f={}));var nx="[REDACTED]",nR=function(e,t){var r,n,o=t.allow,i=void 0===o?[]:o,a=t.strategy,s=void 0===a?f.REMOVE:a,c=(0,w.fX)([],(0,w.zs)(eo.L),!1),l={};try{for(var u=(0,w.Ju)(Object.keys(e)),d=u.next();!d.done;d=u.next()){var p=d.value;!function(t){var r=t.toLowerCase();c.find(function(e){return e.toLowerCase()===r})?s===f.REDACT&&(l[t]=nx):i.find(function(e){return e.toLowerCase()===r})?l[t]=e[t]:s===f.REDACT&&(l[t]=nx)}(p)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return l},nP=function(){function e(e,t,r,n,o,i,a,s,c,l,u){void 0===a&&(a=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=o,this.requestWrapper=i,this.status=a,this.duration=s,this.responseWrapper=c,this.error=l,this.endTime=u}return e.prototype.toSerializable=function(){var e,t,r,n;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?void 0:e.headers((0,w.fX)([],(0,w.zs)(eo.j7),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers((0,w.fX)([],(0,w.zs)(eo.j7),!1)),responseBodySize:null===(n=this.responseWrapper)||void 0===n?void 0:n.bodySize}).filter(function(e){var t=(0,w.zs)(e,2);return void 0!==(t[0],t[1])}))},e}(),nO=function(e,t){void 0===t&&(t=j()),this.callback=e,this.id=t};function nN(e){try{e()}catch(e){}}var nM=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=H();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=H();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,o,i,a,s,c,l,u,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var p=null===(o=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.XMLHttpRequest)||void 0===n?void 0:n.prototype)||void 0===o?void 0:o.open,h=null===(s=null===(a=null===(i=this.globalScope)||void 0===i?void 0:i.XMLHttpRequest)||void 0===a?void 0:a.prototype)||void 0===s?void 0:s.send,f=null===(u=null===(l=null===(c=this.globalScope)||void 0===c?void 0:c.XMLHttpRequest)||void 0===l?void 0:l.prototype)||void 0===u?void 0:u.setRequestHeader;p&&h&&f&&this.observeXhr(p,h,f);var g=null===(d=this.globalScope)||void 0===d?void 0:d.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(r){try{r.callback(e)}catch(e){nN(function(){var r;null===(r=t.logger)||void 0===r||r.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,o,i,a){if(void 0!==i&&void 0!==a){var s,c,l,u,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(c=t.url,d=t.method):c=null===(s=null==t?void 0:t.toString)||void 0===s?void 0:s.call(t),c)try{var p=new URL(c);c="".concat(p.protocol,"//").concat(p.host).concat(p.pathname).concat(p.search).concat(p.hash)}catch(e){}d=(null==r?void 0:r.method)||d,n&&(l=n.status),o&&(u={name:o.name||"UnknownError",message:o.message||"An unknown error occurred"},l=0);var h=Math.floor(performance.now()-a),f=Math.floor(i+h),g=new nP(e,d,i,i,c,r,l,h,n,u,f);this.triggerEventCallbacks(g)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null==performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(r,n){return(0,w.sH)(t,void 0,void 0,function(){var t,o,i,a=this;return(0,w.YH)(this,function(s){switch(s.label){case 0:try{t=this.getTimestamps()}catch(e){nN(function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e(r,n)];case 2:return o=s.sent(),[3,4];case 3:return i=s.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new nC(n):void 0,o?new nI(o):void 0,i,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){nN(function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(o)return[2,o];throw i}})})})},e.createXhrJsonParser=function(e,t){return function(){var r;try{if("json"===e.responseType){if(null===(r=t.globalScope)||void 0===r?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){r instanceof Error&&"InvalidStateError"===r.name&&nN(function(){var r;return null===(r=t.logger)||void 0===r?void 0:r.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})}return null}},e.prototype.observeXhr=function(t,r,n){if(this.globalScope&&t&&r){var o=this.globalScope.XMLHttpRequest.prototype,i=this;o.open=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=(0,w.zs)(r,2),a=o[0],s=o[1];try{this.$$AmplitudeAnalyticsEvent=(0,w.Cl)({method:a,url:null===(e=null==s?void 0:s.toString)||void 0===e?void 0:e.call(s),headers:{}},i.getTimestamps())}catch(e){nN(function(){var t;return null===(t=i.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return t.apply(this,r)},o.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=this,a=e.createXhrJsonParser(this,i),s=t[0],c=o.$$AmplitudeAnalyticsEvent;return o.$$AmplitudeAnalyticsEvent&&o.addEventListener("loadend",function(){try{var e=o.getAllResponseHeaders(),t=o.getResponseHeader("content-length"),r=new nk(o.status,e,t?parseInt(t,10):void 0,a),n=o.$$AmplitudeAnalyticsEvent.headers,l=new n_(s,n);c.status=o.status,i.handleNetworkRequestEvent("xhr",{url:c.url,method:c.method},l,r,void 0,c.startTime,c.durationStart)}catch(e){nN(function(){var t;return null===(t=i.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),r.apply(o,t)},o.setRequestHeader=function(e,t){try{var r=this.$$AmplitudeAnalyticsEvent;r&&(r.headers[e]=t)}catch(e){nN(function(){var t;return null===(t=i.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}n.apply(this,[e,t])}}},e}()),nD="[Amplitude] Network Request",nL="500-599";function nU(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function nq(e,t){var r,n,o=t.split(",");try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),a=i.next();!a.done;a=i.next()){var s=a.value,c=ny(s.split("-").map(Number),2),l=c[0],u=c[1];if(e===l&&void 0===u||e>=l&&e<=u)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1}function nH(e){var t;if(e)try{var r=null===(t=H())||void 0===t?void 0:t.location.href,n=new URL(e,r),o=n.searchParams.toString(),i=n.hash.replace("#",""),a=n.href,s=n.host;n.hash="",n.search="";var c=n.href;return{query:o,fragment:i,href:a,hrefWithoutQueryOrHash:c,host:s}}catch(e){return}}function nF(e){return"object"!=typeof e||null===e?e?nb([],ny(eo.j7),!1):void 0:0!==e.length?e:void 0}function nj(e){var t,r;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.blocklist)||void 0===r?void 0:r.length)}(g||(g={})).NetworkObservable="networkObservable";var nz=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new(rl())(function(e){var r=new nO(function(t){var r={event:t,timestamp:Date.now(),type:"network"};e.next(r)});return nM.subscribe(r,t),function(){nM.unsubscribe(r)}});return(e={})[g.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(o,i){return nv(void 0,void 0,void 0,function(){var a;return nm(this,function(s){var c,l,u,d,p;return"undefined"==typeof document||(a=n(),t=null==o?void 0:o.loggerProvider,l=(c={allObservables:a,networkTrackingOptions:e,amplitude:i,loggerProvider:t}).allObservables,u=c.networkTrackingOptions,d=c.amplitude,p=c.loggerProvider,v=l.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var r,n,o=nH(e.url);if(!o)return!1;var i=o.host;return!(!1!==t.ignoreAmplitudeRequests&&(nU(i,"*.amplitude.com")||nU(i,"amplitude.com"))||(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return nU(i,e)}))||!t.captureRules&&void 0!==e.status&&!nq(e.status,nL)||t.captureRules&&(nb([],ny(t.captureRules),!1).reverse().find(function(t){var r,o,a;if(r=e.status,o=e.url,a=e.method,n=t.hosts&&!t.hosts.find(function(e){return nU(i,e)})||o&&t.urls&&!rA(o,t.urls)||a&&t.methods&&!t.methods.find(function(e){return a.toLowerCase()===e.toLowerCase()||"*"===e})?void 0:!r&&0!==r||!!nq(r,t.statusCodeRange||nL)){var s=nF(t.responseHeaders);if(e.responseWrapper&&s){var c=e.responseWrapper.headers(s);c&&(e.responseHeaders=c)}var l=nF(t.requestHeaders);if(e.requestWrapper&&l){var u=e.requestWrapper.headers(l);u&&(e.requestHeaders=u)}e.responseWrapper&&t.responseBody&&!nj(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!nj(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==n}),!n)||e.requestWrapper&&function(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find(function(e){return e.event_type===nD}))return!0}catch(e){}return!1}(i,e.requestWrapper))}(e.event,u)}).subscribe(function(e){var t,r,n,o=e.event,i=nH(o.url);if(i){var a=null===(r=o.responseWrapper)||void 0===r?void 0:r.bodySize,s=null===(n=o.requestWrapper)||void 0===n?void 0:n.bodySize;(function(e,t,r,n){nv(this,void 0,void 0,function(){var o,i,a;return nm(this,function(s){switch(s.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(i=(o=ny.apply(void 0,[s.sent(),2]))[0],a=o[1],i)try{e["[Amplitude] Request Body"]=JSON.stringify(i)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch(e){null==n||n.debug("Failed to stringify response body")}s.label=2;case 2:return null==r||r.track(nD,e),[2]}})})})(((t={})["[Amplitude] URL"]=i.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=i.query,t["[Amplitude] URL Fragment"]=i.fragment,t["[Amplitude] Request Method"]=o.method,t["[Amplitude] Status Code"]=o.status,t["[Amplitude] Start Time"]=o.startTime,t["[Amplitude] Completion Time"]=o.endTime,t["[Amplitude] Duration"]=o.duration,t["[Amplitude] Request Body Size"]=s,t["[Amplitude] Response Body Size"]=a,t["[Amplitude] Request Type"]=o.type,t["[Amplitude] Request Headers"]=o.requestHeaders,t["[Amplitude] Response Headers"]=o.responseHeaders,t),o,d,p)}}),null==t||t.log("".concat(r," has been successfully added."))),[2]})})},execute:function(e){return nv(void 0,void 0,void 0,function(){return nm(this,function(t){return[2,e]})})},teardown:function(){return nv(void 0,void 0,void 0,function(){return nm(this,function(e){return v.unsubscribe(),[2]})})}}};function nB(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function nK(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;let nG=-1,nY=e=>{addEventListener("pageshow",t=>{t.persisted&&(nG=t.timeStamp,e(t))},!0)},nV=(e,t,r,n)=>{let o,i;return a=>{t.value>=0&&(a||n)&&((i=t.value-(o??0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},nW=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},nJ=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},n$=()=>{let e=nJ();return e?.activationStart??0},nQ=(e,t=-1)=>{let r=nJ(),n="navigate";return nG>=0?n="back-forward-cache":r&&(document.prerendering||n$()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:n}},nX=new WeakMap;function nZ(e,t){return nX.get(e)||nX.set(e,new t),nX.get(e)}class n0{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}let n1=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},n2=e=>{let t=!1;return()=>{t||(e(),t=!0)}},n3=-1,n4=new Set,n5=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,n6=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of n4)e();isFinite(n3)||(n3="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",n6,!0))}},n8=()=>{if(n3<0){let e=n$();n3=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??n5(),addEventListener("visibilitychange",n6,!0),addEventListener("prerenderingchange",n6,!0),nY(()=>{setTimeout(()=>{n3=n5()})})}return{get firstHiddenTime(){return n3},onHidden(e){n4.add(e)}}},n7=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},n9=[1800,3e3],oe=(e,t={})=>{n7(()=>{let r=n8(),n,o=nQ("FCP"),i=n1("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(i.disconnect(),t.startTime<r.firstHiddenTime&&(o.value=Math.max(t.startTime-n$(),0),o.entries.push(t),n(!0)))});i&&(n=nV(e,o,n9,t.reportAllChanges),nY(r=>{n=nV(e,o=nQ("FCP"),n9,t.reportAllChanges),nW(()=>{o.value=performance.now()-r.timeStamp,n(!0)})}))})},ot=[.1,.25],or=(e,t={})=>{let r=n8();oe(n2(()=>{let n,o=nQ("CLS",0),i=nZ(t,n0),a=e=>{for(let t of e)i.h(t);i.i>o.value&&(o.value=i.i,o.entries=i.o,n())},s=n1("layout-shift",a);s&&(n=nV(e,o,ot,t.reportAllChanges),r.onHidden(()=>{a(s.takeRecords()),n(!0)}),nY(()=>{i.i=0,n=nV(e,o=nQ("CLS",0),ot,t.reportAllChanges),nW(()=>n())}),setTimeout(n))}))},on=0,oo=1/0,oi=0,oa=e=>{for(let t of e)t.interactionId&&(oo=Math.min(oo,t.interactionId),on=(oi=Math.max(oi,t.interactionId))?(oi-oo)/7+1:0)},os=()=>n?on:performance.interactionCount??0,oc=()=>{"interactionCount"in performance||n||(n=n1("event",oa,{type:"event",buffered:!0,durationThreshold:0}))},ol=0;class ou{u=[];l=new Map;m;p;v(){ol=os(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((os()-ol)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>
1t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(r)}}}let od=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=n2(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},op=[200,500],oh=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let r=n8();n7(()=>{oc();let n,o=nQ("INP"),i=nZ(t,ou),a=e=>{od(()=>{for(let t of e)i.h(t);let t=i.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,n())})},s=n1("event",a,{durationThreshold:t.durationThreshold??40});n=nV(e,o,op,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{a(s.takeRecords()),n(!0)}),nY(()=>{i.v(),n=nV(e,o=nQ("INP"),op,t.reportAllChanges)}))})};class of{m;h(e){this.m?.(e)}}let og=[2500,4e3],ov=(e,t={})=>{n7(()=>{let r=n8(),n,o=nQ("LCP"),i=nZ(t,of),a=e=>{for(let a of(t.reportAllChanges||(e=e.slice(-1)),e))i.h(a),a.startTime<r.firstHiddenTime&&(o.value=Math.max(a.startTime-n$(),0),o.entries=[a],n())},s=n1("largest-contentful-paint",a);if(s){n=nV(e,o,og,t.reportAllChanges);let r=n2(()=>{a(s.takeRecords()),s.disconnect(),n(!0)}),i=e=>{e.isTrusted&&(od(r),removeEventListener(e.type,i,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,i,{capture:!0});nY(r=>{n=nV(e,o=nQ("LCP"),og,t.reportAllChanges),nW(()=>{o.value=performance.now()-r.timeStamp,n(!0)})})}})},om=[800,1800],oy=e=>{document.prerendering?n7(()=>oy(e)):"complete"!==document.readyState?addEventListener("load",()=>oy(e),!0):setTimeout(e)},ob=(e,t={})=>{let r=nQ("TTFB"),n=nV(e,r,om,t.reportAllChanges);oy(()=>{let o=nJ();o&&(r.value=Math.max(o.responseStart-n$(),0),r.entries=[o],n(!0),nY(()=>{(n=nV(e,r=nQ("TTFB",0),om,t.reportAllChanges))(!0)}))})};function ow(e){var t,r;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0,performance.timeOrigin+r)),navigationStart:Math.floor(performance.timeOrigin)}}var oE=function(){var e=null,t=H(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,o){return nB(void 0,void 0,void 0,function(){var i,a;return nK(this,function(s){return void 0===r||(i=rx((null==n?void 0:n.href)||"",t.loggerProvider),a={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":i,"[Amplitude] Page Path":rx((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":rx(i.split("?")[0],t.loggerProvider)},ov(function(e){a["[Amplitude] LCP"]=ow(e)}),oe(function(e){a["[Amplitude] FCP"]=ow(e)}),oh(function(e){a["[Amplitude] INP"]=ow(e)}),or(function(e){a["[Amplitude] CLS"]=ow(e)}),ob(function(e){a["[Amplitude] TTFB"]=ow(e)}),e=function(){"hidden"===r.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",a),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return nB(void 0,void 0,void 0,function(){return nK(this,function(t){return[2,e]})})},teardown:function(){return nB(void 0,void 0,void 0,function(){return nK(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}},oS=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[eo.r,t,e.substring(0,r)].filter(Boolean).join("_")},oC=function(){function e(e,t){var r;this.shouldTrackNewCampaign=!1,this.options=A({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:tk((null===(r=t.cookieOptions)||void 0===r?void 0:r.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=oS(t.apiKey,"MKTG"),this.webExpStorageKey=oS(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=eo.F3,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return R(this,void 0,void 0,function(){var e,t;return P(this,function(r){switch(r.label){case 0:if(this.options.optOut)return[2];return[4,this.fetchCampaign()];case 1:if(t=N.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||eI(this.sessionTimeout,this.lastEventTime),!t_(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return R(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=t.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||new tW().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n=(t=this.currentCampaign,r=this.options,eE(Object.entries(A(A({},eo.F3),t)).reduce(function(e,t){var n,o=N(t,2),i=o[0],a=o[1];return(e.setOnce("initial_".concat(i),null!==(n=null!=a?a:r.initialEmptyValue)&&void 0!==n?n:"EMPTY"),a)?e.set(i,a):e.unset(i)},new ew.T$)));return e&&(n.event_id=e),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),o_=function(){return(o_=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function oT(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function oI(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function ok(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}Object.create,Object.create;var oA=("function"==typeof SuppressedError&&SuppressedError,"AMP_CURRENT_PAGE"),ox="AMP_PREVIOUS_PAGE",oR="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(m||(m={}));var oP=new Set([s.IDENTIFY,s.GROUP_IDENTIFY,s.REVENUE]),oO=function(e){var t=(void 0===e?{}:e).internalDomains,r=void 0===t?[]:t,n=H(),o=void 0,i=!1,a=void 0,s=!1,c=!1,l=function(e){var t;try{var r=rx(e,a);
1t=new URL(r).hostname}catch(e){null==a||a.error("Could not parse URL: ",e)}return t},u=function(e){var t="undefined"!=typeof location&&location.hostname||"",n=e?l(e):void 0;if(!n)return m.Direct;var o=r.some(function(e){return -1!==t.indexOf(e)}),i=r.some(function(e){return -1!==n.indexOf(e)});return t===n||i&&o?m.Internal:m.External},d=function(){oT(void 0,void 0,void 0,function(){var e,t,r,n,a;return oI(this,function(s){switch(s.label){case 0:if(!(o&&i))return[3,3];return[4,o.get(oR)];case 1:return e=s.sent(),t=rx("undefined"!=typeof location&&location.href||""),r=(null==e?void 0:e[oA])||"",n=void 0,n=t===r?(null==e?void 0:e[ox])||"":r||document.referrer||"",[4,o.set(oR,((a={})[oA]=t,a[ox]=n,a))];case 2:s.sent(),s.label=3;case 3:return[2]}})})};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return oT(void 0,void 0,void 0,function(){return oI(this,function(t){switch(t.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),c=!0,!n)return[3,2];return[4,(o=new e6(n.sessionStorage)).isEnabled()];case 1:i=t.sent(),n.addEventListener("popstate",d),s||(n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=ok(r,3),o=n[0],i=n[1],a=n[2];e.apply(t,[o,i,a]),c&&d()}}),n.history.replaceState=new Proxy(n.history.replaceState,{apply:function(e,t,r){var n=ok(r,3),o=n[0],i=n[1],a=n[2];e.apply(t,[o,i,a]),c&&d()}}),s=!0),t.label=2;case 2:return[2]}})})},execute:function(e){return oT(void 0,void 0,void 0,function(){var t,r,n,a,s;return oI(this,function(c){switch(c.label){case 0:if(t=rx("undefined"!=typeof location&&location.href||""),!(o&&i))return[3,5];return[4,o.get(oR)];case 1:if(null==(r=c.sent())?void 0:r[oA])return[3,3];return[4,o.set(oR,((s={})[oA]=t,s[ox]=document.referrer||"",s))];case 2:c.sent(),c.label=3;case 3:return[4,o.get(oR)];case 4:if(n=c.sent(),a="",n&&(a=n[ox]||""),oP.has(e.event_type))return[2,e];e.event_properties=o_(o_({},e.event_properties||{}),{"[Amplitude] Page Domain":oN(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":oN(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":oN(e,"[Amplitude] Page Path","undefined"!=typeof location&&rx(location.pathname)||""),"[Amplitude] Page Title":oN(e,"[Amplitude] Page Title",tV(tY)),"[Amplitude] Page URL":oN(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":a,"[Amplitude] Previous Page Type":u(a)}),c.label=5;case 5:return[2,e]}})})},teardown:function(){return oT(void 0,void 0,void 0,function(){return oI(this,function(e){switch(e.label){case 0:if(n&&(n.removeEventListener("popstate",d),c=!1),!(o&&i))return[3,2];return[4,o.set(oR,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function oN(e,t,r){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?r:e.event_properties[t]}var oM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t._enableRequestBodyCompressionExperimentalValue=!1,t}return k(t,e),t.prototype.init=function(e,t,r){var n,o;return void 0===e&&(e=""),arguments.length>2?(n=t,o=r):"string"==typeof t?(n=t,o=void 0):(n=null==t?void 0:t.userId,o=t),D(this._init(A(A({},o),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,a,s,c,l,u;return R(this,void 0,void 0,function(){var d,p,h,f,g,v,m,y,b,w,E,S,C,_,T=this;return P(this,function(I){var k,D,L,q,H,F;switch(I.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,d=tM(t),p=null!==(r=t.loggerProvider)&&void 0!==r?r:new U,t.loggerProvider||p.enable(null!==(n=t.logLevel)&&void 0!==n?n:o.Warn),h=null!==(i=t.serverZone)&&void 0!==i?i:"US",g=this._diagnosticsSampleRate,v=null===(a=t.enableDiagnostics)||void 0===a||a,!d)return[3,2];return f=new B(t.apiKey,p,h,null===(s=t.remoteConfig)||void 0===s?void 0:s.serverUrl),[4,new Promise(function(e){null==f||f.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(p.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var o=t.sampleRate;"number"!=typeof o||isNaN(o)||(g=o);var i=t.enabled;"boolean"==typeof i&&(v=i)}e()})})];case 1:I.sent(),I.label=2;case 2:return(m=new ee(t.apiKey,p,h,{enabled:v,sampleRate:g})).setTag("library","".concat(e$,"/").concat(eJ)),"undefined"!=typeof navigator&&m.setTag("user_agent",navigator.userAgent),[4,(k=t.apiKey,D=t,L=this,q=m,H={loggerProvider:p,serverZone:h,enableDiagnostics:v,diagnosticsSampleRate:g},void 0===D&&(D={}),R(void 0,void 0,void 0,function(){var e,t,r,n,o,i,a,s,c,l,u,d,p,h,f,g,v,m,y,b,w,E,S,C,_,T,I,x,O,M,U,F,z,B,K,G,Y,V,W,J,$,Q,X,Z,ee,er,en,ei,ea,es,ec;return P(this,function(el){var eu,ed,ep;switch(el.label){case 0:if(e=D.identityStorage||tE,t="",!(e===tE&&!(null===(E=D.cookieOptions)||void 0===E?void 0:E.domain)&&(null===(S=D.c
1ookieOptions)||void 0===S?void 0:S.domain)!==""))return[3,2];return[4,(eu=void 0,R(void 0,void 0,void 0,function(){var e,t,r,n,o,i,a;return P(this,function(s){switch(s.label){case 0:return[4,new e0(void 0,{diagnosticsClient:q}).isEnabled()];case 1:if(!s.sent()||!eu&&("undefined"==typeof location||!location.hostname)||1===(t=(e=null!=eu?eu:location.hostname).split(".")).length)return[2,""];for(r=[],n=1,tx.find(function(t){return e.endsWith(".".concat(t))})&&(n=2),o=t.length-n-1;o>=0;--o)r.push(t.slice(o).join("."));o=0,s.label=2;case 2:if(!(o<r.length))return[3,7];i=r[o],s.label=3;case 3:return s.trys.push([3,5,,6]),[4,e0.isDomainWritable(i)];case 4:if(s.sent())return[2,"."+i];return[3,6];case 5:return a=s.sent(),q&&q.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(i),error:a instanceof Error?a.message:String(a)}),[3,6];case 6:return o++,[3,2];case 7:return q&&q.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}})}))];case 1:t=el.sent(),el.label=2;case 2:return r=A({domain:null!==(_=null===(C=D.cookieOptions)||void 0===C?void 0:C.domain)&&void 0!==_?_:t,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},D.cookieOptions),n={duplicateResolverFn:function(e){var t=e3(e);return!!t&&e4(JSON.parse(t).cookieDomain,r.domain)},diagnosticsClient:q},[4,(ed=o=tN(D.identityStorage,r,n),void 0===(ep=null===(I=null===(T=D.cookieOptions)||void 0===T?void 0:T.upgrade)||void 0===I||I)&&(ep=!0),R(void 0,void 0,void 0,function(){var e,t,r,n,o,i,a,s,c;return P(this,function(l){switch(l.label){case 0:return e="".concat(eo.r.toLowerCase(),"_").concat(k.substring(0,6)),[4,ed.getRaw(e)];case 1:if(!(t=l.sent()))return[2,{optOut:!1}];if(!ep)return[3,3];return[4,ed.remove(e)];case 2:l.sent(),l.label=3;case 3:return n=(r=N(t.split("."),6))[0],o=r[1],i=r[2],a=r[3],s=r[4],c=r[5],[2,{deviceId:n,userId:ta(o),sessionId:ti(a),lastEventId:ti(c),lastEventTime:ti(s),optOut:!!i}]}})}))];case 3:return i=el.sent(),[4,o.get(e5(k))];case 4:return a=el.sent(),l=!(c=(s=et()).ampTimestamp?Number(s.ampTimestamp):void 0)||Date.now()<c,u=null!==(F=null!==(U=null!==(M=null!==(x=D.deviceId)&&void 0!==x?x:l?null!==(O=s.ampDeviceId)&&void 0!==O?O:s.deviceId:void 0)&&void 0!==M?M:null==a?void 0:a.deviceId)&&void 0!==U?U:i.deviceId)&&void 0!==F?F:j(),d=null!==(z=null==a?void 0:a.lastEventId)&&void 0!==z?z:i.lastEventId,p=null!==(B=null==a?void 0:a.lastEventTime)&&void 0!==B?B:i.lastEventTime,h=null!==(G=null!==(K=D.optOut)&&void 0!==K?K:null==a?void 0:a.optOut)&&void 0!==G?G:i.optOut,f=null!==(Y=null==a?void 0:a.sessionId)&&void 0!==Y?Y:i.sessionId,g=null==a?void 0:a.deferredSessionId,v=null!==(W=null!==(V=D.userId)&&void 0!==V?V:null==a?void 0:a.userId)&&void 0!==W?W:i.userId,L.previousSessionDeviceId=null!==(J=null==a?void 0:a.deviceId)&&void 0!==J?J:i.deviceId,L.previousSessionUserId=null!==($=null==a?void 0:a.userId)&&void 0!==$?$:i.userId,m={ipAddress:null===(X=null===(Q=D.trackingOptions)||void 0===Q?void 0:Q.ipAddress)||void 0===X||X,language:null===(ee=null===(Z=D.trackingOptions)||void 0===Z?void 0:Z.language)||void 0===ee||ee,platform:null===(en=null===(er=D.trackingOptions)||void 0===er?void 0:er.platform)||void 0===en||en},y=null==a?void 0:a.pageCounter,b=null==a?void 0:a.debugLogsEnabled,void 0!==D.autocapture&&(D.defaultTracking=D.autocapture),[4,(w=new tO(k,D.appVersion,o,r,D.defaultTracking,D.autocapture,u,D.flushIntervalMillis,D.flushMaxRetries,D.flushQueueSize,e,D.ingestionMetadata,D.instanceName,d,p,null!==(ei=null==H?void 0:H.loggerProvider)&&void 0!==ei?ei:D.loggerProvider,D.logLevel,D.minIdLength,D.offline,h,D.partnerId,D.plan,D.serverUrl,null!==(ea=null==H?void 0:H.serverZone)&&void 0!==ea?ea:D.serverZone,f,g,D.sessionTimeout,D.storageProvider,m,D.transport,D.useBatch,D.fetchRemoteConfig,v,y,b,D.networkTrackingOptions,D.identify,null!==(es=null==H?void 0:H.enableDiagnostics)&&void 0!==es?es:D.enableDiagnostics,null!==(ec=null==H?void 0:H.diagnosticsSampleRate)&&void 0!==ec?ec:L._diagnosticsSampleRate,q,D.remoteConfig,t,D.enableRequestBodyCompression,L._enableRequestBodyCompressionExperimentalValue)).storageProvider.isEnabled()];case 5:return el.sent()||(w.loggerProvider.warn("Storage provider ".concat(w.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),w.storageProvider=new eX),[2,w]}})}))];case 3:if(y=I.sent(),!(d&&f))return[3,5];return[4,new Promise(function(e){null==f||f.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){y.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&function(e,t){if(e){!function e(t){if(!("object"!=typeof t||null===t||Array.isArray(t))){var r,n,o,i,a,s,c,l,u,d,p,h=Object.keys(t);try{for(var f=O(h),g=f.next();!g.done;g=f.next()){var v=g.value;try{var m=t[v];"boolean"==typeof(null==m?void 0:m.enabled)&&(m.enabled?(delete m.enabled,0===Object.keys(m).length&&(t[v]=!0)):t[v]=!1),e(m)}catch(e){}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}
1try{if(null===(u=null===(l=null===(c=t.autocapture)||void 0===c?void 0:c.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===u?void 0:u.length)try{for(var y=O(t.autocapture.networkTracking.captureRules),b=y.next();!b.done;b=y.next()){var w=b.value;try{for(var E=(a=void 0,O(["responseHeaders","requestHeaders"])),S=E.next();!S.done;S=E.next()){var C=S.value,_=null!==(d=w[C])&&void 0!==d?d:{},T=_.captureSafeHeaders,I=_.allowlist;if(T||I){if(void 0!==I&&!Array.isArray(I)){delete w[C];continue}w[C]=M(M([],N(T?eo.j7:[]),!1),N(null!=I?I:[]),!1)}}}catch(e){a={error:e}}finally{try{S&&!S.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}}}catch(e){o={error:e}}finally{try{b&&!b.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}}catch(e){}var k=null===(p=t.autocapture)||void 0===p?void 0:p.frustrationInteractions;k&&(k.rageClick&&(k.rageClicks=k.rageClick,delete k.rageClick),k.deadClick&&(k.deadClicks=k.deadClick,delete k.deadClick))}}(e);try{var r,n,o,i,a,s,c;if(t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var l=A({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null===(o=e.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===o?void 0:o.length)){l.elementInteractions=A({},e.autocapture.elementInteractions);var u=l.elementInteractions,d=null!==(i=u.pageUrlAllowlist)&&void 0!==i?i:[],p=e.autocapture.elementInteractions.pageUrlAllowlistRegex;u.pageUrlAllowlist=t7(d,p,t),delete u.pageUrlAllowlistRegex}if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null===(a=e.autocapture.networkTracking.captureRules)||void 0===a?void 0:a.length)){l.networkTracking=A({},e.autocapture.networkTracking);var h=l.networkTracking,f=null!==(s=h.captureRules)&&void 0!==s?s:[];try{for(var g=O(f),v=g.next();!v.done;v=g.next()){var m=v.value;m.urls=t7(null!==(c=m.urls)&&void 0!==c?c:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=A({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),"object"==typeof t.autocapture&&(t.autocapture=A(A({},t.autocapture),l))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,y),e()})})];case 4:I.sent(),I.label=5;case 5:return[4,e.prototype._init.call(this,y)];case 6:if(I.sent(),this.logBrowserOptions(y),this.config.remoteConfigClient=f,!eO(this.config.defaultTracking))return[3,8];return this.config.optOut&&this.timeline.addOptOutListener(function(e){return R(T,void 0,void 0,function(){var t;return P(this,function(r){switch(r.label){case 0:if(e)return[3,2];return t=eB(this.config),this.webAttribution=new oC(t,this.config),[4,this.webAttribution.init()];case 1:r.sent(),r.label=2;case 2:return[2]}})})}),b=eB(this.config),this.webAttribution=new oC(b,this.config),[4,this.webAttribution.init()];case 7:I.sent(),I.label=8;case 8:if(S=!(!(E=(w=et()).ampTimestamp?Number(w.ampTimestamp):void 0)||Date.now()<E)||Number.isNaN(Number(w.ampSessionId))?void 0:Number(w.ampSessionId),-1!==(C=this.config.deferredSessionId)||this.config.optOut||(C=Date.now()),this.setSessionId(null!==(u=null!==(l=null!==(c=t.sessionId)&&void 0!==c?c:S)&&void 0!==l?l:C)&&void 0!==u?u:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return R(T,void 0,void 0,function(){return P(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(_=ei(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),!(this.config.offline!==ec))return[3,10];return[4,this.add(t8()).promise];case 9:I.sent(),I.label=10;case 10:return[4,this.add(new ey({diagnosticsClient:m})).promise];case 11:return I.sent(),[4,this.add(new eQ).promise];case 12:return I.sent(),[4,this.add(new eb).promise];case 13:if(I.sent(),t6(this.config),!eP(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(t4()).promise];case 14:I.sent(),I.label=15;case 15:if(!eN(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(t1()).promise];case 16:I.sent(),I.label=17;case 17:if(!eM(this.config.defaultTracking))return[3,20];if(this.config.optOut)return[3,19];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(tQ(ez(this.config))).promise];case 18:return I.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return R(T,void 0,void 0,function(){return P(this,function(t){switch(t.label){case 0:if(e)return[2];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(tQ(ez(this.config))).promise];case 1:return t.sent(),[2]}})})}),I.label=20;case 20:if(!eU(this.config.autocapture))return[3,22];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(nr(eH(this.config),{diagnosticsClient:m})).promise];case 21:I.sent(),I.label=22;case 22:if(!eq(this.config.autocapture))return[3,24];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(ng(eF(this.config))).promise];case 23:I.sent(),I.label=24;case 24:if(!eL(this.config.autocapture))return[3,26];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(nz(ej(this.config))).promise];
1case 25:I.sent(),I.label=26;case 26:if(!("boolean"==typeof(F=this.config.autocapture)?F:"object"==typeof F&&!0===F.webVitals))return[3,28];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(oE()).promise];case 27:I.sent(),I.label=28;case 28:if(!eP(this.config.autocapture,"pageUrlEnrichment"))return[3,30];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(oO()).promise];case 29:I.sent(),I.label=30;case 30:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 31:return I.sent(),_.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=x(t,["time"]);T.track(e.eventType,n,"number"==typeof r?{time:r}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){if(!this.config){this.q.push(this.setUserId.bind(this,e));return}this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),ea(e,this.config.instanceName))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){if(!this.config){this.q.push(this.setDeviceId.bind(this,e));return}this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),es(e,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(j()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var t,r,n,o=new ew.T$,i=null!==(n=e.userProperties)&&void 0!==n?n:{};try{for(var a=O(Object.entries(i)),s=a.next();!s.done;s=a.next()){var c=N(s.value,2),l=c[0],u=c[1];o.set(l,u)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}this.identify(o)}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),D(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,D(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return D(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var o=this.config.lastEventTime,i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,eD(this.config.defaultTracking)&&(n&&o&&r.push(this.track(tp,void 0,{device_id:this.previousSessionDeviceId,event_id:++i,session_id:n,time:o+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++i,r);return this.config.identify&&r.push(this.track(eE(this.config.identify)).promise),eD(this.config.defaultTracking)&&r.push(this.track(td,void 0,{event_id:a?++i:i,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,D(Promise.all(r))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(e){if(!this.config){this.q.push(this.setTransport.bind(this,e));return}this.config.transportProvider=tD(e)},t.prototype.identify=function(t,r){if(eV(t)){var n=t._q;t._q=[],t=eY(new ew.T$,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,o){if(eV(n)){var i=n._q;n._q=[],n=eY(new ew.T$,i)}return e.prototype.groupIdentify.call(this,t,r,n,o)},t.prototype.revenue=function(t,r){if(eV(t)){var n=t._q;t._q=[],t=eY(new eT,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var r=this.webAttribution.generateCampaignEvent(e);
1return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return R(this,void 0,void 0,function(){var r,n,o;return P(this,function(i){return r=Date.now(),n=eI(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===td||t.event_type===tp||t.session_id&&t.session_id!==this.getSessionId()||(n||o?(this.setSessionId(r),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=A(A({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",eA(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t.prototype._enableRequestBodyCompressionExperimental=function(e){if(!this.config){this._enableRequestBodyCompressionExperimentalValue=e;return}},t}(eR),oD=function(){var e=new oM;return{init:T(e.init.bind(e),"init",S(e),_(e,["config"])),add:T(e.add.bind(e),"add",S(e),_(e,["config.apiKey","timeline.plugins"])),remove:T(e.remove.bind(e),"remove",S(e),_(e,["config.apiKey","timeline.plugins"])),track:T(e.track.bind(e),"track",S(e),_(e,["config.apiKey","timeline.queue.length"])),logEvent:T(e.logEvent.bind(e),"logEvent",S(e),_(e,["config.apiKey","timeline.queue.length"])),identify:T(e.identify.bind(e),"identify",S(e),_(e,["config.apiKey","timeline.queue.length"])),groupIdentify:T(e.groupIdentify.bind(e),"groupIdentify",S(e),_(e,["config.apiKey","timeline.queue.length"])),setGroup:T(e.setGroup.bind(e),"setGroup",S(e),_(e,["config.apiKey","timeline.queue.length"])),revenue:T(e.revenue.bind(e),"revenue",S(e),_(e,["config.apiKey","timeline.queue.length"])),flush:T(e.flush.bind(e),"flush",S(e),_(e,["config.apiKey","timeline.queue.length"])),getUserId:T(e.getUserId.bind(e),"getUserId",S(e),_(e,["config","config.userId"])),setUserId:T(e.setUserId.bind(e),"setUserId",S(e),_(e,["config","config.userId"])),getDeviceId:T(e.getDeviceId.bind(e),"getDeviceId",S(e),_(e,["config","config.deviceId"])),setDeviceId:T(e.setDeviceId.bind(e),"setDeviceId",S(e),_(e,["config","config.deviceId"])),reset:T(e.reset.bind(e),"reset",S(e),_(e,["config","config.userId","config.deviceId"])),getSessionId:T(e.getSessionId.bind(e),"getSessionId",S(e),_(e,["config"])),setSessionId:T(e.setSessionId.bind(e),"setSessionId",S(e),_(e,["config"])),extendSession:T(e.extendSession.bind(e),"extendSession",S(e),_(e,["config"])),setOptOut:T(e.setOptOut.bind(e),"setOptOut",S(e),_(e,["config"])),setTransport:T(e.setTransport.bind(e),"setTransport",S(e),_(e,["config"])),getIdentity:T(e.getIdentity.bind(e),"getIdentity",S(e),_(e,["config"])),setIdentity:T(e.setIdentity.bind(e),"setIdentity",S(e),_(e,["config","config.userId","config.deviceId"])),getOptOut:T(e.getOptOut.bind(e),"getOptOut",S(e),_(e,["config"])),_setDiagnosticsSampleRate:T(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",S(e),_(e,["config"])),_enableRequestBodyCompressionExperimental:T(e._enableRequestBodyCompressionExperimental.bind(e),"_enableRequestBodyCompressionExperimental",S(e),_(e,["config"]))}};let oL=oD();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(y||(y={}));var oU=oL.add,oq=oL.extendSession,oH=oL.flush,oF=oL.getDeviceId,oj=oL.getIdentity,oz=oL.getOptOut,oB=oL.getSessionId,oK=oL.getUserId,oG=oL.groupIdentify,oY=oL.identify,oV=oL.init,oW=oL.logEvent,oJ=oL.remove,o$=oL.reset,oQ=oL.revenue,oX=oL.setDeviceId,oZ=oL.setGroup,o0=oL.setIdentity,o1=oL.setOptOut,o2=oL.setSessionId,o3=oL.setTransport,o4=oL.setUserId,o5=oL.track,o6=oL._setDiagnosticsSampleRate,o8=oL._enableRequestBodyCompressionExperimental},10280:(e,t,r)=>{"use strict";r.d(t,{i:()=>p});var n=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:o(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),o=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},i=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var l=function(e,t){var r,n,o=typeof e;if(o!==typeof t)return!1;try{for(var i=s(["string","number","boolean","undefined"]),a=i.next();!a.done;a=i.next())if(a.value===o)return e===t}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var c=Array.isArray(e),u=Array.isArray(t);if(c!==u)return!1;if(c&&u){for(var d=0;d<e.length;d++)if(!l(e[d],t[d]))return!1}else{if(!l(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var p=!0;return Object.keys(e).forEach(function(r){l(e[r],t[r])||(p=!1)}),p}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var u=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=a({},this.identity.userProperties),r=a(a({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,o,i,a,l,u=r.userProperties||{};try{for(var d=s(Object.entries(e)),p=d.next();!p.done;p=d.next()){var h=c(p.value,2),f=h[0],g=h[1];switch(f){case"$set":try{for(var v=(o=void 0,s(Object.entries(g))),m=v.next();!m.done;m=v.next()){var y=c(m.value,2),b=y[0],w=y[1];u[b]=w}}catch(e){o={error:e}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}break;case"$unset":try{for(var E=(a=void 0,s(Object.keys(g))),S=E.next();!S.done;S=E.next()){var b=S.value;delete u[b]}}catch(e){a={error:e}}finally{try{S&&!S.done&&(l=E.return)&&l.call(E)}finally{if(a)throw a.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}return r.userProperties=u,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return a({},this.identity)},e.prototype.setIdentity=function(e){var t=a({},this.identity);this.identity=a({},e),l(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),d="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:self,p=function(){function e(){this.identityStore=new u,this.eventBridge=new i,this.applicationContextProvider=new n}return e.getInstance=function(t){return d.analyticsConnectorInstances||(d.analyticsConnectorInstances={}),d.analyticsConnectorInstances[t]||(d.analyticsConnectorInstances[t]=new e),d.analyticsConnectorInstances[t]},e}()},80048:(e,t,r)=>{"use strict";r.d(t,{Se:()=>c,T$:()=>s});var n,o=r(72881),i=r(24739),a=r(75754),s=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,o.Cl)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(n.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(n.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(n.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(n.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(n.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(n.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(n.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(n.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(n.UNSET,e,i.mG),this},e.prototype.clearAll=function(){return this._properties={},this._properties[n.CLEAR_ALL]=i.mG,this}
1,e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return!(void 0!==this._properties[n.CLEAR_ALL]||this._propertySet.has(t))&&(e===n.ADD?"number"==typeof r:e===n.UNSET||e===n.REMOVE||(0,a.E)(t,r))},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"}(n||(n={}));var c=[n.CLEAR_ALL,n.UNSET,n.SET,n.SET_ONCE,n.ADD,n.APPEND,n.PREPEND,n.PREINSERT,n.POSTINSERT,n.REMOVE]},24739:(e,t,r)=>{"use strict";r.d(t,{Cs:()=>h,Ct:()=>S,F3:()=>A,Gp:()=>I,Jn:()=>f,KY:()=>E,L:()=>R,OP:()=>u,SO:()=>k,VU:()=>g,Wx:()=>v,_9:()=>d,bu:()=>c,e5:()=>a,fL:()=>p,fS:()=>i,h2:()=>m,j7:()=>x,lT:()=>y,mG:()=>n,mJ:()=>s,pL:()=>l,q2:()=>w,qr:()=>C,r:()=>o,tt:()=>T,wX:()=>b,wu:()=>_});var n="-",o="AMP",i="".concat(o,"_unsent"),a="$default_instance",s="https://api2.amplitude.com/2/httpapi",c="https://api.eu.amplitude.com/2/httpapi",l="https://api2.amplitude.com/batch",u="https://api.eu.amplitude.com/batch",d="utm_campaign",p="utm_content",h="utm_id",f="utm_medium",g="utm_source",v="utm_term",m="dclid",y="fbclid",b="gbraid",w="gclid",E="ko_click_id",S="li_fat_id",C="msclkid",_="rdt_cid",T="ttclid",I="twclid",k="wbraid",A={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},x=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],R=["authorization","cookie","set-cookie"]},75754:(e,t,r)=>{"use strict";r.d(t,{E:()=>i,a:()=>o});var n=r(72881),o=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!i(t,r))return!1}return!0},i=function(e,t){var r,i;if("string"!=typeof e)return!1;if(Array.isArray(t)){var a=!0;try{for(var s=(0,n.Ju)(t),c=s.next();!c.done;c=s.next()){var l=c.value;if(Array.isArray(l))return!1;if("object"==typeof l)a=a&&o(l);else if(!["number","string"].includes(typeof l))return!1;if(!a)return!1}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}else if(null==t)return!1;else if("object"==typeof t)return o(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0}},83518:(e,t,r)=>{"use strict";r.d(t,{aj:()=>eX});var n,o,i=r(8457).Buffer,a=function(e,t){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function u(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function h(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var f={IS:"is",IS_NOT:"is not",CONTAINS:"contains",DOES_NOT_CONTAIN:"does not contain",LESS_THAN:"less",LESS_THAN_EQUALS:"less or equal",GREATER_THAN:"greater",GREATER_THAN_EQUALS:"greater or equal",VERSION_LESS_THAN:"version less",VERSION_LESS_THAN_EQUALS:"version less or equal",VERSION_GREATER_THAN:"version greater",VERSION_GREATER_THAN_EQUALS:"version greater or equal",SET_IS:"set is",SET_IS_NOT:"set is not",SET_CONTAINS:"set contains",SET_DOES_NOT_CONTAIN:"set does not contain",SET_CONTAINS_ANY:"set contains any",SET_DOES_NOT_CONTAIN_ANY:"set does not contain any",REGEX_MATCH:"regex match",REGEX_DOES_NOT_MATCH:"regex does not match"},g=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?t[r++]=o:(o<2048?t[r++]=o>>6|192:((64512&o)==55296&&n+1<e.length&&(64512&e.charCodeAt(n+1))==56320?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[r++]=o>>18|240,t[r++]=o>>12&63|128):t[r++]=o>>12|224,t[r++]=o>>6&63|128),t[r++]=63&o|128)}return Uint8Array.from(t)},v=function(e,t){void 0===t&&(t=0);for(var r=g(e),n=r.length,o=n>>2,i=t,a=0;a<o;a++)i=m(w(r,a<<2),i);var s=o<<2,c=0;switch(n-s){case 3:c^=r[s+2]<<16,c^=r[s+1]<<8,c^=r[s],i^=c=Math.imul(c=b(c=Math.imul(c,-0x3361d2af),15),0x1b873593);break;case 2:c^=r[s+1]<<8,c^=r[s],i^=c=Math.imul(c=b(c=Math.imul(c,-0x3361d2af),15),0x1b873593);break;case 1:c^=r[s],i^=c=Math.imul(c=b(c=Math.imul(c,-0x3361d2af),15),0x1b873593)}return y(i^=n)>>>0},m=function(e,t){var r=e,n=t;return n^=r=Math.imul(r=b(r=Math.imul(r,-0x3361d2af),15),0x1b873593),(n=Math.imul(n=b(n,13),5))+-0x19ab949c|0},y=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-0x7a143595),t^=t>>>13,t=Math.imul(t,-0x3d4d51cb),t^=t>>>16},b=function(e,t,r){void 0===r&&(r=32),t>r&&(t%=r);var n=(e&0xffffffff<<r-t>>>0)>>>0>>>r-t>>>0;return(e<<t|n)>>>0},w=function(e,t){return void 0===t&&(t=0),E(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},E=function(e){return(-0x1000000&e)>>>24|(0xff0000&e)>>>8|(65280&e)<<8|(255&e)<<24},S=function(e,t){var r,n;if(t&&0!==t.length){try{for(var o=d(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null!=e)return e}},C="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),_=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(C).exec(t);if(r){var n=Number(r[1]),o=Number(r[2]);if(!(isNaN(n)||isNaN(o)))return new e(n,o,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){if(this.major>e.major)return 1;if(this.major<e.major)return -1;if(this.minor>e.minor)return 1;if(this.minor<e.minor)return -1;if(this.patch>e.patch)return 1;if(this.patch<e.patch||this.preRelease&&!e.preRelease)return -1;if(!this.preRelease&&e.preRelease)return 1;if(this.preRelease&&e.preRelease){if(this.preRelease>e.preRelease)return 1;if(this.preRelease<e.preRelease)return -1}return 0},e}(),T=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,o={},i={context:e,result:o};try{for(var a=d(t),s=a.next();!s.done;s=a.next()){var c=s.value,l=this.evaluateFlag(i,c);l&&(o[c.key]=l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},e.prototype.evaluateFlag=function(e,t){try{for(var r,n,o,i=d(t.segments),a=i.next();!a.done;a=i.next()){var s=a.value;if(o=this.evaluateSegment(e,t,s)){var l=c(c(c({},t.metadata),s.metadata),o.metadata);o=c(c({},o),{metadata:l});break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},e.prototype.evaluateSegment=function(e,t,r){if(!r.conditions){var n=this.bucket(e,r);return void 0!==n?t.variants[n]:void 0}if(this.evaluateConditions(e,r.conditions)){var n=this.bucket(e,r);if(void 0!==n)return t.variants[n]}},e.prototype.evaluateConditions=function(e,t){var r,n,o,i;try{for(var a=d(t),s=a.next();!s.done;s=a.next()){var c=s.value,l=!0;try{for(var u=(o=void 0,d(c)),p=u.next();!p.done;p=u.next()){var h=p.value;if(!(l=this.matchCondition(e,h)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}if(l)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=S(e,t.selector);if(null==r)return this.matchNull(t.op,t.values);if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var o=this.coerceString(r);return void 0!==o&&this.matchString(o,t.op,t.values)},e.prototype.getHash=function(e){return v(e)},e.prototype.bucket=function(e,t){if(!t.bucket)return t.variant;var r,n,o,i,a=this.coerceString(S(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),c=this.getHash(s),l=c%100,u=Math.floor(c/100);try{for(var p=d(t.bucket.allocations),h=p.next();!h.done;h=p.next()){var f=h.value,g=f.range[0],v=f.range[1];if(l>=g&&l<v)try{for(var m=(o=void 0,d(f.distributions)),y=m.next();!y.done;y=m.next()){var b=y.value,w=b.range[0],E=b.range[1];if(u>=w&&u<E)return b.variant}}catch(e){o={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case f.IS:case f.CONTAINS:case f.LESS_THAN:case f.LESS_THAN_EQUALS:case f.GREATER_THAN:case f.GREATER_THAN_EQUALS:case f.VERSION_LESS_THAN:case f.VERSION_LESS_THAN_EQUALS:case f.VERSION_GREATER_THAN:case f.VERSION_GREATER_THAN_EQUALS:case f.SET_IS:case f.SET_CONTAINS:case f.SET_CONTAINS_ANY:return r;case f.IS_NOT:case f.DOES_NOT_CONTAIN:case f.SET_DOES_NOT_CONTAIN:case f.SET_DOES_NOT_CONTAIN_ANY:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case f.SET_IS:return this.setEquals(e,r);case f.SET_IS_NOT:return!this.setEquals(e,r);case f.SET_CONTAINS:return this.matchesSetContainsAll(e,r);case f.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(e,r);case f.SET_CONTAINS_ANY:return this.matchesSetContainsAny(e,r);case f.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case f.IS:return this.matchesIs(e,r);case f.IS_NOT:return!this.matchesIs(e,r);case f.CONTAINS:return this.matchesContains(e,r);case f.DOES_NOT_CONTAIN:return!this.matchesContains(e,r);case f.LESS_THAN:case f.LESS_THAN_EQUALS:case f.GREATER_THAN:case f.GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case f.VERSION_LESS_THAN:case f.VERSION_LESS_THAN_EQUALS:case f.VERSION_GREATER_THAN:case f.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(e,t,r,function(e){return _.parse(e)},this.versionComparator);case f.REGEX_MATCH:return this.matchesRegex(e,r);case f.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var o=d(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,o){var i=this,a=n(e),s=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===a||0===s.length?r.some(function(r){return i.comparator(e,t,r)}):s.some(function(e){return o(a,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case f.LESS_THAN:case f.VERSION_LESS_THAN:return e<r;case f.LESS_THAN_EQUALS:case f.VERSION_LESS_THAN_EQUALS:return e<=r;case f.GREATER_THAN:case f.VERSION_GREATER_THAN:return e>r;case f.GREATER_THAN_EQUALS:case f.VERSION_GREATER_THAN_EQUALS:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case f.LESS_THAN:case f.VERSION_LESS_THAN:return n<0;case f.LESS_THAN_EQUALS:case f.VERSION_LESS_THAN_EQUALS:return n<=0;case f.GREATER_THAN:case f.VERSION_GREATER_THAN:return n>0;case f.GREATER_THAN_EQUALS:case f.VERSION_GREATER_THAN_EQUALS:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return!!new RegExp(t).exec(e)})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){return null==e?void 0:"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e)){var r=e;return r.map(function(e){return t.coerceString(e)}
1).filter(Boolean)}var n=String(e);try{var o=JSON.parse(n);if(Array.isArray(o)){var r=e;return r.map(function(e){return t.coerceString(e)}).filter(Boolean)}var i=this.coerceString(n);return i?[i]:void 0}catch(e){var i=this.coerceString(n);return i?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case f.SET_IS:case f.SET_IS_NOT:case f.SET_CONTAINS:case f.SET_DOES_NOT_CONTAIN:case f.SET_CONTAINS_ANY:case f.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&h([],p(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var o=d(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(!this.matchesIs(a,e))return!1}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var o=d(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(this.matchesIs(a,e))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e}(),I=function(e,t){var r,n,o=c({},e),i=[],a=t||Object.keys(o);try{for(var s=d(a),l=s.next();!l.done;l=s.next()){var u=l.value,f=k(u,o);f&&i.push.apply(i,h([],p(f),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},k=function(e,t,r){void 0===r&&(r=[]);var n,o,i=t[e];if(i){if(!i.dependencies||0===i.dependencies.length)return delete t[i.key],[i];r.push(i.key);var a=[],s=function(e){if(r.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(r));var n=k(e,t,r);n&&a.push.apply(a,h([],p(n),!1))};try{for(var c=d(i.dependencies),l=c.next();!l.done;l=c.next()){var u=l.value;s(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return a.push(i),r.pop(),delete t[i.key],a}};let A="function"==typeof i,x="function"==typeof TextDecoder?new TextDecoder:void 0,R="function"==typeof TextEncoder?new TextEncoder:void 0,P=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),O=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(P),N=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,M=String.fromCharCode.bind(String),D="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),L=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),U=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),q="function"==typeof btoa?e=>btoa(e):A?e=>i.from(e,"binary").toString("base64"):e=>{let t,r,n,o,i="",a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255)throw TypeError("invalid character found");i+=P[(t=r<<16|n<<8|o)>>18&63]+P[t>>12&63]+P[t>>6&63]+P[63&t]}return a?i.slice(0,a-3)+"===".substring(a):i},H=A?e=>i.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(M.apply(null,e.subarray(r,r+4096)));return q(t.join(""))},F=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?M(192|t>>>6)+M(128|63&t):M(224|t>>>12&15)+M(128|t>>>6&63)+M(128|63&t)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return M(240|t>>>18&7)+M(128|t>>>12&63)+M(128|t>>>6&63)+M(128|63&t)},j=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,z=e=>e.replace(j,F),B=A?e=>i.from(e,"utf8").toString("base64"):R?e=>H(R.encode(e)):e=>q(z(e)),K=(e,t=!1)=>t?L(B(e)):B(e),G=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Y=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return M((t>>>10)+55296)+M((1023&t)+56320);case 3:return M((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return M((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},V=e=>e.replace(G,Y),W="function"==typeof atob?e=>atob(U(e)):A?e=>i.from(e,"base64").toString("binary"):e=>
1{if(e=e.replace(/\s+/g,""),!N.test(e))throw TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r="",n,o;for(let i=0;i<e.length;)t=O[e.charAt(i++)]<<18|O[e.charAt(i++)]<<12|(n=O[e.charAt(i++)])<<6|(o=O[e.charAt(i++)]),r+=64===n?M(t>>16&255):64===o?M(t>>16&255,t>>8&255):M(t>>16&255,t>>8&255,255&t);return r},J=A?e=>D(i.from(e,"base64")):e=>D(W(e).split("").map(e=>e.charCodeAt(0))),$=A?e=>i.from(e,"base64").toString("utf8"):x?e=>x.decode(J(e)):e=>V(W(e)),Q=e=>U(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),X={encodeURL:e=>K(e,!0)};var Z=function(e){function t(r,n){var o=e.call(this,n)||this;return o.statusCode=r,Object.setPrototypeOf(o,t.prototype),o}return s(t,e),t}(Error),ee=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return s(t,e),t}(Error),et=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return l(this,void 0,void 0,function(){var r,n,o,i;return u(this,function(a){switch(a.label){case 0:return r=X.encodeURL(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=X.encodeURL(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),o=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&o.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&o.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:o.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(i=a.sent()).status)throw new Z(i.status,"Fetch error response: status=".concat(i.status));return[2,JSON.parse(i.body)]}})})},e}(),er=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return l(this,void 0,void 0,function(){var t,r;return u(this,function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=X.encodeURL(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),en="undefined"!=typeof globalThis?globalThis:r.g||self,eo=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==r.g?r.g:void 0},ei=function(){var e=eo();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){}return!1},ea=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=en.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(en.clearInterval(this.poller),this.poller=void 0)},e}(),es=r(10280),ec=r(13345);(function(){function e(e){this.amplitudeInstance=e}e.prototype.getUser=function(){var e,t,r,n,o,i,a,s,c,l;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(n=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===n?void 0:n.userId,version:null===(i=null===(o=this.amplitudeInstance)||void 0===o?void 0:o.options)||void 0===i?void 0:i.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(l=null===(c=this.amplitudeInstance)||void 0===c?void 0:c.options)||void 0===l?void 0:l.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,r,n,o,i;return[null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===r?void 0:r.name,null===(i=null===(o=null===(n=this.amplitudeInstance)||void 0===n?void 0:n._ua)||void 0===o?void 0:o.browser)||void 0===i?void 0:i.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(){var e,t,r;return null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===r?void 0:r.name}})(),function(){function e(e){this.amplitudeInstance=e}e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,r;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(r=e.variant)||void 0===r?void 0:r.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:((t={})[e.userProperty]="-",t)})}}();var el=function(){return(el=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function eu(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function ed(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function ep(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function eh(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function ef(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var eg=function(e,t){void 0===t&&(t=!1);var r,n,o=ey(e,t),i=void 0,a=en.document.cookie.split("; ");try{for(var s=ep(a),c=s.next();!c.done;c=s.next()){var l=c.value,u=eh(l.split("=",2),2),d=u[0],p=u[1];d===o&&(i=decodeURIComponent(p))}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}if(i)try{if(t){var h=atob(i);return JSON.parse(decodeURIComponent(h))}var f=i.split("."),g=void 0;return f.length>=2&&f[1]&&(g=atob(f[1])),{deviceId:f[0],userId:g}}catch(e){return}},ev=function(e){var t=ey(e,!0);try{var r=en.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}},em=function(e){var t=ey(e,!0);try{var r=en.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}},ey=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},eb=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return eu(this,void 0,void 0,function(){return ed(this,function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=eg(this.apiKey,!0);return!!(e||(e=eg(this.apiKey,!1))||(e=ev(this.apiKey))||(e=em(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return eu(this,void 0,void 0,function(){var t,r=this;return ed(this,function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)}),new Promise(function(t,r){en.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}(),ew=en.fetch||function(e,t){return t=t||{},new Promise(function(r,n){var o=new XMLHttpRequest,i=[],a=[],s={},c=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:c,headers:{keys:function(){return i},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,r){i.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r}),r(c())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(l,t.headers[l]);o.send(t.body||null)})},eE=function(){function e(e){this.client=e}return e.prototype.request=function(e){return eu(this,void 0,void 0,function(){return ed(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),eS={request:function(e,t,r,n,o){var i;return i=eu(void 0,void 0,void 0,function(){var o,i;return ed(this,function(a){switch(a.label){case 0:return[4,ew(e,{method:t,headers:r,body:n})];case 1:return i={status:(o=a.sent()).status},[4,o.text()];case 2:return i.body=a.sent(),[2,i]}})}),null==o||o<=0?i:new Promise(function(e,t){en.setTimeout(function(){t(new ee("Request timeout after "+o+" milliseconds"))},o),i.then(e,t)})}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(n||(n={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(o||(o={}));var eC=function(e){return!e||e===o.FallbackInline||e===o.FallbackConfig||e===o.SecondaryInitialVariants},e_={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:n.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:eS},eT="1.16.1",eI=function(){function e(e,t){var r,n=this;this.isReady=new Promise(function(e){n.resolve=e}),this.config=e,this.client=t;var o=null!==(r=e.instanceName)&&void 0!==r?r:e_.instanceName;this.queue=new eA(o),this.cache=new ek(o)}return e.prototype.ready=function(){return this.integration?this.isReady:Prom
1ise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,n,o={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?o={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)==="web"&&(o={eventType:"$impression",eventProperties:e}),o},e}(),ek=function(){function e(e){this.isSessionStorageAvailable=ex(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&en.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){if((null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod)==="web")return!0;this.loadCache();var t,r=this.inMemoryCache[e.flag_key],n=!1;return r&&r.variant===e.variant||(n=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),n},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=en.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&en.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),eA=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=ei(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=en.setInterval(function(){t.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=ep(this.inMemoryQueue),n=r.next();!n.done;n=r.next()){var o=n.value;try{if(!this.tracker(o))return}catch(e){return}}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(en.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=en.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),en.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),ex=function(){var e=eo();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){}return!1},eR=function(){function e(){this.globalScope=eo()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),eP=function(e,t,r){var n=e.substring(e.length-6);return new eN("amp-exp-".concat(t,"-").concat(n),r,eM)},eO=function(e,t,r){void 0===r&&(r=new eR);var n=e.substring(e.length-6);return new eN("amp-exp-".concat(t,"-").concat(n,"-flags"),r)},eN=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return el({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=ep(Object.keys(e)),o=n.next();!o.done;o=n.next()){var i=o.value;this.cache[i]=e[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var o={};try{for(var i=ep(Object.keys(r)),a=i.next();!a.done;a=i.next()){var s=a.value;try{var c=void 0;(c=this.transformer?this.transformer(r[s]):r[s])&&(o[s]=c)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.clear(),this.putAll(o)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),eM=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,o=e.metadata,i=e.expKey;o&&o.experimentKey?i=o.experimentKey:i&&((o=o||{}).experimentKey=i);var a={};return t?a.key=t:r&&(a.key=r),r&&(a.value=r),o&&(a.metadata=o),n&&(a.payload=n),i&&(a.expKey=i),a}},eD=function(){function e(){this.globalScope=eo()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),eL=function(e,t,r,n){var o,i=null==r?void 0:r.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:a,properties:{key:t,variant:i,source:n},userProperties:((o={})[a]=i,o)}},eU=function(e){return null==e},eq=function(e){return!!eU(e)||e&&0===Object.keys(e).length},eH=function(e){var t;return(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)==="local"},eF=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return eu(this,void 0,void 0,function(){return ed(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return eu(this,void 0,void 0,function(){var n=this;return ed(this,function(o){return this.done||(this.timeoutHandle=en.setTimeout(function(){return eu(n,void 0,void 0,function(){var n,o;return ed(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e()];case 1:return i.sent(),[3,3];case 2:return i.sent(),(n=t+1)<this.attempts&&(o=Math.min(r*this.scalar,this.max),this.backoff(e,n,o)),[3,3];case 3:return[2]}})})},r)),[2]})})},e}(),ej=function(e){if(!e)return{};var t,r,n,o,i={user:e},a=eo();a&&(i.page={url:a.location.href});var s={};if(!e.groups)return i;try{for(var c=ep(Object.keys(e.groups)),l=c.next();!l.done;l=c.next()){var u=l.value,d=e.groups[u];if(d.length>0&&d[0]){var p=d[0],h={group_name:p},f=null===(o=null===(n=e.group_properties)||void 0===n?void 0:n[u])||void 0===o?void 0:o[p];f&&Object.keys(f).length>0&&(h.group_properties=f),s[u]=h}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(i.groups=s),delete i.user.groups,delete i.user.group_properties,i},ez=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},eB=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},eK=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),eG=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),eY=function(){function e(e,t){var r,n,o,i,a,s=this;this.engine=new T,this.isRunning=!1,this.apiKey=e,this.config=el(el(el({},e_),t),{serverUrl:(null==t?void 0:t.serverUrl)||((null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())==="eu"?"https://api.lab.eu.amplitude.com":e_.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||((null===(n=null==t?void 0:t.serverZone)||void 0===n?void 0:n.toLowerCase())==="eu"?"https://flag.lab.eu.amplitude.com":e_.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=t.flagConfigPollingIntervalMillis)&&void 0!==o?o:e_.flagConfigPollingIntervalMillis});var c=null===(i=this.config)||void 0===i?void 0:i.internalInstanceNameSuffix;if(this.isWebExperiment="web"===c,this.poller=new ea(function(){return s.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=eM(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new eK(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new eG(this.config.exposureTrackingProvider)),this.integrationManager=new eI(this.config,this);var u=new eE(this.config.httpClient||eS);this.flagApi=new er(this.apiKey,this.config.flagsServerUrl,u),this.evaluationApi=new et(this.apiKey,this.config.serverUrl,u);var d=c?"".concat(this.config.instanceName,"-").concat(c):this.config.instanceName;a=this.isWebExperiment?new eD:new eR,this.variants=eP(this.apiKey,d,a),this.flags=eO(this.apiKey,d,a);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return eu(this,void 0,void 0,function(){var t,r,n;return ed(this,function(o){switch(o.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),o.label=1;
1case 1:if(o.trys.push([1,6,,7]),t=this.doFlags(),!(null===(n=this.config.fetchOnStart)||void 0===n||n))return[3,3];return[4,Promise.all([this.fetch(e),t])];case 2:return o.sent(),[3,5];case 3:return[4,t];case 4:o.sent(),o.label=5;case 5:return[3,7];case 6:if(r=o.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return eu(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),ed(this,function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),this.config.throwOnError)throw r;return this.config.debug&&(r instanceof ee?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(e,t){if(!this.apiKey)return{value:void 0};var r,n,o=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,o),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=o.variant)||void 0===r?void 0:r.key)||(null===(n=o.variant)||void 0===n?void 0:n.value))),o.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e)eH(this.flags.get(t))||delete e[t];return el(el(el({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){if(!this.user)return this.user;if(null===(e=this.user)||void 0===e||!e.user_properties)return el({},this.user);var e,t=el({},this.user.user_properties);return el(el({},this.user),{user_properties:t})},e.prototype.setUser=function(e){var t;if(!e){this.user=null;return}if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=el({},e.user_properties);this.user=el(el({},e),{user_properties:r})}else this.user=el({},e)},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),o=I(this.flags.getAll(),e),i=ej(n),a=this.engine.evaluate(i,o),s={};try{for(var c=ep(Object.keys(a)),l=c.next();!l.done;l=c.next()){var u=l.value;s[u]=eB(a[u])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return s},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===n.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===n.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var o=this.flags.get(e);return(eH(o)||!r.variant&&o)&&(r=this.localEvaluationVariantAndSource(e,o,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},a=this.evaluate([t.key])[e],s=o.LocalEvaluation,c=null===(n=null==a?void 0:a.metadata)||void 0===n?void 0:n.default;if(!eU(a)&&!c)return{variant:ez(a),source:s,hasDefaultVariant:!1};if(c&&(i={variant:ez(a),source:s,hasDefaultVariant:!0}),!eU(r))return{variant:ez(r),source:o.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!eU(l))return{variant:ez(l),source:o.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=ez(this.config.fallbackVariant),d={variant:u,source:o.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return eq(u)?i:d},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),a=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!eU(i)&&!a)return{variant:ez(i),source:o.LocalStorage,hasDefaultVariant:!1};if(a&&(n={variant:ez(i),source:o.LocalStorage,hasDefaultVariant:!0}),!eU(t))return{variant:ez(t),source:o.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!eU(s))return{variant:ez(s),source:o.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var c=ez(this.config.fallbackVariant),l={variant:c,source:o.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return eq(c)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!eU(i))return{variant:ez(i),source:o.InitialVariants,hasDefaultVariant:!1};var a=this.variants.get(e),s=null===(r=null==a?void 0:a.metadata)||void 0===r?void 0:r.default;if(!eU(a)&&!s)return{variant:ez(a),source:o.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:ez(a),source:o.LocalStorage,hasDefaultVariant:!0}),!eU(t))return{variant:ez(t),source:o.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var c=ez(this.config.fallbackVariant),l={variant:c,source:o.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return eq(c)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return eu(this,void 0,void 0,function(){var o,i;return ed(this,function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;
1case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,n)];case 2:return o=a.sent(),[4,this.storeVariants(o,n)];case 3:return a.sent(),[2,o];case 4:throw i=a.sent(),r&&this.shouldRetryFetch(i)&&this.startRetries(e,n),i;case 5:return[2]}})})},e.prototype.cleanUserPropsForFetch=function(e){var t=el({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return eu(this,void 0,void 0,function(){var n,o,i,a,s,c,l;return ed(this,function(u){switch(u.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=u.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,el({timeoutMillis:t},r))];case 2:n=u.sent(),o={};try{for(a=(i=ep(Object.keys(n))).next();!a.done;a=i.next())o[s=a.value]=eB(n[s])}catch(e){c={error:e}}finally{try{a&&!a.done&&(l=i.return)&&l.call(i)}finally{if(c)throw c.error}}return this.debug("[Experiment] Received variants: ",o),[2,o]}})})},e.prototype.doFlags=function(){return eu(this,void 0,void 0,function(){var e,t,r;return ed(this,function(n){switch(n.label){case 0:if(n.trys.push([0,4,,5]),e=void 0,!this.isWebExperiment)return[3,2];return[4,this.addContextOrWait(this.getUser())];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:eT,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if((r=n.sent())instanceof ee){if(this.config.debug&&console.debug(r),this.config.throwOnError)throw r}else throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return eu(this,void 0,void 0,function(){var r,n,o,i;return ed(this,function(a){for(i in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter(function(e){return e!==t}),o.variants.put(t,e[t])},o=this,e)n(i);for(i in r)this.variants.remove(i);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return eu(this,void 0,void 0,function(){var r=this;return ed(this,function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new eF(8,500,1e4,1.5),this.retriesBackoff.start(function(){return eu(r,void 0,void 0,function(){return ed(this,function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),o=el(el(el({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return el(el(el(el({library:"experiment-js-client/".concat(eT)},r),n),e),{user_properties:o})},e.prototype.addContextOrWait=function(e){return eu(this,void 0,void 0,function(){return ed(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==n.LocalStorage?this.variants.getAll():this.config.source==n.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==n.LocalStorage?this.config.initialVariants:this.config.source==n.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){if(null===(o=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===o||o){this.legacyExposureInternal(e,t.variant,t.source);var r,n,o,i,a,s,c,l,u,d={flag_key:e},p=eC(t.source);if(!p||t.hasDefaultVariant){(null===(i=t.variant)||void 0===i?void 0:i.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var h=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(p||(null==h?void 0:h.default)||((null===(c=t.variant)||void 0===c?void 0:c.key)?d.variant=t.variant.key:(null===(l=t.variant)||void 0===l?void 0:l.value)&&(d.variant=t.variant.value)),h&&(d.metadata=h),this.isWebExperiment){var f=eo();if(null==f?void 0:f.location)try{var g=f.location.href;d.metadata.url=g.split("?")[0]||""}catch(e){}}null===(u=this.exposureTrackingProvider)||void 0===u||u.track(d),this.integrationManager.track(d)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,o,i,a,s;if(this.analyticsProvider){var c=eL(this.addContext(this.getUser()),e,t,r);!eC(r)&&(null==t?void 0:t.value)?(null==t?void 0:t.value)&&(null===(a=null===(i=this.analyticsProvider)||void 0===i?void 0:i.setUserProperty)||void 0===a||a.call(i,c),null===(s=this.analyticsProvider)||void 0===s||s.track(c)):null===(o=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===o||o.call(n,c)}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,ef([e],eh(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof Z)||e.statusCode<400||e.statusCode>=500||429===e.statusCode}
1,e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),eV=function(){function e(e,t){var r,n,o;this.globalScope=eo(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new ec.UAParser(this.userAgent).getResult(),this.localStorage=new eR,this.sessionStorage=new eD,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(o=this.apiKey)||void 0===o?void 0:o.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,o,i=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return el({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(o=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===o?void 0:o.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},i)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,o;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(o=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===o?void 0:o.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){if(this.globalScope){var e,t,r,n={};try{var o=new URL(this.globalScope.location.href);try{for(var i=ep(o.searchParams),a=i.next();!a.done;a=i.next()){var s=eh(a.value,2),c=s[0],l=s[1];n[c]=ef(ef([],eh(null!==(r=n[c])&&void 0!==r?r:[]),!1),eh(l.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce(function(e,t){var r=eh(t,2),n=r[0],o=r[1];return e[n]=1==o.length?o[0]:o,e},{})}},e}();en.experimentInstances={};var eW=en.experimentInstances,eJ=function(e){return(null==e?void 0:e.instanceName)||e_.instanceName},e$=function(e,t){var r=eJ(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)},eQ=function(e,t,r){var n=e$(e,t),o=eW[n];return o||(o=new eY(e,el(el({},t),{userProvider:new eV(null==t?void 0:t.userProvider,e)})),r&&o.addPlugin(r()),eW[n]=o),o},eX={initialize:function(e,t){return eQ(e,t)},initializeWithAmplitudeAnalytics:function(e,t){return eQ(e,t,function(){return new eb(e,es.i.getInstance(eJ(t)),1e4)})}};!function(){function e(){}e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return eu(this,void 0,void 0,function(){return ed(this,function(e){return[2]})})},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return eu(this,void 0,void 0,function(){return ed(this,function(e){return[2,this]})})},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return e_.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){}
1,e.prototype.exposure=function(e){}}()},86419:(e,t,r)=>{"use strict";let n,o;r.d(t,{jO:()=>rh});var i,a,s,c,l,u,d,p,h,f,g,v,m,y,b,w=function(){return(w=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function E(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function S(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,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"}(i||(i={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(a||(a={}));var C=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!==r.g?r.g:void 0};!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(s||(s={}));var _=function(e,t,r,n,o){return void 0===o&&(o=null),function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var c=r(),l=c.logger,u=c.logLevel;if(u&&u<s.Debug||!u||!l)return e.apply(o,i);var d={type:"invoke public method",name:t,args:i,stacktrace:(Error().stack||"").split("\n").slice(3).map(function(e){return e.trim()}),time:{start:new Date().toISOString()},states:{}};n&&d.states&&(d.states.before=n());var p=e.apply(o,i);return p&&p.promise?p.promise.then(function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))}):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))),p}},T=r(53032),I="Amplitude Logger ",k=function(){function e(){this.logLevel=s.None}return e.prototype.disable=function(){this.logLevel=s.None},e.prototype.enable=function(e){void 0===e&&(e=s.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.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<s.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<s.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<s.Debug||console.log("".concat(I,"[Debug]: ").concat(e.join(" ")))},e}();!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(c||(c={}));var A=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,r,n,o,i,a,s,l,u,d,p,h,f,g,v,m,y,b,w,E,S,C,_=e.code||0,T=this.buildStatus(_);switch(T){case c.Success:return{status:T,statusCode:_,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case c.Invalid:return{status:T,statusCode:_,body:{error:null!==(o=e.error)&&void 0!==o?o:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(a=e.events_with_invali
1d_fields)&&void 0!==a?a:{},eventsWithMissingFields:null!==(s=e.events_with_missing_fields)&&void 0!==s?s:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(d=e.exceeded_daily_quota_devices)&&void 0!==d?d:{},silencedDevices:null!==(p=e.silenced_devices)&&void 0!==p?p:[],silencedEvents:null!==(h=e.silenced_events)&&void 0!==h?h:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case c.PayloadTooLarge:return{status:T,statusCode:_,body:{error:null!==(v=e.error)&&void 0!==v?v:""}};case c.RateLimit:return{status:T,statusCode:_,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(E=e.exceeded_daily_quota_devices)&&void 0!==E?E:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(C=e.throttled_events)&&void 0!==C?C:[]}};case c.Timeout:default:return{status:T,statusCode:_}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?c.Success:429===e?c.RateLimit:413===e?c.PayloadTooLarge:408===e?c.Timeout:e>=400&&e<500?c.Invalid:e>=500?c.Failed:c.Unknown},e}(),x=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return(0,T.C6)(t,e),t.prototype.send=function(e,t){return(0,T.sH)(this,void 0,void 0,function(){var r,n;return(0,T.YH)(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:(0,T.Cl)({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"})];case 1:return[4,(r=o.sent()).text()];case 2:n=o.sent();try{return[2,this.buildResponse(JSON.parse(n))]}catch(e){return[2,this.buildResponse({code:r.status})]}return[2]}})})},t}(A),R="$default_instance",P="https://api2.amplitude.com/2/httpapi",O=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:R,logLevel:s.Warn,loggerProvider:new k,offline:!1,optOut:!1,serverUrl:P,serverZone:"US",useBatch:!1}},N=function(){function e(e){this._optOut=!1;var t,r,n,o,i=O();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:i.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||i.flushQueueSize,this.instanceName=e.instanceName||i.instanceName,this.loggerProvider=e.loggerProvider||i.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:i.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:i.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||i.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(o=e.useBatch)&&void 0!==o?o:i.useBatch,this.loggerProvider.enable(this.logLevel);var a=M(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}(),M=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=O().serverZone),void 0===r&&(r=O().useBatch),e)return{serverUrl:e,serverZone:void 0};var n,o=["US","EU"].includes(t)?t:O().serverZone;return{serverZone:o,serverUrl:(n=r,"EU"===o?n?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":n?"https://api2.amplitude.com/batch":P)}};(function(){this.sdk={metrics:{histogram:{}}}}).prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(l||(l={}));var D="[Amplitude]",L="".concat(D," Session Replay ID"),U=l.US,q={enabled:!0},H="".concat(D," Session Replay Debug"),F="amp-mask",j="https://api-sr.amplitude.com/sessions/v2/track",z="https://api-sr.eu.amplitude.com/sessions/v2/track",B="https://api-sr.stag2.amplitude.com/sessions/v2/track";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(u||(u={}));var K=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){if(!this.logger)return function(){};var t,r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),G=r(92851),Y="medium",V=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n,o=r?(n=r.type,r.hasAttribute("data-rr-is-password")?"password":n?n.toLowerCase():null):"";if(!o)return!1;if(["password","hidden","email","tel"].includes(o)||r.autocomplete.startsWith("cc-"))return!0;return!1;case"medium":case"conservative":return!0;default:return V(e,Y,r)}},W=function(e,t,r){var n,o,i;if(void 0===t&&(t={defaultMaskLevel:Y}),r){if(r.closest("."+F)||(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)}))return!0;
1if(r.closest(".amp-unmask")||(null!==(o=t.unmaskSelector)&&void 0!==o?o:[]).some(function(e){return r.closest(e)}))return!1}return V(e,null!==(i=t.defaultMaskLevel)&&void 0!==i?i:Y,r)},J=function(e,t){return function(r,n){return W(e,t,n)?r.replace(/[^\s]/g,"*"):r}},$=function(){var e=(0,G.m)();return(null==e?void 0:e.location)?e.location.href:""},Q=function(e,t){return t||(e===l.STAGING?B:e===l.EU?z:j)},X=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},Z=function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){var t;return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t)}))throw Error("ugcFilterRules must be an array of objects with valid globs")},ee=function(e,t){var r,n;try{for(var o=(0,T.Ju)(t),i=o.next();!i.done;i=o.next()){var a=i.value,s=X(a.selector);if(s.test(e))return e.replace(s,a.replacement)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return e},et=function(){return(0,T.sH)(void 0,void 0,void 0,function(){var e,t,r,n;return(0,T.YH)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,3,,4]),!(e=(0,G.m)()))return[3,2];return[4,e.navigator.storage.estimate()];case 1:return r=(t=o.sent()).usage,n=t.quota,[2,{totalStorageSize:r?Math.round(r/1024):0,percentOfQuota:r&&n?Math.round((r/n+Number.EPSILON)*1e3)/1e3:0,usageDetails:JSON.stringify(t.usageDetails)}];case 2:return[3,4];case 3:return o.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},er=function(e){var t=(0,T.Cl)({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},en=function(){return{flushMaxRetries:2,logLevel:s.Warn,loggerProvider:new k,transportProvider:new x}},eo=function(e){function t(t,r){var n,o,i,a,s,c,l=this,u=en();return(l=e.call(this,(0,T.Cl)((0,T.Cl)({transportProvider:u.transportProvider,loggerProvider:new K(r.loggerProvider||u.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=u.flushMaxRetries?r.flushMaxRetries:u.flushMaxRetries,l.apiKey=t,l.sampleRate=r.sampleRate||0,l.serverZone=r.serverZone||U,l.configServerUrl=r.configServerUrl,l.trackServerUrl=r.trackServerUrl,l.shouldInlineStylesheet=r.shouldInlineStylesheet,l.version=r.version,l.performanceConfig=r.performanceConfig||q,l.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",l.applyBackgroundColorToBlockedElements=null!==(o=r.applyBackgroundColorToBlockedElements)&&void 0!==o&&o,l.enableUrlChangePolling=null!==(i=r.enableUrlChangePolling)&&void 0!==i&&i,l.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,l.captureDocumentTitle=null!==(s=r.captureDocumentTitle)&&void 0!==s&&s,r.privacyConfig&&(l.privacyConfig=r.privacyConfig),r.interactionConfig&&(l.interactionConfig=r.interactionConfig,l.interactionConfig.ugcFilterRules&&Z(l.interactionConfig.ugcFilterRules)),r.debugMode&&(l.debugMode=r.debugMode),void 0!==r.useWebWorker?l.useWebWorker=r.useWebWorker:(null===(c=r.experimental)||void 0===c?void 0:c.useWebWorker)!==void 0&&(l.useWebWorker=r.experimental.useWebWorker),r.omitElementTags&&(l.omitElementTags=r.omitElementTags),l}return(0,T.C6)(t,e),t}(N);!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"}(d||(d={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(p||(p={}));var ei=function(e){return{promise:e||Promise.resolve()}},ea="https://app.amplitude.com",es={US:ea,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},ec="__AMPLITUDE_MESSENGER_INSTANCE__",el="__AMPLITUDE_MESSENGER__",eu=function(){function e(e){var t=(void 0===e?{}:e).origin;this[h]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=void 0===t?ea:t}return e.prototype.notify=function(e){var t,r,n,o;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(o=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===o||o.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var o="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),i={id:o,action:e,args:t};return new Promise(function(t,a){n.requestCallbacks[o]={resolve:t,reject:a},n.notify(i),r.timeout>0&&setTimeout(function(){a(Error("".concat(e," timed out (id: ").concat(o,")"))),delete n.requestCallbacks[o]},r.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null===(t=this.logger)||void 0===t||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===(i=null===(o=this.logger)||void 0===o?void 0:o.warn)||void 0===i||i.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var r,n,o,i,a=this.pendingMessages.get(e);if(a){this.pendingMessages.delete(e);try{for(var s=(0,T.Ju)(a),c=s.next();!c.done;c=s.next()){var l=c.value;t(l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return(0,T.sH)(this,void 0,void 0,function(){var t,r,n;return(0,T.YH)(this,function(o){switch(o.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=(document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=e,o.addEventListener("load",function(){t({status:!0})},{once:!0}),o.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(o)}catch(e){r(e)}})).then(function(){}),this.scriptLoadPromises.set(e,r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r];case 2:return o.sent(),[3,4];case 3:throw n=o.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,o=void 0===e?{}:e,i=o.logger,a=o.endpoint;i&&(this.logger=i),a&&this.endpoint===ea&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var t,r,o,i,a,s=e.data,c=null==s?void 0:s.action;if(c){if("id"in s&&s.id)null===(i=null===(o=n.logger)||void 0===o?void 0:o.debug)||void 0===i||i.call(o,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(s);else{if("ping"===c){n.notify({action:"pong"});return}var l=n.actionHandlers.get(c);if(l)l(s.data);else{var u=null!==(a=n.pendingMessages.get(c))&&void 0!==a?a:[];u.push(s.data),n.pendingMessages.set(c,u)}}}}},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,G.m)();(null==e?void 0:e[el])===this&&delete e[el]},e}();h=ec;var ed="__AMPLITUDE_BACKGROUND_CAPTURE__",ep=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t},eh=r(10280),ef=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ef||{}),eg=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(eg||{}),ev=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ev||{}),em=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(em||{}),ey=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ey||{}),eb=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(eb||{}),ew=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(ew||{}),eE=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(eE||{}),eS=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 r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.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}(),eC=(0,T.fX)([],(0,T.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),e_=function(e){var t,r=(0,G.m)();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,e_);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,(0,T.fX)([],(0,T.zs)(n.entries()),!1).map(function(e){var t=(0,T.zs)(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(eC[n]):eC[n]}).join("")}
1,eT={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},eI=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new eS(e,t)}return e.prototype.subscribe=function(e,t,r){var n=e_(),o={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(o),"all"===t?this.subscribeAll(o):this.subscribeWaitForRemote(o,t.timeout),n},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,T.sH)(this,void 0,void 0,function(){var e,t=this;return(0,T.YH)(this,function(r){switch(r.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=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,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,T.sH)(this,void 0,void 0,function(){var t,r,n,o=this;return(0,T.YH)(this,function(i){switch(i.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)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending c
1allback because cache is empty (first time user).")),[4,t];case 2:return i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,T.sH)(this,void 0,void 0,function(){var r,n;return(0,T.YH)(this,function(o){switch(o.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),o.label=1;case 1:return o.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=o.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return o.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!==(n=o.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=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(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,T.sH)(this,void 0,void 0,function(){var r,n,o,i,a,s,c=this;return(0,T.YH)(this,function(l){switch(l.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},o=function(n){var o,a,s,l,u,d;return(0,T.YH)(this,function(p){switch(p.label){case 0:o=!0,a=new AbortController,s=setTimeout(function(){return a.abort()},t),p.label=1;case 1:return p.trys.push([1,7,8,9]),[4,fetch(i.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:a.signal})];case 2:if((l=p.sent()).ok)return[3,4];return[4,l.text()];case 3:return u=p.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(u)),l.status===eT.INVALID_API_KEY||l.status===eT.FORBIDDEN?(i.logger.error("Remote config client fetch failed with ".concat(l.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,o=!1):l.status>=400&&l.status<500&&l.status!==eT.RATE_LIMIT&&(o=!1),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:p.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=p.sent())instanceof Error&&"AbortError"===d.name?i.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):i.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(s),[7];case 9:if(!o)return[2,"break"];if(!(n<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})];case 10:p.sent(),p.label=11;case 11:return[2]}})},i=this,a=0,l.label=1;case 1:if(!(a<e))return[3,4];return[5,o(a)];case 2:if("object"==typeof(s=l.sent()))return[2,s.value];if("break"===s)return[3,4];l.label=3;case 3:return a++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}(),ek=function(e,t){var r=document.createDocumentFragment(),n=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{r.querySelector(e)}catch(r){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e},eA=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r,n,o;return(0,T.sH)(this,void 0,void 0,function(){var i,a,s,c,l,u,d,p,h,f,g,v,m,y,b,w,E,S=this;return(0,T.YH)(this,function(C){switch(C.label){case 0:(i=(0,T.Cl)({},this.localConfig)).optOut=this.localConfig.optOut,i.captureEnabled=!0,C.label=1;case 1:return C.trys.push([1,3,,4]),[4,new Promise(function(e,t){S.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,n){if(S.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),!r){t(Error("No remote config received"));return}var o,s=r.sr_sampling_config,c=r.sr_privacy_config,l=r.sr_targeting_config,u=null===(o=i.interactionConfig)||void 0===o?void 0:o.ugcFilterRules;i.interactionConfig=r.sr_interaction_config,i.interactionConfig&&u&&(i.interactionConfig.ugcFilterRules=u),i.loggingConfig=r.sr_logging_config,(s||c||l)&&(a={},s&&(a.sr_sampling_config=s),c&&(a.sr_privacy_config=c),l&&(a.sr_targeting_config=l)),e()})})];case 2:return C.sent(),[3,4];case 3:return s=C.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",s),i.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:void 0}];case 4:if(!a)return[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:a}];if(c=a.sr_sampling_config,l=a.sr_privacy_config,u=a.sr_targeting_config,c&&Object.keys(c).length>0?(Object.prototype.hasOwnProperty.call(c,"capture_enabled")?i.captureEnabled=c.capture_enabled:i.captureEnabled=!1,Object.prototype.hasOwnProperty.call(c,"sample_rate")&&(i.sampleRate=c.sample_rate)):(i.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),l){d=null!==(e=i.privacyConfig)&&void 0!==e?e:{},p={defaultMaskLevel:null!==(r=null!==(t=l.defaultMaskLevel)&&void 0!==t?t:d.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:(0,T.fX)([],(0,T.zs)(new Set((0,T.fX)((0,T.fX)([],(0,T.zs)(null!==(n=d.maskAttributes)&&void 0!==n?n:[]),!1),(0,T.zs)(null!==(o=l.maskAttributes)&&void 0!==o?o:[]),!1))),!1)},h=function(e){var t,r,n,o,i,a,s,c,l,u={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=(0,T.Ju)(null!==(s=e.blockSelector)&&void 0!==s?s:[]),p=d.next();!p.done;p=d.next()){var h=p.value;u[h]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=(0,T.Ju)(null!==(c=e.maskSelector)&&void 0!==c?c:[]),g=f.next();!g.done;g=f.next()){var h=g.value;u[h]="mask"}}catch(e){n={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}try{for(var v=(0,T.Ju)(null!==(l=e.unmaskSelector)&&void 0!==l?l:[]),m=v.next();!m.done;m=v.next()){var h=m.value;u[h]="unmask"}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}return u},f=(0,T.Cl)((0,T.Cl)({},h(d)),h(l));try{for(v=(g=(0,T.Ju)(Object.entries(f))).next();!v.done;v=g.next())y=(m=(0,T.zs)(v.value,2))[0],b=m[1],"mask"===b?p.maskSelector.push(y):"block"===b?p.blockSelector.push(y):"unmask"===b&&p.unmaskSelector.push(y)}catch(e){w={error:e}}finally{try{v&&!v.done&&(E=g.return)&&E.call(g)}finally{if(w)throw w.error}}i.privacyConfig=ek(p,this.localConfig.loggerProvider)}return u&&Object.keys(u).length>0&&(i.targetingConfig=u),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:er(i)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:i,remoteConfig:a}]}})})},e}(),ex=Uint8Array,eR=Uint16Array,eP=Uint32Array,eO=new ex([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),eN=new ex([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),eM=new ex([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),eD=function(e,t){for(var r=new eR(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new eP(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},eL=eD(eO,2),eU=eL[0],eq=eL[1];eU[28]=258,eq[258]=28;for(var eH=eD(eN,0),eF=(eH[0],eH[1]),ej=new eR(32768),ez=0;ez<32768;++ez){var eB=(43690&ez)>>>1|(21845&ez)<<1;eB=(61680&(eB=(52428&eB)>>>2|(13107&eB)<<2))>>>4|(3855&eB)<<4,ej[ez]=((65280&eB)>>>8|(255&eB)<<8)>>>1}for(var eK=function(e,t,r){for(var n,o=e.length,i=0,a=new eR(t);
1i<o;++i)++a[e[i]-1];var s=new eR(t);for(i=0;i<t;++i)s[i]=s[i-1]+a[i-1]<<1;if(r){n=new eR(1<<t);var c=15-t;for(i=0;i<o;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)n[ej[d]>>>c]=l}else for(i=0,n=new eR(o);i<o;++i)n[i]=ej[s[e[i]-1]++]>>>15-e[i];return n},eG=new ex(288),ez=0;ez<144;++ez)eG[ez]=8;for(var ez=144;ez<256;++ez)eG[ez]=9;for(var ez=256;ez<280;++ez)eG[ez]=7;for(var ez=280;ez<288;++ez)eG[ez]=8;for(var eY=new ex(32),ez=0;ez<32;++ez)eY[ez]=5;var eV=eK(eG,9,0),eW=eK(eY,5,0),eJ=function(e){return(e/8>>0)+(7&e&&1)},e$=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof eR?eR:e instanceof eP?eP:ex)(r-t);return n.set(e.subarray(t,r)),n},eQ=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},eX=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},eZ=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new ex(0),0];if(1==o){var a=new ex(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var s=r[0],c=r[1],l=0,u=1,d=2;for(r[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=o-1;)s=r[r[l].f<r[d].f?l++:d++],c=r[l!=u&&r[l].f<r[d].f?l++:d++],r[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var p=i[0].s,n=1;n<o;++n)i[n].s>p&&(p=i[n].s);var h=new eR(p+1),f=e0(r[u-1],h,0);if(f>t){var n=0,g=0,v=f-t,m=1<<v;for(i.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});n<o;++n){var y=i[n].s;if(h[y]>t)g+=m-(1<<f-h[y]),h[y]=t;else break}for(g>>>=v;g>0;){var b=i[n].s;h[b]<t?g-=1<<t-h[b]++-1:++n}for(;n>=0&&g;--n){var w=i[n].s;h[w]==t&&(--h[w],++g)}f=t}return[new ex(h),f]},e0=function(e,t,r){return -1==e.s?Math.max(e0(e.l,t,r+1),e0(e.r,t,r+1)):t[e.s]=r},e1=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new eR(++t),n=0,o=e[0],i=1,a=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[r.subarray(0,n),t]},e2=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},e3=function(e,t,r){var n=r.length,o=eJ(t+2);e[o]=255&n,e[o+1]=n>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},e4=function(e,t,r,n,o,i,a,s,c,l,u){eQ(t,u++,r),++o[256];for(var d,p,h,f,g=eZ(o,15),v=g[0],m=g[1],y=eZ(i,15),b=y[0],w=y[1],E=e1(v),S=E[0],C=E[1],_=e1(b),T=_[0],I=_[1],k=new eR(19),A=0;A<S.length;++A)k[31&S[A]]++;for(var A=0;A<T.length;++A)k[31&T[A]]++;for(var x=eZ(k,7),R=x[0],P=x[1],O=19;O>4&&!R[eM[O-1]];--O);var N=l+5<<3,M=e2(o,eG)+e2(i,eY)+a,D=e2(o,v)+e2(i,b)+a+14+3*O+e2(k,R)+(2*k[16]+3*k[17]+7*k[18]);if(N<=M&&N<=D)return e3(t,u,e.subarray(c,c+l));if(eQ(t,u,1+(D<M)),u+=2,D<M){d=eK(v,m,0),p=v,h=eK(b,w,0),f=b;var L=eK(R,P,0);eQ(t,u,C-257),eQ(t,u+5,I-1),eQ(t,u+10,O-4),u+=14;for(var A=0;A<O;++A)eQ(t,u+3*A,R[eM[A]]);u+=3*O;for(var U=[S,T],q=0;q<2;++q)for(var H=U[q],A=0;A<H.length;++A){var F=31&H[A];eQ(t,u,L[F]),u+=R[F],F>15&&(eQ(t,u,H[A]>>>5&127),u+=H[A]>>>12)}}else d=eV,p=eG,h=eW,f=eY;for(var A=0;A<s;++A)if(n[A]>255){var F=n[A]>>>18&31;eX(t,u,d[F+257]),u+=p[F+257],F>7&&(eQ(t,u,n[A]>>>23&31),u+=eO[F]);var j=31&n[A];eX(t,u,h[j]),u+=f[j],j>3&&(eX(t,u,n[A]>>>5&8191),u+=eN[j])}else eX(t,u,d[n[A]]),u+=p[n[A]];return eX(t,u,d[256]),u+p[256]},e5=new eP([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),e6=function(e,t,r,n,o,i){var a=e.length,s=new ex(n+a+5*(1+Math.floor(a/7e3))+o),c=s.subarray(n,s.length-o),l=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d<a?l=e3(c,l,e.subarray(u,d)):(c[u]=i,l=e3(c,l,e.subarray(u,a)))}else{for(var p=e5[t-1],h=p>>>13,f=8191&p,g=(1<<r)-1,v=new eR(32768),m=new eR(g+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},E=new eP(25e3),S=new eR(288),C=new eR(32),_=0,T=0,u=0,I=0,k=0,A=0;u<a;++u){var x=w(u),R=32767&u,P=m[x];if(v[R]=P,m[x]=R,k<=u){var O=a-u;if((_>7e3||I>24576)&&O>423){l=e4(e,c,0,E,S,C,T,I,A,u-A,l),I=_=T=0,A=u;for(var N=0;N<286;++N)S[N]=0;for(var N=0;N<30;++N)C[N]=0}var M=2,D=0,L=f,U=R-P&32767;if(O>2&&x==w(u-U))for(var q=Math.min(h,O)-1,H=Math.min(32767,u),F=Math.min(258,O);U<=H&&--L&&R!=P;){if(e[u+M]==e[u+M-U]){for(var j=0;
1j<F&&e[u+j]==e[u+j-U];++j);if(j>M){if(M=j,D=U,j>q)break;for(var z=Math.min(U,j-2),B=0,N=0;N<z;++N){var K=u-U+N+32768&32767,G=v[K],Y=K-G+32768&32767;Y>B&&(B=Y,P=K)}}}P=v[R=P],U+=R-P+32768&32767}if(D){E[I++]=0x10000000|eq[M]<<18|eF[D];var V=31&eq[M],W=31&eF[D];T+=eO[V]+eN[W],++S[257+V],++C[W],k=u+M,++_}else E[I++]=e[u],++S[e[u]]}}l=e4(e,c,i,E,S,C,T,I,A,u-A,l)}return e$(s,0,n+eJ(l)+o)},e8=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a<s;++a)n+=r[a],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+((255&e)<<23)*2}}},e7=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},e9=function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)};let te=e=>(function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):r+=String.fromCharCode(55296|(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536)>>10,56320|1023&o)}return r})(function(e,t){void 0===t&&(t={});var r,n=e8();n.p(e);var o=e6(e,null==(r=t).level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+r.mem,2,4,!0);return e9(o,t),e7(o,o.length-4,n.d()),o}(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e);for(var n=new ex(e.length+(e.length>>>1)),o=0,i=function(e){n[o++]=e},a=0;a<r;++a){if(o+5>n.length){var s=new ex(o+8+(r-a<<1));s.set(n),n=s}var c=e.charCodeAt(a);c<128?i(c):(c<2048?i(192|c>>>6):(c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),i(128|c>>>12&63)):i(224|c>>>12),i(128|c>>>6&63)),i(128|63&c))}return e$(n,0,o)}(JSON.stringify({...e,v:"v1"}))),!0);var tt=function(){function e(e,t,r,n){var o,i=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){return JSON.stringify(te(e))},this.addCompressedEventToManager=function(e,t){i.eventsManager&&i.deviceId&&i.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:i.deviceId})},this.addCompressedEvent=function(e,t){if(i.worker)try{i.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?i.worker.postMessage(JSON.stringify({event:e,sessionId:t})):i.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=i.compressEvent(e);i.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=i.worker)||void 0===e||e.terminate()};var a=(0,G.m)();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(o=t.performanceConfig)||void 0===o?void 0:o.timeout)||2e3,n){t.loggerProvider.log("Enabling web worker for compression");try{var s=new Blob([n],{type:"application/javascript"}),c=URL.createObjectURL(s),l=new Worker(c);l.onerror=function(e){e.preventDefault(),t.loggerProvider.error("Worker failed, falling back to non-worker compression:",e),l.terminate(),i.worker=void 0},l.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;i.addCompressedEventToManager(r,n)},this.worker=l}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();
1if(r){var n=r.event,o=r.sessionId;this.addCompressedEvent(n,o)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),tr="Session replay event batch rejected due to exceeded retry count",tn="Failed to store session replay events in IndexedDB",to="1.35.1",ti=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue((0,T.Cl)((0,T.Cl)({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:tr}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),e.schedule(0)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,T.sH)(this,void 0,void 0,function(){var t,r,n,o,i,a;return(0,T.YH)(this,function(s){switch(s.label){case 0:t=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),s.label=1;case 1:s.trys.push([1,6,7,8]),n=(r=(0,T.Ju)(t)).next(),s.label=2;case 2:if(n.done)return[3,5];return o=n.value,[4,this.send(o,e)];case 3:s.sent(),s.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return i={error:s.sent()},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}return[7];case 8:return[2]}})})},e.prototype.send=function(e,t){var r,n;return void 0===t&&(t=!0),(0,T.sH)(this,void 0,void 0,function(){var o,i,a,s,c,l,u,d,p,h,f,g;return(0,T.YH)(this,function(v){switch(v.label){case 0:if(!(o=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(i=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(a=$(),s=to,c=e.sampleRate,l=new URLSearchParams({device_id:i,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),u="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||s),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];v.label=1;case 1:return v.trys.push([1,6,,7]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(o),"X-Client-Version":s,"X-Client-Library":u,"X-Client-Url":a.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c),"X-Sampling-Hash-Alg":"xxhash32"},body:JSON.stringify(d),method:"POST"},[4,fetch("".concat(Q(e.serverZone,this.trackServerUrl),"?").concat(l.toString()),p)];case 2:if(null===(h=v.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)return[3,3];f="";try{f=JSON.stringify(h.body,null,2)}catch(e){}return this.completeRequest({context:e,success:"".concat(h.status,": ").concat(f)}),[3,5];case 3:return[4,this.handleReponse(h.status,e)];case 4:v.sent(),v.label=5;case 5:return[3,7];case 6:return g=v.sent(),this.completeRequest({context:e,err:g}),[3,7];case 7:return[2]}})})},e.prototype.handleReponse=function(e,t){return(0,T.sH)(this,void 0,void 0,function(){return(0,T.YH)(this,function(r){switch(r.label){case 0:switch(new A().buildStatus(e)){case c.Success:return[3,1];case c.Failed:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(t),[3,5];case 2:return[4,this.handleOtherResponse(t)];case 3:return r.sent(),[3,5];case 4:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),r.label=5;case 5:return[2]}})})},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){return(0,T.sH)(this,void 0,void 0,function(){var t;return(0,T.YH)(this,function(r){switch(r.label){case 0:if(t=e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0))return this.completeRequest({context:e,err:tr}),[2];return[4,new Promise(function(e){return setTimeout(e,t)})];case 1:return r.sent(),[4,this.send(e,!0)];case 2:return r.sent(),[2]}})})},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e}();let ta=(e,t)=>t.some(t=>e instanceof t),ts=new WeakMap,tc=new WeakMap,tl=new WeakMap,tu={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return ts.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return td(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function td(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(td(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",o),e.addEventListener("error",i)});return tl.set(t,e),t}(e);if(tc.has(e))return tc.get(e);let r="function"==typeof(t=e)?(o||(o=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(tp(this),e),td(this.request)}:function(...e){return td(t.apply(tp(this),e))}:(t instanceof IDBTransaction&&function(e){if(ts.has(e))return;let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});ts.set(e,t)}(t),ta(t,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,tu):t;return r!==e&&(tc.set(e,r),tl.set(r,e)),r}let tp=e=>tl.get(e);function th(e,t,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){let a=indexedDB.open(e,t),s=td(a);return n&&a.addEventListener("upgradeneeded",e=>{n(td(a.result),e.oldVersion,e.newVersion,td(a.transaction),e)}),r&&a.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),s.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",e=>o(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}let tf=["get","getKey","getAll","getAllKeys","count"],tg=["put","add","delete","clear"],tv=new Map;function tm(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(tv.get(t))return tv.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,o=tg.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||tf.includes(r)))return;let i=async function(e,...t){let i=this.transaction(e,o?"readwrite":"readonly"),a=i.store;
1return n&&(a=a.index(t.shift())),(await Promise.all([a[r](...t),o&&i.done]))[0]};return tv.set(t,i),i}tu=(e=>({...e,get:(t,r,n)=>tm(t,r)||e.get(t,r,n),has:(t,r)=>!!tm(t,r)||e.has(t,r)}))(tu);let ty=["continue","continuePrimaryKey","advance"],tb={},tw=new WeakMap,tE=new WeakMap,tS={get(e,t){if(!ty.includes(t))return e[t];let r=tb[t];return r||(r=tb[t]=function(...e){tw.set(this,tE.get(this)[t](...e))}),r}};async function*tC(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let r=new Proxy(t,tS);for(tE.set(r,t),tl.set(r,tp(t));t;)yield r,t=await (tw.get(r)||t.continue()),tw.delete(r)}function t_(e,t){return t===Symbol.asyncIterator&&ta(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&ta(e,[IDBIndex,IDBObjectStore])}tu=(e=>({...e,get:(t,r,n)=>t_(t,r)?tC:e.get(t,r,n),has:(t,r)=>t_(t,r)||e.has(t,r)}))(tu);var tT=function(){function e(e){var t,r,n,o=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=o.getStringSize(t);return o.getEventsArraySize(e)+r>=o.maxPersistedEventsSize||Date.now()-o.timeAtLastSplit>o.interval&&!!e.length&&(o.interval=Math.min(o.maxInterval,o.interval+o.minInterval),o._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!==(t=e.minInterval)&&void 0!==t?t:this.minInterval,this.maxInterval=null!==(r=e.maxInterval)&&void 0!==r?r:this.maxInterval,this.maxPersistedEventsSize=null!==(n=e.maxPersistedEventsSize)&&void 0!==n?n:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var o=(0,T.Ju)(e),i=o.next();!i.done;i=o.next()){var a=i.value;n+=this.getStringSize(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}(),tI=function(e,t,r){"object"==typeof r&&null!==r&&"AbortError"===r.name?e.debug(t):e.warn(t)},tk="sessionCurrentSequence",tA="sequencesToSend",tx=function(e){var t,r;return e.objectStoreNames.contains(tk)||(r=e.createObjectStore(tk,{keyPath:"sessionId"})),e.objectStoreNames.contains(tA)||(t=e.createObjectStore(tA,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},tR=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return(0,T.sH)(r,void 0,void 0,function(){var e,t,r,n,o,i;return(0,T.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=a.sent(),a.label=2;case 2:if(!t)return[3,4];return n=(r=t.value).sessionId,o=r.events,e.push({events:o,sequenceId:t.key,sessionId:n}),[4,t.continue()];case 3:return t=a.sent(),[3,2];case 4:return[2,e];case 5:return i=a.sent(),tI(this.loggerProvider,"".concat(tn,": ").concat(i),i),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(e){return(0,T.sH)(r,void 0,void 0,function(){var t,r,n;return(0,T.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,this.db.get(tk,e)];case 1:if(!(t=o.sent()))return[2,void 0];return[4,this.db.put(tA,{sessionId:e,events:t.events})];case 2:return r=o.sent(),[4,this.db.put(tk,{sessionId:e,events:[]})];case 3:return o.sent(),[2,(0,T.Cl)((0,T.Cl)({},t),{sessionId:e,sequenceId:r})];case 4:return n=o.sent(),tI(this.loggerProvider,"".concat(tn,": ").concat(n),n),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(e,t){return(0,T.sH)(r,void 0,void 0,function(){var r,n,o,i,a,s;return(0,T.YH)(this,function(c){switch(c.label){case 0:return c.trys.push([0,10,,11]),[4,(r=this.db.transaction(tk,"readwrite")).store.get(e)];case 1:if(n=c.sent())return[3,3];return[4,r.store.put({sessionId:e,events:[t]})];case 2:return c.sent(),[2];case 3:if(o=void 0,!this.shouldSplitEventsList(n.events,t))return[3,5];return o=n.events,[4,r.store.put({sessionId:e,events:[t]})];case 4:return c.sent(),[3,7];case 5:return i=n.events.concat(t),[4,r.store.put({sessionId:e,events:i})];case 6:c.sent(),c.label=7;case 7:return[4,r.done];case 8:if(c.sent(),!o)return[2,void 0];return[4,this.storeSendingEvents(e,o)];case 9:if(!(a=c.sent()))return[2,void 0];return[2,{events:o,sessionId:e,sequenceId:a}];case 10:return s=c.sent(),tI(this.loggerProvider,"".concat(tn,": ").concat(s),s),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(e,t){return(0,T.sH)(r,void 0,void 0,function(){var r;return(0,T.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(tA,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),tI(this.loggerProvider,"".concat(tn,": ").concat(r),r),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(e,t){return(0,T.sH)(r,void 0,void 0,function(){var e;return(0,T.YH)(this,function(r){switch(r.label){case 0:if(!t)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.db.delete(tA,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),tI(this.loggerProvider,"".concat(tn,": ").concat(e),e),[3,4];case 4:return[2]}})})},r.db=t.db,r}return(0,T.C6)(t,e),t.new=function(e,r){return(0,T.sH)(this,void 0,void 0,function(){var n,o,i;return(0,T.YH)(this,function(a){switch(a.label){case 0:var s;return a.trys.push([0,2,,3]),n="replay"===e?"":"_".concat(e),[4,(s="".concat(r.a
1piKey.substring(0,10),"_amp_session_replay_events").concat(n),(0,T.sH)(void 0,void 0,void 0,function(){return(0,T.YH)(this,function(e){switch(e.label){case 0:return[4,th(s,1,{upgrade:tx})];case 1:return[2,e.sent()]}})}))];case 1:return o=a.sent(),[2,new t((0,T.Cl)((0,T.Cl)({},r),{db:o}))];case 2:return i=a.sent(),tI(r.loggerProvider,"".concat(tn,": ").concat(i),i),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return(0,T.sH)(this,void 0,void 0,function(){var t,r,n,o,i,a;return(0,T.YH)(this,function(s){switch(s.label){case 0:if(!e)return[3,2];return[4,this.db.get("sessionCurrentSequence",e)];case 1:if(!(t=s.sent()))return[2,void 0];return[2,[t]];case 2:r=[],s.label=3;case 3:return s.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:o=(n=T.Ju.apply(void 0,[s.sent()])).next(),s.label=5;case 5:if(o.done)return[3,7];t=o.value,r.push(t),s.label=6;case 6:return o=n.next(),[3,5];case 7:return[3,10];case 8:return i={error:s.sent()},[3,10];case 9:try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(i)throw i.error}return[7];case 10:return[2,r]}})})},t}(tT),tP=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return(0,T.C6)(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=(0,T.fX)([],(0,T.zs)(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return(0,T.sH)(this,void 0,void 0,function(){return(0,T.YH)(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=(0,T.zs)(e,2),r=t[0],n=t[1],o=n.sessionId,i=n.events;return{sequenceId:Number(r),sessionId:o,events:i}})]})})},t.prototype.storeCurrentSequence=function(e){return(0,T.sH)(this,void 0,void 0,function(){return(0,T.YH)(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return(0,T.sH)(this,void 0,void 0,function(){var r;return(0,T.YH)(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return(0,T.sH)(this,void 0,void 0,function(){return(0,T.YH)(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return(0,T.sH)(this,void 0,void 0,function(){return(0,T.YH)(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(tT),tO=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,o=e.type,i=e.payloadBatcher,a=e.storeType;return(0,T.sH)(void 0,void 0,void 0,function(){var e,s,c,l,u,d;function p(t){return void 0===t&&(t=!1),(0,T.sH)(this,void 0,void 0,function(){return(0,T.YH)(this,function(r){return[2,e.flush(t)]})})}return(0,T.YH)(this,function(h){switch(h.label){case 0:if(e=new ti((0,T.Cl)((0,T.Cl)({},t),{loggerProvider:t.loggerProvider,payloadBatcher:i})),s=function(){return new tP({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r})},c=function(){return(0,T.sH)(void 0,void 0,void 0,function(){var e;return(0,T.YH)(this,function(i){switch(i.label){case 0:return[4,tR.new(o,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,apiKey:t.apiKey})];case 1:if(!(e=i.sent()))return t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,s()];return[2,e]}})})},"idb"!==a)return[3,2];return[4,c()];case 1:return u=h.sent(),[3,3];case 2:u=s(),h.label=3;case 3:return l=u,d=function(r){var n=r.events,i=r.sessionId,a=r.deviceId,s=r.sequenceId;t.debugMode&&et().then(function(e){var r=e.totalStorageSize,n=e.percentOfQuota,o=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(o))}).catch(function(){}),e.sendEventsList({events:n,sessionId:i,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:a,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:o,onComplete:function(){return(0,T.sH)(void 0,void 0,void 0,function(){return(0,T.YH)(this,function(e){switch(e.label){case 0:return[4,l.cleanUpSessionEventsStore(i,s)];case 1:return e.sent(),[2]}})})}})},[2,{sendCurrentSequenceEvents:function(e){var r=e.sessionId,n=e.deviceId;l.storeCurrentSequence(r).then(function(e){e&&d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},addEvent:function(e){var r=e.event,n=e.sessionId,o=e.deviceId;l.addEventToCurrentSequence(n,r.data).then(function(e){return e&&d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:o})}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},sendStoredEvents:function(e){var t=e.deviceId;return(0,T.sH)(void 0,void 0,void 0,function(){var e;return(0,T.YH)(this,function(r){switch(r.label){case 0:return[4,l.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},flush:p}]}})})},tN=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach(function(e){r.set(e.name,e.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(e){return(0,T.sH)(this,void 0,void 0,function(){var t;return(0,T.YH)(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEac
1h(function(r){t.push(r.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,o=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:o})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})})},e.prototype.flush=function(e){return(0,T.sH)(this,void 0,void 0,function(){var t;return(0,T.YH)(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.flush(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e}();function tM(e,t,r){for(var n=null,o=[],i=e,a=0;i&&"break"!==function(){var e,s,c,l,u=new Date().getTime()-v.getTime();if(void 0!==f.timeoutMs&&u>f.timeoutMs)throw Error("Timeout: Can't find a unique selector after ".concat(u,"ms"));var d=tz((e=i.getAttribute("id"))&&f.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null)||tz.apply(void 0,(0,T.fX)([],(0,T.zs)(Array.from(i.attributes).filter(function(e){return f.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})),!1))||tz.apply(void 0,(0,T.fX)([],(0,T.zs)(Array.from(i.classList).filter(f.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})),!1))||tz((s=i.tagName.toLowerCase(),f.tagName(s)?{name:s,penalty:2}:null))||[tH()],p=function(e){var t=e.parentNode;if(!t)return null;var r=t.firstChild;if(!r)return null;for(var n=0;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}(i);if("all"==t)p&&(d=d.concat(d.filter(tj).map(function(e){return tF(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(tj).map(function(e){return tF(e,p)})));else if("one"==t){var h=(0,T.zs)(d=d.slice(0,1),1)[0];p&&tj(h)&&(d=[tF(h,p)])}else"none"==t&&(d=[tH()],p&&(d=[tF(d[0],p)]));try{for(var g=(c=void 0,(0,T.Ju)(d)),m=g.next();!m.done;m=g.next()){var h=m.value;h.level=a}}catch(e){c={error:e}}finally{try{m&&!m.done&&(l=g.return)&&l.call(g)}finally{if(c)throw c.error}}if(o.push(d),o.length>=f.seedMinLength&&(n=tD(o,r)))return"break";i=i.parentElement,a++}(););return(n||(n=tD(o,r)),!n&&r)?r():n}function tD(e,t){var r,n,o=tK(function e(t,r){var n,o,i,a,s;return void 0===r&&(r=[]),(0,T.YH)(this,function(c){switch(c.label){case 0:if(!(t.length>0))return[3,9];c.label=1;case 1:c.trys.push([1,6,7,8]),o=(n=(0,T.Ju)(t[0])).next(),c.label=2;case 2:if(o.done)return[3,5];return i=o.value,[5,(0,T.Ju)(e(t.slice(1,t.length),r.concat(i)))];case 3:c.sent(),c.label=4;case 4:return o=n.next(),[3,2];case 5:return[3,8];case 6:return a={error:c.sent()},[3,8];case 7:try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 8:return[3,11];case 9:return[4,r];case 10:c.sent(),c.label=11;case 11:return[2]}})}(e));if(o.length>f.threshold)return t?t():null;try{for(var i=(0,T.Ju)(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(tq(s))return s}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null}function tL(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var o=e[n].level||0;r=t.level===o-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function tU(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function tq(e){var t=tL(e);switch(g.querySelectorAll(t).length){case 0:throw Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function tH(){return{name:"*",penalty:3}}function tF(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function tj(e){return"html"!==e.name&&!e.name.startsWith("#")}function tz(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(tB);return r.length>0?r:null}function tB(e){return null!=e}function tK(e){return(0,T.fX)([],(0,T.zs)(e),!1).sort(function(e,t){return tU(e)-tU(t)})}var tG=function(e){var t=e.version,r=e.events,n=[];return r.forEach(function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&n.push(t)}),{version:t,events:n}},tY=function(e){var t=e.version,r=e.events,n=[];return r.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)}),{version:t,events:Object.values(n.reduce(function(e,t){var r=t.x,n=t.y,o=t.selector,i=t.timestamp,a=i-i%36e5,s="".concat(r,":").concat(n,":").concat(null!=o?o:"",":").concat(a);return e[s]?e[s].count+=1:e[s]=(0,T.Cl)((0,T.Cl)({},t),{timestamp:a,count:1}),e},{}))}},tV=function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,o=e.deviceIdFn,i=e.mirror,a=e.ugcFilterRules,s=e.performanceOptions;return function(e){if(e.type===ev.Click){var c,l=(0,G.m)();
1if(l){var u=l.location,d=l.innerHeight,p=l.innerWidth;if(u){var h=e.x,m=e.y;if(void 0!==h&&void 0!==m){var y=i.getNode(e.id);if(y)try{c=function(e,t){if(v=new Date,e.nodeType!==Node.ELEMENT_NODE)throw Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var r,n={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};g=(r=(f=(0,T.Cl)((0,T.Cl)({},n),t)).root).nodeType===Node.DOCUMENT_NODE?r:r===n.root?r.ownerDocument:r;var o=tM(e,"all",function(){return tM(e,"two",function(){return tM(e,"one",function(){return tM(e,"none")})})});if(o){var i=tK(function e(t,r,n){var o,i,a;return void 0===n&&(n={counter:0,visited:new Map}),(0,T.YH)(this,function(s){switch(s.label){case 0:if(!(t.length>2&&t.length>f.optimizedMinLength))return[3,5];o=1,s.label=1;case 1:var c;if(!(o<t.length-1))return[3,5];if(n.counter>f.maxNumberOfTries||(n.counter+=1,(i=(0,T.fX)([],(0,T.zs)(t),!1)).splice(o,1),a=tL(i),n.visited.has(a)))return[2];if(!(tq(i)&&(c=i,g.querySelector(tL(c))===r)))return[3,4];return[4,i];case 2:return s.sent(),n.visited.set(a,!0),[5,(0,T.Ju)(e(i,r,n))];case 3:s.sent(),s.label=4;case 4:return o++,[3,1];case 5:return[2]}})}(o,e));return i.length>0&&(o=i[0]),tL(o)}throw Error("Selector was not found.")}(y,s)}catch(e){r.logger.debug("error resolving selector from finder")}var b=ee(u.href,a),w={x:h+r.scrollWatcher.currentScrollX,y:m+r.scrollWatcher.currentScrollY,selector:c,viewportHeight:d,viewportWidth:p,pageUrl:b,timestamp:Date.now(),type:"click"},E=o();E&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(w)},deviceId:E})}}}}}},this.logger=e,this.scrollWatcher=t};function tW(){var e=(0,G.m)();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function tJ(){var e=(0,G.m)();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var t$=function(){function e(e,t){var r=(0,G.m)();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=Q(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,o=r.type,i=new URLSearchParams({device_id:e,session_id:String(n),type:String(o),api_key:this.apiKey}),a="".concat(this.basePageUrl,"?").concat(i.toString());this.sendBeacon(a,t)||this.sendXhr(a,t)},e}(),tQ=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,o,i,a,s=e(),c=(0,G.m)();if(c&&s){var l=null!==(n=c.scrollX)&&void 0!==n?n:0,u=null!==(o=c.scrollY)&&void 0!==o?o:0;(l>0||u>0)&&r.update({id:1,x:l,y:u}),r.transport.send(s,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:tW(),viewportWidth:tJ(),pageUrl:ee(c.location.href,null!==(a=null===(i=r.config.interactionConfig)||void 0===i?void 0:i.ugcFilterRules)&&void 0!==a?a:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=tJ(),this._maxScrollHeight=tW(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new t$(t,r),r)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=tJ();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var o=tW();this._maxScrollY=e.y;var i=e.y+o;i>this._maxScrollHeight&&(this._maxScrollHeight=i),this.timestamp=t}},e}(),tX=function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId="".concat(r,"/").concat(t))},tZ=new function(){var e=this;this.dbs={},this.createStore=function(t){return(0,T.sH)(e,void 0,void 0,function(){return(0,T.YH)(this,function(e){switch(e.label){case 0:return[4,th(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return(0,T.sH)(e,void 0,void 0,function(){var e,r;return(0,T.YH)(this,function(n){switch(n.label){case 0:if(this.dbs&&this.dbs[t])return[2,this.dbs[t]];return e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)];case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,o=t.sessionId;return(0,T.sH)(e,void 0,void 0,function(){var e,t,i,a;return(0,T.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=s.sent(),t=String(o),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(i=s.sent())?void 0:i.targetingMatch];case 3:return a=s.sent(),tI(r,"Failed to get targeting match for session id ".concat(o,": ").concat(a),a),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,o=t.sessionId,i=t.targetingMatch;return(0,T.sH)(e,void 0,void 0,function(){var e,t,a;return(0,T.YH)(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=s.sent(),t=String(o),[4,e.put("sessionTargetingMatch",{targetingMatch:i,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,s.sent()];case 3:return a=s.sent(),tI(r,"Failed to store targeting match for session id ".concat(o,": ").concat(a),a),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,o=t.currentSessionId;return(0,T.sH)(e,void 0,void 0,function(){var e,t,i,a,s,c,l,u;return(0,T.YH)(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=d.sent(),t=String(o),[4,(i=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:a=d.sent(),s=0,d.label=3;case 3:if(!(s<a.length))return[3,6];if(c=a[s],l=Date.now()-c.lastUpdated,!(c.sessionId!==t&&l>1728e5))return[3,5];return[4,i.store.delete(c.sessionId)];case 4:d.sent(),d.label=5;case 5:return s++,[3,3];case 6:return[4,i.done];case 7:return d.sent(),[3,9];case 8:return u=d.sent(),tI(r,"Failed to clear old targeting matches for sessions: ".concat(u),u),[3,9];case 9:return[2]}})})}},t0=function(e){var t=e.sessionId,n=e.targetingConfig,o=e.loggerProvider,i=e.apiKey,a=e.targetingParams,s=e.urlChange,c=void 0!==s&&s;return(0,T.sH)(void 0,void 0,void 0,function(){var e,s,l;return(0,T.YH)(this,function(u){switch(u.label){case 0:return[4,tZ.clearStoreOfOldSessions({loggerProvider:o,apiKey:i,currentSessionId:t})];case 1:return u.sent(),[4,tZ.getTargetingMatchForSession({loggerProvider:o,apiKey:i,sessionId:t})];case 2:if(!0===u.sent()&&!c)return[2,!0];e=!0,u.label=3;case 3:return u.trys.push([3,6,,7]),[4,r.e(5503).then(r.bind(r,95503))];case 4:return[4,(0,u.sent().evaluateTargeting)((0,T.Cl)((0,T.Cl)({},a),{flag:n,sessionId:"string"==typeof t?parseInt(t,10):t,apiKey:i,loggerProvider:o}))];case 5:return(s=u.sent())&&s.sr_targeting_config&&(e="on"===s.sr_targeting_config.key),tZ.storeTargetingMatchForSession({loggerProvider:o,apiKey:i,sessionId:t,targetingMatch:e}),[3,7];case 6:return l=u.sent(),o.warn(l.message),[3,7];case 7:return[2,e]}})})};function t1(e,t){return(e<<t|e>>>32-t)>>>0}function t2(e,t){return e=Math.imul(e=t1(e=e+Math.imul(t,0x85ebca77)>>>0,13),0x9e3779b1)>>>0}function t3(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}var t4="__amplitude_url_tracking_patched__",t5=new WeakMap;function t6(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,o=r.pollingInterval;if(void 0!==n&&n){var i=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},a=i(),s=e.setInterval(function(){var e=i();e!==a&&(a=e,t(e))},void 0===o?1e3:o);return function(){null!=s&&e.clearInterval(s)}}var c=t5.get(e);if(!c){var l=void 0,u=new Set,d=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},p=function(){var e=d();(void 0===l||e!==l)&&(l=e,u.forEach(function(t){return t(e)}))},h=function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return p(),n};return t[t4]=!0,t},f=e.history;if(null==f?void 0:f.pushState){var g=Reflect.get(f,"pushState");g[t4]||(f.pushState=h(g))}if(null==f?void 0:f.replaceState){var v=Reflect.get(f,"replaceState");v[t4]||(f.replaceState=h(v))}c={callbacks:u,notify:p,onPopStateOrHashChange:function(){return p()},listenersAttached:!1},t5.set(e,c)}var m=c;return m.listenersAttached||(e.addEventListener("popstate",m.onPopStateOrHashChange),e.addEventListener("hashchange",m.onPopStateOrHashChange),m.listenersAttached=!0),m.callbacks.add(t),function(){m.callbacks.delete(t),0===m.callbacks.size&&m.listenersAttached&&(e.removeEventListener("popstate",m.onPopStateOrHashChange),e.removeEventListener("hashchange",m.onPopStateOrHashChange),m.listenersAttached=!1)}}function t8(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var o,i,a,s=(0,T.Cl)((0,T.Cl)({},e),n),c=s.ugcFilterRules||[],l=null!==(o=s.enablePolling)&&void 0!==o&&o,u=null!==(i=s.pollingInterval)&&void 0!==i?i:1e3,d=null!==(a=s.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,h=function(){return r.location&&r.location.href||""}
1,f=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,o=h(),i="";return d&&(i=(null==n?void 0:n.title)||""),{href:c.length>0?ee(o,c):o,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}},g=function(){var e=h();(void 0===p||e!==p)&&(p=e,t(f()))},v=t6(r,function(){return g()},l?{enablePolling:!0,pollingInterval:u}:{});return g(),function(){return v()}},options:e}}t8();var t7=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.urlChangeCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(t){var r=(0,G.m)();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),t||r.addEventListener("blur",e.blurListener),t||r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),t||r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),t||r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n,o){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),(0,T.sH)(e,void 0,void 0,function(){var e,i,a,s,c,l,u,d,h,f,g,v;return(0,T.YH)(this,function(m){switch(m.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}if(this.lastTargetingParams=t,!((e=this.config.targetingConfig)&&!this.sessionTargetingMatch))return[3,2];return i=o?this.latestUrlChangeTargetingEvaluationId:void 0,(a=t.event)&&Object.values(p).includes(a.event_type)&&(a=void 0),s=null!==(g=null!==(d=null===(u=t.page)||void 0===u?void 0:u.url)&&void 0!==d?d:null===(f=null===(h=(0,G.m)())||void 0===h?void 0:h.location)||void 0===f?void 0:f.href)&&void 0!==g?g:"",c=null!==(v=t.page)&&void 0!==v?v:""!==s?{url:s}:void 0,[4,t0({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:a,page:c},urlChange:o})];case 1:if(l=m.sent(),o&&void 0!==i&&i!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(i,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||l,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:a,targetingParams:t},null,2)),m.label=2;case 2:if(!r)return[3,3];return this.initialize(!0),[3,5];case 3:if(!(n||!this.recordCancelCallback))return[3,5];return this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()];case 4:m.sent(),m.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),(0,T.sH)(e,void 0,void 0,function(){var e,o,i,a;return(0,T.YH)(this,function(s){switch(s.label){case 0:if(s.trys.push([0,3,,4]),e=void 0,!((o=this.config)&&t!==u.METADATA)||(e={config:er(o),version:to},!n))return[3,2];return[4,et()];case 1:i=s.sent(),e=(0,T.Cl)((0,T.Cl)({},i),e),s.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,(0,T.Cl)((0,T.Cl)({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=s.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(t.toString()))}},this.loggerProvider=new K(new k)}return e.prototype.init=function(e,t){return ei(this._init(e,t))},e.prototype.setupUrlChangeListenerForTargeting=function(){var e,t=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var r=(0,G.m)();if(null==r?void 0:r.location){var n=t6(r,function(e){var r=++t.latestUrlChangeTargetingEvaluationId;t.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}}
1,!1,!1,!0),t.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(r," for ").concat(e,"."))});this.urlChangeCleanup=function(){n(),t.urlChangeCleanup=null}}},e.prototype.getCurrentPageForTargeting=function(){var e,t,r=null===(t=null===(e=(0,G.m)())||void 0===e?void 0:e.location)||void 0===t?void 0:t.href;return null!=r?{url:r}:void 0},e.prototype._init=function(e,t){var n,o,i,a,s,c,l,u;return(0,T.sH)(this,void 0,void 0,function(){var d,p,h,f,g,v,m,y,b,w,E,S,C,_,I;return(0,T.YH)(this,function(A){switch(A.label){case 0:return null===(n=this.urlChangeCleanup)||void 0===n||n.call(this),this.loggerProvider=new K(t.loggerProvider||new k),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new tX({sessionId:t.sessionId,deviceId:t.deviceId}),d=this,[4,(0,T.sH)(void 0,void 0,void 0,function(){var r;return(0,T.YH)(this,function(n){return r=new eo(e,t),[2,new eA(new eI(e,r.loggerProvider,r.serverZone,t.configServerUrl),r)]})})];case 1:return d.joinedConfigGenerator=A.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:h=(p=A.sent()).joinedConfig,f=p.localConfig,g=p.remoteConfig,this.config=h,this.setMetadata(t.sessionId,h,f,g,null===(o=t.version)||void 0===o?void 0:o.version,to,null===(i=t.version)||void 0===i?void 0:i.type),t.sessionId&&(null===(a=this.config.interactionConfig)||void 0===a?void 0:a.enabled)&&(v=tQ.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[v.send(this.getDeviceId.bind(this)).bind(v)],this.scrollHook=v.hook.bind(v),this.clickHandler=new tV(this.loggerProvider,v)),m=[],"idb"!==(y=this.config.storeType)||(null===(s=(0,G.m)())||void 0===s?void 0:s.indexedDB)||(y="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(y," for event storage.")),A.label=3;case 3:return A.trys.push([3,5,,6]),[4,tO({config:this.config,type:"replay",storeType:y})];case 4:return b=A.sent(),m.push({name:"replay",manager:b}),[3,6];case 5:return w=A.sent(),this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(w.toString())),[3,6];case 6:if(!(null===(c=this.config.interactionConfig)||void 0===c?void 0:c.enabled))return[3,10];E=this.config.interactionConfig.batch?tY:tG,A.label=7;case 7:return A.trys.push([7,9,,10]),[4,tO({config:this.config,type:"interaction",minInterval:null!==(l=this.config.interactionConfig.trackEveryNms)&&void 0!==l?l:3e4,maxInterval:6e4,payloadBatcher:E,storeType:y})];case 8:return S=A.sent(),m.push({name:"interaction",manager:S}),[3,10];case 9:return w=A.sent(),this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(w.toString())),[3,10];case 10:if(this.eventsManager=new(tN.bind.apply(tN,(0,T.fX)([void 0],(0,T.zs)(m),!1))),this.eventCompressor&&this.eventCompressor.terminate(),C=void 0,_=(0,G.m)(),!(this.config.useWebWorker&&_&&_.Worker))return[3,12];return[4,r.e(4382).then(r.bind(r,64382))];case 11:C=A.sent().compressionScript,A.label=12;case 12:return this.eventCompressor=new tt(this.eventsManager,this.config,this.getDeviceId(),C),[4,this.initializeNetworkObservers()];case 13:return A.sent(),(null===(u=(0,G.m)())||void 0===u?void 0:u.opener)&&(function(e,t){if(!0!==e[ed]){e[ed]=!0;var r=null,n=function(t,r){var n,o;"background-capture-complete"===t&&(null===(o=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===o||o.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(){null===(o=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===o||o.call(t,"Initializing background capture (external script)");var t,o,i=new URL("https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz",e.endpoint).toString();e.loadScriptOnce(i).then(function(){var t,o,i;null===(o=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===o||o.call(t,"Background capture script loaded (external)"),r=null===(i=null==window?void 0:window.amplitudeBackgroun
1dCapture)||void 0===i?void 0:i.call(window,{messenger:e,onBackgroundCapture:n}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==r?void 0:r.close)||void 0===e||e.call(r),r=null})}}(I=function(e){var t=(0,G.m)(),r=null==t?void 0:t[el];if("object"==typeof r&&null!==r&&ec in r&&!0===r[ec])return r;var n=new eu(void 0);return t&&(t[el]=n),n}()),I.setup((0,T.Cl)({logger:this.loggerProvider},this.config.serverZone&&{endpoint:es[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 14:return A.sent(),this.config.targetingConfig&&this.setupUrlChangeListenerForTargeting(),[2]}})})},e.prototype.setSessionId=function(e,t){return ei(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return(0,T.sH)(this,void 0,void 0,function(){var o,i,a;return(0,T.YH)(this,function(s){switch(s.label){case 0:if(this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(o=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(o),i=t||this.getDeviceId(),this.identifiers=new tX({sessionId:e,deviceId:i}),!(this.joinedConfigGenerator&&o))return[3,2];return[4,this.joinedConfigGenerator.generateJoinedConfig()];case 1:a=s.sent().joinedConfig,this.config=a,s.label=2;case 2:if(!(null===(n=this.config)||void 0===n?void 0:n.targetingConfig))return[3,4];return[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)];case 3:return s.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:s.sent(),s.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),o={};return n&&((e={})[L]=r.sessionReplayId?r.sessionReplayId:null,o=e,t.debugMode&&(o[H]=JSON.stringify({appHash:ep(t.apiKey).toString()}))),this.addCustomRRWebEvent(u.GET_SR_PROPS,{shouldRecord:n,eventProperties:o},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,o},e.prototype.sendEvents=function(e){var t,r=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),(0,T.sH)(this,void 0,void 0,function(){var r;return(0,T.YH)(this,function(n){return(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId)?(r=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){if(null===(e=this.config)||void 0===e?void 0:e.instanceName){var e,t,r,n;r=(void 0===(n=this.config.instanceName)&&(n=R),eh.i.getInstance(n)).identityStore.getIdentity().optOut}return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r=!1,n="",o=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),r=!0,o=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,o=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,function(e,t){void 0===t&&(t=0);var r,n=function(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<e.length){var o=e.charCodeAt(r+1);o>=56320&&o<=57343&&(n=(n-55296<<10)+(o-56320)+65536,r++)}n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}return new Uint8Array(t)}(e),o=n.length,i=0;if(o>=16){for(var a=t+0x9e3779b1+0x85ebca77>>>0,s=t+0x85ebca77>>>0,c=t>>>0,l=t-0x9e3779b1>>>0;i<=o-16;)a=t2(a,t3(n,i)),i+=4,s=t2(s,t3(n,i)),i+=4,c=t2(c,t3(n,i)),i+=4,l=t2(l,t3(n,i)),i+=4;r=t1(a,1)+t1(s,7)+t1(c,12)+t1(l,18)>>>0}else r=t+0x165667b1>>>0;for(r=r+o>>>0;i<=o-4;)r=Math.imul(t1(r=r+Math.imul(t3(n,i),0xc2b2ae3d)>>>0,17),0x27d4eb2f)>>>0,i+=4;for(;i<o;)r=Math.imul(t1(r=r+Math.imul(n[i],0x165667b1)>>>0,11),0x9e3779b1)>>>0,i++;return r^=r>>>15,r=Math.imul(r,0x85ebca77)>>>0,r^=r>>>13,r=Math.imul(r,0xc2b2ae3d)>>>0,(r^=r>>>16)>>>0}(e.toString())%1e6/1e6<t)?(r=!0,o=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),r=!1,o=!1),this.lastShouldRecordDecision!==r&&this.config.targetingConfig&&(this.addCustomRRWebEvent(u.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:o,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=r),r},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){if((null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel)==="conservative")return"*";var e,t,r,n,o=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;if(o)return o},e.prototype.getRecordingPlugins=function(e){var t,n,o,i,a,s;return(0,T.sH)(this,void 0,void 0,function(){var c,l,u,d;return(0,T.YH)(this,function(p){switch(p.label){case 0:c=[];try{l=t8({ugcFilterRules:(null===(n=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)||[],enablePolling:(null===(o=this.config)||void 0===o?void 0:o.enableUrlChangePolling)||!1,pollingInterval:null===(i=this.config)||void 0===i?void 0:i.urlChangePollingInterval,captureDocumentTitle:null===(a=this.config)||void 0===a?void 0:a.captureDocumentTitle}),c.push(l)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(s=null==e?void 0:e.console)||void 0===s?void 0:s.enabled))return[3,4];p.label=1;case 1:return p.trys.push([1,3,,4]),[4,r.e(8970).then(r.bind(r,25139))];case 2:return u=p.sent().getRecordConsolePlugin,c.push(u({level:e.console.levels})),[3,4];case 3:return d=p.sent(),this.loggerProvider.warn("Failed to load console plugin:",d),[3,4];case 4:return[2,c.length>0?c:void 0]}})})},e.prototype.getRecordFunction=function(){return(0,T.sH)(this,void 0,void 0,function(){var e,t;return(0,T.YH)(this,function(n){switch(n.label){case 0:if(this.recordFunction)return[2,this.recordFunction];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,r.e(7840).then(r.bind(r,95299))];case 2:return e=n.sent().record,this.recordFunction=e,[2,e];case 3:return t=n.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){var t,r,n,o,i,a,s,c;return void 0===e&&(e=!0),(0,T.sH)(this,void 0,void 0,function(){var l,d,p,h,f,g,v,m,y,b,w,E,S,C,_,I=this;return(0,T.YH)(this,function(T){switch(T.label){case 0:if(l=this.config,d=this.getShouldRecord(),p=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,!d||!p||!l)return[2];return this.stopRecordingEvents(),[4,this.getRecordFunction()];case 1:if(!(h=T.sent()))return[2];return[4,this.initializeNetworkObservers()];case 2:T.sent(),f=null===(r=l.loggingConfig)||void 0===r?void 0:r.network,g=[j,z,B,Q(l.serverZone,l.trackServerUrl)],null===(n=this.networkObservers)||void 0===n||n.start(function(e){g.some(function(t){return e.url.
1startsWith(t)})||I.addCustomRRWebEvent(u.FETCH_REQUEST,e)},f),v=l.privacyConfig,m=l.interactionConfig,y=l.loggingConfig,b=(null==m?void 0:m.enabled)?{mouseInteraction:this.eventsManager&&(null===(o=this.clickHandler)||void 0===o?void 0:o.createHook({eventsManager:this.eventsManager,sessionId:p,deviceIdFn:this.getDeviceId.bind(this),mirror:h.mirror,ugcFilterRules:null!==(i=m.ugcFilterRules)&&void 0!==i?i:[],performanceOptions:null===(a=l.performanceConfig)||void 0===a?void 0:a.interaction})),scroll:this.scrollHook}:{},w=(null==m?void 0:m.enabled)&&m.ugcFilterRules?m.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(p,".")),T.label=3;case 3:var k;return T.trys.push([3,5,,6]),E=this,S=h,_={emit:function(e){if(I.shouldOptOut()){I.loggerProvider.log("Opting session ".concat(p," out of recording due to optOut config.")),I.stopRecordingEvents(),I.sendEvents();return}e.type===ef.Meta&&(e.data.href=ee(e.data.href,w)),I.eventCompressor&&I.eventCompressor.enqueueEvent(e,p)},inlineStylesheet:l.shouldInlineStylesheet,hooks:b,maskAllInputs:!0,maskTextClass:F,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:l.applyBackgroundColorToBlockedElements,maskInputFn:J("input",v),maskTextFn:J("text",v),maskAttributeFn:(k=v,function(e,t,r){var n;return"style"!==e&&(null!==(n=null==k?void 0:k.maskAttributes)&&void 0!==n?n:[]).includes(e)&&W("text",k,r)?t.replace(/[^\s]/g,"*"):t}),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(s=l.omitElementTags)||void 0===s?void 0:s.script,comment:null===(c=l.omitElementTags)||void 0===c?void 0:c.comment},errorHandler:function(e){if(e.message.includes("insertRule")&&e.message.includes("CSSStyleSheet")||e._external_)throw e;return I.loggerProvider.warn("Error while capturing replay: ",e.toString()),!0}},[4,this.getRecordingPlugins(y)];case 4:return E.recordCancelCallback=S.apply(void 0,[(_.plugins=T.sent(),_)]),this.addCustomRRWebEvent(u.DEBUG_INFO),e&&this.addCustomRRWebEvent(u.METADATA,this.metadata),[3,6];case 5:return C=T.sent(),this.loggerProvider.warn("Failed to initialize session replay:",C),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),(0,T.sH)(this,void 0,void 0,function(){return(0,T.YH)(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){var e;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this),this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,o,i,a){var s=(null==e?void 0:e.toString())?ep(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:s,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(a),replaySDKVersion:o,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:i}},e.prototype.initializeNetworkObservers=function(){var e,t,n;return(0,T.sH)(this,void 0,void 0,function(){var o,i;return(0,T.YH)(this,function(a){switch(a.label){case 0:if(!((null===(n=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===n?void 0:n.enabled)&&!this.networkObservers))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r.e(2758).then(r.bind(r,22758))];case 2:return o=a.sent().NetworkObservers,this.networkObservers=new o,[3,4];case 3:return i=a.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",i),[3,4];case 4:return[2]}})})},e}(),t9=function(e){return function(){var t=e.config||en();return{logger:t.loggerProvider,logLevel:t.logLevel}}};let re=function(){var e=new t7;return{init:_(e.init.bind(e),"init",t9(e)),evaluateTargetingAndCapture:_(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",t9(e)),setSessionId:_(e.setSessionId.bind(e),"setSessionId",t9(e)),getSessionId:_(e.getSessionId.bind(e),"getSessionId",t9(e)),getSessionReplayProperties:_(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",t9(e)),flush:_(e.flush.bind(e),"flush",t9(e)),shutdown:_(e.shutdown.bind(e),"shutdown",t9(e))}}();var rt=re.init,rr=re.setSessionId,rn=re.getSessionId,ro=re.getSessionReplayProperties,ri=re.flush,ra=re.shutdown,rs=re.evaluateTargetingAndCapture;!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"}(m||(m={})),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"}(y||(y={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(b||(b={}));var rc=[m.SET,m.SET_ONCE,m.ADD,m.APPEND,m.PREPEND,m.POSTINSERT],rl=function(e){if(e.user_properties){var t={};
1return Object.keys(e.user_properties).forEach(function(r){if(rc.includes(r)){var n=e.user_properties&&e.user_properties[r];t=w(w({},t),n)}}),t}},ru="1.27.6",rd="".concat("[Amplitude]"," Session Replay ID"),rp=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:ri,getSessionId:rn,getSessionReplayProperties:ro,init:rt,setSessionId:rr,shutdown:ra,evaluateTargetingAndCapture:rs},this.options=w({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var r,n,o,i,a,s,c,l;return E(this,void 0,void 0,function(){var t,u;return S(this,function(d){switch(d.label){case 0:var p;return d.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(ru,".")),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=w(w({},e.defaultTracking),{sessions:!0})),t=(void 0===(p=this.config.instanceName)&&(p="$default_instance"),eh.i.getInstance(p)).identityStore.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null===(n=this.config.remoteConfig)||void 0===n?void 0:n.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.blockSelector,maskSelector:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.maskSelector,unmaskSelector:null===(a=this.options.privacyConfig)||void 0===a?void 0:a.unmaskSelector,defaultMaskLevel:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:ru},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(c=this.options.useWebWorker)&&void 0!==c?c:null===(l=this.options.experimental)||void 0===l?void 0:l.useWebWorker,userProperties:t,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return d.sent(),[3,3];case 2:return u=d.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(u.message)),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(e){var t;return E(this,void 0,void 0,function(){return S(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return E(this,void 0,void 0,function(){return S(this,function(r){switch(r.label){case 0:if(null===(t=this.config)||void 0===t||t.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),!e)return[3,1];return this.sessionReplay.shutdown(),[3,4];case 1:if(!(null!=this.config))return[3,3];return[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise];case 2:r.sent(),r.label=3;case 3:r.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var t,r,n;return E(this,void 0,void 0,function(){var o,i,s,c,l;return S(this,function(u){switch(u.label){case 0:if(u.trys.push([0,9,,10]),!this.options.customSessionId)return[3,4];if(!(o=this.options.customSessionId(e)))return[3,3];if(!(o!==this.sessionReplay.getSessionId()))return[3,2];return[4,this.sessionReplay.setSessionId(o).promise];case 1:u.sent(),u.label=2;case 2:i=this.sessionReplay.getSessionReplayProperties(),e.event_properties=w(w({},e.event_properties),i),u.label=3;case 3:return[3,8];case 4:if(!((o=null===(t=this.config)||void 0===t?void 0:t.sessionId)&&o!==this.sessionReplay.getSessionId()))return[3,6];return[4,this.sessionReplay.setSessionId(o).promise];case 5:u.sent(),u.label=6;case 6:if(!(o&&o===e.session_id))return[3,8];return s=void 0,e.event_type===a.IDENTIFY&&(s=rl(e)),c=C(),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:s,page:(null===(r=null==c?void 0:c.location)||void 0===r?void 0:r.href)!=null?{url:c.location.href}:void 0})];case 7:u.sent(),i=this.sessionReplay.getSessionReplayProperties(),e.event_properties=w(w({},e.event_properties),i),u.label=8;case 8:return e.event_type===a.IDENTIFY&&e.event_properties&&delete e.event_properties[rd],[2,Promise.resolve(e)];case 9:return l=u.sent(),null===(n=this.config)||void 0===n||n.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(l.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return E(this,void 0,void 0,function(){return S(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),rh=function(e){return new rp(e)}},92851:(e,t,r)=>{"use strict";r.d(t,{m:()=>n});var n=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!==r.g?r.g:void 0}},13345:function(e,t,r){var n;!function(o,i){"use strict";var a="function",s="undefined",c="object",l="string",u="model",d="name",p="type",h="vendor",f="version",g
vendor: 4,121 bytes, line 1
1="architecture",v="console",m="mobile",y="tablet",b="smarttv",w="wearable",E="embedded",S="Amazon",C="Apple",_="ASUS",T="BlackBerry",I="Browser",k="Chrome",A="Firefox",x="Google",R="Huawei",P="Microsoft",O="Motorola",N="Opera",M="Samsung",D="Sharp",L="Sony",U="Xiaomi",q="Zebra",H="Facebook",F=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},j=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},z=function(e,t){return typeof e===l&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,350)},G=function(e,t){for(var r,n,o,s,l,u,d=0;d<t.length&&!l;){var p=t[d],h=t[d+1];for(r=n=0;r<p.length&&!l;)if(l=p[r++].exec(e))for(o=0;o<h.length;o++)u=l[++n],typeof(s=h[o])===c&&s.length>0?2===s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3===s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):void 0:this[s[0]]=u?s[1].call(this,u,s[2]):void 0:4===s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):void 0):this[s]=u||i;d+=2}},Y=function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(z(t[r][n],e))return"?"===r?i:r}else if(z(t[r],e))return"?"===r?i:r;return e},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"},W={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,f],[/opios[\/ ]+([\w\.]+)/i],[f,[d,N+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[d,N]],[/(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],[d,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[d,"UC"+I]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[d,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[d,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[d,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+I],f],[/\bfocus\/([\w\.]+)/i],[f,[d,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[d,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[d,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[d,"MIUI "+I]],[/fxios\/([-\w\.]+)/i],[f,[d,A]],[/\bqihu|(qi?ho?o?|360)browser/i],[[d,"360 "+I]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1 "+I],f],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[d,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,H],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[d,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[d,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[d,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,k+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[d,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[f,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}
vendor: 4,519 bytes, line 1
1]],[/(webkit|khtml)\/([\w\.]+)/i],[d,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[d,A+" 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],[d,f],[/(cobalt)\/([\w\.]+)/i],[d,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,B]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,B]]],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],[u,[h,M],[p,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[h,M],[p,m]],[/((ipod|iphone)\d+,\d+)/i],[u,[h,C],[p,m]],[/(ipad\d+,\d+)/i],[u,[h,C],[p,y]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[h,C],[p,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[h,C],[p,y]],[/(macintosh);/i],[u,[h,C]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[h,R],[p,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[h,R],[p,m]],[/\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],[[u,/_/g," "],[h,U],[p,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[h,U],[p,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[h,"OPPO"],[p,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[h,"Vivo"],[p,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[h,"Realme"],[p,m]],[/\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],[u,[h,O],[p,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[h,O],[p,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[h,"LG"],[p,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[h,"LG"],[p,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[h,"Lenovo"],[p,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[h,"Nokia"],[p,m]],[/(pixel c)\b/i],[u,[h,x],[p,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[h,x],[p,m]],[/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],[u,[h,L],[p,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[h,L],[p,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[h,"OnePlus"],[p,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[h,S],[p,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[h,S],[p,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,h,[p,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[h,T],[p,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[h,_],[p,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[h,_],[p,m]],[/(nexus 9)/i],[u,[h,"HTC"],[p,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[u,/_/g," "],[p,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[h,"Acer"],[p,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[h,"Meizu"],[p,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[h,D],[p,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asu
vendor: 5,491 bytes, line 1
1s)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,u,[p,m]],[/(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,u,[p,y]],[/(surface duo)/i],[u,[h,P],[p,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[h,"Fairphone"],[p,m]],[/(u304aa)/i],[u,[h,"AT&T"],[p,m]],[/\bsie-(\w*)/i],[u,[h,"Siemens"],[p,m]],[/\b(rct\w+) b/i],[u,[h,"RCA"],[p,y]],[/\b(venue[\d ]{2,7}) b/i],[u,[h,"Dell"],[p,y]],[/\b(q(?:mv|ta)\w+) b/i],[u,[h,"Verizon"],[p,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[h,"Barnes & Noble"],[p,y]],[/\b(tm\d{3}\w+) b/i],[u,[h,"NuVision"],[p,y]],[/\b(k88) b/i],[u,[h,"ZTE"],[p,y]],[/\b(nx\d{3}j) b/i],[u,[h,"ZTE"],[p,m]],[/\b(gen\d{3}) b.+49h/i],[u,[h,"Swiss"],[p,m]],[/\b(zur\d{3}) b/i],[u,[h,"Swiss"],[p,y]],[/\b((zeki)?tb.*\b) b/i],[u,[h,"Zeki"],[p,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],u,[p,y]],[/\b(ns-?\w{0,9}) b/i],[u,[h,"Insignia"],[p,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[h,"NextBook"],[p,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],u,[p,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],u,[p,m]],[/\b(ph-1) /i],[u,[h,"Essential"],[p,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[h,"Envizen"],[p,y]],[/\b(trio[-\w\. ]+) b/i],[u,[h,"MachSpeed"],[p,y]],[/\btu_(1491) b/i],[u,[h,"Rotor"],[p,y]],[/(shield[\w ]+) b/i],[u,[h,"Nvidia"],[p,y]],[/(sprint) (\w+)/i],[h,u,[p,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[h,P],[p,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[h,q],[p,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[h,q],[p,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,u,[p,v]],[/droid.+; (shield) bui/i],[u,[h,"Nvidia"],[p,v]],[/(playstation [345portablevi]+)/i],[u,[h,L],[p,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[h,P],[p,v]],[/smart-tv.+(samsung)/i],[h,[p,b]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[h,M],[p,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,"LG"],[p,b]],[/(apple) ?tv/i],[h,[u,C+" TV"],[p,b]],[/crkey/i],[[u,k+"cast"],[h,x],[p,b]],[/droid.+aft(\w)( bui|\))/i],[u,[h,S],[p,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[h,D],[p,b]],[/(bravia[\w ]+)( bui|\))/i],[u,[h,L],[p,b]],[/(mitv-\w{5}) bui/i],[u,[h,U],[p,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,K],[u,K],[p,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,b]],[/((pebble))app/i],[h,u,[p,w]],[/droid.+; (glass) \d/i],[u,[h,x],[p,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[h,q],[p,w]],[/(quest( 2)?)/i],[u,[h,H],[p,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[p,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[p,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[p,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[d,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[d,"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],[d,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[d,[f,Y,V]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[d,"Windows"],[f,Y,V]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,f],[/\(bb(10);/i],[f,[d,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[d,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[d,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[d,k+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[d,"Chromium OS"],f],[/(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],[d,f],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[d,f]]},J=function(e,t){if(typeof e===c&&(t=e,e=i),!(this instanceof J))return new J
1(e,t).getResult();var r=e||(typeof o!==s&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),n=t?F(W,t):W;return this.getBrowser=function(){var e,t={};return t[d]=i,t[f]=i,G.call(t,r,n.browser),t.major=typeof(e=t.version)===l?e.replace(/[^\d\.]/g,"").split(".")[0]:i,t},this.getCPU=function(){var e={};return e[g]=i,G.call(e,r,n.cpu),e},this.getDevice=function(){var e={};return e[h]=i,e[u]=i,e[p]=i,G.call(e,r,n.device),e},this.getEngine=function(){var e={};return e[d]=i,e[f]=i,G.call(e,r,n.engine),e},this.getOS=function(){var e={};return e[d]=i,e[f]=i,G.call(e,r,n.os),e},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 r},this.setUA=function(e){return r=typeof e===l&&e.length>350?K(e,350):e,this},this.setUA(r),this};J.VERSION="0.7.33",J.BROWSER=j([d,f,"major"]),J.CPU=j([g]),J.DEVICE=j([u,h,p,v,m,b,y,w,E]),J.ENGINE=J.OS=j([d,f]),typeof t!==s?(e.exports&&(t=e.exports=J),t.UAParser=J):r.amdO?i!==(n=(function(){return J}).call(t,r,t,e))&&(e.exports=n):typeof o!==s&&(o.UAParser=J);var $=typeof o!==s&&(o.jQuery||o.Zepto);if($&&!$.ua){var Q=new J;$.ua=Q.getResult(),$.ua.get=function(){return Q.getUA()},$.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)$.ua[r]=t[r]}}}("object"==typeof window?window:this)},3130:(e,t,r)=>{"use strict";r.d(t,{v:()=>rs});var n,o,i,a,s,c,l,u,d,p,h,f,g,v,m,y,b,w,E,S,C,_,T,I,k,A,x,R,P,O,N,M,D,L,U,q,H,F,j,z,B,K,G=function(e,t){return(G=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function Y(e,t){function r(){this.constructor=e}G(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var V=function(){return(V=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function W(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function J(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function $(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function Q(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}(arguments[t]));return e}!function(e){e.AcquireTokenByCode="acquireTokenByCode",e.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",e.AcquireTokenSilent="acquireTokenSilent",e.AcquireTokenSilentAsync="acquireTokenSilentAsync",e.AcquireTokenPopup="acquireTokenPopup",e.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",e.CryptoOptsSignJwt="cryptoOptsSignJwt",e.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",e.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",e.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",e.SsoSilent="ssoSilent",e.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",e.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",e.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",e.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",e.BrokerHandhshake="brokerHandshake",e.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",e.AcquireTokenByBroker="acquireTokenByBroker",e.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",e.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",e.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken",e.AcquireTokenByCodeAsync="acquireTokenByCodeAsync",e.GetEndpointMetadataFromNetwork="getEndpointMetadataFromNetwork",e.GetCloudDiscoveryMetadataFromNetworkMeasurement="getCloudDiscoveryMetadataFromNetworkMeasurement",e.HandleRedirectPromiseMeasurement="handleRedirectPromiseMeasurement",e.UpdateCloudDiscoveryMetadataMeasurement="updateCloudDiscoveryMetadataMeasurement",e.UsernamePasswordCl
1ientAcquireToken="usernamePasswordClientAcquireToken"}(n||(n={})),function(e){e[e.NotStarted=0]="NotStarted",e[e.InProgress=1]="InProgress",e[e.Completed=2]="Completed"}(o||(o={}));var X=function(e,t){return(X=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function Z(e,t){function r(){this.constructor=e}X(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ee=function(){return(ee=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function et(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function er(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function en(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}var eo={SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},ei=[eo.OPENID_SCOPE,eo.PROFILE_SCOPE,eo.OFFLINE_ACCESS_SCOPE],ea=en(ei,[eo.EMAIL_SCOPE]);!function(e){e.CONTENT_TYPE="Content-Type",e.RETRY_AFTER="Retry-After",e.CCS_HEADER="X-AnchorMailbox",e.WWWAuthenticate="WWW-Authenticate",e.AuthenticationInfo="Authentication-Info",e.X_MS_REQUEST_ID="x-ms-request-id",e.X_MS_HTTP_VERSION="x-ms-httpver"}(i||(i={})),function(e){e.ID_TOKEN="idtoken",e.CLIENT_INFO="client.info",e.ADAL_ID_TOKEN="adal.idtoken",e.ERROR="error",e.ERROR_DESC="error.description",e.ACTIVE_ACCOUNT="active-account",e.ACTIVE_ACCOUNT_FILTERS="active-account-filters"}(a||(a={})),function(e){e.COMMON="common",e.ORGANIZATIONS="organizations",e.CONSUMERS="consumers"}(s||(s={})),function(e){e.CLIENT_ID="client_id",e.REDIRECT_URI="redirect_uri",e.RESPONSE_TYPE="response_type",e.RESPONSE_MODE="response_mode",e.GRANT_TYPE="grant_type",e.CLAIMS="claims",e.SCOPE="scope",e.ERROR="error",e.E
1RROR_DESCRIPTION="error_description",e.ACCESS_TOKEN="access_token",e.ID_TOKEN="id_token",e.REFRESH_TOKEN="refresh_token",e.EXPIRES_IN="expires_in",e.STATE="state",e.NONCE="nonce",e.PROMPT="prompt",e.SESSION_STATE="session_state",e.CLIENT_INFO="client_info",e.CODE="code",e.CODE_CHALLENGE="code_challenge",e.CODE_CHALLENGE_METHOD="code_challenge_method",e.CODE_VERIFIER="code_verifier",e.CLIENT_REQUEST_ID="client-request-id",e.X_CLIENT_SKU="x-client-SKU",e.X_CLIENT_VER="x-client-VER",e.X_CLIENT_OS="x-client-OS",e.X_CLIENT_CPU="x-client-CPU",e.X_CLIENT_CURR_TELEM="x-client-current-telemetry",e.X_CLIENT_LAST_TELEM="x-client-last-telemetry",e.X_MS_LIB_CAPABILITY="x-ms-lib-capability",e.X_APP_NAME="x-app-name",e.X_APP_VER="x-app-ver",e.POST_LOGOUT_URI="post_logout_redirect_uri",e.ID_TOKEN_HINT="id_token_hint",e.DEVICE_CODE="device_code",e.CLIENT_SECRET="client_secret",e.CLIENT_ASSERTION="client_assertion",e.CLIENT_ASSERTION_TYPE="client_assertion_type",e.TOKEN_TYPE="token_type",e.REQ_CNF="req_cnf",e.OBO_ASSERTION="assertion",e.REQUESTED_TOKEN_USE="requested_token_use",e.ON_BEHALF_OF="on_behalf_of",e.FOCI="foci",e.CCS_HEADER="X-AnchorMailbox",e.RETURN_SPA_CODE="return_spa_code",e.NATIVE_BROKER="nativebroker",e.LOGOUT_HINT="logout_hint"}(c||(c={})),function(e){e.ACCESS_TOKEN="access_token",e.XMS_CC="xms_cc"}(l||(l={}));var es={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"};!function(e){e.ACCOUNT="account",e.SID="sid",e.LOGIN_HINT="login_hint",e.ID_TOKEN="id_token",e.DOMAIN_HINT="domain_hint",e.ORGANIZATIONS="organizations",e.CONSUMERS="consumers",e.ACCOUNT_ID="accountIdentifier",e.HOMEACCOUNT_ID="homeAccountIdentifier"}(u||(u={}));var ec={PLAIN:"plain",S256:"S256"};!function(e){e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post"}(d||(d={})),function(e){e.IMPLICIT_GRANT="implicit",e.AUTHORIZATION_CODE_GRANT="authorization_code",e.CLIENT_CREDENTIALS_GRANT="client_credentials",e.RESOURCE_OWNER_PASSWORD_GRANT="password",e.REFRESH_TOKEN_GRANT="refresh_token",e.DEVICE_CODE_GRANT="device_code",e.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer"}(p||(p={})),function(e){e.MSSTS_ACCOUNT_TYPE="MSSTS",e.ADFS_ACCOUNT_TYPE="ADFS",e.MSAV1_ACCOUNT_TYPE="MSA",e.GENERIC_ACCOUNT_TYPE="Generic"}(h||(h={})),function(e){e.CACHE_KEY_SEPARATOR="-",e.CLIENT_INFO_SEPARATOR="."}(f||(f={})),function(e){e.ID_TOKEN="IdToken",e.ACCESS_TOKEN="AccessToken",e.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",e.REFRESH_TOKEN="RefreshToken"}(g||(g={})),function(e){e.ACCOUNT="Account",e.CREDENTIAL="Credential",e.ID_TOKEN="IdToken",e.ACCESS_TOKEN="AccessToken",e.REFRESH_TOKEN="RefreshToken",e.APP_METADATA="AppMetadata",e.TEMPORARY="TempCache",e.TELEMETRY="Telemetry",e.UNDEFINED="Undefined",e.THROTTLING="Throttling"}(v||(v={})),function(e){e[e.ADFS=1001]="ADFS",e[e.MSA=1002]="MSA",e[e.MSSTS=1003]="MSSTS",e[e.GENERIC=1004]="GENERIC",e[e.ACCESS_TOKEN=2001]="ACCESS_TOKEN",e[e.REFRESH_TOKEN=2002]="REFRESH_TOKEN",e[e.ID_TOKEN=2003]="ID_TOKEN",e[e.APP_METADATA=3001]="APP_METADATA",e[e.UNDEFINED=9999]="UNDEFINED"}(m||(m={}));var el="appmetadata",eu={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:86400};!function(e){e.CONFIG="config",e.CACHE="cache",e.NETWORK="network",e.HARDCODED_VALUES="hardcoded_values"}(y||(y={}));var ed={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"};!function(e){e.BEARER="Bearer",e.POP="pop",e.SSH="ssh-cert"}(b||(b={}));var ep={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},eh={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"};!function(e){e.username="username",e.password="password"}(w||(w={})),function(e){e[e.httpSuccess=200]="httpSuccess",e[e.httpBadRequest=400]="httpBadRequest"}(E||(E={})),function(e){e.FAILED_AUTO_DETECTION="1",e.INTERNAL_CACHE="2",e.ENVIRONMENT_VARIABLE="3",e.IMDS="4"}(S||(S={})),function(e){e.CONFIGURED_MATCHES_DETECTED="1",e.CONFIGURED_NO_AUTO_DETECTION="2",e.CONFIGURED_NOT_DETECTED="3",e.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",e.AUTO_DETECTION_REQUESTED_FAILED="5"}(C||(C={})),function(e){e.NO_CACHE_HIT="0",e.FORCE_REFRESH="1",e.NO_CACHED_ACCESS_TOKEN="2",e.CACHED_ACCESS_TOKEN_EXPIRED="3",e.REFRESH_CACHED_ACCESS_TOKEN="4"}(_||(_={})),function(e){e.Jwt="JWT",e.Jwk="JWK"}(T||(T={}));var ef={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},postRequestFailed:{code:"post_request_failed",desc:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."}},eg=function(e){function t(r,n,o){var i=this;return Object.setPrototypeOf(i=e.call(this,n?r+": "+n:r)||this,t.prototype),i.errorCode=r||eo.EMPTY_STRING,i.errorMessage=n||eo.EMPTY_STRING,i.subError=o||eo.EMPTY_STRING,i.name="AuthError",i}return Z(t,e),t.prototype.setCorrelationId=function(e){this.correlationId=e},t.createUnexpectedError=function(e){return new t(ef.unexpectedError.code,ef.unexpectedError.desc+": "+e)},t.createPostRequestFailed=function(e){return new t(ef.postRequestFailed.code,ef.postRequestFailed.desc+": "+e)},t}(Error),ev=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="ServerError",Object.setPrototypeOf(i,t.prototype),i}return Z(t,e),t}(eg),em=["interaction_required","consent_required","login_required"],ey=["message_only","additional_action","basic_action","user_password_expired","consent_required"],eb={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."}}
1,ew=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="InteractionRequiredAuthError",Object.setPrototypeOf(i,t.prototype),i}return Z(t,e),t.isInteractionRequiredError=function(e,t,r){var n=!!e&&em.indexOf(e)>-1,o=!!r&&ey.indexOf(r)>-1,i=!!t&&em.some(function(e){return t.indexOf(e)>-1});return n||i||o},t.createNoTokensFoundError=function(){return new t(eb.noTokensFoundError.code,eb.noTokensFoundError.desc)},t.createNativeAccountUnavailableError=function(){return new t(eb.native_account_unavailable.code,eb.native_account_unavailable.desc)},t}(eg),eE={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},eS={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"};!function(e){e.HandshakeRequest="Handshake",e.HandshakeResponse="HandshakeResponse",e.GetToken="GetToken",e.Response="Response"}(I||(I={})),function(e){e.LocalStorage="localStorage",e.SessionStorage="sessionStorage",e.MemoryStorage="memoryStorage"}(k||(k={})),function(e){e.GET="GET",e.POST="POST"}(A||(A={})),function(e){e.AUTHORITY="authority",e.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",e.SESSION_STATE="session.state",e.REQUEST_STATE="request.state",e.NONCE_IDTOKEN="nonce.id_token",e.ORIGIN_URI="request.origin",e.RENEW_STATUS="token.renew.status",e.URL_HASH="urlHash",e.REQUEST_PARAMS="request.params",e.SCOPES="scopes",e.INTERACTION_STATUS_KEY="interaction.status",e.CCS_CREDENTIAL="ccs.credential",e.CORRELATION_ID="request.correlationId",e.NATIVE_REQUEST="request.native",e.REDIRECT_CONTEXT="request.redirect.context"}(x||(x={})),function(e){e.WRAPPER_SKU="wrapper.sku",e.WRAPPER_VER="wrapper.version"}(R||(R={})),function(e){e[e.acquireTokenRedirect=861]="acquireTokenRedirect",e[e.acquireTokenPopup=862]="acquireTokenPopup",e[e.ssoSilent=863]="ssoSilent",e[e.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",e[e.handleRedirectPromise=865]="handleRedirectPromise",e[e.acquireTokenByCode=866]="acquireTokenByCode",e[e.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",e[e.logout=961]="logout",e[e.logoutPopup=962]="logoutPopup"}(P||(P={})),function(e){e.Redirect="redirect",e.Popup="popup",e.Silent="silent",e.None="none"}(O||(O={})),function(e){e.Startup="startup",e.Login="login",e.Logout="logout",e.AcquireToken="acquireToken",e.SsoSilent="ssoSilent",e.HandleRedirect="handleRedirect",e.None="none"}(N||(N={}));var eC={scopes:ei};!function(e){e.React="@azure/msal-react",e.Angular="@azure/msal-angular"}(M||(M={}));var e_="msal.db",eT=e_+".keys";!function(e){e[e.Default=0]="Default",e[e.AccessToken=1]="AccessToken",e[e.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",e[e.RefreshToken=3]="RefreshToken",e[e.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",e[e.Skip=5]="Skip"}(D||(D={}));var eI={missingKidError:{code:"missing_kid_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."},missingAlgError:{code:"missing_alg_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."}},ek=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="JoseHeaderError",Object.setPrototypeOf(o,t.prototype),o}return Z(t,e),t.createMissingKidError=function(){return new t(eI.missingKidError.code,eI.missingKidError.desc)},t.createMissingAlgError=function(){return new t(eI.missingAlgError.code,eI.missingAlgError.desc)},t}(eg),eA=function(){function e(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}return e.getShrHeaderString=function(t){if(!t.kid)throw ek.createMissingKidError();if(!t.alg)throw ek.createMissingAlgError();return JSON.stringify(new e({typ:t.typ||T.Jwt,kid:t.kid,alg:t.alg}))},e}(),ex=function(){function e(){}return e.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e}(),eR=function(){function e(e){this.cryptoObj=e}return e.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,ex.decimalToHex(e[0])+ex.decimalToHex(e[1])+ex.decimalToHex(e[2])+ex.decimalToHex(e[3])+"-"+ex.decimalToHex(e[4])+ex.decimalToHex(e[5])+"-"+ex.decimalToHex(e[6])+ex.decimalToHex(e[7])+"-"+ex.decimalToHex(e[8])+ex.decimalToHex(e[9])+"-"+ex.decimalToHex(e[10])+ex.decimalToHex(e[11])+ex.decimalToHex(e[12])+ex.decimalToHex(e[13])+ex.decimalToHex(e[14])+ex.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",n=0,o=eo.EMPTY_STRING,i=0;i<36;i++)"-"!==t[i]&&"4"!==t[i]&&(n=16*Math.random()|0),"x"===t[i]?o+=r[n]:"y"===t[i]?(n&
1=3,n|=8,o+=r[n]):o+=t[i];return o}},e.prototype.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e}(),eP=function(){function e(){}return e.stringToUtf8Arr=function(e){for(var t,r=0,n=e.length,o=0;o<n;o++)r+=(t=e.charCodeAt(o))<128?1:t<2048?2:t<65536?3:t<2097152?4:t<0x4000000?5:6;for(var i=new Uint8Array(r),a=0,s=0;a<r;s++)(t=e.charCodeAt(s))<128?i[a++]=t:(t<2048?i[a++]=192+(t>>>6):(t<65536?i[a++]=224+(t>>>12):(t<2097152?i[a++]=240+(t>>>18):(t<0x4000000?i[a++]=248+(t>>>24):(i[a++]=252+(t>>>30),i[a++]=128+(t>>>24&63)),i[a++]=128+(t>>>18&63)),i[a++]=128+(t>>>12&63)),i[a++]=128+(t>>>6&63)),i[a++]=128+(63&t));return i},e.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return t},e.utf8ArrToString=function(e){for(var t=eo.EMPTY_STRING,r=void 0,n=e.length,o=0;o<n;o++)t+=String.fromCharCode((r=e[o])>251&&r<254&&o+5<n?(r-252)*0x40000000+(e[++o]-128<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>247&&r<252&&o+4<n?(r-248<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>239&&r<248&&o+3<n?(r-240<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>223&&r<240&&o+2<n?(r-224<<12)+(e[++o]-128<<6)+e[++o]-128:r>191&&r<224&&o+1<n?(r-192<<6)+e[++o]-128:r);return t},e.getSortedObjectString=function(e){return JSON.stringify(e,Object.keys(e).sort())},e}(),eO=function(){function e(){}return e.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,eo.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_"))},e.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,eo.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")},e.prototype.encode=function(e){var t=eP.stringToUtf8Arr(e);return this.base64EncArr(t)},e.prototype.base64EncArr=function(e){for(var t=(3-e.length%3)%3,r=eo.EMPTY_STRING,n=void 0,o=e.length,i=0,a=0;a<o;a++)n=a%3,i|=e[a]<<(16>>>n&24),(2===n||e.length-a==1)&&(r+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0===t?r:r.substring(0,r.length-t)+(1===t?"=":"==")},e.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},e}(),eN=function(){function e(){}return e.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("Invalid base64 string")}var r=this.base64DecToArr(t);return eP.utf8ArrToString(r)},e.prototype.base64DecToArr=function(e,t){for(var r=e.replace(/[^A-Za-z0-9\+\/]/g,eo.EMPTY_STRING),n=r.length,o=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,i=new Uint8Array(o),a=void 0,s=void 0,c=0,l=0,u=0;u<n;u++)if(s=3&u,c|=this.b64ToUint6(r.charCodeAt(u))<<18-6*s,3===s||n-u==1){for(a=0;a<3&&l<o;a++,l++)i[l]=c>>>(16>>>a&24)&255;c=0}return i},e.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0},e}(),eM={clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoEmptyError:{code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},tokenParsingError:{code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},nullOrEmptyToken:{code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},networkError:{code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},unableToGetOpenidConfigError:{code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hashNotDeserialized:{code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},invalidStateError:{code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},stateMismatchError:{code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},stateNotFoundError:{code:"state_not_found",desc:"State not found"},nonceMismatchError:{code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},nonceNotFoundError:{code:"nonce_not_found",desc:"nonce not found"},authTimeNotFoundError:{code:"auth_time_not_found",desc:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information."},maxAgeTranspiredError:{code:"max_age_transpired",desc:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication."},multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},multipleMatchingAccounts:{code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},multipleMatchingAppMetadata:{code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"}
1,tokenRequestCannotBeMade:{code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},appendEmptyScopeError:{code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},removeEmptyScopeError:{code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},appendScopeSetError:{code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},emptyInputScopeSetError:{code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},DeviceCodePollingCancelled:{code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},DeviceCodeExpired:{code:"device_code_expired",desc:"Device code is expired."},DeviceCodeUnknownError:{code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},NoAccountInSilentRequest:{code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},invalidCacheRecord:{code:"invalid_cache_record",desc:"Cache record object was null or undefined."},invalidCacheEnvironment:{code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},noAccountFound:{code:"no_account_found",desc:"No account found in cache for given key."},CachePluginError:{code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},noCryptoObj:{code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},unexpectedAccountType:{code:"unexpected_account_type",desc:"Unexpected account type."},unexpectedCredentialType:{code:"unexpected_credential_type",desc:"Unexpected credential type."},invalidAssertion:{code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},invalidClientCredential:{code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},tokenRefreshRequired:{code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},userTimeoutReached:{code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},tokenClaimsRequired:{code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},noAuthorizationCodeFromServer:{code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},bindingKeyNotRemovedError:{code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},logoutNotSupported:{code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},keyIdMissing:{code:"key_id_missing",desc:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."}},eD=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientAuthError",Object.setPrototypeOf(o,t.prototype),o}return Z(t,e),t.createClientInfoDecodingError=function(e){return new t(eM.clientInfoDecodingError.code,eM.clientInfoDecodingError.desc+" Failed with error: "+e)},t.createClientInfoEmptyError=function(){return new t(eM.clientInfoEmptyError.code,""+eM.clientInfoEmptyError.desc)},t.createTokenParsingError=function(e){return new t(eM.tokenParsingError.code,eM.tokenParsingError.desc+" Failed with error: "+e)},t.createTokenNullOrEmptyError=function(e){return new t(eM.nullOrEmptyToken.code,eM.nullOrEmptyToken.desc+" Raw Token Value: "+e)},t.createEndpointDiscoveryIncompleteError=function(e){return new t(eM.endpointResolutionError.code,eM.endpointResolutionError.desc+" Detail: "+e)},t.createNetworkError=function(e,r){return new t(eM.networkError.code,eM.networkError.desc+" | Fetch client threw: "+r+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToGetOpenidConfigError=function(e){return new t(eM.unableToGetOpenidConfigError.code,eM.unableToGetOpenidConfigError.desc+" Attempted to retrieve endpoints from: "+e)},t.createHashNotDeserializedError=function(e){return new t(eM.hashNotDeserialized.code,eM.hashNotDeserialized.desc+" Given Object: "+e)},t.createInvalidStateError=function(e,r){return new t(eM.invalidStateError.code,eM.invalidStateError.desc+" Invalid State: "+e+", Root Err: "+r)},t.createStateMismatchError=function(){return new t(eM.stateMismatchError.code,eM.stateMismatchError.desc)},t.createStateNotFoundError=function(e){return new t(eM.stateNotFoundError.code,eM.stateNotFoundError.desc+":  "+e)},t.createNonceMismatchError=function(){return new t(eM.nonceMismatchError.code,eM.nonceMismatchError.desc)},t.createAuthTimeNotFoundError=function(){return new t(eM.authTimeNotFoundError.code,eM.authTimeNotFoundError.desc)},t.createMaxAgeTranspiredError=function(){return new t(eM.maxAgeTranspiredError.code,eM.maxAgeTranspiredError.desc)},t.createNonceNotFoundError=function(e){return new t(eM.nonceNotFoundError.code,eM.nonceNotFoundError.desc+":  "+e)},t.createMultipleMatchingTokensInCacheError=function(){return new t(eM.multipleMatchingTokens.code,eM.multipleMatchingTokens.desc+".")},t.createMultipleMatchingAccountsInCacheError=function(){return new t(eM.multipleMatchingAccounts.code,eM.multipleMatchingAccounts.desc)},t.createMultipleMatchingAppMetadataInCacheError=function(){return new t(eM.multipleMatchingAppMetadata.code,eM.multipleMatchingAppMetadata.desc)},t.createTokenRequestCannotBeMadeError=function(){return new t(eM.tokenRequestCannotBeMade.code,eM.token
1RequestCannotBeMade.desc)},t.createAppendEmptyScopeToSetError=function(e){return new t(eM.appendEmptyScopeError.code,eM.appendEmptyScopeError.desc+" Given Scope: "+e)},t.createRemoveEmptyScopeFromSetError=function(e){return new t(eM.removeEmptyScopeError.code,eM.removeEmptyScopeError.desc+" Given Scope: "+e)},t.createAppendScopeSetError=function(e){return new t(eM.appendScopeSetError.code,eM.appendScopeSetError.desc+" Detail Error: "+e)},t.createEmptyInputScopeSetError=function(){return new t(eM.emptyInputScopeSetError.code,""+eM.emptyInputScopeSetError.desc)},t.createDeviceCodeCancelledError=function(){return new t(eM.DeviceCodePollingCancelled.code,""+eM.DeviceCodePollingCancelled.desc)},t.createDeviceCodeExpiredError=function(){return new t(eM.DeviceCodeExpired.code,""+eM.DeviceCodeExpired.desc)},t.createDeviceCodeUnknownError=function(){return new t(eM.DeviceCodeUnknownError.code,""+eM.DeviceCodeUnknownError.desc)},t.createNoAccountInSilentRequestError=function(){return new t(eM.NoAccountInSilentRequest.code,""+eM.NoAccountInSilentRequest.desc)},t.createNullOrUndefinedCacheRecord=function(){return new t(eM.invalidCacheRecord.code,eM.invalidCacheRecord.desc)},t.createInvalidCacheEnvironmentError=function(){return new t(eM.invalidCacheEnvironment.code,eM.invalidCacheEnvironment.desc)},t.createNoAccountFoundError=function(){return new t(eM.noAccountFound.code,eM.noAccountFound.desc)},t.createCachePluginError=function(){return new t(eM.CachePluginError.code,""+eM.CachePluginError.desc)},t.createNoCryptoObjectError=function(e){return new t(eM.noCryptoObj.code,""+eM.noCryptoObj.desc+e)},t.createInvalidCacheTypeError=function(){return new t(eM.invalidCacheType.code,""+eM.invalidCacheType.desc)},t.createUnexpectedAccountTypeError=function(){return new t(eM.unexpectedAccountType.code,""+eM.unexpectedAccountType.desc)},t.createUnexpectedCredentialTypeError=function(){return new t(eM.unexpectedCredentialType.code,""+eM.unexpectedCredentialType.desc)},t.createInvalidAssertionError=function(){return new t(eM.invalidAssertion.code,""+eM.invalidAssertion.desc)},t.createInvalidCredentialError=function(){return new t(eM.invalidClientCredential.code,""+eM.invalidClientCredential.desc)},t.createRefreshRequiredError=function(){return new t(eM.tokenRefreshRequired.code,eM.tokenRefreshRequired.desc)},t.createUserTimeoutReachedError=function(){return new t(eM.userTimeoutReached.code,eM.userTimeoutReached.desc)},t.createTokenClaimsRequiredError=function(){return new t(eM.tokenClaimsRequired.code,eM.tokenClaimsRequired.desc)},t.createNoAuthCodeInServerResponseError=function(){return new t(eM.noAuthorizationCodeFromServer.code,eM.noAuthorizationCodeFromServer.desc)},t.createBindingKeyNotRemovedError=function(){return new t(eM.bindingKeyNotRemovedError.code,eM.bindingKeyNotRemovedError.desc)},t.createLogoutNotSupportedError=function(){return new t(eM.logoutNotSupported.code,eM.logoutNotSupported.desc)},t.createKeyIdMissingError=function(){return new t(eM.keyIdMissing.code,eM.keyIdMissing.desc)},t}(eg),eL=function(){function e(){}return e.decodeAuthToken=function(t){if(e.isEmpty(t))throw eD.createTokenNullOrEmptyError(t);var r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw eD.createTokenParsingError("Given token is malformed: "+JSON.stringify(t));return{header:r[1],JWSPayload:r[2],JWSSig:r[3]}},e.isEmpty=function(e){return void 0===e||!e||0===e.length},e.isEmptyObj=function(t){if(t&&!e.isEmpty(t))try{var r=JSON.parse(t);return 0===Object.keys(r).length}catch(e){}return!0},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},e.queryStringToObject=function(e){var t={},r=e.split("&"),n=function(e){return decodeURIComponent(e.replace(/\+/g," "))};return r.forEach(function(e){if(e.trim()){var r=e.split(/=(.+)/g,2),o=r[0],i=r[1];o&&i&&(t[n(o)]=n(i))}}),t},e.trimArrayEntries=function(e){return e.map(function(e){return e.trim()})},e.removeEmptyStringsFromArray=function(t){return t.filter(function(t){return!e.isEmpty(t)})},e.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},e.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},e}(),eU={pkceNotGenerated:{code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},cryptoDoesNotExist:{code:"crypto_nonexistent",desc:"The crypto object or function is not available."},httpMethodNotImplementedError:{code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},emptyNavigateUriError:{code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},hashEmptyError:{code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},hashDoesNotContainStateError:{code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},hashDoesNotContainKnownPropertiesError:{code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},unableToParseStateError:{code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},stateInteractionTypeMismatchError:{code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},interactionInProgress:{code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.  For more visit: aka.ms/msaljs/browser-errors."},popupWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},emptyWindowError:{code:"empty_window_error",desc:"window.open returned null or undefined window object."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},monitorPopupTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},monitorIframeTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},redirectInIframeError:{code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered a
1pplications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},blockTokenRequestsInHiddenIframeError:{code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},blockAcquireTokenInPopupsError:{code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},iframeClosedPrematurelyError:{code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},silentLogoutUnsupportedError:{code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},noAccountError:{code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},silentPromptValueError:{code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."},noTokenRequestCacheError:{code:"no_token_request_cache_error",desc:"No token request found in cache."},unableToParseTokenRequestCacheError:{code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},noCachedAuthorityError:{code:"no_cached_authority_error",desc:"No cached authority found."},authRequestNotSet:{code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},notInBrowserEnvironment:{code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},databaseNotOpen:{code:"database_not_open",desc:"Database is not open!"},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},postRequestFailed:{code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},getRequestFailed:{code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},failedToParseNetworkResponse:{code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},unableToLoadTokenError:{code:"unable_to_load_token",desc:"Error loading token to cache."},signingKeyNotFoundInStorage:{code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},authCodeRequired:{code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},authCodeOrNativeAccountRequired:{code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},databaseUnavailable:{code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},unableToAcquireTokenFromNativePlatform:{code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},nativeHandshakeTimeout:{code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},nativeExtensionNotInstalled:{code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},nativeConnectionNotEstablished:{code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},nativeBrokerCalledBeforeInitialize:{code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},nativePromptNotSupported:{code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."}},eq=function(e){function t(r,n){var o=e.call(this,r,n)||this;return Object.setPrototypeOf(o,t.prototype),o.name="BrowserAuthError",o}return Y(t,e),t.createPkceNotGeneratedError=function(e){return new t(eU.pkceNotGenerated.code,eU.pkceNotGenerated.desc+" Detail:"+e)},t.createCryptoNotAvailableError=function(e){return new t(eU.cryptoDoesNotExist.code,eU.cryptoDoesNotExist.desc+" Detail:"+e)},t.createHttpMethodNotImplementedError=function(e){return new t(eU.httpMethodNotImplementedError.code,eU.httpMethodNotImplementedError.desc+" Given Method: "+e)},t.createEmptyNavigationUriError=function(){return new t(eU.emptyNavigateUriError.code,eU.emptyNavigateUriError.desc)},t.createEmptyHashError=function(e){return new t(eU.hashEmptyError.code,eU.hashEmptyError.desc+" Given Url: "+e)},t.createHashDoesNotContainStateError=function(){return new t(eU.hashDoesNotContainStateError.code,eU.hashDoesNotContainStateError.desc)},t.createHashDoesNotContainKnownPropertiesError=function(){return new t(eU.hashDoesNotContainKnownPropertiesError.code,eU.hashDoesNotContainKnownPropertiesError.desc)},t.createUnableToParseStateError=function(){return new t(eU.unableToParseStateError.code,eU.unableToParseStateError.desc)},t.createStateInteractionTypeMismatchError=function(){return new t(eU.stateInteractionTypeMismatchError.code,eU.stateInteractionTypeMismatchError.desc)},t.createInteractionInProgressError=function(){return new t(eU.interactionInProgress.code,eU.interactionInProgress.desc)},t.createPopupWindowError=function(e){var r=eU.popupWindowError.desc;return r=eL.isEmpty(e)?r:r+" Details: "+e,new t(eU.popupWindowError.code,r)},t.createEmptyWindowCreatedError=function(){return new t(eU.emptyWindowError.code,eU.emptyWindowError.desc)},t.createUserCancelledError=function(){return new t(eU.userCancelledError.code,eU.userCancelledError.desc)},t.createMonitorPopupTimeoutError=function(){return new t(eU.monitorPopupTimeoutError.code,eU.monitorPopupTimeoutError.desc)},t.createMonitorIframeTimeoutError=function(){return new t(eU.monitorIframeTimeoutError.code,eU.monitorIframeTimeoutError.desc)},t.createRedirectInIframeError=function(e){return new t(eU.redirectInIframeError.code,eU.redirectInIframeError.desc+" (window.parent !== window) => "+e)},t.createBlockReloadInHiddenIframeError=function(){return new t(eU.blockTokenRequestsInHiddenIframeError.code,eU.blockTokenRequestsInHiddenIframeError.desc)},t.createBlockAcquireTokenInPopupsError=function(){return new t(eU.blockAcquireTokenInPopupsError.code,eU.blockAcquireTokenInPopupsError.desc)},t.createIframeClosedPrematurelyError=function(){return new t(eU.iframeClosedPrematurelyError.code,eU.iframeClosedPrematurelyError.desc)},t.createSilentLogoutUnsupportedError=function(){return new t(eU.silentLogoutUnsupportedError.code,eU.silentLogoutUnsupportedError.desc)},t.createNoAccountError=function(){return new t(eU.noAccountError.code,eU.noAccountError.desc)},t.createSilentPromptValueError=function(e){return new t(eU.silentPromptValueError.code,eU.silentPromptValueError.desc+" Given value: "+e)},t.createUnableToParseTokenRequestCacheError=function(){return new t(eU.unableToParseTokenRequestCacheError.code,eU.unableToParseTokenRequestCacheError.desc)},t.createNoTokenRequestCacheError=function(){return new t(eU.noTokenRequestCacheError.code,eU.noTokenRequestCacheError.desc)},t.createAuthRequestNotSetError=function(){return new t(eU.authRequestNotSet.code,eU.authRequestNotSet.desc)},t.createNoCachedAuthorityError=function(){return new t(eU.noCachedAuthorityError.code,eU.noCachedAuthorityError.desc)},t.createInvalidCacheTypeError=function(){return new t(eU.invalidCacheType.code,""+eU.invalidCacheType.desc)},t.createNonBrowserEnvironmentError=function(){return new t(eU.notInBrowserEnvironment.code,eU.notInBrowserEnvironment.desc)},t.createDatabaseNotOpenError=function(){return new t(eU.databaseNotOpen.code,eU.databaseNotOpen.desc)},t.createNoNetworkConnectivityError=function(){return new t(eU.noNetworkConnectivity.code,eU.noNetworkConnectivity.desc)},t.createPostRequestFailedError=function(e,r){return new t(eU.postRequestFailed.code,eU.postRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createGetRequestFailedError=function(e,r){return new t(eU.getRequestFailed.code,eU.getRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createFailedToParseNetworkResponseError=function(e){return new t(eU.failedToParseNetworkResponse.code,eU.failedToParseNetworkResponse.desc+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToLoadTokenError=function(e){return new t(eU.unableToLoadTokenError.code,eU.unableToLoadTokenError.desc+" | "+e)},t.createSigningKeyNotFoundInStorageError=function(e){return new t(eU.signingKeyNotFoundInStorage.code,eU.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+e)},t.createAuthCodeRequiredError=function(){return new t(eU.authCodeRequired.code,eU.authCodeRequired.desc)},t.createAuthCodeOrNativeAccountIdRequiredError=function(){return new t(eU.authCodeOrNativeAccountRequired.code,eU.authCodeOrNativeAccountRequired.desc)},t.createDatabaseUnavailableError=function(){return new t(eU.databaseUnavailable.code,eU.databaseUnavailable.desc)},t.createUnableToAcquireTokenFromNativePlatformError=function(){return new t(eU.unableToAcquireTokenFromNativePlatform.code,eU.unableToAcquireTokenFromNativePlatform.desc)},t.createNativeHandshakeTimeoutError=function(){return new t(eU.nativeHandshakeTimeout.code,eU.nativeHandshakeTimeout.desc)},t.createNativeExtensionNotInstalledError=function(){return new t(eU.nativeExtensionNotInstalled.code,eU.nativeExtensionNotInstalled.desc)},t.createNativeConnectionNotEstablishedError=function(){return new t(eU.nativeConnectionNotEstablished.code,eU.nativeConnectionNotEstablished.desc)},t.createNativeBrokerCalledBeforeInitialize=function(){return new t(eU.nativeBrokerCalledBeforeInitialize.code,eU.nativeBrokerCalledBeforeInitialize.desc)},t.createNativePromptParameterNotSupportedError=function(){return new t(eU.nativePromptNotSupported.code,eU.nativePromptNotSupported.desc)},t}(eg),eH=function(){function e(e){this.base64Encode=new eO,this.cryptoObj=e}return e.prototype.generateCodes=function(){return J(this,void 0,void 0,function(){var e,t;return $(this,function(r){switch(r.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=r.sent(),[2,{verifier:e,challenge:t}]}})})},e.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw eq.createPkceNotGeneratedError(e)}},e.prototype.generateCodeChallengeFromVerifier=function(e){return J(this,void 0,void 0,function(){var t,r;return $(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=n.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw r=n.sent(),eq.createPkceNotGeneratedError(r);case 3:return[2]}})})},e}(),eF=function(){function e(){}return e.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},e.prototype.generateKey=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){return[2,window.crypto.subtle.generateKey(e,t,r)]})})}
1,e.prototype.exportKey=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){return[2,window.crypto.subtle.exportKey("jwk",e)]})})},e.prototype.importKey=function(e,t,r,n){return J(this,void 0,void 0,function(){return $(this,function(o){return[2,window.crypto.subtle.importKey("jwk",e,t,r,n)]})})},e.prototype.sign=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){return[2,window.crypto.subtle.sign(e,t,r)]})})},e.prototype.digest=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){return[2,window.crypto.subtle.digest(e,t)]})})},e}(),ej=function(){function e(){}return e.prototype.initPrng=function(e){return window.msrCrypto.initPrng(Q(e))},e.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},e.prototype.generateKey=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){return[2,window.msrCrypto.subtle.generateKey(e,t,r)]})})},e.prototype.exportKey=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){return[2,window.msrCrypto.subtle.exportKey("jwk",e)]})})},e.prototype.importKey=function(e,t,r,n){return J(this,void 0,void 0,function(){return $(this,function(o){return[2,window.msrCrypto.subtle.importKey("jwk",e,t,r,n)]})})},e.prototype.sign=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){return[2,window.msrCrypto.subtle.sign(e,t,r)]})})},e.prototype.digest=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){return[2,window.msrCrypto.subtle.digest(e,t)]})})},e}(),ez=function(){function e(){}return e.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},e.prototype.generateKey=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){return[2,new Promise(function(n,o){var i=window.msCrypto.subtle.generateKey(e,t,r);i.addEventListener("complete",function(e){n(e.target.result)}),i.addEventListener("error",function(e){o(e)})})]})})},e.prototype.exportKey=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){return[2,new Promise(function(t,r){var n=window.msCrypto.subtle.exportKey("jwk",e);n.addEventListener("complete",function(e){var n=e.target.result,o=eP.utf8ArrToString(new Uint8Array(n)).replace(/\r/g,eo.EMPTY_STRING).replace(/\n/g,eo.EMPTY_STRING).replace(/\t/g,eo.EMPTY_STRING).split(" ").join(eo.EMPTY_STRING).replace("\0",eo.EMPTY_STRING);try{t(JSON.parse(o))}catch(e){r(e)}}),n.addEventListener("error",function(e){r(e)})})]})})},e.prototype.importKey=function(e,t,r,n){return J(this,void 0,void 0,function(){var o,i;return $(this,function(a){return o=eP.getSortedObjectString(e),i=eP.stringToArrayBuffer(o),[2,new Promise(function(e,o){var a=window.msCrypto.subtle.importKey("jwk",i,t,r,n);a.addEventListener("complete",function(t){e(t.target.result)}),a.addEventListener("error",function(e){o(e)})})]})})},e.prototype.sign=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){return[2,new Promise(function(n,o){var i=window.msCrypto.subtle.sign(e,t,r);i.addEventListener("complete",function(e){n(e.target.result)}),i.addEventListener("error",function(e){o(e)})})]})})},e.prototype.digest=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){return[2,new Promise(function(r,n){var o=window.msCrypto.subtle.digest(e,t.buffer);o.addEventListener("complete",function(e){r(e.target.result)}),o.addEventListener("error",function(e){n(e)})})]})})},e}(),eB={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},entropyNotProvided:{code:"entropy_not_provided",desc:"The available browser crypto interface requires entro
1py set via system.cryptoOptions.entropy configuration option."}},eK=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="BrowserConfigurationAuthError",Object.setPrototypeOf(o,t.prototype),o}return Y(t,e),t.createRedirectUriEmptyError=function(){return new t(eB.redirectUriNotSet.code,eB.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(eB.postLogoutUriNotSet.code,eB.postLogoutUriNotSet.desc)},t.createStorageNotSupportedError=function(e){return new t(eB.storageNotSupportedError.code,eB.storageNotSupportedError.desc+" Given Location: "+e)},t.createRedirectCallbacksNotSetError=function(){return new t(eB.noRedirectCallbacksSet.code,eB.noRedirectCallbacksSet.desc)},t.createStubPcaInstanceCalledError=function(){return new t(eB.stubPcaInstanceCalled.code,eB.stubPcaInstanceCalled.desc)},t.createInMemoryRedirectUnavailableError=function(){return new t(eB.inMemRedirectUnavailable.code,eB.inMemRedirectUnavailable.desc)},t.createEntropyNotProvided=function(){return new t(eB.entropyNotProvided.code,eB.entropyNotProvided.desc)},t}(eg),eG="SHA-256",eY=new Uint8Array([1,0,1]),eV=function(){function e(e,t){var r,n;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new eF;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new ez;else if(this.hasMsrCrypto()&&(null===(r=this.cryptoOptions)||void 0===r?void 0:r.useMsrCrypto))this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new ej;else throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),eq.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),!(null===(n=this.cryptoOptions)||void 0===n?void 0:n.entropy))throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),eK.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:eG,modulusLength:2048,publicExponent:eY}}return e.prototype.hasIECrypto=function(){return"msCrypto"in window},e.prototype.hasBrowserCrypto=function(){return"crypto"in window},e.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},e.prototype.sha256Digest=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){return t=eP.stringToUtf8Arr(e),[2,this.subtleCrypto.digest({name:eG},t)]})})},e.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},e.prototype.generateKeyPair=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,e,t)]})})},e.prototype.exportJwk=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){return[2,this.subtleCrypto.exportKey(e)]})})},e.prototype.importJwk=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){return[2,this.subtleCrypto.importKey(e,this.keygenAlgorithmOptions,t,r)]})})},e.prototype.sign=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,e,t)]})})},e}(),eW=function(){function e(){this.dbName=e_,this.version=1,this.tableName=eT,this.dbOpen=!1}return e.prototype.open=function(){return J(this,void 0,void 0,function(){var e=this;return $(this,function(t){return[2,new Promise(function(t,r){var n=window.indexedDB.open(e.dbName,e.version);n.addEventListener("upgradeneeded",function(t){t.target.result.createObjectStore(e.tableName)}),n.addEventListener("success",function(r){e.db=r.target.result,e.dbOpen=!0,t()}),n.addEventListener("error",function(){return r(eq.createDatabaseUnavailableError())})})]})})},e.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},e.prototype.validateDbIsOpen=function(){return J(this,void 0,void 0,function(){return $(this,function(e){switch(e.label){case 0:if(this.dbOpen)return[3,2];return[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}})})},e.prototype.getItem=function(e){return J(this,void 0,void 0,function(){var t=this;return $(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(r,n){if(!t.db)return n(eq.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).get(e);o.addEventListener("success",function(e){t.closeConnection(),r(e.target.result)}),o.addEventListener("error",function(e){t.closeConnection(),n(e)})})]}})})},e.prototype.setItem=function(e,t){return J(this,void 0,void 0,function(){var r=this;return $(this,function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise(function(n,o){if(!r.db)return o(eq.createDatabaseNotOpenError());var i=r.db.transaction([r.tableName],"readwrite").objectStore(r.tableName).put(t,e);i.addEventListener("success",function(){r.closeConnection(),n()}),i.addEventListener("error",function(e){r.closeConnection(),o(e)})})]}})})},e.prototype.removeItem=function(e){return J(this,void 0,void 0,function(){var t=this;return $(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(r,n){if(!t.db)return n(eq.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readwrite").objectStore(t.tableName).delete(e);o.addEventListener("success",function(){t.closeConnection(),r()}),o.addEventListener("error",function(e){t.closeConnection(),n(e)})})]}})})},e.prototype.getKeys=function(){return J(this,void 0,void 0,function(){var e=this;return $(this,function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise(function(t,r){if(!e.db)return r(eq.createDatabaseNotOpenError());var n=e.db.transaction([e.tableName],"readonly").objectStore(e.tableName).getAllKeys();n.addEventListener("success",function(r){e.closeConnection(),t(r.target.result)}),n.addEventListener("error",function(t){e.closeConnection(),r(t)})})]}})})},e.prototype.containsKey=function(e){return J(this,void 0,void 0,function(){var t=this;return $(this,function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise(function(r,n){if(!t.db)return n(eq.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).count(e);o.addEventListener("success",function(e){t.closeConnection(),r(1===e.target.result)}),o.addEventListener("error",function(e){t.closeConnection(),n(e)})})]}})})},e.prototype.deleteDatabase=function(){return J(this,void 0,void 0,function(){return $(this,function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise(function(e,t){var r=window.indexedDB.deleteDatabase(e_);r.addEventListener("success",function(){return e(!0)}),r.addEventListener("blocked",function(){return e(!0)}),r.addEventListener("error",function(){return t(!1)})})]})})},e}(),eJ=function(){function e(){this.cache=new Map}return e.prototype.getItem=function(e){return this.cache.get(e)||null},e.prototype.setItem=function(e,t){this.cache.set(e,t)},e.prototype.removeItem=function(e){this.cache.delete(e)},e.prototype.getKeys=function(){var e=[];return this.cache.forEach(function(t,r){e.push(r)}),e},e.prototype.containsKey=function(e){return this.cache.has(e)},e.prototype.clear=function(){this.cache.clear()},e}(),e$=function(){function e(e,t){this.inMemoryCache=new eJ,this.indexedDBCache=new eW,this.logger=e,this.storeName=t}return e.prototype.handleDatabaseAccessError=function(e){if(e instanceof eq&&e.errorCode===eU.databaseUnavailable.code)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e},e.prototype.getItem=function(e){return J(this,void 0,void 0,function(){var t,r;return $(this,function(n){switch(n.label){case 0:if(t=this.inMemoryCache.getItem(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},e.prototype.setItem=function(e,t){return J(this,void 0,void 0,function(){var r;return $(this,function(n){switch(n.label){case 0:this.inMemoryCache.setItem(e,t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2]}})})},e.prototype.removeItem=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){switch(r.label){case 0:this.inMemoryCache.removeItem(e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}})})},e.prototype.getKeys=function(){return J(this,void 0,void 0,function(){var e,t;return $(this,function(r){switch(r.label){case 0:if(0!==(e=this.inMemoryCache.getKeys()).length)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,r.sent()];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}})})},e.prototype.containsKey=function(e){return J(this,void 0,void 0,function(){var t,r;return $(this,function(n){switch(n.label){case 0:if(t=this.inMemoryCache.containsKey(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}})})},e.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},e.prototype.clearPersistent=function(){return J(this,void 0,void 0,function(){var e,t;return $(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return(e=r.sent())&&this.logger.verbose("Persistent keystore deleted"),[2,e];case 2:return t=r.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}})})},e}();!function(e){e.asymmetricKeys="asymmetricKeys",e.symmetricKeys="symmetricKeys"}(L||(L={}));var eQ=function(){function e(e){this.logger=e,this.asymmetricKeys=new e$(this.logger,L.asymmetricKeys),this.symmetricKeys=new e$(this.logger,L.symmetricKeys)}return e.prototype.clear=function(){return J(this,void 0,void 0,function(){var e;return $(this,function(t){switch(t.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent
1()];case 2:return t.sent(),[2,!0];case 3:return(e=t.sent())instanceof Error?this.logger.error("Clearing keystore failed with error: "+e.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}})})},e}(),eX=function(){function e(e,t,r){this.logger=e,this.browserCrypto=new eV(this.logger,r),this.b64Encode=new eO,this.b64Decode=new eN,this.guidGenerator=new eR(this.browserCrypto),this.pkceGenerator=new eH(this.browserCrypto),this.cache=new eQ(this.logger),this.performanceClient=t}return e.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},e.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},e.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},e.prototype.generatePkceCodes=function(){return J(this,void 0,void 0,function(){return $(this,function(e){return[2,this.pkceGenerator.generateCodes()]})})},e.prototype.getPublicKeyThumbprint=function(t){var r;return J(this,void 0,void 0,function(){var o,i,a,s,c,l,u,d;return $(this,function(p){switch(p.label){case 0:return o=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(n.CryptoOptsGetPublicKeyThumbprint,t.correlationId),[4,this.browserCrypto.generateKeyPair(e.EXTRACTABLE,e.POP_KEY_USAGES)];case 1:return i=p.sent(),[4,this.browserCrypto.exportJwk(i.publicKey)];case 2:return s={e:(a=p.sent()).e,kty:a.kty,n:a.n},c=eP.getSortedObjectString(s),[4,this.hashString(c)];case 3:return l=p.sent(),[4,this.browserCrypto.exportJwk(i.privateKey)];case 4:return u=p.sent(),[4,this.browserCrypto.importJwk(u,!1,["sign"])];case 5:return d=p.sent(),[4,this.cache.asymmetricKeys.setItem(l,{privateKey:d,publicKey:i.publicKey,requestMethod:t.resourceRequestMethod,requestUri:t.resourceRequestUri})];case 6:return p.sent(),o&&o.endMeasurement({success:!0}),[2,l]}})})},e.prototype.removeTokenBindingKey=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){switch(t.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return t.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return[2,!t.sent()]}})})},e.prototype.clearKeystore=function(){return J(this,void 0,void 0,function(){return $(this,function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}})})},e.prototype.signJwt=function(e,t,r){var o;return J(this,void 0,void 0,function(){var i,a,s,c,l,u,d,p,h,f,g,v;return $(this,function(m){switch(m.label){case 0:return i=null===(o=this.performanceClient)||void 0===o?void 0:o.startMeasurement(n.CryptoOptsSignJwt,r),[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(!(a=m.sent()))throw eq.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(a.publicKey)];case 2:return s=m.sent(),c=eP.getSortedObjectString(s),l=this.b64Encode.urlEncode(JSON.stringify({kid:t})),u=eA.getShrHeaderString({kid:l,alg:s.alg}),d=this.b64Encode.urlEncode(u),e.cnf={jwk:JSON.parse(c)},p=d+"."+this.b64Encode.urlEncode(JSON.stringify(e)),h=eP.stringToArrayBuffer(p),[4,this.browserCrypto.sign(a.privateKey,h)];case 3:return f=m.sent(),g=this.b64Encode.urlEncodeArr(new Uint8Array(f)),v=p+"."+g,i&&i.endMeasurement({success:!0}),[2,v]}})})},e.prototype.hashString=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){switch(r.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return t=new Uint8Array(r.sent()),[2,this.b64Encode.urlEncodeArr(t)]}})})},e.POP_KEY_USAGES=["sign","verify"],e.EXTRACTABLE=!0,e}();!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose",e[e.Trace=4]="Trace"}(U||(U={}));var eZ=function(){function e(t,r,n){this.level=U.Info;var o=t||e.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||function(){},this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level="number"==typeof o.logLevel?o.logLevel:U.Info,this.correlationId=o.correlationId||eo.EMPTY_STRING,this.packageName=r||eo.EMPTY_STRING,this.packageVersion=n||eo.EMPTY_STRING}return e.createDefaultLoggerOptions=function(){return{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:U.Info}},e.prototype.clone=function(t,r,n){return new e({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:n||this.correlationId},t,r)},e.prototype.logMessage=function(e,t){if(!(t.logLevel>this.level)&&(this.piiLoggingEnabled||!t.containsPii)){var r=new Date().toUTCString(),n=(eL.isEmpty(t.correlationId)?eL.isEmpty(this.correlationId)?"["+r+"]":"["+r+"] : ["+this.correlationId+"]":"["+r+"] : ["+t.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+U[t.logLevel]+" - "+e;this.executeCallback(t.logLevel,n,t.containsPii||!1)}},e.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},e.prototype.error=function(e,t){this.logMessage(e,{logLevel:U.Error,containsPii:!1,correlationId:t||eo.EMPTY_STRING})},e.prototype.errorPii=function(e,t){this.logMessage(e,{logLevel:U.Error,containsPii:!0,correlationId:t||eo.EMPTY_STRING})},e.prototype.warning=function(e,t){this.logMessage(e,{logLevel:U.Warning,containsPii:!1,correlationId:t||eo.EMPTY_STRING})},e.prototype.warningPii=function(e,t){this.logMessage(e,{logLevel:U.Warning,containsPii:!0,correlationId:t||eo.EMPTY_STRING})},e.prototype.info=function(e,t){this.logMessage(e,{logLevel:U.Info,containsPii:!1,correlationId:t||eo.EMPTY_STRING})},e.prototype.infoPii=function(e,t){this.logMessage(e,{logLevel:U.Info,containsPii:!0,correlationId:t||eo.EMPTY_STRING})},e.prototype.verbose=function(e,t){this.logMessage(e,{logLevel:U.Verbose,containsPii:!1,correlationId:t||eo.EMPTY_STRING})},e.prototype.verbosePii=function(e,t){this.logMessage(e,{logLevel:U.Verbose,containsPii:!0,correlationId:t||eo.EMPTY_STRING})},e.prototype.trace=function(e,t){this.logMessage(e,{logLevel:U.Trace,containsPii:!1,correlationId:t||eo.EMPTY_STRING})},e.prototype.tracePii=function(e,t){this.logMessage(e,{logLevel:U.Trace,containsPii:!0,correlationId:t||eo.EMPTY_STRING})},e.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},e}(),e0=function(){function e(e,t,r,n,o,i){this.authority=t,this.libraryName=n,this.libraryVersion=o,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.staticFieldsByCorrelationId=new Map,this.measurementsById=new Map,this.countersByCorrelationId=new Map}return e.prototype.startPerformanceMeasurement=function(e,t){return{}},e.prototype.startPerformanceMeasuremeant=function(e,t){return{}},e.prototype.startMeasurement=function(e,t){var r,n,i,a=this,s=t||this.generateId();t||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",s),this.logger.trace("PerformanceClient: Performance measurement started for "+e,s);var c=this.startPerformanceMeasuremeant(e,s);if(c.startMeasurement)c.startMeasurement(),i=c;else{var l=this.startPerformanceMeasurement(e,s);l.startMeasurement(),i=l}var u={eventId:this.generateId(),status:o.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:s};this.cacheEventByCorrelationId(u);var d={appName:null===(r=this.applicationTelemetry)||void 0===r?void 0:r.appName,a
1ppVersion:null===(n=this.applicationTelemetry)||void 0===n?void 0:n.appVersion};return this.addStaticFields(d,s),this.cacheMeasurement(u,i),{endMeasurement:function(e){var t=a.endMeasurement(ee(ee({},u),e));return t&&a.cacheEventByCorrelationId(t),t},flushMeasurement:function(){return a.flushMeasurements(u.name,u.correlationId)},discardMeasurement:function(){return a.discardMeasurements(u.correlationId)},addStaticFields:function(e){return a.addStaticFields(e,u.correlationId)},increment:function(e){return a.increment(e,u.correlationId)},measurement:i,event:u}},e.prototype.endMeasurement=function(e){var t=this.measurementsById.get(e.eventId);if(t){this.measurementsById.delete(e.eventId),t.endMeasurement();var r=t.flushMeasurement();if(null!==r)return this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+r+" ms",e.correlationId),ee(ee({durationMs:Math.round(r)},e),{status:o.Completed});this.logger.trace("PerformanceClient: Performance measurement not taken",e.correlationId)}else this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId);return null},e.prototype.addStaticFields=function(e,t){var r=this.staticFieldsByCorrelationId.get(t);r?(this.logger.trace("PerformanceClient: Updating static fields"),this.staticFieldsByCorrelationId.set(t,ee(ee({},r),e))):(this.logger.trace("PerformanceClient: Adding static fields"),this.staticFieldsByCorrelationId.set(t,e))},e.prototype.increment=function(e,t){var r=this.countersByCorrelationId.get(t);if(!r){this.logger.trace("PerformanceClient: Setting counters"),this.countersByCorrelationId.set(t,ee({},e));return}for(var n in this.logger.trace("PerformanceClient: Updating counters"),e)r.hasOwnProperty(n)||(r[n]=0),r[n]+=e[n]},e.prototype.cacheEventByCorrelationId=function(e){var t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),t.set(e.eventId,e)):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,new Map().set(e.eventId,e)))},e.prototype.cacheMeasurement=function(e,t){this.measurementsById.set(e.eventId,t)},e.prototype.flushMeasurements=function(e,t){var r=this;this.logger.trace("PerformanceClient: Performance measurements flushed for "+e,t);var n=this.eventsByCorrelationId.get(t),i=this.staticFieldsByCorrelationId.get(t),a=this.countersByCorrelationId.get(t);if(n){this.discardCache(t);var s=[];n.forEach(function(n){if(n.name!==e&&n.status!==o.Completed){r.logger.trace("PerformanceClient: Incomplete submeasurement "+n.name+" found for "+e,t);var i=r.endMeasurement(n);i&&s.push(i)}s.push(n)});var c=s.sort(function(e,t){return e.startTimeMs-t.startTimeMs}),l=c.filter(function(t){return t.name===e&&t.status===o.Completed});if(l.length>0){l.length>1&&this.logger.verbose("PerformanceClient: Multiple distinct top-level performance events found, using the first",t);var u=l[0];this.logger.verbose("PerformanceClient: Measurement found for "+e,t);var d=c.reduce(function(n,o){if(o.name!==e){r.logger.trace("PerformanceClient: Complete submeasurement found for "+o.name,t);var i=o.name+"DurationMs";n[i]?r.logger.verbose("PerformanceClient: Submeasurement for "+e+" already exists for "+o.name+", ignoring",t):n[i]=o.durationMs}return n},u),p=ee(ee(ee({},d),i),a);this.emitEvents([p],d.correlationId)}else this.logger.verbose("PerformanceClient: No completed top-level measurements found for "+e,t)}else this.logger.verbose("PerformanceClient: No measurements found",t)},e.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},e.prototype.discardCache=function(e){this.discardMeasurements(e),this.logger.trace("PerformanceClient: Static fields discarded",e),this.staticFieldsByCorrelationId.delete(e),this.logger.trace("PerformanceClient: Counters discarded",e),this.countersByCorrelationId.delete(e)},e.prototype.addPerformanceCallback=function(e){var t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+t),t},e.prototype.removePerformanceCallback=function(e){var t=this.callbacks.delete(e);return t?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),t},e.prototype.emitEvents=function(e,t){var r=this;this.logger.verbose("PerformanceClient: Emitting performance events",t),this.callbacks.forEach(function(n,o){r.logger.trace("PerformanceClient: Emitting event to callback "+o,t),n.apply(null,[e])})},e}(),e1=function(){function e(){}return e.prototype.startMeasurement=function(){},e.prototype.endMeasurement=function(){},e.prototype.flushMeasurement=function(){return null},e}(),e2=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.prototype.generateId=function(){return"callback-id"},t.prototype.startPerformanceMeasuremeant=function(){return new e1},t.prototype.startPerformanceMeasurement=function(){return new e1},t}(e0),e3={createNewGuid:function(){throw eg.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw eg.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw eg.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Crypto interface - generatePkceCodes() has not been implemented",eg.createUnexpectedError(e)})})},getPublicKeyThumbprint:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Crypto interface - getPublicKeyThumbprint() has not been implemented",eg.createUnexpectedError(e)})})},removeTokenBindingKey:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Crypto interface - removeTokenBindingKey() has not been implemented",eg.createUnexpectedError(e)})})},clearKeystore:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Crypto interface - clearKeystore() has not been implemented",eg.createUnexpectedError(e)})})},signJwt:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Crypto interface - signJwt() has not been implemented",eg.createUnexpectedError(e)})})},hashString:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Crypto interface - hashString() has not been implemented",eg.createUnexpectedError(e)})})}};function e4(e,t){if(eL.isEmpty(e))throw eD.createClientInfoEmptyError();try{var r=t.base64Decode(e);return JSON.parse(r)}catch(e){throw eD.createClientInfoDecodingError(e.message)}}function e5(e){if(eL.isEmpty(e))throw eD.createClientInfoDecodingError("Home account ID was empty.");var t=e.split(f.CLIENT_INFO_SEPARATOR,2);return{uid:t[0],utid:t.length<2?eo.EMPTY_STRING:t[1]}}!function(e){e[e.Default=0]="Default",e[e.Adfs=1]="Adfs",e[e.Dsts=2]="Dsts"}(q||(q={}));var e6=function(){function e(){}return e.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(f.CACHE_KEY_SEPARATOR).toLowerCase()},e.prototype.generateAccountKey=function(){return e.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},e.prototype.generateType=function(){switch(this.authorityType){case h.ADFS_ACCOUNT_TYPE:return m.ADFS;case h.MSAV1_ACCOUNT_TYPE:return m.MSA;case h.MSSTS_ACCOUNT_TYPE:return m.MSSTS;case h.GENERIC_ACCOUNT_TYPE:return m.GENERIC;default:throw eD.createUnexpectedAccountTypeError()}},e.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId}},e.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||eo.EMPTY_STRING,e.tenantId||eo.EMPTY_STRING].join(f.CACHE_KEY_SEPARATOR).toLowerCase()}
1,e.createAccount=function(t,r,n,o,i,a,s,c){var l,u,d,p,f,g,v=new e;v.authorityType=h.MSSTS_ACCOUNT_TYPE,v.clientInfo=t,v.homeAccountId=r,v.nativeAccountId=c;var m=s||o&&o.getPreferredCache();if(!m)throw eD.createInvalidCacheEnvironmentError();if(v.environment=m,v.realm=(null===(l=null==n?void 0:n.claims)||void 0===l?void 0:l.tid)||eo.EMPTY_STRING,n){v.idTokenClaims=n.claims,v.localAccountId=(null===(u=null==n?void 0:n.claims)||void 0===u?void 0:u.oid)||(null===(d=null==n?void 0:n.claims)||void 0===d?void 0:d.sub)||eo.EMPTY_STRING;var y=null===(p=null==n?void 0:n.claims)||void 0===p?void 0:p.preferred_username,b=(null===(f=null==n?void 0:n.claims)||void 0===f?void 0:f.emails)?n.claims.emails[0]:null;v.username=y||b||eo.EMPTY_STRING,v.name=null===(g=null==n?void 0:n.claims)||void 0===g?void 0:g.name}return v.cloudGraphHostName=i,v.msGraphHost=a,v},e.createGenericAccount=function(t,r,n,o,i,a){var s,c,l,u,d=new e;d.authorityType=n&&n.authorityType===q.Adfs?h.ADFS_ACCOUNT_TYPE:h.GENERIC_ACCOUNT_TYPE,d.homeAccountId=t,d.realm=eo.EMPTY_STRING;var p=a||n&&n.getPreferredCache();if(!p)throw eD.createInvalidCacheEnvironmentError();return r&&(d.localAccountId=(null===(s=null==r?void 0:r.claims)||void 0===s?void 0:s.oid)||(null===(c=null==r?void 0:r.claims)||void 0===c?void 0:c.sub)||eo.EMPTY_STRING,d.username=(null===(l=null==r?void 0:r.claims)||void 0===l?void 0:l.upn)||eo.EMPTY_STRING,d.name=(null===(u=null==r?void 0:r.claims)||void 0===u?void 0:u.name)||eo.EMPTY_STRING,d.idTokenClaims=null==r?void 0:r.claims),d.environment=p,d.cloudGraphHostName=o,d.msGraphHost=i,d},e.generateHomeAccountId=function(e,t,r,n,o){var i,a=(null===(i=null==o?void 0:o.claims)||void 0===i?void 0:i.sub)?o.claims.sub:eo.EMPTY_STRING;if(t===q.Adfs||t===q.Dsts)return a;if(e)try{var s=e4(e,n);if(!eL.isEmpty(s.uid)&&!eL.isEmpty(s.utid))return""+s.uid+f.CLIENT_INFO_SEPARATOR+s.utid}catch(e){}return r.verbose("No client info in response"),a},e.isAccountEntity=function(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType")},e.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var n=!0;if(r){var o=e.idTokenClaims||{},i=t.idTokenClaims||{};n=o.iat===i.iat&&o.nonce===i.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n},e}(),e8=function(){function e(){}return e.prototype.generateAccountId=function(){return e.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},e.prototype.generateCredentialId=function(){return e.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},e.prototype.generateTarget=function(){return e.generateTargetForCacheKey(this.target)},e.prototype.generateCredentialKey=function(){return e.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},e.prototype.generateType=function(){switch(this.credentialType){case g.ID_TOKEN:return m.ID_TOKEN;case g.ACCESS_TOKEN:case g.ACCESS_TOKEN_WITH_AUTH_SCHEME:return m.ACCESS_TOKEN;case g.REFRESH_TOKEN:return m.REFRESH_TOKEN;default:throw eD.createUnexpectedCredentialTypeError()}},e.getCredentialType=function(e){for(var t=f.CACHE_KEY_SEPARATOR,r=0,n=Object.keys(g);r<n.length;r++){var o=n[r],i=g[o].toLowerCase();if(-1!==e.toLowerCase().search(""+t+"(https?:\\/\\/)?([\\w-]+\\.)*([\\w-]{1,63})(\\.(\\w{2,63}))(\\:[0-9]{4,5})?"+t+i+t))return g[o]}return eo.NOT_DEFINED},e.generateCredentialCacheKey=function(e,t,r,n,o,i,a,s,c){return[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(r,n,o,a),this.generateTargetForCacheKey(i),this.generateClaimsHashForCacheKey(c),this.generateSchemeForCacheKey(s)].join(f.CACHE_KEY_SEPARATOR).toLowerCase()},e.generateAccountIdForCacheKey=function(e,t){return[e,t].join(f.CACHE_KEY_SEPARATOR).toLowerCase()},e.generateCredentialIdForCacheKey=function(e,t,r,n){var o=e===g.REFRESH_TOKEN&&n||t;return[e,o,r||eo.EMPTY_STRING].join(f.CACHE_KEY_SEPARATOR).toLowerCase()},e.generateTargetForCacheKey=function(e){return(e||eo.EMPTY_STRING).toLowerCase()},e.generateClaimsHashForCacheKey=function(e){return(e||eo.EMPTY_STRING).toLowerCase()},e.generateSchemeForCacheKey=function(e){return e&&e.toLowerCase()!==b.BEARER.toLowerCase()?e.toLowerCase():eo.EMPTY_STRING},e}(),e7={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https.  Please see here for valid authority configuration options: https://docs.microsoft.com/en-us
1/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'.  Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},missingNonceAuthenticationHeader:{code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"}},e9=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientConfigurationError",Object.setPrototypeOf(o,t.prototype),o}return Z(t,e),t.createRedirectUriEmptyError=function(){return new t(e7.redirectUriNotSet.code,e7.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(e7.postLogoutUriNotSet.code,e7.postLogoutUriNotSet.desc)},t.createClaimsRequestParsingError=function(e){return new t(e7.claimsRequestParsingError.code,e7.claimsRequestParsingError.desc+" Given value: "+e)},t.createInsecureAuthorityUriError=function(e){return new t(e7.authorityUriInsecure.code,e7.authorityUriInsecure.desc+" Given URI: "+e)},t.createUrlParseError=function(e){return new t(e7.urlParseError.code,e7.urlParseError.desc+" Given Error: "+e)},t.createUrlEmptyError=function(){return new t(e7.urlEmptyError.code,e7.urlEmptyError.desc)},t.createEmptyScopesArrayError=function(){return new t(e7.emptyScopesError.code,""+e7.emptyScopesError.desc)},t.createClientIdSingleScopeError=function(e){return new t(e7.clientIdSingleScopeError.code,e7.clientIdSingleScopeError.desc+" Given Scopes: "+e)},t.createInvalidPromptError=function(e){return new t(e7.invalidPrompt.code,e7.invalidPrompt.desc+" Given value: "+e)},t.createInvalidClaimsRequestError=function(){return new t(e7.invalidClaimsRequest.code,e7.invalidClaimsRequest.desc)},t.createEmptyLogoutRequestError=function(){return new t(e7.logoutRequestEmptyError.code,e7.logoutRequestEmptyError.desc)},t.createEmptyTokenRequestError=function(){return new t(e7.token
1RequestEmptyError.code,e7.tokenRequestEmptyError.desc)},t.createInvalidCodeChallengeMethodError=function(){return new t(e7.invalidCodeChallengeMethod.code,e7.invalidCodeChallengeMethod.desc)},t.createInvalidCodeChallengeParamsError=function(){return new t(e7.invalidCodeChallengeParams.code,e7.invalidCodeChallengeParams.desc)},t.createInvalidCloudDiscoveryMetadataError=function(){return new t(e7.invalidCloudDiscoveryMetadata.code,e7.invalidCloudDiscoveryMetadata.desc)},t.createInvalidAuthorityMetadataError=function(){return new t(e7.invalidAuthorityMetadata.code,e7.invalidAuthorityMetadata.desc)},t.createUntrustedAuthorityError=function(){return new t(e7.untrustedAuthority.code,e7.untrustedAuthority.desc)},t.createInvalidAzureCloudInstanceError=function(){return new t(e7.invalidAzureCloudInstance.code,e7.invalidAzureCloudInstance.desc)},t.createMissingSshJwkError=function(){return new t(e7.missingSshJwk.code,e7.missingSshJwk.desc)},t.createMissingSshKidError=function(){return new t(e7.missingSshKid.code,e7.missingSshKid.desc)},t.createMissingNonceAuthenticationHeadersError=function(){return new t(e7.missingNonceAuthenticationHeader.code,e7.missingNonceAuthenticationHeader.desc)},t.createInvalidAuthenticationHeaderError=function(e,r){return new t(e7.invalidAuthenticationHeader.code,e7.invalidAuthenticationHeader.desc+". Invalid header: "+e+". Details: "+r)},t}(eD),te=function(){function e(e){var t=this,r=e?eL.trimArrayEntries(en(e)):[],n=r?eL.removeEmptyStringsFromArray(r):[];this.validateInputScopes(n),this.scopes=new Set,n.forEach(function(e){return t.scopes.add(e)})}return e.fromString=function(t){return new e((t||eo.EMPTY_STRING).split(" "))},e.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw e9.createEmptyScopesArrayError()},e.prototype.containsScope=function(t){var r=new e(this.printScopesLowerCase().split(" "));return!eL.isEmpty(t)&&r.scopes.has(t.toLowerCase())},e.prototype.containsScopeSet=function(e){var t=this;return!!e&&!(e.scopes.size<=0)&&this.scopes.size>=e.scopes.size&&e.asArray().every(function(e){return t.containsScope(e)})},e.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return ea.forEach(function(r){e.containsScope(r)&&(t+=1)}),this.scopes.size===t},e.prototype.appendScope=function(e){eL.isEmpty(e)||this.scopes.add(e.trim())},e.prototype.appendScopes=function(e){var t=this;try{e.forEach(function(e){return t.appendScope(e)})}catch(e){throw eD.createAppendScopeSetError(e)}},e.prototype.removeScope=function(e){if(eL.isEmpty(e))throw eD.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},e.prototype.removeOIDCScopes=function(){var e=this;ea.forEach(function(t){e.scopes.delete(t)})},e.prototype.unionScopeSets=function(e){if(!e)throw eD.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach(function(e){return t.add(e.toLowerCase())}),this.scopes.forEach(function(e){return t.add(e.toLowerCase())}),t},e.prototype.intersectingScopeSets=function(e){if(!e)throw eD.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r},e.prototype.getScopeCount=function(){return this.scopes.size},e.prototype.asArray=function(){var e=[];return this.scopes.forEach(function(t){return e.push(t)}),e},e.prototype.printScopes=function(){return this.scopes?this.asArray().join(" "):eo.EMPTY_STRING},e.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},e}(),tt=function(){function e(t,r){if(eL.isEmpty(t))throw eD.createTokenNullOrEmptyError(t);this.rawToken=t,this.claims=e.extractTokenClaims(t,r)}return e.extractTokenClaims=function(e,t){var r=eL.decodeAuthToken(e);try{var n=r.JWSPayload,o=t.base64Decode(n);return JSON.parse(o)}catch(e){throw eD.createTokenParsingError(e)}},e.checkMaxAge=function(e,t){if(0===t||Date.now()-3e5>e+t)throw eD.createMaxAgeTranspiredError()},e}(),tr=function(){function e(e,t){this.clientId=e,this.cryptoImpl=t}return e.prototype.getAllAccounts=function(){var t=this,r=this.getAccountsFilteredBy(),n=Object.keys(r).map(function(e){return r[e]});return n.length<1?[]:n.map(function(r){var n=e.toObject(new e6,r).getAccountInfo(),o=t.readIdTokenFromCache(t.clientId,n);return o&&!n.idTokenClaims&&(n.idToken=o.secret,n.idTokenClaims=new tt(o.secret,t.cryptoImpl).claims),n})},e.prototype.saveCacheRecord=function(e){return et(this,void 0,void 0,function(){return er(this,function(t){switch(t.label){case 0:if(!e)throw eD.createNullOrUndefinedCacheRecord();if(e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),!e.accessToken)return[3,2];
1return[4,this.saveAccessToken(e.accessToken)];case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}})})},e.prototype.saveAccessToken=function(e){return et(this,void 0,void 0,function(){var t,r,n,o,i=this;return er(this,function(a){switch(a.label){case 0:if(t=this.getCredentialsFilteredBy({clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash}),r=te.fromString(e.target),!(n=Object.keys(t.accessTokens).map(function(e){return t.accessTokens[e]})))return[3,2];return o=[],n.forEach(function(e){te.fromString(e.target).intersectingScopeSets(r)&&o.push(i.removeCredential(e))}),[4,Promise.all(o)];case 1:a.sent(),a.label=2;case 2:return this.setAccessTokenCredential(e),[2]}})})},e.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:eo.EMPTY_STRING,e?e.environment:eo.EMPTY_STRING,e?e.realm:eo.EMPTY_STRING,e?e.nativeAccountId:eo.EMPTY_STRING)},e.prototype.getAccountsFilteredByInternal=function(e,t,r,n){var o=this,i=this.getKeys(),a={};return i.forEach(function(i){var s=o.getAccount(i);s&&(!e||o.matchHomeAccountId(s,e))&&(!t||o.matchEnvironment(s,t))&&(!r||o.matchRealm(s,r))&&(!n||o.matchNativeAccountId(s,n))&&(a[i]=s)}),a},e.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.userAssertionHash,e.tokenType,e.keyId,e.requestedClaimsHash)},e.prototype.getCredentialsFilteredByInternal=function(e,t,r,n,o,i,a,s,c,l,u){var d=this,p=this.getKeys(),h={idTokens:{},accessTokens:{},refreshTokens:{}};return p.forEach(function(p){var f=e8.getCredentialType(p);if(f!==eo.NOT_DEFINED){var v=d.getSpecificCredential(p,f);if(v&&(!s||d.matchUserAssertionHash(v,s))&&("string"!=typeof e||d.matchHomeAccountId(v,e))&&(!t||d.matchEnvironment(v,t))&&(!i||d.matchRealm(v,i))&&(!r||d.matchCredentialType(v,r))&&(!n||d.matchClientId(v,n))&&(!o||d.matchFamilyId(v,o))&&(!a||d.matchTarget(v,a))&&(!u&&!v.requestedClaimsHash||v.requestedClaimsHash===u)&&(r!==g.ACCESS_TOKEN_WITH_AUTH_SCHEME||(!c||d.matchTokenType(v,c))&&(c!==b.SSH||!l||d.matchKeyId(v,l)))){var m=d.updateCredentialCacheKey(p,v);switch(f){case g.ID_TOKEN:h.idTokens[m]=v;break;case g.ACCESS_TOKEN:case g.ACCESS_TOKEN_WITH_AUTH_SCHEME:h.accessTokens[m]=v;break;case g.REFRESH_TOKEN:h.refreshTokens[m]=v}}}}),h},e.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},e.prototype.getAppMetadataFilteredByInternal=function(e,t){var r=this,n=this.getKeys(),o={};return n.forEach(function(n){if(r.isAppMetadata(n)){var i=r.getAppMetadata(n);i&&(!e||r.matchEnvironment(i,e))&&(!t||r.matchClientId(i,t))&&(o[n]=i)}}),o},e.prototype.getAuthorityMetadataByAlias=function(e){var t=this,r=this.getAuthorityMetadataKeys(),n=null;return r.forEach(function(r){if(t.isAuthorityMetadata(r)&&-1!==r.indexOf(t.clientId)){var o=t.getAuthorityMetadata(r);o&&-1!==o.aliases.indexOf(e)&&(n=o)}}),n},e.prototype.removeAllAccounts=function(){return et(this,void 0,void 0,function(){var e,t,r=this;return er(this,function(n){switch(n.label){case 0:return e=this.getKeys(),t=[],e.forEach(function(e){r.getAccount(e)&&t.push(r.removeAccount(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2,!0]}})})},e.prototype.removeAccount=function(e){return et(this,void 0,void 0,function(){var t;return er(this,function(r){switch(r.label){case 0:if(!(t=this.getAccount(e)))throw eD.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return[2,r.sent()&&this.removeItem(e,v.ACCOUNT)]}})})},e.prototype.removeAccountContext=function(e){return et(this,void 0,void 0,function(){var t,r,n,o=this;return er(this,function(i){switch(i.label){case 0:return t=this.getKeys(),r=e.generateAccountId(),n=[],t.forEach(function(e){var t=e8.getCredentialType(e);if(t!==eo.NOT_DEFINED){var i=o.getSpecificCredential(e,t);i&&r===i.generateAccountId()&&n.push(o.removeCredential(i))}}),[4,Promise.all(n)];case 1:return i.sent(),[2,!0]}})})},e.prototype.removeCredential=function(e){return et(this,void 0,void 0,function(){var t,r;return er(this,function(n){switch(n.label){case 0:if(t=e.generateCredentialKey(),e.credentialType.toLowerCase()!==g.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||e.tokenType!==b.POP||!(r=e.keyId))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(r)];case 2:return n.sent(),[3,4];case 3:throw n.sent(),eD.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(t,v.CREDENTIAL)]}})})},e.prototype.removeAppMetadata=function(){var e=this;
1return this.getKeys().forEach(function(t){e.isAppMetadata(t)&&e.removeItem(t,v.APP_METADATA)}),!0},e.prototype.readCacheRecord=function(e,t,r,n){var o=this.readAccountFromCache(e),i=this.readIdTokenFromCache(t,e),a=this.readAccessTokenFromCache(t,e,r),s=this.readRefreshTokenFromCache(t,e,!1),c=this.readAppMetadataFromCache(n,t);return o&&i&&(o.idTokenClaims=new tt(i.secret,this.cryptoImpl).claims),{account:o,idToken:i,accessToken:a,refreshToken:s,appMetadata:c}},e.prototype.readAccountFromCache=function(e){var t=e6.generateAccountCacheKey(e);return this.getAccount(t)},e.prototype.readAccountFromCacheWithNativeAccountId=function(e){var t=this.getAccountsFilteredBy({nativeAccountId:e}),r=Object.keys(t).map(function(e){return t[e]});if(r.length<1)return null;if(r.length>1)throw eD.createMultipleMatchingAccountsInCacheError();return t[0]},e.prototype.readIdTokenFromCache=function(e,t){var r={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:g.ID_TOKEN,clientId:e,realm:t.tenantId},n=this.getCredentialsFilteredBy(r),o=Object.keys(n.idTokens).map(function(e){return n.idTokens[e]}),i=o.length;if(i<1)return null;if(i>1)throw eD.createMultipleMatchingTokensInCacheError();return o[0]},e.prototype.readAccessTokenFromCache=function(e,t,r){var n=new te(r.scopes||[]),o=r.authenticationScheme||b.BEARER,i=o&&o.toLowerCase()!==b.BEARER.toLowerCase()?g.ACCESS_TOKEN_WITH_AUTH_SCHEME:g.ACCESS_TOKEN,a={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:i,clientId:e,realm:t.tenantId,target:n.printScopesLowerCase(),tokenType:o,keyId:r.sshKid,requestedClaimsHash:r.requestedClaimsHash},s=this.getCredentialsFilteredBy(a),c=Object.keys(s.accessTokens).map(function(e){return s.accessTokens[e]}),l=c.length;if(l<1)return null;if(l>1)throw eD.createMultipleMatchingTokensInCacheError();return c[0]},e.prototype.readRefreshTokenFromCache=function(e,t,r){var n={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:g.REFRESH_TOKEN,clientId:e,familyId:r?"1":void 0},o=this.getCredentialsFilteredBy(n),i=Object.keys(o.refreshTokens).map(function(e){return o.refreshTokens[e]});return i.length<1?null:i[0]},e.prototype.readAppMetadataFromCache=function(e,t){var r=this.getAppMetadataFilteredBy({environment:e,clientId:t}),n=Object.keys(r).map(function(e){return r[e]}),o=n.length;if(o<1)return null;if(o>1)throw eD.createMultipleMatchingAppMetadataInCacheError();return n[0]},e.prototype.isAppMetadataFOCI=function(e,t){var r=this.readAppMetadataFromCache(e,t);return!!(r&&"1"===r.familyId)},e.prototype.matchHomeAccountId=function(e,t){return!!("string"==typeof e.homeAccountId&&t===e.homeAccountId)},e.prototype.matchUserAssertionHash=function(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)},e.prototype.matchEnvironment=function(e,t){var r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)},e.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},e.prototype.matchClientId=function(e,t){return!!(e.clientId&&t===e.clientId)},e.prototype.matchFamilyId=function(e,t){return!!(e.familyId&&t===e.familyId)},e.prototype.matchRealm=function(e,t){return!!(e.realm&&t===e.realm)},e.prototype.matchNativeAccountId=function(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)},e.prototype.matchTarget=function(e,t){if(e.credentialType!==g.ACCESS_TOKEN&&e.credentialType!==g.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;var r=te.fromString(e.target),n=te.fromString(t);return n.containsOnlyOIDCScopes()?n.removeScope(eo.OFFLINE_ACCESS_SCOPE):n.removeOIDCScopes(),r.containsScopeSet(n)},e.prototype.matchTokenType=function(e,t){return!!(e.tokenType&&e.tokenType===t)},e.prototype.matchKeyId=function(e,t){return!!(e.keyId&&e.keyId===t)},e.prototype.isAppMetadata=function(e){return -1!==e.indexOf(el)},e.prototype.isAuthorityMetadata=function(e){return -1!==e.indexOf(eu.CACHE_KEY)},e.prototype.generateAuthorityMetadataCacheKey=function(e){return eu.CACHE_KEY+"-"+this.clientId+"-"+e},e.prototype.getSpecificCredential=function(e,t){switch(t){case g.ID_TOKEN:return this.getIdTokenCredential(e);case g.ACCESS_TOKEN:case g.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case g.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},e.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},e}(),tn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.prototype.setAccount=function(){throw eg.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},t.prototype.getAccount=function(){throw eg.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},t.prototype.setIdTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getIdTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAccessTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getAccessTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setRefreshTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getRefreshTokenCredential=function(){throw eg.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAppMetadata=function(){throw eg.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAppMetadata=function(){throw eg.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.setServerTelemetry=function(){throw eg.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.getServerTelemetry=function(){throw eg.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.setAuthorityMetadata=function(){throw eg.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadata=function(){throw eg.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadataKeys=function(){throw eg.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},t.prototype.setThrottlingCache=function(){throw eg.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.getThrottlingCache=function(){throw eg.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.removeItem=function(){throw eg.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},t.prototype.containsKey=function(){throw eg.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},t.prototype.getKeys=function(){throw eg.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},t.prototype.clear=function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Storage interface - clear() has not been implemented for the cacheStorage interface.",eg.createUnexpectedError(e)})})},t.prototype.updateCredentialCacheKey=function(){throw eg.createUnexpectedError("Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.")},t}(tr),to=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.createIdTokenEntity=function(e,r,n,o,i){var a=new t;return a.credentialType=g.ID_TOKEN,a.homeAccountId=e,a.environment=r,a.clientId=o,a.secret=n,a.realm=i,a},t.isIdTokenEntity=function(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===g.ID_TOKEN},t}(e8),ti=function(){function e(){}return e.nowSeconds=function(){return Math.round(new Date().getTime()/1e3)},e.isTokenExpired=function(t,r){var n=Number(t)||0;return e.nowSeconds()+r>n},e.wasClockTurnedBack=function(t){return Number(t)>e.nowSeconds()},e.delay=function(e,t){return new Promise(function(r){return setTimeout(function(){return r(t)},e)})},e}(),ta=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.createAccessTokenEntity=function(e,r,n,o,i,a,s,c,l,u,d,p,h,f,v){var m,y,w=new t;w.homeAccountId=e,w.credentialType=g.ACCESS_TOKEN,w.secret=n;var E=ti.nowSeconds();if(w.cachedAt=E.toString(),w.expiresOn=s.toString(),w.extendedExpiresOn=c.toString(),u&&(w.refreshOn=u.toString()),w.environment=r,w.clientId=o,w.realm=i,w.target=a,w.userAssertionHash=p,w.tokenType=eL.isEmpty(d)?b.BEARER:d,f&&(w.requestedClaims=f,w.requestedClaimsHash=v),(null===(m=w.tokenType)||void 0===m?void 0:m.toLowerCase())!==b.BEARER.toLowerCase())switch(w.credentialType=g.ACCESS_TOKEN_WITH_AUTH_SCHEME,w.tokenType){case b.POP:var S=tt.extractTokenClaims(n,l);if(!(null===(y=null==S?void 0:S.cnf)||void 0===y?void 0:y.kid))throw eD.createTokenClaimsRequiredError();w.keyId=S.cnf.kid;break;case b.SSH:w.keyId=h}return w},t.isAccessTokenEntity=function(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===g.ACCESS_TOKEN||e.credentialType===g.ACCESS_TOKEN_WITH_AUTH_SCHEME)},t}(e8),ts=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.createRefreshTokenEntity=function(e,r,n,o,i,a){var s=new t;return s.clientId=o,s.credentialType=g.REFRESH_TOKEN,s.environment=r,s.homeAccountId=e,s.secret=n,s.userAssertionHash=a,i&&(s.familyId=i),s},t.isRefreshTokenEntity=function(e){return!!e&&e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===g.REFRESH_TOKEN},t}(e8),tc=function(){function e(){}return e.prototype.generateAppMetadataKey=function(){return e.generateAppMetadataCacheKey(this.environment,this.clientId)},e.generateAppMetadataCacheKey=function(e,t){return[el,e,t].join(f.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAppMetadataEntity=function(t,r,n){var o=new e;return o.clientId=t,o.environment=r,n&&(o.familyId=n),o},e.isAppMetadataEntity=function(e,t){return!!t&&0===e.indexOf(el)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment")},e}(),tl=function(){function e(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return e.isServerTelemetryEntity=function(e,t){var r=0===e.indexOf(ed.CACHE_KEY),n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n},e}(),tu=function(){function e(){this.expiresAt=ti.nowSeconds()+eu.REFRESH_TIME_SECONDS}return e.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},e.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},e.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},e.prototype.resetExpiresAt=function(){this.expiresAt=ti.nowSeconds()+eu.REFRESH_TIME_SECONDS},e.prototype.isExpired=function(){return this.expiresAt<=ti.nowSeconds()},e.isAuthorityMetadataEntity=function(e,t){return!!t&&0===e.indexOf(eu.CACHE_KEY)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")},e}(),td=function(){function e(){}return e.isThrottlingEntity=function(e,t){var r=!1;
1e&&(r=0===e.indexOf(ep.THROTTLING_PREFIX));var n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n},e}(),tp=function(){function e(){}return e.setRequestState=function(t,r,n){var o=e.generateLibraryState(t,n);return eL.isEmpty(r)?o:""+o+eo.RESOURCE_DELIM+r},e.generateLibraryState=function(e,t){if(!e)throw eD.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);var n=JSON.stringify(r);return e.base64Encode(n)},e.parseRequestState=function(e,t){if(!e)throw eD.createNoCryptoObjectError("parseRequestState");if(eL.isEmpty(t))throw eD.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(eo.RESOURCE_DELIM),n=r[0],o=r.length>1?r.slice(1).join(eo.RESOURCE_DELIM):eo.EMPTY_STRING,i=e.base64Decode(n),a=JSON.parse(i);return{userRequestState:eL.isEmpty(o)?eo.EMPTY_STRING:o,libraryState:a}}catch(e){throw eD.createInvalidStateError(t,e)}},e}();!function(e){e.HOME_ACCOUNT_ID="home_account_id",e.UPN="UPN"}(H||(H={}));var th=function(){function e(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return e.prototype.validateWindowStorage=function(e){if(e!==k.LocalStorage&&e!==k.SessionStorage||!window[e])throw eK.createStorageNotSupportedError(e)},e.prototype.getItem=function(e){return this.windowStorage.getItem(e)},e.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},e.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},e.prototype.getKeys=function(){return Object.keys(this.windowStorage)},e.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},e}(),tf=function(){function e(t){if(this._urlString=t,eL.isEmpty(this._urlString))throw e9.createUrlEmptyError();eL.isEmpty(this.getHash())&&(this._urlString=e.canonicalizeUri(t))}return Object.defineProperty(e.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),e.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return eL.endsWith(t,"?")?t=t.slice(0,-1):eL.endsWith(t,"?/")&&(t=t.
1slice(0,-2)),eL.endsWith(t,"/")||(t+="/"),t}return e},e.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(e){throw e9.createUrlParseError(e)}if(!e.HostNameAndPort||!e.PathSegments)throw e9.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw e9.createInsecureAuthorityUriError(this.urlString)},e.appendQueryString=function(e,t){return eL.isEmpty(t)?e:0>e.indexOf("?")?e+"?"+t:e+"&"+t},e.removeHashFromUrl=function(t){return e.canonicalizeUri(t.split("#")[0])},e.prototype.replaceTenantPath=function(t){var r=this.getUrlComponents(),n=r.PathSegments;return t&&0!==n.length&&(n[0]===s.COMMON||n[0]===s.ORGANIZATIONS)&&(n[0]=t),e.constructAuthorityUriFromObject(r)},e.prototype.getHash=function(){return e.parseHash(this.urlString)},e.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw e9.createUrlParseError("Given url string: "+this.urlString);var r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},n=r.AbsolutePath.split("/");return n=n.filter(function(e){return e&&e.length>0}),r.PathSegments=n,!eL.isEmpty(r.QueryString)&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r},e.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw e9.createUrlParseError("Given url string: "+e);return r[2]},e.getAbsoluteUrl=function(t,r){if(t[0]===eo.FORWARD_SLASH){var n=new e(r).getUrlComponents();return n.Protocol+"//"+n.HostNameAndPort+t}return t},e.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):eo.EMPTY_STRING},e.parseQueryString=function(e){var t=e.indexOf("?"),r=e.indexOf("/?");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):eo.EMPTY_STRING},e.constructAuthorityUriFromObject=function(t){return new e(t.Protocol+"//"+t.HostNameAndPort+"/"+t.PathSegments.join("/"))},e.getDeserializedHash=function(t){if(eL.isEmpty(t))return{};var r=e.parseHash(t),n=eL.queryStringToObject(eL.isEmpty(r)?t:r);if(!n)throw eD.createHashNotDeserializedError(JSON.stringify(n));return n},e.getDeserializedQueryString=function(t){if(eL.isEmpty(t))return{};var r=e.parseQueryString(t),n=eL.queryStringToObject(eL.isEmpty(r)?t:r);if(!n)throw eD.createHashNotDeserializedError(JSON.stringify(n));return n},e.hashContainsKnownProperties=function(t){if(eL.isEmpty(t)||0>t.indexOf("="))return!1;var r=e.getDeserializedHash(t);return!!(r.code||r.error_description||r.error||r.state)},e}(),tg=function(){function e(){}return e.extractBrowserRequestState=function(e,t){if(eL.isEmpty(t))return null;try{return tp.parseRequestState(e,t).libraryState.meta}catch(e){throw eD.createInvalidStateError(t,e)}},e.parseServerResponseFromHash=function(e){if(!e)return{};var t=new tf(e);return tf.getDeserializedHash(t.getHash())},e}(),tv=function(e){function t(t,r,n,o){var i=e.call(this,t,n)||this;return i.COOKIE_LIFE_MULTIPLIER=864e5,i.cacheConfig=r,i.logger=o,i.internalStorage=new eJ,i.browserStorage=i.setupBrowserStorage(i.cacheConfig.cacheLocation),i.temporaryCacheStorage=i.setupTemporaryCacheStorage(i.cacheConfig.cacheLocation),i.migrateCacheEntries(),i}return Y(t,e),t.prototype.setupBrowserStorage=function(e){switch(e){case k.LocalStorage:case k.SessionStorage:try{return new th(e)}catch(e){this.logger.verbose(e)}}return this.cacheConfig.cacheLocation=k.MemoryStorage,new eJ},t.prototype.setupTemporaryCacheStorage=function(e){switch(e){case k.LocalStorage:case k.SessionStorage:try{return new th(k.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case k.MemoryStorage:default:return this.internalStorage}},t.prototype.migrateCacheEntries=function(){var e=this,t=eo.CACHE_PREFIX+"."+a.ID_TOKEN,r=eo.CACHE_PREFIX+"."+a.CLIENT_INFO,n=eo.CACHE_PREFIX+"."+a.ERROR,o=eo.CACHE_PREFIX+"."+a.ERROR_DESC,i=[this.browserStorage.getItem(t),this.browserStorage.getItem(r),this.browserStorage.getItem(n),this.browserStorage.getItem(o)];
1[a.ID_TOKEN,a.CLIENT_INFO,a.ERROR,a.ERROR_DESC].forEach(function(t,r){return e.migrateCacheEntry(t,i[r])})},t.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},t.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},t.prototype.getItem=function(e){return this.browserStorage.getItem(e)},t.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},t.prototype.getAccount=function(e){var t=this.getItem(e);if(!t)return null;var r=this.validateAndParseJson(t);return r&&e6.isAccountEntity(r)?tr.toObject(new e6,r):null},t.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e))},t.prototype.getIdTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&to.isIdTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),tr.toObject(new to,r)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null)},t.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},t.prototype.getAccessTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&ta.isAccessTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),tr.toObject(new ta,r)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null)},t.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},t.prototype.getRefreshTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&ts.isRefreshTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),tr.toObject(new ts,r)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null)},t.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},t.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&tc.isAppMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),tr.toObject(new tc,r)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},t.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},t.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&tl.isServerTelemetryEntity(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),tr.toObject(new tl,r)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},t.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},t.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&tu.isAuthorityMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),tr.toObject(new tu,r)):null},t.prototype.getAuthorityMetadataKeys=function(){var e=this;return this.internalStorage.getKeys().filter(function(t){return e.isAuthorityMetadata(t)})},t.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem(R.WRAPPER_SKU,e),this.internalStorage.setItem(R.WRAPPER_VER,t)},t.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem(R.WRAPPER_SKU)||eo.EMPTY_STRING,this.internalStorage.getItem(R.WRAPPER_VER)||eo.EMPTY_STRING]},t.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},t.prototype.getActiveAccount=function(){var e=this.generateCacheKey(a.A
1CTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");var r=this.generateCacheKey(a.ACTIVE_ACCOUNT),n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;var o=this.getAccountInfoByFilter({localAccountId:n})[0]||null;return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(o),o):null}var i=this.validateAndParseJson(t);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId})[0]||null):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)},t.prototype.setActiveAccount=function(e){var t=this.generateCacheKey(a.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(a.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");var n={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId};this.browserStorage.setItem(t,JSON.stringify(n)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)},t.prototype.getAccountInfoByFilter=function(e){var t=this.getAllAccounts();return this.logger.trace("BrowserCacheManager.getAccountInfoByFilter: total "+t.length+" accounts found"),t.filter(function(t){return(!e.username||e.username.toLowerCase()===t.username.toLowerCase())&&(!e.homeAccountId||e.homeAccountId===t.homeAccountId)&&(!e.localAccountId||e.localAccountId===t.localAccountId)&&(!e.tenantId||e.tenantId===t.tenantId)&&(!e.environment||e.environment===t.environment)})},t.prototype.getAccountInfoByHints=function(e,t){var r=this.getAllAccounts().filter(function(r){return t?t===(r.idTokenClaims&&r.idTokenClaims.sid):!!e&&e===r.username});if(1===r.length)return r[0];if(r.length>1)throw eD.createMultipleMatchingAccountsInCacheError();return null},t.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&td.isThrottlingEntity(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),tr.toObject(new td,r)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},t.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},t.prototype.getTemporaryCache=function(e,t){var r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){var n=this.getItemCookie(r);if(n)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),n}var o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===k.LocalStorage){var i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o},t.prototype.setTemporaryCache=function(e,t,r){var n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))},t.prototype.removeItem=function(e){return this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItem
1Cookie(e)),!0},t.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},t.prototype.getKeys=function(){return Q(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},t.prototype.clear=function(){return J(this,void 0,void 0,function(){var e=this;return $(this,function(t){switch(t.label){case 0:return[4,this.removeAllAccounts()];case 1:return t.sent(),this.removeAppMetadata(),this.getKeys().forEach(function(t){(e.browserStorage.containsKey(t)||e.temporaryCacheStorage.containsKey(t))&&(-1!==t.indexOf(eo.CACHE_PREFIX)||-1!==t.indexOf(e.clientId))&&e.removeItem(t)}),this.internalStorage.clear(),[2]}})})},t.prototype.setItemCookie=function(e,t,r){var n=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;SameSite=Lax;";r&&(n+="expires="+this.getCookieExpirationTime(r)+";"),this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n},t.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return eo.EMPTY_STRING},t.prototype.clearMsalCookies=function(){var e=this,t=eo.CACHE_PREFIX+"."+this.clientId;document.cookie.split(";").forEach(function(r){for(;" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t)){var n=r.split("=")[0];e.clearItemCookie(n)}})}
1,t.prototype.clearItemCookie=function(e){this.setItemCookie(e,eo.EMPTY_STRING,-1)},t.prototype.getCookieExpirationTime=function(e){return new Date(new Date().getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()},t.prototype.getCache=function(){return this.browserStorage},t.prototype.setCache=function(){},t.prototype.generateCacheKey=function(e){return this.validateAndParseJson(e)?JSON.stringify(e):eL.startsWith(e,eo.CACHE_PREFIX)||eL.startsWith(e,a.ADAL_ID_TOKEN)?e:eo.CACHE_PREFIX+"."+this.clientId+"."+e},t.prototype.generateAuthorityKey=function(e){var t=tp.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(x.AUTHORITY+"."+t)},t.prototype.generateNonceKey=function(e){var t=tp.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(x.NONCE_IDTOKEN+"."+t)},t.prototype.generateStateKey=function(e){var t=tp.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(x.REQUEST_STATE+"."+t)},t.prototype.getCachedAuthority=function(e){var t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;var n=this.generateAuthorityKey(r);return this.getTemporaryCache(n)},t.prototype.updateCacheEntries=function(e,t,r,n,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);var a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);var s=this.generateAuthorityKey(e);if(this.setTemporaryCache(s,r,!1),o){var c={credential:o.homeAccountId,type:H.HOME_ACCOUNT_ID};this.setTemporaryCache(x.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(!eL.isEmpty(n)){var c={credential:n,type:H.UPN};this.setTemporaryCache(x.CCS_CREDENTIAL,JSON.stringify(c),!0)}},t.prototype.resetRequestCache=function(e){var t=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),eL.isEmpty(e)||this.getKeys().forEach(function(r){-1!==r.indexOf(e)&&t.removeItem(r)}),e&&(this.removeItem(this.generateStateKey(e)),this.removeItem(this.generateNonceKey(e)),this.removeItem(this.generateAuthorityKey(e))),this.removeItem(this.generateCacheKey(x.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(x.ORIGIN_URI)),this.removeItem(this.generateCacheKey(x.URL_HASH)),this.removeItem(this.generateCacheKey(x.CORRELATION_ID)),this.removeItem(this.generateCacheKey(x.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(x.NATIVE_REQUEST)),this.setInteractionInProgress(!1)},t.prototype.cleanRequestByState=function(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){var t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+r),this.resetRequestCache(r||eo.EMPTY_STRING)}this.clearMsalCookies()},t.prototype.cleanRequestByInteractionType=function(e){var t=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(function(r){if(-1!==r.indexOf(x.REQUEST_STATE)){var n=t.temporaryCacheStorage.getItem(r);if(n){var o=tg.extractBrowserRequestState(t.cryptoImpl,n);o&&o.interactionType===e&&(t.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+n),t.resetRequestCache(n))}}}),this.clearMsalCookies(),this.setInteractionInProgress(!1)},t.prototype.cacheCodeRequest=function(e,t){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");var r=t.base64Encode(JSON.stringify(e));this.setTemporaryCache(x.REQUEST_PARAMS,r,!0)},t.prototype.getCachedRequest=function(e,t){this.logger.trace("BrowserCacheManager.getCachedRequest called");var r=this.getTemporaryCache(x.REQUEST_PARAMS,!0);if(!r)throw eq.createNoTokenRequestCacheError();var n=this.validateAndParseJson(t.base64Decode(r));if(!n)throw eq.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(x.REQUEST_PARAMS)),eL.isEmpty(n.authority)){var o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw eq.createNoCachedAuthorityError();n.authority=i}return n},t.prototype.getCachedNativeRequest=function(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");var e=this.getTemporaryCache(x.NATIVE_REQUEST,!0);return e?this.validateAndParseJson(e)||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null):(this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null)},t.prototype.isInteractionInProgress=function(e){var t=this.getInteractionInProgress();return e?t===this.clientId:!!t},t.prototype.getInteractionInProgress=function(){var e=eo.CACHE_PREFIX+"."+x.INTERACTION_STATUS_KEY;return this.getTemporaryCache(e,!1)},t.prototype.setInteractionInProgress=function(e){var t=eo.CACHE_PREFIX+"."+x.INTERACTION_STATUS_KEY;if(e){if(this.getInteractionInProgress())throw eq.createInteractionInProgressError();this.setTemporaryCache(t,this.clientId,!1)}else e||this.getInteractionInProgress()!==this.clientId||this.removeItem(t)},t.prototype.getLegacyLoginHint=function(){var e=this.getTemporaryCache(a.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(a.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var t=this.getTemporaryCache(a.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(a.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));var r=t||e;if(r){var n=new tt(r,this.cryptoImpl);if(n.claims&&n.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL
1/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),n.claims.preferred_username;if(n.claims&&n.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),n.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},t.prototype.updateCredentialCacheKey=function(e,t){var r=t.generateCredentialKey();if(e!==r){var n=this.getItem(e);if(n)return this.removeItem(e),this.setItem(r,n),this.logger.verbose("Updated an outdated "+t.credentialType+" cache key"),r;this.logger.error("Attempted to update an outdated "+t.credentialType+" cache key but no item matching the outdated key was found in storage")}return e},t.prototype.getRedirectRequestContext=function(){return this.getTemporaryCache(x.REDIRECT_CONTEXT,!0)},t.prototype.setRedirectRequestContext=function(e){this.setTemporaryCache(x.REDIRECT_CONTEXT,e,!0)},t}(tr);!function(e){e.AAD="AAD",e.OIDC="OIDC"}(F||(F={})),function(e){e[e.None=0]="None",e.AzurePublic="https://login.microsoftonline.com",e.AzurePpe="https://login.windows-ppe.net",e.AzureChina="https://login.chinacloudapi.cn",e.AzureGermany="https://login.microsoftonline.de",e.AzureUsGovernment="https://login.microsoftonline.us"}(j||(j={}));var tm="9.1.1",ty={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1,proxyUrl:eo.EMPTY_STRING},tb={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:U.Info,correlationId:eo.EMPTY_STRING},tw={sendGetRequestAsync:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Network interface - sendGetRequestAsync() has not been implemented",eg.createUnexpectedError(e)})})},sendPostRequestAsync:function(){return et(this,void 0,void 0,function(){var e;return er(this,function(t){throw e="Network interface - sendPostRequestAsync() has not been implemented",eg.createUnexpectedError(e)})})}},tE={sku:eo.SKU,version:tm,cpu:eo.EMPTY_STRING,os:eo.EMPTY_STRING},tS={clientSecret:eo.EMPTY_STRING,clientAssertion:void 0},tC={azureCloudInstance:j.None,tenant:""+eo.DEFAULT_COMMON_TENANT},t_={application:{appName:"",appVersion:""}},tT={sendGetRequestAsync:function(){return Promise.reject(eg.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented for the Network interface."))},sendPostRequestAsync:function(){return Promise.reject(eg.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented for the Network interface."))}},tI=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return J(this,void 0,void 0,function(){var r,n,o;return $(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,fetch(e,{method:A.GET,headers:this.getFetchHeaders(t)})];case 1:return r=i.sent(),[3,3];case 2:if(n=i.sent(),window.navigator.onLine)throw eq.createGetRequestFailedError(n,e);throw eq.createNoNetworkConnectivityError();case 3:return i.trys.push([3,5,,6]),o={headers:this.getHeaderDict(r.headers)},[4,r.json()];case 4:return[2,(o.body=i.sent(),o.status=r.status,o)];case 5:throw i.sent(),eq.createFailedToParseNetworkResponseError(e);case 6:return[2]}})})},e.prototype.sendPostRequestAsync=function(e,t){return J(this,void 0,void 0,function(){var r,n,o,i;return $(this,function(a){switch(a.label){case 0:r=t&&t.body||eo.EMPTY_STRING,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(e,{method:A.POST,headers:this.getFetchHeaders(t),body:r})];case 2:return n=a.sent(),[3,4];case 3:if(o=a.sent(),window.navigator.onLine)throw eq.createPostRequestFailedError(o,e);throw eq.createNoNetworkConnectivityError();case 4:return a.trys.push([4,6,,7]),i={headers:this.getHeaderDict(n.headers)},[4,n.json()];case 5:return[2,(i.body=a.sent(),i.status=n.status,i)];case 6:throw a.sent(),eq.createFailedToParseNetworkResponseError(e);case 7:return[2]}})})},e.prototype.getFetchHeaders=function(e){var t=new Headers;if(!(e&&e.headers))return t;var r=e.headers;return Object.keys(r).forEach(function(e){t.append(e,r[e])}),t},e.prototype.getHeaderDict=function(e){var t={};return e.forEach(function(e,r){t[r]=e}),t},e}(),tk=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){return[2,this.sendRequestAsync(e,A.GET,t)]})})},e.prototype.sendPostRequestAsync=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){return[2,this.sendRequestAsync(e,A.POST,t)]})})},e.prototype.sendRequestAsync=function(e,t,r){var n=this;return new Promise(function(o,i){var a=new XMLHttpRequest;if(a.open(t,e,!0),n.setXhrHeaders(a,r),a.onload=function(){(a.status<200||a.status>=300)&&(t===A.POST?i(eq.createPostRequestFailedError("Failed with status "+a.status,e)):i(eq.createGetRequestFailedError("Failed with status "+a.status,e)));try{var r=JSON.parse(a.responseText),s={headers:n.getHeaderDict(a),body:r,status:a.status};o(s)}catch(t){i(eq.createFailedToParseNetworkResponseError(e))}},a.onerror=function(){window.navigator.onLine?t===A.POST?i(eq.createPostRequestFailedError("Failed with status "+a.status,e)):i(eq.createGetRequestFailedError("Failed with status "+a.status,e)):i(eq.createNoNetworkConnectivityError())},t===A.POST&&r&&r.body)a.send(r.body);else if(t===A.GET)a.send();else throw eq.createHttpMethodNotImplementedError(t)})},e.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var r=t.headers;Object.keys(r).forEach(function(t){e.setRequestHeader(t,r[t])})}},e.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return t.forEach(function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&o&&(r[n]=o)}),r},e}(),tA=function(){function e(){}return e.clearHash=function(e){e.location.hash=eo.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,eo.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},e.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):eo.EMPTY_STRING},e.isInIframe=function(){return window.parent!==window},e.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(eE.POPUP_NAME_PREFIX+".")},e.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},e.getHomepage=function(){var e=new tf(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},e.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new tI:new tk},e.blockReloadInHiddenIframes=function(){if(tf.hashContainsKnownProperties(window.location.hash)&&e.isInIframe())throw eq.createBlockReloadInHiddenIframeError()},e.blockRedirectInIframe=function(t,r){var n=e.isInIframe();if(t===O.Redirect&&n&&!r)throw eq.createRedirectInIframeError(n)},e.blockAcquireTokenInPopups=function(){if(e.isInPopup())throw eq.createBlockAcquireTokenInPopupsError()},e.blockNonBrowserEnvironment=function(e){if(!e)throw eq.createNonBrowserEnvironmentError()},e.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw eq.createNativeBrokerCalledBeforeInitialize()},e.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),n=e.indexOf("Edge/");return t>0||r>0||n>0},e}(),tx=function(){function e(){}return e.prototype.navigateInternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.prototype.navigateExternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(function(e){setTimeout(function(){e(!0)},t.timeout)})},e}(),tR="@azure/msal-browser",tP="2.32.2";!function(e){e.INITIALIZE_START="msal:initializeStart",e.INITIALIZE_END="msal:initializeEnd",e.ACCOUNT_ADDED="msal:accountAdded",e.ACCOUNT_REMOVED="msal:accountRemoved",e.LOGIN_START="msal:loginStart",e.LOGIN_SUCCESS="msal:loginSuccess",e.LOGIN_FAILURE="msal:loginFailure",e.ACQUIRE_TOKEN_START="msal:acquireTokenStart",e.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",e.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",e.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",e.SSO_SILENT_START="msal:ssoSilentStart",e.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",e.SSO_SILENT_FAILURE="msal:ssoSilentFailure",e.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",e.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",e.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",e.HANDLE_REDIRECT_START="msal:handleRedirectStart",e.HANDLE_REDIRECT_END="msal:handleRedirectEnd",e.POPUP_OPENED="msal:popupOpened",e.LOGOUT_START="msal:logoutStart",e.LOGOUT_SUCCESS="msal:logoutSuccess",e.LOGOUT_FAILURE="msal:logoutFailure",e.LOGOUT_END="msal:logout
1End"}(z||(z={}));var tO=function(){function e(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return e.prototype.addEventCallback=function(e){if("undefined"!=typeof window){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},e.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},e.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},e.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},e.prototype.emitEvent=function(e,t,r,n){var o=this;if("undefined"!=typeof window){var i={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach(function(t,r){o.logger.verbose("Emitting event to callback "+r+": "+e),t.apply(null,[i])})}},e.prototype.handleAccountCacheChange=function(e){try{var t=e.newValue||e.oldValue;if(!t)return;var r=JSON.parse(t);if("object"!=typeof r||!e6.isAccountEntity(r))return;var n=tr.toObject(new e6,r).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(z.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(z.ACCOUNT_REMOVED,void 0,n))}catch(e){return}},e}(),tN=function(){function e(){}return e.generateThrottlingStorageKey=function(e){return ep.THROTTLING_PREFIX+"."+JSON.stringify(e)},e.preProcess=function(t,r){var n,o=e.generateThrottlingStorageKey(r),i=t.getThrottlingCache(o);if(i){if(i.throttleTime<Date.now()){t.removeItem(o,v.THROTTLING);return}throw new ev((null===(n=i.errorCodes)||void 0===n?void 0:n.join(" "))||eo.EMPTY_STRING,i.errorMessage,i.subError)}},e.postProcess=function(t,r,n){if(e.checkResponseStatus(n)||e.checkResponseForRetryAfter(n)){var o={throttleTime:e.calculateThrottleTime(parseInt(n.headers[i.RETRY_AFTER])),error:n.body.error,errorCodes:n.body.error_codes,errorMessage:n.body.error_description,subError:n.body.suberror};t.setThrottlingCache(e.generateThrottlingStorageKey(r),o)}},e.checkResponseStatus=function(e){return 429===e.status||e.status>=500&&e.status<600},e.checkResponseForRetryAfter=function(e){return!!e.headers&&e.headers.hasOwnProperty(i.RETRY_AFTER)&&(e.status<200||e.status>=300)},e.calculateThrottleTime=function(e){var t=Date.now()/1e3;return Math.floor(1e3*Math.min(t+((e<=0?0:e)||ep.DEFAULT_THROTTLE_TIME_SECONDS),t+ep.DEFAULT_MAX_THROTTLE_TIME_SECONDS))},e.removeThrottle=function(e,t,r,n){var o={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:n,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},i=this.generateThrottlingStorageKey(o);return e.removeItem(i,v.THROTTLING)},e}(),tM=function(){function e(e,t){this.networkClient=e,this.cacheManager=t}return e.prototype.sendPostRequest=function(e,t,r){return et(this,void 0,void 0,function(){var n,o;return er(this,function(i){switch(i.label){case 0:tN.preProcess(this.cacheManager,e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(t,r)];case 2:return n=i.sent(),[3,4];case 3:if((o=i.sent())instanceof eg)throw o;throw eD.createNetworkError(t,o);case 4:return tN.postProcess(this.cacheManager,e,n),[2,n]}})})},e}(),tD=function(){function e(e,t){var r,n,o,i,a,s,c,l,u,d,p,h,f;this.config=(r=e.authOptions,n=e.systemOptions,o=e.loggerOptions,i=e.storageInterface,a=e.networkInterface,s=e.cryptoInterface,c=e.clientCredentials,l=e.libraryInfo,u=e.telemetry,d=e.serverTelemetryManager,p=e.persistencePlugin,h=e.serializableCache,f=ee(ee({}
1,tb),o),{authOptions:ee({clientCapabilities:[],azureCloudOptions:tC,skipAuthorityMetadataCache:!1},r),systemOptions:ee(ee({},ty),n),loggerOptions:f,storageInterface:i||new tn(r.clientId,e3),networkInterface:a||tw,cryptoInterface:s||e3,clientCredentials:c||tS,libraryInfo:ee(ee({},tE),l),telemetry:ee(ee({},t_),u),serverTelemetryManager:d||null,persistencePlugin:p||null,serializableCache:h||null}),this.logger=new eZ(this.config.loggerOptions,"@azure/msal-common",tm),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new tM(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}return e.prototype.createTokenRequestHeaders=function(e){var t={};if(t[i.CONTENT_TYPE]=eo.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case H.HOME_ACCOUNT_ID:try{var r=e5(e.credential);t[i.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case H.UPN:t[i.CCS_HEADER]="UPN: "+e.credential}return t},e.prototype.executePostToTokenEndpoint=function(e,t,r,n){return et(this,void 0,void 0,function(){var o;return er(this,function(i){switch(i.label){case 0:return[4,this.networkManager.sendPostRequest(n,e,{body:t,headers:r,proxyUrl:this.config.systemOptions.proxyUrl})];case 1:return o=i.sent(),this.config.serverTelemetryManager&&o.status<500&&429!==o.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,o]}})})},e.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw eD.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},e}(),tL=function(){function e(){}return e.validateRedirectUri=function(e){if(eL.isEmpty(e))throw e9.createRedirectUriEmptyError()},e.validatePrompt=function(e){var t=[];for(var r in es)t.push(es[r]);if(0>t.indexOf(e))throw e9.createInvalidPromptError(e)},e.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw e9.createInvalidClaimsRequestError()}},e.validateCodeChallengeParams=function(e,t){if(eL.isEmpty(e)||eL.isEmpty(t))throw e9.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},e.validateCodeChallengeMethod=function(e){if(0>[ec.PLAIN,ec.S256].indexOf(e))throw e9.createInvalidCodeChallengeMethodError()},e.sanitizeEQParams=function(e,t){return e?(t.forEach(function(t,r){e[r]&&delete e[r]}),e):{}},e}(),tU=function(){function e(){this.parameters=new Map}return e.prototype.addResponseTypeCode=function(){this.parameters.set(c.RESPONSE_TYPE,encodeURIComponent(eo.CODE_RESPONSE_TYPE))},e.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(c.RESPONSE_TYPE,encodeURIComponent(eo.TOKEN_RESPONSE_TYPE+" "+eo.ID_TOKEN_RESPONSE_TYPE))},e.prototype.addResponseMode=function(e){this.parameters.set(c.RESPONSE_MODE,encodeURIComponent(e||d.QUERY))},e.prototype.addNativeBroker=function(){this.parameters.set(c.NATIVE_BROKER,encodeURIComponent("1"))},e.prototype.addScopes=function(e,t){void 0===t&&(t=!0);var r=new te(t?en(e||[],ei):e||[]);this.parameters.set(c.SCOPE,encodeURIComponent(r.printScopes()))},e.prototype.addClientId=function(e){this.parameters.set(c.CLIENT_ID,encodeURIComponent(e))},e.prototype.addRedirectUri=function(e){tL.validateRedirectUri(e),this.parameters.set(c.REDIRECT_URI,encodeURIComponent(e))},e.prototype.addPostLogoutRedirectUri=function(e){tL.validateRedirectUri(e),this.parameters.set(c.POST_LOGOUT_URI,encodeURIComponent(e))},e.prototype.addIdTokenHint=function(e){this.parameters.set(c.ID_TOKEN_HINT,encodeURIComponent(e))},e.prototype.addDomainHint=function(e){this.parameters.set(u.DOMAIN_HINT,encodeURIComponent(e))},e.prototype.addLoginHint=function(e){this.parameters.set(u.LOGIN_HINT,encodeURIComponent(e))},e.prototype.addCcsUpn=function(e){this.parameters.set(i.CCS_HEADER,encodeURIComponent("UPN:"+e))},e.prototype.addCcsOid=function(e){this.parameters.set(i.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},e.prototype.addSid=function(e){this.parameters.set(u.SID,encodeURIComponent(e))},e.prototype.addClaims=function(e,t){var r=this.addClientCapabilitiesToClaims(e,t);tL.validateClaims(r),this.parameters.set(c.CLAIMS,encodeURIComponent(r))},e.prototype.addCorrelationId=function(e){this.parameters.set(c.CLIENT_REQUEST_ID,encodeURIComponent(e))},e.prototype.addLibraryInfo=function(e){this.parameters.set(c.X_CLIENT_SKU,e.sku),this.parameters.set(c.X_CLIENT_VER,e.ver
1sion),e.os&&this.parameters.set(c.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(c.X_CLIENT_CPU,e.cpu)},e.prototype.addApplicationTelemetry=function(e){(null==e?void 0:e.appName)&&this.parameters.set(c.X_APP_NAME,e.appName),(null==e?void 0:e.appVersion)&&this.parameters.set(c.X_APP_VER,e.appVersion)},e.prototype.addPrompt=function(e){tL.validatePrompt(e),this.parameters.set(""+c.PROMPT,encodeURIComponent(e))},e.prototype.addState=function(e){eL.isEmpty(e)||this.parameters.set(c.STATE,encodeURIComponent(e))},e.prototype.addNonce=function(e){this.parameters.set(c.NONCE,encodeURIComponent(e))},e.prototype.addCodeChallengeParams=function(e,t){if(tL.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(c.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(c.CODE_CHALLENGE_METHOD,encodeURIComponent(t));else throw e9.createInvalidCodeChallengeParamsError()},e.prototype.addAuthorizationCode=function(e){this.parameters.set(c.CODE,encodeURIComponent(e))},e.prototype.addDeviceCode=function(e){this.parameters.set(c.DEVICE_CODE,encodeURIComponent(e))},e.prototype.addRefreshToken=function(e){this.parameters.set(c.REFRESH_TOKEN,encodeURIComponent(e))},e.prototype.addCodeVerifier=function(e){this.parameters.set(c.CODE_VERIFIER,encodeURIComponent(e))},e.prototype.addClientSecret=function(e){this.parameters.set(c.CLIENT_SECRET,encodeURIComponent(e))},e.prototype.addClientAssertion=function(e){eL.isEmpty(e)||this.parameters.set(c.CLIENT_ASSERTION,encodeURIComponent(e))},e.prototype.addClientAssertionType=function(e){eL.isEmpty(e)||this.parameters.set(c.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},e.prototype.addOboAssertion=function(e){this.parameters.set(c.OBO_ASSERTION,encodeURIComponent(e))},e.prototype.addRequestTokenUse=function(e){this.parameters.set(c.REQUESTED_TOKEN_USE,encodeURIComponent(e))},e.prototype.addGrantType=function(e){this.parameters.set(c.GRANT_TYPE,encodeURIComponent(e))},e.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},e.prototype.addExtraQueryParameters=function(e){var t=this;tL.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach(function(r){t.parameters.set(r,e[r])})},e.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(e){throw e9.createInvalidClaimsRequestError()}else r={};return t&&t.length>0&&(r.hasOwnProperty(l.ACCESS_TOKEN)||(r[l.ACCESS_TOKEN]={}),r[l.ACCESS_TOKEN][l.XMS_CC]={values:t}),JSON.stringify(r)},e.prototype.addUsername=function(e){this.parameters.set(w.username,encodeURIComponent(e))},e.prototype.addPassword=function(e){this.parameters.set(w.password,encodeURIComponent(e))},e.prototype.addPopToken=function(e){eL.isEmpty(e)||(this.parameters.set(c.TOKEN_TYPE,b.POP),this.parameters.set(c.REQ_CNF,encodeURIComponent(e)))},e.prototype.addSshJwk=function(e){eL.isEmpty(e)||(this.parameters.set(c.TOKEN_TYPE,b.SSH),this.parameters.set(c.REQ_CNF,encodeURIComponent(e)))},e.prototype.addServerTelemetry=function(e){this.parameters.set(c.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(c.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},e.prototype.addThrottling=function(){this.parameters.set(c.X_MS_LIB_CAPABILITY,ep.X_MS_LIB_CAPABILITY_VALUE)},e.prototype.addLogoutHint=function(e){this.parameters.set(c.LOGOUT_HINT,encodeURIComponent(e))},e.prototype.createQueryString=function(){var e=[];return this.parameters.forEach(function(t,r){e.push(r+"="+t)}),e.join("&")},e}(),tq=function(e,t,r,n,o){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=n||null,this.appMetadata=o||null};!function(e){e.SW="sw",e.UHW="uhw"}(B||(B={}));var tH=function(){function e(e){this.cryptoUtils=e}return e.prototype.generateCnf=function(e){return et(this,void 0,void 0,function(){var t,r,n;return er(this,function(o){switch(o.label){case 0:return[4,this.generateKid(e)];case 1:return t=o.sent(),r=this.cryptoUtils.base64Encode(JSON.stringify(t)),n={kid:t.kid,reqCnfString:r},[4,this.cryptoUtils.hashString(r)];case 2:return[2,(n.reqCnfHash=o.sent(),n)]}})})},e.prototype.generateKid=function(e){return et(this,void 0,void 0,function(){return er(this,function(t){switch(t.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return[2,{kid:t.sent(),xms_ksl:B.SW}]}})})},e.prototype.signPopToken=function(e,t,r){return et(this,void 0,void 0,function(){return er(this,function(n){return[2,this.signPayload(e,t,r)]})})},e.prototype.signPayload=function(e,t,r,n){return et(this,void 0,void 0,function(){var o,i,a,s,c,l;return er(this,function(u){switch(u.label){case 0:return o=r.resourceRequestMethod,i=r.resourceRequestUri,a=r.shrClaims,s=r.shrNonce,l=null==(c=i?new tf(i):void 0)?void 0:c.getUrlComponents(),[4,this.cryptoUtils.signJwt(ee({at:e,ts:ti.nowSeconds(),m:null==o?void 0:o.toUpperCase(),u:null==l?void 0:l.HostNameAndPort,nonce:s||this.cryptoUtils.createNewGuid(),p:null==l?void 0:l.AbsolutePath,q:(null==l?void 0:l.QueryString)?[[],l.QueryString]:void 0,client_claims:a||void 0},n),t,r.correlationId)];case 1:return[2,u.sent()]}})})},e}(),tF=function(){function e(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(e.prototype,"cacheHasChanged",{get:function(){return this.hasChanged}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),e}(),tj=function(){function e(e,t,r,n,o,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i}return e.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?eD.createStateNotFoundError("Cached State"):eD.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw eD.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(ew.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new ew(e.error||eo.EMPTY_STRING,e.error_description,e.suberror);throw new ev(e.error||eo.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&e4(e.client_info,r)},e.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(ew.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new ew(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new ev(e.error,t,e.suberror)}},e.prototype.handleServerTokenResponse=function(t,r,n,o,i,a,s,c,l){return et(this,void 0,void 0,function(){var u,d,p,h,f,g;return er(this,function(v){switch(v.label){case 0:if(t.id_token){if(u=new tt(t.id_token||eo.EMPTY_STRING,this.cryptoObj),i&&!eL.isEmpty(i.nonce)&&u.claims.nonce!==i.nonce)throw eD.createNonceMismatchError();if(o.maxAge||0===o.maxAge){if(!(d=u.claims.auth_time))throw eD.createAuthTimeNotFoundError();tt.checkMaxAge(d,o.maxAge)}}this.homeAccountIdentifier=e6.generateHomeAccountId(t.client_info||eo.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,u),i&&i.state&&(p=tp.parseRequestState(this.cryptoObj,i.state)),t.key_id=t.key_id||o.sshKid||void 0,h=this.generateCacheRecord(t,r,n,o,u,a,i),v.label=1;case 1:if(v.trys.push([1,,5,8]),!(this.persistencePlugin&&this.serializableCache))return[3,3];return this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new tF(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(f)];case 2:v.sent(),v.label=3;case 3:if(s&&!c&&h.account&&(g=h.account.generateAccountKey(),!this.cacheStorage.getAccount(g)))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,e.generateAuthenticationResult(this.cryptoObj,r,h,!1,o,u,p,void 0,l)];return[4,this.cacheStorage.saveCacheRecord(h)];case 4:return v.sent(),[3,8];case 5:if(!(this.persistencePlugin&&this.serializableCache&&f))return[3,7];return this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(f)];case 6:v.sent(),v.label=7;case 7:return[7];case 8:return[2,e.generateAuthenticationResult(this.cryptoObj,r,h,!1,o,u,p,t.spa_code,l)]}})})},e.prototype.generateCacheRecord=function(e,t,r,n,o,i,a){var s,c,l=t.getPreferredCache();if(eL.isEmpty(l))throw eD.createInvalidCacheEnvironmentError();!eL.isEmpty(e.id_token)&&o&&(s=to.createIdTokenEntity(this.homeAccountIdentifier,l,e.id_token||eo.EMPTY_STRING,this.clientId,o.claims.tid||eo.EMPTY_STRING),c=this.generateAccountEntity(e,o,t,a));var u=null;if(!eL.isEmpty(e.access_token)){var d=e.scope?te.fromString(e.scope):new te(n.scopes||[]),p=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,h=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,f=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,g=r+p;u=ta.createAccessTokenEntity(this.homeAccountIdentifier,l,e.access_token||eo.EMPTY_STRING,this.clientId,o?o.claims.tid||eo.EMPTY_STRING:t.tenant,d.printScopes(),g,g+h,this.cryptoObj,f&&f>0?r+f:void 0,e.token_type,i,e.key_id,n.claims,n.requestedClaimsHash)}var v=null;eL.isEmpty(e.refresh_token)||(v=ts.createRefreshTokenEntity(this.homeAccountIdentifier,l,e.refresh_token||eo.EMPTY_STRING,this.clientId,e.foci,i));var m=null;return eL.isEmpty(e.foci)||(m=tc.createAppMetadataEntity(this.clientId,l,e.foci)),new tq(c,s,u,v,m)},e.prototype.generateAccountEntity=function(e,t,r,n){var o=r.authorityType,i=n?n.cloud_graph_host_name:eo.EMPTY_STRING,a=n?n.msgraph_host:eo.EMPTY_STRING;if(o===q.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),e6.createGenericAccount(this.homeAccountIdentifier,t,r,i,a);if(eL.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw eD.createClientInfoEmptyError();return e.client_info?e6.createAccount(e.client_info,this.homeAccountIdentifier,t,r,i,a):e6.createGenericAccount(this.homeAccountIdentifier,t,r,i,a)}
1,e.generateAuthenticationResult=function(e,t,r,n,o,i,a,s,c){var l,u,d;return et(this,void 0,void 0,function(){var p,h,f,g,v,m,y,w,E,S,C;return er(this,function(_){switch(_.label){case 0:if(p=eo.EMPTY_STRING,h=[],f=null,v=eo.EMPTY_STRING,!r.accessToken)return[3,4];if(r.accessToken.tokenType!==b.POP)return[3,2];if(m=new tH(e),w=(y=r.accessToken).secret,!(E=y.keyId))throw eD.createKeyIdMissingError();return[4,m.signPopToken(w,E,o)];case 1:return p=_.sent(),[3,3];case 2:p=r.accessToken.secret,_.label=3;case 3:h=te.fromString(r.accessToken.target).asArray(),f=new Date(1e3*Number(r.accessToken.expiresOn)),g=new Date(1e3*Number(r.accessToken.extendedExpiresOn)),_.label=4;case 4:return r.appMetadata&&(v="1"===r.appMetadata.familyId?"1":eo.EMPTY_STRING),S=(null==i?void 0:i.claims.oid)||(null==i?void 0:i.claims.sub)||eo.EMPTY_STRING,C=(null==i?void 0:i.claims.tid)||eo.EMPTY_STRING,[2,{authority:t.canonicalAuthority,uniqueId:S,tenantId:C,scopes:h,account:r.account?r.account.getAccountInfo():null,idToken:i?i.rawToken:eo.EMPTY_STRING,idTokenClaims:i?i.claims:{},accessToken:p,fromCache:n,expiresOn:f,correlationId:o.correlationId,requestId:c||eo.EMPTY_STRING,extExpiresOn:g,familyId:v,tokenType:(null===(l=r.accessToken)||void 0===l?void 0:l.tokenType)||eo.EMPTY_STRING,state:a?a.userRequestState:eo.EMPTY_STRING,cloudGraphHostName:(null===(u=r.account)||void 0===u?void 0:u.cloudGraphHostName)||eo.EMPTY_STRING,msGraphHost:(null===(d=r.account)||void 0===d?void 0:d.msGraphHost)||eo.EMPTY_STRING,code:s,fromNativeBroker:!1}]}})})},e}(),tz=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.includeRedirectUri=!0,n}return Z(t,e),t.prototype.getAuthCodeUrl=function(e){return et(this,void 0,void 0,function(){var t;return er(this,function(r){switch(r.label){case 0:return[4,this.createAuthCodeUrlQueryString(e)];case 1:return t=r.sent(),[2,tf.appendQueryString(this.authority.authorizationEndpoint,t)]}})})},t.prototype.acquireToken=function(e,t){var r,n,o;return et(this,void 0,void 0,function(){var a,s,c,l,u,d,p=this;return er(this,function(h){switch(h.label){case 0:if(a=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement("AuthCodeClientAcquireToken",e.correlationId),this.logger.info("in acquireToken call in auth-code client"),!e||eL.isEmpty(e.code))throw eD.createTokenRequestCannotBeMadeError();return s=ti.nowSeconds(),[4,this.executeTokenRequest(this.authority,e)];case 1:return l=null===(n=(c=h.sent()).headers)||void 0===n?void 0:n[i.X_MS_REQUEST_ID],(u=null===(o=c.headers)||void 0===o?void 0:o[i.X_MS_HTTP_VERSION])&&(null==a||a.addStaticFields({httpVerAuthority:u})),(d=new tj(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(c.body),[2,d.handleServerTokenResponse(c.body,this.authority,s,e,t,void 0,void 0,void 0,l).then(function(e){return null==a||a.endMeasurement({success:!0}),e}).catch(function(t){throw p.logger.verbose("Error in fetching token in ACC",e.correlationId),null==a||a.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t})]}})})},t.prototype.handleFragmentResponse=function(e,t){var r=new tj(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),n=new tf(e),o=tf.getDeserializedHash(n.getHash());if(r.validateServerAuthorizationCodeResponse(o,t,this.cryptoUtils),!o.code)throw eD.createNoAuthCodeInServerResponseError();return ee(ee({},o),{code:o.code})},t.prototype.getLogoutUri=function(e){if(!e)throw e9.createEmptyLogoutRequestError();var t=this.createLogoutUrlQueryString(e);return tf.appendQueryString(this.authority.endSessionEndpoint,t)},t.prototype.executeTokenRequest=function(e,t){return et(this,void 0,void 0,function(){var r,n,o,i,a,s,c;return er(this,function(l){switch(l.label){case 0:return r={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[4,this.createTokenRequestBody(t)];case 1:if(n=l.sent(),o=this.createTokenQueryParameters(t),i=void 0,t.clientInfo)try{a=e4(t.clientInfo,this.cryptoUtils),i={credential:""+a.uid+f.CLIENT_INFO_SEPARATOR+a.utid,type:H.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return s=this.createTokenRequestHeaders(i||t.ccsCredential),c=eL.isEmpty(o)?e.tokenEndpoint:e.tokenEndpoint+"?"+o,[2,this.executePostToTokenEndpoint(c,n,s,r)]}})})},t.prototype.createTokenQueryParameters=function(e){var t=new tU;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},t.prototype.createTokenRequestBody=function(e){return et(this,void 0,void 0,function(){var t,r,n,o,i,a,s;return er(this,function(l){switch(l.label){case 0:if((t=new tU).addClientId(this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):tL.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(r=this.config.clientCredentials.clientAssertion,t.addClientAssertion(r.assertion),t.addClientAssertionType(r.assertionType)),t.addGrantType(p.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme!==b.POP)return[3,2];return[4,new tH(this.cryptoUtils).generateCnf(e)];case 1:return n=l.sent(),t.addPopToken(n.reqCnfString),[3,3];case 2:if(e.authenticationScheme===b.SSH){if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw e9.createMissingSshJwkError()}l.label=3;case 3:if(o=e.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(o),(!eL.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),i=void 0,e.clientInfo)try{a=e4(e.clientInfo,this.cryptoUtils),i={credential:""+a.uid+f.CLIENT_INFO_SEPARATOR+a.utid,type:H.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else i=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&i)switch(i.type){case H.HOME_ACCOUNT_ID:try{a=e5(i.credential),t.addCcsOid(a)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case H.UPN:t.addCcsUpn(i.credential)}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[c.RETURN_SPA_CODE]||t.addExtraQueryParameters(((s={})[c.RETURN_SPA_CODE]="1",s)),[2,t.createQueryString()]}})})},t.prototype.createAuthCodeUrlQueryString=function(e){return et(this,void 0,void 0,function(){var t,r,n,o,i,a,s;return er(this,function(c){switch(c.label){case 0:if((t=new tU).addClientId(this.config.authOptions.clientId),r
1=en(e.scopes||[],e.extraScopesToConsent||[]),t.addScopes(r),t.addRedirectUri(e.redirectUri),n=e.correlationId||this.config.cryptoInterface.createNewGuid(),t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==es.SELECT_ACCOUNT){if(e.sid&&e.prompt===es.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){if(o=this.extractAccountSid(e.account),i=this.extractLoginHint(e.account)){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(i);try{a=e5(e.account.homeAccountId),t.addCcsOid(a)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(o&&e.prompt===es.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(o);try{a=e5(e.account.homeAccountId),t.addCcsOid(a)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{a=e5(e.account.homeAccountId),t.addCcsOid(a)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint))}else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(!eL.isEmpty(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),!e.nativeBroker||(t.addNativeBroker(),e.authenticationScheme!==b.POP))return[3,2];return[4,new tH(this.cryptoUtils).generateCnf(e)];case 1:s=c.sent(),t.addPopToken(s.reqCnfHash),c.label=2;case 2:return[2,t.createQueryString()]}})})},t.prototype.createLogoutUrlQueryString=function(e){var t=new tU;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},t.prototype.extractAccountSid=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.sid)||null},t.prototype.extractLoginHint=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.login_hint)||null},t}(tD),tB={endpointMetadata:{"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/o
1auth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/o
1auth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgra
1ph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgra
1ph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},instanceDiscoveryMetadata:{"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}}},tK=tB.endpointMetadata,tG=tB.instanceDiscoveryMetadata,tY=function(){function e(e){this.networkInterface=e}return e.prototype.detectRegion=function(t,r,n){return et(this,void 0,void 0,function(){var o,i,a,s,c;return er(this,function(l){switch(l.label){case 0:if(o=t)return[3,8];i=e.IMDS_OPTIONS,n&&(i.proxyUrl=n),l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(eo.IMDS_VERSION,i)];case 2:if((a=l.sent()).status===E.httpSuccess&&(o=a.body,r.region_source=S.IMDS),a.status!==E.httpBadRequest)return[3,5];return[4,this.getCurrentVersion(i)];case 3:if(!(s=l.sent()))return r.region_source=S.FAILED_AUTO_DETECTION,[2,null];return[4,this.getRegionFromIMDS(s,i)];case 4:(c=l.sent()).status===E.httpSuccess&&(o=c.body,r.region_source=S.IMDS),l.label=5;case 5:return[3,7];case 6:return l.sent(),r.region_source=S.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];
1case 8:r.region_source=S.ENVIRONMENT_VARIABLE,l.label=9;case 9:return o||(r.region_source=S.FAILED_AUTO_DETECTION),[2,o||null]}})})},e.prototype.getRegionFromIMDS=function(e,t){return et(this,void 0,void 0,function(){return er(this,function(r){return[2,this.networkInterface.sendGetRequestAsync(eo.IMDS_ENDPOINT+"?api-version="+e+"&format=text",t,eo.IMDS_TIMEOUT)]})})},e.prototype.getCurrentVersion=function(e){return et(this,void 0,void 0,function(){var t;return er(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(eo.IMDS_ENDPOINT+"?format=json",e)];case 1:if((t=r.sent()).status===E.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0)return[2,t.body["newest-versions"][0]];return[2,null];case 2:return r.sent(),[2,null];case 3:return[2]}})})},e.IMDS_OPTIONS={headers:{Metadata:"true"}},e}(),tV=function(){function e(e,t,r,n,o,i){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscovery=new tY(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.proxyUrl=i||eo.EMPTY_STRING,this.logger=o}return Object.defineProperty(e.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;if(e.length)switch(e[0].toLowerCase()){case eo.ADFS:return q.Adfs;case eo.DSTS:return q.Dsts}return q.Default},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new tf(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw eD.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw eD.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw eD.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw eD.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw eD.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw eD.createEndpointDiscoveryIncompleteError("Discovery incomplete.")}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}throw eD.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),e.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},e.prototype.replacePath=function(e){var t=e,r=new tf(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(function(e,n){var o=r[n];e!==o&&(t=t.replace("/"+o+"/","/"+e+"/"))}),t},Object.defineProperty(e.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===q.Adfs||this.authorityType===q.Dsts||this.protocolMode===F.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),e.prototype.discoveryComplete=function(){return!!this.metadata},e.prototype.resolveEndpointsAsync=function(){return et(this,void 0,void 0,function(){var e,t,r,n;return er(this,function(o){switch(o.label){case 0:return(e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(e=new tu).updateCanonicalAuthority(this.canonicalAuthority),[4,this.updateCloudDiscoveryMetadata(e)];case 1:return t=o.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network),[4,this.updateEndpointMetadata(e)];case 2:return r=o.sent(),t!==y.CACHE&&r!==y.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority)),n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache),this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e,[2]}})})},e.prototype.updateEndpointMetadata=function(e){var t,r;return et(this,void 0,void 0,function(){var n,o;return er(this,function(i){switch(i.label){case 0:if(n=this.getEndpointMetadataFromConfig())return e.updateEndpointMetadata(n,!1),[2,y.CONFIG];if(this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired())return[2,y.CACHE];return o=this.getEndpointMetadataFromHardcodedValues(),[4,this.getEndpointMetadataFromNetwork()];case 1:if(!(n=i.sent()))return[3,4];if(!(null===(t=this.authorityOptions.azureRegionConfiguration)||void 0===t?void 0:t.azureRegion))return[3,3];return[4,this.updateMetadataWithRegionalInformation(n)];case 2:n=i.sent(),i.label=3;case 3:return e.updateEndpointMetadata(n,!0),[2,y.NETWORK];case 4:if(!(o&&!this.authorityOptions.skipAuthorityMetadataCache))return[3,7];if(!(null===(r=this.authorityOptions.azureRegionConfiguration)||void 0===r?void 0:r.azureRegion))return[3,6];return[4,this.updateMetadataWithRegionalInformation(o)];case 5:o=i.sent(),i.label=6;case 6:return e.updateEndpointMetadata(o,!1),[2,y.HARDCODED_VALUES];case 7:throw eD.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}})})},e.prototype.isAuthoritySameType=function(e){return new tf(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},e.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw e9.createInvalidAuthorityMetadataError()}return null},e.prototype.getEndpointMetadataFromNetwork=function(){return et(this,void 0,void 0,function(){var e,t;return er(this,function(r){switch(r.label){case 0:e={},this.proxyUrl&&(e.proxyUrl=this.proxyUrl),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,e)];case 2:var n;return[2,(n=(t=r.sent()).body).hasOwnProperty("authorization_endpoint")&&n.hasOwnProperty("token_endpoint")&&n.hasOwnProperty("issuer")&&n.hasOwnProperty("jwks_uri")?t.body:null];case 3:return r.sent(),[2,null];case 4:return[2]}})})},e.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in tK?tK[this.canonicalAuthority]:null},e.prototype.updateMetadataWithRegionalInformation=function(t){var r,n,o,i,a;return et(this,void 0,void 0,function(){var s,c;return er(this,function(l){switch(l.label){case 0:return[4,this.regionDiscovery.detectRegion(null===(r=this.authorityOptions.azureRegionConfiguration)||void 0===r?void 0:r.environmentRegion,this.regionDiscoveryMetadata,this.proxyUrl)];case 1:if(s=l.sent(),c=(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.azureRegion)===eo.AZURE_REGION_AUTO_DISCOVER_FLAG?s:null===(o=this.authorityOptions.azureRegionConfiguration)||void 0===o?void 0:o.azureRegion,(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===eo.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=s?C.AUTO_DETECTION_REQUESTED_SUCCESSFUL:C.AUTO_DETECTION_REQUESTED_FAILED:s?this.regionDiscoveryMetadata.region_outcome=(null===(a=this.authorityOptions.azureRegionConfiguration)||void 0===a?void 0:a.azureRegion)===s?C.CONFIGURED_MATCHES_DETECTED:C.CONFIGURED_NOT_DETECTED:this.regionDiscoveryMetadata.region_outcome=C.CONFIGURED_NO_AUTO_DETECTION,c)return this.regionDiscoveryMetadata.region_used=c,[2,e.replaceWithRegionalInformation(t,c)];return[2,t]}})})},e.prototype.updateCloudDiscoveryMetadata=function(e){return et(this,void 0,void 0,function(){var t,r,n;return er(this,function(o){switch(o.label){case 0:if(this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||eo.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||eo.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(e.canonical_authority||eo.NOT_APPLICABLE)),t=this.getCloudDiscoveryMetadataFromConfig())return this.logger.verbose("Found cloud discovery metadata in the config."),e.updateCloudDiscoveryMetadata(t,!1),[2,y.CONFIG];if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),r=e.isExpired(),this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r)return this.logger.verbose("Found metadata in the cache."),[2,y.CACHE];return r&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),[4,this.getCloudDiscoveryMetadataFromNetwork()];case 1:if(t=o.sent())return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),e.updateCloudDiscoveryMetadata(t,!0),[2,y.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),(n=this.getCloudDiscoveryMetadataFromHarcodedValues())&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(n,!1),[2,y.HARDCODED_VALUES];
1throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),e9.createUntrustedAuthorityError()}})})},e.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var t=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=e.getCloudDiscoveryMetadataFromNetworkResponse(t.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),e9.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),e.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},e.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return et(this,void 0,void 0,function(){var t,r,n,o,i,a,s,c;return er(this,function(l){switch(l.label){case 0:t=""+eo.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",r={},this.proxyUrl&&(r.proxyUrl=this.proxyUrl),n=null,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(t,r)];case 2:var u,d;if(o=l.sent(),i=void 0,a=void 0,(u=o.body).hasOwnProperty("tenant_discovery_endpoint")&&u.hasOwnProperty("metadata"))a=(i=o.body).metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+i.tenant_discovery_endpoint);else{if(!((d=o.body).hasOwnProperty("error")&&d.hasOwnProperty("error_description")))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+o.status),(i=o.body).error===eo.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+i.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+i.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),n=e.getCloudDiscoveryMetadataFromNetworkResponse(a,this.hostnameAndPort),[3,4];case 3:return(s=l.sent())instanceof eg?this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\nError: "+s.errorCode+"\nError Description: "+s.errorMessage):(c=s,this.logger.error("A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: "+c.name+"\nError Description: "+c.message)),[2,null];case 4:return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),n=e.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,n]}})})},e.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in tG?tG[this.canonicalAuthority]:null},e.prototype.isInKnownAuthorities=function(){var e=this;return this.authorityOptions.knownAuthorities.filter(function(t){return tf.getDomainFromUrl(t).toLowerCase()===e.hostnameAndPort}).length>0},e.generateAuthority=function(e,t){var r;if(t&&t.azureCloudInstance!==j.None){var n=t.tenant?t.tenant:eo.DEFAULT_COMMON_TENANT;r=t.azureCloudInstance+"/"+n+"/"}return r||e},e.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},e.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.aliases.indexOf(t)>-1)return n}return null},e.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw eD.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},e.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},e.isPublicCloudAuthority=function(e){return eo.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},e.buildRegionalAuthorityString=function(e,t,r){var n=new tf(e);n.validateAsUri();var o=n.getUrlComponents(),i=t+"."+o.HostNameAndPort;this.isPublicCloudAuthority(o.HostNameAndPort)&&(i=t+"."+eo.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var a=tf.constructAuthorityUriFromObject(ee(ee({},n.getUrlComponents()),{HostNameAndPort:i})).urlString;return r?a+"?"+r:a},e.replaceWithRegionalInformation=function(t,r){return t.authorization_endpoint=e.buildRegionalAuthorityString(t.authorization_endpoint,r),t.token_endpoint=e.buildRegionalAuthorityString(t.token_endpoint,r,eo.REGIONAL_AUTH_NON_MSI_QUERY_STRING),t.end_session_endpoint&&(t.end_session_endpoint=e.buildRegionalAuthorityString(t.end_session_endpoint,r)),t},e}(),tW=function(){function e(){}return e.createDiscoveredInstance=function(t,r,n,o,i,a){return et(this,void 0,void 0,function(){var s,c;return er(this,function(l){switch(l.label){case 0:s=e.createInstance(t,r,n,o,i,a),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,s.resolveEndpointsAsync()];case 2:return l.sent(),[2,s];case 3:throw c=l.sent(),eD.createEndpointDiscoveryIncompleteError(c);case 4:return[2]}})})},e.createInstance=function(e,t,r,n,o,i){if(eL.isEmpty(e))throw e9.createUrlEmptyError();return new tV(e,t,r,n,o,i)},e}(),tJ=function(){function e(e,t){this.cacheOutcome=_.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||eo.EMPTY_STRING,this.wrapperVer=e.wrapperVer||eo.EMPTY_STRING,this.telemetryCacheKey=ed.CACHE_KEY+f.CACHE_KEY_SEPARATOR+e.clientId}return e.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+ed.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(ed.VALUE_SEPARATOR),r=[e,this.getRegionDiscoveryFields()].join(ed.VALUE_SEPARATOR);return[ed.SCHEMA_VERSION,r,t].join(ed.CATEGORY_SEPARATOR)},e.prototype.generateLastRequestHeaderValue=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t),n=t.failedRequests.slice(0,2*r).join(ed.VALUE_SEPARATOR),o=t.errors.slice(0,r).join(ed.VALUE_SEPARATOR),i=t.errors.length,a=r<i?ed.OVERFLOW_TRUE:ed.OVERFLOW_FALSE,s=[i,a].join(ed.VALUE_SEPARATOR);
1return[ed.SCHEMA_VERSION,t.cacheHits,n,o,s].join(ed.CATEGORY_SEPARATOR)},e.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=ed.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),eL.isEmpty(e.subError)?eL.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(ed.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},e.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},e.prototype.getLastRequests=function(){var e=new tl;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},e.prototype.clearTelemetryCache=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t);if(r===t.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{var n=new tl;n.failedRequests=t.failedRequests.slice(2*r),n.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n)}},e.maxErrorsToSend=function(e){var t,r=0,n=0,o=e.errors.length;for(t=0;t<o;t++){var i=e.failedRequests[2*t]||eo.EMPTY_STRING,a=e.failedRequests[2*t+1]||eo.EMPTY_STRING,s=e.errors[t]||eo.EMPTY_STRING;if((n+=i.toString().length+a.toString().length+s.length+3)<ed.MAX_LAST_HEADER_BYTES)r+=1;else break}return r},e.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||eo.EMPTY_STRING),e.push(this.regionSource||eo.EMPTY_STRING),e.push(this.regionOutcome||eo.EMPTY_STRING),e.join(",")},e.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},e.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},e}(),t$=function(){function e(e,t,r,n,o,i,a,s,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=i,this.nativeMessageHandler=s,this.correlationId=c||this.browserCrypto.createNewGuid(),this.logger=n.clone(eE.MSAL_SKU,tP,this.correlationId),this.performanceClient=a}return e.prototype.clearCacheOnLogout=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){switch(t.label){case 0:if(!e)return[3,5];e6.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(e6.generateAccountCacheKey(e))];case 2:return t.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return t.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return t.trys.push([5,8,,9]),this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),[4,this.browserStorage.clear()];case 6:return t.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return t.sent(),[3,9];case 8:return t.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}})})},e.prototype.initializeBaseRequest=function(e){return J(this,void 0,void 0,function(){var t,r,n,o;return $(this,function(i){switch(i.label){case 0:if(this.logger.verbose("Initializing BaseAuthRequest"),t=e.authority||this.config.auth.authority,r=Q(e&&e.scopes||[]),(n=V(V({},e),{correlationId:this.correlationId,authority:t,scopes:r})).authenticationScheme){if(n.authenticationScheme===b.SSH){if(!e.sshJwk)throw e9.createMissingSshJwkError();if(!e.sshKid)throw e9.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+n.authenticationScheme+'" as configured in Auth request')}else n.authenticationScheme=b.BEARER,this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');if(!(e.claims&&!eL.isEmpty(e.claims)))return[3,2];return o=n,[4,this.browserCrypto.hashString(e.claims)];case 1:o.requestedClaimsHash=i.sent(),i.label=2;case 2:return[2,n]}})})},e.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var t=e||this.config.auth.redirectUri||tA.getCurrentUri();return tf.getAbsoluteUrl(t,tA.getCurrentUri())},e.prototype.initializeServerTelemetryManager=function(e,t){return this.logger.verbose("initializeServerTelemetryManager called"),new tJ({clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]},this.browserStorage)},e.prototype.getDiscoveredAuthority=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){switch(r.label){case 0:if(this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},!e)return[3,2];return this.logger.verbose("Creating discovered authority with request authority"),[4,tW.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t,this.logger)];case 1:case 3:return[2,r.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,tW.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger)]}})})},e}(),tQ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.initializeAuthorizationCodeRequest=function(e){return J(this,void 0,void 0,function(){var t,r;return $(this,function(n){switch(n.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",e.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return t=n.sent(),r=V(V({},e),{redirectUri:e.redirectUri,code:eo.EMPTY_STRING,codeVerifier:t.verifier}),e.codeChallenge=t.challenge,e.codeChallengeMethod=eo.S256_CODE_CHALLENGE_METHOD,[2,r]}})})},t.prototype.initializeLogoutRequest=function(e){this.logger.verbose("initializeLogoutRequest called",null==e?void 0:e.correlationId);var t=V({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},e);if(e){if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){var r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set")}else this.logger.verbose("logoutHint will not be set since no logout request was configured");return e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=tf.getAbsoluteUrl(e.postLogoutRedirectUri,tA.getCurrentUri())
1):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=tf.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,tA.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=tf.getAbsoluteUrl(tA.getCurrentUri(),tA.getCurrentUri())),t},t.prototype.getLogoutHintFromIdTokenClaims=function(e){var t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},t.prototype.createAuthCodeClient=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t,r)];case 1:return[2,new tz(n.sent())]}})})},t.prototype.getClientConfiguration=function(e,t,r){return J(this,void 0,void 0,function(){var n,o;return $(this,function(i){switch(i.label){case 0:return this.logger.verbose("getClientConfiguration called",this.correlationId),[4,this.getDiscoveredAuthority(t,r)];case 1:return n=i.sent(),o=this.config.system.loggerOptions,[2,{authOptions:{clientId:this.config.auth.clientId,authority:n,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:o.loggerCallback,piiLoggingEnabled:o.piiLoggingEnabled,logLevel:o.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:e,libraryInfo:{sku:eE.MSAL_SKU,version:tP,cpu:eo.EMPTY_STRING,os:eo.EMPTY_STRING},telemetry:this.config.telemetry}]}})})},t.prototype.validateAndExtractStateFromHash=function(e,t,r){if(this.logger.verbose("validateAndExtractStateFromHash called",r),!e.state)throw eq.createHashDoesNotContainStateError();var n=tg.extractBrowserRequestState(this.browserCrypto,e.state);if(!n)throw eq.createUnableToParseStateError();if(n.interactionType!==t)throw eq.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",r),e.state},t.prototype.getDiscoveredAuthority=function(e,t){var r;return J(this,void 0,void 0,function(){var o,i,a,s;return $(this,function(c){switch(c.label){case 0:return this.logger.verbose("getDiscoveredAuthority called",this.correlationId),o=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(n.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),i={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e||this.config.auth.authority,s=tV.generateAuthority(a,t||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),[4,tW.createDiscoveredInstance(s,this.config.system.networkClient,this.browserStorage,i,this.logger).then(function(e){return o.endMeasurement({success:!0}),e}).catch(function(e){throw o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})];case 1:return[2,c.sent()]}})})},t.prototype.initializeAuthorizationRequest=function(e,t){return J(this,void 0,void 0,function(){var r,n,o,i,a,s,c;return $(this,function(l){switch(l.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),r=this.getRedirectUri(e.redirectUri),n={interactionType:t},o=tp.setRequestState(this.browserCrypto,e&&e.state||eo.EMPTY_STRING,n),a=[{}
1],[4,this.initializeBaseRequest(e)];case 1:return i=V.apply(void 0,[V.apply(void 0,a.concat([l.sent()])),{redirectUri:r,state:o,nonce:e.nonce||this.browserCrypto.createNewGuid(),responseMode:d.FRAGMENT}]),(s=e.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+s.homeAccountId,this.correlationId),i.account=s),eL.isEmpty(i.loginHint)&&!s&&(c=this.browserStorage.getLegacyLoginHint())&&(i.loginHint=c),[2,i]}})})},t}(t$);!function(e){e.USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",e.USER_CANCEL="USER_CANCEL",e.NO_NETWORK="NO_NETWORK",e.TRANSIENT_ERROR="TRANSIENT_ERROR",e.PERSISTENT_ERROR="PERSISTENT_ERROR",e.DISABLED="DISABLED",e.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE"}(K||(K={}));var tX={extensionError:{code:"ContentError"},userSwitch:{code:"user_switch",desc:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."},tokensNotFoundInCache:{code:"tokens_not_found_in_internal_memory_cache",desc:"Tokens not cached in MSAL JS internal memory, please make the WAM request"}},tZ=function(e){function t(r,n,o){var i=e.call(this,r,n)||this;return Object.setPrototypeOf(i,t.prototype),i.name="NativeAuthError",i.ext=o,i}return Y(t,e),t.prototype.isFatal=function(){return!!this.ext&&!!this.ext.status&&(this.ext.status===K.PERSISTENT_ERROR||this.ext.status===K.DISABLED)||this.errorCode===tX.extensionError.code},t.createError=function(e,r,n){if(n&&n.status)switch(n.status){case K.ACCOUNT_UNAVAILABLE:return ew.createNativeAccountUnavailableError();case K.USER_INTERACTION_REQUIRED:return new ew(e,r);case K.USER_CANCEL:return eq.createUserCancelledError();case K.NO_NETWORK:return eq.createNoNetworkConnectivityError()}return new t(e,r,n)},t.createUserSwitchError=function(){return new t(tX.userSwitch.code,tX.userSwitch.desc)},t.createTokensNotFoundInCacheError=function(){return new t(tX.tokensNotFoundInCache.code,tX.tokensNotFoundInCache.desc)},t}(eg),t0=function(e){function t(t,r){return e.call(this,t,r)||this}return Z(t,e),t.prototype.acquireToken=function(e){var t,r,o,a;return et(this,void 0,void 0,function(){var s,c,l,u,d,p,h=this;return er(this,function(f){switch(f.label){case 0:return s=null===(t=this.performanceClient)||void 0===t?void 0:t.startMeasurement(n.RefreshTokenClientAcquireToken,e.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",e.correlationId),c=ti.nowSeconds(),[4,this.executeTokenRequest(e,this.authority)];case 1:return u=null===(r=(l=f.sent()).headers)||void 0===r?void 0:r[i.X_MS_HTTP_VERSION],null==s||s.addStaticFields({refreshTokenSize:(null===(o=l.body.refresh_token)||void 0===o?void 0:o.length)||0}),u&&(null==s||s.addStaticFields({httpVerToken:u})),d=null===(a=l.headers)||void 0===a?void 0:a[i.X_MS_REQUEST_ID],(p=new tj(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(l.body),[2,p.handleServerTokenResponse(l.body,this.authority,c,e,void 0,void 0,!0,e.forceCache,d).then(function(e){return null==s||s.endMeasurement({success:!0}),e}).catch(function(t){throw h.logger.verbose("Error in fetching refresh token",e.correlationId),null==s||s.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t})]}})})},t.prototype.acquireTokenByRefreshToken=function(e){return et(this,void 0,void 0,function(){var t,r;return er(this,function(n){if(!e)throw e9.createEmptyTokenRequestError();if(!e.account)throw eD.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(e.account.environment,this.config.authOptions.clientId))try{return[2,this.acquireTokenWithCachedRefreshToken(e,!0)]}catch(e){if(t=e instanceof ew&&e.errorCode===eb.noTokensFoundError.code,r=e instanceof ev&&e.errorCode===eh.INVALID_GRANT_ERROR&&e.subError===eh.CLIENT_MISMATCH_ERROR,t||r);else throw e}return[2,this.acquireTokenWithCachedRefreshToken(e,!1)]})})},t.prototype.acquireTokenWithCachedRefreshToken=function(e,t){var r;return et(this,void 0,void 0,function(){var o,i,a;return er(this,function(s){if(o=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(n.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",e.correlationId),!(i=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,e.account,t)))throw null==o||o.discardMeasurement(),ew.createNoTokensFoundError();return null==o||o.endMeasurement({success:!0}),a=ee(ee({},e),{refreshToken:i.secret,authenticationScheme:e.authenticationScheme||b.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:H.HOME_ACCOUNT_ID}}),[2,this.acquireToken(a)]})})},t.prototype.executeTokenRequest=function(e,t){var r;return et(this,void 0,void 0,function(){var o,i,a,s,c,l;return er(this,function(u){switch(u.label){case 0:return o=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(n.RefreshTokenClientExecuteTokenRequest,e.correlationId),[4,this.createTokenRequestBody(e)];case 1:return i=u.sent(),a=this.createTokenQueryParameters(e),s=this.createTokenRequestHeaders(e.ccsCredential),c={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},l=tf.appendQueryString(t.tokenEndpoint,a),[2,this.executePostToTokenEndpoint(l,i,s,c).then(function(e){return null==o||o.endMeasurement({success:!0}),e}).catch(function(e){throw null==o||o.endMeasurement({success:!1}),e})]}})})},t.prototype.createTokenQueryParameters=function(e){var t=new tU;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},t.prototype.createTokenRequestBody=function(e){var t;return et(this,void 0,void 0,function(){var r,o,i,a,s,c;return er(this,function(l){switch(l.label){case 0:if(r=e.correlationId,o=null===(t=this.performanceClient)||void 0===t?void 0:t.startMeasurement(n.BaseClientCreateTokenRequestHeaders,r),(i=new tU).addClientId(this.config.authOptions.clientId),i.addScopes(e.scopes),i.addGrantType(p.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&i.addServerTelemetry(this.serverTelemetryManager),i.addCorrelationId(r),i.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&i.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(a=this.config.clientCredentials.clientAssertion,i.addClientAssertion(a.assertion),i.addClientAssertionType(a.assertionType)),e.authenticationScheme!==b.POP)return[3,2];return[4,new tH(this.cryptoUtils).generateCnf(e)];case 1:return s=l.sent(),i.addPopToken(s.reqCnfString),[3,3];case 2:if(e.authenticationScheme===b.SSH){if(e.sshJwk)i.addSshJwk(e.sshJwk);else throw null==o||o.endMeasurement({success:!1}),e9.createMissingSshJwkError()}l.label=3;case 3:if((!eL.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case H.HOME_ACCOUNT_ID:try{c=e5(e.ccsCredential.credential),i.addCcsOid(c)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case H.UPN:i.addCcsUpn(e.ccsCredential.credential)}return null==o||o.endMeasurement({success:!0}),[2,i.createQueryString()]}})})},t}(tD),t1=function(e){function t(t,r){return e.call(this,t,r)||this}return Z(t,e),t.prototype.acquireToken=function(e){return et(this,void 0,void 0,function(){var t;return er(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.acquireCachedToken(e)];case 1:return[2,r.sent()];case 2:if((t=r.sent())instanceof eD&&t.errorCode===eM.tokenRefreshRequired.code)return[2,new t0(this.config,this.performanceClient).acquireTokenByRefreshToken(e)];throw t;case 3:return[2]}})})},t.prototype.acquireCachedToken=function(e){var t,r,n,o;return et(this,void 0,void 0,function(){var i,a;return er(this,function(s){switch(s.label){case 0:if(!e)throw e9.createEmptyTokenRequestError();if(e.forceRefresh)throw null===(t=this.serverTelemetryManager)||void 0===t||t.setCacheOutcome(_.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),eD.createRefreshRequiredError();if(!e.account)throw eD.createNoAccountInSilentRequestError();if(i=e.authority||this.authority.getPreferredCache(),(a=this.cacheManager.readCacheRecord(e.account,this.config.authOptions.clientId,e,i)).accessToken){if(ti.wasClockTurnedBack(a.accessToken.cachedAt)||ti.isTokenExpired(a.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null===(n=this.serverTelemetryManager)||void 0===n||n.setCacheOutcome(_.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),eD.createRefreshRequiredError();if(a.accessToken.refreshOn&&ti.isTokenExpired(a.accessToken.refreshOn,0))throw null===(o=this.serverTelemetryManager)||void 0===o||o.setCacheOutcome(_.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),eD.createRefreshRequiredError()}else throw null===(r=this.serverTelemetryManager)||void 0===r||r.setCacheOutcome(_.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),eD.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(a,e)];case 1:return[2,s.sent()]}})})},t.prototype.generateResultFromCacheRecord=function(e,t){return et(this,void 0,void 0,function(){var r,n;return er(this,function(o){switch(o.label){case 0:if(e.idToken&&(r=new tt(e.idToken.secret,this.config.cryptoInterface)),t.maxAge||0===t.maxAge){if(!(n=null==r?void 0:r.claims.auth_time))throw eD.createAuthTimeNotFoundError();tt.checkMaxAge(n,t.maxAge)}return[4,tj.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)];case 1:return[2,o.sent()]}})})},t}(tD),t2=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.acquireToken=function(e){return J(this,void 0,void 0,function(){var t,r,o,i,a;return $(this,function(s){switch(s.label){case 0:return t=this.performanceClient.startMeasurement(n.SilentCacheClientAcquireToken,e.correlationId),r=this.initializeServerTelemetryManager(P.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(r,e.authority,e.azureCloudOptions)];case 1:o=s.sent(),this.logger.verbose("Silent auth client created"),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,o.acquireCachedToken(e)];case 3:return i=s.sent(),t.endMeasurement({success:!0,fromCache:!0}),[2,i];case 4:throw(a=s.sent())instanceof eq&&a.errorCode===eU.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),t.endMeasurement({errorCode:a instanceof eg&&a.errorCode||void 0,subErrorCode:a instanceof eg&&a.sub
1Error||void 0,success:!1}),a;case 5:return[2]}})})},t.prototype.logout=function(){return Promise.reject(eq.createSilentLogoutUnsupportedError())},t.prototype.createSilentFlowClient=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t,r)];case 1:return[2,new t1(n.sent(),this.performanceClient)]}})})},t.prototype.initializeSilentRequest=function(e,t){return J(this,void 0,void 0,function(){var r;return $(this,function(n){switch(n.label){case 0:return r=[V({},e)],[4,this.initializeBaseRequest(e)];case 1:return[2,V.apply(void 0,[V.apply(void 0,r.concat([n.sent()])),{account:t,forceRefresh:e.forceRefresh||!1}])]}})})},t}(tQ),t3=function(e){function t(t,r,n,o,i,a,s,c,l,u,d,p){var h=e.call(this,t,r,n,o,i,a,c,l,p)||this;return h.apiId=s,h.accountId=u,h.nativeMessageHandler=l,h.nativeStorageManager=d,h.silentCacheClient=new t2(t,h.nativeStorageManager,n,o,i,a,c,l,p),h}return Y(t,e),t.prototype.acquireToken=function(e){return J(this,void 0,void 0,function(){var t,r,o,i,a,s,c;return $(this,function(l){switch(l.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),t=this.performanceClient.startMeasurement(n.NativeInteractionClientAcquireToken,e.correlationId),r=ti.nowSeconds(),[4,this.initializeNativeRequest(e)];case 1:o=l.sent(),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,o)];case 3:return i=l.sent(),t.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,i];case 4:return l.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return a={method:I.GetToken,request:o},[4,this.nativeMessageHandler.sendMessage(a)];case 6:return s=l.sent(),c=this.validateNativeResponse(s),[2,this.handleNativeResponse(c,o,r).then(function(e){return t.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),e}).catch(function(e){throw t.endMeasurement({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e})]}})})},t.prototype.createSilentCacheRequest=function(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:te.fromString(e.scope).asArray(),account:t,forceRefresh:!1}},t.prototype.acquireTokensFromCache=function(e,t){return J(this,void 0,void 0,function(){var r,n,o;return $(this,function(i){switch(i.label){case 0:if(!(r=this.browserStorage.readAccountFromCacheWithNativeAccountId(e)))throw eD.createNoAccountFoundError();n=r.getAccountInfo(),i.label=1;case 1:return i.trys.push([1,3,,4]),o=this.createSilentCacheRequest(t,n),[4,this.silentCacheClient.acquireToken(o)];case 2:return[2,i.sent()];case 3:throw i.sent();case 4:return[2]}})})},t.prototype.acquireTokenRedirect=function(e){return J(this,void 0,void 0,function(){var t,r,n,o,i,a;return $(this,function(s){switch(s.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(e)];case 1:t=s.sent(),r={method:I.GetToken,request:t},s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(r)];case 3:return n=s.sent(),this.validateNativeResponse(n),[3,5];case 4:if((o=s.sent())instanceof tZ&&o.isFatal())throw o;return[3,5];case 5:return this.browserStorage.setTemporaryCache(x.NATIVE_REQUEST,JSON.stringify(t),!0),i={apiId:P.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri),[4,this.navigationClient.navigateExternal(a,i)];case 6:return s.sent(),[2]}})})},t.prototype.handleRedirectPromise=function(){return J(this,void 0,void 0,function(){var e,t,r,n,o,i,a,s;return $(this,function(c){switch(c.label){case 0:if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(e=this.browserStorage.getCachedNativeRequest()))return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];t=e.prompt,r=W(e,["prompt"]),t&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, remov
1ing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(x.NATIVE_REQUEST)),n={method:I.GetToken,request:r},o=ti.nowSeconds(),c.label=1;case 1:return c.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(n)];case 2:return i=c.sent(),this.validateNativeResponse(i),a=this.handleNativeResponse(i,r,o),this.browserStorage.setInteractionInProgress(!1),[2,a];case 3:throw s=c.sent(),this.browserStorage.setInteractionInProgress(!1),s;case 4:return[2]}})})},t.prototype.logout=function(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")},t.prototype.handleNativeResponse=function(e,t,r){return J(this,void 0,void 0,function(){var n,o,i,a,s,c,l,u,d,p,h,f,g,v,m,y,w,E,S=this;return $(this,function(C){switch(C.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),n=this.getMATSFromResponse(e),this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:n?n.broker_version:void 0,matsAccountJoinOnStart:n?n.account_join_on_start:void 0,matsAccountJoinOnEnd:n?n.account_join_on_end:void 0,matsDeviceJoin:n?n.device_join:void 0,matsPromptBehavior:n?n.prompt_behavior:void 0,matsApiErrorCode:n?n.api_error_code:void 0,matsUiVisible:n?n.ui_visible:void 0,matsSilentCode:n?n.silent_code:void 0,matsSilentBiSubCode:n?n.silent_bi_sub_code:void 0,matsSilentMessage:n?n.silent_message:void 0,matsSilentStatus:n?n.silent_status:void 0,matsHttpStatus:n?n.http_status:void 0,matsHttpEventCount:n?n.http_event_count:void 0},this.correlationId),e.account.id!==t.accountId)throw tZ.createUserSwitchError();return o=new tt(e.id_token||eo.EMPTY_STRING,this.browserCrypto),[4,this.getDiscoveredAuthority(t.authority)];case 1:if(a=(i=C.sent()).getPreferredCache(),s=e6.generateHomeAccountId(e.client_info||eo.EMPTY_STRING,q.Default,this.logger,this.browserCrypto,o),c=e6.createAccount(e.client_info,s,o,void 0,void 0,void 0,a,e.account.id),this.browserStorage.setAccount(c),l=e.scope?te.fromString(e.scope):te.fromString(t.scope),d=(u=e.account.properties||{}).UID||o.claims.oid||o.claims.sub||eo.EMPTY_STRING,p=u.TenantId||o.claims.tid||eo.EMPTY_STRING,f=b.BEARER,t.tokenType===b.POP)return[3,2];return[3,4];case 2:if(f=b.POP,e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),h=e.shr,[3,5];if(g=new tH(this.browserCrypto),v={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce},!t.keyId)throw eD.createKeyIdMissingError();return[4,g.signPopToken(e.access_token,t.keyId,v)];case 3:return h=C.sent(),[3,5];case 4:h=e.access_token,C.label=5;case 5:return m={authority:i.canonicalAuthority,uniqueId:d,tenantId:p,scopes:l.asArray(),account:c.getAccountInfo(),idToken:e.id_token,idTokenClaims:o.claims,accessToken:h,fromCache:!!n&&this.isResponseFromCache(n),expiresOn:new Date(1e3*Number(r+e.expires_in)),tokenType:f,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0},y=to.createIdTokenEntity(s,t.authority,e.id_token||eo.EMPTY_STRING,t.clientId,o.claims.tid||eo.EMPTY_STRING),this.nativeStorageManager.setIdTokenCredential(y),w=r+(f===b.POP?eo.SHR_NONCE_VALIDITY:("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0),E=ta.createAccessTokenEntity(s,t.authority,h,t.clientId,p,l.printScopes(),w,0,this.browserCrypto),this.nativeStorageManager.setAccessTokenCredential(E),this.browserStorage.removeAccountContext(c).catch(function(e){S.logger.error("Error occurred while removing account context from browser storage. "+e)}),[2,m]}})})},t.prototype.validateNativeResponse=function(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw tZ.createUnexpectedError("Response missing expected properties.")},t.prototype.getMATSFromResponse=function(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},t.prototype.isResponseFromCache=function(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached},t.prototype.initializeNativeRequest=function(e){return J(this,void 0,void 0,function(){var t,r,n,o,i,a,s,c,l=this;return $(this,function(u){switch(u.label){case 0:if(this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),(t=new tf(e.authority||this.config.auth.authority)).validateAsUri(),r=e.scopes,n=W(e,["scopes"]),(o=new te(r||[])).appendScopes(ei),i=function(){switch(l.apiId){case P.ssoSilent:case P.acquireTokenSilent_silentFlow:return l.logger.trace("initializeNativeRequest: silent request sets prompt to none"),es.NONE}if(!e.prompt){l.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case es.NONE:case es.CONSENT:case es.LOGIN:return l.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw l.logger.trace("initializeNativeRequest: prompt = "+e.prompt+" is not compatible with native flow"),eq.createNativePromptParameterNotSupportedError()}},a=V(V({},n),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:t.urlString,
1scope:o.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:i(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:V(V(V({},e.extraQueryParameters),e.tokenQueryParameters),{telemetry:eS.MATS_TELEMETRY}),extendedExpiryToken:!1}),e.authenticationScheme!==b.POP)return[3,2];return s={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},[4,new tH(this.browserCrypto).generateCnf(s)];case 1:c=u.sent(),a.reqCnf=c.reqCnfHash,a.keyId=c.kid,u.label=2;case 2:return[2,a]}})})},t}(t$),t4=function(){function e(e,t,r){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=r,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this)}return e.prototype.sendMessage=function(e){return J(this,void 0,void 0,function(){var t,r=this;return $(this,function(n){return this.logger.trace("NativeMessageHandler - sendMessage called."),t={channel:eS.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:e},this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: "+JSON.stringify(t)),this.messageChannel.port1.postMessage(t),[2,new Promise(function(e,n){r.resolvers.set(t.responseId,{resolve:e,reject:n})})]})})},e.createProvider=function(t,r){return J(this,void 0,void 0,function(){var n,o;return $(this,function(i){switch(i.label){case 0:t.trace("NativeMessageHandler - createProvider called."),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,(n=new e(t,r,eS.PREFERRED_EXTENSION_ID)).sendHandshakeRequest()];case 2:return i.sent(),[2,n];case 3:return i.sent(),[4,(o=new e(t,r)).sendHandshakeRequest()];case 4:return i.sent(),[2,o];case 5:return[2]}})})},e.prototype.sendHandshakeRequest=function(){return J(this,void 0,void 0,function(){var e,t=this;return $(this,function(r){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),e={channel:eS.CHANNEL_ID,extensionId:this.extensionId,responseId:this.responseId++,body:{method:I.HandshakeRequest}},this.messageChannel.port1.onmessage=function(e){t.onChannelMessage(e)},window.postMessage(e,window.origin,[this.messageChannel.port2]),[2,new Promise(function(r,n){t.handshakeResolvers.set(e.responseId,{resolve:r,reject:n}),t.timeoutId=window.setTimeout(function(){window.removeEventListener("message",t.windowListener,!1),t.messageChannel.port1.close(),t.messageChannel.port2.close(),n(eq.createNativeHandshakeTimeoutError()),t.handshakeResolvers.delete(e.responseId)},t.handshakeTimeoutMs)})]})})},e.prototype.onWindowMessage=function(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source===window){var t=e.data;if(t.channel&&t.channel===eS.CHANNEL_ID&&(!t.extensionId||t.extensionId===this.extensionId)&&t.body.method===I.HandshakeRequest){this.logger.verbose(t.extensionId?"Extension with id: "+t.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1);var r=this.handshakeResolvers.get(t.responseId);r&&r.reject(eq.createNativeExtensionNotInstalledError())}}},e.prototype.onChannelMessage=function(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var t=e.data,r=this.resolvers.get(t.responseId),n=this.handshakeResolvers.get(t.responseId);try{var o=t.body.method;if(o===I.Response){if(!r)return;var i=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(i)),"Success"!==i.status)r.reject(tZ.createError(i.code,i.description,i.ext));else if(i.result)i.result.code&&i.result.description?r.reject(tZ.createError(i.result.code,i.result.description,i.result.ext)):r.resolve(i.result);else throw eg.createUnexpectedError("Event does not contain result.");this.resolvers.delete(t.responseId)}else if(o===I.HandshakeResponse){if(!n)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),n.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(t){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+t.toString()),this.logger.errorPii("Unable to parse "+e),r?r.reject(t):n&&n.reject(t)}},e.prototype.getExtensionId=function(){return this.extensionId},e.prototype.getExtensionVersion=function(){return this.extensionVersion},e.isNativeAvailable=function(e,t,r,n){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(n)switch(n){case b.BEARER:case b.POP:t.trace("isNativeAvailable: authenticationScheme is supported, returning true");break;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},e}(),t5=function(){function e(e,t,r,n){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n}return e.prototype.handleCodeResponseFromHash=function(e,t,r,n){return J(this,void 0,void 0,function(){var o,i,a;return $(this,function(s){if(this.logger.verbose("InteractionHandler.handleCodeResponse called"),eL.isEmpty(e))throw eq.createEmptyHashError(e);
1if(o=this.browserStorage.generateStateKey(t),!(i=this.browserStorage.getTemporaryCache(o)))throw eD.createStateNotFoundError("Cached State");try{a=this.authModule.handleFragmentResponse(e,i)}catch(e){if(e instanceof ev&&e.subError===eU.userCancelledError.code)throw eq.createUserCancelledError();throw e}return[2,this.handleCodeResponseFromServer(a,t,r,n)]})})},e.prototype.handleCodeResponseFromServer=function(e,t,r,n,o){return void 0===o&&(o=!0),J(this,void 0,void 0,function(){var i,a,s,c,l,u;return $(this,function(d){switch(d.label){case 0:if(this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),i=this.browserStorage.generateStateKey(t),!(a=this.browserStorage.getTemporaryCache(i)))throw eD.createStateNotFoundError("Cached State");if(s=this.browserStorage.generateNonceKey(a),c=this.browserStorage.getTemporaryCache(s),this.authCodeRequest.code=e.code,!e.cloud_instance_host_name)return[3,2];return[4,this.updateTokenEndpointAuthority(e.cloud_instance_host_name,r,n)];case 1:d.sent(),d.label=2;case 2:return o&&(e.nonce=c||void 0),e.state=a,e.client_info?this.authCodeRequest.clientInfo=e.client_info:(l=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=l),[4,this.authModule.acquireToken(this.authCodeRequest,e)];case 3:return u=d.sent(),this.browserStorage.cleanRequestByState(t),[2,u]}})})},e.prototype.updateTokenEndpointAuthority=function(e,t,r){return J(this,void 0,void 0,function(){var n,o;return $(this,function(i){switch(i.label){case 0:return n="https://"+e+"/"+t.tenant+"/",[4,tW.createDiscoveredInstance(n,r,this.browserStorage,t.options,this.logger)];case 1:return o=i.sent(),this.authModule.updateAuthority(o),[2]}})})},e.prototype.checkCcsCredentials=function(){var e=this.browserStorage.getTemporaryCache(x.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+e)}return null},e}(),t6=function(e){function t(t,r,n,o,i,a,s,c,l,u){var d=e.call(this,t,r,n,o,i,a,s,l,u)||this;return d.unloadWindow=d.unloadWindow.bind(d),d.nativeStorage=c,d}return Y(t,e),t.prototype.acquireToken=function(e){try{var t=this.generatePopupName(e.scopes||ei,e.authority||this.config.auth.authority),r=e.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t,r);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var n=this.openSizedPopup("about:blank",t,r);return this.acquireTokenPopupAsync(e,t,r,n)}catch(e){return Promise.reject(e)}},t.prototype.logout=function(e){try{this.logger.verbose("logoutPopup called");var t=this.initializeLogoutRequest(e),r=this.generateLogoutPopupName(t),n=e&&e.authority,o=e&&e.mainWindowRedirectUri,i=(null==e?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,i,n,void 0,o);this.logger.verbose("asyncPopup set to false, opening popup");var a=this.openSizedPopup("about:blank",r,i);return this.logoutPopupAsync(t,r,i,n,a,o)}catch(e){return Promise.reject(e)}},t.prototype.acquireTokenPopupAsync=function(e,t,r,o){return J(this,void 0,void 0,function(){var i,a,s,c,l,u,d,p,h,f,g,v,m,y,b,w,E=this;return $(this,function(S){switch(S.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),i=this.initializeServerTelemetryManager(P.acquireTokenPopup),[4,this.initializeAuthorizationRequest(e,O.Popup)];case 1:a=S.sent(),this.browserStorage.updateCacheEntries(a.state,a.nonce,a.authority,a.loginHint||eo.EMPTY_STRING,a.account||null),S.label=2;case 2:return S.trys.push([2,8,,9]),[4,this.initializeAuthorizationCodeRequest(a)];case 3:return s=S.sent(),[4,this.createAuthCodeClient(i,a.authority,a.azureCloudOptions)];case 4:return c=S.sent(),this.logger.verbose("Auth code client created"),l=t4.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme),u=void 0,l&&(u=this.performanceClient.startMeasurement(n.FetchAccountIdWithNativeBroker,e.correlationId)),[4,c.getAuthCodeUrl(V(V({},a),{nativeBroker:l}))];case 5:return d=S.sent(),p=new t5(c,this.browserStorage,s,this.logger),h={popup:o,popupName:t,popupWindowAttributes:r},f=this.initiateAuthRequest(d,h),this.eventHandler.emitEvent(z.POPUP_OPENED,O.Popup,{popupWindow:f},null),[4,this.monitorPopupForHash(f)];case 6:if(g=S.sent(),v=tf.getDeserializedHash(g),m=this.validateAndExtractStateFromHash(v,O.Popup,a.correlationId),tN.removeThrottle(this.browserStorage,this.config.auth.clientId,s),v.accountId){if
1(this.logger.verbose("Account id found in hash, calling WAM for token"),u&&u.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw eq.createNativeConnectionNotEstablishedError();return y=new t3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,P.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,v.accountId,this.nativeStorage,a.correlationId),b=tp.parseRequestState(this.browserCrypto,m).userRequestState,[2,y.acquireToken(V(V({},a),{state:b,prompt:void 0})).finally(function(){E.browserStorage.cleanRequestByState(m)})]}return[4,p.handleCodeResponseFromHash(g,m,c.authority,this.networkClient)];case 7:return[2,S.sent()];case 8:throw w=S.sent(),o&&o.close(),w instanceof eg&&w.setCorrelationId(this.correlationId),i.cacheFailedRequest(w),this.browserStorage.cleanRequestByState(a.state),w;case 9:return[2]}})})},t.prototype.logoutPopupAsync=function(e,t,r,n,o,i){return J(this,void 0,void 0,function(){var a,s,c,l,u,d,p;return $(this,function(h){switch(h.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(z.LOGOUT_START,O.Popup,e),a=this.initializeServerTelemetryManager(P.logoutPopup),h.label=1;case 1:return h.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(e.account)];case 2:return h.sent(),[4,this.createAuthCodeClient(a,n)];case 3:return s=h.sent(),this.logger.verbose("Auth code client created"),c=s.getLogoutUri(e),this.eventHandler.emitEvent(z.LOGOUT_SUCCESS,O.Popup,e),l=this.openPopup(c,{popupName:t,popupWindowAttributes:r,popup:o}),this.eventHandler.emitEvent(z.POPUP_OPENED,O.Popup,{popupWindow:l},null),[4,this.waitForLogoutPopup(l)];case 4:return h.sent(),i?(u={apiId:P.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=tf.getAbsoluteUrl(i,tA.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+d),this.navigationClient.navigateInternal(d,u)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw p=h.sent(),o&&o.close(),p instanceof eg&&p.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(z.LOGOUT_FAILURE,O.Popup,null,p),this.eventHandler.emitEvent(z.LOGOUT_END,O.Popup),a.cacheFailedRequest(p),p;case 6:return this.eventHandler.emitEvent(z.LOGOUT_END,O.Popup),[2]}})})},t.prototype.initiateAuthRequest=function(e,t){if(!eL.isEmpty(e))return this.logger.infoPii("Navigate to: "+e),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),eq.createEmptyNavigationUriError()},t.prototype.monitorPopupForHash=function(e){var t=this;return new Promise(function(r,n){var o=t.config.system.windowHashTimeout/t.config.system.pollIntervalMilliseconds,i=0;t.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var a=setInterval(function(){if(e.closed){t.logger.error("PopupHandler.monitorPopupForHash - window closed"),t.cleanPopup(),clearInterval(a),n(eq.createUserCancelledError());return}var s=eo.EMPTY_STRING,c=eo.EMPTY_STRING;try{s=e.location.href,c=e.location.hash}catch(e){}!eL.isEmpty(s)&&"about:blank"!==s&&(t.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),i++,c?(t.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(a),t.cleanPopup(e),tf.hashContainsKnownProperties(c)?(t.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),r(c)):(t.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),t.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+c),n(eq.createHashDoesNotContainKnownPropertiesError()))):i>o&&(t.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(a),n(eq.createMonitorPopupTimeoutError())))},t.config.system.pollIntervalMilliseconds)})},t.prototype.waitForLogoutPopup=function(e){var t=this;return new Promise(function(r){t.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var n=setInterval(function(){e.closed&&(t.logger.error("PopupHandler.waitForLogoutPopup - window closed"),t.cleanPopup(),clearInterval(n),r()
1);var o=eo.EMPTY_STRING;try{o=e.location.href}catch(e){}eL.isEmpty(o)||"about:blank"===o||(t.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(n),t.cleanPopup(e),r())},t.config.system.pollIntervalMilliseconds)})},t.prototype.openPopup=function(e,t){try{var r=void 0;if(t.popup?(r=t.popup,this.logger.verbosePii("Navigating popup window to: "+e),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii("Opening popup window to: "+e),r=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!r)throw eq.createEmptyWindowCreatedError();return r.focus&&r.focus(),this.currentWindow=r,window.addEventListener("beforeunload",this.unloadWindow),r}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),eq.createPopupWindowError(e.toString())}},t.prototype.openSizedPopup=function(e,t,r){var n,o,i,a,s=window.screenLeft?window.screenLeft:window.screenX,c=window.screenTop?window.screenTop:window.screenY,l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,d=null===(n=r.popupSize)||void 0===n?void 0:n.width,p=null===(o=r.popupSize)||void 0===o?void 0:o.height,h=null===(i=r.popupPosition)||void 0===i?void 0:i.top,f=null===(a=r.popupPosition)||void 0===a?void 0:a.left;return(!d||d<0||d>l)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),d=eE.POPUP_WIDTH),(!p||p<0||p>u)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),p=eE.POPUP_HEIGHT),(!h||h<0||h>u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),h=Math.max(0,u/2-eE.POPUP_HEIGHT/2+c)),(!f||f<0||f>l)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),f=Math.max(0,l/2-eE.POPUP_WIDTH/2+s)),window.open(e,t,"width="+d+", height="+p+", top="+h+", left="+f+", scrollbars=yes")},t.prototype.unloadWindow=function(e){this.browserStorage.cleanRequestByInteractionType(O.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()},t.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},t.prototype.generatePopupName=function(e,t){return eE.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+e.join("-")+"."+t+"."+this.correlationId},t.prototype.generateLogoutPopupName=function(e){var t=e.account&&e.account.homeAccountId;return eE.POPUP_NAME_PREFIX+"."+this.config.auth.clientId+"."+t+"."+this.correlationId},t}(tQ),t8=function(e){function t(t,r,n,o,i){var a=e.call(this,t,r,n,o)||this;return a.browserCrypto=i,a}return Y(t,e),t.prototype.initiateAuthRequest=function(e,t){return J(this,void 0,void 0,function(){var r;return $(this,function(n){switch(n.label){case 0:if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),eL.isEmpty(e))return[3,7];if(t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(x.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(x.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+e),r={apiId:P.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1},"function"!=typeof t.onRedirectNavigate)return[3,4];if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!(!1!==t.onRedirectNavigate(e)))return[3,2];return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,t.navigationClient.navigateExternal(e,r)];case 1:case 5:return n.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,t.navigationClient.navigateExternal(e,r)];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),eq.createEmptyNavigationUriError();case 8:return[2]}})})},t.prototype.handleCodeResponseFromHash=function(e,t,r,n){return J(this,void 0,void 0,function(){var o,i,a,s,c,l,u;return $(this,function(d){switch(d.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),eL.isEmpty(e))throw eq.createEmptyHashError(e);
1if(this.browserStorage.setInteractionInProgress(!1),o=this.browserStorage.generateStateKey(t),!(i=this.browserStorage.getTemporaryCache(o)))throw eD.createStateNotFoundError("Cached State");try{a=this.authModule.handleFragmentResponse(e,i)}catch(e){if(e instanceof ev&&e.subError===eU.userCancelledError.code)throw eq.createUserCancelledError();throw e}if(s=this.browserStorage.generateNonceKey(i),c=this.browserStorage.getTemporaryCache(s),this.authCodeRequest.code=a.code,!a.cloud_instance_host_name)return[3,2];return[4,this.updateTokenEndpointAuthority(a.cloud_instance_host_name,r,n)];case 1:d.sent(),d.label=2;case 2:return a.nonce=c||void 0,a.state=i,a.client_info?this.authCodeRequest.clientInfo=a.client_info:(l=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=l),[4,this.authModule.acquireToken(this.authCodeRequest,a)];case 3:return u=d.sent(),this.browserStorage.cleanRequestByState(t),[2,u]}})})},t}(t5),t7=function(e){function t(t,r,n,o,i,a,s,c,l,u){var d=e.call(this,t,r,n,o,i,a,s,l,u)||this;return d.nativeStorage=c,d}return Y(t,e),t.prototype.acquireToken=function(e){return J(this,void 0,void 0,function(){var t,r,n,o,i,a,s,c,l,u=this;return $(this,function(d){switch(d.label){case 0:return[4,this.initializeAuthorizationRequest(e,O.Redirect)];case 1:t=d.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||eo.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(P.acquireTokenRedirect),n=function(e){e.persisted&&(u.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),u.browserStorage.cleanRequestByState(t.state))},d.label=2;case 2:return d.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(t)];case 3:return o=d.sent(),[4,this.createAuthCodeClient(r,t.authority,t.azureCloudOptions)];case 4:return i=d.sent(),this.logger.verbose("Auth code client created"),a=new t8(i,this.browserStorage,o,this.logger,this.browserCrypto),[4,i.getAuthCodeUrl(V(V({},t),{nativeBroker:t4.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}))];case 5:return s=d.sent(),c=this.getRedirectStartPage(e.redirectStartPage),this.logger.verbosePii("Redirect start page: "+c),window.addEventListener("pageshow",n),[4,a.initiateAuthRequest(s,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:c,onRedirectNavigate:e.onRedirectNavigate})];case 6:return[2,d.sent()];case 7:throw(l=d.sent())instanceof eg&&l.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",n),r.cacheFailedRequest(l),this.browserStorage.cleanRequestByState(t.state),l;case 8:return[2]}})})},t.prototype.handleRedirectPromise=function(e){return J(this,void 0,void 0,function(){var t,r,n,o,i,a,s,c,l,u;return $(this,function(d){switch(d.label){case 0:t=this.initializeServerTelemetryManager(P.handleRedirectPromise),d.label=1;case 1:if(d.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(r=this.getRedirectResponseHash(e||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(O.Redirect),[2,null];n=void 0;try{o=tf.getDeserializedHash(r),n=this.validateAndExtractStateFromHash(o,O.Redirect),this.logger.verbose("State extracted from hash")}catch(e){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+e),this.browserStorage.cleanRequestByInteractionType(O.Redirect),[2,null]}if(i=this.browserStorage.getTemporaryCache(x.ORIGIN_URI,!0)||eo.EMPTY_STRING,!(tf.removeHashFromUrl(i)===tf.removeHashFromUrl(window.location.href)&&this.config.auth.navigateToLoginRequestUrl))return[3,3];return this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(r,n,t)];case 2:return a=d.sent(),i.indexOf("#")>-1&&tA.replaceHash(i),[2,a];case 3:if(this.config.auth.navigateToLoginRequestUrl)return[3,4];return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(r,n,t)];case 4:if(!(!tA.isInIframe()||this.config.system.allowRedirectInIframe))return[3,9];if(this.browserStorage.setTemporaryCache(x.URL_HASH,r,!0),s={apiId:P.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},c=!0,!(!i||"null"===i))return[3,6];return l=tA.getHomepage(),this.browserStorage.setTemporaryCache(x.ORIGIN_URI,l,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(l,s)];case 5:return c=d.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+i),[4,this.navigationClient.navigateInternal(i,s)];case 7:c=d.sent(),d.label=8;case 8:if(!c)return[2,this.handleHash(r,n,t)];d.label=9;case 9:return[2,null];case 10:throw(u=d.sent())instanceof eg&&u.setCorrelationId(this.correlationId),t.cacheFailedRequest(u),this.browserStorage.cleanRequestByInteractionType(O.Redirect),u;case 11:return[2]}})})},t.prototype.getRedirectResponseHash=function(e){if(this.logger.verbose("getRedirectResponseHash called"),tf.hashContainsKnownProperties(e))return tA.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;var t=this.browserStorage.getTemporaryCache(x.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(x.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning c
1ached hash"),t},t.prototype.handleHash=function(e,t,r){return J(this,void 0,void 0,function(){var n,o,i,a,s,c,l=this;return $(this,function(u){switch(u.label){case 0:if(n=this.browserStorage.getCachedRequest(t,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),(o=tf.getDeserializedHash(e)).accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw eq.createNativeConnectionNotEstablishedError();return i=new t3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,P.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,o.accountId,this.browserStorage,n.correlationId),a=tp.parseRequestState(this.browserCrypto,t).userRequestState,[2,i.acquireToken(V(V({},n),{state:a,prompt:void 0})).finally(function(){l.browserStorage.cleanRequestByState(t)})]}if(!(s=this.browserStorage.getCachedAuthority(t)))throw eq.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(r,s)];case 1:return c=u.sent(),this.logger.verbose("Auth code client created"),tN.removeThrottle(this.browserStorage,this.config.auth.clientId,n),[4,new t8(c,this.browserStorage,n,this.logger,this.browserCrypto).handleCodeResponseFromHash(e,t,c.authority,this.networkClient)];case 2:return[2,u.sent()]}})})},t.prototype.logout=function(e){return J(this,void 0,void 0,function(){var t,r,n,o,i,a;return $(this,function(s){switch(s.label){case 0:this.logger.verbose("logoutRedirect called"),t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(P.logout),s.label=1;case 1:return s.trys.push([1,10,,11]),this.eventHandler.emitEvent(z.LOGOUT_START,O.Redirect,e),[4,this.clearCacheOnLogout(t.account)];case 2:return s.sent(),n={apiId:P.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(r,e&&e.authority)];case 3:if(o=s.sent(),this.logger.verbose("Auth code client created"),i=o.getLogoutUri(t),this.eventHandler.emitEvent(z.LOGOUT_SUCCESS,O.Redirect,t),!(e&&"function"==typeof e.onRedirectNavigate))return[3,7];if(!(!1!==e.onRedirectNavigate(i)))return[3,5];return this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(i,n)];case 4:return s.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),s.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(i,n)];case 8:return s.sent(),[2];case 9:return[3,11];case 10:throw(a=s.sent())instanceof eg&&a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a),this.eventHandler.emitEvent(z.LOGOUT_FAILURE,O.Redirect,null,a),this.eventHandler.emitEvent(z.LOGOUT_END,O.Redirect),a;case 11:return this.eventHandler.emitEvent(z.LOGOUT_END,O.Redirect),[2]}})})},t.prototype.getRedirectStartPage=function(e){var t=e||window.location.href;return tf.getAbsoluteUrl(t,tA.getCurrentUri())},t}(tQ),t9=function(e){function t(t,r,n,o,i){var a=e.call(this,t,r,n,o)||this;return a.navigateFrameWait=i.navigateFrameWait,a.pollIntervalMilliseconds=i.pollIntervalMilliseconds,a}return Y(t,e),t.prototype.initiateAuthRequest=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){switch(r.label){case 0:if(eL.isEmpty(e))throw this.logger.info("Navigate url is empty"),eq.createEmptyNavigationUriError();if(!this.navigateFrameWait)return[3,2];return[4,this.loadFrame(e)];case 1:return t=r.sent(),[3,3];case 2:t=this.loadFrameSync(e),r.label=3;case 3:return[2,t]}})})},t.prototype.monitorIframeForHash=function(e,t){var r=this;return new Promise(function(n,o){t<6e3&&r.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+t+"ms) than the default (6000ms). This may result in timeouts.");var i=window.performance.now()+t,a=setInterval(function(){if(window.performance.now()>i){r.removeHiddenIframe(e),clearInterval(a),o(eq.createMonitorIframeTimeoutError());return}var t=eo.EMPTY_STRING,s=e.contentWindow;try{t=s?s.location.href:eo.EMPTY_STRING}catch(e){}if(!eL.isEmpty(t)){var c=s?s.location.hash:eo.EMPTY_STRING;if(tf.hashContainsKnownProperties(c)){r.removeHiddenIframe(e),clearInterval(a),n(c);return}}},r.pollIntervalMilliseconds)})},t.prototype.loadFrame=function(e){var t=this;return new Promise(function(r,n){var o=t.createHiddenIframe();setTimeout(function(){if(!o){n("Unable to load iframe");return}o.src=e,r(o)},t.navigateFrameWait)})},t.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},t.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},t.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},t}(t5),re=function(e){function t(t,r,n,o,i,a,s,c,l,u,d){var p=e.call(this,t,r,n,o,i,a,c,u,d)||this;return p.apiId=s,p.nativeStorage=l,p}return Y(t,e),t.prototype.acquireToken=function(e){return J(this,void 0,void 0,function(){var t,r,o,i,a;return $(this,function(s){switch(s.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),t=this.performanceClient.startMeasurement(n.SilentIframeClientAcquireToken,e.correlationId),eL.isEmpty(e.loginHint)&&eL.isEmpty(e.sid)&&(!e.account||eL.isEmpty(e.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),e.prompt&&e.prompt!==es.NONE&&e.prompt!==es.NO_SESSION)throw t.endMeasurement({success:!1}),eq.createSilentPromptValueError(e.prompt);return[4,this.initializeAuthorizationRequest(V(V({},e),{prompt:e.prompt||es.NONE}),O.Silent)];case 1:r=s.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||eo.EMPTY_STRING,r.account||null),o=this.initializeServerTelemetryManager(this.apiId),s.label=2;case 2:return s.trys.push([2,5,,6]),[4,this.createAuthCodeClient(o,r.authority,r.azureCloudOptions)];case 3:return i=s.sent(),this.logger.verbose("Auth code client created"),[4,this.silentTokenHelper(i,r).then(function(e){return t.endMeasurement({success:!0,fromCache:!1,requestId:e.requestId}),e})];case 4:return[2,s.sent()];case 5:throw(a=s.sent())instanceof eg&&a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(r.state),t.endMeasurement({errorCode:a instanceof eg&&a.errorCode||void 0,subErrorCode:a instanceof eg&&a.sub
1Error||void 0,success:!1}),a;case 6:return[2]}})})},t.prototype.logout=function(){return Promise.reject(eq.createSilentLogoutUnsupportedError())},t.prototype.silentTokenHelper=function(e,t){return J(this,void 0,void 0,function(){var r,n,o,i,a,s,c,l,u,d=this;return $(this,function(p){switch(p.label){case 0:return[4,this.initializeAuthorizationCodeRequest(t)];case 1:return r=p.sent(),[4,e.getAuthCodeUrl(V(V({},t),{nativeBroker:t4.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}))];case 2:return n=p.sent(),[4,(o=new t9(e,this.browserStorage,r,this.logger,this.config.system)).initiateAuthRequest(n)];case 3:return i=p.sent(),[4,o.monitorIframeForHash(i,this.config.system.iframeHashTimeout)];case 4:if(a=p.sent(),s=tf.getDeserializedHash(a),c=this.validateAndExtractStateFromHash(s,O.Silent,r.correlationId),s.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw eq.createNativeConnectionNotEstablishedError();return l=new t3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,s.accountId,this.browserStorage,this.correlationId),u=tp.parseRequestState(this.browserCrypto,c).userRequestState,[2,l.acquireToken(V(V({},t),{state:u,prompt:t.prompt||es.NONE})).finally(function(){d.browserStorage.cleanRequestByState(c)})]}return[2,o.handleCodeResponseFromHash(a,c,e.authority,this.networkClient)]}})})},t}(tQ),rt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Y(t,e),t.prototype.acquireToken=function(e){return J(this,void 0,void 0,function(){var t,r,o,i,a,s=this;return $(this,function(c){switch(c.label){case 0:return r=[V({},e)],[4,this.initializeBaseRequest(e)];case 1:return t=V.apply(void 0,r.concat([c.sent()])),o=this.performanceClient.startMeasurement(n.SilentRefreshClientAcquireToken,t.correlationId),i=this.initializeServerTelemetryManager(P.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(i,t.authority,t.azureCloudOptions)];case 2:return a=c.sent(),this.logger.verbose("Refresh token client created"),[2,a.acquireTokenByRefreshToken(t).then(function(e){return o.endMeasurement({success:!0,fromCache:e.fromCache,requestId:e.requestId}),e}).catch(function(e){throw e instanceof eg&&e.setCorrelationId(s.correlationId),i.cacheFailedRequest(e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},t.prototype.logout=function(){return Promise.reject(eq.createSilentLogoutUnsupportedError())},t.prototype.createRefreshTokenClient=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t,r)];case 1:return[2,new t0(n.sent(),this.performanceClient)]}})})},t}(tQ),rr=function(){function e(e,t,r,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=n}return e.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw eq.createUnableToLoadTokenError("Please ensure server response includes id token.");var n,o,i=new tt(t.id_token,this.cryptoObj);if(e.account){var a=this.loadAccount(i,e.account.environment,void 0,void 0,e.account.homeAccountId);n=new tq(a,this.loadIdToken(i,a.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,a.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadRefreshToken(e,t,a.homeAccountId,e.account.environment))}else if(e.authority){var s=tV.generateAuthority(e.authority,e.azureCloudOptions),c={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};if(o=new tV(s,this.config.system.networkClient,this.storage,c,this.logger),r.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");var a=this.loadAccount(i,o.hostnameAndPort,r.clientInfo,o.authorityType);n=new tq(a,this.loadIdToken(i,a.homeAccountId,o.hostnameAndPort,o.tenant),this.loadAccessToken(e,t,a.homeAccountId,o.hostnameAndPort,o.tenant,r),this.loadRefreshToken(e,t,a.homeAccountId,o.hostnameAndPort))}else if(t.client_info){this.logger.trace("TokenCache - homeAccountId from response");var a=this.loadAccount(i,o.hostnameAndPort,t.client_info,o.authorityType);n=new tq(a,this.loadIdToken(i,a.homeAccountId,o.hostnameAndPort,o.tenant),this.loadAccessToken(e,t,a.homeAccountId,o.hostnameAndPort,o.tenant,r),this.loadRefreshToken(e,t,a.homeAccountId,o.hostnameAndPort))}else throw eq.createUnableToLoadTokenError("Please provide clientInfo in the response or options.")}else throw eq.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");return this.generateAuthenticationResult(e,i,n,o)},e.prototype.loadAccount=function(e,t,r,n,o){if(o?i=o:void 0!==n&&r&&(i=e6.generateHomeAccountId(r,n,this.logger,this.cryptoObj,e)),!i)throw eq.createUnableToLoadTokenError("Unexpected missing homeAccountId");var i,a=r?e6.createAccount(r,i,e,void 0,void 0,void 0,t):e6.createGenericAccount(i,e,void 0,void 0,void 0,t);
1if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(a),a;throw eq.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.loadIdToken=function(e,t,r,n){var o=to.createIdTokenEntity(t,r,e.rawToken,this.config.auth.clientId,n);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw eq.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.loadAccessToken=function(e,t,r,n,o,i){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw eq.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw eq.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new te(e.scopes).printScopes(),s=i.expiresOn||t.expires_in+new Date().getTime()/1e3,c=i.extendedExpiresOn,l=ta.createAccessTokenEntity(r,n,t.access_token,this.config.auth.clientId,o,a,s,c,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(l),l;throw eq.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.loadRefreshToken=function(e,t,r,n){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;var o=ts.createRefreshTokenEntity(r,n,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(o),o;throw eq.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.generateAuthenticationResult=function(e,t,r,n){var o,i,a,s,c=eo.EMPTY_STRING,l=[],u=null;(null==r?void 0:r.accessToken)&&(c=r.accessToken.secret,l=te.fromString(r.accessToken.target).asArray(),u=new Date(1e3*Number(r.accessToken.expiresOn)),s=new Date(1e3*Number(r.accessToken.extendedExpiresOn)));var d=(null==t?void 0:t.claims.oid)||(null==t?void 0:t.claims.sub)||eo.EMPTY_STRING,p=(null==t?void 0:t.claims.tid)||eo.EMPTY_STRING;return{authority:n?n.canonicalAuthority:eo.EMPTY_STRING,uniqueId:d,tenantId:p,scopes:l,account:(null==r?void 0:r.account)?r.account.getAccountInfo():null,idToken:t?t.rawToken:eo.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:c,fromCache:!0,expiresOn:u,correlationId:e.correlationId||eo.EMPTY_STRING,requestId:eo.EMPTY_STRING,extExpiresOn:s,familyId:eo.EMPTY_STRING,tokenType:(null===(o=null==r?void 0:r.accessToken)||void 0===o?void 0:o.tokenType)||eo.EMPTY_STRING,state:eo.EMPTY_STRING,cloudGraphHostName:(null===(i=null==r?void 0:r.account)||void 0===i?void 0:i.cloudGraphHostName)||eo.EMPTY_STRING,msGraphHost:(null===(a=null==r?void 0:r.account)||void 0===a?void 0:a.msGraphHost)||eo.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},e}(),rn=function(e){function t(t){var r=e.call(this,t)||this;return r.includeRedirectUri=!1,r}return Y(t,e),t}(tz),ro=function(e){function t(t,r,n,o,i,a,s,c,l,u){var d=e.call(this,t,r,n,o,i,a,c,l,u)||this;return d.apiId=s,d}return Y(t,e),t.prototype.acquireToken=function(e){return J(this,void 0,void 0,function(){var t,r,n,o,i;return $(this,function(a){switch(a.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!e.code)throw eq.createAuthCodeRequiredError();return[4,this.initializeAuthorizationRequest(e,O.Silent)];case 1:t=a.sent(),this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||eo.EMPTY_STRING,t.account||null),r=this.initializeServerTelemetryManager(this.apiId),a.label=2;case 2:return a.trys.push([2,4,,5]),n=V(V({},t),{code:e.code}),[4,this.getClientConfiguration(r,t.authority)];case 3:return o=new rn(a.sent()),this.logger.verbose("Auth code client created"),[2,new t9(o,this.browserStorage,n,this.logger,this.config.system).handleCodeResponseFromServer({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t.state,o.authority,this.networkClient,!1)];case 4:throw(i=a.sent())instanceof eg&&i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i),this.browserStorage.cleanRequestByState(t.state),i;case 5:return[2]}})})},t.prototype.logout=function(){return Promise.reject(eq.createSilentLogoutUnsupportedError())},t}(tQ),ri=function(){function e(e,t){this.correlationId=t,this.measureName="msal.measure."+e+"."+this.correlationId,this.startMark="msal.start."+e+"."+this.correlationId,this.endMark="msal.end."+e+"."+this.correlationId}
1return e.supportsBrowserPerformance=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName},e.prototype.startMeasurement=function(){if(e.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}},e.prototype.endMeasurement=function(){if(e.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}},e.prototype.flushMeasurement=function(){if(e.supportsBrowserPerformance())try{var t=window.performance.getEntriesByName(this.measureName,"measure");if(t.length>0){var r=t[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),r}}catch(e){}return null},e}(),ra=function(e){function t(t,r,n,o,i,a,s){var c=e.call(this,t,r,n,o,i,a)||this;return c.browserCrypto=new eV(c.logger,s),c.guidGenerator=new eR(c.browserCrypto),c}return Y(t,e),t.prototype.startPerformanceMeasurement=function(e,t){return new ri(e,t)},t.prototype.generateId=function(){return this.guidGenerator.generateGuid()},t.prototype.getPageVisibility=function(){var e;return(null===(e=document.visibilityState)||void 0===e?void 0:e.toString())||null},t.prototype.startMeasurement=function(t,r){var n=this,o=this.getPageVisibility(),i=e.prototype.startMeasurement.call(this,t,r);return V(V({},i),{endMeasurement:function(e){return i.endMeasurement(V({startPageVisibility:o,endPageVisibility:n.getPageVisibility()},e))}})},t}(e0),rs=function(e){function t(t){var r=e.call(this,t)||this;return r.activeSilentTokenRequests=new Map,r}return Y(t,e),t.prototype.loginRedirect=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){return t=this.getRequestCorrelationId(e),this.logger.verbose("loginRedirect called",t),[2,this.acquireTokenRedirect(V({correlationId:t},e||eC))]})})},t.prototype.loginPopup=function(e){var t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup(V({correlationId:t},e||eC))},t.prototype.acquireTokenSilent=function(e){return J(this,void 0,void 0,function(){var t,r,o,i,a,s,c=this;return $(this,function(l){if(t=this.getRequestCorrelationId(e),(r=this.performanceClient.startMeasurement(n.AcquireTokenSilent,t)).addStaticFields({cacheLookupPolicy:e.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(O.Silent),this.logger.verbose("acquireTokenSilent called",t),!(o=e.account||this.getActiveAccount()))throw eq.createNoAccountError();return(i=JSON.stringify({clientId:this.config.auth.clientId,authority:e.authority||eo.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid}),void 0===(a=this.activeSilentTokenRequests.get(i)))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t),s=this.acquireTokenSilentAsync(V(V({},e),{correlationId:t}),o).then(function(t){return c.activeSilentTokenRequests.delete(i),r.addStaticFields({accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),r.endMeasurement({success:!0,fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:t.requestId}),r.flushMeasurement(),t}).catch(function(e){throw c.activeSilentTokenRequests.delete(i),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e}),this.activeSilentTokenRequests.set(i,s),[2,s]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.endMeasurement({success:!0}),r.discardMeasurement(),[2,a])})})},t.prototype.acquireTokenSilentAsync=function(e,t){return J(this,void 0,void 0,function(){var r,o,i,a,s,c,l=this;return $(this,function(u){switch(u.label){case 0:if(this.eventHandler.emitEvent(z.ACQUIRE_TOKEN_START,O.Silent,e),r=this.performanceClient.startMeasurement(n.AcquireTokenSilentAsync,e.correlationId),!(t4.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&t.nativeAccountId))return[3,1];return this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),i=V(V({},e),{account:t}),o=this.acquireTokenNative(i,P.acquireTokenSilent_silentFlow).catch(function(t){return J(l,void 0,void 0,function(){return $(this,function(r){if(t instanceof tZ&&t.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(e.correlationId).acquireToken(e)];throw t})})}),[3,3];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),[4,(a=this.createSilentCacheClient(e.correlationId)).initializeSilentRequest(e,t)];case 2:s=u.sent(),c=V(V({},e),{cacheLookupPolicy:e.cacheLookupPolicy||D.Default}),o=this.acquireTokenFromCache(a,s,c).catch(function(t){if(c.cacheLookupPolicy===D.AccessToken)throw t;return tA.blockReloadInHiddenIframes(),l.eventHandler.emitEvent(z.ACQUIRE_TOKEN_NETWORK_START,O.Silent,s),l.acquireTokenByRefreshToken(s,c).catch(function(t){var r=t instanceof ev,n=t instanceof ew,o=t.errorCode===eE.INVALID_GRANT_ERROR;
1if((!r||!o||n||c.cacheLookupPolicy===D.AccessTokenAndRefreshToken||c.cacheLookupPolicy===D.RefreshToken)&&c.cacheLookupPolicy!==D.Skip)throw t;return l.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",e.correlationId),l.acquireTokenBySilentIframe(s)})}),u.label=3;case 3:return[2,o.then(function(e){return l.eventHandler.emitEvent(z.ACQUIRE_TOKEN_SUCCESS,O.Silent,e),r.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e}).catch(function(e){throw l.eventHandler.emitEvent(z.ACQUIRE_TOKEN_FAILURE,O.Silent,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})]}})})},t}(function(){function e(e){this.isBrowserEnvironment="undefined"!=typeof window,this.config=(t=this.isBrowserEnvironment,r=e.auth,n=e.cache,o=e.system,i=e.telemetry,a={clientId:eo.EMPTY_STRING,authority:""+eo.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:eo.EMPTY_STRING,authorityMetadata:eo.EMPTY_STRING,redirectUri:eo.EMPTY_STRING,postLogoutRedirectUri:eo.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:F.AAD,azureCloudOptions:{azureCloudInstance:j.None,tenant:eo.EMPTY_STRING},skipAuthorityMetadataCache:!1},s={cacheLocation:k.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},c={loggerCallback:function(){},logLevel:U.Info,piiLoggingEnabled:!1},l=V(V({},ty),{loggerOptions:c,networkClient:t?tA.getBrowserNetworkClient():tT,navigationClient:new tx,loadFrameTimeout:0,windowHashTimeout:(null==o?void 0:o.loadFrameTimeout)||6e4,iframeHashTimeout:(null==o?void 0:o.loadFrameTimeout)||6e3,navigateFrameWait:t&&tA.detectIEOrEdge()?500:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(null==o?void 0:o.nativeBrokerHandshakeTimeout)||2e3,pollIntervalMilliseconds:eE.DEFAULT_POLL_INTERVAL_MS,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),u=V(V({},o),{loggerOptions:(null==o?void 0:o.loggerOptions)||c}),d={application:{appName:eo.EMPTY_STRING,appVersion:eo.EMPTY_STRING}},{auth:V(V({},a),r),cache:V(V({},s),n),system:V(V({},l),u),telemetry:V(V({},d),i)}),this.initialized=!1,this.logger=new eZ(this.config.system.loggerOptions,tR,tP),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new ra(this.config.auth.clientId,this.config.auth.authority,this.logger,tR,tP,this.config.telemetry.application,this.config.system.cryptoOptions):new e2(this.config.auth.clientId,this.config.auth.authority,this.logger,tR,tP,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new eX(this.logger,this.performanceClient,this.config.system.cryptoOptions):e3,this.eventHandler=new tO(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new tv(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(p=this.config.auth.clientId,h=this.logger,new tv(p,{cacheLocation:k.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1},e3,h));var t,r,n,o,i,a,s,c,l,u,d,p,h,f={cacheLocation:k.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1};this.nativeInternalStorage=new tv(this.config.auth.clientId,f,this.browserCrypto,this.logger),this.tokenCache=new rr(this.config,this.browserStorage,this.logger,this.browserCrypto)}return e.prototype.initialize=function(){return J(this,void 0,void 0,function(){var e,t;return $(this,function(r){switch(r.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(this.eventHandler.emitEvent(z.INITIALIZE_START),!this.config.system.allowNativeBroker)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),e=this,[4,t4.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout)];case 2:return e.nativeExtensionProvider=r.sent(),[3,4];case 3:return t=r.sent(),this.logger.verbose(t),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(z.INITIALIZE_END),[2]}})})},e.prototype.handleRedirectPromise=function(e){return J(this,void 0,void 0,function(){var t,r,n,o,i,a,s=this;return $(this,function(c){return(this.logger.verbose("handleRedirectPromise called"),tA.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t=this.getAllAccounts(),this.isBrowserEnvironment)?(r=e||eo.EMPTY_STRING,void 0===(n=this.redirectResponse.get(r))?(this.eventHandler.emitEvent(z.HANDLE_REDIRECT_START,O.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),o=this.browserStorage.getCachedNativeRequest(),i=void 0,o&&t4.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),i=new t3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,P.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,o.accountId,this.nativeInternalStorage,o.correlationId).handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),a=this.browserStorage.getTemporaryCache(x.CORRELATION_ID,!0)||eo.EMPTY_STRING,i=this.createRedirectClient(a).handleRedirectPromise(e)),n=i.then(function(e){return e&&(t.length<s.getAllAccounts().length?(s.eventHandler.emitEvent(z.LOGIN_SUCCESS,O.Redirect,e),s.logger.verbose("handleRedirectResponse returned result, login success")):(s.eventHandler.emitEvent(z.ACQUIRE_TOKEN_SUCCESS,O.Redirect,e),s.logger.verbose("handleRedirectResponse returned result, acquire token success"))),s.eventHandler.emitEvent(z.HANDLE_REDIRECT_END,O.Redirect),e}).catch(function(e){throw t.length>0?s.eventHandler.emitEvent(z.ACQUIRE_TOKEN_FAILURE,O.Redirect,null,e):s.eventHandler.emitEvent(z.LOGIN_FAILURE,O.Redirect,null,e),s.eventHandler.emitEvent(z.HANDLE_REDIRECT_END,O.Redirect),e}),this.redirectResponse.set(r,n)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,n]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])})})},e.prototype.acquireTokenRedirect=function(e){return J(this,void 0,void 0,function(){var t,r,n=this;return $(this,function(o){return t=this.getRequestCorrelationId(e),this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(O.Redirect),(r=this.getAllAccounts().length>0)?this.eventHandler.emitEvent(z.ACQUIRE_TOKEN_START,O.Redirect,e):this.eventHandler.emitEvent(z.LOGIN_START,O.Redirect,e),[2,(this.nativeExtensionProvider&&this.canUseNative(e)?new t3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,P.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireTokenRedirect(e).catch(function(t){if(t instanceof tZ&&t.isFatal()){
1n.nativeExtensionProvider=void 0;var r=n.createRedirectClient(e.correlationId);return r.acquireToken(e)}if(t instanceof ew){n.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");var r=n.createRedirectClient(e.correlationId);return r.acquireToken(e)}throw n.browserStorage.setInteractionInProgress(!1),t}):this.createRedirectClient(e.correlationId).acquireToken(e)).catch(function(e){throw r?n.eventHandler.emitEvent(z.ACQUIRE_TOKEN_FAILURE,O.Redirect,null,e):n.eventHandler.emitEvent(z.LOGIN_FAILURE,O.Redirect,null,e),e})]})})},e.prototype.acquireTokenPopup=function(e){var t=this,r=this.getRequestCorrelationId(e),o=this.performanceClient.startMeasurement(n.AcquireTokenPopup,r);try{this.logger.verbose("acquireTokenPopup called",r),this.preflightBrowserEnvironmentCheck(O.Popup)}catch(e){return Promise.reject(e)}var i=this.getAllAccounts();return i.length>0?this.eventHandler.emitEvent(z.ACQUIRE_TOKEN_START,O.Popup,e):this.eventHandler.emitEvent(z.LOGIN_START,O.Popup,e),(this.canUseNative(e)?this.acquireTokenNative(e,P.acquireTokenPopup).then(function(e){return t.browserStorage.setInteractionInProgress(!1),o.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(r){if(r instanceof tZ&&r.isFatal()){t.nativeExtensionProvider=void 0;var n=t.createPopupClient(e.correlationId);return n.acquireToken(e)}if(r instanceof ew){t.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");var n=t.createPopupClient(e.correlationId);return n.acquireToken(e)}throw t.browserStorage.setInteractionInProgress(!1),r}):this.createPopupClient(e.correlationId).acquireToken(e)).then(function(e){return i.length<t.getAllAccounts().length?t.eventHandler.emitEvent(z.LOGIN_SUCCESS,O.Popup,e):t.eventHandler.emitEvent(z.ACQUIRE_TOKEN_SUCCESS,O.Popup,e),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){return i.length>0?t.eventHandler.emitEvent(z.ACQUIRE_TOKEN_FAILURE,O.Popup,null,e):t.eventHandler.emitEvent(z.LOGIN_FAILURE,O.Popup,null,e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),Promise.reject(e)})},e.prototype.ssoSilent=function(e){return J(this,void 0,void 0,function(){var t,r,o,i=this;return $(this,function(a){return t=this.getRequestCorrelationId(e),r=V(V({},e),{prompt:e.prompt,correlationId:t}),this.preflightBrowserEnvironmentCheck(O.Silent),o=this.performanceClient.startMeasurement(n.SsoSilent,t),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(z.SSO_SILENT_START,O.Silent,r),[2,(this.canUseNative(r)?this.acquireTokenNative(r,P.ssoSilent).catch(function(e){if(e instanceof tZ&&e.isFatal())return i.nativeExtensionProvider=void 0,i.createSilentIframeClient(r.correlationId).acquireToken(r);throw e}):this.createSilentIframeClient(r.correlationId).acquireToken(r)).then(function(e){return i.eventHandler.emitEvent(z.SSO_SILENT_SUCCESS,O.Silent,e),o.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),o.flushMeasurement(),e}).catch(function(e){throw i.eventHandler.emitEvent(z.SSO_SILENT_FAILURE,O.Silent,null,e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),o.flushMeasurement(),e})]})})},e.prototype.acquireTokenByCode=function(e){return J(this,void 0,void 0,function(){var t,r,o,i,a=this;return $(this,function(s){t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(O.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(z.ACQUIRE_TOKEN_BY_CODE_START,O.Silent,e),r=this.performanceClient.startMeasurement(n.AcquireTokenByCode,e.correlationId);try{if(e.code)return o=e.code,(i=this.hybridAuthCodeResponses.get(o))?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),r.endMeasurement({success:!0}),r.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),i=this.acquireTokenByCodeAsync(V(V({},e),{correlationId:t})).then(function(e){return a.eventHandler.emitEvent(z.ACQUIRE_TOKEN_BY_CODE_SUCCESS,O.Silent,e),a.hybridAuthCodeResponses.delete(o),r.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),r.endMeasurement({success:!0,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),r.flushMeasurement(),e}).catch(function(e){throw a.hybridAuthCodeResponses.delete(o),a.eventHandler.emitEvent(z.ACQUIRE_TOKEN_BY_CODE_FAILURE,O.Silent,null,e),r.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),r.flushMeasurement(),e}),this.hybridAuthCodeResponses.set(o,i)),[2,i];
1if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return[2,this.acquireTokenNative(e,P.acquireTokenByCode,e.nativeAccountId).catch(function(e){throw e instanceof tZ&&e.isFatal()&&(a.nativeExtensionProvider=void 0),e})];throw eq.createUnableToAcquireTokenFromNativePlatformError()}throw eq.createAuthCodeOrNativeAccountIdRequiredError()}catch(e){throw this.eventHandler.emitEvent(z.ACQUIRE_TOKEN_BY_CODE_FAILURE,O.Silent,null,e),r.endMeasurement({errorCode:e instanceof eg&&e.errorCode||void 0,subErrorCode:e instanceof eg&&e.subError||void 0,success:!1}),e}return[2]})})},e.prototype.acquireTokenByCodeAsync=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){switch(t.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),[4,this.createSilentAuthCodeClient(e.correlationId).acquireToken(e)];case 1:return[2,t.sent()]}})})},e.prototype.acquireTokenFromCache=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){switch(r.cacheLookupPolicy){case D.Default:case D.AccessToken:case D.AccessTokenAndRefreshToken:return[2,e.acquireToken(t)];default:throw eD.createRefreshRequiredError()}return[2]})})},e.prototype.acquireTokenByRefreshToken=function(e,t){return J(this,void 0,void 0,function(){return $(this,function(r){switch(t.cacheLookupPolicy){case D.Default:case D.AccessTokenAndRefreshToken:case D.RefreshToken:case D.RefreshTokenAndNetwork:return[2,this.createSilentRefreshClient(e.correlationId).acquireToken(e)];default:throw eD.createRefreshRequiredError()}return[2]})})},e.prototype.acquireTokenBySilentIframe=function(e){return J(this,void 0,void 0,function(){return $(this,function(t){return[2,this.createSilentIframeClient(e.correlationId).acquireToken(e)]})})},e.prototype.logout=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){return t=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(V({correlationId:t},e))]})})},e.prototype.logoutRedirect=function(e){return J(this,void 0,void 0,function(){var t;return $(this,function(r){return t=this.getRequestCorrelationId(e),this.preflightBrowserEnvironmentCheck(O.Redirect),[2,this.createRedirectClient(t).logout(e)]})})},e.prototype.logoutPopup=function(e){try{var t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(O.Popup),this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}},e.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},e.prototype.getAccountByUsername=function(e){var t=this.getAllAccounts();return!eL.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+e),t.filter(function(t){return t.username.toLowerCase()===e.toLowerCase()})[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},e.prototype.getAccountByHomeId=function(e){var t=this.getAllAccounts();return!eL.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+e),t.filter(function(t){return t.homeAccountId===e})[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},e.prototype.getAccountByLocalId=function(e){var t=this.getAllAccounts();return!eL.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+e),t.filter(function(t){return t.localAccountId===e})[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},e.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},e.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},e.prototype.preflightBrowserEnvironmentCheck=function(e,t){if(void 0===t&&(t=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),tA.blockNonBrowserEnvironment(this.isBrowserEnvironment),tA.blockRedirectInIframe(e,this.config.system.allowRedirectInIframe),tA.blockReloadInHiddenIframes(),tA.blockAcquireTokenInPopups(),tA.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),e===O.Redirect&&this.config.cache.cac
1heLocation===k.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw eK.createInMemoryRedirectUnavailableError();(e===O.Redirect||e===O.Popup)&&this.preflightInteractiveRequest(t)},e.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),tA.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},e.prototype.acquireTokenNative=function(e,t,r){return J(this,void 0,void 0,function(){return $(this,function(n){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw eq.createNativeConnectionNotEstablishedError();return[2,new t3(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)]})})},e.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!t4.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case es.NONE:case es.CONSENT:case es.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!!(t||this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)},e.prototype.getNativeAccountId=function(e){var t=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return t&&t.nativeAccountId||""},e.prototype.createPopupClient=function(e){return new t6(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},e.prototype.createRedirectClient=function(e){return new t7(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},e.prototype.createSilentIframeClient=function(e){return new re(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,P.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},e.prototype.createSilentCacheClient=function(e){return new t2(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.createSilentRefreshClient=function(e){return new rt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.createSilentAuthCodeClient=function(e){return new ro(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,P.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)},e.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},e.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},e.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},e.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},e.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},e.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},e.prototype.getTokenCache=function(){return this.tokenCache},e.prototype.getLogger=function(){return this.logger},e.prototype.setLogger=function(e){this.logger=e},e.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},e.prototype.setNavigationClient=function(e){this.navigationClient=e},e.prototype.getConfiguration=function(){return this.config},e.prototype.getRequestCorrelationId=function(e){return(null==e?void 0:e.correlationId)?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():eo.EMPTY_STRING},e}())},75270:(e,t,r)=>{"use strict";r.d(t,{FA:()=>S,Ku:()=>I,T9:()=>g,Uj:()=>l,bD:()=>function e(t,r){if(t===r)return!0;let n=Object.keys(t),o=Object.keys(r);for(let i of n){if(!o.includes(i))return!1;let n=t[i],a=r[i];if(_(n)&&_(a)){if(!e(n,a))return!1}else if(n!==a)return!1}for(let e of o)if(!n.includes(e))return!1;return!0},cY:()=>v,dM:()=>w,eX:()=>b,g:()=>E,p9:()=>T,sr:()=>m,zW:()=>y});var n=r(91205);let o=function(e){let t=[],r=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t[r++]=o:(o<2048?t[r++]=o>>6|192:((64512&o)==55296&&n+1<e.length&&(64512&e.charCodeAt(n+1))==56320?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[r++]=o>>18|240,t[r++]=o>>12&63|128):t[r++]=o>>12|224,t[r++]=o>>6&63|128),t[r++]=63&o|128)}return t},i=function(e){let t=[],r=0,n=0;for(;r<e.length;){let o=e[r++];if(o<128)t[n++]=String.fromCharCode(o);else if(o>191&&o<224){let i=e[r++];t[n++]=String.fromCharCode((31&o)<<6|63&i)}else if(o>239&&o<365){let i=((7&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(i>>
110)),t[n++]=String.fromCharCode(56320+(1023&i))}else{let i=e[r++],a=e[r++];t[n++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&a)}}return t.join("")},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();let r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let t=0;t<e.length;t+=3){let o=e[t],i=t+1<e.length,a=i?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=o>>2,u=(3&o)<<4|a>>4,d=(15&a)<<2|c>>6,p=63&c;s||(p=64,i||(d=64)),n.push(r[l],r[u],r[d],r[p])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(o(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):i(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let t=0;t<e.length;){let o=r[e.charAt(t++)],i=t<e.length?r[e.charAt(t)]:0,a=++t<e.length?r[e.charAt(t)]:64,c=++t<e.length?r[e.charAt(t)]:64;if(++t,null==o||null==i||null==a||null==c)throw new s;let l=o<<2|i>>4;if(n.push(l),64!==a){let e=i<<4&240|a>>2;if(n.push(e),64!==c){let e=a<<6&192|c;n.push(e)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class s extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let c=function(e){let t=o(e);return a.encodeByteArray(t,!0)},l=function(e){return c(e).replace(/\./g,"")},u=function(e){try{return a.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},d=()=>(function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("Unable to locate global object.")})().__FIREBASE_DEFAULTS__,p=()=>{if(void 0===n||void 0===n.env)return;let e=n.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},h=()=>{let e;if("undefined"==typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&u(e[1]);return t&&JSON.parse(t)},f=()=>{try{return d()||p()||h()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},g=()=>{var e;return null===(e=f())||void 0===e?void 0:e.config};class v{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}function m(){let e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function y(){try{return"object"==typeof indexedDB}catch(e){return!1}}function b(){return new Promise((e,t)=>{try{let r=!0,n="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(n);o.onsuccess=()=>{o.result.close(),r||self.indexedDB.deleteDatabase(n),e(!0)},o.onupgradeneeded=()=>{r=!1},o.onerror=()=>{var e;t((null===(e=o.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})}function w(){return"undefined"!=typeof navigator&&!!navigator.cookieEnabled}class E extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,E.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,S.prototype.create)}}class S{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){let r=t[0]||{},n=`${this.service}/${e}`,o=this.errors[e],i=o?o.replace(C,(e,t)=>{let n=r[t];return null!=n?String(n):`<${t}?>`}):"Error",a=`${this.serviceName}: ${i} (${n}).`;return new E(n,a,r)}}let C=/\{\$([^}]+)}/g;function _(e){return null!==e&&"object"==typeof e}function T(e,t=1e3,r=2){let n=t*Math.pow(r,e),o=Math.round(.5*n*(Math.random()-.5)*2);return Math.min(144e5,n+o)}function I(e){return e&&e._delegate?e._delegate:e}},65343:(e,t,r)=>{"use strict";let n;r.d(t,{Ay:()=>Z});
1var o=r(7620),i=r(75928),a=r(57882),s=r(16718),c=r(75309),l=r(89136),u=r(85188),d=r(81924),p=r(388),h=r(79138),f=r(11954),g=r(50008),v=r(4746);let m={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};var y=r(86238);let b=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;return e.length===t.length&&e.every((e,n)=>r(e,t[n]))};function w(e,t){return e-t}function E(e,t){var r;let{index:n}=null!==(r=e.reduce((e,r,n)=>{let o=Math.abs(t-r);return null===e||o<e.distance||o===e.distance?{distance:o,index:n}:e},null))&&void 0!==r?r:{};return n}function S(e,t){if(void 0!==t.current&&e.changedTouches){for(let r=0;r<e.changedTouches.length;r+=1){let n=e.changedTouches[r];if(n.identifier===t.current)return{x:n.clientX,y:n.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function C(e){let{values:t,newValue:r,index:n}=e,o=t.slice();return o[n]=r,o.sort(w)}function _(e){var t,r,n;let{sliderRef:o,activeIndex:i,setActive:a}=e,s=(0,u.A)(o.current);(null===(t=o.current)||void 0===t?void 0:t.contains(s.activeElement))&&Number(null==s?void 0:null===(r=s.activeElement)||void 0===r?void 0:r.getAttribute("data-index"))===i||null===(n=o.current)||void 0===n||n.querySelector('[type="range"][data-index="'.concat(i,'"]')).focus(),a&&a(i)}function T(e,t){return"number"==typeof e&&"number"==typeof t?e===t:"object"==typeof e&&"object"==typeof t&&b(e,t)}let I={horizontal:{offset:e=>({left:"".concat(e,"%")}),leap:e=>({width:"".concat(e,"%")})},"horizontal-reverse":{offset:e=>({right:"".concat(e,"%")}),leap:e=>({width:"".concat(e,"%")})},vertical:{offset:e=>({bottom:"".concat(e,"%")}),leap:e=>({height:"".concat(e,"%")})}},k=e=>e;function A(){return void 0===n&&("undefined"!=typeof CSS&&"function"==typeof CSS.supports?n=CSS.supports("touch-action","none"):n=!0),n}var x=r(81970),R=r(13395),P=r(63695),O=r(70742),N=r(51359);let M=e=>!e||!(0,x.A)(e);var D=r(63123);function L(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t=>{let[,r]=t;return r&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("string"!=typeof e.main)return!1;for(let r of t)if(!e.hasOwnProperty(r)||"string"!=typeof e[r])return!1;return!0}(r,e)}}var U=r(16604),q=r(55222);function H(e){return(0,q.Ay)("MuiSlider",e)}let F=(0,U.A)("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]);var j=r(54568);let z=e=>{let{open:t}=e;return{offset:(0,i.A)(t&&F.valueLabelOpen),circle:F.valueLabelCircle,label:F.valueLabelLabel}};function B(e){return e}let K=(0,R.Ay)("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t["color".concat((0,D.A)(r.color))],"medium"!==r.size&&t["size".concat((0,D.A)(r.size))],r.marked&&t.marked,"vertical"===r.orientation&&t.vertical,"inverted"===r.track&&t.trackInverted,!1===r.track&&t.trackFalse]}})((0,P.A)(e=>{let{theme:t}=e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},["&.".concat(F.disabled)]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},["&.".concat(F.dragging)]:{["& .".concat(F.thumb,", & .").concat(F.track)]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(L()).map(e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}}),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}})),G=(0,R.Ay)("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),Y=(0,R.Ay)("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})((0,P.A)(e=>{let{theme:t}=e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(t.palette).filter(L()).map(e=>{let[r]=e;return{props:{color:r,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider["".concat(r,"Track")],borderColor:t.vars.palette.Slider["".concat(r,"Track")]}:{backgroundColor:(0,s.a)(t.palette[r].main,.62),borderColor:(0,s.a)(t.palette[r].main,.62),...t.applyStyles("dark",{backgroundColor:(0,s.e$)(t.palette[r].main,.5)}),...t.applyStyles("dark",{borderColor:(0,s.e$)(t.palette[r].main,.5)})}}}})]}})),V=(0,R.Ay)("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.thumb,t["thumbColor".concat((0,D.A)(r.color))],"medium"!==r.size&&t["thumbSize".concat((0,D.A)(r.size))]]}})((0,P.A)(e=>{let{theme:t}=e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,he
1ight:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},["&.".concat(F.disabled)]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(t.palette).filter(L()).map(e=>{let[r]=e;return{props:{color:r},style:{["&:hover, &.".concat(F.focusVisible)]:{...t.vars?{boxShadow:"0px 0px 0px 8px rgba(".concat(t.vars.palette[r].mainChannel," / 0.16)")}:{boxShadow:"0px 0px 0px 8px ".concat((0,s.X4)(t.palette[r].main,.16))},"@media (hover: none)":{boxShadow:"none"}},["&.".concat(F.active)]:{...t.vars?{boxShadow:"0px 0px 0px 14px rgba(".concat(t.vars.palette[r].mainChannel," / 0.16)")}:{boxShadow:"0px 0px 0px 14px ".concat((0,s.X4)(t.palette[r].main,.16))}}}}})]}})),W=(0,R.Ay)(function(e){let{children:t,className:r,value:n}=e,a=z(e);return t?o.cloneElement(t,{className:(0,i.A)(t.props.className)},(0,j.jsxs)(o.Fragment,{children:[t.props.children,(0,j.jsx)("span",{className:(0,i.A)(a.offset,r),"aria-hidden":!0,children:(0,j.jsx)("span",{className:a.circle,children:(0,j.jsx)("span",{className:a.label,children:n})})})]})):null},{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})((0,P.A)(e=>{let{theme:t}=e;return{zIndex:1,whiteSpace:"nowrap",...t.typography.body2,fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},["&.".concat(F.valueLabelOpen)]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},["&.".concat(F.valueLabelOpen)]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}})),J=(0,R.Ay)("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>(0,N.A)(e)&&"markActive"!==e,overridesResolver:(e,t)=>{let{markActive:r}=e;return[t.mark,r&&t.markActive]}})((0,P.A)(e=>{let{theme:t}=e;return{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]}})),$=(0,R.Ay)("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>(0,N.A)(e)&&"markLabelActive"!==e,overridesResolver:(e,t)=>t.markLabel})((0,P.A)(e=>{let{theme:t}=e;return{...t.typography.body2,color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]}})),Q=e=>{let{disabled:t,dragging:r,marked:n,orientation:o,track:i,classes:s,color:c,size:l}=e,u={root:["root",t&&"disabled",r&&"dragging",n&&"marked","vertical"===o&&"vertical","inverted"===i&&"trackInverted",!1===i&&"trackFalse",c&&"color".concat((0,D.A)(c)),l&&"size".concat((0,D.A)(l))],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&"thumbSize".concat((0,D.A)(l)),c&&"thumbColor".concat((0,D.A)(c))],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return(0,a.A)(u,H,s)},X=e=>{let{children:t}=e;return t},Z=o.forwardRef(function(e,t){var r,n,a,s,b,R,P,N,D,L,U,q,H,F,z,Z,ee,et,er,en,eo,ei,ea,es;let ec=(0,O.b)({props:e,name:"MuiSlider"}),el=(0,c.I)(),{"aria-label":eu,"aria-valuetext":ed,"aria-labelledby":ep,component:eh="span",components:ef={},componentsProps:eg={},color:ev="primary",classes:em,className:ey,disableSwap:eb=!1,disabled:ew=!1,getAriaLabel:eE,getAriaValueText:eS,marks:eC=!1,max:e_=100,min:eT=0,name:eI,onChange:ek,onChangeCommitted:eA,orientation:ex="horizontal",shiftStep:eR=10,size:eP="medium",step:eO=1,scale:eN=B,slotProps:eM,slots:eD,tabIndex:eL,track:eU="normal",value:eq,valueLabelDisplay:eH="off",valueLabelFormat:eF=B,...ej}=ec,ez={...ec,isRtl:el,max:e_,min:eT,classes:em,disabled:ew,disableSwap:eb,orientation:ex,marks:eC,color:ev,size:eP,step:eO,shiftStep:eR,scale:eN,track:eU,valueLabelDisplay:eH,valueLabelFormat:eF},{axisProps:eB,getRootProps:eK,getHiddenInputProps:eG,getThumbProps:eY,open:eV,active:eW,axis:eJ,focusedThumbIndex:e$,range:eQ,dragging:eX,marks:eZ,values:e0,trackOffset:e1,trackLeap:e2,getThumbStyle:e3}=function(e){let{"aria-labelledby":t,defaultValue:r,disabled:n=!1,disableSwap:i=!1,isRtl:a=!1,marks:s=!1,max:c=100,min:l=0,name:b,onChange:x,onChangeCommitted:R,orientation:P="horizontal",rootRef:O,scale:N=k,step:M=1,shiftStep:D=10,tabIndex:L,value:U}
1=e,q=o.useRef(void 0),[H,F]=o.useState(-1),[j,z]=o.useState(-1),[B,K]=o.useState(!1),G=o.useRef(0),[Y,V]=(0,d.A)({controlled:U,default:null!=r?r:l,name:"Slider"}),W=x&&((e,t,r)=>{let n=e.nativeEvent||e,o=new n.constructor(n.type,n);Object.defineProperty(o,"target",{writable:!0,value:{value:t,name:b}}),x(o,t,r)}),J=Array.isArray(Y),$=J?Y.slice().sort(w):[Y];$=$.map(e=>null==e?l:(0,p.A)(e,l,c));let Q=!0===s&&null!==M?[...Array(Math.floor((c-l)/M)+1)].map((e,t)=>({value:l+M*t})):s||[],X=Q.map(e=>e.value),[Z,ee]=o.useState(-1),et=o.useRef(null),er=(0,h.A)(O,et),en=e=>t=>{var r;let n=Number(t.currentTarget.getAttribute("data-index"));(0,f.A)(t.target)&&ee(n),z(n),null==e||null===(r=e.onFocus)||void 0===r||r.call(e,t)},eo=e=>t=>{var r;(0,f.A)(t.target)||ee(-1),z(-1),null==e||null===(r=e.onBlur)||void 0===r||r.call(e,t)},ei=(e,t)=>{let r=Number(e.currentTarget.getAttribute("data-index")),n=$[r],o=X.indexOf(n),a=t;if(Q&&null==M){let e=X[X.length-1];a=a>e?e:a<X[0]?X[0]:a<n?X[o-1]:X[o+1]}if(a=(0,p.A)(a,l,c),J){i&&(a=(0,p.A)(a,$[r-1]||-1/0,$[r+1]||1/0));let e=a;a=C({values:$,newValue:a,index:r});let t=r;i||(t=a.indexOf(e)),_({sliderRef:et,activeIndex:t})}V(a),ee(r),W&&!T(a,Y)&&W(e,a,r),R&&R(e,a)},ea=e=>t=>{var r;if(null!==M){let e=$[Number(t.currentTarget.getAttribute("data-index"))],r=null;("ArrowLeft"===t.key||"ArrowDown"===t.key)&&t.shiftKey||"PageDown"===t.key?r=Math.max(e-D,l):(("ArrowRight"===t.key||"ArrowUp"===t.key)&&t.shiftKey||"PageUp"===t.key)&&(r=Math.min(e+D,c)),null!==r&&(ei(t,r),t.preventDefault())}null==e||null===(r=e.onKeyDown)||void 0===r||r.call(e,t)};(0,g.A)(()=>{if(n&&et.current.contains(document.activeElement)){var e;null===(e=document.activeElement)||void 0===e||e.blur()}},[n]),n&&-1!==H&&F(-1),n&&-1!==Z&&ee(-1);let es=e=>t=>{var r;null===(r=e.onChange)||void 0===r||r.call(e,t),ei(t,t.target.valueAsNumber)},ec=o.useRef(void 0),el=P;a&&"horizontal"===P&&(el+="-reverse");let eu=e=>{let t,r,{finger:n,move:o=!1}=e,{current:a}=et,{width:s,height:u,bottom:d,left:h}=a.getBoundingClientRect();if(t=el.startsWith("vertical")?(d-n.y)/u:(n.x-h)/s,el.includes("-reverse")&&(t=1-t),r=(c-l)*t+l,M)r=Number((Math.round((r-l)/M)*M+l).toFixed(function(e){if(1>Math.abs(e)){let t=e.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}let t=e.toString().split(".")[1];return t?t.length:0}(M)));else{let e=E(X,r);r=X[e]}r=(0,p.A)(r,l,c);let f=0;if(J){f=o?ec.current:E($,r),i&&(r=(0,p.A)(r,$[f-1]||-1/0,$[f+1]||1/0));let e=r;r=C({values:$,newValue:r,index:f}),i&&o||(f=r.indexOf(e),ec.current=f)}return{newValue:r,activeIndex:f}},ed=(0,v.A)(e=>{let t=S(e,q);if(!t)return;if(G.current+=1,"mousemove"===e.type&&0===e.buttons){ep(e);return}let{newValue:r,activeIndex:n}=eu({finger:t,move:!0});_({sliderRef:et,activeIndex:n,setActive:F}),V(r),!B&&G.current>2&&K(!0),W&&!T(r,Y)&&W(e,r,n)}),ep=(0,v.A)(e=>{let t=S(e,q);if(K(!1),!t)return;let{newValue:r}=eu({finger:t,move:!0});F(-1),"touchend"===e.type&&z(-1),R&&R(e,r),q.current=void 0,ef()}),eh=(0,v.A)(e=>{if(n)return;A()||e.preventDefault();let t=e.changedTouches[0];null!=t&&(q.current=t.identifier);let r=S(e,q);if(!1!==r){let{newValue:t,activeIndex:n}=eu({finger:r});_({sliderRef:et,activeIndex:n,setActive:F}),V(t),W&&!T(t,Y)&&W(e,t,n)}G.current=0;let o=(0,u.A)(et.current);o.addEventListener("touchmove",ed,{passive:!0}),o.addEventListener("touchend",ep,{passive:!0})}),ef=o.useCallback(()=>{let e=(0,u.A)(et.current);e.removeEventListener("mousemove",ed),e.removeEventListener("mouseup",ep),e.removeEventListener("touchmove",ed),e.removeEventListener("touchend",ep)},[ep,ed]);o.useEffect(()=>{let{current:e}=et;return e.addEventListener("touchstart",eh,{passive:A()}),()=>{e.removeEventListener("touchstart",eh),ef()}},[ef,eh]),o.useEffect(()=>{n&&ef()},[n,ef]);let eg=e=>t=>{var r;if(null===(r=e.onMouseDown)||void 0===r||r.call(e,t),n||t.defaultPrevented||0!==t.button)return;t.preventDefault();let o=S(t,q);if(!1!==o){let{newValue:e,activeIndex:r}=eu({finger:o});_({sliderRef:et,activeIndex:r,setActive:F}),V(e),W&&!T(e,Y)&&W(t,e,r)}G.current=0;let i=(0,u.A)(et.current);i.addEventListener("mousemove",ed,{passive:!0}),i.addEventListener("mouseup",ep)},ev=((J?$[0]:l)-l)*100/(c-l),em=($[$.length-1]-l)*100/(c-l)-ev,ey=e=>t=>{var r;null===(r=e.onMouseOver)||void 0===r||r.call(e,t),z(Number(t.currentTarget.getAttribute("data-index")))},eb=e=>t=>{var r;null===(r=e.onMouseLeave)||void 0===r||r.call(e,t),z(-1)};return{active:H,axis:el,axisProps:I,dragging:B,focusedThumbIndex:Z,getHiddenInputProps:function(){var r;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,y.A)(o),s={onChange:es(i||{}),onFocus:en(i||{}),onBlur:eo(i||{}),onKeyDown:ea(i||{})},u={...i,...s};return{tabIndex:L,"aria-labelledby":t,"aria-orientation":P,"aria-valuemax":N(c),"aria-valuemin":N(l),name:b,type:"range",min:e.min,max:e.max,step:null===e.step&&e.marks?"any":null!==(r=e.step)&&void 0!==r?r:void 0,disabled:n,...o,...u,style:{...m,direction:a?"rtl":"ltr",width:"100%",height:"100%"}}},getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,y.A)(e),r={onMouseDown:eg(t||{})},n={...t,...r};return{...e,ref:er,...n}},getThumbProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,y.A)(e),r={onMouseOver:ey(t||{}),onMouseLeave:eb(t||{})};return{...e,...t,...r}},marks:Q,open:j,range:J,rootRef:er,trackLeap:em,trackOffset:ev,values:$,getThumbStyle:e=>({pointerEvents:-1!==H&&H!==e?"none":void 0})}}({...ez,rootRef:t});ez.marked=eZ.length>0&&eZ.some(e=>
1e.label),ez.dragging=eX,ez.focusedThumbIndex=e$;let e4=Q(ez),e5=null!==(n=null!==(r=null==eD?void 0:eD.root)&&void 0!==r?r:ef.Root)&&void 0!==n?n:K,e6=null!==(s=null!==(a=null==eD?void 0:eD.rail)&&void 0!==a?a:ef.Rail)&&void 0!==s?s:G,e8=null!==(R=null!==(b=null==eD?void 0:eD.track)&&void 0!==b?b:ef.Track)&&void 0!==R?R:Y,e7=null!==(N=null!==(P=null==eD?void 0:eD.thumb)&&void 0!==P?P:ef.Thumb)&&void 0!==N?N:V,e9=null!==(L=null!==(D=null==eD?void 0:eD.valueLabel)&&void 0!==D?D:ef.ValueLabel)&&void 0!==L?L:W,te=null!==(q=null!==(U=null==eD?void 0:eD.mark)&&void 0!==U?U:ef.Mark)&&void 0!==q?q:J,tt=null!==(F=null!==(H=null==eD?void 0:eD.markLabel)&&void 0!==H?H:ef.MarkLabel)&&void 0!==F?F:$,tr=null!==(Z=null!==(z=null==eD?void 0:eD.input)&&void 0!==z?z:ef.Input)&&void 0!==Z?Z:"input",tn=null!==(ee=null==eM?void 0:eM.root)&&void 0!==ee?ee:eg.root,to=null!==(et=null==eM?void 0:eM.rail)&&void 0!==et?et:eg.rail,ti=null!==(er=null==eM?void 0:eM.track)&&void 0!==er?er:eg.track,ta=null!==(en=null==eM?void 0:eM.thumb)&&void 0!==en?en:eg.thumb,ts=null!==(eo=null==eM?void 0:eM.valueLabel)&&void 0!==eo?eo:eg.valueLabel,tc=null!==(ei=null==eM?void 0:eM.mark)&&void 0!==ei?ei:eg.mark,tl=null!==(ea=null==eM?void 0:eM.markLabel)&&void 0!==ea?ea:eg.markLabel,tu=null!==(es=null==eM?void 0:eM.input)&&void 0!==es?es:eg.input,td=(0,l.A)({elementType:e5,getSlotProps:eK,externalSlotProps:tn,externalForwardedProps:ej,additionalProps:{...M(e5)&&{as:eh}},ownerState:{...ez,...null==tn?void 0:tn.ownerState},className:[e4.root,ey]}),tp=(0,l.A)({elementType:e6,externalSlotProps:to,ownerState:ez,className:e4.rail}),th=(0,l.A)({elementType:e8,externalSlotProps:ti,additionalProps:{style:{...eB[eJ].offset(e1),...eB[eJ].leap(e2)}},ownerState:{...ez,...null==ti?void 0:ti.ownerState},className:e4.track}),tf=(0,l.A)({elementType:e7,getSlotProps:eY,externalSlotProps:ta,ownerState:{...ez,...null==ta?void 0:ta.ownerState},className:e4.thumb}),tg=(0,l.A)({elementType:e9,externalSlotProps:ts,ownerState:{...ez,...null==ts?void 0:ts.ownerState},className:e4.valueLabel}),tv=(0,l.A)({elementType:te,externalSlotProps:tc,ownerState:ez,className:e4.mark}),tm=(0,l.A)({elementType:tt,externalSlotProps:tl,ownerState:ez,className:e4.markLabel}),ty=(0,l.A)({elementType:tr,getSlotProps:eG,externalSlotProps:tu,ownerState:ez});return(0,j.jsxs)(e5,{...td,children:[(0,j.jsx)(e6,{...tp}),(0,j.jsx)(e8,{...th}),eZ.filter(e=>e.value>=eT&&e.value<=e_).map((e,t)=>{let r;let n=(e.value-eT)*100/(e_-eT),a=eB[eJ].offset(n);return r=!1===eU?e0.includes(e.value):"normal"===eU&&(eQ?e.value>=e0[0]&&e.value<=e0[e0.length-1]:e.value<=e0[0])||"inverted"===eU&&(eQ?e.value<=e0[0]||e.value>=e0[e0.length-1]:e.value>=e0[0]),(0,j.jsxs)(o.Fragment,{children:[(0,j.jsx)(te,{"data-index":t,...tv,...!(0,x.A)(te)&&{markActive:r},style:{...a,...tv.style},className:(0,i.A)(tv.className,r&&e4.markActive)}),null!=e.label?(0,j.jsx)(tt,{"aria-hidden":!0,"data-index":t,...tm,...!(0,x.A)(tt)&&{markLabelActive:r},style:{...a,...tm.style},className:(0,i.A)(e4.markLabel,tm.className,r&&e4.markLabelActive),children:e.label}):null]},t)}),e0.map((e,t)=>{let r=(e-eT)*100/(e_-eT),n=eB[eJ].offset(r),o="off"===eH?X:e9;return(0,j.jsx)(o,{...!(0,x.A)(o)&&{valueLabelFormat:eF,valueLabelDisplay:eH,value:"function"==typeof eF?eF(eN(e),t):eF,index:t,open:eV===t||eW===t||"on"===eH,disabled:ew},...tg,children:(0,j.jsx)(e7,{"data-index":t,...tf,className:(0,i.A)(e4.thumb,tf.className,eW===t&&e4.active,e$===t&&e4.focusVisible),style:{...n,...e3(t),...tf.style},children:(0,j.jsx)(tr,{"data-index":t,"aria-label":eE?eE(t):eu,"aria-valuenow":eN(e),"aria-labelledby":ep,"aria-valuetext":eS?eS(eN(e),t):ed,value:e0[t],...ty})})},t)})]})})},81970:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=function(e){return"string"==typeof e}},35278:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(",");if(0===r.length)return!0;var n=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return r.some(function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?n.toLowerCase().endsWith(t):t.endsWith("/*")?i===t.replace(/\/.*$/,""):o===t})}return!0}},39850:e=>{e.exports=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return -1}},34347:(e,t,r)=>
1{var n=r(6074),o=r(22936),i=Array.prototype.splice;e.exports=function(e,t){for(var r=e?t.length:0,a=r-1;r--;){var s=t[r];if(r==a||s!==c){var c=s;o(s)?i.call(e,s,1):n(e,s)}}return e}},6074:(e,t,r)=>{var n=r(32168),o=r(38667),i=r(86976),a=r(14580);e.exports=function(e,t){return t=n(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},2135:(e,t,r)=>{var n=r(15724),o=r(65927),i=r(6135);e.exports=function(e){return function(t,r,a){var s=Object(t);if(!o(t)){var c=n(r,3);t=i(t),r=function(e){return c(s[e],e,s)}}var l=e(t,r,a);return l>-1?s[c?t[l]:l]:void 0}}},86976:(e,t,r)=>{var n=r(58103),o=r(59561);e.exports=function(e,t){return t.length<2?e:n(e,o(t,0,-1))}},68164:(e,t,r)=>{var n=r(2135)(r(20832));e.exports=n},20832:(e,t,r)=>{var n=r(39850),o=r(15724),i=r(98080),a=Math.max;e.exports=function(e,t,r){var s=null==e?0:e.length;if(!s)return -1;var c=null==r?0:i(r);return c<0&&(c=a(s+c,0)),n(e,o(t,3),c)}},1955:(e,t,r)=>{e.exports=r(56721)},56721:e=>{e.exports=function(e){return e&&e.length?e[0]:void 0}},38667:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},86119:e=>{e.exports=function(){}},48103:(e,t,r)=>{var n=r(15724),o=r(34347);e.exports=function(e,t){var r=[];if(!(e&&e.length))return r;var i=-1,a=[],s=e.length;for(t=n(t,3);++i<s;){var c=e[i];t(c,i,e)&&(r.push(c),a.push(i))}return o(e,a),r}},61250:(e,t,r)=>{"use strict";r.d(t,{default:()=>o.a});var n=r(34331),o=r.n(n)},34331:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return y},handleClientScriptLoad:function(){return g},initScriptLoader:function(){return v}});let n=r(54454),o=r(45615),i=r(54568),a=n._(r(97509)),s=o._(r(7620)),c=r(4174),l=r(85498),u=r(4758),d=new Map,p=new Set,h=e=>{if(a.default.preinit){e.forEach(e=>{a.default.preinit(e,{as:"style"})});return}if("undefined"!=typeof window){let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}},f=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:o=null,dangerouslySetInnerHTML:i,children:a="",strategy:s="afterInteractive",onError:c,stylesheets:u}=e,f=r||t;if(f&&p.has(f))return;if(d.has(t)){p.add(f),d.get(t).then(n,c);return}let g=()=>{o&&o(),p.add(f)},v=document.createElement("script"),m=new Promise((e,t)=>{v.addEventListener("load",function(t){e(),n&&n.call(this,t),g()}),v.addEventListener("error",function(e){t(e)})}).catch(function(e){c&&c(e)});i?(v.innerHTML=i.__html||"",g()):a?(v.textContent="string"==typeof a?a:Array.isArray(a)?a.join(""):"",g()):t&&(v.src=t,d.set(t,m)),(0,l.setAttributesFromProps)(v,e),"worker"===s&&v.setAttribute("type","text/partytown"),v.setAttribute("data-nscript",s),u&&h(u),document.body.appendChild(v)};function g(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>f(e))}):f(e)}function v(e){e.forEach(g),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");p.add(t)})}function m(e){let{id:t,src:r="",onLoad:n=()=>{},onReady:o=null,strategy:l="afterInteractive",onError:d,stylesheets:h,...g}=e,{updateScripts:v,scripts:m,getIsSsr:y,appDir:b,nonce:w}=(0,s.useContext)(c.HeadManagerContext),E=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=t||r;E.current||(o&&e&&p.has(e)&&o(),E.current=!0)},[o,t,r]);let S=(0,s.useRef)(!1);if((0,s.useEffect)(()=>{!S.current&&("afterInteractive"===l?f(e):"lazyOnload"===l&&("complete"===document.readyState?(0,u.requestIdleCallback)(()=>f(e)):window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>f(e))})),S.current=!0)},[e,l]),("beforeInteractive"===l||"worker"===l)&&(v?(m[l]=(m[l]||[]).concat([{id:t,src:r,onLoad:n,onReady:o,onError:d,...g}]),v(m)):y&&y()?p.add(t||r):y&&!y()&&f(e)),b){if(h&&h.forEach(e=>{a.default.preinit(e,{as:"style"})}),"beforeInteractive"===l)return r?(a.default.preload(r,g.integrity?{as:"script",integrity:g.integrity,nonce:w,crossOrigin:g.crossOrigin}:{as:"script",nonce:w,crossOrigin:g.crossOrigin}),(0,i.jsx)("script",{nonce:w,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+J
1SON.stringify([r,{...g,id:t}])+")"}})):(g.dangerouslySetInnerHTML&&(g.children=g.dangerouslySetInnerHTML.__html,delete g.dangerouslySetInnerHTML),(0,i.jsx)("script",{nonce:w,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...g,id:t}])+")"}}));"afterInteractive"===l&&r&&a.default.preload(r,g.integrity?{as:"script",integrity:g.integrity,nonce:w,crossOrigin:g.crossOrigin}:{as:"script",nonce:w,crossOrigin:g.crossOrigin})}return null}Object.defineProperty(m,"__nextScript",{value:!0});let y=m;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},85498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"setAttributesFromProps",{enumerable:!0,get:function(){return i}});let r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"},n=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"];function o(e){return["async","defer","noModule"].includes(e)}function i(e,t){for(let[i,a]of Object.entries(t)){if(!t.hasOwnProperty(i)||n.includes(i)||void 0===a)continue;let s=r[i]||i.toLowerCase();"SCRIPT"===e.tagName&&o(s)?e[s]=!!a:e.setAttribute(s,String(a)),(!1===a||"SCRIPT"===e.tagName&&o(s)&&(!a||"false"===a))&&(e.setAttribute(s,""),e.removeAttribute(s))}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13167:(e,t,r)=>{e.exports=r(72344)},87653:e=>{"use strict";var t=!!("undefined"!=typeof window&&window.document&&window.document.createElement),r={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=r},28494:e=>{var t,r,n,o,i,a,s,c,l,u,d,p,h,f,g,v=!1;function m(){if(!v){v=!0;var e=navigator.userAgent,m=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Ice
1weasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),y=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),h=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),g=/Mobile/i.exec(e),d=!!/Win64/.exec(e),m){(t=m[1]?parseFloat(m[1]):m[5]?parseFloat(m[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var b=/(?:Trident\/(\d+.\d+))/.exec(e);a=b?parseFloat(b[1])+4:t,r=m[2]?parseFloat(m[2]):NaN,n=m[3]?parseFloat(m[3]):NaN,i=(o=m[4]?parseFloat(m[4]):NaN)&&(m=/(?:Chrome\/(\d+\.\d+))/.exec(e))&&m[1]?parseFloat(m[1]):NaN}else t=r=n=i=o=NaN;if(y){if(y[1]){var w=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!w||parseFloat(w[1].replace("_","."))}else s=!1;c=!!y[2],l=!!y[3]}else s=c=l=!1}}var y={ie:function(){return m()||t},ieCompatibilityMode:function(){return m()||a>t},ie64:function(){return y.ie()&&d},firefox:function(){return m()||r},opera:function(){return m()||n},webkit:function(){return m()||o},safari:function(){return y.webkit()},chrome:function(){return m()||i},windows:function(){return m()||c},osx:function(){return m()||s},linux:function(){return m()||l},iphone:function(){return m()||p},mobile:function(){return m()||p||h||u||g},nativeApp:function(){return m()||f},android:function(){return m()||u},ipad:function(){return m()||h}};e.exports=y},60516:(e,t,r)=>{"use strict";var n,o=r(87653);o.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var r="on"+e,i=r in document;if(!i){var a=document.createElement("div");a.setAttribute(r,"return;"),i="function"==typeof a[r]}return!i&&n&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},72344:(e,t,r)=>{"use strict";var n=r(28494),o=r(60516);function i(e){var t=0,r=0,n=0,o=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),n=10*t,o=10*r,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||o)&&e.deltaMode&&(1==e.deltaMode?(n*=40,o*=40):(n*=800,o*=800)),n&&!t&&(t=n<1?-1:1),o&&!r&&(r=o<1?-1:1),{spinX:t,spinY:r,pixelX:n,pixelY:o}}i.getEventType=function(){return n.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=i},72551:(e,t,r)=>{"use strict";var n=r(66100);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},13357:(e,t,r)=>{e.exports=r(72551)()},66100:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},38323:(e,t,r)=>{"use strict";r.d(t,{t:()=>o});var n=r(94940),o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return(0,n.C6)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r.closed||t.next(this._value),r},t.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(8084).B)},30244:(e,t,r)=>{"use strict";r.d(t,{m:()=>a});var n=r(94940),o=r(8084),i=r(73994),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=i.U);var o=e.call(this)||this;return o._bufferSize=t,o._windowTime=r,o._timestampProvider=n,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,t),o._windowTime=Math.max(1,r),o}return(0,n.C6)(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,o=this._infiniteTimeWindow,i=this._timestampProvider,a=this._windowTime;!r&&(n.push(t),o||n.push(i.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),o=0;o<n.length&&!e.closed;o+=r?1:2)e.next(n[o]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,o=(n?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!n){for(var i=t.now(),a=0,s=1;s<r.length&&r[s]<=i;
1s+=2)a=s;a&&r.splice(0,a+1)}},t}(o.B)},58259:(e,t,r)=>{"use strict";r.d(t,{p:()=>p});var n=r(29523),o=Array.isArray,i=Object.getPrototypeOf,a=Object.prototype,s=Object.keys,c=r(99669),l=r(1245),u=r(8191),d=r(23533);function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,l.ms)(e),p=function(e){if(1===e.length){var t=e[0];if(o(t))return{args:t,keys:null};if(t&&"object"==typeof t&&i(t)===a){var r=s(t);return{args:r.map(function(e){return t[e]}),keys:r}}}return{args:e,keys:null}}(e),h=p.args,f=p.keys,g=new n.c(function(e){var t=h.length;if(!t){e.complete();return}for(var r=Array(t),n=t,o=t,i=function(t){var i=!1;(0,c.Tg)(h[t]).subscribe((0,u._)(e,function(e){!i&&(i=!0,o--),r[t]=e},function(){return n--},void 0,function(){(!n||!i)&&(!o&&e.next(f?f.reduce(function(e,t,n){return e[t]=r[n],e},{}):r),e.complete())}))},a=0;a<t;a++)i(a)});return r?g.pipe((0,d.I)(r)):g}},64218:(e,t,r)=>{"use strict";r.d(t,{Y:()=>i});var n=r(71951),o=r(4246);function i(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.E),e<0&&(e=0),(0,o.O)(e,e,t)}},15667:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});var n=r(59173),o=r(35068),i=r(8191),a=r(99669);function s(e){return(0,n.N)(function(t,r){var n=[];return t.subscribe((0,i._)(r,function(e){return n.push(e)},function(){r.next(n),r.complete()})),(0,a.Tg)(e).subscribe((0,i._)(r,function(){var e=n;n=[],r.next(e)},o.l)),function(){n=null}})}},19083:(e,t,r)=>{"use strict";r.d(t,{j:()=>o});var n=r(59173);function o(e){return(0,n.N)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}},36232:(e,t,r)=>{"use strict";r.d(t,{u:()=>o});var n=r(7337);function o(e){return(0,n.T)(function(){return e})}},49878:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s});var n=r(59173),o=r(8191),i=r(99669),a=r(35068);function s(e){return(0,n.N)(function(t,r){(0,i.Tg)(e).subscribe((0,o._)(r,function(){return r.complete()},a.l)),r.closed||t.subscribe(r)})}},32280:e=>{var t=Object.prototype.hasOwnProperty;function r(e){return"[Throws: "+(e?e.message:"?")+"]"}function n(e){var n=[];return function e(o){if(null===o||"object"!=typeof o)return o;if(-1!==n.indexOf(o))return"[Circular]";if(n.push(o),"function"==typeof o.toJSON)try{var i=e(o.toJSON());return n.pop(),i}catch(e){return r(e)}if(Array.isArray(o)){var a=o.map(e);return n.pop(),a}var s=Object.keys(o).reduce(function(n,i){return n[i]=e(function(e,n){if(t.call(e,n))try{return e[n]}catch(e){return r(e)}return e[n]}(o,i)),n},{});return n.pop(),s}(e)}e.exports=function(e,t,r){return JSON.stringify(n(e),t,r)},e.exports.ensureProperties=n},79417:(e,t,r)=>{e.exports=r(51170).Observable},51170:(e,t)=>{"use strict";t.Observable=void 0;let r=e=>!!Symbol[e],n=e=>r(e)?Symbol[e]:"@@"+e,o=n("iterator"),i=n("observable"),a=n("species");function s(e,t){let r=e[t];if(null!=r){if("function"!=typeof r)throw TypeError(r+" is not a function");return r}}function c(e){let t=e.constructor;return void 0!==t&&null===(t=t[a])&&(t=void 0),void 0!==t?t:v}function l(e){l.log?l.log(e):setTimeout(()=>{throw e})}function u(e){Promise.resolve().then(()=>{try{e()}catch(e){l(e)}})}function d(e){let t=e._cleanup;if(void 0!==t){if(e._cleanup=void 0,!t)return;try{if("function"==typeof t)t();else{let e=s(t,"unsubscribe");e&&e.call(t)}}catch(e){l(e)}}}function p(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function h(e,t,r){e._state="running";let n=e._observer;try{let o=s(n,t);switch(t){case"next":o&&o.call(n,r);break;case"error":if(p(e),o)o.call(n,r);else throw r;break;case"complete":p(e),o&&o.call(n)}}catch(e){l(e)}"closed"===e._state?d(e):"running"===e._state&&(e._state="ready")}function f(e,t,r){if("closed"!==e._state){if("buffering"===e._state){e._queue.push({type:t,value:r});return}if("ready"!==e._state){e._state="buffering",e._queue=[{type:t,value:r}],u(()=>(function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let r=0;r<t.length&&(h(e,t[r].type,t[r].value),"closed"!==e._state);++r);}})(e));return}h(e,t,r)}}class g{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let r=this,n={get closed(){return"closed"===r._state},next(e){f(r,"next",e)},error(e){f(r,"error",e)},complete(){f(r,"complete")}};try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}
1unsubscribe(){"closed"!==this._state&&(p(this),d(this))}}class v{constructor(e){if(!(this instanceof v))throw TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return("object"!=typeof e||null===e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new g(e,this._subscriber)}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e){r(TypeError(e+" is not a function"));return}function n(){o.unsubscribe(),t()}let o=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),o.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(c(this))(t=>this.subscribe({next(r){try{r=e(r)}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(c(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=c(this),r=arguments.length>1,n=!1,o=arguments[1],i=o;return new t(t=>this.subscribe({next(o){let a=!n;if(n=!0,!a||r)try{i=e(i,o)}catch(e){return t.error(e)}else i=o},error(e){t.error(e)},complete(){if(!n&&!r)return t.error(TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=c(this);return new t(r=>{let n;let o=0;return!function i(a){n=a.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){o===e.length?(n=void 0,r.complete()):i(t.from(e[o++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=c(this);return new t(r=>{let n=[],o=this.subscribe({next(o){if(e)try{o=e(o)}catch(e){return r.error(e)}let a=t.from(o).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){let e=n.indexOf(a);e>=0&&n.splice(e,1),i()}});n.push(a)},error(e){r.error(e)},complete(){i()}});function i(){o.closed&&0===n.length&&r.complete()}return()=>{n.forEach(e=>e.unsubscribe()),o.unsubscribe()}})}[i](){return this}static from(e){let t="function"==typeof this?this:v;if(null==e)throw TypeError(e+" is not an object");let n=s(e,i);if(n){let r=n.call(e);if(Object(r)!==r)throw TypeError(r+" is not an object");return r instanceof v&&r.constructor===t?r:new t(e=>r.subscribe(e))}if(r("iterator")&&(n=s(e,o)))return new t(t=>{u(()=>{if(!t.closed){for(let r of n.call(e))if(t.next(r),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{u(()=>{if(!t.closed){for(let r=0;r<e.length;++r)if(t.next(e[r]),t.closed)return;t.complete()}})});throw TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:v)(t=>{u(()=>{if(!t.closed){for(let r=0;r<e.length;++r)if(t.next(e[r]),t.closed)return;t.complete()}})})}static get[a](){return this}}t.Observable=v,Object.defineProperty(v,Symbol("extensions"),{value:{symbol:i,hostReportError:l},configurable:!0})},97987:()=>{},72881:(e,t,r)=>{"use strict";r.d(t,{Cl:()=>n,Ju:()=>s,Tt:()=>o,YH:()=>a,fX:()=>l,sH:()=>i,zs:()=>c});var n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function i(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function a(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function l(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},53032:(e,t,r)=>{"use strict";r.d(t,{C6:()=>o,Cl:()=>i,Ju:()=>c,YH:()=>s,fX:()=>u,sH:()=>a,zs:()=>l});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function c(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function u(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},78735:(e,t,r)=>{"use strict";r.d(t,{KO:()=>C,Sx:()=>S,Wp:()=>E,j6:()=>y,om:()=>m});var n=r(77827),o=r(24464),i=r(75270),a=r(66730);class s{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(!function(e){let t=e.getComponent();return(null==t?void 0:t.type)==="VERSION"}(e))return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(" ")}}let c="@firebase/app",l="0.10.17",u=new o.Vy("@firebase/app"),d="[DEFAULT]",p={[c]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/data-connect":"fire-data-connect","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/vertexai":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},h=new Map,f=new Map,g=new Map;function v(e,t){try{e.container.addComponent(t)}catch(r){u.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function m(e){let t=e.name;if(g.has(t))return u.debug(`There were multiple attempts to register component ${t}.`),!1;
1for(let r of(g.set(t,e),h.values()))v(r,e);for(let t of f.values())v(t,e);return!0}function y(e,t){let r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}let b=new i.FA("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class w{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new n.uA("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw b.create("app-deleted",{appName:this._name})}}function E(e,t={}){let r=e;"object"!=typeof t&&(t={name:t});let o=Object.assign({name:d,automaticDataCollectionEnabled:!1},t),a=o.name;if("string"!=typeof a||!a)throw b.create("bad-app-name",{appName:String(a)});if(r||(r=(0,i.T9)()),!r)throw b.create("no-options");let s=h.get(a);if(s){if((0,i.bD)(r,s.options)&&(0,i.bD)(o,s.config))return s;throw b.create("duplicate-app",{appName:a})}let c=new n.h1(a);for(let e of g.values())c.addComponent(e);let l=new w(r,o,c);return h.set(a,l),l}function S(e=d){let t=h.get(e);if(!t&&e===d&&(0,i.T9)())return E();if(!t)throw b.create("no-app",{appName:e});return t}function C(e,t,r){var o;let i=null!==(o=p[e])&&void 0!==o?o:e;r&&(i+=`-${r}`);let a=i.match(/\s|\//),s=t.match(/\s|\//);if(a||s){let e=[`Unable to register library "${i}" with version "${t}":`];a&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),a&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),u.warn(e.join(" "));return}m(new n.uA(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}let _="firebase-heartbeat-store",T=null;function I(){return T||(T=(0,a.P2)("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(_)}catch(e){console.warn(e)}}}).catch(e=>{throw b.create("idb-open",{originalErrorMessage:e.message})})),T}async function k(e){try{let t=(await I()).transaction(_),r=await t.objectStore(_).get(x(e));return await t.done,r}catch(e){if(e instanceof i.g)u.warn(e.message);else{let t=b.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});u.warn(t.message)}}}async function A(e,t){try{let r=(await I()).transaction(_,"readwrite"),n=r.objectStore(_);await n.put(t,x(e)),await r.done}catch(e){if(e instanceof i.g)u.warn(e.message);else{let t=b.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});u.warn(t.message)}}}function x(e){return`${e.name}!${e.options.appId}`}class R{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new O(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;try{let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=P();if((null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some(e=>e.date===n))return;return this._heartbeatsCache.heartbeats.push({date:n,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{let t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache)}catch(e){u.warn(e)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)==null||0===this._heartbeatsCache.heartbeats.length)return"";let t=P(),{heartbeatsToSend:r,unsentEntries:n}=function(e,t=1024){let r=[],n=e.slice();for(let o of e){let e=r.find(e=>e.agent===o.agent);if(e){if(e.dates.push(o.date),N(r)>t){e.dates.pop();break}}else if(r.push({agent:o.agent,dates:[o.date]}),N(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}(this._heartbeatsCache.heartbeats),o=(0,i.Uj)(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(e){return u.warn(e),""}}}function P(){return new Date().toISOString().substring(0,10)}class O{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,i.zW)()&&(0,i.eX
1)().then(()=>!0).catch(()=>!1)}async read(){if(!await this._canUseIndexedDBPromise)return{heartbeats:[]};{let e=await k(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){let r=await this.read();return A(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){let r=await this.read();return A(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}}}function N(e){return(0,i.Uj)(JSON.stringify({version:2,heartbeats:e})).length}m(new n.uA("platform-logger",e=>new s(e),"PRIVATE")),m(new n.uA("heartbeat",e=>new R(e),"PRIVATE")),C(c,l,""),C(c,l,"esm2017"),C("fire-js","")},77827:(e,t,r)=>{"use strict";r.d(t,{h1:()=>s,uA:()=>o});var n=r(75270);class o{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}let i="[DEFAULT]";class a{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new n.cY;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&e.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let r=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(e){if(n)return null;throw e}else{if(n)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:i})}catch(e){}for(let[e,t]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:r});t.resolve(e)}catch(e){}}}}clearInstance(e=i){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=i){return this.instances.has(e)}getOptions(e=i){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let n=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[e,t]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(e)&&t.resolve(n);return n}onInit(e,t){var r;let n=this.normalizeInstanceIdentifier(t),o=null!==(r=this.onInitCallbacks.get(n))&&void 0!==r?r:new Set;o.add(e),this.onInitCallbacks.set(n,o);let i=this.instances.get(n);return i&&e(i,n),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let n of r)try{n(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:e===i?void 0:e,options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch(e){}return r||null}normalizeInstanceIdentifier(e=i){return this.component?this.component.multipleInstances?e:i:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class s{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new a(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},24464:(e,t,r)=>{"use strict";var n;r.d(t,{Vy:()=>l});let o=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.E
1RROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n||(n={}));let i={debug:n.DEBUG,verbose:n.VERBOSE,info:n.INFO,warn:n.WARN,error:n.ERROR,silent:n.SILENT},a=n.INFO,s={[n.DEBUG]:"log",[n.VERBOSE]:"log",[n.INFO]:"info",[n.WARN]:"warn",[n.ERROR]:"error"},c=(e,t,...r)=>{if(t<e.logLevel)return;let n=new Date().toISOString(),o=s[t];if(o)console[o](`[${n}]  ${e.name}:`,...r);else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class l{constructor(e){this.name=e,this._logLevel=a,this._logHandler=c,this._userLogHandler=null,o.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in n))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?i[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,n.DEBUG,...e),this._logHandler(this,n.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,n.VERBOSE,...e),this._logHandler(this,n.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,n.INFO,...e),this._logHandler(this,n.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,n.WARN,...e),this._logHandler(this,n.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,n.ERROR,...e),this._logHandler(this,n.ERROR,...e)}}},71606:(e,t,r)=>{"use strict";function n(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}r.d(t,{A:()=>h});var o,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(e){var t;if(!(t=i.exec(e)))throw Error("invalid format: "+e);return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function s(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function c(e,t){var r=n(e,t);if(!r)return e+"";var o=r[0],i=r[1];return i<0?"0."+Array(-i).join("0")+o:o.length>i+1?o.slice(0,i+1)+"."+o.slice(i+1):o+Array(i-o.length+2).join("0")}a.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let l={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>c(100*e,t),r:c,s:function(e,t){var r=n(e,t);if(!r)return e+"";var i=r[0],a=r[1],s=a-(o=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,c=i.length;return s===c?i:s>c?i+Array(s-c+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+Array(1-s).join("0")+n(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function u(e){return e}var d=Array.prototype.map,p=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function h(e){var t,r,i,s=void 0===e.grouping||void 0===e.thousands?u:(t=d.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var o=e.length,i=[],a=0,s=t[0],c=0;o>0&&s>0&&(c+s+1>n&&(s=Math.max(1,n-c)),i.push(e.substring(o-=s,o+s)),!((c+=s+1)>n));)s=t[a=(a+1)%t.length];return i.reverse().join(r)}),c=void 0===e.currency?"":e.currency[0]+"",h=void 0===e.currency?"":e.currency[1]+"",f=void 0===e.decimal?".":e.decimal+"",g=void 0===e.numerals?u:(i=d.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return i[+e]})}),v=void 0===e.percent?"%":e.percent+"",m=void 0===e.minus?"−":e.minus+"",y=void 0===e.nan?"NaN":e.nan+"";function b(e){var t=(e=a(e)).fill,r=e.align,n=e.sign,i=e.symbol,u=e.zero,d=e.width,b=e.comma,w=e.precision,E=e.trim,S=e.type;"n"===S?(b=!0,S="g"):l[S]||(void 0===w&&(w=12),E=!0,S="g"),(u||"0"===t&&"="===r)&&(u=!0,t="0",r="=");
1var C="$"===i?c:"#"===i&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",_="$"===i?h:/[%p]/.test(S)?v:"",T=l[S],I=/[defgprs%]/.test(S);function k(e){var i,a,c,l=C,h=_;if("c"===S)h=T(e)+h,e="";else{var v=(e=+e)<0||1/e<0;if(e=isNaN(e)?y:T(Math.abs(e),w),E&&(e=function(e){e:for(var t,r=e.length,n=1,o=-1;n<r;++n)switch(e[n]){case".":o=t=n;break;case"0":0===o&&(o=n),t=n;break;default:if(!+e[n])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),v&&0==+e&&"+"!==n&&(v=!1),l=(v?"("===n?n:m:"-"===n||"("===n?"":n)+l,h=("s"===S?p[8+o/3]:"")+h+(v&&"("===n?")":""),I){for(i=-1,a=e.length;++i<a;)if(48>(c=e.charCodeAt(i))||c>57){h=(46===c?f+e.slice(i+1):e.slice(i))+h,e=e.slice(0,i);break}}}b&&!u&&(e=s(e,1/0));var k=l.length+e.length+h.length,A=k<d?Array(d-k+1).join(t):"";switch(b&&u&&(e=s(A+e,A.length?d-h.length:1/0),A=""),r){case"<":e=l+e+h+A;break;case"=":e=l+A+e+h;break;case"^":e=A.slice(0,k=A.length>>1)+l+e+h+A.slice(k);break;default:e=A+l+e+h}return g(e)}return w=void 0===w?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w)),k.toString=function(){return e+""},k}return{format:b,formatPrefix:function(e,t){var r,o=b(((e=a(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(((r=n(Math.abs(r=t)))?r[1]:NaN)/3))),s=Math.pow(10,-i),c=p[8+i/3];return function(e){return o(s*e)+c}}}}},72928:(e,t,r)=>{"use strict";let n,o,i,a;r.d(t,{P5:()=>eS,$s:()=>eC});var s=r(78735),c=r(24464),l=r(75270),u=r(77827),d=r(66730);let p="@firebase/installations",h="0.6.11",f=`w:${h}`,g="FIS_v2",v=new l.FA("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function m(e){return e instanceof l.g&&e.code.includes("request-failed")}function y({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function b(e){return{token:e.token,requestStatus:2,expiresIn:Number(e.expiresIn.replace("s","000")),creationTime:Date.now()}}async function w(e,t){let r=(await t.json()).error;return v.create("request-failed",{requestName:e,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function E({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}async function S(e){let t=await e();return t.status>=500&&t.status<600?e():t}async function C({appConfig:e,heartbeatServiceProvider:t},{fid:r}){let n=y(e),o=E(e),i=t.getImmediate({optional:!0});if(i){let e=await i.getHeartbeatsHeader();e&&o.append("x-firebase-client",e)}let a={method:"POST",headers:o,body:JSON.stringify({fid:r,authVersion:g,appId:e.appId,sdkVersion:f})},s=await S(()=>fetch(n,a));if(s.ok){let e=await s.json();return{fid:e.fid||r,registrationStatus:2,refreshToken:e.refreshToken,authToken:b(e.authToken)}}throw await w("Create Installation",s)}function _(e){return new Promise(t=>{setTimeout(t,e)})}let T=/^[cdef][\w-]{21}$/;function I(e){return`${e.appName}!${e.appId}`}let k=new Map;function A(e,t){let r=I(e);x(r,t),function(e,t){let r=(!R&&"BroadcastChannel"in self&&((R=new BroadcastChannel("[Firebase] FID Change")).onmessage=e=>{x(e.data.key,e.data.fid)}),R);r&&r.postMessage({key:e,fid:t}),0===k.size&&R&&(R.close(),R=null)}(r,t)}function x(e,t){let r=k.get(e);if(r)for(let e of r)e(t)}let R=null,P="firebase-installations-store",O=null;function N(){return O||(O=(0,d.P2)("firebase-installations-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(P)}})),O}async function M(e,t){let r=I(e),n=(await N()).transaction(P,"readwrite"),o=n.objectStore(P),i=await o.get(r);return await o.put(t,r),await n.done,i&&i.fid===t.fid||A(e,t.fid),t}async function D(e){let t=I(e),r=(await N()).transaction(P,"readwrite");await r.objectStore(P).delete(t),await r.done}async function L(e,t){let r=I(e),n=(await N()).transaction(P,"readwrite"),o=n.objectStore(P),i=await o.get(r),a=t(i);return void 0===a?await o.delete(r):await o.put(a,r),await n.done,a&&(!i||i.fid!==a.fid)&&A(e,a.fid),a}async function U(e){let t;let r=await L(e.appConfig,r=>{let n=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(v.create("app-offline"))};let r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=q(e,r);return{installationEntry:r,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:H(e)}:{installationEntry:t}}(e,j(r||{fid:function(){try{let e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;let t=btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22);return T.test(t)?t:""}catch(e){return""}}(),registrationStatus:0}));return t=n.registrationPromise,n.installationEntry});
1return""===r.fid?{installationEntry:await t}:{installationEntry:r,registrationPromise:t}}async function q(e,t){try{let r=await C(e,t);return M(e.appConfig,r)}catch(r){throw m(r)&&409===r.customData.serverCode?await D(e.appConfig):await M(e.appConfig,{fid:t.fid,registrationStatus:0}),r}}async function H(e){let t=await F(e.appConfig);for(;1===t.registrationStatus;)await _(100),t=await F(e.appConfig);if(0===t.registrationStatus){let{installationEntry:t,registrationPromise:r}=await U(e);return r||t}return t}function F(e){return L(e,e=>{if(!e)throw v.create("installation-not-found");return j(e)})}function j(e){return 1===e.registrationStatus&&e.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e}async function z({appConfig:e,heartbeatServiceProvider:t},r){let n=function(e,{fid:t}){return`${y(e)}/${t}/authTokens:generate`}(e,r),o=function(e,{refreshToken:t}){let r=E(e);return r.append("Authorization",`${g} ${t}`),r}(e,r),i=t.getImmediate({optional:!0});if(i){let e=await i.getHeartbeatsHeader();e&&o.append("x-firebase-client",e)}let a={method:"POST",headers:o,body:JSON.stringify({installation:{sdkVersion:f,appId:e.appId}})},s=await S(()=>fetch(n,a));if(s.ok)return b(await s.json());throw await w("Generate Auth Token",s)}async function B(e,t=!1){let r;let n=await L(e.appConfig,n=>{var o;if(!V(n))throw v.create("not-registered");let i=n.authToken;if(!t&&2===(o=i).requestStatus&&!function(e){let t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+36e5}(o))return n;if(1===i.requestStatus)return r=K(e,t),n;{if(!navigator.onLine)throw v.create("app-offline");let t=function(e){let t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(n);return r=Y(e,t),t}});return r?await r:n.authToken}async function K(e,t){let r=await G(e.appConfig);for(;1===r.authToken.requestStatus;)await _(100),r=await G(e.appConfig);let n=r.authToken;return 0===n.requestStatus?B(e,t):n}function G(e){return L(e,e=>{var t;if(!V(e))throw v.create("not-registered");return 1===(t=e.authToken).requestStatus&&t.requestTime+1e4<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function Y(e,t){try{let r=await z(e,t),n=Object.assign(Object.assign({},t),{authToken:r});return await M(e.appConfig,n),r}catch(r){if(m(r)&&(401===r.customData.serverCode||404===r.customData.serverCode))await D(e.appConfig);else{let r=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await M(e.appConfig,r)}throw r}}function V(e){return void 0!==e&&2===e.registrationStatus}async function W(e){let{installationEntry:t,registrationPromise:r}=await U(e);return r?r.catch(console.error):B(e).catch(console.error),t.fid}async function J(e,t=!1){return await $(e),(await B(e,t)).token}async function $(e){let{registrationPromise:t}=await U(e);t&&await t}function Q(e){return v.create("missing-app-config-values",{valueName:e})}let X="installations";(0,s.om)(new u.uA(X,e=>{let t=e.getProvider("app").getImmediate(),r=function(e){if(!e||!e.options)throw Q("App Configuration");if(!e.name)throw Q("App Name");for(let t of["projectId","apiKey","appId"])if(!e.options[t])throw Q(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),n=(0,s.j6)(t,"heartbeat");return{app:t,appConfig:r,heartbeatServiceProvider:n,_delete:()=>Promise.resolve()}},"PUBLIC")),(0,s.om)(new u.uA("installations-internal",e=>{let t=e.getProvider("app").getImmediate(),r=(0,s.j6)(t,X).getImmediate();return{getId:()=>W(r),getToken:e=>J(r,e)}},"PRIVATE")),(0,s.KO)(p,h),(0,s.KO)(p,h,"esm2017");let Z="analytics",ee="https://www.googletagmanager.com/gtag/js",et=new c.Vy("@firebase/analytics"),er=new l.FA("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}
1","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});function en(e){if(!e.startsWith(ee)){let t=er.create("invalid-gtag-resource",{gtagURL:e});return et.warn(t.message),""}return e}function eo(e){return Promise.all(e.map(e=>e.catch(e=>e)))}async function ei(e,t,r,n,o,i){let a=n[o];try{if(a)await t[a];else{let e=(await eo(r)).find(e=>e.measurementId===o);e&&await t[e.appId]}}catch(e){et.error(e)}e("config",o,i)}async function ea(e,t,r,n,o){try{let i=[];if(o&&o.send_to){let e=o.send_to;Array.isArray(e)||(e=[e]);let n=await eo(r);for(let r of e){let e=n.find(e=>e.measurementId===r),o=e&&t[e.appId];if(o)i.push(o);else{i=[];break}}}0===i.length&&(i=Object.values(t)),await Promise.all(i),e("event",n,o||{})}catch(e){et.error(e)}}class es{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}let ec=new es;async function el(e){var t;let{appId:r,apiKey:n}=e,o={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":n})},i="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",r),a=await fetch(i,o);if(200!==a.status&&304!==a.status){let e="";try{let r=await a.json();(null===(t=r.error)||void 0===t?void 0:t.message)&&(e=r.error.message)}catch(e){}throw er.create("config-fetch-failed",{httpStatus:a.status,responseMessage:e})}return a.json()}async function eu(e,t=ec,r){let{appId:n,apiKey:o,measurementId:i}=e.options;if(!n)throw er.create("no-app-id");if(!o){if(i)return{measurementId:i,appId:n};throw er.create("no-api-key")}let a=t.getThrottleMetadata(n)||{backoffCount:0,throttleEndTimeMillis:Date.now()},s=new ep;return setTimeout(async()=>{s.abort()},void 0!==r?r:6e4),ed({appId:n,apiKey:o,measurementId:i},a,s,t)}async function ed(e,{throttleEndTimeMillis:t,backoffCount:r},n,o=ec){var i;let{appId:a,measurementId:s}=e;try{await new Promise((e,r)=>{let o=setTimeout(e,Math.max(t-Date.now(),0));n.addEventListener(()=>{clearTimeout(o),r(er.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}catch(e){if(s)return et.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${s} provided in the "measurementId" field in the local Firebase config. [${null==e?void 0:e.message}]`),{appId:a,measurementId:s};throw e}try{let t=await el(e);return o.deleteThrottleMetadata(a),t}catch(u){if(!function(e){if(!(e instanceof l.g)||!e.customData)return!1;let t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(u)){if(o.deleteThrottleMetadata(a),s)return et.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${s} provided in the "measurementId" field in the local Firebase config. [${null==u?void 0:u.message}]`),{appId:a,measurementId:s};throw u}let t=503===Number(null===(i=null==u?void 0:u.customData)||void 0===i?void 0:i.httpStatus)?(0,l.p9)(r,o.intervalMillis,30):(0,l.p9)(r,o.intervalMillis),c={throttleEndTimeMillis:Date.now()+t,backoffCount:r+1};return o.setThrottleMetadata(a,c),et.debug(`Calling attemptFetch again in ${t} millis`),ed(e,c,n,o)}}class ep{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}
1abort(){this.listeners.forEach(e=>e())}}async function eh(e,t,r,n,o){if(o&&o.global){e("event",r,n);return}{let o=await t;e("event",r,Object.assign(Object.assign({},n),{send_to:o}))}}async function ef(){if(!(0,l.zW)())return et.warn(er.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await (0,l.eX)()}catch(e){return et.warn(er.create("indexeddb-unavailable",{errorInfo:null==e?void 0:e.toString()}).message),!1}return!0}async function eg(e,t,r,i,a,s,c){var l;let u=eu(e);u.then(t=>{r[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&et.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(e=>et.error(e)),t.push(u);let d=ef().then(e=>e?i.getId():void 0),[p,h]=await Promise.all([u,d]);!function(e){for(let t of Object.values(window.document.getElementsByTagName("script")))if(t.src&&t.src.includes(ee)&&t.src.includes(e))return t;return null}(s)&&function(e,t){var r,n;let o;let i=(r="firebase-js-sdk-policy",n={createScriptURL:en},window.trustedTypes&&(o=window.trustedTypes.createPolicy(r,n)),o),a=document.createElement("script"),s=`${ee}?l=${e}&id=${t}`;a.src=i?null==i?void 0:i.createScriptURL(s):s,a.async=!0,document.head.appendChild(a)}(s,p.measurementId),o&&(a("consent","default",o),o=void 0),a("js",new Date);let f=null!==(l=null==c?void 0:c.config)&&void 0!==l?l:{};return f.origin="firebase",f.update=!0,null!=h&&(f.firebase_id=h),a("config",p.measurementId,f),n&&(a("set",n),n=void 0),p.measurementId}class ev{constructor(e){this.app=e}_delete(){return delete em[this.app.options.appId],Promise.resolve()}}let em={},ey=[],eb={},ew="dataLayer",eE=!1;function eS(e=(0,s.Sx)()){e=(0,l.Ku)(e);let t=(0,s.j6)(e,Z);return t.isInitialized()?t.getImmediate():function(e,t={}){let r=(0,s.j6)(e,Z);if(r.isInitialized()){let e=r.getImmediate();if((0,l.bD)(t,r.getOptions()))return e;throw er.create("already-initialized")}return r.initialize({options:t})}(e)}function eC(e,t,r,n){e=(0,l.Ku)(e),eh(a,em[e.app.options.appId],t,r,n).catch(e=>et.error(e))}let e_="@firebase/analytics",eT="0.10.10";(0,s.om)(new u.uA(Z,(e,{options:t})=>(function(e,t,r){!function(){let e=[];
1if((0,l.sr)()&&e.push("This is a browser extension environment."),(0,l.dM)()||e.push("Cookies are not available."),e.length>0){let t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),r=er.create("invalid-analytics-context",{errorInfo:t});et.warn(r.message)}}();let n=e.options.appId;if(!n)throw er.create("no-app-id");if(!e.options.apiKey){if(e.options.measurementId)et.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw er.create("no-api-key")}if(null!=em[n])throw er.create("already-exists",{id:n});if(!eE){var o,s;let e,t;e=[],Array.isArray(window[ew])?e=window[ew]:window[ew]=e;let{wrappedGtag:r,gtagCore:n}=(o="gtag",t=function(...e){window[ew].push(arguments)},window[o]&&"function"==typeof window[o]&&(t=window[o]),window[o]=(s=t,async function(e,...t){try{if("event"===e){let[e,r]=t;await ea(s,em,ey,e,r)}else if("config"===e){let[e,r]=t;await ei(s,em,ey,eb,e,r)}else if("consent"===e){let[e,r]=t;s("consent",e,r)}else if("get"===e){let[e,r,n]=t;s("get",e,r,n)}else if("set"===e){let[e]=t;s("set",e)}else s(e,...t)}catch(e){et.error(e)}}),{gtagCore:t,wrappedGtag:window[o]});a=r,i=n,eE=!0}return em[n]=eg(e,ey,eb,t,i,ew,r),new ev(e)})(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),(0,s.om)(new u.uA("analytics-internal",function(e){try{let t=e.getProvider(Z).getImmediate();return{logEvent:(e,r,n)=>eC(t,e,r,n)}}catch(e){throw er.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),(0,s.KO)(e_,eT),(0,s.KO)(e_,eT,"esm2017")},66730:(e,t,r)=>{"use strict";let n,o;r.d(t,{P2:()=>f});let i=(e,t)=>t.some(t=>e instanceof t),a=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("objectStoreNames"===t)return e.objectStoreNames||c.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return p(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(p(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&a.set(t,e)}).catch(()=>{}),u.set(t,e),t}(e);if(l.has(e))return l.get(e);let r="function"==typeof(t=e)?t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(o||(o=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(h(this),e),p(a.get(this))}:function(...e){return p(t.apply(h(this),e))}:function(e,...r){let n=t.call(h(this),e,...r);return c.set(n,e.sort?e.sort():[e]),p(n)}:(t instanceof IDBTransaction&&function(e){if(s.has(e))return;let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});s.set(e,t)}(t),i(t,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,d):t;return r!==e&&(l.set(e,r),u.set(r,e)),r}let h=e=>u.get(e);function f(e,t,{blocked:r,upgrade:n,blocking:o,terminated:i}={}){let a=indexedDB.open(e,t),s=p(a);return n&&a.addEventListener("upgradeneeded",e=>{n(p(a.result),e.oldVersion,e.newVersion,p(a.transaction),e)}),r&&a.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),s.then(e=>{i&&e.addEventListener("close",()=>i()),o&&e.addEventListener("versionchange",e=>o(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}let g=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],m=new Map;function y(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(m.get(t))return m.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,o=v.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||g.includes(r)))return;let i=async function(e,...t){let i=this.transaction(e,o?"readwrite":"readonly"),a=i.store;
1return n&&(a=a.index(t.shift())),(await Promise.all([a[r](...t),o&&i.done]))[0]};return m.set(t,i),i}d=(e=>({...e,get:(t,r,n)=>y(t,r)||e.get(t,r,n),has:(t,r)=>!!y(t,r)||e.has(t,r)}))(d)},31266:(e,t,r)=>{"use strict";r.d(t,{O4:()=>R,VB:()=>ei});var n=r(7620),o=r(13357);function i(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;let a
vendor: 41,168 bytes, line 1
1=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function 
1s(e,t,r){let n=function(e){let{name:t}=e;if(t&&-1!==t.lastIndexOf(".")&&!e.type){let r=t.split(".").pop().toLowerCase(),n=a.get(r);n&&Object.defineProperty(e,"type",{value:n,writable:!1,configurable:!1,enumerable:!0})}return e}(e),{webkitRelativePath:o}=e,i="string"==typeof t?t:"string"==typeof o&&o.length>0?o:`./${e.name}`;return"string"!=typeof n.path&&c(n,"path",i),void 0!==r&&Object.defineProperty(n,"handle",{value:r,writable:!1,configurable:!1,enumerable:!0}),c(n,"relativePath",i),n}function c(e,t,r){Object.defineProperty(e,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}let l=[".DS_Store","Thumbs.db"];function u(e){return"object"==typeof e&&null!==e}function d(e){return e.filter(e=>-1===l.indexOf(e.name))}function p(e){if(null===e)return[];let t=[];for(let r=0;r<e.length;r++){let n=e[r];t.push(n)}return t}function h(e){if("function"!=typeof e.webkitGetAsEntry)return f(e);let t=e.webkitGetAsEntry();return t&&t.isDirectory?v(t):f(e,t)}function f(e,t){return i(this,void 0,void 0,function*(){var r;if(globalThis.isSecureContext&&"function"==typeof e.getAsFileSystemHandle){let t=yield e.getAsFileSystemHandle();if(null===t)throw Error(`${e} is not a File`);if(void 0!==t){let e=yield t.getFile();return e.handle=t,s(e)}}let n=e.getAsFile();if(!n)throw Error(`${e} is not a File`);return s(n,null!==(r=null==t?void 0:t.fullPath)&&void 0!==r?r:void 0)})}function g(e){return i(this,void 0,void 0,function*(){return e.isDirectory?v(e):function(e){return i(this,void 0,void 0,function*(){return new Promise((t,r)=>{e.file(r=>{t(s(r,e.fullPath))},e=>{r(e)})})})}(e)})}function v(e){let t=e.createReader();return new Promise((e,r)=>{let n=[];!function o(){t.readEntries(t=>i(this,void 0,void 0,function*(){if(t.length){let e=Promise.all(t.map(g));n.push(e),o()}else try{let t=yield Promise.all(n);e(t)}catch(e){r(e)}}),e=>{r(e)})}()})}var m=r(35278);function y(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){E(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return i}}(e,t)||C(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(e,t)}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var T="function"==typeof m?m:m.default,I="file-invalid-type",k="file-too-large",A="file-too-small",x="too-many-files",R={FileInvalidType:I,FileTooLarge:k,FileTooSmall:A,TooManyFiles:x},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(","),r=t.length>1?"one of ".concat(t.join(", ")):t[0];return{code:I,message:"File type must be ".concat(r)}},O=function(e){return{code:k,message:"File is larger than ".concat(e," ").concat(1===e?"byte":"bytes")}},N=function(e){return{code:A,message:"File is smaller than ".concat(e," ").concat(1===e?"byte":"bytes")}},M={code:x,message:"Too many files"};function D(e,t){var r="application/x-moz-file"===e.type||T(e,t)||""===e.type&&"function"==typeof e.getAsFile;return[r,r?null:P(t)]}function L(e,t,r){if(U(e.size)){if(U(t)&&U(r)){if(e.size>r)return[!1,O(r)];if(e.size<t)return[!1,N(t)]}else if(U(t)&&e.size<t)return[!1,N(t)];else if(U(r)&&e.size>r)return[!1,O(r)]}return[!0,null]}function U(e){return null!=e}function q(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function H(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(e){return"Files"===e||"application/x-moz-file"===e}):!!e.target&&!!e.target.files}function F(e){e.preventDefault()}function j(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return t.some(function(t){return!q(e)&&t&&t.apply(void 0,[e].concat(n)),q(e)})}}function z(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||"application/*"===e||/\w+\/[-+.\w]+/g.test(e)}function B(e){return/^.*\.[\w]+$/.test(e)}var K=["children"],G=["open"],Y=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],V=["refKey","onChange","onClick"];function W(e){return function(e){if(Array.isArray(e))return Q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return i}}(e,t)||$(e,t)||function(){throw TypeError("Invalid attempt to de
1structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return Q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q(e,t)}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(t){ee(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function et(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var er=(0,n.forwardRef)(function(e,t){var r=e.children,o=ei(et(e,K)),i=o.open,a=et(o,G);return(0,n.useImperativeHandle)(t,function(){return{open:i}},[i]),n.createElement(n.Fragment,null,r(Z(Z({},a),{},{open:i})))});er.displayName="Dropzone";var en={disabled:!1,getFilesFromEvent:function(e){return i(this,void 0,void 0,function*(){return u(e)&&u(e.dataTransfer)?function(e,t){return i(this,void 0,void 0,function*(){if(e.items){let r=p(e.items).filter(e=>"file"===e.kind);return"drop"!==t?r:d(function e(t){return t.reduce((t,r)=>[...t,...Array.isArray(r)?e(r):[r]],[])}((yield Promise.all(r.map(h)))))}return d(p(e.files).map(e=>s(e)))})}(e.dataTransfer,e.type):u(e)&&u(e.target)?p(e.target.files).map(e=>s(e)):Array.isArray(e)&&e.every(e=>"getFile"in e&&"function"==typeof e.getFile)?function(e){return i(this,void 0,void 0,function*(){return(yield Promise.all(e.map(e=>e.getFile()))).map(e=>s(e))})}(e):[]})},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};er.defaultProps=en,er.propTypes={children:o.func,accept:o.objectOf(o.arrayOf(o.string)),multiple:o.bool,preventDropOnDocument:o.bool,noClick:o.bool,noKeyboard:o.bool,noDrag:o.bool,noDragEventsBubbling:o.bool,minSize:o.number,maxSize:o.number,maxFiles:o.number,disabled:o.bool,getFilesFromEvent:o.func,onFileDialogCancel:o.func,onFileDialogOpen:o.func,useFsAccessApi:o.bool,autoFocus:o.bool,onDragEnter:o.func,onDragLeave:o.func,onDragOver:o.func,onDrop:o.func,onDropAccepted:o.func,onDropRejected:o.func,onError:o.func,validator:o.func};var eo={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function ei(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Z(Z({},en),e),r=t.accept,o=t.disabled,i=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,c=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,h=t.onDrop,f=t.onDropAccepted,g=t.onDropRejected,v=t.onFileDialogCancel,m=t.onFileDialogOpen,b=t.useFsAccessApi,C=t.autoFocus,_=t.preventDropOnDocument,T=t.noClick,I=t.noKeyboard,k=t.noDrag,A=t.noDragEventsBubbling,x=t.onError,R=t.validator,P=(0,n.useMemo)(function(){return function(e){if(U(e))return Object.entries(e).reduce(function(e,t){var r=S(t,2),n=r[0],o=r[1];return[].concat(y(e),[n],y(o))},[]).filter(function(e){return z(e)||B(e)}).join(",")}(r)},[r]),O=(0,n.useMemo)(function(){return U(r)?[{description:"Files",accept:Object.entries(r).filter(function(e){var t=S(e,2),r=t[0],n=t[1],o=!0;return z(r)||(console.warn('Skipped "'.concat(r,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),Array.isArray(n)&&n.every(B)||(console.warn('Skipped "'.concat(r,'" because an invali
1d file extension was provided.')),o=!1),o}).reduce(function(e,t){var r=S(t,2),n=r[0],o=r[1];return w(w({},e),{},E({},n,o))},{})}]:r},[r]),N=(0,n.useMemo)(function(){return"function"==typeof m?m:es},[m]),K=(0,n.useMemo)(function(){return"function"==typeof v?v:es},[v]),G=(0,n.useRef)(null),$=(0,n.useRef)(null),Q=J((0,n.useReducer)(ea,eo),2),X=Q[0],er=Q[1],ei=X.isFocused,ec=X.isFileDialogActive,el=(0,n.useRef)("undefined"!=typeof window&&window.isSecureContext&&b&&"showOpenFilePicker"in window),eu=function(){!el.current&&ec&&setTimeout(function(){$.current&&!$.current.files.length&&(er({type:"closeDialog"}),K())},300)};(0,n.useEffect)(function(){return window.addEventListener("focus",eu,!1),function(){window.removeEventListener("focus",eu,!1)}},[$,ec,K,el]);var ed=(0,n.useRef)([]),ep=(0,n.useRef)([]),eh=function(e){G.current&&G.current.contains(e.target)||(e.preventDefault(),ed.current=[])};(0,n.useEffect)(function(){return _&&(document.addEventListener("dragover",F,!1),document.addEventListener("drop",eh,!1)),function(){_&&(document.removeEventListener("dragover",F),document.removeEventListener("drop",eh))}},[G,_]),(0,n.useEffect)(function(){var e=function(e){ep.current=[].concat(W(ep.current),[e.target]),H(e)&&er({isDragGlobal:!0,type:"setDragGlobal"})},t=function(e){ep.current=ep.current.filter(function(t){return t!==e.target&&null!==t}),ep.current.length>0||er({isDragGlobal:!1,type:"setDragGlobal"})},r=function(){ep.current=[],er({isDragGlobal:!1,type:"setDragGlobal"})},n=function(){ep.current=[],er({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",e,!1),document.addEventListener("dragleave",t,!1),document.addEventListener("dragend",r,!1),document.addEventListener("drop",n,!1),function(){document.removeEventListener("dragenter",e),document.removeEventListener("dragleave",t),document.removeEventListener("dragend",r),document.removeEventListener("drop",n)}},[G]),(0,n.useEffect)(function(){return!o&&C&&G.current&&G.current.focus(),function(){}},[G,C,o]);var ef=(0,n.useCallback)(function(e){x?x(e):console.error(e)},[x]),eg=(0,n.useCallback)(function(e){e.preventDefault(),e.persist(),eA(e),ed.current=[].concat(W(ed.current),[e.target]),H(e)&&Promise.resolve(i(e)).then(function(t){if(!q(e)||A){var r,n,o,i,d,p,h,f,g=t.length,v=g>0&&(n=(r={files:t,accept:P,minSize:s,maxSize:a,multiple:c,maxFiles:l,validator:R}).files,o=r.accept,i=r.minSize,d=r.maxSize,p=r.multiple,h=r.maxFiles,f=r.validator,(!!p||!(n.length>1))&&(!p||!(h>=1)||!(n.length>h))&&n.every(function(e){var t=S(D(e,o),1)[0],r=S(L(e,i,d),1)[0],n=f?f(e):null;return t&&r&&!n}));er({isDragAccept:v,isDragReject:g>0&&!v,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e)}}).catch(function(e){return ef(e)})},[i,u,ef,A,P,s,a,c,l,R]),ev=(0,n.useCallback)(function(e){e.preventDefault(),e.persist(),eA(e);var t=H(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return t&&p&&p(e),!1},[p,A]),em=(0,n.useCallback)(function(e){e.preventDefault(),e.persist(),eA(e);var t=ed.current.filter(function(e){return G.current&&G.current.contains(e)}),r=t.indexOf(e.target);-1!==r&&t.splice(r,1),ed.current=t,!(t.length>0)&&(er({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),H(e)&&d&&d(e))},[G,d,A]),ey=(0,n.useCallback)(function(e,t){var r=[],n=[];e.forEach(function(e){var t=J(D(e,P),2),o=t[0],i=t[1],c=J(L(e,s,a),2),l=c[0],u=c[1],d=R?R(e):null;if(o&&l&&!d)r.push(e);else{var p=[i,u];d&&(p=p.concat(d)),n.push({file:e,errors:p.filter(function(e){return e})})}}),(!c&&r.length>1||c&&l>=1&&r.length>l)&&(r.forEach(function(e){n.push({file:e,errors:[M]})}),r.splice(0)),er({acceptedFiles:r,fileRejections:n,type:"setFiles"}),h&&h(r,n,t),n.length>0&&g&&g(n,t),r.length>0&&f&&f(r,t)},[er,c,P,s,a,l,h,f,g,R]),eb=(0,n.useCallback)(function(e){e.preventDefault(),e.persist(),eA(e),ed.current=[],H(e)&&Promise.resolve(i(e)).then(function(t){(!q(e)||A)&&ey(t,e)}).catch(function(e){return ef(e)}),er({type:"reset"})},[i,ey,ef,A]),ew=(0,n.useCallback)(function(){if(el.current){er({type:"openDialog"}),N(),window.showOpenFilePicker({multiple:c,types:O}).then(function(e){return i(e)}).then(function(e){ey(e,null),er({type:"closeDialog"})}).catch(function(e){e instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)?(K(e),er({type:"closeDialog"})):e instanceof DOMException&&("SecurityError"===e.name||e.code===e.SECURITY_ERR)?(el.current=!1,$.current?($.current.value=null,$.current.click()):ef(Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ef(e)});return}$.current&&(er({type:"openDialog"}),N(),$.current.value=null,$.current.click())},[er,N,K,b,ey,ef,O,c]),eE=(0,n.useCallback)(function(e){G.current&&G.current.isEqualNode(e.target)&&(" "===e.key||"Enter"===e.key||32===e.keyCode||13===e.keyCode)&&(e.preventDefault(),ew())},[G,ew]),eS=(0,n.useCallback)(function(){er({type:"focus"})},[]),eC=(0,n.useCallback)(function(){er({type:"blur"})},[]),e_=(0,n.useCallback)(function(){T||(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return -1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/")}()?setTimeout(ew,0):ew())},[T,ew]),eT=function(e){return o?null:e},eI=function(e){return I?null:eT(e)},ek=function(e){return k?null:eT(e)},eA=function(e){A&&e.stopPropagation()},ex=(0,n.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=e.role,n=e.onKeyDown,i=e.onFocus,a=e.onBlur,s=e.onClick,c=e.onDragEnter,l=e.onDragOver,u=e.onDragLeave,d=e.onDrop,p=et(e,Y);
1return Z(Z(ee({onKeyDown:eI(j(n,eE)),onFocus:eI(j(i,eS)),onBlur:eI(j(a,eC)),onClick:eT(j(s,e_)),onDragEnter:ek(j(c,eg)),onDragOver:ek(j(l,ev)),onDragLeave:ek(j(u,em)),onDrop:ek(j(d,eb)),role:"string"==typeof r&&""!==r?r:"presentation"},void 0===t?"ref":t,G),o||I?{}:{tabIndex:0}),p)}},[G,eE,eS,eC,e_,eg,ev,em,eb,I,k,o]),eR=(0,n.useCallback)(function(e){e.stopPropagation()},[]),eP=(0,n.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,r=e.onChange,n=e.onClick,o=et(e,V);return Z(Z({},ee({accept:P,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:eT(j(r,eb)),onClick:eT(j(n,eR)),tabIndex:-1},void 0===t?"ref":t,$)),o)}},[$,r,c,eb,o]);return Z(Z({},X),{},{isFocused:ei&&!o,getRootProps:ex,getInputProps:eP,rootRef:G,inputRef:$,open:eT(ew)})}function ea(e,t){switch(t.type){case"focus":return Z(Z({},e),{},{isFocused:!0});case"blur":return Z(Z({},e),{},{isFocused:!1});case"openDialog":return Z(Z({},eo),{},{isFileDialogActive:!0});case"closeDialog":return Z(Z({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Z(Z({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Z(Z({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:!1});case"setDragGlobal":return Z(Z({},e),{},{isDragGlobal:t.isDragGlobal});case"reset":return Z({},eo);default:return e}}function es(){}},46649:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>m});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create,Object.create;var i=("function"==typeof SuppressedError&&SuppressedError,r(7620)),a=r(13167);function s(e,t,r,n,o){void 0===o&&(o=0);var i=f(t.width,t.height,o),a=i.width,s=i.height;return{x:c(e.x,a,r.width,n),y:c(e.y,s,r.height,n)}}function c(e,t,r,n){var o=t*n/2-r/2;return g(e,-o,o)}function l(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function u(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function d(e,t){return Math.min(e,Math.max(0,t))}function p(e,t){return t}function h(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function f(e,t,r){var n=r*Math.PI/180;return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}function g(e,t,r){return Math.min(Math.max(e,t),r)}function v(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&e.length>0}).join(" ").trim()}var m=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.cropperRef=i.createRef(),r.imageRef=i.createRef(),r.videoRef=i.createRef(),r.containerPosition={x:0,y:0},r.containerRef=null,r.styleRef=null,r.containerRect=null,r.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},r.dragStartPosition={x:0,y:0},r.dragStartCrop={x:0,y:0},r.gestureZoomStart=0,r.gestureRotationStart=0,r.isTouching=!1,r.lastPinchDistance=0,r.lastPinchRotation=0,r.rafDragTimeout=null,r.rafPinchTimeout=null,r.wheelTimer=null,r.currentDoc="undefined"!=typeof document?document:null,r.currentWindow="undefined"!=typeof window?window:null,r.resizeObserver=null,r.previousCropSize=null,r.isInitialized=!1,r.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},r.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&r.containerRef){var e=!0;r.resizeObserver=new window.ResizeObserver(function(t){if(e){e=!1;return}r.computeSizes()}),r.resizeObserver.observe(r.containerRef)}},r.preventZoomSafari=function(e){return e.preventDefault()},r.cleanEvents=function(){r.currentDoc&&(r.currentDoc.removeEventListener("mousemove",r.onMouseMove),r.currentDoc.removeEventListener("mouseup",r.onDragStopped),r.currentDoc.removeEventListener("touchmove",r.onTouchMove),r.currentDoc.removeEventListener("touchend",r.onDragStopped),r.currentDoc.removeEventListener("gesturechange",r.onGestureChange),r.currentDoc.removeEventListener("gestureend",r.onGestureEnd),r.currentDoc.removeEventListener("scroll",r.onScroll))},r.clearScrollEvent=function(){r.containerRef&&r.containerRef.removeEventListener("wheel",r.onWheel),r.wheelTimer&&clearTimeout(r.wheelTimer)},r.onMediaLoad=function(){var e=r.computeSizes();e&&(r.previousCropSize=e,r.emitCropData(),r.setInitialCrop(e),r.isInitialized=!0),r.props.onMediaLoaded&&r.props.onMediaLoaded(r.mediaSize)},r.setInitialCrop=function(e){if(r.props.initialCroppedAreaPercentages){var t,n,o,i,a,s,c,l=(t=r.props.initialCroppedAreaPercentages,n=r.mediaSize,o=r.props.rotation,i=r.props.minZoom,a=r.props.maxZoom,s=f(n.width,n.height,o),{crop:{x:(c=g(e.width/s.width*(100/t.width),i,a))*s.width/2-e.width/2-s.width*c*(t.x/100),y:c*s.height/2-e.height/2-s.height*c*(t.y/100)},zoom:c}),u=l.crop,d=l.zoom;r.props.onCropChange(u),r.props.onZoomChange&&r.props.onZoomChange(d)}else if(r.props.initialCroppedAreaPixels){var p,h,v,m,y,b,w,E,S,C=(p=r.props.initialCroppedAreaPixels,h=r.mediaSize,v=r.props.rotation,m=r.props.minZoom,y=r.props.maxZoom,void 0===v&&(v=0),b=f(h.naturalWi
1dth,h.naturalHeight,v),E=g((w=h.width>h.height?h.width/h.naturalWidth:h.height/h.naturalHeight,e.height>e.width?e.height/(p.height*w):e.width/(p.width*w)),m,y),S=e.height>e.width?e.height/p.height:e.width/p.width,{crop:{x:((b.width-p.width)/2-p.x)*S,y:((b.height-p.height)/2-p.y)*S},zoom:E}),u=C.crop,d=C.zoom;r.props.onCropChange(u),r.props.onZoomChange&&r.props.onZoomChange(d)}},r.computeSizes=function(){var e,t,n,i,a,s,c=r.imageRef.current||r.videoRef.current;if(c&&r.containerRef){r.containerRect=r.containerRef.getBoundingClientRect(),r.saveContainerPosition();var l,u,d,p,h,g,v,m,y,b,w,E=r.containerRect.width/r.containerRect.height,S=(null===(e=r.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=r.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,C=(null===(n=r.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(i=r.videoRef.current)||void 0===i?void 0:i.videoHeight)||0,_=c.offsetWidth<S||c.offsetHeight<C,T=S/C,I=void 0;if(_)switch(r.state.mediaObjectFit){default:case"contain":I=E>T?{width:r.containerRect.height*T,height:r.containerRect.height}:{width:r.containerRect.width,height:r.containerRect.width/T};break;case"horizontal-cover":I={width:r.containerRect.width,height:r.containerRect.width/T};break;case"vertical-cover":I={width:r.containerRect.height*T,height:r.containerRect.height}}else I={width:c.offsetWidth,height:c.offsetHeight};r.mediaSize=o(o({},I),{naturalWidth:S,naturalHeight:C}),r.props.setMediaSize&&r.props.setMediaSize(r.mediaSize);var k=r.props.cropSize?r.props.cropSize:(l=r.mediaSize.width,u=r.mediaSize.height,d=r.containerRect.width,p=r.containerRect.height,h=r.props.aspect,void 0===(g=r.props.rotation)&&(g=0),m=(v=f(l,u,g)).width,y=v.height,(b=Math.min(m,d))>(w=Math.min(y,p))*h?{width:w*h,height:w}:{width:b,height:b/h});return((null===(a=r.state.cropSize)||void 0===a?void 0:a.height)!==k.height||(null===(s=r.state.cropSize)||void 0===s?void 0:s.width)!==k.width)&&r.props.onCropSizeChange&&r.props.onCropSizeChange(k),r.setState({cropSize:k},r.recomputeCropPosition),r.props.setCropSize&&r.props.setCropSize(k),k}},r.saveContainerPosition=function(){if(r.containerRef){var e=r.containerRef.getBoundingClientRect();r.containerPosition={x:e.left,y:e.top}}},r.onMouseDown=function(e){r.currentDoc&&(e.preventDefault(),r.currentDoc.addEventListener("mousemove",r.onMouseMove),r.currentDoc.addEventListener("mouseup",r.onDragStopped),r.saveContainerPosition(),r.onDragStart(t.getMousePoint(e)))},r.onMouseMove=function(e){return r.onDrag(t.getMousePoint(e))},r.onScroll=function(e){r.currentDoc&&(e.preventDefault(),r.saveContainerPosition())},r.onTouchStart=function(e){r.currentDoc&&(r.isTouching=!0,(!r.props.onTouchRequest||r.props.onTouchRequest(e))&&(r.currentDoc.addEventListener("touchmove",r.onTouchMove,{passive:!1}),r.currentDoc.addEventListener("touchend",r.onDragStopped),r.saveContainerPosition(),2===e.touches.length?r.onPinchStart(e):1===e.touches.length&&r.onDragStart(t.getTouchPoint(e.touches[0]))))},r.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?r.onPinchMove(e):1===e.touches.length&&r.onDrag(t.getTouchPoint(e.touches[0]))},r.onGestureStart=function(e){r.currentDoc&&(e.preventDefault(),r.currentDoc.addEventListener("gesturechange",r.onGestureChange),r.currentDoc.addEventListener("gestureend",r.onGestureEnd),r.gestureZoomStart=r.props.zoom,r.gestureRotationStart=r.props.rotation)},r.onGestureChange=function(e){if(e.preventDefault(),!r.isTouching){var n=t.getMousePoint(e),o=r.gestureZoomStart-1+e.scale;if(r.setNewZoom(o,n,{shouldUpdatePosition:!0}),r.props.onRotationChange){var i=r.gestureRotationStart+e.rotation;r.props.onRotationChange(i)}}},r.onGestureEnd=function(e){r.cleanEvents()},r.onDragStart=function(e){var t,n,i=e.x,a=e.y;r.dragStartPosition={x:i,y:a},r.dragStartCrop=o({},r.props.crop),null===(n=(t=r.props).onInteractionStart)||void 0===n||n.call(t)},r.onDrag=function(e){var t=e.x,n=e.y;r.currentWindow&&(r.rafDragTimeout&&r.currentWindow.cancelAnimationFrame(r.rafDragTimeout),r.rafDragTimeout=r.currentWindow.requestAnimationFrame(function(){if(r.state.cropSize&&void 0!==t&&void 0!==n){var e=t-r.dragStartPosition.x,o=n-r.dragStartPosition.y,i={x:r.dragStartCrop.x+e,y:r.dragStartCrop.y+o},a=r.props.restrictPosition?s(i,r.mediaSize,r.state.cropSize,r.props.zoom,r.props.rotation):i;r.props.onCropChange(a)}}))},r.onDragStopped=function(){var e,t;r.isTouching=!1,r.cleanEvents(),r.emitCropData(),null===(t=(e=r.props).onInteractionEnd)||void 0===t||t.call(e)},r.onWheel=function(e){if(r.currentWindow&&(!r.props.onWheelRequest||r.props.onWheelRequest(e))){e.preventDefault();var n=t.getMousePoint(e),o=a(e).pixelY,i=r.props.zoom-o*r.props.zoomSpeed/200;r.setNewZoom(i,n,{shouldUpdatePosition:!0}),r.state.hasWheelJustStarted||r.setState({hasWheelJustStarted:!0},function(){var e,t;return null===(t=(e=r.props).onInteractionStart)||void 0===t?void 0:t.call(e)}),r.wheelTimer&&clearTimeout(r.wheelTimer),r.wheelTimer=r.currentWindow.setTimeout(function(){return r.setState({hasWheelJustStarted:!1},function(){var e,t;return null===(t=(e=r.props).onInteractionEnd)||void 0===t?void 0:t.call(e)})},250)}},r.getPointOnContainer=function(e,t){var n=e.x,o=e.y;if(!r.containerRect)throw Error("The Cropper is not mounted");return{x:r.containerRect.width/2-(n-t.x),y:r.containerRect.height/2-(o-t.y)}},r.getPointOnMedia=function(e){var t=e.x,n=e.y,o=r.props,i=o.crop,a=o.zoom;return{x:(t+i.x)/a,y:(n+i.y)/a}},r.setNewZoom=function(e,t,n){var o=(void 0===n?{}:n).shouldUpdatePosition;if(r.state.cropSize&&r.props.onZoomChange){var i=g(e,r.props.minZoom,r.props.maxZoom);if(void 0===o||o){var a=r.getPointOnContainer(t,r.containerPosition),c=r.getPointOnMedia(a),l={x:c.x*i-a.x,y:c.y*i-a.y},u=r.props.restrictPosition?s(l,r.mediaSize,r.state.cropSize,i,r.props.rotation):l;r.props.onCropChange(u)}r.props.onZoomChange(i)}},r.getCropData=function(){var e,t,n,i,a,c,l,u,h,g,v,m,y,b,w;return r.state.cropSize?(e=r.props.restrictPosition?s(r.props.crop,r.mediaSize,r.state.cropSize,r.props.zoom,r.props.rotation):r.props.crop,t=r.mediaSize,n=r.state.cropSize,i=r.getAspect(),a=r.props.zoom,c=r.props.rotation,l=r.props.restrictPosition,void 0===c&&(c=0),void 0===l&&(l=!0),u=l?d:p,h=f(t.width,t.height,c),g=f(t.naturalWi
1dth,t.naturalHeight,c),v={x:u(100,((h.width-n.width/a)/2-e.x/a)/h.width*100),y:u(100,((h.height-n.height/a)/2-e.y/a)/h.height*100),width:u(100,n.width/h.width*100/a),height:u(100,n.height/h.height*100/a)},m=Math.round(u(g.width,v.width*g.width/100)),y=Math.round(u(g.height,v.height*g.height/100)),b=g.width>=g.height*i?{width:Math.round(y*i),height:y}:{width:m,height:Math.round(m/i)},w=o(o({},b),{x:Math.round(u(g.width-b.width,v.x*g.width/100)),y:Math.round(u(g.height-b.height,v.y*g.height/100))}),{croppedAreaPercentages:v,croppedAreaPixels:w}):null},r.emitCropData=function(){var e=r.getCropData();if(e){var t=e.croppedAreaPercentages,n=e.croppedAreaPixels;r.props.onCropComplete&&r.props.onCropComplete(t,n),r.props.onCropAreaChange&&r.props.onCropAreaChange(t,n)}},r.emitCropAreaChange=function(){var e=r.getCropData();if(e){var t=e.croppedAreaPercentages,n=e.croppedAreaPixels;r.props.onCropAreaChange&&r.props.onCropAreaChange(t,n)}},r.recomputeCropPosition=function(){if(r.state.cropSize){var e,t,n=r.props.crop;if(r.isInitialized&&(null===(e=r.previousCropSize)||void 0===e?void 0:e.width)&&(null===(t=r.previousCropSize)||void 0===t?void 0:t.height)&&(Math.abs(r.previousCropSize.width-r.state.cropSize.width)>1e-6||Math.abs(r.previousCropSize.height-r.state.cropSize.height)>1e-6)){var o=r.state.cropSize.width/r.previousCropSize.width,i=r.state.cropSize.height/r.previousCropSize.height;n={x:r.props.crop.x*o,y:r.props.crop.y*i}}var a=r.props.restrictPosition?s(n,r.mediaSize,r.state.cropSize,r.props.zoom,r.props.rotation):n;r.previousCropSize=r.state.cropSize,r.props.onCropChange(a),r.emitCropData()}},r.onKeyDown=function(e){var t,n,i=r.props,a=i.crop,c=i.onCropChange,l=i.keyboardStep,u=i.zoom,d=i.rotation,p=l;if(r.state.cropSize){e.shiftKey&&(p*=.2);var h=o({},a);switch(e.key){case"ArrowUp":h.y-=p,e.preventDefault();break;case"ArrowDown":h.y+=p,e.preventDefault();break;case"ArrowLeft":h.x-=p,e.preventDefault();break;case"ArrowRight":h.x+=p,e.preventDefault();break;default:return}r.props.restrictPosition&&(h=s(h,r.mediaSize,r.state.cropSize,u,d)),e.repeat||null===(n=(t=r.props).onInteractionStart)||void 0===n||n.call(t),c(h)}},r.onKeyUp=function(e){var t,n;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}r.emitCropData(),null===(n=(t=r.props).onInteractionEnd)||void 0===n||n.call(t)},r}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}
1\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.height)||(null===(n=e.cropSize)||void 0===n?void 0:n.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():((null===(i=e.crop)||void 0===i?void 0:i.x)!==(null===(a=this.props.crop)||void 0===a?void 0:a.x)||(null===(s=e.crop)||void 0===s?void 0:s.y)!==(null===(c=this.props.crop)||void 0===c?void 0:c.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(l=this.videoRef.current)||void 0===l||l.load());var t,r,n,o,i,a,s,c,l,u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},t.prototype.getObjectFit=function(){var e,t,r,n;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var o=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(r=this.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(n=this.videoRef.current)||void 0===n?void 0:n.videoHeight)||0)<o?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var r=t.getTouchPoint(e.touches[0]),n=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=l(r,n),this.lastPinchRotation=u(r,n),this.onDragStart(h(r,n))},t.prototype.onPinchMove=function(e){var r=this;if(this.currentDoc&&this.currentWindow){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=h(n,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=l(n,o),t=r.props.zoom*(e/r.lastPinchDistance);r.setNewZoom(t,i,{shouldUpdatePosition:!1}),r.lastPinchDistance=e;var a=u(n,o),s=r.props.rotation+(a-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(s),r.lastPinchRotation=a})}},t.prototype.render=function(){var e,t=this,r=this.props,n=r.image,a=r.video,s=r.mediaProps,c=r.cropperProps,l=r.transform,u=r.crop,d=u.x,p=u.y,h=r.rotation,f=r.zoom,g=r.cropShape,m=r.showGrid,y=r.roundCropAreaPixels,b=r.style,w=b.containerStyle,E=b.cropAreaStyle,S=b.mediaStyle,C=r.classes,_=C.containerClassName,T=C.cropAreaClassName,I=C.mediaClassName,k=null!==(e=this.state.mediaObjectFit)&&void 0!==e?e:this.getObjectFit();return i.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef
1=e},"data-testid":"container",style:w,className:v("reactEasyCrop_Container",_)},n?i.createElement("img",o({alt:"",className:v("reactEasyCrop_Image","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",I)},s,{src:n,ref:this.imageRef,style:o(o({},S),{transform:l||"translate(".concat(d,"px, ").concat(p,"px) rotate(").concat(h,"deg) scale(").concat(f,")")}),onLoad:this.onMediaLoad})):a&&i.createElement("video",o({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:v("reactEasyCrop_Video","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",I)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:o(o({},S),{transform:l||"translate(".concat(d,"px, ").concat(p,"px) rotate(").concat(h,"deg) scale(").concat(f,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(e){return i.createElement("source",o({key:e.src},e))})),this.state.cropSize&&i.createElement("div",o({ref:this.cropperRef,style:o(o({},E),{width:y?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:y?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:v("reactEasyCrop_CropArea","round"===g&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",T)},c)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(i.Component)},43356:(e,t,r)=>{"use strict";r.d(t,{Wx:()=>l});var n=r(7620),o=Object.defineProperty,i=new Map,a=new WeakMap,s=0,c=void 0;function l(){var e;let{threshold:t,delay:r,trackVisibility:o,rootMargin:l,root:u,triggerOnce:d,skip:p,initialInView:h,fallbackInView:f,onChange:g}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[v,m]=n.useState(null),y=n.useRef(g),[b,w]=n.useState({inView:!!h,entry:void 0});y.current=g,n.useEffect(()=>{let e;if(!p&&v)return e=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c;if(void 0===window.IntersectionObserver&&void 0!==n){let o=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),()=>{}}let{id:o,observer:l,elements:u}=function(e){let t=Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>{var r;return"".concat(t,"_").concat("root"===t?(r=e.root)?(a.has(r)||(s+=1,a.set(r,s.toString())),a.get(r)):"0":e[t])}).toString(),r=i.get(t);if(!r){let n;let o=new Map,a=new IntersectionObserver(t=>{t.forEach(t=>{var r;let i=t.isIntersecting&&n.some(e=>t.intersectionRatio>=e);e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(r=o.get(t.target))||r.forEach(e=>{e(i,t)})})},e);n=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:a,elements:o},i.set(t,r)}return r}(r),d=u.get(e)||[];return u.has(e)||u.set(e,d),d.push(t),l.observe(e),function(){d.splice(d.indexOf(t),1),0===d.length&&(u.delete(e),l.unobserve(e)),0===u.size&&(l.disconnect(),i.delete(o))}}(v,(t,r)=>{w({inView:t,entry:r}),y.current&&y.current(t,r),r.isIntersecting&&d&&e&&(e(),e=void 0)},{root:u,rootMargin:l,threshold:t,trackVisibility:o,delay:r},f),()=>{e&&e()}},[Array.isArray(t)?t.toString():t,v,u,l,d,p,o,f,r]);let E=null==(e=b.entry)?void 0:e.target,S=n.useRef(void 0);v||!E||d||p||S.current===E||(S.current=E,w({inView:!!h,entry:void 0}));let C=[m,b.inView,b.entry];return C.ref=C[0],C.inView=C[1],C.entry=C[2],C}n.Component},40106:(e,t,r)=>{"use strict";r.d(t,{N9:()=>C,GP:()=>S,oR:()=>P});var n=r(7620);let o=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=function e(t){var r,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t){if(Array.isArray(t))for(r=0;r<t.length;r++)t[r]&&(n=e(t[r]))&&(o&&(o+=" "),o+=n);
1else for(r in t)t[r]&&(o&&(o+=" "),o+=r)}return o}(e))&&(n&&(n+=" "),n+=t);return n},i=e=>"number"==typeof e&&!isNaN(e),a=e=>"string"==typeof e,s=e=>"function"==typeof e,c=e=>a(e)||s(e)?e:null,l=e=>(0,n.isValidElement)(e)||a(e)||s(e)||i(e);function u(e){let{enter:t,exit:r,appendPosition:o=!1,collapse:i=!0,collapseDuration:a=300}=e;return function(e){let{children:s,position:c,preventExitTransition:l,done:u,nodeRef:d,isIn:p}=e,h=o?"".concat(t,"--").concat(c):t,f=o?"".concat(r,"--").concat(c):r,g=(0,n.useRef)(0);return(0,n.useLayoutEffect)(()=>{let e=d.current,t=h.split(" "),r=n=>{n.target===d.current&&(e.dispatchEvent(new Event("d")),e.removeEventListener("animationend",r),e.removeEventListener("animationcancel",r),0===g.current&&"animationcancel"!==n.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)},[]),(0,n.useEffect)(()=>{let e=d.current,t=()=>{e.removeEventListener("animationend",t),i?function(e,t,r){void 0===r&&(r=300);let{scrollHeight:n,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=n+"px",o.transition="all ".concat(r,"ms"),requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,r)})})}(e,u,a):u()};p||(l?t():(g.current=1,e.className+=" ".concat(f),e.addEventListener("animationend",t)))},[p]),n.createElement(n.Fragment,null,s)}}function d(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}let p={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){let r=this.list.get(e).filter(e=>e!==t);return this.list.set(e,r),this}return this.list.delete(e),this},cancelEmit(e){let t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{let r=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(r)})}},h=e=>{let{theme:t,type:r,...o}=e;return n.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":"var(--toastify-icon-color-".concat(r,")"),...o})},f={info:function(e){return n.createElement(h,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return n.createElement(h,{...e},n.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return n.createElement(h,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return n.createElement(h,{...e},n.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return n.createElement("div",{className:"Toastify__spinner"})}};function g(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function v(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function m(e){let{closeToast:t,theme:r,ariaLabel:o="close"}=e;return n.createElement("button",{className:"Toastify__close-button Toastify__close-button--".concat(r),type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":o},n.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function y(e){let{delay:t,isRunning:r,closeToast:i,type:a="default",hide:c,className:l,style:u,controlledProgress:d,progress:p,rtl:h,isIn:f,theme:g}=e,v=c||d&&0===p,m={...u,animationDuration:"".concat(t,"ms"),animationPlayState:r?"running":"paused",opacity:v?0:1};d&&(m.transform="scaleX(".concat(p,")"));let y=o("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--".concat(g),"Toastify__progress-bar--".concat(a),{"Toastify__progress-bar--rtl":h}),b=s(l)?l({rtl:h,type:a,defaultClassName:y}):o(y,l);return n.createElement("div",{role:"progressbar","aria-hidden":v?"true":"false","aria-label":"notification timer",className:b,style:m,[d&&p>=1?"onTransitionEnd":"onAnimationEnd"]:d&&p<1?null:()=>{f&&i()}})}let b=e=>{let{isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:a}
1=function(e){let[t,r]=(0,n.useState)(!1),[o,i]=(0,n.useState)(!1),a=(0,n.useRef)(null),c=(0,n.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,l=(0,n.useRef)(e),{autoClose:u,pauseOnHover:d,closeToast:p,onClick:h,closeOnClick:f}=e;function m(t){if(e.draggable){"touchstart"===t.nativeEvent.type&&t.nativeEvent.preventDefault(),c.didMove=!1,document.addEventListener("mousemove",E),document.addEventListener("mouseup",S),document.addEventListener("touchmove",E),document.addEventListener("touchend",S);let r=a.current;c.canCloseOnClick=!0,c.canDrag=!0,c.boundingRect=r.getBoundingClientRect(),r.style.transition="",c.x=g(t.nativeEvent),c.y=v(t.nativeEvent),"x"===e.draggableDirection?(c.start=c.x,c.removalDistance=r.offsetWidth*(e.draggablePercent/100)):(c.start=c.y,c.removalDistance=r.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function y(t){if(c.boundingRect){let{top:r,bottom:n,left:o,right:i}=c.boundingRect;"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&c.x>=o&&c.x<=i&&c.y>=r&&c.y<=n?w():b()}}function b(){r(!0)}function w(){r(!1)}function E(r){let n=a.current;c.canDrag&&n&&(c.didMove=!0,t&&w(),c.x=g(r),c.y=v(r),c.delta="x"===e.draggableDirection?c.x-c.start:c.y-c.start,c.start!==c.x&&(c.canCloseOnClick=!1),n.style.transform="translate".concat(e.draggableDirection,"(").concat(c.delta,"px)"),n.style.opacity=""+(1-Math.abs(c.delta/c.removalDistance)))}function S(){document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",S);let t=a.current;if(c.canDrag&&c.didMove&&t){if(c.canDrag=!1,Math.abs(c.delta)>c.removalDistance)return i(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform="translate".concat(e.draggableDirection,"(0)"),t.style.opacity="1"}}(0,n.useEffect)(()=>{l.current=e}),(0,n.useEffect)(()=>(a.current&&a.current.addEventListener("d",b,{once:!0}),s(e.onOpen)&&e.onOpen((0,n.isValidElement)(e.children)&&e.children.props),()=>{let e=l.current;s(e.onClose)&&e.onClose((0,n.isValidElement)(e.children)&&e.children.props)}),[]),(0,n.useEffect)(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||w(),window.addEventListener("focus",b),window.addEventListener("blur",w)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",b),window.removeEventListener("blur",w))}),[e.pauseOnFocusLoss]);let C={onMouseDown:m,onTouchStart:m,onMouseUp:y,onTouchEnd:y};return u&&d&&(C.onMouseEnter=w,C.onMouseLeave=b),f&&(C.onClick=e=>{h&&h(e),c.canCloseOnClick&&p()}),{playToast:b,pauseToast:w,isRunning:t,preventExitTransition:o,toastRef:a,eventHandlers:C}}(e),{closeButton:c,children:l,autoClose:u,onClick:d,type:p,hideProgressBar:h,closeToast:f,transition:b,position:w,className:E,style:S,bodyClassName:C,bodyStyle:_,progressClassName:T,progressStyle:I,updateId:k,role:A,progress:x,rtl:R,toastId:P,deleteToast:O,isIn:N,isLoading:M,iconOut:D,closeOnClick:L,theme:U}=e,q=o("Toastify__toast","Toastify__toast-theme--".concat(U),"Toastify__toast--".concat(p),{"Toastify__toast--rtl":R},{"Toastify__toast--close-on-click":L}),H=s(E)?E({rtl:R,position:w,type:p,defaultClassName:q}):o(q,E),F=!!x||!u,j={closeToast:f,type:p,theme:U},z=null;return!1===c||(z=s(c)?c(j):(0,n.isValidElement)(c)?(0,n.cloneElement)(c,j):m(j)),n.createElement(b,{isIn:N,done:O,position:w,preventExitTransition:r,nodeRef:i},n.createElement("div",{id:P,onClick:d,className:H,...a,style:S,ref:i},n.createElement("div",{...N&&{role:A},className:s(C)?C({type:p}):o("Toastify__toast-body",C),style:_},null!=D&&n.createElement("div",{className:o("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!M})},D),n.createElement("div",null,l)),z,n.createElement(y,{...k&&!F?{key:"pb-".concat(k)}:{},rtl:R,theme:U,delay:u,isRunning:t,isIn:N,closeToast:f,hide:h,type:p,style:I,className:T,controlledProgress:F,progress:x||0})))}
1,w=function(e,t){return void 0===t&&(t=!1),{enter:"Toastify--animate Toastify__".concat(e,"-enter"),exit:"Toastify--animate Toastify__".concat(e,"-exit"),appendPosition:t}},E=u(w("bounce",!0)),S=(u(w("slide",!0)),u(w("zoom"))),C=(u(w("flip")),(0,n.forwardRef)((e,t)=>{let{getToastToRender:r,containerRef:u,isToastActive:h}=function(e){let[,t]=(0,n.useReducer)(e=>e+1,0),[r,o]=(0,n.useState)([]),u=(0,n.useRef)(null),h=(0,n.useRef)(new Map).current,g=e=>-1!==r.indexOf(e),v=(0,n.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:g,getToast:e=>h.get(e)}).current;function m(e){let{containerId:t}=e,{limit:r}=v.props;!r||t&&v.containerId!==t||(v.count-=v.queue.length,v.queue=[])}function y(e){o(t=>null==e?[]:t.filter(t=>t!==e))}function b(){let{toastContent:e,toastProps:t,staleId:r}=v.queue.shift();E(e,t,r)}function w(e,r){var o,g;let{delay:m,staleId:w,...S}=r;if(!l(e)||!u.current||v.props.enableMultiContainer&&S.containerId!==v.props.containerId||h.has(S.toastId)&&null==S.updateId)return;let{toastId:C,updateId:_,data:T}=S,{props:I}=v,k=()=>y(C),A=null==_;A&&v.count++;let x={...I,style:I.toastStyle,key:v.toastKey++,...Object.fromEntries(Object.entries(S).filter(e=>{let[t,r]=e;return null!=r})),toastId:C,updateId:_,data:T,closeToast:k,isIn:!1,className:c(S.className||I.toastClassName),bodyClassName:c(S.bodyClassName||I.bodyClassName),progressClassName:c(S.progressClassName||I.progressClassName),autoClose:!S.isLoading&&(o=S.autoClose,g=I.autoClose,!1===o||i(o)&&o>0?o:g),deleteToast(){let e=d(h.get(C),"removed");h.delete(C),p.emit(4,e);let r=v.queue.length;if(v.count=null==C?v.count-v.displayedToast:v.count-1,v.count<0&&(v.count=0),r>0){let e=null==C?v.props.limit:1;if(1===r||1===e)v.displayedToast++,b();else{let t=e>r?r:e;v.displayedToast=t;for(let e=0;e<t;e++)b()}}else t()}};x.iconOut=function(e){let{theme:t,type:r,isLoading:o,icon:c}=e,l=null,u={theme:t,type:r};return!1===c||(s(c)?l=c(u):(0,n.isValidElement)(c)?l=(0,n.cloneElement)(c,u):a(c)||i(c)?l=c:o?l=f.spinner():r in f&&(l=f[r](u))),l}(x),s(S.onOpen)&&(x.onOpen=S.onOpen),s(S.onClose)&&(x.onClose=S.onClose),x.closeButton=I.closeButton,!1===S.closeButton||l(S.closeButton)?x.closeButton=S.closeButton:!0===S.closeButton&&(x.closeButton=!l(I.closeButton)||I.closeButton);let R=e;(0,n.isValidElement)(e)&&!a(e.type)?R=(0,n.cloneElement)(e,{closeToast:k,toastProps:x,data:T}):s(e)&&(R=e({closeToast:k,toastProps:x,data:T})),I.limit&&I.limit>0&&v.count>I.limit&&A?v.queue.push({toastContent:R,toastProps:x,staleId:w}):i(m)?setTimeout(()=>{E(R,x,w)},m):E(R,x,w)}function E(e,t,r){let{toastId:n}=t;r&&h.delete(r);let i={content:e,props:t};h.set(n,i),o(e=>[...e,n].filter(e=>e!==r)),p.emit(4,d(i,null==i.props.updateId?"added":"updated"))}return(0,n.useEffect)(()=>(v.containerId=e.containerId,p.cancelEmit(3).on(0,w).on(1,e=>u.current&&y(e)).on(5,m).emit(2,v),()=>{h.clear(),p.emit(3,v)}),[]),(0,n.useEffect)(()=>{v.props=e,v.isToastActive=g,v.displayedToast=r.length}),{getToastToRender:function(t){let r=new Map,n=Array.from(h.values());return e.newestOnTop&&n.reverse(),n.forEach(e=>{let{position:t}=e.props;r.has(t)||r.set(t,[]),r.get(t).push(e)}),Array.from(r,e=>t(e[0],e[1]))},containerRef:u,isToastActive:g}}(e),{className:g,style:v,rtl:m,containerId:y}=e;return(0,n.useEffect)(()=>{t&&(t.current=u.current)},[]),n.createElement("div",{ref:u,className:"Toastify",id:y},r((e,t)=>{let r=t.length?{...v}:{...v,pointerEvents:"none"};return n.createElement("div",{className:function(e){let t=o("Toastify__toast-container","Toastify__toast-container--".concat(e),{"Toastify__toast-container--rtl":m});return s(g)?g({position:e,rtl:m,defaultClassName:t}):o(t,c(g))}(e),style:r,key:"container-".concat(e)},t.map((e,r)=>{let{content:o,props:i}=e;return n.createElement(b,{...i,isIn:h(i.toastId),style:{...i.style,"--nth":r+1,"--len":t.length},key:"toast-".concat(i.key)},o)}))}))}));C.displayName="ToastContainer",C.defaultProps={position:"top-right",transition:E,autoClose:5e3,closeButton:m,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let _,T=new Map,I=[],k=1;
1function A(e,t){return T.size>0?p.emit(0,e,t):I.push({content:e,options:t}),t.toastId}function x(e,t){return{...t,type:t&&t.type||e,toastId:t&&(a(t.toastId)||i(t.toastId))?t.toastId:""+k++}}function R(e){return(t,r)=>A(t,x(e,r))}function P(e,t){return A(e,x("default",t))}P.loading=(e,t)=>A(e,x("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),P.promise=function(e,t,r){let n,{pending:o,error:i,success:c}=t;o&&(n=a(o)?P.loading(o,r):P.loading(o.render,{...r,...o}));let l={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(e,t,o)=>{if(null==t)return void P.dismiss(n);let i={type:e,...l,...r,data:o},s=a(t)?{render:t}:t;return n?P.update(n,{...i,...s}):P(s.render,{...i,...s}),o},d=s(e)?e():e;return d.then(e=>u("success",c,e)).catch(e=>u("error",i,e)),d},P.success=R("success"),P.info=R("info"),P.error=R("error"),P.warning=R("warning"),P.warn=P.warning,P.dark=(e,t)=>A(e,x("default",{theme:"dark",...t})),P.dismiss=e=>{T.size>0?p.emit(1,e):I=I.filter(t=>null!=e&&t.options.toastId!==e)},P.clearWaitingQueue=function(e){return void 0===e&&(e={}
1),p.emit(5,e)},P.isActive=e=>{let t=!1;return T.forEach(r=>{r.isToastActive&&r.isToastActive(e)&&(t=!0)}),t},P.update=function(e,t){void 0===t&&(t={}),setTimeout(()=>{let r=function(e,t){let{containerId:r}=t,n=T.get(r||_);return n&&n.getToast(e)}(e,t);if(r){let{props:n,content:o}=r,i={delay:100,...n,...t,toastId:t.toastId||e,updateId:""+k++};i.toastId!==e&&(i.staleId=e);let a=i.render||o;delete i.render,A(a,i)}},0)},P.done=e=>{P.update(e,{progress:1})},P.onChange=e=>(p.on(4,e),()=>{p.off(4,e)}),P.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},P.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},p.on(2,e=>{_=e.containerId||e,T.set(_,e),I.forEach(e=>{p.emit(0,e.content,e.options)}),I=[]}).on(3,e=>{T.delete(e.containerId||e),0===T.size&&p.off(0).off(1).off(5)})}}]);

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.