@descope/debug-logs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import{AwsRum as t}from"aws-rum-web";class e{constructor(t={}){this.enabled=!1,this.id="console-plugin",this.originalMethods={log:console.log,info:console.info,warn:console.warn,error:console.error,debug:console.debug},this.levels=new Set(t.levels||["log","info","warn","error","debug"]),this.maxMessageLength=t.maxMessageLength??10240}load(t){this.context=t,this.enable()}enable(){this.enabled||(this.enabled=!0,["log","info","warn","error","debug"].forEach((t=>{this.levels.has(t)&&(console[t]=(...e)=>{if(this.originalMethods[t](...e),this.enabled)try{let r=e.map((t=>"object"==typeof t?JSON.stringify(t):String(t))).join(" ");r.length>this.maxMessageLength&&(r=r.substring(0,this.maxMessageLength-20)+"... [truncated]"),this.context.record("console_log",{level:t,message:r,timestamp:Date.now()})}catch(t){}})})))}disable(){this.enabled&&(this.enabled=!1,["log","info","warn","error","debug"].forEach((t=>{this.levels.has(t)&&(console[t]=this.originalMethods[t])})))}getPluginId(){return this.id}}class r{constructor(){this.enabled=!1,this.id="navigation-plugin",this.originalPushState=history.pushState,this.originalReplaceState=history.replaceState,this.currentUrl="",this.eventHandlers=[]}load(t){this.context=t,this.currentUrl=window.location.href,this.enable()}enable(){if(this.enabled)return;this.enabled=!0,history.pushState=(...t)=>{const e=this.currentUrl;try{this.originalPushState.apply(history,t),this.currentUrl=window.location.href,this.recordNavigation(e,this.currentUrl,"pushState")}catch(t){throw this.currentUrl=window.location.href,t}},history.replaceState=(...t)=>{const e=this.currentUrl;try{this.originalReplaceState.apply(history,t),this.currentUrl=window.location.href,this.recordNavigation(e,this.currentUrl,"replaceState")}catch(t){throw this.currentUrl=window.location.href,t}};const t=()=>{const t=this.currentUrl;this.currentUrl=window.location.href,this.recordNavigation(t,this.currentUrl,"popstate")};window.addEventListener("popstate",t),this.eventHandlers.push({type:"popstate",handler:t});const e=()=>{const t=this.currentUrl;this.currentUrl=window.location.href,this.recordNavigation(t,this.currentUrl,"hashchange")};window.addEventListener("hashchange",e),this.eventHandlers.push({type:"hashchange",handler:e})}disable(){this.enabled&&(this.enabled=!1,history.pushState=this.originalPushState,history.replaceState=this.originalReplaceState,this.eventHandlers.forEach((({type:t,handler:e})=>{window.removeEventListener(t,e)})),this.eventHandlers=[])}getPluginId(){return this.id}recordNavigation(t,e,r){if(this.enabled)try{this.context.record("navigation",{type:r,from:t,to:e,timestamp:Date.now()})}catch(t){}}}class i{constructor(t={}){this.enabled=!1,this.id="dom-mutation-plugin",this.observer=null,this.pendingMutations=[],this.flushTimeout=null,this.rootElement=document.body,this.config=t,this.throttleMs=t.throttleMs||100,this.maxHtmlLength=t.maxHtmlLength??51200,this.includeText=!0===t.includeText}load(t){this.context=t,this.enable()}enable(){if(this.enabled)return;this.enabled=!0;let t=document.body;if(this.config.rootElement)if("string"==typeof this.config.rootElement){const e=document.querySelector(this.config.rootElement);e&&(t=e)}else t=this.config.rootElement;this.rootElement=t;try{this.observer=new MutationObserver((t=>{this.enabled&&this.scheduleMutationFlush(t)})),this.observer.observe(this.rootElement,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1});const t=this.snapshotHTML();t&&this.context.record("dom_mutation",{addedNodes:0,removedNodes:0,attributeChanges:0,characterDataChanges:0,timestamp:Date.now(),rootElementHTML:t,initial:!0})}catch(t){console.debug("DOM mutation plugin failed to start:",t)}}snapshotHTML(){const t=(this.includeText?this.rootElement:function(t){const e=document.createElement("div");e.innerHTML=t.innerHTML;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),i=[];let s=r.nextNode();for(;s;)i.push(s),s=r.nextNode();return i.forEach((t=>t.parentNode?.removeChild(t))),e}(this.rootElement)).innerHTML;return t.length>this.maxHtmlLength?t.substring(0,this.maxHtmlLength-20)+"... [truncated]":t}disable(){if(!this.enabled)return;this.enabled=!1,this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),this.observer&&(this.observer.disconnect(),this.observer=null);const t=[...this.pendingMutations];this.pendingMutations=[],t.length>0&&this.recordPendingMutations(t)}getPluginId(){return this.id}scheduleMutationFlush(t){this.enabled&&(this.pendingMutations.push(...t),this.flushTimeout&&clearTimeout(this.flushTimeout),this.flushTimeout=setTimeout((()=>{this.enabled&&this.flushMutations()}),this.throttleMs))}flushMutations(){this.enabled&&this.observer&&(this.recordPendingMutations(),this.flushTimeout=null)}recordPendingMutations(t){if(!t&&!this.enabled)return;const e=t||this.pendingMutations;if(0!==e.length){try{let t=0,r=0,i=0,s=0;for(const n of e)t+=n.addedNodes.length,r+=n.removedNodes.length,"attributes"===n.type?i++:"characterData"===n.type&&s++;const n=t>0||r>0?this.snapshotHTML():"";this.context.record("dom_mutation",{addedNodes:t,removedNodes:r,attributeChanges:i,characterDataChanges:s,timestamp:Date.now(),rootElementHTML:n})}catch(t){}t||(this.pendingMutations=[])}}}function s(t){return"undefined"!=typeof Request&&t instanceof Request}function n(t,e){const r={};if(!t)return r;const i=(t,i)=>{const s=t.toLowerCase(),n=e?e(i):i;r[s]=n};return"undefined"!=typeof Headers&&t instanceof Headers?(t.forEach(((t,e)=>i(e,t))),r):Array.isArray(t)?(t.forEach((([t,e])=>i(t,e))),r):(Object.entries(t).forEach((([t,e])=>i(t,String(e)))),r)}function o(t,e){const r={};return t?(t.trim().split(/\r?\n/).forEach((t=>{const i=t.indexOf(":");if(-1===i)return;const s=t.slice(0,i).trim().toLowerCase(),n=t.slice(i+1).trim();r[s]=e(n)})),r):r}function a(t){if(!t)return t;try{return new URL(t,window.location.href).toString()}catch{return t}}function h(t,e){return!!t&&(!e||0===e.length||e.some((e=>{try{return e.test(t)}catch(t){return console.debug("Network plugin filter failed:",t),!1}})))}function l(t,e){return t.headers?n(t.headers,e):{}}function c(t,e){console.debug(t,e)}function u(t){return Date.now()-t}const d=Symbol("network-plugin-metadata");class g{constructor(t={}){this.enabled=!1,this.id="network-plugin",this.urlFilters=function(t){if(t)return Array.isArray(t)?t:[t]}(t.urlFilter),this.maxHeaderLength=t.maxHeaderLength??2048,this.truncate=t=>function(t,e){return t.length<=e?t:t.substring(0,e-20)+"... [truncated]"}(t,this.maxHeaderLength)}load(t){this.context=t,this.enable()}enable(){this.enabled||(this.enabled=!0,this.patchFetch(),this.patchXhr())}disable(){this.enabled&&(this.enabled=!1,this.restoreFetch(),this.restoreXhr())}getPluginId(){return this.id}patchFetch(){if("function"!=typeof window.fetch)return;this.originalFetch||(this.originalFetch=window.fetch);const t=this.originalFetch,e=this;window.fetch=function(...r){return e.handleFetch(t,r,this??window)}}restoreFetch(){this.originalFetch&&(window.fetch=this.originalFetch)}patchXhr(){if("undefined"==typeof XMLHttpRequest)return;this.originalXhrOpen||(this.originalXhrOpen=XMLHttpRequest.prototype.open,this.originalXhrSend=XMLHttpRequest.prototype.send,this.originalXhrSetRequestHeader=XMLHttpRequest.prototype.setRequestHeader);const t=this;XMLHttpRequest.prototype.open=function(e,r,i,s,n){const o=this;try{const i=t.getXhrMeta(o);i.method=(e||"GET").toUpperCase();const s="string"==typeof r?r:r?.toString()||"";i.url=a(s)}catch(t){c("XHR metadata collection failed:",t)}return t.originalXhrOpen.call(this,e,r,i??!0,s??null,n??null)},XMLHttpRequest.prototype.setRequestHeader=function(e,r){const i=this;try{const s=t.getXhrMeta(i);e&&(s.requestHeaders[e.toLowerCase()]=t.truncate(String(r??"")))}catch(t){c("XHR header capture failed:",t)}return t.originalXhrSetRequestHeader.call(this,e,r)},XMLHttpRequest.prototype.send=function(e){const r=this;let i=!1;try{const e=t.getXhrMeta(r);e.startTime=Date.now(),e.url||(e.url=a(r.responseURL||"")),i=h(e.url||"",t.urlFilters)}catch(t){c("XHR send metadata check failed:",t)}if(!i)return t.originalXhrSend.call(this,e);const s=()=>{try{t.recordXhrSuccess(r)}catch(t){c("XHR success recording failed:",t)}o()},n=e=>{try{t.recordXhrError(r,e.type)}catch(t){c("XHR error recording failed:",t)}o()},o=()=>{try{r.removeEventListener("load",s),r.removeEventListener("error",n),r.removeEventListener("abort",n),r.removeEventListener("timeout",n),delete r[d]}catch(t){c("XHR cleanup failed:",t)}};try{r.addEventListener("load",s),r.addEventListener("error",n),r.addEventListener("abort",n),r.addEventListener("timeout",n)}catch(t){c("XHR event listener attachment failed:",t)}return t.originalXhrSend.call(this,e)}}restoreXhr(){"undefined"!=typeof XMLHttpRequest&&(this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen),this.originalXhrSend&&(XMLHttpRequest.prototype.send=this.originalXhrSend),this.originalXhrSetRequestHeader&&(XMLHttpRequest.prototype.setRequestHeader=this.originalXhrSetRequestHeader))}handleFetch(t,e,r){if(!this.enabled)return t.apply(r,e);const[i,o]=e,d=a(function(t){return"string"==typeof t?t:t instanceof URL?t.toString():s(t)?t.url:String(t)}(i));if(!h(d,this.urlFilters))return t.apply(r,e);const g=function(t,e){return e?.method?e.method.toUpperCase():s(t)&&t.method?t.method.toUpperCase():"GET"}(i,o),p=function(t,e,r){const i={};return s(t)&&Object.assign(i,n(t.headers,r)),e?.headers&&Object.assign(i,n(e.headers,r)),i}(i,o,this.truncate),f=Date.now();return t.apply(r,e).then((t=>{try{this.recordNetworkSuccess({transport:"fetch",url:d,method:g,status:t.status,statusText:t.statusText,duration:u(f),timestamp:f,requestHeaders:p,responseHeaders:l(t,this.truncate)})}catch(t){c("Failed to record network success:",t)}return t})).catch((t=>{try{this.recordNetworkError({transport:"fetch",url:d,method:g,duration:u(f),timestamp:f,requestHeaders:p,error:t instanceof Error?t.message:String(t)})}catch(t){c("Failed to record network error:",t)}throw t}))}recordXhrSuccess(t){if(!this.enabled)return;const e=t[d];e?.startTime&&e.url&&this.recordNetworkSuccess({transport:"xhr",url:e.url,method:e.method||"GET",status:t.status,statusText:t.statusText,duration:u(e.startTime),timestamp:e.startTime,requestHeaders:e.requestHeaders,responseHeaders:o(t.getAllResponseHeaders(),this.truncate)})}recordXhrError(t,e){if(!this.enabled)return;const r=t[d];r?.startTime&&r.url&&this.recordNetworkError({transport:"xhr",url:r.url,method:r.method||"GET",duration:u(r.startTime),timestamp:r.startTime,requestHeaders:r.requestHeaders,status:t.status,statusText:t.statusText,error:e})}recordNetworkSuccess(t){if(this.enabled)try{this.context.record("network_request",t)}catch(t){c("Network plugin failed to record request:",t)}}recordNetworkError(t){if(this.enabled)try{this.context.record("network_error",t)}catch(t){c("Network plugin failed to record error:",t)}}getXhrMeta(t){return t[d]||(t[d]={requestHeaders:{}}),t[d]}}function p(t){if(t)return"object"==typeof t?t:{}}class f{constructor(t,e,r=console){if(this.rumClient=null,this.plugins=[],this.isShutdown=!1,this.initializationFailed=!1,this.config=t,this.context=e,this.logger=r,t.enabled)try{this.initializeRumClient()}catch(t){this.initializationFailed=!0,this.logger.error("Telemetry initialization failed:",t)}else this.logger.debug("Telemetry is disabled")}initializeRumClient(){try{const t=[...this.buildHttpTelemetry(),"errors"],e=this.buildCustomPlugins();this.rumClient=this.createRumClient(t,e),this.rumClient.addSessionAttributes({projectId:this.context.projectId,flowId:this.context.flowId}),this.plugins.forEach((t=>{t.enable()}));const r=this.tryGetSessionId();this.logger.info(`TelemetryManager: RUM client ready (sessionId=${r??"unknown"})`)}catch(t){throw this.logger.error("Failed to initialize telemetry:",t),t}}buildHttpTelemetry(){if(!1===this.config.capture?.network)return[];const t={recordAllRequests:!0,addXRayTraceIdHeader:!1,stackTraceLength:200},e=this.config.capture?.network?.urlFilter;if(e){const r=Array.isArray(e)?e:[e];t.recordResourceUrl=t=>r.some((e=>e.test(t)))}return[["http",t]]}buildCustomPlugins(){const t=[];if(!1!==this.config.capture?.console){const r=p(this.config.capture?.console);t.push(new e(r))}if(!1!==this.config.capture?.navigation&&t.push(new r),!1!==this.config.capture?.network){const e=p(this.config.capture?.network);t.push(new g(e))}if(!1!==this.config.capture?.dom){const e=p(this.config.capture?.dom);t.push(new i(e))}return this.plugins.push(...t),t}createRumClient(e,r){const i={endpoint:this.config.rumConfig.endpoint,telemetries:e,eventPluginsToLoad:r,allowCookies:!0,enableXRay:!1,sessionEventLimit:1e4,batchLimit:500,eventCacheSize:2e3,dispatchInterval:5e3,...this.config.rumConfig};return this.logger.debug("Creating RUM client with config:",i),new t(this.config.rumConfig.applicationId,this.context.version||"1.0.0",this.config.rumConfig.region,i)}shutdown(){this.isShutdown?this.logger.debug("Telemetry already shutdown"):(this.isShutdown=!0,this.safe("shutdown rum client",(()=>{this.rumClient&&(this.rumClient.disable(),this.rumClient=null)})),this.plugins.forEach((t=>{this.safe("disable plugin",(()=>t.disable()))})),this.plugins=[],this.logger.debug("Telemetry shutdown complete"))}enable(){this.assertMutable("enable")&&this.safe("enable",(()=>{this.plugins.forEach((t=>t.enable())),this.logger.debug("Telemetry enabled")}))}disable(){this.assertMutable("disable")&&this.safe("disable",(()=>{this.plugins.forEach((t=>t.disable())),this.logger.debug("Telemetry disabled")}))}updateContext(t){this.assertMutable("update telemetry context")&&this.safe("update telemetry context",(()=>{const e=Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)));this.context={...this.context,...e},this.rumClient.addSessionAttributes(e),this.logger.debug("Telemetry context updated:",e)}))}isReady(){return!this.isShutdown&&!this.initializationFailed&&null!==this.rumClient}getRumClient(){return this.rumClient}assertMutable(t){return this.initializationFailed?(this.logger.error(`Cannot ${t}: telemetry initialization failed`),!1):this.isShutdown?(this.logger.error(`Cannot ${t}: telemetry has been shutdown. Create a new instance.`),!1):!!this.rumClient||(this.logger.error(`Cannot ${t}: telemetry not initialized`),!1)}safe(t,e){try{e()}catch(e){this.logger.error(`Failed to ${t}:`,e)}}tryGetSessionId(){try{return this.rumClient?.eventCache?.getSession?.()?.sessionId??null}catch{return null}}}export{f as default};
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/plugins/consolePlugin.ts","../src/plugins/navigationPlugin.ts","../src/plugins/domMutationPlugin.ts","../src/plugins/networkPlugin/helpers.ts","../src/plugins/networkPlugin/types.ts","../src/plugins/networkPlugin/NetworkPlugin.ts","../src/telemetryManager.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["ConsolePlugin","constructor","config","this","enabled","id","originalMethods","log","console","info","warn","error","debug","levels","Set","maxMessageLength","load","context","enable","forEach","level","has","args","message","map","arg","JSON","stringify","String","join","length","substring","record","timestamp","Date","now","disable","getPluginId","NavigationPlugin","originalPushState","history","pushState","originalReplaceState","replaceState","currentUrl","eventHandlers","window","location","href","previousUrl","apply","recordNavigation","handlePopState","addEventListener","push","type","handler","handleHashChange","removeEventListener","from","to","DomMutationPlugin","observer","pendingMutations","flushTimeout","rootElement","document","body","throttleMs","maxHtmlLength","includeText","observeTarget","element","querySelector","MutationObserver","mutations","scheduleMutationFlush","observe","childList","attributes","characterData","subtree","attributeOldValue","characterDataOldValue","rootElementHTML","snapshotHTML","addedNodes","removedNodes","attributeChanges","characterDataChanges","initial","raw","root","container","createElement","innerHTML","walker","createTreeWalker","NodeFilter","SHOW_TEXT","toRemove","node","nextNode","n","parentNode","removeChild","stripTextNodes","clearTimeout","disconnect","mutationsToFlush","recordPendingMutations","setTimeout","flushMutations","mutationsToRecord","m","isRequest","input","Request","toHeadersMap","headers","truncate","result","applyPair","key","value","normalizedKey","toLowerCase","normalizedValue","Headers","Array","isArray","Object","entries","parseResponseHeaders","rawHeaders","trim","split","line","separatorIndex","indexOf","slice","normalizeUrl","url","URL","toString","shouldCaptureUrl","urlFilters","some","filter","test","extractResponseHeaders","response","safeDebugLog","calculateDuration","startTime","XHR_METADATA","Symbol","NetworkPlugin","normalizeFilters","urlFilter","maxHeaderLength","maxLength","truncateHeader","patchFetch","patchXhr","restoreFetch","restoreXhr","fetch","originalFetch","plugin","handleFetch","XMLHttpRequest","originalXhrOpen","prototype","open","originalXhrSend","send","originalXhrSetRequestHeader","setRequestHeader","method","async","username","password","xhr","meta","getXhrMeta","toUpperCase","urlString","call","requestHeaders","shouldCapture","responseURL","handleLoad","recordXhrSuccess","cleanup","handleError","event","recordXhrError","thisArg","init","extractUrl","extractMethod","assign","extractRequestHeaders","then","recordNetworkSuccess","transport","status","statusText","duration","responseHeaders","recordError","catch","recordNetworkError","Error","getAllResponseHeaders","data","normalizeConfig","TelemetryManager","logger","rumClient","plugins","isShutdown","initializationFailed","initializeRumClient","telemetries","buildHttpTelemetry","eventPluginsToLoad","buildCustomPlugins","createRumClient","addSessionAttributes","projectId","flowId","sessionId","tryGetSessionId","capture","network","httpConfig","recordAllRequests","addXRayTraceIdHeader","stackTraceLength","filters","recordResourceUrl","navigation","dom","rumConfig","endpoint","allowCookies","enableXRay","sessionEventLimit","batchLimit","eventCacheSize","dispatchInterval","AwsRum","applicationId","version","region","shutdown","safe","assertMutable","updateContext","filteredContext","fromEntries","undefined","isReady","getRumClient","op","fn","eventCache","getSession"],"mappings":"2CAiBaA,EAeX,WAAAC,CAAYC,EAA8B,IAblCC,KAAOC,SAAG,EACDD,KAAEE,GAAG,iBAIdF,KAAAG,gBAAkB,CACxBC,IAAKC,QAAQD,IACbE,KAAMD,QAAQC,KACdC,KAAMF,QAAQE,KACdC,MAAOH,QAAQG,MACfC,MAAOJ,QAAQI,OAKfT,KAAKU,OAAS,IAAIC,IAChBZ,EAAOW,QAAU,CAAC,MAAO,OAAQ,OAAQ,QAAS,UAEpDV,KAAKY,iBACHb,EAAOa,kBA3BsB,MA8BjC,IAAAC,CAAKC,GACHd,KAAKc,QAAUA,EACfd,KAAKe,SAGP,MAAAA,GACMf,KAAKC,UACTD,KAAKC,SAAU,EAGd,CAAC,MAAO,OAAQ,OAAQ,QAAS,SAAmBe,SAASC,IACvDjB,KAAKU,OAAOQ,IAAID,KAErBZ,QAAQY,GAAS,IAAIE,KAKnB,GAHAnB,KAAKG,gBAAgBc,MAAUE,GAG1BnB,KAAKC,QAGV,IAEE,IAAImB,EAAUD,EACXE,KAAKC,GACW,iBAARA,EAAmBC,KAAKC,UAAUF,GAAOG,OAAOH,KAExDI,KAAK,KAGJN,EAAQO,OAAS3B,K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,GACOjC,KAAKgQ,cAAc,YACxBhQ,KAAK+P,KAAK,WAAW,KACnB/P,KAAK0N,QAAQ1M,SAASsJ,GAAWA,EAAOrI,YACxCjC,KAAKwN,OAAO/M,MAAM,qBAAqB,IAI3C,aAAAwP,CACEnP,GAEKd,KAAKgQ,cAAc,6BACxBhQ,KAAK+P,KAAK,4BAA4B,KACpC,MAAMG,EAAkBlI,OAAOmI,YAC7BnI,OAAOC,QAAQnH,GAASmI,QAAO,EAAI,CAAAxB,UAAqB2I,IAAV3I,KAEhDzH,KAAKc,QAAU,IAAKd,KAAKc,WAAYoP,GACrClQ,KAAKyN,UAAWU,qBAAqB+B,GACrClQ,KAAKwN,OAAO/M,MAAM,6BAA8ByP,EAAgB,IAIpE,OAAAG,GACE,OACGrQ,KAAK2N,aAAe3N,KAAK4N,sBAA2C,OAAnB5N,KAAKyN,UAI3D,YAAA6C,GACE,OAAOtQ,KAAKyN,UAGN,aAAAuC,CAAcO,GACpB,OAAIvQ,KAAK4N,sBACP5N,KAAKwN,OAAOhN,MAAM,UAAU+P,uCACrB,GAELvQ,KAAK2N,YACP3N,KAAKwN,OAAOhN,MACV,UAAU+P,2DAEL,KAEJvQ,KAAKyN,YACRzN,KAAKwN,OAAOhN,MAAM,UAAU+P,iCACrB,GAKH,IAAAR,CAAKQ,EAAYC,GACvB,IACEA,IACA,MAAOhQ,GACPR,KAAKwN,OAAOhN,MAAM,aAAa+P,KAAO/P,IASlC,eAAA+N,GACN,IACE,OACGvO,KAAKyN,WAAmBgD,YAAYC,gBAAgBpC,WAAa,KAEpE,MACA,OAAO"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DescopeDebugLogs=t()}(this,(function(){"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var t,n,r,i,o,a,s;!function(e){e.HEADER="header",e.QUERY="query"}(t||(t={})),function(e){e.HEADER="header",e.QUERY="query"}(n||(n={})),function(e){e.HTTP="http",e.HTTPS="https"}(r||(r={})),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(i||(i={})),function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"}(o||(o={})),function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"}(a||(a={})),function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"}(s||(s={}));class c{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new c({...e,headers:{...e.headers}});var n;return t.query&&(t.query=(n=t.query,Object.keys(n).reduce(((e,t)=>{const r=n[t];return{...e,[t]:Array.isArray(r)?[...r]:r}}),{}))),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){return c.clone(this)}}class u{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}const l=e=>encodeURIComponent(e).replace(/[!'()*]/g,d),d=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function h(e,t){return new Request(e,t)}function f(e=0){return new Promise(((t,n)=>{e&&setTimeout((()=>{const t=new Error(`Request did not complete within ${e} ms`);t.name="TimeoutError",n(t)}),e)}))}const p={supported:void 0};let g=class e{static create(t){return"function"==typeof t?.handle?t:new e(t)}constructor(e){"function"==typeof e?this.configProvider=e().then((e=>e||{})):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===p.supported&&(p.supported=Boolean("undefined"!=typeof Request&&"keepalive"in h("https://[::1]")))}destroy(){}async handle(e,{abortSignal:t}={}){this.config||(this.config=await this.configProvider);const n=this.config.requestTimeout,r=!0===this.config.keepAlive,i=this.config.credentials;if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",Promise.reject(e)}let o=e.path;const a=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=l(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${l(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${l(r)}`),t.push(e)}}return t.join("&")}(e.query||{});a&&(o+=`?${a}`),e.fragment&&(o+=`#${e.fragment}`);let s="";if(null!=e.username||null!=e.password){s=`${e.username??""}:${e.password??""}@`}const{port:c,method:d}=e,g=`${e.protocol}//${s}${e.hostname}${c?`:${c}`:""}${o}`,v="GET"===d||"HEAD"===d?void 0:e.body,y={body:v,headers:new Headers(e.headers),method:d,credentials:i};this.config?.cache&&(y.cache=this.config.cache),v&&(y.duplex="half"),"undefined"!=typeof AbortController&&(y.signal=t),p.supported&&(y.keepalive=r),"function"==typeof this.config.requestInit&&Object.assign(y,this.config.requestInit(e));let m=()=>{};const w=h(g,y),b=[fetch(w).then((e=>{const t=e.headers,n={};for(const e of t.entries())n[e[0]]=e[1];return null!=e.body?{response:new u({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then((t=>({response:new u({headers:n,reason:e.statusText,statusCode:e.status,body:t})})))})),f(n)];return t&&b.push(new Promise(((e,n)=>{const r=()=>{const e=new Error("Request aborted");e.name="AbortError",n(e)};if("function"==typeof t.addEventListener){const e=t;e.addEventListener("abort",r,{once:!0}),m=()=>e.removeEventListener("abort",r)}else t.onabort=r}))),Promise.race(b).finally(m)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((n=>(n[e]=t,n)))}httpHandlerConfigs(){return this.config??{}}};const v={},y=new Array(64);for(let e=0,t="A".charCodeAt(0),n="Z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t);v[n]=e,y[e]=n}for(let e=0,t="a".charCodeAt(0),n="z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t),r=e+26;v[n]=r,y[r]=n}for(let e=0;e<10;e++){v[e.toString(10)]=e+52;const t=e.toString(10),n=e+52;v[t]=n,y[n]=t}v["+"]=62,y[62]="+",v["/"]=63,y[63]="/";const m=e=>(new TextEncoder).encode(e),w=e=>"string"==typeof e?m(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e);var b=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},E=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},S=function(e){return b(void 0,void 0,void 0,(function(){var t;return E(this,(function(n){switch(n.label){case 0:return[4,e.body.getReader().read()];case 1:return t=n.sent().value,[2,JSON.parse(String.fromCharCode.apply(null,t))]}}))}))},_=function(e){return b(void 0,void 0,void 0,(function(){var t;return E(this,(function(n){switch(n.label){case 0:return[4,e.body.getReader().read()];case 1:return t=n.sent().value,[2,String.fromCharCode.apply(null,t)]}}))}))},T=window&&window.__assign||function(){return T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T.apply(this,arguments)},C=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},x=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},I=function(e){var t=this;this.assumeRoleWithWebIdentity=function(e){return C(t,void 0,void 0,(function(){var t,n,r,i,o,a;return x(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),t=T(T({},e),{Action:"AssumeRoleWithWebIdentity",Version:"2011-06-15"}),n=new URLSearchParams(Object.entries(t)).toString(),r=new c({method:"POST",headers:{"content-type":"application/x-www-form-urlencoded",host:this.hostname},protocol:"https:",hostname:this.hostname,body:n}),[4,this.fetchRequestHandler.handle(r)];case 1:return i=s.sent().response,[4,_(i)];case 2:return[2,{accessKeyId:(o=s.sent()).split("<AccessKeyId>")[1].split("</AccessKeyId>")[0],secretAccessKey:o.split("<SecretAccessKey>")[1].split("</SecretAccessKey>")[0],sessionToken:o.split("<SessionToken>")[1].split("</SessionToken>")[0],expiration:new Date(o.split("<Expiration>")[1].split("</Expiration>")[0])}];case 3:throw a=s.sent(),new Error("CWR: Failed to retrieve credentials from STS: ".concat(a));case 4:return[2]}}))}))},this.hostname="sts.".concat(e.region,".amazonaws.com"),this.fetchRequestHandler=e.fetchRequestHandler},O="cwr_c",P="cwr_i",A="cwr_s",L="cwr_u",k=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},R=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},M=function(e){var t,n=this;this.getId=function(e){return k(n,void 0,void 0,(function(){var t,n,r,i,o,a;return R(this,(function(s){switch(s.label){case 0:t=null;try{t=JSON.parse(localStorage.getItem(this.identityStorageKey))}catch(e){}if(t&&t.IdentityId)return[2,Promise.resolve(t)];s.label=1;case 1:return s.trys.push([1,4,,5]),n=JSON.stringify(e),r=this.getHttpRequest("AWSCognitoIdentityService.GetId",n),o=S,[4,this.fetchRequestHandler.handle(r)];case 2:return[4,o.apply(void 0,[s.sent().response])];case 3:i=s.sent();try{localStorage.setItem(this.identityStorageKey,JSON.stringify({IdentityId:i.IdentityId}))}catch(e){}return[2,i];case 4:throw a=s.sent(),new Error("CWR: Failed to retrieve Cognito identity: ".concat(a));case 5:return[2]}}))}))},this.getOpenIdToken=function(e){return k(n,void 0,void 0,(function(){var t,n,r,i,o;return R(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),t=JSON.stringify(e),n=this.getHttpRequest("AWSCognitoIdentityService.GetOpenIdToken",t),[4,this.fetchRequestHandler.handle(n)];case 1:return r=a.sent().response,i=this.validateOpenIdTokenResponse,[4,S(r)];case 2:return[2,i.apply(this,[a.sent()])];case 3:throw o=a.sent(),localStorage.removeItem(this.identityStorageKey),new Error("CWR: Failed to retrieve Cognito OpenId token: ".concat(o));case 4:return[2]}}))}))},this.getCredentialsForIdentity=function(e){return k(n,void 0,void 0,(function(){var t,n,r,i,o,a,s,c,u,l;return R(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),t=JSON.stringify({IdentityId:e}),n=this.getHttpRequest("AWSCognitoIdentityService.GetCredentialsForIdentity",t),[4,this.fetchRequestHandler.handle(n)];case 1:return r=d.sent().response,u=this.validateCredenentialsResponse,[4,S(r)];case 2:return i=u.apply(this,[d.sent()]),o=i.AccessKeyId,a=i.Expiration,s=i.SecretKey,c=i.SessionToken,[2,{accessKeyId:o,secretAccessKey:s,sessionToken:c,expiration:new Date(1e3*a)}];case 3:throw l=d.sent(),localStorage.removeItem(this.identityStorageKey),new Error("CWR: Failed to retrieve credentials for Cognito identity: ".concat(l));case 4:return[2]}}))}))},this.validateOpenIdTokenResponse=function(e){if("IdentityId"in e&&"Token"in e)return e;throw e&&"__type"in e&&"message"in e?new Error("".concat(e.__type,": ").concat(e.message)):new Error("Unknown OpenIdToken response")},this.validateCredenentialsResponse=function(e){if("IdentityId"in e&&"Credentials"in e)return e.Credentials;throw e&&"__type"in e&&"message"in e?new Error("".concat(e.__type,": ").concat(e.message)):new Error("Unknown Credentials response")},this.getHttpRequest=function(e,t){return new c({method:"POST",headers:{"content-type":"application/x-amz-json-1.1","x-amz-target":e},protocol:"https:",hostname:n.hostname,body:t})},this.hostname="cognito-identity.".concat(e.region,".amazonaws.com"),this.fetchRequestHandler=e.fetchRequestHandler,this.identityStorageKey=(null===(t=e.clientConfig)||void 0===t?void 0:t.cookieAttributes.unique)?"".concat(P,"_").concat(e.applicationId):P},j=window&&window.__assign||function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j.apply(this,arguments)},H=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},D=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},q=function(){function e(e,t){var n=this;this.ChainAnonymousCredentialsProvider=function(){return H(n,void 0,void 0,(function(){return D(this,(function(e){return[2,this.AnonymousCredentialsProvider().catch(this.AnonymousStorageCredentialsProvider).catch(this.AnonymousCognitoCredentialsProvider)]}))}))},this.AnonymousCredentialsProvider=function(){return H(n,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,new Promise((function(t,n){if(e.renewCredentials())return n();t(e.credentials)}))]}))}))},this.AnonymousStorageCredentialsProvider=function(){return H(n,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,new Promise((function(t,n){var r;try{r=JSON.parse(localStorage.getItem(e.credentialStorageKey))}catch(e){return n()}if(e.credentials=j(j({},r),{expiration:new Date(r.expiration)}),e.renewCredentials())return n();t(e.credentials)}))]}))}))};var r=e.identityPoolId.split(":")[0];this.config=e,this.cognitoIdentityClient=new M({fetchRequestHandler:new g,region:r,clientConfig:e,applicationId:t}),this.credentialStorageKey=this.config.cookieAttributes.unique?"".concat(O,"_").concat(t):O}return e.prototype.renewCredentials=function(){if(!this.credentials||!this.credentials.expiration)return!0;var e=new Date(this.credentials.expiration.getTime()-3e4);return new Date>e},e}(),U=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},F=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},B=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.AnonymousCognitoCredentialsProvider=function(){return N(r,void 0,void 0,(function(){var e,t,n,r,i;return F(this,(function(o){switch(o.label){case 0:e=1,o.label=1;case 1:o.label=2;case 2:return o.trys.push([2,6,,7]),[4,this.cognitoIdentityClient.getId({IdentityPoolId:this.config.identityPoolId})];case 3:return t=o.sent(),[4,this.cognitoIdentityClient.getOpenIdToken(t)];case 4:return n=o.sent(),[4,this.stsClient.assumeRoleWithWebIdentity({RoleArn:this.config.guestRoleArn,RoleSessionName:"cwr",WebIdentityToken:n.Token})];case 5:r=o.sent(),this.credentials=r;try{localStorage.setItem(this.credentialStorageKey,JSON.stringify(r))}catch(e){}return[2,r];case 6:if(i=o.sent(),!e)throw i;return e--,[3,7];case 7:return[3,1];case 8:return[2]}}))}))};var i=t.identityPoolId.split(":")[0];return r.stsClient=new I({fetchRequestHandler:new g,region:i}),r}return U(t,e),t}(q),X=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},$=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},V=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.AnonymousCognitoCredentialsProvider=function(){return z(r,void 0,void 0,(function(){var e,t,n,r;return $(this,(function(i){switch(i.label){case 0:e=1,i.label=1;case 1:i.label=2;case 2:return i.trys.push([2,5,,6]),[4,this.cognitoIdentityClient.getId({IdentityPoolId:this.config.identityPoolId})];case 3:return t=i.sent(),[4,this.cognitoIdentityClient.getCredentialsForIdentity(t.IdentityId)];case 4:n=i.sent(),this.credentials=n;try{localStorage.setItem(this.credentialStorageKey,JSON.stringify(n))}catch(e){}return[2,n];case 5:if(r=i.sent(),!e)throw r;return e--,[3,6];case 6:return[3,1];case 7:return[2]}}))}))},r}return X(t,e),t}(q),W="com.amazon.rum",G="".concat(W,".http_event"),K="".concat(W,".xray_trace_event"),Z="".concat(W,".largest_contentful_paint_event"),J="".concat(W,".first_input_delay_event"),Y="".concat(W,".cumulative_layout_shift_event"),Q="".concat(W,".interaction_to_next_paint_event"),ee="".concat(W,".performance_navigation_event"),te="".concat(W,".performance_resource_event"),ne="".concat(W,".dom_event"),re="".concat(W,".js_error_event"),ie="".concat(W,".page_view_event"),oe="".concat(W,".session_start_event"),ae=function(){function e(t){this.enabled=!0,this.pluginId=e.generatePluginId(t)}return e.generatePluginId=function(t){return"".concat(e.idPrefix,".").concat(t)},e.prototype.load=function(e){var t;this.context=e,null===(t=this.onload)||void 0===t||t.call(this)},e.prototype.getPluginId=function(){return this.pluginId},e.idPrefix="com.amazonaws.rum",e}(),se=function(){function e(e){this.context=e,this.plugins=new Map}return e.prototype.addPlugin=function(e){var t=e.getPluginId();if(this.hasPlugin(t))throw new Error('Plugin "'.concat(t,'" already defined in the PluginManager'));this.plugins.set(t,e),e.load(this.context)},e.prototype.updatePlugin=function(e,t){var n,r=this.getPlugin(e);null===(n=null==r?void 0:r.update)||void 0===n||n.call(r,t)},e.prototype.enable=function(){this.plugins.forEach((function(e){return e.enable()}))},e.prototype.disable=function(){this.plugins.forEach((function(e){return e.disable()}))},e.prototype.hasPlugin=function(e){return Boolean(this.getPlugin(e))},e.prototype.record=function(e,t){var n=this.getPlugin(e);if(!((null==n?void 0:n.record)instanceof Function))throw new Error("AWS RUM Client record: Invalid plugin ID");n.record(t)},e.prototype.getPlugin=function(e){var t;return null!==(t=this.plugins.get(e))&&void 0!==t?t:this.plugins.get(ae.generatePluginId(e))},e}(),ce=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue=window&&window.__assign||function(){return ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ue.apply(this,arguments)},le="dom-event",de={interactionId:function(){return""},enableMutationObserver:!1,events:[]},he=function(e){function t(t){var n=e.call(this,le)||this;return n.enabled=!1,n.eventListenerMap=new Map,n.config=ue(ue({},de),t),n}return ce(t,e),t.getElementInfo=function(e){var t={name:"UNKNOWN"};return e.target instanceof Node&&(t.name=e.target.nodeName),e.target instanceof Element&&e.target.id&&(t.id=e.target.id),t},t.prototype.enable=function(){var e=this;"complete"===document.readyState?this.enabled||(this.addListeners(),this.config.enableMutationObserver&&this.observeDOMMutation(),this.enabled=!0):window.addEventListener("load",(function(){return e.enable()}))},t.prototype.disable=function(){this.enabled&&(this.removeListeners(),this.observer&&this.observer.disconnect(),this.enabled=!1)},t.prototype.update=function(e){var t=this;e.forEach((function(e){t.addEventHandler(e),t.config.events.push(e)}))},t.prototype.onload=function(){this.enable()},t.prototype.removeListeners=function(){var e=this;this.config.events.forEach((function(t){return e.removeEventHandler(t)}))},t.prototype.addListeners=function(){var e=this;this.config.events.forEach((function(t){return e.addEventHandler(t)}))},t.prototype.getEventListener=function(e){var n=this;return function(r){var i,o=t.getElementInfo(r),a=n.config.interactionId(r),s=ue(ue(ue({version:"1.1.0",event:r.type,element:o.name},o.id?{elementId:o.id}:{}),a?{interactionId:a}:{}),e?{cssLocator:e}:{});(null===(i=n.context)||void 0===i?void 0:i.record)&&n.context.record(ne,s)}},t.prototype.addEventHandler=function(e){var t=e.event,n=this.getEventListener(e.cssLocator),r=[],i=this.eventListenerMap.has(e)?this.eventListenerMap.get(e):[];if(e.cssLocator)document.querySelectorAll(e.cssLocator).forEach((function(e){r.push(e)}));else if(e.elementId){var o=document.getElementById(e.elementId);o&&r.push(o)}else e.element&&r.push(e.element);r.forEach((function(e){e.addEventListener(t,n),i.push({element:e,eventListener:n})})),this.eventListenerMap.set(e,i)},t.prototype.removeEventHandler=function(e){var t=this.eventListenerMap.get(e);t&&(t.forEach((function(t){var n=t.element,r=t.eventListener;n.removeEventListener(e.event,r)})),this.eventListenerMap.delete(e))},t.prototype.observeDOMMutation=function(){var e=this;this.observer=new MutationObserver((function(){e.removeListeners(),e.addListeners()})),this.observer.observe(document,{childList:!0,subtree:!0})},t}(ae),fe=function(e){return e!==Object(e)&&null!=e},pe=function(e,t){var n=function(e){var t={version:"1.0.0",type:"undefined",message:"undefined"};return void 0!==e.type&&(t.type=e.type),void 0!==e.message&&(t.message=e.message),void 0!==e.filename&&(t.filename=e.filename),void 0!==e.lineno&&(t.lineno=e.lineno),void 0!==e.colno&&(t.colno=e.colno),t}(e),r=e.error;return!function(e){var t=typeof e;return("object"===t||"function"===t)&&!!e}(r)?fe(r)&&function(e,t){"unhandledrejection"!==e.type&&(e.type=t.toString()),e.message=t.toString()}(n,r):function(e,t,n){t.name&&(e.type=t.name),t.message&&(e.message=t.message),t.fileName&&(e.filename=t.fileName),t.lineNumber&&(e.lineno=t.lineNumber),t.columnNumber&&(e.colno=t.columnNumber),n&&t.stack&&(e.stack=t.stack.length>n?t.stack.substring(0,n)+"...":t.stack)}(n,r,t),n},ge=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ve=window&&window.__assign||function(){return ve=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ve.apply(this,arguments)},ye="js-error",me={stackTraceLength:1e3,ignore:function(){return!1}},we=function(e){function t(t){var n=e.call(this,ye)||this;return n.eventHandler=function(e){n.config.ignore(e)||n.recordJsErrorEvent(e)},n.promiseRejectEventHandler=function(e){n.config.ignore(e)||n.recordJsErrorEvent({type:e.type,error:e.reason})},n.config=ve(ve({},me),t),n}return ge(t,e),t.prototype.enable=function(){this.enabled||(this.addEventHandler(),this.enabled=!0)},t.prototype.disable=function(){this.enabled&&(this.removeEventHandler(),this.enabled=!1)},t.prototype.record=function(e){e instanceof ErrorEvent?this.recordJsErrorEvent(e):this.recordJsErrorEvent({type:"error",error:e})},t.prototype.onload=function(){this.addEventHandler()},t.prototype.recordJsErrorEvent=function(e){var t;null===(t=this.context)||void 0===t||t.record(re,pe(e,this.config.stackTraceLength))},t.prototype.addEventHandler=function(){window.addEventListener("error",this.eventHandler),window.addEventListener("unhandledrejection",this.promiseRejectEventHandler)},t.prototype.removeEventHandler=function(){window.removeEventListener("error",this.eventHandler),window.removeEventListener("unhandledrejection",this.promiseRejectEventHandler)},t}(ae),be=function(e,t,n,r,i){var o=e+"=";o+=t||"",void 0!==i&&(o+="; Expires=".concat(i.toUTCString())),o+="; Domain=".concat(n.domain),o+="; Path=".concat(n.path),o+="; SameSite=".concat(n.sameSite),o+=n.secure?"; Secure":"",document.cookie=o},Ee=function(e){for(var t=0,n=document.cookie.split("; ");t<n.length;t++){var r=n[t].split("=");if(r[0]===e)return r[1]}return""};let Se;const _e=new Uint8Array(16);function Te(){if(!Se&&(Se="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Se))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Se(_e)}const Ce=[];for(let e=0;e<256;++e)Ce.push((e+256).toString(16).slice(1));var xe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ie(e,t,n){if(xe.randomUUID&&!e)return xe.randomUUID();const r=(e=e||{}).random||(e.rng||Te)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return Ce[e[t+0]]+Ce[e[t+1]]+Ce[e[t+2]]+Ce[e[t+3]]+"-"+Ce[e[t+4]]+Ce[e[t+5]]+"-"+Ce[e[t+6]]+Ce[e[t+7]]+"-"+Ce[e[t+8]]+Ce[e[t+9]]+"-"+Ce[e[t+10]]+Ce[e[t+11]]+Ce[e[t+12]]+Ce[e[t+13]]+Ce[e[t+14]]+Ce[e[t+15]]}(r)}function Oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pe(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var Ae,Le={exports:{}},ke=Le.exports;var Re,Me,je=(Ae||(Ae=1,function(e,t){!function(n,r){var i="function",o="undefined",a="object",s="string",c="major",u="model",l="name",d="type",h="vendor",f="version",p="architecture",g="console",v="mobile",y="tablet",m="smarttv",w="wearable",b="embedded",E="Amazon",S="Apple",_="ASUS",T="BlackBerry",C="Browser",x="Chrome",I="Firefox",O="Google",P="Huawei",A="LG",L="Microsoft",k="Motorola",R="Opera",M="Samsung",j="Sharp",H="Sony",D="Xiaomi",q="Zebra",U="Facebook",N="Chromium OS",F="Mac OS",B=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},X=function(e,t){return typeof e===s&&-1!==z(t).indexOf(z(e))},z=function(e){return e.toLowerCase()},$=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},V=function(e,t){for(var n,o,s,c,u,l,d=0;d<t.length&&!u;){var h=t[d],f=t[d+1];for(n=o=0;n<h.length&&!u&&h[n];)if(u=h[n++].exec(e))for(s=0;s<f.length;s++)l=u[++o],typeof(c=f[s])===a&&c.length>0?2===c.length?typeof c[1]==i?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?typeof c[1]!==i||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):r:this[c[0]]=l?c[1].call(this,l,c[2]):r:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):r):this[c]=l||r;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(X(t[n][i],e))return"?"===n?r:n}else if(X(t[n],e))return"?"===n?r:n;return e},G={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"},K={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,f],[/opios[\/ ]+([\w\.]+)/i],[f,[l,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[l,R]],[/(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|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[l,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+C],f],[/\bfocus\/([\w\.]+)/i],[f,[l,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[l,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[l,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[l,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[f,[l,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+C]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+C],f],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,U],f],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[l,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,x+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[l,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[f,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[l,I+" 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,/panasonic;(viera)/i],[l,f],[/(cobalt)\/([\w\.]+)/i],[l,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,z]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",z]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,z]]],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],[d,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[h,M],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[h,S],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[h,S],[d,y]],[/(macintosh);/i],[u,[h,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[h,j],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[h,P],[d,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[h,P],[d,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[h,D],[d,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[h,D],[d,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"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[h,"Vivo"],[d,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[h,"Realme"],[d,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[h,k],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[h,k],[d,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[h,A],[d,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[h,A],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[h,"Lenovo"],[d,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[h,"Nokia"],[d,v]],[/(pixel c)\b/i],[u,[h,O],[d,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[h,O],[d,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[h,H],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[h,H],[d,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[h,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[h,E],[d,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[h,E],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,h,[d,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[h,T],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[h,_],[d,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[h,_],[d,v]],[/(nexus 9)/i],[u,[h,"HTC"],[d,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[u,/_/g," "],[d,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[h,"Acer"],[d,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[h,"Meizu"],[d,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,u,[d,v]],[/(kobo)\s(ereader|touch)/i,/(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,[d,y]],[/(surface duo)/i],[u,[h,L],[d,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[h,"Fairphone"],[d,v]],[/(u304aa)/i],[u,[h,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[u,[h,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[u,[h,"RCA"],[d,y]],[/\b(venue[\d ]{2,7}) b/i],[u,[h,"Dell"],[d,y]],[/\b(q(?:mv|ta)\w+) b/i],[u,[h,"Verizon"],[d,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[h,"Barnes & Noble"],[d,y]],[/\b(tm\d{3}\w+) b/i],[u,[h,"NuVision"],[d,y]],[/\b(k88) b/i],[u,[h,"ZTE"],[d,y]],[/\b(nx\d{3}j) b/i],[u,[h,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[u,[h,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[u,[h,"Swiss"],[d,y]],[/\b((zeki)?tb.*\b) b/i],[u,[h,"Zeki"],[d,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],u,[d,y]],[/\b(ns-?\w{0,9}) b/i],[u,[h,"Insignia"],[d,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[h,"NextBook"],[d,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],u,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],u,[d,v]],[/\b(ph-1) /i],[u,[h,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[h,"Envizen"],[d,y]],[/\b(trio[-\w\. ]+) b/i],[u,[h,"MachSpeed"],[d,y]],[/\btu_(1491) b/i],[u,[h,"Rotor"],[d,y]],[/(shield[\w ]+) b/i],[u,[h,"Nvidia"],[d,y]],[/(sprint) (\w+)/i],[h,u,[d,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[h,L],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[h,q],[d,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[h,q],[d,v]],[/smart-tv.+(samsung)/i],[h,[d,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[h,M],[d,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,A],[d,m]],[/(apple) ?tv/i],[h,[u,S+" TV"],[d,m]],[/crkey/i],[[u,x+"cast"],[h,O],[d,m]],[/droid.+aft(\w)( bui|\))/i],[u,[h,E],[d,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[h,j],[d,m]],[/(bravia[\w ]+)( bui|\))/i],[u,[h,H],[d,m]],[/(mitv-\w{5}) bui/i],[u,[h,D],[d,m]],[/Hbbtv.*(technisat) (.*);/i],[h,u,[d,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,$],[u,$],[d,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,u,[d,g]],[/droid.+; (shield) bui/i],[u,[h,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[u,[h,H],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[h,L],[d,g]],[/((pebble))app/i],[h,u,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[h,S],[d,w]],[/droid.+; (glass) \d/i],[u,[h,O],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[h,q],[d,w]],[/(quest( 2| pro)?)/i],[u,[h,U],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,b]],[/(aeobc)\b/i],[u,[h,E],[d,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[f,W,G]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[f,W,G]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,F],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,f],[/\(bb(10);/i],[f,[l,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[l,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[l,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,N],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,f],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,f]]},Z=function(e,t){if(typeof e===a&&(t=e,e=r),!(this instanceof Z))return new Z(e,t).getResult();var g=typeof n!==o&&n.navigator?n.navigator:r,m=e||(g&&g.userAgent?g.userAgent:""),w=g&&g.userAgentData?g.userAgentData:r,b=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(K,t):K,E=g&&g.userAgent==m;return this.getBrowser=function(){var e,t={};return t[l]=r,t[f]=r,V.call(t,m,b.browser),t[c]=typeof(e=t[f])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r,E&&g&&g.brave&&typeof g.brave.isBrave==i&&(t[l]="Brave"),t},this.getCPU=function(){var e={};return e[p]=r,V.call(e,m,b.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[u]=r,e[d]=r,V.call(e,m,b.device),E&&!e[d]&&w&&w.mobile&&(e[d]=v),E&&"Macintosh"==e[u]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[u]="iPad",e[d]=y),e},this.getEngine=function(){var e={};return e[l]=r,e[f]=r,V.call(e,m,b.engine),e},this.getOS=function(){var e={};return e[l]=r,e[f]=r,V.call(e,m,b.os),E&&!e[l]&&w&&"Unknown"!=w.platform&&(e[l]=w.platform.replace(/chrome os/i,N).replace(/macos/i,F)),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 m},this.setUA=function(e){return m=typeof e===s&&e.length>350?$(e,350):e,this},this.setUA(m),this};Z.VERSION="1.0.35",Z.BROWSER=B([l,f,c]),Z.CPU=B([p]),Z.DEVICE=B([u,h,d,g,v,m,y,w,b]),Z.ENGINE=Z.OS=B([l,f]),e.exports&&(t=e.exports=Z),t.UAParser=Z;var J=typeof n!==o&&(n.jQuery||n.Zepto);if(J&&!J.ua){var Y=new Z;J.ua=Y.getResult(),J.ua.get=function(){return Y.getUA()},J.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var n in t)J.ua[n]=t[n]}}}("object"==typeof window?window:ke)}(Le,Le.exports)),Le.exports),He=window&&window.__assign||function(){return He=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},He.apply(this,arguments)},De="00000000-0000-0000-0000-000000000000",qe="unknown",Ue=function(){function e(e,t,n,r){this.appMonitorDetails=e,this.config=t,this.recordEvent=n,this.pageManager=r,this.sessionCookieName=this.config.cookieAttributes.unique?"".concat(A,"_").concat(this.appMonitorDetails.id):A,this.session={sessionId:De,record:this.sample(),eventCount:0},this.initializeUser(),this.collectAttributes(),this.addSessionAttributes(this.config.sessionAttributes),this.getSessionFromCookie()}return e.prototype.isSampled=function(){return this.session.record},e.prototype.getSession=function(){return(this.session.sessionId===De||this.session.sessionId!==De&&new Date>=this.sessionExpiry)&&this.createSession(),this.session},e.prototype.getAttributes=function(){return this.attributes},e.prototype.addSessionAttributes=function(e){this.attributes=He(He({},this.attributes),e)},e.prototype.getUserId=function(){return this.useCookies()?this.userId:De},e.prototype.incrementSessionEventCount=function(){this.session.eventCount++,this.renewSession()},e.prototype.isLimitExceeded=function(){return this.session.eventCount>=this.config.sessionEventLimit&&this.config.sessionEventLimit>0},e.prototype.canRecord=function(){return this.session.record&&!this.isLimitExceeded()},e.prototype.initializeUser=function(){var e="";this.userExpiry=new Date,this.userExpiry.setDate(this.userExpiry.getDate()+this.config.userIdRetentionDays),this.config.userIdRetentionDays<=0?this.userId="00000000-0000-0000-0000-000000000000":this.useCookies()?(e=this.getUserIdCookie(),this.userId=e||Ie(),this.createOrRenewUserCookie(e,this.userExpiry)):this.userId=Ie()},e.prototype.createOrRenewSessionCookie=function(e,t){btoa&&be(this.sessionCookieName,btoa(JSON.stringify(e)),this.config.cookieAttributes,0,t)},e.prototype.createOrRenewUserCookie=function(e,t){be(L,e,this.config.cookieAttributes,0,t)},e.prototype.getUserIdCookie=function(){return Ee(L)},e.prototype.getSessionFromCookie=function(){if(this.useCookies()){var e=Ee(this.sessionCookieName);if(e&&atob)try{this.session=JSON.parse(atob(e)),this.pageManager.resumeSession(this.session.page)}catch(e){}}},e.prototype.storeSessionAsCookie=function(){this.useCookies()&&this.config.userIdRetentionDays>0&&this.createOrRenewUserCookie(this.userId,this.userExpiry),this.useCookies()&&this.createOrRenewSessionCookie(this.session,this.sessionExpiry)},e.prototype.createSession=function(){this.session={sessionId:Ie(),record:this.session.sessionId===De?this.session.record:this.sample(),eventCount:0},this.session.page=this.pageManager.getPage(),this.sessionExpiry=new Date((new Date).getTime()+1e3*this.config.sessionLengthSeconds),this.storeSessionAsCookie(),this.recordEvent(oe,{version:"1.0.0"})},e.prototype.renewSession=function(){this.sessionExpiry=new Date((new Date).getTime()+1e3*this.config.sessionLengthSeconds),this.session.page=this.pageManager.getPage(),this.storeSessionAsCookie()},e.prototype.collectAttributes=function(){var e=new je.UAParser(navigator.userAgent).getResult();this.attributes={browserLanguage:navigator.language,browserName:e.browser.name?e.browser.name:qe,browserVersion:e.browser.version?e.browser.version:qe,osName:e.os.name?e.os.name:qe,osVersion:e.os.version?e.os.version:qe,deviceType:e.device.type?e.device.type:"desktop",platformType:"web",domain:window.location.hostname,"aws:releaseId":this.config.releaseId}},e.prototype.useCookies=function(){return navigator.cookieEnabled&&this.config.allowCookies},e.prototype.sample=function(){return Math.random()<this.config.sessionSampleRate},e}();var Ne,Fe=function(){if(Me)return Re;function e(e){return"function"==typeof e}Me=1;var t=console.error.bind(console);function n(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function r(n){n&&n.logger&&(e(n.logger)?t=n.logger:t("new logger isn't a function, not replacing"))}function i(r,i,o){if(r&&r[i]){if(!o)return t("no wrapper function"),void t((new Error).stack);if(e(r[i])&&e(o)){var a=r[i],s=o(a,i);return n(s,"__original",a),n(s,"__unwrap",(function(){r[i]===s&&n(r,i,a)})),n(s,"__wrapped",!0),n(r,i,s),s}t("original object and wrapper must be functions")}else t("no original function "+i+" to wrap")}function o(e,n){return e&&e[n]?e[n].__unwrap?e[n].__unwrap():void t("no original to unwrap to -- has "+n+" already been unwrapped?"):(t("no function to unwrap."),void t((new Error).stack))}return r.wrap=i,r.massWrap=function(e,n,r){if(!e)return t("must provide one or more modules to patch"),void t((new Error).stack);Array.isArray(e)||(e=[e]),n&&Array.isArray(n)?e.forEach((function(e){n.forEach((function(t){i(e,t,r)}))})):t("must provide one or more functions to wrap on modules")},r.unwrap=o,r.massUnwrap=function(e,n){if(!e)return t("must provide one or more modules to patch"),void t((new Error).stack);Array.isArray(e)||(e=[e]),n&&Array.isArray(n)?e.forEach((function(e){n.forEach((function(t){o(e,t)}))})):t("must provide one or more functions to unwrap on modules")},Re=r}(),Be=e({__proto__:null,default:Oe(Fe)},[Fe]),Xe=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ze=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enable=t.patch.bind(t,!0),t.disable=t.patch.bind(t,!1),t.enabled=!1,t}return Xe(t,e),t.prototype.patchAll=function(){for(var e=Fe.wrap.bind(Be),t=0,n=this.patches;t<n.length;t++){var r=n[t];e(r.nodule,r.name,r.wrapper())}},t.prototype.unpatchAll=function(){for(var e=Fe.unwrap.bind(Be),t=0,n=this.patches;t<n.length;t++){var r=n[t];e(r.nodule,r.name)}},t.prototype.patch=function(e){void 0===e&&(e=!0),this.enabled!==e&&(this.enabled=e,e?this.patchAll():this.unpatchAll())},t}(ae),$e=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ve=function(e){function t(t,n,r){var i=e.call(this,"virtual-page-load-timer")||this;return i.sendWrapper=function(){var e=i;return function(t){return function(){return e.recordXhr(this),this.addEventListener("loadend",e.endTracking),t.apply(this,arguments)}}},i.endTracking=function(e){var t=Date.now(),n=e.target;n.removeEventListener("loadend",i.endTracking),i.removeXhr(n,t)},i.fetch=function(e,t,n){return e.apply(t,n).catch((function(e){throw e})).finally(i.decrementFetchCounter)},i.fetchWrapper=function(){var e=i;return function(t){return function(n,r){return e.fetchCounter+=1,e.fetch(t,this,arguments)}}},i.decrementFetchCounter=function(){i.isPageLoaded||(i.latestEndTime=Date.now()),i.fetchCounter-=1},i.checkLoadStatus=function(){0===i.ongoingRequests.size&&0===i.fetchCounter&&(clearInterval(i.periodicCheckerId),clearTimeout(i.timeoutCheckerId),i.domMutationObserver.disconnect(),i.recordRouteChangeNavigationEvent(i.pageManager.getPage()),i.periodicCheckerId=void 0,i.timeoutCheckerId=void 0,i.isPageLoaded=!0)},i.declareTimeout=function(){clearInterval(i.periodicCheckerId),i.periodicCheckerId=void 0,i.timeoutCheckerId=void 0,i.domMutationObserver.disconnect(),i.isPageLoaded=!0},i.resetInterval=function(){i.latestEndTime=Date.now(),clearInterval(i.periodicCheckerId),i.periodicCheckerId=setInterval(i.checkLoadStatus,i.config.routeChangeComplete)},i.moveItemsFromBuffer=function(e){i.ongoingRequests.add(e)},i.updateLatestInteractionTime=function(e){i.latestInteractionTime=Date.now()},i.periodicCheckerId=void 0,i.timeoutCheckerId=void 0,i.domMutationObserver=new MutationObserver(i.resetInterval),i.ongoingRequests=new Set,i.requestBuffer=new Set,i.fetchCounter=0,i.isPageLoaded=!0,i.latestEndTime=0,i.latestInteractionTime=0,i.config=n,i.pageManager=t,i.record=r,i.enable(),document.addEventListener("mousedown",i.updateLatestInteractionTime),document.addEventListener("keydown",i.updateLatestInteractionTime),i}return $e(t,e),Object.defineProperty(t.prototype,"patches",{get:function(){return[{nodule:XMLHttpRequest.prototype,name:"send",wrapper:this.sendWrapper},{nodule:window,name:"fetch",wrapper:this.fetchWrapper}]},enumerable:!1,configurable:!0}),t.prototype.startTiming=function(){this.latestEndTime=Date.now(),this.periodicCheckerId&&clearInterval(this.periodicCheckerId),this.timeoutCheckerId&&clearTimeout(this.timeoutCheckerId),this.domMutationObserver.disconnect(),this.periodicCheckerId=setInterval(this.checkLoadStatus,this.config.routeChangeComplete),this.timeoutCheckerId=setTimeout(this.declareTimeout,this.config.routeChangeTimeout),this.domMutationObserver.observe(document,{subtree:!0,childList:!0,attributes:!1,characterData:!1}),this.isPageLoaded=!1,this.requestBuffer.forEach(this.moveItemsFromBuffer),this.requestBuffer.clear()},t.prototype.recordXhr=function(e){this.pageManager.getPage()&&!1===this.isPageLoaded?this.ongoingRequests.add(e):this.requestBuffer.add(e)},t.prototype.removeXhr=function(e,t){this.pageManager.getPage()&&this.ongoingRequests.has(e)?(this.ongoingRequests.delete(e),this.latestEndTime=t):this.requestBuffer.has(e)&&this.requestBuffer.delete(e)},t.prototype.recordRouteChangeNavigationEvent=function(e){var t={version:"1.0.0",initiatorType:"route_change",navigationType:"navigate",startTime:e.start,duration:this.latestEndTime-e.start};this.record&&this.record(ee,t)},t}(ze),We=window&&window.__assign||function(){return We=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},We.apply(this,arguments)},Ge=function(){function e(e,t){this.TIMEOUT=1e3,this.config=e,this.record=t,this.page=void 0,this.resumed=!1,this.recordInteraction=!1,this.virtualPageLoadTimer=new Ve(this,e,t)}return e.prototype.getPage=function(){return this.page},e.prototype.getAttributes=function(){return this.attributes},e.prototype.resumeSession=function(e){this.recordInteraction=!0,e&&(this.page=e,this.resumed=!0)},e.prototype.recordPageView=function(e){var t;if(t="string"==typeof e?e:e.pageId,this.useCookies()&&(this.recordInteraction=!0),this.page){if(this.page.pageId===t)return this.resumed?void this.collectAttributes(this.page,"object"==typeof e?e:void 0):void 0;this.createNextPage(this.page,t)}else this.createLandingPage(t);this.collectAttributes(this.page,"object"==typeof e?e:void 0),this.recordPageViewEvent(this.page)},e.prototype.createNextPage=function(e,t){var n=Date.now(),r=this.virtualPageLoadTimer.latestInteractionTime;!this.resumed&&n-r<=this.TIMEOUT&&(n=r,this.virtualPageLoadTimer.startTiming()),this.timeOnParentPage=n-e.start,this.resumed=!1,this.page={pageId:t,parentPageId:e.pageId,interaction:e.interaction+1,referrer:document.referrer,referrerDomain:this.getDomainFromReferrer(),start:n}},e.prototype.createLandingPage=function(e){this.page={pageId:e,interaction:0,referrer:document.referrer,referrerDomain:this.getDomainFromReferrer(),start:Date.now()}},e.prototype.collectAttributes=function(e,t){var n;this.attributes={title:(null===(n=null==t?void 0:t.pageAttributes)||void 0===n?void 0:n.title)?t.pageAttributes.title:document.title,pageId:e.pageId},this.recordInteraction&&(this.attributes.interaction=e.interaction,void 0!==e.parentPageId&&(this.attributes.parentPageId=e.parentPageId)),(null==t?void 0:t.pageTags)&&(this.attributes.pageTags=t.pageTags),(null==t?void 0:t.pageAttributes)&&(this.attributes=We(We({},t.pageAttributes),this.attributes))},e.prototype.createPageViewEvent=function(e){var t={version:"1.0.0",pageId:e.pageId};return this.recordInteraction&&(t.interaction=e.interaction,t.pageInteractionId=e.pageId+"-"+e.interaction,void 0!==e.parentPageId&&(t.parentPageInteractionId=e.parentPageId+"-"+(e.interaction-1),t.timeOnParentPage=this.timeOnParentPage),t.referrer=document.referrer,t.referrerDomain=this.getDomainFromReferrer()),t},e.prototype.recordPageViewEvent=function(e){this.record(ie,this.createPageViewEvent(e))},e.prototype.useCookies=function(){return navigator.cookieEnabled&&this.config.allowCookies},e.prototype.getDomainFromReferrer=function(){try{return new URL(document.referrer).hostname}catch(e){return"localhost"===document.referrer?document.referrer:""}},e}();!function(e){e.EVENT="event"}(Ne||(Ne={}));var Ke=function(){function e(){this.subscribers=new Map}return e.prototype.subscribe=function(e,t){var n,r=null!==(n=this.subscribers.get(e))&&void 0!==n?n:[];r.length||this.subscribers.set(e,r),r.push(t)},e.prototype.unsubscribe=function(e,t){var n=this.subscribers.get(e);if(n)for(var r=0;r<n.length;r++)if(n[r]===t)return n.splice(r,1),!0;return!1},e.prototype.dispatch=function(e,t){var n=this.subscribers.get(e);if(n)for(var r=0,i=n;r<i.length;r++){(0,i[r])(t)}},e}(),Ze=window&&window.__assign||function(){return Ze=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ze.apply(this,arguments)},Je=function(){function e(e,t,n){void 0===n&&(n=new Ke);var r=this;this.eventBus=n,this.events=[],this.candidates=new Map,this.recordPageView=function(e){r.isCurrentUrlAllowed()&&r.pageManager.recordPageView(e)},this.recordEvent=function(e,t){r.enabled&&r.isCurrentUrlAllowed()&&(e!==oe&&r.sessionManager.getSession(),r.sessionManager.canRecord()&&(r.sessionManager.incrementSessionEventCount(),r.addRecordToCache(e,t)))},this.recordCandidate=function(e,t){var n=r.sessionManager.getSession();if(r.enabled&&r.isCurrentUrlAllowed()&&n.record){var i=r.createEvent(e,t)[0];r.candidates.has(e)?r.candidates.set(e,i):r.candidates.size<r.config.candidatesCacheSize&&!r.sessionManager.isLimitExceeded()&&(r.candidates.set(e,i),r.sessionManager.incrementSessionEventCount())}},this.getSession=function(){if(r.isCurrentUrlAllowed())return r.sessionManager.getSession()},this.addRecordToCache=function(e,t){if(r.enabled&&r.events.length!==r.config.eventCacheSize){var n=r.createEvent(e,t),i=n[0],o=n[1];r.eventBus.dispatch(Ne.EVENT,o),r.events.push(i)}},this.createEvent=function(e,t){var n=Ze(Ze(Ze({},r.sessionManager.getAttributes()),r.pageManager.getAttributes()),{version:"1.0.0","aws:client":r.installationMethod,"aws:clientVersion":"1.25.0"}),i={id:Ie(),timestamp:new Date,type:e};return[Ze(Ze({},i),{details:JSON.stringify(t),metadata:JSON.stringify(n)}),Ze(Ze({},i),{details:t,metadata:n})]},this.appMonitorDetails=e,this.config=t,this.enabled=!0,this.pageManager=new Ge(t,this.recordEvent),this.sessionManager=new Ue(e,t,this.recordEvent,this.pageManager),this.installationMethod=t.client}return e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.isSessionSampled=function(){return this.sessionManager.isSampled()},e.prototype.hasEvents=function(){return 0!==this.events.length},e.prototype.hasCandidates=function(){return 0!==this.candidates.size},e.prototype.getEventBatch=function(e){void 0===e&&(e=!1);var t=[];if(e&&this.hasCandidates())if(this.candidates.size<=this.config.batchLimit)t=Array.from(this.candidates.values()),this.candidates.clear();else for(var n=0,r=0,i=Array.from(this.candidates.keys());r<i.length;r++){var o=i[r];if(n++>=this.config.batchLimit)break;var a=this.candidates.get(o);a&&(t.push(a),this.candidates.delete(o))}return this.events.length&&(this.events.length<=this.config.batchLimit-t.length?(t.push.apply(t,this.events),this.events=[]):t.push.apply(t,this.events.splice(0,this.config.batchLimit-t.length))),t},e.prototype.getAppMonitorDetails=function(){return this.appMonitorDetails},e.prototype.getUserDetails=function(){return{userId:this.sessionManager.getUserId(),sessionId:this.sessionManager.getSession().sessionId}},e.prototype.addSessionAttributes=function(e){this.sessionManager.addSessionAttributes(e)},e.prototype.isCurrentUrlAllowed=function(){var e=document.location.toString(),t=this.config.pagesToExclude.some((function(t){return t.test(e)}));return this.config.pagesToInclude.some((function(t){return t.test(e)}))&&!t},e}();const Ye={},Qe={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),Ye[e]=t,Qe[t]=e}function et(e){let t="";for(let n=0;n<e.byteLength;n++)t+=Ye[e[n]];return t}const tt=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},nt="X-Amz-Date",rt="X-Amz-Signature",it="X-Amz-Security-Token",ot="authorization",at=nt.toLowerCase(),st=[ot,at,"date"],ct=rt.toLowerCase(),ut="x-amz-content-sha256",lt=it.toLowerCase(),dt={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},ht=/^proxy-/,ft=/^sec-/,pt="AWS4-HMAC-SHA256",gt="AWS4-HMAC-SHA256-PAYLOAD",vt="aws4_request",yt={},mt=[],wt=(e,t,n)=>`${e}/${t}/${n}/${vt}`,bt=(e,t,n)=>{const r=new e(t);return r.update(w(n)),r.digest()},Et=({headers:e},t,n)=>{const r={};for(const i of Object.keys(e).sort()){if(null==e[i])continue;const o=i.toLowerCase();(o in dt||t?.has(o)||ht.test(o)||ft.test(o))&&(!n||n&&!n.has(o))||(r[o]=e[i].trim().replace(/\s+/g," "))}return r},St=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===ut)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||(r=t,"function"==typeof ArrayBuffer&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(r))){const e=new n;return e.update(w(t)),et(await e.digest())}var r;return"UNSIGNED-PAYLOAD"};class _t{format(e){const t=[];for(const n of Object.keys(e)){const r=m(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce(((e,t)=>e+t.byteLength),0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const o=new Uint8Array(i.buffer);return o.set(e.value,3),o;case"string":const a=m(e.value),s=new DataView(new ArrayBuffer(3+a.byteLength));s.setUint8(0,7),s.setUint16(1,a.byteLength,!1);const c=new Uint8Array(s.buffer);return c.set(a,3),c;case"timestamp":const u=new Uint8Array(9);return u[0]=8,u.set(xt.fromNumber(e.value.valueOf()).bytes,1),u;case"uuid":if(!Ct.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const l=new Uint8Array(17);return l[0]=9,l.set(function(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(!(r in Qe))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=Qe[r]}return t}(e.value.replace(/\-/g,"")),1),l}}}var Tt;!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(Tt||(Tt={}));const Ct=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class xt{constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&It(t),new xt(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&It(e),parseInt(et(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function It(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}const Ot=e=>{e=c.clone(e);for(const t of Object.keys(e.headers))st.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},Pt=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e;class At{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o=!0}){this.headerFormatter=new _t,this.service=r,this.sha256=i,this.uriEscapePath=o,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=tt(n),this.credentialProvider=tt(t)}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:a,hoistableHeaders:s,signingRegion:u,signingService:l}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const h=u??await this.regionProvider(),{longDate:f,shortDate:p}=Lt(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const g=wt(p,h,l??this.service),v=((e,t={})=>{const{headers:n,query:r={}}=c.clone(e);for(const e of Object.keys(n)){const i=e.toLowerCase();("x-amz-"===i.slice(0,6)&&!t.unhoistableHeaders?.has(i)||t.hoistableHeaders?.has(i))&&(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}})(Ot(e),{unhoistableHeaders:o,hoistableHeaders:s});d.sessionToken&&(v.query[it]=d.sessionToken),v.query["X-Amz-Algorithm"]=pt,v.query["X-Amz-Credential"]=`${d.accessKeyId}/${g}`,v.query[nt]=f,v.query["X-Amz-Expires"]=r.toString(10);const y=Et(v,i,a);return v.query["X-Amz-SignedHeaders"]=kt(y),v.query[rt]=await this.getSignature(f,g,this.getSigningKey(d,h,p,l),this.createCanonicalRequest(v,y,await St(e,this.sha256))),v}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:i,signingService:o}){const a=i??await this.regionProvider(),{shortDate:s,longDate:c}=Lt(n),u=wt(s,a,o??this.service),l=await St({headers:{},body:t},this.sha256),d=new this.sha256;d.update(e);const h=et(await d.digest()),f=[gt,c,u,r,h,l].join("\n");return this.signString(f,{signingDate:n,signingRegion:a,signingService:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature}).then((t=>({message:e.message,signature:t})))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r}={}){const i=await this.credentialProvider();this.validateResolvedCredentials(i);const o=n??await this.regionProvider(),{shortDate:a}=Lt(t),s=new this.sha256(await this.getSigningKey(i,o,a,r));return s.update(w(e)),et(await s.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:o}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const s=i??await this.regionProvider(),c=Ot(e),{longDate:u,shortDate:l}=Lt(t),d=wt(l,s,o??this.service);c.headers[at]=u,a.sessionToken&&(c.headers[lt]=a.sessionToken);const h=await St(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(ut,c.headers)&&this.applyChecksum&&(c.headers[ut]=h);const f=Et(c,r,n),p=await this.getSignature(u,d,this.getSigningKey(a,s,l,o),this.createCanonicalRequest(c,f,h));return c.headers[ot]=`${pt} Credential=${a.accessKeyId}/${d}, SignedHeaders=${kt(f)}, Signature=${p}`,c}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===ct)continue;const i=l(r);t.push(i);const o=e[r];"string"==typeof o?n[i]=`${i}=${l(o)}`:Array.isArray(o)&&(n[i]=o.slice(0).reduce(((e,t)=>e.concat([`${i}=${l(t)}`])),[]).sort().join("&"))}return t.sort().map((e=>n[e])).filter((e=>e)).join("&")})(e)}\n${r.map((e=>`${e}:${t[e]}`)).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n){const r=new this.sha256;r.update(w(n));const i=await r.digest();return`${pt}\n${e}\n${t}\n${et(i)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return l(n).replace(/%2F/g,"/")}return e}async getSignature(e,t,n,r){const i=await this.createStringToSign(e,t,r),o=new this.sha256(await n);return o.update(w(i)),et(await o.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,i)=>{const o=`${n}:${r}:${i}:${et(await bt(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(o in yt)return yt[o];for(mt.push(o);mt.length>50;)delete yt[mt.shift()];let a=`AWS4${t.secretAccessKey}`;for(const t of[n,r,i,vt])a=await bt(e,a,t);return yt[o]=a})(this.sha256,e,n,t,r||this.service)}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}}const Lt=e=>{const t=(n=e,Pt(n).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");var n;return{longDate:t,shortDate:t.slice(0,8)}},kt=e=>Object.keys(e).sort().join(";");var Rt={},Mt=function(e,t){return Mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Mt(e,t)};function jt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Mt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ht=function(){return Ht=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ht.apply(this,arguments)};function Dt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function qt(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function Ut(e,t){return function(n,r){t(n,r,e)}}function Nt(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=r.kind,u="getter"===c?"get":"setter"===c?"set":"value",l=!t&&e?r.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h=!1,f=n.length-1;f>=0;f--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var v=(0,n[f])("accessor"===c?{get:d.get,set:d.set}:d[u],p);if("accessor"===c){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(d.get=s),(s=a(v.set))&&(d.set=s),(s=a(v.init))&&i.unshift(s)}else(s=a(v))&&("field"===c?i.unshift(s):d[u]=s)}l&&Object.defineProperty(l,r.name,d),h=!0}function Ft(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function Bt(e){return"symbol"==typeof e?e:"".concat(e)}function Xt(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function zt(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function $t(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function Vt(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var Wt=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function Gt(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||Wt(t,e,n)}function Kt(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Jt(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Zt(arguments[t]));return e}function Yt(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function Qt(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function en(e){return this instanceof en?(this.v=e,this):new en(e)}function tn(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{!function(e){e.value instanceof en?Promise.resolve(e.value.v).then(c,u):l(o[0][2],e)}(i[e](t))}catch(e){l(o[0][3],e)}}function c(e){s("next",e)}function u(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function nn(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:en(e[r](t)),done:!1}:i?i(t):t}:i}}function rn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Kt(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function on(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var an=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},sn=function(e){return sn=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},sn(e)};function cn(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=sn(e),r=0;r<n.length;r++)"default"!==n[r]&&Wt(t,e,n[r]);return an(t,e),t}function un(e){return e&&e.__esModule?e:{default:e}}function ln(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function dn(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}function hn(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function fn(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var pn="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function gn(e){function t(t){e.error=e.hasError?new pn(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function i(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,(function(e){return t(e),i()}))}else r|=1}catch(e){t(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function vn(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,r,i,o){return n?t?".jsx":".js":!r||i&&o?r+i+"."+o.toLowerCase()+"js":e})):e}var yn,mn={__extends:jt,__assign:Ht,__rest:Dt,__decorate:qt,__param:Ut,__esDecorate:Nt,__runInitializers:Ft,__propKey:Bt,__setFunctionName:Xt,__metadata:zt,__awaiter:$t,__generator:Vt,__createBinding:Wt,__exportStar:Gt,__values:Kt,__read:Zt,__spread:Jt,__spreadArrays:Yt,__spreadArray:Qt,__await:en,__asyncGenerator:tn,__asyncDelegator:nn,__asyncValues:rn,__makeTemplateObject:on,__importStar:cn,__importDefault:un,__classPrivateFieldGet:ln,__classPrivateFieldSet:dn,__classPrivateFieldIn:hn,__addDisposableResource:fn,__disposeResources:gn,__rewriteRelativeImportExtension:vn},wn=Pe(Object.freeze({__proto__:null,__addDisposableResource:fn,get __assign(){return Ht},__asyncDelegator:nn,__asyncGenerator:tn,__asyncValues:rn,__await:en,__awaiter:$t,__classPrivateFieldGet:ln,__classPrivateFieldIn:hn,__classPrivateFieldSet:dn,__createBinding:Wt,__decorate:qt,__disposeResources:gn,__esDecorate:Nt,__exportStar:Gt,__extends:jt,__generator:Vt,__importDefault:un,__importStar:cn,__makeTemplateObject:on,__metadata:zt,__param:Ut,__propKey:Bt,__read:Zt,__rest:Dt,__rewriteRelativeImportExtension:vn,__runInitializers:Ft,__setFunctionName:Xt,__spread:Jt,__spreadArray:Qt,__spreadArrays:Yt,__values:Kt,default:mn})),bn={},En={};function Sn(){return yn||(yn=1,Object.defineProperty(En,"__esModule",{value:!0}),En.MAX_HASHABLE_LENGTH=En.INIT=En.KEY=En.DIGEST_LENGTH=En.BLOCK_SIZE=void 0,En.BLOCK_SIZE=64,En.DIGEST_LENGTH=32,En.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),En.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],En.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),En}var _n,Tn={};var Cn={},xn={};var In,On=Object.freeze({__proto__:null,fromUtf8:e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const i=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),toUtf8:e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const i=e[++n];t+=String.fromCharCode((31&r)<<6|63&i)}else if(240<=r&&r<365){const i="%"+[r,e[++n],e[++n],e[++n]].map((e=>e.toString(16))).join("%");t+=decodeURIComponent(i)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)}),Pn=Pe(On);var An,Ln={};var kn,Rn={};var Mn,jn,Hn,Dn,qn={};function Un(){return jn||(jn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uint32ArrayFrom=e.numToUint8=e.isEmptyData=e.convertToBuffer=void 0;var t=function(){if(In)return xn;In=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.convertToBuffer=void 0;var e=Pn,t="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e.fromUtf8;return xn.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?t(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)},xn}();Object.defineProperty(e,"convertToBuffer",{enumerable:!0,get:function(){return t.convertToBuffer}});var n=(An||(An=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.isEmptyData=void 0,Ln.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}),Ln);Object.defineProperty(e,"isEmptyData",{enumerable:!0,get:function(){return n.isEmptyData}});var r=(kn||(kn=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.numToUint8=void 0,Rn.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}),Rn);Object.defineProperty(e,"numToUint8",{enumerable:!0,get:function(){return r.numToUint8}});var i=(Mn||(Mn=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.uint32ArrayFrom=void 0,qn.uint32ArrayFrom=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n<e.length;)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}),qn);Object.defineProperty(e,"uint32ArrayFrom",{enumerable:!0,get:function(){return i.uint32ArrayFrom}})}(Cn)),Cn}function Nn(){if(Hn)return bn;Hn=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.Sha256=void 0;var e=wn,t=Sn(),n=function(){if(_n)return Tn;_n=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.RawSha256=void 0;var e=Sn(),t=function(){function t(){this.state=Int32Array.from(e.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,r=t.byteLength;if(this.bytesHashed+=r,8*this.bytesHashed>e.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=t[n++],r--,this.bufferLength===e.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var t=8*this.bytesHashed,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%e.BLOCK_SIZE>=e.BLOCK_SIZE-8){for(var i=this.bufferLength;i<e.BLOCK_SIZE;i++)n.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(i=this.bufferLength;i<e.BLOCK_SIZE-8;i++)n.setUint8(i,0);n.setUint32(e.BLOCK_SIZE-8,Math.floor(t/4294967296),!0),n.setUint32(e.BLOCK_SIZE-4,t),this.hashBuffer(),this.finished=!0}var o=new Uint8Array(e.DIGEST_LENGTH);for(i=0;i<8;i++)o[4*i]=this.state[i]>>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},t.prototype.hashBuffer=function(){for(var t=this.buffer,n=this.state,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],u=n[6],l=n[7],d=0;d<e.BLOCK_SIZE;d++){if(d<16)this.temp[d]=(255&t[4*d])<<24|(255&t[4*d+1])<<16|(255&t[4*d+2])<<8|255&t[4*d+3];else{var h=this.temp[d-2],f=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,p=((h=this.temp[d-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[d]=(f+this.temp[d-7]|0)+(p+this.temp[d-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&c^~s&u)|0)+(l+(e.KEY[d]+this.temp[d]|0)|0)|0,v=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&o^i&o)|0;l=u,u=c,c=s,s=a+g|0,a=o,o=i,i=r,r=g+v|0}n[0]+=r,n[1]+=i,n[2]+=o,n[3]+=a,n[4]+=s,n[5]+=c,n[6]+=u,n[7]+=l},t}();return Tn.RawSha256=t,Tn}(),r=Un(),i=function(){function i(e){this.secret=e,this.hash=new n.RawSha256,this.reset()}return i.prototype.update=function(e){if(!(0,r.isEmptyData)(e)&&!this.error)try{this.hash.update((0,r.convertToBuffer)(e))}catch(e){this.error=e}},i.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},i.prototype.digest=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,this.digestSync()]}))}))},i.prototype.reset=function(){if(this.hash=new n.RawSha256,this.secret){this.outer=new n.RawSha256;var e=function(e){var i=(0,r.convertToBuffer)(e);if(i.byteLength>t.BLOCK_SIZE){var o=new n.RawSha256;o.update(i),i=o.digest()}var a=new Uint8Array(t.BLOCK_SIZE);return a.set(i),a}(this.secret),i=new Uint8Array(t.BLOCK_SIZE);i.set(e);for(var o=0;o<t.BLOCK_SIZE;o++)e[o]^=54,i[o]^=92;this.hash.update(e),this.outer.update(i);for(o=0;o<e.byteLength;o++)e[o]=0}},i}();return bn.Sha256=i,bn}var Fn=(Dn||(Dn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),wn.__exportStar(Nn(),e)}(Rt)),Rt),Bn=window&&window.__assign||function(){return Bn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Bn.apply(this,arguments)},Xn=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},zn=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},$n={expiresIn:60},Vn=function(e){var t=this;this.sendFetch=function(e){return Xn(t,void 0,void 0,(function(){var t,n;return zn(this,(function(r){switch(r.label){case 0:return[4,this.getHttpRequestOptions(e,"application/json")];case 1:return t=r.sent(),n=new c(t),this.awsSigV4?[4,this.awsSigV4.sign(n)]:[3,3];case 2:n=r.sent(),r.label=3;case 3:return[2,this.config.fetchRequestHandler.handle(n)]}}))}))},this.sendBeacon=function(e){return Xn(t,void 0,void 0,(function(){var t,n;return zn(this,(function(r){switch(r.label){case 0:return[4,this.getHttpRequestOptions(e,"text/plain;charset=UTF-8")];case 1:return t=r.sent(),n=new c(t),this.awsSigV4?[4,this.awsSigV4.presign(n,$n)]:[3,3];case 2:n=r.sent(),r.label=3;case 3:return[2,this.config.beaconRequestHandler.handle(n)]}}))}))},this.getHttpRequestOptions=function(e,n){return Xn(t,void 0,void 0,(function(){var t,r,i,o,a,s,c,u;return zn(this,(function(l){switch(l.label){case 0:return t=JSON.stringify(Wn(e)),r=this.config.endpoint.pathname.replace(/\/$/,""),i={method:"POST",protocol:this.config.endpoint.protocol,port:Number(this.config.endpoint.port)||void 0,headers:Bn({"content-type":n,host:this.config.endpoint.host},this.config.headers),hostname:this.config.endpoint.hostname,path:"".concat(r,"/appmonitors/").concat(e.AppMonitorDetails.id),body:t},this.awsSigV4?(o=[Bn({},i)],c={},a=[Bn({},i.headers)],u={},s="X-Amz-Content-Sha256",[4,Kn(t)]):[3,2];case 1:return[2,Bn.apply(void 0,o.concat([(c.headers=Bn.apply(void 0,a.concat([(u[s]=l.sent(),u)])),c)]))];case 2:return[2,i]}}))}))},this.config=e,e.credentials&&(this.awsSigV4=new At({applyChecksum:!0,credentials:e.credentials,region:e.region,service:"rum",uriEscapePath:!0,sha256:Fn.Sha256}))},Wn=function(e){var t=[];e.RumEvents.forEach((function(e){return t.push(Gn(e))}));var n={BatchId:e.BatchId,AppMonitorDetails:e.AppMonitorDetails,UserDetails:e.UserDetails,RumEvents:t};return e.Alias&&(n=Bn(Bn({},n),{Alias:e.Alias})),n},Gn=function(e){return{id:e.id,timestamp:Math.round(e.timestamp.getTime()/1e3),type:e.type,metadata:e.metadata,details:e.details}},Kn=function(e){return Xn(void 0,void 0,void 0,(function(){var t,n;return zn(this,(function(r){switch(r.label){case 0:return(t=new Fn.Sha256).update(e),n=et,[4,t.digest()];case 1:return[2,n.apply(void 0,[r.sent()]).toLowerCase()]}}))}))};const Zn=e=>encodeURIComponent(e).replace(/[!'()*]/g,Jn),Jn=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function Yn(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=Zn(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${Zn(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${Zn(r)}`),t.push(e)}}return t.join("&")}for(var Qn=function(){function e(){}return e.prototype.handle=function(e){var t=this.sendBeacon(e);return new Promise((function(e,n){t?e({response:new u({statusCode:200})}):n()}))},e.prototype.updateHttpClientConfig=function(e,t){},e.prototype.httpHandlerConfigs=function(){return{}},e.prototype.sendBeacon=function(e){var t=e.path;if(e.query){var n=Yn(e.query);n&&(t+="?".concat(n))}var r=e.port,i="".concat(e.protocol,"//").concat(e.hostname).concat(r?":".concat(r):"").concat(t);return navigator.sendBeacon(i,e.body)},e}(),er=function(){function e(e){var t=void 0===e?{}:e,n=t.fetchFunction,r=t.requestTimeout;this.requestTimeout=r,this.fetchFunction=n}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal,r=this.requestTimeout;if(null==n?void 0:n.aborted){var i=new Error("Request aborted");return i.name="AbortError",Promise.reject(i)}var o=e.path;if(e.query){var a=Yn(e.query);a&&(o+="?".concat(a))}var s=e.port,c=e.method,l="".concat(e.protocol,"//").concat(e.hostname).concat(s?":".concat(s):"").concat(o),d={body:"GET"===c||"HEAD"===c?void 0:e.body,headers:new Headers(e.headers),method:c};"undefined"!=typeof AbortController&&(d.signal=n);var h,f=new Request(l,d),p=[this.fetchFunction.apply(window,[f]).then((function(e){for(var t=e.headers,n={},r=0,i=t.entries();r<i.length;r++){var o=i[r];n[o[0]]=o[1]}return void 0!==e.body?{response:new u({headers:n,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new u({headers:n,statusCode:e.status,body:t})}}))})),(h=r,void 0===h&&(h=0),new Promise((function(e,t){h&&setTimeout((function(){var e=new Error("Request did not complete within ".concat(h," ms"));e.name="TimeoutError",t(e)}),h)})))];return n&&p.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(p)},e.prototype.updateHttpClientConfig=function(e,t){},e.prototype.httpHandlerConfigs=function(){return{}},e}(),tr=function(e){if(crypto)return crypto.getRandomValues(e);if(msCrypto)return msCrypto.getRandomValues(e);throw new Error("No crypto library found.")},nr=[],rr=0;rr<256;rr++)nr[rr]=(rr+256).toString(16).substr(1);var ir,or,ar="X-Amzn-Trace-Id",sr="traceparent",cr=function(e,t){return Array.isArray(t)?t.some((function(t){return t.test(e)})):t},ur={logicalServiceName:"rum.aws.amazon.com",urlsToInclude:[/.*/],urlsToExclude:[/cognito\-identity\.([^\.]*\.)?amazonaws\.com/,/sts\.([^\.]*\.)?amazonaws\.com/],stackTraceLength:200,recordAllRequests:!1,addXRayTraceIdHeader:!1},lr=function(e){return 4===Math.floor(e/100)},dr=function(e){return 5===Math.floor(e/100)},hr=function(e){return 429===e},fr=function(e,t){var n=t.urlsToInclude.some((function(t){return t.test(e)})),r=t.urlsToExclude.some((function(t){return t.test(e)}));return n&&!r},pr=function(){return Date.now()/1e3},gr=function(e,t,n,r){return{version:"1.0.0",name:e,origin:"AWS::RUM::AppMonitor",id:_r(),start_time:t,trace_id:n?Sr():Er(),end_time:void 0,subsegments:[],in_progress:!1}},vr=function(e,t,n){var r={id:_r(),name:e,start_time:t,end_time:void 0,in_progress:!1,namespace:e.endsWith("amazonaws.com")?"aws":"remote"};return n&&(r.http=n),r},yr=function(e){try{return e.hostname?e.hostname:e.url?new URL(e.url).hostname:new URL(e.toString()).hostname}catch(e){return window.location.hostname}},mr=function(e,t){return"Root="+e+";Parent="+t+";Sampled=1"},wr=function(e,t){return"00-"+e+"-"+t+"-01"},br=function(e){return e.url?e.url:e.toString()},Er=function(){return"1-".concat(Tr(),"-").concat(Cr())},Sr=function(){var e=new Uint8Array(16);return tr(e),"".concat(xr(e))},_r=function(){var e=new Uint8Array(8);return tr(e),xr(e)},Tr=function(){return Math.floor(Date.now()/1e3).toString(16)},Cr=function(){var e=new Uint8Array(12);return tr(e),xr(e)},xr=function(e){for(var t="",n=0;n<e.length;n++)t+=nr[e[n]];return t},Ir=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Or=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Pr=function(){function e(e,t,n){void 0===n&&(n=function(e){return 2e3*Math.pow(2,e-1)}),this.handler=e,this.retries=t,this.backoff=n}return e.prototype.handle=function(e){return Ir(this,void 0,void 0,(function(){var t,n,r;return Or(this,(function(i){switch(i.label){case 0:t=this.retries,i.label=1;case 1:i.label=2;case 2:return i.trys.push([2,4,,6]),[4,this.handler.handle(e)];case 3:if(n=i.sent(),200<=(o=n.response.statusCode)&&o<300)return[2,n];throw n.response.statusCode;case 4:if("number"==typeof(r=i.sent())&&!hr(r)&&!dr(r))throw new Error("".concat(r));if(t<=0)throw r;return t--,[4,this.sleep(this.backoff(this.retries-t))];case 5:return i.sent(),[3,6];case 6:return[3,1];case 7:return[2]}var o}))}))},e.prototype.sleep=function(e){return Ir(this,void 0,void 0,(function(){return Or(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,e)}))]}))}))},e.prototype.updateHttpClientConfig=function(e,t){},e.prototype.httpHandlerConfigs=function(){return{}},e}(),Ar=window&&window.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Lr=window&&window.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},kr="CWR: Cannot dispatch; no AWS credentials.",Rr=function(){function e(e,t,n,r){var i=this;this.disableCodes=["403","404"],this.dispatchFetch=function(){return Ar(i,void 0,void 0,(function(){return Lr(this,(function(e){return this.doRequest()?[2,this.rum.sendFetch(this.createRequest()).catch(this.handleReject)]:[2]}))}))},this.dispatchBeacon=function(){return Ar(i,void 0,void 0,(function(){var e,t=this;return Lr(this,(function(n){return this.doRequest()?(e=this.createRequest(),[2,this.rum.sendBeacon(e).catch((function(){return t.rum.sendFetch(e)}))]):[2]}))}))},this.dispatchFetchFailSilent=function(){return Ar(i,void 0,void 0,(function(){return Lr(this,(function(e){return[2,this.dispatchFetch().catch((function(){}))]}))}))},this.dispatchBeaconFailSilent=function(){return Ar(i,void 0,void 0,(function(){return Lr(this,(function(e){return[2,this.dispatchBeacon().catch((function(){}))]}))}))},this.flushSync=function(){var e;if("hidden"===document.visibilityState&&i.doRequest(!0)){var t=i.rum.sendBeacon,n=i.rum.sendFetch;i.config.useBeacon||(t=(e=[n,t])[0],n=e[1]);var r=i.createRequest(!0);t(r).catch((function(){return n(r)})).catch((function(){}))}},this.handleReject=function(e){throw e instanceof Error&&i.disableCodes.includes(e.message)&&i.disable(),e},this.defaultClientBuilder=function(e,t,n){return new Vn({fetchRequestHandler:new Pr(new er({fetchFunction:i.config.fetchFunction}),i.config.retries),beaconRequestHandler:new Qn,endpoint:e,region:t,credentials:n,headers:i.headers})},this.region=e,this.endpoint=t,this.eventCache=n,this.enabled=!0,this.buildClient=r.clientBuilder||this.defaultClientBuilder,this.config=r,this.headers=r.headers,this.startDispatchTimer(),r.signing?this.rum={sendFetch:function(){return Promise.reject(new Error(kr))},sendBeacon:function(){return Promise.reject(new Error(kr))}}:this.rum=this.buildClient(this.endpoint,this.region,void 0)}return e.prototype.enable=function(){this.enabled=!0,this.startDispatchTimer()},e.prototype.disable=function(){this.stopDispatchTimer(),this.enabled=!1},e.prototype.setAwsCredentials=function(e){this.rum=this.buildClient(this.endpoint,this.region,e),"function"==typeof e&&e()},e.prototype.startDispatchTimer=function(){document.addEventListener("visibilitychange",this.flushSync),document.addEventListener("pagehide",this.flushSync),this.config.dispatchInterval<=0||this.dispatchTimerId||(this.dispatchTimerId=window.setInterval(this.dispatchFetchFailSilent,this.config.dispatchInterval))},e.prototype.stopDispatchTimer=function(){document.removeEventListener("visibilitychange",this.flushSync),document.removeEventListener("pagehide",this.flushSync),this.dispatchTimerId&&(window.clearInterval(this.dispatchTimerId),this.dispatchTimerId=void 0)},e.prototype.doRequest=function(e){return void 0===e&&(e=!1),!!this.enabled&&(!(!e||!this.eventCache.hasCandidates())||this.eventCache.hasEvents())},e.prototype.createRequest=function(e){return void 0===e&&(e=!1),{BatchId:Ie(),AppMonitorDetails:this.eventCache.getAppMonitorDetails(),UserDetails:this.eventCache.getUserDetails(),RumEvents:this.eventCache.getEventBatch(e),Alias:this.config.alias}},e}();!function(e){e.OTHER="other",e.STYLESHEET="stylesheet",e.DOCUMENT="document",e.SCRIPT="script",e.IMAGE="image",e.FONT="font"}(ir||(ir={})),function(e){e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.FRAME="frame",e.SCRIPT="script",e.CSS="css"}(or||(or={}));var Mr,jr,Hr=function(e){return[e.startTime,e.duration].join("#")},Dr=[{name:ir.STYLESHEET,list:["css","less"]},{name:ir.DOCUMENT,list:["htm","html","ts","doc","docx","pdf","xls","xlsx"]},{name:ir.SCRIPT,list:["js"]},{name:ir.IMAGE,list:["ai","bmp","gif","ico","jpeg","jpg","png","ps","psd","svg","tif","tiff"]},{name:ir.FONT,list:["fnt","fon","otf","ttf","woff"]}],qr=function(e,t){var n=ir.OTHER;if(e){var r=e.substring(e.lastIndexOf("/")+1),i=r.substring(r.lastIndexOf(".")+1).split(/[?#]/)[0];Dr.forEach((function(e){e.list.indexOf(i)>-1&&(n=e.name)}))}if(t&&n===ir.OTHER)switch(t){case or.IMAGE:case or.IMG:case or.INPUT:n=ir.IMAGE;break;case or.IFRAME:case or.FRAME:n=ir.DOCUMENT;break;case or.SCRIPT:n=ir.SCRIPT;break;case or.CSS:n=ir.STYLESHEET}return n},Ur=/.*\/application\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/events/,Nr={eventLimit:10,ignore:function(e){return"resource"===e.entryType&&(!/^https?:/.test(e.name)||/^(fetch|xmlhttprequest)$/.test(e.initiatorType))},recordAllTypes:[ir.DOCUMENT,ir.SCRIPT,ir.STYLESHEET,ir.FONT],sampleTypes:[ir.IMAGE,ir.OTHER],reportAllLCP:!1,reportAllCLS:!1,reportAllINP:!1},Fr=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Br=window&&window.__assign||function(){return Br=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Br.apply(this,arguments)},Xr="navigation",zr="load",$r=function(e){function t(t){var n=e.call(this,"navigation")||this;return n.eventListener=function(){if(0===performance.getEntriesByType(Xr).length)n.performanceNavigationEventHandlerTimingLevel1();else{var e=new PerformanceObserver((function(e){e.getEntries().filter((function(e){return e.entryType===Xr})).filter((function(e){return!n.config.ignore(e)})).forEach((function(e){n.performanceNavigationEventHandlerTimingLevel2(e)}))}));e.observe({entryTypes:[Xr]})}},n.performanceNavigationEventHandlerTimingLevel1=function(){setTimeout((function(){var e,t=performance.timing,r=t.navigationStart,i={version:"1.0.0",initiatorType:"navigation",startTime:0,unloadEventStart:t.unloadEventStart>0?t.unloadEventStart-r:0,promptForUnload:t.unloadEventEnd-t.unloadEventStart,redirectStart:t.redirectStart>0?t.redirectStart-r:0,redirectTime:t.redirectEnd-t.redirectStart,fetchStart:t.fetchStart>0?t.fetchStart-r:0,domainLookupStart:t.domainLookupStart>0?t.domainLookupStart-r:0,dns:t.domainLookupEnd-t.domainLookupStart,connectStart:t.connectStart>0?t.connectStart-r:0,connect:t.connectEnd-t.connectStart,secureConnectionStart:t.secureConnectionStart>0?t.secureConnectionStart-r:0,tlsTime:t.secureConnectionStart>0?t.connectEnd-t.secureConnectionStart:0,requestStart:t.requestStart>0?t.requestStart-r:0,timeToFirstByte:t.responseStart-t.requestStart,responseStart:t.responseStart>0?t.responseStart-r:0,responseTime:t.responseStart>0?t.responseEnd-t.responseStart:0,domInteractive:t.domInteractive>0?t.domInteractive-r:0,domContentLoadedEventStart:t.domContentLoadedEventStart>0?t.domContentLoadedEventStart-r:0,domContentLoaded:t.domContentLoadedEventEnd-t.domContentLoadedEventStart,domComplete:t.domComplete>0?t.domComplete-r:0,domProcessingTime:t.loadEventStart-t.responseEnd,loadEventStart:t.loadEventStart>0?t.loadEventStart-r:0,loadEventTime:t.loadEventEnd-t.loadEventStart,duration:t.loadEventEnd-t.navigationStart,navigationTimingLevel:1};(null===(e=n.context)||void 0===e?void 0:e.record)&&n.context.record(ee,i)}),0)},n.performanceNavigationEventHandlerTimingLevel2=function(e){var t,r={version:"1.0.0",initiatorType:e.initiatorType,navigationType:e.type,startTime:e.startTime,unloadEventStart:e.unloadEventStart,promptForUnload:e.unloadEventEnd-e.unloadEventStart,redirectCount:e.redirectCount,redirectStart:e.redirectStart,redirectTime:e.redirectEnd-e.redirectStart,workerStart:e.workerStart,workerTime:e.workerStart>0?e.fetchStart-e.workerStart:0,fetchStart:e.fetchStart,domainLookupStart:e.domainLookupStart,dns:e.domainLookupEnd-e.domainLookupStart,nextHopProtocol:e.nextHopProtocol,connectStart:e.connectStart,connect:e.connectEnd-e.connectStart,secureConnectionStart:e.secureConnectionStart,tlsTime:e.secureConnectionStart>0?e.connectEnd-e.secureConnectionStart:0,requestStart:e.requestStart,timeToFirstByte:e.responseStart-e.requestStart,responseStart:e.responseStart,responseTime:e.responseStart>0?e.responseEnd-e.responseStart:0,domInteractive:e.domInteractive,domContentLoadedEventStart:e.domContentLoadedEventStart,domContentLoaded:e.domContentLoadedEventEnd-e.domContentLoadedEventStart,domComplete:e.domComplete,domProcessingTime:e.loadEventStart-e.responseEnd,loadEventStart:e.loadEventStart,loadEventTime:e.loadEventEnd-e.loadEventStart,duration:e.duration,headerSize:e.transferSize>0?e.transferSize-e.encodedBodySize:0,transferSize:e.transferSize,compressionRatio:e.encodedBodySize>0?e.decodedBodySize/e.encodedBodySize:0,navigationTimingLevel:2};(null===(t=n.context)||void 0===t?void 0:t.record)&&n.context.record(ee,r)},n.config=Br(Br({},Nr),t),n}return Fr(t,e),t.prototype.enable=function(){this.enabled||(this.enabled=!0,window.addEventListener(zr,this.eventListener))},t.prototype.disable=function(){this.enabled&&(this.enabled=!1,this.eventListener&&window.removeEventListener(zr,this.eventListener))},t.prototype.hasTheWindowLoadEventFired=function(){if(window.performance&&window.performance.getEntriesByType(Xr).length){var e=window.performance.getEntriesByType(Xr)[0];return Boolean(e.loadEventEnd)}return!1},t.prototype.onload=function(){var e=this;this.enabled&&(this.hasTheWindowLoadEventFired()?window.performance.getEntriesByType(Xr).filter((function(t){return!e.config.ignore(t)})).forEach((function(t){return e.performanceNavigationEventHandlerTimingLevel2(t)})):window.addEventListener(zr,this.eventListener))},t}(ae),Vr=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wr=window&&window.__assign||function(){return Wr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wr.apply(this,arguments)},Gr="resource",Kr=function(e){function t(t){var n=e.call(this,"resource")||this;return n.performanceEntryHandler=function(e){n.recordPerformanceEntries(e.getEntries())},n.recordPerformanceEntries=function(e){var t=[],r=[];for(e.filter((function(e){return e.entryType===Gr})).filter((function(e){return!n.config.ignore(e)})).forEach((function(e){var i=e,o=i.name,a=i.initiatorType,s=qr(o,a);n.config.recordAllTypes.includes(s)?t.push(e):n.config.sampleTypes.includes(s)&&r.push(e)})),t.forEach((function(e){return n.recordResourceEvent(e)})),function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}}(r);r.length>0&&n.eventCount<n.config.eventLimit;)n.recordResourceEvent(r.pop()),n.eventCount++},n.recordResourceEvent=function(e){var t,r=e.name,i=e.startTime,o=e.initiatorType,a=e.duration,s=e.transferSize;if(!function(e,t){try{return new URL(e).hostname===t&&Ur.test(e)}catch(e){return!1}}(r,n.context.config.endpointUrl.hostname)&&(null===(t=n.context)||void 0===t?void 0:t.record)){var c={version:"1.0.0",initiatorType:o,startTime:i,duration:a,fileType:qr(r,o),transferSize:s};n.context.config.recordResourceUrl&&(c.targetUrl=r),n.context.record(te,c)}},n.config=Wr(Wr({},Nr),t),n.eventCount=0,n.resourceObserver=new PerformanceObserver(n.performanceEntryHandler),n}return Vr(t,e),t.prototype.enable=function(){this.enabled||(this.enabled=!0,this.resourceObserver.observe({type:Gr,buffered:!0}))},t.prototype.disable=function(){this.enabled&&(this.enabled=!1,this.resourceObserver.disconnect())},t.prototype.onload=function(){this.resourceObserver.observe({type:Gr,buffered:!0})},t}(ae),Zr=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Jr=function(e){if("loading"===document.readyState)return"loading";var t=Zr();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Yr=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Qr=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:Yr(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},ei=-1,ti=function(e){addEventListener("pageshow",(function(t){t.persisted&&(ei=t.timeStamp,e(t))}),!0)},ni=function(){var e=Zr();return e&&e.activationStart||0},ri=function(e,t){var n=Zr(),r="navigate";return ei>=0?r="back-forward-cache":n&&(document.prerendering||ni()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},ii=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},oi=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ai=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},si=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},ci=function(e){var t=!1;return function(){t||(e(),t=!0)}},ui=-1,li=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},di=function(e){"hidden"===document.visibilityState&&ui>-1&&(ui="visibilitychange"===e.type?e.timeStamp:0,fi())},hi=function(){addEventListener("visibilitychange",di,!0),addEventListener("prerenderingchange",di,!0)},fi=function(){removeEventListener("visibilitychange",di,!0),removeEventListener("prerenderingchange",di,!0)},pi=function(){return ui<0&&(ui=li(),hi(),ti((function(){setTimeout((function(){ui=li(),hi()}),0)}))),{get firstHiddenTime(){return ui}}},gi=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},vi=[1800,3e3],yi=[.1,.25],mi=function(e,t){!function(e,t){t=t||{},function(e,t){t=t||{},gi((function(){var n,r=pi(),i=ri("FCP"),o=ii("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-ni(),0),i.entries.push(e),n(!0)))}))}));o&&(n=oi(e,i,vi,t.reportAllChanges),ti((function(r){i=ri("FCP"),n=oi(e,i,vi,t.reportAllChanges),ai((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))}(ci((function(){var n,r=ri("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},s=ii("layout-shift",a);s&&(n=oi(e,r,yi,t.reportAllChanges),si((function(){a(s.takeRecords()),n(!0)})),ti((function(){i=0,r=ri("CLS",0),n=oi(e,r,yi,t.reportAllChanges),ai((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(n={largestShiftTarget:Qr(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:Jr(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)},wi=0,bi=1/0,Ei=0,Si=function(e){e.forEach((function(e){e.interactionId&&(bi=Math.min(bi,e.interactionId),Ei=Math.max(Ei,e.interactionId),wi=Ei?(Ei-bi)/7+1:0)}))},_i=function(){return Mr?wi:performance.interactionCount||0},Ti=function(){"interactionCount"in performance||Mr||(Mr=ii("event",Si,{type:"event",buffered:!0,durationThreshold:0}))},Ci=[],xi=new Map,Ii=0,Oi=[],Pi=function(e){if(Oi.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ci[Ci.length-1],n=xi.get(e.interactionId);if(n||Ci.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};xi.set(r.id,r),Ci.push(r)}Ci.sort((function(e,t){return t.latency-e.latency})),Ci.length>10&&Ci.splice(10).forEach((function(e){return xi.delete(e.id)}))}}},Ai=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=ci(e),"hidden"===document.visibilityState?e():(n=t(e),si(e)),n},Li=[200,500],ki=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},gi((function(){var n;Ti();var r,i=ri("INP"),o=function(e){Ai((function(){e.forEach(Pi);var t=function(){var e=Math.min(Ci.length-1,Math.floor((_i()-Ii)/50));return Ci[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())}))},a=ii("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=oi(e,i,Li,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),si((function(){o(a.takeRecords()),r(!0)})),ti((function(){Ii=_i(),Ci.length=0,xi.clear(),i=ri("INP"),r=oi(e,i,Li,t.reportAllChanges)})))})))},Ri=[],Mi=[],ji=0,Hi=new WeakMap,Di=new Map,qi=-1,Ui=function(e){Ri=Ri.concat(e),Ni()},Ni=function(){qi<0&&(qi=Ai(Fi))},Fi=function(){Di.size>10&&Di.forEach((function(e,t){xi.has(t)||Di.delete(t)}));var e=Ci.map((function(e){return Hi.get(e.entries[0])})),t=Mi.length-50;Mi=Mi.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<Mi.length;r++){var i=Mi[r];Gi(i.startTime,i.processingEnd).forEach((function(e){n.add(e)}))}var o=Ri.length-1-50;Ri=Ri.filter((function(e,t){return e.startTime>ji&&t>o||n.has(e)})),qi=-1};Oi.push((function(e){e.interactionId&&e.target&&!Di.has(e.interactionId)&&Di.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;ji=Math.max(ji,e.processingEnd);for(var r=Mi.length-1;r>=0;r--){var i=Mi[r];if(Math.abs(n-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Mi.push(t)),(e.interactionId||"first-input"===e.entryType)&&Hi.set(e,t),Ni()}));var Bi,Xi,zi,$i,Vi,Wi,Gi=function(e,t){for(var n,r=[],i=0;n=Ri[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Ki=[2500,4e3],Zi={},Ji={passive:!0,capture:!0},Yi=new Date,Qi=function(e,t){Bi||(Bi=t,Xi=e,zi=new Date,no(removeEventListener),eo())},eo=function(){if(Xi>=0&&Xi<zi-Yi){var e={entryType:"first-input",name:Bi.type,target:Bi.target,cancelable:Bi.cancelable,startTime:Bi.timeStamp,processingStart:Bi.timeStamp+Xi};$i.forEach((function(t){t(e)})),$i=[]}},to=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Qi(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Ji),removeEventListener("pointercancel",r,Ji)};addEventListener("pointerup",n,Ji),addEventListener("pointercancel",r,Ji)}(t,e):Qi(t,e)}},no=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,to,Ji)}))},ro=[100,300],io=function(e,t){!function(e,t){t=t||{},gi((function(){var n,r=pi(),i=ri("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},a=function(e){e.forEach(o)},s=ii("first-input",a);n=oi(e,i,ro,t.reportAllChanges),s&&(si(ci((function(){a(s.takeRecords()),s.disconnect()}))),ti((function(){var r;i=ri("FID"),n=oi(e,i,ro,t.reportAllChanges),$i=[],Xi=-1,Bi=null,no(addEventListener),r=o,$i.push(r),eo()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:Qr(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:Jr(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)},oo=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ao=window&&window.__assign||function(){return ao=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ao.apply(this,arguments)},so=function(e){function t(t){var n=e.call(this,"web-vitals")||this;return n.resourceEventIds=new Map,n.cacheLCPCandidates=PerformanceObserver.supportedEntryTypes.includes("largest-contentful-paint"),n.handleEvent=function(e){switch(e.type){case te:var t=e.details;n.cacheLCPCandidates&&t.fileType===ir.IMAGE&&n.resourceEventIds.set(Hr(e.details),e.id);break;case ee:n.navigationEventId=e.id}},n.config=ao(ao({},Nr),t),n}return oo(t,e),t.prototype.enable=function(){},t.prototype.disable=function(){},t.prototype.onload=function(){var e=this;this.context.eventBus.subscribe(Ne.EVENT,this.handleEvent),function(e,t){!function(e,t){t=t||{},gi((function(){var n,r=pi(),i=ri("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-ni(),0),i.entries=[e],n())}))},a=ii("largest-contentful-paint",o);if(a){n=oi(e,i,Ki,t.reportAllChanges);var s=ci((function(){Zi[i.id]||(o(a.takeRecords()),a.disconnect(),Zi[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Ai(s)}),{once:!0,capture:!0})})),si(s),ti((function(r){i=ri("LCP"),n=oi(e,i,Ki,t.reportAllChanges),ai((function(){i.value=performance.now()-r.timeStamp,Zi[i.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=Zr();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],a=Math.max(0,n.responseStart-r),s=Math.max(a,o?(o.requestStart||o.startTime)-r:0),c=Math.max(s,o?o.responseEnd-r:0),u=Math.max(c,i.startTime-r);t={element:Qr(i.element),timeToFirstByte:a,resourceLoadDelay:s-a,resourceLoadDuration:c-s,elementRenderDelay:u-c,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((function(t){return e.handleLCP(t)}),{reportAllChanges:this.config.reportAllLCP}),io((function(t){return e.handleFID(t)})),mi((function(t){return e.handleCLS(t)}),{reportAllChanges:!0}),function(e,t){jr||(jr=ii("long-animation-frame",Ui)),ki((function(t){var n=function(e){var t=e.entries[0],n=Hi.get(t),r=t.processingStart,i=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=Gi(t.startTime,i),s=e.entries.find((function(e){return e.target})),c=s&&s.target||Di.get(t.interactionId),u=[t.startTime+t.duration,i].concat(a.map((function(e){return e.startTime+e.duration}))),l=Math.max.apply(Math,u),d={interactionTarget:Qr(c),interactionTargetElement:c,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:l,processedEventEntries:o,longAnimationFrameEntries:a,inputDelay:r-t.startTime,processingDuration:i-r,presentationDelay:Math.max(l-i,0),loadState:Jr(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}((function(t){return e.handleINP(t)}),{reportAllChanges:!0})},t.prototype.handleLCP=function(e){var t,n,r=e.attribution,i={element:r.element,url:r.url,timeToFirstByte:r.timeToFirstByte,resourceLoadDelay:r.resourceLoadDelay,resourceLoadTime:r.resourceLoadDuration,elementRenderDelay:r.elementRenderDelay};if(r.lcpResourceEntry){var o=Hr(r.lcpResourceEntry);i.lcpResourceEntry=this.resourceEventIds.get(o)}this.navigationEventId&&(i.navigationEntry=this.navigationEventId),null===(t=this.context)||void 0===t||t.record(Z,{version:"1.0.0",value:e.value,attribution:i}),null===(n=this.context)||void 0===n||n.eventBus.unsubscribe(Ne.EVENT,this.handleEvent),this.resourceEventIds.clear(),this.navigationEventId=void 0},t.prototype.handleCLS=function(e){var t=e.attribution,n=this.context,r=n.record,i=n.recordCandidate;(this.config.reportAllCLS?r:i)(Y,{version:"1.0.0",value:e.value,attribution:{largestShiftTarget:t.largestShiftTarget,largestShiftValue:t.largestShiftValue,largestShiftTime:t.largestShiftTime,loadState:t.loadState}})},t.prototype.handleFID=function(e){var t,n=e.attribution;null===(t=this.context)||void 0===t||t.record(J,{version:"1.0.0",value:e.value,attribution:{eventTarget:n.eventTarget,eventType:n.eventType,eventTime:n.eventTime,loadState:n.loadState}})},t.prototype.handleINP=function(e){var t=e.attribution,n=this.context,r=n.record,i=n.recordCandidate;(this.config.reportAllINP?r:i)(Q,{version:"1.0.0",value:e.value,attribution:{interactionTarget:t.interactionTarget,interactionTime:t.interactionTime,nextPaintTime:t.nextPaintTime,interactionType:t.interactionType,inputDelay:t.inputDelay,processingDuration:t.processingDuration,presentationDelay:t.presentationDelay,loadState:t.loadState}})},t}(ae),co=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uo=function(e){function t(t){var n=e.call(this,t)||this;return n.name="XMLHttpRequest error",n}return co(t,e),t}(Error),lo=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ho=window&&window.__assign||function(){return ho=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ho.apply(this,arguments)},fo=function(e){function t(t){var n=e.call(this,"xhr")||this;return n.addXRayTraceIdHeader=function(e){return cr(e,n.config.addXRayTraceIdHeader)},n.isTracingEnabled=function(){return n.context.config.enableXRay},n.isSessionRecorded=function(){var e;return(null===(e=n.context.getSession())||void 0===e?void 0:e.record)||!1},n.handleXhrLoadEvent=function(e){var t=e.target,r=n.xhrMap.get(t);if(r){var i=pr();r.trace.end_time=i,r.trace.subsegments[0].end_time=i,r.trace.subsegments[0].http.response={status:t.status},hr(t.status)?(r.trace.subsegments[0].throttle=!0,r.trace.throttle=!0):lr(t.status)?(r.trace.subsegments[0].error=!0,r.trace.error=!0):dr(t.status)&&(r.trace.subsegments[0].fault=!0,r.trace.fault=!0);var o=t.getResponseHeader("Content-Length"),a=o?parseInt(o,10):NaN;isNaN(a)||(r.trace.subsegments[0].http.response.content_length=a),n.recordTraceEvent(r.trace),n.recordHttpEventWithResponse(r,t)}},n.handleXhrErrorEvent=function(e){var t=e.target,r=n.xhrMap.get(t),i=t.statusText?t.status.toString()+": "+t.statusText:t.status.toString();if(r){var o=pr();r.trace.fault=!0,r.trace.end_time=o,r.trace.subsegments[0].end_time=o,r.trace.subsegments[0].fault=!0,r.trace.subsegments[0].cause={exceptions:[{type:"XMLHttpRequest error",message:i}]},n.recordTraceEvent(r.trace),n.recordHttpEventWithError(r,t,new uo(i))}},n.handleXhrAbortEvent=function(e){var t=e.target,r=n.xhrMap.get(t);r&&n.handleXhrDetailsOnError(r,t,"XMLHttpRequest abort")},n.handleXhrTimeoutEvent=function(e){var t=e.target,r=n.xhrMap.get(t);n.handleXhrDetailsOnError(r,t,"XMLHttpRequest timeout")},n.initializeTrace=function(e){var t=pr();e.trace=gr(n.config.logicalServiceName,t,n.context.config.enableW3CTraceId),e.trace.subsegments.push(vr(yr(e.url),t,{request:{method:e.method,url:e.url,traced:!0}}))},n.sendWrapper=function(){var e=n;return function(t){return function(){var n=e.xhrMap.get(this);return n&&(this.addEventListener("load",e.handleXhrLoadEvent),this.addEventListener("error",e.handleXhrErrorEvent),this.addEventListener("abort",e.handleXhrAbortEvent),this.addEventListener("timeout",e.handleXhrTimeoutEvent),e.initializeTrace(n),!e.isSyntheticsUA&&e.isTracingEnabled()&&e.addXRayTraceIdHeader(n.url)&&e.isSessionRecorded()&&(e.context.config.enableW3CTraceId?this.setRequestHeader(sr,wr(n.trace.trace_id,n.trace.subsegments[0].id)):this.setRequestHeader(ar,mr(n.trace.trace_id,n.trace.subsegments[0].id)))),t.apply(this,arguments)}}},n.openWrapper=function(){var e=n;return function(t){return function(n,r,i){return fr(r,e.config)&&e.xhrMap.set(this,{url:r,method:n,async:i}),t.apply(this,arguments)}}},n.config=ho(ho({},ur),t),n.xhrMap=new Map,n.isSyntheticsUA=navigator.userAgent.includes("CloudWatchSynthetics"),n}return lo(t,e),t.prototype.onload=function(){this.enable()},Object.defineProperty(t.prototype,"patches",{get:function(){return[{nodule:XMLHttpRequest.prototype,name:"send",wrapper:this.sendWrapper},{nodule:XMLHttpRequest.prototype,name:"open",wrapper:this.openWrapper}]},enumerable:!1,configurable:!0}),t.prototype.handleXhrDetailsOnError=function(e,t,n){if(e){var r=pr();e.trace.end_time=r,e.trace.subsegments[0].end_time=r,e.trace.subsegments[0].error=!0,e.trace.subsegments[0].cause={exceptions:[{type:n}]},this.recordTraceEvent(e.trace),this.recordHttpEventWithError(e,t,n)}},t.prototype.statusOk=function(e){return e>=200&&e<300},t.prototype.recordHttpEventWithResponse=function(e,t){this.xhrMap.delete(t);var n={version:"1.0.0",request:{method:e.method,url:e.url},response:{status:t.status,statusText:t.statusText}};this.isTracingEnabled()&&(n.trace_id=e.trace.trace_id,n.segment_id=e.trace.subsegments[0].id),!this.config.recordAllRequests&&this.statusOk(t.status)||this.context.record(G,n)},t.prototype.recordHttpEventWithError=function(e,t,n){this.xhrMap.delete(t);var r={version:"1.0.0",request:{method:e.method,url:e.url},error:pe({type:"error",error:n},this.config.stackTraceLength)};this.isTracingEnabled()&&(r.trace_id=e.trace.trace_id,r.segment_id=e.trace.subsegments[0].id),this.context.record(G,r)},t.prototype.recordTraceEvent=function(e){!this.isSyntheticsUA&&this.isTracingEnabled()&&this.isSessionRecorded()&&this.context.record(K,e)},t}(ze),po=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),go=window&&window.__assign||function(){return go=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},go.apply(this,arguments)},vo=function(e){function t(t){var n=e.call(this,"fetch")||this;return n.isTracingEnabled=function(){return n.context.config.enableXRay},n.isSessionRecorded=function(){var e;return(null===(e=n.context.getSession())||void 0===e?void 0:e.record)||!1},n.beginTrace=function(e,t,r){var i=pr(),o=function(e,t,n){var r={request:{}};return r.request.method=(null==t?void 0:t.method)?t.method:"GET",r.request.traced=n,r.request.url=br(e),r}(e,t,!0),a=gr(n.config.logicalServiceName,i,n.context.config.enableW3CTraceId),s=vr(yr(e),i,o);return a.subsegments.push(s),n.isTraceIdHeaderEnabled(e)&&n.addXRayTraceIdHeader(e,t,r,a),a},n.addXRayTraceIdHeader=function(e,t,r,i){if(e.headers)return o=e.headers,a=i.trace_id,s=i.subsegments[0].id,void(n.context.config.enableW3CTraceId?o.set(sr,wr(a,s)):o.set(ar,mr(a,s)));var o,a,s;t||(t={},[].push.call(r,t)),function(e,t,n,r){e.headers||(e.headers={}),r?e.headers[sr]=wr(t,n):e.headers[ar]=mr(t,n)}(t,i.trace_id,i.subsegments[0].id,n.context.config.enableW3CTraceId)},n.endTrace=function(e,t,r){if(e){var i=pr();if(e.subsegments[0].end_time=i,e.end_time=i,t){e.subsegments[0].http.response={status:t.status},hr(t.status)?(e.subsegments[0].throttle=!0,e.throttle=!0):lr(t.status)?(e.subsegments[0].error=!0,e.error=!0):dr(t.status)&&(e.subsegments[0].fault=!0,e.fault=!0);var o=t.headers.get("Content-Length"),a=o?parseInt(o,10):NaN;isNaN(a)||(e.subsegments[0].http.response.content_length=a)}r&&(e.fault=!0,e.subsegments[0].fault=!0,r instanceof Object?n.appendErrorCauseFromObject(e.subsegments[0],r):fe(r)&&n.appendErrorCauseFromPrimitive(e.subsegments[0],r.toString())),n.context.record(K,e)}},n.createHttpEvent=function(e,t){var n=e;return{version:"1.0.0",request:{url:br(e),method:(null==t?void 0:t.method)?t.method:n.method?n.method:"GET"}}},n.recordHttpEventWithResponse=function(e,t){!n.config.recordAllRequests&&t.ok||(e.response={status:t.status,statusText:t.statusText},n.context.record(G,e))},n.recordHttpEventWithError=function(e,t){e.error=pe({type:"error",error:t},n.config.stackTraceLength),n.context.record(G,e)},n.fetch=function(e,t,r,i,o){var a,s=n.createHttpEvent(i,o);if(!fr(br(i),n.config))return e.apply(t,r);var c=function(e,t){var n,r,i,o={};return e&&(t?(i=null===(n=e.get(sr))||void 0===n?void 0:n.split("-"))&&function(e){return 4===(null==e?void 0:e.length)&&2===e[0].length&&32===e[1].length&&16===e[2].length&&("00"===e[3]||"01"===e[3])}(i)&&(o.traceId=i[1],o.segmentId=i[2]):3===(null==(i=null===(r=e.get(ar))||void 0===r?void 0:r.split(";"))?void 0:i.length)&&(o.traceId=i[0].split("Root=")[1],o.segmentId=i[1].split("Parent=")[1])),o}(i.headers,n.context.config.enableW3CTraceId);return c.traceId&&c.segmentId?(s.trace_id=c.traceId,s.segment_id=c.segmentId):n.isTracingEnabled()&&n.isSessionRecorded()&&(a=n.beginTrace(i,o,r),s.trace_id=a.trace_id,s.segment_id=a.subsegments[0].id),e.apply(t,r).then((function(e){return n.endTrace(a,e,void 0),n.recordHttpEventWithResponse(s,e),e})).catch((function(e){throw n.endTrace(a,void 0,e),n.recordHttpEventWithError(s,e),e}))},n.fetchWrapper=function(){var e=n;return function(t){return function(n,r){return e.fetch(t,this,arguments,n,r)}}},n.config=go(go({},ur),t),n}return po(t,e),Object.defineProperty(t.prototype,"patches",{get:function(){return[{nodule:window,name:"fetch",wrapper:this.fetchWrapper}]},enumerable:!1,configurable:!0}),t.prototype.onload=function(){this.enable()},t.prototype.isTraceIdHeaderEnabled=function(e){var t=br(e);return cr(t,this.config.addXRayTraceIdHeader)},t.prototype.appendErrorCauseFromPrimitive=function(e,t){e.cause={exceptions:[{type:t}]}},t.prototype.appendErrorCauseFromObject=function(e,t){e.cause={exceptions:[{type:t.name,message:t.message}]}},t}(ze),yo=window&&window.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mo=function(e){function t(){var t=e.call(this,"page-view")||this;return t.pushState=function(){var e=t;return function(t){return function(n,r,i){var o=t.apply(this,arguments);return e.recordPageView(),o}}},t.replaceState=function(){var e=t;return function(t){return function(n,r,i){var o=t.apply(this,arguments);return e.recordPageView(),o}}},t.popstateListener=function(e){t.recordPageView()},t.recordPageView=function(){t.context.recordPageView(t.createIdForCurrentPage())},t.enable(),t}return yo(t,e),t.prototype.onload=function(){this.addListener(),this.recordPageView()},Object.defineProperty(t.prototype,"patches",{get:function(){return[{nodule:History.prototype,name:"pushState",wrapper:this.pushState},{nodule:History.prototype,name:"replaceState",wrapper:this.replaceState}]},enumerable:!1,configurable:!0}),t.prototype.addListener=function(){window.addEventListener("popstate",this.popstateListener)},t.prototype.createIdForCurrentPage=function(){var e=window.location.pathname,t=window.location.hash;switch(this.context.config.pageIdFormat){case Wi.PathAndHash:return e&&t?e+t:e||(t||"");case Wi.Hash:return t||"";case Wi.Path:default:return e||""}},t}(ze),wo=window&&window.__assign||function(){return wo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},wo.apply(this,arguments)},bo=window&&window.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Eo=window&&window.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},So="us-west-2",_o="https://dataplane.rum.".concat(So,".amazonaws.com");!function(e){e.Errors="errors",e.Performance="performance",e.Interaction="interaction",e.Http="http"}(Vi||(Vi={})),function(e){e.Path="PATH",e.Hash="HASH",e.PathAndHash="PATH_AND_HASH"}(Wi||(Wi={}));var To={candidatesCacheSize:10},Co=function(){function e(e,t,n,r){void 0===r&&(r={});var i=r.cookieAttributes,o=bo(r,["cookieAttributes"]);this.eventBus=new Ke,void 0===n&&(n="us-west-2");var a=wo(wo({},{unique:!1,domain:window.location.hostname,path:"/",sameSite:"Strict",secure:!0}),i);this.config=wo(wo(wo({fetchFunction:fetch},function(e){return wo({allowCookies:!1,batchLimit:100,client:"arw-module",cookieAttributes:e,disableAutoPageView:!1,dispatchInterval:5e3,enableRumClient:!0,enableXRay:!1,endpoint:_o,endpointUrl:new URL(_o),eventCacheSize:200,eventPluginsToLoad:[],pageIdFormat:Wi.Path,pagesToExclude:[],pagesToInclude:[/.*/],signing:!0,recordResourceUrl:!0,retries:2,routeChangeComplete:100,routeChangeTimeout:1e4,sessionAttributes:{},sessionEventLimit:200,sessionLengthSeconds:1800,sessionSampleRate:1,telemetries:[],useBeacon:!0,userIdRetentionDays:30,enableW3CTraceId:!1},To)}(a)),o),To),this.config.endpoint=this.getDataPlaneEndpoint(n,o),this.config.endpointUrl=new URL(this.config.endpoint),this.eventCache=this.initEventCache(e,t),this.dispatchManager=this.initDispatch(n,e),this.pluginManager=this.initPluginManager(e,t),this.config.enableRumClient?this.enable():this.disable()}return e.prototype.setAwsCredentials=function(e){this.dispatchManager.setAwsCredentials(e)},e.prototype.addSessionAttributes=function(e){this.eventCache.addSessionAttributes(e)},e.prototype.addPlugin=function(e){this.pluginManager.addPlugin(e)},e.prototype.dispatch=function(){this.dispatchManager.dispatchFetch()},e.prototype.dispatchBeacon=function(){this.dispatchManager.dispatchBeacon()},e.prototype.enable=function(){this.eventCache.enable(),this.pluginManager.enable(),this.dispatchManager.enable()},e.prototype.disable=function(){this.dispatchManager.disable(),this.pluginManager.disable(),this.eventCache.disable()},e.prototype.allowCookies=function(e){this.config.allowCookies=e},e.prototype.recordPageView=function(e){this.eventCache.recordPageView(e)},e.prototype.recordError=function(e){this.pluginManager.record(ye,e)},e.prototype.registerDomEvents=function(e){this.pluginManager.updatePlugin(le,e)},e.prototype.recordEvent=function(e,t){this.eventCache.recordEvent(e,t)},e.prototype.initEventCache=function(e,t){return new Je({id:e,version:t},this.config,this.eventBus)},e.prototype.initDispatch=function(e,t){var n=new Rr(e,this.config.endpointUrl,this.eventCache,this.config);return this.eventCache.isSessionSampled()?(this.config.identityPoolId&&this.config.guestRoleArn?n.setAwsCredentials(new B(this.config,t).ChainAnonymousCredentialsProvider):this.config.identityPoolId&&n.setAwsCredentials(new V(this.config,t).ChainAnonymousCredentialsProvider),n):n},e.prototype.initPluginManager=function(e,t){var n=this.constructBuiltinPlugins(),r=Eo(Eo([],n,!0),this.config.eventPluginsToLoad,!0),i={applicationId:e,applicationVersion:t,config:this.config,record:this.eventCache.recordEvent,recordCandidate:this.eventCache.recordCandidate,recordPageView:this.eventCache.recordPageView,getSession:this.eventCache.getSession,eventBus:this.eventBus},o=new se(i);return this.config.disableAutoPageView||o.addPlugin(new mo),r.forEach((function(e){o.addPlugin(e)})),o},e.prototype.constructBuiltinPlugins=function(){var e=[],t=this.telemetryFunctor();return this.config.telemetries.forEach((function(n){"string"==typeof n&&t[n.toLowerCase()]?e=Eo(Eo([],e,!0),t[n.toLowerCase()]({}),!0):Array.isArray(n)&&t[n[0].toLowerCase()]&&(e=Eo(Eo([],e,!0),t[n[0].toLowerCase()](n[1]),!0))})),e},e.prototype.getDataPlaneEndpoint=function(e,t){return t.endpoint?t.endpoint:_o.replace(So,e)},e.prototype.telemetryFunctor=function(){var e;return(e={})[Vi.Errors]=function(e){return[new we(e)]},e[Vi.Performance]=function(e){return[new $r(e),new Kr(e),new so(e)]},e[Vi.Interaction]=function(e){return[new he(e)]},e[Vi.Http]=function(e){return[new fo(e),new vo(e)]},e},e}();class xo{constructor(e={}){this.enabled=!1,this.id="console-plugin",this.originalMethods={log:console.log,info:console.info,warn:console.warn,error:console.error,debug:console.debug},this.levels=new Set(e.levels||["log","info","warn","error","debug"]),this.maxMessageLength=e.maxMessageLength??10240}load(e){this.context=e,this.enable()}enable(){this.enabled||(this.enabled=!0,["log","info","warn","error","debug"].forEach((e=>{this.levels.has(e)&&(console[e]=(...t)=>{if(this.originalMethods[e](...t),this.enabled)try{let n=t.map((e=>"object"==typeof e?JSON.stringify(e):String(e))).join(" ");n.length>this.maxMessageLength&&(n=n.substring(0,this.maxMessageLength-20)+"... [truncated]"),this.context.record("console_log",{level:e,message:n,timestamp:Date.now()})}catch(e){}})})))}disable(){this.enabled&&(this.enabled=!1,["log","info","warn","error","debug"].forEach((e=>{this.levels.has(e)&&(console[e]=this.originalMethods[e])})))}getPluginId(){return this.id}}class Io{constructor(){this.enabled=!1,this.id="navigation-plugin",this.originalPushState=history.pushState,this.originalReplaceState=history.replaceState,this.currentUrl="",this.eventHandlers=[]}load(e){this.context=e,this.currentUrl=window.location.href,this.enable()}enable(){if(this.enabled)return;this.enabled=!0,history.pushState=(...e)=>{const t=this.currentUrl;try{this.originalPushState.apply(history,e),this.currentUrl=window.location.href,this.recordNavigation(t,this.currentUrl,"pushState")}catch(e){throw this.currentUrl=window.location.href,e}},history.replaceState=(...e)=>{const t=this.currentUrl;try{this.originalReplaceState.apply(history,e),this.currentUrl=window.location.href,this.recordNavigation(t,this.currentUrl,"replaceState")}catch(e){throw this.currentUrl=window.location.href,e}};const e=()=>{const e=this.currentUrl;this.currentUrl=window.location.href,this.recordNavigation(e,this.currentUrl,"popstate")};window.addEventListener("popstate",e),this.eventHandlers.push({type:"popstate",handler:e});const t=()=>{const e=this.currentUrl;this.currentUrl=window.location.href,this.recordNavigation(e,this.currentUrl,"hashchange")};window.addEventListener("hashchange",t),this.eventHandlers.push({type:"hashchange",handler:t})}disable(){this.enabled&&(this.enabled=!1,history.pushState=this.originalPushState,history.replaceState=this.originalReplaceState,this.eventHandlers.forEach((({type:e,handler:t})=>{window.removeEventListener(e,t)})),this.eventHandlers=[])}getPluginId(){return this.id}recordNavigation(e,t,n){if(this.enabled)try{this.context.record("navigation",{type:n,from:e,to:t,timestamp:Date.now()})}catch(e){}}}class Oo{constructor(e={}){this.enabled=!1,this.id="dom-mutation-plugin",this.observer=null,this.pendingMutations=[],this.flushTimeout=null,this.rootElement=document.body,this.config=e,this.throttleMs=e.throttleMs||100,this.maxHtmlLength=e.maxHtmlLength??51200,this.includeText=!0===e.includeText}load(e){this.context=e,this.enable()}enable(){if(this.enabled)return;this.enabled=!0;let e=document.body;if(this.config.rootElement)if("string"==typeof this.config.rootElement){const t=document.querySelector(this.config.rootElement);t&&(e=t)}else e=this.config.rootElement;this.rootElement=e;try{this.observer=new MutationObserver((e=>{this.enabled&&this.scheduleMutationFlush(e)})),this.observer.observe(this.rootElement,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1});const e=this.snapshotHTML();e&&this.context.record("dom_mutation",{addedNodes:0,removedNodes:0,attributeChanges:0,characterDataChanges:0,timestamp:Date.now(),rootElementHTML:e,initial:!0})}catch(e){console.debug("DOM mutation plugin failed to start:",e)}}snapshotHTML(){const e=this.includeText?this.rootElement:function(e){const t=document.createElement("div");t.innerHTML=e.innerHTML;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),r=[];let i=n.nextNode();for(;i;)r.push(i),i=n.nextNode();return r.forEach((e=>e.parentNode?.removeChild(e))),t}(this.rootElement),t=e.innerHTML;return t.length>this.maxHtmlLength?t.substring(0,this.maxHtmlLength-20)+"... [truncated]":t}disable(){if(!this.enabled)return;this.enabled=!1,this.flushTimeout&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),this.observer&&(this.observer.disconnect(),this.observer=null);const e=[...this.pendingMutations];this.pendingMutations=[],e.length>0&&this.recordPendingMutations(e)}getPluginId(){return this.id}scheduleMutationFlush(e){this.enabled&&(this.pendingMutations.push(...e),this.flushTimeout&&clearTimeout(this.flushTimeout),this.flushTimeout=setTimeout((()=>{this.enabled&&this.flushMutations()}),this.throttleMs))}flushMutations(){this.enabled&&this.observer&&(this.recordPendingMutations(),this.flushTimeout=null)}recordPendingMutations(e){if(!e&&!this.enabled)return;const t=e||this.pendingMutations;if(0!==t.length){try{let e=0,n=0,r=0,i=0;for(const o of t)e+=o.addedNodes.length,n+=o.removedNodes.length,"attributes"===o.type?r++:"characterData"===o.type&&i++;const o=e>0||n>0?this.snapshotHTML():"";this.context.record("dom_mutation",{addedNodes:e,removedNodes:n,attributeChanges:r,characterDataChanges:i,timestamp:Date.now(),rootElementHTML:o})}catch(e){}e||(this.pendingMutations=[])}}}function Po(e){return"undefined"!=typeof Request&&e instanceof Request}function Ao(e,t){const n={};if(!e)return n;const r=(e,r)=>{const i=e.toLowerCase(),o=t?t(r):r;n[i]=o};return"undefined"!=typeof Headers&&e instanceof Headers?(e.forEach(((e,t)=>r(t,e))),n):Array.isArray(e)?(e.forEach((([e,t])=>r(e,t))),n):(Object.entries(e).forEach((([e,t])=>r(e,String(t)))),n)}function Lo(e,t){const n={};return e?(e.trim().split(/\r?\n/).forEach((e=>{const r=e.indexOf(":");if(-1===r)return;const i=e.slice(0,r).trim().toLowerCase(),o=e.slice(r+1).trim();n[i]=t(o)})),n):n}function ko(e){if(!e)return e;try{return new URL(e,window.location.href).toString()}catch{return e}}function Ro(e,t){return!!e&&(!t||0===t.length||t.some((t=>{try{return t.test(e)}catch(e){return console.debug("Network plugin filter failed:",e),!1}})))}function Mo(e,t){return e.headers?Ao(e.headers,t):{}}function jo(e,t){console.debug(e,t)}function Ho(e){return Date.now()-e}const Do=Symbol("network-plugin-metadata");class qo{constructor(e={}){this.enabled=!1,this.id="network-plugin",this.urlFilters=function(e){if(e)return Array.isArray(e)?e:[e]}(e.urlFilter),this.maxHeaderLength=e.maxHeaderLength??2048,this.truncate=e=>function(e,t){return e.length<=t?e:e.substring(0,t-20)+"... [truncated]"}(e,this.maxHeaderLength)}load(e){this.context=e,this.enable()}enable(){this.enabled||(this.enabled=!0,this.patchFetch(),this.patchXhr())}disable(){this.enabled&&(this.enabled=!1,this.restoreFetch(),this.restoreXhr())}getPluginId(){return this.id}patchFetch(){if("function"!=typeof window.fetch)return;this.originalFetch||(this.originalFetch=window.fetch);const e=this.originalFetch,t=this;window.fetch=function(...n){return t.handleFetch(e,n,this??window)}}restoreFetch(){this.originalFetch&&(window.fetch=this.originalFetch)}patchXhr(){if("undefined"==typeof XMLHttpRequest)return;this.originalXhrOpen||(this.originalXhrOpen=XMLHttpRequest.prototype.open,this.originalXhrSend=XMLHttpRequest.prototype.send,this.originalXhrSetRequestHeader=XMLHttpRequest.prototype.setRequestHeader);const e=this;XMLHttpRequest.prototype.open=function(t,n,r,i,o){const a=this;try{const r=e.getXhrMeta(a);r.method=(t||"GET").toUpperCase();const i="string"==typeof n?n:n?.toString()||"";r.url=ko(i)}catch(e){jo("XHR metadata collection failed:",e)}return e.originalXhrOpen.call(this,t,n,r??!0,i??null,o??null)},XMLHttpRequest.prototype.setRequestHeader=function(t,n){const r=this;try{const i=e.getXhrMeta(r);t&&(i.requestHeaders[t.toLowerCase()]=e.truncate(String(n??"")))}catch(e){jo("XHR header capture failed:",e)}return e.originalXhrSetRequestHeader.call(this,t,n)},XMLHttpRequest.prototype.send=function(t){const n=this;let r=!1;try{const t=e.getXhrMeta(n);t.startTime=Date.now(),t.url||(t.url=ko(n.responseURL||"")),r=Ro(t.url||"",e.urlFilters)}catch(e){jo("XHR send metadata check failed:",e)}if(!r)return e.originalXhrSend.call(this,t);const i=()=>{try{e.recordXhrSuccess(n)}catch(e){jo("XHR success recording failed:",e)}a()},o=t=>{try{e.recordXhrError(n,t.type)}catch(e){jo("XHR error recording failed:",e)}a()},a=()=>{try{n.removeEventListener("load",i),n.removeEventListener("error",o),n.removeEventListener("abort",o),n.removeEventListener("timeout",o),delete n[Do]}catch(e){jo("XHR cleanup failed:",e)}};try{n.addEventListener("load",i),n.addEventListener("error",o),n.addEventListener("abort",o),n.addEventListener("timeout",o)}catch(e){jo("XHR event listener attachment failed:",e)}return e.originalXhrSend.call(this,t)}}restoreXhr(){"undefined"!=typeof XMLHttpRequest&&(this.originalXhrOpen&&(XMLHttpRequest.prototype.open=this.originalXhrOpen),this.originalXhrSend&&(XMLHttpRequest.prototype.send=this.originalXhrSend),this.originalXhrSetRequestHeader&&(XMLHttpRequest.prototype.setRequestHeader=this.originalXhrSetRequestHeader))}handleFetch(e,t,n){if(!this.enabled)return e.apply(n,t);const[r,i]=t,o=ko(function(e){return"string"==typeof e?e:e instanceof URL?e.toString():Po(e)?e.url:String(e)}(r));if(!Ro(o,this.urlFilters))return e.apply(n,t);const a=function(e,t){return t?.method?t.method.toUpperCase():Po(e)&&e.method?e.method.toUpperCase():"GET"}(r,i),s=function(e,t,n){const r={};return Po(e)&&Object.assign(r,Ao(e.headers,n)),t?.headers&&Object.assign(r,Ao(t.headers,n)),r}(r,i,this.truncate),c=Date.now();return e.apply(n,t).then((e=>{try{this.recordNetworkSuccess({transport:"fetch",url:o,method:a,status:e.status,statusText:e.statusText,duration:Ho(c),timestamp:c,requestHeaders:s,responseHeaders:Mo(e,this.truncate)})}catch(e){jo("Failed to record network success:",e)}return e})).catch((e=>{try{this.recordNetworkError({transport:"fetch",url:o,method:a,duration:Ho(c),timestamp:c,requestHeaders:s,error:e instanceof Error?e.message:String(e)})}catch(e){jo("Failed to record network error:",e)}throw e}))}recordXhrSuccess(e){if(!this.enabled)return;const t=e[Do];t?.startTime&&t.url&&this.recordNetworkSuccess({transport:"xhr",url:t.url,method:t.method||"GET",status:e.status,statusText:e.statusText,duration:Ho(t.startTime),timestamp:t.startTime,requestHeaders:t.requestHeaders,responseHeaders:Lo(e.getAllResponseHeaders(),this.truncate)})}recordXhrError(e,t){if(!this.enabled)return;const n=e[Do];n?.startTime&&n.url&&this.recordNetworkError({transport:"xhr",url:n.url,method:n.method||"GET",duration:Ho(n.startTime),timestamp:n.startTime,requestHeaders:n.requestHeaders,status:e.status,statusText:e.statusText,error:t})}recordNetworkSuccess(e){if(this.enabled)try{this.context.record("network_request",e)}catch(e){jo("Network plugin failed to record request:",e)}}recordNetworkError(e){if(this.enabled)try{this.context.record("network_error",e)}catch(e){jo("Network plugin failed to record error:",e)}}getXhrMeta(e){return e[Do]||(e[Do]={requestHeaders:{}}),e[Do]}}function Uo(e){if(e)return"object"==typeof e?e:{}}return class{constructor(e,t,n=console){if(this.rumClient=null,this.plugins=[],this.isShutdown=!1,this.initializationFailed=!1,this.config=e,this.context=t,this.logger=n,e.enabled)try{this.initializeRumClient()}catch(e){this.initializationFailed=!0,this.logger.error("Telemetry initialization failed:",e)}else this.logger.debug("Telemetry is disabled")}initializeRumClient(){try{const e=[...this.buildHttpTelemetry(),"errors"],t=this.buildCustomPlugins();this.rumClient=this.createRumClient(e,t),this.rumClient.addSessionAttributes({projectId:this.context.projectId,flowId:this.context.flowId}),this.plugins.forEach((e=>{e.enable()}));const n=this.tryGetSessionId();this.logger.info(`TelemetryManager: RUM client ready (sessionId=${n??"unknown"})`)}catch(e){throw this.logger.error("Failed to initialize telemetry:",e),e}}buildHttpTelemetry(){if(!1===this.config.capture?.network)return[];const e={recordAllRequests:!0,addXRayTraceIdHeader:!1,stackTraceLength:200},t=this.config.capture?.network?.urlFilter;if(t){const n=Array.isArray(t)?t:[t];e.recordResourceUrl=e=>n.some((t=>t.test(e)))}return[["http",e]]}buildCustomPlugins(){const e=[];if(!1!==this.config.capture?.console){const t=Uo(this.config.capture?.console);e.push(new xo(t))}if(!1!==this.config.capture?.navigation&&e.push(new Io),!1!==this.config.capture?.network){const t=Uo(this.config.capture?.network);e.push(new qo(t))}if(!1!==this.config.capture?.dom){const t=Uo(this.config.capture?.dom);e.push(new Oo(t))}return this.plugins.push(...e),e}createRumClient(e,t){const n={endpoint:this.config.rumConfig.endpoint,telemetries:e,eventPluginsToLoad:t,allowCookies:!0,enableXRay:!1,sessionEventLimit:1e4,batchLimit:500,eventCacheSize:2e3,dispatchInterval:5e3,...this.config.rumConfig};return this.logger.debug("Creating RUM client with config:",n),new Co(this.config.rumConfig.applicationId,this.context.version||"1.0.0",this.config.rumConfig.region,n)}shutdown(){this.isShutdown?this.logger.debug("Telemetry already shutdown"):(this.isShutdown=!0,this.safe("shutdown rum client",(()=>{this.rumClient&&(this.rumClient.disable(),this.rumClient=null)})),this.plugins.forEach((e=>{this.safe("disable plugin",(()=>e.disable()))})),this.plugins=[],this.logger.debug("Telemetry shutdown complete"))}enable(){this.assertMutable("enable")&&this.safe("enable",(()=>{this.plugins.forEach((e=>e.enable())),this.logger.debug("Telemetry enabled")}))}disable(){this.assertMutable("disable")&&this.safe("disable",(()=>{this.plugins.forEach((e=>e.disable())),this.logger.debug("Telemetry disabled")}))}updateContext(e){this.assertMutable("update telemetry context")&&this.safe("update telemetry context",(()=>{const t=Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)));this.context={...this.context,...t},this.rumClient.addSessionAttributes(t),this.logger.debug("Telemetry context updated:",t)}))}isReady(){return!this.isShutdown&&!this.initializationFailed&&null!==this.rumClient}getRumClient(){return this.rumClient}assertMutable(e){return this.initializationFailed?(this.logger.error(`Cannot ${e}: telemetry initialization failed`),!1):this.isShutdown?(this.logger.error(`Cannot ${e}: telemetry has been shutdown. Create a new instance.`),!1):!!this.rumClient||(this.logger.error(`Cannot ${e}: telemetry not initialized`),!1)}safe(e,t){try{t()}catch(t){this.logger.error(`Failed to ${e}:`,t)}}tryGetSessionId(){try{return this.rumClient?.eventCache?.getSession?.()?.sessionId??null}catch{return null}}}}));
2
+ //# sourceMappingURL=index.js.map