@safaricom-mxl/web-sdk 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/attributes.cjs +2 -0
- package/dist/constants/attributes.cjs.map +1 -1
- package/dist/constants/attributes.d.cts +2 -1
- package/dist/constants/attributes.d.cts.map +1 -1
- package/dist/constants/attributes.d.ts +2 -1
- package/dist/constants/attributes.d.ts.map +1 -1
- package/dist/constants/attributes.js +2 -1
- package/dist/constants/attributes.js.map +1 -1
- package/dist/constants/index.cjs +1 -0
- package/dist/constants/index.d.cts +2 -2
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.cjs +1 -1
- package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.cjs.map +1 -1
- package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.d.cts.map +1 -1
- package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.d.ts.map +1 -1
- package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.js +2 -2
- package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.js.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.cjs +3 -1
- package/dist/managers/MXLLogManager/MXLLogManager.cjs.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.d.cts.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.d.ts.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.js +4 -2
- package/dist/managers/MXLLogManager/MXLLogManager.js.map +1 -1
- package/dist/mxl-web-sdk.js +3 -38
- package/dist/mxl-web-sdk.js.map +1 -1
- package/dist/resources/constants/index.cjs +1 -1
- package/dist/resources/constants/index.cjs.map +1 -1
- package/dist/resources/constants/index.d.cts +1 -1
- package/dist/resources/constants/index.d.ts +1 -1
- package/dist/resources/constants/index.js +1 -1
- package/dist/resources/constants/index.js.map +1 -1
- package/dist/sdk/initSDK.cjs +14 -12
- package/dist/sdk/initSDK.cjs.map +1 -1
- package/dist/sdk/initSDK.d.cts.map +1 -1
- package/dist/sdk/initSDK.d.ts.map +1 -1
- package/dist/sdk/initSDK.js +14 -12
- package/dist/sdk/initSDK.js.map +1 -1
- package/dist/sdk/noopSessionRecording.cjs +10 -0
- package/dist/sdk/noopSessionRecording.cjs.map +1 -0
- package/dist/sdk/noopSessionRecording.d.cts +7 -0
- package/dist/sdk/noopSessionRecording.d.cts.map +1 -0
- package/dist/sdk/noopSessionRecording.d.ts +7 -0
- package/dist/sdk/noopSessionRecording.d.ts.map +1 -0
- package/dist/sdk/noopSessionRecording.js +9 -0
- package/dist/sdk/noopSessionRecording.js.map +1 -0
- package/dist/sdk/setupSessionRecorder.cjs +64 -22
- package/dist/sdk/setupSessionRecorder.cjs.map +1 -1
- package/dist/sdk/setupSessionRecorder.d.cts +16 -7
- package/dist/sdk/setupSessionRecorder.d.cts.map +1 -1
- package/dist/sdk/setupSessionRecorder.d.ts +16 -7
- package/dist/sdk/setupSessionRecorder.d.ts.map +1 -1
- package/dist/sdk/setupSessionRecorder.js +62 -21
- package/dist/sdk/setupSessionRecorder.js.map +1 -1
- package/package.json +2 -2
package/dist/mxl-web-sdk.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
"use strict";window.MXLWebSdk=window.MXLWebSdk||(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let u=`1.9.1`,d=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function f(e){let t=new Set([e]),n=new Set,r=e.match(d);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(d);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}let p=f(u),m=u.split(`.`)[0],h=Symbol.for(`opentelemetry.js.api.${m}`),g=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function _(e,t,n,r=!1){var i;let a=g[h]=(i=g[h])==null?{version:u}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${u}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${u}.`),!0}function v(e){var t,n;let r=(t=g[h])==null?void 0:t.version;if(!(!r||!p(r)))return(n=g[h])==null?void 0:n[e]}function y(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${u}.`);let n=g[h];n&&delete n[e]}var b=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return x(`debug`,this._namespace,e)}error(...e){return x(`error`,this._namespace,e)}info(...e){return x(`info`,this._namespace,e)}warn(...e){return x(`warn`,this._namespace,e)}verbose(...e){return x(`verbose`,this._namespace,e)}};function x(e,t,n){let r=v(`diag`);if(r)return r[e](t,...n)}var S;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(S||(S={}));function C(e,t){e<S.NONE?e=S.NONE:e>S.ALL&&(e=S.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,S.ERROR),warn:n(`warn`,S.WARN),info:n(`info`,S.INFO),debug:n(`debug`,S.DEBUG),verbose:n(`verbose`,S.VERBOSE)}}var w=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=v(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:S.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=v(`diag`),s=C((i=n.logLevel)==null?S.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return _(`diag`,s,t,!0)},t.disable=()=>{y(`diag`,t)},t.createComponentLogger=e=>new b(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},ee=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}};let T=Symbol(`BaggageEntryMetadata`),E=w.instance();function D(e={}){return new ee(new Map(Object.entries(e)))}function te(e){return typeof e!=`string`&&(E.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:T,toString(){return e}}}function O(e){return Symbol.for(e)}let k=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},A=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],j={};if(typeof console<`u`)for(let e of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[e]==`function`&&(j[e]=console[e]);var ne=class{constructor(){function e(e){return function(...t){let n=j[e];if(typeof n!=`function`&&(n=j.log),typeof n!=`function`&&console&&(n=console[e],typeof n!=`function`&&(n=console.log)),typeof n==`function`)return n.apply(console,t)}}for(let t=0;t<A.length;t++)this[A[t].n]=e(A[t].c)}},re=class{constructor(){}createGauge(e,t){return de}createHistogram(e,t){return fe}createCounter(e,t){return ue}createUpDownCounter(e,t){return pe}createObservableGauge(e,t){return he}createObservableCounter(e,t){return me}createObservableUpDownCounter(e,t){return ge}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ie=class{},M=class extends ie{add(e,t){}},ae=class extends ie{add(e,t){}},N=class extends ie{record(e,t){}},P=class extends ie{record(e,t){}},F=class{addCallback(e){}removeCallback(e){}},oe=class extends F{},se=class extends F{},ce=class extends F{};let le=new re,ue=new M,de=new N,fe=new P,pe=new ae,me=new oe,he=new se,ge=new ce;function _e(){return le}let ve={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},ye={set(e,t,n){e!=null&&(e[t]=n)}};var be=class{active(){return k}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}};let xe=`context`,Se=new be;var Ce=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return _(xe,e,w.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return v(xe)||Se}disable(){this._getContextManager().disable(),y(xe,w.instance())}},we;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(we||(we={}));let Te={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:we.NONE};var Ee=class{constructor(e=Te){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}};let De=O(`OpenTelemetry Context Key SPAN`);function Oe(e){return e.getValue(De)||void 0}function ke(){return Oe(Ce.getInstance().active())}function Ae(e,t){return e.setValue(De,t)}function je(e){return e.deleteValue(De)}function Me(e,t){return Ae(e,new Ee(t))}function Ne(e){var t;return(t=Oe(e))==null?void 0:t.spanContext()}let Pe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Fe(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Pe[e.charCodeAt(t)]|0)+(Pe[e.charCodeAt(t+1)]|0)+(Pe[e.charCodeAt(t+2)]|0)+(Pe[e.charCodeAt(t+3)]|0);return n===t}function Ie(e){return Fe(e,32)&&e!==`00000000000000000000000000000000`}function Le(e){return Fe(e,16)&&e!==`0000000000000000`}function Re(e){return Ie(e.traceId)&&Le(e.spanId)}function ze(e){return new Ee(e)}let Be=Ce.getInstance();var Ve=class{startSpan(e,t,n=Be.active()){if(t!=null&&t.root)return new Ee;let r=n&&Ne(n);return He(r)&&Re(r)?new Ee(r):new Ee}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a==null?Be.active():a,c=this.startSpan(e,i,s),l=Ae(s,c);return Be.with(l,o,void 0,c)}};function He(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}let Ue=new Ve;var We=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ue}};let Ge=new class{getTracer(e,t,n){return new Ve}};var Ke=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new We(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Ge:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}},qe;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(qe||(qe={}));var Je;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(Je||(Je={}));var Ye;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Ye||(Ye={}));let I=Ce.getInstance(),L=w.instance(),Xe=new class{getMeter(e,t,n){return le}},Ze=`metrics`,Qe=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return _(Ze,e,w.instance())}getMeterProvider(){return v(Ze)||Xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){y(Ze,w.instance())}}.getInstance();var $e=class{inject(e,t){}extract(e,t){return e}fields(){return[]}};let et=O(`OpenTelemetry Baggage Key`);function tt(e){return e.getValue(et)||void 0}function nt(){return tt(Ce.getInstance().active())}function rt(e,t){return e.setValue(et,t)}function it(e){return e.deleteValue(et)}let at=`propagation`,ot=new $e,st=class e{constructor(){this.createBaggage=D,this.getBaggage=tt,this.getActiveBaggage=nt,this.setBaggage=rt,this.deleteBaggage=it}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return _(at,e,w.instance())}inject(e,t,n=ye){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=ve){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){y(at,w.instance())}_getGlobalPropagator(){return v(at)||ot}}.getInstance(),ct=`trace`,R=class e{constructor(){this._proxyTracerProvider=new Ke,this.wrapSpanContext=ze,this.isSpanContextValid=Re,this.deleteSpan=je,this.getSpan=Oe,this.getActiveSpan=ke,this.getSpanContext=Ne,this.setSpan=Ae,this.setSpanContext=Me}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=_(ct,this._proxyTracerProvider,w.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return v(ct)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){y(ct,w.instance()),this._proxyTracerProvider=new Ke}}.getInstance(),lt=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.addEventListener(t,n)})},ut=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.removeEventListener(t,n)})};function dt(e,t,n,r=new Set){return new Proxy(e,{get(e,i,a){let o=Reflect.get(e,i,a);return typeof o!=`function`||r.has(i)?o:(...r)=>{try{return o.apply(e,r)}catch(e){let a=e instanceof Error?e.message:`Unknown error`;n.error(`${String(i)}: ${a}`);let o=t[i];return typeof o==`function`?o.apply(t,r):void 0}}}})}let ft=new Uint8Array(16),pt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`).toUpperCase()),mt=()=>{crypto.getRandomValues(ft);let e=``;for(let t=0;t<16;t++)e+=pt[ft[t]];return e},ht=()=>`mxlv2-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,gt=(e,t,n)=>{try{let r=e.getItem(t),i=r?parseInt(r,10):0;return Number.isNaN(i)&&(n.warn(`Non-numeric value stored at ${t} (${String(r)}); resetting counter.`),i=0),i++,e.setItem(t,i.toString()),i}catch(e){return n.warn(`Failed to retrieve ${t} from storage: `,e),1}},_t=`mxl.type`,vt=`mxl.state`,yt=`mxl.properties.`,bt=`mxl.instrumentation`,xt=`mxl.js_file_bundle_ids`,St=`browser.url.full`,Ct=`app.surface.name`,wt=`app.surface.id`,Tt=`app.surface.label`,Et=e=>e.visibilityState===`hidden`?`background`:`foreground`,Dt=globalThis,Ot=(e,t)=>!t||t<=0||t>100?!1:t>=kt(e),kt=e=>{if(e.length<6)return 0;let t=e.slice(-6),n=Math.pow(16,6)-1;return parseInt(t,16)/n*100},At=O(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function jt(e){return e.setValue(At,!0)}function Mt(e){return e.getValue(At)===!0}let Nt=`baggage`;function Pt(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ft(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function It(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch(e){return}let c;return t!==-1&&t<e.length-1&&(c=te(e.substring(t+1))),{key:o,value:s,metadata:c}}var Lt=class{inject(e,t,n){let r=st.getBaggage(e);if(!r||Mt(e))return;let i=Pt(Ft(r).filter(e=>e.length<=4096).slice(0,180));i.length>0&&n.set(t,Nt,i)}extract(e,t,n){let r=n.get(t,Nt),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=It(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:st.setBaggage(e,st.createBaggage(a))}fields(){return[Nt]}};function Rt(e){"@babel/helpers - typeof";return Rt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Rt(e)}function zt(e,t){if(Rt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Rt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bt(e){var t=zt(e,`string`);return Rt(t)==`symbol`?t:t+``}function z(e,t,n){return(t=Bt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ht(n)){L.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ut(r)){L.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Ht(e){return typeof e==`string`&&e!==``}function Ut(e){return e==null?!0:Array.isArray(e)?Wt(e):Gt(typeof e)}function Wt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Gt(e)){t=e;continue}return!1}return!1}}return!0}function Gt(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Kt(){return e=>{L.error(qt(e))}}function qt(e){return typeof e==`string`?e:JSON.stringify(Jt(e))}function Jt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}let Yt=Kt();function Xt(e){try{Yt(e)}catch(e){}}let Zt=`http.url`,Qt=`error.type`,$t=`exception.message`,en=`exception.stacktrace`,tn=`exception.type`,nn=`http.request.method`,rn=`http.request.method_original`,an=`http.response.status_code`,on=`server.address`,sn=`server.port`,cn=`service.name`,ln=`telemetry.sdk.language`,un=`telemetry.sdk.name`,dn=`telemetry.sdk.version`,fn=`url.full`,pn=`user_agent.original`,mn={[un]:`opentelemetry`,"process.runtime.name":`browser`,[ln]:`webjs`,[dn]:`2.7.1`},hn=performance,gn=Math.pow(10,6),_n=Math.pow(10,9);function vn(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*gn)]}function yn(e){return En(vn(hn.timeOrigin),vn(typeof e==`number`?e:hn.now()))}function bn(e){if(wn(e))return e;if(typeof e==`number`)return e<hn.timeOrigin?yn(e):vn(e);if(e instanceof Date)return vn(e.getTime());throw TypeError(`Invalid input type`)}function xn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=_n),[n,r]}function Sn(e){return e[0]*_n+e[1]}function Cn(e){return e[0]*1e3+e[1]/1e6}function wn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Tn(e){return wn(e)||typeof e==`number`||e instanceof Date}function En(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=_n&&(n[1]-=_n,n[0]+=1),n}var Dn;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(Dn||(Dn={}));var On=class{constructor(e={}){var t;z(this,`_propagators`,void 0),z(this,`_fields`,void 0),this._propagators=(t=e.propagators)==null?[]:t;let n=new Set;for(let e of this._propagators){let t=typeof e.fields==`function`?e.fields():[];for(let e of t)n.add(e)}this._fields=Array.from(n)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){L.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){L.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}};let kn=`[_0-9a-z-*/]`,An=`[a-z]${kn}{0,255}`,jn=`[a-z0-9]${kn}{0,240}@[a-z]${kn}{0,13}`,Mn=RegExp(`^(?:${An}|${jn})$`),Nn=/^[ -~]{0,255}[!-~]$/,Pn=/,|=/;function Fn(e){return Mn.test(e)}function In(e){return Nn.test(e)&&!Pn.test(e)}var Ln=class e{constructor(e){z(this,`_length`,void 0),z(this,`_rawTraceState`,void 0),z(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Fn(e)||!In(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>512)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=`,`+e),e=`${n[0]}=${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(`,`),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(`=`);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Fn(a)||!In(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>512)&&(t.set(a,o),n=s,t.size>=32))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};let Rn=`traceparent`,zn=`tracestate`,Bn=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Vn(e){let t=Bn.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Hn=class{inject(e,t,n){let r=R.getSpanContext(e);if(!r||Mt(e)||!Re(r))return;let i=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||we.NONE).toString(16)}`;n.set(t,Rn,i),r.traceState&&n.set(t,zn,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,Rn);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Vn(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,zn);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Ln(typeof e==`string`?e:void 0)}return R.setSpanContext(e,a)}fields(){return[Rn,zn]}};let Un=Function.prototype.toString,Wn=Un.call(Object),Gn=Object.getPrototypeOf,Kn=Object.prototype,qn=Kn.hasOwnProperty,Jn=Symbol?Symbol.toStringTag:void 0,Yn=Kn.toString;function Xn(e){if(!Zn(e)||Qn(e)!==`[object Object]`)return!1;let t=Gn(e);if(t===null)return!0;let n=qn.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Un.call(n)===Wn}function Zn(e){return typeof e==`object`&&!!e}function Qn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Jn&&Jn in Object(e)?$n(e):er(e)}function $n(e){let t=qn.call(e,Jn),n=e[Jn],r=!1;try{e[Jn]=void 0,r=!0}catch(e){}let i=Yn.call(e);return r&&(t?e[Jn]=n:delete e[Jn]),i}function er(e){return Yn.call(e)}function tr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=rr(t,e.shift(),0,n);return t}function nr(e){return ar(e)?e.slice():e}function rr(e,t,n=0,r){let i;if(!(n>20)){if(n++,cr(e)||cr(t)||or(t))i=nr(t);else if(ar(e)){if(i=e.slice(),ar(t))for(let e=0,n=t.length;e<n;e++)i.push(nr(t[e]));else if(sr(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=nr(t[r]))}}}else if(sr(e))if(sr(t)){if(!lr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(cr(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(ir(e,s,r)||ir(t,s,r))delete i[s];else{if(sr(a)&&sr(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=rr(i[s],c,n,r)}}}}else i=t;return i}}function ir(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function ar(e){return Array.isArray(e)}function or(e){return typeof e==`function`}function sr(e){return!cr(e)&&!ar(e)&&!or(e)&&typeof e==`object`}function cr(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function lr(e,t){return!(!Xn(e)||!Xn(t))}var ur=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function dr(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new ur(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function fr(e,t){return typeof t==`string`?e===t:!!e.match(t)}function pr(e,t){if(!t)return!1;for(let n of t)if(fr(e,n))return!0;return!1}var mr=class{constructor(){z(this,`_promise`,void 0),z(this,`_resolve`,void 0),z(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},hr=class{constructor(e,t){z(this,`_isCalled`,!1),z(this,`_deferred`,new mr),z(this,`_callback`,void 0),z(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function gr(e,t){return new Promise(n=>{I.with(jt(I.active()),()=>{e.export(t,n)})})}let _r={_export:gr},vr;function yr(){if(vr===void 0)try{let e=globalThis.process.argv0;vr=e?`unknown_service:${e}`:`unknown_service`}catch(e){vr=`unknown_service`}return vr}let br=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;function xr(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function B(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){xr(a,r,i,o,s,`next`,e)}function s(e){xr(a,r,i,o,s,`throw`,e)}o(void 0)})}}var Sr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Er(t),r._asyncAttributesPending=t.filter(([e,t])=>br(t)).length>0,r}constructor(e,t){var n;z(this,`_rawAttributes`,void 0),z(this,`_asyncAttributesPending`,!1),z(this,`_schemaUrl`,void 0),z(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(br(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Er(this._rawAttributes),this._schemaUrl=Dr(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return B(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,br(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&L.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(br(n)){L.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]!=null||(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Or(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Cr(e,t){return Sr.FromAttributeList(Object.entries(e),t)}function wr(){return Cr({})}function Tr(){return Cr({[cn]:yr(),[ln]:mn[ln],[un]:mn[un],[dn]:mn[dn]})}function Er(e){return e.map(([e,t])=>br(t)?[e,t.catch(t=>{L.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Dr(e){if(typeof e==`string`||e===void 0)return e;L.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Or(e,t){let n=e==null?void 0:e.schemaUrl,r=t==null?void 0:t.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;L.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var kr=class{constructor(e){var t,n;z(this,`_spanContext`,void 0),z(this,`kind`,void 0),z(this,`parentSpanContext`,void 0),z(this,`attributes`,{}),z(this,`links`,[]),z(this,`events`,[]),z(this,`startTime`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_droppedAttributesCount`,0),z(this,`_droppedEventsCount`,0),z(this,`_droppedLinksCount`,0),z(this,`_attributesCount`,0),z(this,`name`,void 0),z(this,`status`,{code:Ye.UNSET}),z(this,`endTime`,[0,0]),z(this,`_ended`,!1),z(this,`_duration`,[-1,-1]),z(this,`_spanProcessor`,void 0),z(this,`_spanLimits`,void 0),z(this,`_attributeValueLengthLimit`,void 0),z(this,`_recordEndMetrics`,void 0),z(this,`_performanceStartTime`,void 0),z(this,`_performanceOffset`,void 0),z(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=hn.now(),this._performanceOffset=r-(this._performanceStartTime+hn.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=(t=this._spanLimits.attributeValueLengthLimit)==null?0:t,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime((n=e.startTime)==null?r:n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return L.warn(`Invalid attribute key: ${e}`),this;if(!Ut(t))return L.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return L.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&L.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),Tn(t)&&(Tn(n)||(n=t),t=void 0);let i=Vt(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&L.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Vt(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===Ye.UNSET||this.status.code===Ye.OK)return this;let t={code:e.code};return e.code===Ye.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&L.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t;if(this._isSpanEnded()){L.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=xn(this.startTime,this.endTime),this._duration[0]<0&&(L.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&L.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&L.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(t=this._recordEndMetrics)==null||t.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=hn.now())return yn(e+this._performanceOffset);if(typeof e==`number`)return vn(e);if(e instanceof Date)return vn(e.getTime());if(wn(e))return e;if(this._startTimeProvided)return vn(Date.now());let t=hn.now()-this._performanceStartTime;return En(this.startTime,vn(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[$t]=e:e&&(e.code?n[tn]=e.code.toString():e.name&&(n[tn]=e.name),e.message&&(n[$t]=e.message),e.stack&&(n[en]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(`exception`,n,t):L.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);L.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(L.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},Ar;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Ar||(Ar={}));var jr=class{shouldSample(){return{decision:Ar.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Mr=class{shouldSample(){return{decision:Ar.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},Nr=class{constructor(e){var t,n,r,i;z(this,`_root`,void 0),z(this,`_remoteParentSampled`,void 0),z(this,`_remoteParentNotSampled`,void 0),z(this,`_localParentSampled`,void 0),z(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(Xt(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Mr),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Mr:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new jr:n,this._localParentSampled=(r=e.localParentSampled)==null?new Mr:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new jr:i}shouldSample(e,t,n,r,i,a){let o=R.getSpanContext(e);return!o||!Re(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&we.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&we.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Pr=class{constructor(e=0){z(this,`_ratio`,void 0),z(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Ie(t)&&this._accumulate(t)<this._upperBound?Ar.RECORD_AND_SAMPLED:Ar.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},Fr;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Fr||(Fr={}));function Ir(){var e,t,n,r,i,a,o,s;return{sampler:Lr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(e=void 0)==null?1/0:e,attributeCountLimit:(t=void 0)==null?128:t},spanLimits:{attributeValueLengthLimit:(n=void 0)==null?1/0:n,attributeCountLimit:(r=void 0)==null?128:r,linkCountLimit:(i=void 0)==null?128:i,eventCountLimit:(a=void 0)==null?128:a,attributePerEventCountLimit:(o=void 0)==null?128:o,attributePerLinkCountLimit:(s=void 0)==null?128:s}}}function Lr(){var e;let t=(e=void 0)==null?Fr.ParentBasedAlwaysOn:e;switch(t){case Fr.AlwaysOn:return new Mr;case Fr.AlwaysOff:return new jr;case Fr.ParentBasedAlwaysOn:return new Nr({root:new Mr});case Fr.ParentBasedAlwaysOff:return new Nr({root:new jr});case Fr.TraceIdRatio:return new Pr(Rr());case Fr.ParentBasedTraceIdRatio:return new Nr({root:new Pr(Rr())});default:return L.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Fr.ParentBasedAlwaysOn}".`),new Nr({root:new Mr})}}function Rr(){return L.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1}function zr(e){let t={sampler:Lr()},n=Ir(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Br(e){var t,n,r,i,a,o,s,c,l,u,d,f;let p=Object.assign({},e.spanLimits);return p.attributeCountLimit=(t=(n=(r=(i=(a=e.spanLimits)==null?void 0:a.attributeCountLimit)==null?(o=e.generalLimits)==null?void 0:o.attributeCountLimit:i)==null?void 0:r)==null?void 0:n)==null?128:t,p.attributeValueLengthLimit=(s=(c=(l=(u=(d=e.spanLimits)==null?void 0:d.attributeValueLengthLimit)==null?(f=e.generalLimits)==null?void 0:f.attributeValueLengthLimit:u)==null?void 0:l)==null?void 0:c)==null?1/0:s,Object.assign({},e,{spanLimits:p})}var Vr=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_isExporting`,!1),z(this,`_finishedSpans`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_droppedSpansCount`,0),this._exporter=e,this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==`number`?t.maxExportBatchSize:(n=void 0)==null?512:n,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==`number`?t.maxQueueSize:(r=void 0)==null?2048:r,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==`number`?t.scheduledDelayMillis:(i=void 0)==null?5e3:i,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==`number`?t.exportTimeoutMillis:(a=void 0)==null?3e4:a,this._shutdownOnce=new hr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(L.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&we.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&L.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(L.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);I.with(jt(I.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{if(clearTimeout(n),r.code===Dn.SUCCESS)e();else{var i;t((i=r.error)==null?Error(`BatchSpanProcessor: span export failed`):i)}}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a!=null||(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{Xt(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,Xt(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Hr=class extends Vr{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this.onInit(t)}onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{Xt(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Xt(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}};let Ur=new Uint8Array(16),Wr=new Uint8Array(8),Gr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Kr(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function qr(e){let t=``;for(let n=0;n<e.length;n++)t+=Gr[e[n]];return t}var Jr=class{generateTraceId(){return Kr(Ur),qr(Ur)}generateSpanId(){return Kr(Wr),qr(Wr)}};let Yr=`otel.span.sampling_result`;var Xr=class{constructor(e){z(this,`startedSpans`,void 0),z(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(`otel.sdk.span.started`,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(`otel.sdk.span.live`,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Qr(t);if(this.startedSpans.add(1,{"otel.span.parent.origin":Zr(e),[Yr]:n}),t===Ar.NOT_RECORD)return()=>{};let r={[Yr]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Zr(e){return e?e.isRemote?`remote`:`local`:`none`}function Qr(e){switch(e){case Ar.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case Ar.RECORD:return`RECORD_ONLY`;case Ar.NOT_RECORD:return`DROP`}}var $r=class{constructor(e,t,n,r){z(this,`_sampler`,void 0),z(this,`_generalLimits`,void 0),z(this,`_spanLimits`,void 0),z(this,`_idGenerator`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_resource`,void 0),z(this,`_spanProcessor`,void 0),z(this,`_tracerMetrics`,void 0);let i=zr(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Jr,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,`2.7.1`):_e();this._tracerMetrics=new Xr(a)}startSpan(e,t={},n=I.active()){var r,i,a;t.root&&(n=R.deleteSpan(n));let o=R.getSpan(n);if(Mt(n))return L.debug(`Instrumentation suppressed, returning Noop Span`),R.wrapSpanContext(Te);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!R.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?Je.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:Vt(e.attributes)})),m=Vt(t.attributes),h=this._sampler.shouldSample(n,u,e,f,m,p),g=this._tracerMetrics.startSpan(s,h.decision);d=(a=h.traceState)==null?d:a;let _=h.decision===qe.RECORD_AND_SAMPLED?we.SAMPLED:we.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===qe.NOT_RECORD)return L.debug(`Recording is off, propagating context in a non-recording span`),R.wrapSpanContext(v);let y=Vt(Object.assign(m,h.attributes));return new kr({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:v,name:e,kind:f,links:p,parentSpanContext:l,attributes:y,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:g})}startActiveSpan(e,t,n,r){var i;let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=n):(a=t,o=n,s=r);let c=(i=o)==null?I.active():i,l=this.startSpan(e,a,c),u=R.setSpan(c,l);return I.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},ei=class{constructor(e){z(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Xt(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},ti;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(ti||(ti={}));var ni=class{constructor(e={}){var t,n;z(this,`_config`,void 0),z(this,`_tracers`,new Map),z(this,`_resource`,void 0),z(this,`_activeSpanProcessor`,void 0);let r=tr({},Ir(),Br(e));this._resource=(t=r.resource)==null?Tr():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new ei(i)}getTracer(e,t,n){let r=`${e}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._tracers.has(r)||this._tracers.set(r,new $r({name:e,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=ti.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==ti.timeout&&(r=ti.resolved,n(r))}).catch(e=>{clearTimeout(i),r=ti.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==ti.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},ri=class{constructor(){z(this,`_enabled`,!1),z(this,`_currentContext`,k)}_bindFunction(e=k,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=k,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=k,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||k;try{return t.call(n,...r)}finally{this._currentContext=i}}};function ii(e){if(e!==null){if(e===void 0){let e=new ri;e.enable(),I.setGlobalContextManager(e);return}e.enable(),I.setGlobalContextManager(e)}}function ai(e){if(e!==null){if(e===void 0){st.setGlobalPropagator(new On({propagators:[new Hn,new Lt]}));return}st.setGlobalPropagator(e)}}var oi=class extends ni{constructor(e={}){super(e)}register(e={}){R.setGlobalTracerProvider(this),ai(e.propagator),ii(e.contextManager)}},V;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(V||(V={}));let si;function ci(){return si||(si=document.createElement(`a`)),si}function li(e,t){return t in e}function ui(e,t,n,r=!0){if(li(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function di(e,t,n=!1,r,i){if(r===void 0&&(r=t[V.START_TIME]!==0),n||(ui(e,V.FETCH_START,t,r),ui(e,V.DOMAIN_LOOKUP_START,t,r),ui(e,V.DOMAIN_LOOKUP_END,t,r),ui(e,V.CONNECT_START,t,r),ui(e,V.SECURE_CONNECTION_START,t,r),ui(e,V.CONNECT_END,t,r),ui(e,V.REQUEST_START,t,r),ui(e,V.RESPONSE_START,t,r),ui(e,V.RESPONSE_END,t,r)),!i){let n=t[V.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(`http.response_content_length`,n);let r=t[V.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(`http.response_content_length_uncompressed`,r)}}function fi(e){return e.slice().sort((e,t)=>{let n=e[V.FETCH_START],r=t[V.FETCH_START];return n>r?1:n<r?-1:0})}function pi(){return typeof location<`u`?location.origin:void 0}function mi(e,t,n,r,i=new WeakSet,a){let o=_i(e);e=o.toString();let s=gi(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=fi(s);if(o.origin!==pi()&&c.length>1){let e=c[0],t=hi(c,e[V.RESPONSE_END],n),r=e[V.RESPONSE_END];return t[V.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function hi(e,t,n){let r=Sn(n),i=Sn(bn(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=Sn(bn(n[V.FETCH_START])),c=r-Sn(bn(n[V.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function gi(e,t,n,r,i,a){let o=Sn(t),s=Sn(n),c=r.filter(t=>{let n=Sn(bn(t[V.FETCH_START])),r=Sn(bn(t[V.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function _i(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ci();return t.href=e,t}function vi(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),_i(e).origin===pi()?!0:n.some(t=>fr(e,t))}let yi=`mxl_pending_`;var bi=class{constructor({resource:e=wr(),storage:t=window.localStorage,diag:n=L.createComponentLogger({namespace:`MXLSpanStorage`}),storedSpansExpireTimeoutMS:r=3600*1e3,onExpiredSpansExport:i,spanSessionManager:a}){z(this,`_noExportTracer`,void 0),z(this,`_storage`,void 0),z(this,`_diag`,void 0),z(this,`_onExpiredSpansExport`,void 0),z(this,`_storedSpansExpireTimeoutMS`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_checkExpiredSpansInterval`,void 0),this._noExportTracer=new ni({resource:e}).getTracer(`mxl-web-sdk-sessions`),this._storage=t,this._diag=n,this._storedSpansExpireTimeoutMS=r,this._onExpiredSpansExport=i,this._spanSessionManager=a,this.startExpiredSpansCheck()}storePendingSpans(e,t,n){try{if(this.clearStoredSpans(e),this._getPendingSpansKeys().length>=10){this._spanSessionManager.incrSessionCountForKey(`mxl.max_pending_spans_reached`),this._diag.warn(`Not storing pending spans as the max number of items was reached`);return}let r=`${yi}${e}_${Date.now()}`;this._storage.setItem(r,JSON.stringify([t,...n],(e,t)=>e.startsWith(`_`)?void 0:t)),this._diag.debug(`Stored pending span: ${r}`)}catch(e){this._diag.error(`Failed to store spans to storage:`,e)}}clearStoredSpans(e){try{let t=`${yi}${e}_`;this._getPendingSpansKeys().forEach(e=>{e.startsWith(t)&&this._storage.removeItem(e)})}catch(e){this._diag.error(`Failed to clear stored spans from storage:`,e)}}startExpiredSpansCheck(){this._checkExpiredSpansInterval=setInterval(()=>{this.checkAndExportExpiredSpans()},300*1e3)}stopExpiredSpansCheck(){this._checkExpiredSpansInterval&&(clearInterval(this._checkExpiredSpansInterval),this._checkExpiredSpansInterval=void 0)}checkAndExportExpiredSpans(){try{let e=this._getPendingSpansKeys();if(e.length===0)return;let t=Date.now();e.forEach(e=>{let n=e.split(`_`),r=parseInt(n[n.length-1],10);if(Number.isNaN(r)&&(this._diag.error(`Found invalid timestamp in stored span:`,r),this._storage.removeItem(e)),t-r<=this._storedSpansExpireTimeoutMS)return;let i=this._storage.getItem(e);if(i){try{let e=[];for(let t of JSON.parse(i)){let n=this._noExportTracer.startSpan(t.name,{kind:t.kind,attributes:t.attributes,links:t.links,startTime:t.startTime});n.setStatus(t.status),n.end(t.endTime),e.push(n)}this._onExpiredSpansExport&&e.length>0&&this._onExpiredSpansExport(e)}catch(e){this._diag.error(`Failed to process expired spans:`,e)}this._storage.removeItem(e)}})}catch(e){this._diag.error(`Failed to check and export expired spans:`,e)}}_getPendingSpansKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(yi)&&e.push(n)}return e}destroy(){this.stopExpiredSpansCheck()}},xi=class{constructor(e,t){z(this,`_keyPrefix`,void 0),z(this,`_storage`,void 0),this._keyPrefix=`${e}_`,this._storage=t}getNamespacedKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(this._keyPrefix)&&e.push(n.substring(this._keyPrefix.length))}return e}get length(){return this.getNamespacedKeys().length}clear(){this.getNamespacedKeys().forEach(e=>{this._storage.removeItem(`${this._keyPrefix}${e}`)})}getItem(e){return this._storage.getItem(`${this._keyPrefix}${e}`)}key(e){return this.getNamespacedKeys()[e]||null}removeItem(e){this._storage.removeItem(`${this._keyPrefix}${e}`)}setItem(e,t){this._storage.setItem(`${this._keyPrefix}${e}`,t)}getStorageEventKey(e){return`${this._keyPrefix}${e}`}};let Si=({diag:e,featureManager:t,registerGlobally:n,propagator:r,defaultInstrumentationConfig:i})=>{var a;if(!t.isNetworkSpanForwardingEnabled())return!1;let o=[];return n||o.push("Network span forwarding cannot be used when `registerGlobally` is set to false. Turning off network span forwarding."),r&&o.push("Network span forwarding cannot be used alongside a custom `propagator`. Turning off network span forwarding."),!(i==null||(a=i.omit)==null)&&a.has(`@opentelemetry/instrumentation-xml-http-request`)&&i.omit.has(`@opentelemetry/instrumentation-fetch`)&&o.push(`Network span forwarding cannot be used when both '@opentelemetry/instrumentation-xml-http-request' and '@opentelemetry/instrumentation-fetch' are omitted. Turning off network span forwarding.`),o.forEach(t=>{e.warn(t)}),o.length===0};var Ci=class{constructor(e=window.performance){z(this,`_clock`,void 0),z(this,`epochMillisFromOriginOffset`,e=>this._clock.timeOrigin+e),z(this,`getNowHRTime`,()=>vn(this.getNowMillis())),z(this,`getNowMillis`,()=>this.epochMillisFromOriginOffset(this._clock.now())),z(this,`millisSinceHRTime`,e=>this.getNowMillis()-Cn(e)),z(this,`millisFromZeroTime`,e=>e),this._clock=e}};function wi(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Ti(e,t){if(e==null)return{};var n,r,i=wi(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ei(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let Di=[`diag`];function Oi(e){var t,n;return typeof PerformanceObserver<`u`&&((t=(n=PerformanceObserver.supportedEntryTypes)==null?void 0:n.includes(e))==null?!1:t)}function ki(e,t,n){let r=n==null?{}:n,{diag:i}=r,a=Ti(r,Di);if(!Oi(e))return i==null||i.debug(`${e} not supported, skipping observer`),null;try{let n=new PerformanceObserver(n=>{for(let r of n.getEntries())try{t(r)}catch(t){i==null||i.error(`error processing ${e} entry`,t)}});return n.observe(H({type:e,buffered:!0},a)),n}catch(e){return null}}let Ai=(e,t=1e3)=>{let n=!1;return(...r)=>{n||(e(...r),setTimeout(()=>{n=!1},t),n=!0)}};var ji=class{logException(e,t){}message(e,t,n){}};let Mi=new ji;var Ni=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Mi:e}setDelegate(e){this._delegate=e}logException(e,t){this.getDelegate().logException(e,t)}message(e,t,n){this.getDelegate().message(e,t,n)}};let Pi=new ji,Fi=new Set([`setDelegate`,`getDelegate`]);var Ii=class e{static getInstance(){if(!e._instance){let t=new Ni,n=dt(t,Pi,L.createComponentLogger({namespace:`LogAPI`}),Fi);e._instance=Object.assign(n,{setGlobalLogManager(e){t.setDelegate(e)},getLogManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Ii,`_instance`,void 0);let Li=Ii.getInstance();var Ri=class{setCurrentRoute(e){}getCurrentRoute(){return null}getCurrentPageId(){return``}setPageLabel(e){}getPageLabel(){return null}clearCurrentRoute(){}};let zi=new Ri;var Bi=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?zi:e}setDelegate(e){this._delegate=e}setCurrentRoute(e){this.getDelegate().setCurrentRoute(e)}getCurrentRoute(){return this.getDelegate().getCurrentRoute()}getCurrentPageId(){return this.getDelegate().getCurrentPageId()}setPageLabel(e){this.getDelegate().setPageLabel(e)}getPageLabel(){return this.getDelegate().getPageLabel()}clearCurrentRoute(){this.getDelegate().clearCurrentRoute()}};let Vi=new Ri,Hi=new Set([`setDelegate`,`getDelegate`]);var Ui=class e{static getInstance(){if(!e._instance){let t=new Bi,n=dt(t,Vi,L.createComponentLogger({namespace:`PageAPI`}),Hi);e._instance=Object.assign(n,{setGlobalPageManager(e){t.setDelegate(e)},getPageManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Ui,`_instance`,void 0);let Wi=Ui.getInstance();var Gi=class{constructor(){z(this,`getSessionId`,()=>null),z(this,`getPreviousSessionId`,()=>null)}addBreadcrumb(e){}addProperty(e,t,n){}removeProperty(e){}endSessionSpan(){}endSessionSpanInternal(e){}currentSessionAsReadableSpan(e){return null}getSessionSpan(){return null}getSessionStartTime(){return null}startSessionSpan(){}addSessionStartedListener(e){return()=>{}}addSessionEndedListener(e){return()=>{}}};let Ki=new Gi;var qi=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Ki:e}setDelegate(e){this._delegate=e}addBreadcrumb(e){this.getDelegate().addBreadcrumb(e)}addProperty(e,t,n){this.getDelegate().addProperty(e,t,n)}removeProperty(e){this.getDelegate().removeProperty(e)}endSessionSpan(){this.getDelegate().endSessionSpan()}endSessionSpanInternal(e){this.getDelegate().endSessionSpanInternal(e)}currentSessionAsReadableSpan(e){return this.getDelegate().currentSessionAsReadableSpan(e)}getSessionId(){return this.getDelegate().getSessionId()}getPreviousSessionId(){return this.getDelegate().getPreviousSessionId()}getSessionSpan(){return this.getDelegate().getSessionSpan()}getSessionStartTime(){return this.getDelegate().getSessionStartTime()}startSessionSpan(e){this.getDelegate().startSessionSpan(e)}addSessionStartedListener(e){return this.getDelegate().addSessionStartedListener(e)}addSessionEndedListener(e){return this.getDelegate().addSessionEndedListener(e)}};let Ji=new Gi,Yi=new Set([`setDelegate`,`getDelegate`]);var Xi=class e{static getInstance(){if(!e._instance){let t=new qi,n=dt(t,Ji,L.createComponentLogger({namespace:`SessionAPI`}),Yi);e._instance=Object.assign(n,{setGlobalSessionManager(e){t.setDelegate(e)},getSpanSessionManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Xi,`_instance`,void 0);let Zi=Xi.getInstance();var Qi=class{constructor(e=Te){z(this,`_spanContext`,void 0),z(this,`attributes`,{}),this._spanContext=e}fail(e){}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}removeAttribute(e){return this}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},$i=class{startSpan(e,t){return new Qi}setSpan(e,t){return k}getSpan(e){}};let ea=new $i;var ta=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?ea:e}setDelegate(e){this._delegate=e}startSpan(e,t,n){return this.getDelegate().startSpan(e,t,n)}setSpan(e,t){return this.getDelegate().setSpan(e,t)}getSpan(e){return this.getDelegate().getSpan(e)}};let na=new $i,ra=new Set([`setDelegate`,`getDelegate`]);var ia=class e{static getInstance(){if(!e._instance){let t=new ta,n=dt(t,na,L.createComponentLogger({namespace:`TraceAPI`}),ra);e._instance=Object.assign(n,{setGlobalTraceManager(e){t.setDelegate(e)},getTraceManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(ia,`_instance`,void 0);let aa=ia.getInstance();var oa=class{getMXLUserId(){return``}getUserId(){return null}setUserId(){}clearUserId(){}};let sa=new oa;var ca=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?sa:e}setDelegate(e){this._delegate=e}getMXLUserId(){return this.getDelegate().getMXLUserId()}getUserId(){return this.getDelegate().getUserId()}setUserId(e){this.getDelegate().setUserId(e)}clearUserId(){this.getDelegate().clearUserId()}};let la=new oa,ua=new Set([`setDelegate`,`getDelegate`]);var da=class e{static getInstance(){if(!e._instance){let t=new ca,n=dt(t,la,L.createComponentLogger({namespace:`UserAPI`}),ua);e._instance=Object.assign(n,{setGlobalUserManager(e){t.setDelegate(e)},getUserManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(da,`_instance`,void 0);let fa=da.getInstance(),pa={pageLabel:Tt};var ma=class{emit(e){}enabled(){return!1}};let ha=new ma,ga=Symbol.for(`io.opentelemetry.js.api.logs`),_a=globalThis;function va(e,t,n){return r=>r===e?t:n}let ya=new class{getLogger(e,t,n){return new ma}};var ba=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ha}},xa=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new ba(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?ya:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Sa=class e{constructor(){this._proxyLoggerProvider=new xa}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return _a[ga]?this.getLoggerProvider():(_a[ga]=va(1,e,ya),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=_a[ga])==null?void 0:e.call(_a,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete _a[ga],this._proxyLoggerProvider=new xa}}.getInstance();function Ca(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function wa(e){e.forEach(e=>e.disable())}function Ta(e){var t,n;let r=e.tracerProvider||R.getTracerProvider(),i=e.meterProvider||Qe.getMeterProvider(),a=e.loggerProvider||Sa.getLoggerProvider(),o=(t=(n=e.instrumentations)==null?void 0:n.flat())==null?[]:t;return Ca(o,r,i,a),()=>{wa(o)}}let Ea=console.error.bind(console);function Da(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}let Oa=(e,t,n)=>{if(!e||!e[t]){Ea(`no original function `+String(t)+` to wrap`);return}if(!n){Ea(`no wrapper function`),Ea(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){Ea(`original object and wrapper must be functions`);return}let i=n(r,t);return Da(i,`__original`,r),Da(i,`__unwrap`,()=>{e[t]===i&&Da(e,t,r)}),Da(i,`__wrapped`,!0),Da(e,t,i),i},ka=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Oa(e,t,n)})})},Aa=(e,t)=>{if(!e||!e[t]){Ea(`no function to unwrap.`),Ea(Error().stack);return}let n=e[t];if(!n.__unwrap)Ea(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},ja=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Aa(e,t)})})};function Ma(e){e&&e.logger&&(typeof e.logger==`function`?Ea=e.logger:Ea(`new logger isn't a function, not replacing`))}Ma.wrap=Oa,Ma.massWrap=ka,Ma.unwrap=Aa,Ma.massUnwrap=ja;var Na=class{constructor(e,t,n){z(this,`_config`,{}),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),z(this,`_diag`,void 0),z(this,`instrumentationName`,void 0),z(this,`instrumentationVersion`,void 0),z(this,`_wrap`,Oa),z(this,`_unwrap`,Aa),z(this,`_massWrap`,ka),z(this,`_massUnwrap`,ja),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=L.createComponentLogger({namespace:e}),this._tracer=R.getTracer(e,t),this._meter=Qe.getMeter(e,t),this._logger=Sa.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=H({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Pa=class extends Na{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function Fa(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}var U;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(U||(U={}));function Ia(e,t){let n=U.OLD,r=t==null?void 0:t.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r==null?[]:r)if(t.toLowerCase()===e+`/dup`){n=U.DUPLICATE;break}else t.toLowerCase()===e&&(n=U.STABLE);return n}let La=`session.id`,Ra=`user.id`;var za;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(za||(za={}));var Ba=class{emit(e){}enabled(){return!1}};let Va=new Ba,Ha=Symbol.for(`io.opentelemetry.js.api.logs`),Ua=globalThis;function Wa(e,t,n){return r=>r===e?t:n}let Ga=new class{getLogger(e,t,n){return new Ba}};var Ka=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Va}},qa=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new Ka(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?Ga:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Ja=class e{constructor(){this._proxyLoggerProvider=new qa}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return Ua[Ha]?this.getLoggerProvider():(Ua[Ha]=Wa(1,e,Ga),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ua[Ha])==null?void 0:e.call(Ua,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete Ua[Ha],this._proxyLoggerProvider=new qa}}.getInstance();var Ya=class{constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,z(this,`_config`,{}),z(this,`_diag`,void 0),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),this.setConfig(n),this._diag=L.createComponentLogger({namespace:e}),this._tracer=R.getTracer(e,t),this._meter=Qe.getMeter(e,t),this._logger=Ja.getLogger(e,t),this._updateMetricInstruments()}get tracer(){return this._tracer}get meter(){return this._meter}get logger(){return this._logger}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}getConfig(){return this._config}setConfig(e){this._config=H({enabled:!0},e)}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}_updateMetricInstruments(){}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Xa=class extends Ya{constructor({instrumentationName:e,instrumentationVersion:t,config:n,diag:r,perf:i,limitManager:a}){super(e,t,n),z(this,`_sessionManager`,void 0),z(this,`_logManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_perf`,void 0),r&&(this._diag=r),this._perf=i==null?new Ci:i,this._sessionManager=Zi.getSpanSessionManager(),this._logManager=Li.getLogManager(),this._limitManager=a}get limitManager(){return this._limitManager}get sessionManager(){return this._sessionManager}get logManager(){return this._logManager}get perf(){return this._perf}init(){}setLimitManager(e){this._limitManager=e}setLogManager(e){this._logManager=e}setSessionManager(e){this._sessionManager=e}};let Za=()=>{let e={},t=window.performance.getEntriesByType(`navigation`)[0];return Object.values(V).forEach(n=>{if(li(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}}),e},Qa={"first-paint":`firstPaint`,"first-contentful-paint":`firstContentfulPaint`},$a=e=>{window.performance.getEntriesByType(`paint`).forEach(({name:t,startTime:n})=>{li(Qa,t)&&e.addEvent(Qa[t],n)})};var eo=class extends Xa{constructor({diag:e,perf:t,enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i=!1,ignoreNetworkEvents:a=!1}={}){super({instrumentationName:`DocumentLoadInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i,ignoreNetworkEvents:a}}),z(this,`_onDocumentLoaded`,void 0),z(this,`_performanceCollected`,!1),this._onDocumentLoaded=()=>{window.setTimeout(()=>{this._collectPerformance()},0)},this._config.enabled&&this.enable()}init(){this._diag.debug(`Initializing document load instrumentation`)}_addResourcesSpans(e){performance.getEntriesByType(`resource`).forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){if(this._performanceCollected)return;this._performanceCollected=!0;let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===Rn),t=Za(),n=(e==null?void 0:e.content)||``;I.with(st.extract(k,{traceparent:n}),()=>{var e;let n=this._startSpan(`documentLoad`,V.FETCH_START,t);n&&(I.with(R.setSpan(I.active(),n),()=>{let e=this._startSpan(`documentFetch`,V.FETCH_START,t);e&&(e.setAttribute(fn,location.href),I.with(R.setSpan(I.active(),e),()=>{var n;di(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.documentFetch),this._endSpan(e,V.RESPONSE_END,t)}))}),n.setAttribute(_t,`ux.document_load`),n.setAttribute(fn,location.href),n.setAttribute(pn,navigator.userAgent),this._addResourcesSpans(n),this.getConfig().ignoreNetworkEvents||(ui(n,V.FETCH_START,t),ui(n,V.UNLOAD_EVENT_START,t),ui(n,V.UNLOAD_EVENT_END,t),ui(n,V.DOM_INTERACTIVE,t),ui(n,V.DOM_CONTENT_LOADED_EVENT_START,t),ui(n,V.DOM_CONTENT_LOADED_EVENT_END,t),ui(n,V.DOM_COMPLETE,t),ui(n,V.LOAD_EVENT_START,t),ui(n,V.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||$a(n),this._addCustomAttributesOnSpan(n,(e=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:e.documentLoad),this._endSpan(n,V.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(li(n,t)&&typeof n[t]==`number`?e.end(n[t]):e.end())}_initResourceSpan(e,t){var n;let r=this._startSpan(`resourceFetch`,V.FETCH_START,e,t);r&&(r.setAttribute(_t,`ux.resource_fetch`),r.setAttribute(fn,e.name),di(r,e,this.getConfig().ignoreNetworkEvents),e.deliveryType&&r.setAttribute(`http.response.delivery_type`,e.deliveryType),e.initiatorType&&r.setAttribute(`http.request.initiator_type`,e.initiatorType),e.renderBlockingStatus&&r.setAttribute(`http.request.render_blocking_status`,e.renderBlockingStatus),e.responseStatus&&r.setAttribute(an,e.responseStatus),typeof e.encodedBodySize==`number`&&e.encodedBodySize>=0&&r.setAttribute(`http.response.body.size`,e.encodedBodySize),typeof e.transferSize==`number`&&e.transferSize>=0&&r.setAttribute(`http.response.size`,e.transferSize),typeof e.decodedBodySize==`number`&&e.decodedBodySize>=0&&r.setAttribute(`http.response.decoded_body_size`,e.decodedBodySize),this._addResourceDiagnosticAttributes(r,e),this._addCustomAttributesOnResourceSpan(r,e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.resourceFetch),this._endSpan(r,V.RESPONSE_END,e))}_startSpan(e,t,n,r){if(li(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?R.setSpan(I.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():window.addEventListener(`load`,this._onDocumentLoaded)}_addCustomAttributesOnSpan(e,t){t&&Fa(()=>{t(e)},e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&Fa(()=>{n(e,t)},e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}_hasNoSizeData(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.decodedBodySize==`number`?e.decodedBodySize:0,r=typeof e.encodedBodySize==`number`?e.encodedBodySize:0;return t===0&&n===0&&r===0}_hasTimingData(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return t>0&&n>0}_isCorsRestricted(e){return this._hasNoSizeData(e)&&this._hasTimingData(e)}_isFetchIncomplete(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return this._hasNoSizeData(e)&&t>0&&n===0}_isFetchPrevented(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0;return this._hasNoSizeData(e)&&t===0}_isCacheValidated(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.deliveryType==`string`?e.deliveryType:``;return t===300&&n!==`cache`}_addResourceDiagnosticAttributes(e,t){this._isCorsRestricted(t)?e.setAttribute(`http.response.cors_opaque`,!0):this._isFetchIncomplete(t)?e.setAttribute(`http.request.incomplete`,!0):this._isFetchPrevented(t)&&e.setAttribute(`http.request.prevented`,!0),this._isCacheValidated(t)&&e.setAttribute(`http.response.cache_revalidated`,!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},to=class extends Xa{constructor({diag:e,perf:t,rootNode:n,emptyCheckDelayMs:r=500}){super({instrumentationName:`EmptyRootInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,void 0),z(this,`_emptyCheckDelayMs`,void 0),z(this,`_rootNode`,void 0),this._rootNode=n,this._emptyCheckDelayMs=r,this._observer=new MutationObserver((e,t)=>{this._observerCallback(e)}),this._config.enabled&&this._rootNode?this.enable():this._rootNode||this._diag.warn(`supplied root node was null, this instrumentation won't be enabled`)}disable(){this._observer.disconnect()}enable(){this._rootNode&&this._observer.observe(this._rootNode,{childList:!0})}_observerCallback(e){let t=!1,n=!1;for(let r of e)r.target===this._rootNode&&(r.removedNodes.length>0&&(t=!0),r.addedNodes.length>0&&(n=!0));t&&!n&&(this._diag.debug(`root node had child nodes removed without new ones being added, checking if it's empty in ${this._emptyCheckDelayMs}ms`),window.setTimeout(()=>{this._checkForEmptyRootNode()},this._emptyCheckDelayMs))}_checkForEmptyRootNode(){var e;if(((e=this._rootNode)==null?void 0:e.childNodes.length)===0){this._diag.debug(`root node was found to be empty`);let e=this.sessionManager.getSessionSpan();e?e.addEvent(`empty-root-node`,{"mxl.type":`ux.empty_root_node`}):this._diag.debug(`no active session found to emit event on`)}}};let no=(e,t)=>{let n=e.nodeName.toLowerCase(),r=t.substring(0,30),i=t.length>30?`...`:``;return`<${n}${e.className?` class="${e.className}"`:``}>${r}${i}</${n}>`};var ro=class extends Xa{constructor({diag:e,perf:t,shouldTrack:n,innerTextForElement:r}={}){super({instrumentationName:`ClicksInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onClickHandler`,void 0),this._onClickHandler=e=>{let t=e.target;if(t instanceof HTMLElement&&!t.hasAttribute(`disabled`)&&!(n&&!n(t)))try{let n=this.sessionManager.getSessionSpan();n&&n.addEvent(`click`,{"mxl.type":`ux.tap`,"view.name":no(t,r?r(t):t.innerText),"tap.coords":`${e.x.toString()},${e.y.toString()}`},this.perf.epochMillisFromOriginOffset(e.timeStamp))}catch(e){this._diag.error(`failed to create new user interaction span event`,e)}},this._config.enabled&&this.enable()}disable(){document.removeEventListener(`click`,this._onClickHandler)}enable(){document.addEventListener(`click`,this._onClickHandler)}},io=class extends Xa{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ElementTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_observer`,null),z(this,`_isEnabled`,!1),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Oi(`element`)){this._diag.debug(`element not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=ki(`element`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}}}disable(){this._isEnabled=!1,this._observer&&(this._observer.disconnect(),this._observer=null)}_processEntry(e){var t,n;if(!this._isEnabled||(t=this.limitManager)!=null&&t.limitElementTimingEntry())return;let r=this.tracer.startSpan(e.identifier,{startTime:this.perf.epochMillisFromOriginOffset(0),attributes:{[_t]:`ux.element_timing`,"mxl.element_timing.identifier":e.identifier,"mxl.element_timing.element":(n=e.element)==null||(n=n.tagName)==null?void 0:n.toLowerCase(),"mxl.element_timing.render_time":e.renderTime,"mxl.element_timing.load_time":e.loadTime,"mxl.element_timing.start_time":e.startTime,"mxl.element_timing.url":e.url,"mxl.element_timing.natural_width":e.naturalWidth,"mxl.element_timing.natural_height":e.naturalHeight}});e.loadTime>0&&r.addEvent(`load`,this.perf.epochMillisFromOriginOffset(e.loadTime)),r.end(this.perf.epochMillisFromOriginOffset(e.startTime))}},ao=class extends Xa{constructor({diag:e,perf:t}={}){super({instrumentationName:`GlobalExceptionInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onErrorHandler`,void 0),z(this,`_onUnhandledRejectionHandler`,void 0),this._onErrorHandler=e=>{this.logManager.logException(e.error||e.message,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`global_exception`})},this._onUnhandledRejectionHandler=e=>{this.logManager.logException(e.reason,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`promise_rejection`})},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`error`,this._onErrorHandler),window.removeEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}enable(){window.addEventListener(`error`,this._onErrorHandler),window.addEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}},oo=class extends Xa{constructor({diag:e,perf:t}={}){super({instrumentationName:`LoafInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,null),z(this,`_isFirstEntry`,!0),z(this,`_removeSessionEndListener`,null),z(this,`_isEnabled`,!1),z(this,`_totalDuration`,0),z(this,`_workDuration`,0),z(this,`_styleLayoutDuration`,0),z(this,`_count`,0),z(this,`_longestDuration`,0),z(this,`_longestDurationExcludingFirst`,0),z(this,`_totalBlockingDuration`,0),z(this,`_scriptSummaries`,new Map),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Oi(`long-animation-frame`)){this._diag.debug(`long-animation-frame not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=ki(`long-animation-frame`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}this._registerSessionEndListener()}}_registerSessionEndListener(){this._isEnabled&&(this._removeSessionEndListener&&this._removeSessionEndListener(),this._removeSessionEndListener=this.sessionManager.addSessionEndedListener(()=>{try{this._flushReport()}catch(e){this._diag.error(`error flushing report`,e)}}))}setSessionManager(e){super.setSessionManager(e),this._registerSessionEndListener()}disable(){this._isEnabled=!1,this._resetAccumulators(),this._observer&&(this._observer.disconnect(),this._observer=null),this._removeSessionEndListener&&(this._removeSessionEndListener(),this._removeSessionEndListener=null)}_processEntry(e){if(this._isEnabled){this._count++,this._totalDuration+=e.duration,this._workDuration+=e.renderStart?e.renderStart-e.startTime:e.duration,e.styleAndLayoutStart&&(this._styleLayoutDuration+=Math.max(0,e.startTime+e.duration-e.styleAndLayoutStart)),this._longestDuration=Math.max(this._longestDuration,e.duration),this._isFirstEntry&&this._count===1?this._isFirstEntry=!1:(this._longestDurationExcludingFirst=Math.max(this._longestDurationExcludingFirst,e.duration),e.firstUIEventTimestamp===0&&(this._totalBlockingDuration+=e.blockingDuration));try{for(let t of e.scripts){let e=t.sourceURL||`(inline)`;e.length>2048&&(e=`${e.substring(0,2048)}...`);let n=this._scriptSummaries.get(e);n?(n.totalDuration+=t.duration,n.styleAndLayoutDuration+=t.forcedStyleAndLayoutDuration,n.count++):this._scriptSummaries.set(e,{totalDuration:t.duration,styleAndLayoutDuration:t.forcedStyleAndLayoutDuration,count:1})}}catch(e){this._diag.error(`error processing scripts for entry`,e)}}}_flushReport(){if(this._count===0)return;let e;e=this._totalBlockingDuration<=200?`good`:this._totalBlockingDuration<=600?`needs-improvement`:`poor`;let t={[_t]:`ux.web_vital`,"mxl.web_vital.id":ht(),"mxl.web_vital.name":`TBD`,"mxl.web_vital.value":Math.round(this._totalBlockingDuration),"mxl.web_vital.rating":e,"mxl.tbd.loaf_total_duration":Math.round(this._totalDuration),"mxl.tbd.loaf_work_duration":Math.round(this._workDuration),"mxl.tbd.loaf_style_and_layout_duration":Math.round(this._styleLayoutDuration),"mxl.tbd.loaf_count":this._count,"mxl.tbd.loaf_longest_duration":Math.round(this._longestDuration),"mxl.tbd.loaf_longest_duration_excluding_first":Math.round(this._longestDurationExcludingFirst)};try{this.logger.emit({eventName:`mxl-loaf-report`,severityNumber:za.INFO,attributes:t})}catch(e){this._diag.error(`error emitting loaf report`,e)}try{if(this._scriptSummaries.size>0){let e=[...this._scriptSummaries].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]);this.logger.emit({eventName:`mxl-loaf-scripts`,severityNumber:za.INFO,body:JSON.stringify(Object.fromEntries(e)),attributes:{[_t]:`ux.loaf_scripts`}})}}catch(e){this._diag.error(`error emitting loaf script summary`,e)}this._resetAccumulators()}_resetAccumulators(){this._totalDuration=0,this._workDuration=0,this._styleLayoutDuration=0,this._count=0,this._longestDuration=0,this._longestDurationExcludingFirst=0,this._totalBlockingDuration=0,this._scriptSummaries=new Map}};let so=/\([^()]+\)/g;var co=class extends Xa{constructor({diag:e,shouldCleanupPathOptionsFromRouteName:t=!0}){super({instrumentationName:`NavigationInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_shouldCleanupPathOptionsFromRouteName`,!0),z(this,`_currentRouteSpan`,null),z(this,`_instrumentationType`,`manual`),z(this,`_removeSessionStartedFn`,null),z(this,`_removeSessionEndedFn`,null),z(this,`setInstrumentationType`,e=>{this._instrumentationType=e}),z(this,`setCurrentRoute`,e=>{if(!this._config.enabled)return;let t=Wi.getCurrentRoute();e.url!==(t==null?void 0:t.url)&&(Wi.setCurrentRoute(e),this._endRouteSpan(t),this._startRouteSpan(e))}),z(this,`_setupSessionListeners`,()=>{this._removeSessionStartedFn||(this._removeSessionStartedFn=this.sessionManager.addSessionStartedListener(()=>{let e=Wi.getCurrentRoute();e&&!this._currentRouteSpan&&(this._diag.debug(`Session started, starting route span.`),this._startRouteSpan(e))})),this._removeSessionEndedFn||(this._removeSessionEndedFn=this.sessionManager.addSessionEndedListener(()=>{this._currentRouteSpan&&(this._diag.debug(`Session ended, ending route span.`),this._endRouteSpan(Wi.getCurrentRoute()))}))}),z(this,`_cleanUpSessionListeners`,()=>{this._removeSessionStartedFn&&(this._removeSessionStartedFn(),this._removeSessionStartedFn=null),this._removeSessionEndedFn&&(this._removeSessionEndedFn(),this._removeSessionEndedFn=null)}),z(this,`_startRouteSpan`,e=>{this._diag.debug(`Starting route span for url: ${e.url}`),this._setupSessionListeners();let t=this._shouldCleanupPathOptionsFromRouteName?e.path.replace(so,``):e.path;return this._currentRouteSpan=this.tracer.startSpan(t,{attributes:{[_t]:`ux.surface`,[Ct]:t,[wt]:Wi.getCurrentPageId()||void 0}}),this._currentRouteSpan.setAttribute(bt,this._instrumentationType),this._currentRouteSpan}),z(this,`_endRouteSpan`,e=>{this._currentRouteSpan&&(e&&this._diag.debug(`Ending route span for url: ${e.url}`),this._currentRouteSpan.end(),this._currentRouteSpan=null)}),z(this,`enable`,()=>{this.setConfig({enabled:!0}),this._diag.debug(`NavigationInstrumentation enabled, listening for navigation events.`)}),z(this,`disable`,()=>{this._cleanUpSessionListeners(),this.setConfig({enabled:!1}),this._diag.debug(`NavigationInstrumentation disabled, stopped listening for navigation events.`)}),this._shouldCleanupPathOptionsFromRouteName=t,this._config.enabled&&this.enable()}};let lo,uo=(e={})=>(lo||(lo=new co(e)),lo);var fo=class extends Xa{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ServerTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_onLoad`,void 0),z(this,`_performanceCollected`,!1),this._onLoad=()=>{this._readServerTiming()},this._config.enabled&&this.enable()}enable(){if(window.removeEventListener(`load`,this._onLoad),window.document.readyState===`complete`){this._readServerTiming();return}window.addEventListener(`load`,this._onLoad)}disable(){window.removeEventListener(`load`,this._onLoad)}_readServerTiming(){var e;if(this._performanceCollected)return;this._performanceCollected=!0;let t=(e=performance.getEntriesByType(`navigation`)[0])==null?void 0:e.serverTiming;if(t!=null&&t.length)for(let e of t){var n;if((n=this.limitManager)!=null&&n.limitServerTimingEntry())return;this.logger.emit({eventName:`mxl-server-timing`,severityNumber:za.INFO,attributes:{[_t]:`ux.server_timing`,"mxl.server_timing.name":e.name,"mxl.server_timing.duration":e.duration,"mxl.server_timing.description":e.description}})}}};let po=`0.0.15`,mo=`mxl_app_instance_id`,ho=(e,t)=>{let n=null;try{n=e.getItem(mo)}catch(e){t.warn(`Failed to retrieve app instance ID from session storage`,e)}if(!n){t.debug(`No existing app instance ID found in session storage, creating a new one`),n=mt();try{e.setItem(mo,n)}catch(e){t.warn(`Failed to persist app instance ID to session storage`,e)}}return n},go=`unknown_service`,_o=({serviceName:e})=>Cr({[cn]:e}),vo=({diagLogger:e,appVersion:t,pageSessionStorage:n})=>Cr({[un]:`mxl-web-sdk`,app_version:t,app_framework:1,sdk_version:po,[dn]:po,sdk_simple_version:1,sdk_platform:`web`,[ln]:`webjs`,"mxl.app_instance_id":ho(n,e),[pn]:window.navigator.userAgent,screen_resolution:`${window.screen.width}x${window.screen.height}`}),yo={samplingPct:100,networkSpansForwardingThreshold:0},bo=`mxl_remote_config`,xo=(e,{osVersion:t,appVersion:n,deviceId:r},i)=>`${i||`https://mxl-basket.apps.ocpthikadev01.safaricom.net`}/config?appId=${e}&osVersion=${t}&appVersion=${n}&deviceId=${r}`,So=e=>{let t={samplingPct:e.threshold};return e.network_span_forwarding!==void 0&&(t.networkSpansForwardingThreshold=e.network_span_forwarding.pct_enabled),e.empty_session_avoidance_enabled_pct!==void 0&&(t.emptySessionAvoidanceEnabledPct=e.empty_session_avoidance_enabled_pct),e.service_name!==void 0&&e.service_name!==``&&(t.serviceName=e.service_name),t};var Co=class{constructor({appID:e,appVersion:t,deviceId:n,diag:r=L.createComponentLogger({namespace:`mxl-config-manager`}),storage:i=window.localStorage,defaultConfig:a={},mxlConfigURL:o}={}){z(this,`_remoteConfigURL`,null),z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_baseConfig`,void 0),z(this,`_sdkConfig`,void 0),z(this,`_etag`,null),z(this,`_remoteSourceServiceName`,void 0),e&&t&&n&&(this._remoteConfigURL=xo(e,{appVersion:t,deviceId:n,osVersion:`1`},o)),this._diag=r,this._storage=i;let s=this._getRemoteConfigFromStorage();s&&(this._etag=s.etag,this._captureRemoteServiceName(s.config)),this._baseConfig=H(H({},yo),a),this._sdkConfig=H(H({},this._baseConfig),s?So(s.config):{})}setConfig(e){this._sdkConfig=H(H({},this._sdkConfig),e)}getConfig(){return this._sdkConfig}resolveApplicationServiceName(e){var t,n;return((t=this._remoteSourceServiceName)==null?void 0:t.trim())||(e==null?void 0:e.trim())||((n=this._baseConfig.serviceName)==null?void 0:n.trim())||go}_captureRemoteServiceName(e){if(e.service_name===void 0)return;let t=e.service_name.trim();this._remoteSourceServiceName=t.length>0?t:void 0}refreshRemoteConfig(){var e=this;return B(function*(){if(e._remoteConfigURL)try{let t=yield e._fetchRemoteConfig(e._remoteConfigURL);if(!t){e._diag.debug(`No changes in remote config, skipping update`);return}let[n,r]=t;e._captureRemoteServiceName(n),e._storage.setItem(bo,JSON.stringify({config:n,etag:r})),e._sdkConfig=H(H({},e._baseConfig),So(n)),e._etag=r}catch(t){e._diag.warn(`Failed to refresh remote config: ${t instanceof Error?t.message:String(t)}`)}})()}_getRemoteConfigFromStorage(){try{let e=this._storage.getItem(bo);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to parse remote config from storage: ${e instanceof Error?e.message:String(e)}`),null}}_fetchRemoteConfig(e){var t=this;return B(function*(){let n=yield fetch(e,{headers:t._etag?{"If-None-Match":t._etag}:{}}),r=n.headers.get(`etag`);return n.status===304?null:n.ok?[yield n.json(),r]:(t._diag.warn(`Failed to fetch remote config from ${e}: ${n.statusText}`),null)})()}};let wo={maxAllowed:{error_log:500,warning_log:200,info_log:100,exception:500,breadcrumb:100,session_property:100,span:1e3,network_request:1e4,element_timing:500,server_timing:500,user_timing_mark:500,user_timing_measure:500},maxLength:{error_log:128,warning_log:128,info_log:128,exception:1024,breadcrumb:256,session_property_key:128,session_property_value:256,log_attribute_key:128,log_attribute_value:256,exception_attribute_key:128,exception_attribute_value:256},maxAttributes:{error_log:50,warning_log:50,info_log:50,exception:50}},To={info:`info_log`,warning:`warning_log`,error:`error_log`};var Eo=class{constructor({diag:e,maxAllowed:t,maxLength:n,maxAttributes:r}){z(this,`_diag`,void 0),z(this,`_diagnosticCounts`,{}),z(this,`_currentCount`,{exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}),z(this,`_maxAllowed`,void 0),z(this,`_maxLength`,void 0),z(this,`_maxAttributes`,void 0),this._diag=e==null?L.createComponentLogger({namespace:`MXLLimitManager`}):e,this._maxAllowed=t,this._maxLength=n,this._maxAttributes=r}_dropIfMaxReached(e){return this._currentCount[e]>=this._maxAllowed[e]?(this._diag.warn(`disallowing ${e} because the maximum number of ${this._maxAllowed[e].toString()} has already been reached for this session`),this._incrDiagnosticCount(e,`drop`),!0):(this._currentCount[e]=(this._currentCount[e]||0)+1,!1)}truncateString(e,t){return t.length>this._maxLength[e]?(this._diag.warn(`truncating ${e} because it is longer than ${this._maxLength[e].toString()} characters: "${t}"`),this._incrDiagnosticCount(e,`truncate_string`),t.substring(0,this._maxLength[e])):t}_truncateAttributes(e,t,n,r){let i=Object.keys(t);i.length>this._maxAttributes[e]&&(this._diag.warn(`truncating ${e} attributes because there are more than ${this._maxAttributes[e].toString()} set`),this._incrDiagnosticCount(e,`truncate_attributes`));let a={};for(let s=0;s<Math.min(i.length,this._maxAttributes[e]);s++){var o;let e=this.truncateString(n,i[s]);a[e]=this.truncateString(r,((o=t[i[s]])==null?void 0:o.toString())||``)}return a}limitBreadcrumb(e){return this._dropIfMaxReached(`breadcrumb`)?`dropped`:{name:this.truncateString(`breadcrumb`,e)}}limitException(e,t){return this._dropIfMaxReached(`exception`)?`dropped`:{message:this.truncateString(`exception`,e),attributes:this._truncateAttributes(`exception`,t,`exception_attribute_key`,`exception_attribute_value`)}}limitLog(e,t,n){let r=To[t];return this._dropIfMaxReached(r)?`dropped`:{message:this.truncateString(r,e),attributes:this._truncateAttributes(r,n,`log_attribute_key`,`log_attribute_value`)}}limitSessionProperty(e,t){return this._dropIfMaxReached(`session_property`)?`dropped`:{key:this.truncateString(`session_property_key`,e),value:this.truncateString(`session_property_value`,t)}}limitElementTimingEntry(){return this._dropIfMaxReached(`element_timing`)}limitServerTimingEntry(){return this._dropIfMaxReached(`server_timing`)}limitUserTimingEntry(e){return this._dropIfMaxReached(e===`mark`?`user_timing_mark`:`user_timing_measure`)}dropReadableSpan(e){let t=e.attributes[`mxl.type`]===`perf.network_request`?`network_request`:`span`;return this._dropIfMaxReached(t)}reset(){this._diagnosticCounts={},this._currentCount={exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}}_incrDiagnosticCount(e,t){let n=`mxl.app.applied_limit.${e}.${t}.count`;this._diagnosticCounts[n]=(this._diagnosticCounts[n]||0)+1}getDiagnosticCounts(){return this._diagnosticCounts}};let Do=()=>JSON.stringify(Dt._MXLFileBundleIDs||Dt._MXLFileBundleIDs||{});var Oo=class e{constructor({diag:e,perf:t,spanSessionManager:n,limitManager:r,loggerProvider:i,visibilityDoc:a=window.document,storage:o=window.localStorage}){z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_logger`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0);let s=i==null?Ja:i;this._diag=e==null?L.createComponentLogger({namespace:`MXLLogManager`}):e,this._perf=t==null?new Ci:t,this._logger=s.getLogger(`mxl-web-sdk-logs`),this._spanSessionManager=n,this._limitManager=r,this._visibilityDoc=a,this._storage=o}_validateAttributes(e){return Object.prototype.toString.call(e)===`[object Object]`?e:(this._diag.warn(`attributes must be a plain object`,e),{})}static _logSeverityToSeverityNumber(e){switch(e){case`info`:return za.INFO;case`warning`:return za.WARN;default:return za.ERROR}}logException(t,{handled:n=!0,attributes:r={},timestamp:i=this._perf.getNowMillis(),handler:a=`manual`}={}){var o;let s=this._validateAttributes(r);n||this._spanSessionManager.incrSessionCountForKey(`mxl.unhandled_exceptions_count`);let c=(t==null||(o=t.constructor)==null?void 0:o.name)||typeof t,l=``,u=c,d=``,f=``;if(t instanceof Error)l=String(t.message||``).trim(),u=t.name||``,d=t.stack||``,f=t.cause?`present`:``;else if(t&&typeof t==`object`)try{l=JSON.stringify(t)}catch(e){l=String(t).trim()}else l=String(t).trim();let p=this._limitManager.limitException(l,s);p!==`dropped`&&this._logger.emit({timestamp:i,severityNumber:za.ERROR,severityText:`ERROR`,body:p.message,attributes:H(H({},p.attributes),{},{[_t]:`sys.exception`,"mxl.exception_handling":e._exceptionHandlingType(n,a),"mxl.exception_cause":f,[tn]:c,"exception.name":u,[$t]:p.message,[en]:d,[xt]:Do(),[vt]:Et(this._visibilityDoc),"mxl.exception_number":gt(this._storage,`mxl_exception_number`,this._diag)})})}message(e,t,{attributes:n={},includeStacktrace:r=!0,stacktrace:i}={}){if(typeof e!=`string`||!e.trim()){this._diag.warn(`Message must be a non-empty string`);return}if(![`info`,`warning`,`error`].includes(t)){this._diag.warn(`Severity must be info, warning, or error`);return}let a=this._validateAttributes(n);t===`error`&&this._spanSessionManager.incrSessionCountForKey(`mxl.error_log_count`);let o=``;t!==`info`&&(typeof i==`string`?o=i:r&&(o=Error().stack||``)),this._logMessage({message:e.trim(),severity:t,timestamp:this._perf.getNowMillis(),attributes:a,stack:o})}_logMessage({message:t,severity:n,timestamp:r,attributes:i={},stack:a}){let o=this._limitManager.limitLog(t,n,i);o!==`dropped`&&this._logger.emit({timestamp:r,severityNumber:e._logSeverityToSeverityNumber(n),severityText:n.toUpperCase(),body:o.message,attributes:H(H(H({},o.attributes),{},{[_t]:`sys.log`},a?{"mxl.stacktrace.js":a,[xt]:Do()}:{}),{},{[vt]:Et(this._visibilityDoc)})})}static _exceptionHandlingType(e,t){return e?`handled`:t===`global_exception`?`unhandled_error`:t===`promise_rejection`?`unhandled_rejection`:`unhandled`}},ko=class{constructor({useDocumentTitleAsPageLabel:e=!0,titleDocument:t=window.document}={}){z(this,`_currentRoute`,null),z(this,`_currentPageId`,null),z(this,`_pageLabel`,null),z(this,`_titleDocument`,void 0),z(this,`_useDocumentTitleAsPageLabel`,void 0),z(this,`getCurrentPageId`,()=>this._currentPageId),z(this,`getCurrentRoute`,()=>this._currentRoute),z(this,`setPageLabel`,e=>{this._pageLabel=e}),z(this,`getPageLabel`,()=>this._pageLabel||(!this._useDocumentTitleAsPageLabel||!this._titleDocument?null:this._titleDocument.title)),z(this,`setCurrentRoute`,e=>{(!this._currentRoute||this._currentRoute.url!==e.url)&&(this._currentPageId=mt()),this._currentRoute=e,e.label?this._pageLabel=e.label:this._pageLabel=null}),z(this,`clearCurrentRoute`,()=>{this._currentRoute=null,this._currentPageId=null,this._pageLabel=null}),this._useDocumentTitleAsPageLabel=e,this._titleDocument=t}},Ao=class{constructor({dynamicConfigManager:e,deviceId:t,blockNetworkSpanForwarding:n}){z(this,`_dynamicConfigManager`,void 0),z(this,`_deviceId`,void 0),z(this,`_blockNetworkSpanForwarding`,void 0),this._dynamicConfigManager=e,this._deviceId=t,this._blockNetworkSpanForwarding=n}isSDKEnabled(){let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.samplingPct)}isNetworkSpanForwardingEnabled(){if(this._blockNetworkSpanForwarding)return!1;let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.networkSpansForwardingThreshold)}isEmptySessionAvoidanceEnabled(){let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.emptySessionAvoidanceEnabledPct)}},jo=class{constructor(e){z(this,`_span`,void 0),this._span=e}get attributes(){return this._span.attributes}addEvent(e,t,n){return this._span.addEvent(e,t,n),this}addLink(e){return this._span.addLink(e),this}addLinks(e){return this._span.addLinks(e),this}end(e){this._span.end(e)}isRecording(){return this._span.isRecording()}recordException(e,t){this._span.recordException(e,t)}setAttribute(e,t){return this._span.setAttribute(e,t),this}setAttributes(e){return this._span.setAttributes(e),this}removeAttribute(e){let t=this._span.attributes,{[e]:n}=t,r=Ti(t,[e].map(Bt));return this._span.attributes=r,this}setStatus(e){return this._span.setStatus(e),this}spanContext(){return this._span.spanContext()}updateName(e){return this._span.updateName(e),this}fail(e={code:`failure`}){e.code&&this._span.setAttribute(`mxl.error_code`,e.code.toUpperCase()),this._span.end(e.endTime)}};let Mo=`mxl_tab`,No=`mxl_tab_activity`;var Po=class{constructor({diag:e,perf:t,visibilityDoc:n=window.document,storage:r=window.localStorage,sessionStorage:i=window.sessionStorage,limitManager:a,referrer:o=document.referrer,navigationPerformance:s=window.performance}){z(this,`_previousSessionId`,null),z(this,`_activeSessionId`,null),z(this,`_activeSessionStartTime`,null),z(this,`_sessionSpan`,null),z(this,`_activeSessionCounts`,null),z(this,`_nextSessionCounts`,{}),z(this,`_coldStart`,!0),z(this,`_sdkStartupDuration`,0),z(this,`_sessionStartedListeners`,[]),z(this,`_sessionEndedListeners`,[]),z(this,`_tab`,void 0),z(this,`_navigationSource`,void 0),z(this,`_referrerInfo`,void 0),z(this,`_tracer`,void 0),z(this,`_noExportTracer`,void 0),z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0),z(this,`_sessionStorage`,void 0),z(this,`_limitManager`,void 0),z(this,`_referrer`,void 0),z(this,`_navigationPerformance`,void 0),this._diag=e==null?L.createComponentLogger({namespace:`MXLSpanSessionManager`}):e,this._perf=t==null?new Ci:t,this._visibilityDoc=n,this._storage=r,this._sessionStorage=i,this._limitManager=a,this._referrer=o,this._navigationPerformance=s,this._tracer=R.getTracer(`mxl-web-sdk-sessions`),this._noExportTracer=new ni().getTracer(`mxl-web-sdk-sessions`),this._referrerInfo=this._processReferrer();let c=this._initTab();this._tab=c.tab,this._navigationSource=c.navigationSource,this._setupNewTabClickListeners()}_getPermanentAttributes(){let e=new Map;try{for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);if(n!=null&&n.startsWith(`mxl.properties.`)){let t=this._storage.getItem(n);t&&e.set(n,t)}}}catch(e){this._diag.warn(`Error loading permanent session properties`,e)}return Object.fromEntries(e.entries())}addBreadcrumb(e){if(!this._sessionSpan){this._diag.debug(`trying to add breadcrumb to a session, but there is no session in progress. This is a no-op.`);return}let t=this._limitManager.limitBreadcrumb(e);t!==`dropped`&&this._sessionSpan.addEvent(`mxl-breadcrumb`,{message:t.name},this._perf.getNowMillis())}addProperty(e,t,n){if(!this._sessionSpan){this._diag.debug(`trying to add properties to a session, but there is no session in progress. This is a no-op.`);return}let r=this._limitManager.limitSessionProperty(e,t);if(r===`dropped`)return;let i=yt+r.key;if(this._sessionSpan.setAttribute(i,r.value),(n==null?void 0:n.lifespan)===`permanent`)try{this._storage.setItem(i,t)}catch(e){this._diag.warn(`Failed to set permanent session property`,e)}}removeProperty(e){if(!this._sessionSpan){this._diag.debug(`trying to remove a session property, but there is no session in progress. This is a no-op.`);return}let t=yt+this._limitManager.truncateString(`session_property_key`,e);this._sessionSpan.removeAttribute(t);try{this._storage.getItem(t)&&this._storage.removeItem(t)}catch(e){this._diag.warn(`Error removing permanent session property`,e)}}endSessionSpan(){this.endSessionSpanInternal(`manual`)}endSessionSpanInternal(e){if(!this._sessionSpan){this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`);return}for(let e of this._sessionEndedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session ended listener`,e)}this._sessionSpan.setAttributes(this._endSessionSpanAttributes(e)),this._sessionSpan.end(),this._sessionSpan=null,this._activeSessionStartTime=null,this._previousSessionId=this._activeSessionId,this._activeSessionId=null,this._activeSessionCounts=null,this._limitManager.reset()}_endSessionSpanAttributes(e){return H(H(H(H({},this._getPermanentAttributes()),{},{"mxl.session_end_type":e},this._activeSessionCounts),this._limitManager.getDiagnosticCounts()),{},{"mxl.sdk_startup_duration":this._sdkStartupDuration})}currentSessionAsReadableSpan(e){if(!this._sessionSpan||!this._activeSessionStartTime)return this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`),null;let t=this._noExportTracer.startSpan(`mxl-session`,{startTime:this._activeSessionStartTime,attributes:H(H(H({},this._sessionSpan.attributes),this._endSessionSpanAttributes(e)),{},{"mxl.from_storage":!0})});return t.end(),t}getSessionId(){return this._activeSessionId}getPreviousSessionId(){return this._previousSessionId}getSessionSpan(){return this._sessionSpan}getSessionStartTime(){return this._activeSessionStartTime}startSessionSpan(e){var t;this._sessionSpan&&this.endSessionSpanInternal(`manual`),this._activeSessionId=mt(),this._activeSessionStartTime=this._perf.getNowHRTime(),this._activeSessionCounts={};let n=this._nextSessionCounts;this._nextSessionCounts={};let r=H(H({},this._getPermanentAttributes()),{},{[_t]:`ux.session`,[vt]:Et(this._visibilityDoc),[La]:this._activeSessionId,"mxl.cold_start":this._coldStart,"mxl.session_number":gt(this._storage,`mxl_session_number`,this._diag),"mxl.experience_id":this._tab.experienceId,"mxl.tab_id":this._tab.tabId,"mxl.navigation_source":this._navigationSource},n);this._referrerInfo.isValid&&this._referrerInfo.scrubbedUrl&&(r[`mxl.referrer_url`]=this._referrerInfo.scrubbedUrl),this._tab.sourceTabId&&(r[`mxl.source_tab_id`]=this._tab.sourceTabId),r[`mxl.session_start_type`]=(t=e==null?void 0:e.reason)==null?`manual`:t,this._sessionSpan=new jo(this._tracer.startSpan(`mxl-session`,{attributes:r})),this._coldStart=!1;for(let e of this._sessionStartedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session started listener`,e)}}incrSessionCountForKey(e){if(!this._sessionSpan||!this._activeSessionCounts){this._diag.debug(`trying to increment a count for the active session, but there is no session in progress. This is a no-op.`);return}this._activeSessionCounts[e]=(this._activeSessionCounts[e]||0)+1}incrNextSessionCountForKey(e){this._nextSessionCounts[e]=(this._nextSessionCounts[e]||0)+1}addSessionStartedListener(e){let t=this._sessionStartedListeners.push(e);return()=>{this._sessionStartedListeners.splice(t-1,1)}}addSessionEndedListener(e){let t=this._sessionEndedListeners.push(e);return()=>{this._sessionEndedListeners.splice(t-1,1)}}recordSDKStartupDuration(e){this._sdkStartupDuration=Math.ceil(e)}setTracerProvider(e){this._tracer=e.getTracer(`mxl-web-sdk-sessions`)}_determineNavigationSource(){try{let e=this._navigationPerformance.getEntriesByType(`navigation`);if(e.length>0&&e[0]){let t=e[0];if(t.type===`reload`)return`reload`;if(t.type===`back_forward`)return`back_forward`}}catch(e){this._diag.warn(`Failed to get navigation type`,e)}return this._referrerInfo.isValid?this._referrerInfo.isSameOrigin?`same_origin`:`external`:`direct`}_processReferrer(){if(!this._referrer)return{isValid:!1,isSameOrigin:!1};try{let e=new URL(this._referrer),t=window.location.origin;return{isValid:!0,isSameOrigin:e.origin===t,scrubbedUrl:e.origin+e.pathname}}catch(e){return{isValid:!1,isSameOrigin:!1}}}_getTabContext(e){let t=ho(this._sessionStorage,this._diag),n,r;if(e===`same_origin`){let e=this._getTabActivity();e&&Date.now()-e.lastActivityMs<=1e4&&(n=e.tabId,r=e.experienceId)}return r!=null||(r=mt()),{sourceTabId:n,experienceId:r,tabId:t}}_initTab(){let e=this._determineNavigationSource();try{let t=this._sessionStorage.getItem(Mo);if(t)return{tab:JSON.parse(t),navigationSource:e}}catch(e){this._diag.warn(`Failed to retrieve tab data`,e)}let t=this._getTabContext(e),n={experienceId:t.experienceId,sourceTabId:t.sourceTabId,tabId:t.tabId};try{this._sessionStorage.setItem(Mo,JSON.stringify(n))}catch(e){this._diag.warn(`Failed to store tab data`,e)}return{tab:n,navigationSource:e}}_getTabActivity(){try{let e=this._storage.getItem(No);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to retrieve tab activity`,e),null}}_storeTabActivity(e){try{this._storage.setItem(No,JSON.stringify(e))}catch(e){this._diag.warn(`Failed to save tab activity`,e)}}_storeCurrentTabAsSource(){let e={tabId:this._tab.tabId,experienceId:this._tab.experienceId,lastActivityMs:Date.now()};this._storeTabActivity(e)}_setupNewTabClickListeners(){let e=e=>{var t;if(e.button===1||e.ctrlKey||e.metaKey||e.shiftKey){this._storeCurrentTabAsSource();return}(t=e.target)!=null&&t.closest(`a[target="_blank"], form[target="_blank"], a[rel*="noopener"], a[rel*="noreferrer"]`)&&this._storeCurrentTabAsSource()},t={capture:!0,passive:!0};document.addEventListener(`auxclick`,e,t),document.addEventListener(`click`,e,t)}},Fo=class{constructor({tracerProvider:e}={}){z(this,`_tracer`,void 0),z(this,`setSpan`,R.setSpan);let t=e==null?R:e;this._tracer=t.getTracer(`mxl-web-sdk-traces`)}startSpan(e,t={},n){t.attributes=t.attributes?t.attributes:{},t.attributes[_t]=`perf`;let r=t.parentSpan?R.setSpan(I.active(),t.parentSpan):n;return new jo(this._tracer.startSpan(e,t,r))}getSpan(e){let t=R.getSpan(e);if(t)return new jo(t)}};let Io=`mxl_user`,Lo=`mxl_user_id`,Ro=`mxl_external_user_id`,zo=e=>typeof e[`enduser.pseudo.id`]==`string`&&e[`enduser.pseudo.id`].length===32,Bo=e=>typeof e==`string`&&e.length===32;var Vo=class{constructor({diag:e,storage:t=window.localStorage}={}){z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_mxlUserId`,null),this._diag=e==null?L.createComponentLogger({namespace:`MXLUserManager`}):e,this._storage=t,this._migrateOldLocalStorageKey(),this._initialSetup()}getMXLUserId(){return this._mxlUserId||this._generateNewMXLUserId()}setMXLUserId(e){this._mxlUserId=e;try{this._storage.setItem(Lo,e)}catch(e){this._diag.warn(`Failed to persist user object for storage, keeping it in-memory only`,e)}}clearMXLUserId(){this._mxlUserId=null;try{this._storage.removeItem(Lo)}catch(e){this._diag.warn(`Failed to remove mxl user in storage`,e)}}_migrateOldLocalStorageKey(){try{let e=this._storage.getItem(Io);if(e){let t=JSON.parse(e);zo(t)?(this._diag.debug(`Migrating old user data from storage`),this._storage.setItem(Lo,t[`enduser.pseudo.id`]),this._storage.removeItem(Io)):(this._diag.warn(`Invalid user data found in storage, clearing old user data`),this._storage.removeItem(Io))}}catch(e){this._diag.warn(`Failed to get old user data from storage`,e)}}_initialSetup(){try{let e=this._storage.getItem(Lo);e?Bo(e)?this._mxlUserId=e:(this._diag.warn(`Invalid mxl user id, generating a new one`),this.clearMXLUserId()):this._diag.debug(`No existing user found in storage, creating a new one`)}catch(e){this._diag.warn(`Failed to get mxl user id from storage, defaulting to a new one`,e)}this._mxlUserId||(this._mxlUserId=this._generateNewMXLUserId())}_generateNewMXLUserId(){let e=mt();return this.setMXLUserId(e),e}getUserId(){try{return this._storage.getItem(Ro)}catch(e){return this._diag.warn(`Failed to retrieve user id from storage`,e),null}}setUserId(e){try{this._storage.setItem(Ro,e)}catch(e){this._diag.warn(`Failed to store user id`,e)}}clearUserId(){try{this._storage.removeItem(Ro)}catch(e){this._diag.warn(`Failed to clear user id`,e)}}};let Ho=[`keydown`,`mousedown`,`mousemove`,`scroll`];var Uo=class extends Xa{constructor({diag:e}={}){super({instrumentationName:`SpanSessionBrowserActivityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_onActivityThrottled`,void 0),z(this,`_activityTimeout`,void 0),z(this,`disable`,()=>{ut({target:window,events:Ho,callback:this._onActivityThrottled}),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null}),z(this,`enable`,()=>{lt({target:window,events:Ho,callback:this._onActivityThrottled})}),z(this,`_onInactivity`,()=>{this._diag.debug(`Inactivity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null,this.sessionManager.endSessionSpanInternal(`inactivity`)}),z(this,`_onActivity`,()=>{this._diag.debug(`Activity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this.sessionManager.getSessionId()||this.sessionManager.startSessionSpan({reason:`activity`}),this._activityTimeout=setTimeout(this._onInactivity,18e5)}),this._activityTimeout=null,this._onActivityThrottled=Ai(this._onActivity,3e4),this._config.enabled&&this.enable()}},Wo=class extends Xa{constructor({diag:e,perf:t,visibilityDoc:n=window.document}={}){super({instrumentationName:`SpanSessionVisibilityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onVisibilityChange`,void 0),this._onVisibilityChange=()=>{this._diag.debug(`Visibility change detected: ${n.visibilityState}`);try{this.sessionManager.endSessionSpanInternal(`state_changed`),n.visibilityState===`visible`&&(this._diag.debug(`Starting a session since document visibility switched to visible`),this.sessionManager.startSessionSpan({reason:`visible`}))}catch(e){this._diag.error(`Failed to rotate session on visibility change to ${n.visibilityState}`,e)}},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`visibilitychange`,this._onVisibilityChange)}enable(){window.addEventListener(`visibilitychange`,this._onVisibilityChange)}};let Go=`mxl.user_timing.start_time`,Ko=`mxl.user_timing.duration`,qo=`mxl.user_timing.entry_type`;var Jo=class extends Xa{constructor({diag:e,perf:t,limitManager:n,allowedEntries:r}={}){super({instrumentationName:`UserTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_markObserver`,null),z(this,`_measureObserver`,null),z(this,`_seenEntries`,new Set),z(this,`_isEnabled`,!1),z(this,`_allowedEntries`,void 0),this._allowedEntries=r,this._config.enabled&&this.enable()}enable(){this._isEnabled||(this._isEnabled=!0,this._seenEntries=new Set,this._markObserver&&this._markObserver.disconnect(),this._measureObserver&&this._measureObserver.disconnect(),this._markObserver=ki(`mark`,this._processEntry.bind(this),{diag:this._diag}),this._markObserver||this._diag.error(`failed to enable mark observer`),this._measureObserver=ki(`measure`,e=>this._processEntry(e),{diag:this._diag}),this._measureObserver||this._diag.error(`failed to enable measure observer`),!this._markObserver&&!this._measureObserver&&(this._isEnabled=!1))}disable(){this._isEnabled=!1,this._markObserver&&(this._markObserver.disconnect(),this._markObserver=null),this._measureObserver&&(this._measureObserver.disconnect(),this._measureObserver=null),this._seenEntries=new Set}_processEntry(e){var t;if(!this._isEnabled||this._allowedEntries!==void 0&&!(Array.isArray(this._allowedEntries)?this._allowedEntries.includes(e.name):this._allowedEntries(e)))return;let n=`${location.href}::${e.name}`;if(this._seenEntries.has(n)||(this._seenEntries.add(n),(t=this.limitManager)!=null&&t.limitUserTimingEntry(e.entryType)))return;if(e.entryType===`measure`){let t=e.detail;this.tracer.startSpan(e.name,{startTime:this.perf.epochMillisFromOriginOffset(e.startTime),attributes:H({[_t]:`ux.user_timing`,[bt]:`user_timing`,[qo]:e.entryType,[Go]:this.perf.millisFromZeroTime(e.startTime),[Ko]:e.duration},t!=null&&{"mxl.user_timing.detail":JSON.stringify(t)})}).end(this.perf.epochMillisFromOriginOffset(e.startTime+e.duration));return}let r=e.detail,i=r==null?void 0:JSON.stringify(r);this.logger.emit({timestamp:this.perf.epochMillisFromOriginOffset(e.startTime),eventName:`mxl-user-timing`,severityNumber:za.INFO,attributes:{[_t]:`ux.user_timing`,"mxl.user_timing.name":e.name,[Go]:this.perf.millisFromZeroTime(e.startTime),[Ko]:e.duration,[qo]:e.entryType},body:i})}};let Yo=`mxl.web_vital.attribution.`;var Xo=class{constructor(){z(this,`t`,void 0),z(this,`o`,0),z(this,`i`,[])}u(e){var t;if(e.hadRecentInput)return;let n=this.i[0],r=this.i.at(-1);this.o&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),(t=this.t)==null||t.call(this,e)}};let Zo=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Qo=e=>{if(document.readyState===`loading`)return`loading`;let t=Zo();if(t){if(e<t.domInteractive)return`loading`;if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return`dom-interactive`;if(t.domComplete===0||e<t.domComplete)return`dom-content-loaded`}return`complete`},$o=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},es=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[$o(n),...Array.from(n.classList).sort()].join(`.`);if(t.length+r.length>99)return t||r;if(t=t?r+`>`+t:r,n.id)break;e=n.parentNode}}catch(e){}return t},ts=new WeakMap;function ns(e,t){return ts.get(e)||ts.set(e,new t),ts.get(e)}let rs=-1,is=()=>rs,as=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(rs=t.timeStamp,e(t))},!0)},os=(e,t,n,r)=>{let i,a;return o=>{var s;t.value>=0&&(o||r)&&(a=t.value-((s=i)==null?0:s),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`)(t.value,n),e(t)))}},ss=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},cs=()=>{var e,t;return(e=(t=Zo())==null?void 0:t.activationStart)==null?0:e},ls=(e,t=-1)=>{let n=Zo(),r=`navigate`;return is()>=0?r=`back-forward-cache`:n&&(document.prerendering||cs()>0?r=`prerender`:document.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:r}},us=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(H({type:e,buffered:!0},n)),r}}catch(e){}},ds=e=>{let t=!1;return()=>{t||(e(),t=!0)}},fs=-1,ps=new Set,ms=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,hs=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of ps)e();isFinite(fs)||(fs=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,hs,!0))}},gs=()=>{if(fs<0){var e;let t=cs(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;fs=n==null?ms():n,addEventListener(`visibilitychange`,hs,!0),addEventListener(`prerenderingchange`,hs,!0),as(()=>{setTimeout(()=>{fs=ms()})})}return{get firstHiddenTime(){return fs},onHidden(e){ps.add(e)}}},_s=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},vs=[1800,3e3],ys=(e,t={})=>{_s(()=>{let n=gs(),r,i=ls(`FCP`),a=us(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-cs(),0),i.entries.push(t),r(!0)))});a&&(r=os(e,i,vs,t.reportAllChanges),as(n=>{i=ls(`FCP`),r=os(e,i,vs,t.reportAllChanges),ss(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},bs=[.1,.25],xs=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],Ss=(e,t={})=>{let n=ns(t=Object.assign({},t),Xo),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=xs(e.sources),o=n==null?void 0:n.node;if(o){var i,a;let e=(i=(a=t.generateTarget)==null?void 0:a.call(t,o))==null?es(o):i;r.set(n,e)}}},((e,t={})=>{let n=gs();ys(ds(()=>{let r,i=ls(`CLS`,0),a=ns(t,Xo),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=us(`layout-shift`,o);s&&(r=os(e,i,bs,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),as(()=>{a.o=0,i=ls(`CLS`,0),r=os(e,i,bs,t.reportAllChanges),ss(r)}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){var n;let i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(!(i==null||(n=i.sources)==null)&&n.length){let e=xs(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:Qo(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},Cs=(e,t={})=>{ys(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Qo(is())};if(e.entries.length){let n=Zo(),r=e.entries.at(-1);if(n){let i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:Qo(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},ws=0,Ts=1/0,Es=0,Ds=e=>{for(let t of e)t.interactionId&&(Ts=Math.min(Ts,t.interactionId),Es=Math.max(Es,t.interactionId),ws=Es?(Es-Ts)/7+1:0)},Os,ks=()=>{var e;return Os?ws:(e=performance.interactionCount)==null?0:e},As=()=>{`interactionCount`in performance||Os||(Os=us(`event`,Ds,{durationThreshold:0}))},js=0;var Ms=class{constructor(){z(this,`l`,[]),z(this,`h`,new Map),z(this,`m`,void 0),z(this,`p`,void 0)}v(){js=ks(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((ks()-js)/50));return this.l[e]}u(e){var t;if((t=this.m)==null||t.call(this,e),!e.interactionId&&e.entryType!==`first-input`)return;let n=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>n.T){var i;if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){let e=this.l.splice(10);for(let t of e)this.h.delete(t.id)}(i=this.p)==null||i.call(this,r)}}};let Ns=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=ds(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},Ps=[200,500],Fs=(e,t={})=>{let n=ns(t=Object.assign({},t),Ms),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(Ns(u),c=!0)},u=()=>{let e=new Set(n.l.map(e=>o.get(e.entries[0]))),t=i.length-10;i=i.filter((n,r)=>r>=t||e.has(n));let s=new Set;for(let e of i){let t=d(e.startTime,e.processingEnd);for(let e of t)s.add(e)}r=r.filter(e=>e.startTime>a||s.has(e)),c=!1};n.m=e=>{let n=e.startTime+e.duration,r;a=Math.max(a,e.processingEnd);for(let a=i.length-1;a>=0;a--){let o=i[a];if(Math.abs(n-o.renderTime)<=8){r=o,r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:!1===t.includeProcessedEventEntries?[]:[e]},i.push(r)),(e.interactionId||e.entryType===`first-input`)&&o.set(e,r),l()},n.p=e=>{if(!s.get(e)){let i=e.entries[0].target;if(i){var n,r;let a=(n=(r=t.generateTarget)==null?void 0:r.call(t,i))==null?es(i):n;s.set(e,a)}}};let d=(e,t)=>{let n=[];for(let i of r)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;n.push(i)}return n},f=e=>{let t=e.entries[0],r=o.get(t),i=t.processingStart,a=Math.max(t.startTime+t.duration,i),c=Math.min(r.processingEnd,a),l=r.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,c),f=n.h.get(t.interactionId),p={interactionTarget:s.get(f),interactionType:t.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:u,inputDelay:i-t.startTime,processingDuration:c-i,presentationDelay:a-c,loadState:Qo(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{var t;if(!((t=e.longAnimationFrameEntries)!=null&&t.length))return;let n=e.interactionTime,r=e.inputDelay,i=e.processingDuration,a,o,s=0,c=0,l=0,u=0;for(let t of e.longAnimationFrameEntries){c=c+t.startTime+t.duration-t.styleAndLayoutStart;for(let e of t.scripts){let t=e.startTime+e.duration;if(t<n)continue;let l=t-Math.max(n,e.startTime),d=e.duration?l/e.duration*e.forcedStyleAndLayoutDuration:0;s+=l-d,c+=d,l>u&&(o=e.startTime<n+r?`input-delay`:e.startTime>=n+r+i?`presentation-delay`:`processing-duration`,a=e,u=l)}}let d=e.longAnimationFrameEntries.at(-1),f=d?d.startTime+d.duration:0;f>=n+r+i&&(l=e.nextPaintTime-f),a&&o&&(e.longestScript={entry:a,subpart:o,intersectingDuration:u}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=c,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-c-l})(p),Object.assign(e,{attribution:p})};us(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=gs();_s(()=>{var r;As();let i,a=ls(`INP`),o=ns(t,Ms),s=e=>{Ns(()=>{for(let t of e)o.u(t);let t=o.M();t&&t.T!==a.value&&(a.value=t.T,a.entries=t.entries,i())})},c=us(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=os(e,a,Ps,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),as(()=>{o.v(),a=ls(`INP`),i=os(e,a,Ps,t.reportAllChanges)}))})})(t=>{e(f(t))},t)};var Is=class{constructor(){z(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}};let Ls=[2500,4e3],Rs=(e,t={})=>{let n=ns(t=Object.assign({},t),Is),r=new WeakMap;n.m=e=>{let n=e.element;if(n){var i,a;let o=(i=(a=t.generateTarget)==null?void 0:a.call(t,n))==null?es(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{_s(()=>{let n=gs(),r,i=ls(`LCP`),a=ns(t,Is),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a.u(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-cs(),0),i.entries=[t],r())},s=us(`largest-contentful-paint`,o);if(s){r=os(e,i,Ls,t.reportAllChanges);let n=ds(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(Ns(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});as(n=>{i=ls(`LCP`),r=os(e,i,Ls,t.reportAllChanges),ss(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=e.entries.at(-1),i=n.url&&performance.getEntriesByType(`resource`).find(e=>e.name===n.url);t.target=r.get(n),t.lcpEntry=n,n.url&&(t.url=n.url),i&&(t.lcpResourceEntry=i);let a=Zo();if(a){let n=a.activationStart||0,r=Math.max(0,a.responseStart-n),o=Math.max(r,i?(i.requestStart||i.startTime)-n:0),s=Math.min(e.value,Math.max(o,i?i.responseEnd-n:0));t=H(H({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},zs=[800,1800],Bs=e=>{document.prerendering?_s(()=>Bs(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Bs(e),!0)},Vs=(e,t={})=>{((e,t={})=>{let n=ls(`TTFB`),r=os(e,n,zs,t.reportAllChanges);Bs(()=>{let i=Zo();i&&(n.value=Math.max(i.responseStart-cs(),0),n.entries=[i],r(!0),as(()=>{n=ls(`TTFB`,0),r=os(e,n,zs,t.reportAllChanges),r(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)},Hs=[`CLS`,`INP`,`LCP`,`FCP`,`TTFB`],Us={CLS:Ss,FCP:Cs,LCP:Rs,INP:Fs,TTFB:Vs,FID:void 0},Ws=e=>{let t=typeof e;return t===`number`||t===`string`||t===`boolean`},Gs=e=>Math.round(Math.max(0,e)),Ks=e=>{let t={},n=e.attribution;if(!n||typeof n!=`object`)return t;for(let[e,r]of Object.entries(n))Ws(r)&&(t[`${Yo}${e}`]=r);return t},qs=(e,t)=>{let n={},r=e.attribution;try{if(r.longAnimationFrameEntries.length>0){let e=new Map;for(let t of r.longAnimationFrameEntries)for(let n of t.scripts){let t=n.sourceURL||`(inline)`;t.length>2048&&(t=`${t.substring(0,2048)}...`);let r=e.get(t);r?(r.totalDuration+=n.duration,r.styleAndLayoutDuration+=n.forcedStyleAndLayoutDuration,r.count++):e.set(t,{totalDuration:n.duration,styleAndLayoutDuration:n.forcedStyleAndLayoutDuration,count:1})}e.size>0&&(n[`${Yo}loaf_scripts`]=JSON.stringify(Object.fromEntries([...e].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]))))}}catch(e){t.error(`error building loaf scripts for INP`,e)}return n},Js=(e,t)=>{let n={},r=e.attribution.navigationEntry;if(r)try{var i;let e=Gs(r.redirectEnd-r.redirectStart),t=Gs(r.domainLookupEnd-r.domainLookupStart),a=Gs(r.secureConnectionStart>0?r.secureConnectionStart-r.connectStart:r.connectEnd-r.connectStart),o=Gs(r.secureConnectionStart>0?r.connectEnd-r.secureConnectionStart:0),s=Gs(Math.max((i=r.finalResponseHeadersStart)==null?0:i,r.responseStart)-r.requestStart),c=Gs(Math.round(r.responseEnd-r.startTime)-e-t-a-o-s),l=Yo;n[`${l}redirect`]=e,n[`${l}domainLookup`]=t,n[`${l}tcpConnection`]=a,n[`${l}tlsNegotiation`]=o,n[`${l}serverResponse`]=s,n[`${l}unattributed`]=c}catch(e){t.error(`error computing TTFB timing breakdown`,e)}else t.debug(`TTFB navigationEntry unavailable, skipping timing breakdown`);return n};var Ys=class extends Xa{constructor({diag:e,perf:t,listeners:n=Us,urlDocument:r=window.document,urlAttribution:i=!0,pageManager:a}={}){super({instrumentationName:`WebVitalsInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_listeners`,void 0),z(this,`_urlDocument`,void 0),z(this,`_urlAttribution`,void 0),z(this,`_pageManager`,void 0),z(this,`_attributedPage`,{INP:void 0,LCP:void 0,CLS:void 0,FCP:void 0,TTFB:void 0}),z(this,`_largestShiftTargetForCLS`,void 0),z(this,`_listenersRegistered`,!1),z(this,`_isEnabled`,!1),this._listeners=n,this._urlDocument=r,this._urlAttribution=i,this._pageManager=a==null?Wi.getPageManager():a,this._config.enabled&&this.enable()}disable(){this._isEnabled=!1,this._diag.debug(`WebVitalsInstrumentation disabled, pausing emission`)}enable(){if(this._isEnabled=!0,this._listenersRegistered){this._diag.debug(`WebVitalsInstrumentation listeners already registered, resuming emission`);return}if(this._listenersRegistered=!0,Hs.forEach(e=>{var t,n;(t=(n=this._listeners)[e])==null||t.call(n,t=>{if(!this._isEnabled)return;let n=this.sessionManager.getSessionSpan();if(!n)return;let r=this._getTimeForMetric(t),i=this._getAttributedPageForMetric(t),a=H(H(H({"mxl.type":`ux.web_vital`,"url.full":i.fullURL,"browser.url.full":i.fullURL,"mxl.web_vital.navigation_type":t.navigationType,"mxl.web_vital.name":t.name,"mxl.web_vital.rating":t.rating,"mxl.web_vital.id":t.id,"mxl.web_vital.delta":t.delta,"mxl.web_vital.value":t.value},Ks(t)),e===`INP`?qs(t,this._diag):{}),e===`TTFB`?Js(t,this._diag):{});i.path&&i.pageID&&(a[`app.surface.name`]=i.path,a[`app.surface.id`]=i.pageID),i.label&&(a[`app.surface.label`]=i.label),n.addEvent(`mxl-web-vitals-report-${e}`,a,r)})}),this._urlAttribution){var e,t,n,r,i,a,o,s,c,l;(e=(t=this._listeners).TTFB)==null||e.call(t,()=>{this._attributedPage.TTFB=this._currentAttributedPage()},{reportAllChanges:!0}),(n=(r=this._listeners).FCP)==null||n.call(r,()=>{this._attributedPage.FCP=this._currentAttributedPage()},{reportAllChanges:!0}),(i=(a=this._listeners).INP)==null||i.call(a,()=>{this._attributedPage.INP=this._currentAttributedPage()},{reportAllChanges:!0}),(o=(s=this._listeners).LCP)==null||o.call(s,()=>{this._attributedPage.LCP=this._currentAttributedPage()},{reportAllChanges:!0}),(c=(l=this._listeners).CLS)==null||c.call(l,e=>{let t=e;this._largestShiftTargetForCLS!==t.attribution.largestShiftTarget&&(this._largestShiftTargetForCLS=t.attribution.largestShiftTarget,this._attributedPage.CLS=this._currentAttributedPage())},{reportAllChanges:!0})}}_getTimeForMetric(e){return e.name===`CLS`&&e.attribution.largestShiftTime?this.perf.epochMillisFromOriginOffset(e.attribution.largestShiftTime):e.name===`INP`&&e.attribution.interactionTime?this.perf.epochMillisFromOriginOffset(e.attribution.interactionTime):this.perf.getNowMillis()}_currentAttributedPage(){let e={fullURL:this._urlDocument.URL},t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.path=t.path,e.pageID=n);let r=this._pageManager.getPageLabel();return r&&(e.label=r),e}_getAttributedPageForMetric(e){return e.name===`FCP`&&this._attributedPage.FCP?this._attributedPage.FCP:e.name===`TTFB`&&this._attributedPage.TTFB?this._attributedPage.TTFB:e.name===`INP`&&this._attributedPage.INP?this._attributedPage.INP:e.name===`LCP`&&this._attributedPage.LCP?this._attributedPage.LCP:e.name===`CLS`&&this._attributedPage.CLS&&e.attribution.largestShiftTarget===this._largestShiftTargetForCLS?this._attributedPage.CLS:this._currentAttributedPage()}};function Xs(e){return Zs(e,new WeakSet)}function Zs(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Zs(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Zs(e,t))}return!1}var Qs=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){z(this,`hrTime`,void 0),z(this,`hrTimeObserved`,void 0),z(this,`spanContext`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`attributes`,{}),z(this,`_severityText`,void 0),z(this,`_severityNumber`,void 0),z(this,`_body`,void 0),z(this,`_eventName`,void 0),z(this,`_attributesCount`,0),z(this,`_droppedAttributesCount`,0),z(this,`_isReadonly`,!1),z(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=bn(r==null?f:r),this.hrTimeObserved=bn(i==null?f:i),d){let e=R.getSpanContext(d);e&&Re(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return L.warn(`Invalid attribute key: ${e}`),this;if(!Xs(t))return L.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&L.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return L.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute($t,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(tn,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(tn,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute($t,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(en,n.stack),t=!0)}t||L.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&L.warn(`Can not execute the operation on emitted log record`),this._isReadonly}},$s=class{constructor(e,t){z(this,`instrumentationScope`,void 0),z(this,`_sharedState`,void 0),z(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=e.context||I.active();if(!this.enabled(e))return;let n=new Qs(this._sharedState,this.instrumentationScope,H({context:t},e));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e==null?void 0:e.severityNumber;if(typeof n==`number`&&n!==za.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=(e==null?void 0:e.context)||I.active();if(t.traceBased){let e=R.getSpanContext(r);if(e&&Re(e)&&(e.traceFlags&we.SAMPLED)!==we.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e==null?void 0:e.severityNumber,eventName:e==null?void 0:e.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},ec=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}},tc=class{constructor(e,t){z(this,`processors`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return B(function*(){let t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map(e=>dr(e.forceFlush(),t)))})()}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}shutdown(){var e=this;return B(function*(){yield Promise.all(e.processors.map(e=>e.shutdown()))})()}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function nc(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var rc=class{constructor(e){z(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(`otel.sdk.log.created`,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}};let ic={disabled:!1,minimumSeverity:za.UNSPECIFIED,traceBased:!1},ac=()=>H({},ic);var oc=class{constructor(e,t,n,r,i,a){z(this,`loggers`,new Map),z(this,`activeProcessor`,void 0),z(this,`registeredLogRecordProcessors`,[]),z(this,`resource`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),z(this,`logRecordLimits`,void 0),z(this,`processors`,void 0),z(this,`loggerMetrics`,void 0),z(this,`_loggerConfigurator`,void 0),z(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new tc(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ec,this._loggerConfigurator=i==null?ac:i;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,`0.218.0`):_e();this.loggerMetrics=new rc(o)}getLoggerConfig(e){let t=nc(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}},sc=class{constructor(e={}){var t,n,r,i,a,o,s,c;z(this,`_shutdownOnce`,void 0),z(this,`_sharedState`,void 0);let l={resource:(t=e.resource)==null?Tr():t,forceFlushTimeoutMillis:(n=e.forceFlushTimeoutMillis)==null?3e4:n,logRecordLimits:{attributeCountLimit:(r=(i=e.logRecordLimits)==null?void 0:i.attributeCountLimit)==null?128:r,attributeValueLengthLimit:(a=(o=e.logRecordLimits)==null?void 0:o.attributeValueLengthLimit)==null?1/0:a},loggerConfigurator:(s=e.loggerConfigurator)==null?ac:s,processors:(c=e.processors)==null?[]:c,meterProvider:e.meterProvider};this._sharedState=new oc(l.resource,l.forceFlushTimeoutMillis,l.logRecordLimits,l.processors,l.loggerConfigurator,l.meterProvider),this._shutdownOnce=new hr(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return L.warn(`A shutdown LoggerProvider cannot provide a Logger`),Va;e||L.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new $s({name:r,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(L.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(L.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};function cc(e){return lc.apply(this,arguments)}function lc(){return lc=B(function*(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&(yield Promise.all(t))}),lc.apply(this,arguments)}var uc=class{constructor(e,t,n){z(this,`_exportCompleted`,void 0),z(this,`_exportScheduledPromise`,void 0),z(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(e,t,n){var r=this;return B(function*(){try{yield cc(t),yield I.with(jt(I.active()),B(function*(){return r._exportWithTimeout(e,t,n)}))}catch(e){Xt(e),r._exportScheduledResolve()}})()}_exportWithTimeout(e,t,n){var r=this;return B(function*(){return new Promise((i,a)=>{let o=setTimeout(()=>{a(Error(`Timeout`))},n);e.export(t,e=>{if(clearTimeout(o),e.code===Dn.SUCCESS)i();else{var t;a((t=e.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):t)}}),r._exportScheduledResolve()})})()}},dc=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_currentExport`,null),z(this,`_finishedLogRecords`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=(n=t==null?void 0:t.maxExportBatchSize)==null?512:n,this._maxQueueSize=(r=t==null?void 0:t.maxQueueSize)==null?2048:r,this._scheduledDelayMillis=(i=t==null?void 0:t.scheduledDelayMillis)==null?5e3:i,this._exportTimeoutMillis=(a=t==null?void 0:t.exportTimeoutMillis)==null?3e4:a,this._shutdownOnce=new hr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(L.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return B(function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()})()}_flushAll(){var e=this;return B(function*(){if(e._flushing)return;e._flushing=!0;let t=e._finishedLogRecords;for(e._finishedLogRecords=[],e._clearTimer(),e._currentExport!==null&&(yield e._exporter.forceFlush(),yield e._currentExport.exportCompleted,e._currentExport=null);t.length>0;){let n;t.length<=e._maxExportBatchSize?(n=t,t=[]):n=t.splice(0,e._maxExportBatchSize);let r=new uc(e._exporter,n,e._exportTimeoutMillis);e._currentExport=r;try{yield r.exportScheduled,yield e._exporter.forceFlush(),yield r.exportCompleted}catch(e){Xt(e)}finally{e._currentExport=null}}e._flushing=!1,e._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new uc(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,Xt(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},fc=class extends dc{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this._onInit(t)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}},pc=class{constructor(e){z(this,`_sessionIdProvider`,void 0),this._sessionIdProvider=e}forceFlush(){return B(function*(){})()}onStart(e,t){var n;let r=(n=this._sessionIdProvider)==null?void 0:n.getSessionId();r&&e.setAttribute(`session.id`,r)}onEnd(e){}shutdown(){return B(function*(){})()}};function mc(e){return new pc(e)}let hc={compression:`gzip`,keepalive:!0,concurrencyLimit:5,timeoutMillis:30*1e3},gc=(e,t)=>({"X-MXL-AID":e,"X-MXL-DID":t}),_c=(e,t)=>t||`http://mxl-otelcol.service-availability.apps.ocpthikadev01.safaricom.net`,vc=`1.9.1`,yc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function bc(e){let t=new Set([e]),n=new Set,r=e.match(yc);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(yc);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}let xc=bc(vc),Sc=vc.split(`.`)[0],Cc=Symbol.for(`opentelemetry.js.api.${Sc}`),wc=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function Tc(e,t,n,r=!1){var i;let a=wc[Cc]=(i=wc[Cc])==null?{version:vc}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${vc}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${vc}.`),!0}function Ec(e){var t,n;let r=(t=wc[Cc])==null?void 0:t.version;if(!(!r||!xc(r)))return(n=wc[Cc])==null?void 0:n[e]}function Dc(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${vc}.`);let n=wc[Cc];n&&delete n[e]}var Oc=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return kc(`debug`,this._namespace,e)}error(...e){return kc(`error`,this._namespace,e)}info(...e){return kc(`info`,this._namespace,e)}warn(...e){return kc(`warn`,this._namespace,e)}verbose(...e){return kc(`verbose`,this._namespace,e)}};function kc(e,t,n){let r=Ec(`diag`);if(r)return r[e](t,...n)}var Ac;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(Ac||(Ac={}));function jc(e,t){e<Ac.NONE?e=Ac.NONE:e>Ac.ALL&&(e=Ac.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,Ac.ERROR),warn:n(`warn`,Ac.WARN),info:n(`info`,Ac.INFO),debug:n(`debug`,Ac.DEBUG),verbose:n(`verbose`,Ac.VERBOSE)}}let Mc=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=Ec(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:Ac.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=Ec(`diag`),s=jc((i=n.logLevel)==null?Ac.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return Tc(`diag`,s,t,!0)},t.disable=()=>{Dc(`diag`,t)},t.createComponentLogger=e=>new Oc(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}.instance(),Nc=Math.pow(10,9);function Pc(e){return e[0]*Nc+e[1]}function Fc(e,t){let n={attributes:Lc(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function Ic(e){return{name:e.name,version:e.version}}function Lc(e,t){return Object.keys(e).map(n=>Rc(n,e[n],t))}function Rc(e,t,n){return{key:e,value:zc(t,n)}}function zc(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=zc(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:zc(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}function Bc(e,t){return{resourceLogs:Hc(e,t)}}function Vc(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function Hc(e,t){let n=Vc(e);return Array.from(n,([e,n])=>{let r=Fc(e,t);return{resource:r,scopeLogs:Array.from(n,([,e])=>({scope:Ic(e[0].instrumentationScope),logRecords:e.map(e=>Uc(e,t)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function Uc(e,t){var n,r,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:Wc(e.severityNumber),severityText:e.severityText,body:zc(e.body,t),eventName:e.eventName,attributes:Gc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:(n=e.spanContext)==null?void 0:n.traceFlags,traceId:t.encodeOptionalSpanContext((r=e.spanContext)==null?void 0:r.traceId),spanId:t.encodeOptionalSpanContext((i=e.spanContext)==null?void 0:i.spanId)}}function Wc(e){return e}function Gc(e,t){return Object.keys(e).map(n=>Rc(n,e[n],t))}function Kc(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function qc(e){return Kc(e).toString()}let Jc=typeof BigInt<`u`?qc:Pc;function Yc(e){return e}let Xc={encodeHrTime:Jc,encodeSpanContext:Yc,encodeOptionalSpanContext:Yc,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},Zc={serializeRequest:e=>{let t=Bc(e,Xc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Mc.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}};function Qc(e,t){let n=e&255|256;return t&&(n|=512),n}function $c(e,t){var n,r,i,a;let o=e.spanContext(),s=e.status,c=(n=e.parentSpanContext)!=null&&n.spanId?t.encodeSpanContext((r=e.parentSpanContext)==null?void 0:r.spanId):void 0;return{traceId:t.encodeSpanContext(o.traceId),spanId:t.encodeSpanContext(o.spanId),parentSpanId:c,traceState:(i=o.traceState)==null?void 0:i.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Lc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>tl(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>el(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Qc(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function el(e,t){var n;return{attributes:e.attributes?Lc(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(n=e.context.traceState)==null?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Qc(e.context.traceFlags,e.context.isRemote)}}function tl(e,t){return{attributes:e.attributes?Lc(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function nl(e,t){return{resourceSpans:il(e,t)}}function rl(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function il(e,t){let n=rl(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>$c(e,t));o.push({scope:Ic(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Fc(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}let al={serializeRequest:e=>{let t=nl(e,Xc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Mc.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};var ol=class{constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},sl=class extends Error{constructor(e,t,n){super(e),z(this,`code`,void 0),z(this,`name`,`OTLPExporterError`),z(this,`data`,void 0),this.data=n,this.code=t}},cl=class{constructor(e){z(this,`_concurrencyLimit`,void 0),z(this,`_sendingPromises`,[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return B(function*(){yield Promise.all(e._sendingPromises)})()}};function ll(e){return new cl(e.concurrencyLimit)}function ul(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function dl(){return{handleResponse(e){e==null||!ul(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||L.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var fl=class{constructor(e,t,n,r,i){z(this,`_diagLogger`,void 0),z(this,`_transport`,void 0),z(this,`_serializer`,void 0),z(this,`_responseHandler`,void 0),z(this,`_promiseQueue`,void 0),z(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=L.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:Dn.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:Dn.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:Dn.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:Dn.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:Dn.FAILED,error:(n=e.error)==null?new sl(`Export failed with retryable status`):n})}else t({code:Dn.FAILED,error:new sl(`Export failed with unknown error`)})},e=>t({code:Dn.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return B(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function pl(e,t){return new fl(e.transport,e.serializer,dl(),e.promiseHandler,t.timeout)}function ml(e,t,n){return pl({transport:n,serializer:t,promiseHandler:ll(e)},{timeout:e.timeoutMillis})}let hl=49152,gl=0,_l=0;var vl=class e{constructor(e){this._config=e}static _compressRequest(e){return B(function*(){let t=new CompressionStream(`gzip`),n=t.writable.getWriter();n.write(e),n.close();let r=[],i=t.readable.getReader(),a=!1;for(;!a;){let e=yield i.read();e.value&&r.push(e.value),a=e.done}let o=new Uint8Array(r.reduce((e,t)=>e+t.length,0)),s=0;for(let e of r)o.set(e,s),s+=e.length;return o})()}send(e,t){return this._asyncSend(e,t)}shutdown(){}_asyncSend(t,n){var r=this;return B(function*(){let i=t,a=H({"Content-Type":`application/json`},r._config.headers),o,s;if(`timeout`in AbortSignal)o=AbortSignal.timeout(n);else{let e=new AbortController;o=e.signal,s=setTimeout(()=>{e.abort(new DOMException(`TimeoutError`,`TimeoutError`))},n)}let c=!1;try{if(r._config.compression===`gzip`){try{i=yield e._compressRequest(t)}catch(e){let t=e instanceof Error?e:Error(String(e));return L.warn(`Fetch transport gzip compression failed: ${t.message}`),{status:`failure`,error:t}}a[`Content-Encoding`]=`gzip`,a[`Content-Length`]=i.length.toString()}let n=gl+i.byteLength>hl;if(c=!n&&!(_l>=9),c)gl+=i.byteLength,_l++;else{let e=n?`inflight bytes (${gl} + ${i.byteLength}) would exceed ${hl}B budget`:`concurrent count (${_l}) at limit of 9`;L.debug(`Sending without keepalive: ${e}`)}let s=yield fetch(r._config.url,{method:`POST`,keepalive:c,headers:a,body:i,signal:o});if(s.ok)return{status:`success`};let l=Error(`${s.status} Fetch request failed`),u=`Fetch transport received HTTP ${s.status} (keepalive=${c})`;return s.status>=500?(L.debug(u),{status:`retryable`,error:l}):(L.warn(u),{status:`failure`,error:l})}catch(e){let t=e instanceof Error?e:Error(String(e)),n=t instanceof TypeError||t instanceof DOMException&&t.name===`TimeoutError`,r=`Fetch transport failed (keepalive=${c}): ${t.message}`;return n?L.debug(r):L.warn(r),{status:n?`retryable`:`failure`,error:t}}finally{s!==void 0&&clearTimeout(s),c&&(gl-=i.byteLength,_l--)}})()}};let yl=e=>new vl(e),bl=()=>Math.random()*40-20;var xl=class{constructor(e,t=new Ci){this._transport=e,this._perf=t}send(e,t){var n=this;return B(function*(){let r=n._perf.getNowMillis()+t,i=yield n._transport.send(e,t),a=5,o=1e3;for(;i.status===`retryable`&&a>0;){var s;a--;let t=Math.max(Math.min(o,5e3)+bl(),0);o*=1.5;let c=(s=i.retryInMillis)==null?t:s,l=r-n._perf.getNowMillis();if(c>l)return i;i=yield n._retry(e,l,c)}return i})()}shutdown(){this._transport.shutdown()}_retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}};let Sl=e=>{var t;return new xl(e.transport,(t=e.perf)==null?new Ci:t)},Cl=(e,t)=>ml(e,t,Sl({transport:yl(e)}));var wl=class extends ol{constructor(e){super(Cl(e,Zc))}};let Tl=(e,t)=>`${_c(e,t)}/v1/logs`;var El=class extends wl{constructor({appID:e,userID:t,mxlDataURL:n}){super(H(H({},hc),{},{headers:gc(e,t),url:Tl(e,n)}))}},Dl=class extends ol{constructor(e){super(Cl(H(H({},e),{},{compression:`gzip`}),al))}};let Ol=(e,t)=>`${_c(e,t)}/v1/traces`;var kl=class extends Dl{constructor({appID:e,userID:t,mxlDataURL:n}){super(H(H({},hc),{},{headers:gc(e,t),url:Ol(e,n)}))}},Al=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`browser.url.full`]||e.setAttribute(St,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}},jl=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){e.attributes[`browser.url.full`]||(e.attributes[St]=this._urlDocument.URL)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Ml=class{constructor({spanSessionManager:e}){z(this,`_spanSessionManager`,void 0),this._spanSessionManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.setAttributes({"log.record.uid":mt(),[La]:this._spanSessionManager.getSessionId(),"session.previous_id":this._spanSessionManager.getPreviousSessionId()})}shutdown(){return Promise.resolve(void 0)}},Nl=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&e.setAttribute(t.key,t.scrub(n))})}shutdown(){return Promise.resolve(void 0)}},Pl=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`mxl.type`]||e.setAttribute(_t,`sys.log`),e.setAttribute(fn,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}};let Fl=e=>{if((e.attributes[`http.request.method`]||e.attributes[`http.method`])&&(typeof e.attributes[`http.response.status_code`]==`number`||typeof e.attributes[`http.status_code`]==`number`)){var t;let n=(t=e.attributes[`url.full`])==null?e.attributes[Zt]:t;return typeof n==`string`&&n.includes(`://`)}return!1};var Il=class{forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(Fl(e)){var t,n,r,i,a;e.attributes[_t]=`perf.network_request`,(t=e.attributes)[`url.full`]!=null||(t[`url.full`]=e.attributes[`http.url`]),(n=e.attributes)[`http.response.status_code`]!=null||(n[`http.response.status_code`]=e.attributes[`http.status_code`]),(r=e.attributes)[`http.request.method`]!=null||(r[`http.request.method`]=e.attributes[`http.method`]),(i=e.attributes)[`http.response.body.size`]!=null||(i[`http.response.body.size`]=e.attributes[`http.response_content_length`]),(a=e.attributes)[`http.request.body.size`]!=null||(a[`http.request.body.size`]=e.attributes[`http.request_content_length`])}}onStart(){}shutdown(){return Promise.resolve(void 0)}};let Ll=e=>e.attributes[_t]===`ux.session`,Rl=(e,t)=>`mxl.${t===`current`?`export_failed`:`previous_export_failed`}.${e}`;var zl=class{constructor({resource:e,exporter:t,limitManager:n,spanSessionManager:r,storage:i=window.localStorage,storedSpansExpireTimeoutMS:a,diag:o=L.createComponentLogger({namespace:`MXLSessionBatchedSpanProcessor`})}){z(this,`_shutdownOnce`,void 0),z(this,`_pendingSpans`,[]),z(this,`_exporter`,void 0),z(this,`_limitManager`,void 0),z(this,`_spanStorage`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_diag`,void 0),z(this,`_shutdown`,()=>(this._spanStorage.destroy(),this._exporter.shutdown())),this._diag=o,this._exporter=t,this._shutdownOnce=new hr(this._shutdown,this),this._limitManager=n,this._spanSessionManager=r,this._spanStorage=new bi({resource:e,storage:i,diag:o,onExpiredSpansExport:e=>{this._exportSpans(e)},storedSpansExpireTimeoutMS:a,spanSessionManager:r})}forceFlush(){return this._diag.debug(`forceFlush called for MXLSessionBatchedSpanProcessor. This is a no op`),Promise.resolve(void 0)}onEnd(e){if(this._shutdownOnce.isCalled){this._diag.debug(`span ended after processor shutdown. Ignoring span.`);return}if(Ll(e))this._diag.debug(`session span ended. Exporting all pending spans.`),this._exportSpans([e,...this._pendingSpans]),this._pendingSpans=[];else{if(this._diag.debug(`non-session span ended. Adding to pending spans queue.`),this._limitManager.dropReadableSpan(e))return;this._pendingSpans.push(e)}}_exportSpans(e){_r._export(this._exporter,e).then(e=>{if(e.code===Dn.FAILED){var t;let n=((t=e.error)==null?void 0:t.message)||`unknown error`,r=`unknown`;n===`Concurrent export limit reached`?r=`concurrent_limit`:n===`Fetch request errored`&&(r=`fetch_error`),this._spanSessionManager.incrSessionCountForKey(Rl(r,`current`)),this._spanSessionManager.incrNextSessionCountForKey(Rl(r,`previous`)),this._diag.error(`spans failed to export: ${n}`)}}).catch(e=>{let t=`unknown error`;e&&e instanceof Error?t=e.message:typeof e==`string`&&(t=e),this._spanSessionManager.incrSessionCountForKey(Rl(`unknown`,`current`)),this._spanSessionManager.incrNextSessionCountForKey(Rl(`unknown`,`previous`)),this._diag.error(`spans failed to export: ${t}`)})}onStart(){}getPendingSpansCount(){return this._pendingSpans.length}storePendingSpans(e,t){this._spanStorage.storePendingSpans(e,t,this._pendingSpans)}clearStoredSpans(e){this._spanStorage.clearStoredSpans(e)}shutdown(){return this._shutdownOnce.call()}},Bl=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute();t&&(e.setAttribute(Ct,t.path),e.setAttribute(wt,this._pageManager.getCurrentPageId()))}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&e.setAttribute(Tt,t)}shutdown(){return Promise.resolve(void 0)}},Vl=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.attributes[Ct]=t.path,e.attributes[wt]=n)}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&(e.attributes[Tt]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Hl=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&(e.attributes[t.key]=t.scrub(n))})}onStart(){}shutdown(){return Promise.resolve(void 0)}},Ul=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._userManager.getUserId()&&e.setAttributes({[Ra]:this._userManager.getUserId()})}shutdown(){return Promise.resolve(void 0)}},Wl=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){let t=this._userManager.getUserId();t&&(e.attributes[Ra]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Gl=class extends Hn{inject(e,t,n){super.inject(e,t,n);let r=R.getSpan(e);if(r){let e=t instanceof Headers?t.get(`traceparent`):ve.get(t,`traceparent`);e&&r.setAttribute(`mxl.w3c_traceparent`,e)}}};let Kl=/\/\/(.+):(.+)@(.+)\//,ql=[`AWSAccessKeyId`,`Signature`,`sig`,"`X-Goog-Signature",`password`,`auth`,`pw`,`token`],Jl=({value:e,queryParamRegex:t,scrubPath:n,scrubQuery:r})=>{let i=e;return n&&(i=i.replace(Kl,`//REDACTED:REDACTED@$3/`)),r&&(i=i.replaceAll(t,`$1$2=REDACTED`)),i},Yl=e=>{let t=[...ql,...e||[]],n=RegExp(`(^|&|\\?)(${t.join(`|`)})=[^&]+`,`g`);return[{key:fn,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:Zt,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:`url.path`,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!1})},{key:`url.query`,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!1,scrubQuery:!0})}]},Xl=new class{constructor({diagLogger:e=L.createComponentLogger({namespace:`mxl-registry`})}={}){z(this,`_sdk`,null),z(this,`_diag`,void 0),z(this,`register`,e=>{this._sdk!==null&&this._diag.warn(`previously registered sdk will be overwritten`),this._sdk=e}),z(this,`clear`,()=>{this._sdk===null&&this._diag.warn(`sdk already cleared, this is a no-op`),this._sdk=null}),z(this,`registered`,()=>this._sdk),this._diag=e}};var Zl;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Zl||(Zl={}));let Ql=L.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function $l(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=eu(t.body);return t.body=e,n}else return Promise.resolve(nu(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>iu(e)):Promise.resolve()}}function eu(e){if(!e.pipeThrough)return Ql.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},transform(e,n){return B(function*(){let r=yield e;t+=r.byteLength,n.enqueue(e)})()},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function tu(e){return typeof Document<`u`&&e instanceof Document}function nu(e){if(tu(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return iu(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return au(e);if(e instanceof URLSearchParams)return iu(e.toString());if(e.byteLength!==void 0)return e.byteLength;Ql.warn(`unknown body type`)}let ru=new TextEncoder;function iu(e){return ru.encode(e).byteLength}function au(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function ou(e){let t=lu(),n=e.toUpperCase();return n in t?n:`_OTHER`}let su={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},cu;function lu(){return cu===void 0&&(cu=su),cu}let uu={"https:":`443`,"http:":`80`};function du(e){let t=Number(e.port||uu[e.protocol]);if(t&&!isNaN(t))return t}let fu=`0.218.0`,pu=typeof PerformanceObserver<`u`;var mu=class extends Pa{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,fu,e),z(this,`component`,`fetch`),z(this,`version`,fu),z(this,`moduleName`,this.component),z(this,`_usedResources`,new WeakSet),z(this,`_tasksCount`,0),z(this,`_semconvStability`,void 0),this._semconvStability=Ia(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[V.FETCH_START]},R.setSpan(I.active(),e)),r=!(this._semconvStability&U.OLD);di(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[V.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=_i(t.url);if(this._semconvStability&U.OLD&&(e.setAttribute(`http.status_code`,t.status),t.statusText!=null&&e.setAttribute(Zl.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(`http.host`,n.host),e.setAttribute(`http.scheme`,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(`http.user_agent`,navigator.userAgent)),this._semconvStability&U.STABLE){e.setAttribute(an,t.status),e.setAttribute(on,n.hostname);let r=du(n);r&&e.setAttribute(sn,r)}}_addHeaders(e,t){if(!vi(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};st.inject(I.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)st.inject(I.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t=new Headers(e.headers);st.inject(I.active(),t,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))}),e.headers=t}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(pr(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&U.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Zl.COMPONENT]=this.moduleName,r[`http.method`]=i,r[`http.url`]=e}if(this._semconvStability&U.STABLE){let i=t.method,a=ou(t.method||`GET`);n||(n=a),r[nn]=a,a!==i&&(r[rn]=i),r[fn]=e}return this.tracer.startSpan(n,{kind:Je.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=mi(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&U.OLD);di(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=vn(Date.now()),i=yn();this._addFinalSpanAttributes(e,n),this._semconvStability&U.STABLE&&n.status>=400&&(e.setStatus({code:Ye.ERROR}),e.setAttribute(Qt,String(n.status))),setTimeout(()=>{var n;(n=t.observer)==null||n.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=_i(n[0]instanceof Request?n[0].url:String(n[0])).href,a;a=n[0]instanceof Request?n[1]==null?n[0]:new Request(n[0],n[1]):n[1]||{};let o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&$l(...n).then(e=>{e&&(t._semconvStability&U.OLD&&o.setAttribute(`http.request_content_length_uncompressed`,e),t._semconvStability&U.STABLE&&o.setAttribute(`http.request.body.size`,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}catch(n){t._diag.error(`Failed to read fetch response body`,n),t._endSpan(e,s,{status:0,url:i})}return n}function d(e,n){try{c(e,n)}catch(r){t._diag.error(`Failed to end span on fetch error`,r),t._endSpan(e,s,{status:n.status||0,url:i})}throw n}return I.with(R.setSpan(I.active(),o),()=>(t._callRequestHook(o,a),t._addHeaders(a,i),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o),d.bind(r,o))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&Fa(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&Fa(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=yn(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(!pu){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug(`fetch constructor already patched`),this._isEnabled=!0;return}try{this._wrap(globalThis,`fetch`,this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(e){this._diag.warn(`Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.`,e)}}}disable(){pu&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}},hu;(function(e){e.METHOD_OPEN=`open`,e.METHOD_SEND=`send`,e.EVENT_ABORT=`abort`,e.EVENT_ERROR=`error`,e.EVENT_LOAD=`loaded`,e.EVENT_TIMEOUT=`timeout`})(hu||(hu={}));let gu=L.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`});function _u(e){return typeof Document<`u`&&e instanceof Document}function vu(e){if(_u(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return bu(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return xu(e);if(e instanceof URLSearchParams)return bu(e.toString());if(e.byteLength!==void 0)return e.byteLength;gu.warn(`unknown body type`)}let yu=new TextEncoder;function bu(e){return yu.encode(e).byteLength}function xu(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Su(e){let t=Tu(),n=e.toUpperCase();return n in t?n:`_OTHER`}let Cu={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},wu;function Tu(){return wu===void 0&&(wu=Cu),wu}let Eu={"https:":`443`,"http:":`80`};function Du(e){let t=Number(e.port||Eu[e.protocol]);if(t&&!isNaN(t))return t}let Ou=`0.218.0`;var ku;(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(ku||(ku={}));var Au=class extends Pa{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,Ou,e),z(this,`component`,`xml-http-request`),z(this,`version`,Ou),z(this,`moduleName`,this.component),z(this,`_tasksCount`,0),z(this,`_xhrMem`,new WeakMap),z(this,`_usedResources`,new WeakSet),z(this,`_semconvStability`,void 0),this._semconvStability=Ia(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addHeaders(e,t){let n=_i(t).href;if(!vi(n,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};st.inject(I.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let r={};st.inject(I.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){I.with(R.setSpan(I.active(),e),()=>{let e=this.tracer.startSpan(`CORS Preflight`,{startTime:t[V.FETCH_START]}),n=!(this._semconvStability&U.OLD);di(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[V.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&U.OLD){if(t.status!==void 0&&e.setAttribute(`http.status_code`,t.status),t.statusText!==void 0&&e.setAttribute(ku.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=_i(n);e.setAttribute(`http.host`,t.host),e.setAttribute(`http.scheme`,t.protocol.replace(`:`,``))}e.setAttribute(`http.user_agent`,navigator.userAgent)}this._semconvStability&U.STABLE&&t.status&&e.setAttribute(an,t.status)}_applyAttributesAfterXHR(e,t){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n==`function`&&Fa(()=>n(e,t),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_addResourceObserver(e,t){let n=this._xhrMem.get(e);!n||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(n.createdResources={observer:new PerformanceObserver(e=>{let r=e.getEntries(),i=_i(t);r.forEach(e=>{e.initiatorType===`xmlhttprequest`&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(hn.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!n||!r||!i||!e.createdResources)return;let a=e.createdResources.entries;(!a||!a.length)&&(a=hn.getEntriesByType(`resource`));let o=mi(_i(n).href,r,i,a,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&U.OLD);di(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){let r=_i(t);if(pr(r.href,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let i=``,a={};if(this._semconvStability&U.OLD&&(i=n.toUpperCase(),a[`http.method`]=n,a[`http.url`]=r.toString()),this._semconvStability&U.STABLE){let e=n,t=Su(n);i||(i=t),a[nn]=t,t!==e&&(a[rn]=e),a[fn]=r.toString(),a[on]=r.hostname;let o=Du(r);o&&(a[sn]=o)}let o=this.tracer.startSpan(i,{kind:Je.CLIENT,attributes:a});return o.addEvent(hu.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:o,spanUrl:t}),o}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){let e=this;function t(t,n,r,i){let a=n.callbackToRemoveEvents;typeof a==`function`&&a();let{span:o,spanUrl:s,sendStartTime:c}=n;o&&(e._findResourceAndAddNetworkEvents(n,o,s,c,r),o.addEvent(t,i),e._addFinalSpanAttributes(o,n,s),o.end(i),e._tasksCount--),e._clearResources()}function n(n,r,i,a){let o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){let t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&U.STABLE&&(i?a&&(t.setStatus({code:Ye.ERROR,message:a}),t.setAttribute(Qt,a)):o.status&&o.status>=400&&(t.setStatus({code:Ye.ERROR}),t.setAttribute(Qt,String(o.status))))}let s=yn(),c=Date.now();setTimeout(()=>{t(n,o,s,c)},300)}function r(){n(hu.EVENT_ERROR,this,!0,`error`)}function i(){n(hu.EVENT_ABORT,this,!1)}function a(){n(hu.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(hu.EVENT_LOAD,this,!1):n(hu.EVENT_ERROR,this,!1)}function s(t){t.removeEventListener(`abort`,i),t.removeEventListener(`error`,r),t.removeEventListener(`load`,o),t.removeEventListener(`timeout`,a);let n=e._xhrMem.get(t);n&&(n.callbackToRemoveEvents=void 0)}return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let c=e._xhrMem.get(this);if(!c)return t.apply(this,n);let l=c.span,u=c.spanUrl;if(l&&u){if(e.getConfig().measureRequestSize&&n!=null&&n[0]){let t=n[0],r=vu(t);r!==void 0&&(e._semconvStability&U.OLD&&l.setAttribute(`http.request_content_length_uncompressed`,r),e._semconvStability&U.STABLE&&l.setAttribute(`http.request.body.size`,r))}I.with(R.setSpan(I.active(),l),()=>{e._tasksCount++,c.sendStartTime=yn(),l.addEvent(hu.METHOD_SEND),this.addEventListener(`abort`,i),this.addEventListener(`error`,r),this.addEventListener(`load`,o),this.addEventListener(`timeout`,a),c.callbackToRemoveEvents=()=>{s(this),c.createdResources&&c.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,n)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug(`reactivating existing patch on`,this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug(`applying patch to`,this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(e){this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.warn(`Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.`,e)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}};let ju=(e={},{logManager:t,spanSessionManager:n,pageManager:r,limitManager:i})=>{var a,o,s,c,l,u,d,f,p,m;let h=[new Wo(e[`session-visibility`]),new Uo(e[`session-activity`])];if((a=e.omit)!=null&&a.has(`exception`)||h.push(new ao(e.exception)),(o=e.omit)!=null&&o.has(`click`)||h.push(new ro(e.click)),(s=e.omit)!=null&&s.has(`web-vital`)||h.push(new Ys(H(H({},e[`web-vital`]),{},{pageManager:r}))),(c=e.omit)!=null&&c.has(`loaf`)||h.push(new oo(H({},e.loaf))),(l=e.omit)!=null&&l.has(`user-timing`)||h.push(new Jo(e[`user-timing`])),(u=e.omit)!=null&&u.has(`element-timing`)||h.push(new io(H(H({},e[`element-timing`]),{},{limitManager:i}))),(d=e.omit)!=null&&d.has(`document-load`)||h.push(new eo(e[`document-load`])),(f=e.omit)!=null&&f.has(`server-timing`)||h.push(new fo(H(H({},e[`server-timing`]),{},{limitManager:i}))),!((p=e.omit)!=null&&p.has(`@opentelemetry/instrumentation-fetch`))){var g,_,v,y;h.push(new mu(H(H({},e[`@opentelemetry/instrumentation-fetch`]),{},{ignoreUrls:[...(g=(_=e.network)==null?void 0:_.ignoreUrls)==null?[]:g,...(v=(y=e[`@opentelemetry/instrumentation-fetch`])==null?void 0:y.ignoreUrls)==null?[]:v]})))}if(!((m=e.omit)!=null&&m.has(`@opentelemetry/instrumentation-xml-http-request`))){var b,x,S,C;h.push(new Au(H(H({},e[`@opentelemetry/instrumentation-xml-http-request`]),{},{ignoreUrls:[...(b=(x=e.network)==null?void 0:x.ignoreUrls)==null?[]:b,...(S=(C=e[`@opentelemetry/instrumentation-xml-http-request`])==null?void 0:C.ignoreUrls)==null?[]:S]})))}e[`empty-root`]&&h.push(new to(H({},e[`empty-root`])));for(let e of h)e instanceof Xa&&(n&&e.setSessionManager(n),t&&e.setLogManager(t),i&&e.setLimitManager(i));return h};
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var W=function(){return W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},W.apply(this,arguments)};function Mu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,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 Nu(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function G(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function K(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Pu;(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})(Pu||(Pu={}));function Fu(e){return e.nodeType===e.ELEMENT_NODE}function Iu(e){var t,n=(t=e)==null?void 0:t.host;return!!(n&&n.shadowRoot&&n.shadowRoot===e)}function Lu(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,a=e.maskInputFn,o=i||``;return(t[n.toLowerCase()]||t[r])&&(o=a?a(o):`*`.repeat(o.length)),o}var Ru=`__rrweb_original__`;function zu(e){var t=e.getContext(`2d`);if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var a=t.getImageData,o=Ru in a?a[Ru]:a;if(new Uint32Array(o.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(function(e){return e!==0}))return!1}return!0}var Bu=1,Vu=RegExp(`[^a-z0-9-_:]`);function Hu(){return Bu++}function Uu(e){if(e instanceof HTMLFormElement)return`form`;var t=e.tagName.toLowerCase().trim();return Vu.test(t)?`div`:t}function Wu(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Gu).join(``):null}catch(e){return null}}function Gu(e){var t=e.cssText;if(Ku(e))try{t=Wu(e.styleSheet)||t}catch(e){}return t}function Ku(e){return`styleSheet`in e}function qu(e){return e.cssRules?Array.from(e.cssRules).map(function(e){return e.cssText||``}).join(``):``}function Ju(e){var t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var Yu,Xu,Zu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Qu=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,$u=/^(data:)([^,]*),(.*)/i;function ed(e,t){return(e||``).replace(Zu,function(e,n,r,i,a,o){var s=r||a||o,c=n||i||``;if(!s)return e;if(!Qu.test(s)||$u.test(s))return`url(`+c+s+c+`)`;if(s[0]===`/`)return`url(`+c+(Ju(t)+s)+c+`)`;var l=t.split(`/`),u=s.split(`/`);l.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];p!==`.`&&(p===`..`?l.pop():l.push(p))}return`url(`+c+l.join(`/`)+c+`)`})}var td=/^[^ \t\n\r\u000c]+/,nd=/^[, \t\n\r\u000c]+/;function rd(e,t){if(t.trim()===``)return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}for(var i=[];r(nd),!(n>=t.length);){var a=r(td);if(a.slice(-1)===`,`)a=id(e,a.substring(0,a.length-1)),i.push(a);else{var o=``;a=id(e,a);for(var s=!1;;){var c=t.charAt(n);if(c===``){i.push((a+o).trim());break}else if(s)c===`)`&&(s=!1);else if(c===`,`){n+=1,i.push((a+o).trim());break}else c===`(`&&(s=!0);o+=c,n+=1}}}return i.join(`, `)}function id(e,t){if(!t||t.trim()===``)return t;var n=e.createElement(`a`);return n.href=t,n.href}function ad(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function od(){var e=document.createElement(`a`);return e.href=``,e.href}function sd(e,t,n,r){return n===`src`||n===`href`&&r||n===`xlink:href`&&r&&r[0]!==`#`||n===`background`&&r&&(t===`table`||t===`td`||t===`th`)?id(e,r):n===`srcset`&&r?rd(e,r):n===`style`&&r?ed(r,od()):t===`object`&&n===`data`&&r?id(e,r):r}function cd(e,t,n){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n?e.matches(n):!1}function ld(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n&&e.matches(n)?!0:ld(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,ld(e.parentNode,t,n)}function ud(e,t,n){var r=e.contentWindow;if(r){var i=!1,a;try{a=r.document.readyState}catch(e){return}if(a!==`complete`){var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener(`load`,function(){clearTimeout(o),i=!0,t()});return}var s=`about:blank`;if(r.location.href!==s||e.src===s||e.src===``){setTimeout(t,0);return}e.addEventListener(`load`,t)}}function dd(e,t){var n,r=t.doc,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,p=t.dataURLOptions,m=p===void 0?{}:p,h=t.inlineImages,g=t.recordCanvas,_=t.keepIframeSrcFn,v;if(r.__sn){var y=r.__sn.id;v=y===1?void 0:y}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:Pu.Document,childNodes:[],rootId:v}:{type:Pu.Document,childNodes:[],compatMode:e.compatMode,rootId:v};case e.DOCUMENT_TYPE_NODE:return{type:Pu.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:for(var b=cd(e,i,a),x=Uu(e),S={},C=0,w=Array.from(e.attributes);C<w.length;C++){var ee=w[C],T=ee.name,E=ee.value;S[T]=sd(r,x,T,E)}if(x===`link`&&c){var D=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),te=null;D&&(te=Wu(D)),te&&(delete S.rel,delete S.href,S._cssText=ed(te,D.href))}if(x===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){var te=Wu(e.sheet);te&&(S._cssText=ed(te,od()))}if(x===`input`||x===`textarea`||x===`select`){var E=e.value;S.type!==`radio`&&S.type!==`checkbox`&&S.type!==`submit`&&S.type!==`button`&&E?S.value=Lu({type:S.type,tagName:x,value:E,maskInputOptions:u,maskInputFn:f}):e.checked&&(S.checked=e.checked)}if(x===`option`&&(e.selected&&!u.select?S.selected=!0:delete S.selected),x===`canvas`&&g){if(e.__context===`2d`)zu(e)||(S.rr_dataURL=e.toDataURL(m.type,m.quality));else if(!(`__context`in e)){var O=e.toDataURL(m.type,m.quality),k=document.createElement(`canvas`);k.width=e.width,k.height=e.height,O!==k.toDataURL(m.type,m.quality)&&(S.rr_dataURL=O)}}if(x===`img`&&h){Yu||(Yu=r.createElement(`canvas`),Xu=Yu.getContext(`2d`));var A=e,j=A.crossOrigin;A.crossOrigin=`anonymous`;var ne=function(){try{Yu.width=A.naturalWidth,Yu.height=A.naturalHeight,Xu.drawImage(A,0,0),S.rr_dataURL=Yu.toDataURL(m.type,m.quality)}catch(e){console.warn(`Cannot inline img src=`+A.currentSrc+`! Error: `+e)}j?S.crossOrigin=j:delete S.crossOrigin};A.complete&&A.naturalWidth!==0?ne():A.onload=ne}if((x===`audio`||x===`video`)&&(S.rr_mediaState=e.paused?`paused`:`played`,S.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop),b){var re=e.getBoundingClientRect(),ie=re.width,M=re.height;S={class:S.class,rr_width:ie+`px`,rr_height:M+`px`}}return x===`iframe`&&!_(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src),{type:Pu.Element,tagName:x,attributes:S,childNodes:[],isSVG:ad(e)||void 0,needBlock:b,rootId:v};case e.TEXT_NODE:var ae=e.parentNode&&e.parentNode.tagName,N=e.textContent,P=ae===`STYLE`?!0:void 0,F=ae===`SCRIPT`?!0:void 0;if(P&&N){try{e.nextSibling||e.previousSibling||(n=e.parentNode.sheet)!=null&&n.cssRules&&(N=qu(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: `+t,e)}N=ed(N,od())}return F&&(N=`SCRIPT_PLACEHOLDER`),!P&&!F&&ld(e,o,s)&&N&&(N=d?d(N):N.replace(/[\S]/g,`*`)),{type:Pu.Text,textContent:N||``,isStyle:P,rootId:v};case e.CDATA_SECTION_NODE:return{type:Pu.CDATA,textContent:``,rootId:v};case e.COMMENT_NODE:return{type:Pu.Comment,textContent:e.textContent||``,rootId:v};default:return!1}}function q(e){return e===void 0?``:e.toLowerCase()}function fd(e,t){return!!(t.comment&&e.type===Pu.Comment||e.type===Pu.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&e.attributes.rel===`preload`&&e.attributes.as===`script`||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&e.attributes.href.endsWith(`.js`))||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||q(e.attributes.name)===`application-name`||q(e.attributes.rel)===`icon`||q(e.attributes.rel)===`apple-touch-icon`||q(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&q(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(q(e.attributes.property).match(/^(og|twitter|fb):/)||q(e.attributes.name).match(/^(og|twitter):/)||q(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(q(e.attributes.name)===`robots`||q(e.attributes.name)===`googlebot`||q(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(q(e.attributes.name)===`author`||q(e.attributes.name)===`generator`||q(e.attributes.name)===`framework`||q(e.attributes.name)===`publisher`||q(e.attributes.name)===`progid`||q(e.attributes.property).match(/^article:/)||q(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(q(e.attributes.name)===`google-site-verification`||q(e.attributes.name)===`yandex-verification`||q(e.attributes.name)===`csrf-token`||q(e.attributes.name)===`p:domain_verify`||q(e.attributes.name)===`verify-v1`||q(e.attributes.name)===`verification`||q(e.attributes.name)===`shopify-checkout-api-token`))))}function pd(e,t){var n=t.doc,r=t.map,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,p=f===void 0?{}:f,m=t.maskTextFn,h=t.maskInputFn,g=t.slimDOMOptions,_=t.dataURLOptions,v=_===void 0?{}:_,y=t.inlineImages,b=y===void 0?!1:y,x=t.recordCanvas,S=x===void 0?!1:x,C=t.onSerialize,w=t.onIframeLoad,ee=t.iframeLoadTimeout,T=ee===void 0?5e3:ee,E=t.keepIframeSrcFn,D=E===void 0?function(){return!1}:E,te=t.preserveWhiteSpace,O=te===void 0?!0:te,k=dd(e,{doc:n,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,dataURLOptions:v,inlineImages:b,recordCanvas:S,keepIframeSrcFn:D});if(!k)return console.warn(e,`not serialized`),null;var A=`__sn`in e?e.__sn.id:fd(k,g)||!O&&k.type===Pu.Text&&!k.isStyle&&!k.textContent.replace(/^\s+|\s+$/gm,``).length?-2:Hu(),j=Object.assign(k,{id:A});if(e.__sn=j,A===-2)return null;r[A]=e,C&&C(e);var ne=!l;if(j.type===Pu.Element&&(ne=ne&&!j.needBlock,delete j.needBlock,e.shadowRoot&&(j.isShadowHost=!0)),(j.type===Pu.Document||j.type===Pu.Element)&&ne){g.headWhitespace&&k.type===Pu.Element&&k.tagName===`head`&&(O=!1);for(var re={doc:n,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D},ie=0,M=Array.from(e.childNodes);ie<M.length;ie++){var ae=M[ie],N=pd(ae,re);N&&j.childNodes.push(N)}if(Fu(e)&&e.shadowRoot)for(var P=0,F=Array.from(e.shadowRoot.childNodes);P<F.length;P++){var ae=F[P],N=pd(ae,re);N&&(N.isShadow=!0,j.childNodes.push(N))}}return e.parentNode&&Iu(e.parentNode)&&(j.isShadow=!0),j.type===Pu.Element&&j.tagName===`iframe`&&ud(e,function(){var t=e.contentDocument;if(t&&w){var n=pd(t,{doc:t,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D});n&&w(e,n)}},T),j}function md(e,t){var n=t||{},r=n.blockClass,i=r===void 0?`rr-block`:r,a=n.blockSelector,o=a===void 0?null:a,s=n.maskTextClass,c=s===void 0?`rr-mask`:s,l=n.maskTextSelector,u=l===void 0?null:l,d=n.inlineStylesheet,f=d===void 0?!0:d,p=n.inlineImages,m=p===void 0?!1:p,h=n.recordCanvas,g=h===void 0?!1:h,_=n.maskAllInputs,v=_===void 0?!1:_,y=n.maskTextFn,b=n.maskInputFn,x=n.slimDOM,S=x===void 0?!1:x,C=n.dataURLOptions,w=n.preserveWhiteSpace,ee=n.onSerialize,T=n.onIframeLoad,E=n.iframeLoadTimeout,D=n.keepIframeSrcFn,te=D===void 0?function(){return!1}:D,O={};return[pd(e,{doc:e,map:O,blockClass:i,blockSelector:o,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:v===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:v===!1?{password:!0}:v,maskTextFn:y,maskInputFn:b,slimDOMOptions:S===!0||S===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:C,inlineImages:m,recordCanvas:g,preserveWhiteSpace:w,onSerialize:ee,onIframeLoad:T,iframeLoadTimeout:E,keepIframeSrcFn:te}),O]}var J;(function(e){e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`})(J||(J={}));var hd;(function(e){e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`})(hd||(hd={}));var gd;(function(e){e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`})(gd||(gd={}));var _d;(function(e){e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`})(_d||(_d={}));var vd;(function(e){e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`})(vd||(vd={}));var yd;(function(e){e.Start=`start`,e.Pause=`pause`,e.Resume=`resume`,e.Resize=`resize`,e.Finish=`finish`,e.FullsnapshotRebuilded=`fullsnapshot-rebuilded`,e.LoadStylesheetStart=`load-stylesheet-start`,e.LoadStylesheetEnd=`load-stylesheet-end`,e.SkipStart=`skip-start`,e.SkipEnd=`skip-end`,e.MouseInteraction=`mouse-interaction`,e.EventCast=`event-cast`,e.CustomEvent=`custom-event`,e.Flush=`flush`,e.StateChange=`state-change`,e.PlayBack=`play-back`})(yd||(yd={}));function bd(e,t,n){n===void 0&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}function xd(){return{map:{},getId:function(e){return!e||!e.__sn?-1:e.__sn.id},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}var Sd=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
"use strict";window.MXLWebSdk=window.MXLWebSdk||(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f,p=s((()=>{f=`1.9.1`}));function m(e){let t=new Set([e]),n=new Set,r=e.match(h);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(h);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var h,g,_=s((()=>{p(),h=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,g=m(f)}));function v(e,t,n,r=!1){var i;let a=C[S]=(i=C[S])==null?{version:f}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${f}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${f}.`),!0}function y(e){var t,n;let r=(t=C[S])==null?void 0:t.version;if(!(!r||!g(r)))return(n=C[S])==null?void 0:n[e]}function b(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${f}.`);let n=C[S];n&&delete n[e]}var x,S,C,w=s((()=>{p(),_(),x=f.split(`.`)[0],S=Symbol.for(`opentelemetry.js.api.${x}`),C=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function ee(e,t,n){let r=y(`diag`);if(r)return r[e](t,...n)}var T,E=s((()=>{w(),T=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return ee(`debug`,this._namespace,e)}error(...e){return ee(`error`,this._namespace,e)}info(...e){return ee(`info`,this._namespace,e)}warn(...e){return ee(`warn`,this._namespace,e)}verbose(...e){return ee(`verbose`,this._namespace,e)}}})),D,te=s((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(D||(D={}))}));function O(e,t){e<D.NONE?e=D.NONE:e>D.ALL&&(e=D.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,D.ERROR),warn:n(`warn`,D.WARN),info:n(`info`,D.INFO),debug:n(`debug`,D.DEBUG),verbose:n(`verbose`,D.VERBOSE)}}var k=s((()=>{te()})),A,j,M=s((()=>{E(),k(),te(),w(),A=`diag`,j=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=y(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:D.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=y(`diag`),s=O((i=n.logLevel)==null?D.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return v(`diag`,s,t,!0)},t.disable=()=>{b(A,t)},t.createComponentLogger=e=>new T(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}})),ne,re=s((()=>{ne=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}}})),ie,ae=s((()=>{ie=Symbol(`BaggageEntryMetadata`)}));function N(e={}){return new ne(new Map(Object.entries(e)))}function oe(e){return typeof e!=`string`&&(P.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:ie,toString(){return e}}}var P,se=s((()=>{M(),re(),ae(),P=j.instance()}));function ce(e){return Symbol.for(e)}var le,ue,de=s((()=>{le=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},ue=new le})),fe,pe,me,he=s((()=>{if(fe=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],pe={},typeof console<`u`)for(let e of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[e]==`function`&&(pe[e]=console[e]);me=class{constructor(){function e(e){return function(...t){let n=pe[e];if(typeof n!=`function`&&(n=pe.log),typeof n!=`function`&&console&&(n=console[e],typeof n!=`function`&&(n=console.log)),typeof n==`function`)return n.apply(console,t)}}for(let t=0;t<fe.length;t++)this[fe[t].n]=e(fe[t].c)}}}));function ge(){return De}var _e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe=s((()=>{_e=class{constructor(){}createGauge(e,t){return ke}createHistogram(e,t){return Ae}createCounter(e,t){return Oe}createUpDownCounter(e,t){return je}createObservableGauge(e,t){return Ne}createObservableCounter(e,t){return Me}createObservableUpDownCounter(e,t){return Pe}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ve=class{},ye=class extends ve{add(e,t){}},be=class extends ve{add(e,t){}},xe=class extends ve{record(e,t){}},Se=class extends ve{record(e,t){}},Ce=class{addCallback(e){}removeCallback(e){}},we=class extends Ce{},Te=class extends Ce{},Ee=class extends Ce{},De=new _e,Oe=new ye,ke=new xe,Ae=new Se,je=new be,Me=new we,Ne=new Te,Pe=new Ee})),Ie,Le,Re=s((()=>{Ie={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},Le={set(e,t,n){e!=null&&(e[t]=n)}}})),ze,Be=s((()=>{de(),ze=class{active(){return ue}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),Ve,He,Ue,We=s((()=>{Be(),w(),M(),Ve=`context`,He=new ze,Ue=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return v(Ve,e,j.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return y(Ve)||He}disable(){this._getContextManager().disable(),b(Ve,j.instance())}}})),Ge,Ke=s((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Ge||(Ge={}))})),qe,Je,Ye,Xe=s((()=>{Ke(),qe=`0000000000000000`,Je=`00000000000000000000000000000000`,Ye={traceId:Je,spanId:qe,traceFlags:Ge.NONE}})),Ze,Qe=s((()=>{Xe(),Ze=class{constructor(e=Ye){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function $e(e){return e.getValue(at)||void 0}function et(){return $e(Ue.getInstance().active())}function tt(e,t){return e.setValue(at,t)}function nt(e){return e.deleteValue(at)}function rt(e,t){return tt(e,new Ze(t))}function it(e){var t;return(t=$e(e))==null?void 0:t.spanContext()}var at,ot=s((()=>{de(),Qe(),We(),at=ce(`OpenTelemetry Context Key SPAN`)}));function st(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(ft[e.charCodeAt(t)]|0)+(ft[e.charCodeAt(t+1)]|0)+(ft[e.charCodeAt(t+2)]|0)+(ft[e.charCodeAt(t+3)]|0);return n===t}function ct(e){return st(e,32)&&e!==`00000000000000000000000000000000`}function lt(e){return st(e,16)&&e!==`0000000000000000`}function ut(e){return ct(e.traceId)&<(e.spanId)}function dt(e){return new Ze(e)}var ft,pt=s((()=>{Xe(),Qe(),ft=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function mt(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var ht,gt,_t=s((()=>{We(),ot(),Qe(),pt(),ht=Ue.getInstance(),gt=class{startSpan(e,t,n=ht.active()){if(t!=null&&t.root)return new Ze;let r=n&&it(n);return mt(r)&&ut(r)?new Ze(r):new Ze}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a==null?ht.active():a,c=this.startSpan(e,i,s),l=tt(s,c);return ht.with(l,o,void 0,c)}}})),vt,yt,bt=s((()=>{_t(),vt=new gt,yt=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):vt}}})),xt,St=s((()=>{_t(),xt=class{getTracer(e,t,n){return new gt}}})),Ct,wt,Tt=s((()=>{bt(),St(),Ct=new xt,wt=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new yt(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Ct:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}}})),Et,Dt=s((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Et||(Et={}))})),Ot,kt=s((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(Ot||(Ot={}))})),At,jt=s((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(At||(At={}))})),F,Mt=s((()=>{We(),F=Ue.getInstance()})),I,Nt=s((()=>{M(),I=j.instance()})),Pt,Ft,It=s((()=>{Fe(),Pt=class{getMeter(e,t,n){return De}},Ft=new Pt})),Lt,Rt,zt=s((()=>{It(),w(),M(),Lt=`metrics`,Rt=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return v(Lt,e,j.instance())}getMeterProvider(){return y(Lt)||Ft}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){b(Lt,j.instance())}}})),Bt,Vt=s((()=>{zt(),Bt=Rt.getInstance()})),Ht,Ut=s((()=>{Ht=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}}));function Wt(e){return e.getValue(Jt)||void 0}function Gt(){return Wt(Ue.getInstance().active())}function Kt(e,t){return e.setValue(Jt,t)}function qt(e){return e.deleteValue(Jt)}var Jt,Yt=s((()=>{We(),de(),Jt=ce(`OpenTelemetry Baggage Key`)})),Xt,Zt,Qt,$t=s((()=>{w(),Ut(),Re(),Yt(),se(),M(),Xt=`propagation`,Zt=new Ht,Qt=class e{constructor(){this.createBaggage=N,this.getBaggage=Wt,this.getActiveBaggage=Gt,this.setBaggage=Kt,this.deleteBaggage=qt}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return v(Xt,e,j.instance())}inject(e,t,n=Le){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=Ie){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){b(Xt,j.instance())}_getGlobalPropagator(){return y(Xt)||Zt}}})),en,tn=s((()=>{$t(),en=Qt.getInstance()})),nn,rn,an=s((()=>{w(),Tt(),pt(),ot(),M(),nn=`trace`,rn=class e{constructor(){this._proxyTracerProvider=new wt,this.wrapSpanContext=dt,this.isSpanContextValid=ut,this.deleteSpan=nt,this.getSpan=$e,this.getActiveSpan=et,this.getSpanContext=it,this.setSpan=tt,this.setSpanContext=rt}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=v(nn,this._proxyTracerProvider,j.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return y(nn)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){b(nn,j.instance()),this._proxyTracerProvider=new wt}}})),L,on=s((()=>{an(),L=rn.getInstance()})),R=s((()=>{se(),de(),he(),te(),Fe(),Re(),bt(),Tt(),Dt(),kt(),jt(),Ke(),pt(),Xe(),Mt(),Nt(),Vt(),tn(),on()}));let sn=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.addEventListener(t,n)})},cn=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.removeEventListener(t,n)})};function ln(e,t,n,r=new Set){return new Proxy(e,{get(e,i,a){let o=Reflect.get(e,i,a);return typeof o!=`function`||r.has(i)?o:(...r)=>{try{return o.apply(e,r)}catch(e){let a=e instanceof Error?e.message:`Unknown error`;n.error(`${String(i)}: ${a}`);let o=t[i];return typeof o==`function`?o.apply(t,r):void 0}}}})}let un=new Uint8Array(16),dn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`).toUpperCase()),fn=()=>{crypto.getRandomValues(un);let e=``;for(let t=0;t<16;t++)e+=dn[un[t]];return e},pn=()=>`mxlv2-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,mn=(e,t,n)=>{try{let r=e.getItem(t),i=r?parseInt(r,10):0;return Number.isNaN(i)&&(n.warn(`Non-numeric value stored at ${t} (${String(r)}); resetting counter.`),i=0),i++,e.setItem(t,i.toString()),i}catch(e){return n.warn(`Failed to retrieve ${t} from storage: `,e),1}},hn=`mxl.type`,gn=`mxl.state`,_n=`mxl.properties.`,vn=`react.component_stack`,yn=`mxl.instrumentation`,bn=`mxl.js_file_bundle_ids`,xn=`browser.url.full`,Sn=`app.surface.name`,Cn=`app.surface.id`,wn=`app.surface.label`,Tn=e=>e.visibilityState===`hidden`?`background`:`foreground`,En=globalThis,Dn=(e,t)=>!t||t<=0||t>100?!1:t>=On(e),On=e=>{if(e.length<6)return 0;let t=e.slice(-6),n=Math.pow(16,6)-1;return parseInt(t,16)/n*100};function kn(e){return e.setValue(jn,!0)}function An(e){return e.getValue(jn)===!0}var jn,Mn=s((()=>{R(),jn=ce(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)})),Nn,Pn,Fn=s((()=>{Nn=`baggage`,Pn=4096}));function In(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ln(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Rn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch(e){return}let c;return t!==-1&&t<e.length-1&&(c=oe(e.substring(t+1))),{key:o,value:s,metadata:c}}var zn=s((()=>{R(),Fn()})),Bn,Vn=s((()=>{R(),Mn(),Fn(),zn(),Bn=class{inject(e,t,n){let r=en.getBaggage(e);if(!r||An(e))return;let i=In(Ln(r).filter(e=>e.length<=Pn).slice(0,180));i.length>0&&n.set(t,Nn,i)}extract(e,t,n){let r=n.get(t,Nn),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Rn(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:en.setBaggage(e,en.createBaggage(a))}fields(){return[Nn]}}}));function Hn(e){"@babel/helpers - typeof";return Hn=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Hn(e)}var Un=s((()=>{}));function Wn(e,t){if(Hn(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Hn(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Gn=s((()=>{Un()}));function Kn(e){var t=Wn(e,`string`);return Hn(t)==`symbol`?t:t+``}var qn=s((()=>{Un(),Gn()}));function z(e,t,n){return(t=Kn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var B=s((()=>{qn()}));function Jn(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Yn(n)){I.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Xn(r)){I.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Yn(e){return typeof e==`string`&&e!==``}function Xn(e){return e==null?!0:Array.isArray(e)?Zn(e):Qn(typeof e)}function Zn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Qn(e)){t=e;continue}return!1}return!1}}return!0}function Qn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var $n=s((()=>{R()}));function er(){return e=>{I.error(tr(e))}}function tr(e){return typeof e==`string`?e:JSON.stringify(nr(e))}function nr(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var rr=s((()=>{R()}));function ir(e){try{ar(e)}catch(e){}}var ar,or=s((()=>{rr(),ar=er()})),sr=s((()=>{})),cr,lr=s((()=>{cr=`2.7.1`})),ur,dr,fr=s((()=>{ur=`http.url`,dr=ur})),pr=s((()=>{fr()})),mr=s((()=>{})),hr=s((()=>{mr()})),gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr=s((()=>{gr=`error.type`,_r=`exception.message`,vr=`exception.stacktrace`,yr=`exception.type`,br=`http.request.method`,xr=`http.request.method_original`,Sr=`http.response.status_code`,Cr=`server.address`,wr=`server.port`,Tr=`service.name`,Er=`telemetry.sdk.language`,Dr=`webjs`,Or=`telemetry.sdk.name`,kr=`telemetry.sdk.version`,Ar=`url.full`,jr=`url.path`,Mr=`url.query`,Nr=`user_agent.original`})),Fr=s((()=>{})),Ir=s((()=>{})),Lr=s((()=>{pr(),hr(),Pr(),Fr(),Ir()})),Rr,zr=s((()=>{Rr=`process.runtime.name`})),Br,Vr=s((()=>{lr(),Lr(),zr(),Br={[Or]:`opentelemetry`,[Rr]:`browser`,[Er]:Dr,[kr]:cr}})),Hr,Ur=s((()=>{sr(),Vr(),Hr=performance}));function Wr(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*ei)]}function Gr(e){return Qr(Wr(Hr.timeOrigin),Wr(typeof e==`number`?e:Hr.now()))}function Kr(e){if(Xr(e))return e;if(typeof e==`number`)return e<Hr.timeOrigin?Gr(e):Wr(e);if(e instanceof Date)return Wr(e.getTime());throw TypeError(`Invalid input type`)}function qr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=ti),[n,r]}function Jr(e){return e[0]*ti+e[1]}function Yr(e){return e[0]*1e3+e[1]/1e6}function Xr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Zr(e){return Xr(e)||typeof e==`number`||e instanceof Date}function Qr(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=ti&&(n[1]-=ti,n[0]+=1),n}var $r,ei,ti,ni=s((()=>{Ur(),$r=9,ei=Math.pow(10,6),ti=Math.pow(10,$r)})),ri,ii=s((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(ri||(ri={}))})),ai,oi=s((()=>{R(),B(),ai=class{constructor(e={}){var t;z(this,`_propagators`,void 0),z(this,`_fields`,void 0),this._propagators=(t=e.propagators)==null?[]:t;let n=new Set;for(let e of this._propagators){let t=typeof e.fields==`function`?e.fields():[];for(let e of t)n.add(e)}this._fields=Array.from(n)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){I.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){I.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}}));function si(e){return fi.test(e)}function ci(e){return pi.test(e)&&!mi.test(e)}var li,ui,di,fi,pi,mi,hi=s((()=>{li=`[_0-9a-z-*/]`,ui=`[a-z]${li}{0,255}`,di=`[a-z0-9]${li}{0,240}@[a-z]${li}{0,13}`,fi=RegExp(`^(?:${ui}|${di})$`),pi=/^[ -~]{0,255}[!-~]$/,mi=/,|=/})),gi,_i,vi,yi,bi,xi=s((()=>{hi(),B(),gi=32,_i=512,vi=`,`,yi=`=`,bi=class e{constructor(e){z(this,`_length`,void 0),z(this,`_rawTraceState`,void 0),z(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!si(e)||!ci(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>_i)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=vi+e),e=`${n[0]}${yi}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(vi),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(yi);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!si(a)||!ci(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>_i)&&(t.set(a,o),n=s,t.size>=gi))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}}}));function Si(e){let t=Ei.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Ci,wi,Ti,Ei,Di,Oi=s((()=>{R(),Mn(),xi(),Ci=`traceparent`,wi=`tracestate`,Ti=`00`,Ei=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`),Di=class{inject(e,t,n){let r=L.getSpanContext(e);if(!r||An(e)||!ut(r))return;let i=`${Ti}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Ge.NONE).toString(16)}`;n.set(t,Ci,i),r.traceState&&n.set(t,wi,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,Ci);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Si(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,wi);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new bi(typeof e==`string`?e:void 0)}return L.setSpanContext(e,a)}fields(){return[Ci,wi]}}}));function ki(e){if(!Ai(e)||ji(e)!==Pi)return!1;let t=zi(e);if(t===null)return!0;let n=Vi.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Li.call(n)===Ri}function Ai(e){return typeof e==`object`&&!!e}function ji(e){return e==null?e===void 0?Ii:Fi:Hi&&Hi in Object(e)?Mi(e):Ni(e)}function Mi(e){let t=Vi.call(e,Hi),n=e[Hi],r=!1;try{e[Hi]=void 0,r=!0}catch(e){}let i=Ui.call(e);return r&&(t?e[Hi]=n:delete e[Hi]),i}function Ni(e){return Ui.call(e)}var Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi=s((()=>{Pi=`[object Object]`,Fi=`[object Null]`,Ii=`[object Undefined]`,Li=Function.prototype.toString,Ri=Li.call(Object),zi=Object.getPrototypeOf,Bi=Object.prototype,Vi=Bi.hasOwnProperty,Hi=Symbol?Symbol.toStringTag:void 0,Ui=Bi.toString}));function Gi(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=qi(t,e.shift(),0,n);return t}function Ki(e){return Yi(e)?e.slice():e}function qi(e,t,n=0,r){let i;if(!(n>ea)){if(n++,Qi(e)||Qi(t)||Xi(t))i=Ki(t);else if(Yi(e)){if(i=e.slice(),Yi(t))for(let e=0,n=t.length;e<n;e++)i.push(Ki(t[e]));else if(Zi(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Ki(t[r]))}}}else if(Zi(e))if(Zi(t)){if(!$i(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(Qi(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Ji(e,s,r)||Ji(t,s,r))delete i[s];else{if(Zi(a)&&Zi(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=qi(i[s],c,n,r)}}}}else i=t;return i}}function Ji(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function Yi(e){return Array.isArray(e)}function Xi(e){return typeof e==`function`}function Zi(e){return!Qi(e)&&!Yi(e)&&!Xi(e)&&typeof e==`object`}function Qi(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function $i(e,t){return!(!ki(e)||!ki(t))}var ea,ta=s((()=>{Wi(),ea=20}));function na(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new ra(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}var ra,ia=s((()=>{ra=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}}));function aa(e,t){return typeof t==`string`?e===t:!!e.match(t)}function oa(e,t){if(!t)return!1;for(let n of t)if(aa(e,n))return!0;return!1}var sa=s((()=>{})),ca,la=s((()=>{B(),ca=class{constructor(){z(this,`_promise`,void 0),z(this,`_resolve`,void 0),z(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),ua,da=s((()=>{la(),B(),ua=class{constructor(e,t){z(this,`_isCalled`,!1),z(this,`_deferred`,new ca),z(this,`_callback`,void 0),z(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function fa(e,t){return new Promise(n=>{F.with(kn(F.active()),()=>{e.export(t,n)})})}var pa=s((()=>{R(),Mn()})),ma,V=s((()=>{Vn(),B(),$n(),or(),rr(),ni(),ii(),zn(),Ur(),oi(),Oi(),R(),Mn(),xi(),ta(),ia(),sa(),da(),pa(),ma={_export:fa}}));let ha;function ga(){if(ha===void 0)try{let e=globalThis.process.argv0;ha=e?`unknown_service:${e}`:`unknown_service`}catch(e){ha=`unknown_service`}return ha}let _a=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;function va(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function ya(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){va(a,r,i,o,s,`next`,e)}function s(e){va(a,r,i,o,s,`throw`,e)}o(void 0)})}}R(),V(),Lr(),B();var ba=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=wa(t),r._asyncAttributesPending=t.filter(([e,t])=>_a(t)).length>0,r}constructor(e,t){var n;z(this,`_rawAttributes`,void 0),z(this,`_asyncAttributesPending`,!1),z(this,`_schemaUrl`,void 0),z(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(_a(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=wa(this._rawAttributes),this._schemaUrl=Ta(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return ya(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,_a(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&I.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(_a(n)){I.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]!=null||(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Ea(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function xa(e,t){return ba.FromAttributeList(Object.entries(e),t)}function Sa(){return xa({})}function Ca(){return xa({[Tr]:ga(),[Er]:Br[Er],[Or]:Br[Or],[kr]:Br[kr]})}function wa(e){return e.map(([e,t])=>_a(t)?[e,t.catch(t=>{I.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Ta(e){if(typeof e==`string`||e===void 0)return e;I.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Ea(e,t){let n=e==null?void 0:e.schemaUrl,r=t==null?void 0:t.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;I.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}R(),V(),Lr(),B();var Da=class{constructor(e){var t,n;z(this,`_spanContext`,void 0),z(this,`kind`,void 0),z(this,`parentSpanContext`,void 0),z(this,`attributes`,{}),z(this,`links`,[]),z(this,`events`,[]),z(this,`startTime`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_droppedAttributesCount`,0),z(this,`_droppedEventsCount`,0),z(this,`_droppedLinksCount`,0),z(this,`_attributesCount`,0),z(this,`name`,void 0),z(this,`status`,{code:At.UNSET}),z(this,`endTime`,[0,0]),z(this,`_ended`,!1),z(this,`_duration`,[-1,-1]),z(this,`_spanProcessor`,void 0),z(this,`_spanLimits`,void 0),z(this,`_attributeValueLengthLimit`,void 0),z(this,`_recordEndMetrics`,void 0),z(this,`_performanceStartTime`,void 0),z(this,`_performanceOffset`,void 0),z(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=Hr.now(),this._performanceOffset=r-(this._performanceStartTime+Hr.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=(t=this._spanLimits.attributeValueLengthLimit)==null?0:t,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime((n=e.startTime)==null?r:n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return I.warn(`Invalid attribute key: ${e}`),this;if(!Xn(t))return I.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return I.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&I.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),Zr(t)&&(Zr(n)||(n=t),t=void 0);let i=Jn(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&I.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Jn(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===At.UNSET||this.status.code===At.OK)return this;let t={code:e.code};return e.code===At.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&I.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t;if(this._isSpanEnded()){I.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=qr(this.startTime,this.endTime),this._duration[0]<0&&(I.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&I.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&I.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(t=this._recordEndMetrics)==null||t.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=Hr.now())return Gr(e+this._performanceOffset);if(typeof e==`number`)return Wr(e);if(e instanceof Date)return Wr(e.getTime());if(Xr(e))return e;if(this._startTimeProvided)return Wr(Date.now());let t=Hr.now()-this._performanceStartTime;return Qr(this.startTime,Wr(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[_r]=e:e&&(e.code?n[yr]=e.code.toString():e.name&&(n[yr]=e.name),e.message&&(n[_r]=e.message),e.stack&&(n[vr]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(`exception`,n,t):I.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);I.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(I.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},Oa;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Oa||(Oa={}));var ka=class{shouldSample(){return{decision:Oa.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Aa=class{shouldSample(){return{decision:Oa.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};R(),V(),B();var ja=class{constructor(e){var t,n,r,i;z(this,`_root`,void 0),z(this,`_remoteParentSampled`,void 0),z(this,`_remoteParentNotSampled`,void 0),z(this,`_localParentSampled`,void 0),z(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(ir(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Aa),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Aa:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new ka:n,this._localParentSampled=(r=e.localParentSampled)==null?new Aa:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new ka:i}shouldSample(e,t,n,r,i,a){let o=L.getSpanContext(e);return!o||!ut(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&Ge.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&Ge.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};R(),B();var Ma=class{constructor(e=0){z(this,`_ratio`,void 0),z(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:ct(t)&&this._accumulate(t)<this._upperBound?Oa.RECORD_AND_SAMPLED:Oa.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}};R(),V();var Na;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Na||(Na={}));function Pa(){var e,t,n,r,i,a,o,s;return{sampler:Fa(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(e=void 0)==null?1/0:e,attributeCountLimit:(t=void 0)==null?128:t},spanLimits:{attributeValueLengthLimit:(n=void 0)==null?1/0:n,attributeCountLimit:(r=void 0)==null?128:r,linkCountLimit:(i=void 0)==null?128:i,eventCountLimit:(a=void 0)==null?128:a,attributePerEventCountLimit:(o=void 0)==null?128:o,attributePerLinkCountLimit:(s=void 0)==null?128:s}}}function Fa(){var e;let t=(e=void 0)==null?Na.ParentBasedAlwaysOn:e;switch(t){case Na.AlwaysOn:return new Aa;case Na.AlwaysOff:return new ka;case Na.ParentBasedAlwaysOn:return new ja({root:new Aa});case Na.ParentBasedAlwaysOff:return new ja({root:new ka});case Na.TraceIdRatio:return new Ma(Ia());case Na.ParentBasedTraceIdRatio:return new ja({root:new Ma(Ia())});default:return I.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Na.ParentBasedAlwaysOn}".`),new ja({root:new Aa})}}function Ia(){return I.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1}V();function La(e){let t={sampler:Fa()},n=Pa(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Ra(e){var t,n,r,i,a,o,s,c,l,u,d,f;let p=Object.assign({},e.spanLimits);return p.attributeCountLimit=(t=(n=(r=(i=(a=e.spanLimits)==null?void 0:a.attributeCountLimit)==null?(o=e.generalLimits)==null?void 0:o.attributeCountLimit:i)==null?void 0:r)==null?void 0:n)==null?128:t,p.attributeValueLengthLimit=(s=(c=(l=(u=(d=e.spanLimits)==null?void 0:d.attributeValueLengthLimit)==null?(f=e.generalLimits)==null?void 0:f.attributeValueLengthLimit:u)==null?void 0:l)==null?void 0:c)==null?1/0:s,Object.assign({},e,{spanLimits:p})}R(),V(),B();var za=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_isExporting`,!1),z(this,`_finishedSpans`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_droppedSpansCount`,0),this._exporter=e,this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==`number`?t.maxExportBatchSize:(n=void 0)==null?512:n,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==`number`?t.maxQueueSize:(r=void 0)==null?2048:r,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==`number`?t.scheduledDelayMillis:(i=void 0)==null?5e3:i,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==`number`?t.exportTimeoutMillis:(a=void 0)==null?3e4:a,this._shutdownOnce=new ua(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(I.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Ge.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&I.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(I.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);F.with(kn(F.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{if(clearTimeout(n),r.code===ri.SUCCESS)e();else{var i;t((i=r.error)==null?Error(`BatchSpanProcessor: span export failed`):i)}}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a!=null||(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{ir(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,ir(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};V(),B();var Ba=class extends za{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this.onInit(t)}onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{ir(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{ir(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}};let Va=new Uint8Array(16),Ha=new Uint8Array(8),Ua=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Wa(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ga(e){let t=``;for(let n=0;n<e.length;n++)t+=Ua[e[n]];return t}var Ka=class{generateTraceId(){return Wa(Va),Ga(Va)}generateSpanId(){return Wa(Ha),Ga(Ha)}};let qa=`otel.span.sampling_result`;B();var Ja=class{constructor(e){z(this,`startedSpans`,void 0),z(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(`otel.sdk.span.started`,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(`otel.sdk.span.live`,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Xa(t);if(this.startedSpans.add(1,{"otel.span.parent.origin":Ya(e),[qa]:n}),t===Oa.NOT_RECORD)return()=>{};let r={[qa]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Ya(e){return e?e.isRemote?`remote`:`local`:`none`}function Xa(e){switch(e){case Oa.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case Oa.RECORD:return`RECORD_ONLY`;case Oa.NOT_RECORD:return`DROP`}}R(),V(),B();var Za=class{constructor(e,t,n,r){z(this,`_sampler`,void 0),z(this,`_generalLimits`,void 0),z(this,`_spanLimits`,void 0),z(this,`_idGenerator`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_resource`,void 0),z(this,`_spanProcessor`,void 0),z(this,`_tracerMetrics`,void 0);let i=La(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Ka,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,`2.7.1`):ge();this._tracerMetrics=new Ja(a)}startSpan(e,t={},n=F.active()){var r,i,a;t.root&&(n=L.deleteSpan(n));let o=L.getSpan(n);if(An(n))return I.debug(`Instrumentation suppressed, returning Noop Span`),L.wrapSpanContext(Ye);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!L.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?Ot.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:Jn(e.attributes)})),m=Jn(t.attributes),h=this._sampler.shouldSample(n,u,e,f,m,p),g=this._tracerMetrics.startSpan(s,h.decision);d=(a=h.traceState)==null?d:a;let _=h.decision===Et.RECORD_AND_SAMPLED?Ge.SAMPLED:Ge.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===Et.NOT_RECORD)return I.debug(`Recording is off, propagating context in a non-recording span`),L.wrapSpanContext(v);let y=Jn(Object.assign(m,h.attributes));return new Da({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:v,name:e,kind:f,links:p,parentSpanContext:l,attributes:y,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:g})}startActiveSpan(e,t,n,r){var i;let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=n):(a=t,o=n,s=r);let c=(i=o)==null?F.active():i,l=this.startSpan(e,a,c),u=L.setSpan(c,l);return F.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};V(),B();var Qa=class{constructor(e){z(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{ir(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}};V(),B();var $a;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})($a||($a={}));var eo=class{constructor(e={}){var t,n;z(this,`_config`,void 0),z(this,`_tracers`,new Map),z(this,`_resource`,void 0),z(this,`_activeSpanProcessor`,void 0);let r=Gi({},Pa(),Ra(e));this._resource=(t=r.resource)==null?Ca():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new Qa(i)}getTracer(e,t,n){let r=`${e}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._tracers.has(r)||this._tracers.set(r,new Za({name:e,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=$a.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==$a.timeout&&(r=$a.resolved,n(r))}).catch(e=>{clearTimeout(i),r=$a.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==$a.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};R(),B();var to=class{constructor(){z(this,`_enabled`,!1),z(this,`_currentContext`,ue)}_bindFunction(e=ue,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=ue,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=ue,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||ue;try{return t.call(n,...r)}finally{this._currentContext=i}}};R(),V();function no(e){if(e!==null){if(e===void 0){let e=new to;e.enable(),F.setGlobalContextManager(e);return}e.enable(),F.setGlobalContextManager(e)}}function ro(e){if(e!==null){if(e===void 0){en.setGlobalPropagator(new ai({propagators:[new Di,new Bn]}));return}en.setGlobalPropagator(e)}}var io=class extends eo{constructor(e={}){super(e)}register(e={}){L.setGlobalTracerProvider(this),ro(e.propagator),no(e.contextManager)}},H;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(H||(H={})),V();let ao;function oo(){return ao||(ao=document.createElement(`a`)),ao}function so(e,t){return t in e}function co(e,t,n,r=!0){if(so(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function lo(e,t,n=!1,r,i){if(r===void 0&&(r=t[H.START_TIME]!==0),n||(co(e,H.FETCH_START,t,r),co(e,H.DOMAIN_LOOKUP_START,t,r),co(e,H.DOMAIN_LOOKUP_END,t,r),co(e,H.CONNECT_START,t,r),co(e,H.SECURE_CONNECTION_START,t,r),co(e,H.CONNECT_END,t,r),co(e,H.REQUEST_START,t,r),co(e,H.RESPONSE_START,t,r),co(e,H.RESPONSE_END,t,r)),!i){let n=t[H.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(`http.response_content_length`,n);let r=t[H.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(`http.response_content_length_uncompressed`,r)}}function uo(e){return e.slice().sort((e,t)=>{let n=e[H.FETCH_START],r=t[H.FETCH_START];return n>r?1:n<r?-1:0})}function fo(){return typeof location<`u`?location.origin:void 0}function po(e,t,n,r,i=new WeakSet,a){let o=go(e);e=o.toString();let s=ho(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=uo(s);if(o.origin!==fo()&&c.length>1){let e=c[0],t=mo(c,e[H.RESPONSE_END],n),r=e[H.RESPONSE_END];return t[H.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function mo(e,t,n){let r=Jr(n),i=Jr(Kr(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=Jr(Kr(n[H.FETCH_START])),c=r-Jr(Kr(n[H.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function ho(e,t,n,r,i,a){let o=Jr(t),s=Jr(n),c=r.filter(t=>{let n=Jr(Kr(t[H.FETCH_START])),r=Jr(Kr(t[H.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function go(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=oo();return t.href=e,t}function _o(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),go(e).origin===fo()?!0:n.some(t=>aa(e,t))}R(),B();let vo=`mxl_pending_`;var yo=class{constructor({resource:e=Sa(),storage:t=window.localStorage,diag:n=I.createComponentLogger({namespace:`MXLSpanStorage`}),storedSpansExpireTimeoutMS:r=3600*1e3,onExpiredSpansExport:i,spanSessionManager:a}){z(this,`_noExportTracer`,void 0),z(this,`_storage`,void 0),z(this,`_diag`,void 0),z(this,`_onExpiredSpansExport`,void 0),z(this,`_storedSpansExpireTimeoutMS`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_checkExpiredSpansInterval`,void 0),this._noExportTracer=new eo({resource:e}).getTracer(`mxl-web-sdk-sessions`),this._storage=t,this._diag=n,this._storedSpansExpireTimeoutMS=r,this._onExpiredSpansExport=i,this._spanSessionManager=a,this.startExpiredSpansCheck()}storePendingSpans(e,t,n){try{if(this.clearStoredSpans(e),this._getPendingSpansKeys().length>=10){this._spanSessionManager.incrSessionCountForKey(`mxl.max_pending_spans_reached`),this._diag.warn(`Not storing pending spans as the max number of items was reached`);return}let r=`${vo}${e}_${Date.now()}`;this._storage.setItem(r,JSON.stringify([t,...n],(e,t)=>e.startsWith(`_`)?void 0:t)),this._diag.debug(`Stored pending span: ${r}`)}catch(e){this._diag.error(`Failed to store spans to storage:`,e)}}clearStoredSpans(e){try{let t=`${vo}${e}_`;this._getPendingSpansKeys().forEach(e=>{e.startsWith(t)&&this._storage.removeItem(e)})}catch(e){this._diag.error(`Failed to clear stored spans from storage:`,e)}}startExpiredSpansCheck(){this._checkExpiredSpansInterval=setInterval(()=>{this.checkAndExportExpiredSpans()},300*1e3)}stopExpiredSpansCheck(){this._checkExpiredSpansInterval&&(clearInterval(this._checkExpiredSpansInterval),this._checkExpiredSpansInterval=void 0)}checkAndExportExpiredSpans(){try{let e=this._getPendingSpansKeys();if(e.length===0)return;let t=Date.now();e.forEach(e=>{let n=e.split(`_`),r=parseInt(n[n.length-1],10);if(Number.isNaN(r)&&(this._diag.error(`Found invalid timestamp in stored span:`,r),this._storage.removeItem(e)),t-r<=this._storedSpansExpireTimeoutMS)return;let i=this._storage.getItem(e);if(i){try{let e=[];for(let t of JSON.parse(i)){let n=this._noExportTracer.startSpan(t.name,{kind:t.kind,attributes:t.attributes,links:t.links,startTime:t.startTime});n.setStatus(t.status),n.end(t.endTime),e.push(n)}this._onExpiredSpansExport&&e.length>0&&this._onExpiredSpansExport(e)}catch(e){this._diag.error(`Failed to process expired spans:`,e)}this._storage.removeItem(e)}})}catch(e){this._diag.error(`Failed to check and export expired spans:`,e)}}_getPendingSpansKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(vo)&&e.push(n)}return e}destroy(){this.stopExpiredSpansCheck()}};B();var bo=class{constructor(e,t){z(this,`_keyPrefix`,void 0),z(this,`_storage`,void 0),this._keyPrefix=`${e}_`,this._storage=t}getNamespacedKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(this._keyPrefix)&&e.push(n.substring(this._keyPrefix.length))}return e}get length(){return this.getNamespacedKeys().length}clear(){this.getNamespacedKeys().forEach(e=>{this._storage.removeItem(`${this._keyPrefix}${e}`)})}getItem(e){return this._storage.getItem(`${this._keyPrefix}${e}`)}key(e){return this.getNamespacedKeys()[e]||null}removeItem(e){this._storage.removeItem(`${this._keyPrefix}${e}`)}setItem(e,t){this._storage.setItem(`${this._keyPrefix}${e}`,t)}getStorageEventKey(e){return`${this._keyPrefix}${e}`}};let xo=({diag:e,featureManager:t,registerGlobally:n,propagator:r,defaultInstrumentationConfig:i})=>{var a;if(!t.isNetworkSpanForwardingEnabled())return!1;let o=[];return n||o.push("Network span forwarding cannot be used when `registerGlobally` is set to false. Turning off network span forwarding."),r&&o.push("Network span forwarding cannot be used alongside a custom `propagator`. Turning off network span forwarding."),!(i==null||(a=i.omit)==null)&&a.has(`@opentelemetry/instrumentation-xml-http-request`)&&i.omit.has(`@opentelemetry/instrumentation-fetch`)&&o.push(`Network span forwarding cannot be used when both '@opentelemetry/instrumentation-xml-http-request' and '@opentelemetry/instrumentation-fetch' are omitted. Turning off network span forwarding.`),o.forEach(t=>{e.warn(t)}),o.length===0};V(),B();var So=class{constructor(e=window.performance){z(this,`_clock`,void 0),z(this,`epochMillisFromOriginOffset`,e=>this._clock.timeOrigin+e),z(this,`getNowHRTime`,()=>Wr(this.getNowMillis())),z(this,`getNowMillis`,()=>this.epochMillisFromOriginOffset(this._clock.now())),z(this,`millisSinceHRTime`,e=>this.getNowMillis()-Yr(e)),z(this,`millisFromZeroTime`,e=>e),this._clock=e}};function Co(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var wo=s((()=>{}));function To(e,t){if(e==null)return{};var n,r,i=Co(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Eo=s((()=>{wo()}));function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Do(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Oo=s((()=>{B()}));Eo(),Oo();let ko=[`diag`];function Ao(e){var t,n;return typeof PerformanceObserver<`u`&&((t=(n=PerformanceObserver.supportedEntryTypes)==null?void 0:n.includes(e))==null?!1:t)}function jo(e,t,n){let r=n==null?{}:n,{diag:i}=r,a=To(r,ko);if(!Ao(e))return i==null||i.debug(`${e} not supported, skipping observer`),null;try{let n=new PerformanceObserver(n=>{for(let r of n.getEntries())try{t(r)}catch(t){i==null||i.error(`error processing ${e} entry`,t)}});return n.observe(U({type:e,buffered:!0},a)),n}catch(e){return null}}let Mo=(e,t=1e3)=>{let n=!1;return(...r)=>{n||(e(...r),setTimeout(()=>{n=!1},t),n=!0)}};var No=class{logException(e,t){}message(e,t,n){}};B();let Po=new No;var Fo=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Po:e}setDelegate(e){this._delegate=e}logException(e,t){this.getDelegate().logException(e,t)}message(e,t,n){this.getDelegate().message(e,t,n)}};R(),B();let Io=new No,Lo=new Set([`setDelegate`,`getDelegate`]);var Ro=class e{static getInstance(){if(!e._instance){let t=new Fo,n=ln(t,Io,I.createComponentLogger({namespace:`LogAPI`}),Lo);e._instance=Object.assign(n,{setGlobalLogManager(e){t.setDelegate(e)},getLogManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Ro,`_instance`,void 0);let zo=Ro.getInstance();var Bo=class{setCurrentRoute(e){}getCurrentRoute(){return null}getCurrentPageId(){return``}setPageLabel(e){}getPageLabel(){return null}clearCurrentRoute(){}};B();let Vo=new Bo;var Ho=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Vo:e}setDelegate(e){this._delegate=e}setCurrentRoute(e){this.getDelegate().setCurrentRoute(e)}getCurrentRoute(){return this.getDelegate().getCurrentRoute()}getCurrentPageId(){return this.getDelegate().getCurrentPageId()}setPageLabel(e){this.getDelegate().setPageLabel(e)}getPageLabel(){return this.getDelegate().getPageLabel()}clearCurrentRoute(){this.getDelegate().clearCurrentRoute()}};R(),B();let Uo=new Bo,Wo=new Set([`setDelegate`,`getDelegate`]);var Go=class e{static getInstance(){if(!e._instance){let t=new Ho,n=ln(t,Uo,I.createComponentLogger({namespace:`PageAPI`}),Wo);e._instance=Object.assign(n,{setGlobalPageManager(e){t.setDelegate(e)},getPageManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Go,`_instance`,void 0);let Ko=Go.getInstance();B();var qo=class{constructor(){z(this,`getSessionId`,()=>null),z(this,`getPreviousSessionId`,()=>null)}addBreadcrumb(e){}addProperty(e,t,n){}removeProperty(e){}endSessionSpan(){}endSessionSpanInternal(e){}currentSessionAsReadableSpan(e){return null}getSessionSpan(){return null}getSessionStartTime(){return null}startSessionSpan(){}addSessionStartedListener(e){return()=>{}}addSessionEndedListener(e){return()=>{}}};B();let Jo=new qo;var Yo=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Jo:e}setDelegate(e){this._delegate=e}addBreadcrumb(e){this.getDelegate().addBreadcrumb(e)}addProperty(e,t,n){this.getDelegate().addProperty(e,t,n)}removeProperty(e){this.getDelegate().removeProperty(e)}endSessionSpan(){this.getDelegate().endSessionSpan()}endSessionSpanInternal(e){this.getDelegate().endSessionSpanInternal(e)}currentSessionAsReadableSpan(e){return this.getDelegate().currentSessionAsReadableSpan(e)}getSessionId(){return this.getDelegate().getSessionId()}getPreviousSessionId(){return this.getDelegate().getPreviousSessionId()}getSessionSpan(){return this.getDelegate().getSessionSpan()}getSessionStartTime(){return this.getDelegate().getSessionStartTime()}startSessionSpan(e){this.getDelegate().startSessionSpan(e)}addSessionStartedListener(e){return this.getDelegate().addSessionStartedListener(e)}addSessionEndedListener(e){return this.getDelegate().addSessionEndedListener(e)}};R(),B();let Xo=new qo,Zo=new Set([`setDelegate`,`getDelegate`]);var Qo=class e{static getInstance(){if(!e._instance){let t=new Yo,n=ln(t,Xo,I.createComponentLogger({namespace:`SessionAPI`}),Zo);e._instance=Object.assign(n,{setGlobalSessionManager(e){t.setDelegate(e)},getSpanSessionManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Qo,`_instance`,void 0);let $o=Qo.getInstance();R(),B();var es=class{constructor(e=Ye){z(this,`_spanContext`,void 0),z(this,`attributes`,{}),this._spanContext=e}fail(e){}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}removeAttribute(e){return this}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}};R();var ts=class{startSpan(e,t){return new es}setSpan(e,t){return ue}getSpan(e){}};B();let ns=new ts;var rs=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?ns:e}setDelegate(e){this._delegate=e}startSpan(e,t,n){return this.getDelegate().startSpan(e,t,n)}setSpan(e,t){return this.getDelegate().setSpan(e,t)}getSpan(e){return this.getDelegate().getSpan(e)}};R(),B();let is=new ts,as=new Set([`setDelegate`,`getDelegate`]);var os=class e{static getInstance(){if(!e._instance){let t=new rs,n=ln(t,is,I.createComponentLogger({namespace:`TraceAPI`}),as);e._instance=Object.assign(n,{setGlobalTraceManager(e){t.setDelegate(e)},getTraceManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(os,`_instance`,void 0);let ss=os.getInstance();var cs=class{getMXLUserId(){return``}getUserId(){return null}setUserId(){}clearUserId(){}};B();let ls=new cs;var us=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?ls:e}setDelegate(e){this._delegate=e}getMXLUserId(){return this.getDelegate().getMXLUserId()}getUserId(){return this.getDelegate().getUserId()}setUserId(e){this.getDelegate().setUserId(e)}clearUserId(){this.getDelegate().clearUserId()}};R(),B();let ds=new cs,fs=new Set([`setDelegate`,`getDelegate`]);var ps=class e{static getInstance(){if(!e._instance){let t=new us,n=ln(t,ds,I.createComponentLogger({namespace:`UserAPI`}),fs);e._instance=Object.assign(n,{setGlobalUserManager(e){t.setDelegate(e)},getUserManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(ps,`_instance`,void 0);let ms=ps.getInstance(),hs={pageLabel:wn};var gs=class{emit(e){}enabled(){return!1}};let _s=new gs,vs=Symbol.for(`io.opentelemetry.js.api.logs`),ys=globalThis;function bs(e,t,n){return r=>r===e?t:n}let xs=new class{getLogger(e,t,n){return new gs}};var Ss=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):_s}},Cs=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new Ss(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?xs:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let ws=class e{constructor(){this._proxyLoggerProvider=new Cs}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return ys[vs]?this.getLoggerProvider():(ys[vs]=bs(1,e,xs),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=ys[vs])==null?void 0:e.call(ys,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete ys[vs],this._proxyLoggerProvider=new Cs}}.getInstance();function Ts(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Es(e){e.forEach(e=>e.disable())}R();function Ds(e){var t,n;let r=e.tracerProvider||L.getTracerProvider(),i=e.meterProvider||Bt.getMeterProvider(),a=e.loggerProvider||ws.getLoggerProvider(),o=(t=(n=e.instrumentations)==null?void 0:n.flat())==null?[]:t;return Ts(o,r,i,a),()=>{Es(o)}}let Os=console.error.bind(console);function ks(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}let As=(e,t,n)=>{if(!e||!e[t]){Os(`no original function `+String(t)+` to wrap`);return}if(!n){Os(`no wrapper function`),Os(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){Os(`original object and wrapper must be functions`);return}let i=n(r,t);return ks(i,`__original`,r),ks(i,`__unwrap`,()=>{e[t]===i&&ks(e,t,r)}),ks(i,`__wrapped`,!0),ks(e,t,i),i},js=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Os(`must provide one or more modules to patch`),Os(Error().stack);return}if(!(t&&Array.isArray(t))){Os(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{As(e,t,n)})})},Ms=(e,t)=>{if(!e||!e[t]){Os(`no function to unwrap.`),Os(Error().stack);return}let n=e[t];if(!n.__unwrap)Os(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ns=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Os(`must provide one or more modules to patch`),Os(Error().stack);return}if(!(t&&Array.isArray(t))){Os(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Ms(e,t)})})};function Ps(e){e&&e.logger&&(typeof e.logger==`function`?Os=e.logger:Os(`new logger isn't a function, not replacing`))}Ps.wrap=As,Ps.massWrap=js,Ps.unwrap=Ms,Ps.massUnwrap=Ns,R(),B(),Oo();var Fs=class{constructor(e,t,n){z(this,`_config`,{}),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),z(this,`_diag`,void 0),z(this,`instrumentationName`,void 0),z(this,`instrumentationVersion`,void 0),z(this,`_wrap`,As),z(this,`_unwrap`,Ms),z(this,`_massWrap`,js),z(this,`_massUnwrap`,Ns),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=I.createComponentLogger({namespace:e}),this._tracer=L.getTracer(e,t),this._meter=Bt.getMeter(e,t),this._logger=ws.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=U({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Is=class extends Fs{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function Ls(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}var W;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(W||(W={}));function Rs(e,t){let n=W.OLD,r=t==null?void 0:t.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r==null?[]:r)if(t.toLowerCase()===e+`/dup`){n=W.DUPLICATE;break}else t.toLowerCase()===e&&(n=W.STABLE);return n}let zs=`session.id`,Bs=`user.id`;var Vs;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(Vs||(Vs={}));var Hs=class{emit(e){}enabled(){return!1}};let Us=new Hs,Ws=Symbol.for(`io.opentelemetry.js.api.logs`),Gs=globalThis;function Ks(e,t,n){return r=>r===e?t:n}let qs=new class{getLogger(e,t,n){return new Hs}};var Js=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Us}},Ys=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new Js(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?qs:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Xs=class e{constructor(){this._proxyLoggerProvider=new Ys}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return Gs[Ws]?this.getLoggerProvider():(Gs[Ws]=Ks(1,e,qs),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Gs[Ws])==null?void 0:e.call(Gs,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete Gs[Ws],this._proxyLoggerProvider=new Ys}}.getInstance();R(),B(),Oo();var Zs=class{constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,z(this,`_config`,{}),z(this,`_diag`,void 0),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),this.setConfig(n),this._diag=I.createComponentLogger({namespace:e}),this._tracer=L.getTracer(e,t),this._meter=Bt.getMeter(e,t),this._logger=Xs.getLogger(e,t),this._updateMetricInstruments()}get tracer(){return this._tracer}get meter(){return this._meter}get logger(){return this._logger}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}getConfig(){return this._config}setConfig(e){this._config=U({enabled:!0},e)}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}_updateMetricInstruments(){}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}};B();var Qs=class extends Zs{constructor({instrumentationName:e,instrumentationVersion:t,config:n,diag:r,perf:i,limitManager:a}){super(e,t,n),z(this,`_sessionManager`,void 0),z(this,`_logManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_perf`,void 0),r&&(this._diag=r),this._perf=i==null?new So:i,this._sessionManager=$o.getSpanSessionManager(),this._logManager=zo.getLogManager(),this._limitManager=a}get limitManager(){return this._limitManager}get sessionManager(){return this._sessionManager}get logManager(){return this._logManager}get perf(){return this._perf}init(){}setLimitManager(e){this._limitManager=e}setLogManager(e){this._logManager=e}setSessionManager(e){this._sessionManager=e}};let $s=()=>{let e={},t=window.performance.getEntriesByType(`navigation`)[0];return Object.values(H).forEach(n=>{if(so(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}}),e},ec={"first-paint":`firstPaint`,"first-contentful-paint":`firstContentfulPaint`},tc=e=>{window.performance.getEntriesByType(`paint`).forEach(({name:t,startTime:n})=>{so(ec,t)&&e.addEvent(ec[t],n)})};R(),V(),Lr(),B();var nc=class extends Qs{constructor({diag:e,perf:t,enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i=!1,ignoreNetworkEvents:a=!1}={}){super({instrumentationName:`DocumentLoadInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i,ignoreNetworkEvents:a}}),z(this,`_onDocumentLoaded`,void 0),z(this,`_performanceCollected`,!1),this._onDocumentLoaded=()=>{window.setTimeout(()=>{this._collectPerformance()},0)},this._config.enabled&&this.enable()}init(){this._diag.debug(`Initializing document load instrumentation`)}_addResourcesSpans(e){performance.getEntriesByType(`resource`).forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){if(this._performanceCollected)return;this._performanceCollected=!0;let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===Ci),t=$s(),n=(e==null?void 0:e.content)||``;F.with(en.extract(ue,{traceparent:n}),()=>{var e;let n=this._startSpan(`documentLoad`,H.FETCH_START,t);n&&(F.with(L.setSpan(F.active(),n),()=>{let e=this._startSpan(`documentFetch`,H.FETCH_START,t);e&&(e.setAttribute(Ar,location.href),F.with(L.setSpan(F.active(),e),()=>{var n;lo(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.documentFetch),this._endSpan(e,H.RESPONSE_END,t)}))}),n.setAttribute(hn,`ux.document_load`),n.setAttribute(Ar,location.href),n.setAttribute(Nr,navigator.userAgent),this._addResourcesSpans(n),this.getConfig().ignoreNetworkEvents||(co(n,H.FETCH_START,t),co(n,H.UNLOAD_EVENT_START,t),co(n,H.UNLOAD_EVENT_END,t),co(n,H.DOM_INTERACTIVE,t),co(n,H.DOM_CONTENT_LOADED_EVENT_START,t),co(n,H.DOM_CONTENT_LOADED_EVENT_END,t),co(n,H.DOM_COMPLETE,t),co(n,H.LOAD_EVENT_START,t),co(n,H.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||tc(n),this._addCustomAttributesOnSpan(n,(e=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:e.documentLoad),this._endSpan(n,H.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(so(n,t)&&typeof n[t]==`number`?e.end(n[t]):e.end())}_initResourceSpan(e,t){var n;let r=this._startSpan(`resourceFetch`,H.FETCH_START,e,t);r&&(r.setAttribute(hn,`ux.resource_fetch`),r.setAttribute(Ar,e.name),lo(r,e,this.getConfig().ignoreNetworkEvents),e.deliveryType&&r.setAttribute(`http.response.delivery_type`,e.deliveryType),e.initiatorType&&r.setAttribute(`http.request.initiator_type`,e.initiatorType),e.renderBlockingStatus&&r.setAttribute(`http.request.render_blocking_status`,e.renderBlockingStatus),e.responseStatus&&r.setAttribute(Sr,e.responseStatus),typeof e.encodedBodySize==`number`&&e.encodedBodySize>=0&&r.setAttribute(`http.response.body.size`,e.encodedBodySize),typeof e.transferSize==`number`&&e.transferSize>=0&&r.setAttribute(`http.response.size`,e.transferSize),typeof e.decodedBodySize==`number`&&e.decodedBodySize>=0&&r.setAttribute(`http.response.decoded_body_size`,e.decodedBodySize),this._addResourceDiagnosticAttributes(r,e),this._addCustomAttributesOnResourceSpan(r,e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.resourceFetch),this._endSpan(r,H.RESPONSE_END,e))}_startSpan(e,t,n,r){if(so(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?L.setSpan(F.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():window.addEventListener(`load`,this._onDocumentLoaded)}_addCustomAttributesOnSpan(e,t){t&&Ls(()=>{t(e)},e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&Ls(()=>{n(e,t)},e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}_hasNoSizeData(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.decodedBodySize==`number`?e.decodedBodySize:0,r=typeof e.encodedBodySize==`number`?e.encodedBodySize:0;return t===0&&n===0&&r===0}_hasTimingData(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return t>0&&n>0}_isCorsRestricted(e){return this._hasNoSizeData(e)&&this._hasTimingData(e)}_isFetchIncomplete(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return this._hasNoSizeData(e)&&t>0&&n===0}_isFetchPrevented(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0;return this._hasNoSizeData(e)&&t===0}_isCacheValidated(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.deliveryType==`string`?e.deliveryType:``;return t===300&&n!==`cache`}_addResourceDiagnosticAttributes(e,t){this._isCorsRestricted(t)?e.setAttribute(`http.response.cors_opaque`,!0):this._isFetchIncomplete(t)?e.setAttribute(`http.request.incomplete`,!0):this._isFetchPrevented(t)&&e.setAttribute(`http.request.prevented`,!0),this._isCacheValidated(t)&&e.setAttribute(`http.response.cache_revalidated`,!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}};B();var rc=class extends Qs{constructor({diag:e,perf:t,rootNode:n,emptyCheckDelayMs:r=500}){super({instrumentationName:`EmptyRootInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,void 0),z(this,`_emptyCheckDelayMs`,void 0),z(this,`_rootNode`,void 0),this._rootNode=n,this._emptyCheckDelayMs=r,this._observer=new MutationObserver((e,t)=>{this._observerCallback(e)}),this._config.enabled&&this._rootNode?this.enable():this._rootNode||this._diag.warn(`supplied root node was null, this instrumentation won't be enabled`)}disable(){this._observer.disconnect()}enable(){this._rootNode&&this._observer.observe(this._rootNode,{childList:!0})}_observerCallback(e){let t=!1,n=!1;for(let r of e)r.target===this._rootNode&&(r.removedNodes.length>0&&(t=!0),r.addedNodes.length>0&&(n=!0));t&&!n&&(this._diag.debug(`root node had child nodes removed without new ones being added, checking if it's empty in ${this._emptyCheckDelayMs}ms`),window.setTimeout(()=>{this._checkForEmptyRootNode()},this._emptyCheckDelayMs))}_checkForEmptyRootNode(){var e;if(((e=this._rootNode)==null?void 0:e.childNodes.length)===0){this._diag.debug(`root node was found to be empty`);let e=this.sessionManager.getSessionSpan();e?e.addEvent(`empty-root-node`,{"mxl.type":`ux.empty_root_node`}):this._diag.debug(`no active session found to emit event on`)}}};let ic=(e,t)=>{let n=e.nodeName.toLowerCase(),r=t.substring(0,30),i=t.length>30?`...`:``;return`<${n}${e.className?` class="${e.className}"`:``}>${r}${i}</${n}>`};B();var ac=class extends Qs{constructor({diag:e,perf:t,shouldTrack:n,innerTextForElement:r}={}){super({instrumentationName:`ClicksInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onClickHandler`,void 0),this._onClickHandler=e=>{let t=e.target;if(t instanceof HTMLElement&&!t.hasAttribute(`disabled`)&&!(n&&!n(t)))try{let n=this.sessionManager.getSessionSpan();n&&n.addEvent(`click`,{"mxl.type":`ux.tap`,"view.name":ic(t,r?r(t):t.innerText),"tap.coords":`${e.x.toString()},${e.y.toString()}`},this.perf.epochMillisFromOriginOffset(e.timeStamp))}catch(e){this._diag.error(`failed to create new user interaction span event`,e)}},this._config.enabled&&this.enable()}disable(){document.removeEventListener(`click`,this._onClickHandler)}enable(){document.addEventListener(`click`,this._onClickHandler)}};B();var oc=class extends Qs{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ElementTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_observer`,null),z(this,`_isEnabled`,!1),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Ao(`element`)){this._diag.debug(`element not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=jo(`element`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}}}disable(){this._isEnabled=!1,this._observer&&(this._observer.disconnect(),this._observer=null)}_processEntry(e){var t,n;if(!this._isEnabled||(t=this.limitManager)!=null&&t.limitElementTimingEntry())return;let r=this.tracer.startSpan(e.identifier,{startTime:this.perf.epochMillisFromOriginOffset(0),attributes:{[hn]:`ux.element_timing`,"mxl.element_timing.identifier":e.identifier,"mxl.element_timing.element":(n=e.element)==null||(n=n.tagName)==null?void 0:n.toLowerCase(),"mxl.element_timing.render_time":e.renderTime,"mxl.element_timing.load_time":e.loadTime,"mxl.element_timing.start_time":e.startTime,"mxl.element_timing.url":e.url,"mxl.element_timing.natural_width":e.naturalWidth,"mxl.element_timing.natural_height":e.naturalHeight}});e.loadTime>0&&r.addEvent(`load`,this.perf.epochMillisFromOriginOffset(e.loadTime)),r.end(this.perf.epochMillisFromOriginOffset(e.startTime))}};B();var sc=class extends Qs{constructor({diag:e,perf:t}={}){super({instrumentationName:`GlobalExceptionInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onErrorHandler`,void 0),z(this,`_onUnhandledRejectionHandler`,void 0),this._onErrorHandler=e=>{this.logManager.logException(e.error||e.message,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`global_exception`})},this._onUnhandledRejectionHandler=e=>{this.logManager.logException(e.reason,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`promise_rejection`})},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`error`,this._onErrorHandler),window.removeEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}enable(){window.addEventListener(`error`,this._onErrorHandler),window.addEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}};B();var cc=class extends Qs{constructor({diag:e,perf:t}={}){super({instrumentationName:`LoafInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,null),z(this,`_isFirstEntry`,!0),z(this,`_removeSessionEndListener`,null),z(this,`_isEnabled`,!1),z(this,`_totalDuration`,0),z(this,`_workDuration`,0),z(this,`_styleLayoutDuration`,0),z(this,`_count`,0),z(this,`_longestDuration`,0),z(this,`_longestDurationExcludingFirst`,0),z(this,`_totalBlockingDuration`,0),z(this,`_scriptSummaries`,new Map),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Ao(`long-animation-frame`)){this._diag.debug(`long-animation-frame not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=jo(`long-animation-frame`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}this._registerSessionEndListener()}}_registerSessionEndListener(){this._isEnabled&&(this._removeSessionEndListener&&this._removeSessionEndListener(),this._removeSessionEndListener=this.sessionManager.addSessionEndedListener(()=>{try{this._flushReport()}catch(e){this._diag.error(`error flushing report`,e)}}))}setSessionManager(e){super.setSessionManager(e),this._registerSessionEndListener()}disable(){this._isEnabled=!1,this._resetAccumulators(),this._observer&&(this._observer.disconnect(),this._observer=null),this._removeSessionEndListener&&(this._removeSessionEndListener(),this._removeSessionEndListener=null)}_processEntry(e){if(this._isEnabled){this._count++,this._totalDuration+=e.duration,this._workDuration+=e.renderStart?e.renderStart-e.startTime:e.duration,e.styleAndLayoutStart&&(this._styleLayoutDuration+=Math.max(0,e.startTime+e.duration-e.styleAndLayoutStart)),this._longestDuration=Math.max(this._longestDuration,e.duration),this._isFirstEntry&&this._count===1?this._isFirstEntry=!1:(this._longestDurationExcludingFirst=Math.max(this._longestDurationExcludingFirst,e.duration),e.firstUIEventTimestamp===0&&(this._totalBlockingDuration+=e.blockingDuration));try{for(let t of e.scripts){let e=t.sourceURL||`(inline)`;e.length>2048&&(e=`${e.substring(0,2048)}...`);let n=this._scriptSummaries.get(e);n?(n.totalDuration+=t.duration,n.styleAndLayoutDuration+=t.forcedStyleAndLayoutDuration,n.count++):this._scriptSummaries.set(e,{totalDuration:t.duration,styleAndLayoutDuration:t.forcedStyleAndLayoutDuration,count:1})}}catch(e){this._diag.error(`error processing scripts for entry`,e)}}}_flushReport(){if(this._count===0)return;let e;e=this._totalBlockingDuration<=200?`good`:this._totalBlockingDuration<=600?`needs-improvement`:`poor`;let t={[hn]:`ux.web_vital`,"mxl.web_vital.id":pn(),"mxl.web_vital.name":`TBD`,"mxl.web_vital.value":Math.round(this._totalBlockingDuration),"mxl.web_vital.rating":e,"mxl.tbd.loaf_total_duration":Math.round(this._totalDuration),"mxl.tbd.loaf_work_duration":Math.round(this._workDuration),"mxl.tbd.loaf_style_and_layout_duration":Math.round(this._styleLayoutDuration),"mxl.tbd.loaf_count":this._count,"mxl.tbd.loaf_longest_duration":Math.round(this._longestDuration),"mxl.tbd.loaf_longest_duration_excluding_first":Math.round(this._longestDurationExcludingFirst)};try{this.logger.emit({eventName:`mxl-loaf-report`,severityNumber:Vs.INFO,attributes:t})}catch(e){this._diag.error(`error emitting loaf report`,e)}try{if(this._scriptSummaries.size>0){let e=[...this._scriptSummaries].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]);this.logger.emit({eventName:`mxl-loaf-scripts`,severityNumber:Vs.INFO,body:JSON.stringify(Object.fromEntries(e)),attributes:{[hn]:`ux.loaf_scripts`}})}}catch(e){this._diag.error(`error emitting loaf script summary`,e)}this._resetAccumulators()}_resetAccumulators(){this._totalDuration=0,this._workDuration=0,this._styleLayoutDuration=0,this._count=0,this._longestDuration=0,this._longestDurationExcludingFirst=0,this._totalBlockingDuration=0,this._scriptSummaries=new Map}};B();let lc=/\([^()]+\)/g;var uc=class extends Qs{constructor({diag:e,shouldCleanupPathOptionsFromRouteName:t=!0}){super({instrumentationName:`NavigationInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_shouldCleanupPathOptionsFromRouteName`,!0),z(this,`_currentRouteSpan`,null),z(this,`_instrumentationType`,`manual`),z(this,`_removeSessionStartedFn`,null),z(this,`_removeSessionEndedFn`,null),z(this,`setInstrumentationType`,e=>{this._instrumentationType=e}),z(this,`setCurrentRoute`,e=>{if(!this._config.enabled)return;let t=Ko.getCurrentRoute();e.url!==(t==null?void 0:t.url)&&(Ko.setCurrentRoute(e),this._endRouteSpan(t),this._startRouteSpan(e))}),z(this,`_setupSessionListeners`,()=>{this._removeSessionStartedFn||(this._removeSessionStartedFn=this.sessionManager.addSessionStartedListener(()=>{let e=Ko.getCurrentRoute();e&&!this._currentRouteSpan&&(this._diag.debug(`Session started, starting route span.`),this._startRouteSpan(e))})),this._removeSessionEndedFn||(this._removeSessionEndedFn=this.sessionManager.addSessionEndedListener(()=>{this._currentRouteSpan&&(this._diag.debug(`Session ended, ending route span.`),this._endRouteSpan(Ko.getCurrentRoute()))}))}),z(this,`_cleanUpSessionListeners`,()=>{this._removeSessionStartedFn&&(this._removeSessionStartedFn(),this._removeSessionStartedFn=null),this._removeSessionEndedFn&&(this._removeSessionEndedFn(),this._removeSessionEndedFn=null)}),z(this,`_startRouteSpan`,e=>{this._diag.debug(`Starting route span for url: ${e.url}`),this._setupSessionListeners();let t=this._shouldCleanupPathOptionsFromRouteName?e.path.replace(lc,``):e.path;return this._currentRouteSpan=this.tracer.startSpan(t,{attributes:{[hn]:`ux.surface`,[Sn]:t,[Cn]:Ko.getCurrentPageId()||void 0}}),this._currentRouteSpan.setAttribute(yn,this._instrumentationType),this._currentRouteSpan}),z(this,`_endRouteSpan`,e=>{this._currentRouteSpan&&(e&&this._diag.debug(`Ending route span for url: ${e.url}`),this._currentRouteSpan.end(),this._currentRouteSpan=null)}),z(this,`enable`,()=>{this.setConfig({enabled:!0}),this._diag.debug(`NavigationInstrumentation enabled, listening for navigation events.`)}),z(this,`disable`,()=>{this._cleanUpSessionListeners(),this.setConfig({enabled:!1}),this._diag.debug(`NavigationInstrumentation disabled, stopped listening for navigation events.`)}),this._shouldCleanupPathOptionsFromRouteName=t,this._config.enabled&&this.enable()}};let dc,fc=(e={})=>(dc||(dc=new uc(e)),dc);B();var pc=class extends Qs{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ServerTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_onLoad`,void 0),z(this,`_performanceCollected`,!1),this._onLoad=()=>{this._readServerTiming()},this._config.enabled&&this.enable()}enable(){if(window.removeEventListener(`load`,this._onLoad),window.document.readyState===`complete`){this._readServerTiming();return}window.addEventListener(`load`,this._onLoad)}disable(){window.removeEventListener(`load`,this._onLoad)}_readServerTiming(){var e;if(this._performanceCollected)return;this._performanceCollected=!0;let t=(e=performance.getEntriesByType(`navigation`)[0])==null?void 0:e.serverTiming;if(t!=null&&t.length)for(let e of t){var n;if((n=this.limitManager)!=null&&n.limitServerTimingEntry())return;this.logger.emit({eventName:`mxl-server-timing`,severityNumber:Vs.INFO,attributes:{[hn]:`ux.server_timing`,"mxl.server_timing.name":e.name,"mxl.server_timing.duration":e.duration,"mxl.server_timing.description":e.description}})}}};let mc=`0.0.16`,hc=`mxl_app_instance_id`,gc=(e,t)=>{let n=null;try{n=e.getItem(hc)}catch(e){t.warn(`Failed to retrieve app instance ID from session storage`,e)}if(!n){t.debug(`No existing app instance ID found in session storage, creating a new one`),n=fn();try{e.setItem(hc,n)}catch(e){t.warn(`Failed to persist app instance ID to session storage`,e)}}return n};Lr();let _c=`unknown_service`,vc=({serviceName:e})=>xa({[Tr]:e}),yc=({diagLogger:e,appVersion:t,pageSessionStorage:n})=>xa({[Or]:`mxl-web-sdk`,app_version:t,app_framework:1,sdk_version:mc,[kr]:mc,sdk_simple_version:1,sdk_platform:`web`,[Er]:`webjs`,"mxl.app_instance_id":gc(n,e),[Nr]:window.navigator.userAgent,screen_resolution:`${window.screen.width}x${window.screen.height}`}),bc={samplingPct:100,networkSpansForwardingThreshold:0},xc=`mxl_remote_config`,Sc=(e,{osVersion:t,appVersion:n,deviceId:r},i)=>`${i||`https://mxl-basket.apps.ocpthikadev01.safaricom.net`}/config?appId=${e}&osVersion=${t}&appVersion=${n}&deviceId=${r}`;R(),B(),Oo();let Cc=e=>{let t={samplingPct:e.threshold};return e.network_span_forwarding!==void 0&&(t.networkSpansForwardingThreshold=e.network_span_forwarding.pct_enabled),e.empty_session_avoidance_enabled_pct!==void 0&&(t.emptySessionAvoidanceEnabledPct=e.empty_session_avoidance_enabled_pct),e.service_name!==void 0&&e.service_name!==``&&(t.serviceName=e.service_name),t};var wc=class{constructor({appID:e,appVersion:t,deviceId:n,diag:r=I.createComponentLogger({namespace:`mxl-config-manager`}),storage:i=window.localStorage,defaultConfig:a={},mxlConfigURL:o}={}){z(this,`_remoteConfigURL`,null),z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_baseConfig`,void 0),z(this,`_sdkConfig`,void 0),z(this,`_etag`,null),z(this,`_remoteSourceServiceName`,void 0),e&&t&&n&&(this._remoteConfigURL=Sc(e,{appVersion:t,deviceId:n,osVersion:`1`},o)),this._diag=r,this._storage=i;let s=this._getRemoteConfigFromStorage();s&&(this._etag=s.etag,this._captureRemoteServiceName(s.config)),this._baseConfig=U(U({},bc),a),this._sdkConfig=U(U({},this._baseConfig),s?Cc(s.config):{})}setConfig(e){this._sdkConfig=U(U({},this._sdkConfig),e)}getConfig(){return this._sdkConfig}resolveApplicationServiceName(e){var t,n;return((t=this._remoteSourceServiceName)==null?void 0:t.trim())||(e==null?void 0:e.trim())||((n=this._baseConfig.serviceName)==null?void 0:n.trim())||_c}_captureRemoteServiceName(e){if(e.service_name===void 0)return;let t=e.service_name.trim();this._remoteSourceServiceName=t.length>0?t:void 0}refreshRemoteConfig(){var e=this;return ya(function*(){if(e._remoteConfigURL)try{let t=yield e._fetchRemoteConfig(e._remoteConfigURL);if(!t){e._diag.debug(`No changes in remote config, skipping update`);return}let[n,r]=t;e._captureRemoteServiceName(n),e._storage.setItem(xc,JSON.stringify({config:n,etag:r})),e._sdkConfig=U(U({},e._baseConfig),Cc(n)),e._etag=r}catch(t){e._diag.warn(`Failed to refresh remote config: ${t instanceof Error?t.message:String(t)}`)}})()}_getRemoteConfigFromStorage(){try{let e=this._storage.getItem(xc);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to parse remote config from storage: ${e instanceof Error?e.message:String(e)}`),null}}_fetchRemoteConfig(e){var t=this;return ya(function*(){let n=yield fetch(e,{headers:t._etag?{"If-None-Match":t._etag}:{}}),r=n.headers.get(`etag`);return n.status===304?null:n.ok?[yield n.json(),r]:(t._diag.warn(`Failed to fetch remote config from ${e}: ${n.statusText}`),null)})()}};let Tc={maxAllowed:{error_log:500,warning_log:200,info_log:100,exception:500,breadcrumb:100,session_property:100,span:1e3,network_request:1e4,element_timing:500,server_timing:500,user_timing_mark:500,user_timing_measure:500},maxLength:{error_log:128,warning_log:128,info_log:128,exception:1024,breadcrumb:256,session_property_key:128,session_property_value:256,log_attribute_key:128,log_attribute_value:256,exception_attribute_key:128,exception_attribute_value:256},maxAttributes:{error_log:50,warning_log:50,info_log:50,exception:50}};R(),B();let Ec={info:`info_log`,warning:`warning_log`,error:`error_log`};var Dc=class{constructor({diag:e,maxAllowed:t,maxLength:n,maxAttributes:r}){z(this,`_diag`,void 0),z(this,`_diagnosticCounts`,{}),z(this,`_currentCount`,{exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}),z(this,`_maxAllowed`,void 0),z(this,`_maxLength`,void 0),z(this,`_maxAttributes`,void 0),this._diag=e==null?I.createComponentLogger({namespace:`MXLLimitManager`}):e,this._maxAllowed=t,this._maxLength=n,this._maxAttributes=r}_dropIfMaxReached(e){return this._currentCount[e]>=this._maxAllowed[e]?(this._diag.warn(`disallowing ${e} because the maximum number of ${this._maxAllowed[e].toString()} has already been reached for this session`),this._incrDiagnosticCount(e,`drop`),!0):(this._currentCount[e]=(this._currentCount[e]||0)+1,!1)}truncateString(e,t){return t.length>this._maxLength[e]?(this._diag.warn(`truncating ${e} because it is longer than ${this._maxLength[e].toString()} characters: "${t}"`),this._incrDiagnosticCount(e,`truncate_string`),t.substring(0,this._maxLength[e])):t}_truncateAttributes(e,t,n,r){let i=Object.keys(t);i.length>this._maxAttributes[e]&&(this._diag.warn(`truncating ${e} attributes because there are more than ${this._maxAttributes[e].toString()} set`),this._incrDiagnosticCount(e,`truncate_attributes`));let a={};for(let s=0;s<Math.min(i.length,this._maxAttributes[e]);s++){var o;let e=this.truncateString(n,i[s]);a[e]=this.truncateString(r,((o=t[i[s]])==null?void 0:o.toString())||``)}return a}limitBreadcrumb(e){return this._dropIfMaxReached(`breadcrumb`)?`dropped`:{name:this.truncateString(`breadcrumb`,e)}}limitException(e,t){return this._dropIfMaxReached(`exception`)?`dropped`:{message:this.truncateString(`exception`,e),attributes:this._truncateAttributes(`exception`,t,`exception_attribute_key`,`exception_attribute_value`)}}limitLog(e,t,n){let r=Ec[t];return this._dropIfMaxReached(r)?`dropped`:{message:this.truncateString(r,e),attributes:this._truncateAttributes(r,n,`log_attribute_key`,`log_attribute_value`)}}limitSessionProperty(e,t){return this._dropIfMaxReached(`session_property`)?`dropped`:{key:this.truncateString(`session_property_key`,e),value:this.truncateString(`session_property_value`,t)}}limitElementTimingEntry(){return this._dropIfMaxReached(`element_timing`)}limitServerTimingEntry(){return this._dropIfMaxReached(`server_timing`)}limitUserTimingEntry(e){return this._dropIfMaxReached(e===`mark`?`user_timing_mark`:`user_timing_measure`)}dropReadableSpan(e){let t=e.attributes[`mxl.type`]===`perf.network_request`?`network_request`:`span`;return this._dropIfMaxReached(t)}reset(){this._diagnosticCounts={},this._currentCount={exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}}_incrDiagnosticCount(e,t){let n=`mxl.app.applied_limit.${e}.${t}.count`;this._diagnosticCounts[n]=(this._diagnosticCounts[n]||0)+1}getDiagnosticCounts(){return this._diagnosticCounts}};R(),Lr(),B(),qn(),Eo(),Oo();let Oc=()=>JSON.stringify(En._MXLFileBundleIDs||En._MXLFileBundleIDs||{});var kc=class e{constructor({diag:e,perf:t,spanSessionManager:n,limitManager:r,loggerProvider:i,visibilityDoc:a=window.document,storage:o=window.localStorage}){z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_logger`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0);let s=i==null?Xs:i;this._diag=e==null?I.createComponentLogger({namespace:`MXLLogManager`}):e,this._perf=t==null?new So:t,this._logger=s.getLogger(`mxl-web-sdk-logs`),this._spanSessionManager=n,this._limitManager=r,this._visibilityDoc=a,this._storage=o}_validateAttributes(e){return Object.prototype.toString.call(e)===`[object Object]`?e:(this._diag.warn(`attributes must be a plain object`,e),{})}static _logSeverityToSeverityNumber(e){switch(e){case`info`:return Vs.INFO;case`warning`:return Vs.WARN;default:return Vs.ERROR}}logException(t,{handled:n=!0,attributes:r={},timestamp:i=this._perf.getNowMillis(),handler:a=`manual`}={}){var o;let s=this._validateAttributes(r);n||this._spanSessionManager.incrSessionCountForKey(`mxl.unhandled_exceptions_count`);let c=(t==null||(o=t.constructor)==null?void 0:o.name)||typeof t,l=``,u=c,d=``,f=``;if(t instanceof Error)l=String(t.message||``).trim(),u=t.name||``,d=t.stack||``,f=t.cause?`present`:``;else if(t&&typeof t==`object`)try{l=JSON.stringify(t)}catch(e){l=String(t).trim()}else l=String(t).trim();let{[vn]:p}=s,m=To(s,[vn].map(Kn)),h=this._limitManager.limitException(l,m);h!==`dropped`&&this._logger.emit({timestamp:i,severityNumber:Vs.ERROR,severityText:`ERROR`,body:h.message,attributes:U(U(U({},h.attributes),p===void 0?{}:{[vn]:String(p)}),{},{[hn]:`sys.exception`,"mxl.exception_handling":e._exceptionHandlingType(n,a),"mxl.exception_cause":f,[yr]:c,"exception.name":u,[_r]:h.message,[vr]:d,[bn]:Oc(),[gn]:Tn(this._visibilityDoc),"mxl.exception_number":mn(this._storage,`mxl_exception_number`,this._diag)})})}message(e,t,{attributes:n={},includeStacktrace:r=!0,stacktrace:i}={}){if(typeof e!=`string`||!e.trim()){this._diag.warn(`Message must be a non-empty string`);return}if(![`info`,`warning`,`error`].includes(t)){this._diag.warn(`Severity must be info, warning, or error`);return}let a=this._validateAttributes(n);t===`error`&&this._spanSessionManager.incrSessionCountForKey(`mxl.error_log_count`);let o=``;t!==`info`&&(typeof i==`string`?o=i:r&&(o=Error().stack||``)),this._logMessage({message:e.trim(),severity:t,timestamp:this._perf.getNowMillis(),attributes:a,stack:o})}_logMessage({message:t,severity:n,timestamp:r,attributes:i={},stack:a}){let o=this._limitManager.limitLog(t,n,i);o!==`dropped`&&this._logger.emit({timestamp:r,severityNumber:e._logSeverityToSeverityNumber(n),severityText:n.toUpperCase(),body:o.message,attributes:U(U(U({},o.attributes),{},{[hn]:`sys.log`},a?{"mxl.stacktrace.js":a,[bn]:Oc()}:{}),{},{[gn]:Tn(this._visibilityDoc)})})}static _exceptionHandlingType(e,t){return e?`handled`:t===`global_exception`?`unhandled_error`:t===`promise_rejection`?`unhandled_rejection`:`unhandled`}};B();var Ac=class{constructor({useDocumentTitleAsPageLabel:e=!0,titleDocument:t=window.document}={}){z(this,`_currentRoute`,null),z(this,`_currentPageId`,null),z(this,`_pageLabel`,null),z(this,`_titleDocument`,void 0),z(this,`_useDocumentTitleAsPageLabel`,void 0),z(this,`getCurrentPageId`,()=>this._currentPageId),z(this,`getCurrentRoute`,()=>this._currentRoute),z(this,`setPageLabel`,e=>{this._pageLabel=e}),z(this,`getPageLabel`,()=>this._pageLabel||(!this._useDocumentTitleAsPageLabel||!this._titleDocument?null:this._titleDocument.title)),z(this,`setCurrentRoute`,e=>{(!this._currentRoute||this._currentRoute.url!==e.url)&&(this._currentPageId=fn()),this._currentRoute=e,e.label?this._pageLabel=e.label:this._pageLabel=null}),z(this,`clearCurrentRoute`,()=>{this._currentRoute=null,this._currentPageId=null,this._pageLabel=null}),this._useDocumentTitleAsPageLabel=e,this._titleDocument=t}};B();var jc=class{constructor({dynamicConfigManager:e,deviceId:t,blockNetworkSpanForwarding:n}){z(this,`_dynamicConfigManager`,void 0),z(this,`_deviceId`,void 0),z(this,`_blockNetworkSpanForwarding`,void 0),this._dynamicConfigManager=e,this._deviceId=t,this._blockNetworkSpanForwarding=n}isSDKEnabled(){let e=this._dynamicConfigManager.getConfig();return Dn(this._deviceId,e.samplingPct)}isNetworkSpanForwardingEnabled(){if(this._blockNetworkSpanForwarding)return!1;let e=this._dynamicConfigManager.getConfig();return Dn(this._deviceId,e.networkSpansForwardingThreshold)}isEmptySessionAvoidanceEnabled(){let e=this._dynamicConfigManager.getConfig();return Dn(this._deviceId,e.emptySessionAvoidanceEnabledPct)}};B(),qn(),Eo();var Mc=class{constructor(e){z(this,`_span`,void 0),this._span=e}get attributes(){return this._span.attributes}addEvent(e,t,n){return this._span.addEvent(e,t,n),this}addLink(e){return this._span.addLink(e),this}addLinks(e){return this._span.addLinks(e),this}end(e){this._span.end(e)}isRecording(){return this._span.isRecording()}recordException(e,t){this._span.recordException(e,t)}setAttribute(e,t){return this._span.setAttribute(e,t),this}setAttributes(e){return this._span.setAttributes(e),this}removeAttribute(e){let t=this._span.attributes,{[e]:n}=t,r=To(t,[e].map(Kn));return this._span.attributes=r,this}setStatus(e){return this._span.setStatus(e),this}spanContext(){return this._span.spanContext()}updateName(e){return this._span.updateName(e),this}fail(e={code:`failure`}){e.code&&this._span.setAttribute(`mxl.error_code`,e.code.toUpperCase()),this._span.end(e.endTime)}};let Nc=`mxl_tab`,Pc=`mxl_tab_activity`;R(),B(),Oo();var Fc=class{constructor({diag:e,perf:t,visibilityDoc:n=window.document,storage:r=window.localStorage,sessionStorage:i=window.sessionStorage,limitManager:a,referrer:o=document.referrer,navigationPerformance:s=window.performance}){z(this,`_previousSessionId`,null),z(this,`_activeSessionId`,null),z(this,`_activeSessionStartTime`,null),z(this,`_sessionSpan`,null),z(this,`_activeSessionCounts`,null),z(this,`_nextSessionCounts`,{}),z(this,`_coldStart`,!0),z(this,`_sdkStartupDuration`,0),z(this,`_sessionStartedListeners`,[]),z(this,`_sessionEndedListeners`,[]),z(this,`_tab`,void 0),z(this,`_navigationSource`,void 0),z(this,`_referrerInfo`,void 0),z(this,`_tracer`,void 0),z(this,`_noExportTracer`,void 0),z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0),z(this,`_sessionStorage`,void 0),z(this,`_limitManager`,void 0),z(this,`_referrer`,void 0),z(this,`_navigationPerformance`,void 0),this._diag=e==null?I.createComponentLogger({namespace:`MXLSpanSessionManager`}):e,this._perf=t==null?new So:t,this._visibilityDoc=n,this._storage=r,this._sessionStorage=i,this._limitManager=a,this._referrer=o,this._navigationPerformance=s,this._tracer=L.getTracer(`mxl-web-sdk-sessions`),this._noExportTracer=new eo().getTracer(`mxl-web-sdk-sessions`),this._referrerInfo=this._processReferrer();let c=this._initTab();this._tab=c.tab,this._navigationSource=c.navigationSource,this._setupNewTabClickListeners()}_getPermanentAttributes(){let e=new Map;try{for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);if(n!=null&&n.startsWith(`mxl.properties.`)){let t=this._storage.getItem(n);t&&e.set(n,t)}}}catch(e){this._diag.warn(`Error loading permanent session properties`,e)}return Object.fromEntries(e.entries())}addBreadcrumb(e){if(!this._sessionSpan){this._diag.debug(`trying to add breadcrumb to a session, but there is no session in progress. This is a no-op.`);return}let t=this._limitManager.limitBreadcrumb(e);t!==`dropped`&&this._sessionSpan.addEvent(`mxl-breadcrumb`,{message:t.name},this._perf.getNowMillis())}addProperty(e,t,n){if(!this._sessionSpan){this._diag.debug(`trying to add properties to a session, but there is no session in progress. This is a no-op.`);return}let r=this._limitManager.limitSessionProperty(e,t);if(r===`dropped`)return;let i=_n+r.key;if(this._sessionSpan.setAttribute(i,r.value),(n==null?void 0:n.lifespan)===`permanent`)try{this._storage.setItem(i,t)}catch(e){this._diag.warn(`Failed to set permanent session property`,e)}}removeProperty(e){if(!this._sessionSpan){this._diag.debug(`trying to remove a session property, but there is no session in progress. This is a no-op.`);return}let t=_n+this._limitManager.truncateString(`session_property_key`,e);this._sessionSpan.removeAttribute(t);try{this._storage.getItem(t)&&this._storage.removeItem(t)}catch(e){this._diag.warn(`Error removing permanent session property`,e)}}endSessionSpan(){this.endSessionSpanInternal(`manual`)}endSessionSpanInternal(e){if(!this._sessionSpan){this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`);return}for(let e of this._sessionEndedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session ended listener`,e)}this._sessionSpan.setAttributes(this._endSessionSpanAttributes(e)),this._sessionSpan.end(),this._sessionSpan=null,this._activeSessionStartTime=null,this._previousSessionId=this._activeSessionId,this._activeSessionId=null,this._activeSessionCounts=null,this._limitManager.reset()}_endSessionSpanAttributes(e){return U(U(U(U({},this._getPermanentAttributes()),{},{"mxl.session_end_type":e},this._activeSessionCounts),this._limitManager.getDiagnosticCounts()),{},{"mxl.sdk_startup_duration":this._sdkStartupDuration})}currentSessionAsReadableSpan(e){if(!this._sessionSpan||!this._activeSessionStartTime)return this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`),null;let t=this._noExportTracer.startSpan(`mxl-session`,{startTime:this._activeSessionStartTime,attributes:U(U(U({},this._sessionSpan.attributes),this._endSessionSpanAttributes(e)),{},{"mxl.from_storage":!0})});return t.end(),t}getSessionId(){return this._activeSessionId}getPreviousSessionId(){return this._previousSessionId}getSessionSpan(){return this._sessionSpan}getSessionStartTime(){return this._activeSessionStartTime}startSessionSpan(e){var t;this._sessionSpan&&this.endSessionSpanInternal(`manual`),this._activeSessionId=fn(),this._activeSessionStartTime=this._perf.getNowHRTime(),this._activeSessionCounts={};let n=this._nextSessionCounts;this._nextSessionCounts={};let r=U(U({},this._getPermanentAttributes()),{},{[hn]:`ux.session`,[gn]:Tn(this._visibilityDoc),[zs]:this._activeSessionId,"mxl.cold_start":this._coldStart,"mxl.session_number":mn(this._storage,`mxl_session_number`,this._diag),"mxl.experience_id":this._tab.experienceId,"mxl.tab_id":this._tab.tabId,"mxl.navigation_source":this._navigationSource},n);this._referrerInfo.isValid&&this._referrerInfo.scrubbedUrl&&(r[`mxl.referrer_url`]=this._referrerInfo.scrubbedUrl),this._tab.sourceTabId&&(r[`mxl.source_tab_id`]=this._tab.sourceTabId),r[`mxl.session_start_type`]=(t=e==null?void 0:e.reason)==null?`manual`:t,this._sessionSpan=new Mc(this._tracer.startSpan(`mxl-session`,{attributes:r})),this._coldStart=!1;for(let e of this._sessionStartedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session started listener`,e)}}incrSessionCountForKey(e){if(!this._sessionSpan||!this._activeSessionCounts){this._diag.debug(`trying to increment a count for the active session, but there is no session in progress. This is a no-op.`);return}this._activeSessionCounts[e]=(this._activeSessionCounts[e]||0)+1}incrNextSessionCountForKey(e){this._nextSessionCounts[e]=(this._nextSessionCounts[e]||0)+1}addSessionStartedListener(e){let t=this._sessionStartedListeners.push(e);return()=>{this._sessionStartedListeners.splice(t-1,1)}}addSessionEndedListener(e){let t=this._sessionEndedListeners.push(e);return()=>{this._sessionEndedListeners.splice(t-1,1)}}recordSDKStartupDuration(e){this._sdkStartupDuration=Math.ceil(e)}setTracerProvider(e){this._tracer=e.getTracer(`mxl-web-sdk-sessions`)}_determineNavigationSource(){try{let e=this._navigationPerformance.getEntriesByType(`navigation`);if(e.length>0&&e[0]){let t=e[0];if(t.type===`reload`)return`reload`;if(t.type===`back_forward`)return`back_forward`}}catch(e){this._diag.warn(`Failed to get navigation type`,e)}return this._referrerInfo.isValid?this._referrerInfo.isSameOrigin?`same_origin`:`external`:`direct`}_processReferrer(){if(!this._referrer)return{isValid:!1,isSameOrigin:!1};try{let e=new URL(this._referrer),t=window.location.origin;return{isValid:!0,isSameOrigin:e.origin===t,scrubbedUrl:e.origin+e.pathname}}catch(e){return{isValid:!1,isSameOrigin:!1}}}_getTabContext(e){let t=gc(this._sessionStorage,this._diag),n,r;if(e===`same_origin`){let e=this._getTabActivity();e&&Date.now()-e.lastActivityMs<=1e4&&(n=e.tabId,r=e.experienceId)}return r!=null||(r=fn()),{sourceTabId:n,experienceId:r,tabId:t}}_initTab(){let e=this._determineNavigationSource();try{let t=this._sessionStorage.getItem(Nc);if(t)return{tab:JSON.parse(t),navigationSource:e}}catch(e){this._diag.warn(`Failed to retrieve tab data`,e)}let t=this._getTabContext(e),n={experienceId:t.experienceId,sourceTabId:t.sourceTabId,tabId:t.tabId};try{this._sessionStorage.setItem(Nc,JSON.stringify(n))}catch(e){this._diag.warn(`Failed to store tab data`,e)}return{tab:n,navigationSource:e}}_getTabActivity(){try{let e=this._storage.getItem(Pc);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to retrieve tab activity`,e),null}}_storeTabActivity(e){try{this._storage.setItem(Pc,JSON.stringify(e))}catch(e){this._diag.warn(`Failed to save tab activity`,e)}}_storeCurrentTabAsSource(){let e={tabId:this._tab.tabId,experienceId:this._tab.experienceId,lastActivityMs:Date.now()};this._storeTabActivity(e)}_setupNewTabClickListeners(){let e=e=>{var t;if(e.button===1||e.ctrlKey||e.metaKey||e.shiftKey){this._storeCurrentTabAsSource();return}(t=e.target)!=null&&t.closest(`a[target="_blank"], form[target="_blank"], a[rel*="noopener"], a[rel*="noreferrer"]`)&&this._storeCurrentTabAsSource()},t={capture:!0,passive:!0};document.addEventListener(`auxclick`,e,t),document.addEventListener(`click`,e,t)}};R(),B();var Ic=class{constructor({tracerProvider:e}={}){z(this,`_tracer`,void 0),z(this,`setSpan`,L.setSpan);let t=e==null?L:e;this._tracer=t.getTracer(`mxl-web-sdk-traces`)}startSpan(e,t={},n){t.attributes=t.attributes?t.attributes:{},t.attributes[hn]=`perf`;let r=t.parentSpan?L.setSpan(F.active(),t.parentSpan):n;return new Mc(this._tracer.startSpan(e,t,r))}getSpan(e){let t=L.getSpan(e);if(t)return new Mc(t)}};let Lc=`mxl_user`,Rc=`mxl_user_id`,zc=`mxl_external_user_id`,Bc=e=>typeof e[`enduser.pseudo.id`]==`string`&&e[`enduser.pseudo.id`].length===32,Vc=e=>typeof e==`string`&&e.length===32;R(),B();var Hc=class{constructor({diag:e,storage:t=window.localStorage}={}){z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_mxlUserId`,null),this._diag=e==null?I.createComponentLogger({namespace:`MXLUserManager`}):e,this._storage=t,this._migrateOldLocalStorageKey(),this._initialSetup()}getMXLUserId(){return this._mxlUserId||this._generateNewMXLUserId()}setMXLUserId(e){this._mxlUserId=e;try{this._storage.setItem(Rc,e)}catch(e){this._diag.warn(`Failed to persist user object for storage, keeping it in-memory only`,e)}}clearMXLUserId(){this._mxlUserId=null;try{this._storage.removeItem(Rc)}catch(e){this._diag.warn(`Failed to remove mxl user in storage`,e)}}_migrateOldLocalStorageKey(){try{let e=this._storage.getItem(Lc);if(e){let t=JSON.parse(e);Bc(t)?(this._diag.debug(`Migrating old user data from storage`),this._storage.setItem(Rc,t[`enduser.pseudo.id`]),this._storage.removeItem(Lc)):(this._diag.warn(`Invalid user data found in storage, clearing old user data`),this._storage.removeItem(Lc))}}catch(e){this._diag.warn(`Failed to get old user data from storage`,e)}}_initialSetup(){try{let e=this._storage.getItem(Rc);e?Vc(e)?this._mxlUserId=e:(this._diag.warn(`Invalid mxl user id, generating a new one`),this.clearMXLUserId()):this._diag.debug(`No existing user found in storage, creating a new one`)}catch(e){this._diag.warn(`Failed to get mxl user id from storage, defaulting to a new one`,e)}this._mxlUserId||(this._mxlUserId=this._generateNewMXLUserId())}_generateNewMXLUserId(){let e=fn();return this.setMXLUserId(e),e}getUserId(){try{return this._storage.getItem(zc)}catch(e){return this._diag.warn(`Failed to retrieve user id from storage`,e),null}}setUserId(e){try{this._storage.setItem(zc,e)}catch(e){this._diag.warn(`Failed to store user id`,e)}}clearUserId(){try{this._storage.removeItem(zc)}catch(e){this._diag.warn(`Failed to clear user id`,e)}}};let Uc=[`keydown`,`mousedown`,`mousemove`,`scroll`];B();var Wc=class extends Qs{constructor({diag:e}={}){super({instrumentationName:`SpanSessionBrowserActivityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_onActivityThrottled`,void 0),z(this,`_activityTimeout`,void 0),z(this,`disable`,()=>{cn({target:window,events:Uc,callback:this._onActivityThrottled}),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null}),z(this,`enable`,()=>{sn({target:window,events:Uc,callback:this._onActivityThrottled})}),z(this,`_onInactivity`,()=>{this._diag.debug(`Inactivity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null,this.sessionManager.endSessionSpanInternal(`inactivity`)}),z(this,`_onActivity`,()=>{this._diag.debug(`Activity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this.sessionManager.getSessionId()||this.sessionManager.startSessionSpan({reason:`activity`}),this._activityTimeout=setTimeout(this._onInactivity,18e5)}),this._activityTimeout=null,this._onActivityThrottled=Mo(this._onActivity,3e4),this._config.enabled&&this.enable()}};B();var Gc=class extends Qs{constructor({diag:e,perf:t,visibilityDoc:n=window.document}={}){super({instrumentationName:`SpanSessionVisibilityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onVisibilityChange`,void 0),this._onVisibilityChange=()=>{this._diag.debug(`Visibility change detected: ${n.visibilityState}`);try{this.sessionManager.endSessionSpanInternal(`state_changed`),n.visibilityState===`visible`&&(this._diag.debug(`Starting a session since document visibility switched to visible`),this.sessionManager.startSessionSpan({reason:`visible`}))}catch(e){this._diag.error(`Failed to rotate session on visibility change to ${n.visibilityState}`,e)}},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`visibilitychange`,this._onVisibilityChange)}enable(){window.addEventListener(`visibilitychange`,this._onVisibilityChange)}};let Kc=`mxl.user_timing.start_time`,qc=`mxl.user_timing.duration`,Jc=`mxl.user_timing.entry_type`;B(),Oo();var Yc=class extends Qs{constructor({diag:e,perf:t,limitManager:n,allowedEntries:r}={}){super({instrumentationName:`UserTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_markObserver`,null),z(this,`_measureObserver`,null),z(this,`_seenEntries`,new Set),z(this,`_isEnabled`,!1),z(this,`_allowedEntries`,void 0),this._allowedEntries=r,this._config.enabled&&this.enable()}enable(){this._isEnabled||(this._isEnabled=!0,this._seenEntries=new Set,this._markObserver&&this._markObserver.disconnect(),this._measureObserver&&this._measureObserver.disconnect(),this._markObserver=jo(`mark`,this._processEntry.bind(this),{diag:this._diag}),this._markObserver||this._diag.error(`failed to enable mark observer`),this._measureObserver=jo(`measure`,e=>this._processEntry(e),{diag:this._diag}),this._measureObserver||this._diag.error(`failed to enable measure observer`),!this._markObserver&&!this._measureObserver&&(this._isEnabled=!1))}disable(){this._isEnabled=!1,this._markObserver&&(this._markObserver.disconnect(),this._markObserver=null),this._measureObserver&&(this._measureObserver.disconnect(),this._measureObserver=null),this._seenEntries=new Set}_processEntry(e){var t;if(!this._isEnabled||this._allowedEntries!==void 0&&!(Array.isArray(this._allowedEntries)?this._allowedEntries.includes(e.name):this._allowedEntries(e)))return;let n=`${location.href}::${e.name}`;if(this._seenEntries.has(n)||(this._seenEntries.add(n),(t=this.limitManager)!=null&&t.limitUserTimingEntry(e.entryType)))return;if(e.entryType===`measure`){let t=e.detail;this.tracer.startSpan(e.name,{startTime:this.perf.epochMillisFromOriginOffset(e.startTime),attributes:U({[hn]:`ux.user_timing`,[yn]:`user_timing`,[Jc]:e.entryType,[Kc]:this.perf.millisFromZeroTime(e.startTime),[qc]:e.duration},t!=null&&{"mxl.user_timing.detail":JSON.stringify(t)})}).end(this.perf.epochMillisFromOriginOffset(e.startTime+e.duration));return}let r=e.detail,i=r==null?void 0:JSON.stringify(r);this.logger.emit({timestamp:this.perf.epochMillisFromOriginOffset(e.startTime),eventName:`mxl-user-timing`,severityNumber:Vs.INFO,attributes:{[hn]:`ux.user_timing`,"mxl.user_timing.name":e.name,[Kc]:this.perf.millisFromZeroTime(e.startTime),[qc]:e.duration,[Jc]:e.entryType},body:i})}};let Xc=`mxl.web_vital.attribution.`;B(),Oo();var Zc=class{constructor(){z(this,`t`,void 0),z(this,`o`,0),z(this,`i`,[])}u(e){var t;if(e.hadRecentInput)return;let n=this.i[0],r=this.i.at(-1);this.o&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),(t=this.t)==null||t.call(this,e)}};let Qc=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},$c=e=>{if(document.readyState===`loading`)return`loading`;let t=Qc();if(t){if(e<t.domInteractive)return`loading`;if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return`dom-interactive`;if(t.domComplete===0||e<t.domComplete)return`dom-content-loaded`}return`complete`},el=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},tl=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[el(n),...Array.from(n.classList).sort()].join(`.`);if(t.length+r.length>99)return t||r;if(t=t?r+`>`+t:r,n.id)break;e=n.parentNode}}catch(e){}return t},nl=new WeakMap;function rl(e,t){return nl.get(e)||nl.set(e,new t),nl.get(e)}let il=-1,al=()=>il,ol=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(il=t.timeStamp,e(t))},!0)},sl=(e,t,n,r)=>{let i,a;return o=>{var s;t.value>=0&&(o||r)&&(a=t.value-((s=i)==null?0:s),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`)(t.value,n),e(t)))}},cl=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},ll=()=>{var e,t;return(e=(t=Qc())==null?void 0:t.activationStart)==null?0:e},ul=(e,t=-1)=>{let n=Qc(),r=`navigate`;return al()>=0?r=`back-forward-cache`:n&&(document.prerendering||ll()>0?r=`prerender`:document.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:r}},dl=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(U({type:e,buffered:!0},n)),r}}catch(e){}},fl=e=>{let t=!1;return()=>{t||(e(),t=!0)}},pl=-1,ml=new Set,hl=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,gl=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of ml)e();isFinite(pl)||(pl=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,gl,!0))}},_l=()=>{if(pl<0){var e;let t=ll(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;pl=n==null?hl():n,addEventListener(`visibilitychange`,gl,!0),addEventListener(`prerenderingchange`,gl,!0),ol(()=>{setTimeout(()=>{pl=hl()})})}return{get firstHiddenTime(){return pl},onHidden(e){ml.add(e)}}},vl=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},yl=[1800,3e3],bl=(e,t={})=>{vl(()=>{let n=_l(),r,i=ul(`FCP`),a=dl(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ll(),0),i.entries.push(t),r(!0)))});a&&(r=sl(e,i,yl,t.reportAllChanges),ol(n=>{i=ul(`FCP`),r=sl(e,i,yl,t.reportAllChanges),cl(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},xl=[.1,.25],Sl=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],Cl=(e,t={})=>{let n=rl(t=Object.assign({},t),Zc),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=Sl(e.sources),o=n==null?void 0:n.node;if(o){var i,a;let e=(i=(a=t.generateTarget)==null?void 0:a.call(t,o))==null?tl(o):i;r.set(n,e)}}},((e,t={})=>{let n=_l();bl(fl(()=>{let r,i=ul(`CLS`,0),a=rl(t,Zc),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=dl(`layout-shift`,o);s&&(r=sl(e,i,xl,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),ol(()=>{a.o=0,i=ul(`CLS`,0),r=sl(e,i,xl,t.reportAllChanges),cl(r)}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){var n;let i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(!(i==null||(n=i.sources)==null)&&n.length){let e=Sl(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:$c(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},wl=(e,t={})=>{bl(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:$c(al())};if(e.entries.length){let n=Qc(),r=e.entries.at(-1);if(n){let i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:$c(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},Tl=0,El=1/0,Dl=0,Ol=e=>{for(let t of e)t.interactionId&&(El=Math.min(El,t.interactionId),Dl=Math.max(Dl,t.interactionId),Tl=Dl?(Dl-El)/7+1:0)},kl,Al=()=>{var e;return kl?Tl:(e=performance.interactionCount)==null?0:e},jl=()=>{`interactionCount`in performance||kl||(kl=dl(`event`,Ol,{durationThreshold:0}))},Ml=0;var Nl=class{constructor(){z(this,`l`,[]),z(this,`h`,new Map),z(this,`m`,void 0),z(this,`p`,void 0)}v(){Ml=Al(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((Al()-Ml)/50));return this.l[e]}u(e){var t;if((t=this.m)==null||t.call(this,e),!e.interactionId&&e.entryType!==`first-input`)return;let n=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>n.T){var i;if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){let e=this.l.splice(10);for(let t of e)this.h.delete(t.id)}(i=this.p)==null||i.call(this,r)}}};let Pl=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=fl(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},Fl=[200,500],Il=(e,t={})=>{let n=rl(t=Object.assign({},t),Nl),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(Pl(u),c=!0)},u=()=>{let e=new Set(n.l.map(e=>o.get(e.entries[0]))),t=i.length-10;i=i.filter((n,r)=>r>=t||e.has(n));let s=new Set;for(let e of i){let t=d(e.startTime,e.processingEnd);for(let e of t)s.add(e)}r=r.filter(e=>e.startTime>a||s.has(e)),c=!1};n.m=e=>{let n=e.startTime+e.duration,r;a=Math.max(a,e.processingEnd);for(let a=i.length-1;a>=0;a--){let o=i[a];if(Math.abs(n-o.renderTime)<=8){r=o,r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:!1===t.includeProcessedEventEntries?[]:[e]},i.push(r)),(e.interactionId||e.entryType===`first-input`)&&o.set(e,r),l()},n.p=e=>{if(!s.get(e)){let i=e.entries[0].target;if(i){var n,r;let a=(n=(r=t.generateTarget)==null?void 0:r.call(t,i))==null?tl(i):n;s.set(e,a)}}};let d=(e,t)=>{let n=[];for(let i of r)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;n.push(i)}return n},f=e=>{let t=e.entries[0],r=o.get(t),i=t.processingStart,a=Math.max(t.startTime+t.duration,i),c=Math.min(r.processingEnd,a),l=r.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,c),f=n.h.get(t.interactionId),p={interactionTarget:s.get(f),interactionType:t.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:u,inputDelay:i-t.startTime,processingDuration:c-i,presentationDelay:a-c,loadState:$c(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{var t;if(!((t=e.longAnimationFrameEntries)!=null&&t.length))return;let n=e.interactionTime,r=e.inputDelay,i=e.processingDuration,a,o,s=0,c=0,l=0,u=0;for(let t of e.longAnimationFrameEntries){c=c+t.startTime+t.duration-t.styleAndLayoutStart;for(let e of t.scripts){let t=e.startTime+e.duration;if(t<n)continue;let l=t-Math.max(n,e.startTime),d=e.duration?l/e.duration*e.forcedStyleAndLayoutDuration:0;s+=l-d,c+=d,l>u&&(o=e.startTime<n+r?`input-delay`:e.startTime>=n+r+i?`presentation-delay`:`processing-duration`,a=e,u=l)}}let d=e.longAnimationFrameEntries.at(-1),f=d?d.startTime+d.duration:0;f>=n+r+i&&(l=e.nextPaintTime-f),a&&o&&(e.longestScript={entry:a,subpart:o,intersectingDuration:u}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=c,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-c-l})(p),Object.assign(e,{attribution:p})};dl(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=_l();vl(()=>{var r;jl();let i,a=ul(`INP`),o=rl(t,Nl),s=e=>{Pl(()=>{for(let t of e)o.u(t);let t=o.M();t&&t.T!==a.value&&(a.value=t.T,a.entries=t.entries,i())})},c=dl(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=sl(e,a,Fl,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),ol(()=>{o.v(),a=ul(`INP`),i=sl(e,a,Fl,t.reportAllChanges)}))})})(t=>{e(f(t))},t)};var Ll=class{constructor(){z(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}};let Rl=[2500,4e3],zl=(e,t={})=>{let n=rl(t=Object.assign({},t),Ll),r=new WeakMap;n.m=e=>{let n=e.element;if(n){var i,a;let o=(i=(a=t.generateTarget)==null?void 0:a.call(t,n))==null?tl(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{vl(()=>{let n=_l(),r,i=ul(`LCP`),a=rl(t,Ll),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a.u(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ll(),0),i.entries=[t],r())},s=dl(`largest-contentful-paint`,o);if(s){r=sl(e,i,Rl,t.reportAllChanges);let n=fl(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(Pl(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});ol(n=>{i=ul(`LCP`),r=sl(e,i,Rl,t.reportAllChanges),cl(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=e.entries.at(-1),i=n.url&&performance.getEntriesByType(`resource`).find(e=>e.name===n.url);t.target=r.get(n),t.lcpEntry=n,n.url&&(t.url=n.url),i&&(t.lcpResourceEntry=i);let a=Qc();if(a){let n=a.activationStart||0,r=Math.max(0,a.responseStart-n),o=Math.max(r,i?(i.requestStart||i.startTime)-n:0),s=Math.min(e.value,Math.max(o,i?i.responseEnd-n:0));t=U(U({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},Bl=[800,1800],Vl=e=>{document.prerendering?vl(()=>Vl(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Vl(e),!0)},Hl=(e,t={})=>{((e,t={})=>{let n=ul(`TTFB`),r=sl(e,n,Bl,t.reportAllChanges);Vl(()=>{let i=Qc();i&&(n.value=Math.max(i.responseStart-ll(),0),n.entries=[i],r(!0),ol(()=>{n=ul(`TTFB`,0),r=sl(e,n,Bl,t.reportAllChanges),r(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)},Ul=[`CLS`,`INP`,`LCP`,`FCP`,`TTFB`],Wl={CLS:Cl,FCP:wl,LCP:zl,INP:Il,TTFB:Hl,FID:void 0};Lr(),B(),Oo();let Gl=e=>{let t=typeof e;return t===`number`||t===`string`||t===`boolean`},Kl=e=>Math.round(Math.max(0,e)),ql=e=>{let t={},n=e.attribution;if(!n||typeof n!=`object`)return t;for(let[e,r]of Object.entries(n))Gl(r)&&(t[`${Xc}${e}`]=r);return t},Jl=(e,t)=>{let n={},r=e.attribution;try{if(r.longAnimationFrameEntries.length>0){let e=new Map;for(let t of r.longAnimationFrameEntries)for(let n of t.scripts){let t=n.sourceURL||`(inline)`;t.length>2048&&(t=`${t.substring(0,2048)}...`);let r=e.get(t);r?(r.totalDuration+=n.duration,r.styleAndLayoutDuration+=n.forcedStyleAndLayoutDuration,r.count++):e.set(t,{totalDuration:n.duration,styleAndLayoutDuration:n.forcedStyleAndLayoutDuration,count:1})}e.size>0&&(n[`${Xc}loaf_scripts`]=JSON.stringify(Object.fromEntries([...e].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]))))}}catch(e){t.error(`error building loaf scripts for INP`,e)}return n},Yl=(e,t)=>{let n={},r=e.attribution.navigationEntry;if(r)try{var i;let e=Kl(r.redirectEnd-r.redirectStart),t=Kl(r.domainLookupEnd-r.domainLookupStart),a=Kl(r.secureConnectionStart>0?r.secureConnectionStart-r.connectStart:r.connectEnd-r.connectStart),o=Kl(r.secureConnectionStart>0?r.connectEnd-r.secureConnectionStart:0),s=Kl(Math.max((i=r.finalResponseHeadersStart)==null?0:i,r.responseStart)-r.requestStart),c=Kl(Math.round(r.responseEnd-r.startTime)-e-t-a-o-s),l=Xc;n[`${l}redirect`]=e,n[`${l}domainLookup`]=t,n[`${l}tcpConnection`]=a,n[`${l}tlsNegotiation`]=o,n[`${l}serverResponse`]=s,n[`${l}unattributed`]=c}catch(e){t.error(`error computing TTFB timing breakdown`,e)}else t.debug(`TTFB navigationEntry unavailable, skipping timing breakdown`);return n};var Xl=class extends Qs{constructor({diag:e,perf:t,listeners:n=Wl,urlDocument:r=window.document,urlAttribution:i=!0,pageManager:a}={}){super({instrumentationName:`WebVitalsInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_listeners`,void 0),z(this,`_urlDocument`,void 0),z(this,`_urlAttribution`,void 0),z(this,`_pageManager`,void 0),z(this,`_attributedPage`,{INP:void 0,LCP:void 0,CLS:void 0,FCP:void 0,TTFB:void 0}),z(this,`_largestShiftTargetForCLS`,void 0),z(this,`_listenersRegistered`,!1),z(this,`_isEnabled`,!1),this._listeners=n,this._urlDocument=r,this._urlAttribution=i,this._pageManager=a==null?Ko.getPageManager():a,this._config.enabled&&this.enable()}disable(){this._isEnabled=!1,this._diag.debug(`WebVitalsInstrumentation disabled, pausing emission`)}enable(){if(this._isEnabled=!0,this._listenersRegistered){this._diag.debug(`WebVitalsInstrumentation listeners already registered, resuming emission`);return}if(this._listenersRegistered=!0,Ul.forEach(e=>{var t,n;(t=(n=this._listeners)[e])==null||t.call(n,t=>{if(!this._isEnabled)return;let n=this.sessionManager.getSessionSpan();if(!n)return;let r=this._getTimeForMetric(t),i=this._getAttributedPageForMetric(t),a=U(U(U({"mxl.type":`ux.web_vital`,"url.full":i.fullURL,"browser.url.full":i.fullURL,"mxl.web_vital.navigation_type":t.navigationType,"mxl.web_vital.name":t.name,"mxl.web_vital.rating":t.rating,"mxl.web_vital.id":t.id,"mxl.web_vital.delta":t.delta,"mxl.web_vital.value":t.value},ql(t)),e===`INP`?Jl(t,this._diag):{}),e===`TTFB`?Yl(t,this._diag):{});i.path&&i.pageID&&(a[`app.surface.name`]=i.path,a[`app.surface.id`]=i.pageID),i.label&&(a[`app.surface.label`]=i.label),n.addEvent(`mxl-web-vitals-report-${e}`,a,r)})}),this._urlAttribution){var e,t,n,r,i,a,o,s,c,l;(e=(t=this._listeners).TTFB)==null||e.call(t,()=>{this._attributedPage.TTFB=this._currentAttributedPage()},{reportAllChanges:!0}),(n=(r=this._listeners).FCP)==null||n.call(r,()=>{this._attributedPage.FCP=this._currentAttributedPage()},{reportAllChanges:!0}),(i=(a=this._listeners).INP)==null||i.call(a,()=>{this._attributedPage.INP=this._currentAttributedPage()},{reportAllChanges:!0}),(o=(s=this._listeners).LCP)==null||o.call(s,()=>{this._attributedPage.LCP=this._currentAttributedPage()},{reportAllChanges:!0}),(c=(l=this._listeners).CLS)==null||c.call(l,e=>{let t=e;this._largestShiftTargetForCLS!==t.attribution.largestShiftTarget&&(this._largestShiftTargetForCLS=t.attribution.largestShiftTarget,this._attributedPage.CLS=this._currentAttributedPage())},{reportAllChanges:!0})}}_getTimeForMetric(e){return e.name===`CLS`&&e.attribution.largestShiftTime?this.perf.epochMillisFromOriginOffset(e.attribution.largestShiftTime):e.name===`INP`&&e.attribution.interactionTime?this.perf.epochMillisFromOriginOffset(e.attribution.interactionTime):this.perf.getNowMillis()}_currentAttributedPage(){let e={fullURL:this._urlDocument.URL},t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.path=t.path,e.pageID=n);let r=this._pageManager.getPageLabel();return r&&(e.label=r),e}_getAttributedPageForMetric(e){return e.name===`FCP`&&this._attributedPage.FCP?this._attributedPage.FCP:e.name===`TTFB`&&this._attributedPage.TTFB?this._attributedPage.TTFB:e.name===`INP`&&this._attributedPage.INP?this._attributedPage.INP:e.name===`LCP`&&this._attributedPage.LCP?this._attributedPage.LCP:e.name===`CLS`&&this._attributedPage.CLS&&e.attribution.largestShiftTarget===this._largestShiftTargetForCLS?this._attributedPage.CLS:this._currentAttributedPage()}};function Zl(e){return Ql(e,new WeakSet)}function Ql(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Ql(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Ql(e,t))}return!1}R(),V(),Lr(),B();var $l=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){z(this,`hrTime`,void 0),z(this,`hrTimeObserved`,void 0),z(this,`spanContext`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`attributes`,{}),z(this,`_severityText`,void 0),z(this,`_severityNumber`,void 0),z(this,`_body`,void 0),z(this,`_eventName`,void 0),z(this,`_attributesCount`,0),z(this,`_droppedAttributesCount`,0),z(this,`_isReadonly`,!1),z(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=Kr(r==null?f:r),this.hrTimeObserved=Kr(i==null?f:i),d){let e=L.getSpanContext(d);e&&ut(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return I.warn(`Invalid attribute key: ${e}`),this;if(!Zl(t))return I.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&I.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return I.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(_r,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(yr,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(yr,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(_r,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(vr,n.stack),t=!0)}t||I.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&I.warn(`Can not execute the operation on emitted log record`),this._isReadonly}};R(),B(),Oo();var eu=class{constructor(e,t){z(this,`instrumentationScope`,void 0),z(this,`_sharedState`,void 0),z(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=e.context||F.active();if(!this.enabled(e))return;let n=new $l(this._sharedState,this.instrumentationScope,U({context:t},e));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e==null?void 0:e.severityNumber;if(typeof n==`number`&&n!==Vs.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=(e==null?void 0:e.context)||F.active();if(t.traceBased){let e=L.getSpanContext(r);if(e&&ut(e)&&(e.traceFlags&Ge.SAMPLED)!==Ge.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e==null?void 0:e.severityNumber,eventName:e==null?void 0:e.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},tu=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}};V(),B();var nu=class{constructor(e,t){z(this,`processors`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return ya(function*(){let t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map(e=>na(e.forceFlush(),t)))})()}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}shutdown(){var e=this;return ya(function*(){yield Promise.all(e.processors.map(e=>e.shutdown()))})()}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function ru(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}B();var iu=class{constructor(e){z(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(`otel.sdk.log.created`,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}};R(),Oo(),B();let au={disabled:!1,minimumSeverity:Vs.UNSPECIFIED,traceBased:!1},ou=()=>U({},au);var su=class{constructor(e,t,n,r,i,a){z(this,`loggers`,new Map),z(this,`activeProcessor`,void 0),z(this,`registeredLogRecordProcessors`,[]),z(this,`resource`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),z(this,`logRecordLimits`,void 0),z(this,`processors`,void 0),z(this,`loggerMetrics`,void 0),z(this,`_loggerConfigurator`,void 0),z(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new nu(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new tu,this._loggerConfigurator=i==null?ou:i;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,`0.218.0`):ge();this.loggerMetrics=new iu(o)}getLoggerConfig(e){let t=ru(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}};R(),V(),B();var cu=class{constructor(e={}){var t,n,r,i,a,o,s,c;z(this,`_shutdownOnce`,void 0),z(this,`_sharedState`,void 0);let l={resource:(t=e.resource)==null?Ca():t,forceFlushTimeoutMillis:(n=e.forceFlushTimeoutMillis)==null?3e4:n,logRecordLimits:{attributeCountLimit:(r=(i=e.logRecordLimits)==null?void 0:i.attributeCountLimit)==null?128:r,attributeValueLengthLimit:(a=(o=e.logRecordLimits)==null?void 0:o.attributeValueLengthLimit)==null?1/0:a},loggerConfigurator:(s=e.loggerConfigurator)==null?ou:s,processors:(c=e.processors)==null?[]:c,meterProvider:e.meterProvider};this._sharedState=new su(l.resource,l.forceFlushTimeoutMillis,l.logRecordLimits,l.processors,l.loggerConfigurator,l.meterProvider),this._shutdownOnce=new ua(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return I.warn(`A shutdown LoggerProvider cannot provide a Logger`),Us;e||I.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new eu({name:r,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(I.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(I.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};R(),V(),B();function lu(e){return uu.apply(this,arguments)}function uu(){return uu=ya(function*(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&(yield Promise.all(t))}),uu.apply(this,arguments)}var du=class{constructor(e,t,n){z(this,`_exportCompleted`,void 0),z(this,`_exportScheduledPromise`,void 0),z(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(e,t,n){var r=this;return ya(function*(){try{yield lu(t),yield F.with(kn(F.active()),ya(function*(){return r._exportWithTimeout(e,t,n)}))}catch(e){ir(e),r._exportScheduledResolve()}})()}_exportWithTimeout(e,t,n){var r=this;return ya(function*(){return new Promise((i,a)=>{let o=setTimeout(()=>{a(Error(`Timeout`))},n);e.export(t,e=>{if(clearTimeout(o),e.code===ri.SUCCESS)i();else{var t;a((t=e.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):t)}}),r._exportScheduledResolve()})})()}},fu=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_currentExport`,null),z(this,`_finishedLogRecords`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=(n=t==null?void 0:t.maxExportBatchSize)==null?512:n,this._maxQueueSize=(r=t==null?void 0:t.maxQueueSize)==null?2048:r,this._scheduledDelayMillis=(i=t==null?void 0:t.scheduledDelayMillis)==null?5e3:i,this._exportTimeoutMillis=(a=t==null?void 0:t.exportTimeoutMillis)==null?3e4:a,this._shutdownOnce=new ua(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(I.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return ya(function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()})()}_flushAll(){var e=this;return ya(function*(){if(e._flushing)return;e._flushing=!0;let t=e._finishedLogRecords;for(e._finishedLogRecords=[],e._clearTimer(),e._currentExport!==null&&(yield e._exporter.forceFlush(),yield e._currentExport.exportCompleted,e._currentExport=null);t.length>0;){let n;t.length<=e._maxExportBatchSize?(n=t,t=[]):n=t.splice(0,e._maxExportBatchSize);let r=new du(e._exporter,n,e._exportTimeoutMillis);e._currentExport=r;try{yield r.exportScheduled,yield e._exporter.forceFlush(),yield r.exportCompleted}catch(e){ir(e)}finally{e._currentExport=null}}e._flushing=!1,e._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new du(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,ir(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};B();var pu=class extends fu{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this._onInit(t)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}};B();var mu=class{constructor(e){z(this,`_sessionIdProvider`,void 0),this._sessionIdProvider=e}forceFlush(){return ya(function*(){})()}onStart(e,t){var n;let r=(n=this._sessionIdProvider)==null?void 0:n.getSessionId();r&&e.setAttribute(`session.id`,r)}onEnd(e){}shutdown(){return ya(function*(){})()}};function hu(e){return new mu(e)}let gu={compression:`gzip`,keepalive:!0,concurrencyLimit:5,timeoutMillis:30*1e3},_u=(e,t)=>({"X-MXL-AID":e,"X-MXL-DID":t}),vu=(e,t)=>t||`http://mxl-otelcol.service-availability.apps.ocpthikadev01.safaricom.net`,yu=`1.9.1`,bu=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function xu(e){let t=new Set([e]),n=new Set,r=e.match(bu);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(bu);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}let Su=xu(yu),Cu=yu.split(`.`)[0],wu=Symbol.for(`opentelemetry.js.api.${Cu}`),Tu=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function Eu(e,t,n,r=!1){var i;let a=Tu[wu]=(i=Tu[wu])==null?{version:yu}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${yu}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${yu}.`),!0}function Du(e){var t,n;let r=(t=Tu[wu])==null?void 0:t.version;if(!(!r||!Su(r)))return(n=Tu[wu])==null?void 0:n[e]}function Ou(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${yu}.`);let n=Tu[wu];n&&delete n[e]}var ku=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Au(`debug`,this._namespace,e)}error(...e){return Au(`error`,this._namespace,e)}info(...e){return Au(`info`,this._namespace,e)}warn(...e){return Au(`warn`,this._namespace,e)}verbose(...e){return Au(`verbose`,this._namespace,e)}};function Au(e,t,n){let r=Du(`diag`);if(r)return r[e](t,...n)}var ju;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(ju||(ju={}));function Mu(e,t){e<ju.NONE?e=ju.NONE:e>ju.ALL&&(e=ju.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,ju.ERROR),warn:n(`warn`,ju.WARN),info:n(`info`,ju.INFO),debug:n(`debug`,ju.DEBUG),verbose:n(`verbose`,ju.VERBOSE)}}let Nu=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=Du(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:ju.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=Du(`diag`),s=Mu((i=n.logLevel)==null?ju.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return Eu(`diag`,s,t,!0)},t.disable=()=>{Ou(`diag`,t)},t.createComponentLogger=e=>new ku(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}.instance(),Pu=Math.pow(10,9);function Fu(e){return e[0]*Pu+e[1]}function Iu(e,t){let n={attributes:Ru(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function Lu(e){return{name:e.name,version:e.version}}function Ru(e,t){return Object.keys(e).map(n=>zu(n,e[n],t))}function zu(e,t,n){return{key:e,value:Bu(t,n)}}function Bu(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=Bu(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:Bu(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}function Vu(e,t){return{resourceLogs:Uu(e,t)}}function Hu(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function Uu(e,t){let n=Hu(e);return Array.from(n,([e,n])=>{let r=Iu(e,t);return{resource:r,scopeLogs:Array.from(n,([,e])=>({scope:Lu(e[0].instrumentationScope),logRecords:e.map(e=>Wu(e,t)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function Wu(e,t){var n,r,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:Gu(e.severityNumber),severityText:e.severityText,body:Bu(e.body,t),eventName:e.eventName,attributes:Ku(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:(n=e.spanContext)==null?void 0:n.traceFlags,traceId:t.encodeOptionalSpanContext((r=e.spanContext)==null?void 0:r.traceId),spanId:t.encodeOptionalSpanContext((i=e.spanContext)==null?void 0:i.spanId)}}function Gu(e){return e}function Ku(e,t){return Object.keys(e).map(n=>zu(n,e[n],t))}function qu(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Ju(e){return qu(e).toString()}let Yu=typeof BigInt<`u`?Ju:Fu;function Xu(e){return e}let Zu={encodeHrTime:Yu,encodeSpanContext:Xu,encodeOptionalSpanContext:Xu,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},Qu={serializeRequest:e=>{let t=Vu(e,Zu);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Nu.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}};function $u(e,t){let n=e&255|256;return t&&(n|=512),n}function ed(e,t){var n,r,i,a;let o=e.spanContext(),s=e.status,c=(n=e.parentSpanContext)!=null&&n.spanId?t.encodeSpanContext((r=e.parentSpanContext)==null?void 0:r.spanId):void 0;return{traceId:t.encodeSpanContext(o.traceId),spanId:t.encodeSpanContext(o.spanId),parentSpanId:c,traceState:(i=o.traceState)==null?void 0:i.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Ru(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>nd(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>td(e,t)),droppedLinksCount:e.droppedLinksCount,flags:$u(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function td(e,t){var n;return{attributes:e.attributes?Ru(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(n=e.context.traceState)==null?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:$u(e.context.traceFlags,e.context.isRemote)}}function nd(e,t){return{attributes:e.attributes?Ru(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function rd(e,t){return{resourceSpans:ad(e,t)}}function id(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function ad(e,t){let n=id(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>ed(e,t));o.push({scope:Lu(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Iu(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}let od={serializeRequest:e=>{let t=rd(e,Zu);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Nu.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};var sd=class{constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};B();var cd=class extends Error{constructor(e,t,n){super(e),z(this,`code`,void 0),z(this,`name`,`OTLPExporterError`),z(this,`data`,void 0),this.data=n,this.code=t}};B();var ld=class{constructor(e){z(this,`_concurrencyLimit`,void 0),z(this,`_sendingPromises`,[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return ya(function*(){yield Promise.all(e._sendingPromises)})()}};function ud(e){return new ld(e.concurrencyLimit)}R();function dd(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function fd(){return{handleResponse(e){e==null||!dd(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||I.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}V(),R(),B();var pd=class{constructor(e,t,n,r,i){z(this,`_diagLogger`,void 0),z(this,`_transport`,void 0),z(this,`_serializer`,void 0),z(this,`_responseHandler`,void 0),z(this,`_promiseQueue`,void 0),z(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=I.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:ri.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:ri.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:ri.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:ri.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:ri.FAILED,error:(n=e.error)==null?new cd(`Export failed with retryable status`):n})}else t({code:ri.FAILED,error:new cd(`Export failed with unknown error`)})},e=>t({code:ri.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return ya(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function md(e,t){return new pd(e.transport,e.serializer,fd(),e.promiseHandler,t.timeout)}function hd(e,t,n){return md({transport:n,serializer:t,promiseHandler:ud(e)},{timeout:e.timeoutMillis})}R(),Oo();let gd=49152,_d=0,vd=0;var yd=class e{constructor(e){this._config=e}static _compressRequest(e){return ya(function*(){let t=new CompressionStream(`gzip`),n=t.writable.getWriter();n.write(e),n.close();let r=[],i=t.readable.getReader(),a=!1;for(;!a;){let e=yield i.read();e.value&&r.push(e.value),a=e.done}let o=new Uint8Array(r.reduce((e,t)=>e+t.length,0)),s=0;for(let e of r)o.set(e,s),s+=e.length;return o})()}send(e,t){return this._asyncSend(e,t)}shutdown(){}_asyncSend(t,n){var r=this;return ya(function*(){let i=t,a=U({"Content-Type":`application/json`},r._config.headers),o,s;if(`timeout`in AbortSignal)o=AbortSignal.timeout(n);else{let e=new AbortController;o=e.signal,s=setTimeout(()=>{e.abort(new DOMException(`TimeoutError`,`TimeoutError`))},n)}let c=!1;try{if(r._config.compression===`gzip`){try{i=yield e._compressRequest(t)}catch(e){let t=e instanceof Error?e:Error(String(e));return I.warn(`Fetch transport gzip compression failed: ${t.message}`),{status:`failure`,error:t}}a[`Content-Encoding`]=`gzip`,a[`Content-Length`]=i.length.toString()}let n=_d+i.byteLength>gd;if(c=!n&&!(vd>=9),c)_d+=i.byteLength,vd++;else{let e=n?`inflight bytes (${_d} + ${i.byteLength}) would exceed ${gd}B budget`:`concurrent count (${vd}) at limit of 9`;I.debug(`Sending without keepalive: ${e}`)}let s=yield fetch(r._config.url,{method:`POST`,keepalive:c,headers:a,body:i,signal:o});if(s.ok)return{status:`success`};let l=Error(`${s.status} Fetch request failed`),u=`Fetch transport received HTTP ${s.status} (keepalive=${c})`;return s.status>=500?(I.debug(u),{status:`retryable`,error:l}):(I.warn(u),{status:`failure`,error:l})}catch(e){let t=e instanceof Error?e:Error(String(e)),n=t instanceof TypeError||t instanceof DOMException&&t.name===`TimeoutError`,r=`Fetch transport failed (keepalive=${c}): ${t.message}`;return n?I.debug(r):I.warn(r),{status:n?`retryable`:`failure`,error:t}}finally{s!==void 0&&clearTimeout(s),c&&(_d-=i.byteLength,vd--)}})()}};let bd=e=>new yd(e),xd=()=>Math.random()*40-20;var Sd=class{constructor(e,t=new So){this._transport=e,this._perf=t}send(e,t){var n=this;return ya(function*(){let r=n._perf.getNowMillis()+t,i=yield n._transport.send(e,t),a=5,o=1e3;for(;i.status===`retryable`&&a>0;){var s;a--;let t=Math.max(Math.min(o,5e3)+xd(),0);o*=1.5;let c=(s=i.retryInMillis)==null?t:s,l=r-n._perf.getNowMillis();if(c>l)return i;i=yield n._retry(e,l,c)}return i})()}shutdown(){this._transport.shutdown()}_retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}};let Cd=e=>{var t;return new Sd(e.transport,(t=e.perf)==null?new So:t)},wd=(e,t)=>hd(e,t,Cd({transport:bd(e)}));var Td=class extends sd{constructor(e){super(wd(e,Qu))}};let Ed=(e,t)=>`${vu(e,t)}/v1/logs`;Oo();var Dd=class extends Td{constructor({appID:e,userID:t,mxlDataURL:n}){super(U(U({},gu),{},{headers:_u(e,t),url:Ed(e,n)}))}};Oo();var Od=class extends sd{constructor(e){super(wd(U(U({},e),{},{compression:`gzip`}),od))}};let kd=(e,t)=>`${vu(e,t)}/v1/traces`;Oo();var Ad=class extends Od{constructor({appID:e,userID:t,mxlDataURL:n}){super(U(U({},gu),{},{headers:_u(e,t),url:kd(e,n)}))}};B();var jd=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`browser.url.full`]||e.setAttribute(xn,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}};B();var Md=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){e.attributes[`browser.url.full`]||(e.attributes[xn]=this._urlDocument.URL)}onStart(){}shutdown(){return Promise.resolve(void 0)}};B();var Nd=class{constructor({spanSessionManager:e}){z(this,`_spanSessionManager`,void 0),this._spanSessionManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.setAttributes({"log.record.uid":fn(),[zs]:this._spanSessionManager.getSessionId(),"session.previous_id":this._spanSessionManager.getPreviousSessionId()})}shutdown(){return Promise.resolve(void 0)}};B();var Pd=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&e.setAttribute(t.key,t.scrub(n))})}shutdown(){return Promise.resolve(void 0)}};Lr(),B();var Fd=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`mxl.type`]||e.setAttribute(hn,`sys.log`),e.setAttribute(Ar,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}};Lr();let Id=e=>{if((e.attributes[`http.request.method`]||e.attributes[`http.method`])&&(typeof e.attributes[`http.response.status_code`]==`number`||typeof e.attributes[`http.status_code`]==`number`)){var t;let n=(t=e.attributes[`url.full`])==null?e.attributes[dr]:t;return typeof n==`string`&&n.includes(`://`)}return!1};Lr();var Ld=class{forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(Id(e)){var t,n,r,i,a;e.attributes[hn]=`perf.network_request`,(t=e.attributes)[`url.full`]!=null||(t[`url.full`]=e.attributes[`http.url`]),(n=e.attributes)[`http.response.status_code`]!=null||(n[`http.response.status_code`]=e.attributes[`http.status_code`]),(r=e.attributes)[`http.request.method`]!=null||(r[`http.request.method`]=e.attributes[`http.method`]),(i=e.attributes)[`http.response.body.size`]!=null||(i[`http.response.body.size`]=e.attributes[`http.response_content_length`]),(a=e.attributes)[`http.request.body.size`]!=null||(a[`http.request.body.size`]=e.attributes[`http.request_content_length`])}}onStart(){}shutdown(){return Promise.resolve(void 0)}};R(),V(),B();let Rd=e=>e.attributes[hn]===`ux.session`,zd=(e,t)=>`mxl.${t===`current`?`export_failed`:`previous_export_failed`}.${e}`;var Bd=class{constructor({resource:e,exporter:t,limitManager:n,spanSessionManager:r,storage:i=window.localStorage,storedSpansExpireTimeoutMS:a,diag:o=I.createComponentLogger({namespace:`MXLSessionBatchedSpanProcessor`})}){z(this,`_shutdownOnce`,void 0),z(this,`_pendingSpans`,[]),z(this,`_exporter`,void 0),z(this,`_limitManager`,void 0),z(this,`_spanStorage`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_diag`,void 0),z(this,`_shutdown`,()=>(this._spanStorage.destroy(),this._exporter.shutdown())),this._diag=o,this._exporter=t,this._shutdownOnce=new ua(this._shutdown,this),this._limitManager=n,this._spanSessionManager=r,this._spanStorage=new yo({resource:e,storage:i,diag:o,onExpiredSpansExport:e=>{this._exportSpans(e)},storedSpansExpireTimeoutMS:a,spanSessionManager:r})}forceFlush(){return this._diag.debug(`forceFlush called for MXLSessionBatchedSpanProcessor. This is a no op`),Promise.resolve(void 0)}onEnd(e){if(this._shutdownOnce.isCalled){this._diag.debug(`span ended after processor shutdown. Ignoring span.`);return}if(Rd(e))this._diag.debug(`session span ended. Exporting all pending spans.`),this._exportSpans([e,...this._pendingSpans]),this._pendingSpans=[];else{if(this._diag.debug(`non-session span ended. Adding to pending spans queue.`),this._limitManager.dropReadableSpan(e))return;this._pendingSpans.push(e)}}_exportSpans(e){ma._export(this._exporter,e).then(e=>{if(e.code===ri.FAILED){var t;let n=((t=e.error)==null?void 0:t.message)||`unknown error`,r=`unknown`;n===`Concurrent export limit reached`?r=`concurrent_limit`:n===`Fetch request errored`&&(r=`fetch_error`),this._spanSessionManager.incrSessionCountForKey(zd(r,`current`)),this._spanSessionManager.incrNextSessionCountForKey(zd(r,`previous`)),this._diag.error(`spans failed to export: ${n}`)}}).catch(e=>{let t=`unknown error`;e&&e instanceof Error?t=e.message:typeof e==`string`&&(t=e),this._spanSessionManager.incrSessionCountForKey(zd(`unknown`,`current`)),this._spanSessionManager.incrNextSessionCountForKey(zd(`unknown`,`previous`)),this._diag.error(`spans failed to export: ${t}`)})}onStart(){}getPendingSpansCount(){return this._pendingSpans.length}storePendingSpans(e,t){this._spanStorage.storePendingSpans(e,t,this._pendingSpans)}clearStoredSpans(e){this._spanStorage.clearStoredSpans(e)}shutdown(){return this._shutdownOnce.call()}};B();var Vd=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute();t&&(e.setAttribute(Sn,t.path),e.setAttribute(Cn,this._pageManager.getCurrentPageId()))}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&e.setAttribute(wn,t)}shutdown(){return Promise.resolve(void 0)}};B();var Hd=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.attributes[Sn]=t.path,e.attributes[Cn]=n)}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&(e.attributes[wn]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}};B();var Ud=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&(e.attributes[t.key]=t.scrub(n))})}onStart(){}shutdown(){return Promise.resolve(void 0)}};B();var Wd=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._userManager.getUserId()&&e.setAttributes({[Bs]:this._userManager.getUserId()})}shutdown(){return Promise.resolve(void 0)}};B();var Gd=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){let t=this._userManager.getUserId();t&&(e.attributes[Bs]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}};R(),V();var Kd=class extends Di{inject(e,t,n){super.inject(e,t,n);let r=L.getSpan(e);if(r){let e=t instanceof Headers?t.get(`traceparent`):Ie.get(t,`traceparent`);e&&r.setAttribute(`mxl.w3c_traceparent`,e)}}};Lr();let qd=/\/\/(.+):(.+)@(.+)\//,Jd=[`AWSAccessKeyId`,`Signature`,`sig`,"`X-Goog-Signature",`password`,`auth`,`pw`,`token`],Yd=({value:e,queryParamRegex:t,scrubPath:n,scrubQuery:r})=>{let i=e;return n&&(i=i.replace(qd,`//REDACTED:REDACTED@$3/`)),r&&(i=i.replaceAll(t,`$1$2=REDACTED`)),i},Xd=e=>{let t=[...Jd,...e||[]],n=RegExp(`(^|&|\\?)(${t.join(`|`)})=[^&]+`,`g`);return[{key:Ar,scrub:e=>Yd({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:dr,scrub:e=>Yd({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:jr,scrub:e=>Yd({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!1})},{key:Mr,scrub:e=>Yd({value:e,queryParamRegex:n,scrubPath:!1,scrubQuery:!0})}]},Zd={isRecording:()=>!1,setEnabled:()=>{}};R(),B();let Qd=new class{constructor({diagLogger:e=I.createComponentLogger({namespace:`mxl-registry`})}={}){z(this,`_sdk`,null),z(this,`_diag`,void 0),z(this,`register`,e=>{this._sdk!==null&&this._diag.warn(`previously registered sdk will be overwritten`),this._sdk=e}),z(this,`clear`,()=>{this._sdk===null&&this._diag.warn(`sdk already cleared, this is a no-op`),this._sdk=null}),z(this,`registered`,()=>this._sdk),this._diag=e}};function $d(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,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 ef(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function G(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function K(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tf,nf=s((()=>{tf=function(){return tf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},tf.apply(this,arguments)}}));function rf(e){return e.nodeType===e.ELEMENT_NODE}function af(e){var t,n=(t=e)==null?void 0:t.host;return!!(n&&n.shadowRoot&&n.shadowRoot===e)}function of(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,a=e.maskInputFn,o=i||``;return(t[n.toLowerCase()]||t[r])&&(o=a?a(o):`*`.repeat(o.length)),o}function sf(e){var t=e.getContext(`2d`);if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var a=t.getImageData,o=kf in a?a[kf]:a;if(new Uint32Array(o.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(function(e){return e!==0}))return!1}return!0}function cf(){return Af++}function lf(e){if(e instanceof HTMLFormElement)return`form`;var t=e.tagName.toLowerCase().trim();return jf.test(t)?`div`:t}function uf(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(df).join(``):null}catch(e){return null}}function df(e){var t=e.cssText;if(ff(e))try{t=uf(e.styleSheet)||t}catch(e){}return t}function ff(e){return`styleSheet`in e}function pf(e){return e.cssRules?Array.from(e.cssRules).map(function(e){return e.cssText||``}).join(``):``}function mf(e){var t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}function hf(e,t){return(e||``).replace(Pf,function(e,n,r,i,a,o){var s=r||a||o,c=n||i||``;if(!s)return e;if(!Ff.test(s)||If.test(s))return`url(`+c+s+c+`)`;if(s[0]===`/`)return`url(`+c+(mf(t)+s)+c+`)`;var l=t.split(`/`),u=s.split(`/`);l.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];p!==`.`&&(p===`..`?l.pop():l.push(p))}return`url(`+c+l.join(`/`)+c+`)`})}function gf(e,t){if(t.trim()===``)return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}for(var i=[];r(Rf),!(n>=t.length);){var a=r(Lf);if(a.slice(-1)===`,`)a=_f(e,a.substring(0,a.length-1)),i.push(a);else{var o=``;a=_f(e,a);for(var s=!1;;){var c=t.charAt(n);if(c===``){i.push((a+o).trim());break}else if(s)c===`)`&&(s=!1);else if(c===`,`){n+=1,i.push((a+o).trim());break}else c===`(`&&(s=!0);o+=c,n+=1}}}return i.join(`, `)}function _f(e,t){if(!t||t.trim()===``)return t;var n=e.createElement(`a`);return n.href=t,n.href}function vf(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function yf(){var e=document.createElement(`a`);return e.href=``,e.href}function bf(e,t,n,r){return n===`src`||n===`href`&&r||n===`xlink:href`&&r&&r[0]!==`#`||n===`background`&&r&&(t===`table`||t===`td`||t===`th`)?_f(e,r):n===`srcset`&&r?gf(e,r):n===`style`&&r?hf(r,yf()):t===`object`&&n===`data`&&r?_f(e,r):r}function xf(e,t,n){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n?e.matches(n):!1}function Sf(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n&&e.matches(n)?!0:Sf(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Sf(e.parentNode,t,n)}function Cf(e,t,n){var r=e.contentWindow;if(r){var i=!1,a;try{a=r.document.readyState}catch(e){return}if(a!==`complete`){var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener(`load`,function(){clearTimeout(o),i=!0,t()});return}var s=`about:blank`;if(r.location.href!==s||e.src===s||e.src===``){setTimeout(t,0);return}e.addEventListener(`load`,t)}}function wf(e,t){var n,r=t.doc,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,p=t.dataURLOptions,m=p===void 0?{}:p,h=t.inlineImages,g=t.recordCanvas,_=t.keepIframeSrcFn,v;if(r.__sn){var y=r.__sn.id;v=y===1?void 0:y}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:Of.Document,childNodes:[],rootId:v}:{type:Of.Document,childNodes:[],compatMode:e.compatMode,rootId:v};case e.DOCUMENT_TYPE_NODE:return{type:Of.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:for(var b=xf(e,i,a),x=lf(e),S={},C=0,w=Array.from(e.attributes);C<w.length;C++){var ee=w[C],T=ee.name,E=ee.value;S[T]=bf(r,x,T,E)}if(x===`link`&&c){var D=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),te=null;D&&(te=uf(D)),te&&(delete S.rel,delete S.href,S._cssText=hf(te,D.href))}if(x===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){var te=uf(e.sheet);te&&(S._cssText=hf(te,yf()))}if(x===`input`||x===`textarea`||x===`select`){var E=e.value;S.type!==`radio`&&S.type!==`checkbox`&&S.type!==`submit`&&S.type!==`button`&&E?S.value=of({type:S.type,tagName:x,value:E,maskInputOptions:u,maskInputFn:f}):e.checked&&(S.checked=e.checked)}if(x===`option`&&(e.selected&&!u.select?S.selected=!0:delete S.selected),x===`canvas`&&g){if(e.__context===`2d`)sf(e)||(S.rr_dataURL=e.toDataURL(m.type,m.quality));else if(!(`__context`in e)){var O=e.toDataURL(m.type,m.quality),k=document.createElement(`canvas`);k.width=e.width,k.height=e.height,O!==k.toDataURL(m.type,m.quality)&&(S.rr_dataURL=O)}}if(x===`img`&&h){Mf||(Mf=r.createElement(`canvas`),Nf=Mf.getContext(`2d`));var A=e,j=A.crossOrigin;A.crossOrigin=`anonymous`;var M=function(){try{Mf.width=A.naturalWidth,Mf.height=A.naturalHeight,Nf.drawImage(A,0,0),S.rr_dataURL=Mf.toDataURL(m.type,m.quality)}catch(e){console.warn(`Cannot inline img src=`+A.currentSrc+`! Error: `+e)}j?S.crossOrigin=j:delete S.crossOrigin};A.complete&&A.naturalWidth!==0?M():A.onload=M}if((x===`audio`||x===`video`)&&(S.rr_mediaState=e.paused?`paused`:`played`,S.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop),b){var ne=e.getBoundingClientRect(),re=ne.width,ie=ne.height;S={class:S.class,rr_width:re+`px`,rr_height:ie+`px`}}return x===`iframe`&&!_(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src),{type:Of.Element,tagName:x,attributes:S,childNodes:[],isSVG:vf(e)||void 0,needBlock:b,rootId:v};case e.TEXT_NODE:var ae=e.parentNode&&e.parentNode.tagName,N=e.textContent,oe=ae===`STYLE`?!0:void 0,P=ae===`SCRIPT`?!0:void 0;if(oe&&N){try{e.nextSibling||e.previousSibling||(n=e.parentNode.sheet)!=null&&n.cssRules&&(N=pf(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: `+t,e)}N=hf(N,yf())}return P&&(N=`SCRIPT_PLACEHOLDER`),!oe&&!P&&Sf(e,o,s)&&N&&(N=d?d(N):N.replace(/[\S]/g,`*`)),{type:Of.Text,textContent:N||``,isStyle:oe,rootId:v};case e.CDATA_SECTION_NODE:return{type:Of.CDATA,textContent:``,rootId:v};case e.COMMENT_NODE:return{type:Of.Comment,textContent:e.textContent||``,rootId:v};default:return!1}}function q(e){return e===void 0?``:e.toLowerCase()}function Tf(e,t){return!!(t.comment&&e.type===Of.Comment||e.type===Of.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&e.attributes.rel===`preload`&&e.attributes.as===`script`||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&e.attributes.href.endsWith(`.js`))||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||q(e.attributes.name)===`application-name`||q(e.attributes.rel)===`icon`||q(e.attributes.rel)===`apple-touch-icon`||q(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&q(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(q(e.attributes.property).match(/^(og|twitter|fb):/)||q(e.attributes.name).match(/^(og|twitter):/)||q(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(q(e.attributes.name)===`robots`||q(e.attributes.name)===`googlebot`||q(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(q(e.attributes.name)===`author`||q(e.attributes.name)===`generator`||q(e.attributes.name)===`framework`||q(e.attributes.name)===`publisher`||q(e.attributes.name)===`progid`||q(e.attributes.property).match(/^article:/)||q(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(q(e.attributes.name)===`google-site-verification`||q(e.attributes.name)===`yandex-verification`||q(e.attributes.name)===`csrf-token`||q(e.attributes.name)===`p:domain_verify`||q(e.attributes.name)===`verify-v1`||q(e.attributes.name)===`verification`||q(e.attributes.name)===`shopify-checkout-api-token`))))}function Ef(e,t){var n=t.doc,r=t.map,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,p=f===void 0?{}:f,m=t.maskTextFn,h=t.maskInputFn,g=t.slimDOMOptions,_=t.dataURLOptions,v=_===void 0?{}:_,y=t.inlineImages,b=y===void 0?!1:y,x=t.recordCanvas,S=x===void 0?!1:x,C=t.onSerialize,w=t.onIframeLoad,ee=t.iframeLoadTimeout,T=ee===void 0?5e3:ee,E=t.keepIframeSrcFn,D=E===void 0?function(){return!1}:E,te=t.preserveWhiteSpace,O=te===void 0?!0:te,k=wf(e,{doc:n,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,dataURLOptions:v,inlineImages:b,recordCanvas:S,keepIframeSrcFn:D});if(!k)return console.warn(e,`not serialized`),null;var A=`__sn`in e?e.__sn.id:Tf(k,g)||!O&&k.type===Of.Text&&!k.isStyle&&!k.textContent.replace(/^\s+|\s+$/gm,``).length?-2:cf(),j=Object.assign(k,{id:A});if(e.__sn=j,A===-2)return null;r[A]=e,C&&C(e);var M=!l;if(j.type===Of.Element&&(M=M&&!j.needBlock,delete j.needBlock,e.shadowRoot&&(j.isShadowHost=!0)),(j.type===Of.Document||j.type===Of.Element)&&M){g.headWhitespace&&k.type===Of.Element&&k.tagName===`head`&&(O=!1);for(var ne={doc:n,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D},re=0,ie=Array.from(e.childNodes);re<ie.length;re++){var ae=ie[re],N=Ef(ae,ne);N&&j.childNodes.push(N)}if(rf(e)&&e.shadowRoot)for(var oe=0,P=Array.from(e.shadowRoot.childNodes);oe<P.length;oe++){var ae=P[oe],N=Ef(ae,ne);N&&(N.isShadow=!0,j.childNodes.push(N))}}return e.parentNode&&af(e.parentNode)&&(j.isShadow=!0),j.type===Of.Element&&j.tagName===`iframe`&&Cf(e,function(){var t=e.contentDocument;if(t&&w){var n=Ef(t,{doc:t,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D});n&&w(e,n)}},T),j}function Df(e,t){var n=t||{},r=n.blockClass,i=r===void 0?`rr-block`:r,a=n.blockSelector,o=a===void 0?null:a,s=n.maskTextClass,c=s===void 0?`rr-mask`:s,l=n.maskTextSelector,u=l===void 0?null:l,d=n.inlineStylesheet,f=d===void 0?!0:d,p=n.inlineImages,m=p===void 0?!1:p,h=n.recordCanvas,g=h===void 0?!1:h,_=n.maskAllInputs,v=_===void 0?!1:_,y=n.maskTextFn,b=n.maskInputFn,x=n.slimDOM,S=x===void 0?!1:x,C=n.dataURLOptions,w=n.preserveWhiteSpace,ee=n.onSerialize,T=n.onIframeLoad,E=n.iframeLoadTimeout,D=n.keepIframeSrcFn,te=D===void 0?function(){return!1}:D,O={};return[Ef(e,{doc:e,map:O,blockClass:i,blockSelector:o,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:v===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:v===!1?{password:!0}:v,maskTextFn:y,maskInputFn:b,slimDOMOptions:S===!0||S===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:C,inlineImages:m,recordCanvas:g,preserveWhiteSpace:w,onSerialize:ee,onIframeLoad:T,iframeLoadTimeout:E,keepIframeSrcFn:te}),O]}var Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf=s((()=>{(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})(Of||(Of={})),kf=`__rrweb_original__`,Af=1,jf=RegExp(`[^a-z0-9-_:]`),Pf=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ff=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,If=/^(data:)([^,]*),(.*)/i,Lf=/^[^ \t\n\r\u000c]+/,Rf=/^[, \t\n\r\u000c]+/,zf=/([^\\]):hover/,new RegExp(zf.source,`g`)})),J,Vf,Hf,Uf,Wf,Gf,Kf=s((()=>{(function(e){e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`})(J||(J={})),(function(e){e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`})(Vf||(Vf={})),(function(e){e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`})(Hf||(Hf={})),(function(e){e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`})(Uf||(Uf={})),(function(e){e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`})(Wf||(Wf={})),(function(e){e.Start=`start`,e.Pause=`pause`,e.Resume=`resume`,e.Resize=`resize`,e.Finish=`finish`,e.FullsnapshotRebuilded=`fullsnapshot-rebuilded`,e.LoadStylesheetStart=`load-stylesheet-start`,e.LoadStylesheetEnd=`load-stylesheet-end`,e.SkipStart=`skip-start`,e.SkipEnd=`skip-end`,e.MouseInteraction=`mouse-interaction`,e.EventCast=`event-cast`,e.CustomEvent=`custom-event`,e.Flush=`flush`,e.StateChange=`state-change`,e.PlayBack=`play-back`})(Gf||(Gf={}))}));function qf(e,t,n){n===void 0&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}function Jf(){return{map:{},getId:function(e){return!e||!e.__sn?-1:e.__sn.id},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}function Yf(e,t,n){n===void 0&&(n={});var r=null,i=0;return function(a){var o=Date.now();!i&&n.leading===!1&&(i=o);var s=t-(o-i),c=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=o,e.apply(c,l)):!r&&n.trailing!==!1&&(r=setTimeout(function(){i=n.leading===!1?0:Date.now(),r=null,e.apply(c,l)},s))}}function Xf(e,t,n,r,i){i===void 0&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),a&&a.set&&a.set.call(this,e)}}),function(){return Xf(e,t,a||{},!0)}}function Zf(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function Qf(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $f(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ep(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if(typeof t==`string`){if(e.closest!==void 0)return e.closest(`.`+t)!==null;n=e.classList.contains(t)}else e.classList.forEach(function(e){t.test(e)&&(n=!0)});return n||ep(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ep(e.parentNode,t)}function tp(e){return`__sn`in e?e.__sn.id===-2:!1}function np(e,t){if(af(e))return!1;var n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?np(e.parentNode,t):!0:!0}function rp(e){return!!e.changedTouches}function ip(e){e===void 0&&(e=window),`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw TypeError(`1 argument is required`);do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}function ap(e){return`__sn`in e?e.__sn.type===Of.Element&&e.__sn.tagName===`iframe`:!1}function op(e){return!!(e!=null&&e.shadowRoot)}var sp,cp,lp=s((()=>{nf(),Kf(),Bf(),sp=`Please stop import mirror directly. Instead of that,\r
|
|
17
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
18
|
-
or you can use record.mirror to access the mirror instance during recording.`,Cd={map:{},getId:function(){return console.error(Sd),-1},getNode:function(){return console.error(Sd),null},removeNodeFromMap:function(){console.error(Sd)},has:function(){return console.error(Sd),!1},reset:function(){console.error(Sd)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Cd=new Proxy(Cd,{get:function(e,t,n){return t===`map`&&console.error(Sd),Reflect.get(e,t,n)}}));function wd(e,t,n){n===void 0&&(n={});var r=null,i=0;return function(a){var o=Date.now();!i&&n.leading===!1&&(i=o);var s=t-(o-i),c=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=o,e.apply(c,l)):!r&&n.trailing!==!1&&(r=setTimeout(function(){i=n.leading===!1?0:Date.now(),r=null,e.apply(c,l)},s))}}function Td(e,t,n,r,i){i===void 0&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),a&&a.set&&a.set.call(this,e)}}),function(){return Td(e,t,a||{},!0)}}function Ed(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function Dd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Od(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function kd(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if(typeof t==`string`){if(e.closest!==void 0)return e.closest(`.`+t)!==null;n=e.classList.contains(t)}else e.classList.forEach(function(e){t.test(e)&&(n=!0)});return n||kd(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,kd(e.parentNode,t)}function Ad(e){return`__sn`in e?e.__sn.id===-2:!1}function jd(e,t){if(Iu(e))return!1;var n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?jd(e.parentNode,t):!0:!0}function Md(e){return!!e.changedTouches}function Nd(e){e===void 0&&(e=window),`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw TypeError(`1 argument is required`);do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}(function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),a=function(e){n.removeIdSet.add(e);var r=t.getNode(e);r==null||r.childNodes.forEach(function(e){`__sn`in e&&a(e.__sn.id)})},o=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach(function(e){return o(e)});var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),o(i)):(delete this.tree[i.id],this.indexes.delete(i.id),o(i)):(this.removeNodeMutations.push(e),a(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,i=this,a=this,o=a.tree,s=a.removeNodeMutations,c=a.textMutations,l=a.attributeMutations,u={source:hd.Mutation,removes:s,texts:c,attributes:l,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter(function(e){return!i.removeIdSet.has(e.id)}),u.attributes=u.attributes.concat(t?[]:e.attributes).filter(function(e){return!i.removeIdSet.has(e.id)}),!i.removeIdSet.has(e.id)&&!i.removeIdSet.has(e.mutation.parentId)&&!t?(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach(function(e){return d(e,!1)})):Object.values(e.children).forEach(function(e){return d(e,!0)})};Object.values(o).forEach(function(e){return d(e,!1)});try{for(var f=Nu(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var h=Nu(this.inputMap.keys()),g=h.next();!g.done;g=h.next()){var m=g.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var _=new Map(this.scrollMap),v=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:_,inputMap:v}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e})();function Pd(e){return`__sn`in e?e.__sn.type===Pu.Element&&e.__sn.tagName===`iframe`:!1}function Fd(e){return!!(e!=null&&e.shadowRoot)}function Id(e){return`__ln`in e}var Ld=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw Error(`Position outside of list range`);for(var t=this.head,n=0;n<e;n++)t=(t==null?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Id(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Id(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),Rd=function(e,t){return`${e}@${t}`};function zd(e){return`__sn`in e}var Bd=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,n,r,i;if(!(e.frozen||e.locked)){for(var a=[],o=new Ld,s=function(t){for(var n=t,r=-2;r===-2;)n=n&&n.nextSibling,r=n&&e.mirror.getId(n);return r},c=function(t){for(var n,r,i,c,l,u=t.getRootNode?(n=t.getRootNode())==null?void 0:n.host:null,d=u;(i=(r=d==null?void 0:d.getRootNode)==null?void 0:r.call(d))!=null&&i.host;)d=((l=(c=d==null?void 0:d.getRootNode)==null?void 0:c.call(d))==null?void 0:l.host)||null;var f=!e.doc.contains(t)&&(d===null||!e.doc.contains(d));if(!(!t.parentNode||f)){var p=Iu(t.parentNode)?e.mirror.getId(u):e.mirror.getId(t.parentNode),m=s(t);if(p===-1||m===-1)return o.addNode(t);var h=pd(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){Pd(n)&&e.iframeManager.addIframe(n),Fd(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});h&&a.push({parentId:p,nextId:m,node:h})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=Nu(e.movedSet),u=l.next();!u.done;u=l.next()){var d=u.value;Hd(e.removes,d,e.mirror)&&!e.movedSet.has(d.parentNode)||c(d)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}try{for(var f=Nu(e.addedSet),p=f.next();!p.done;p=f.next()){var d=p.value;!Ud(e.droppedSet,d)&&!Hd(e.removes,d,e.mirror)||Ud(e.movedSet,d)?c(d):e.droppedSet.add(d)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}for(var m=null;o.length;){var h=null;if(m){var g=e.mirror.getId(m.value.parentNode),_=s(m.value);g!==-1&&_!==-1&&(h=m)}if(!h)for(var v=o.length-1;v>=0;v--){var y=o.get(v);if(y){var g=e.mirror.getId(y.value.parentNode),_=s(y.value);if(g!==-1&&_!==-1){h=y;break}}}if(!h){for(;o.head;)o.removeNode(o.head.value);break}m=h.previous,o.removeNode(h.value),c(h.value)}var b={texts:e.texts.map(function(t){return{id:e.mirror.getId(t.node),value:t.value}}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:a};!b.texts.length&&!b.attributes.length&&!b.removes.length&&!b.adds.length||(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(b))}},this.processMutation=function(t){var n,r,i,a;if(!Ad(t.target))switch(t.type){case`characterData`:var o=t.target.textContent;!kd(t.target,e.blockClass)&&o!==t.oldValue&&e.texts.push({value:ld(t.target,e.maskTextClass,e.maskTextSelector)&&o?e.maskTextFn?e.maskTextFn(o):o.replace(/[\S]/g,`*`):o,node:t.target});break;case`attributes`:var s=t.target,o=t.target.getAttribute(t.attributeName);if(t.attributeName===`value`&&(o=Lu({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute(`type`),value:o,maskInputFn:e.maskInputFn})),kd(t.target,e.blockClass)||o===t.oldValue)return;var c=e.attributes.find(function(e){return e.node===t.target});if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),t.attributeName===`style`){var l=e.doc.createElement(`span`);t.oldValue&&l.setAttribute(`style`,t.oldValue),(c.attributes.style===void 0||c.attributes.style===null)&&(c.attributes.style={});var u=c.attributes.style;try{for(var d=Nu(Array.from(s.style)),f=d.next();!f.done;f=d.next()){var p=f.value,m=s.style.getPropertyValue(p),h=s.style.getPropertyPriority(p);(m!==l.style.getPropertyValue(p)||h!==l.style.getPropertyPriority(p))&&(h===``?u[p]=m:u[p]=[m,h])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}try{for(var g=Nu(Array.from(l.style)),_=g.next();!_.done;_=g.next()){var p=_.value;s.style.getPropertyValue(p)===``&&(u[p]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=sd(e.doc,t.target.tagName,t.attributeName,o);break;case`childList`:t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var r=e.mirror.getId(n),i=Iu(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);kd(t.target,e.blockClass)||Ad(n)||(e.addedSet.has(n)?(Vd(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&r===-1||jd(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[Rd(r,i)]?Vd(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:Iu(t.target)?!0:void 0})),e.mapRemoves.push(n))});break}},this.genAdds=function(t,n){if(!(n&&kd(n,e.blockClass))){if(zd(t)){if(Ad(t))return;e.movedSet.add(t);var r=null;n&&zd(n)&&(r=n.__sn.id),r&&(e.movedMap[Rd(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);kd(t,e.blockClass)||t.childNodes.forEach(function(t){return e.genAdds(t)})}}}return e.prototype.init=function(e){var t=this;[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`doc`,`mirror`,`iframeManager`,`shadowDomManager`,`canvasManager`].forEach(function(n){t[n]=e[n]})},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function Vd(e,t){e.delete(t),t.childNodes.forEach(function(t){return Vd(e,t)})}function Hd(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return e.some(function(e){return e.id===i})?!0:Hd(e,r,n)}function Ud(e,t){var n=t.parentNode;return n?e.has(n)?!0:Ud(e,n):!1}var Wd=[],Gd=typeof CSSGroupingRule<`u`,Kd=typeof CSSMediaRule<`u`,qd=typeof CSSSupportsRule<`u`,Jd=typeof CSSConditionRule<`u`;function Yd(e){try{if(`composedPath`in e){var t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Xd(e,t){var n,r,i=new Bd;Wd.push(i),i.init(e);var a=window.MutationObserver||window.__rrMutationObserver,o=(r=(n=window==null?void 0:window.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,`MutationObserver`);o&&window[o]&&(a=window[o]);var s=new a(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Zd(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(n.mousemove===!1)return function(){};var a=typeof n.mousemove==`number`?n.mousemove:50,o=typeof n.mousemoveCallback==`number`?n.mousemoveCallback:500,s=[],c,l=wd(function(e){var n=Date.now()-c;t(s.map(function(e){return e.timeOffset-=n,e}),e),s=[],c=null},o),u=wd(function(e){var t=Yd(e),n=Md(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;c||(c=Date.now()),s.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-c}),l(typeof DragEvent<`u`&&e instanceof DragEvent?hd.Drag:e instanceof MouseEvent?hd.MouseMove:hd.TouchMove)},a,{trailing:!1}),d=[bd(`mousemove`,u,r),bd(`touchmove`,u,r),bd(`drag`,u,r)];return function(){d.forEach(function(e){return e()})}}function Qd(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;if(a.mouseInteraction===!1)return function(){};var o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=function(e){return function(n){var a=Yd(n);if(!kd(a,i)){var o=Md(n)?n.changedTouches[0]:n;if(o){var s=r.getId(a),c=o.clientX,l=o.clientY;t({type:gd[e],id:s,x:c,y:l})}}}};return Object.keys(gd).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1}).forEach(function(e){var t=e.toLowerCase(),r=c(e);s.push(bd(t,r,n))}),function(){s.forEach(function(e){return e()})}}function $d(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;return bd(`scroll`,wd(function(e){var a=Yd(e);if(!(!a||kd(a,i))){var o=r.getId(a);if(a===n){var s=n.scrollingElement||n.documentElement;t({id:o,x:s.scrollLeft,y:s.scrollTop})}else t({id:o,x:a.scrollLeft,y:a.scrollTop})}},a.scroll||100),n)}function ef(e){var t=e.viewportResizeCb,n=-1,r=-1;return bd(`resize`,wd(function(){var e=Dd(),i=Od();(n!==e||r!==i)&&(t({width:Number(i),height:Number(e)}),n=e,r=i)},200),window)}function tf(e,t){var n=W({},e);return t||delete n.userTriggered,n}var nf=[`INPUT`,`TEXTAREA`,`SELECT`],rf=new WeakMap;function af(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.ignoreClass,o=e.maskInputOptions,s=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function u(e){var t=Yd(e),r=e.isTrusted;if(t&&t.tagName===`OPTION`&&(t=t.parentElement),!(!t||!t.tagName||nf.indexOf(t.tagName)<0||kd(t,i))){var c=t.type;if(!t.classList.contains(a)){var u=t.value,f=!1;c===`radio`||c===`checkbox`?f=t.checked:(o[t.tagName.toLowerCase()]||o[c])&&(u=Lu({maskInputOptions:o,tagName:t.tagName,type:c,value:u,maskInputFn:s})),d(t,tf({text:u,isChecked:f,userTriggered:r},l));var p=t.name;c===`radio`&&p&&f&&n.querySelectorAll(`input[type="radio"][name="${p}"]`).forEach(function(e){e!==t&&d(e,tf({text:e.value,isChecked:!f,userTriggered:!1},l))})}}}function d(e,n){var i=rf.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){rf.set(e,n);var a=r.getId(e);t(W(W({},n),{id:a}))}}var f=(c.input===`last`?[`change`]:[`input`,`change`]).map(function(e){return bd(e,u,n)}),p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`),m=[[HTMLInputElement.prototype,`value`],[HTMLInputElement.prototype,`checked`],[HTMLSelectElement.prototype,`value`],[HTMLTextAreaElement.prototype,`value`],[HTMLSelectElement.prototype,`selectedIndex`],[HTMLOptionElement.prototype,`selected`]];return p&&p.set&&f.push.apply(f,K([],G(m.map(function(e){return Td(e[0],e[1],{set:function(){u({target:this})}})})),!1)),function(){f.forEach(function(e){return e()})}}function of(e){var t=[];function n(e,t){if(Gd&&e.parentRule instanceof CSSGroupingRule||Kd&&e.parentRule instanceof CSSMediaRule||qd&&e.parentRule instanceof CSSSupportsRule||Jd&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules),r=n.indexOf(e);t.unshift(r)}else{var n=Array.from(e.parentStyleSheet.cssRules),r=n.indexOf(e);t.unshift(r)}return t}return n(e,t)}function sf(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=t.win,a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(e,t){var i=r.getId(this.ownerNode);return i!==-1&&n({id:i,adds:[{rule:e,index:t}]}),a.apply(this,arguments)};var o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(e){var t=r.getId(this.ownerNode);return t!==-1&&n({id:t,removes:[{index:e}]}),o.apply(this,arguments)};var s={};Gd?s.CSSGroupingRule=i.CSSGroupingRule:(Kd&&(s.CSSMediaRule=i.CSSMediaRule),Jd&&(s.CSSConditionRule=i.CSSConditionRule),qd&&(s.CSSSupportsRule=i.CSSSupportsRule));var c={};return Object.entries(s).forEach(function(e){var t=G(e,2),i=t[0],a=t[1];c[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(e,t){var a=r.getId(this.parentStyleSheet.ownerNode);return a!==-1&&n({id:a,adds:[{rule:e,index:K(K([],G(of(this)),!1),[t||0],!1)}]}),c[i].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(e){var t=r.getId(this.parentStyleSheet.ownerNode);return t!==-1&&n({id:t,removes:[{index:K(K([],G(of(this)),!1),[e],!1)}]}),c[i].deleteRule.apply(this,arguments)}}),function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(function(e){var t=G(e,2),n=t[0],r=t[1];r.prototype.insertRule=c[n].insertRule,r.prototype.deleteRule=c[n].deleteRule})}}function cf(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var o,s,c=r.getId((s=(o=this.parentRule)==null?void 0:o.parentStyleSheet)==null?void 0:s.ownerNode);return c!==-1&&n({id:c,set:{property:e,value:t,priority:i},index:of(this.parentRule)}),a.apply(this,arguments)};var o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,a=r.getId((i=(t=this.parentRule)==null?void 0:t.parentStyleSheet)==null?void 0:i.ownerNode);return a!==-1&&n({id:a,remove:{property:e},index:of(this.parentRule)}),o.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o}}function lf(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,a=function(e){return wd(function(i){var a=Yd(i);if(!(!a||kd(a,n))){var o=a,s=o.currentTime,c=o.volume,l=o.muted;t({type:e,id:r.getId(a),currentTime:s,volume:c,muted:l})}},i.media||500)},o=[bd(`play`,a(0)),bd(`pause`,a(1)),bd(`seeked`,a(2)),bd(`volumechange`,a(3))];return function(){o.forEach(function(e){return e()})}}function uf(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],a=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,n){var r=new o(e,t,n);return a.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=Ed(n.fonts,`add`,function(e){return function(n){return setTimeout(function(){var e=a.get(n);e&&(t(e),a.delete(n))},0),e.apply(this,[n])}});return i.push(function(){r.FontFace=o}),i.push(s),function(){i.forEach(function(e){return e()})}}function df(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb;e.mutationCb=function(){var e=[...arguments];t.mutation&&t.mutation.apply(t,K([],G(e),!1)),n.apply(void 0,K([],G(e),!1))},e.mousemoveCb=function(){var e=[...arguments];t.mousemove&&t.mousemove.apply(t,K([],G(e),!1)),r.apply(void 0,K([],G(e),!1))},e.mouseInteractionCb=function(){var e=[...arguments];t.mouseInteraction&&t.mouseInteraction.apply(t,K([],G(e),!1)),i.apply(void 0,K([],G(e),!1))},e.scrollCb=function(){var e=[...arguments];t.scroll&&t.scroll.apply(t,K([],G(e),!1)),a.apply(void 0,K([],G(e),!1))},e.viewportResizeCb=function(){var e=[...arguments];t.viewportResize&&t.viewportResize.apply(t,K([],G(e),!1)),o.apply(void 0,K([],G(e),!1))},e.inputCb=function(){var e=[...arguments];t.input&&t.input.apply(t,K([],G(e),!1)),s.apply(void 0,K([],G(e),!1))},e.mediaInteractionCb=function(){var e=[...arguments];t.mediaInteaction&&t.mediaInteaction.apply(t,K([],G(e),!1)),c.apply(void 0,K([],G(e),!1))},e.styleSheetRuleCb=function(){var e=[...arguments];t.styleSheetRule&&t.styleSheetRule.apply(t,K([],G(e),!1)),l.apply(void 0,K([],G(e),!1))},e.styleDeclarationCb=function(){var e=[...arguments];t.styleDeclaration&&t.styleDeclaration.apply(t,K([],G(e),!1)),u.apply(void 0,K([],G(e),!1))},e.canvasMutationCb=function(){var e=[...arguments];t.canvasMutation&&t.canvasMutation.apply(t,K([],G(e),!1)),d.apply(void 0,K([],G(e),!1))},e.fontCb=function(){var e=[...arguments];t.font&&t.font.apply(t,K([],G(e),!1)),f.apply(void 0,K([],G(e),!1))}}function ff(e,t){var n,r;t===void 0&&(t={});var i=e.doc.defaultView;if(!i)return function(){};df(e,t);var a=Xd(e,e.doc),o=Zd(e),s=Qd(e),c=$d(e),l=ef(e),u=af(e),d=lf(e),f=sf(e,{win:i}),p=cf(e,{win:i}),m=e.collectFonts?uf(e):function(){},h=[];try{for(var g=Nu(e.plugins),_=g.next();!_.done;_=g.next()){var v=_.value;h.push(v.observer(v.callback,i,v.options))}}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return function(){Wd.forEach(function(e){return e.reset()}),a.disconnect(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h.forEach(function(e){return e()})}}var pf=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)==null||n.call(this,e)},e}(),mf=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(Ed(HTMLElement.prototype,`attachShadow`,function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}}))}return e.prototype.addShadowRoot=function(e,t){Xd(W(W({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),$d(W(W({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(Ed(e.contentWindow.HTMLElement.prototype,`attachShadow`,function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}},e.prototype.reset=function(){this.restorePatches.forEach(function(e){return e()})},e}();function hf(e,t,n,r){var i,a,o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),c=function(r){try{if(typeof t.CanvasRenderingContext2D.prototype[r]!=`function`)return`continue`;var i=Ed(t.CanvasRenderingContext2D.prototype,r,function(t){return function(){for(var i=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return kd(this.canvas,n)||setTimeout(function(){var t=K([],G(a),!1);if(r===`drawImage`&&t[0]&&t[0]instanceof HTMLCanvasElement){var n=t[0],o=n.getContext(`2d`),s=o==null?void 0:o.getImageData(0,0,n.width,n.height),c=s==null?void 0:s.data;t[0]=JSON.stringify(c)}e(i.canvas,{type:_d[`2D`],property:r,args:t})},0),t.apply(this,a)}});o.push(i)}catch(n){var a=Td(t.CanvasRenderingContext2D.prototype,r,{set:function(t){e(this.canvas,{type:_d[`2D`],property:r,args:[t],setter:!0})}});o.push(a)}};try{for(var l=Nu(s),u=l.next();!u.done;u=l.next()){var d=u.value;c(d)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return function(){o.forEach(function(e){return e()})}}function gf(e,t){var n=[];try{var r=Ed(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(n){var r=[...arguments].slice(1);return kd(this,t)||`__context`in this||(this.__context=n),e.apply(this,K([n],G(r),!1))}});n.push(r)}catch(e){console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return function(){n.forEach(function(e){return e()})}}for(var _f=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,vf=typeof Uint8Array>`u`?[]:new Uint8Array(256),yf=0;yf<_f.length;yf++)vf[_f.charCodeAt(yf)]=yf;var bf=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=_f[t[n]>>2],i+=_f[(t[n]&3)<<4|t[n+1]>>4],i+=_f[(t[n+1]&15)<<2|t[n+2]>>6],i+=_f[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},xf=new Map;function Sf(e,t){var n=xf.get(e);return n||(n=new Map,xf.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Cf=function(e,t,n){if(!(!e||!(Ef(e,t)||typeof e==`object`))){var r=e.constructor.name,i=Sf(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a}};function wf(e,t,n){return e instanceof Array?e.map(function(e){return wf(e,t,n)}):e===null?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:bf(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[wf(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[wf(e.data,t,n),e.width,e.height]}:Ef(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:Cf(e,t,n)}:e}var Tf=function(e,t,n){return K([],G(e),!1).map(function(e){return wf(e,t,n)})},Ef=function(e,t){return!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(function(e){return typeof t[e]==`function`}).find(function(n){return e instanceof t[n]})};function Df(e,t,n,r,i,a){var o,s,c=[],l=Object.getOwnPropertyNames(e),u=function(o){try{if(typeof e[o]!=`function`)return`continue`;var s=Ed(e,o,function(s){return function(){var c=[...arguments],l=s.apply(this,c);if(Cf(l,a,e),!kd(this.canvas,r)){i.getId(this.canvas);var u={type:t,property:o,args:Tf(K([],G(c),!1),a,e)};n(this.canvas,u)}return l}});c.push(s)}catch(r){var l=Td(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(l)}};try{for(var d=Nu(l),f=d.next();!f.done;f=d.next()){var p=f.value;u(p)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}return c}function Of(e,t,n,r){var i=[];return i.push.apply(i,K([],G(Df(t.WebGLRenderingContext.prototype,_d.WebGL,e,n,r,t)),!1)),t.WebGL2RenderingContext!==void 0&&i.push.apply(i,K([],G(Df(t.WebGL2RenderingContext.prototype,_d.WebGL2,e,n,r,t)),!1)),function(){i.forEach(function(e){return e()})}}var kf=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,e.recordCanvas===!0&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=gf(e,t),r=hf(this.processMutation.bind(this),e,t,this.mirror),i=Of(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){n(),r(),i()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!(this.frozen||this.locked)){var n=this.pendingCanvasMutations.get(e);if(!(!n||t===-1)){var r=n.map(function(e){return e.type,Mu(e,[`type`])}),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Af(e){return W(W({},e),{timestamp:Date.now()})}var jf,Mf,Nf=xd();function Pf(e){e===void 0&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,a=i===void 0?`rr-block`:i,o=e.blockSelector,s=o===void 0?null:o,c=e.ignoreClass,l=c===void 0?`rr-ignore`:c,u=e.maskTextClass,d=u===void 0?`rr-mask`:u,f=e.maskTextSelector,p=f===void 0?null:f,m=e.inlineStylesheet,h=m===void 0?!0:m,g=e.maskAllInputs,_=e.maskInputOptions,v=e.slimDOMOptions,y=e.maskInputFn,b=e.maskTextFn,x=e.hooks,S=e.packFn,C=e.sampling,w=C===void 0?{}:C,ee=e.mousemoveWait,T=e.recordCanvas,E=T===void 0?!1:T,D=e.userTriggeredOnInput,te=D===void 0?!1:D,O=e.collectFonts,k=O===void 0?!1:O,A=e.inlineImages,j=A===void 0?!1:A,ne=e.plugins,re=e.keepIframeSrcFn,ie=re===void 0?function(){return!1}:re;if(!t)throw Error(`emit function is required`);ee!==void 0&&w.mousemove===void 0&&(w.mousemove=ee);var M=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:_===void 0?{password:!0}:_,ae=v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:v===`all`,headMetaDescKeywords:v===`all`}:v||{};Nd();var N,P=0,F=function(e){var t,n;try{for(var r=Nu(ne||[]),i=r.next();!i.done;i=r.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return S&&(e=S(e)),e};jf=function(e,i){var a;if((a=Wd[0])!=null&&a.isFrozen()&&e.type!==J.FullSnapshot&&!(e.type===J.IncrementalSnapshot&&e.data.source===hd.Mutation)&&Wd.forEach(function(e){return e.unfreeze()}),t(F(e),i),e.type===J.FullSnapshot)N=e,P=0;else if(e.type===J.IncrementalSnapshot){if(e.data.source===hd.Mutation&&e.data.isAttachIframe)return;P++;var o=r&&P>=r,s=n&&e.timestamp-N.timestamp>n;(o||s)&&Mf(!0)}};var oe=function(e){jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.Mutation},e)}))},se=function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.Scroll},e)}))},ce=function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.CanvasMutation},e)}))},le=new pf({mutationCb:oe}),ue=new kf({recordCanvas:E,mutationCb:ce,win:window,blockClass:a,mirror:Nf}),de=new mf({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskInputOptions:M,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:j,sampling:w,slimDOMOptions:ae,iframeManager:le,canvasManager:ue},mirror:Nf});Mf=function(e){var t,n,r,i;e===void 0&&(e=!1),jf(Af({type:J.Meta,data:{href:window.location.href,width:Od(),height:Dd()}}),e),Wd.forEach(function(e){return e.lock()});var o=G(md(document,{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskAllInputs:M,maskTextFn:b,slimDOM:ae,recordCanvas:E,inlineImages:j,onSerialize:function(e){Pd(e)&&le.addIframe(e),Fd(e)&&de.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){le.attachIframe(e,t),de.observeAttachShadow(e)},keepIframeSrcFn:ie}),2),c=o[0],l=o[1];if(!c)return console.warn(`Failed to snapshot the document`);Nf.map=l,jf(Af({type:J.FullSnapshot,data:{node:c,initialOffset:{left:window.pageXOffset===void 0?(document==null?void 0:document.documentElement.scrollLeft)||((n=(t=document==null?void 0:document.body)==null?void 0:t.parentElement)==null?void 0:n.scrollLeft)||(document==null?void 0:document.body.scrollLeft)||0:window.pageXOffset,top:window.pageYOffset===void 0?(document==null?void 0:document.documentElement.scrollTop)||((i=(r=document==null?void 0:document.body)==null?void 0:r.parentElement)==null?void 0:i.scrollTop)||(document==null?void 0:document.body.scrollTop)||0:window.pageYOffset}}})),Wd.forEach(function(e){return e.unlock()})};try{var fe=[];fe.push(bd(`DOMContentLoaded`,function(){jf(Af({type:J.DomContentLoaded,data:{}}))}));var pe=function(e){var t;return ff({mutationCb:oe,mousemoveCb:function(e,t){return jf(Af({type:J.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.MouseInteraction},e)}))},scrollCb:se,viewportResizeCb:function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.ViewportResize},e)}))},inputCb:function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.Input},e)}))},mediaInteractionCb:function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.StyleDeclaration},e)}))},canvasMutationCb:ce,fontCb:function(e){return jf(Af({type:J.IncrementalSnapshot,data:W({source:hd.Font},e)}))},blockClass:a,ignoreClass:l,maskTextClass:d,maskTextSelector:p,maskInputOptions:M,inlineStylesheet:h,sampling:w,recordCanvas:E,inlineImages:j,userTriggeredOnInput:te,collectFonts:k,doc:e,maskInputFn:y,maskTextFn:b,blockSelector:s,slimDOMOptions:ae,mirror:Nf,iframeManager:le,shadowDomManager:de,canvasManager:ue,plugins:((t=ne==null?void 0:ne.filter(function(e){return e.observer}))==null?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return jf(Af({type:J.Plugin,data:{plugin:e.name,payload:t}}))}}}))||[]},x)};le.addLoadListener(function(e){fe.push(pe(e.contentDocument))});var me=function(){Mf(),fe.push(pe(document))};return document.readyState===`interactive`||document.readyState===`complete`?me():fe.push(bd(`load`,function(){jf(Af({type:J.Load,data:{}})),me()},window)),function(){fe.forEach(function(e){return e()})}}catch(e){console.warn(e)}}Pf.addCustomEvent=function(e,t){if(!jf)throw Error(`please add custom event after start recording`);jf(Af({type:J.Custom,data:{tag:e,payload:t}}))},Pf.freezePage=function(){Wd.forEach(function(e){return e.freeze()})},Pf.takeFullSnapshot=function(e){if(!Mf)throw Error(`please take full snapshot after start recording`);Mf(e)},Pf.mirror=Nf;var Ff=Uint8Array,If=Uint16Array,Lf=Uint32Array,Rf=new Ff([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),zf=new Ff([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bf=new Ff([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vf=function(e,t){for(var n=new If(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Lf(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},Hf=Vf(Rf,2),Uf=Hf[0],Wf=Hf[1];Uf[28]=258,Wf[258]=28;var Gf=Vf(zf,0);Gf[0];for(var Kf=Gf[1],qf=new If(32768),Y=0;Y<32768;++Y){var Jf=(Y&43690)>>>1|(Y&21845)<<1;Jf=(Jf&52428)>>>2|(Jf&13107)<<2,Jf=(Jf&61680)>>>4|(Jf&3855)<<4,qf[Y]=((Jf&65280)>>>8|(Jf&255)<<8)>>>1}for(var Yf=(function(e,t,n){for(var r=e.length,i=0,a=new If(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new If(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new If(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[qf[d]>>>c]=l}else for(s=new If(r),i=0;i<r;++i)e[i]&&(s[i]=qf[o[e[i]-1]++]>>>15-e[i]);return s}),Xf=new Ff(288),Y=0;Y<144;++Y)Xf[Y]=8;for(var Y=144;Y<256;++Y)Xf[Y]=9;for(var Y=256;Y<280;++Y)Xf[Y]=7;for(var Y=280;Y<288;++Y)Xf[Y]=8;for(var Zf=new Ff(32),Y=0;Y<32;++Y)Zf[Y]=5;var Qf=Yf(Xf,9,0),$f=Yf(Zf,5,0),ep=function(e){return(e+7)/8|0},tp=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?If:e.BYTES_PER_ELEMENT==4?Lf:Ff)(n-t);return r.set(e.subarray(t,n)),r},np=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},rp=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},ip=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[dp,0];if(i==1){var o=new Ff(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new If(f+1),m=ap(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new Ff(p),m]},ap=function(e,t,n){return e.s==-1?Math.max(ap(e.l,t,n+1),ap(e.r,t,n+1)):t[e.s]=n},op=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new If(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},sp=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},cp=function(e,t,n){var r=n.length,i=ep(t+2);e[i]=r&255,e[i+1]=r>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},lp=function(e,t,n,r,i,a,o,s,c,l,u){np(t,u++,n),++i[256];for(var d=ip(i,15),f=d[0],p=d[1],m=ip(a,15),h=m[0],g=m[1],_=op(f),v=_[0],y=_[1],b=op(h),x=b[0],S=b[1],C=new If(19),w=0;w<v.length;++w)C[v[w]&31]++;for(var w=0;w<x.length;++w)C[x[w]&31]++;for(var ee=ip(C,7),T=ee[0],E=ee[1],D=19;D>4&&!T[Bf[D-1]];--D);var te=l+5<<3,O=sp(i,Xf)+sp(a,Zf)+o,k=sp(i,f)+sp(a,h)+o+14+3*D+sp(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(te<=O&&te<=k)return cp(t,u,e.subarray(c,c+l));var A,j,ne,re;if(np(t,u,1+(k<O)),u+=2,k<O){A=Yf(f,p,0),j=f,ne=Yf(h,g,0),re=h;var ie=Yf(T,E,0);np(t,u,y-257),np(t,u+5,S-1),np(t,u+10,D-4),u+=14;for(var w=0;w<D;++w)np(t,u+3*w,T[Bf[w]]);u+=3*D;for(var M=[v,x],ae=0;ae<2;++ae)for(var N=M[ae],w=0;w<N.length;++w){var P=N[w]&31;np(t,u,ie[P]),u+=T[P],P>15&&(np(t,u,N[w]>>>5&127),u+=N[w]>>>12)}}else A=Qf,j=Xf,ne=$f,re=Zf;for(var w=0;w<s;++w)if(r[w]>255){var P=r[w]>>>18&31;rp(t,u,A[P+257]),u+=j[P+257],P>7&&(np(t,u,r[w]>>>23&31),u+=Rf[P]);var F=r[w]&31;rp(t,u,ne[F]),u+=re[F],F>3&&(rp(t,u,r[w]>>>5&8191),u+=zf[F])}else rp(t,u,A[r[w]]),u+=j[r[w]];return rp(t,u,A[256]),u+j[256]},up=new Lf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),dp=new Ff(0),fp=function(e,t,n,r,i,a){var o=e.length,s=new Ff(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d>=o&&(c[l>>3]=a),l=cp(c,l+1,e.subarray(u,d))}else{for(var f=up[t-1],p=f>>>13,m=f&8191,h=(1<<n)-1,g=new If(32768),_=new If(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new Lf(25e3),S=new If(288),C=new If(32),w=0,ee=0,u=0,T=0,E=0,D=0;u<o;++u){var te=b(u),O=u&32767,k=_[te];if(g[O]=k,_[te]=O,E<=u){var A=o-u;if((w>7e3||T>24576)&&A>423){l=lp(e,c,0,x,S,C,ee,T,D,u-D,l),T=w=ee=0,D=u;for(var j=0;j<286;++j)S[j]=0;for(var j=0;j<30;++j)C[j]=0}var ne=2,re=0,ie=m,M=O-k&32767;if(A>2&&te==b(u-M))for(var ae=Math.min(p,A)-1,N=Math.min(32767,u),P=Math.min(258,A);M<=N&&--ie&&O!=k;){if(e[u+ne]==e[u+ne-M]){for(var F=0;F<P&&e[u+F]==e[u+F-M];++F);if(F>ne){if(ne=F,re=M,F>ae)break;for(var oe=Math.min(M,F-2),se=0,j=0;j<oe;++j){var ce=u-M+j+32768&32767,le=ce-g[ce]+32768&32767;le>se&&(se=le,k=ce)}}}O=k,k=g[O],M+=O-k+32768&32767}if(re){x[T++]=268435456|Wf[ne]<<18|Kf[re];var ue=Wf[ne]&31,de=Kf[re]&31;ee+=Rf[ue]+zf[de],++S[257+ue],++C[de],E=u+ne,++w}else x[T++]=e[u],++S[e[u]]}}l=lp(e,c,a,x,S,C,ee,T,D,u-D,l),!a&&l&7&&(l=cp(c,l+1,dp))}return tp(s,0,r+ep(l)+i)},pp=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),mp=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=pp[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},hp=function(e,t,n,r,i){return fp(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)},gp=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},_p=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&gp(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},vp=function(e){return 10+(e.filename&&e.filename.length+1||0)};function yp(e,t){t||(t={});var n=mp(),r=e.length;n.p(e);var i=hp(e,t,vp(t),8),a=i.length;return _p(i,t),gp(i,a-8,n.d()),gp(i,a-4,r),i}var bp=typeof TextDecoder<`u`&&new TextDecoder;try{bp.decode(dp,{stream:!0})}catch(e){}
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`,cp={map:{},getId:function(){return console.error(sp),-1},getNode:function(){return console.error(sp),null},removeNodeFromMap:function(){console.error(sp)},has:function(){return console.error(sp),!1},reset:function(){console.error(sp)}},typeof window<`u`&&window.Proxy&&window.Reflect&&(cp=new Proxy(cp,{get:function(e,t,n){return t===`map`&&console.error(sp),Reflect.get(e,t,n)}})),function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),a=function(e){n.removeIdSet.add(e);var r=t.getNode(e);r==null||r.childNodes.forEach(function(e){`__sn`in e&&a(e.__sn.id)})},o=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach(function(e){return o(e)});var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),o(i)):(delete this.tree[i.id],this.indexes.delete(i.id),o(i)):(this.removeNodeMutations.push(e),a(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,i=this,a=this,o=a.tree,s=a.removeNodeMutations,c=a.textMutations,l=a.attributeMutations,u={source:Vf.Mutation,removes:s,texts:c,attributes:l,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter(function(e){return!i.removeIdSet.has(e.id)}),u.attributes=u.attributes.concat(t?[]:e.attributes).filter(function(e){return!i.removeIdSet.has(e.id)}),!i.removeIdSet.has(e.id)&&!i.removeIdSet.has(e.mutation.parentId)&&!t?(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach(function(e){return d(e,!1)})):Object.values(e.children).forEach(function(e){return d(e,!0)})};Object.values(o).forEach(function(e){return d(e,!1)});try{for(var f=ef(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var h=ef(this.inputMap.keys()),g=h.next();!g.done;g=h.next()){var m=g.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var _=new Map(this.scrollMap),v=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:_,inputMap:v}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e}()}));function up(e){return`__ln`in e}function dp(e){return`__sn`in e}function fp(e,t){e.delete(t),t.childNodes.forEach(function(t){return fp(e,t)})}function pp(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return e.some(function(e){return e.id===i})?!0:pp(e,r,n)}function mp(e,t){var n=t.parentNode;return n?e.has(n)?!0:mp(e,n):!1}var hp,gp,_p,vp=s((()=>{nf(),Bf(),lp(),hp=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw Error(`Position outside of list range`);for(var t=this.head,n=0;n<e;n++)t=(t==null?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&up(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&up(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),gp=function(e,t){return`${e}@${t}`},_p=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,n,r,i;if(!(e.frozen||e.locked)){for(var a=[],o=new hp,s=function(t){for(var n=t,r=-2;r===-2;)n=n&&n.nextSibling,r=n&&e.mirror.getId(n);return r},c=function(t){for(var n,r,i,c,l,u=t.getRootNode?(n=t.getRootNode())==null?void 0:n.host:null,d=u;(i=(r=d==null?void 0:d.getRootNode)==null?void 0:r.call(d))!=null&&i.host;)d=((l=(c=d==null?void 0:d.getRootNode)==null?void 0:c.call(d))==null?void 0:l.host)||null;var f=!e.doc.contains(t)&&(d===null||!e.doc.contains(d));if(!(!t.parentNode||f)){var p=af(t.parentNode)?e.mirror.getId(u):e.mirror.getId(t.parentNode),m=s(t);if(p===-1||m===-1)return o.addNode(t);var h=Ef(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){ap(n)&&e.iframeManager.addIframe(n),op(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});h&&a.push({parentId:p,nextId:m,node:h})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=ef(e.movedSet),u=l.next();!u.done;u=l.next()){var d=u.value;pp(e.removes,d,e.mirror)&&!e.movedSet.has(d.parentNode)||c(d)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}try{for(var f=ef(e.addedSet),p=f.next();!p.done;p=f.next()){var d=p.value;!mp(e.droppedSet,d)&&!pp(e.removes,d,e.mirror)||mp(e.movedSet,d)?c(d):e.droppedSet.add(d)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}for(var m=null;o.length;){var h=null;if(m){var g=e.mirror.getId(m.value.parentNode),_=s(m.value);g!==-1&&_!==-1&&(h=m)}if(!h)for(var v=o.length-1;v>=0;v--){var y=o.get(v);if(y){var g=e.mirror.getId(y.value.parentNode),_=s(y.value);if(g!==-1&&_!==-1){h=y;break}}}if(!h){for(;o.head;)o.removeNode(o.head.value);break}m=h.previous,o.removeNode(h.value),c(h.value)}var b={texts:e.texts.map(function(t){return{id:e.mirror.getId(t.node),value:t.value}}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:a};!b.texts.length&&!b.attributes.length&&!b.removes.length&&!b.adds.length||(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(b))}},this.processMutation=function(t){var n,r,i,a;if(!tp(t.target))switch(t.type){case`characterData`:var o=t.target.textContent;!ep(t.target,e.blockClass)&&o!==t.oldValue&&e.texts.push({value:Sf(t.target,e.maskTextClass,e.maskTextSelector)&&o?e.maskTextFn?e.maskTextFn(o):o.replace(/[\S]/g,`*`):o,node:t.target});break;case`attributes`:var s=t.target,o=t.target.getAttribute(t.attributeName);if(t.attributeName===`value`&&(o=of({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute(`type`),value:o,maskInputFn:e.maskInputFn})),ep(t.target,e.blockClass)||o===t.oldValue)return;var c=e.attributes.find(function(e){return e.node===t.target});if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),t.attributeName===`style`){var l=e.doc.createElement(`span`);t.oldValue&&l.setAttribute(`style`,t.oldValue),(c.attributes.style===void 0||c.attributes.style===null)&&(c.attributes.style={});var u=c.attributes.style;try{for(var d=ef(Array.from(s.style)),f=d.next();!f.done;f=d.next()){var p=f.value,m=s.style.getPropertyValue(p),h=s.style.getPropertyPriority(p);(m!==l.style.getPropertyValue(p)||h!==l.style.getPropertyPriority(p))&&(h===``?u[p]=m:u[p]=[m,h])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}try{for(var g=ef(Array.from(l.style)),_=g.next();!_.done;_=g.next()){var p=_.value;s.style.getPropertyValue(p)===``&&(u[p]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=bf(e.doc,t.target.tagName,t.attributeName,o);break;case`childList`:t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var r=e.mirror.getId(n),i=af(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ep(t.target,e.blockClass)||tp(n)||(e.addedSet.has(n)?(fp(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&r===-1||np(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[gp(r,i)]?fp(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:af(t.target)?!0:void 0})),e.mapRemoves.push(n))});break}},this.genAdds=function(t,n){if(!(n&&ep(n,e.blockClass))){if(dp(t)){if(tp(t))return;e.movedSet.add(t);var r=null;n&&dp(n)&&(r=n.__sn.id),r&&(e.movedMap[gp(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ep(t,e.blockClass)||t.childNodes.forEach(function(t){return e.genAdds(t)})}}}return e.prototype.init=function(e){var t=this;[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`doc`,`mirror`,`iframeManager`,`shadowDomManager`,`canvasManager`].forEach(function(n){t[n]=e[n]})},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}()}));function yp(e){try{if(`composedPath`in e){var t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function bp(e,t){var n,r,i=new _p;Pp.push(i),i.init(e);var a=window.MutationObserver||window.__rrMutationObserver,o=(r=(n=window==null?void 0:window.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,`MutationObserver`);o&&window[o]&&(a=window[o]);var s=new a(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function xp(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(n.mousemove===!1)return function(){};var a=typeof n.mousemove==`number`?n.mousemove:50,o=typeof n.mousemoveCallback==`number`?n.mousemoveCallback:500,s=[],c,l=Yf(function(e){var n=Date.now()-c;t(s.map(function(e){return e.timeOffset-=n,e}),e),s=[],c=null},o),u=Yf(function(e){var t=yp(e),n=rp(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;c||(c=Date.now()),s.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-c}),l(typeof DragEvent<`u`&&e instanceof DragEvent?Vf.Drag:e instanceof MouseEvent?Vf.MouseMove:Vf.TouchMove)},a,{trailing:!1}),d=[qf(`mousemove`,u,r),qf(`touchmove`,u,r),qf(`drag`,u,r)];return function(){d.forEach(function(e){return e()})}}function Sp(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;if(a.mouseInteraction===!1)return function(){};var o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=function(e){return function(n){var a=yp(n);if(!ep(a,i)){var o=rp(n)?n.changedTouches[0]:n;if(o){var s=r.getId(a),c=o.clientX,l=o.clientY;t({type:Hf[e],id:s,x:c,y:l})}}}};return Object.keys(Hf).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1}).forEach(function(e){var t=e.toLowerCase(),r=c(e);s.push(qf(t,r,n))}),function(){s.forEach(function(e){return e()})}}function Cp(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;return qf(`scroll`,Yf(function(e){var a=yp(e);if(!(!a||ep(a,i))){var o=r.getId(a);if(a===n){var s=n.scrollingElement||n.documentElement;t({id:o,x:s.scrollLeft,y:s.scrollTop})}else t({id:o,x:a.scrollLeft,y:a.scrollTop})}},a.scroll||100),n)}function wp(e){var t=e.viewportResizeCb,n=-1,r=-1;return qf(`resize`,Yf(function(){var e=Qf(),i=$f();(n!==e||r!==i)&&(t({width:Number(i),height:Number(e)}),n=e,r=i)},200),window)}function Tp(e,t){var n=tf({},e);return t||delete n.userTriggered,n}function Ep(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.ignoreClass,o=e.maskInputOptions,s=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function u(e){var t=yp(e),r=e.isTrusted;if(t&&t.tagName===`OPTION`&&(t=t.parentElement),!(!t||!t.tagName||zp.indexOf(t.tagName)<0||ep(t,i))){var c=t.type;if(!t.classList.contains(a)){var u=t.value,f=!1;c===`radio`||c===`checkbox`?f=t.checked:(o[t.tagName.toLowerCase()]||o[c])&&(u=of({maskInputOptions:o,tagName:t.tagName,type:c,value:u,maskInputFn:s})),d(t,Tp({text:u,isChecked:f,userTriggered:r},l));var p=t.name;c===`radio`&&p&&f&&n.querySelectorAll(`input[type="radio"][name="${p}"]`).forEach(function(e){e!==t&&d(e,Tp({text:e.value,isChecked:!f,userTriggered:!1},l))})}}}function d(e,n){var i=Bp.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Bp.set(e,n);var a=r.getId(e);t(tf(tf({},n),{id:a}))}}var f=(c.input===`last`?[`change`]:[`input`,`change`]).map(function(e){return qf(e,u,n)}),p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`),m=[[HTMLInputElement.prototype,`value`],[HTMLInputElement.prototype,`checked`],[HTMLSelectElement.prototype,`value`],[HTMLTextAreaElement.prototype,`value`],[HTMLSelectElement.prototype,`selectedIndex`],[HTMLOptionElement.prototype,`selected`]];return p&&p.set&&f.push.apply(f,K([],G(m.map(function(e){return Xf(e[0],e[1],{set:function(){u({target:this})}})})),!1)),function(){f.forEach(function(e){return e()})}}function Dp(e){var t=[];function n(e,t){if(Fp&&e.parentRule instanceof CSSGroupingRule||Ip&&e.parentRule instanceof CSSMediaRule||Lp&&e.parentRule instanceof CSSSupportsRule||Rp&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules),r=n.indexOf(e);t.unshift(r)}else{var n=Array.from(e.parentStyleSheet.cssRules),r=n.indexOf(e);t.unshift(r)}return t}return n(e,t)}function Op(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=t.win,a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(e,t){var i=r.getId(this.ownerNode);return i!==-1&&n({id:i,adds:[{rule:e,index:t}]}),a.apply(this,arguments)};var o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(e){var t=r.getId(this.ownerNode);return t!==-1&&n({id:t,removes:[{index:e}]}),o.apply(this,arguments)};var s={};Fp?s.CSSGroupingRule=i.CSSGroupingRule:(Ip&&(s.CSSMediaRule=i.CSSMediaRule),Rp&&(s.CSSConditionRule=i.CSSConditionRule),Lp&&(s.CSSSupportsRule=i.CSSSupportsRule));var c={};return Object.entries(s).forEach(function(e){var t=G(e,2),i=t[0],a=t[1];c[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(e,t){var a=r.getId(this.parentStyleSheet.ownerNode);return a!==-1&&n({id:a,adds:[{rule:e,index:K(K([],G(Dp(this)),!1),[t||0],!1)}]}),c[i].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(e){var t=r.getId(this.parentStyleSheet.ownerNode);return t!==-1&&n({id:t,removes:[{index:K(K([],G(Dp(this)),!1),[e],!1)}]}),c[i].deleteRule.apply(this,arguments)}}),function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(function(e){var t=G(e,2),n=t[0],r=t[1];r.prototype.insertRule=c[n].insertRule,r.prototype.deleteRule=c[n].deleteRule})}}function kp(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var o,s,c=r.getId((s=(o=this.parentRule)==null?void 0:o.parentStyleSheet)==null?void 0:s.ownerNode);return c!==-1&&n({id:c,set:{property:e,value:t,priority:i},index:Dp(this.parentRule)}),a.apply(this,arguments)};var o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,a=r.getId((i=(t=this.parentRule)==null?void 0:t.parentStyleSheet)==null?void 0:i.ownerNode);return a!==-1&&n({id:a,remove:{property:e},index:Dp(this.parentRule)}),o.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o}}function Ap(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,a=function(e){return Yf(function(i){var a=yp(i);if(!(!a||ep(a,n))){var o=a,s=o.currentTime,c=o.volume,l=o.muted;t({type:e,id:r.getId(a),currentTime:s,volume:c,muted:l})}},i.media||500)},o=[qf(`play`,a(0)),qf(`pause`,a(1)),qf(`seeked`,a(2)),qf(`volumechange`,a(3))];return function(){o.forEach(function(e){return e()})}}function jp(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],a=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,n){var r=new o(e,t,n);return a.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=Zf(n.fonts,`add`,function(e){return function(n){return setTimeout(function(){var e=a.get(n);e&&(t(e),a.delete(n))},0),e.apply(this,[n])}});return i.push(function(){r.FontFace=o}),i.push(s),function(){i.forEach(function(e){return e()})}}function Mp(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb;e.mutationCb=function(){var e=[...arguments];t.mutation&&t.mutation.apply(t,K([],G(e),!1)),n.apply(void 0,K([],G(e),!1))},e.mousemoveCb=function(){var e=[...arguments];t.mousemove&&t.mousemove.apply(t,K([],G(e),!1)),r.apply(void 0,K([],G(e),!1))},e.mouseInteractionCb=function(){var e=[...arguments];t.mouseInteraction&&t.mouseInteraction.apply(t,K([],G(e),!1)),i.apply(void 0,K([],G(e),!1))},e.scrollCb=function(){var e=[...arguments];t.scroll&&t.scroll.apply(t,K([],G(e),!1)),a.apply(void 0,K([],G(e),!1))},e.viewportResizeCb=function(){var e=[...arguments];t.viewportResize&&t.viewportResize.apply(t,K([],G(e),!1)),o.apply(void 0,K([],G(e),!1))},e.inputCb=function(){var e=[...arguments];t.input&&t.input.apply(t,K([],G(e),!1)),s.apply(void 0,K([],G(e),!1))},e.mediaInteractionCb=function(){var e=[...arguments];t.mediaInteaction&&t.mediaInteaction.apply(t,K([],G(e),!1)),c.apply(void 0,K([],G(e),!1))},e.styleSheetRuleCb=function(){var e=[...arguments];t.styleSheetRule&&t.styleSheetRule.apply(t,K([],G(e),!1)),l.apply(void 0,K([],G(e),!1))},e.styleDeclarationCb=function(){var e=[...arguments];t.styleDeclaration&&t.styleDeclaration.apply(t,K([],G(e),!1)),u.apply(void 0,K([],G(e),!1))},e.canvasMutationCb=function(){var e=[...arguments];t.canvasMutation&&t.canvasMutation.apply(t,K([],G(e),!1)),d.apply(void 0,K([],G(e),!1))},e.fontCb=function(){var e=[...arguments];t.font&&t.font.apply(t,K([],G(e),!1)),f.apply(void 0,K([],G(e),!1))}}function Np(e,t){var n,r;t===void 0&&(t={});var i=e.doc.defaultView;if(!i)return function(){};Mp(e,t);var a=bp(e,e.doc),o=xp(e),s=Sp(e),c=Cp(e),l=wp(e),u=Ep(e),d=Ap(e),f=Op(e,{win:i}),p=kp(e,{win:i}),m=e.collectFonts?jp(e):function(){},h=[];try{for(var g=ef(e.plugins),_=g.next();!_.done;_=g.next()){var v=_.value;h.push(v.observer(v.callback,i,v.options))}}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return function(){Pp.forEach(function(e){return e.reset()}),a.disconnect(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h.forEach(function(e){return e()})}}var Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp=s((()=>{nf(),Bf(),lp(),Kf(),vp(),Pp=[],Fp=typeof CSSGroupingRule<`u`,Ip=typeof CSSMediaRule<`u`,Lp=typeof CSSSupportsRule<`u`,Rp=typeof CSSConditionRule<`u`,zp=[`INPUT`,`TEXTAREA`,`SELECT`],Bp=new WeakMap})),Hp,Up=s((()=>{Hp=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)==null||n.call(this,e)},e}()})),Wp,Gp=s((()=>{nf(),Vp(),lp(),Wp=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(Zf(HTMLElement.prototype,`attachShadow`,function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}}))}return e.prototype.addShadowRoot=function(e,t){bp(tf(tf({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Cp(tf(tf({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(Zf(e.contentWindow.HTMLElement.prototype,`attachShadow`,function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}},e.prototype.reset=function(){this.restorePatches.forEach(function(e){return e()})},e}()}));function Kp(e,t,n,r){var i,a,o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),c=function(r){try{if(typeof t.CanvasRenderingContext2D.prototype[r]!=`function`)return`continue`;var i=Zf(t.CanvasRenderingContext2D.prototype,r,function(t){return function(){for(var i=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return ep(this.canvas,n)||setTimeout(function(){var t=K([],G(a),!1);if(r===`drawImage`&&t[0]&&t[0]instanceof HTMLCanvasElement){var n=t[0],o=n.getContext(`2d`),s=o==null?void 0:o.getImageData(0,0,n.width,n.height),c=s==null?void 0:s.data;t[0]=JSON.stringify(c)}e(i.canvas,{type:Uf[`2D`],property:r,args:t})},0),t.apply(this,a)}});o.push(i)}catch(n){var a=Xf(t.CanvasRenderingContext2D.prototype,r,{set:function(t){e(this.canvas,{type:Uf[`2D`],property:r,args:[t],setter:!0})}});o.push(a)}};try{for(var l=ef(s),u=l.next();!u.done;u=l.next()){var d=u.value;c(d)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return function(){o.forEach(function(e){return e()})}}var qp=s((()=>{nf(),Kf(),lp()}));function Jp(e,t){var n=[];try{var r=Zf(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(n){var r=[...arguments].slice(1);return ep(this,t)||`__context`in this||(this.__context=n),e.apply(this,K([n],G(r),!1))}});n.push(r)}catch(e){console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return function(){n.forEach(function(e){return e()})}}var Yp=s((()=>{nf(),lp()})),Xp,Zp,Qp,$p,em=s((()=>{for(Xp=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Zp=typeof Uint8Array>`u`?[]:new Uint8Array(256),Qp=0;Qp<Xp.length;Qp++)Zp[Xp.charCodeAt(Qp)]=Qp;$p=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Xp[t[n]>>2],i+=Xp[(t[n]&3)<<4|t[n+1]>>4],i+=Xp[(t[n+1]&15)<<2|t[n+2]>>6],i+=Xp[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i}}));function tm(e,t){var n=rm.get(e);return n||(n=new Map,rm.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function nm(e,t,n){return e instanceof Array?e.map(function(e){return nm(e,t,n)}):e===null?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:$p(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[nm(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[nm(e.data,t,n),e.width,e.height]}:om(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:im(e,t,n)}:e}var rm,im,am,om,sm=s((()=>{nf(),em(),rm=new Map,im=function(e,t,n){if(!(!e||!(om(e,t)||typeof e==`object`))){var r=e.constructor.name,i=tm(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a}},am=function(e,t,n){return K([],G(e),!1).map(function(e){return nm(e,t,n)})},om=function(e,t){return!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(function(e){return typeof t[e]==`function`}).find(function(n){return e instanceof t[n]})}}));function cm(e,t,n,r,i,a){var o,s,c=[],l=Object.getOwnPropertyNames(e),u=function(o){try{if(typeof e[o]!=`function`)return`continue`;var s=Zf(e,o,function(s){return function(){var c=[...arguments],l=s.apply(this,c);if(im(l,a,e),!ep(this.canvas,r)){i.getId(this.canvas);var u={type:t,property:o,args:am(K([],G(c),!1),a,e)};n(this.canvas,u)}return l}});c.push(s)}catch(r){var l=Xf(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(l)}};try{for(var d=ef(l),f=d.next();!f.done;f=d.next()){var p=f.value;u(p)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}return c}function lm(e,t,n,r){var i=[];return i.push.apply(i,K([],G(cm(t.WebGLRenderingContext.prototype,Uf.WebGL,e,n,r,t)),!1)),t.WebGL2RenderingContext!==void 0&&i.push.apply(i,K([],G(cm(t.WebGL2RenderingContext.prototype,Uf.WebGL2,e,n,r,t)),!1)),function(){i.forEach(function(e){return e()})}}var um=s((()=>{nf(),Kf(),lp(),sm()})),dm,fm=s((()=>{nf(),qp(),Yp(),um(),dm=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,e.recordCanvas===!0&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Jp(e,t),r=Kp(this.processMutation.bind(this),e,t,this.mirror),i=lm(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){n(),r(),i()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!(this.frozen||this.locked)){var n=this.pendingCanvasMutations.get(e);if(!(!n||t===-1)){var r=n.map(function(e){return e.type,$d(e,[`type`])}),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}()}));function pm(e){return tf(tf({},e),{timestamp:Date.now()})}function mm(e){e===void 0&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,a=i===void 0?`rr-block`:i,o=e.blockSelector,s=o===void 0?null:o,c=e.ignoreClass,l=c===void 0?`rr-ignore`:c,u=e.maskTextClass,d=u===void 0?`rr-mask`:u,f=e.maskTextSelector,p=f===void 0?null:f,m=e.inlineStylesheet,h=m===void 0?!0:m,g=e.maskAllInputs,_=e.maskInputOptions,v=e.slimDOMOptions,y=e.maskInputFn,b=e.maskTextFn,x=e.hooks,S=e.packFn,C=e.sampling,w=C===void 0?{}:C,ee=e.mousemoveWait,T=e.recordCanvas,E=T===void 0?!1:T,D=e.userTriggeredOnInput,te=D===void 0?!1:D,O=e.collectFonts,k=O===void 0?!1:O,A=e.inlineImages,j=A===void 0?!1:A,M=e.plugins,ne=e.keepIframeSrcFn,re=ne===void 0?function(){return!1}:ne;if(!t)throw Error(`emit function is required`);ee!==void 0&&w.mousemove===void 0&&(w.mousemove=ee);var ie=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:_===void 0?{password:!0}:_,ae=v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:v===`all`,headMetaDescKeywords:v===`all`}:v||{};ip();var N,oe=0,P=function(e){var t,n;try{for(var r=ef(M||[]),i=r.next();!i.done;i=r.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return S&&(e=S(e)),e};hm=function(e,i){var a;if((a=Pp[0])!=null&&a.isFrozen()&&e.type!==J.FullSnapshot&&!(e.type===J.IncrementalSnapshot&&e.data.source===Vf.Mutation)&&Pp.forEach(function(e){return e.unfreeze()}),t(P(e),i),e.type===J.FullSnapshot)N=e,oe=0;else if(e.type===J.IncrementalSnapshot){if(e.data.source===Vf.Mutation&&e.data.isAttachIframe)return;oe++;var o=r&&oe>=r,s=n&&e.timestamp-N.timestamp>n;(o||s)&&gm(!0)}};var se=function(e){hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.Mutation},e)}))},ce=function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.Scroll},e)}))},le=function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.CanvasMutation},e)}))},ue=new Hp({mutationCb:se}),de=new dm({recordCanvas:E,mutationCb:le,win:window,blockClass:a,mirror:_m}),fe=new Wp({mutationCb:se,scrollCb:ce,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskInputOptions:ie,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:j,sampling:w,slimDOMOptions:ae,iframeManager:ue,canvasManager:de},mirror:_m});gm=function(e){var t,n,r,i;e===void 0&&(e=!1),hm(pm({type:J.Meta,data:{href:window.location.href,width:$f(),height:Qf()}}),e),Pp.forEach(function(e){return e.lock()});var o=G(Df(document,{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskAllInputs:ie,maskTextFn:b,slimDOM:ae,recordCanvas:E,inlineImages:j,onSerialize:function(e){ap(e)&&ue.addIframe(e),op(e)&&fe.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ue.attachIframe(e,t),fe.observeAttachShadow(e)},keepIframeSrcFn:re}),2),c=o[0],l=o[1];if(!c)return console.warn(`Failed to snapshot the document`);_m.map=l,hm(pm({type:J.FullSnapshot,data:{node:c,initialOffset:{left:window.pageXOffset===void 0?(document==null?void 0:document.documentElement.scrollLeft)||((n=(t=document==null?void 0:document.body)==null?void 0:t.parentElement)==null?void 0:n.scrollLeft)||(document==null?void 0:document.body.scrollLeft)||0:window.pageXOffset,top:window.pageYOffset===void 0?(document==null?void 0:document.documentElement.scrollTop)||((i=(r=document==null?void 0:document.body)==null?void 0:r.parentElement)==null?void 0:i.scrollTop)||(document==null?void 0:document.body.scrollTop)||0:window.pageYOffset}}})),Pp.forEach(function(e){return e.unlock()})};try{var pe=[];pe.push(qf(`DOMContentLoaded`,function(){hm(pm({type:J.DomContentLoaded,data:{}}))}));var me=function(e){var t;return Np({mutationCb:se,mousemoveCb:function(e,t){return hm(pm({type:J.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.MouseInteraction},e)}))},scrollCb:ce,viewportResizeCb:function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.ViewportResize},e)}))},inputCb:function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.Input},e)}))},mediaInteractionCb:function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.StyleDeclaration},e)}))},canvasMutationCb:le,fontCb:function(e){return hm(pm({type:J.IncrementalSnapshot,data:tf({source:Vf.Font},e)}))},blockClass:a,ignoreClass:l,maskTextClass:d,maskTextSelector:p,maskInputOptions:ie,inlineStylesheet:h,sampling:w,recordCanvas:E,inlineImages:j,userTriggeredOnInput:te,collectFonts:k,doc:e,maskInputFn:y,maskTextFn:b,blockSelector:s,slimDOMOptions:ae,mirror:_m,iframeManager:ue,shadowDomManager:fe,canvasManager:de,plugins:((t=M==null?void 0:M.filter(function(e){return e.observer}))==null?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return hm(pm({type:J.Plugin,data:{plugin:e.name,payload:t}}))}}}))||[]},x)};ue.addLoadListener(function(e){pe.push(me(e.contentDocument))});var he=function(){gm(),pe.push(me(document))};return document.readyState===`interactive`||document.readyState===`complete`?he():pe.push(qf(`load`,function(){hm(pm({type:J.Load,data:{}})),he()},window)),function(){pe.forEach(function(e){return e()})}}catch(e){console.warn(e)}}var hm,gm,_m,vm=s((()=>{nf(),Bf(),Vp(),lp(),Kf(),Up(),Gp(),fm(),_m=Jf(),mm.addCustomEvent=function(e,t){if(!hm)throw Error(`please add custom event after start recording`);hm(pm({type:J.Custom,data:{tag:e,payload:t}}))},mm.freezePage=function(){Pp.forEach(function(e){return e.freeze()})},mm.takeFullSnapshot=function(e){if(!gm)throw Error(`please take full snapshot after start recording`);gm(e)},mm.mirror=_m})),ym=s((()=>{vm(),nf(),Bf(),Kf(),lp(),em()}));function bm(e,t){t||(t={});var n=eh(),r=e.length;n.p(e);var i=th(e,t,ih(t),8),a=i.length;return rh(i,t),nh(i,a-8,n.d()),nh(i,a-4,r),i}var xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Y,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh=s((()=>{for(xm=Uint8Array,Sm=Uint16Array,Cm=Uint32Array,wm=new xm([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Tm=new xm([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Em=new xm([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dm=function(e,t){for(var n=new Sm(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Cm(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},Om=Dm(wm,2),km=Om[0],Am=Om[1],km[28]=258,Am[258]=28,jm=Dm(Tm,0),jm[0],Mm=jm[1],Nm=new Sm(32768),Y=0;Y<32768;++Y)Pm=(Y&43690)>>>1|(Y&21845)<<1,Pm=(Pm&52428)>>>2|(Pm&13107)<<2,Pm=(Pm&61680)>>>4|(Pm&3855)<<4,Nm[Y]=((Pm&65280)>>>8|(Pm&255)<<8)>>>1;for(Fm=(function(e,t,n){for(var r=e.length,i=0,a=new Sm(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new Sm(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new Sm(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[Nm[d]>>>c]=l}else for(s=new Sm(r),i=0;i<r;++i)e[i]&&(s[i]=Nm[o[e[i]-1]++]>>>15-e[i]);return s}),Im=new xm(288),Y=0;Y<144;++Y)Im[Y]=8;for(Y=144;Y<256;++Y)Im[Y]=9;for(Y=256;Y<280;++Y)Im[Y]=7;for(Y=280;Y<288;++Y)Im[Y]=8;for(Lm=new xm(32),Y=0;Y<32;++Y)Lm[Y]=5;Rm=Fm(Im,9,0),zm=Fm(Lm,5,0),Bm=function(e){return(e+7)/8|0},Vm=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?Sm:e.BYTES_PER_ELEMENT==4?Cm:xm)(n-t);return r.set(e.subarray(t,n)),r},Hm=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Um=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Wm=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[Zm,0];if(i==1){var o=new xm(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new Sm(f+1),m=Gm(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new xm(p),m]},Gm=function(e,t,n){return e.s==-1?Math.max(Gm(e.l,t,n+1),Gm(e.r,t,n+1)):t[e.s]=n},Km=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Sm(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},qm=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Jm=function(e,t,n){var r=n.length,i=Bm(t+2);e[i]=r&255,e[i+1]=r>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},Ym=function(e,t,n,r,i,a,o,s,c,l,u){Hm(t,u++,n),++i[256];for(var d=Wm(i,15),f=d[0],p=d[1],m=Wm(a,15),h=m[0],g=m[1],_=Km(f),v=_[0],y=_[1],b=Km(h),x=b[0],S=b[1],C=new Sm(19),w=0;w<v.length;++w)C[v[w]&31]++;for(var w=0;w<x.length;++w)C[x[w]&31]++;for(var ee=Wm(C,7),T=ee[0],E=ee[1],D=19;D>4&&!T[Em[D-1]];--D);var te=l+5<<3,O=qm(i,Im)+qm(a,Lm)+o,k=qm(i,f)+qm(a,h)+o+14+3*D+qm(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(te<=O&&te<=k)return Jm(t,u,e.subarray(c,c+l));var A,j,M,ne;if(Hm(t,u,1+(k<O)),u+=2,k<O){A=Fm(f,p,0),j=f,M=Fm(h,g,0),ne=h;var re=Fm(T,E,0);Hm(t,u,y-257),Hm(t,u+5,S-1),Hm(t,u+10,D-4),u+=14;for(var w=0;w<D;++w)Hm(t,u+3*w,T[Em[w]]);u+=3*D;for(var ie=[v,x],ae=0;ae<2;++ae)for(var N=ie[ae],w=0;w<N.length;++w){var oe=N[w]&31;Hm(t,u,re[oe]),u+=T[oe],oe>15&&(Hm(t,u,N[w]>>>5&127),u+=N[w]>>>12)}}else A=Rm,j=Im,M=zm,ne=Lm;for(var w=0;w<s;++w)if(r[w]>255){var oe=r[w]>>>18&31;Um(t,u,A[oe+257]),u+=j[oe+257],oe>7&&(Hm(t,u,r[w]>>>23&31),u+=wm[oe]);var P=r[w]&31;Um(t,u,M[P]),u+=ne[P],P>3&&(Um(t,u,r[w]>>>5&8191),u+=Tm[P])}else Um(t,u,A[r[w]]),u+=j[r[w]];return Um(t,u,A[256]),u+j[256]},Xm=new Cm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zm=new xm(0),Qm=function(e,t,n,r,i,a){var o=e.length,s=new xm(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d>=o&&(c[l>>3]=a),l=Jm(c,l+1,e.subarray(u,d))}else{for(var f=Xm[t-1],p=f>>>13,m=f&8191,h=(1<<n)-1,g=new Sm(32768),_=new Sm(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new Cm(25e3),S=new Sm(288),C=new Sm(32),w=0,ee=0,u=0,T=0,E=0,D=0;u<o;++u){var te=b(u),O=u&32767,k=_[te];if(g[O]=k,_[te]=O,E<=u){var A=o-u;if((w>7e3||T>24576)&&A>423){l=Ym(e,c,0,x,S,C,ee,T,D,u-D,l),T=w=ee=0,D=u;for(var j=0;j<286;++j)S[j]=0;for(var j=0;j<30;++j)C[j]=0}var M=2,ne=0,re=m,ie=O-k&32767;if(A>2&&te==b(u-ie))for(var ae=Math.min(p,A)-1,N=Math.min(32767,u),oe=Math.min(258,A);ie<=N&&--re&&O!=k;){if(e[u+M]==e[u+M-ie]){for(var P=0;P<oe&&e[u+P]==e[u+P-ie];++P);if(P>M){if(M=P,ne=ie,P>ae)break;for(var se=Math.min(ie,P-2),ce=0,j=0;j<se;++j){var le=u-ie+j+32768&32767,ue=le-g[le]+32768&32767;ue>ce&&(ce=ue,k=le)}}}O=k,k=g[O],ie+=O-k+32768&32767}if(ne){x[T++]=268435456|Am[M]<<18|Mm[ne];var de=Am[M]&31,fe=Mm[ne]&31;ee+=wm[de]+Tm[fe],++S[257+de],++C[fe],E=u+M,++w}else x[T++]=e[u],++S[e[u]]}}l=Ym(e,c,a,x,S,C,ee,T,D,u-D,l),!a&&l&7&&(l=Jm(c,l+1,Zm))}return Vm(s,0,r+Bm(l)+i)},$m=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),eh=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=$m[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},th=function(e,t,n,r,i){return Qm(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)},nh=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},rh=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&nh(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},ih=function(e){return 10+(e.filename&&e.filename.length+1||0)},ah=typeof TextDecoder<`u`&&new TextDecoder;try{ah.decode(Zm,{stream:!0})}catch(e){}}));function X(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}function sh(e){return(e&&e.__isLong__)===!0}function ch(e){var t=Math.clz32(e&-e);return e?31-t:t}function lh(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=hh[e],r)?r:(n=Z(e,0,!0),i&&(hh[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=mh[e],r)?r:(n=Z(e,e<0?-1:0,!1),i&&(mh[e]=n),n))}function uh(e,t){if(isNaN(e))return t?wh:Ch;if(t){if(e<0)return wh;if(e>=bh)return kh}else{if(e<=-xh)return Ah;if(e+1>=xh)return Oh}return e<0?uh(-e,t).neg():Z(e%yh|0,e/yh|0,t)}function Z(e,t,n){return new X(e,t,n)}function dh(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?wh:Ch;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return dh(e.substring(1),t,n).neg();for(var i=uh(gh(n,8)),a=Ch,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+s),n);if(s<8){var l=uh(gh(n,s));a=a.mul(l).add(uh(c))}else a=a.mul(i),a=a.add(uh(c))}return a.unsigned=t,a}function fh(e,t){return typeof e==`number`?uh(e,t):typeof e==`string`?dh(e,t):Z(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}var ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh,Ah,Q,jh=s((()=>{ph=null;try{ph=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}X.prototype.__isLong__,Object.defineProperty(X.prototype,`__isLong__`,{value:!0}),X.isLong=sh,mh={},hh={},X.fromInt=lh,X.fromNumber=uh,X.fromBits=Z,gh=Math.pow,X.fromString=dh,X.fromValue=fh,_h=65536,vh=1<<24,yh=_h*_h,bh=yh*yh,xh=bh/2,Sh=lh(vh),Ch=lh(0),X.ZERO=Ch,wh=lh(0,!0),X.UZERO=wh,Th=lh(1),X.ONE=Th,Eh=lh(1,!0),X.UONE=Eh,Dh=lh(-1),X.NEG_ONE=Dh,Oh=Z(-1,2147483647,!1),X.MAX_VALUE=Oh,kh=Z(-1,-1,!0),X.MAX_UNSIGNED_VALUE=kh,Ah=Z(0,-2147483648,!1),X.MIN_VALUE=Ah,Q=X.prototype,Q.toInt=function(){return this.unsigned?this.low>>>0:this.low},Q.toNumber=function(){return this.unsigned?(this.high>>>0)*yh+(this.low>>>0):this.high*yh+(this.low>>>0)},Q.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(Ah)){var t=uh(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=uh(gh(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),c=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return c+o;for(;c.length<6;)c=`0`+c;o=``+c+o}},Q.getHighBits=function(){return this.high},Q.getHighBitsUnsigned=function(){return this.high>>>0},Q.getLowBits=function(){return this.low},Q.getLowBitsUnsigned=function(){return this.low>>>0},Q.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ah)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},Q.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},Q.isZero=function(){return this.high===0&&this.low===0},Q.eqz=Q.isZero,Q.isNegative=function(){return!this.unsigned&&this.high<0},Q.isPositive=function(){return this.unsigned||this.high>=0},Q.isOdd=function(){return(this.low&1)==1},Q.isEven=function(){return(this.low&1)==0},Q.equals=function(e){return sh(e)||(e=fh(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},Q.eq=Q.equals,Q.notEquals=function(e){return!this.eq(e)},Q.neq=Q.notEquals,Q.ne=Q.notEquals,Q.lessThan=function(e){return this.comp(e)<0},Q.lt=Q.lessThan,Q.lessThanOrEqual=function(e){return this.comp(e)<=0},Q.lte=Q.lessThanOrEqual,Q.le=Q.lessThanOrEqual,Q.greaterThan=function(e){return this.comp(e)>0},Q.gt=Q.greaterThan,Q.greaterThanOrEqual=function(e){return this.comp(e)>=0},Q.gte=Q.greaterThanOrEqual,Q.ge=Q.greaterThanOrEqual,Q.compare=function(e){if(sh(e)||(e=fh(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Q.comp=Q.compare,Q.negate=function(){return!this.unsigned&&this.eq(Ah)?Ah:this.not().add(Th)},Q.neg=Q.negate,Q.add=function(e){sh(e)||(e=fh(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i+c,d+=f>>>16,f&=65535,d+=r+s,u+=d>>>16,d&=65535,u+=n+o,l+=u>>>16,u&=65535,l+=t+a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.subtract=function(e){return sh(e)||(e=fh(e)),this.add(e.neg())},Q.sub=Q.subtract,Q.multiply=function(e){if(this.isZero())return this;if(sh(e)||(e=fh(e)),ph)return Z(ph.mul(this.low,this.high,e.low,e.high),ph.get_high(),this.unsigned);if(e.isZero())return this.unsigned?wh:Ch;if(this.eq(Ah))return e.isOdd()?Ah:Ch;if(e.eq(Ah))return this.isOdd()?Ah:Ch;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Sh)&&e.lt(Sh))return uh(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i*c,d+=f>>>16,f&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=i*s,u+=d>>>16,d&=65535,u+=n*c,l+=u>>>16,u&=65535,u+=r*s,l+=u>>>16,u&=65535,u+=i*o,l+=u>>>16,u&=65535,l+=t*c+n*s+r*o+i*a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.mul=Q.multiply,Q.divide=function(e){if(sh(e)||(e=fh(e)),e.isZero())throw Error(`division by zero`);if(ph)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:Z((this.unsigned?ph.div_u:ph.div_s)(this.low,this.high,e.low,e.high),ph.get_high(),this.unsigned);if(this.isZero())return this.unsigned?wh:Ch;var t,n,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return wh;if(e.gt(this.shru(1)))return Eh;r=wh}else{if(this.eq(Ah))return e.eq(Th)||e.eq(Dh)?Ah:e.eq(Ah)?Th:(t=this.shr(1).div(e).shl(1),t.eq(Ch)?e.isNegative()?Th:Dh:(n=this.sub(e.mul(t)),r=t.add(n.div(e)),r));if(e.eq(Ah))return this.unsigned?wh:Ch;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=Ch}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(t)/Math.LN2),a=i<=48?1:gh(2,i-48),o=uh(t),s=o.mul(e);s.isNegative()||s.gt(n);)t-=a,o=uh(t,this.unsigned),s=o.mul(e);o.isZero()&&(o=Th),r=r.add(o),n=n.sub(s)}return r},Q.div=Q.divide,Q.modulo=function(e){return sh(e)||(e=fh(e)),ph?Z((this.unsigned?ph.rem_u:ph.rem_s)(this.low,this.high,e.low,e.high),ph.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Q.mod=Q.modulo,Q.rem=Q.modulo,Q.not=function(){return Z(~this.low,~this.high,this.unsigned)},Q.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Q.clz=Q.countLeadingZeros,Q.countTrailingZeros=function(){return this.low?ch(this.low):ch(this.high)+32},Q.ctz=Q.countTrailingZeros,Q.and=function(e){return sh(e)||(e=fh(e)),Z(this.low&e.low,this.high&e.high,this.unsigned)},Q.or=function(e){return sh(e)||(e=fh(e)),Z(this.low|e.low,this.high|e.high,this.unsigned)},Q.xor=function(e){return sh(e)||(e=fh(e)),Z(this.low^e.low,this.high^e.high,this.unsigned)},Q.shiftLeft=function(e){return sh(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Z(0,this.low<<e-32,this.unsigned)},Q.shl=Q.shiftLeft,Q.shiftRight=function(e){return sh(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Z(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Q.shr=Q.shiftRight,Q.shiftRightUnsigned=function(e){return sh(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):Z(e===32?this.high:this.high>>>e-32,0,this.unsigned)},Q.shru=Q.shiftRightUnsigned,Q.shr_u=Q.shiftRightUnsigned,Q.rotateLeft=function(e){var t;return sh(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,Z(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},Q.rotl=Q.rotateLeft,Q.rotateRight=function(e){var t;return sh(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,Z(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},Q.rotr=Q.rotateRight,Q.toSigned=function(){return this.unsigned?Z(this.low,this.high,!1):this},Q.toUnsigned=function(){return this.unsigned?this:Z(this.low,this.high,!0)},Q.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Q.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},Q.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},X.fromBytes=function(e,t,n){return n?X.fromBytesLE(e,t):X.fromBytesBE(e,t)},X.fromBytesLE=function(e,t){return new X(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},X.fromBytesBE=function(e,t){return new X(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(X.fromBigInt=function(e,t){return Z(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},X.fromValue=function(e,t){return typeof e==`bigint`?X.fromBigInt(e,t):fh(e,t)},Q.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e})})),Mh=c(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),Nh=c((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(;t>0&&e.charAt(t-1)===`=`;)--t;return Math.floor(t*3/4)};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r[45]=62,r[95]=63,t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i};var o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,s=/[-_]/,c=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;t.test=function(e){return o.test(e)||s.test(e)&&c.test(e)}})),Ph=c(((e,t)=>{t.exports=n;function n(){this._listeners=Object.create(null)}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners=Object.create(null);else if(t===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r}return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),Fh=c(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*Math.pow(2,-a)*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*Math.pow(2,a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*Math.pow(2,-c),e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),Ih=c(((e,t)=>{t.exports=n;function n(e){try{if(typeof require!=`function`)return null;var t=require(e);return t&&(t.length||Object.keys(t).length)?t:null}catch(e){return null}}})),Lh=c((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t};function r(e,t,r,i){for(var a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i}t.read=function(e,t,n){if(n-t<1)return``;for(var i=``,a=t,o,s,c,l,u,d,f,p;a+7<n;a+=8){if(o=e[a],s=e[a+1],c=e[a+2],l=e[a+3],u=e[a+4],d=e[a+5],f=e[a+6],p=e[a+7],(o|s|c|l|u|d|f|p)&128)return r(e,a,n,i);i+=String.fromCharCode(o,s,c,l,u,d,f,p)}for(;a<n;++a){if(o=e[a],o&128)return r(e,a,n,i);i+=String.fromCharCode(o)}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),Rh=c(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),zh=c(((e,t)=>{t.exports=r;var n=Vh();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),Bh=c(((e,t)=>{(function(n,r){function i(e){return e.default||e}typeof define==`function`&&define.amd?define([],function(){var e={};return r(e),i(e)}):typeof e==`object`?(r(e),typeof t==`object`&&(t.exports=i(e))):(function(){var e={};r(e),n.Long=i(e)})()})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:e,function(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;
|
|
19
4
|
/**
|
|
20
5
|
* @license
|
|
21
6
|
* Copyright 2009 The Closure Library Authors
|
|
@@ -35,25 +20,5 @@ or you can use record.mirror to access the mirror instance during recording.`,Cd
|
|
|
35
20
|
*
|
|
36
21
|
* SPDX-License-Identifier: Apache-2.0
|
|
37
22
|
*/
|
|
38
|
-
var xp=null;try{xp=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function X(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}X.prototype.__isLong__,Object.defineProperty(X.prototype,`__isLong__`,{value:!0});function Sp(e){return(e&&e.__isLong__)===!0}function Cp(e){var t=Math.clz32(e&-e);return e?31-t:t}X.isLong=Sp;var wp={},Tp={};function Ep(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=Tp[e],r)?r:(n=Z(e,0,!0),i&&(Tp[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=wp[e],r)?r:(n=Z(e,e<0?-1:0,!1),i&&(wp[e]=n),n))}X.fromInt=Ep;function Dp(e,t){if(isNaN(e))return t?Rp:Lp;if(t){if(e<0)return Rp;if(e>=Pp)return Up}else{if(e<=-Fp)return Wp;if(e+1>=Fp)return Hp}return e<0?Dp(-e,t).neg():Z(e%Np|0,e/Np|0,t)}X.fromNumber=Dp;function Z(e,t,n){return new X(e,t,n)}X.fromBits=Z;var Op=Math.pow;function kp(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?Rp:Lp;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return kp(e.substring(1),t,n).neg();for(var i=Dp(Op(n,8)),a=Lp,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+s),n);if(s<8){var l=Dp(Op(n,s));a=a.mul(l).add(Dp(c))}else a=a.mul(i),a=a.add(Dp(c))}return a.unsigned=t,a}X.fromString=kp;function Ap(e,t){return typeof e==`number`?Dp(e,t):typeof e==`string`?kp(e,t):Z(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}X.fromValue=Ap;var jp=65536,Mp=1<<24,Np=jp*jp,Pp=Np*Np,Fp=Pp/2,Ip=Ep(Mp),Lp=Ep(0);X.ZERO=Lp;var Rp=Ep(0,!0);X.UZERO=Rp;var zp=Ep(1);X.ONE=zp;var Bp=Ep(1,!0);X.UONE=Bp;var Vp=Ep(-1);X.NEG_ONE=Vp;var Hp=Z(-1,2147483647,!1);X.MAX_VALUE=Hp;var Up=Z(-1,-1,!0);X.MAX_UNSIGNED_VALUE=Up;var Wp=Z(0,-2147483648,!1);X.MIN_VALUE=Wp;var Q=X.prototype;Q.toInt=function(){return this.unsigned?this.low>>>0:this.low},Q.toNumber=function(){return this.unsigned?(this.high>>>0)*Np+(this.low>>>0):this.high*Np+(this.low>>>0)},Q.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(Wp)){var t=Dp(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=Dp(Op(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),c=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return c+o;for(;c.length<6;)c=`0`+c;o=``+c+o}},Q.getHighBits=function(){return this.high},Q.getHighBitsUnsigned=function(){return this.high>>>0},Q.getLowBits=function(){return this.low},Q.getLowBitsUnsigned=function(){return this.low>>>0},Q.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Wp)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},Q.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},Q.isZero=function(){return this.high===0&&this.low===0},Q.eqz=Q.isZero,Q.isNegative=function(){return!this.unsigned&&this.high<0},Q.isPositive=function(){return this.unsigned||this.high>=0},Q.isOdd=function(){return(this.low&1)==1},Q.isEven=function(){return(this.low&1)==0},Q.equals=function(e){return Sp(e)||(e=Ap(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},Q.eq=Q.equals,Q.notEquals=function(e){return!this.eq(e)},Q.neq=Q.notEquals,Q.ne=Q.notEquals,Q.lessThan=function(e){return this.comp(e)<0},Q.lt=Q.lessThan,Q.lessThanOrEqual=function(e){return this.comp(e)<=0},Q.lte=Q.lessThanOrEqual,Q.le=Q.lessThanOrEqual,Q.greaterThan=function(e){return this.comp(e)>0},Q.gt=Q.greaterThan,Q.greaterThanOrEqual=function(e){return this.comp(e)>=0},Q.gte=Q.greaterThanOrEqual,Q.ge=Q.greaterThanOrEqual,Q.compare=function(e){if(Sp(e)||(e=Ap(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Q.comp=Q.compare,Q.negate=function(){return!this.unsigned&&this.eq(Wp)?Wp:this.not().add(zp)},Q.neg=Q.negate,Q.add=function(e){Sp(e)||(e=Ap(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i+c,d+=f>>>16,f&=65535,d+=r+s,u+=d>>>16,d&=65535,u+=n+o,l+=u>>>16,u&=65535,l+=t+a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.subtract=function(e){return Sp(e)||(e=Ap(e)),this.add(e.neg())},Q.sub=Q.subtract,Q.multiply=function(e){if(this.isZero())return this;if(Sp(e)||(e=Ap(e)),xp)return Z(xp.mul(this.low,this.high,e.low,e.high),xp.get_high(),this.unsigned);if(e.isZero())return this.unsigned?Rp:Lp;if(this.eq(Wp))return e.isOdd()?Wp:Lp;if(e.eq(Wp))return this.isOdd()?Wp:Lp;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Ip)&&e.lt(Ip))return Dp(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i*c,d+=f>>>16,f&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=i*s,u+=d>>>16,d&=65535,u+=n*c,l+=u>>>16,u&=65535,u+=r*s,l+=u>>>16,u&=65535,u+=i*o,l+=u>>>16,u&=65535,l+=t*c+n*s+r*o+i*a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.mul=Q.multiply,Q.divide=function(e){if(Sp(e)||(e=Ap(e)),e.isZero())throw Error(`division by zero`);if(xp)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:Z((this.unsigned?xp.div_u:xp.div_s)(this.low,this.high,e.low,e.high),xp.get_high(),this.unsigned);if(this.isZero())return this.unsigned?Rp:Lp;var t,n,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Rp;if(e.gt(this.shru(1)))return Bp;r=Rp}else{if(this.eq(Wp))return e.eq(zp)||e.eq(Vp)?Wp:e.eq(Wp)?zp:(t=this.shr(1).div(e).shl(1),t.eq(Lp)?e.isNegative()?zp:Vp:(n=this.sub(e.mul(t)),r=t.add(n.div(e)),r));if(e.eq(Wp))return this.unsigned?Rp:Lp;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=Lp}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(t)/Math.LN2),a=i<=48?1:Op(2,i-48),o=Dp(t),s=o.mul(e);s.isNegative()||s.gt(n);)t-=a,o=Dp(t,this.unsigned),s=o.mul(e);o.isZero()&&(o=zp),r=r.add(o),n=n.sub(s)}return r},Q.div=Q.divide,Q.modulo=function(e){return Sp(e)||(e=Ap(e)),xp?Z((this.unsigned?xp.rem_u:xp.rem_s)(this.low,this.high,e.low,e.high),xp.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Q.mod=Q.modulo,Q.rem=Q.modulo,Q.not=function(){return Z(~this.low,~this.high,this.unsigned)},Q.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Q.clz=Q.countLeadingZeros,Q.countTrailingZeros=function(){return this.low?Cp(this.low):Cp(this.high)+32},Q.ctz=Q.countTrailingZeros,Q.and=function(e){return Sp(e)||(e=Ap(e)),Z(this.low&e.low,this.high&e.high,this.unsigned)},Q.or=function(e){return Sp(e)||(e=Ap(e)),Z(this.low|e.low,this.high|e.high,this.unsigned)},Q.xor=function(e){return Sp(e)||(e=Ap(e)),Z(this.low^e.low,this.high^e.high,this.unsigned)},Q.shiftLeft=function(e){return Sp(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Z(0,this.low<<e-32,this.unsigned)},Q.shl=Q.shiftLeft,Q.shiftRight=function(e){return Sp(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Z(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Q.shr=Q.shiftRight,Q.shiftRightUnsigned=function(e){return Sp(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):Z(e===32?this.high:this.high>>>e-32,0,this.unsigned)},Q.shru=Q.shiftRightUnsigned,Q.shr_u=Q.shiftRightUnsigned,Q.rotateLeft=function(e){var t;return Sp(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,Z(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},Q.rotl=Q.rotateLeft,Q.rotateRight=function(e){var t;return Sp(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,Z(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},Q.rotr=Q.rotateRight,Q.toSigned=function(){return this.unsigned?Z(this.low,this.high,!1):this},Q.toUnsigned=function(){return this.unsigned?this:Z(this.low,this.high,!0)},Q.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Q.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},Q.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},X.fromBytes=function(e,t,n){return n?X.fromBytesLE(e,t):X.fromBytesBE(e,t)},X.fromBytesLE=function(e,t){return new X(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},X.fromBytesBE=function(e,t){return new X(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(X.fromBigInt=function(e,t){return Z(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},X.fromValue=function(e,t){return typeof e==`bigint`?X.fromBigInt(e,t):Ap(e,t)},Q.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var Gp=s(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),Kp=s((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(;t>0&&e.charAt(t-1)===`=`;)--t;return Math.floor(t*3/4)};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r[45]=62,r[95]=63,t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i};var o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,s=/[-_]/,c=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;t.test=function(e){return o.test(e)||s.test(e)&&c.test(e)}})),qp=s(((e,t)=>{t.exports=n;function n(){this._listeners=Object.create(null)}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners=Object.create(null);else if(t===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r}return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),Jp=s(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*Math.pow(2,-a)*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*Math.pow(2,a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*Math.pow(2,-c),e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),Yp=s(((e,t)=>{t.exports=n;function n(e){try{if(typeof require!=`function`)return null;var t=require(e);return t&&(t.length||Object.keys(t).length)?t:null}catch(e){return null}}})),Xp=s((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t};function r(e,t,r,i){for(var a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i}t.read=function(e,t,n){if(n-t<1)return``;for(var i=``,a=t,o,s,c,l,u,d,f,p;a+7<n;a+=8){if(o=e[a],s=e[a+1],c=e[a+2],l=e[a+3],u=e[a+4],d=e[a+5],f=e[a+6],p=e[a+7],(o|s|c|l|u|d|f|p)&128)return r(e,a,n,i);i+=String.fromCharCode(o,s,c,l,u,d,f,p)}for(;a<n;++a){if(o=e[a],o&128)return r(e,a,n,i);i+=String.fromCharCode(o)}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),Zp=s(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),Qp=s(((e,t)=>{t.exports=r;var n=em();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),$p=s(((e,t)=>{(function(n,r){function i(e){return e.default||e}typeof define==`function`&&define.amd?define([],function(){var e={};return r(e),i(e)}):typeof e==`object`?(r(e),typeof t==`object`&&(t.exports=i(e))):(function(){var e={};r(e),n.Long=i(e)})()})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:e,function(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;
|
|
39
|
-
/**
|
|
40
|
-
* @license
|
|
41
|
-
* Copyright 2009 The Closure Library Authors
|
|
42
|
-
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
|
43
|
-
*
|
|
44
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
45
|
-
* you may not use this file except in compliance with the License.
|
|
46
|
-
* You may obtain a copy of the License at
|
|
47
|
-
*
|
|
48
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
-
*
|
|
50
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
51
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
-
* See the License for the specific language governing permissions and
|
|
54
|
-
* limitations under the License.
|
|
55
|
-
*
|
|
56
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
57
|
-
*/
|
|
58
|
-
var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,`__isLong__`,{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return ee}else{if(e<=-_)return T;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var ee=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=ee;var T=l(0,-2147483648,!1);n.MIN_VALUE=T;var E=n.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},E.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(T)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},E.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},E.isZero=function(){return this.high===0&&this.low===0},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return(this.low&1)==1},E.isEven=function(){return(this.low&1)==0},E.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(x)},E.neg=E.negate,E.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},E.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(T))return e.isOdd()?T:y;if(e.eq(T))return this.isOdd()?T:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(T))return e.eq(x)||e.eq(C)?T:e.eq(T)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(T))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},E.div=E.divide,E.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return l(~this.low,~this.high,this.unsigned)},E.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},E.clz=E.countLeadingZeros,E.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},E.ctz=E.countTrailingZeros,E.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},E.rotl=E.rotateLeft,E.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},E.rotr=E.rotateRight,E.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(n.fromBigInt=function(e,t){return l(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},n.fromValue=function(e,t){return typeof e==`bigint`?n.fromBigInt(e,t):f(e,t)},E.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=n})})),em=s((e=>{var t=e;t.asPromise=Gp(),t.base64=Kp(),t.EventEmitter=qp(),t.float=Jp(),t.inquire=Yp(),t.utf8=Xp(),t.pool=Zp(),t.LongBits=Qp();function n(e){return e===`__proto__`||e===`prototype`||e===`constructor`}t.isUnsafeProperty=n,t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.global.Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||(function(){try{var e=$p();return e&&e.isLong?e:null}catch(e){return null}})(),t.key2Re=/^(?:true|false|0|1)$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)},t.longFromKey=function(e,n){return t.key64Re.test(e)&&!t.key32Re.test(e)?t.longFromHash(e,n):e},t.boolFromKey=function(e){return e===`true`||e===`1`};function r(e){var t=typeof arguments[arguments.length-1]==`boolean`,r=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var i=1;i<r;++i){var a=arguments[i];if(a)for(var o=Object.keys(a),s=0;s<o.length;++s)!n(o[s])&&(e[o[s]]===void 0||!t)&&(e[o[s]]=a[o[s]])}return e}t.merge=r,t.nestingLimit=32,t.recursionLimit=100,t.makeProp=function(e,t,n){Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:n===void 0?!0:n,configurable:!0,writable:!0})},t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),n&&r(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=i,t.ProtocolError=i(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),tm=s(((e,t)=>{t.exports=u;var n=em(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function m(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function h(e,t){this.len=e,this.next=void 0,this.val=t}h.prototype=Object.create(s.prototype),h.prototype.fn=m,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return(e|=0)<0?this._push(g,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function g(e,t,n){for(var r=e.lo,i=e.hi;i;)t[n++]=r&127|128,r=(r>>>7|i<<25)>>>0,i>>>=7;for(;r>127;)t[n++]=r&127|128,r>>>=7;t[n++]=r}u.prototype.uint64=function(e){var t=i.from(e);return this._push(g,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(g,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function _(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(_,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(_,4,t.lo)._push(_,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var v=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},u.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(v,t,e):this},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(t===e.length?p:o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){return this.finishInto(this.constructor.alloc(this.len),0)},u.prototype.finishInto=function(e,t){t===void 0&&(t=0);for(var n=this.head.next,r=t;n;)n.fn(n.val,e,r),r+=n.len,n=n.next;return e},u._configure=function(e){r=e,u.create=d(),r._configure()}})),nm=s(((e,t)=>{t.exports=i;var n=tm();(i.prototype=Object.create(n.prototype)).constructor=i;var r=em();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(i.writeBytesBuffer,t,e):this};function a(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function o(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(t===e.length&&t<40?a:o,t,e),this},i._configure()})),rm=s(((e,t)=>{t.exports=s;var n=em(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.raw=function(e,t){return Array.isArray(this.buf)?this.buf.slice(e,t):e===t?new this.buf.constructor(0):this._slice.call(this.buf,e,t)},s.prototype.uint32=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128)||(n=(n|(e[t]&15)<<28)>>>0,e[t++]<128))return this.pos=t,n;for(var r=0;r<5;++r){if(t>=this.len)throw this.pos=t,o(this);if(e[t++]<128)return this.pos=t,n}throw this.pos=t,Error(`invalid varint encoding`)},s.prototype.tag=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128))return this.pos=t,n;if(n=(n|(e[t]&15)<<28)>>>0,e[t]<128&&!(e[t]&112))return this.pos=t+1,n;throw this.pos=t+1,Error(`invalid tag encoding`)},s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){for(var e=!1,t,n=0;n<10;++n){if(this.pos>=this.len)throw o(this);if(t=this.buf[this.pos++],t&127&&(e=!0),t<128)return e}throw Error(`invalid varint encoding`)};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,this.raw(t,n)},s.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,a.read(this.buf,t,n)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.recursionLimit=n.recursionLimit,s.prototype.skipType=function(e,t,n){if(t===void 0&&(t=0),t>s.recursionLimit)throw Error(`max depth exceeded`);if(n===0)throw Error(`illegal tag: field number 0`);switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),i=r>>>3;if(e=r&7,!i)throw Error(`illegal tag: field number 0`);if(e===4){if(n!==void 0&&i!==n)throw Error(`invalid end group tag`);break}this.skipType(e,t+1,i)}break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),im=s(((e,t)=>{t.exports=i;var n=rm();(i.prototype=Object.create(n.prototype)).constructor=i;var r=em();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.raw=function(e,t){return e===t?r.Buffer.alloc(0):this._slice.call(this.buf,e,t)},i.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw RangeError(`index out of range: `+this.pos+` + `+e+` > `+this.len);return this.pos=n,this.buf.utf8Slice?this.buf.utf8Slice(t,n):this.buf.toString(`utf-8`,t,n)},i._configure()})),am=s(((e,t)=>{t.exports=r;var n=em();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),om=s((e=>{var t=e;t.Service=am()})),sm=s(((e,t)=>{t.exports={}})),cm=s((e=>{var t=e;t.build=`minimal`,t.Writer=tm(),t.BufferWriter=nm(),t.Reader=rm(),t.BufferReader=im(),t.util=em(),t.rpc=om(),t.roots=sm(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),$=l(s(((e,t)=>{t.exports=cm()}))(),1);let lm=[`resource`,`getSessionId`,`tracer`,`url`,`debug`,`apiKey`,`headers`];var um=class{constructor(e,t){z(this,`logs`,[]),z(this,`scheduledDelayMillis`,void 0),z(this,`timeout`,void 0),z(this,`exporter`,void 0),z(this,`lastBatchSent`,0),this.scheduledDelayMillis=(t==null?void 0:t.scheduledDelayMillis)||5e3,this.exporter=e,typeof window<`u`&&window.addEventListener(`unload`,()=>{this._flushAll()})}onLog(e){this.logs.push(e),this.timeout===void 0&&(this.timeout=setTimeout(()=>{this.timeout=void 0,this._flushAll()},this.scheduledDelayMillis))}_flushAll(){this.lastBatchSent=Date.now(),I.with(jt(I.active()),()=>{let e=this.logs.splice(0,this.logs.length);this.exporter.export(e)})}};function dm(e,t,n){return{body:e,timeUnixNano:t,attributes:n}}function fm(){return Reflect.get(globalThis,`Buffer`)||void 0}function pm(e){let t=fm();if(t)return Uint8Array.from(t.from(e,`base64`));let n=globalThis.atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}function mm(e){let t=fm();if(t)return t.from(e).toString(`base64`);let n=[];return e.forEach(e=>{n.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(n.join(``))}function hm(){return{stringValue:void 0,boolValue:void 0,intValue:void 0,doubleValue:void 0,arrayValue:void 0,kvlistValue:void 0,bytesValue:void 0}}let gm={encode(e,t=$.default.Writer.create()){return e.stringValue!==void 0&&t.uint32(10).string(e.stringValue),e.boolValue!==void 0&&t.uint32(16).bool(e.boolValue),e.intValue!==void 0&&t.uint32(24).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(33).double(e.doubleValue),e.arrayValue!==void 0&&vm.encode(e.arrayValue,t.uint32(42).fork()).ldelim(),e.kvlistValue!==void 0&&bm.encode(e.kvlistValue,t.uint32(50).fork()).ldelim(),e.bytesValue!==void 0&&t.uint32(58).bytes(e.bytesValue),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.stringValue=n.string();continue;case 2:if(e!==16)break;i.boolValue=n.bool();continue;case 3:if(e!==24)break;i.intValue=Dm(n.int64());continue;case 4:if(e!==33)break;i.doubleValue=n.double();continue;case 5:if(e!==42)break;i.arrayValue=vm.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.kvlistValue=bm.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.bytesValue=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{stringValue:Om(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:Om(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,intValue:Om(e.intValue)?globalThis.Number(e.intValue):void 0,doubleValue:Om(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,arrayValue:Om(e.arrayValue)?vm.fromJSON(e.arrayValue):void 0,kvlistValue:Om(e.kvlistValue)?bm.fromJSON(e.kvlistValue):void 0,bytesValue:Om(e.bytesValue)?pm(e.bytesValue):void 0}},toJSON(e){let t={};return e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.arrayValue!==void 0&&(t.arrayValue=vm.toJSON(e.arrayValue)),e.kvlistValue!==void 0&&(t.kvlistValue=bm.toJSON(e.kvlistValue)),e.bytesValue!==void 0&&(t.bytesValue=mm(e.bytesValue)),t},create(e){return gm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a;let o=hm();return o.stringValue=(t=e.stringValue)==null?void 0:t,o.boolValue=(n=e.boolValue)==null?void 0:n,o.intValue=(r=e.intValue)==null?void 0:r,o.doubleValue=(i=e.doubleValue)==null?void 0:i,o.arrayValue=e.arrayValue!==void 0&&e.arrayValue!==null?vm.fromPartial(e.arrayValue):void 0,o.kvlistValue=e.kvlistValue!==void 0&&e.kvlistValue!==null?bm.fromPartial(e.kvlistValue):void 0,o.bytesValue=(a=e.bytesValue)==null?void 0:a,o}};function _m(){return{values:[]}}let vm={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)gm.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_m();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(gm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>gm.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>gm.toJSON(e))),n},create(e){return vm.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=_m();return n.values=((t=e.values)==null?void 0:t.map(e=>gm.fromPartial(e)))||[],n}};function ym(){return{values:[]}}let bm={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Sm.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ym();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Sm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Sm.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Sm.toJSON(e))),n},create(e){return bm.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=ym();return n.values=((t=e.values)==null?void 0:t.map(e=>Sm.fromPartial(e)))||[],n}};function xm(){return{key:``,value:void 0}}let Sm={encode(e,t=$.default.Writer.create()){return e.key!==void 0&&e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&gm.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=xm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=gm.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{key:Om(e.key)?globalThis.String(e.key):``,value:Om(e.value)?gm.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==void 0&&e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=gm.toJSON(e.value)),t},create(e){return Sm.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=xm();return n.key=(t=e.key)==null?``:t,n.value=e.value!==void 0&&e.value!==null?gm.fromPartial(e.value):void 0,n}};function Cm(){return{name:``,version:``}}let wm={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Cm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:Om(e.name)?globalThis.String(e.name):``,version:Om(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return wm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Cm();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Tm(){return{name:``,version:``}}let Em={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Tm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:Om(e.name)?globalThis.String(e.name):``,version:Om(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Em.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Tm();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Dm(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function Om(e){return e!=null}function km(){return{attributes:[],droppedAttributesCount:0}}let Am={encode(e,t=$.default.Writer.create()){if(e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Sm.encode(n,t.uint32(10).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(16).uint32(e.droppedAttributesCount),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=km();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.attributes.push(Sm.decode(n,n.uint32()));continue;case 2:if(e!==16)break;i.droppedAttributesCount=n.uint32();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Sm.fromJSON(e)):[],droppedAttributesCount:jm(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0}},toJSON(e){var t;let n={};return(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Sm.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),n},create(e){return Am.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=km();return r.attributes=((t=e.attributes)==null?void 0:t.map(e=>Sm.fromPartial(e)))||[],r.droppedAttributesCount=(n=e.droppedAttributesCount)==null?0:n,r}};function jm(e){return e!=null}function Mm(e){switch(e){case 0:case`SEVERITY_NUMBER_UNSPECIFIED`:return 0;case 1:case`SEVERITY_NUMBER_TRACE`:return 1;case 2:case`SEVERITY_NUMBER_TRACE2`:return 2;case 3:case`SEVERITY_NUMBER_TRACE3`:return 3;case 4:case`SEVERITY_NUMBER_TRACE4`:return 4;case 5:case`SEVERITY_NUMBER_DEBUG`:return 5;case 6:case`SEVERITY_NUMBER_DEBUG2`:return 6;case 7:case`SEVERITY_NUMBER_DEBUG3`:return 7;case 8:case`SEVERITY_NUMBER_DEBUG4`:return 8;case 9:case`SEVERITY_NUMBER_INFO`:return 9;case 10:case`SEVERITY_NUMBER_INFO2`:return 10;case 11:case`SEVERITY_NUMBER_INFO3`:return 11;case 12:case`SEVERITY_NUMBER_INFO4`:return 12;case 13:case`SEVERITY_NUMBER_WARN`:return 13;case 14:case`SEVERITY_NUMBER_WARN2`:return 14;case 15:case`SEVERITY_NUMBER_WARN3`:return 15;case 16:case`SEVERITY_NUMBER_WARN4`:return 16;case 17:case`SEVERITY_NUMBER_ERROR`:return 17;case 18:case`SEVERITY_NUMBER_ERROR2`:return 18;case 19:case`SEVERITY_NUMBER_ERROR3`:return 19;case 20:case`SEVERITY_NUMBER_ERROR4`:return 20;case 21:case`SEVERITY_NUMBER_FATAL`:return 21;case 22:case`SEVERITY_NUMBER_FATAL2`:return 22;case 23:case`SEVERITY_NUMBER_FATAL3`:return 23;case 24:case`SEVERITY_NUMBER_FATAL4`:return 24;default:return-1}}function Nm(e){switch(e){case 0:return`SEVERITY_NUMBER_UNSPECIFIED`;case 1:return`SEVERITY_NUMBER_TRACE`;case 2:return`SEVERITY_NUMBER_TRACE2`;case 3:return`SEVERITY_NUMBER_TRACE3`;case 4:return`SEVERITY_NUMBER_TRACE4`;case 5:return`SEVERITY_NUMBER_DEBUG`;case 6:return`SEVERITY_NUMBER_DEBUG2`;case 7:return`SEVERITY_NUMBER_DEBUG3`;case 8:return`SEVERITY_NUMBER_DEBUG4`;case 9:return`SEVERITY_NUMBER_INFO`;case 10:return`SEVERITY_NUMBER_INFO2`;case 11:return`SEVERITY_NUMBER_INFO3`;case 12:return`SEVERITY_NUMBER_INFO4`;case 13:return`SEVERITY_NUMBER_WARN`;case 14:return`SEVERITY_NUMBER_WARN2`;case 15:return`SEVERITY_NUMBER_WARN3`;case 16:return`SEVERITY_NUMBER_WARN4`;case 17:return`SEVERITY_NUMBER_ERROR`;case 18:return`SEVERITY_NUMBER_ERROR2`;case 19:return`SEVERITY_NUMBER_ERROR3`;case 20:return`SEVERITY_NUMBER_ERROR4`;case 21:return`SEVERITY_NUMBER_FATAL`;case 22:return`SEVERITY_NUMBER_FATAL2`;case 23:return`SEVERITY_NUMBER_FATAL3`;case 24:return`SEVERITY_NUMBER_FATAL4`;default:return`UNRECOGNIZED`}}function Pm(){return{resourceLogs:[]}}let Fm={encode(e,t=$.default.Writer.create()){if(e.resourceLogs!==void 0&&e.resourceLogs.length!==0)for(let n of e.resourceLogs)Lm.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Pm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resourceLogs.push(Lm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resourceLogs:globalThis.Array.isArray(e==null?void 0:e.resourceLogs)?e.resourceLogs.map(e=>Lm.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.resourceLogs)!=null&&t.length&&(n.resourceLogs=e.resourceLogs.map(e=>Lm.toJSON(e))),n},create(e){return Fm.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Pm();return n.resourceLogs=((t=e.resourceLogs)==null?void 0:t.map(e=>Lm.fromPartial(e)))||[],n}};function Im(){return{resource:void 0,scopeLogs:[],instrumentationLibraryLogs:[],schemaUrl:``}}let Lm={encode(e,t=$.default.Writer.create()){if(e.resource!==void 0&&Am.encode(e.resource,t.uint32(10).fork()).ldelim(),e.scopeLogs!==void 0&&e.scopeLogs.length!==0)for(let n of e.scopeLogs)zm.encode(n,t.uint32(18).fork()).ldelim();if(e.instrumentationLibraryLogs!==void 0&&e.instrumentationLibraryLogs.length!==0)for(let n of e.instrumentationLibraryLogs)Vm.encode(n,t.uint32(8002).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Im();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resource=Am.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.scopeLogs.push(zm.decode(n,n.uint32()));continue;case 1e3:if(e!==8002)break;i.instrumentationLibraryLogs.push(Vm.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resource:Gm(e.resource)?Am.fromJSON(e.resource):void 0,scopeLogs:globalThis.Array.isArray(e==null?void 0:e.scopeLogs)?e.scopeLogs.map(e=>zm.fromJSON(e)):[],instrumentationLibraryLogs:globalThis.Array.isArray(e==null?void 0:e.instrumentationLibraryLogs)?e.instrumentationLibraryLogs.map(e=>Vm.fromJSON(e)):[],schemaUrl:Gm(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t,n;let r={};return e.resource!==void 0&&(r.resource=Am.toJSON(e.resource)),(t=e.scopeLogs)!=null&&t.length&&(r.scopeLogs=e.scopeLogs.map(e=>zm.toJSON(e))),(n=e.instrumentationLibraryLogs)!=null&&n.length&&(r.instrumentationLibraryLogs=e.instrumentationLibraryLogs.map(e=>Vm.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(r.schemaUrl=e.schemaUrl),r},create(e){return Lm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r;let i=Im();return i.resource=e.resource!==void 0&&e.resource!==null?Am.fromPartial(e.resource):void 0,i.scopeLogs=((t=e.scopeLogs)==null?void 0:t.map(e=>zm.fromPartial(e)))||[],i.instrumentationLibraryLogs=((n=e.instrumentationLibraryLogs)==null?void 0:n.map(e=>Vm.fromPartial(e)))||[],i.schemaUrl=(r=e.schemaUrl)==null?``:r,i}};function Rm(){return{scope:void 0,logRecords:[],schemaUrl:``}}let zm={encode(e,t=$.default.Writer.create()){if(e.scope!==void 0&&Em.encode(e.scope,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)Um.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Rm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.scope=Em.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(Um.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{scope:Gm(e.scope)?Em.fromJSON(e.scope):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>Um.fromJSON(e)):[],schemaUrl:Gm(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.scope!==void 0&&(n.scope=Em.toJSON(e.scope)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>Um.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return zm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Rm();return r.scope=e.scope!==void 0&&e.scope!==null?Em.fromPartial(e.scope):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>Um.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function Bm(){return{instrumentationLibrary:void 0,logRecords:[],schemaUrl:``}}let Vm={encode(e,t=$.default.Writer.create()){if(e.instrumentationLibrary!==void 0&&wm.encode(e.instrumentationLibrary,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)Um.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Bm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.instrumentationLibrary=wm.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(Um.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{instrumentationLibrary:Gm(e.instrumentationLibrary)?wm.fromJSON(e.instrumentationLibrary):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>Um.fromJSON(e)):[],schemaUrl:Gm(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.instrumentationLibrary!==void 0&&(n.instrumentationLibrary=wm.toJSON(e.instrumentationLibrary)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>Um.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return Vm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Bm();return r.instrumentationLibrary=e.instrumentationLibrary!==void 0&&e.instrumentationLibrary!==null?wm.fromPartial(e.instrumentationLibrary):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>Um.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function Hm(){return{timeUnixNano:0,observedTimeUnixNano:0,severityNumber:0,severityText:``,body:void 0,attributes:[],droppedAttributesCount:0,flags:0,traceId:new Uint8Array,spanId:new Uint8Array}}let Um={encode(e,t=$.default.Writer.create()){if(e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&t.uint32(9).fixed64(e.timeUnixNano),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&t.uint32(89).fixed64(e.observedTimeUnixNano),e.severityNumber!==void 0&&e.severityNumber!==0&&t.uint32(16).int32(e.severityNumber),e.severityText!==void 0&&e.severityText!==``&&t.uint32(26).string(e.severityText),e.body!==void 0&&gm.encode(e.body,t.uint32(42).fork()).ldelim(),e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Sm.encode(n,t.uint32(50).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(56).uint32(e.droppedAttributesCount),e.flags!==void 0&&e.flags!==0&&t.uint32(69).fixed32(e.flags),e.traceId!==void 0&&e.traceId.length!==0&&t.uint32(74).bytes(e.traceId),e.spanId!==void 0&&e.spanId.length!==0&&t.uint32(82).bytes(e.spanId),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Hm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==9)break;i.timeUnixNano=Wm(n.fixed64());continue;case 11:if(e!==89)break;i.observedTimeUnixNano=Wm(n.fixed64());continue;case 2:if(e!==16)break;i.severityNumber=n.int32();continue;case 3:if(e!==26)break;i.severityText=n.string();continue;case 5:if(e!==42)break;i.body=gm.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.attributes.push(Sm.decode(n,n.uint32()));continue;case 7:if(e!==56)break;i.droppedAttributesCount=n.uint32();continue;case 8:if(e!==69)break;i.flags=n.fixed32();continue;case 9:if(e!==74)break;i.traceId=n.bytes();continue;case 10:if(e!==82)break;i.spanId=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{timeUnixNano:Gm(e.timeUnixNano)?globalThis.Number(e.timeUnixNano):0,observedTimeUnixNano:Gm(e.observedTimeUnixNano)?globalThis.Number(e.observedTimeUnixNano):0,severityNumber:Gm(e.severityNumber)?Mm(e.severityNumber):0,severityText:Gm(e.severityText)?globalThis.String(e.severityText):``,body:Gm(e.body)?gm.fromJSON(e.body):void 0,attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Sm.fromJSON(e)):[],droppedAttributesCount:Gm(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0,flags:Gm(e.flags)?globalThis.Number(e.flags):0,traceId:Gm(e.traceId)?pm(e.traceId):new Uint8Array,spanId:Gm(e.spanId)?pm(e.spanId):new Uint8Array}},toJSON(e){var t;let n={};return e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&(n.timeUnixNano=Math.round(e.timeUnixNano)),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&(n.observedTimeUnixNano=Math.round(e.observedTimeUnixNano)),e.severityNumber!==void 0&&e.severityNumber!==0&&(n.severityNumber=Nm(e.severityNumber)),e.severityText!==void 0&&e.severityText!==``&&(n.severityText=e.severityText),e.body!==void 0&&(n.body=gm.toJSON(e.body)),(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Sm.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),e.flags!==void 0&&e.flags!==0&&(n.flags=Math.round(e.flags)),e.traceId!==void 0&&e.traceId.length!==0&&(n.traceId=mm(e.traceId)),e.spanId!==void 0&&e.spanId.length!==0&&(n.spanId=mm(e.spanId)),n},create(e){return Um.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a,o,s,c,l;let u=Hm();return u.timeUnixNano=(t=e.timeUnixNano)==null?0:t,u.observedTimeUnixNano=(n=e.observedTimeUnixNano)==null?0:n,u.severityNumber=(r=e.severityNumber)==null?0:r,u.severityText=(i=e.severityText)==null?``:i,u.body=e.body!==void 0&&e.body!==null?gm.fromPartial(e.body):void 0,u.attributes=((a=e.attributes)==null?void 0:a.map(e=>Sm.fromPartial(e)))||[],u.droppedAttributesCount=(o=e.droppedAttributesCount)==null?0:o,u.flags=(s=e.flags)==null?0:s,u.traceId=(c=e.traceId)==null?new Uint8Array:c,u.spanId=(l=e.spanId)==null?new Uint8Array:l,u}};function Wm(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function Gm(e){return e!=null}let Km=`0.0.12`,qm={"Content-Type":`application/x-protobuf`,"Content-Encoding":`gzip`},Jm=Fm;function Ym(e){return Array.isArray(e)}function Xm(e){return!!e&&typeof e==`object`&&!Ym(e)}function Zm(e){return Xm(e)?{kvlistValue:{values:Object.entries(e).map(([e,t])=>({key:e,value:Zm(t)}))}}:Ym(e)?{arrayValue:{values:e.map(e=>Zm(e))}}:typeof e==`string`?{stringValue:e}:typeof e==`number`?{doubleValue:e}:typeof e==`boolean`?{boolValue:e}:{}}var Qm=class{constructor(e){z(this,`config`,void 0),this.config=e}constructLogData(e){var t,n,r;return{resourceLogs:[{resource:{attributes:(t=Zm(H({},Object.fromEntries(Object.entries((n=(r=this.config.resource)==null?void 0:r.attributes)==null?{}:n)))))==null||(t=t.kvlistValue)==null?void 0:t.values},scopeLogs:[{scope:{name:`rum.rr-web`,version:Km},logRecords:e.map(e=>{var t,n;return{body:Zm((t=e.body)==null?null:t),timeUnixNano:e.timeUnixNano*1e6,attributes:(n=Zm(e.attributes||{}).kvlistValue)==null?void 0:n.values}})}]}]}}export(e){if(e.length===0)return;let t=this.constructLogData(e);this.config.debug&&console.log(`otlp request`,t);let n=yp(Jm.encode(t).finish()),r=this.config.headers?Object.assign({},qm,this.config.headers):qm;fetch(this.config.beaconUrl,{method:`POST`,body:new Uint8Array(n),headers:r}).catch(()=>{})}};function $m(e){if(e.length>5e6){let t=e.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim);for(let n of t)e=n[1].toLocaleLowerCase().slice(0,6)===`image/`?e.replace(n[0],`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==`):e.replace(n[0],``)}return e}var eh=class{constructor(e,t={}){var n,r;z(this,`bucketSize`,100),z(this,`refillRate`,10),z(this,`mutationBuckets`,{}),z(this,`loggedTracker`,{}),z(this,`refillBuckets`,()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})}),z(this,`getNodeOrRelevantParent`,e=>{let t=this.rrweb.mirror.getNode(e);if((t==null?void 0:t.nodeName)!==`svg`&&t instanceof Element){let e=t.closest(`svg`);if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]}),z(this,`numberOfChanges`,e=>{var t,n,r,i,a,o,s,c;return((t=(n=e.removes)==null?void 0:n.length)==null?0:t)+((r=(i=e.attributes)==null?void 0:i.length)==null?0:r)+((a=(o=e.texts)==null?void 0:o.length)==null?0:a)+((s=(c=e.adds)==null?void 0:c.length)==null?0:s)}),z(this,`throttleMutations`,e=>{if(e.type!==3||e.data.source!==0)return e;let t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t;let[n,r]=this.getNodeOrRelevantParent(e.id);if(this.mutationBuckets[n]===0)return!1;if(this.mutationBuckets[n]=(t=this.mutationBuckets[n])==null?this.bucketSize:t,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),this.mutationBuckets[n]===0&&!this.loggedTracker[n]){var i,a;this.loggedTracker[n]=!0,(i=(a=this.options).onBlockedNode)==null||i.call(a,n,r)}return e}));let r=this.numberOfChanges(t);if(!(r===0&&n!==r))return e}),this.rrweb=e,this.options=t,this.refillRate=(n=this.options.refillRate)==null?this.refillRate:n,this.bucketSize=(r=this.options.bucketSize)==null?this.bucketSize:r,setInterval(()=>{this.refillBuckets()},1e3)}};let th=950*1024,nh=new TextEncoder,rh=new TextDecoder,ih=!1,ah,oh,sh=0,ch=!1,lh=1,uh=1,dh,fh,ph,mh={get inited(){return!!ih},isRecording(){return!!ih&&!ch},setEnabled(e){e?mh.resume():mh.stop()},init(e){var t,n;if(ih)return;if(typeof window>`u`){console.error(`Session recorder can't be ran in non-browser environments`);return}let{resource:r,getSessionId:i,tracer:a,url:o,debug:s,apiKey:c,headers:l}=e,u=Ti(e,lm);fh=i,ah=a;let d=ah.startSpan(`record init`);if(!d.isRecording())return;d.end();let f=o,p=H({},l);c&&(p.authorization=c);let m=new um(new Qm({beaconUrl:f,debug:s,headers:p,resource:r}),{});oh=(t=i())==null?``:t,sh=Date.now(),dh=(n=dh)==null?new eh(Pf,{onBlockedNode:(e,t)=>{let n=`OpenTelemetry Session Recorder: Rate limiting recording mutations on node ${e}. This can be due to excessive animations.`,r=Date.now(),i=ah.startSpan(`console.warn`,{kind:Je.INTERNAL,startTime:r});i.setAttribute(`component`,`console`),i.setAttribute(`level`,`warn`),i.setAttribute(`message`,n),i.end(r),s&&console.warn(n,t),clearTimeout(ph),ph=setTimeout(()=>{Pf.takeFullSnapshot()},1e3)}}):n,ih=Pf(H(H({maskAllInputs:!0,maskTextSelector:`*`},u),{},{emit(e){var t;if(ch)return;let n=(t=fh==null?void 0:fh())==null?``:t;if(n!==oh){if(document.hidden)return;oh=n,sh=Date.now(),lh=1,uh=1,Pf.takeFullSnapshot()}if(e.timestamp>sh+1446e4)return;let r=dh?dh.throttleMutations(e):e;if(!r)return;let i=r.timestamp,a=lh++,o=nh.encode($m(JSON.stringify(r))),c=Math.ceil(o.byteLength/th);for(let e=0;e<c;e++){let t=e*th,n=(e+1)*th,r=dm(rh.decode(o.slice(t,n)),i,{"rr-web.offset":uh++,"rr-web.event":a,"rr-web.chunk":e+1,"rr-web.total-chunks":c});s&&console.log(r),m.onLog(r)}}}))},resume(){if(!ih)return;let e=ch;ch=!1,e||(Pf.takeFullSnapshot(),ah.startSpan(`record resume`).end())},stop(){ih&&(ch&&ah.startSpan(`record stop`).end(),ch=!0)},deinit(){ih&&(ih(),ih=!1,fh=void 0)}},hh={isRecording:()=>!1,setEnabled:()=>{}};function gh({resource:e,spanSessionManager:t,tracerProvider:n,appID:r,userID:i,mxlDataURL:a,sessionRecorder:o}){return H({resource:e,getSessionId:()=>t.getSessionId(),tracer:n.getTracer(`mxl.session-recorder`,Km),url:Tl(r,a),headers:gc(r,i)},o)}function _h(e){let t=()=>gh(e);return e.recordUserSessions?(mh.init(t()),{isRecording:()=>mh.isRecording(),setEnabled:e=>{mh.setEnabled(e)}}):{isRecording:()=>mh.isRecording(),setEnabled:e=>{e?mh.inited?mh.resume():mh.init(t()):mh.inited&&mh.stop()}}}let vh=e=>{if(e!==void 0){if(typeof e!=`string`)throw Error(`appID must be a string, or omitted if not using MXL. Received ${String(e)}`);return e}},yh=e=>{if(e===void 0){let e=`MXLAppVersionX.X.X`;return e===``?`unspecified`:e}if(typeof e!=`string`)throw Error(`if appVersion is specified, it must be a string. Received ${String(e)}`);let t=e.trim();if(t===``)throw Error(`if appVersion is specified, it cannot be an empty string.`);return t},bh=({appID:e,appVersion:t,resource:n=wr(),spanExporters:r=[],logExporters:i=[],spanProcessors:a=[],propagator:o=null,defaultInstrumentationConfig:s,instrumentations:c=[],contextManager:l=null,logProcessors:u=[],attributeScrubbers:d=[],enableDefaultAttributeScrubbing:f=!0,additionalQueryParamsToScrub:p=[],logLevel:m=S.ERROR,mxlDataURL:h,mxlConfigURL:g,diagLogger:_=L.createComponentLogger({namespace:`mxl-sdk`}),dynamicSDKConfigManager:v,dynamicSDKConfig:y,registerGlobally:b=!0,blockNetworkSpanForwarding:x=!1,restrictedProtocols:C=new Set([`file:`]),useDocumentTitleAsPageLabel:w=!0,recordUserSessions:ee=!0,sessionRecorder:T,serviceName:E}={})=>{try{var D,te;if(b){let e=Xl.registered();if(e!==null)return _.warn(`SDK has already been successfully initialized, skipping this invocation of initSDK`),e}if(L.setLogger(new ne,{logLevel:m}),typeof window>`u`)return _.warn(`browser not detected, skipping initialization`),!1;let S=new Ci,k=S.getNowMillis(),A=vh(e),j=yh(t),re=A!==void 0;if(!re&&!i.length&&!r.length)throw Error(`when appID is omitted, at least one logExporter or spanExporter must be set`);if(C.has(window.location.protocol))throw Error(`not initializing due to restricted protocol: ${window.location.protocol}`);if(re&&typeof CompressionStream>`u`)throw Error(`CompressionStream is not supported in this browser and required for data compression.`);let ie=!b&&e,M=ie?new xi(e,window.localStorage):window.localStorage,ae=ie?new xi(e,window.sessionStorage):window.sessionStorage,N=xh({registerGlobally:b,sdkLocalStorage:M}),P=N.getMXLUserId();if(re&&!P)throw Error(`userID is required when using MXL exporter`);let F=H({},y),oe=v==null?new Co({appID:A,appVersion:j,mxlConfigURL:g,defaultConfig:F,deviceId:P,storage:M}):v;oe.refreshRemoteConfig();let se=_o({serviceName:(D=(te=oe.resolveApplicationServiceName)==null?void 0:te.call(oe,E))==null?(()=>{var e;return(E==null?void 0:E.trim())||((e=oe.getConfig().serviceName)==null?void 0:e.trim())||go})():D}).merge(n).merge(vo({diagLogger:_,appVersion:j,pageSessionStorage:ae})),ce=new Ao({dynamicConfigManager:oe,deviceId:P,blockNetworkSpanForwarding:x});if(!ce.isSDKEnabled())return _.debug(`SDK is disabled, skipping initialization.`),!1;let le=Si({featureManager:ce,diag:_,registerGlobally:b,defaultInstrumentationConfig:s,propagator:o}),ue=new Eo(wo),de=[...f?Yl(p):[],...d],fe=Sh({limitManager:ue,registerGlobally:b,sdkLocalStorage:M,sdkSessionStorage:ae}),pe,me;if(re){var O;pe=new zl({resource:se,exporter:new kl({appID:A,mxlDataURL:h,userID:P}),limitManager:ue,storedSpansExpireTimeoutMS:s==null||(O=s[`session-visibility`])==null?void 0:O.storedSpansExpireTimeoutMS,storage:M,spanSessionManager:fe}),me=new fc(new El({appID:A,mxlDataURL:h,userID:P}))}let he=Th({useDocumentTitleAsPageLabel:w,registerGlobally:b}),{tracerProvider:ge,mxlTraceManager:_e}=Ch({resource:se,spanSessionManager:fe,userManager:N,spanExporters:r,spanProcessors:a,propagator:le?new Gl:o,contextManager:l,attributeScrubbers:de,registerGlobally:b,mxlSpanProcessor:pe,pageManager:he});fe.setTracerProvider(ge);let{loggerProvider:ve,mxlLogManager:ye}=wh({resource:se,userManager:N,logExporters:i,logProcessors:u,spanSessionManager:fe,limitManager:ue,attributeScrubbers:de,registerGlobally:b,mxlLogProcessor:me,sdkLocalStorage:M,pageManager:he});fe.startSessionSpan({reason:`init`}),Ta(b?{instrumentations:[ju(s,{spanSessionManager:fe,pageManager:he,limitManager:ue}),...c]}:{tracerProvider:ge,loggerProvider:ve,instrumentations:[ju(s,{logManager:ye,spanSessionManager:fe,pageManager:he,limitManager:ue}),...c]});let be=typeof window<`u`&&window.__MXL_DISABLE_SESSION_RECORDER===!0,xe=re&&A&&P&&!be?_h({resource:se,spanSessionManager:fe,tracerProvider:ge,appID:A,userID:P,mxlDataURL:h,recordUserSessions:ee,sessionRecorder:T}):hh;_.info(`successfully initialized the SDK`);let Se={setDynamicConfig:e=>{oe.setConfig(e)},flush:function(){var e=B(function*(){yield ge.forceFlush(),yield ve.forceFlush()});return function(){return e.apply(this,arguments)}}(),log:ye,trace:_e,session:fe,user:N,page:he,sessionRecording:xe};return b&&Xl.register(Se),fe.recordSDKStartupDuration(S.getNowMillis()-k),Se}catch(e){let t=e instanceof Error?e.message:`Unknown error.`;return _.error(`failed to initialize the SDK: ${t}`),!1}},xh=({registerGlobally:e,sdkLocalStorage:t})=>{let n=new Vo({storage:t});return e&&fa.setGlobalUserManager(n),n},Sh=({limitManager:e,registerGlobally:t,sdkLocalStorage:n,sdkSessionStorage:r})=>{let i=new Po({limitManager:e,storage:n,sessionStorage:r});return t&&Zi.setGlobalSessionManager(i),i},Ch=({resource:e,spanSessionManager:t,userManager:n,spanExporters:r,spanProcessors:i=[],propagator:a=null,contextManager:o=null,attributeScrubbers:s,registerGlobally:c,mxlSpanProcessor:l,pageManager:u})=>{let d=[...i,mc(t),new jl,new Il,new Wl({userManager:n}),new Vl({pageManager:u}),new Hl({attributeScrubbers:s})];r==null||r.forEach(e=>{d.push(new Hr(e))}),l&&d.push(l);let f=new oi({resource:e,spanProcessors:d,spanLimits:{attributeCountLimit:wo.maxAllowed.session_property*2,eventCountLimit:wo.maxAllowed.breadcrumb*2}}),p=new Fo({tracerProvider:c?void 0:f});return c&&(aa.setGlobalTraceManager(p),f.register({contextManager:o||new ri,propagator:a})),{tracerProvider:f,mxlTraceManager:p}},wh=({resource:e,userManager:t,logExporters:n,logProcessors:r,spanSessionManager:i,limitManager:a,attributeScrubbers:o,registerGlobally:s,mxlLogProcessor:c,sdkLocalStorage:l,pageManager:u})=>{let d=[...r,new Ml({spanSessionManager:i}),new Al,new Pl,new Ul({userManager:t}),new Nl({attributeScrubbers:o}),new Bl({pageManager:u})];n==null||n.forEach(e=>{d.push(new fc(e))}),c&&d.push(c);let f=new sc({resource:e,processors:d}),p=new Oo({spanSessionManager:i,limitManager:a,loggerProvider:s?void 0:f,storage:l});return s&&(Ja.setGlobalLoggerProvider(f),Li.setGlobalLogManager(p)),{loggerProvider:f,mxlLogManager:p}},Th=({useDocumentTitleAsPageLabel:e,registerGlobally:t})=>{let n=new ko({useDocumentTitleAsPageLabel:e});return t&&Wi.setGlobalPageManager(n),n};return Object.defineProperty(e,`DiagLogLevel`,{enumerable:!0,get:function(){return S}}),e.attributes=pa,e.getNavigationInstrumentation=uo,e.initSDK=bh,e.log=Li,e.page=Wi,e.session=Zi,e.trace=aa,e.user=fa,e})({});
|
|
23
|
+
var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,`__isLong__`,{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return ee}else{if(e<=-_)return T;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var ee=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=ee;var T=l(0,-2147483648,!1);n.MIN_VALUE=T;var E=n.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},E.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(T)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},E.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},E.isZero=function(){return this.high===0&&this.low===0},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return(this.low&1)==1},E.isEven=function(){return(this.low&1)==0},E.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(x)},E.neg=E.negate,E.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},E.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(T))return e.isOdd()?T:y;if(e.eq(T))return this.isOdd()?T:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(T))return e.eq(x)||e.eq(C)?T:e.eq(T)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(T))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},E.div=E.divide,E.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return l(~this.low,~this.high,this.unsigned)},E.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},E.clz=E.countLeadingZeros,E.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},E.ctz=E.countTrailingZeros,E.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},E.rotl=E.rotateLeft,E.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},E.rotr=E.rotateRight,E.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(n.fromBigInt=function(e,t){return l(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},n.fromValue=function(e,t){return typeof e==`bigint`?n.fromBigInt(e,t):f(e,t)},E.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=n})})),Vh=c((e=>{var t=e;t.asPromise=Mh(),t.base64=Nh(),t.EventEmitter=Ph(),t.float=Fh(),t.inquire=Ih(),t.utf8=Lh(),t.pool=Rh(),t.LongBits=zh();function n(e){return e===`__proto__`||e===`prototype`||e===`constructor`}t.isUnsafeProperty=n,t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.global.Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||(function(){try{var e=Bh();return e&&e.isLong?e:null}catch(e){return null}})(),t.key2Re=/^(?:true|false|0|1)$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)},t.longFromKey=function(e,n){return t.key64Re.test(e)&&!t.key32Re.test(e)?t.longFromHash(e,n):e},t.boolFromKey=function(e){return e===`true`||e===`1`};function r(e){var t=typeof arguments[arguments.length-1]==`boolean`,r=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var i=1;i<r;++i){var a=arguments[i];if(a)for(var o=Object.keys(a),s=0;s<o.length;++s)!n(o[s])&&(e[o[s]]===void 0||!t)&&(e[o[s]]=a[o[s]])}return e}t.merge=r,t.nestingLimit=32,t.recursionLimit=100,t.makeProp=function(e,t,n){Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:n===void 0?!0:n,configurable:!0,writable:!0})},t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),n&&r(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=i,t.ProtocolError=i(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),Hh=c(((e,t)=>{t.exports=u;var n=Vh(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function m(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function h(e,t){this.len=e,this.next=void 0,this.val=t}h.prototype=Object.create(s.prototype),h.prototype.fn=m,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return(e|=0)<0?this._push(g,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function g(e,t,n){for(var r=e.lo,i=e.hi;i;)t[n++]=r&127|128,r=(r>>>7|i<<25)>>>0,i>>>=7;for(;r>127;)t[n++]=r&127|128,r>>>=7;t[n++]=r}u.prototype.uint64=function(e){var t=i.from(e);return this._push(g,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(g,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function _(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(_,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(_,4,t.lo)._push(_,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var v=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},u.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(v,t,e):this},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(t===e.length?p:o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){return this.finishInto(this.constructor.alloc(this.len),0)},u.prototype.finishInto=function(e,t){t===void 0&&(t=0);for(var n=this.head.next,r=t;n;)n.fn(n.val,e,r),r+=n.len,n=n.next;return e},u._configure=function(e){r=e,u.create=d(),r._configure()}})),Uh=c(((e,t)=>{t.exports=i;var n=Hh();(i.prototype=Object.create(n.prototype)).constructor=i;var r=Vh();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(i.writeBytesBuffer,t,e):this};function a(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function o(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(t===e.length&&t<40?a:o,t,e),this},i._configure()})),Wh=c(((e,t)=>{t.exports=s;var n=Vh(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.raw=function(e,t){return Array.isArray(this.buf)?this.buf.slice(e,t):e===t?new this.buf.constructor(0):this._slice.call(this.buf,e,t)},s.prototype.uint32=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128)||(n=(n|(e[t]&15)<<28)>>>0,e[t++]<128))return this.pos=t,n;for(var r=0;r<5;++r){if(t>=this.len)throw this.pos=t,o(this);if(e[t++]<128)return this.pos=t,n}throw this.pos=t,Error(`invalid varint encoding`)},s.prototype.tag=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128))return this.pos=t,n;if(n=(n|(e[t]&15)<<28)>>>0,e[t]<128&&!(e[t]&112))return this.pos=t+1,n;throw this.pos=t+1,Error(`invalid tag encoding`)},s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){for(var e=!1,t,n=0;n<10;++n){if(this.pos>=this.len)throw o(this);if(t=this.buf[this.pos++],t&127&&(e=!0),t<128)return e}throw Error(`invalid varint encoding`)};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,this.raw(t,n)},s.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,a.read(this.buf,t,n)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.recursionLimit=n.recursionLimit,s.prototype.skipType=function(e,t,n){if(t===void 0&&(t=0),t>s.recursionLimit)throw Error(`max depth exceeded`);if(n===0)throw Error(`illegal tag: field number 0`);switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),i=r>>>3;if(e=r&7,!i)throw Error(`illegal tag: field number 0`);if(e===4){if(n!==void 0&&i!==n)throw Error(`invalid end group tag`);break}this.skipType(e,t+1,i)}break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Gh=c(((e,t)=>{t.exports=i;var n=Wh();(i.prototype=Object.create(n.prototype)).constructor=i;var r=Vh();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.raw=function(e,t){return e===t?r.Buffer.alloc(0):this._slice.call(this.buf,e,t)},i.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw RangeError(`index out of range: `+this.pos+` + `+e+` > `+this.len);return this.pos=n,this.buf.utf8Slice?this.buf.utf8Slice(t,n):this.buf.toString(`utf-8`,t,n)},i._configure()})),Kh=c(((e,t)=>{t.exports=r;var n=Vh();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),qh=c((e=>{var t=e;t.Service=Kh()})),Jh=c(((e,t)=>{t.exports={}})),Yh=c((e=>{var t=e;t.build=`minimal`,t.Writer=Hh(),t.BufferWriter=Uh(),t.Reader=Wh(),t.BufferReader=Gh(),t.util=Vh(),t.rpc=qh(),t.roots=Jh(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),Xh=c(((e,t)=>{t.exports=Yh()})),Zh=l({RumRecorder:()=>a_,SessionRecorder:()=>a_,VERSION:()=>zg,default:()=>a_});function Qh(e,t,n){return{body:e,timeUnixNano:t,attributes:n}}function $h(){return Reflect.get(globalThis,`Buffer`)||void 0}function eg(e){let t=$h();if(t)return Uint8Array.from(t.from(e,`base64`));let n=globalThis.atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}function tg(e){let t=$h();if(t)return t.from(e).toString(`base64`);let n=[];return e.forEach(e=>{n.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(n.join(``))}function ng(){return{stringValue:void 0,boolValue:void 0,intValue:void 0,doubleValue:void 0,arrayValue:void 0,kvlistValue:void 0,bytesValue:void 0}}function rg(){return{values:[]}}function ig(){return{values:[]}}function ag(){return{key:``,value:void 0}}function og(){return{name:``,version:``}}function sg(){return{name:``,version:``}}function cg(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}function lg(e){return e!=null}function ug(){return{attributes:[],droppedAttributesCount:0}}function dg(e){return e!=null}function fg(e){switch(e){case 0:case`SEVERITY_NUMBER_UNSPECIFIED`:return 0;case 1:case`SEVERITY_NUMBER_TRACE`:return 1;case 2:case`SEVERITY_NUMBER_TRACE2`:return 2;case 3:case`SEVERITY_NUMBER_TRACE3`:return 3;case 4:case`SEVERITY_NUMBER_TRACE4`:return 4;case 5:case`SEVERITY_NUMBER_DEBUG`:return 5;case 6:case`SEVERITY_NUMBER_DEBUG2`:return 6;case 7:case`SEVERITY_NUMBER_DEBUG3`:return 7;case 8:case`SEVERITY_NUMBER_DEBUG4`:return 8;case 9:case`SEVERITY_NUMBER_INFO`:return 9;case 10:case`SEVERITY_NUMBER_INFO2`:return 10;case 11:case`SEVERITY_NUMBER_INFO3`:return 11;case 12:case`SEVERITY_NUMBER_INFO4`:return 12;case 13:case`SEVERITY_NUMBER_WARN`:return 13;case 14:case`SEVERITY_NUMBER_WARN2`:return 14;case 15:case`SEVERITY_NUMBER_WARN3`:return 15;case 16:case`SEVERITY_NUMBER_WARN4`:return 16;case 17:case`SEVERITY_NUMBER_ERROR`:return 17;case 18:case`SEVERITY_NUMBER_ERROR2`:return 18;case 19:case`SEVERITY_NUMBER_ERROR3`:return 19;case 20:case`SEVERITY_NUMBER_ERROR4`:return 20;case 21:case`SEVERITY_NUMBER_FATAL`:return 21;case 22:case`SEVERITY_NUMBER_FATAL2`:return 22;case 23:case`SEVERITY_NUMBER_FATAL3`:return 23;case 24:case`SEVERITY_NUMBER_FATAL4`:return 24;default:return-1}}function pg(e){switch(e){case 0:return`SEVERITY_NUMBER_UNSPECIFIED`;case 1:return`SEVERITY_NUMBER_TRACE`;case 2:return`SEVERITY_NUMBER_TRACE2`;case 3:return`SEVERITY_NUMBER_TRACE3`;case 4:return`SEVERITY_NUMBER_TRACE4`;case 5:return`SEVERITY_NUMBER_DEBUG`;case 6:return`SEVERITY_NUMBER_DEBUG2`;case 7:return`SEVERITY_NUMBER_DEBUG3`;case 8:return`SEVERITY_NUMBER_DEBUG4`;case 9:return`SEVERITY_NUMBER_INFO`;case 10:return`SEVERITY_NUMBER_INFO2`;case 11:return`SEVERITY_NUMBER_INFO3`;case 12:return`SEVERITY_NUMBER_INFO4`;case 13:return`SEVERITY_NUMBER_WARN`;case 14:return`SEVERITY_NUMBER_WARN2`;case 15:return`SEVERITY_NUMBER_WARN3`;case 16:return`SEVERITY_NUMBER_WARN4`;case 17:return`SEVERITY_NUMBER_ERROR`;case 18:return`SEVERITY_NUMBER_ERROR2`;case 19:return`SEVERITY_NUMBER_ERROR3`;case 20:return`SEVERITY_NUMBER_ERROR4`;case 21:return`SEVERITY_NUMBER_FATAL`;case 22:return`SEVERITY_NUMBER_FATAL2`;case 23:return`SEVERITY_NUMBER_FATAL3`;case 24:return`SEVERITY_NUMBER_FATAL4`;default:return`UNRECOGNIZED`}}function mg(){return{resourceLogs:[]}}function hg(){return{resource:void 0,scopeLogs:[],instrumentationLibraryLogs:[],schemaUrl:``}}function gg(){return{scope:void 0,logRecords:[],schemaUrl:``}}function _g(){return{instrumentationLibrary:void 0,logRecords:[],schemaUrl:``}}function vg(){return{timeUnixNano:0,observedTimeUnixNano:0,severityNumber:0,severityText:``,body:void 0,attributes:[],droppedAttributesCount:0,flags:0,traceId:new Uint8Array,spanId:new Uint8Array}}function yg(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}function bg(e){return e!=null}function xg(e){return Array.isArray(e)}function Sg(e){return!!e&&typeof e==`object`&&!xg(e)}function Cg(e){return Sg(e)?{kvlistValue:{values:Object.entries(e).map(([e,t])=>({key:e,value:Cg(t)}))}}:xg(e)?{arrayValue:{values:e.map(e=>Cg(e))}}:typeof e==`string`?{stringValue:e}:typeof e==`number`?{doubleValue:e}:typeof e==`boolean`?{boolValue:e}:{}}function wg(e){if(e.length>5e6){let t=e.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim);for(let n of t)e=n[1].toLocaleLowerCase().slice(0,6)===`image/`?e.replace(n[0],Ug):e.replace(n[0],``)}return e}var $,Tg,Eg,Dg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg,Ig,Lg,Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_=s((()=>{R(),ym(),V(),oh(),jh(),$=d(Xh(),1),B(),Oo(),Eo(),Tg=[`resource`,`getSessionId`,`tracer`,`url`,`debug`,`apiKey`,`headers`],Eg=class{constructor(e,t){z(this,`logs`,[]),z(this,`scheduledDelayMillis`,void 0),z(this,`timeout`,void 0),z(this,`exporter`,void 0),z(this,`lastBatchSent`,0),this.scheduledDelayMillis=(t==null?void 0:t.scheduledDelayMillis)||5e3,this.exporter=e,typeof window<`u`&&window.addEventListener(`unload`,()=>{this._flushAll()})}onLog(e){this.logs.push(e),this.timeout===void 0&&(this.timeout=setTimeout(()=>{this.timeout=void 0,this._flushAll()},this.scheduledDelayMillis))}_flushAll(){this.lastBatchSent=Date.now(),F.with(kn(F.active()),()=>{let e=this.logs.splice(0,this.logs.length);this.exporter.export(e)})}},Dg={encode(e,t=$.default.Writer.create()){return e.stringValue!==void 0&&t.uint32(10).string(e.stringValue),e.boolValue!==void 0&&t.uint32(16).bool(e.boolValue),e.intValue!==void 0&&t.uint32(24).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(33).double(e.doubleValue),e.arrayValue!==void 0&&Og.encode(e.arrayValue,t.uint32(42).fork()).ldelim(),e.kvlistValue!==void 0&&kg.encode(e.kvlistValue,t.uint32(50).fork()).ldelim(),e.bytesValue!==void 0&&t.uint32(58).bytes(e.bytesValue),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ng();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.stringValue=n.string();continue;case 2:if(e!==16)break;i.boolValue=n.bool();continue;case 3:if(e!==24)break;i.intValue=cg(n.int64());continue;case 4:if(e!==33)break;i.doubleValue=n.double();continue;case 5:if(e!==42)break;i.arrayValue=Og.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.kvlistValue=kg.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.bytesValue=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{stringValue:lg(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:lg(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,intValue:lg(e.intValue)?globalThis.Number(e.intValue):void 0,doubleValue:lg(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,arrayValue:lg(e.arrayValue)?Og.fromJSON(e.arrayValue):void 0,kvlistValue:lg(e.kvlistValue)?kg.fromJSON(e.kvlistValue):void 0,bytesValue:lg(e.bytesValue)?eg(e.bytesValue):void 0}},toJSON(e){let t={};return e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.arrayValue!==void 0&&(t.arrayValue=Og.toJSON(e.arrayValue)),e.kvlistValue!==void 0&&(t.kvlistValue=kg.toJSON(e.kvlistValue)),e.bytesValue!==void 0&&(t.bytesValue=tg(e.bytesValue)),t},create(e){return Dg.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a;let o=ng();return o.stringValue=(t=e.stringValue)==null?void 0:t,o.boolValue=(n=e.boolValue)==null?void 0:n,o.intValue=(r=e.intValue)==null?void 0:r,o.doubleValue=(i=e.doubleValue)==null?void 0:i,o.arrayValue=e.arrayValue!==void 0&&e.arrayValue!==null?Og.fromPartial(e.arrayValue):void 0,o.kvlistValue=e.kvlistValue!==void 0&&e.kvlistValue!==null?kg.fromPartial(e.kvlistValue):void 0,o.bytesValue=(a=e.bytesValue)==null?void 0:a,o}},Og={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Dg.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rg();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Dg.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Dg.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Dg.toJSON(e))),n},create(e){return Og.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=rg();return n.values=((t=e.values)==null?void 0:t.map(e=>Dg.fromPartial(e)))||[],n}},kg={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Ag.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ig();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Ag.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Ag.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Ag.toJSON(e))),n},create(e){return kg.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=ig();return n.values=((t=e.values)==null?void 0:t.map(e=>Ag.fromPartial(e)))||[],n}},Ag={encode(e,t=$.default.Writer.create()){return e.key!==void 0&&e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Dg.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ag();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Dg.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{key:lg(e.key)?globalThis.String(e.key):``,value:lg(e.value)?Dg.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==void 0&&e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=Dg.toJSON(e.value)),t},create(e){return Ag.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=ag();return n.key=(t=e.key)==null?``:t,n.value=e.value!==void 0&&e.value!==null?Dg.fromPartial(e.value):void 0,n}},jg={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=og();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:lg(e.name)?globalThis.String(e.name):``,version:lg(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return jg.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=og();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}},Mg={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sg();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:lg(e.name)?globalThis.String(e.name):``,version:lg(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Mg.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=sg();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}},$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure()),Ng={encode(e,t=$.default.Writer.create()){if(e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Ag.encode(n,t.uint32(10).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(16).uint32(e.droppedAttributesCount),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=ug();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.attributes.push(Ag.decode(n,n.uint32()));continue;case 2:if(e!==16)break;i.droppedAttributesCount=n.uint32();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Ag.fromJSON(e)):[],droppedAttributesCount:dg(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0}},toJSON(e){var t;let n={};return(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Ag.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),n},create(e){return Ng.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=ug();return r.attributes=((t=e.attributes)==null?void 0:t.map(e=>Ag.fromPartial(e)))||[],r.droppedAttributesCount=(n=e.droppedAttributesCount)==null?0:n,r}},Pg={encode(e,t=$.default.Writer.create()){if(e.resourceLogs!==void 0&&e.resourceLogs.length!==0)for(let n of e.resourceLogs)Fg.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=mg();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resourceLogs.push(Fg.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resourceLogs:globalThis.Array.isArray(e==null?void 0:e.resourceLogs)?e.resourceLogs.map(e=>Fg.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.resourceLogs)!=null&&t.length&&(n.resourceLogs=e.resourceLogs.map(e=>Fg.toJSON(e))),n},create(e){return Pg.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=mg();return n.resourceLogs=((t=e.resourceLogs)==null?void 0:t.map(e=>Fg.fromPartial(e)))||[],n}},Fg={encode(e,t=$.default.Writer.create()){if(e.resource!==void 0&&Ng.encode(e.resource,t.uint32(10).fork()).ldelim(),e.scopeLogs!==void 0&&e.scopeLogs.length!==0)for(let n of e.scopeLogs)Ig.encode(n,t.uint32(18).fork()).ldelim();if(e.instrumentationLibraryLogs!==void 0&&e.instrumentationLibraryLogs.length!==0)for(let n of e.instrumentationLibraryLogs)Lg.encode(n,t.uint32(8002).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=hg();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resource=Ng.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.scopeLogs.push(Ig.decode(n,n.uint32()));continue;case 1e3:if(e!==8002)break;i.instrumentationLibraryLogs.push(Lg.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resource:bg(e.resource)?Ng.fromJSON(e.resource):void 0,scopeLogs:globalThis.Array.isArray(e==null?void 0:e.scopeLogs)?e.scopeLogs.map(e=>Ig.fromJSON(e)):[],instrumentationLibraryLogs:globalThis.Array.isArray(e==null?void 0:e.instrumentationLibraryLogs)?e.instrumentationLibraryLogs.map(e=>Lg.fromJSON(e)):[],schemaUrl:bg(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t,n;let r={};return e.resource!==void 0&&(r.resource=Ng.toJSON(e.resource)),(t=e.scopeLogs)!=null&&t.length&&(r.scopeLogs=e.scopeLogs.map(e=>Ig.toJSON(e))),(n=e.instrumentationLibraryLogs)!=null&&n.length&&(r.instrumentationLibraryLogs=e.instrumentationLibraryLogs.map(e=>Lg.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(r.schemaUrl=e.schemaUrl),r},create(e){return Fg.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r;let i=hg();return i.resource=e.resource!==void 0&&e.resource!==null?Ng.fromPartial(e.resource):void 0,i.scopeLogs=((t=e.scopeLogs)==null?void 0:t.map(e=>Ig.fromPartial(e)))||[],i.instrumentationLibraryLogs=((n=e.instrumentationLibraryLogs)==null?void 0:n.map(e=>Lg.fromPartial(e)))||[],i.schemaUrl=(r=e.schemaUrl)==null?``:r,i}},Ig={encode(e,t=$.default.Writer.create()){if(e.scope!==void 0&&Mg.encode(e.scope,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)Rg.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=gg();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.scope=Mg.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(Rg.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{scope:bg(e.scope)?Mg.fromJSON(e.scope):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>Rg.fromJSON(e)):[],schemaUrl:bg(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.scope!==void 0&&(n.scope=Mg.toJSON(e.scope)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>Rg.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return Ig.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=gg();return r.scope=e.scope!==void 0&&e.scope!==null?Mg.fromPartial(e.scope):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>Rg.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}},Lg={encode(e,t=$.default.Writer.create()){if(e.instrumentationLibrary!==void 0&&jg.encode(e.instrumentationLibrary,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)Rg.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=_g();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.instrumentationLibrary=jg.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(Rg.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{instrumentationLibrary:bg(e.instrumentationLibrary)?jg.fromJSON(e.instrumentationLibrary):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>Rg.fromJSON(e)):[],schemaUrl:bg(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.instrumentationLibrary!==void 0&&(n.instrumentationLibrary=jg.toJSON(e.instrumentationLibrary)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>Rg.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return Lg.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=_g();return r.instrumentationLibrary=e.instrumentationLibrary!==void 0&&e.instrumentationLibrary!==null?jg.fromPartial(e.instrumentationLibrary):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>Rg.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}},Rg={encode(e,t=$.default.Writer.create()){if(e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&t.uint32(9).fixed64(e.timeUnixNano),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&t.uint32(89).fixed64(e.observedTimeUnixNano),e.severityNumber!==void 0&&e.severityNumber!==0&&t.uint32(16).int32(e.severityNumber),e.severityText!==void 0&&e.severityText!==``&&t.uint32(26).string(e.severityText),e.body!==void 0&&Dg.encode(e.body,t.uint32(42).fork()).ldelim(),e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Ag.encode(n,t.uint32(50).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(56).uint32(e.droppedAttributesCount),e.flags!==void 0&&e.flags!==0&&t.uint32(69).fixed32(e.flags),e.traceId!==void 0&&e.traceId.length!==0&&t.uint32(74).bytes(e.traceId),e.spanId!==void 0&&e.spanId.length!==0&&t.uint32(82).bytes(e.spanId),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=vg();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==9)break;i.timeUnixNano=yg(n.fixed64());continue;case 11:if(e!==89)break;i.observedTimeUnixNano=yg(n.fixed64());continue;case 2:if(e!==16)break;i.severityNumber=n.int32();continue;case 3:if(e!==26)break;i.severityText=n.string();continue;case 5:if(e!==42)break;i.body=Dg.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.attributes.push(Ag.decode(n,n.uint32()));continue;case 7:if(e!==56)break;i.droppedAttributesCount=n.uint32();continue;case 8:if(e!==69)break;i.flags=n.fixed32();continue;case 9:if(e!==74)break;i.traceId=n.bytes();continue;case 10:if(e!==82)break;i.spanId=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{timeUnixNano:bg(e.timeUnixNano)?globalThis.Number(e.timeUnixNano):0,observedTimeUnixNano:bg(e.observedTimeUnixNano)?globalThis.Number(e.observedTimeUnixNano):0,severityNumber:bg(e.severityNumber)?fg(e.severityNumber):0,severityText:bg(e.severityText)?globalThis.String(e.severityText):``,body:bg(e.body)?Dg.fromJSON(e.body):void 0,attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Ag.fromJSON(e)):[],droppedAttributesCount:bg(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0,flags:bg(e.flags)?globalThis.Number(e.flags):0,traceId:bg(e.traceId)?eg(e.traceId):new Uint8Array,spanId:bg(e.spanId)?eg(e.spanId):new Uint8Array}},toJSON(e){var t;let n={};return e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&(n.timeUnixNano=Math.round(e.timeUnixNano)),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&(n.observedTimeUnixNano=Math.round(e.observedTimeUnixNano)),e.severityNumber!==void 0&&e.severityNumber!==0&&(n.severityNumber=pg(e.severityNumber)),e.severityText!==void 0&&e.severityText!==``&&(n.severityText=e.severityText),e.body!==void 0&&(n.body=Dg.toJSON(e.body)),(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Ag.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),e.flags!==void 0&&e.flags!==0&&(n.flags=Math.round(e.flags)),e.traceId!==void 0&&e.traceId.length!==0&&(n.traceId=tg(e.traceId)),e.spanId!==void 0&&e.spanId.length!==0&&(n.spanId=tg(e.spanId)),n},create(e){return Rg.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a,o,s,c,l;let u=vg();return u.timeUnixNano=(t=e.timeUnixNano)==null?0:t,u.observedTimeUnixNano=(n=e.observedTimeUnixNano)==null?0:n,u.severityNumber=(r=e.severityNumber)==null?0:r,u.severityText=(i=e.severityText)==null?``:i,u.body=e.body!==void 0&&e.body!==null?Dg.fromPartial(e.body):void 0,u.attributes=((a=e.attributes)==null?void 0:a.map(e=>Ag.fromPartial(e)))||[],u.droppedAttributesCount=(o=e.droppedAttributesCount)==null?0:o,u.flags=(s=e.flags)==null?0:s,u.traceId=(c=e.traceId)==null?new Uint8Array:c,u.spanId=(l=e.spanId)==null?new Uint8Array:l,u}},$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure()),zg=`0.0.16`,Bg={"Content-Type":`application/x-protobuf`,"Content-Encoding":`gzip`},Vg=Pg,Hg=class{constructor(e){z(this,`config`,void 0),this.config=e}constructLogData(e){var t,n,r;return{resourceLogs:[{resource:{attributes:(t=Cg(U({},Object.fromEntries(Object.entries((n=(r=this.config.resource)==null?void 0:r.attributes)==null?{}:n)))))==null||(t=t.kvlistValue)==null?void 0:t.values},scopeLogs:[{scope:{name:`rum.rr-web`,version:zg},logRecords:e.map(e=>{var t,n;return{body:Cg((t=e.body)==null?null:t),timeUnixNano:e.timeUnixNano*1e6,attributes:(n=Cg(e.attributes||{}).kvlistValue)==null?void 0:n.values}})}]}]}}export(e){if(e.length===0)return;let t=this.constructLogData(e);this.config.debug&&console.log(`otlp request`,t);let n=bm(Vg.encode(t).finish()),r=this.config.headers?Object.assign({},Bg,this.config.headers):Bg;fetch(this.config.beaconUrl,{method:`POST`,body:new Uint8Array(n),headers:r}).catch(()=>{})}},Ug=`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==`,Wg=class{constructor(e,t={}){var n,r;z(this,`bucketSize`,100),z(this,`refillRate`,10),z(this,`mutationBuckets`,{}),z(this,`loggedTracker`,{}),z(this,`refillBuckets`,()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})}),z(this,`getNodeOrRelevantParent`,e=>{let t=this.rrweb.mirror.getNode(e);if((t==null?void 0:t.nodeName)!==`svg`&&t instanceof Element){let e=t.closest(`svg`);if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]}),z(this,`numberOfChanges`,e=>{var t,n,r,i,a,o,s,c;return((t=(n=e.removes)==null?void 0:n.length)==null?0:t)+((r=(i=e.attributes)==null?void 0:i.length)==null?0:r)+((a=(o=e.texts)==null?void 0:o.length)==null?0:a)+((s=(c=e.adds)==null?void 0:c.length)==null?0:s)}),z(this,`throttleMutations`,e=>{if(e.type!==3||e.data.source!==0)return e;let t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t;let[n,r]=this.getNodeOrRelevantParent(e.id);if(this.mutationBuckets[n]===0)return!1;if(this.mutationBuckets[n]=(t=this.mutationBuckets[n])==null?this.bucketSize:t,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),this.mutationBuckets[n]===0&&!this.loggedTracker[n]){var i,a;this.loggedTracker[n]=!0,(i=(a=this.options).onBlockedNode)==null||i.call(a,n,r)}return e}));let r=this.numberOfChanges(t);if(!(r===0&&n!==r))return e}),this.rrweb=e,this.options=t,this.refillRate=(n=this.options.refillRate)==null?this.refillRate:n,this.bucketSize=(r=this.options.bucketSize)==null?this.bucketSize:r,setInterval(()=>{this.refillBuckets()},1e3)}},Gg=14460*1e3,Kg=950*1024,qg=new TextEncoder,Jg=new TextDecoder,Yg=!1,Qg=0,$g=!1,e_=1,t_=1,a_={get inited(){return!!Yg},isRecording(){return!!Yg&&!$g},setEnabled(e){e?a_.resume():a_.stop()},init(e){var t,n;if(Yg)return;if(typeof window>`u`){console.error(`Session recorder can't be ran in non-browser environments`);return}let{resource:r,getSessionId:i,tracer:a,url:o,debug:s,apiKey:c,headers:l}=e,u=To(e,Tg);r_=i,Xg=a;let d=Xg.startSpan(`record init`);if(!d.isRecording())return;d.end();let f=o,p=U({},l);c&&(p.authorization=c);let m=new Eg(new Hg({beaconUrl:f,debug:s,headers:p,resource:r}),{});Zg=(t=i())==null?``:t,Qg=Date.now(),n_=(n=n_)==null?new Wg(mm,{onBlockedNode:(e,t)=>{let n=`OpenTelemetry Session Recorder: Rate limiting recording mutations on node ${e}. This can be due to excessive animations.`,r=Date.now(),i=Xg.startSpan(`console.warn`,{kind:Ot.INTERNAL,startTime:r});i.setAttribute(`component`,`console`),i.setAttribute(`level`,`warn`),i.setAttribute(`message`,n),i.end(r),s&&console.warn(n,t),clearTimeout(i_),i_=setTimeout(()=>{mm.takeFullSnapshot()},1e3)}}):n,Yg=mm(U(U({maskAllInputs:!0,maskTextSelector:`*`},u),{},{emit(e){var t;if($g)return;let n=(t=r_==null?void 0:r_())==null?``:t;if(n!==Zg){if(document.hidden)return;Zg=n,Qg=Date.now(),e_=1,t_=1,mm.takeFullSnapshot()}if(e.timestamp>Qg+Gg)return;let r=n_?n_.throttleMutations(e):e;if(!r)return;let i=r.timestamp,a=e_++,o=qg.encode(wg(JSON.stringify(r))),c=Math.ceil(o.byteLength/Kg);for(let e=0;e<c;e++){let t=e*Kg,n=(e+1)*Kg,r=Qh(Jg.decode(o.slice(t,n)),i,{"rr-web.offset":t_++,"rr-web.event":a,"rr-web.chunk":e+1,"rr-web.total-chunks":c});s&&console.log(r),m.onLog(r)}}}))},resume(){if(!Yg)return;let e=$g;$g=!1,e||(mm.takeFullSnapshot(),Xg.startSpan(`record resume`).end())},stop(){Yg&&($g&&Xg.startSpan(`record stop`).end(),$g=!0)},deinit(){Yg&&(Yg(),Yg=!1,r_=void 0)}}}));Oo();let s_;function c_(){return s_!=null||(s_=Promise.resolve().then(()=>(o_(),Zh))),s_}function l_({resource:e,spanSessionManager:t,tracerProvider:n,appID:r,userID:i,mxlDataURL:a,sessionRecorder:o},s){return U({resource:e,getSessionId:()=>t.getSessionId(),tracer:n.getTracer(`mxl.session-recorder`,s),url:Ed(r,a),headers:_u(r,i)},o)}function u_(e){let t,n=!1,r=!1,i=!1,a,o=()=>t==null?void 0:t.SessionRecorder,s=()=>new Promise(t=>{let n=e.spanSessionManager.addSessionStartedListener(()=>{n(),t()})}),c=()=>r||i?Promise.resolve():(a!=null||(a=ya(function*(){if(e.spanSessionManager.getSessionId()===null&&(yield s()),!(r||i||n)){n=!0;try{t=yield c_();let n=l_(e,t.VERSION);t.SessionRecorder.init(n),r=!0}catch(t){i=!0,e.diagLogger.error(`Failed to initialize session recorder`,t)}finally{a=void 0}}})()),a);return e.recordUserSessions&&c(),{isRecording:()=>{var e;return!!((e=o())!=null&&e.isRecording())},setEnabled:e=>{if(e){if(r){var t;(t=o())==null||t.setEnabled(!0);return}c().then(()=>{if(r){var e;(e=o())==null||e.setEnabled(!0)}});return}if(r){var n;(n=o())==null||n.setEnabled(!1)}}}}var d_;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(d_||(d_={})),R(),V();let f_=I.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function p_(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=m_(t.body);return t.body=e,n}else return Promise.resolve(g_(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>v_(e)):Promise.resolve()}}function m_(e){if(!e.pipeThrough)return f_.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},transform(e,n){return ya(function*(){let r=yield e;t+=r.byteLength,n.enqueue(e)})()},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function h_(e){return typeof Document<`u`&&e instanceof Document}function g_(e){if(h_(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return v_(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return y_(e);if(e instanceof URLSearchParams)return v_(e.toString());if(e.byteLength!==void 0)return e.byteLength;f_.warn(`unknown body type`)}let __=new TextEncoder;function v_(e){return __.encode(e).byteLength}function y_(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function b_(e){let t=C_(),n=e.toUpperCase();return n in t?n:`_OTHER`}let x_={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},S_;function C_(){return S_===void 0&&(S_=x_),S_}let w_={"https:":`443`,"http:":`80`};function T_(e){let t=Number(e.port||w_[e.protocol]);if(t&&!isNaN(t))return t}let E_=`0.218.0`;R(),V(),Lr(),B();let D_=typeof PerformanceObserver<`u`;var O_=class extends Is{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,E_,e),z(this,`component`,`fetch`),z(this,`version`,E_),z(this,`moduleName`,this.component),z(this,`_usedResources`,new WeakSet),z(this,`_tasksCount`,0),z(this,`_semconvStability`,void 0),this._semconvStability=Rs(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[H.FETCH_START]},L.setSpan(F.active(),e)),r=!(this._semconvStability&W.OLD);lo(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[H.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=go(t.url);if(this._semconvStability&W.OLD&&(e.setAttribute(`http.status_code`,t.status),t.statusText!=null&&e.setAttribute(d_.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(`http.host`,n.host),e.setAttribute(`http.scheme`,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(`http.user_agent`,navigator.userAgent)),this._semconvStability&W.STABLE){e.setAttribute(Sr,t.status),e.setAttribute(Cr,n.hostname);let r=T_(n);r&&e.setAttribute(wr,r)}}_addHeaders(e,t){if(!_o(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};en.inject(F.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)en.inject(F.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t=new Headers(e.headers);en.inject(F.active(),t,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))}),e.headers=t}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(oa(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&W.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[d_.COMPONENT]=this.moduleName,r[`http.method`]=i,r[`http.url`]=e}if(this._semconvStability&W.STABLE){let i=t.method,a=b_(t.method||`GET`);n||(n=a),r[br]=a,a!==i&&(r[xr]=i),r[Ar]=e}return this.tracer.startSpan(n,{kind:Ot.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=po(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&W.OLD);lo(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=Wr(Date.now()),i=Gr();this._addFinalSpanAttributes(e,n),this._semconvStability&W.STABLE&&n.status>=400&&(e.setStatus({code:At.ERROR}),e.setAttribute(gr,String(n.status))),setTimeout(()=>{var n;(n=t.observer)==null||n.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=go(n[0]instanceof Request?n[0].url:String(n[0])).href,a;a=n[0]instanceof Request?n[1]==null?n[0]:new Request(n[0],n[1]):n[1]||{};let o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&p_(...n).then(e=>{e&&(t._semconvStability&W.OLD&&o.setAttribute(`http.request_content_length_uncompressed`,e),t._semconvStability&W.STABLE&&o.setAttribute(`http.request.body.size`,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}catch(n){t._diag.error(`Failed to read fetch response body`,n),t._endSpan(e,s,{status:0,url:i})}return n}function d(e,n){try{c(e,n)}catch(r){t._diag.error(`Failed to end span on fetch error`,r),t._endSpan(e,s,{status:n.status||0,url:i})}throw n}return F.with(L.setSpan(F.active(),o),()=>(t._callRequestHook(o,a),t._addHeaders(a,i),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o),d.bind(r,o))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&Ls(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&Ls(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=Gr(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(!D_){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug(`fetch constructor already patched`),this._isEnabled=!0;return}try{this._wrap(globalThis,`fetch`,this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(e){this._diag.warn(`Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.`,e)}}}disable(){D_&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}},k_;(function(e){e.METHOD_OPEN=`open`,e.METHOD_SEND=`send`,e.EVENT_ABORT=`abort`,e.EVENT_ERROR=`error`,e.EVENT_LOAD=`loaded`,e.EVENT_TIMEOUT=`timeout`})(k_||(k_={})),R(),V();let A_=I.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`});function j_(e){return typeof Document<`u`&&e instanceof Document}function M_(e){if(j_(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return P_(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return F_(e);if(e instanceof URLSearchParams)return P_(e.toString());if(e.byteLength!==void 0)return e.byteLength;A_.warn(`unknown body type`)}let N_=new TextEncoder;function P_(e){return N_.encode(e).byteLength}function F_(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function I_(e){let t=z_(),n=e.toUpperCase();return n in t?n:`_OTHER`}let L_={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},R_;function z_(){return R_===void 0&&(R_=L_),R_}let B_={"https:":`443`,"http:":`80`};function V_(e){let t=Number(e.port||B_[e.protocol]);if(t&&!isNaN(t))return t}let H_=`0.218.0`;var U_;(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(U_||(U_={})),R(),V(),Lr(),B();var W_=class extends Is{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,H_,e),z(this,`component`,`xml-http-request`),z(this,`version`,H_),z(this,`moduleName`,this.component),z(this,`_tasksCount`,0),z(this,`_xhrMem`,new WeakMap),z(this,`_usedResources`,new WeakSet),z(this,`_semconvStability`,void 0),this._semconvStability=Rs(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addHeaders(e,t){let n=go(t).href;if(!_o(n,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};en.inject(F.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let r={};en.inject(F.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){F.with(L.setSpan(F.active(),e),()=>{let e=this.tracer.startSpan(`CORS Preflight`,{startTime:t[H.FETCH_START]}),n=!(this._semconvStability&W.OLD);lo(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[H.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&W.OLD){if(t.status!==void 0&&e.setAttribute(`http.status_code`,t.status),t.statusText!==void 0&&e.setAttribute(U_.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=go(n);e.setAttribute(`http.host`,t.host),e.setAttribute(`http.scheme`,t.protocol.replace(`:`,``))}e.setAttribute(`http.user_agent`,navigator.userAgent)}this._semconvStability&W.STABLE&&t.status&&e.setAttribute(Sr,t.status)}_applyAttributesAfterXHR(e,t){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n==`function`&&Ls(()=>n(e,t),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_addResourceObserver(e,t){let n=this._xhrMem.get(e);!n||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(n.createdResources={observer:new PerformanceObserver(e=>{let r=e.getEntries(),i=go(t);r.forEach(e=>{e.initiatorType===`xmlhttprequest`&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(Hr.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!n||!r||!i||!e.createdResources)return;let a=e.createdResources.entries;(!a||!a.length)&&(a=Hr.getEntriesByType(`resource`));let o=po(go(n).href,r,i,a,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&W.OLD);lo(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){let r=go(t);if(oa(r.href,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let i=``,a={};if(this._semconvStability&W.OLD&&(i=n.toUpperCase(),a[`http.method`]=n,a[`http.url`]=r.toString()),this._semconvStability&W.STABLE){let e=n,t=I_(n);i||(i=t),a[br]=t,t!==e&&(a[xr]=e),a[Ar]=r.toString(),a[Cr]=r.hostname;let o=V_(r);o&&(a[wr]=o)}let o=this.tracer.startSpan(i,{kind:Ot.CLIENT,attributes:a});return o.addEvent(k_.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:o,spanUrl:t}),o}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){let e=this;function t(t,n,r,i){let a=n.callbackToRemoveEvents;typeof a==`function`&&a();let{span:o,spanUrl:s,sendStartTime:c}=n;o&&(e._findResourceAndAddNetworkEvents(n,o,s,c,r),o.addEvent(t,i),e._addFinalSpanAttributes(o,n,s),o.end(i),e._tasksCount--),e._clearResources()}function n(n,r,i,a){let o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){let t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&W.STABLE&&(i?a&&(t.setStatus({code:At.ERROR,message:a}),t.setAttribute(gr,a)):o.status&&o.status>=400&&(t.setStatus({code:At.ERROR}),t.setAttribute(gr,String(o.status))))}let s=Gr(),c=Date.now();setTimeout(()=>{t(n,o,s,c)},300)}function r(){n(k_.EVENT_ERROR,this,!0,`error`)}function i(){n(k_.EVENT_ABORT,this,!1)}function a(){n(k_.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(k_.EVENT_LOAD,this,!1):n(k_.EVENT_ERROR,this,!1)}function s(t){t.removeEventListener(`abort`,i),t.removeEventListener(`error`,r),t.removeEventListener(`load`,o),t.removeEventListener(`timeout`,a);let n=e._xhrMem.get(t);n&&(n.callbackToRemoveEvents=void 0)}return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let c=e._xhrMem.get(this);if(!c)return t.apply(this,n);let l=c.span,u=c.spanUrl;if(l&&u){if(e.getConfig().measureRequestSize&&n!=null&&n[0]){let t=n[0],r=M_(t);r!==void 0&&(e._semconvStability&W.OLD&&l.setAttribute(`http.request_content_length_uncompressed`,r),e._semconvStability&W.STABLE&&l.setAttribute(`http.request.body.size`,r))}F.with(L.setSpan(F.active(),l),()=>{e._tasksCount++,c.sendStartTime=Gr(),l.addEvent(k_.METHOD_SEND),this.addEventListener(`abort`,i),this.addEventListener(`error`,r),this.addEventListener(`load`,o),this.addEventListener(`timeout`,a),c.callbackToRemoveEvents=()=>{s(this),c.createdResources&&c.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,n)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug(`reactivating existing patch on`,this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug(`applying patch to`,this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(e){this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.warn(`Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.`,e)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}};Oo();let G_=(e={},{logManager:t,spanSessionManager:n,pageManager:r,limitManager:i})=>{var a,o,s,c,l,u,d,f,p,m;let h=[new Gc(e[`session-visibility`]),new Wc(e[`session-activity`])];if((a=e.omit)!=null&&a.has(`exception`)||h.push(new sc(e.exception)),(o=e.omit)!=null&&o.has(`click`)||h.push(new ac(e.click)),(s=e.omit)!=null&&s.has(`web-vital`)||h.push(new Xl(U(U({},e[`web-vital`]),{},{pageManager:r}))),(c=e.omit)!=null&&c.has(`loaf`)||h.push(new cc(U({},e.loaf))),(l=e.omit)!=null&&l.has(`user-timing`)||h.push(new Yc(e[`user-timing`])),(u=e.omit)!=null&&u.has(`element-timing`)||h.push(new oc(U(U({},e[`element-timing`]),{},{limitManager:i}))),(d=e.omit)!=null&&d.has(`document-load`)||h.push(new nc(e[`document-load`])),(f=e.omit)!=null&&f.has(`server-timing`)||h.push(new pc(U(U({},e[`server-timing`]),{},{limitManager:i}))),!((p=e.omit)!=null&&p.has(`@opentelemetry/instrumentation-fetch`))){var g,_,v,y;h.push(new O_(U(U({},e[`@opentelemetry/instrumentation-fetch`]),{},{ignoreUrls:[...(g=(_=e.network)==null?void 0:_.ignoreUrls)==null?[]:g,...(v=(y=e[`@opentelemetry/instrumentation-fetch`])==null?void 0:y.ignoreUrls)==null?[]:v]})))}if(!((m=e.omit)!=null&&m.has(`@opentelemetry/instrumentation-xml-http-request`))){var b,x,S,C;h.push(new W_(U(U({},e[`@opentelemetry/instrumentation-xml-http-request`]),{},{ignoreUrls:[...(b=(x=e.network)==null?void 0:x.ignoreUrls)==null?[]:b,...(S=(C=e[`@opentelemetry/instrumentation-xml-http-request`])==null?void 0:C.ignoreUrls)==null?[]:S]})))}e[`empty-root`]&&h.push(new rc(U({},e[`empty-root`])));for(let e of h)e instanceof Qs&&(n&&e.setSessionManager(n),t&&e.setLogManager(t),i&&e.setLimitManager(i));return h},K_=e=>{if(e!==void 0){if(typeof e!=`string`)throw Error(`appID must be a string, or omitted if not using MXL. Received ${String(e)}`);return e}},q_=e=>{if(e===void 0){let e=`MXLAppVersionX.X.X`;return e===``?`unspecified`:e}if(typeof e!=`string`)throw Error(`if appVersion is specified, it must be a string. Received ${String(e)}`);let t=e.trim();if(t===``)throw Error(`if appVersion is specified, it cannot be an empty string.`);return t};R(),Oo();let J_=({appID:e,appVersion:t,resource:n=Sa(),spanExporters:r=[],logExporters:i=[],spanProcessors:a=[],propagator:o=null,defaultInstrumentationConfig:s,instrumentations:c=[],contextManager:l=null,logProcessors:u=[],attributeScrubbers:d=[],enableDefaultAttributeScrubbing:f=!0,additionalQueryParamsToScrub:p=[],logLevel:m=D.ERROR,mxlDataURL:h,mxlConfigURL:g,diagLogger:_=I.createComponentLogger({namespace:`mxl-sdk`}),dynamicSDKConfigManager:v,dynamicSDKConfig:y,registerGlobally:b=!0,blockNetworkSpanForwarding:x=!1,restrictedProtocols:S=new Set([`file:`]),useDocumentTitleAsPageLabel:C=!0,recordUserSessions:w=!0,sessionRecorder:ee,serviceName:T}={})=>{try{var E,te;if(b){let e=Qd.registered();if(e!==null)return _.warn(`SDK has already been successfully initialized, skipping this invocation of initSDK`),e}if(I.setLogger(new me,{logLevel:m}),typeof window>`u`)return _.warn(`browser not detected, skipping initialization`),!1;let D=new So,k=D.getNowMillis(),A=K_(e),j=q_(t),M=A!==void 0;if(!M&&!i.length&&!r.length)throw Error(`when appID is omitted, at least one logExporter or spanExporter must be set`);if(S.has(window.location.protocol))throw Error(`not initializing due to restricted protocol: ${window.location.protocol}`);if(M&&typeof CompressionStream>`u`)throw Error(`CompressionStream is not supported in this browser and required for data compression.`);let ne=!b&&e,re=ne?new bo(e,window.localStorage):window.localStorage,ie=ne?new bo(e,window.sessionStorage):window.sessionStorage,ae=Y_({registerGlobally:b,sdkLocalStorage:re}),N=ae.getMXLUserId();if(M&&!N)throw Error(`userID is required when using MXL exporter`);let oe=U({},y),P=v==null?new wc({appID:A,appVersion:j,mxlConfigURL:g,defaultConfig:oe,deviceId:N,storage:re}):v;P.refreshRemoteConfig();let se=vc({serviceName:(E=(te=P.resolveApplicationServiceName)==null?void 0:te.call(P,T))==null?(()=>{var e;return(T==null?void 0:T.trim())||((e=P.getConfig().serviceName)==null?void 0:e.trim())||_c})():E}).merge(n).merge(yc({diagLogger:_,appVersion:j,pageSessionStorage:ie})),ce=new jc({dynamicConfigManager:P,deviceId:N,blockNetworkSpanForwarding:x});if(!ce.isSDKEnabled())return _.debug(`SDK is disabled, skipping initialization.`),!1;let le=xo({featureManager:ce,diag:_,registerGlobally:b,defaultInstrumentationConfig:s,propagator:o}),ue=new Dc(Tc),de=[...f?Xd(p):[],...d],fe=X_({limitManager:ue,registerGlobally:b,sdkLocalStorage:re,sdkSessionStorage:ie}),pe,he;if(M){var O;pe=new Bd({resource:se,exporter:new Ad({appID:A,mxlDataURL:h,userID:N}),limitManager:ue,storedSpansExpireTimeoutMS:s==null||(O=s[`session-visibility`])==null?void 0:O.storedSpansExpireTimeoutMS,storage:re,spanSessionManager:fe}),he=new pu(new Dd({appID:A,mxlDataURL:h,userID:N}))}let ge=$_({useDocumentTitleAsPageLabel:C,registerGlobally:b}),{tracerProvider:_e,mxlTraceManager:ve}=Z_({resource:se,spanSessionManager:fe,userManager:ae,spanExporters:r,spanProcessors:a,propagator:le?new Kd:o,contextManager:l,attributeScrubbers:de,registerGlobally:b,mxlSpanProcessor:pe,pageManager:ge});fe.setTracerProvider(_e);let{loggerProvider:ye,mxlLogManager:be}=Q_({resource:se,userManager:ae,logExporters:i,logProcessors:u,spanSessionManager:fe,limitManager:ue,attributeScrubbers:de,registerGlobally:b,mxlLogProcessor:he,sdkLocalStorage:re,pageManager:ge});fe.startSessionSpan({reason:`init`});let xe=typeof window<`u`&&window.__MXL_DISABLE_SESSION_RECORDER===!0,Se=M&&A&&N&&!xe?u_({resource:se,spanSessionManager:fe,tracerProvider:_e,appID:A,userID:N,mxlDataURL:h,recordUserSessions:w,sessionRecorder:ee,diagLogger:_}):Zd;Ds(b?{instrumentations:[G_(s,{spanSessionManager:fe,pageManager:ge,limitManager:ue}),...c]}:{tracerProvider:_e,loggerProvider:ye,instrumentations:[G_(s,{logManager:be,spanSessionManager:fe,pageManager:ge,limitManager:ue}),...c]}),_.info(`successfully initialized the SDK`);let Ce={setDynamicConfig:e=>{P.setConfig(e)},flush:function(){var e=ya(function*(){yield _e.forceFlush(),yield ye.forceFlush()});return function(){return e.apply(this,arguments)}}(),log:be,trace:ve,session:fe,user:ae,page:ge,sessionRecording:Se};return b&&Qd.register(Ce),fe.recordSDKStartupDuration(D.getNowMillis()-k),Ce}catch(e){let t=e instanceof Error?e.message:`Unknown error.`;return _.error(`failed to initialize the SDK: ${t}`),!1}},Y_=({registerGlobally:e,sdkLocalStorage:t})=>{let n=new Hc({storage:t});return e&&ms.setGlobalUserManager(n),n},X_=({limitManager:e,registerGlobally:t,sdkLocalStorage:n,sdkSessionStorage:r})=>{let i=new Fc({limitManager:e,storage:n,sessionStorage:r});return t&&$o.setGlobalSessionManager(i),i},Z_=({resource:e,spanSessionManager:t,userManager:n,spanExporters:r,spanProcessors:i=[],propagator:a=null,contextManager:o=null,attributeScrubbers:s,registerGlobally:c,mxlSpanProcessor:l,pageManager:u})=>{let d=[...i,hu(t),new Md,new Ld,new Gd({userManager:n}),new Hd({pageManager:u}),new Ud({attributeScrubbers:s})];r==null||r.forEach(e=>{d.push(new Ba(e))}),l&&d.push(l);let f=new io({resource:e,spanProcessors:d,spanLimits:{attributeCountLimit:Tc.maxAllowed.session_property*2,eventCountLimit:Tc.maxAllowed.breadcrumb*2}}),p=new Ic({tracerProvider:c?void 0:f});return c&&(ss.setGlobalTraceManager(p),f.register({contextManager:o||new to,propagator:a})),{tracerProvider:f,mxlTraceManager:p}},Q_=({resource:e,userManager:t,logExporters:n,logProcessors:r,spanSessionManager:i,limitManager:a,attributeScrubbers:o,registerGlobally:s,mxlLogProcessor:c,sdkLocalStorage:l,pageManager:u})=>{let d=[...r,new Nd({spanSessionManager:i}),new jd,new Fd,new Wd({userManager:t}),new Pd({attributeScrubbers:o}),new Vd({pageManager:u})];n==null||n.forEach(e=>{d.push(new pu(e))}),c&&d.push(c);let f=new cu({resource:e,processors:d}),p=new kc({spanSessionManager:i,limitManager:a,loggerProvider:s?void 0:f,storage:l});return s&&(Xs.setGlobalLoggerProvider(f),zo.setGlobalLogManager(p)),{loggerProvider:f,mxlLogManager:p}},$_=({useDocumentTitleAsPageLabel:e,registerGlobally:t})=>{let n=new Ac({useDocumentTitleAsPageLabel:e});return t&&Ko.setGlobalPageManager(n),n};return R(),Object.defineProperty(e,`DiagLogLevel`,{enumerable:!0,get:function(){return D}}),e.attributes=hs,e.getNavigationInstrumentation=fc,e.initSDK=J_,e.log=zo,e.page=Ko,e.session=$o,e.trace=ss,e.user=ms,e})({});
|
|
59
24
|
//# sourceMappingURL=mxl-web-sdk.js.map
|