@blueking/open-telemetry 0.0.32 → 0.0.33
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/README.md +20 -19
- package/dist/bk-rum.global.js +2 -2
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/plugin.d.ts +3 -0
- package/dist/index.js +461 -354
- package/dist/index.js.map +1 -1
- package/dist/plugins/web-vitals.d.ts +1 -1
- package/dist/schema/attributes.d.ts +1 -0
- package/dist/schema/span.d.ts +10 -0
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +1 -1
- package/skills/bk-rum-otele/evals/evals.json +1 -1
- package/skills/bk-rum-otele/references/actions.md +3 -3
- package/skills/bk-rum-otele/references/api.md +3 -3
- package/skills/bk-rum-otele/references/architecture.md +2 -2
- package/skills/bk-rum-otele/references/blank-screen.md +2 -2
- package/skills/bk-rum-otele/references/capabilities.md +17 -17
- package/skills/bk-rum-otele/references/configuration.md +1 -1
- package/skills/bk-rum-otele/references/data-model.md +3 -3
- package/skills/bk-rum-otele/references/errors-security.md +4 -4
- package/skills/bk-rum-otele/references/getting-started.md +3 -2
- package/skills/bk-rum-otele/references/network.md +5 -5
- package/skills/bk-rum-otele/references/performance.md +2 -2
- package/skills/bk-rum-otele/references/session-context.md +3 -3
- package/skills/bk-rum-otele/references/span-protocol.md +174 -265
- package/skills/bk-rum-otele/references/telemetry-reference.md +36 -33
- package/skills/bk-rum-otele/references/transport-sampling.md +2 -2
- package/skills/bk-rum-otele/references/troubleshooting.md +3 -3
- package/skills/bk-rum-otele/references/views-routing.md +4 -4
package/dist/bk-rum.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var BkOpenTelemetry=(function(){var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=e(e=0)),t),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=`1.9.1`,i=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function a(e){let t=new Set([e]),n=new Set,r=e.match(i);if(!r)return()=>!1;let a={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(a.prerelease!=null)return function(t){return t===e};function o(e){return n.add(e),!1}function s(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(i);if(!r)return o(e);let c={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return c.prerelease!=null||a.major!==c.major?o(e):a.major===0?a.minor===c.minor&&a.patch<=c.patch?s(e):o(e):a.minor<=c.minor?s(e):o(e)}}var o=a(r),s=r.split(`.`)[0],c=Symbol.for(`opentelemetry.js.api.${s}`),l=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function u(e,t,n,i=!1){var a;let o=l[c]=(a=l[c])==null?{version:r}:a;if(!i&&o[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(o.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${r}`);return n.error(t.stack||t.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${r}.`),!0}function d(e){var t,n;let r=(t=l[c])==null?void 0:t.version;if(!(!r||!o(r)))return(n=l[c])==null?void 0:n[e]}function f(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${r}.`);let n=l[c];n&&delete n[e]}var p=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return m(`debug`,this._namespace,e)}error(...e){return m(`error`,this._namespace,e)}info(...e){return m(`info`,this._namespace,e)}warn(...e){return m(`warn`,this._namespace,e)}verbose(...e){return m(`verbose`,this._namespace,e)}};function m(e,t,n){let r=d(`diag`);if(r)return r[e](t,...n)}var h;(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`})(h||(h={}));function g(e,t){e<h.NONE?e=h.NONE:e>h.ALL&&(e=h.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`,h.ERROR),warn:n(`warn`,h.WARN),info:n(`info`,h.INFO),debug:n(`debug`,h.DEBUG),verbose:n(`verbose`,h.VERBOSE)}}var _=`diag`,v=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=d(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:h.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=d(`diag`),s=g((i=n.logLevel)==null?h.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 u(`diag`,s,t,!0)},t.disable=()=>{f(_,t)},t.createComponentLogger=e=>new p(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},y=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}},b=Symbol(`BaggageEntryMetadata`),x=v.instance();function S(e={}){return new y(new Map(Object.entries(e)))}function C(e){return typeof e!=`string`&&(x.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:b,toString(){return e}}}function w(e){return Symbol.for(e)}var T=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}}},E=class{constructor(){}createGauge(e,t){return ae}createHistogram(e,t){return oe}createCounter(e,t){return ie}createUpDownCounter(e,t){return se}createObservableGauge(e,t){return le}createObservableCounter(e,t){return ce}createObservableUpDownCounter(e,t){return ue}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},D=class{},ee=class extends D{add(e,t){}},O=class extends D{add(e,t){}},k=class extends D{record(e,t){}},A=class extends D{record(e,t){}},te=class{addCallback(e){}removeCallback(e){}},j=class extends te{},ne=class extends te{},re=class extends te{},M=new E,ie=new ee,ae=new k,oe=new A,se=new O,ce=new j,le=new ne,ue=new re;function de(){return M}var fe={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},pe={set(e,t,n){e!=null&&(e[t]=n)}},me=class{active(){return T}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},he=`context`,ge=new me,_e=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return u(he,e,v.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 d(he)||ge}disable(){this._getContextManager().disable(),f(he,v.instance())}},N;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(N||(N={}));var ve={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:N.NONE},ye=class{constructor(e=ve){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){}},be=w(`OpenTelemetry Context Key SPAN`);function xe(e){return e.getValue(be)||void 0}function Se(){return xe(_e.getInstance().active())}function Ce(e,t){return e.setValue(be,t)}function we(e){return e.deleteValue(be)}function Te(e,t){return Ce(e,new ye(t))}function Ee(e){var t;return(t=xe(e))==null?void 0:t.spanContext()}var De=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 Oe(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(De[e.charCodeAt(t)]|0)+(De[e.charCodeAt(t+1)]|0)+(De[e.charCodeAt(t+2)]|0)+(De[e.charCodeAt(t+3)]|0);return n===t}function ke(e){return Oe(e,32)&&e!==`00000000000000000000000000000000`}function Ae(e){return Oe(e,16)&&e!==`0000000000000000`}function je(e){return ke(e.traceId)&&Ae(e.spanId)}function Me(e){return new ye(e)}var Ne=_e.getInstance(),Pe=class{startSpan(e,t,n=Ne.active()){if(t!=null&&t.root)return new ye;let r=n&&Ee(n);return Fe(r)&&je(r)?new ye(r):new ye}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?Ne.active():a,c=this.startSpan(e,i,s),l=Ce(s,c);return Ne.with(l,o,void 0,c)}};function Fe(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 Ie=new Pe,Le=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):Ie}},Re=new class{getTracer(e,t,n){return new Pe}},ze=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new Le(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Re:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}},Be;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Be||(Be={}));var Ve;(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`})(Ve||(Ve={}));var He;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(He||(He={}));var P=_e.getInstance(),F=v.instance(),Ue=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},We=w(`OpenTelemetry Baggage Key`);function Ge(e){return e.getValue(We)||void 0}function Ke(){return Ge(_e.getInstance().active())}function qe(e,t){return e.setValue(We,t)}function Je(e){return e.deleteValue(We)}var Ye=`propagation`,Xe=new Ue,Ze=class e{constructor(){this.createBaggage=S,this.getBaggage=Ge,this.getActiveBaggage=Ke,this.setBaggage=qe,this.deleteBaggage=Je}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return u(Ye,e,v.instance())}inject(e,t,n=pe){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=fe){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){f(Ye,v.instance())}_getGlobalPropagator(){return d(Ye)||Xe}}.getInstance(),Qe=`trace`,$e=class e{constructor(){this._proxyTracerProvider=new ze,this.wrapSpanContext=Me,this.isSpanContextValid=je,this.deleteSpan=we,this.getSpan=xe,this.getActiveSpan=Se,this.getSpanContext=Ee,this.setSpan=Ce,this.setSpanContext=Te}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=u(Qe,this._proxyTracerProvider,v.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return d(Qe)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){f(Qe,v.instance()),this._proxyTracerProvider=new ze}}.getInstance();function et(e){return typeof e==`object`&&!!e&&`addEventListener`in e&&typeof e.addEventListener==`function`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`}function tt(e){"@babel/helpers - typeof";return tt=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},tt(e)}var nt=t((()=>{}));function rt(e,t){if(tt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(tt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var it=t((()=>{nt()}));function at(e){var t=rt(e,`string`);return tt(t)==`symbol`?t:t+``}var ot=t((()=>{nt(),it()}));function I(e,t,n){return(t=at(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var L=t((()=>{ot()}));L();var st=`OT_ZONE_CONTEXT`,ct=class{constructor(){I(this,`_enabled`,!1)}_bindFunction(e,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}_bindListener(e,t){let n=t;return n.__ot_listeners===void 0?(n.__ot_listeners={},typeof n.addEventListener==`function`&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),typeof n.removeEventListener==`function`&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener)),t):t}_createZone(e,t){return Zone.current.fork({name:e,properties:{[st]:t},onCancelTask(e,t,n,r){return r.state===`notScheduled`||r.state===`running`?r:e.cancelTask(n,r)}})}_patchAddEventListener(e,t,n){let r=this;return function(i,a,o){e.__ot_listeners===void 0&&(e.__ot_listeners={});let s=e.__ot_listeners[i];s===void 0&&(s=new WeakMap,e.__ot_listeners[i]=s);let c=r.bind(n,a);return s.set(a,c),t.call(this,i,c,o)}}_patchRemoveEventListener(e,t){return function(n,r){if(e.__ot_listeners===void 0||e.__ot_listeners[n]===void 0)return t.call(this,n,r);let i=e.__ot_listeners[n],a=i.get(r);return i.delete(r),t.call(this,n,a||r)}}active(){return!this._enabled||!Zone.current?T:Zone.current.get(st)||T}bind(e,t){return typeof t==`function`?this._bindFunction(e,t):(et(t)&&this._bindListener(e,t),t)}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){let i=`otel:with`;return t.name&&(i+=`:${t.name}`),this._createZone(i,e).run(t,n,r)}},lt=Object.defineProperty,ut=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,ht=(e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gt=(e,t)=>{for(var n in t||(t={}))pt.call(t,n)&&ht(e,n,t[n]);if(ft)for(var n of ft(t))mt.call(t,n)&&ht(e,n,t[n]);return e},_t=(e,t)=>ut(e,dt(t)),R=(e,t,n)=>(ht(e,typeof t==`symbol`?t:t+``,n),n),z=globalThis;function B(e){return(z.__Zone_symbol_prefix||`__zone_symbol__`)+e}function vt(){let e=z.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t(`Zone`);let r=class e{constructor(e,t){R(this,`_parent`),R(this,`_name`),R(this,`_properties`),R(this,`_zoneDelegate`),this._parent=e,this._name=t?t.name||`unnamed`:`<root>`,this._properties=t&&t.properties||{},this._zoneDelegate=new o(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(z.Promise!==ee.ZoneAwarePromise)throw Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=e.current;for(;t.parent;)t=t.parent;return t}static get current(){return k.zone}static get currentTask(){return A}static __load_patch(r,i,a=!1){if(ee.hasOwnProperty(r)){let e=z[B(`forceDuplicateZoneCheck`)]===!0;if(!a&&e)throw Error(`Already loaded patch: `+r)}else if(!z[`__Zone_disable_`+r]){let a=`Zone:`+r;t(a),ee[r]=i(z,e,O),n(a,a)}}get parent(){return this._parent}get name(){return this._name}get(e){let t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw Error(`ZoneSpec required!`);return this._zoneDelegate.fork(this,e)}wrap(e,t){if(typeof e!=`function`)throw Error(`Expecting function got: `+e);let n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}run(e,t,n,r){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{k=k.parent}}runGuarded(e,t=null,n,r){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.parent}}runTask(e,t,n){if(e.zone!=this)throw Error(`A task can only be run in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);let r=e,{type:i,data:{isPeriodic:a=!1,isRefreshable:o=!1}={}}=e;if(e.state===y&&(i===D||i===E))return;let s=e.state!=S;s&&r._transitionTo(S,x);let c=A;A=r,k={parent:k,zone:this};try{i==E&&e.data&&!a&&!o&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{let t=e.state;if(t!==y&&t!==w)if(i==D||a||o&&t===b)s&&r._transitionTo(x,S,b);else{let e=r._zoneDelegates;this._updateTaskCount(r,-1),s&&r._transitionTo(y,S,y),o&&(r._zoneDelegates=e)}k=k.parent,A=c}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);let t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(w,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(x,b),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new s(T,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,i){return this.scheduleTask(new s(E,e,t,n,r,i))}scheduleEventTask(e,t,n,r,i){return this.scheduleTask(new s(D,e,t,n,r,i))}cancelTask(e){if(e.zone!=this)throw Error(`A task can only be cancelled in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);if(!(e.state!==x&&e.state!==S)){e._transitionTo(C,x,S);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(w,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){let n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}};R(r,`__symbol__`,B);let i=r,a={name:``,onHasTask:(e,t,n,r)=>e.hasTask(n,r),onScheduleTask:(e,t,n,r)=>e.scheduleTask(n,r),onInvokeTask:(e,t,n,r,i,a)=>e.invokeTask(n,r,i,a),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class o{constructor(e,t,n){R(this,`_zone`),R(this,`_taskCounts`,{microTask:0,macroTask:0,eventTask:0}),R(this,`_forkDlgt`),R(this,`_forkZS`),R(this,`_forkCurrZone`),R(this,`_interceptDlgt`),R(this,`_interceptZS`),R(this,`_interceptCurrZone`),R(this,`_invokeDlgt`),R(this,`_invokeZS`),R(this,`_invokeCurrZone`),R(this,`_handleErrorDlgt`),R(this,`_handleErrorZS`),R(this,`_handleErrorCurrZone`),R(this,`_scheduleTaskDlgt`),R(this,`_scheduleTaskZS`),R(this,`_scheduleTaskCurrZone`),R(this,`_invokeTaskDlgt`),R(this,`_invokeTaskZS`),R(this,`_invokeTaskCurrZone`),R(this,`_cancelTaskDlgt`),R(this,`_cancelTaskZS`),R(this,`_cancelTaskCurrZone`),R(this,`_hasTaskDlgt`),R(this,`_hasTaskDlgtOwner`),R(this,`_hasTaskZS`),R(this,`_hasTaskCurrZone`),this._zone=e,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let r=n&&n.onHasTask,i=t&&t._hasTaskZS;(r||i)&&(this._hasTaskZS=r?n:a,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=a,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=a,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=a,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new i(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,i):t.apply(n,r)}handleError(e,t){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t):!0}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else if(t.type==T)g(t);else throw Error(`Task is missing scheduleFn.`);return n}invokeTask(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error(`Task is not cancelable`);n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){let n=this._taskCounts,r=n[e],i=n[e]=r+t;if(i<0)throw Error(`More tasks executed then were scheduled.`);if(r==0||i==0){let t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class s{constructor(e,t,n,r,i,a){if(R(this,`type`),R(this,`source`),R(this,`invoke`),R(this,`callback`),R(this,`data`),R(this,`scheduleFn`),R(this,`cancelFn`),R(this,`_zone`,null),R(this,`runCount`,0),R(this,`_zoneDelegates`,null),R(this,`_state`,`notScheduled`),this.type=e,this.source=t,this.data=r,this.scheduleFn=i,this.cancelFn=a,!n)throw Error(`callback is not defined`);this.callback=n;let o=this;e===D&&r&&r.useG?this.invoke=s.invokeTask:this.invoke=function(){return s.invokeTask.call(z,o,this,arguments)}}static invokeTask(e,t,n){e||(e=this),te++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{te===1&&!z[d]&&_(),te--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,n){if(this._state===t||this._state===n)this._state=e,e==y&&(this._zoneDelegates=null);else throw Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?` or '`+n+`'`:``}, was '${this._state}'.`)}toString(){return this.data&&this.data.handleId!==void 0?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let c=B(`setTimeout`),l=B(`Promise`),u=B(`then`),d=B(`enable_native_microtask_draining`),f=[],p=!1,m;function h(e){var t;!m&&z[l]&&(m=z[l].resolve(0)),m?((t=m[u])==null?m.then:t).call(m,e):z[c](e,0)}function g(e){let t=z[d],n=t&&f.length===0&&!p,r=!t&&te===0&&f.length===0;(n||r)&&h(_),e&&f.push(e)}function _(){if(!p){for(p=!0;f.length;){let e=f;f=[];for(let t of e)try{t.zone.runTask(t,null,null)}catch(e){O.onUnhandledError(e)}}z[d]?(p=!1,O.microtaskDrainDone()):(O.microtaskDrainDone(),p=!1)}}let v={name:`NO ZONE`},y=`notScheduled`,b=`scheduling`,x=`scheduled`,S=`running`,C=`canceling`,w=`unknown`,T=`microTask`,E=`macroTask`,D=`eventTask`,ee={},O={symbol:B,currentZoneFrame:()=>k,onUnhandledError:j,microtaskDrainDone:j,scheduleMicroTask:g,showUncaughtError:()=>!i[B(`ignoreConsoleErrorUncaughtError`)],patchEventTarget:()=>[],patchOnProperties:j,patchMethod:()=>j,bindArguments:()=>[],patchThen:()=>j,patchMacroTask:()=>j,patchEventPrototype:()=>j,getGlobalObjects:()=>void 0,ObjectDefineProperty:()=>j,ObjectGetOwnPropertyDescriptor:()=>void 0,ObjectCreate:()=>void 0,ArraySlice:()=>[],patchClass:()=>j,wrapWithCurrentZone:()=>j,filterProperties:()=>[],attachOriginToPatched:()=>j,_redefineProperty:()=>j,patchCallbacks:()=>j,nativeScheduleMicroTask:h},k={parent:null,zone:new i(null,null)},A=null,te=0;function j(){}return n(`Zone`,`Zone`),i}function yt(){let e=globalThis,t=e[B(`forceDuplicateZoneCheck`)]===!0;if(e.Zone&&(t||typeof e.Zone.__symbol__!=`function`))throw Error(`Zone already loaded.`);return e.Zone!=null||(e.Zone=vt()),e.Zone}var bt=Object.getOwnPropertyDescriptor,xt=Object.defineProperty,St=Object.getPrototypeOf,Ct=Object.create,wt=Array.prototype.slice,Tt=`addEventListener`,Et=`removeEventListener`,Dt=B(Tt),Ot=B(Et),kt=`true`,At=`false`,jt=B(``);function Mt(e,t){return Zone.current.wrap(e,t)}function Nt(e,t,n,r,i){return Zone.current.scheduleMacroTask(e,t,n,r,i)}var V=B,Pt=typeof window<`u`,Ft=Pt?window:void 0,H=Pt&&Ft||globalThis,It=`removeAttribute`;function Lt(e,t){for(let n=e.length-1;n>=0;n--)typeof e[n]==`function`&&(e[n]=Mt(e[n],t+`_`+n));return e}function Rt(e,t){let n=e.constructor.name;for(let r=0;r<t.length;r++){let i=t[r],a=e[i];if(a){if(!zt(bt(e,i)))continue;e[i]=(e=>{let t=function(){return e.apply(this,Lt(arguments,n+`.`+i))};return en(t,e),t})(a)}}}function zt(e){return e?e.writable===!1?!1:!(typeof e.get==`function`&&e.set===void 0):!0}var Bt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope,Vt=!(`nw`in H)&&H.process!==void 0&&H.process.toString()===`[object process]`,Ht=!Vt&&!Bt&&!!(Pt&&Ft.HTMLElement),Ut=H.process!==void 0&&H.process.toString()===`[object process]`&&!Bt&&!!(Pt&&Ft.HTMLElement),Wt={},Gt=V(`enable_beforeunload`),Kt=function(e){if(e=e||H.event,!e)return;let t=Wt[e.type];t||(t=Wt[e.type]=V(`ON_PROPERTY`+e.type));let n=this||e.target||H,r=n[t],i;if(Ht&&n===Ft&&e.type===`error`){let t=e;i=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),i===!0&&e.preventDefault()}else i=r&&r.apply(this,arguments),e.type===`beforeunload`&&H[Gt]&&typeof i==`string`?e.returnValue=i:i!=null&&!i&&e.preventDefault();return i};function qt(e,t,n){let r=bt(e,t);if(!r&&n&&bt(n,t)&&(r={enumerable:!0,configurable:!0}),!r||!r.configurable)return;let i=V(`on`+t+`patched`);if(e.hasOwnProperty(i)&&e[i])return;delete r.writable,delete r.value;let a=r.get,o=r.set,s=t.slice(2),c=Wt[s];c||(c=Wt[s]=V(`ON_PROPERTY`+s)),r.set=function(t){let n=this;!n&&e===H&&(n=H),n&&(typeof n[c]==`function`&&n.removeEventListener(s,Kt),o==null||o.call(n,null),n[c]=t,typeof t==`function`&&n.addEventListener(s,Kt,!1))},r.get=function(){let n=this;if(!n&&e===H&&(n=H),!n)return null;let i=n[c];if(i)return i;if(a){let e=a.call(this);if(e)return r.set.call(this,e),typeof n[It]==`function`&&n.removeAttribute(t),e}return null},xt(e,t,r),e[i]=!0}function Jt(e,t,n){if(t)for(let r=0;r<t.length;r++)qt(e,`on`+t[r],n);else{let t=[];for(let n in e)n.slice(0,2)==`on`&&t.push(n);for(let r=0;r<t.length;r++)qt(e,t[r],n)}}var U=V(`originalInstance`);function Yt(e){let t=H[e];if(!t)return;H[V(e)]=t,H[e]=function(){let n=Lt(arguments,e);switch(n.length){case 0:this[U]=new t;break;case 1:this[U]=new t(n[0]);break;case 2:this[U]=new t(n[0],n[1]);break;case 3:this[U]=new t(n[0],n[1],n[2]);break;case 4:this[U]=new t(n[0],n[1],n[2],n[3]);break;default:throw Error(`Arg list too long.`)}},en(H[e],t);let n=new t(function(){}),r;for(r in n)e===`XMLHttpRequest`&&r===`responseBlob`||(function(t){typeof n[t]==`function`?H[e].prototype[t]=function(){return this[U][t].apply(this[U],arguments)}:xt(H[e].prototype,t,{set:function(n){typeof n==`function`?(this[U][t]=Mt(n,e+`.`+t),en(this[U][t],n)):this[U][t]=n},get:function(){return this[U][t]}})})(r);for(r in t)r!==`prototype`&&t.hasOwnProperty(r)&&(H[e][r]=t[r])}function Xt(e,t){typeof Object.getOwnPropertySymbols==`function`&&Object.getOwnPropertySymbols(e).forEach(n=>{let r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){r&&(!r.writable||typeof r.set!=`function`)||(e[n]=t)},enumerable:r?r.enumerable:!0,configurable:r?r.configurable:!0})})}var Zt=!1;function Qt(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=St(r);!r&&e[t]&&(r=e);let i=V(t),a=null;if(r&&(!(a=r[i])||!r.hasOwnProperty(i))&&(a=r[i]=r[t],zt(r&&bt(r,t)))){let e=n(a,i,t);r[t]=function(){return e(this,arguments)},en(r[t],a),Zt&&Xt(a,r[t])}return a}function $t(e,t,n){let r=null;function i(e){let t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=Qt(e,t,e=>function(t,r){let a=n(t,r);return a.cbIdx>=0&&typeof r[a.cbIdx]==`function`?Nt(a.name,r[a.cbIdx],a,i):e.apply(t,r)})}function en(e,t){e[V(`OriginalDelegate`)]=t}function tn(e){return typeof e==`function`}function nn(e){return typeof e==`number`}var rn={useG:!0},W={},an={},on=RegExp(`^`+jt+`(\\w+)(true|false)$`),sn=V(`propagationStopped`);function cn(e,t){let n=(t?t(e):e)+At,r=(t?t(e):e)+kt,i=jt+n,a=jt+r;W[e]={},W[e][At]=i,W[e][kt]=a}function ln(e,t,n,r){let i=r&&r.add||Tt,a=r&&r.rm||Et,o=r&&r.listeners||`eventListeners`,s=r&&r.rmAll||`removeAllListeners`,c=V(i),l=`.`+i+`:`,u=`prependListener`;``+u;let d=function(e,t,n){if(e.isRemoved)return;let r=e.callback;typeof r==`object`&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);let i;try{e.invoke(e,t,[n])}catch(e){i=e}let o=e.options;if(o&&typeof o==`object`&&o.once){let r=e.originalDelegate?e.originalDelegate:e.callback;t[a].call(t,n.type,r,o)}return i};function f(n,r,i){if(r=r||e.event,!r)return;let a=n||r.target||e,o=a[W[r.type][i?kt:At]];if(o){let e=[];if(o.length===1){let t=d(o[0],a,r);t&&e.push(t)}else{let t=o.slice();for(let n=0;n<t.length&&!(r&&r[sn]===!0);n++){let i=d(t[n],a,r);i&&e.push(i)}}if(e.length===1)throw e[0];for(let n=0;n<e.length;n++){let r=e[n];t.nativeScheduleMicroTask(()=>{throw r})}}}let p=function(e){return f(this,e,!1)},m=function(e){return f(this,e,!0)};function h(t,n){if(!t)return!1;let r=!0;n&&n.useG!==void 0&&(r=n.useG);let d=n&&n.vh,f=!0;n&&n.chkDup!==void 0&&(f=n.chkDup);let h=!1;n&&n.rt!==void 0&&(h=n.rt);let g=t;for(;g&&!g.hasOwnProperty(i);)g=St(g);if(!g&&t[i]&&(g=t),!g||g[c])return!1;let _=n&&n.eventNameToString,v={},y=g[c]=g[i],b=g[V(a)]=g[a],x=g[V(o)]=g[o],S=g[V(s)]=g[s],C;n&&n.prepend&&(C=g[V(n.prepend)]=g[n.prepend]);function w(e,t){return t?typeof e==`boolean`?{capture:e,passive:!0}:e?typeof e==`object`&&e.passive!==!1?_t(gt({},e),{passive:!0}):e:{passive:!0}:e}let T=function(e){if(!v.isExisting)return y.call(v.target,v.eventName,v.capture?m:p,v.options)},E=function(e){if(!e.isRemoved){let t=W[e.eventName],n;t&&(n=t[e.capture?kt:At]);let r=n&&e.target[n];if(r){for(let t=0;t<r.length;t++)if(r[t]===e){r.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),r.length===0&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return b.call(e.target,e.eventName,e.capture?m:p,e.options)},D=function(e){return y.call(v.target,v.eventName,e.invoke,v.options)},ee=function(e){return C.call(v.target,v.eventName,e.invoke,v.options)},O=function(e){return b.call(e.target,e.eventName,e.invoke,e.options)},k=r?T:D,A=r?E:O,te=(n==null?void 0:n.diff)||function(e,t){let n=typeof t;return n===`function`&&e.callback===t||n===`object`&&e.originalDelegate===t},j=Zone[V(`UNPATCHED_EVENTS`)],ne=e[V(`PASSIVE_EVENTS`)];function re(e){if(typeof e==`object`&&e){let t=gt({},e);return e.signal&&(t.signal=e.signal),t}return e}let M=function(t,i,a,o,s=!1,c=!1){return function(){let l=this||e,u=arguments[0];n&&n.transferEventName&&(u=n.transferEventName(u));let p=arguments[1];if(!p||Vt&&u===`uncaughtException`)return t.apply(this,arguments);let m=!1;if(typeof p!=`function`){if(!p.handleEvent)return t.apply(this,arguments);m=!0}if(d&&!d(t,p,l,arguments))return;let h=!!ne&&ne.indexOf(u)!==-1,g=re(w(arguments[2],h)),y=g==null?void 0:g.signal;if(y!=null&&y.aborted)return;if(j){for(let e=0;e<j.length;e++)if(u===j[e])return h?t.call(l,u,p,g):t.apply(this,arguments)}let b=g?typeof g==`boolean`?!0:g.capture:!1,x=g&&typeof g==`object`?g.once:!1,S=Zone.current,C=W[u];C||(cn(u,_),C=W[u]);let T=C[b?kt:At],E=l[T],D=!1;if(E){if(D=!0,f){for(let e=0;e<E.length;e++)if(te(E[e],p))return}}else E=l[T]=[];let ee,O=l.constructor.name,k=an[O];k&&(ee=k[u]),ee||(ee=O+i+(_?_(u):u)),v.options=g,x&&(v.options.once=!1),v.target=l,v.capture=b,v.eventName=u,v.isExisting=D;let A=r?rn:void 0;A&&(A.taskData=v),y&&(v.options.signal=void 0);let M=S.scheduleEventTask(ee,p,A,a,o);if(y){v.options.signal=y;let e=()=>M.zone.cancelTask(M);t.call(y,`abort`,e,{once:!0}),M.removeAbortListener=()=>y.removeEventListener(`abort`,e)}if(v.target=null,A&&(A.taskData=null),x&&(v.options.once=!0),typeof M.options!=`boolean`&&(M.options=g),M.target=l,M.capture=b,M.eventName=u,m&&(M.originalDelegate=p),c?E.unshift(M):E.push(M),s)return l}};return g[i]=M(y,l,k,A,h),C&&(g[u]=M(C,`.prependListener:`,ee,A,h,!0)),g[a]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=arguments[2],a=i?typeof i==`boolean`?!0:i.capture:!1,o=arguments[1];if(!o)return b.apply(this,arguments);if(d&&!d(b,o,t,arguments))return;let s=W[r],c;s&&(c=s[a?kt:At]);let l=c&&t[c];if(l)for(let e=0;e<l.length;e++){let n=l[e];if(te(n,o)){if(l.splice(e,1),n.isRemoved=!0,l.length===0&&(n.allRemoved=!0,t[c]=null,!a&&typeof r==`string`)){let e=jt+`ON_PROPERTY`+r;t[e]=null}return n.zone.cancelTask(n),h?t:void 0}}return b.apply(this,arguments)},g[o]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=[],a=un(t,_?_(r):r);for(let e=0;e<a.length;e++){let t=a[e],n=t.originalDelegate?t.originalDelegate:t.callback;i.push(n)}return i},g[s]=function(){let t=this||e,r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));let e=W[r];if(e){let n=e[At],i=e[kt],o=t[n],s=t[i];if(o){let e=o.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}if(s){let e=s.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}}}else{let e=Object.keys(t);for(let t=0;t<e.length;t++){let n=e[t],r=on.exec(n),i=r&&r[1];i&&i!==`removeListener`&&this[s].call(this,i)}this[s].call(this,`removeListener`)}if(h)return this},en(g[i],y),en(g[a],b),S&&en(g[s],S),x&&en(g[o],x),!0}let g=[];for(let e=0;e<n.length;e++)g[e]=h(n[e],r);return g}function un(e,t){if(!t){let n=[];for(let r in e){let i=on.exec(r),a=i&&i[1];if(a&&(!t||a===t)){let t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=W[t];n||(cn(t),n=W[t]);let r=e[n[At]],i=e[n[kt]];return r?i?r.concat(i):r.slice():i?i.slice():[]}function dn(e,t){let n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,`stopImmediatePropagation`,e=>function(t,n){t[sn]=!0,e&&e.apply(t,n)})}function fn(e,t){t.patchMethod(e,`queueMicrotask`,e=>function(e,t){Zone.current.scheduleMicroTask(`queueMicrotask`,t[0])})}var pn=V(`zoneTask`);function mn(e,t,n,r){let i=null,a=null;t+=r,n+=r;let o={};function s(t){let n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};let r=i.apply(e,n.args);return nn(r)?n.handleId=r:(n.handle=r,n.isRefreshable=tn(r.refresh)),t}function c(t){let{handle:n,handleId:r}=t.data;return a.call(e,n==null?r:n)}i=Qt(e,t,n=>function(i,a){var l;if(tn(a[0])){let e={isRefreshable:!1,isPeriodic:r===`Interval`,delay:r===`Timeout`||r===`Interval`?a[1]||0:void 0,args:a},n=a[0];a[0]=function(){try{return n.apply(this,arguments)}finally{let{handle:t,handleId:n,isPeriodic:r,isRefreshable:i}=e;!r&&!i&&(n?delete o[n]:t&&(t[pn]=null))}};let i=Nt(t,a[0],e,s,c);if(!i)return i;let{handleId:u,handle:d,isRefreshable:f,isPeriodic:p}=i.data;if(u)o[u]=i;else if(d&&(d[pn]=i,f&&!p)){let e=d.refresh;d.refresh=function(){let{zone:t,state:n}=i;return n===`notScheduled`?(i._state=`scheduled`,t._updateTaskCount(i,1)):n===`running`&&(i._state=`scheduling`),e.call(this)}}return(l=d==null?u:d)==null?i:l}else return n.apply(e,a)}),a=Qt(e,n,t=>function(n,r){let i=r[0],a;nn(i)?(a=o[i],delete o[i]):(a=i==null?void 0:i[pn],a?i[pn]=null:a=i),a!=null&&a.type?a.cancelFn&&a.zone.cancelTask(a):t.apply(e,r)})}function hn(e,t){let{isBrowser:n,isMix:r}=t.getGlobalObjects();!n&&!r||!e.customElements||!(`customElements`in e)||t.patchCallbacks(t,e.customElements,`customElements`,`define`,[`connectedCallback`,`disconnectedCallback`,`adoptedCallback`,`attributeChangedCallback`,`formAssociatedCallback`,`formDisabledCallback`,`formResetCallback`,`formStateRestoreCallback`])}function gn(e,t){if(Zone[t.symbol(`patchEventTarget`)])return;let{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:i,FALSE_STR:a,ZONE_SYMBOL_PREFIX:o}=t.getGlobalObjects();for(let e=0;e<n.length;e++){let t=n[e],s=t+a,c=t+i,l=o+s,u=o+c;r[t]={},r[t][a]=l,r[t][i]=u}let s=e.EventTarget;if(!(!s||!s.prototype))return t.patchEventTarget(e,t,[s&&s.prototype]),!0}function _n(e,t){t.patchEventPrototype(e,t)}function vn(e,t,n){if(!n||n.length===0)return t;let r=n.filter(t=>t.target===e);if(r.length===0)return t;let i=r[0].ignoreProperties;return t.filter(e=>i.indexOf(e)===-1)}function yn(e,t,n,r){e&&Jt(e,vn(e,t,n),r)}function bn(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith(`on`)&&e.length>2).map(e=>e.substring(2))}function xn(e,t){if(Vt&&!Ut||Zone[e.symbol(`patchEvents`)])return;let n=t.__Zone_ignore_on_properties,r=[];if(Ht){let e=window;r=r.concat([`Document`,`SVGElement`,`Element`,`HTMLElement`,`HTMLBodyElement`,`HTMLMediaElement`,`HTMLFrameSetElement`,`HTMLFrameElement`,`HTMLIFrameElement`,`HTMLMarqueeElement`,`Worker`]),yn(e,bn(e),n,St(e))}r=r.concat([`XMLHttpRequest`,`XMLHttpRequestEventTarget`,`IDBIndex`,`IDBRequest`,`IDBOpenDBRequest`,`IDBDatabase`,`IDBTransaction`,`IDBCursor`,`WebSocket`]);for(let e=0;e<r.length;e++){let i=t[r[e]];i!=null&&i.prototype&&yn(i.prototype,bn(i.prototype),n)}}function Sn(e){e.__load_patch(`timers`,e=>{let t=`clear`;mn(e,`set`,t,`Timeout`),mn(e,`set`,t,`Interval`),mn(e,`set`,t,`Immediate`)}),e.__load_patch(`requestAnimationFrame`,e=>{mn(e,`request`,`cancel`,`AnimationFrame`),mn(e,`mozRequest`,`mozCancel`,`AnimationFrame`),mn(e,`webkitRequest`,`webkitCancel`,`AnimationFrame`)}),e.__load_patch(`blocking`,(e,t)=>{let n=[`alert`,`prompt`,`confirm`];for(let r=0;r<n.length;r++){let i=n[r];Qt(e,i,(n,r,i)=>function(r,a){return t.current.run(n,e,a,i)})}}),e.__load_patch(`EventTarget`,(e,t,n)=>{_n(e,n),gn(e,n);let r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch(`MutationObserver`,(e,t,n)=>{Yt(`MutationObserver`),Yt(`WebKitMutationObserver`)}),e.__load_patch(`IntersectionObserver`,(e,t,n)=>{Yt(`IntersectionObserver`)}),e.__load_patch(`FileReader`,(e,t,n)=>{Yt(`FileReader`)}),e.__load_patch(`on_property`,(e,t,n)=>{xn(n,e)}),e.__load_patch(`customElements`,(e,t,n)=>{hn(e,n)}),e.__load_patch(`XHR`,(e,t)=>{c(e);let n=V(`xhrTask`),r=V(`xhrSync`),i=V(`xhrListener`),a=V(`xhrScheduled`),o=V(`xhrURL`),s=V(`xhrErrorBeforeScheduled`);function c(e){let c=e.XMLHttpRequest;if(!c)return;let l=c.prototype;function u(e){return e[n]}let d=l[Dt],f=l[Ot];if(!d){let t=e.XMLHttpRequestEventTarget;if(t){let e=t.prototype;d=e[Dt],f=e[Ot]}}let p=`readystatechange`,m=`scheduled`;function h(e){let r=e.data,o=r.target;o[a]=!1,o[s]=!1;let c=o[i];d||(d=o[Dt],f=o[Ot]),c&&f.call(o,p,c);let l=o[i]=()=>{if(o.readyState===o.DONE)if(!r.aborted&&o[a]&&e.state===m){let n=o[t.__symbol__(`loadfalse`)];if(o.status!==0&&n&&n.length>0){let i=e.invoke;e.invoke=function(){let n=o[t.__symbol__(`loadfalse`)];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);!r.aborted&&e.state===m&&i.call(e)},n.push(e)}else e.invoke()}else !r.aborted&&o[a]===!1&&(o[s]=!0)};return d.call(o,p,l),o[n]||(o[n]=e),x.apply(o,r.args),o[a]=!0,e}function g(){}function _(e){let t=e.data;return t.aborted=!0,S.apply(t.target,t.args)}let v=Qt(l,`open`,()=>function(e,t){return e[r]=t[2]==0,e[o]=t[1],v.apply(e,t)}),y=V(`fetchTaskAborting`),b=V(`fetchTaskScheduling`),x=Qt(l,`send`,()=>function(e,n){if(t.current[b]===!0||e[r])return x.apply(e,n);{let t={target:e,url:e[o],isPeriodic:!1,args:n,aborted:!1},r=Nt(`XMLHttpRequest.send`,g,t,h,_);e&&e[s]===!0&&!t.aborted&&r.state===m&&r.invoke()}}),S=Qt(l,`abort`,()=>function(e,n){let r=u(e);if(r&&typeof r.type==`string`){if(r.cancelFn==null||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(t.current[y]===!0)return S.apply(e,n)})}}),e.__load_patch(`geolocation`,e=>{e.navigator&&e.navigator.geolocation&&Rt(e.navigator.geolocation,[`getCurrentPosition`,`watchPosition`])}),e.__load_patch(`PromiseRejectionEvent`,(e,t)=>{function n(t){return function(n){un(e,t).forEach(r=>{let i=e.PromiseRejectionEvent;if(i){let e=new i(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[V(`unhandledPromiseRejectionHandler`)]=n(`unhandledrejection`),t[V(`rejectionHandledHandler`)]=n(`rejectionhandled`))}),e.__load_patch(`queueMicrotask`,(e,t,n)=>{fn(e,n)})}function Cn(e){e.__load_patch(`ZoneAwarePromise`,(e,t,n)=>{let r=Object.getOwnPropertyDescriptor,i=Object.defineProperty;function a(e){return e&&e.toString===Object.prototype.toString?(e.constructor&&e.constructor.name||``)+`: `+JSON.stringify(e):e?e.toString():Object.prototype.toString.call(e)}let o=n.symbol,s=[],c=e[o(`DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION`)]!==!1,l=o(`Promise`),u=o(`then`);n.onUnhandledError=e=>{if(n.showUncaughtError()){let t=e&&e.rejection;t?console.error(`Unhandled Promise rejection:`,t instanceof Error?t.message:t,`; Zone:`,e.zone.name,`; Task:`,e.task&&e.task.source,`; Value:`,t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;s.length;){let e=s.shift();try{e.zone.runGuarded(()=>{throw e.throwOriginal?e.rejection:e})}catch(e){f(e)}}};let d=o(`unhandledPromiseRejectionHandler`);function f(e){n.onUnhandledError(e);try{let n=t[d];typeof n==`function`&&n.call(this,e)}catch(e){}}function p(e){return e&&typeof e.then==`function`}function m(e){return e}function h(e){return k.reject(e)}let g=o(`state`),_=o(`value`),v=o(`finally`),y=o(`parentPromiseValue`),b=o(`parentPromiseState`);function x(e,t){return n=>{try{w(e,t,n)}catch(t){w(e,!1,t)}}}let S=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},C=o(`currentTaskTrace`);function w(e,r,o){let l=S();if(e===o)throw TypeError(`Promise resolved with itself`);if(e[g]===null){let u=null;try{(typeof o==`object`||typeof o==`function`)&&(u=o&&o.then)}catch(t){return l(()=>{w(e,!1,t)})(),e}if(r!==!1&&o instanceof k&&o.hasOwnProperty(g)&&o.hasOwnProperty(_)&&o[g]!==null)E(o),w(e,o[g],o[_]);else if(r!==!1&&typeof u==`function`)try{u.call(o,l(x(e,r)),l(x(e,!1)))}catch(t){l(()=>{w(e,!1,t)})()}else{e[g]=r;let l=e[_];if(e[_]=o,e[v]===v&&r===!0&&(e[g]=e[b],e[_]=e[y]),r===!1&&o instanceof Error){let e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&i(o,C,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)D(e,l[t++],l[t++],l[t++],l[t++]);if(l.length==0&&r==0){e[g]=0;let r=o;try{throw Error(`Uncaught (in promise): `+a(o)+(o&&o.stack?`
|
|
2
|
-
`+o.stack:``))}catch(e){r=e}c&&(r.throwOriginal=!0),r.rejection=o,r.promise=e,r.zone=t.current,r.task=t.currentTask,s.push(r),n.scheduleMicroTask()}}}return e}let T=o(`rejectionHandledHandler`);function E(e){if(e[g]===0){try{let n=t[T];n&&typeof n==`function`&&n.call(this,{rejection:e[_],promise:e})}catch(e){}e[g]=!1;for(let t=0;t<s.length;t++)e===s[t].promise&&s.splice(t,1)}}function D(e,t,n,r,i){E(e);let a=e[g],o=a?typeof r==`function`?r:m:typeof i==`function`?i:h;t.scheduleMicroTask(`Promise.then`,()=>{try{let r=e[_],i=!!n&&v===n[v];i&&(n[y]=r,n[b]=a),w(n,!0,t.run(o,void 0,i&&o!==h&&o!==m?[]:[r]))}catch(e){w(n,!1,e)}},n)}let ee=function(){},O=e.AggregateError;class k{static toString(){return`function ZoneAwarePromise() { [native code] }`}static resolve(e){return e instanceof k?e:w(new this(null),!0,e)}static reject(e){return w(new this(null),!1,e)}static withResolvers(){let e={};return e.promise=new k((t,n)=>{e.resolve=t,e.reject=n}),e}static any(e){if(!e||typeof e[Symbol.iterator]!=`function`)return Promise.reject(new O([],`All promises were rejected`));let t=[],n=0;try{for(let r of e)n++,t.push(k.resolve(r))}catch(e){return Promise.reject(new O([],`All promises were rejected`))}if(n===0)return Promise.reject(new O([],`All promises were rejected`));let r=!1,i=[];return new k((e,a)=>{for(let o=0;o<t.length;o++)t[o].then(t=>{r||(r=!0,e(t))},e=>{i.push(e),n--,n===0&&(r=!0,a(new O(i,`All promises were rejected`)))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function i(e){t(e)}function a(e){n(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(i,a);return r}static all(e){return k.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof k?this:k).allWithCallback(e,{thenCallback:e=>({status:`fulfilled`,value:e}),errorCallback:e=>({status:`rejected`,reason:e})})}static allWithCallback(e,t){let n,r,i=new this((e,t)=>{n=e,r=t}),a=2,o=0,s=[];for(let i of e){p(i)||(i=this.resolve(i));let e=o;try{i.then(r=>{s[e]=t?t.thenCallback(r):r,a--,a===0&&n(s)},i=>{t?(s[e]=t.errorCallback(i),a--,a===0&&n(s)):r(i)})}catch(e){r(e)}a++,o++}return a-=2,a===0&&n(s),i}constructor(e){let t=this;if(!(t instanceof k))throw Error(`Must be an instanceof Promise.`);t[g]=null,t[_]=[];try{let n=S();e&&e(n(x(t,!0)),n(x(t,!1)))}catch(e){w(t,!1,e)}}get[Symbol.toStringTag](){return`Promise`}get[Symbol.species](){return k}then(e,n){var r;let i=(r=this.constructor)==null?void 0:r[Symbol.species];(!i||typeof i!=`function`)&&(i=this.constructor||k);let a=new i(ee),o=t.current;return this[g]==null?this[_].push(o,a,e,n):D(this,o,a,e,n),a}catch(e){return this.then(null,e)}finally(e){var n;let r=(n=this.constructor)==null?void 0:n[Symbol.species];(!r||typeof r!=`function`)&&(r=k);let i=new r(ee);i[v]=v;let a=t.current;return this[g]==null?this[_].push(a,i,e,e):D(this,a,i,e,e),i}}k.resolve=k.resolve,k.reject=k.reject,k.race=k.race,k.all=k.all;let A=e[l]=e.Promise;e.Promise=k;let te=o(`thenPatched`);function j(e){let t=e.prototype,n=r(t,`then`);if(n&&(n.writable===!1||!n.configurable))return;let i=t.then;t[u]=i,e.prototype.then=function(e,t){return new k((e,t)=>{i.call(this,e,t)}).then(e,t)},e[te]=!0}n.patchThen=j;function ne(e){return function(t,n){let r=e.apply(t,n);if(r instanceof k)return r;let i=r.constructor;return i[te]||j(i),r}}if(A){j(A);let t=A.try;t&&typeof t==`function`&&(k.try=t),Qt(e,`fetch`,e=>ne(e))}return Promise[t.__symbol__(`uncaughtPromiseErrors`)]=s,k})}function wn(e){e.__load_patch(`toString`,e=>{let t=Function.prototype.toString,n=V(`OriginalDelegate`),r=V(`Promise`),i=V(`Error`),a=function(){if(typeof this==`function`){let a=this[n];if(a)return typeof a==`function`?t.call(a):Object.prototype.toString.call(a);if(this===Promise){let n=e[r];if(n)return t.call(n)}if(this===Error){let n=e[i];if(n)return t.call(n)}}return t.call(this)};a[n]=t,Function.prototype.toString=a;let o=Object.prototype.toString;Object.prototype.toString=function(){return typeof Promise==`function`&&this instanceof Promise?`[object Promise]`:o.call(this)}})}function Tn(e,t,n,r,i){let a=Zone.__symbol__(r);if(t[a])return;let o=t[a]=t[r];t[r]=function(a,s,c){return s&&s.prototype&&i.forEach(function(t){let i=`${n}.${r}::`+t,a=s.prototype;try{if(a.hasOwnProperty(t)){let n=e.ObjectGetOwnPropertyDescriptor(a,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,i),e._redefineProperty(s.prototype,t,n)):a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}else a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}catch(e){}}),o.call(t,a,s,c)},e.attachOriginToPatched(t[r],o)}function En(e){e.__load_patch(`util`,(e,t,n)=>{let r=bn(e);n.patchOnProperties=Jt,n.patchMethod=Qt,n.bindArguments=Lt,n.patchMacroTask=$t;let i=t.__symbol__(`BLACK_LISTED_EVENTS`),a=t.__symbol__(`UNPATCHED_EVENTS`);e[a]&&(e[i]=e[a]),e[i]&&(t[i]=t[a]=e[i]),n.patchEventPrototype=dn,n.patchEventTarget=ln,n.ObjectDefineProperty=xt,n.ObjectGetOwnPropertyDescriptor=bt,n.ObjectCreate=Ct,n.ArraySlice=wt,n.patchClass=Yt,n.wrapWithCurrentZone=Mt,n.filterProperties=vn,n.attachOriginToPatched=en,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Tn,n.getGlobalObjects=()=>({globalSources:an,zoneSymbolEventNames:W,eventNames:r,isBrowser:Ht,isMix:Ut,isNode:Vt,TRUE_STR:kt,FALSE_STR:At,ZONE_SYMBOL_PREFIX:jt,ADD_EVENT_LISTENER_STR:Tt,REMOVE_EVENT_LISTENER_STR:Et})})}function Dn(e){Cn(e),wn(e),En(e)}var On=yt();Dn(On),Sn(On);var kn=w(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function An(e){return e.setValue(kn,!0)}function jn(e){return e.getValue(kn)===!0}var Mn=`baggage`,Nn=4096;function Pn(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Fn(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 In(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=C(e.substring(t+1))),{key:o,value:s,metadata:c}}var Ln=class{inject(e,t,n){let r=Ze.getBaggage(e);if(!r||jn(e))return;let i=Pn(Fn(r).filter(e=>e.length<=Nn).slice(0,180));i.length>0&&n.set(t,Mn,i)}extract(e,t,n){let r=n.get(t,Mn),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=In(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:Ze.setBaggage(e,Ze.createBaggage(a))}fields(){return[Mn]}};function Rn(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!zn(n)){F.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Bn(r)){F.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function zn(e){return typeof e==`string`&&e!==``}function Bn(e){return e==null?!0:Array.isArray(e)?Vn(e):Hn(typeof e)}function Vn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Hn(e)){t=e;continue}return!1}return!1}}return!0}function Hn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Un(){return e=>{F.error(Wn(e))}}function Wn(e){return typeof e==`string`?e:JSON.stringify(Gn(e))}function Gn(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 Kn=Un();function qn(e){try{Kn(e)}catch(e){}}var Jn=`2.7.1`,Yn=`exception.message`,Xn=`exception.stacktrace`,Zn=`exception.type`,Qn=`service.name`,$n=`telemetry.sdk.language`,er=`webjs`,tr=`telemetry.sdk.name`,nr=`telemetry.sdk.version`,rr=`process.runtime.name`,ir={[tr]:`opentelemetry`,[rr]:`browser`,[$n]:er,[nr]:Jn},ar=performance,or=9,sr=Math.pow(10,6),cr=Math.pow(10,or);function lr(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*sr)]}function ur(e){return hr(lr(ar.timeOrigin),lr(typeof e==`number`?e:ar.now()))}function dr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=cr),[n,r]}function fr(e){return e[0]*cr+e[1]}function pr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function mr(e){return pr(e)||typeof e==`number`||e instanceof Date}function hr(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=cr&&(n[1]-=cr,n[0]+=1),n}var gr;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(gr||(gr={})),L();var _r=class{constructor(e={}){var t;I(this,`_propagators`,void 0),I(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){F.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){F.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},vr=`[_0-9a-z-*/]`,yr=`[a-z]${vr}{0,255}`,br=`[a-z0-9]${vr}{0,240}@[a-z]${vr}{0,13}`,xr=RegExp(`^(?:${yr}|${br})$`),Sr=/^[ -~]{0,255}[!-~]$/,Cr=/,|=/;function wr(e){return xr.test(e)}function Tr(e){return Sr.test(e)&&!Cr.test(e)}L();var Er=32,Dr=512,Or=`,`,kr=`=`,Ar=class e{constructor(e){I(this,`_length`,void 0),I(this,`_rawTraceState`,void 0),I(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!wr(e)||!Tr(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>Dr)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=Or+e),e=`${n[0]}${kr}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Or),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(kr);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!wr(a)||!Tr(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>Dr)&&(t.set(a,o),n=s,t.size>=Er))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}},jr=`traceparent`,Mr=`tracestate`,Nr=`00`,Pr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Fr(e){let t=Pr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Ir=class{inject(e,t,n){let r=$e.getSpanContext(e);if(!r||jn(e)||!je(r))return;let i=`${Nr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||N.NONE).toString(16)}`;n.set(t,jr,i),r.traceState&&n.set(t,Mr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,jr);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Fr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Mr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Ar(typeof e==`string`?e:void 0)}return $e.setSpanContext(e,a)}fields(){return[jr,Mr]}},Lr=`[object Object]`,Rr=`[object Null]`,zr=`[object Undefined]`,Br=Function.prototype.toString,Vr=Br.call(Object),Hr=Object.getPrototypeOf,Ur=Object.prototype,Wr=Ur.hasOwnProperty,Gr=Symbol?Symbol.toStringTag:void 0,Kr=Ur.toString;function qr(e){if(!Jr(e)||Yr(e)!==Lr)return!1;let t=Hr(e);if(t===null)return!0;let n=Wr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Br.call(n)===Vr}function Jr(e){return typeof e==`object`&&!!e}function Yr(e){return e==null?e===void 0?zr:Rr:Gr&&Gr in Object(e)?Xr(e):Zr(e)}function Xr(e){let t=Wr.call(e,Gr),n=e[Gr],r=!1;try{e[Gr]=void 0,r=!0}catch(e){}let i=Kr.call(e);return r&&(t?e[Gr]=n:delete e[Gr]),i}function Zr(e){return Kr.call(e)}var Qr=20;function $r(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=ti(t,e.shift(),0,n);return t}function ei(e){return ri(e)?e.slice():e}function ti(e,t,n=0,r){let i;if(!(n>Qr)){if(n++,oi(e)||oi(t)||ii(t))i=ei(t);else if(ri(e)){if(i=e.slice(),ri(t))for(let e=0,n=t.length;e<n;e++)i.push(ei(t[e]));else if(ai(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]=ei(t[r]))}}}else if(ai(e))if(ai(t)){if(!si(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(oi(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(ni(e,s,r)||ni(t,s,r))delete i[s];else{if(ai(a)&&ai(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]=ti(i[s],c,n,r)}}}}else i=t;return i}}function ni(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 ri(e){return Array.isArray(e)}function ii(e){return typeof e==`function`}function ai(e){return!oi(e)&&!ri(e)&&!ii(e)&&typeof e==`object`}function oi(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function si(e,t){return!(!qr(e)||!qr(t))}L();var ci=class{constructor(){I(this,`_promise`,void 0),I(this,`_resolve`,void 0),I(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)}};L();var li=class{constructor(e,t){I(this,`_isCalled`,!1),I(this,`_deferred`,new ci),I(this,`_callback`,void 0),I(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 ui(e,t){return new Promise(n=>{P.with(An(P.active()),()=>{e.export(t,n)})})}var di={_export:ui};L();var fi=class{constructor(e){I(this,`_delegate`,void 0),this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};L();var pi=class extends Error{constructor(e,t,n){super(e),I(this,`code`,void 0),I(this,`name`,`OTLPExporterError`),I(this,`data`,void 0),this.data=n,this.code=t}};function mi(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 G(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){mi(a,r,i,o,s,`next`,e)}function s(e){mi(a,r,i,o,s,`throw`,e)}o(void 0)})}}function hi(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function gi(e){if(e!=null)return G(function*(){return e})}function _i(e,t,n){var r,i,a,o,s,c;return{timeoutMillis:hi((r=(i=e.timeoutMillis)==null?t.timeoutMillis:i)==null?n.timeoutMillis:r),concurrencyLimit:(a=(o=e.concurrencyLimit)==null?t.concurrencyLimit:o)==null?n.concurrencyLimit:a,compression:(s=(c=e.compression)==null?t.compression:c)==null?n.compression:s}}function vi(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}L();var yi=class{constructor(e){I(this,`_concurrencyLimit`,void 0),I(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 G(function*(){yield Promise.all(e._sendingPromises)})()}};function bi(e){return new yi(e.concurrencyLimit)}function xi(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function Si(){return{handleResponse(e){e==null||!xi(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||F.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}L();var Ci=class{constructor(e,t,n,r,i){I(this,`_diagLogger`,void 0),I(this,`_transport`,void 0),I(this,`_serializer`,void 0),I(this,`_responseHandler`,void 0),I(this,`_promiseQueue`,void 0),I(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=F.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:gr.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:gr.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:gr.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:gr.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:gr.FAILED,error:(n=e.error)==null?new pi(`Export failed with retryable status`):n})}else t({code:gr.FAILED,error:new pi(`Export failed with unknown error`)})},e=>t({code:gr.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return G(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function wi(e,t){return new Ci(e.transport,e.serializer,Si(),e.promiseHandler,t.timeout)}function Ti(e,t,n){return wi({transport:n,serializer:t,promiseHandler:bi(e)},{timeout:e.timeoutMillis})}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 K(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){I(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}var q=t((()=>{L()})),Di;function Oi(){if(Di===void 0)try{let e=globalThis.process.argv0;Di=e?`unknown_service:${e}`:`unknown_service`}catch(e){Di=`unknown_service`}return Di}var ki=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;L();var Ai=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Ni(t),r._asyncAttributesPending=t.filter(([e,t])=>ki(t)).length>0,r}constructor(e,t){var n;I(this,`_rawAttributes`,void 0),I(this,`_asyncAttributesPending`,!1),I(this,`_schemaUrl`,void 0),I(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(ki(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Ni(this._rawAttributes),this._schemaUrl=Pi(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return G(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,ki(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&F.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(ki(n)){F.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=Fi(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function ji(e,t){return Ai.FromAttributeList(Object.entries(e),t)}function Mi(){return ji({[Qn]:Oi(),[$n]:ir[$n],[tr]:ir[tr],[nr]:ir[nr]})}function Ni(e){return e.map(([e,t])=>ki(t)?[e,t.catch(t=>{F.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Pi(e){if(typeof e==`string`||e===void 0)return e;F.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Fi(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;F.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}function Ii(e,t){let n={attributes:Ri(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function Li(e){return{name:e.name,version:e.version}}function Ri(e,t){return Object.keys(e).map(n=>zi(n,e[n],t))}function zi(e,t,n){return{key:e,value:Bi(t,n)}}function Bi(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]=Bi(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:Bi(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}function Vi(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Hi(e){return Vi(e).toString()}var Ui=typeof BigInt<`u`?Hi:fr;function Wi(e){return e}var Gi={encodeHrTime:Ui,encodeSpanContext:Wi,encodeOptionalSpanContext:Wi,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(``))}},Ki=256,qi=512;function Ji(e,t){let n=e&255|Ki;return t&&(n|=qi),n}function Yi(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:Ri(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Zi(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>Xi(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Ji(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function Xi(e,t){var n;return{attributes:e.attributes?Ri(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:Ji(e.context.traceFlags,e.context.isRemote)}}function Zi(e,t){return{attributes:e.attributes?Ri(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Qi(e,t){return{resourceSpans:ea(e,t)}}function $i(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 ea(e,t){let n=$i(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=>Yi(e,t));o.push({scope:Li(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Ii(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var ta={serializeRequest:e=>{let t=Qi(e,Gi);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 F.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};L();var na=5,ra=1e3,ia=5e3,aa=1.5,oa=.2;function sa(){return 2*oa*Math.random()-oa}var ca=class{constructor(e){I(this,`_transport`,void 0),this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}send(e,t){var n=this;return G(function*(){let r=na,i=ra,a=Date.now()+t,o=yield n._transport.send(e,t);for(;o.status===`retryable`&&r>0;){var s;r--;let t=Math.max(Math.min(i*(1+sa()),ia),0);i*=aa;let c=(s=o.retryInMillis)==null?t:s,l=a-Date.now();if(c>l)return F.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),o;F.verbose(`Scheduling export retry in ${Math.round(c)}ms`),o=yield n.retry(e,l,c)}return o.status===`success`?F.verbose(`Export succeeded after ${na-r} retry attempts.`):o.status===`retryable`?F.info(`Export failed after maximum retry attempts (${na}).`):F.info(`Export failed with non-retryable error: ${o.error}`),o})()}shutdown(){return this._transport.shutdown()}};function la(e){return new ca(e.transport)}function ua(e){return e===429||e===502||e===503||e===504}function da(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}L();var fa=60*1024,pa=9,ma=0,ha=0,ga=class{constructor(e){I(this,`_parameters`,void 0),this._parameters=e}send(e,t){var n=this;return G(function*(){let r=new AbortController,i=setTimeout(()=>r.abort(),t),a=globalThis.fetch;typeof a.__original==`function`&&(a=a.__original);let o=e.byteLength,s=ma+o>fa,c=!s&&!(ha>=pa);if(c)ma+=o,ha++;else{let e=s?`size limit`:`count limit`;F.debug(`keepalive disabled: ${(o/1024).toFixed(1)}KB payload, ${ha} pending (${e})`)}try{let t=new URL(n._parameters.url),i=yield a(t.href,{method:`POST`,headers:yield n._parameters.headers(),body:e,signal:r.signal,keepalive:c,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(F.debug(`export response success (status: ${i.status})`),{status:`success`}):ua(i.status)?(F.warn(`export response retryable (status: ${i.status})`),{status:`retryable`,retryInMillis:da(i.headers.get(`Retry-After`))}):(F.error(`export response failure (status: ${i.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${i.status}`)})}catch(e){return va(e)?(F.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(F.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(i),c&&(ma-=o,ha--)}})()}shutdown(){}};function _a(e){return new ga(e)}function va(e){return e instanceof TypeError&&!e.cause}function ya(e,t){return Ti(e,t,la({transport:_a(e)}))}function ba(e){let t={};return Object.entries(e==null?{}:e).forEach(([e,n])=>{n===void 0?F.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}q();function xa(e,t,n){return G(function*(){let r=K({},yield n()),i={};return t!=null&&Object.assign(i,yield t()),e!=null&&Object.assign(i,ba(yield e())),Object.assign(i,r)})}function Sa(e){if(e!=null)try{var t;let n=(t=globalThis.location)==null?void 0:t.href;return new URL(e,n).href}catch(t){throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function Ca(e,t,n){var r,i;return K(K({},_i(e,t,n)),{},{headers:xa(e.headers,t.headers,n.headers),url:(r=(i=Sa(e.url))==null?t.url:i)==null?n.url:r})}function wa(e,t){return K(K({},vi()),{},{headers:function(){var t=G(function*(){return e});return function(){return t.apply(this,arguments)}}(),url:`http://localhost:4318/`+t})}function Ta(e){return typeof e.headers==`function`?e.headers:gi(e.headers)}function Ea(e,t,n){return Ca({url:e.url,timeoutMillis:e.timeoutMillis,headers:Ta(e),concurrencyLimit:e.concurrencyLimit},{},wa(n,t))}function Da(e,t,n,r){return ya(Ea(e,n,r),t)}var Oa=class extends fi{constructor(e={}){super(Da(e,ta,`v1/traces`,{"Content-Type":`application/json`}))}},ka=`exception`;L();var Aa=class{constructor(e){var t,n;I(this,`_spanContext`,void 0),I(this,`kind`,void 0),I(this,`parentSpanContext`,void 0),I(this,`attributes`,{}),I(this,`links`,[]),I(this,`events`,[]),I(this,`startTime`,void 0),I(this,`resource`,void 0),I(this,`instrumentationScope`,void 0),I(this,`_droppedAttributesCount`,0),I(this,`_droppedEventsCount`,0),I(this,`_droppedLinksCount`,0),I(this,`_attributesCount`,0),I(this,`name`,void 0),I(this,`status`,{code:He.UNSET}),I(this,`endTime`,[0,0]),I(this,`_ended`,!1),I(this,`_duration`,[-1,-1]),I(this,`_spanProcessor`,void 0),I(this,`_spanLimits`,void 0),I(this,`_attributeValueLengthLimit`,void 0),I(this,`_recordEndMetrics`,void 0),I(this,`_performanceStartTime`,void 0),I(this,`_performanceOffset`,void 0),I(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=ar.now(),this._performanceOffset=r-(this._performanceStartTime+ar.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 F.warn(`Invalid attribute key: ${e}`),this;if(!Bn(t))return F.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 F.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&F.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),mr(t)&&(mr(n)||(n=t),t=void 0);let i=Rn(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&&F.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Rn(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===He.UNSET||this.status.code===He.OK)return this;let t={code:e.code};return e.code===He.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&F.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()){F.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=dr(this.startTime,this.endTime),this._duration[0]<0&&(F.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&&F.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&F.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<=ar.now())return ur(e+this._performanceOffset);if(typeof e==`number`)return lr(e);if(e instanceof Date)return lr(e.getTime());if(pr(e))return e;if(this._startTimeProvided)return lr(Date.now());let t=ar.now()-this._performanceStartTime;return hr(this.startTime,lr(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Yn]=e:e&&(e.code?n[Zn]=e.code.toString():e.name&&(n[Zn]=e.name),e.message&&(n[Yn]=e.message),e.stack&&(n[Xn]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(ka,n,t):F.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}}`);F.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?(F.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}},J;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(J||(J={}));var ja=class{shouldSample(){return{decision:J.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Ma=class{shouldSample(){return{decision:J.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};L();var Na=class{constructor(e){var t,n,r,i;I(this,`_root`,void 0),I(this,`_remoteParentSampled`,void 0),I(this,`_remoteParentNotSampled`,void 0),I(this,`_localParentSampled`,void 0),I(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(qn(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Ma),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Ma:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new ja:n,this._localParentSampled=(r=e.localParentSampled)==null?new Ma:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new ja:i}shouldSample(e,t,n,r,i,a){let o=$e.getSpanContext(e);return!o||!je(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&N.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&N.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()}}`}};L();var Pa=class{constructor(e=0){I(this,`_ratio`,void 0),I(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:ke(t)&&this._accumulate(t)<this._upperBound?J.RECORD_AND_SAMPLED:J.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}},Fa;(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`})(Fa||(Fa={}));var Ia=1;function La(){var e,t,n,r,i,a,o,s;return{sampler:Ra(),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 Ra(){var e;let t=(e=void 0)==null?Fa.ParentBasedAlwaysOn:e;switch(t){case Fa.AlwaysOn:return new Ma;case Fa.AlwaysOff:return new ja;case Fa.ParentBasedAlwaysOn:return new Na({root:new Ma});case Fa.ParentBasedAlwaysOff:return new Na({root:new ja});case Fa.TraceIdRatio:return new Pa(za());case Fa.ParentBasedTraceIdRatio:return new Na({root:new Pa(za())});default:return F.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Fa.ParentBasedAlwaysOn}".`),new Na({root:new Ma})}}function za(){return F.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ia}.`),Ia}var Ba=1/0;function Va(e){let t={sampler:Ra()},n=La(),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 Ha(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?Ba:s,Object.assign({},e,{spanLimits:p})}L();var Ua=class{constructor(e,t){var n,r,i,a;I(this,`_maxExportBatchSize`,void 0),I(this,`_maxQueueSize`,void 0),I(this,`_scheduledDelayMillis`,void 0),I(this,`_exportTimeoutMillis`,void 0),I(this,`_exporter`,void 0),I(this,`_isExporting`,!1),I(this,`_finishedSpans`,[]),I(this,`_timer`,void 0),I(this,`_shutdownOnce`,void 0),I(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 li(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(F.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&N.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&&F.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(F.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);P.with(An(P.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===gr.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=>{qn(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,qn(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)}};L();var Wa=class extends Ua{constructor(e,t){super(e,t),I(this,`_visibilityChangeListener`,void 0),I(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=>{qn(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{qn(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))}},Ga=16,Ka=8,qa=new Uint8Array(Ga),Ja=new Uint8Array(Ka),Ya=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Xa(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 Za(e){let t=``;for(let n=0;n<e.length;n++)t+=Ya[e[n]];return t}var Qa=class{generateTraceId(){return Xa(qa),Za(qa)}generateSpanId(){return Xa(Ja),Za(Ja)}},$a=`otel.span.parent.origin`,eo=`otel.span.sampling_result`,to=`otel.sdk.span.live`,no=`otel.sdk.span.started`;L();var ro=class{constructor(e){I(this,`startedSpans`,void 0),I(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(no,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(to,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=ao(t);if(this.startedSpans.add(1,{[$a]:io(e),[eo]:n}),t===J.NOT_RECORD)return()=>{};let r={[eo]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function io(e){return e?e.isRemote?`remote`:`local`:`none`}function ao(e){switch(e){case J.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case J.RECORD:return`RECORD_ONLY`;case J.NOT_RECORD:return`DROP`}}var oo=`2.7.1`;L();var so=class{constructor(e,t,n,r){I(this,`_sampler`,void 0),I(this,`_generalLimits`,void 0),I(this,`_spanLimits`,void 0),I(this,`_idGenerator`,void 0),I(this,`instrumentationScope`,void 0),I(this,`_resource`,void 0),I(this,`_spanProcessor`,void 0),I(this,`_tracerMetrics`,void 0);let i=Va(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Qa,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,oo):de();this._tracerMetrics=new ro(a)}startSpan(e,t={},n=P.active()){var r,i,a;t.root&&(n=$e.deleteSpan(n));let o=$e.getSpan(n);if(jn(n))return F.debug(`Instrumentation suppressed, returning Noop Span`),$e.wrapSpanContext(ve);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!$e.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?Ve.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:Rn(e.attributes)})),m=Rn(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===Be.RECORD_AND_SAMPLED?N.SAMPLED:N.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===Be.NOT_RECORD)return F.debug(`Recording is off, propagating context in a non-recording span`),$e.wrapSpanContext(v);let y=Rn(Object.assign(m,h.attributes));return new Aa({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?P.active():i,l=this.startSpan(e,a,c),u=$e.setSpan(c,l);return P.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};L();var co=class{constructor(e){I(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=>{qn(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)})}};L();var lo;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(lo||(lo={}));var uo=class{constructor(e={}){var t,n;I(this,`_config`,void 0),I(this,`_tracers`,new Map),I(this,`_resource`,void 0),I(this,`_activeSpanProcessor`,void 0);let r=$r({},La(),Ha(e));this._resource=(t=r.resource)==null?Mi():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new co(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 so({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=lo.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==lo.timeout&&(r=lo.resolved,n(r))}).catch(e=>{clearTimeout(i),r=lo.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==lo.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};L();var fo=class{constructor(e){I(this,`_exporter`,void 0),I(this,`_shutdownOnce`,void 0),I(this,`_pendingExports`,void 0),this._exporter=e,this._shutdownOnce=new li(this._shutdown,this),this._pendingExports=new Set}forceFlush(){var e=this;return G(function*(){yield Promise.all(Array.from(e._pendingExports)),e._exporter.forceFlush&&(yield e._exporter.forceFlush())})()}onStart(e,t){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&N.SAMPLED)===0)return;let t=this._doExport(e).catch(e=>qn(e));this._pendingExports.add(t),t.finally(()=>this._pendingExports.delete(t))}_doExport(e){var t=this;return G(function*(){if(e.resource.asyncAttributesPending){var n,r;yield(n=(r=e.resource).waitForAsyncAttributes)==null?void 0:n.call(r)}let i=yield di._export(t._exporter,[e]);if(i.code!==gr.SUCCESS){var a;throw(a=i.error)==null?Error(`SimpleSpanProcessor: span export failed (status ${i})`):a}})()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};L();var po=class{constructor(){I(this,`_enabled`,!1),I(this,`_currentContext`,T)}_bindFunction(e=T,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=T,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=T,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||T;try{return t.call(n,...r)}finally{this._currentContext=i}}};function mo(e){if(e!==null){if(e===void 0){let e=new po;e.enable(),P.setGlobalContextManager(e);return}e.enable(),P.setGlobalContextManager(e)}}function ho(e){if(e!==null){if(e===void 0){Ze.setGlobalPropagator(new _r({propagators:[new Ir,new Ln]}));return}Ze.setGlobalPropagator(e)}}var go=class extends uo{constructor(e={}){super(e)}register(e={}){$e.setGlobalTracerProvider(this),ho(e.propagator),mo(e.contextManager)}},Y=e=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`,_o=()=>typeof window>`u`?`http://localhost`:window.location.origin,vo=e=>{try{return new URL(e,_o()).href}catch(t){return e}},yo=/^(?:\d+|[0-9a-f]{8}-[0-9a-f-]{27,}|[0-9a-f]{16,})$/i,bo=e=>e.split(/[?#]/,1)[0].split(`/`).map(e=>yo.test(e)?`:id`:e).join(`/`),xo=e=>e.length>1?e.replace(/\/+$/,``):e,So=(e,t)=>{let n=e=>xo(e.replace(/[?#].*$/,``));return n(e)===n(t)},Co=(e,t)=>So(vo(t),vo(e.transport.endpoint)),wo=(e,t)=>Co(e,t),To=(e,t)=>typeof e==`function`?e(t):typeof e==`string`?t.includes(e):(e.lastIndex=0,e.test(t)),Eo=(e,t)=>(Array.isArray(e)?e:e?[e]:[]).some(e=>To(e,t)),Do=e=>typeof e.tracking.request==`object`?e.tracking.request:void 0,Oo=(e,t)=>{var n;return wo(e,t)||Eo((n=Do(e))==null?void 0:n.excludedUrls,vo(t))},ko=(e,t)=>{var n;return Eo((n=Do(e))==null?void 0:n.allowedTracingUrls,vo(t))},X={actionFrustrationType:`action.frustration.type`,actionId:`action.id`,actionTargetName:`action.target.name`,actionTargetTag:`action.target.tag`,actionType:`action.type`,deploymentEnvironmentName:`deployment.environment.name`,cacheHit:`resource.cache.hit`,deviceType:`device.type`,longTaskBlockingDuration:`long_task.blocking_duration`,longTaskEntryType:`long_task.entry_type`,longTaskId:`long_task.id`,networkEffectiveType:`network.effective_type`,networkStatus:`network.status`,nextHopProtocol:`resource.protocol`,outcomeType:`outcome.type`,serviceName:`service.name`,serviceVersion:`service.version`,sessionHasReplay:`session.has_replay`,sessionId:`session.id`,sessionSampleRate:`session.sample_rate`,sessionPhase:`session.phase`,sessionType:`session.type`,spanType:`span_type`,userId:`user.id`,userAgentName:`user_agent.name`,userAgentOsName:`user_agent.os.name`,userAgentVersion:`user_agent.version`,vitalMetric:`vital.metric`,vitalValue:`vital.value`,viewDomComplete:`view.dom_complete`,viewDomContentLoaded:`view.dom_content_loaded`,viewDomInteractive:`view.dom_interactive`,viewFirstByte:`view.first_byte`,viewId:`view.id`,viewLoadEvent:`view.load_event`,viewLoadingTime:`view.loading_time`,viewLoadingTimeSource:`view.loading_time_source`,viewLoadingType:`view.loading_type`,viewName:`view.name`,viewPhase:`view.phase`,viewPrevious:`view.previous`,viewPreviousUrlTemplate:`view.previous_url_template`,viewReferrer:`view.referrer`,viewStartedAt:`view.started_at`,viewUrl:`view.url`,viewUrlTemplate:`view.url_template`,viewVersion:`view.version`,websocketPhase:`websocket.phase`};q();var Z={abort:`abort`,error:`error`,success:`success`,timeout:`timeout`,warning:`warning`},Q={action:`action`,custom:`custom`,error:`error`,longTask:`long_task`,resource:`resource`,session:`session`,vital:`vital`,view:`view`,websocket:`websocket`},Ao=e=>e===408||e===504?Z.timeout:typeof e==`number`&&e>=400?Z.error:Z.success,jo=e=>e===`good`?Z.success:Z.warning,Mo=e=>{if(!e)return{};try{let t=new URL(e,typeof location>`u`?`http://localhost`:location.href);return{serverAddress:t.hostname,serverPort:t.port?Number(t.port):void 0}}catch(e){return{}}},$=({outcome:e=Z.success,spanType:t})=>({[X.spanType]:t,[X.outcomeType]:e}),No=({initiatorType:e=`other`,method:t,outcome:n,url:r})=>{let i=Mo(r),a=(n==null?void 0:n.type)===`response`&&typeof n.statusCode==`number`&&n.statusCode>0?n.statusCode:void 0,o=(n==null?void 0:n.type)===`abort`?Z.abort:(n==null?void 0:n.type)===`timeout`?Z.timeout:(n==null?void 0:n.type)===`network_error`?Z.error:typeof a==`number`?Ao(a):Z.success,s=t==null?void 0:t.toUpperCase();return K(K(K(K(K({},$({outcome:o,spanType:Q.resource})),i.serverAddress?{"server.address":i.serverAddress}:{}),i.serverPort===void 0?{}:{"server.port":i.serverPort}),{},{"resource.type":e},s?{"http.request.method":s}:{}),typeof a==`number`?{"http.response.status_code":a}:{})};q();var Po=100,Fo=100,Io=1e3,Lo=100,Ro=1e4,zo=`data-bk-action-name`,Bo=100,Vo=10,Ho=e=>e.replace(/\s+/g,` `).trim().slice(0,Bo),Uo=e=>{var t;if(e.parentElement)return e.parentElement;let n=(t=e.getRootNode)==null?void 0:t.call(e);return typeof ShadowRoot<`u`&&n instanceof ShadowRoot?n.host:null},Wo=(e,t)=>{let n=e;for(;n;){let e=n.getAttribute(t);if(e)return Ho(e);n=Uo(n)}},Go=e=>{var t;return e.isContentEditable?``:Ho((t=e.textContent)==null?``:t)},Ko=e=>{var t,n;let r=e,i=(t=r.labels)==null?void 0:t[0];if(i){let e=Go(i);if(e)return e}let a=e.tagName.toLowerCase(),o=(n=e.getAttribute(`type`))==null?void 0:n.toLowerCase();if(a===`input`&&[`button`,`reset`,`submit`].includes(o==null?``:o)){var s;let e=Ho((s=r.value)==null?``:s);if(e)return e}if(a===`button`||a===`label`||e.getAttribute(`role`)===`button`){let t=Go(e);if(t)return t}for(let t of[`aria-label`,`alt`,`name`,`title`,`placeholder`]){var c;let n=Ho((c=e.getAttribute(t))==null?``:c);if(n)return n}},qo=(e,t=zo,n=!1)=>{let r=Wo(e,t);if(r)return r;if(!n)return e.tagName.toLowerCase();let i=e,a=0;for(;i&&a<=Vo;){let e=i.tagName.toLowerCase();if(e===`body`||e===`html`||e===`head`)break;let t=Ko(i);if(t)return t;if(e===`form`)break;i=Uo(i),a+=1}for(i=e,a=0;i&&a<=Vo;){let e=i.tagName.toLowerCase();if(e===`body`||e===`html`||e===`head`)break;let t=Go(i);if(t)return t;if(e===`form`)break;i=Uo(i),a+=1}return e.tagName.toLowerCase()},Jo=e=>{var t;let n=(t=e.composedPath)==null?void 0:t.call(e)[0];return n instanceof Element?n:e.target instanceof Element?e.target:void 0},Yo=e=>{let t=e.timeStamp;return!Number.isFinite(t)||t<=0?Date.now():t>0xe8d4a51000?t:typeof performance>`u`?Date.now():performance.timeOrigin+t},Xo=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:t,Zo=e=>{let t=e;if(t.tagName.toLowerCase()===`label`&&t.hasAttribute(`for`)){var n;t=document.getElementById((n=t.getAttribute(`for`))==null?``:n)}for(;t;){let e=t.tagName.toLowerCase();if(t.hasAttribute(`contenteditable`)||e===`canvas`||e===`select`||e===`textarea`||e===`a`&&t.hasAttribute(`href`))return!0;if(e===`input`){var r,i;return![`button`,`checkbox`,`radio`,`range`,`reset`,`submit`].includes((r=(i=t.getAttribute(`type`))==null?void 0:i.toLowerCase())==null?`text`:r)}t=Uo(t)}return!1},Qo=(e={})=>{let t=[],n=new Map,r=new Set,i=e.actionNameAttribute||zo,a=Xo(e.maxDuration,Ro),o=[],s,c=()=>{s==null||s.setRuntimeAttributes({[X.actionId]:[...n.keys()].at(-1)})},l=e=>!e.hadActivity&&!e.userActivity.input&&!e.userActivity.scroll&&!e.userActivity.selection&&!Zo(e.target),u=e=>{if(!r.delete(e)||!s||!e.completed)return;clearTimeout(e.reportTimer),e.hadError&&e.frustrations.add(`error_click`),l(e)&&e.frustrations.add(`dead_click`);let t=[`rage_click`,`dead_click`,`error_click`].filter(t=>e.frustrations.has(t)),{endTime:n,hasLoadingTime:i}=e.completed,a=e.hadError||t.length>0;s.startSpan(`action.click`,K(K(K(K({},s.config.hooks.getPageAttributes()),$({outcome:a?Z.warning:Z.success,spanType:Q.action})),e.runtimeAttributes),{},{[X.actionId]:e.id,[X.actionType]:`click`,[X.actionTargetName]:e.targetName,[X.actionTargetTag]:e.targetTag},t.length?{[X.actionFrustrationType]:t}:{}),{startTime:e.startTime}).end(i?n:e.startTime)},d=(e,t,i)=>{if(!n.delete(e.id)||!s)return;clearTimeout(e.validationTimer),clearTimeout(e.quietTimer),clearTimeout(e.maxDurationTimer),c(),e.completed={endTime:t,hasLoadingTime:i},r.add(e);let a=Math.max(0,e.startTime+Io-Date.now());e.reportTimer=setTimeout(()=>u(e),a)},f=()=>{[...r].forEach(u)},p=e=>{if(clearTimeout(e.quietTimer),!e.hadActivity||e.pendingRequests.size)return;let t=Math.max(0,e.lastActivityTime+Fo-Date.now());e.quietTimer=setTimeout(()=>d(e,e.lastActivityTime,!0),t)},m=(e,t)=>{e.hadActivity=!0,e.lastActivityTime=Math.max(e.lastActivityTime,t),p(e)},h=(e,t)=>t>=e.startTime&&t<=e.startTime+a,g=e=>{for(let i of n.values()){if(e.type===`request_start`){var t;if(e.url&&Eo(s==null||(t=s.config.view)==null?void 0:t.excludedActivityUrls,e.url)||!h(i,e.time))continue;i.pendingRequests.add(e.id),m(i,e.time);continue}if(e.type===`request_end`){if(!i.pendingRequests.delete(e.id))continue;m(i,e.time);continue}if(e.type===`long_task`||e.type===`resource`){var r;if(e.type===`resource`&&e.url&&Eo(s==null||(r=s.config.view)==null?void 0:r.excludedActivityUrls,e.url)||e.startTime>i.startTime+a||(e.type===`resource`?e.startTime<i.startTime:e.endTime<i.startTime))continue;m(i,e.endTime);continue}if(e.type===`dom_mutation`||e.type===`window_open`){h(i,e.time)&&m(i,e.time);continue}e.type===`error`&&h(i,e.time)&&(i.hadError=!0,m(i,e.time))}},_=(e=Date.now())=>{[...n.values()].forEach(t=>d(t,e,t.hadActivity))},v=(e,t)=>{let n=`clientX`in t&&typeof t.clientX==`number`?t.clientX:0,r=`clientY`in t&&typeof t.clientY==`number`?t.clientY:0;o=o.filter(t=>e.startTime-t.action.startTime<=Io);let i=o.at(-1),a=o.some(e=>e.action.userActivity.scroll||e.action.userActivity.selection),s=(i==null?void 0:i.target)===e.target&&Math.hypot(i.x-n,i.y-r)<=Lo;(a||i&&!s)&&(o=[]),o.push({action:e,target:e.target,x:n,y:r}),o.length>=3&&e.startTime-o[o.length-3].action.startTime<=Io&&(o.slice(-3).map(e=>e.action).forEach(e=>e.frustrations.add(`rage_click`)),o=[])};return{name:`action`,init(l){if(typeof window>`u`||typeof document>`u`)return;s=l;let u={capture:!0,passive:!0},p=t=>{if(!l.isSampled()||`button`in t&&typeof t.button==`number`&&t.button!==0)return;let r=Jo(t);if(!r)return;let o=Yo(t),s=Y(`action`),u={frustrations:new Set,hadActivity:!1,hadError:!1,id:s,lastActivityTime:o,maxDurationTimer:setTimeout(()=>d(u,o+a,!0),a),pendingRequests:new Set,runtimeAttributes:l.getRuntimeAttributes(),startTime:o,target:r,targetName:qo(r,i,e.nameCollection===`text`),targetTag:r.tagName.toLowerCase(),userActivity:{input:!1,scroll:!1,selection:!1},validationTimer:setTimeout(()=>{u.hadActivity||d(u,u.startTime,!1)},Po)};n.set(s,u),v(u,t),c()};window.addEventListener(`click`,p,u),t.push(()=>window.removeEventListener(`click`,p,u));let m=l.onActivity(g),h=l.onSessionLifecycle(e=>{e.type===`expired`&&(_(e.expiredAt),f())});t.push(m,h);let y=()=>{document.visibilityState===`hidden`&&(_(),f())},b=()=>{_(),f()};window.addEventListener(`pagehide`,b),document.addEventListener(`visibilitychange`,y),t.push(()=>window.removeEventListener(`pagehide`,b),()=>document.removeEventListener(`visibilitychange`,y));let x=e=>{new Set([...n.values(),...r,...o.map(e=>e.action)]).forEach(t=>{t.userActivity[e]=!0,e!==`input`&&t.frustrations.delete(`rage_click`)})},S=()=>x(`input`),C=()=>x(`scroll`),w=()=>x(`selection`);window.addEventListener(`input`,S,u),window.addEventListener(`scroll`,C,u),document.addEventListener(`selectionchange`,w,u),t.push(()=>window.removeEventListener(`input`,S,u),()=>window.removeEventListener(`scroll`,C,u),()=>document.removeEventListener(`selectionchange`,w,u))},shutdown(){for(_(),f();t.length;){var e;(e=t.pop())==null||e()}o=[],s=void 0}}},$o=e=>{let t=e.type===`characterData`?e.target.parentElement:e.target;return t instanceof Element&&!!t.closest(`[data-bk-excluded-activity-mutations]`)},es=()=>{let e,t=[];return{name:`activity`,init(n){if(typeof document<`u`&&typeof MutationObserver<`u`&&(e=new MutationObserver(e=>{e.length&&!e.every($o)&&n.notifyActivity({time:Date.now(),type:`dom_mutation`})}),e.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0})),!(typeof window>`u`)&&typeof window.open==`function`){let e=window.open,r=((...t)=>(n.notifyActivity({time:Date.now(),type:`window_open`}),Reflect.apply(e,window,t)));window.open=r,t.push(()=>{window.open===r&&(window.open=e)})}},shutdown(){var n;for(e==null||e.disconnect(),e=void 0;t.length;)(n=t.pop())==null||n()}}},ts=(e,t)=>!!(t&&Eo(e.config.view.excludedActivityUrls,t)),ns=(e,t,n)=>{let r=new Set,i=!1,a=!1,o=t,s,c=e=>{i||(i=!0,clearTimeout(f),clearTimeout(s),d(),n(e))},l=()=>{clearTimeout(s),!(!a||r.size)&&(s=setTimeout(()=>c({endTime:o,hadActivity:!0}),Math.max(0,o+100-Date.now())))},u=e=>{a=!0,o=Math.max(o,e),l()},d=e.onActivity(n=>{if(!(n.type===`error`||n.type===`long_task`)){if(n.type===`request_start`){if(n.time<t||ts(e,n.url))return;r.add(n.id),u(n.time);return}if(n.type===`request_end`){if(!r.delete(n.id))return;u(n.time);return}if(n.type===`resource`){if(n.endTime<t||ts(e,n.url))return;u(n.endTime);return}n.time>=t&&u(n.time)}}),f=setTimeout(()=>{a||c({hadActivity:!1})},100);return()=>{i||(i=!0,clearTimeout(f),clearTimeout(s),d())}};q();var rs=1e3,is=200,as=`body`,os=.8,ss=[`[data-loading="true"]`,`[aria-busy="true"]`,`.loading`,`.is-loading`,`.spinner`,`.skeleton`,`.bk-loading`],cs=[[.2,.2],[.5,.2],[.8,.2],[.2,.5],[.5,.5],[.8,.5],[.2,.8],[.5,.8],[.8,.8]],ls=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:t,us=(e,t)=>typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(1,e)):t,ds=(e,t)=>t.some(t=>{try{return e.matches(t)||!!e.closest(t)}catch(e){return!1}}),fs=e=>{if(typeof getComputedStyle!=`function`)return!0;let t=getComputedStyle(e);return t.display!==`none`&&t.visibility!==`hidden`&&Number(t.opacity||1)>0},ps=(e,t)=>{if(typeof document.elementsFromPoint==`function`)return document.elementsFromPoint(e,t);let n=document.elementFromPoint(e,t);return n?[n]:[]},ms=(e,t)=>{var n;let r=document.querySelector(e),i=(n=r==null?document.body:r)==null?document.documentElement:n,a=0,o=0;for(let[e,n]of cs){let r=ps(window.innerWidth*e,window.innerHeight*n);if(r.some(e=>ds(e,t))){o+=1;continue}r.some(e=>e!==i&&e!==document.body&&e!==document.documentElement&&i.contains(e)&&fs(e))||(a+=1)}let s=cs.length-o;return{emptyCount:a,ignoredCount:o,reason:r?`empty_viewport`:`missing_root`,score:s?a/s:0,validCount:s}},hs=(e={})=>{var t;let n=ls(e.checkDelay,rs),r=ls(e.confirmationDelay,is),i=e.rootSelector||as,a=us(e.threshold,os),o=[...ss,...(t=e.ignoreSelectors)==null?[]:t],s,c,l,u,d=()=>{},f;return{name:`blank-screen`,init(e){if(typeof window>`u`||typeof document>`u`)return;let t=()=>{clearTimeout(u),u=void 0},p=(t,n)=>{if(s!==t||c===t||!e.isSampled())return;c=t;let r=Date.now();e.startSpan(`browser.blank_screen`,K(K({},$({outcome:Z.error,spanType:Q.error})),{},{"blank_screen.empty_ratio":n.score,"blank_screen.empty_sample_count":n.emptyCount,"blank_screen.reason":n.reason}),{startTime:r}).end(r)},m=t=>{if(s!==t||c===t||document.visibilityState===`hidden`)return;let n;try{n=ms(i,o)}catch(t){var l;e.config.debug&&((l=globalThis.console)==null||l.warn(`[bk-ot][blank-screen] detection failed:`,t));return}!n.validCount||n.score<a||(u=setTimeout(()=>{if(s!==t||document.visibilityState===`hidden`)return;let n;try{n=ms(i,o)}catch(t){var r;e.config.debug&&((r=globalThis.console)==null||r.warn(`[bk-ot][blank-screen] confirmation failed:`,t));return}n.validCount&&n.score>=a&&p(t,n)},r))},h=r=>{t(),!(document.visibilityState===`hidden`||!e.isSampled())&&(u=setTimeout(()=>m(r),n))};d=e.onViewChange(n=>{if(n.id!==s&&(t(),l==null||l(),l=void 0,s=n.id,c=void 0,n.id)){let t=n.id;l=ns(e,Date.now(),()=>{l=void 0,h(t)})}});let g=()=>{document.visibilityState===`hidden`?t():s&&c!==s&&h(s)};document.addEventListener(`visibilitychange`,g),f=()=>document.removeEventListener(`visibilitychange`,g)},shutdown(){clearTimeout(u),u=void 0,d(),l==null||l(),l=void 0,f==null||f(),f=void 0,s=void 0,c=void 0}}},gs=[`http.url`,`url.full`],_s=new WeakSet,vs=e=>{_s.add(e)},ys=e=>{for(let n of gs){var t;let r=(t=e.attributes)==null?void 0:t[n];if(typeof r==`string`)return r}},bs=e=>{let t=e==null?void 0:e[X.sessionId];return typeof t==`string`&&t.length>0},xs=e=>{let t=e==null?void 0:e[X.viewId];return typeof t==`string`&&t.length>0},Ss=e=>bs(e)&&xs(e),Cs=class{constructor(e,t,n){this.inner=e,this.config=t,this.getRuntimeAttributes=n}forceFlush(){return this.inner.forceFlush()}onEnd(e){let t=ys(e);if(!(_s.delete(e)||t&&Co(this.config,t)||!Ss(e.attributes)&&!(e.name===`browser.session`&&bs(e.attributes)))){try{var n,r;if(((n=this.config.hooks)==null||(r=n.beforeSend)==null?void 0:r.call(n,{attributes:e.attributes,name:e.name,signal:`span`}))===!1)return}catch(e){var i;this.config.debug&&((i=globalThis.console)==null||i.warn(`[bk-ot] tracking.beforeSend failed:`,e))}this.inner.onEnd(e)}}onStart(e,t){var n;let r=(n=e.attributes)==null?{}:n,i={};for(let[e,t]of Object.entries(this.getRuntimeAttributes()))r[e]===void 0&&t!==void 0&&(i[e]=t);e.setAttributes(i),this.inner.onStart(e,t)}shutdown(){return this.inner.shutdown()}},ws=100,Ts=200,Es=[],Ds=e=>e.replace(/#.*$/,``),Os=e=>{let t=Es.indexOf(e);t>=0&&Es.splice(t,1),e.timer!==void 0&&clearTimeout(e.timer)},ks=(e,t)=>{let n=e.callback;Os(e),e.callback=void 0,n==null||n(t)},As=e=>{let t=performance.timeOrigin+e.startTime,n=Es.filter(n=>!n.entry&&Ds(n.url)===Ds(e.name)&&t>=n.startTime-50).sort((e,n)=>Math.abs(e.startTime-t)-Math.abs(n.startTime-t))[0];n&&(n.entry=e,n.callback&&ks(n,e))},js=(e,t=Date.now())=>{let n={startTime:t,url:e};return Es.push(n),Es.length>ws&&ks(Es[0]),{cancel:()=>ks(n),complete:e=>{if(n.callback=e,n.entry){ks(n,n.entry);return}n.timer=setTimeout(()=>ks(n),Ts)}}};q();var Ms=`traceparent`,Ns=32,Ps=16,Fs=`0123456789abcdef`,Is=/^[\da-f]+$/,Ls=/^0+$/,Rs=/^\d+$/,zs=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(?:-.*)?$/,Bs=/^([\da-f]{32})-([\da-f]{16})(?:-([01]))?$/,Vs=/(?:^|,)_dd\.p\.tid=([\da-f]{16})(?:,|$)/,Hs=`0000000000000000`,Us=(e,t)=>e.length===t&&Is.test(e)&&!Ls.test(e),Ws=e=>{let t=e.toLowerCase();return Us(t,Ns)?t:Us(t,Ps)?t.padStart(Ns,`0`):void 0},Gs=e=>{let t=e.toLowerCase();return Us(t,Ps)?t:void 0},Ks=e=>{let t=new Uint8Array(e/2);if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`)crypto.getRandomValues(t);else for(let e=0;e<t.length;e+=1)t[e]=Math.floor(Math.random()*256);let n=``;for(let e of t)n+=Fs[e>>4]+Fs[e&15];return Ls.test(n)?`${n.slice(1)}1`:n},qs=e=>{if(!Rs.test(e))return;let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n)-48;for(let e=0;e<t.length;e+=1){let n=t[e]*10+r;t[e]=n%16,r=(n-n%16)/16}for(;r>0;)t.push(r%16),r=(r-r%16)/16}if(t.length>Ps)return;let n=``;for(let e=t.length-1;e>=0;--e)n+=Fs[t[e]];return n.padStart(Ps,`0`)},Js=(e,t)=>{let n={};for(let i of t){var r;let t=(r=e(i))==null?void 0:r.trim();t&&(n[i]=t)}return n},Ys=[e=>{var t;let n=(t=e(`traceparent`))==null?void 0:t.trim().toLowerCase();if(!n)return;let r=zs.exec(n);if(!r||r[1]===`ff`)return;let[,,i,a,o]=r;if(!(!Us(i,Ns)||!Us(a,Ps)))return{format:`traceparent`,headers:Js(e,[Ms]),sampled:(Number.parseInt(o,16)&1)==1,spanId:a,traceId:i}},e=>{var t;let n=(t=e(`sentry-trace`))==null?void 0:t.trim().toLowerCase();if(!n)return;let r=Js(e,[`sentry-trace`]),i=Bs.exec(n);if(!i)return{format:`sentry-trace`,headers:r};let[,a,o,s]=i;return K(K({format:`sentry-trace`,headers:r},s===void 0?{}:{sampled:s===`1`}),Us(a,Ns)&&Us(o,Ps)?{spanId:o,traceId:a}:{})},e=>{var t;let n=(t=e(`b3`))==null?void 0:t.trim().toLowerCase();if(!n)return;let[r,i,a]=n.split(`-`),o=r?Ws(r):void 0,s=i?Gs(i):void 0;return K(K({format:`b3`,headers:Js(e,[`b3`])},o&&s?{spanId:s,traceId:o}:{}),a?{sampled:a===`1`||a===`d`}:{})},e=>{var t,n,r;let i=(t=e(`x-b3-traceid`))==null?void 0:t.trim().toLowerCase(),a=(n=e(`x-b3-spanid`))==null?void 0:n.trim().toLowerCase(),o=(r=e(`x-b3-sampled`))==null?void 0:r.trim().toLowerCase();if(!i&&!a&&!o)return;let s=i?Ws(i):void 0,c=a?Gs(a):void 0;return K(K({format:`b3-multi`,headers:Js(e,[`x-b3-traceid`,`x-b3-spanid`,`x-b3-parentspanid`,`x-b3-sampled`,`x-b3-flags`])},s&&c?{spanId:c,traceId:s}:{}),o?{sampled:o===`1`||o===`d`}:{})},e=>{var t,n,r,i,a,o;let s=(t=e(`x-datadog-trace-id`))==null?void 0:t.trim(),c=(n=e(`x-datadog-parent-id`))==null?void 0:n.trim(),l=(r=e(`x-datadog-sampling-priority`))==null?void 0:r.trim();if(!s&&!c&&!l)return;let u=(i=e(`x-datadog-tags`))==null?void 0:i.trim().toLowerCase(),d=(a=u?(o=Vs.exec(u))==null?void 0:o[1]:void 0)==null?Hs:a,f=s?qs(s):void 0,p=f?Ws(`${d}${f}`):void 0,m=c?qs(c):void 0,h=m?Gs(m):void 0;return K(K({format:`datadog`,headers:Js(e,[`x-datadog-trace-id`,`x-datadog-parent-id`,`x-datadog-sampling-priority`,`x-datadog-origin`,`x-datadog-tags`])},p&&h?{spanId:h,traceId:p}:{}),l?{sampled:Number(l)>0}:{})},e=>{var t;let n=(t=e(`sw8`))==null?void 0:t.trim();if(!n)return;let r=n.split(`-`)[0];return K({format:`sw8`,headers:Js(e,[`sw8`])},r?{sampled:r===`1`}:{})}],Xs=e=>{for(let t of Ys){let n=t(e);if(n)return n}},Zs=(e,t,n,r)=>({attributes:n,context:{spanId:t,traceFlags:r===!1?N.NONE:N.SAMPLED,traceId:e}}),Qs=e=>{var t,n;let r=Xs(e);if(!r){let e=Ks(Ns),t=Ks(Ps),n=`00-${e}-${t}-01`;return{links:[Zs(e,t,{format:`traceparent`,injected:!0,[Ms]:n})],traceparent:n}}return{links:[Zs((t=r.traceId)==null?Ks(Ns):t,(n=r.spanId)==null?Ks(Ps):n,K({format:r.format,injected:!1},r.headers),r.sampled)]}};q();var $s=e=>e.deliveryType===`cache`||e.transferSize===0&&e.decodedBodySize>0?!0:void 0,ec=e=>e.transferSize===0&&e.encodedBodySize===0&&e.decodedBodySize===0&&e.requestStart===0&&e.responseStart===0&&!e.nextHopProtocol,tc=(...e)=>e.every((t,n)=>n===0||e[n-1]<=t),nc=(e,t,n,r,i)=>{tc(n,r,i)&&(e[`resource.${t}.start`]=r-n,e[`resource.${t}.duration`]=i-r)},rc=e=>{let t={},n=[e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd];return!n.every(Number.isFinite)||!tc(...n)?t:(nc(t,`first_byte`,e.startTime,e.requestStart,e.responseStart),nc(t,`download`,e.startTime,e.responseStart,e.responseEnd),e.workerStart>0&&e.workerStart<e.fetchStart&&nc(t,`worker`,e.startTime,e.workerStart,e.fetchStart),e.fetchStart<e.domainLookupEnd&&nc(t,`dns`,e.startTime,e.domainLookupStart,e.domainLookupEnd),e.fetchStart<e.connectEnd&&(nc(t,`connect`,e.startTime,e.connectStart,e.connectEnd),e.connectStart<=e.secureConnectionStart&&e.secureConnectionStart<=e.connectEnd&&nc(t,`ssl`,e.startTime,e.secureConnectionStart,e.connectEnd)),e.redirectEnd>e.startTime&&tc(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart)&&nc(t,`redirect`,e.startTime,e.redirectStart,e.redirectEnd),t)},ic=e=>e.duration===0&&e.responseEnd>e.startTime?e.responseEnd-e.startTime:e.duration,ac=e=>{let t=ec(e),n=typeof e.deliveryType==`string`&&e.deliveryType?e.deliveryType:void 0;return K(K(K(K(K({[X.cacheHit]:$s(e)},e.nextHopProtocol?{[X.nextHopProtocol]:e.nextHopProtocol}:{}),rc(e)),n?{"resource.delivery_type":n}:{}),e.renderBlockingStatus?{"resource.render_blocking_status":e.renderBlockingStatus}:{}),t?{}:{"resource.size":e.decodedBodySize,"resource.encoded_body_size":e.encodedBodySize,"resource.decoded_body_size":e.decodedBodySize,"resource.transfer_size":e.transferSize})},oc=(e=!0)=>{let t;return{name:`resource`,init(n){var r;if(typeof PerformanceObserver>`u`||!((r=PerformanceObserver.supportedEntryTypes)!=null&&r.includes(`resource`)))return;let i=t=>{if(!n.isSampled()||!t.name||wo(n.config,t.name))return;if(t.initiatorType===`fetch`||t.initiatorType===`xmlhttprequest`){As(t);return}if(t.duration<0)return;let r=n.config.hooks.redactUrl(t.name),i=ic(t),a=performance.timeOrigin+t.startTime,o=a+i;e&&n.isSampled()&&n.startSpan(`browser.resource`,K(K(K({},n.config.hooks.getPageAttributes()),No({initiatorType:t.initiatorType||`other`,outcome:typeof t.responseStatus==`number`?{statusCode:t.responseStatus,type:`response`}:void 0,url:r})),{},{"url.full":r,"url.template":n.config.hooks.getRequestUrlTemplate(r)},ac(t)),{kind:Ve.CLIENT,startTime:a}).end(o),n.notifyActivity({endTime:o,startTime:a,type:`resource`,url:t.name})};try{t=new PerformanceObserver(e=>{for(let t of e.getEntries())i(t)}),t.observe({type:`resource`,buffered:!0})}catch(e){t=void 0}},shutdown(){t==null||t.disconnect(),t=void 0}}};q();var sc=e=>typeof e.config.tracking.request==`object`?e.config.tracking.request:void 0,cc=e=>{var t;let n=(t=sc(e))==null?void 0:t.allowedTracingUrls;return Array.isArray(n)?n.length>0:n!==void 0},lc=e=>typeof e==`object`&&e&&`name`in e&&typeof e.name==`string`?e.name:``,uc=(e,t)=>{let n=e.signal;return lc(n==null?void 0:n.reason)===`TimeoutError`||lc(t)===`TimeoutError`?{error:t,type:`timeout`}:n!=null&&n.aborted||lc(t)===`AbortError`?{type:`abort`}:{error:t,type:`network_error`}},dc=(e,t)=>e===`abort`?{type:`abort`}:e===`timeout`?{type:`timeout`}:e===`error`||t.status===0?{type:`network_error`}:{statusCode:t.status,type:`response`},fc=e=>e.type===`network_error`||e.type===`timeout`||e.type===`response`&&typeof e.statusCode==`number`&&e.statusCode>=400,pc=e=>typeof e==`string`||e instanceof URL?vo(String(e)):vo(e.url),mc=(e,t)=>{var n;return((n=t==null?void 0:t.method)==null?typeof Request<`u`&&e instanceof Request?e.method:`GET`:n).toUpperCase()},hc=(e,t)=>typeof Request<`u`&&e instanceof Request?e:t==null?{}:t,gc=(e,t)=>{var n;let r=typeof Request<`u`&&e instanceof Request?e.headers:void 0;return new Headers((n=t==null?void 0:t.headers)==null?r:n)},_c=(e,t,n)=>n.traceparent?(t.set(Ms,n.traceparent),K(K({},e),{},{headers:t})):e,vc=e=>t=>e==null?void 0:e[t.toLowerCase()],yc=(e,t)=>wo(e.config,t)||Eo(e.config.view.excludedActivityUrls,t),bc=(e,t)=>{if(yc(e,t))return()=>{};let n=Y(`request`);e.notifyActivity({id:n,time:Date.now(),type:`request_start`,url:t});let r=!1;return()=>{r||(r=!0,e.notifyActivity({id:n,time:Date.now(),type:`request_end`}))}},xc=(e,t)=>e.isSampled()?js(t):{cancel(){},complete(e){e()}},Sc=(e,t,n,r)=>{var i,a;let o=(i=n.startedAt)==null?Date.now():i;return e.startSpan(`browser.resource`,K(K(K({},e.config.hooks.getPageAttributes()),No({initiatorType:t,method:n.method,url:(a=n.url)==null?``:a})),n.url?{"url.full":e.config.hooks.redactUrl(n.url),"url.template":e.config.hooks.getRequestUrlTemplate(n.url)}:{}),K({kind:Ve.CLIENT,startTime:o},r?{links:r.links}:{}))},Cc=(e,t,n,r,i,a={})=>{let o=a.url,s=o?e.config.hooks.redactUrl(o):void 0,c=a.method,l={attributes:K(K(K(K({},e.config.hooks.getPageAttributes()),No({initiatorType:n,method:c,outcome:i,url:s==null?``:s})),s?{"url.full":s}:{}),o?{"url.template":e.config.hooks.getRequestUrlTemplate(o)}:{}),resource:{method:c,outcome:i,transport:n,url:s},type:`resource`},u=!0;try{var d,f;u=(d=sc(e))==null||(f=d.beforeSend)==null?void 0:f.call(d,l,r)}catch(t){var p;e.config.debug&&((p=globalThis.console)==null||p.warn(`[bk-ot] request.beforeSend failed:`,t))}if(t.setAttributes(e.applyRedact(l.attributes)),u===!1){vs(t);return}fc(i)&&t.setStatus({code:He.ERROR})},wc=e=>{let t=[],n=new Set;return{name:`request`,enabled:e!==!1,init(e){if(!(typeof window>`u`)){if(typeof window.fetch==`function`){let r=window.fetch,i=function(){var t=G(function*(t,i){let a=pc(t);if(!e.isSampled()||Oo(e.config,a))return r.call(this,t,i);let o={method:mc(t,i),startedAt:Date.now(),url:a},s=ko(e.config,a)?gc(t,i):void 0,c=s?Qs(e=>{var t;return(t=s.get(e))==null?void 0:t}):void 0,l=Sc(e,`fetch`,o,c),u=xc(e,a),d=bc(e,a),f=hc(t,i),p=s&&c?_c(i,s,c):i,m=!1,h=(t,r=Date.now())=>{if(!m){if(m=!0,n.delete(g),t){l.setAttributes(e.applyRedact(ac(t))),l.end(performance.timeOrigin+t.startTime+ic(t));return}l.end(r)}},g=()=>{u.cancel(),h()};n.add(g);try{let n=yield r.call(this,t,p),i=K(K({},n.status>0?{statusCode:n.status}:{}),{},{type:`response`});Cc(e,l,`fetch`,{request:f,response:n,type:`fetch`},i,o);let a=Date.now();return u.complete(e=>h(e,a)),n}catch(t){let n=uc(f,t);Cc(e,l,`fetch`,{error:t,request:f,type:`fetch`},n,o),n.type!==`abort`&&t instanceof Error&&l.recordException(t);let r=Date.now();throw u.complete(e=>h(e,r)),t}finally{d()}});return function(e,n){return t.apply(this,arguments)}}();window.fetch=i,t.push(()=>{window.fetch===i&&(window.fetch=r)})}if(typeof XMLHttpRequest<`u`){let r=new WeakMap,i=new WeakMap,a=XMLHttpRequest.prototype.open,o=XMLHttpRequest.prototype.send,s=function(e,t,n=!0,o,s){return r.set(this,{method:e.toUpperCase(),url:vo(String(t))}),i.delete(this),a.call(this,e,String(t),n,o,s)},c=function(t){var a;let s=(a=r.get(this))==null?{}:a;if(!e.isSampled()||!s.url||Oo(e.config,s.url))return o.call(this,t);s.startedAt=Date.now();let c=ko(e.config,s.url)?Qs(vc(i.get(this))):void 0,l=Sc(e,`xhr`,s,c),u=xc(e,s.url),d=bc(e,s.url);c!=null&&c.traceparent&&this.setRequestHeader(Ms,c.traceparent);let f=!1,p=!1,m=()=>{},h=()=>{m(),u.cancel(),!p&&(p=!0,n.delete(h),d(),l.end())};n.add(h);let g=t=>{if(f||p)return;f=!0,m();let r=dc(t,this);Cc(e,l,`xhr`,{type:`xhr`,xhr:this},r,s),d();let i=Date.now();u.complete(t=>{if(!p){if(p=!0,n.delete(h),t){l.setAttributes(e.applyRedact(ac(t))),l.end(performance.timeOrigin+t.startTime+ic(t));return}l.end(i)}})},_=()=>g(`abort`),v=()=>g(`error`),y=()=>g(`load`),b=()=>g(`timeout`);m=()=>{this.removeEventListener(`abort`,_),this.removeEventListener(`error`,v),this.removeEventListener(`load`,y),this.removeEventListener(`timeout`,b)},this.addEventListener(`abort`,_,{once:!0}),this.addEventListener(`error`,v,{once:!0}),this.addEventListener(`load`,y,{once:!0}),this.addEventListener(`timeout`,b,{once:!0});try{return o.call(this,t)}catch(e){throw e instanceof Error&&l.recordException(e),g(`error`),e}};if(XMLHttpRequest.prototype.open=s,XMLHttpRequest.prototype.send=c,t.push(()=>{XMLHttpRequest.prototype.open===s&&(XMLHttpRequest.prototype.open=a),XMLHttpRequest.prototype.send===c&&(XMLHttpRequest.prototype.send=o)}),cc(e)&&typeof XMLHttpRequest.prototype.setRequestHeader==`function`){let e=XMLHttpRequest.prototype.setRequestHeader,n=function(t,n){var r;let a=t.toLowerCase(),o=(r=i.get(this))==null?{}:r;return o[a]=a in o?`${o[a]}, ${n}`:n,i.set(this,o),e.call(this,t,n)};XMLHttpRequest.prototype.setRequestHeader=n,t.push(()=>{XMLHttpRequest.prototype.setRequestHeader===n&&(XMLHttpRequest.prototype.setRequestHeader=e)})}}}},shutdown(){var e;for(let e of[...n])e();for(;t.length;)(e=t.pop())==null||e()}}};q();var Tc=/^https?:|^\/\//i,Ec=(e,t)=>{if(t)return Tc.test(t)?e(t):t},Dc=()=>{let e;return{name:`csp-violation`,init(t){if(typeof window>`u`||typeof document>`u`)return;let n=e=>{if(!t.isSampled())return;let n=Date.now(),r=Ec(t.config.hooks.redactUrl,e.blockedURI),i=e.sourceFile?t.config.hooks.redactUrl(e.sourceFile):void 0;t.startSpan(`csp.violation`,K(K(K({},t.config.hooks.getPageAttributes()),$({outcome:Z.error,spanType:Q.error})),{},{"csp.blocked_uri":r,"csp.violated_directive":e.violatedDirective,"csp.effective_directive":e.effectiveDirective,"csp.disposition":e.disposition,"csp.source_file":i,"csp.line_number":e.lineNumber,"csp.column_number":e.columnNumber,"csp.status_code":e.statusCode,"csp.original_policy":e.originalPolicy,"error.source":`csp`}),{startTime:n}).end(n)};document.addEventListener(`securitypolicyviolation`,n),e=()=>document.removeEventListener(`securitypolicyviolation`,n)},shutdown(){e==null||e(),e=void 0}}},Oc=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)};q();var kc=`BK_RUM_DEVICE_ID`,Ac=250,jc=()=>navigator.connection,Mc=()=>navigator.userAgentData,Nc=e=>{for(let[t,n]of[[`Edge`,/Edg\/([\d.]+)/],[`Chrome`,/Chrome\/([\d.]+)/],[`Firefox`,/Firefox\/([\d.]+)/],[`Safari`,/Version\/([\d.]+).*Safari/]]){let r=e.match(n);if(r!=null&&r[1])return{name:t,version:r[1].split(`.`)[0]}}return{name:`Other`,version:void 0}},Pc=(e,t)=>{let n=`${t==null?``:t} ${e}`;return/iphone|ipad|ipod/i.test(n)?`iOS`:/android/i.test(n)?`Android`:/mac/i.test(n)?`macOS`:/win/i.test(n)?`Windows`:/linux/i.test(n)?`Linux`:`Other`},Fc=e=>{let t=null;try{t=window.localStorage.getItem(e)}catch(e){}if(t)return t;let n=Y(`device`);try{window.localStorage.setItem(e,n)}catch(e){}return n},Ic=()=>{var e,t;return typeof window>`u`?{}:{"browser.viewport.width":window.innerWidth,"browser.viewport.height":window.innerHeight,"browser.screen.width":(e=window.screen)==null?void 0:e.width,"browser.screen.height":(t=window.screen)==null?void 0:t.height}},Lc=()=>{if(typeof navigator>`u`)return{};let e=jc();return{[X.networkStatus]:navigator.onLine?`connected`:`not_connected`,"network.effective_type":e==null?void 0:e.effectiveType,"network.connection.type":e==null?void 0:e.type}},Rc=()=>{if(typeof navigator>`u`)return{};let e=Mc(),t=navigator.userAgent,n=Nc(t),r=Pc(t,e==null?void 0:e.platform),i=e!=null&&e.mobile||/mobi|android|iphone|ipad|ipod/i.test(t)?`mobile`:`desktop`;return{[X.deviceType]:i,[X.userAgentName]:n.name,[X.userAgentVersion]:n.version,[X.userAgentOsName]:r}},zc=(e,t)=>{let n;return()=>{n!==void 0&&window.clearTimeout(n),n=window.setTimeout(()=>{n=void 0,e()},t)}},Bc=(e={})=>{let t=[];return{name:`device`,init(n){var r;let i=(r=e.storageKey)==null?`${kc}_${Oc(n.config.application.name)}`:r,a=typeof window>`u`||e.persistentId!==!0?Y(`device`):Fc(i);if(n.setRuntimeAttributes(K(K(K({"device.id":a},n.config.tracking.device===!1?Rc():{}),Ic()),Lc())),typeof window>`u`)return;let o=zc(()=>{n.setRuntimeAttributes(Ic())},Ac);window.addEventListener(`resize`,o),window.addEventListener(`orientationchange`,o),t.push(()=>window.removeEventListener(`resize`,o),()=>window.removeEventListener(`orientationchange`,o));let s=()=>{n.setRuntimeAttributes(Lc())};window.addEventListener(`online`,s),window.addEventListener(`offline`,s),t.push(()=>window.removeEventListener(`online`,s),()=>window.removeEventListener(`offline`,s));let c=jc();c&&typeof c.addEventListener==`function`&&(c.addEventListener(`change`,s),t.push(()=>{var e;(e=c.removeEventListener)==null||e.call(c,`change`,s)}))},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};q();var Vc=e=>{if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch(t){return String(e)}},Hc=({context:e,error:t,exceptionType:n,extra:r={},source:i,spanName:a})=>{if(!e.isSampled())return;let o=Date.now(),s=Vc(t);e.notifyActivity({time:o,type:`error`});let c=t instanceof Error?t:{message:s,name:n==null?i:n},l=K(K(K(K({},e.config.hooks.getPageAttributes()),e.config.hooks.getErrorAttributes()),$({outcome:Z.error,spanType:Q.error})),{},{"error.message":s,"error.handled":!1,"error.source":i},r),u=e.startSpan(a,l,{startTime:o});u.recordException(c),u.setStatus({code:He.ERROR,message:s}),u.end()},Uc=()=>{let e=[];return{name:`error`,init(t){if(typeof window>`u`)return;let n=e=>{var n;Hc({context:t,spanName:`browser.error`,source:`window.error`,error:(n=e.error)==null?e.message:n,extra:{"code.filepath":e.filename,"code.lineno":e.lineno,"code.column":e.colno}})},r=e=>{Hc({context:t,spanName:`browser.unhandledrejection`,source:`unhandledrejection`,error:e.reason,exceptionType:e.reason instanceof Error?e.reason.name:`UnhandledRejection`})},i=e=>{if(e instanceof ErrorEvent)return;let n=e.target;if(!(n instanceof Element))return;let r=n,i=r.src||r.href||n.currentSrc||``;Hc({context:t,spanName:`browser.resource_error`,source:`resource`,error:Error(`Resource load failed: ${n.tagName.toLowerCase()} ${i}`),exceptionType:`ResourceError`,extra:{"url.full":t.config.hooks.redactUrl(i)}})};window.addEventListener(`error`,n),window.addEventListener(`unhandledrejection`,r),window.addEventListener(`error`,i,!0),e.push(()=>window.removeEventListener(`error`,n),()=>window.removeEventListener(`unhandledrejection`,r),()=>window.removeEventListener(`error`,i,!0))},shutdown(){for(;e.length;){var t;(t=e.pop())==null||t()}}}};q();var Wc=50,Gc=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:t,Kc=e=>Number.isFinite(e)?e:void 0,qc=(e,t)=>K(K(K(K(K({},e.containerId?{"long_task.attribution.container_id":e.containerId}:{}),e.containerName?{"long_task.attribution.container_name":e.containerName}:{}),e.containerSrc?{"long_task.attribution.container_src":t(e.containerSrc)}:{}),e.containerType?{"long_task.attribution.container_type":e.containerType}:{}),e.name?{"long_task.attribution.name":e.name}:{}),Jc=(e,t)=>({"long_task.script.duration":e.duration,"long_task.script.execution_start":e.executionStart,"long_task.script.forced_style_and_layout_duration":e.forcedStyleAndLayoutDuration,"long_task.script.invoker":e.invoker,"long_task.script.invoker_type":e.invokerType,"long_task.script.pause_duration":e.pauseDuration,"long_task.script.source_char_position":e.sourceCharPosition,"long_task.script.source_function_name":e.sourceFunctionName,"long_task.script.source_url":e.sourceURL?t(e.sourceURL):``,"long_task.script.start_time":e.startTime,"long_task.script.window_attribution":e.windowAttribution}),Yc=(e={})=>{let t=Gc(e.threshold,Wc),n,r,i=[];return{name:`long-task`,init(e){var a;if(typeof PerformanceObserver>`u`||typeof performance>`u`)return;let o=(a=PerformanceObserver.supportedEntryTypes)==null?[]:a,s=o.includes(`long-animation-frame`)?`long-animation-frame`:o.includes(`longtask`)?`longtask`:void 0;if(!s)return;let c=n=>{var r,i;if(!e.isSampled()||!Number.isFinite(n.duration)||n.duration<t)return;let a=n.entryType===`long-animation-frame`,o=a?n:void 0,s=(r=o==null?void 0:o.scripts)==null?[]:r,c=Y(`long-task`),l=performance.timeOrigin+n.startTime,u=l+n.duration,d=a?`long-animation-frame`:`long-task`,f=a||(i=n.attribution)==null?[]:i,p=e.startSpan(`browser.long_task`,K(K(K(K(K(K({},e.config.hooks.getPageAttributes()),$({spanType:Q.longTask})),Kc(o==null?void 0:o.blockingDuration)===void 0?{}:{[X.longTaskBlockingDuration]:o.blockingDuration}),{},{[X.longTaskEntryType]:d,[X.longTaskId]:c,"long_task.name":n.name},Kc(o==null?void 0:o.firstUIEventTimestamp)===void 0?{}:{"long_task.first_ui_event_timestamp":o.firstUIEventTimestamp}),Kc(o==null?void 0:o.renderStart)===void 0?{}:{"long_task.render_start":o.renderStart}),Kc(o==null?void 0:o.styleAndLayoutStart)===void 0?{}:{"long_task.style_and_layout_start":o.styleAndLayoutStart}),{startTime:l});s.forEach(t=>{p.addEvent(`long_task.script`,e.applyRedact(Jc(t,e.config.hooks.redactUrl)),performance.timeOrigin+t.startTime)}),f.forEach((t,n)=>{p.addEvent(`long_task.attribution`,e.applyRedact(K({"long_task.attribution.index":n},qc(t,e.config.hooks.redactUrl))),l)}),p.end(u),e.notifyActivity({endTime:u,startTime:l,type:`long_task`})},l=e=>e.forEach(e=>c(e));try{let e=!0;n=new PerformanceObserver(t=>{let n=t.getEntries();e?(i.push(...n),r||(r=setTimeout(()=>{let e=i;i=[],r=void 0,l(e)}))):l(n)}),n.observe({type:s,buffered:!0}),e=!1}catch(e){n=void 0}},shutdown(){n==null||n.disconnect(),n=void 0,clearTimeout(r),r=void 0,i=[]}}},Xc=new Set,Zc=``,Qc,$c,el=!1,tl=()=>typeof location>`u`?``:location.href,nl=(e,t)=>{let n=tl();Zc=n;let r={fromUrl:t,source:e,toUrl:n};for(let e of Array.from(Xc))e(r)},rl=()=>{nl(`popstate`,Zc||tl())},il=()=>{nl(`hashchange`,Zc||tl())},al=()=>{el||typeof window>`u`||typeof history>`u`||(el=!0,Zc=tl(),Qc=history.pushState,$c=history.replaceState,history.pushState=function(e,t,n){let r=Zc||tl(),i=Qc==null?void 0:Qc.apply(this,[e,t,n]);return nl(`pushState`,r),i},history.replaceState=function(e,t,n){let r=Zc||tl(),i=$c==null?void 0:$c.apply(this,[e,t,n]);return nl(`replaceState`,r),i},window.addEventListener(`popstate`,rl),window.addEventListener(`hashchange`,il))},ol=()=>{!el||typeof window>`u`||typeof history>`u`||(Qc&&(history.pushState=Qc),$c&&(history.replaceState=$c),window.removeEventListener(`popstate`,rl),window.removeEventListener(`hashchange`,il),Qc=void 0,$c=void 0,el=!1,Zc=``)},sl=e=>typeof window>`u`||typeof history>`u`?()=>{}:(al(),Xc.add(e),()=>{Xc.delete(e),Xc.size===0&&ol()});function cl(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 ll(e,t){if(e==null)return{};var n,r,i=cl(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}q();var ul=[`stopLoadingTime`],dl=new Set(Object.values(X)),fl=()=>typeof location>`u`?``:location.href,pl=()=>{if(typeof performance>`u`)return{};let e=performance.getEntriesByType(`navigation`)[0];if(!e)return{};let t={},n=(e,n)=>{Number.isFinite(n)&&n>0&&(t[e]=n)};return n(X.viewFirstByte,e.responseStart),n(X.viewDomInteractive,e.domInteractive),n(X.viewDomContentLoaded,e.domContentLoadedEventEnd),n(X.viewDomComplete,e.domComplete),n(X.viewLoadEvent,e.loadEventEnd),t},ml=e=>{let t=e.indexOf(`?`);return t<0?e:e.slice(0,t)},hl=e=>{let t=e.slice(1);if(!t||typeof document>`u`||typeof document.getElementById!=`function`)return!1;try{return!!document.getElementById(decodeURIComponent(t))}catch(e){return!!document.getElementById(t)}},gl=(e,t)=>{try{let n=typeof location>`u`?`http://localhost`:location.href,r=new URL(e,n),i=new URL(t,n);return r.pathname!==i.pathname||!hl(i.hash)&&ml(r.hash)!==ml(i.hash)}catch(n){return e!==t}},_l=()=>{let e=[];return{name:`page-view`,init(t){if(typeof window>`u`)return;let n,r,i,a=(e=Date.now())=>t.setView({},e),o=(e,n,r=Date.now(),i)=>{e.version+=1,t.startSpan(`browser.view`,K(K(K(K(K({},t.config.hooks.getPageAttributes()),e.attributes),e.snapshotAttributes),{},{[X.viewPhase]:n,[X.viewStartedAt]:e.startedAt,[X.viewVersion]:e.version},i?{"view.end_reason":i}:{}),e.loadingTime===void 0?{}:{[X.viewLoadingTime]:e.loadingTime,[X.viewLoadingTimeSource]:e.loadingTimeSource}),{contextTime:r,startTime:r}).end(r)},s=(e,t=!0,r=Date.now())=>{var i;if(!n){t&&a(r);return}let s=K({},n);(i=n.stopLoadingTime)==null||i.call(n),o(n,`end`,r,e),n=void 0,t&&a(r);let{stopLoadingTime:c}=s;return ll(s,ul)},c=(e,t,r)=>{if(n!==e||!Number.isFinite(t)||t<0)return;let i=K(K({},e.loadingType===`initial_load`?pl():{}),{},{[X.viewLoadingTime]:t,[X.viewLoadingTimeSource]:r});Object.assign(e.snapshotAttributes,i),e.loadingTime=t,e.loadingTimeSource=r,o(e,`update`)},l=e=>{if(!t.config.view.loadingTime||document.visibilityState===`hidden`)return;let r=!1,i,a=e.loadingType!==`initial_load`,o,s,l=!1,u,d=()=>{var t;if(l||!r||!a||n!==e)return;let s=[i,o].filter(e=>e!==void 0);s.length&&c(e,Math.max(...s),`auto`),(t=e.stopLoadingTime)==null||t.call(e),e.stopLoadingTime=void 0},f=()=>{var t,n;let r=(t=(n=performance).getEntriesByType)==null?void 0:t.call(n,`navigation`)[0];return r!=null&&r.loadEventEnd?(o=Math.max(0,performance.timeOrigin+r.loadEventEnd-e.startedAt),a=!0,!0):!1};if(!a&&!f()){let t=()=>{setTimeout(()=>{n===e&&(f(),a=!0,d())})};window.addEventListener(`load`,t,{once:!0}),s=()=>window.removeEventListener(`load`,t)}let p=ns(t,e.startedAt,t=>{r=!0,t.hadActivity&&(i=Math.max(0,t.endTime-e.startedAt)),d()}),m=()=>{var t;document.visibilityState===`hidden`&&(l=!0,(t=e.stopLoadingTime)==null||t.call(e),e.stopLoadingTime=void 0)};document.addEventListener(`visibilitychange`,m),u=()=>document.removeEventListener(`visibilitychange`,m),e.stopLoadingTime=()=>{p(),s==null||s(),s=void 0,u==null||u(),u=void 0},d()},u=e=>{let n=t.applyRedact(e==null?{}:e);return Object.fromEntries(Object.entries(n).filter(([e,t])=>t!==void 0&&!dl.has(e)))},d=(e,r,i,a=(e=>(e=n==null?void 0:n.rawUrl)==null?``:e)())=>{var c;if(!t.isSessionActive())return;let d=(c=e.url)==null?fl():c,f=t.config.hooks.getViewUrlTemplate(d),p=a?t.config.hooks.getViewUrlTemplate(a):``,m=e.name,h=u(e.attributes);s(r,!1);let g=Y(`view`),_=t.config.hooks.redactUrl(d),v=t.config.hooks.redactUrl(a),y=i===`initial_load`,b=y&&typeof performance<`u`?performance.timeOrigin:Date.now(),x=y?pl():{};t.setView({attributes:h,id:g,loadingType:i,name:m,startedAt:b,url:_,urlTemplate:f},b),n={attributes:h,version:0,id:g,loadingType:i,name:m,rawUrl:d,snapshotAttributes:K(K(K(K(K(K({},h),t.config.hooks.getPageAttributes()),x),$({spanType:Q.view})),{},{[X.viewId]:g},m?{[X.viewName]:m}:{}),{},{[X.viewUrl]:_,[X.viewUrlTemplate]:f,[X.viewLoadingType]:i,[X.viewPrevious]:v,[X.viewPreviousUrlTemplate]:p},y&&document.referrer?{[X.viewReferrer]:t.config.hooks.redactUrl(document.referrer)}:{}),startedAt:b,url:_,urlTemplate:f},o(n,`start`,b),l(n)},f=t.onViewCommand(e=>{if(e.type===`start`){d(e.options,`manual`,n?`route_change`:`initial_load`);return}if(n){if(e.type===`set_loading_time`){var r;(r=n.stopLoadingTime)==null||r.call(n),n.stopLoadingTime=void 0,c(n,Math.max(0,e.time-n.startedAt),`manual`);return}n.name!==e.name&&(n.name=e.name,n.snapshotAttributes[X.viewName]=e.name,t.setView({attributes:n.attributes,id:n.id,loadingType:n.loadingType,name:n.name,startedAt:n.startedAt,url:n.url,urlTemplate:n.urlTemplate}),o(n,`update`))}}),p=()=>{};t.config.view.tracking===`auto`&&(n||d({},`load`,`initial_load`),p=sl(e=>{gl(e.fromUrl,e.toUrl)&&d({},e.source,`route_change`,e.fromUrl)}));let m=e=>{if(e.persisted){r=s(`bfcache`);return}r=void 0,s(`pagehide`)},h=e=>{if(e.persisted&&t.config.view.tracking===`auto`){let e=r;if(r=void 0,!t.isSessionActive()){i=e;return}d(e?{attributes:e.attributes,name:e.name,url:e.rawUrl}:{},`bfCache`,`bf_cache`,e==null?void 0:e.rawUrl)}},g=t.onSessionLifecycle(e=>{if(e.type===`expired`){var t;i=(t=s(`session_expired`,!0,e.expiredAt))==null?r:t,r=void 0;return}i&&(d({attributes:i.attributes,name:i.name,url:i.rawUrl},`sessionRenewal`,`session_renewal`,i.rawUrl),i=void 0)});window.addEventListener(`pagehide`,m),window.addEventListener(`pageshow`,h),e.push(p,g,f,()=>window.removeEventListener(`pagehide`,m),()=>window.removeEventListener(`pageshow`,h),()=>s(`shutdown`))},shutdown(){for(;e.length;){var t;(t=e.pop())==null||t()}}}};q();var vl=5e3,yl=e=>typeof e==`number`&&Number.isFinite(e)&&e>0,bl=(e,t,n,r)=>({expiresAt:Math.min(t+n,t+r),id:e,startedAt:t,status:`active`}),xl=(e,t,n)=>{if(t>=e.startedAt+n)return`maxLifetime`;if(t>=e.expiresAt)return`inactivity`},Sl=(e,t,n,r)=>K(K({},e),{},{expiresAt:Math.min(t+n,e.startedAt+r)}),Cl=(e,t,n)=>{if(!e)return null;try{let r=JSON.parse(e);if(r.status===`active`&&typeof r.id==`string`&&r.id.length>0&&yl(r.startedAt)&&r.startedAt<=t+vl&&yl(r.expiresAt)&&r.expiresAt>=r.startedAt&&r.expiresAt<=r.startedAt+n||r.status===`expired`&&typeof r.previousId==`string`&&r.previousId.length>0&&(r.reason===`inactivity`||r.reason===`maxLifetime`)&&yl(r.expiredAt)&&r.expiredAt<=t+vl)return r}catch(e){}return null};q();var wl=900*1e3,Tl=14400*1e3,El=1e3,Dl=6e4,Ol=[`click`,`keydown`,`scroll`,`touchstart`],kl=new Map,Al=e=>{let t=typeof window<`u`,n=()=>{var n;if(t)try{return window.localStorage.getItem(e)}catch(e){t=!1}return(n=kl.get(e))==null?null:n};return n(),{isLocalStorage:()=>t,read:n,write:n=>{let r=JSON.stringify(n);if(kl.set(e,r),t)try{window.localStorage.setItem(e,r)}catch(e){t=!1}}}},jl=(e,t)=>{let n=``;try{n=new URL(e).host}catch(t){n=e}return`bk_ot_session__${Oc(`${t}\0${n||`default`}`)}`},Ml=(e,t,n,r)=>{e.startSpan(`browser.session`,K(K(K({},e.config.hooks.getPageAttributes()),$({spanType:Q.session})),{},{[X.sessionPhase]:t,[X.sessionHasReplay]:!1,[X.sessionId]:n,[X.sessionType]:`user`}),{contextTime:r,startTime:r}).end(r)},Nl=(e={})=>{let t=[];return{name:`session`,init(n){var r;if(typeof window>`u`||typeof document>`u`){let e=Date.now(),t=Y(`session`);n.setRuntimeAttributes({[X.sessionHasReplay]:!1,[X.sessionId]:t,[X.sessionType]:`user`},e);return}let i=(r=e.storageKey)==null?jl(n.config.transport.endpoint,n.config.application.name):r,a=Al(i),o=typeof performance<`u`&&Number.isFinite(performance.timeOrigin)?performance.timeOrigin:Date.now(),s,c,l=(e=Date.now())=>Cl(a.read(),e,Tl),u=()=>{c!==void 0&&(clearTimeout(c),c=void 0)},d=(e,t=Date.now())=>{let r=s;r&&(n.notifySessionLifecycle({expiredAt:t,id:r,reason:e,type:`expired`}),Ml(n,`end`,r,t),u(),s=void 0,n.setRuntimeAttributes({[X.sessionHasReplay]:void 0,[X.sessionId]:void 0,[X.sessionType]:void 0},t),n.flush())},f=()=>{let e=Date.now(),t=l(e);if(!t){d(`external`,e);return}if(t.status===`expired`){d(t.reason,t.expiredAt);return}if(t.id!==s){d(`external`,e);return}let n=xl(t,e,Tl);if(!n){p(t);return}let r={expiredAt:e,previousId:t.id,reason:n,status:`expired`};a.write(r),d(n,e)},p=e=>{u();let t=Math.min(e.expiresAt,e.startedAt+Tl);c=setTimeout(f,Math.max(0,t-Date.now()))},m=(e,t)=>{let r=e.id!==s;s=e.id,n.setRuntimeAttributes({[X.sessionHasReplay]:!1,[X.sessionId]:e.id,[X.sessionType]:`user`},Math.min(e.startedAt,o)),p(e),r&&t&&n.notifySessionLifecycle({id:e.id,previousId:t.previousId,reason:t.reason,startedAt:e.startedAt,type:`renewed`})},h=(e=!1)=>{let t=Date.now(),r=l(t);if((r==null?void 0:r.status)===`active`&&!xl(r,t,Tl)){let e=Sl(r,t,wl,Tl);a.write(e),m(e,s?void 0:{reason:`shared`});return}let i=(r==null?void 0:r.status)===`expired`?r.previousId:r==null?void 0:r.id,o=(r==null?void 0:r.status)===`expired`?r.reason:r?xl(r,t,Tl):e?`init`:void 0,c=bl(Y(`session`),t,wl,Tl);a.write(c),m(c,{previousId:i,reason:o==null?`init`:o}),Ml(n,(o==null?`init`:o)===`init`?`start`:`rotate`,c.id,c.startedAt)},g=()=>{if(!s)return;let e=Date.now(),t=l(e);if((t==null?void 0:t.status)!==`active`||t.id!==s||xl(t,e,Tl)){f();return}let n=Sl(t,e,wl,Tl);a.write(n),m(n)};h(!0);let _=0,v=()=>{let e=Date.now();e-_<El||(_=e,h())},y={capture:!0,passive:!0};Ol.forEach(e=>window.addEventListener(e,v,y)),t.push(()=>{Ol.forEach(e=>window.removeEventListener(e,v,y))});let b=()=>{document.visibilityState===`visible`&&g()};document.addEventListener(`visibilitychange`,b);let x=window.setInterval(b,Dl);t.push(()=>{document.removeEventListener(`visibilitychange`,b),window.clearInterval(x)});let S=e=>{if(!a.isLocalStorage()||e.storageArea!==window.localStorage||e.key!==i)return;let t=Date.now(),n=Cl(e.newValue,t,Tl);if((n==null?void 0:n.status)===`active`&&n.id===s&&!xl(n,t,Tl)){p(n);return}d((n==null?void 0:n.status)===`expired`?n.reason:`external`,(n==null?void 0:n.status)===`expired`?n.expiredAt:t)};window.addEventListener(`storage`,S),t.push(()=>window.removeEventListener(`storage`,S)),t.push(u)},shutdown(){for(var e;t.length;)(e=t.pop())==null||e()}}},Pl=n({CLSThresholds:()=>au,FCPThresholds:()=>ru,INPThresholds:()=>yu,LCPThresholds:()=>Su,TTFBThresholds:()=>wu,onCLS:()=>su,onFCP:()=>cu,onINP:()=>bu,onLCP:()=>Cu,onTTFB:()=>Eu});function Fl(e,t){return Vl.get(e)||Vl.set(e,new t),Vl.get(e)}var Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du=t((()=>{L(),q(),Il=class{constructor(){I(this,`t`,void 0),I(this,`o`,0),I(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)}},Ll=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Rl=e=>{if(document.readyState===`loading`)return`loading`;let t=Ll();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`},zl=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},Bl=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[zl(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},Vl=new WeakMap,Hl=-1,Ul=()=>Hl,Wl=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(Hl=t.timeStamp,e(t))},!0)},Gl=(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)))}},Kl=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},ql=()=>{var e,t;return(e=(t=Ll())==null?void 0:t.activationStart)==null?0:e},Jl=(e,t=-1)=>{let n=Ll(),r=`navigate`;return Ul()>=0?r=`back-forward-cache`:n&&(document.prerendering||ql()>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}},Yl=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(K({type:e,buffered:!0},n)),r}}catch(e){}},Xl=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Zl=-1,Ql=new Set,$l=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,eu=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of Ql)e();isFinite(Zl)||(Zl=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,eu,!0))}},tu=()=>{if(Zl<0){var e;let t=ql(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;Zl=n==null?$l():n,addEventListener(`visibilitychange`,eu,!0),addEventListener(`prerenderingchange`,eu,!0),Wl(()=>{setTimeout(()=>{Zl=$l()})})}return{get firstHiddenTime(){return Zl},onHidden(e){Ql.add(e)}}},nu=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},ru=[1800,3e3],iu=(e,t={})=>{nu(()=>{let n=tu(),r,i=Jl(`FCP`),a=Yl(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ql(),0),i.entries.push(t),r(!0)))});a&&(r=Gl(e,i,ru,t.reportAllChanges),Wl(n=>{i=Jl(`FCP`),r=Gl(e,i,ru,t.reportAllChanges),Kl(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},au=[.1,.25],ou=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],su=(e,t={})=>{let n=Fl(t=Object.assign({},t),Il),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=ou(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?Bl(o):i;r.set(n,e)}}},((e,t={})=>{let n=tu();iu(Xl(()=>{let r,i=Jl(`CLS`,0),a=Fl(t,Il),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=Yl(`layout-shift`,o);s&&(r=Gl(e,i,au,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),Wl(()=>{a.o=0,i=Jl(`CLS`,0),r=Gl(e,i,au,t.reportAllChanges),Kl(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=ou(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:Rl(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},cu=(e,t={})=>{iu(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Rl(Ul())};if(e.entries.length){let n=Ll(),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:Rl(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},lu=0,uu=1/0,du=0,fu=e=>{for(let t of e)t.interactionId&&(uu=Math.min(uu,t.interactionId),du=Math.max(du,t.interactionId),lu=du?(du-uu)/7+1:0)},mu=()=>{var e;return pu?lu:(e=performance.interactionCount)==null?0:e},hu=()=>{`interactionCount`in performance||pu||(pu=Yl(`event`,fu,{durationThreshold:0}))},gu=0,_u=class{constructor(){I(this,`l`,[]),I(this,`h`,new Map),I(this,`m`,void 0),I(this,`p`,void 0)}v(){gu=mu(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((mu()-gu)/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)}}},vu=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=Xl(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},yu=[200,500],bu=(e,t={})=>{let n=Fl(t=Object.assign({},t),_u),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(vu(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?Bl(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:Rl(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})};Yl(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=tu();nu(()=>{var r;hu();let i,a=Jl(`INP`),o=Fl(t,_u),s=e=>{vu(()=>{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=Yl(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=Gl(e,a,yu,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),Wl(()=>{o.v(),a=Jl(`INP`),i=Gl(e,a,yu,t.reportAllChanges)}))})})(t=>{e(f(t))},t)},xu=class{constructor(){I(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}},Su=[2500,4e3],Cu=(e,t={})=>{let n=Fl(t=Object.assign({},t),xu),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?Bl(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{nu(()=>{let n=tu(),r,i=Jl(`LCP`),a=Fl(t,xu),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-ql(),0),i.entries=[t],r())},s=Yl(`largest-contentful-paint`,o);if(s){r=Gl(e,i,Su,t.reportAllChanges);let n=Xl(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(vu(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});Wl(n=>{i=Jl(`LCP`),r=Gl(e,i,Su,t.reportAllChanges),Kl(()=>{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=Ll();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=K(K({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},wu=[800,1800],Tu=e=>{document.prerendering?nu(()=>Tu(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Tu(e),!0)},Eu=(e,t={})=>{((e,t={})=>{let n=Jl(`TTFB`),r=Gl(e,n,wu,t.reportAllChanges);Tu(()=>{let i=Ll();i&&(n.value=Math.max(i.responseStart-ql(),0),n.entries=[i],r(!0),Wl(()=>{n=Jl(`TTFB`,0),r=Gl(e,n,wu,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)}}));q();var Ou=10,ku=6e4,Au=5e3,ju=1e3,Mu=(e,t)=>!!t&&e===t,Nu=(e,t)=>{let[n,r]=e===`CLS`?[.1,.25]:[200,500];return t<=n?`good`:t<=r?`needs-improvement`:`poor`},Pu=e=>{var t,n,r;if(!(typeof Element>`u`||!(e instanceof Element)))return(t=(n=(r=e.getAttribute(`data-bk-action-name`))==null?e.getAttribute(`aria-label`):r)==null?e.getAttribute(`name`):n)==null?e.tagName.toLowerCase():t},Fu=()=>{if(typeof performance>`u`)return;let e=performance.interactionCount;return typeof e==`number`&&Number.isFinite(e)?e:void 0},Iu=(e,t)=>{var n,r;let i=(n=t.value)==null?0:n;t.hadRecentInput||!Number.isFinite(i)||(e.clsWindowStart===void 0||t.startTime-((r=e.clsWindowEnd)==null?t.startTime:r)>=ju||t.startTime-e.clsWindowStart>=Au?(e.clsWindowStart=t.startTime,e.clsWindowValue=i):e.clsWindowValue+=i,e.clsWindowEnd=t.startTime,e.clsWindowValue>e.cls&&(e.cls=Math.round(e.clsWindowValue*1e4)/1e4))},Lu=(e,t)=>{var n,r;if(!t.interactionId||!Number.isFinite(t.duration))return;e.interactionIdMin=Math.min(e.interactionIdMin,t.interactionId),e.interactionIdMax=Math.max(e.interactionIdMax,t.interactionId);let i=(n=t.processingStart)==null?t.startTime:n,a=(r=t.processingEnd)==null?i:r,o={duration:Math.min(t.duration,ku),inputDelay:Math.max(0,i-t.startTime),interactionId:t.interactionId,interactionTarget:Pu(t.target),interactionType:t.name,presentationDelay:Math.max(0,t.startTime+t.duration-a),processingDuration:Math.max(0,a-i)},s=e.inpCandidates.findIndex(e=>e.interactionId===t.interactionId);s>=0?o.duration>e.inpCandidates[s].duration&&(e.inpCandidates[s]=o):e.inpCandidates.push(o),e.inpCandidates.sort((e,t)=>t.duration-e.duration).splice(Ou)},Ru=e=>{let t=Fu(),n=t!==void 0&&e.interactionCountAtStart!==void 0?Math.max(0,t-e.interactionCountAtStart):e.interactionIdMin===1/0?0:(e.interactionIdMax-e.interactionIdMin)/7+1;if(e.inpCandidates.length)return e.inpCandidates[Math.min(e.inpCandidates.length-1,Math.floor(n/50))]},zu=(e,t)=>{var n;let r=(n=e.attribution)==null?{}:n,i={},a=e=>r[e],o=(e,t,n)=>{t!=null&&(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)&&(i[e]=typeof t==`string`&&n?n(t):t)};switch(e.name){case`LCP`:o(`vital.lcp.url`,a(`url`),t),o(`vital.lcp.target`,a(`target`)),o(`vital.lcp.element_render_delay`,a(`elementRenderDelay`)),o(`vital.lcp.resource_load_duration`,a(`resourceLoadDuration`));break;case`CLS`:o(`vital.cls.load_state`,a(`loadState`));break;case`INP`:o(`vital.inp.interaction_target`,a(`interactionTarget`)),o(`vital.inp.interaction_type`,a(`interactionType`)),o(`vital.inp.input_delay`,a(`inputDelay`)),o(`vital.inp.processing_duration`,a(`processingDuration`)),o(`vital.inp.presentation_delay`,a(`presentationDelay`));break;case`TTFB`:o(`vital.ttfb.waiting_duration`,a(`waitingDuration`)),o(`vital.ttfb.dns_duration`,a(`dnsDuration`)),o(`vital.ttfb.connection_duration`,a(`connectionDuration`)),o(`vital.ttfb.request_duration`,a(`requestDuration`));break;default:break}return i},Bu=()=>{let e,t=!1;return{name:`web-vitals`,init(n){return G(function*(){if(typeof window>`u`)return;let r;try{r=yield Promise.resolve().then(()=>(Du(),Pl))}catch(e){if(n.config.debug){var i;(i=globalThis.console)==null||i.warn(`[bk-ot] web-vitals load failed:`,e)}return}if(t)return;let{onFCP:a,onLCP:o,onTTFB:s}=r,c=(e,t,r,i=r==null?Date.now():r)=>{if(!n.isSampled())return;let a=e.name.toLowerCase();n.startSpan(`browser.web_vital`,K(K(K(K({},n.config.hooks.getPageAttributes()),t),$({outcome:jo(e.rating),spanType:Q.vital})),{},{[X.vitalMetric]:a,[X.vitalValue]:e.value,"vital.id":e.id},zu(e,n.config.hooks.redactUrl)),{contextTime:r,startTime:i}).end(i)},l=e=>{if(t||!Number.isFinite(e.value)||!n.isSampled())return;let r=e.entries[0],i=r&&typeof performance<`u`?performance.timeOrigin+r.startTime:void 0;c(e,i===void 0?n.getRuntimeAttributes():n.getRuntimeAttributesAt(i),i)},u,d,f,p=(e,t,n)=>{c(e,t,n,Date.now())},m=()=>{let e=u;if(!e||!n.isSampled())return;p({attribution:{},entries:[],id:Y(`vital`),name:`CLS`,rating:Nu(`CLS`,e.cls),value:e.cls},e.runtimeAttributes,e.startedAt);let t=Ru(e);t&&p({attribution:{inputDelay:t.inputDelay,interactionTarget:t.interactionTarget,interactionType:t.interactionType,presentationDelay:t.presentationDelay,processingDuration:t.processingDuration},entries:[],id:Y(`vital`),name:`INP`,rating:Nu(`INP`,t.duration),value:t.duration},e.runtimeAttributes,e.startedAt)},h=n.onViewChange(e=>{var t;let r=u;if(r&&Mu(r.id,e.id)){r.runtimeAttributes=K(K(K({},r.runtimeAttributes),{},{[X.viewId]:e.id},e.name?{[X.viewName]:e.name}:{}),{},{[X.viewUrl]:e.url,[X.viewUrlTemplate]:e.urlTemplate});return}m(),u=e.id?{cls:0,clsWindowValue:0,interactionCountAtStart:Fu(),interactionIdMax:0,interactionIdMin:1/0,inpCandidates:[],id:e.id,runtimeAttributes:n.getRuntimeAttributes(),startedAt:(t=e.startedAt)==null?Date.now():t}:void 0});if(typeof PerformanceObserver<`u`){var g,_;(g=PerformanceObserver.supportedEntryTypes)!=null&&g.includes(`layout-shift`)&&(f=new PerformanceObserver(e=>{if(u)for(let t of e.getEntries())performance.timeOrigin+t.startTime<u.startedAt||Iu(u,t)}),f.observe({buffered:!0,type:`layout-shift`})),(_=PerformanceObserver.supportedEntryTypes)!=null&&_.includes(`event`)&&(d=new PerformanceObserver(e=>{if(u)for(let t of e.getEntries())performance.timeOrigin+t.startTime<u.startedAt||!t.interactionId||!Number.isFinite(t.duration)||Lu(u,t)}),d.observe({buffered:!0,durationThreshold:40,type:`event`}))}a(l),o(l),s(l),e=()=>{m(),u=void 0,h(),f==null||f.disconnect(),d==null||d.disconnect()}})()},shutdown(){t=!0,e==null||e(),e=void 0}}};q();var Vu=(e,t)=>{let n={"network.protocol.name":`websocket`,"url.full":t(e)};try{let t=new URL(e,typeof location>`u`?`http://localhost`:location.href);n[`server.address`]=t.hostname,t.port&&(n[`server.port`]=Number(t.port)),n[`url.scheme`]=t.protocol.replace(`:`,``)}catch(e){}return n},Hu=(e,t,n,r)=>{let i=Y(`websocket`),a=Vu(n,t.config.hooks.redactUrl),o=!1,s=(e,n,o={})=>{if(r()||!t.isSampled())return;let s=e===`error`;t.startSpan(`browser.websocket`,K(K(K({},a),$({outcome:s?Z.error:Z.success,spanType:Q.websocket})),{},{[X.websocketPhase]:e,"websocket.connection.id":i},o),{kind:Ve.CLIENT,startTime:n}).end(n)};s(`connect`,Date.now()),e.addEventListener(`open`,()=>{o=!0,s(`open`,Date.now())}),e.addEventListener(`error`,()=>{s(`error`,Date.now(),{"websocket.error.phase":o?`runtime`:`connect`})}),e.addEventListener(`close`,e=>{s(`close`,Date.now(),{"websocket.close.code":e.code,"websocket.close.reason":e.reason,"websocket.close.was_clean":e.wasClean})})},Uu=()=>{let e,t,n=!1;return{name:`websocket`,init(r){if(typeof window>`u`||window.WebSocket===void 0)return;let i=window.WebSocket;e=i,t=new Proxy(i,{construct(e,t,i){let a=Reflect.construct(e,t,i);if(n||!r.isSampled())return a;let o=t[0]==null?``:String(t[0]);return o&&!wo(r.config,o)&&Hu(a,r,o,()=>n),a}}),window.WebSocket=t},shutdown(){n=!0,typeof window<`u`&&e&&window.WebSocket===t&&(window.WebSocket=e),t=void 0,e=void 0}}};L();var Wu=class{constructor(){I(this,`listeners`,new Set),I(this,`notify`,e=>{this.listeners.forEach(t=>t(e))}),I(this,`subscribe`,e=>(this.listeners.add(e),()=>this.listeners.delete(e)))}},Gu=`0.0.32`;q();var Ku=e=>e.trim().replace(/\/+$/,``),qu=e=>{var t;let n=e.token||e.headers?K(K({},e.token?{Authorization:`Bearer ${e.token}`}:{}),(t=e.headers)==null?{}:t):void 0;return{concurrencyLimit:e.concurrencyLimit,endpoint:`${Ku(e.endpoint)}/v1/rum`,headers:n,timeoutMillis:e.timeoutMillis}},Ju=e=>typeof e!=`number`||!Number.isFinite(e)?1:Math.max(0,Math.min(1,e)),Yu=e=>e,Xu=e=>{if(!e)return e;try{let t=new URL(e,typeof location>`u`?`http://localhost`:location.href);return t.username=``,t.password=``,t.search=``,t.hash=``,t.href}catch(t){return e.replace(/[?#].*$/,``)}},Zu=e=>{try{return new URL(e,typeof location>`u`?`http://localhost`:location.href).pathname||`/`}catch(t){return e||`/`}},Qu=e=>bo(Zu(e)),$u=(e,t)=>n=>{try{let e=t==null?void 0:t(n);if(e)return e}catch(t){var r;e.debug&&((r=globalThis.console)==null||r.warn(`[bk-ot] url template hook failed:`,t))}return Qu(n)},ed=e=>{var t;return{environment:(t=e.environment)==null?`production`:t,name:e.name,version:e.version}},td=(e,t,n)=>K(K(K({[X.deploymentEnvironmentName]:e.environment},t===!1?{}:Rc()),{},{[X.serviceName]:e.name},e.version?{[X.serviceVersion]:e.version}:{}),{},{[X.sessionSampleRate]:n,"telemetry.sdk.language":`webjs`,"telemetry.sdk.name":`blueking`,"telemetry.sdk.version":Gu}),nd=e=>{var t;if(!e)throw Error(`[bk-ot] transport is required.`);if(!((t=e.endpoint)!=null&&t.trim()))throw Error(`[bk-ot] transport.endpoint is required.`)},rd=e=>{var t,n,r,i,a,o,s,c,l,u,d,f,p;return{beforeSend:(t=e.tracking)==null?void 0:t.beforeSend,getPageAttributes:(n=(r=e.context)==null||(r=r.attributes)==null?void 0:r.page)==null?(()=>({})):n,getErrorAttributes:(i=(a=e.context)==null||(a=a.attributes)==null?void 0:a.error)==null?(()=>({})):i,getCustomAttributes:(o=(s=e.context)==null||(s=s.attributes)==null?void 0:s.custom)==null?(()=>({})):o,getRequestUrlTemplate:$u(e,typeof((c=e.tracking)==null?void 0:c.request)==`object`?e.tracking.request.getUrlTemplate:void 0),getViewUrlTemplate:$u(e,typeof((l=e.tracking)==null?void 0:l.view)==`object`?e.tracking.view.getUrlTemplate:void 0),redactAttributes:(u=(d=e.privacy)==null?void 0:d.redactAttributes)==null?Yu:u,redactUrl:(f=(p=e.privacy)==null?void 0:p.redactUrl)==null?Xu:f}},id=e=>{var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;if(!(!((t=e.application)==null||(t=t.name)==null)&&t.trim()))throw Error(`[bk-ot] application.name is required.`);nd(e.transport);let _=ed(e.application),v=typeof((n=e.tracking)==null?void 0:n.view)==`object`?e.tracking.view:void 0,y=rd(e),b=Ju((r=e.session)==null?void 0:r.sampleRate);return{application:_,autoStart:(i=e.autoStart)==null?!0:i,debug:(a=e.debug)==null?!1:a,enabled:(o=e.enabled)==null?!0:o,extensions:{instrumentations:[...(s=(c=e.extensions)==null?void 0:c.instrumentations)==null?[]:s],plugins:[...(l=(u=e.extensions)==null?void 0:u.plugins)==null?[]:l]},hooks:y,resourceAttributes:y.redactAttributes(td(_,(d=e.tracking)==null?void 0:d.device,b)),session:K(K({},e.session),{},{sampleRate:b}),spanBatch:e.transport.batch,spanProcessor:(f=e.transport.processor)==null?`batch`:f,tracking:(p=e.tracking)==null?{}:p,trackingConsent:(m=(h=e.privacy)==null?void 0:h.trackingConsent)==null?`granted`:m,transport:qu(e.transport),user:(g=e.context)==null?void 0:g.user,view:{excludedActivityUrls:v==null?void 0:v.excludedActivityUrls,loadingTime:(v==null?void 0:v.loadingTime)!==!1,tracking:(v==null?void 0:v.tracking)===`manual`?`manual`:`auto`}}};L();var ad=(e,t)=>typeof e.enabled==`function`?e.enabled(t):e.enabled!==!1,od=class{constructor(e){I(this,`plugins`,void 0),I(this,`startedPlugins`,[]),this.plugins=e}flush(){var e=this;return G(function*(){yield Promise.all(e.startedPlugins.map(e=>Promise.resolve().then(()=>{var t;return(t=e.flush)==null?void 0:t.call(e)})))})()}shutdown(){var e=this;return G(function*(){let t=[...e.startedPlugins].reverse();for(let e of t){var n;yield(n=e.shutdown)==null?void 0:n.call(e)}e.startedPlugins=[]})()}start(e){var t=this;return G(function*(){for(let r of t.plugins)if(ad(r,e.config))try{yield r.init(e),t.startedPlugins.push(r)}catch(t){if(e.config.debug){var n;(n=globalThis.console)==null||n.warn(`[bk-ot] plugin "${r.name}" init failed:`,t)}}})()}};L(),q();var sd=new Set(Object.values(X)),cd=e=>{if(typeof e==`string`&&e.length>0)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;--t){let n=e[t];if(typeof n==`string`&&n.length>0)return n}},ld=class{constructor(e={},t){I(this,`actionHistory`,[]),I(this,`attributes`,{}),I(this,`queuedViewCommands`,[]),I(this,`recordAssociation`,(e,t,n,r)=>{let i=e.at(-1);if(i&&i.endedAt===void 0&&(i.endedAt=Math.max(i.startedAt,n)),r){let r={};for(let e of t){let t=this.attributes[e];t!==void 0&&(r[e]=t)}e.push({attributes:r,startedAt:n})}e.length>100&&e.splice(0,e.length-100)}),I(this,`sessionHistory`,[]),I(this,`sampled`,!1),I(this,`samplingHistory`,[]),I(this,`sessionLifecycleListeners`,new Set),I(this,`setOptionalAttribute`,(e,t)=>{if(t===void 0){delete this.attributes[e];return}this.attributes[e]=t}),I(this,`user`,{}),I(this,`view`,{}),I(this,`viewAttributeKeys`,new Set),I(this,`viewChangeListeners`,new Set),I(this,`viewCommandListeners`,new Set),I(this,`viewHistory`,[]),I(this,`viewScopedAttributeKeys`,new Set),I(this,`dispatchViewCommand`,e=>{if(this.viewCommandListeners.size===0){this.queuedViewCommands.push(e);return}this.viewCommandListeners.forEach(t=>t(e))}),I(this,`getAttributes`,()=>K({},this.attributes)),I(this,`getAttributesAt`,e=>{if(!Number.isFinite(e))return this.getAttributes();let t=this.getAttributes(),n=(n,r)=>{for(let e of r)delete t[e];let i=[...n].reverse().find(t=>t.startedAt<=e&&(t.endedAt===void 0||e<t.endedAt));i&&Object.assign(t,i.attributes)};return n(this.sessionHistory,[X.sessionId,X.sessionHasReplay]),n(this.viewHistory,this.viewScopedAttributeKeys),n(this.actionHistory,[X.actionId]),t}),I(this,`getUser`,()=>K({},this.user)),I(this,`getView`,()=>K({},this.view)),I(this,`isSessionActive`,()=>typeof this.attributes[X.sessionId]==`string`),I(this,`isSessionSampledAt`,e=>{var t,n;return Number.isFinite(e)?(t=(n=[...this.samplingHistory].reverse().find(t=>t.startedAt<=e&&(t.endedAt===void 0||e<t.endedAt)))==null?void 0:n.sampled)==null?!1:t:this.sampled}),I(this,`isViewActive`,()=>typeof this.attributes[X.viewId]==`string`),I(this,`notifySessionLifecycle`,e=>{this.sessionLifecycleListeners.forEach(t=>t(e))}),I(this,`onSessionLifecycle`,e=>(this.sessionLifecycleListeners.add(e),()=>this.sessionLifecycleListeners.delete(e))),I(this,`onViewChange`,e=>(this.viewChangeListeners.add(e),this.view.id&&e(this.getView()),()=>this.viewChangeListeners.delete(e))),I(this,`onViewCommand`,e=>{for(this.viewCommandListeners.add(e);this.queuedViewCommands.length;)e(this.queuedViewCommands.shift());return()=>this.viewCommandListeners.delete(e)}),I(this,`setAttributes`,(e,t=Date.now())=>{for(let[t,n]of Object.entries(e)){if(n===void 0){delete this.attributes[t];continue}this.attributes[t]=n}if(X.sessionId in e&&this.recordAssociation(this.sessionHistory,[X.sessionId,X.sessionHasReplay],t,typeof this.attributes[X.sessionId]==`string`),X.actionId in e){let e=cd(this.attributes[X.actionId]);e===void 0?delete this.attributes[X.actionId]:this.attributes[X.actionId]=e,this.recordAssociation(this.actionHistory,[X.actionId],t,typeof this.attributes[X.actionId]==`string`)}}),I(this,`setUser`,e=>{if(this.user=K(K({},this.user),e),`id`in e){if(e.id===void 0){delete this.attributes[X.userId];return}this.attributes[X.userId]=e.id}}),I(this,`setSessionSampled`,(e,t=Date.now())=>{if(e===this.sampled)return;let n=this.samplingHistory.at(-1);n&&n.endedAt===void 0&&(n.endedAt=Math.max(n.startedAt,t)),this.sampled=e,e&&this.samplingHistory.push({sampled:e,startedAt:t}),this.samplingHistory.length>100&&this.samplingHistory.splice(0,this.samplingHistory.length-100)}),I(this,`setView`,(e,t=(t=>(t=e.startedAt)==null?Date.now():t)())=>{var n;this.viewAttributeKeys.forEach(e=>delete this.attributes[e]),this.viewAttributeKeys.clear();let r={};for(let[t,i]of Object.entries((n=e.attributes)==null?{}:n))i===void 0||sd.has(t)||(r[t]=i,this.attributes[t]=i,this.viewAttributeKeys.add(t),this.viewScopedAttributeKeys.add(t));this.view=K(K({},e),{},{attributes:r}),this.setOptionalAttribute(X.viewId,e.id),this.setOptionalAttribute(X.viewUrl,e.url),this.setOptionalAttribute(X.viewUrlTemplate,e.urlTemplate),this.setOptionalAttribute(X.viewLoadingType,e.loadingType),this.setOptionalAttribute(X.viewName,e.name),[X.viewId,X.viewUrl,X.viewUrlTemplate,X.viewLoadingType,X.viewName].forEach(e=>this.viewScopedAttributeKeys.add(e)),this.recordAssociation(this.viewHistory,this.viewScopedAttributeKeys,t,typeof e.id==`string`&&e.id.length>0),this.viewChangeListeners.forEach(e=>e(this.getView()))}),this.setAttributes(e),t&&this.setUser(t)}},ud=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t=Math.imul(t^e.charCodeAt(n),16777619);return t+=t<<13,t^=t>>>7,t+=t<<3,t^=t>>>17,t+=t<<5,(t>>>0)/4294967296},dd=({application:e,session:t},n)=>t.sampleRate<=0?!1:t.sampleRate>=1?!0:ud(`${e.name}\0${n}`)<t.sampleRate;L(),q();var fd=e=>({url:e.endpoint,headers:e.headers,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis}),pd=`bk-rum`,md=class{constructor(e){this.isSampled=e}shouldSample(){return{decision:this.isSampled()?J.RECORD_AND_SAMPLED:J.NOT_RECORD}}toString(){return`RumSessionSampler`}},hd,gd=()=>{if(hd)hd.users+=1;else{let e=new ct().enable(),t=P.setGlobalContextManager(e);t||e.disable(),hd={contextManager:t?e:void 0,ownsContext:t,ownsPropagator:Ze.setGlobalPropagator(new Ir),users:1}}let e=!1;return()=>{e||!hd||(e=!0,--hd.users,!(hd.users>0)&&(hd.ownsContext&&P.disable(),hd.ownsPropagator&&Ze.disable(),hd=void 0))}},_d=(e,t)=>t?new Proxy(e,{get(e,t,n){if(t===`export`)return(t,n)=>{var r;return(r=globalThis.console)==null||r.log(`[bk-ot][rum]`,t),e.export(t,n)};let r=Reflect.get(e,t,n);return typeof r==`function`?r.bind(e):r}}):e,vd=e=>[wc(e.tracking.request)],yd=e=>[Nl(e.session),...Sd(e.tracking.device,!0,Bc),es(),_l(),oc(bd(e.tracking.resource,!0))],bd=(e,t)=>e===void 0?t:e!==!1,xd=e=>typeof e==`object`&&e?e:void 0,Sd=(e,t,n)=>bd(e,t)?[n(xd(e))]:[],Cd=e=>[...Sd(e.error,!0,Uc),...Sd(e.webVitals,!0,Bu),...Sd(e.blankScreen,!0,hs),...Sd(e.action,!0,Qo),...Sd(e.websocket,!1,Uu),...Sd(e.longTask,!1,Yc),...Sd(e.cspViolation,!1,Dc)],wd=class{assertBeforeStart(e){if(this.phase!==`idle`)throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`)}createPluginContext(){return{applyRedact:this.applyRedact,config:this.config,flush:this.flush,getRuntimeAttributes:this.getRuntimeAttributes,getRuntimeAttributesAt:this.getRuntimeAttributesAt,isSampled:this.isSampled,isSessionActive:this.isSessionActive,isViewActive:this.isViewActive,notifySessionLifecycle:this.notifySessionLifecycle,notifyActivity:this.activityObserver.notify,onActivity:this.activityObserver.subscribe,onSessionLifecycle:this.onSessionLifecycle,onViewCommand:this.runtimeContext.onViewCommand,onViewChange:this.runtimeContext.onViewChange,registerInstrumentations:this.registerInstrumentations,setRuntimeAttributes:this.setRuntimeAttributes,setUser:this.setUser,setView:this.runtimeContext.setView,startSpan:this.startSpan,tracer:this.tracer}}createPluginManager(){var e;return new od([...yd(this.config),...vd(this.config),...Cd(this.config.tracking),...(e=this.config.extensions.plugins)==null?[]:e])}constructor(e){var t=this;I(this,`activityObserver`,new Wu),I(this,`flushProviders`,G(function*(){yield t.tracerProvider.forceFlush()})),I(this,`phase`,`idle`),I(this,`pluginManager`,void 0),I(this,`registeredInstrumentations`,void 0),I(this,`releaseOtelGlobals`,void 0),I(this,`runtimeContext`,void 0),I(this,`sampled`,!1),I(this,`startCollection`,G(function*(){if(t.pluginManager||!t.config.enabled||t.config.trackingConsent!==`granted`)return;t.releaseOtelGlobals=gd();let e=t.createPluginManager();t.pluginManager=e;try{var n;yield e.start(t.createPluginContext()),t.registerInstrumentations((n=t.config.extensions.instrumentations)==null?[]:n)}catch(n){var r,i,a;for(yield e.shutdown(),t.pluginManager=void 0;t.registeredInstrumentations.length;)(r=t.registeredInstrumentations.pop())==null||(i=r.disable)==null||i.call(r);throw(a=t.releaseOtelGlobals)==null||a.call(t),t.releaseOtelGlobals=void 0,n}})),I(this,`stopCollection`,function(){var e=G(function*(e){var n,r,i;let a=t.pluginManager;if(a){for(yield a.shutdown(),t.pluginManager=void 0;t.registeredInstrumentations.length;)(n=t.registeredInstrumentations.pop())==null||(r=n.disable)==null||r.call(n);t.setRuntimeAttributes({[X.sessionHasReplay]:void 0,[X.sessionId]:void 0}),e&&(yield t.flushProviders()),(i=t.releaseOtelGlobals)==null||i.call(t),t.releaseOtelGlobals=void 0}});return function(t){return e.apply(this,arguments)}}()),I(this,`teardownCallbacks`,[]),I(this,`tracerProvider`,void 0),I(this,`applyRedact`,e=>this.config.hooks.redactAttributes(e)),I(this,`config`,void 0),I(this,`flush`,G(function*(){var e;yield(e=t.pluginManager)==null?void 0:e.flush(),yield t.flushProviders()})),I(this,`getRuntimeAttributes`,()=>this.runtimeContext.getAttributes()),I(this,`getRuntimeAttributesAt`,e=>this.runtimeContext.getAttributesAt(e)),I(this,`isSampled`,()=>this.sampled),I(this,`isSessionActive`,()=>this.runtimeContext.isSessionActive()),I(this,`isViewActive`,()=>this.runtimeContext.isViewActive()),I(this,`notifySessionLifecycle`,e=>{this.runtimeContext.notifySessionLifecycle(e)}),I(this,`onSessionLifecycle`,e=>this.runtimeContext.onSessionLifecycle(e)),I(this,`registerInstrumentations`,e=>{e.length&&(e.forEach(e=>{e.setTracerProvider(this.tracerProvider),e.getConfig().enabled||e.enable()}),this.registeredInstrumentations.push(...e))}),I(this,`reportAction`,({attributes:e={},name:t})=>{if(!this.isSampled())return;let n=Y(`action`),r=Date.now();this.startSpan(`action.${t}`,K(K(K(K({},this.config.hooks.getPageAttributes()),e),$({spanType:Q.action})),{},{[X.actionId]:n,[X.actionType]:`custom`}),{startTime:r}).end(r)}),I(this,`reportCustomEvent`,({attributes:e={},error:t,name:n})=>{if(!this.isSampled()){if(this.config.debug){var r;(r=globalThis.console)==null||r.warn(`[bk-ot] custom event dropped (not sampled):`,n)}return}let i=Date.now(),a=this.startSpan(`custom.${n}`,K(K(K(K({},this.config.hooks.getPageAttributes()),this.config.hooks.getCustomAttributes()),e),$({outcome:t?Z.error:Z.success,spanType:Q.custom})),{startTime:i});t&&(a.recordException(t),a.setStatus({code:He.ERROR,message:t.message})),a.end(i)}),I(this,`setRuntimeAttributes`,(e,t)=>{let n=K({},e),r=t==null?Date.now():t;if(X.sessionId in e){let t=e[X.sessionId];this.sampled=this.config.enabled&&typeof t==`string`&&t.length>0?dd(this.config,t):!1,this.runtimeContext.setSessionSampled(this.sampled,r)}this.runtimeContext.setAttributes(n,r)}),I(this,`setTrackingConsent`,function(){var e=G(function*(e){t.config.trackingConsent!==e&&(t.config.trackingConsent=e,t.phase===`started`&&(e===`granted`?yield t.startCollection():yield t.stopCollection(!0)))});return function(t){return e.apply(this,arguments)}}()),I(this,`setUser`,e=>{this.runtimeContext.setUser(e)}),I(this,`setViewLoadingTime`,()=>{this.isSampled()&&this.runtimeContext.dispatchViewCommand({time:Date.now(),type:`set_loading_time`})}),I(this,`setViewName`,e=>{this.isSampled()&&this.runtimeContext.dispatchViewCommand({name:e,type:`set_name`})}),I(this,`shutdown`,G(function*(){if(t.phase!==`stopped`){for(yield t.stopCollection(!1),yield t.flushProviders();t.teardownCallbacks.length;){var e;(e=t.teardownCallbacks.pop())==null||e()}yield t.tracerProvider.shutdown(),t.phase=`stopped`}})),I(this,`start`,G(function*(){if(!(t.phase===`started`||t.phase===`starting`)){if(t.phase===`stopped`)throw Error(`[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.`);if(!t.config.enabled){t.phase=`started`;return}t.phase=`starting`;try{if(yield t.startCollection(),typeof window<`u`&&typeof document<`u`){let e=()=>{t.flush()},n=()=>{document.visibilityState===`hidden`&&t.flush()};window.addEventListener(`pagehide`,e),document.addEventListener(`visibilitychange`,n),t.teardownCallbacks.push(()=>window.removeEventListener(`pagehide`,e),()=>document.removeEventListener(`visibilitychange`,n))}}catch(n){for(;t.teardownCallbacks.length;){var e;(e=t.teardownCallbacks.pop())==null||e()}throw yield t.stopCollection(!1),t.phase=`idle`,n}t.phase=`started`}})),I(this,`startSpan`,(e,t={},n)=>{var r,i;let a=(r=n==null?void 0:n.contextTime)==null?typeof(n==null?void 0:n.startTime)==`number`?n.startTime:void 0:r;if(!this.isSampled()||a!==void 0&&!this.runtimeContext.isSessionSampledAt(a))return this.tracer.startSpan(e);let o=a===void 0?this.getRuntimeAttributes():this.runtimeContext.getAttributesAt(a);return this.tracer.startSpan(e,{kind:(i=n==null?void 0:n.kind)==null?Ve.INTERNAL:i,links:n==null?void 0:n.links,startTime:n==null?void 0:n.startTime,attributes:this.applyRedact(K(K({},o),t))})}),I(this,`startView`,(e={})=>{this.isSampled()&&this.runtimeContext.dispatchViewCommand({options:e,type:`start`})}),I(this,`tracer`,void 0),I(this,`use`,e=>{var t;return this.assertBeforeStart(`use`),(t=this.config.extensions.plugins)==null||t.push(e),this}),I(this,`useInstrumentation`,e=>{var t;return this.assertBeforeStart(`useInstrumentation`),this.config.enabled&&((t=this.config.extensions.instrumentations)==null||t.push(e)),this}),this.config=id(e),this.runtimeContext=new ld({},this.config.user);let n=ji(this.config.resourceAttributes),r=(()=>{let e=_d(new Oa(fd(this.config.transport)),this.config.debug);return[new Cs(this.config.spanProcessor===`simple`?new fo(e):new Wa(e,this.config.spanBatch),this.config,()=>this.applyRedact(K(K({},this.runtimeContext.getAttributes()),this.config.hooks.getPageAttributes())))]})();this.tracerProvider=new go({resource:n,sampler:new md(this.isSampled),spanProcessors:r}),this.tracer=this.tracerProvider.getTracer(pd),this.registeredInstrumentations=[],this.config.autoStart&&this.start().catch(e=>{var t;(t=globalThis.console)==null||t.warn(`[bk-ot] auto start failed:`,e)})}};return typeof window<`u`&&Object.assign(window,{BkOpenTelemetry:wd}),wd})();
|
|
1
|
+
var BkOpenTelemetry=(function(){var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=e(e=0)),t),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=`1.9.1`,i=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function a(e){let t=new Set([e]),n=new Set,r=e.match(i);if(!r)return()=>!1;let a={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(a.prerelease!=null)return function(t){return t===e};function o(e){return n.add(e),!1}function s(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(i);if(!r)return o(e);let c={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return c.prerelease!=null||a.major!==c.major?o(e):a.major===0?a.minor===c.minor&&a.patch<=c.patch?s(e):o(e):a.minor<=c.minor?s(e):o(e)}}var o=a(r),s=r.split(`.`)[0],c=Symbol.for(`opentelemetry.js.api.${s}`),l=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function u(e,t,n,i=!1){var a;let o=l[c]=(a=l[c])==null?{version:r}:a;if(!i&&o[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(o.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${r}`);return n.error(t.stack||t.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${r}.`),!0}function d(e){var t,n;let r=(t=l[c])==null?void 0:t.version;if(!(!r||!o(r)))return(n=l[c])==null?void 0:n[e]}function f(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${r}.`);let n=l[c];n&&delete n[e]}var p=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return m(`debug`,this._namespace,e)}error(...e){return m(`error`,this._namespace,e)}info(...e){return m(`info`,this._namespace,e)}warn(...e){return m(`warn`,this._namespace,e)}verbose(...e){return m(`verbose`,this._namespace,e)}};function m(e,t,n){let r=d(`diag`);if(r)return r[e](t,...n)}var h;(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`})(h||(h={}));function g(e,t){e<h.NONE?e=h.NONE:e>h.ALL&&(e=h.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`,h.ERROR),warn:n(`warn`,h.WARN),info:n(`info`,h.INFO),debug:n(`debug`,h.DEBUG),verbose:n(`verbose`,h.VERBOSE)}}var _=`diag`,v=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=d(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:h.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=d(`diag`),s=g((i=n.logLevel)==null?h.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 u(`diag`,s,t,!0)},t.disable=()=>{f(_,t)},t.createComponentLogger=e=>new p(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},y=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}},b=Symbol(`BaggageEntryMetadata`),x=v.instance();function S(e={}){return new y(new Map(Object.entries(e)))}function C(e){return typeof e!=`string`&&(x.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:b,toString(){return e}}}function w(e){return Symbol.for(e)}var T=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}}},E=class{constructor(){}createGauge(e,t){return ae}createHistogram(e,t){return oe}createCounter(e,t){return ie}createUpDownCounter(e,t){return se}createObservableGauge(e,t){return le}createObservableCounter(e,t){return ce}createObservableUpDownCounter(e,t){return ue}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},D=class{},ee=class extends D{add(e,t){}},O=class extends D{add(e,t){}},k=class extends D{record(e,t){}},A=class extends D{record(e,t){}},te=class{addCallback(e){}removeCallback(e){}},j=class extends te{},ne=class extends te{},re=class extends te{},M=new E,ie=new ee,ae=new k,oe=new A,se=new O,ce=new j,le=new ne,ue=new re;function de(){return M}var fe={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},pe={set(e,t,n){e!=null&&(e[t]=n)}},me=class{active(){return T}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},he=`context`,ge=new me,_e=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return u(he,e,v.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 d(he)||ge}disable(){this._getContextManager().disable(),f(he,v.instance())}},N;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(N||(N={}));var ve={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:N.NONE},ye=class{constructor(e=ve){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){}},be=w(`OpenTelemetry Context Key SPAN`);function xe(e){return e.getValue(be)||void 0}function Se(){return xe(_e.getInstance().active())}function Ce(e,t){return e.setValue(be,t)}function we(e){return e.deleteValue(be)}function Te(e,t){return Ce(e,new ye(t))}function Ee(e){var t;return(t=xe(e))==null?void 0:t.spanContext()}var De=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 Oe(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(De[e.charCodeAt(t)]|0)+(De[e.charCodeAt(t+1)]|0)+(De[e.charCodeAt(t+2)]|0)+(De[e.charCodeAt(t+3)]|0);return n===t}function ke(e){return Oe(e,32)&&e!==`00000000000000000000000000000000`}function Ae(e){return Oe(e,16)&&e!==`0000000000000000`}function je(e){return ke(e.traceId)&&Ae(e.spanId)}function Me(e){return new ye(e)}var Ne=_e.getInstance(),Pe=class{startSpan(e,t,n=Ne.active()){if(t!=null&&t.root)return new ye;let r=n&&Ee(n);return Fe(r)&&je(r)?new ye(r):new ye}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?Ne.active():a,c=this.startSpan(e,i,s),l=Ce(s,c);return Ne.with(l,o,void 0,c)}};function Fe(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 Ie=new Pe,Le=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):Ie}},Re=new class{getTracer(e,t,n){return new Pe}},ze=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new Le(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Re:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}},Be;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Be||(Be={}));var Ve;(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`})(Ve||(Ve={}));var He;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(He||(He={}));var Ue=_e.getInstance(),P=v.instance(),We=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},Ge=w(`OpenTelemetry Baggage Key`);function Ke(e){return e.getValue(Ge)||void 0}function qe(){return Ke(_e.getInstance().active())}function Je(e,t){return e.setValue(Ge,t)}function Ye(e){return e.deleteValue(Ge)}var Xe=`propagation`,Ze=new We,Qe=class e{constructor(){this.createBaggage=S,this.getBaggage=Ke,this.getActiveBaggage=qe,this.setBaggage=Je,this.deleteBaggage=Ye}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return u(Xe,e,v.instance())}inject(e,t,n=pe){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=fe){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){f(Xe,v.instance())}_getGlobalPropagator(){return d(Xe)||Ze}}.getInstance(),$e=`trace`,et=class e{constructor(){this._proxyTracerProvider=new ze,this.wrapSpanContext=Me,this.isSpanContextValid=je,this.deleteSpan=we,this.getSpan=xe,this.getActiveSpan=Se,this.getSpanContext=Ee,this.setSpan=Ce,this.setSpanContext=Te}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=u($e,this._proxyTracerProvider,v.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return d($e)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){f($e,v.instance()),this._proxyTracerProvider=new ze}}.getInstance();function tt(e){return typeof e==`object`&&!!e&&`addEventListener`in e&&typeof e.addEventListener==`function`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`}function nt(e){"@babel/helpers - typeof";return nt=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},nt(e)}var rt=t((()=>{}));function it(e,t){if(nt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(nt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var at=t((()=>{rt()}));function ot(e){var t=it(e,`string`);return nt(t)==`symbol`?t:t+``}var st=t((()=>{rt(),at()}));function F(e,t,n){return(t=ot(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var I=t((()=>{st()}));I();var ct=`OT_ZONE_CONTEXT`,lt=class{constructor(){F(this,`_enabled`,!1)}_bindFunction(e,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}_bindListener(e,t){let n=t;return n.__ot_listeners===void 0?(n.__ot_listeners={},typeof n.addEventListener==`function`&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),typeof n.removeEventListener==`function`&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener)),t):t}_createZone(e,t){return Zone.current.fork({name:e,properties:{[ct]:t},onCancelTask(e,t,n,r){return r.state===`notScheduled`||r.state===`running`?r:e.cancelTask(n,r)}})}_patchAddEventListener(e,t,n){let r=this;return function(i,a,o){e.__ot_listeners===void 0&&(e.__ot_listeners={});let s=e.__ot_listeners[i];s===void 0&&(s=new WeakMap,e.__ot_listeners[i]=s);let c=r.bind(n,a);return s.set(a,c),t.call(this,i,c,o)}}_patchRemoveEventListener(e,t){return function(n,r){if(e.__ot_listeners===void 0||e.__ot_listeners[n]===void 0)return t.call(this,n,r);let i=e.__ot_listeners[n],a=i.get(r);return i.delete(r),t.call(this,n,a||r)}}active(){return!this._enabled||!Zone.current?T:Zone.current.get(ct)||T}bind(e,t){return typeof t==`function`?this._bindFunction(e,t):(tt(t)&&this._bindListener(e,t),t)}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){let i=`otel:with`;return t.name&&(i+=`:${t.name}`),this._createZone(i,e).run(t,n,r)}},ut=Object.defineProperty,dt=Object.defineProperties,ft=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,mt=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,gt=(e,t,n)=>t in e?ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_t=(e,t)=>{for(var n in t||(t={}))mt.call(t,n)&>(e,n,t[n]);if(pt)for(var n of pt(t))ht.call(t,n)&>(e,n,t[n]);return e},vt=(e,t)=>dt(e,ft(t)),L=(e,t,n)=>(gt(e,typeof t==`symbol`?t:t+``,n),n),R=globalThis;function z(e){return(R.__Zone_symbol_prefix||`__zone_symbol__`)+e}function yt(){let e=R.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t(`Zone`);let r=class e{constructor(e,t){L(this,`_parent`),L(this,`_name`),L(this,`_properties`),L(this,`_zoneDelegate`),this._parent=e,this._name=t?t.name||`unnamed`:`<root>`,this._properties=t&&t.properties||{},this._zoneDelegate=new o(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(R.Promise!==ee.ZoneAwarePromise)throw Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=e.current;for(;t.parent;)t=t.parent;return t}static get current(){return k.zone}static get currentTask(){return A}static __load_patch(r,i,a=!1){if(ee.hasOwnProperty(r)){let e=R[z(`forceDuplicateZoneCheck`)]===!0;if(!a&&e)throw Error(`Already loaded patch: `+r)}else if(!R[`__Zone_disable_`+r]){let a=`Zone:`+r;t(a),ee[r]=i(R,e,O),n(a,a)}}get parent(){return this._parent}get name(){return this._name}get(e){let t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw Error(`ZoneSpec required!`);return this._zoneDelegate.fork(this,e)}wrap(e,t){if(typeof e!=`function`)throw Error(`Expecting function got: `+e);let n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}run(e,t,n,r){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{k=k.parent}}runGuarded(e,t=null,n,r){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.parent}}runTask(e,t,n){if(e.zone!=this)throw Error(`A task can only be run in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);let r=e,{type:i,data:{isPeriodic:a=!1,isRefreshable:o=!1}={}}=e;if(e.state===y&&(i===D||i===E))return;let s=e.state!=S;s&&r._transitionTo(S,x);let c=A;A=r,k={parent:k,zone:this};try{i==E&&e.data&&!a&&!o&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{let t=e.state;if(t!==y&&t!==w)if(i==D||a||o&&t===b)s&&r._transitionTo(x,S,b);else{let e=r._zoneDelegates;this._updateTaskCount(r,-1),s&&r._transitionTo(y,S,y),o&&(r._zoneDelegates=e)}k=k.parent,A=c}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);let t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(w,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(x,b),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new s(T,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,i){return this.scheduleTask(new s(E,e,t,n,r,i))}scheduleEventTask(e,t,n,r,i){return this.scheduleTask(new s(D,e,t,n,r,i))}cancelTask(e){if(e.zone!=this)throw Error(`A task can only be cancelled in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);if(!(e.state!==x&&e.state!==S)){e._transitionTo(C,x,S);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(w,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){let n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}};L(r,`__symbol__`,z);let i=r,a={name:``,onHasTask:(e,t,n,r)=>e.hasTask(n,r),onScheduleTask:(e,t,n,r)=>e.scheduleTask(n,r),onInvokeTask:(e,t,n,r,i,a)=>e.invokeTask(n,r,i,a),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class o{constructor(e,t,n){L(this,`_zone`),L(this,`_taskCounts`,{microTask:0,macroTask:0,eventTask:0}),L(this,`_forkDlgt`),L(this,`_forkZS`),L(this,`_forkCurrZone`),L(this,`_interceptDlgt`),L(this,`_interceptZS`),L(this,`_interceptCurrZone`),L(this,`_invokeDlgt`),L(this,`_invokeZS`),L(this,`_invokeCurrZone`),L(this,`_handleErrorDlgt`),L(this,`_handleErrorZS`),L(this,`_handleErrorCurrZone`),L(this,`_scheduleTaskDlgt`),L(this,`_scheduleTaskZS`),L(this,`_scheduleTaskCurrZone`),L(this,`_invokeTaskDlgt`),L(this,`_invokeTaskZS`),L(this,`_invokeTaskCurrZone`),L(this,`_cancelTaskDlgt`),L(this,`_cancelTaskZS`),L(this,`_cancelTaskCurrZone`),L(this,`_hasTaskDlgt`),L(this,`_hasTaskDlgtOwner`),L(this,`_hasTaskZS`),L(this,`_hasTaskCurrZone`),this._zone=e,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let r=n&&n.onHasTask,i=t&&t._hasTaskZS;(r||i)&&(this._hasTaskZS=r?n:a,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=a,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=a,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=a,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new i(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,i):t.apply(n,r)}handleError(e,t){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t):!0}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else if(t.type==T)g(t);else throw Error(`Task is missing scheduleFn.`);return n}invokeTask(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error(`Task is not cancelable`);n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){let n=this._taskCounts,r=n[e],i=n[e]=r+t;if(i<0)throw Error(`More tasks executed then were scheduled.`);if(r==0||i==0){let t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class s{constructor(e,t,n,r,i,a){if(L(this,`type`),L(this,`source`),L(this,`invoke`),L(this,`callback`),L(this,`data`),L(this,`scheduleFn`),L(this,`cancelFn`),L(this,`_zone`,null),L(this,`runCount`,0),L(this,`_zoneDelegates`,null),L(this,`_state`,`notScheduled`),this.type=e,this.source=t,this.data=r,this.scheduleFn=i,this.cancelFn=a,!n)throw Error(`callback is not defined`);this.callback=n;let o=this;e===D&&r&&r.useG?this.invoke=s.invokeTask:this.invoke=function(){return s.invokeTask.call(R,o,this,arguments)}}static invokeTask(e,t,n){e||(e=this),te++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{te===1&&!R[d]&&_(),te--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,n){if(this._state===t||this._state===n)this._state=e,e==y&&(this._zoneDelegates=null);else throw Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?` or '`+n+`'`:``}, was '${this._state}'.`)}toString(){return this.data&&this.data.handleId!==void 0?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let c=z(`setTimeout`),l=z(`Promise`),u=z(`then`),d=z(`enable_native_microtask_draining`),f=[],p=!1,m;function h(e){var t;!m&&R[l]&&(m=R[l].resolve(0)),m?((t=m[u])==null?m.then:t).call(m,e):R[c](e,0)}function g(e){let t=R[d],n=t&&f.length===0&&!p,r=!t&&te===0&&f.length===0;(n||r)&&h(_),e&&f.push(e)}function _(){if(!p){for(p=!0;f.length;){let e=f;f=[];for(let t of e)try{t.zone.runTask(t,null,null)}catch(e){O.onUnhandledError(e)}}R[d]?(p=!1,O.microtaskDrainDone()):(O.microtaskDrainDone(),p=!1)}}let v={name:`NO ZONE`},y=`notScheduled`,b=`scheduling`,x=`scheduled`,S=`running`,C=`canceling`,w=`unknown`,T=`microTask`,E=`macroTask`,D=`eventTask`,ee={},O={symbol:z,currentZoneFrame:()=>k,onUnhandledError:j,microtaskDrainDone:j,scheduleMicroTask:g,showUncaughtError:()=>!i[z(`ignoreConsoleErrorUncaughtError`)],patchEventTarget:()=>[],patchOnProperties:j,patchMethod:()=>j,bindArguments:()=>[],patchThen:()=>j,patchMacroTask:()=>j,patchEventPrototype:()=>j,getGlobalObjects:()=>void 0,ObjectDefineProperty:()=>j,ObjectGetOwnPropertyDescriptor:()=>void 0,ObjectCreate:()=>void 0,ArraySlice:()=>[],patchClass:()=>j,wrapWithCurrentZone:()=>j,filterProperties:()=>[],attachOriginToPatched:()=>j,_redefineProperty:()=>j,patchCallbacks:()=>j,nativeScheduleMicroTask:h},k={parent:null,zone:new i(null,null)},A=null,te=0;function j(){}return n(`Zone`,`Zone`),i}function bt(){let e=globalThis,t=e[z(`forceDuplicateZoneCheck`)]===!0;if(e.Zone&&(t||typeof e.Zone.__symbol__!=`function`))throw Error(`Zone already loaded.`);return e.Zone!=null||(e.Zone=yt()),e.Zone}var xt=Object.getOwnPropertyDescriptor,St=Object.defineProperty,Ct=Object.getPrototypeOf,wt=Object.create,Tt=Array.prototype.slice,Et=`addEventListener`,Dt=`removeEventListener`,Ot=z(Et),kt=z(Dt),At=`true`,jt=`false`,Mt=z(``);function Nt(e,t){return Zone.current.wrap(e,t)}function Pt(e,t,n,r,i){return Zone.current.scheduleMacroTask(e,t,n,r,i)}var B=z,Ft=typeof window<`u`,It=Ft?window:void 0,V=Ft&&It||globalThis,Lt=`removeAttribute`;function Rt(e,t){for(let n=e.length-1;n>=0;n--)typeof e[n]==`function`&&(e[n]=Nt(e[n],t+`_`+n));return e}function zt(e,t){let n=e.constructor.name;for(let r=0;r<t.length;r++){let i=t[r],a=e[i];if(a){if(!Bt(xt(e,i)))continue;e[i]=(e=>{let t=function(){return e.apply(this,Rt(arguments,n+`.`+i))};return nn(t,e),t})(a)}}}function Bt(e){return e?e.writable===!1?!1:!(typeof e.get==`function`&&e.set===void 0):!0}var Vt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope,Ht=!(`nw`in V)&&V.process!==void 0&&V.process.toString()===`[object process]`,Ut=!Ht&&!Vt&&!!(Ft&&It.HTMLElement),Wt=V.process!==void 0&&V.process.toString()===`[object process]`&&!Vt&&!!(Ft&&It.HTMLElement),Gt={},Kt=B(`enable_beforeunload`),qt=function(e){if(e=e||V.event,!e)return;let t=Gt[e.type];t||(t=Gt[e.type]=B(`ON_PROPERTY`+e.type));let n=this||e.target||V,r=n[t],i;if(Ut&&n===It&&e.type===`error`){let t=e;i=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),i===!0&&e.preventDefault()}else i=r&&r.apply(this,arguments),e.type===`beforeunload`&&V[Kt]&&typeof i==`string`?e.returnValue=i:i!=null&&!i&&e.preventDefault();return i};function Jt(e,t,n){let r=xt(e,t);if(!r&&n&&xt(n,t)&&(r={enumerable:!0,configurable:!0}),!r||!r.configurable)return;let i=B(`on`+t+`patched`);if(e.hasOwnProperty(i)&&e[i])return;delete r.writable,delete r.value;let a=r.get,o=r.set,s=t.slice(2),c=Gt[s];c||(c=Gt[s]=B(`ON_PROPERTY`+s)),r.set=function(t){let n=this;!n&&e===V&&(n=V),n&&(typeof n[c]==`function`&&n.removeEventListener(s,qt),o==null||o.call(n,null),n[c]=t,typeof t==`function`&&n.addEventListener(s,qt,!1))},r.get=function(){let n=this;if(!n&&e===V&&(n=V),!n)return null;let i=n[c];if(i)return i;if(a){let e=a.call(this);if(e)return r.set.call(this,e),typeof n[Lt]==`function`&&n.removeAttribute(t),e}return null},St(e,t,r),e[i]=!0}function Yt(e,t,n){if(t)for(let r=0;r<t.length;r++)Jt(e,`on`+t[r],n);else{let t=[];for(let n in e)n.slice(0,2)==`on`&&t.push(n);for(let r=0;r<t.length;r++)Jt(e,t[r],n)}}var Xt=B(`originalInstance`);function Zt(e){let t=V[e];if(!t)return;V[B(e)]=t,V[e]=function(){let n=Rt(arguments,e);switch(n.length){case 0:this[Xt]=new t;break;case 1:this[Xt]=new t(n[0]);break;case 2:this[Xt]=new t(n[0],n[1]);break;case 3:this[Xt]=new t(n[0],n[1],n[2]);break;case 4:this[Xt]=new t(n[0],n[1],n[2],n[3]);break;default:throw Error(`Arg list too long.`)}},nn(V[e],t);let n=new t(function(){}),r;for(r in n)e===`XMLHttpRequest`&&r===`responseBlob`||(function(t){typeof n[t]==`function`?V[e].prototype[t]=function(){return this[Xt][t].apply(this[Xt],arguments)}:St(V[e].prototype,t,{set:function(n){typeof n==`function`?(this[Xt][t]=Nt(n,e+`.`+t),nn(this[Xt][t],n)):this[Xt][t]=n},get:function(){return this[Xt][t]}})})(r);for(r in t)r!==`prototype`&&t.hasOwnProperty(r)&&(V[e][r]=t[r])}function Qt(e,t){typeof Object.getOwnPropertySymbols==`function`&&Object.getOwnPropertySymbols(e).forEach(n=>{let r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){r&&(!r.writable||typeof r.set!=`function`)||(e[n]=t)},enumerable:r?r.enumerable:!0,configurable:r?r.configurable:!0})})}var $t=!1;function en(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=Ct(r);!r&&e[t]&&(r=e);let i=B(t),a=null;if(r&&(!(a=r[i])||!r.hasOwnProperty(i))&&(a=r[i]=r[t],Bt(r&&xt(r,t)))){let e=n(a,i,t);r[t]=function(){return e(this,arguments)},nn(r[t],a),$t&&Qt(a,r[t])}return a}function tn(e,t,n){let r=null;function i(e){let t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=en(e,t,e=>function(t,r){let a=n(t,r);return a.cbIdx>=0&&typeof r[a.cbIdx]==`function`?Pt(a.name,r[a.cbIdx],a,i):e.apply(t,r)})}function nn(e,t){e[B(`OriginalDelegate`)]=t}function rn(e){return typeof e==`function`}function an(e){return typeof e==`number`}var on={useG:!0},H={},sn={},cn=RegExp(`^`+Mt+`(\\w+)(true|false)$`),ln=B(`propagationStopped`);function un(e,t){let n=(t?t(e):e)+jt,r=(t?t(e):e)+At,i=Mt+n,a=Mt+r;H[e]={},H[e][jt]=i,H[e][At]=a}function dn(e,t,n,r){let i=r&&r.add||Et,a=r&&r.rm||Dt,o=r&&r.listeners||`eventListeners`,s=r&&r.rmAll||`removeAllListeners`,c=B(i),l=`.`+i+`:`,u=`prependListener`;``+u;let d=function(e,t,n){if(e.isRemoved)return;let r=e.callback;typeof r==`object`&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);let i;try{e.invoke(e,t,[n])}catch(e){i=e}let o=e.options;if(o&&typeof o==`object`&&o.once){let r=e.originalDelegate?e.originalDelegate:e.callback;t[a].call(t,n.type,r,o)}return i};function f(n,r,i){if(r=r||e.event,!r)return;let a=n||r.target||e,o=a[H[r.type][i?At:jt]];if(o){let e=[];if(o.length===1){let t=d(o[0],a,r);t&&e.push(t)}else{let t=o.slice();for(let n=0;n<t.length&&!(r&&r[ln]===!0);n++){let i=d(t[n],a,r);i&&e.push(i)}}if(e.length===1)throw e[0];for(let n=0;n<e.length;n++){let r=e[n];t.nativeScheduleMicroTask(()=>{throw r})}}}let p=function(e){return f(this,e,!1)},m=function(e){return f(this,e,!0)};function h(t,n){if(!t)return!1;let r=!0;n&&n.useG!==void 0&&(r=n.useG);let d=n&&n.vh,f=!0;n&&n.chkDup!==void 0&&(f=n.chkDup);let h=!1;n&&n.rt!==void 0&&(h=n.rt);let g=t;for(;g&&!g.hasOwnProperty(i);)g=Ct(g);if(!g&&t[i]&&(g=t),!g||g[c])return!1;let _=n&&n.eventNameToString,v={},y=g[c]=g[i],b=g[B(a)]=g[a],x=g[B(o)]=g[o],S=g[B(s)]=g[s],C;n&&n.prepend&&(C=g[B(n.prepend)]=g[n.prepend]);function w(e,t){return t?typeof e==`boolean`?{capture:e,passive:!0}:e?typeof e==`object`&&e.passive!==!1?vt(_t({},e),{passive:!0}):e:{passive:!0}:e}let T=function(e){if(!v.isExisting)return y.call(v.target,v.eventName,v.capture?m:p,v.options)},E=function(e){if(!e.isRemoved){let t=H[e.eventName],n;t&&(n=t[e.capture?At:jt]);let r=n&&e.target[n];if(r){for(let t=0;t<r.length;t++)if(r[t]===e){r.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),r.length===0&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return b.call(e.target,e.eventName,e.capture?m:p,e.options)},D=function(e){return y.call(v.target,v.eventName,e.invoke,v.options)},ee=function(e){return C.call(v.target,v.eventName,e.invoke,v.options)},O=function(e){return b.call(e.target,e.eventName,e.invoke,e.options)},k=r?T:D,A=r?E:O,te=(n==null?void 0:n.diff)||function(e,t){let n=typeof t;return n===`function`&&e.callback===t||n===`object`&&e.originalDelegate===t},j=Zone[B(`UNPATCHED_EVENTS`)],ne=e[B(`PASSIVE_EVENTS`)];function re(e){if(typeof e==`object`&&e){let t=_t({},e);return e.signal&&(t.signal=e.signal),t}return e}let M=function(t,i,a,o,s=!1,c=!1){return function(){let l=this||e,u=arguments[0];n&&n.transferEventName&&(u=n.transferEventName(u));let p=arguments[1];if(!p||Ht&&u===`uncaughtException`)return t.apply(this,arguments);let m=!1;if(typeof p!=`function`){if(!p.handleEvent)return t.apply(this,arguments);m=!0}if(d&&!d(t,p,l,arguments))return;let h=!!ne&&ne.indexOf(u)!==-1,g=re(w(arguments[2],h)),y=g==null?void 0:g.signal;if(y!=null&&y.aborted)return;if(j){for(let e=0;e<j.length;e++)if(u===j[e])return h?t.call(l,u,p,g):t.apply(this,arguments)}let b=g?typeof g==`boolean`?!0:g.capture:!1,x=g&&typeof g==`object`?g.once:!1,S=Zone.current,C=H[u];C||(un(u,_),C=H[u]);let T=C[b?At:jt],E=l[T],D=!1;if(E){if(D=!0,f){for(let e=0;e<E.length;e++)if(te(E[e],p))return}}else E=l[T]=[];let ee,O=l.constructor.name,k=sn[O];k&&(ee=k[u]),ee||(ee=O+i+(_?_(u):u)),v.options=g,x&&(v.options.once=!1),v.target=l,v.capture=b,v.eventName=u,v.isExisting=D;let A=r?on:void 0;A&&(A.taskData=v),y&&(v.options.signal=void 0);let M=S.scheduleEventTask(ee,p,A,a,o);if(y){v.options.signal=y;let e=()=>M.zone.cancelTask(M);t.call(y,`abort`,e,{once:!0}),M.removeAbortListener=()=>y.removeEventListener(`abort`,e)}if(v.target=null,A&&(A.taskData=null),x&&(v.options.once=!0),typeof M.options!=`boolean`&&(M.options=g),M.target=l,M.capture=b,M.eventName=u,m&&(M.originalDelegate=p),c?E.unshift(M):E.push(M),s)return l}};return g[i]=M(y,l,k,A,h),C&&(g[u]=M(C,`.prependListener:`,ee,A,h,!0)),g[a]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=arguments[2],a=i?typeof i==`boolean`?!0:i.capture:!1,o=arguments[1];if(!o)return b.apply(this,arguments);if(d&&!d(b,o,t,arguments))return;let s=H[r],c;s&&(c=s[a?At:jt]);let l=c&&t[c];if(l)for(let e=0;e<l.length;e++){let n=l[e];if(te(n,o)){if(l.splice(e,1),n.isRemoved=!0,l.length===0&&(n.allRemoved=!0,t[c]=null,!a&&typeof r==`string`)){let e=Mt+`ON_PROPERTY`+r;t[e]=null}return n.zone.cancelTask(n),h?t:void 0}}return b.apply(this,arguments)},g[o]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=[],a=fn(t,_?_(r):r);for(let e=0;e<a.length;e++){let t=a[e],n=t.originalDelegate?t.originalDelegate:t.callback;i.push(n)}return i},g[s]=function(){let t=this||e,r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));let e=H[r];if(e){let n=e[jt],i=e[At],o=t[n],s=t[i];if(o){let e=o.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}if(s){let e=s.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}}}else{let e=Object.keys(t);for(let t=0;t<e.length;t++){let n=e[t],r=cn.exec(n),i=r&&r[1];i&&i!==`removeListener`&&this[s].call(this,i)}this[s].call(this,`removeListener`)}if(h)return this},nn(g[i],y),nn(g[a],b),S&&nn(g[s],S),x&&nn(g[o],x),!0}let g=[];for(let e=0;e<n.length;e++)g[e]=h(n[e],r);return g}function fn(e,t){if(!t){let n=[];for(let r in e){let i=cn.exec(r),a=i&&i[1];if(a&&(!t||a===t)){let t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=H[t];n||(un(t),n=H[t]);let r=e[n[jt]],i=e[n[At]];return r?i?r.concat(i):r.slice():i?i.slice():[]}function pn(e,t){let n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,`stopImmediatePropagation`,e=>function(t,n){t[ln]=!0,e&&e.apply(t,n)})}function mn(e,t){t.patchMethod(e,`queueMicrotask`,e=>function(e,t){Zone.current.scheduleMicroTask(`queueMicrotask`,t[0])})}var hn=B(`zoneTask`);function gn(e,t,n,r){let i=null,a=null;t+=r,n+=r;let o={};function s(t){let n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};let r=i.apply(e,n.args);return an(r)?n.handleId=r:(n.handle=r,n.isRefreshable=rn(r.refresh)),t}function c(t){let{handle:n,handleId:r}=t.data;return a.call(e,n==null?r:n)}i=en(e,t,n=>function(i,a){var l;if(rn(a[0])){let e={isRefreshable:!1,isPeriodic:r===`Interval`,delay:r===`Timeout`||r===`Interval`?a[1]||0:void 0,args:a},n=a[0];a[0]=function(){try{return n.apply(this,arguments)}finally{let{handle:t,handleId:n,isPeriodic:r,isRefreshable:i}=e;!r&&!i&&(n?delete o[n]:t&&(t[hn]=null))}};let i=Pt(t,a[0],e,s,c);if(!i)return i;let{handleId:u,handle:d,isRefreshable:f,isPeriodic:p}=i.data;if(u)o[u]=i;else if(d&&(d[hn]=i,f&&!p)){let e=d.refresh;d.refresh=function(){let{zone:t,state:n}=i;return n===`notScheduled`?(i._state=`scheduled`,t._updateTaskCount(i,1)):n===`running`&&(i._state=`scheduling`),e.call(this)}}return(l=d==null?u:d)==null?i:l}else return n.apply(e,a)}),a=en(e,n,t=>function(n,r){let i=r[0],a;an(i)?(a=o[i],delete o[i]):(a=i==null?void 0:i[hn],a?i[hn]=null:a=i),a!=null&&a.type?a.cancelFn&&a.zone.cancelTask(a):t.apply(e,r)})}function _n(e,t){let{isBrowser:n,isMix:r}=t.getGlobalObjects();!n&&!r||!e.customElements||!(`customElements`in e)||t.patchCallbacks(t,e.customElements,`customElements`,`define`,[`connectedCallback`,`disconnectedCallback`,`adoptedCallback`,`attributeChangedCallback`,`formAssociatedCallback`,`formDisabledCallback`,`formResetCallback`,`formStateRestoreCallback`])}function vn(e,t){if(Zone[t.symbol(`patchEventTarget`)])return;let{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:i,FALSE_STR:a,ZONE_SYMBOL_PREFIX:o}=t.getGlobalObjects();for(let e=0;e<n.length;e++){let t=n[e],s=t+a,c=t+i,l=o+s,u=o+c;r[t]={},r[t][a]=l,r[t][i]=u}let s=e.EventTarget;if(!(!s||!s.prototype))return t.patchEventTarget(e,t,[s&&s.prototype]),!0}function yn(e,t){t.patchEventPrototype(e,t)}function bn(e,t,n){if(!n||n.length===0)return t;let r=n.filter(t=>t.target===e);if(r.length===0)return t;let i=r[0].ignoreProperties;return t.filter(e=>i.indexOf(e)===-1)}function xn(e,t,n,r){e&&Yt(e,bn(e,t,n),r)}function Sn(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith(`on`)&&e.length>2).map(e=>e.substring(2))}function Cn(e,t){if(Ht&&!Wt||Zone[e.symbol(`patchEvents`)])return;let n=t.__Zone_ignore_on_properties,r=[];if(Ut){let e=window;r=r.concat([`Document`,`SVGElement`,`Element`,`HTMLElement`,`HTMLBodyElement`,`HTMLMediaElement`,`HTMLFrameSetElement`,`HTMLFrameElement`,`HTMLIFrameElement`,`HTMLMarqueeElement`,`Worker`]),xn(e,Sn(e),n,Ct(e))}r=r.concat([`XMLHttpRequest`,`XMLHttpRequestEventTarget`,`IDBIndex`,`IDBRequest`,`IDBOpenDBRequest`,`IDBDatabase`,`IDBTransaction`,`IDBCursor`,`WebSocket`]);for(let e=0;e<r.length;e++){let i=t[r[e]];i!=null&&i.prototype&&xn(i.prototype,Sn(i.prototype),n)}}function wn(e){e.__load_patch(`timers`,e=>{let t=`clear`;gn(e,`set`,t,`Timeout`),gn(e,`set`,t,`Interval`),gn(e,`set`,t,`Immediate`)}),e.__load_patch(`requestAnimationFrame`,e=>{gn(e,`request`,`cancel`,`AnimationFrame`),gn(e,`mozRequest`,`mozCancel`,`AnimationFrame`),gn(e,`webkitRequest`,`webkitCancel`,`AnimationFrame`)}),e.__load_patch(`blocking`,(e,t)=>{let n=[`alert`,`prompt`,`confirm`];for(let r=0;r<n.length;r++){let i=n[r];en(e,i,(n,r,i)=>function(r,a){return t.current.run(n,e,a,i)})}}),e.__load_patch(`EventTarget`,(e,t,n)=>{yn(e,n),vn(e,n);let r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch(`MutationObserver`,(e,t,n)=>{Zt(`MutationObserver`),Zt(`WebKitMutationObserver`)}),e.__load_patch(`IntersectionObserver`,(e,t,n)=>{Zt(`IntersectionObserver`)}),e.__load_patch(`FileReader`,(e,t,n)=>{Zt(`FileReader`)}),e.__load_patch(`on_property`,(e,t,n)=>{Cn(n,e)}),e.__load_patch(`customElements`,(e,t,n)=>{_n(e,n)}),e.__load_patch(`XHR`,(e,t)=>{c(e);let n=B(`xhrTask`),r=B(`xhrSync`),i=B(`xhrListener`),a=B(`xhrScheduled`),o=B(`xhrURL`),s=B(`xhrErrorBeforeScheduled`);function c(e){let c=e.XMLHttpRequest;if(!c)return;let l=c.prototype;function u(e){return e[n]}let d=l[Ot],f=l[kt];if(!d){let t=e.XMLHttpRequestEventTarget;if(t){let e=t.prototype;d=e[Ot],f=e[kt]}}let p=`readystatechange`,m=`scheduled`;function h(e){let r=e.data,o=r.target;o[a]=!1,o[s]=!1;let c=o[i];d||(d=o[Ot],f=o[kt]),c&&f.call(o,p,c);let l=o[i]=()=>{if(o.readyState===o.DONE)if(!r.aborted&&o[a]&&e.state===m){let n=o[t.__symbol__(`loadfalse`)];if(o.status!==0&&n&&n.length>0){let i=e.invoke;e.invoke=function(){let n=o[t.__symbol__(`loadfalse`)];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);!r.aborted&&e.state===m&&i.call(e)},n.push(e)}else e.invoke()}else !r.aborted&&o[a]===!1&&(o[s]=!0)};return d.call(o,p,l),o[n]||(o[n]=e),x.apply(o,r.args),o[a]=!0,e}function g(){}function _(e){let t=e.data;return t.aborted=!0,S.apply(t.target,t.args)}let v=en(l,`open`,()=>function(e,t){return e[r]=t[2]==0,e[o]=t[1],v.apply(e,t)}),y=B(`fetchTaskAborting`),b=B(`fetchTaskScheduling`),x=en(l,`send`,()=>function(e,n){if(t.current[b]===!0||e[r])return x.apply(e,n);{let t={target:e,url:e[o],isPeriodic:!1,args:n,aborted:!1},r=Pt(`XMLHttpRequest.send`,g,t,h,_);e&&e[s]===!0&&!t.aborted&&r.state===m&&r.invoke()}}),S=en(l,`abort`,()=>function(e,n){let r=u(e);if(r&&typeof r.type==`string`){if(r.cancelFn==null||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(t.current[y]===!0)return S.apply(e,n)})}}),e.__load_patch(`geolocation`,e=>{e.navigator&&e.navigator.geolocation&&zt(e.navigator.geolocation,[`getCurrentPosition`,`watchPosition`])}),e.__load_patch(`PromiseRejectionEvent`,(e,t)=>{function n(t){return function(n){fn(e,t).forEach(r=>{let i=e.PromiseRejectionEvent;if(i){let e=new i(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[B(`unhandledPromiseRejectionHandler`)]=n(`unhandledrejection`),t[B(`rejectionHandledHandler`)]=n(`rejectionhandled`))}),e.__load_patch(`queueMicrotask`,(e,t,n)=>{mn(e,n)})}function Tn(e){e.__load_patch(`ZoneAwarePromise`,(e,t,n)=>{let r=Object.getOwnPropertyDescriptor,i=Object.defineProperty;function a(e){return e&&e.toString===Object.prototype.toString?(e.constructor&&e.constructor.name||``)+`: `+JSON.stringify(e):e?e.toString():Object.prototype.toString.call(e)}let o=n.symbol,s=[],c=e[o(`DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION`)]!==!1,l=o(`Promise`),u=o(`then`);n.onUnhandledError=e=>{if(n.showUncaughtError()){let t=e&&e.rejection;t?console.error(`Unhandled Promise rejection:`,t instanceof Error?t.message:t,`; Zone:`,e.zone.name,`; Task:`,e.task&&e.task.source,`; Value:`,t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;s.length;){let e=s.shift();try{e.zone.runGuarded(()=>{throw e.throwOriginal?e.rejection:e})}catch(e){f(e)}}};let d=o(`unhandledPromiseRejectionHandler`);function f(e){n.onUnhandledError(e);try{let n=t[d];typeof n==`function`&&n.call(this,e)}catch(e){}}function p(e){return e&&typeof e.then==`function`}function m(e){return e}function h(e){return k.reject(e)}let g=o(`state`),_=o(`value`),v=o(`finally`),y=o(`parentPromiseValue`),b=o(`parentPromiseState`);function x(e,t){return n=>{try{w(e,t,n)}catch(t){w(e,!1,t)}}}let S=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},C=o(`currentTaskTrace`);function w(e,r,o){let l=S();if(e===o)throw TypeError(`Promise resolved with itself`);if(e[g]===null){let u=null;try{(typeof o==`object`||typeof o==`function`)&&(u=o&&o.then)}catch(t){return l(()=>{w(e,!1,t)})(),e}if(r!==!1&&o instanceof k&&o.hasOwnProperty(g)&&o.hasOwnProperty(_)&&o[g]!==null)E(o),w(e,o[g],o[_]);else if(r!==!1&&typeof u==`function`)try{u.call(o,l(x(e,r)),l(x(e,!1)))}catch(t){l(()=>{w(e,!1,t)})()}else{e[g]=r;let l=e[_];if(e[_]=o,e[v]===v&&r===!0&&(e[g]=e[b],e[_]=e[y]),r===!1&&o instanceof Error){let e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&i(o,C,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)D(e,l[t++],l[t++],l[t++],l[t++]);if(l.length==0&&r==0){e[g]=0;let r=o;try{throw Error(`Uncaught (in promise): `+a(o)+(o&&o.stack?`
|
|
2
|
+
`+o.stack:``))}catch(e){r=e}c&&(r.throwOriginal=!0),r.rejection=o,r.promise=e,r.zone=t.current,r.task=t.currentTask,s.push(r),n.scheduleMicroTask()}}}return e}let T=o(`rejectionHandledHandler`);function E(e){if(e[g]===0){try{let n=t[T];n&&typeof n==`function`&&n.call(this,{rejection:e[_],promise:e})}catch(e){}e[g]=!1;for(let t=0;t<s.length;t++)e===s[t].promise&&s.splice(t,1)}}function D(e,t,n,r,i){E(e);let a=e[g],o=a?typeof r==`function`?r:m:typeof i==`function`?i:h;t.scheduleMicroTask(`Promise.then`,()=>{try{let r=e[_],i=!!n&&v===n[v];i&&(n[y]=r,n[b]=a),w(n,!0,t.run(o,void 0,i&&o!==h&&o!==m?[]:[r]))}catch(e){w(n,!1,e)}},n)}let ee=function(){},O=e.AggregateError;class k{static toString(){return`function ZoneAwarePromise() { [native code] }`}static resolve(e){return e instanceof k?e:w(new this(null),!0,e)}static reject(e){return w(new this(null),!1,e)}static withResolvers(){let e={};return e.promise=new k((t,n)=>{e.resolve=t,e.reject=n}),e}static any(e){if(!e||typeof e[Symbol.iterator]!=`function`)return Promise.reject(new O([],`All promises were rejected`));let t=[],n=0;try{for(let r of e)n++,t.push(k.resolve(r))}catch(e){return Promise.reject(new O([],`All promises were rejected`))}if(n===0)return Promise.reject(new O([],`All promises were rejected`));let r=!1,i=[];return new k((e,a)=>{for(let o=0;o<t.length;o++)t[o].then(t=>{r||(r=!0,e(t))},e=>{i.push(e),n--,n===0&&(r=!0,a(new O(i,`All promises were rejected`)))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function i(e){t(e)}function a(e){n(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(i,a);return r}static all(e){return k.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof k?this:k).allWithCallback(e,{thenCallback:e=>({status:`fulfilled`,value:e}),errorCallback:e=>({status:`rejected`,reason:e})})}static allWithCallback(e,t){let n,r,i=new this((e,t)=>{n=e,r=t}),a=2,o=0,s=[];for(let i of e){p(i)||(i=this.resolve(i));let e=o;try{i.then(r=>{s[e]=t?t.thenCallback(r):r,a--,a===0&&n(s)},i=>{t?(s[e]=t.errorCallback(i),a--,a===0&&n(s)):r(i)})}catch(e){r(e)}a++,o++}return a-=2,a===0&&n(s),i}constructor(e){let t=this;if(!(t instanceof k))throw Error(`Must be an instanceof Promise.`);t[g]=null,t[_]=[];try{let n=S();e&&e(n(x(t,!0)),n(x(t,!1)))}catch(e){w(t,!1,e)}}get[Symbol.toStringTag](){return`Promise`}get[Symbol.species](){return k}then(e,n){var r;let i=(r=this.constructor)==null?void 0:r[Symbol.species];(!i||typeof i!=`function`)&&(i=this.constructor||k);let a=new i(ee),o=t.current;return this[g]==null?this[_].push(o,a,e,n):D(this,o,a,e,n),a}catch(e){return this.then(null,e)}finally(e){var n;let r=(n=this.constructor)==null?void 0:n[Symbol.species];(!r||typeof r!=`function`)&&(r=k);let i=new r(ee);i[v]=v;let a=t.current;return this[g]==null?this[_].push(a,i,e,e):D(this,a,i,e,e),i}}k.resolve=k.resolve,k.reject=k.reject,k.race=k.race,k.all=k.all;let A=e[l]=e.Promise;e.Promise=k;let te=o(`thenPatched`);function j(e){let t=e.prototype,n=r(t,`then`);if(n&&(n.writable===!1||!n.configurable))return;let i=t.then;t[u]=i,e.prototype.then=function(e,t){return new k((e,t)=>{i.call(this,e,t)}).then(e,t)},e[te]=!0}n.patchThen=j;function ne(e){return function(t,n){let r=e.apply(t,n);if(r instanceof k)return r;let i=r.constructor;return i[te]||j(i),r}}if(A){j(A);let t=A.try;t&&typeof t==`function`&&(k.try=t),en(e,`fetch`,e=>ne(e))}return Promise[t.__symbol__(`uncaughtPromiseErrors`)]=s,k})}function En(e){e.__load_patch(`toString`,e=>{let t=Function.prototype.toString,n=B(`OriginalDelegate`),r=B(`Promise`),i=B(`Error`),a=function(){if(typeof this==`function`){let a=this[n];if(a)return typeof a==`function`?t.call(a):Object.prototype.toString.call(a);if(this===Promise){let n=e[r];if(n)return t.call(n)}if(this===Error){let n=e[i];if(n)return t.call(n)}}return t.call(this)};a[n]=t,Function.prototype.toString=a;let o=Object.prototype.toString;Object.prototype.toString=function(){return typeof Promise==`function`&&this instanceof Promise?`[object Promise]`:o.call(this)}})}function Dn(e,t,n,r,i){let a=Zone.__symbol__(r);if(t[a])return;let o=t[a]=t[r];t[r]=function(a,s,c){return s&&s.prototype&&i.forEach(function(t){let i=`${n}.${r}::`+t,a=s.prototype;try{if(a.hasOwnProperty(t)){let n=e.ObjectGetOwnPropertyDescriptor(a,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,i),e._redefineProperty(s.prototype,t,n)):a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}else a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}catch(e){}}),o.call(t,a,s,c)},e.attachOriginToPatched(t[r],o)}function On(e){e.__load_patch(`util`,(e,t,n)=>{let r=Sn(e);n.patchOnProperties=Yt,n.patchMethod=en,n.bindArguments=Rt,n.patchMacroTask=tn;let i=t.__symbol__(`BLACK_LISTED_EVENTS`),a=t.__symbol__(`UNPATCHED_EVENTS`);e[a]&&(e[i]=e[a]),e[i]&&(t[i]=t[a]=e[i]),n.patchEventPrototype=pn,n.patchEventTarget=dn,n.ObjectDefineProperty=St,n.ObjectGetOwnPropertyDescriptor=xt,n.ObjectCreate=wt,n.ArraySlice=Tt,n.patchClass=Zt,n.wrapWithCurrentZone=Nt,n.filterProperties=bn,n.attachOriginToPatched=nn,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Dn,n.getGlobalObjects=()=>({globalSources:sn,zoneSymbolEventNames:H,eventNames:r,isBrowser:Ut,isMix:Wt,isNode:Ht,TRUE_STR:At,FALSE_STR:jt,ZONE_SYMBOL_PREFIX:Mt,ADD_EVENT_LISTENER_STR:Et,REMOVE_EVENT_LISTENER_STR:Dt})})}function kn(e){Tn(e),En(e),On(e)}var An=bt();kn(An),wn(An);var jn=w(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Mn(e){return e.setValue(jn,!0)}function Nn(e){return e.getValue(jn)===!0}var Pn=`baggage`,Fn=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=C(e.substring(t+1))),{key:o,value:s,metadata:c}}var zn=class{inject(e,t,n){let r=Qe.getBaggage(e);if(!r||Nn(e))return;let i=In(Ln(r).filter(e=>e.length<=Fn).slice(0,180));i.length>0&&n.set(t,Pn,i)}extract(e,t,n){let r=n.get(t,Pn),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:Qe.setBaggage(e,Qe.createBaggage(a))}fields(){return[Pn]}};function Bn(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Vn(n)){P.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Hn(r)){P.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Vn(e){return typeof e==`string`&&e!==``}function Hn(e){return e==null?!0:Array.isArray(e)?Un(e):Wn(typeof e)}function Un(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Wn(e)){t=e;continue}return!1}return!1}}return!0}function Wn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Gn(){return e=>{P.error(Kn(e))}}function Kn(e){return typeof e==`string`?e:JSON.stringify(qn(e))}function qn(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 Jn=Gn();function Yn(e){try{Jn(e)}catch(e){}}var Xn=`2.7.1`,Zn=`exception.message`,Qn=`exception.stacktrace`,$n=`exception.type`,er=`service.name`,tr=`telemetry.sdk.language`,nr=`webjs`,rr=`telemetry.sdk.name`,ir=`telemetry.sdk.version`,ar=`process.runtime.name`,or={[rr]:`opentelemetry`,[ar]:`browser`,[tr]:nr,[ir]:Xn},sr=performance,cr=9,lr=Math.pow(10,6),ur=Math.pow(10,cr);function dr(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*lr)]}function fr(e){return _r(dr(sr.timeOrigin),dr(typeof e==`number`?e:sr.now()))}function pr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=ur),[n,r]}function mr(e){return e[0]*ur+e[1]}function hr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function gr(e){return hr(e)||typeof e==`number`||e instanceof Date}function _r(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=ur&&(n[1]-=ur,n[0]+=1),n}var vr;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(vr||(vr={})),I();var yr=class{constructor(e={}){var t;F(this,`_propagators`,void 0),F(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){P.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){P.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},br=`[_0-9a-z-*/]`,xr=`[a-z]${br}{0,255}`,Sr=`[a-z0-9]${br}{0,240}@[a-z]${br}{0,13}`,Cr=RegExp(`^(?:${xr}|${Sr})$`),wr=/^[ -~]{0,255}[!-~]$/,Tr=/,|=/;function Er(e){return Cr.test(e)}function Dr(e){return wr.test(e)&&!Tr.test(e)}I();var Or=32,kr=512,Ar=`,`,jr=`=`,Mr=class e{constructor(e){F(this,`_length`,void 0),F(this,`_rawTraceState`,void 0),F(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Er(e)||!Dr(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>kr)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=Ar+e),e=`${n[0]}${jr}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Ar),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(jr);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Er(a)||!Dr(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>kr)&&(t.set(a,o),n=s,t.size>=Or))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}},Nr=`traceparent`,Pr=`tracestate`,Fr=`00`,Ir=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Lr(e){let t=Ir.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Rr=class{inject(e,t,n){let r=et.getSpanContext(e);if(!r||Nn(e)||!je(r))return;let i=`${Fr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||N.NONE).toString(16)}`;n.set(t,Nr,i),r.traceState&&n.set(t,Pr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,Nr);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Lr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Pr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Mr(typeof e==`string`?e:void 0)}return et.setSpanContext(e,a)}fields(){return[Nr,Pr]}},zr=`[object Object]`,Br=`[object Null]`,Vr=`[object Undefined]`,Hr=Function.prototype.toString,Ur=Hr.call(Object),Wr=Object.getPrototypeOf,Gr=Object.prototype,Kr=Gr.hasOwnProperty,qr=Symbol?Symbol.toStringTag:void 0,Jr=Gr.toString;function Yr(e){if(!Xr(e)||Zr(e)!==zr)return!1;let t=Wr(e);if(t===null)return!0;let n=Kr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Hr.call(n)===Ur}function Xr(e){return typeof e==`object`&&!!e}function Zr(e){return e==null?e===void 0?Vr:Br:qr&&qr in Object(e)?Qr(e):$r(e)}function Qr(e){let t=Kr.call(e,qr),n=e[qr],r=!1;try{e[qr]=void 0,r=!0}catch(e){}let i=Jr.call(e);return r&&(t?e[qr]=n:delete e[qr]),i}function $r(e){return Jr.call(e)}var ei=20;function ti(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=ri(t,e.shift(),0,n);return t}function ni(e){return ai(e)?e.slice():e}function ri(e,t,n=0,r){let i;if(!(n>ei)){if(n++,ci(e)||ci(t)||oi(t))i=ni(t);else if(ai(e)){if(i=e.slice(),ai(t))for(let e=0,n=t.length;e<n;e++)i.push(ni(t[e]));else if(si(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]=ni(t[r]))}}}else if(si(e))if(si(t)){if(!li(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(ci(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(ii(e,s,r)||ii(t,s,r))delete i[s];else{if(si(a)&&si(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]=ri(i[s],c,n,r)}}}}else i=t;return i}}function ii(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 ai(e){return Array.isArray(e)}function oi(e){return typeof e==`function`}function si(e){return!ci(e)&&!ai(e)&&!oi(e)&&typeof e==`object`}function ci(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function li(e,t){return!(!Yr(e)||!Yr(t))}I();var ui=class{constructor(){F(this,`_promise`,void 0),F(this,`_resolve`,void 0),F(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)}};I();var di=class{constructor(e,t){F(this,`_isCalled`,!1),F(this,`_deferred`,new ui),F(this,`_callback`,void 0),F(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 fi(e,t){return new Promise(n=>{Ue.with(Mn(Ue.active()),()=>{e.export(t,n)})})}var pi={_export:fi};I();var mi=class{constructor(e){F(this,`_delegate`,void 0),this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};I();var hi=class extends Error{constructor(e,t,n){super(e),F(this,`code`,void 0),F(this,`name`,`OTLPExporterError`),F(this,`data`,void 0),this.data=n,this.code=t}};function gi(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 U(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){gi(a,r,i,o,s,`next`,e)}function s(e){gi(a,r,i,o,s,`throw`,e)}o(void 0)})}}function _i(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function vi(e){if(e!=null)return U(function*(){return e})}function yi(e,t,n){var r,i,a,o,s,c;return{timeoutMillis:_i((r=(i=e.timeoutMillis)==null?t.timeoutMillis:i)==null?n.timeoutMillis:r),concurrencyLimit:(a=(o=e.concurrencyLimit)==null?t.concurrencyLimit:o)==null?n.concurrencyLimit:a,compression:(s=(c=e.compression)==null?t.compression:c)==null?n.compression:s}}function bi(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}I();var xi=class{constructor(e){F(this,`_concurrencyLimit`,void 0),F(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 U(function*(){yield Promise.all(e._sendingPromises)})()}};function Si(e){return new xi(e.concurrencyLimit)}function Ci(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function wi(){return{handleResponse(e){e==null||!Ci(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||P.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}I();var Ti=class{constructor(e,t,n,r,i){F(this,`_diagLogger`,void 0),F(this,`_transport`,void 0),F(this,`_serializer`,void 0),F(this,`_responseHandler`,void 0),F(this,`_promiseQueue`,void 0),F(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=P.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:vr.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:vr.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:vr.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:vr.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:vr.FAILED,error:(n=e.error)==null?new hi(`Export failed with retryable status`):n})}else t({code:vr.FAILED,error:new hi(`Export failed with unknown error`)})},e=>t({code:vr.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return U(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function Ei(e,t){return new Ti(e.transport,e.serializer,wi(),e.promiseHandler,t.timeout)}function Di(e,t,n){return Ei({transport:n,serializer:t,promiseHandler:Si(e)},{timeout:e.timeoutMillis})}function Oi(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 W(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Oi(Object(n),!0).forEach(function(t){F(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var G=t((()=>{I()})),ki;function Ai(){if(ki===void 0)try{let e=globalThis.process.argv0;ki=e?`unknown_service:${e}`:`unknown_service`}catch(e){ki=`unknown_service`}return ki}var ji=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;I();var Mi=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Fi(t),r._asyncAttributesPending=t.filter(([e,t])=>ji(t)).length>0,r}constructor(e,t){var n;F(this,`_rawAttributes`,void 0),F(this,`_asyncAttributesPending`,!1),F(this,`_schemaUrl`,void 0),F(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(ji(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Fi(this._rawAttributes),this._schemaUrl=Ii(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return U(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,ji(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&P.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(ji(n)){P.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=Li(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Ni(e,t){return Mi.FromAttributeList(Object.entries(e),t)}function Pi(){return Ni({[er]:Ai(),[tr]:or[tr],[rr]:or[rr],[ir]:or[ir]})}function Fi(e){return e.map(([e,t])=>ji(t)?[e,t.catch(t=>{P.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Ii(e){if(typeof e==`string`||e===void 0)return e;P.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Li(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;P.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}function Ri(e,t){let n={attributes:Bi(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function zi(e){return{name:e.name,version:e.version}}function Bi(e,t){return Object.keys(e).map(n=>Vi(n,e[n],t))}function Vi(e,t,n){return{key:e,value:Hi(t,n)}}function Hi(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]=Hi(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:Hi(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}function Ui(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Wi(e){return Ui(e).toString()}var Gi=typeof BigInt<`u`?Wi:mr;function Ki(e){return e}var qi={encodeHrTime:Gi,encodeSpanContext:Ki,encodeOptionalSpanContext:Ki,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(``))}},Ji=256,Yi=512;function Xi(e,t){let n=e&255|Ji;return t&&(n|=Yi),n}function Zi(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:Bi(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>$i(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>Qi(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Xi(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function Qi(e,t){var n;return{attributes:e.attributes?Bi(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:Xi(e.context.traceFlags,e.context.isRemote)}}function $i(e,t){return{attributes:e.attributes?Bi(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function ea(e,t){return{resourceSpans:na(e,t)}}function ta(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 na(e,t){let n=ta(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=>Zi(e,t));o.push({scope:zi(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Ri(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var ra={serializeRequest:e=>{let t=ea(e,qi);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 P.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};I();var ia=5,aa=1e3,oa=5e3,sa=1.5,ca=.2;function la(){return 2*ca*Math.random()-ca}var ua=class{constructor(e){F(this,`_transport`,void 0),this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}send(e,t){var n=this;return U(function*(){let r=ia,i=aa,a=Date.now()+t,o=yield n._transport.send(e,t);for(;o.status===`retryable`&&r>0;){var s;r--;let t=Math.max(Math.min(i*(1+la()),oa),0);i*=sa;let c=(s=o.retryInMillis)==null?t:s,l=a-Date.now();if(c>l)return P.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),o;P.verbose(`Scheduling export retry in ${Math.round(c)}ms`),o=yield n.retry(e,l,c)}return o.status===`success`?P.verbose(`Export succeeded after ${ia-r} retry attempts.`):o.status===`retryable`?P.info(`Export failed after maximum retry attempts (${ia}).`):P.info(`Export failed with non-retryable error: ${o.error}`),o})()}shutdown(){return this._transport.shutdown()}};function da(e){return new ua(e.transport)}function fa(e){return e===429||e===502||e===503||e===504}function pa(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}I();var ma=60*1024,ha=9,ga=0,_a=0,va=class{constructor(e){F(this,`_parameters`,void 0),this._parameters=e}send(e,t){var n=this;return U(function*(){let r=new AbortController,i=setTimeout(()=>r.abort(),t),a=globalThis.fetch;typeof a.__original==`function`&&(a=a.__original);let o=e.byteLength,s=ga+o>ma,c=!s&&!(_a>=ha);if(c)ga+=o,_a++;else{let e=s?`size limit`:`count limit`;P.debug(`keepalive disabled: ${(o/1024).toFixed(1)}KB payload, ${_a} pending (${e})`)}try{let t=new URL(n._parameters.url),i=yield a(t.href,{method:`POST`,headers:yield n._parameters.headers(),body:e,signal:r.signal,keepalive:c,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(P.debug(`export response success (status: ${i.status})`),{status:`success`}):fa(i.status)?(P.warn(`export response retryable (status: ${i.status})`),{status:`retryable`,retryInMillis:pa(i.headers.get(`Retry-After`))}):(P.error(`export response failure (status: ${i.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${i.status}`)})}catch(e){return ba(e)?(P.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(P.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(i),c&&(ga-=o,_a--)}})()}shutdown(){}};function ya(e){return new va(e)}function ba(e){return e instanceof TypeError&&!e.cause}function xa(e,t){return Di(e,t,da({transport:ya(e)}))}function Sa(e){let t={};return Object.entries(e==null?{}:e).forEach(([e,n])=>{n===void 0?P.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}G();function Ca(e,t,n){return U(function*(){let r=W({},yield n()),i={};return t!=null&&Object.assign(i,yield t()),e!=null&&Object.assign(i,Sa(yield e())),Object.assign(i,r)})}function wa(e){if(e!=null)try{var t;let n=(t=globalThis.location)==null?void 0:t.href;return new URL(e,n).href}catch(t){throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function Ta(e,t,n){var r,i;return W(W({},yi(e,t,n)),{},{headers:Ca(e.headers,t.headers,n.headers),url:(r=(i=wa(e.url))==null?t.url:i)==null?n.url:r})}function Ea(e,t){return W(W({},bi()),{},{headers:function(){var t=U(function*(){return e});return function(){return t.apply(this,arguments)}}(),url:`http://localhost:4318/`+t})}function Da(e){return typeof e.headers==`function`?e.headers:vi(e.headers)}function Oa(e,t,n){return Ta({url:e.url,timeoutMillis:e.timeoutMillis,headers:Da(e),concurrencyLimit:e.concurrencyLimit},{},Ea(n,t))}function ka(e,t,n,r){return xa(Oa(e,n,r),t)}var Aa=class extends mi{constructor(e={}){super(ka(e,ra,`v1/traces`,{"Content-Type":`application/json`}))}},ja=`exception`;I();var Ma=class{constructor(e){var t,n;F(this,`_spanContext`,void 0),F(this,`kind`,void 0),F(this,`parentSpanContext`,void 0),F(this,`attributes`,{}),F(this,`links`,[]),F(this,`events`,[]),F(this,`startTime`,void 0),F(this,`resource`,void 0),F(this,`instrumentationScope`,void 0),F(this,`_droppedAttributesCount`,0),F(this,`_droppedEventsCount`,0),F(this,`_droppedLinksCount`,0),F(this,`_attributesCount`,0),F(this,`name`,void 0),F(this,`status`,{code:He.UNSET}),F(this,`endTime`,[0,0]),F(this,`_ended`,!1),F(this,`_duration`,[-1,-1]),F(this,`_spanProcessor`,void 0),F(this,`_spanLimits`,void 0),F(this,`_attributeValueLengthLimit`,void 0),F(this,`_recordEndMetrics`,void 0),F(this,`_performanceStartTime`,void 0),F(this,`_performanceOffset`,void 0),F(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=sr.now(),this._performanceOffset=r-(this._performanceStartTime+sr.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 P.warn(`Invalid attribute key: ${e}`),this;if(!Hn(t))return P.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 P.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&P.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),gr(t)&&(gr(n)||(n=t),t=void 0);let i=Bn(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&&P.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Bn(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===He.UNSET||this.status.code===He.OK)return this;let t={code:e.code};return e.code===He.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&P.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()){P.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=pr(this.startTime,this.endTime),this._duration[0]<0&&(P.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&&P.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&P.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<=sr.now())return fr(e+this._performanceOffset);if(typeof e==`number`)return dr(e);if(e instanceof Date)return dr(e.getTime());if(hr(e))return e;if(this._startTimeProvided)return dr(Date.now());let t=sr.now()-this._performanceStartTime;return _r(this.startTime,dr(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Zn]=e:e&&(e.code?n[$n]=e.code.toString():e.name&&(n[$n]=e.name),e.message&&(n[Zn]=e.message),e.stack&&(n[Qn]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(ja,n,t):P.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}}`);P.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?(P.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}},K;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(K||(K={}));var Na=class{shouldSample(){return{decision:K.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Pa=class{shouldSample(){return{decision:K.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};I();var Fa=class{constructor(e){var t,n,r,i;F(this,`_root`,void 0),F(this,`_remoteParentSampled`,void 0),F(this,`_remoteParentNotSampled`,void 0),F(this,`_localParentSampled`,void 0),F(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(Yn(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Pa),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Pa:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new Na:n,this._localParentSampled=(r=e.localParentSampled)==null?new Pa:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new Na:i}shouldSample(e,t,n,r,i,a){let o=et.getSpanContext(e);return!o||!je(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&N.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&N.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()}}`}};I();var Ia=class{constructor(e=0){F(this,`_ratio`,void 0),F(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:ke(t)&&this._accumulate(t)<this._upperBound?K.RECORD_AND_SAMPLED:K.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}},La;(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`})(La||(La={}));var Ra=1;function za(){var e,t,n,r,i,a,o,s;return{sampler:Ba(),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 Ba(){var e;let t=(e=void 0)==null?La.ParentBasedAlwaysOn:e;switch(t){case La.AlwaysOn:return new Pa;case La.AlwaysOff:return new Na;case La.ParentBasedAlwaysOn:return new Fa({root:new Pa});case La.ParentBasedAlwaysOff:return new Fa({root:new Na});case La.TraceIdRatio:return new Ia(Va());case La.ParentBasedTraceIdRatio:return new Fa({root:new Ia(Va())});default:return P.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${La.ParentBasedAlwaysOn}".`),new Fa({root:new Pa})}}function Va(){return P.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ra}.`),Ra}var Ha=1/0;function Ua(e){let t={sampler:Ba()},n=za(),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 Wa(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?Ha:s,Object.assign({},e,{spanLimits:p})}I();var Ga=class{constructor(e,t){var n,r,i,a;F(this,`_maxExportBatchSize`,void 0),F(this,`_maxQueueSize`,void 0),F(this,`_scheduledDelayMillis`,void 0),F(this,`_exportTimeoutMillis`,void 0),F(this,`_exporter`,void 0),F(this,`_isExporting`,!1),F(this,`_finishedSpans`,[]),F(this,`_timer`,void 0),F(this,`_shutdownOnce`,void 0),F(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 di(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(P.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&N.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&&P.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(P.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);Ue.with(Mn(Ue.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===vr.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=>{Yn(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,Yn(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)}};I();var Ka=class extends Ga{constructor(e,t){super(e,t),F(this,`_visibilityChangeListener`,void 0),F(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=>{Yn(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Yn(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))}},qa=16,Ja=8,Ya=new Uint8Array(qa),Xa=new Uint8Array(Ja),Za=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Qa(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 $a(e){let t=``;for(let n=0;n<e.length;n++)t+=Za[e[n]];return t}var eo=class{generateTraceId(){return Qa(Ya),$a(Ya)}generateSpanId(){return Qa(Xa),$a(Xa)}},to=`otel.span.parent.origin`,no=`otel.span.sampling_result`,ro=`otel.sdk.span.live`,io=`otel.sdk.span.started`;I();var ao=class{constructor(e){F(this,`startedSpans`,void 0),F(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(io,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ro,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=so(t);if(this.startedSpans.add(1,{[to]:oo(e),[no]:n}),t===K.NOT_RECORD)return()=>{};let r={[no]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function oo(e){return e?e.isRemote?`remote`:`local`:`none`}function so(e){switch(e){case K.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case K.RECORD:return`RECORD_ONLY`;case K.NOT_RECORD:return`DROP`}}var co=`2.7.1`;I();var lo=class{constructor(e,t,n,r){F(this,`_sampler`,void 0),F(this,`_generalLimits`,void 0),F(this,`_spanLimits`,void 0),F(this,`_idGenerator`,void 0),F(this,`instrumentationScope`,void 0),F(this,`_resource`,void 0),F(this,`_spanProcessor`,void 0),F(this,`_tracerMetrics`,void 0);let i=Ua(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new eo,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,co):de();this._tracerMetrics=new ao(a)}startSpan(e,t={},n=Ue.active()){var r,i,a;t.root&&(n=et.deleteSpan(n));let o=et.getSpan(n);if(Nn(n))return P.debug(`Instrumentation suppressed, returning Noop Span`),et.wrapSpanContext(ve);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!et.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?Ve.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:Bn(e.attributes)})),m=Bn(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===Be.RECORD_AND_SAMPLED?N.SAMPLED:N.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===Be.NOT_RECORD)return P.debug(`Recording is off, propagating context in a non-recording span`),et.wrapSpanContext(v);let y=Bn(Object.assign(m,h.attributes));return new Ma({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?Ue.active():i,l=this.startSpan(e,a,c),u=et.setSpan(c,l);return Ue.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};I();var uo=class{constructor(e){F(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=>{Yn(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)})}};I();var fo;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(fo||(fo={}));var po=class{constructor(e={}){var t,n;F(this,`_config`,void 0),F(this,`_tracers`,new Map),F(this,`_resource`,void 0),F(this,`_activeSpanProcessor`,void 0);let r=ti({},za(),Wa(e));this._resource=(t=r.resource)==null?Pi():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new uo(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 lo({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=fo.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==fo.timeout&&(r=fo.resolved,n(r))}).catch(e=>{clearTimeout(i),r=fo.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==fo.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};I();var mo=class{constructor(e){F(this,`_exporter`,void 0),F(this,`_shutdownOnce`,void 0),F(this,`_pendingExports`,void 0),this._exporter=e,this._shutdownOnce=new di(this._shutdown,this),this._pendingExports=new Set}forceFlush(){var e=this;return U(function*(){yield Promise.all(Array.from(e._pendingExports)),e._exporter.forceFlush&&(yield e._exporter.forceFlush())})()}onStart(e,t){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&N.SAMPLED)===0)return;let t=this._doExport(e).catch(e=>Yn(e));this._pendingExports.add(t),t.finally(()=>this._pendingExports.delete(t))}_doExport(e){var t=this;return U(function*(){if(e.resource.asyncAttributesPending){var n,r;yield(n=(r=e.resource).waitForAsyncAttributes)==null?void 0:n.call(r)}let i=yield pi._export(t._exporter,[e]);if(i.code!==vr.SUCCESS){var a;throw(a=i.error)==null?Error(`SimpleSpanProcessor: span export failed (status ${i})`):a}})()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};I();var ho=class{constructor(){F(this,`_enabled`,!1),F(this,`_currentContext`,T)}_bindFunction(e=T,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=T,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=T,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||T;try{return t.call(n,...r)}finally{this._currentContext=i}}};function go(e){if(e!==null){if(e===void 0){let e=new ho;e.enable(),Ue.setGlobalContextManager(e);return}e.enable(),Ue.setGlobalContextManager(e)}}function _o(e){if(e!==null){if(e===void 0){Qe.setGlobalPropagator(new yr({propagators:[new Rr,new zn]}));return}Qe.setGlobalPropagator(e)}}var vo=class extends po{constructor(e={}){super(e)}register(e={}){et.setGlobalTracerProvider(this),_o(e.propagator),go(e.contextManager)}},q=e=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`,yo=()=>typeof window>`u`?`http://localhost`:window.location.origin,bo=e=>{try{return new URL(e,yo()).href}catch(t){return e}},xo=/^(?:\d+|[0-9a-f]{8}-[0-9a-f-]{27,}|[0-9a-f]{16,})$/i,So=e=>e.split(/[?#]/,1)[0].split(`/`).map(e=>xo.test(e)?`:id`:e).join(`/`),Co=e=>e.length>1?e.replace(/\/+$/,``):e,wo=(e,t)=>{let n=e=>Co(e.replace(/[?#].*$/,``));return n(e)===n(t)},To=(e,t)=>wo(bo(t),bo(e.transport.endpoint)),Eo=(e,t)=>To(e,t),Do=(e,t)=>typeof e==`function`?e(t):typeof e==`string`?t.includes(e):(e.lastIndex=0,e.test(t)),Oo=(e,t)=>(Array.isArray(e)?e:e?[e]:[]).some(e=>Do(e,t)),ko=e=>typeof e.tracking.request==`object`?e.tracking.request:void 0,Ao=(e,t)=>{var n;return Eo(e,t)||Oo((n=ko(e))==null?void 0:n.excludedUrls,bo(t))},jo=(e,t)=>{var n;return Oo((n=ko(e))==null?void 0:n.allowedTracingUrls,bo(t))},J={actionFrustrationType:`action.frustration.type`,actionId:`action.id`,actionName:`action.name`,actionTargetName:`action.target.name`,actionTargetTag:`action.target.tag`,actionType:`action.type`,deploymentEnvironmentName:`deployment.environment.name`,cacheHit:`resource.cache.hit`,deviceType:`device.type`,longTaskBlockingDuration:`long_task.blocking_duration`,longTaskEntryType:`long_task.entry_type`,longTaskId:`long_task.id`,networkEffectiveType:`network.effective_type`,networkStatus:`network.status`,nextHopProtocol:`resource.protocol`,outcomeType:`outcome.type`,serviceName:`service.name`,serviceVersion:`service.version`,sessionHasReplay:`session.has_replay`,sessionId:`session.id`,sessionSampleRate:`session.sample_rate`,sessionPhase:`session.phase`,sessionType:`session.type`,spanType:`span_type`,userId:`user.id`,userAgentName:`user_agent.name`,userAgentOsName:`user_agent.os.name`,userAgentVersion:`user_agent.version`,vitalMetric:`vital.metric`,vitalValue:`vital.value`,viewDomComplete:`view.dom_complete`,viewDomContentLoaded:`view.dom_content_loaded`,viewDomInteractive:`view.dom_interactive`,viewFirstByte:`view.first_byte`,viewId:`view.id`,viewLoadEvent:`view.load_event`,viewLoadingTime:`view.loading_time`,viewLoadingTimeSource:`view.loading_time_source`,viewLoadingType:`view.loading_type`,viewName:`view.name`,viewPhase:`view.phase`,viewPrevious:`view.previous`,viewPreviousUrlTemplate:`view.previous_url_template`,viewReferrer:`view.referrer`,viewStartedAt:`view.started_at`,viewUrl:`view.url`,viewUrlTemplate:`view.url_template`,viewVersion:`view.version`,websocketPhase:`websocket.phase`};G();var Y={abort:`abort`,error:`error`,success:`success`,timeout:`timeout`,warning:`warning`},X={action:`action`,custom:`custom`,error:`error`,longTask:`long_task`,resource:`resource`,session:`session`,vital:`vital`,view:`view`,websocket:`websocket`},Z=(e,t)=>{let n=e[t];return typeof n==`string`&&n.trim()?n.trim():void 0},Q=({attributes:e,nameHint:t,spanType:n})=>{if(n===X.session){let t=Z(e,J.sessionPhase);return t?`session.${t}`:`session`}if(n===X.view){var r,i;return(r=(i=Z(e,J.viewName))==null?Z(e,J.viewUrlTemplate):i)==null?`view`:r}if(n===X.resource){var a;let t=(a=Z(e,`http.request.method`))==null?void 0:a.toUpperCase(),n=Z(e,`url.template`);if(t&&n)return`${t} ${n}`;let r=Z(e,`resource.type`);return r?`resource.${r}`:`resource`}if(n===X.action){var o,s;return(o=(s=Z(e,J.actionName))==null?Z(e,J.actionType):s)==null?`action`:o}if(n===X.error){let n=Z(e,`blank_screen.reason`);if(n)return`blank_screen.${n}`;let r=Z(e,`csp.effective_directive`);return r?`csp.${r}`:(t==null?void 0:t.trim())||Z(e,`error.source`)||`error`}if(n===X.vital){var c,l;return(c=(l=Z(e,J.vitalMetric))==null?void 0:l.toUpperCase())==null?`vital`:c}if(n===X.longTask){var u;return(u=Z(e,J.longTaskEntryType))==null?`long-task`:u}if(n===X.websocket){let t=Z(e,J.websocketPhase);return t?`websocket.${t}`:`websocket`}return n===X.custom?t===void 0?`custom`:`custom.${t}`:n},Mo=e=>e===408||e===504?Y.timeout:typeof e==`number`&&e>=400?Y.error:Y.success,No=e=>e===`good`?Y.success:Y.warning,Po=e=>{if(!e)return{};try{let t=new URL(e,typeof location>`u`?`http://localhost`:location.href);return{serverAddress:t.hostname,serverPort:t.port?Number(t.port):void 0}}catch(e){return{}}},$=({outcome:e=Y.success,spanType:t})=>({[J.spanType]:t,[J.outcomeType]:e}),Fo=({initiatorType:e=`other`,method:t,outcome:n,url:r})=>{let i=Po(r),a=(n==null?void 0:n.type)===`response`&&typeof n.statusCode==`number`&&n.statusCode>0?n.statusCode:void 0,o=(n==null?void 0:n.type)===`abort`?Y.abort:(n==null?void 0:n.type)===`timeout`?Y.timeout:(n==null?void 0:n.type)===`network_error`?Y.error:typeof a==`number`?Mo(a):Y.success,s=t==null?void 0:t.toUpperCase();return W(W(W(W(W({},$({outcome:o,spanType:X.resource})),i.serverAddress?{"server.address":i.serverAddress}:{}),i.serverPort===void 0?{}:{"server.port":i.serverPort}),{},{"resource.type":e},s?{"http.request.method":s}:{}),typeof a==`number`?{"http.response.status_code":a}:{})};G();var Io=100,Lo=100,Ro=1e3,zo=100,Bo=1e4,Vo=`data-bk-action-name`,Ho=100,Uo=10,Wo=e=>e.replace(/\s+/g,` `).trim().slice(0,Ho),Go=e=>{var t;if(e.parentElement)return e.parentElement;let n=(t=e.getRootNode)==null?void 0:t.call(e);return typeof ShadowRoot<`u`&&n instanceof ShadowRoot?n.host:null},Ko=(e,t)=>{let n=e;for(;n;){let e=n.getAttribute(t);if(e)return Wo(e);n=Go(n)}},qo=e=>{var t;return e.isContentEditable?``:Wo((t=e.textContent)==null?``:t)},Jo=e=>{var t,n;let r=e,i=(t=r.labels)==null?void 0:t[0];if(i){let e=qo(i);if(e)return e}let a=e.tagName.toLowerCase(),o=(n=e.getAttribute(`type`))==null?void 0:n.toLowerCase();if(a===`input`&&[`button`,`reset`,`submit`].includes(o==null?``:o)){var s;let e=Wo((s=r.value)==null?``:s);if(e)return e}if(a===`button`||a===`label`||e.getAttribute(`role`)===`button`){let t=qo(e);if(t)return t}for(let t of[`aria-label`,`alt`,`name`,`title`,`placeholder`]){var c;let n=Wo((c=e.getAttribute(t))==null?``:c);if(n)return n}},Yo=(e,t=Vo,n=!1)=>{let r=Ko(e,t);if(r)return r;if(!n)return e.tagName.toLowerCase();let i=e,a=0;for(;i&&a<=Uo;){let e=i.tagName.toLowerCase();if(e===`body`||e===`html`||e===`head`)break;let t=Jo(i);if(t)return t;if(e===`form`)break;i=Go(i),a+=1}for(i=e,a=0;i&&a<=Uo;){let e=i.tagName.toLowerCase();if(e===`body`||e===`html`||e===`head`)break;let t=qo(i);if(t)return t;if(e===`form`)break;i=Go(i),a+=1}return e.tagName.toLowerCase()},Xo=e=>{var t;let n=(t=e.composedPath)==null?void 0:t.call(e)[0];return n instanceof Element?n:e.target instanceof Element?e.target:void 0},Zo=e=>{let t=e.timeStamp;return!Number.isFinite(t)||t<=0?Date.now():t>0xe8d4a51000?t:typeof performance>`u`?Date.now():performance.timeOrigin+t},Qo=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:t,$o=e=>{let t=e;if(t.tagName.toLowerCase()===`label`&&t.hasAttribute(`for`)){var n;t=document.getElementById((n=t.getAttribute(`for`))==null?``:n)}for(;t;){let e=t.tagName.toLowerCase();if(t.hasAttribute(`contenteditable`)||e===`canvas`||e===`select`||e===`textarea`||e===`a`&&t.hasAttribute(`href`))return!0;if(e===`input`){var r,i;return![`button`,`checkbox`,`radio`,`range`,`reset`,`submit`].includes((r=(i=t.getAttribute(`type`))==null?void 0:i.toLowerCase())==null?`text`:r)}t=Go(t)}return!1},es=(e={})=>{let t=[],n=new Map,r=new Set,i=e.actionNameAttribute||Vo,a=Qo(e.maxDuration,Bo),o=[],s,c=()=>{s==null||s.setRuntimeAttributes({[J.actionId]:[...n.keys()].at(-1)})},l=e=>!e.hadActivity&&!e.userActivity.input&&!e.userActivity.scroll&&!e.userActivity.selection&&!$o(e.target),u=e=>{if(!r.delete(e)||!s||!e.completed)return;clearTimeout(e.reportTimer),e.hadError&&e.frustrations.add(`error_click`),l(e)&&e.frustrations.add(`dead_click`);let t=[`rage_click`,`dead_click`,`error_click`].filter(t=>e.frustrations.has(t)),{endTime:n,hasLoadingTime:i}=e.completed,a=e.hadError||t.length>0,o=`click ${e.targetName}`,c=W(W(W(W({},s.config.hooks.getPageAttributes()),$({outcome:a?Y.warning:Y.success,spanType:X.action})),e.runtimeAttributes),{},{[J.actionId]:e.id,[J.actionName]:o,[J.actionType]:`click`,[J.actionTargetName]:e.targetName,[J.actionTargetTag]:e.targetTag},t.length?{[J.actionFrustrationType]:t}:{});s.startSpan(Q({attributes:c,spanType:X.action}),c,{rumSpanType:X.action,startTime:e.startTime}).end(i?n:e.startTime)},d=(e,t,i)=>{if(!n.delete(e.id)||!s)return;clearTimeout(e.validationTimer),clearTimeout(e.quietTimer),clearTimeout(e.maxDurationTimer),c(),e.completed={endTime:t,hasLoadingTime:i},r.add(e);let a=Math.max(0,e.startTime+Ro-Date.now());e.reportTimer=setTimeout(()=>u(e),a)},f=()=>{[...r].forEach(u)},p=e=>{if(clearTimeout(e.quietTimer),!e.hadActivity||e.pendingRequests.size)return;let t=Math.max(0,e.lastActivityTime+Lo-Date.now());e.quietTimer=setTimeout(()=>d(e,e.lastActivityTime,!0),t)},m=(e,t)=>{e.hadActivity=!0,e.lastActivityTime=Math.max(e.lastActivityTime,t),p(e)},h=(e,t)=>t>=e.startTime&&t<=e.startTime+a,g=e=>{for(let i of n.values()){if(e.type===`request_start`){var t;if(e.url&&Oo(s==null||(t=s.config.view)==null?void 0:t.excludedActivityUrls,e.url)||!h(i,e.time))continue;i.pendingRequests.add(e.id),m(i,e.time);continue}if(e.type===`request_end`){if(!i.pendingRequests.delete(e.id))continue;m(i,e.time);continue}if(e.type===`long_task`||e.type===`resource`){var r;if(e.type===`resource`&&e.url&&Oo(s==null||(r=s.config.view)==null?void 0:r.excludedActivityUrls,e.url)||e.startTime>i.startTime+a||(e.type===`resource`?e.startTime<i.startTime:e.endTime<i.startTime))continue;m(i,e.endTime);continue}if(e.type===`dom_mutation`||e.type===`window_open`){h(i,e.time)&&m(i,e.time);continue}e.type===`error`&&h(i,e.time)&&(i.hadError=!0,m(i,e.time))}},_=(e=Date.now())=>{[...n.values()].forEach(t=>d(t,e,t.hadActivity))},v=(e,t)=>{let n=`clientX`in t&&typeof t.clientX==`number`?t.clientX:0,r=`clientY`in t&&typeof t.clientY==`number`?t.clientY:0;o=o.filter(t=>e.startTime-t.action.startTime<=Ro);let i=o.at(-1),a=o.some(e=>e.action.userActivity.scroll||e.action.userActivity.selection),s=(i==null?void 0:i.target)===e.target&&Math.hypot(i.x-n,i.y-r)<=zo;(a||i&&!s)&&(o=[]),o.push({action:e,target:e.target,x:n,y:r}),o.length>=3&&e.startTime-o[o.length-3].action.startTime<=Ro&&(o.slice(-3).map(e=>e.action).forEach(e=>e.frustrations.add(`rage_click`)),o=[])};return{name:`action`,init(l){if(typeof window>`u`||typeof document>`u`)return;s=l;let u={capture:!0,passive:!0},p=t=>{if(!l.isSampled()||`button`in t&&typeof t.button==`number`&&t.button!==0)return;let r=Xo(t);if(!r)return;let o=Zo(t),s=q(`action`),u={frustrations:new Set,hadActivity:!1,hadError:!1,id:s,lastActivityTime:o,maxDurationTimer:setTimeout(()=>d(u,o+a,!0),a),pendingRequests:new Set,runtimeAttributes:l.getRuntimeAttributes(),startTime:o,target:r,targetName:Yo(r,i,e.nameCollection===`text`),targetTag:r.tagName.toLowerCase(),userActivity:{input:!1,scroll:!1,selection:!1},validationTimer:setTimeout(()=>{u.hadActivity||d(u,u.startTime,!1)},Io)};n.set(s,u),v(u,t),c()};window.addEventListener(`click`,p,u),t.push(()=>window.removeEventListener(`click`,p,u));let m=l.onActivity(g),h=l.onSessionLifecycle(e=>{e.type===`expired`&&(_(e.expiredAt),f())});t.push(m,h);let y=()=>{document.visibilityState===`hidden`&&(_(),f())},b=()=>{_(),f()};window.addEventListener(`pagehide`,b),document.addEventListener(`visibilitychange`,y),t.push(()=>window.removeEventListener(`pagehide`,b),()=>document.removeEventListener(`visibilitychange`,y));let x=e=>{new Set([...n.values(),...r,...o.map(e=>e.action)]).forEach(t=>{t.userActivity[e]=!0,e!==`input`&&t.frustrations.delete(`rage_click`)})},S=()=>x(`input`),C=()=>x(`scroll`),w=()=>x(`selection`);window.addEventListener(`input`,S,u),window.addEventListener(`scroll`,C,u),document.addEventListener(`selectionchange`,w,u),t.push(()=>window.removeEventListener(`input`,S,u),()=>window.removeEventListener(`scroll`,C,u),()=>document.removeEventListener(`selectionchange`,w,u))},shutdown(){for(_(),f();t.length;){var e;(e=t.pop())==null||e()}o=[],s=void 0}}},ts=e=>{let t=e.type===`characterData`?e.target.parentElement:e.target;return t instanceof Element&&!!t.closest(`[data-bk-excluded-activity-mutations]`)},ns=()=>{let e,t=[];return{name:`activity`,init(n){if(typeof document<`u`&&typeof MutationObserver<`u`&&(e=new MutationObserver(e=>{e.length&&!e.every(ts)&&n.notifyActivity({time:Date.now(),type:`dom_mutation`})}),e.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0})),!(typeof window>`u`)&&typeof window.open==`function`){let e=window.open,r=((...t)=>(n.notifyActivity({time:Date.now(),type:`window_open`}),Reflect.apply(e,window,t)));window.open=r,t.push(()=>{window.open===r&&(window.open=e)})}},shutdown(){var n;for(e==null||e.disconnect(),e=void 0;t.length;)(n=t.pop())==null||n()}}},rs=(e,t)=>!!(t&&Oo(e.config.view.excludedActivityUrls,t)),is=(e,t,n)=>{let r=new Set,i=!1,a=!1,o=t,s,c=e=>{i||(i=!0,clearTimeout(f),clearTimeout(s),d(),n(e))},l=()=>{clearTimeout(s),!(!a||r.size)&&(s=setTimeout(()=>c({endTime:o,hadActivity:!0}),Math.max(0,o+100-Date.now())))},u=e=>{a=!0,o=Math.max(o,e),l()},d=e.onActivity(n=>{if(!(n.type===`error`||n.type===`long_task`)){if(n.type===`request_start`){if(n.time<t||rs(e,n.url))return;r.add(n.id),u(n.time);return}if(n.type===`request_end`){if(!r.delete(n.id))return;u(n.time);return}if(n.type===`resource`){if(n.endTime<t||rs(e,n.url))return;u(n.endTime);return}n.time>=t&&u(n.time)}}),f=setTimeout(()=>{a||c({hadActivity:!1})},100);return()=>{i||(i=!0,clearTimeout(f),clearTimeout(s),d())}};G();var as=1e3,os=200,ss=`body`,cs=.8,ls=[`[data-loading="true"]`,`[aria-busy="true"]`,`.loading`,`.is-loading`,`.spinner`,`.skeleton`,`.bk-loading`],us=[[.2,.2],[.5,.2],[.8,.2],[.2,.5],[.5,.5],[.8,.5],[.2,.8],[.5,.8],[.8,.8]],ds=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:t,fs=(e,t)=>typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(1,e)):t,ps=(e,t)=>t.some(t=>{try{return e.matches(t)||!!e.closest(t)}catch(e){return!1}}),ms=e=>{if(typeof getComputedStyle!=`function`)return!0;let t=getComputedStyle(e);return t.display!==`none`&&t.visibility!==`hidden`&&Number(t.opacity||1)>0},hs=(e,t)=>{if(typeof document.elementsFromPoint==`function`)return document.elementsFromPoint(e,t);let n=document.elementFromPoint(e,t);return n?[n]:[]},gs=(e,t)=>{var n;let r=document.querySelector(e),i=(n=r==null?document.body:r)==null?document.documentElement:n,a=0,o=0;for(let[e,n]of us){let r=hs(window.innerWidth*e,window.innerHeight*n);if(r.some(e=>ps(e,t))){o+=1;continue}r.some(e=>e!==i&&e!==document.body&&e!==document.documentElement&&i.contains(e)&&ms(e))||(a+=1)}let s=us.length-o;return{emptyCount:a,ignoredCount:o,reason:r?`empty_viewport`:`missing_root`,score:s?a/s:0,validCount:s}},_s=(e={})=>{var t;let n=ds(e.checkDelay,as),r=ds(e.confirmationDelay,os),i=e.rootSelector||ss,a=fs(e.threshold,cs),o=[...ls,...(t=e.ignoreSelectors)==null?[]:t],s,c,l,u,d=()=>{},f;return{name:`blank-screen`,init(e){if(typeof window>`u`||typeof document>`u`)return;let t=()=>{clearTimeout(u),u=void 0},p=(t,n)=>{if(s!==t||c===t||!e.isSampled())return;c=t;let r=Date.now(),i=W(W({},$({outcome:Y.error,spanType:X.error})),{},{"blank_screen.empty_ratio":n.score,"blank_screen.empty_sample_count":n.emptyCount,"blank_screen.reason":n.reason});e.startSpan(Q({attributes:i,spanType:X.error}),i,{startTime:r}).end(r)},m=t=>{if(s!==t||c===t||document.visibilityState===`hidden`)return;let n;try{n=gs(i,o)}catch(t){var l;e.config.debug&&((l=globalThis.console)==null||l.warn(`[bk-ot][blank-screen] detection failed:`,t));return}!n.validCount||n.score<a||(u=setTimeout(()=>{if(s!==t||document.visibilityState===`hidden`)return;let n;try{n=gs(i,o)}catch(t){var r;e.config.debug&&((r=globalThis.console)==null||r.warn(`[bk-ot][blank-screen] confirmation failed:`,t));return}n.validCount&&n.score>=a&&p(t,n)},r))},h=r=>{t(),!(document.visibilityState===`hidden`||!e.isSampled())&&(u=setTimeout(()=>m(r),n))};d=e.onViewChange(n=>{if(n.id!==s&&(t(),l==null||l(),l=void 0,s=n.id,c=void 0,n.id)){let t=n.id;l=is(e,Date.now(),()=>{l=void 0,h(t)})}});let g=()=>{document.visibilityState===`hidden`?t():s&&c!==s&&h(s)};document.addEventListener(`visibilitychange`,g),f=()=>document.removeEventListener(`visibilitychange`,g)},shutdown(){clearTimeout(u),u=void 0,d(),l==null||l(),l=void 0,f==null||f(),f=void 0,s=void 0,c=void 0}}},vs=[`http.url`,`url.full`],ys=new WeakSet,bs=e=>{ys.add(e)},xs=e=>{for(let n of vs){var t;let r=(t=e.attributes)==null?void 0:t[n];if(typeof r==`string`)return r}},Ss=e=>{let t=e==null?void 0:e[J.sessionId];return typeof t==`string`&&t.length>0},Cs=e=>{let t=e==null?void 0:e[J.viewId];return typeof t==`string`&&t.length>0},ws=e=>Ss(e)&&Cs(e),Ts=e=>(e==null?void 0:e[J.spanType])===X.session,Es=class{constructor(e,t,n){this.inner=e,this.config=t,this.getRuntimeAttributes=n}forceFlush(){return this.inner.forceFlush()}onEnd(e){let t=xs(e);if(!(ys.delete(e)||t&&To(this.config,t)||!ws(e.attributes)&&!(Ts(e.attributes)&&Ss(e.attributes)))){try{var n,r;if(((n=this.config.hooks)==null||(r=n.beforeSend)==null?void 0:r.call(n,{attributes:e.attributes,name:e.name,signal:`span`}))===!1)return}catch(e){var i;this.config.debug&&((i=globalThis.console)==null||i.warn(`[bk-ot] tracking.beforeSend failed:`,e))}this.inner.onEnd(e)}}onStart(e,t){var n;let r=(n=e.attributes)==null?{}:n,i={};for(let[e,t]of Object.entries(this.getRuntimeAttributes()))r[e]===void 0&&t!==void 0&&(i[e]=t);e.setAttributes(i),this.inner.onStart(e,t)}shutdown(){return this.inner.shutdown()}},Ds=100,Os=200,ks=[],As=e=>e.replace(/#.*$/,``),js=e=>{let t=ks.indexOf(e);t>=0&&ks.splice(t,1),e.timer!==void 0&&clearTimeout(e.timer)},Ms=(e,t)=>{let n=e.callback;js(e),e.callback=void 0,n==null||n(t)},Ns=e=>{let t=performance.timeOrigin+e.startTime,n=ks.filter(n=>!n.entry&&As(n.url)===As(e.name)&&t>=n.startTime-50).sort((e,n)=>Math.abs(e.startTime-t)-Math.abs(n.startTime-t))[0];n&&(n.entry=e,n.callback&&Ms(n,e))},Ps=(e,t=Date.now())=>{let n={startTime:t,url:e};return ks.push(n),ks.length>Ds&&Ms(ks[0]),{cancel:()=>Ms(n),complete:e=>{if(n.callback=e,n.entry){Ms(n,n.entry);return}n.timer=setTimeout(()=>Ms(n),Os)}}};G();var Fs=`traceparent`,Is=32,Ls=16,Rs=`0123456789abcdef`,zs=/^[\da-f]+$/,Bs=/^0+$/,Vs=/^\d+$/,Hs=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})(?:-.*)?$/,Us=/^([\da-f]{32})-([\da-f]{16})(?:-([01]))?$/,Ws=/(?:^|,)_dd\.p\.tid=([\da-f]{16})(?:,|$)/,Gs=`0000000000000000`,Ks=(e,t)=>e.length===t&&zs.test(e)&&!Bs.test(e),qs=e=>{let t=e.toLowerCase();return Ks(t,Is)?t:Ks(t,Ls)?t.padStart(Is,`0`):void 0},Js=e=>{let t=e.toLowerCase();return Ks(t,Ls)?t:void 0},Ys=e=>{let t=new Uint8Array(e/2);if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`)crypto.getRandomValues(t);else for(let e=0;e<t.length;e+=1)t[e]=Math.floor(Math.random()*256);let n=``;for(let e of t)n+=Rs[e>>4]+Rs[e&15];return Bs.test(n)?`${n.slice(1)}1`:n},Xs=e=>{if(!Vs.test(e))return;let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n)-48;for(let e=0;e<t.length;e+=1){let n=t[e]*10+r;t[e]=n%16,r=(n-n%16)/16}for(;r>0;)t.push(r%16),r=(r-r%16)/16}if(t.length>Ls)return;let n=``;for(let e=t.length-1;e>=0;--e)n+=Rs[t[e]];return n.padStart(Ls,`0`)},Zs=(e,t)=>{let n={};for(let i of t){var r;let t=(r=e(i))==null?void 0:r.trim();t&&(n[i]=t)}return n},Qs=[e=>{var t;let n=(t=e(`traceparent`))==null?void 0:t.trim().toLowerCase();if(!n)return;let r=Hs.exec(n);if(!r||r[1]===`ff`)return;let[,,i,a,o]=r;if(!(!Ks(i,Is)||!Ks(a,Ls)))return{format:`traceparent`,headers:Zs(e,[Fs]),sampled:(Number.parseInt(o,16)&1)==1,spanId:a,traceId:i}},e=>{var t;let n=(t=e(`sentry-trace`))==null?void 0:t.trim().toLowerCase();if(!n)return;let r=Zs(e,[`sentry-trace`]),i=Us.exec(n);if(!i)return{format:`sentry-trace`,headers:r};let[,a,o,s]=i;return W(W({format:`sentry-trace`,headers:r},s===void 0?{}:{sampled:s===`1`}),Ks(a,Is)&&Ks(o,Ls)?{spanId:o,traceId:a}:{})},e=>{var t;let n=(t=e(`b3`))==null?void 0:t.trim().toLowerCase();if(!n)return;let[r,i,a]=n.split(`-`),o=r?qs(r):void 0,s=i?Js(i):void 0;return W(W({format:`b3`,headers:Zs(e,[`b3`])},o&&s?{spanId:s,traceId:o}:{}),a?{sampled:a===`1`||a===`d`}:{})},e=>{var t,n,r;let i=(t=e(`x-b3-traceid`))==null?void 0:t.trim().toLowerCase(),a=(n=e(`x-b3-spanid`))==null?void 0:n.trim().toLowerCase(),o=(r=e(`x-b3-sampled`))==null?void 0:r.trim().toLowerCase();if(!i&&!a&&!o)return;let s=i?qs(i):void 0,c=a?Js(a):void 0;return W(W({format:`b3-multi`,headers:Zs(e,[`x-b3-traceid`,`x-b3-spanid`,`x-b3-parentspanid`,`x-b3-sampled`,`x-b3-flags`])},s&&c?{spanId:c,traceId:s}:{}),o?{sampled:o===`1`||o===`d`}:{})},e=>{var t,n,r,i,a,o;let s=(t=e(`x-datadog-trace-id`))==null?void 0:t.trim(),c=(n=e(`x-datadog-parent-id`))==null?void 0:n.trim(),l=(r=e(`x-datadog-sampling-priority`))==null?void 0:r.trim();if(!s&&!c&&!l)return;let u=(i=e(`x-datadog-tags`))==null?void 0:i.trim().toLowerCase(),d=(a=u?(o=Ws.exec(u))==null?void 0:o[1]:void 0)==null?Gs:a,f=s?Xs(s):void 0,p=f?qs(`${d}${f}`):void 0,m=c?Xs(c):void 0,h=m?Js(m):void 0;return W(W({format:`datadog`,headers:Zs(e,[`x-datadog-trace-id`,`x-datadog-parent-id`,`x-datadog-sampling-priority`,`x-datadog-origin`,`x-datadog-tags`])},p&&h?{spanId:h,traceId:p}:{}),l?{sampled:Number(l)>0}:{})},e=>{var t;let n=(t=e(`sw8`))==null?void 0:t.trim();if(!n)return;let r=n.split(`-`)[0];return W({format:`sw8`,headers:Zs(e,[`sw8`])},r?{sampled:r===`1`}:{})}],$s=e=>{for(let t of Qs){let n=t(e);if(n)return n}},ec=(e,t,n,r)=>({attributes:n,context:{spanId:t,traceFlags:r===!1?N.NONE:N.SAMPLED,traceId:e}}),tc=e=>{var t,n;let r=$s(e);if(!r){let e=Ys(Is),t=Ys(Ls),n=`00-${e}-${t}-01`;return{links:[ec(e,t,{format:`traceparent`,injected:!0,[Fs]:n})],traceparent:n}}return{links:[ec((t=r.traceId)==null?Ys(Is):t,(n=r.spanId)==null?Ys(Ls):n,W({format:r.format,injected:!1},r.headers),r.sampled)]}};G();var nc=e=>e.deliveryType===`cache`||e.transferSize===0&&e.decodedBodySize>0?!0:void 0,rc=e=>e.transferSize===0&&e.encodedBodySize===0&&e.decodedBodySize===0&&e.requestStart===0&&e.responseStart===0&&!e.nextHopProtocol,ic=(...e)=>e.every((t,n)=>n===0||e[n-1]<=t),ac=(e,t,n,r,i)=>{ic(n,r,i)&&(e[`resource.${t}.start`]=r-n,e[`resource.${t}.duration`]=i-r)},oc=e=>{let t={},n=[e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd];return!n.every(Number.isFinite)||!ic(...n)?t:(ac(t,`first_byte`,e.startTime,e.requestStart,e.responseStart),ac(t,`download`,e.startTime,e.responseStart,e.responseEnd),e.workerStart>0&&e.workerStart<e.fetchStart&&ac(t,`worker`,e.startTime,e.workerStart,e.fetchStart),e.fetchStart<e.domainLookupEnd&&ac(t,`dns`,e.startTime,e.domainLookupStart,e.domainLookupEnd),e.fetchStart<e.connectEnd&&(ac(t,`connect`,e.startTime,e.connectStart,e.connectEnd),e.connectStart<=e.secureConnectionStart&&e.secureConnectionStart<=e.connectEnd&&ac(t,`ssl`,e.startTime,e.secureConnectionStart,e.connectEnd)),e.redirectEnd>e.startTime&&ic(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart)&&ac(t,`redirect`,e.startTime,e.redirectStart,e.redirectEnd),t)},sc=e=>e.duration===0&&e.responseEnd>e.startTime?e.responseEnd-e.startTime:e.duration,cc=e=>{let t=rc(e),n=typeof e.deliveryType==`string`&&e.deliveryType?e.deliveryType:void 0;return W(W(W(W(W({[J.cacheHit]:nc(e)},e.nextHopProtocol?{[J.nextHopProtocol]:e.nextHopProtocol}:{}),oc(e)),n?{"resource.delivery_type":n}:{}),e.renderBlockingStatus?{"resource.render_blocking_status":e.renderBlockingStatus}:{}),t?{}:{"resource.size":e.decodedBodySize,"resource.encoded_body_size":e.encodedBodySize,"resource.decoded_body_size":e.decodedBodySize,"resource.transfer_size":e.transferSize})},lc=(e=!0)=>{let t;return{name:`resource`,init(n){var r;if(typeof PerformanceObserver>`u`||!((r=PerformanceObserver.supportedEntryTypes)!=null&&r.includes(`resource`)))return;let i=t=>{if(!n.isSampled()||!t.name||Eo(n.config,t.name))return;if(t.initiatorType===`fetch`||t.initiatorType===`xmlhttprequest`){Ns(t);return}if(t.duration<0)return;let r=n.config.hooks.redactUrl(t.name),i=sc(t),a=performance.timeOrigin+t.startTime,o=a+i;if(e&&n.isSampled()){let e=W(W(W({},n.config.hooks.getPageAttributes()),Fo({initiatorType:t.initiatorType||`other`,method:`GET`,outcome:typeof t.responseStatus==`number`?{statusCode:t.responseStatus,type:`response`}:void 0,url:r})),{},{"url.full":r,"url.template":n.config.hooks.getRequestUrlTemplate(r)},cc(t));n.startSpan(Q({attributes:e,spanType:X.resource}),e,{kind:Ve.CLIENT,rumSpanType:X.resource,startTime:a}).end(o)}n.notifyActivity({endTime:o,startTime:a,type:`resource`,url:t.name})};try{t=new PerformanceObserver(e=>{for(let t of e.getEntries())i(t)}),t.observe({type:`resource`,buffered:!0})}catch(e){t=void 0}},shutdown(){t==null||t.disconnect(),t=void 0}}};G();var uc=e=>typeof e.config.tracking.request==`object`?e.config.tracking.request:void 0,dc=e=>{var t;let n=(t=uc(e))==null?void 0:t.allowedTracingUrls;return Array.isArray(n)?n.length>0:n!==void 0},fc=e=>typeof e==`object`&&e&&`name`in e&&typeof e.name==`string`?e.name:``,pc=(e,t)=>{let n=e.signal;return fc(n==null?void 0:n.reason)===`TimeoutError`||fc(t)===`TimeoutError`?{error:t,type:`timeout`}:n!=null&&n.aborted||fc(t)===`AbortError`?{type:`abort`}:{error:t,type:`network_error`}},mc=(e,t)=>e===`abort`?{type:`abort`}:e===`timeout`?{type:`timeout`}:e===`error`||t.status===0?{type:`network_error`}:{statusCode:t.status,type:`response`},hc=e=>e.type===`network_error`||e.type===`timeout`||e.type===`response`&&typeof e.statusCode==`number`&&e.statusCode>=400,gc=e=>typeof e==`string`||e instanceof URL?bo(String(e)):bo(e.url),_c=(e,t)=>{var n;return((n=t==null?void 0:t.method)==null?typeof Request<`u`&&e instanceof Request?e.method:`GET`:n).toUpperCase()},vc=(e,t)=>typeof Request<`u`&&e instanceof Request?e:t==null?{}:t,yc=(e,t)=>{var n;let r=typeof Request<`u`&&e instanceof Request?e.headers:void 0;return new Headers((n=t==null?void 0:t.headers)==null?r:n)},bc=(e,t,n)=>n.traceparent?(t.set(Fs,n.traceparent),W(W({},e),{},{headers:t})):e,xc=e=>t=>e==null?void 0:e[t.toLowerCase()],Sc=(e,t)=>Eo(e.config,t)||Oo(e.config.view.excludedActivityUrls,t),Cc=(e,t)=>{if(Sc(e,t))return()=>{};let n=q(`request`);e.notifyActivity({id:n,time:Date.now(),type:`request_start`,url:t});let r=!1;return()=>{r||(r=!0,e.notifyActivity({id:n,time:Date.now(),type:`request_end`}))}},wc=(e,t)=>e.isSampled()?Ps(t):{cancel(){},complete(e){e()}},Tc=(e,t,n,r)=>{var i,a;let o=(i=n.startedAt)==null?Date.now():i,s=W(W(W({},e.config.hooks.getPageAttributes()),Fo({initiatorType:t,method:n.method,url:(a=n.url)==null?``:a})),n.url?{"url.full":e.config.hooks.redactUrl(n.url),"url.template":e.config.hooks.getRequestUrlTemplate(n.url)}:{});return e.startSpan(Q({attributes:s,spanType:X.resource}),s,W({kind:Ve.CLIENT,rumSpanType:X.resource,startTime:o},r?{links:r.links}:{}))},Ec=(e,t,n,r,i,a={})=>{let o=a.url,s=o?e.config.hooks.redactUrl(o):void 0,c=a.method,l={attributes:W(W(W(W({},e.config.hooks.getPageAttributes()),Fo({initiatorType:n,method:c,outcome:i,url:s==null?``:s})),s?{"url.full":s}:{}),o?{"url.template":e.config.hooks.getRequestUrlTemplate(o)}:{}),resource:{method:c,outcome:i,transport:n,url:s},type:`resource`},u=!0;try{var d,f;u=(d=uc(e))==null||(f=d.beforeSend)==null?void 0:f.call(d,l,r)}catch(t){var p;e.config.debug&&((p=globalThis.console)==null||p.warn(`[bk-ot] request.beforeSend failed:`,t))}let m=e.applyRedact(l.attributes);if(t.setAttributes(m),t.updateName(Q({attributes:m,spanType:X.resource})),u===!1){bs(t);return}hc(i)&&t.setStatus({code:He.ERROR})},Dc=e=>{let t=[],n=new Set;return{name:`request`,enabled:e!==!1,init(e){if(!(typeof window>`u`)){if(typeof window.fetch==`function`){let r=window.fetch,i=function(){var t=U(function*(t,i){let a=gc(t);if(!e.isSampled()||Ao(e.config,a))return r.call(this,t,i);let o={method:_c(t,i),startedAt:Date.now(),url:a},s=jo(e.config,a)?yc(t,i):void 0,c=s?tc(e=>{var t;return(t=s.get(e))==null?void 0:t}):void 0,l=Tc(e,`fetch`,o,c),u=wc(e,a),d=Cc(e,a),f=vc(t,i),p=s&&c?bc(i,s,c):i,m=!1,h=(t,r=Date.now())=>{if(!m){if(m=!0,n.delete(g),t){l.setAttributes(e.applyRedact(cc(t))),l.end(performance.timeOrigin+t.startTime+sc(t));return}l.end(r)}},g=()=>{u.cancel(),h()};n.add(g);try{let n=yield r.call(this,t,p),i=W(W({},n.status>0?{statusCode:n.status}:{}),{},{type:`response`});Ec(e,l,`fetch`,{request:f,response:n,type:`fetch`},i,o);let a=Date.now();return u.complete(e=>h(e,a)),n}catch(t){let n=pc(f,t);Ec(e,l,`fetch`,{error:t,request:f,type:`fetch`},n,o),n.type!==`abort`&&t instanceof Error&&l.recordException(t);let r=Date.now();throw u.complete(e=>h(e,r)),t}finally{d()}});return function(e,n){return t.apply(this,arguments)}}();window.fetch=i,t.push(()=>{window.fetch===i&&(window.fetch=r)})}if(typeof XMLHttpRequest<`u`){let r=new WeakMap,i=new WeakMap,a=XMLHttpRequest.prototype.open,o=XMLHttpRequest.prototype.send,s=function(e,t,n=!0,o,s){return r.set(this,{method:e.toUpperCase(),url:bo(String(t))}),i.delete(this),a.call(this,e,String(t),n,o,s)},c=function(t){var a;let s=(a=r.get(this))==null?{}:a;if(!e.isSampled()||!s.url||Ao(e.config,s.url))return o.call(this,t);s.startedAt=Date.now();let c=jo(e.config,s.url)?tc(xc(i.get(this))):void 0,l=Tc(e,`xhr`,s,c),u=wc(e,s.url),d=Cc(e,s.url);c!=null&&c.traceparent&&this.setRequestHeader(Fs,c.traceparent);let f=!1,p=!1,m=()=>{},h=()=>{m(),u.cancel(),!p&&(p=!0,n.delete(h),d(),l.end())};n.add(h);let g=t=>{if(f||p)return;f=!0,m();let r=mc(t,this);Ec(e,l,`xhr`,{type:`xhr`,xhr:this},r,s),d();let i=Date.now();u.complete(t=>{if(!p){if(p=!0,n.delete(h),t){l.setAttributes(e.applyRedact(cc(t))),l.end(performance.timeOrigin+t.startTime+sc(t));return}l.end(i)}})},_=()=>g(`abort`),v=()=>g(`error`),y=()=>g(`load`),b=()=>g(`timeout`);m=()=>{this.removeEventListener(`abort`,_),this.removeEventListener(`error`,v),this.removeEventListener(`load`,y),this.removeEventListener(`timeout`,b)},this.addEventListener(`abort`,_,{once:!0}),this.addEventListener(`error`,v,{once:!0}),this.addEventListener(`load`,y,{once:!0}),this.addEventListener(`timeout`,b,{once:!0});try{return o.call(this,t)}catch(e){throw e instanceof Error&&l.recordException(e),g(`error`),e}};if(XMLHttpRequest.prototype.open=s,XMLHttpRequest.prototype.send=c,t.push(()=>{XMLHttpRequest.prototype.open===s&&(XMLHttpRequest.prototype.open=a),XMLHttpRequest.prototype.send===c&&(XMLHttpRequest.prototype.send=o)}),dc(e)&&typeof XMLHttpRequest.prototype.setRequestHeader==`function`){let e=XMLHttpRequest.prototype.setRequestHeader,n=function(t,n){var r;let a=t.toLowerCase(),o=(r=i.get(this))==null?{}:r;return o[a]=a in o?`${o[a]}, ${n}`:n,i.set(this,o),e.call(this,t,n)};XMLHttpRequest.prototype.setRequestHeader=n,t.push(()=>{XMLHttpRequest.prototype.setRequestHeader===n&&(XMLHttpRequest.prototype.setRequestHeader=e)})}}}},shutdown(){var e;for(let e of[...n])e();for(;t.length;)(e=t.pop())==null||e()}}};G();var Oc=/^https?:|^\/\//i,kc=(e,t)=>{if(t)return Oc.test(t)?e(t):t},Ac=()=>{let e;return{name:`csp-violation`,init(t){if(typeof window>`u`||typeof document>`u`)return;let n=e=>{if(!t.isSampled())return;let n=Date.now(),r=kc(t.config.hooks.redactUrl,e.blockedURI),i=e.sourceFile?t.config.hooks.redactUrl(e.sourceFile):void 0,a=W(W(W({},t.config.hooks.getPageAttributes()),$({outcome:Y.error,spanType:X.error})),{},{"csp.blocked_uri":r,"csp.violated_directive":e.violatedDirective,"csp.effective_directive":e.effectiveDirective,"csp.disposition":e.disposition,"csp.source_file":i,"csp.line_number":e.lineNumber,"csp.column_number":e.columnNumber,"csp.status_code":e.statusCode,"csp.original_policy":e.originalPolicy,"error.source":`csp`});t.startSpan(Q({attributes:a,spanType:X.error}),a,{startTime:n}).end(n)};document.addEventListener(`securitypolicyviolation`,n),e=()=>document.removeEventListener(`securitypolicyviolation`,n)},shutdown(){e==null||e(),e=void 0}}},jc=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)};G();var Mc=`BK_RUM_DEVICE_ID`,Nc=250,Pc=()=>navigator.connection,Fc=()=>navigator.userAgentData,Ic=e=>{for(let[t,n]of[[`Edge`,/Edg\/([\d.]+)/],[`Chrome`,/Chrome\/([\d.]+)/],[`Firefox`,/Firefox\/([\d.]+)/],[`Safari`,/Version\/([\d.]+).*Safari/]]){let r=e.match(n);if(r!=null&&r[1])return{name:t,version:r[1].split(`.`)[0]}}return{name:`Other`,version:void 0}},Lc=(e,t)=>{let n=`${t==null?``:t} ${e}`;return/iphone|ipad|ipod/i.test(n)?`iOS`:/android/i.test(n)?`Android`:/mac/i.test(n)?`macOS`:/win/i.test(n)?`Windows`:/linux/i.test(n)?`Linux`:`Other`},Rc=e=>{let t=null;try{t=window.localStorage.getItem(e)}catch(e){}if(t)return t;let n=q(`device`);try{window.localStorage.setItem(e,n)}catch(e){}return n},zc=()=>{var e,t;return typeof window>`u`?{}:{"browser.viewport.width":window.innerWidth,"browser.viewport.height":window.innerHeight,"browser.screen.width":(e=window.screen)==null?void 0:e.width,"browser.screen.height":(t=window.screen)==null?void 0:t.height}},Bc=()=>{if(typeof navigator>`u`)return{};let e=Pc();return{[J.networkStatus]:navigator.onLine?`connected`:`not_connected`,"network.effective_type":e==null?void 0:e.effectiveType,"network.connection.type":e==null?void 0:e.type}},Vc=()=>{if(typeof navigator>`u`)return{};let e=Fc(),t=navigator.userAgent,n=Ic(t),r=Lc(t,e==null?void 0:e.platform),i=e!=null&&e.mobile||/mobi|android|iphone|ipad|ipod/i.test(t)?`mobile`:`desktop`;return{[J.deviceType]:i,[J.userAgentName]:n.name,[J.userAgentVersion]:n.version,[J.userAgentOsName]:r}},Hc=(e,t)=>{let n;return()=>{n!==void 0&&window.clearTimeout(n),n=window.setTimeout(()=>{n=void 0,e()},t)}},Uc=(e={})=>{let t=[];return{name:`device`,init(n){var r;let i=(r=e.storageKey)==null?`${Mc}_${jc(n.config.application.name)}`:r,a=typeof window>`u`||e.persistentId!==!0?q(`device`):Rc(i);if(n.setRuntimeAttributes(W(W(W({"device.id":a},n.config.tracking.device===!1?Vc():{}),zc()),Bc())),typeof window>`u`)return;let o=Hc(()=>{n.setRuntimeAttributes(zc())},Nc);window.addEventListener(`resize`,o),window.addEventListener(`orientationchange`,o),t.push(()=>window.removeEventListener(`resize`,o),()=>window.removeEventListener(`orientationchange`,o));let s=()=>{n.setRuntimeAttributes(Bc())};window.addEventListener(`online`,s),window.addEventListener(`offline`,s),t.push(()=>window.removeEventListener(`online`,s),()=>window.removeEventListener(`offline`,s));let c=Pc();c&&typeof c.addEventListener==`function`&&(c.addEventListener(`change`,s),t.push(()=>{var e;(e=c.removeEventListener)==null||e.call(c,`change`,s)}))},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};G();var Wc=e=>{if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch(t){return String(e)}},Gc=({context:e,error:t,exceptionType:n,extra:r={},source:i})=>{if(!e.isSampled())return;let a=Date.now(),o=Wc(t);e.notifyActivity({time:a,type:`error`});let s=n==null?t instanceof Error?t.name||`Error`:i:n,c=t instanceof Error?t:{message:o,name:s},l=W(W(W(W({},e.config.hooks.getPageAttributes()),e.config.hooks.getErrorAttributes()),$({outcome:Y.error,spanType:X.error})),{},{"error.message":o,"error.handled":!1,"error.source":i},r),u=e.startSpan(Q({attributes:l,nameHint:s,spanType:X.error}),l,{startTime:a});u.recordException(c),u.setStatus({code:He.ERROR,message:o}),u.end()},Kc=()=>{let e=[];return{name:`error`,init(t){if(typeof window>`u`)return;let n=e=>{var n;Gc({context:t,source:`window.error`,error:(n=e.error)==null?e.message:n,extra:{"code.filepath":e.filename,"code.lineno":e.lineno,"code.column":e.colno}})},r=e=>{Gc({context:t,source:`unhandledrejection`,error:e.reason,exceptionType:e.reason instanceof Error?e.reason.name:`UnhandledRejection`})},i=e=>{if(e instanceof ErrorEvent)return;let n=e.target;if(!(n instanceof Element))return;let r=n,i=r.src||r.href||n.currentSrc||``;Gc({context:t,source:`resource`,error:Error(`Resource load failed: ${n.tagName.toLowerCase()} ${i}`),exceptionType:`ResourceError`,extra:{"url.full":t.config.hooks.redactUrl(i)}})};window.addEventListener(`error`,n),window.addEventListener(`unhandledrejection`,r),window.addEventListener(`error`,i,!0),e.push(()=>window.removeEventListener(`error`,n),()=>window.removeEventListener(`unhandledrejection`,r),()=>window.removeEventListener(`error`,i,!0))},shutdown(){for(;e.length;){var t;(t=e.pop())==null||t()}}}};G();var qc=50,Jc=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:t,Yc=e=>Number.isFinite(e)?e:void 0,Xc=(e,t)=>W(W(W(W(W({},e.containerId?{"long_task.attribution.container_id":e.containerId}:{}),e.containerName?{"long_task.attribution.container_name":e.containerName}:{}),e.containerSrc?{"long_task.attribution.container_src":t(e.containerSrc)}:{}),e.containerType?{"long_task.attribution.container_type":e.containerType}:{}),e.name?{"long_task.attribution.name":e.name}:{}),Zc=(e,t)=>({"long_task.script.duration":e.duration,"long_task.script.execution_start":e.executionStart,"long_task.script.forced_style_and_layout_duration":e.forcedStyleAndLayoutDuration,"long_task.script.invoker":e.invoker,"long_task.script.invoker_type":e.invokerType,"long_task.script.pause_duration":e.pauseDuration,"long_task.script.source_char_position":e.sourceCharPosition,"long_task.script.source_function_name":e.sourceFunctionName,"long_task.script.source_url":e.sourceURL?t(e.sourceURL):``,"long_task.script.start_time":e.startTime,"long_task.script.window_attribution":e.windowAttribution}),Qc=(e={})=>{let t=Jc(e.threshold,qc),n,r,i=[];return{name:`long-task`,init(e){var a;if(typeof PerformanceObserver>`u`||typeof performance>`u`)return;let o=(a=PerformanceObserver.supportedEntryTypes)==null?[]:a,s=o.includes(`long-animation-frame`)?`long-animation-frame`:o.includes(`longtask`)?`longtask`:void 0;if(!s)return;let c=n=>{var r,i;if(!e.isSampled()||!Number.isFinite(n.duration)||n.duration<t)return;let a=n.entryType===`long-animation-frame`,o=a?n:void 0,s=(r=o==null?void 0:o.scripts)==null?[]:r,c=q(`long-task`),l=performance.timeOrigin+n.startTime,u=l+n.duration,d=a?`long-animation-frame`:`long-task`,f=a||(i=n.attribution)==null?[]:i,p=W(W(W(W(W(W({},e.config.hooks.getPageAttributes()),$({spanType:X.longTask})),Yc(o==null?void 0:o.blockingDuration)===void 0?{}:{[J.longTaskBlockingDuration]:o.blockingDuration}),{},{[J.longTaskEntryType]:d,[J.longTaskId]:c,"long_task.name":n.name},Yc(o==null?void 0:o.firstUIEventTimestamp)===void 0?{}:{"long_task.first_ui_event_timestamp":o.firstUIEventTimestamp}),Yc(o==null?void 0:o.renderStart)===void 0?{}:{"long_task.render_start":o.renderStart}),Yc(o==null?void 0:o.styleAndLayoutStart)===void 0?{}:{"long_task.style_and_layout_start":o.styleAndLayoutStart}),m=e.startSpan(Q({attributes:p,spanType:X.longTask}),p,{startTime:l});s.forEach(t=>{m.addEvent(`long_task.script`,e.applyRedact(Zc(t,e.config.hooks.redactUrl)),performance.timeOrigin+t.startTime)}),f.forEach((t,n)=>{m.addEvent(`long_task.attribution`,e.applyRedact(W({"long_task.attribution.index":n},Xc(t,e.config.hooks.redactUrl))),l)}),m.end(u),e.notifyActivity({endTime:u,startTime:l,type:`long_task`})},l=e=>e.forEach(e=>c(e));try{let e=!0;n=new PerformanceObserver(t=>{let n=t.getEntries();e?(i.push(...n),r||(r=setTimeout(()=>{let e=i;i=[],r=void 0,l(e)}))):l(n)}),n.observe({type:s,buffered:!0}),e=!1}catch(e){n=void 0}},shutdown(){n==null||n.disconnect(),n=void 0,clearTimeout(r),r=void 0,i=[]}}},$c=new Set,el=``,tl,nl,rl=!1,il=()=>typeof location>`u`?``:location.href,al=(e,t)=>{let n=il();el=n;let r={fromUrl:t,source:e,toUrl:n};for(let e of Array.from($c))e(r)},ol=()=>{al(`popstate`,el||il())},sl=()=>{al(`hashchange`,el||il())},cl=()=>{rl||typeof window>`u`||typeof history>`u`||(rl=!0,el=il(),tl=history.pushState,nl=history.replaceState,history.pushState=function(e,t,n){let r=el||il(),i=tl==null?void 0:tl.apply(this,[e,t,n]);return al(`pushState`,r),i},history.replaceState=function(e,t,n){let r=el||il(),i=nl==null?void 0:nl.apply(this,[e,t,n]);return al(`replaceState`,r),i},window.addEventListener(`popstate`,ol),window.addEventListener(`hashchange`,sl))},ll=()=>{!rl||typeof window>`u`||typeof history>`u`||(tl&&(history.pushState=tl),nl&&(history.replaceState=nl),window.removeEventListener(`popstate`,ol),window.removeEventListener(`hashchange`,sl),tl=void 0,nl=void 0,rl=!1,el=``)},ul=e=>typeof window>`u`||typeof history>`u`?()=>{}:(cl(),$c.add(e),()=>{$c.delete(e),$c.size===0&&ll()});function dl(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 fl(e,t){if(e==null)return{};var n,r,i=dl(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}G();var pl=[`stopLoadingTime`],ml=new Set(Object.values(J)),hl=()=>typeof location>`u`?``:location.href,gl=()=>{if(typeof performance>`u`)return{};let e=performance.getEntriesByType(`navigation`)[0];if(!e)return{};let t={},n=(e,n)=>{Number.isFinite(n)&&n>0&&(t[e]=n)};return n(J.viewFirstByte,e.responseStart),n(J.viewDomInteractive,e.domInteractive),n(J.viewDomContentLoaded,e.domContentLoadedEventEnd),n(J.viewDomComplete,e.domComplete),n(J.viewLoadEvent,e.loadEventEnd),t},_l=e=>{let t=e.indexOf(`?`);return t<0?e:e.slice(0,t)},vl=e=>{let t=e.slice(1);if(!t||typeof document>`u`||typeof document.getElementById!=`function`)return!1;try{return!!document.getElementById(decodeURIComponent(t))}catch(e){return!!document.getElementById(t)}},yl=(e,t)=>{try{let n=typeof location>`u`?`http://localhost`:location.href,r=new URL(e,n),i=new URL(t,n);return r.pathname!==i.pathname||!vl(i.hash)&&_l(r.hash)!==_l(i.hash)}catch(n){return e!==t}},bl=()=>{let e=[];return{name:`page-view`,init(t){if(typeof window>`u`)return;let n,r,i,a=(e=Date.now())=>t.setView({},e),o=(e,n,r=Date.now(),i)=>{e.version+=1;let a=W(W(W(W(W({},t.config.hooks.getPageAttributes()),e.attributes),e.snapshotAttributes),{},{[J.viewPhase]:n,[J.viewStartedAt]:e.startedAt,[J.viewVersion]:e.version},i?{"view.end_reason":i}:{}),e.loadingTime===void 0?{}:{[J.viewLoadingTime]:e.loadingTime,[J.viewLoadingTimeSource]:e.loadingTimeSource});t.startSpan(Q({attributes:a,spanType:X.view}),a,{contextTime:r,rumSpanType:X.view,startTime:r}).end(r)},s=(e,t=!0,r=Date.now())=>{var i;if(!n){t&&a(r);return}let s=W({},n);(i=n.stopLoadingTime)==null||i.call(n),o(n,`end`,r,e),n=void 0,t&&a(r);let{stopLoadingTime:c}=s;return fl(s,pl)},c=(e,t,r)=>{if(n!==e||!Number.isFinite(t)||t<0)return;let i=W(W({},e.loadingType===`initial_load`?gl():{}),{},{[J.viewLoadingTime]:t,[J.viewLoadingTimeSource]:r});Object.assign(e.snapshotAttributes,i),e.loadingTime=t,e.loadingTimeSource=r,o(e,`update`)},l=e=>{if(!t.config.view.loadingTime||document.visibilityState===`hidden`)return;let r=!1,i,a=e.loadingType!==`initial_load`,o,s,l=!1,u,d=()=>{var t;if(l||!r||!a||n!==e)return;let s=[i,o].filter(e=>e!==void 0);s.length&&c(e,Math.max(...s),`auto`),(t=e.stopLoadingTime)==null||t.call(e),e.stopLoadingTime=void 0},f=()=>{var t,n;let r=(t=(n=performance).getEntriesByType)==null?void 0:t.call(n,`navigation`)[0];return r!=null&&r.loadEventEnd?(o=Math.max(0,performance.timeOrigin+r.loadEventEnd-e.startedAt),a=!0,!0):!1};if(!a&&!f()){let t=()=>{setTimeout(()=>{n===e&&(f(),a=!0,d())})};window.addEventListener(`load`,t,{once:!0}),s=()=>window.removeEventListener(`load`,t)}let p=is(t,e.startedAt,t=>{r=!0,t.hadActivity&&(i=Math.max(0,t.endTime-e.startedAt)),d()}),m=()=>{var t;document.visibilityState===`hidden`&&(l=!0,(t=e.stopLoadingTime)==null||t.call(e),e.stopLoadingTime=void 0)};document.addEventListener(`visibilitychange`,m),u=()=>document.removeEventListener(`visibilitychange`,m),e.stopLoadingTime=()=>{p(),s==null||s(),s=void 0,u==null||u(),u=void 0},d()},u=e=>{let n=t.applyRedact(e==null?{}:e);return Object.fromEntries(Object.entries(n).filter(([e,t])=>t!==void 0&&!ml.has(e)))},d=(e,r,i,a=(e=>(e=n==null?void 0:n.rawUrl)==null?``:e)())=>{var c,d;if(!t.isSessionActive())return;let f=(c=e.url)==null?hl():c,p=t.config.hooks.getViewUrlTemplate(f),m=a?t.config.hooks.getViewUrlTemplate(a):``,h=(d=e.name)==null?p:d,g=u(e.attributes);s(r,!1);let _=q(`view`),v=t.config.hooks.redactUrl(f),y=t.config.hooks.redactUrl(a),b=i===`initial_load`,x=b&&typeof performance<`u`?performance.timeOrigin:Date.now(),S=b?gl():{};t.setView({attributes:g,id:_,loadingType:i,name:h,startedAt:x,url:v,urlTemplate:p},x),n={attributes:g,version:0,id:_,loadingType:i,name:h,rawUrl:f,snapshotAttributes:W(W(W(W(W(W({},g),t.config.hooks.getPageAttributes()),S),$({spanType:X.view})),{},{[J.viewId]:_},h?{[J.viewName]:h}:{}),{},{[J.viewUrl]:v,[J.viewUrlTemplate]:p,[J.viewLoadingType]:i,[J.viewPrevious]:y,[J.viewPreviousUrlTemplate]:m},b&&document.referrer?{[J.viewReferrer]:t.config.hooks.redactUrl(document.referrer)}:{}),startedAt:x,url:v,urlTemplate:p},o(n,`start`,x),l(n)},f=t.onViewCommand(e=>{if(e.type===`start`){d(e.options,`manual`,n?`route_change`:`initial_load`);return}if(n){if(e.type===`set_loading_time`){var r;(r=n.stopLoadingTime)==null||r.call(n),n.stopLoadingTime=void 0,c(n,Math.max(0,e.time-n.startedAt),`manual`);return}n.name!==e.name&&(n.name=e.name,n.snapshotAttributes[J.viewName]=e.name,t.setView({attributes:n.attributes,id:n.id,loadingType:n.loadingType,name:n.name,startedAt:n.startedAt,url:n.url,urlTemplate:n.urlTemplate}),o(n,`update`))}}),p=()=>{};t.config.view.tracking===`auto`&&(n||d({},`load`,`initial_load`),p=ul(e=>{yl(e.fromUrl,e.toUrl)&&d({},e.source,`route_change`,e.fromUrl)}));let m=e=>{if(e.persisted){r=s(`bfcache`);return}r=void 0,s(`pagehide`)},h=e=>{if(e.persisted&&t.config.view.tracking===`auto`){let e=r;if(r=void 0,!t.isSessionActive()){i=e;return}d(e?{attributes:e.attributes,name:e.name,url:e.rawUrl}:{},`bfCache`,`bf_cache`,e==null?void 0:e.rawUrl)}},g=t.onSessionLifecycle(e=>{if(e.type===`expired`){var t;i=(t=s(`session_expired`,!0,e.expiredAt))==null?r:t,r=void 0;return}i&&(d({attributes:i.attributes,name:i.name,url:i.rawUrl},`sessionRenewal`,`session_renewal`,i.rawUrl),i=void 0)});window.addEventListener(`pagehide`,m),window.addEventListener(`pageshow`,h),e.push(p,g,f,()=>window.removeEventListener(`pagehide`,m),()=>window.removeEventListener(`pageshow`,h),()=>s(`shutdown`))},shutdown(){for(;e.length;){var t;(t=e.pop())==null||t()}}}};G();var xl=5e3,Sl=e=>typeof e==`number`&&Number.isFinite(e)&&e>0,Cl=(e,t,n,r)=>({expiresAt:Math.min(t+n,t+r),id:e,startedAt:t,status:`active`}),wl=(e,t,n)=>{if(t>=e.startedAt+n)return`maxLifetime`;if(t>=e.expiresAt)return`inactivity`},Tl=(e,t,n,r)=>W(W({},e),{},{expiresAt:Math.min(t+n,e.startedAt+r)}),El=(e,t,n)=>{if(!e)return null;try{let r=JSON.parse(e);if(r.status===`active`&&typeof r.id==`string`&&r.id.length>0&&Sl(r.startedAt)&&r.startedAt<=t+xl&&Sl(r.expiresAt)&&r.expiresAt>=r.startedAt&&r.expiresAt<=r.startedAt+n||r.status===`expired`&&typeof r.previousId==`string`&&r.previousId.length>0&&(r.reason===`inactivity`||r.reason===`maxLifetime`)&&Sl(r.expiredAt)&&r.expiredAt<=t+xl)return r}catch(e){}return null};G();var Dl=900*1e3,Ol=14400*1e3,kl=1e3,Al=6e4,jl=[`click`,`keydown`,`scroll`,`touchstart`],Ml=new Map,Nl=e=>{let t=typeof window<`u`,n=()=>{var n;if(t)try{return window.localStorage.getItem(e)}catch(e){t=!1}return(n=Ml.get(e))==null?null:n};return n(),{isLocalStorage:()=>t,read:n,write:n=>{let r=JSON.stringify(n);if(Ml.set(e,r),t)try{window.localStorage.setItem(e,r)}catch(e){t=!1}}}},Pl=(e,t)=>{let n=``;try{n=new URL(e).host}catch(t){n=e}return`bk_ot_session__${jc(`${t}\0${n||`default`}`)}`},Fl=(e,t,n,r)=>{let i=W(W(W({},e.config.hooks.getPageAttributes()),$({spanType:X.session})),{},{[J.sessionPhase]:t,[J.sessionHasReplay]:!1,[J.sessionId]:n,[J.sessionType]:`user`});e.startSpan(Q({attributes:i,spanType:X.session}),i,{contextTime:r,startTime:r}).end(r)},Il=(e={})=>{let t=[];return{name:`session`,init(n){var r;if(typeof window>`u`||typeof document>`u`){let e=Date.now(),t=q(`session`);n.setRuntimeAttributes({[J.sessionHasReplay]:!1,[J.sessionId]:t,[J.sessionType]:`user`},e);return}let i=(r=e.storageKey)==null?Pl(n.config.transport.endpoint,n.config.application.name):r,a=Nl(i),o=typeof performance<`u`&&Number.isFinite(performance.timeOrigin)?performance.timeOrigin:Date.now(),s,c,l=(e=Date.now())=>El(a.read(),e,Ol),u=()=>{c!==void 0&&(clearTimeout(c),c=void 0)},d=(e,t=Date.now())=>{let r=s;r&&(n.notifySessionLifecycle({expiredAt:t,id:r,reason:e,type:`expired`}),Fl(n,`end`,r,t),u(),s=void 0,n.setRuntimeAttributes({[J.sessionHasReplay]:void 0,[J.sessionId]:void 0,[J.sessionType]:void 0},t),n.flush())},f=()=>{let e=Date.now(),t=l(e);if(!t){d(`external`,e);return}if(t.status===`expired`){d(t.reason,t.expiredAt);return}if(t.id!==s){d(`external`,e);return}let n=wl(t,e,Ol);if(!n){p(t);return}let r={expiredAt:e,previousId:t.id,reason:n,status:`expired`};a.write(r),d(n,e)},p=e=>{u();let t=Math.min(e.expiresAt,e.startedAt+Ol);c=setTimeout(f,Math.max(0,t-Date.now()))},m=(e,t)=>{let r=e.id!==s;s=e.id,n.setRuntimeAttributes({[J.sessionHasReplay]:!1,[J.sessionId]:e.id,[J.sessionType]:`user`},Math.min(e.startedAt,o)),p(e),r&&t&&n.notifySessionLifecycle({id:e.id,previousId:t.previousId,reason:t.reason,startedAt:e.startedAt,type:`renewed`})},h=(e=!1)=>{let t=Date.now(),r=l(t);if((r==null?void 0:r.status)===`active`&&!wl(r,t,Ol)){let e=Tl(r,t,Dl,Ol);a.write(e),m(e,s?void 0:{reason:`shared`});return}let i=(r==null?void 0:r.status)===`expired`?r.previousId:r==null?void 0:r.id,o=(r==null?void 0:r.status)===`expired`?r.reason:r?wl(r,t,Ol):e?`init`:void 0,c=Cl(q(`session`),t,Dl,Ol);a.write(c),m(c,{previousId:i,reason:o==null?`init`:o}),Fl(n,(o==null?`init`:o)===`init`?`start`:`rotate`,c.id,c.startedAt)},g=()=>{if(!s)return;let e=Date.now(),t=l(e);if((t==null?void 0:t.status)!==`active`||t.id!==s||wl(t,e,Ol)){f();return}let n=Tl(t,e,Dl,Ol);a.write(n),m(n)};h(!0);let _=0,v=()=>{let e=Date.now();e-_<kl||(_=e,h())},y={capture:!0,passive:!0};jl.forEach(e=>window.addEventListener(e,v,y)),t.push(()=>{jl.forEach(e=>window.removeEventListener(e,v,y))});let b=()=>{document.visibilityState===`visible`&&g()};document.addEventListener(`visibilitychange`,b);let x=window.setInterval(b,Al);t.push(()=>{document.removeEventListener(`visibilitychange`,b),window.clearInterval(x)});let S=e=>{if(!a.isLocalStorage()||e.storageArea!==window.localStorage||e.key!==i)return;let t=Date.now(),n=El(e.newValue,t,Ol);if((n==null?void 0:n.status)===`active`&&n.id===s&&!wl(n,t,Ol)){p(n);return}d((n==null?void 0:n.status)===`expired`?n.reason:`external`,(n==null?void 0:n.status)===`expired`?n.expiredAt:t)};window.addEventListener(`storage`,S),t.push(()=>window.removeEventListener(`storage`,S)),t.push(u)},shutdown(){for(var e;t.length;)(e=t.pop())==null||e()}}},Ll=n({CLSThresholds:()=>cu,FCPThresholds:()=>ou,INPThresholds:()=>Su,LCPThresholds:()=>Tu,TTFBThresholds:()=>Du,onCLS:()=>uu,onFCP:()=>du,onINP:()=>Cu,onLCP:()=>Eu,onTTFB:()=>ku});function Rl(e,t){return Wl.get(e)||Wl.set(e,new t),Wl.get(e)}var zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au=t((()=>{I(),G(),zl=class{constructor(){F(this,`t`,void 0),F(this,`o`,0),F(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)}},Bl=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Vl=e=>{if(document.readyState===`loading`)return`loading`;let t=Bl();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`},Hl=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},Ul=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[Hl(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},Wl=new WeakMap,Gl=-1,Kl=()=>Gl,ql=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(Gl=t.timeStamp,e(t))},!0)},Jl=(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)))}},Yl=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Xl=()=>{var e,t;return(e=(t=Bl())==null?void 0:t.activationStart)==null?0:e},Zl=(e,t=-1)=>{let n=Bl(),r=`navigate`;return Kl()>=0?r=`back-forward-cache`:n&&(document.prerendering||Xl()>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}},Ql=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(W({type:e,buffered:!0},n)),r}}catch(e){}},$l=e=>{let t=!1;return()=>{t||(e(),t=!0)}},eu=-1,tu=new Set,nu=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,ru=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of tu)e();isFinite(eu)||(eu=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,ru,!0))}},iu=()=>{if(eu<0){var e;let t=Xl(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;eu=n==null?nu():n,addEventListener(`visibilitychange`,ru,!0),addEventListener(`prerenderingchange`,ru,!0),ql(()=>{setTimeout(()=>{eu=nu()})})}return{get firstHiddenTime(){return eu},onHidden(e){tu.add(e)}}},au=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},ou=[1800,3e3],su=(e,t={})=>{au(()=>{let n=iu(),r,i=Zl(`FCP`),a=Ql(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Xl(),0),i.entries.push(t),r(!0)))});a&&(r=Jl(e,i,ou,t.reportAllChanges),ql(n=>{i=Zl(`FCP`),r=Jl(e,i,ou,t.reportAllChanges),Yl(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},cu=[.1,.25],lu=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],uu=(e,t={})=>{let n=Rl(t=Object.assign({},t),zl),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=lu(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?Ul(o):i;r.set(n,e)}}},((e,t={})=>{let n=iu();su($l(()=>{let r,i=Zl(`CLS`,0),a=Rl(t,zl),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=Ql(`layout-shift`,o);s&&(r=Jl(e,i,cu,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),ql(()=>{a.o=0,i=Zl(`CLS`,0),r=Jl(e,i,cu,t.reportAllChanges),Yl(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=lu(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:Vl(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},du=(e,t={})=>{su(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Vl(Kl())};if(e.entries.length){let n=Bl(),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:Vl(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},fu=0,pu=1/0,mu=0,hu=e=>{for(let t of e)t.interactionId&&(pu=Math.min(pu,t.interactionId),mu=Math.max(mu,t.interactionId),fu=mu?(mu-pu)/7+1:0)},_u=()=>{var e;return gu?fu:(e=performance.interactionCount)==null?0:e},vu=()=>{`interactionCount`in performance||gu||(gu=Ql(`event`,hu,{durationThreshold:0}))},yu=0,bu=class{constructor(){F(this,`l`,[]),F(this,`h`,new Map),F(this,`m`,void 0),F(this,`p`,void 0)}v(){yu=_u(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((_u()-yu)/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)}}},xu=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=$l(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},Su=[200,500],Cu=(e,t={})=>{let n=Rl(t=Object.assign({},t),bu),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(xu(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?Ul(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:Vl(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})};Ql(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=iu();au(()=>{var r;vu();let i,a=Zl(`INP`),o=Rl(t,bu),s=e=>{xu(()=>{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=Ql(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=Jl(e,a,Su,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),ql(()=>{o.v(),a=Zl(`INP`),i=Jl(e,a,Su,t.reportAllChanges)}))})})(t=>{e(f(t))},t)},wu=class{constructor(){F(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}},Tu=[2500,4e3],Eu=(e,t={})=>{let n=Rl(t=Object.assign({},t),wu),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?Ul(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{au(()=>{let n=iu(),r,i=Zl(`LCP`),a=Rl(t,wu),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-Xl(),0),i.entries=[t],r())},s=Ql(`largest-contentful-paint`,o);if(s){r=Jl(e,i,Tu,t.reportAllChanges);let n=$l(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(xu(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});ql(n=>{i=Zl(`LCP`),r=Jl(e,i,Tu,t.reportAllChanges),Yl(()=>{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=Bl();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=W(W({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},Du=[800,1800],Ou=e=>{document.prerendering?au(()=>Ou(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Ou(e),!0)},ku=(e,t={})=>{((e,t={})=>{let n=Zl(`TTFB`),r=Jl(e,n,Du,t.reportAllChanges);Ou(()=>{let i=Bl();i&&(n.value=Math.max(i.responseStart-Xl(),0),n.entries=[i],r(!0),ql(()=>{n=Zl(`TTFB`,0),r=Jl(e,n,Du,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)}}));G();var ju=10,Mu=6e4,Nu=5e3,Pu=1e3,Fu=(e,t)=>!!t&&e===t,Iu=(e,t)=>{let[n,r]=e===`CLS`?[.1,.25]:[200,500];return t<=n?`good`:t<=r?`needs-improvement`:`poor`},Lu=e=>{var t,n,r;if(!(typeof Element>`u`||!(e instanceof Element)))return(t=(n=(r=e.getAttribute(`data-bk-action-name`))==null?e.getAttribute(`aria-label`):r)==null?e.getAttribute(`name`):n)==null?e.tagName.toLowerCase():t},Ru=()=>{if(typeof performance>`u`)return;let e=performance.interactionCount;return typeof e==`number`&&Number.isFinite(e)?e:void 0},zu=(e,t)=>{var n,r;let i=(n=t.value)==null?0:n;t.hadRecentInput||!Number.isFinite(i)||(e.clsWindowStart===void 0||t.startTime-((r=e.clsWindowEnd)==null?t.startTime:r)>=Pu||t.startTime-e.clsWindowStart>=Nu?(e.clsWindowStart=t.startTime,e.clsWindowValue=i):e.clsWindowValue+=i,e.clsWindowEnd=t.startTime,e.clsWindowValue>e.cls&&(e.cls=Math.round(e.clsWindowValue*1e4)/1e4))},Bu=(e,t)=>{var n,r;if(!t.interactionId||!Number.isFinite(t.duration))return;e.interactionIdMin=Math.min(e.interactionIdMin,t.interactionId),e.interactionIdMax=Math.max(e.interactionIdMax,t.interactionId);let i=(n=t.processingStart)==null?t.startTime:n,a=(r=t.processingEnd)==null?i:r,o={duration:Math.min(t.duration,Mu),inputDelay:Math.max(0,i-t.startTime),interactionId:t.interactionId,interactionTarget:Lu(t.target),interactionType:t.name,presentationDelay:Math.max(0,t.startTime+t.duration-a),processingDuration:Math.max(0,a-i)},s=e.inpCandidates.findIndex(e=>e.interactionId===t.interactionId);s>=0?o.duration>e.inpCandidates[s].duration&&(e.inpCandidates[s]=o):e.inpCandidates.push(o),e.inpCandidates.sort((e,t)=>t.duration-e.duration).splice(ju)},Vu=e=>{let t=Ru(),n=t!==void 0&&e.interactionCountAtStart!==void 0?Math.max(0,t-e.interactionCountAtStart):e.interactionIdMin===1/0?0:(e.interactionIdMax-e.interactionIdMin)/7+1;if(e.inpCandidates.length)return e.inpCandidates[Math.min(e.inpCandidates.length-1,Math.floor(n/50))]},Hu=(e,t)=>{var n;let r=(n=e.attribution)==null?{}:n,i={},a=e=>r[e],o=(e,t,n)=>{t!=null&&(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)&&(i[e]=typeof t==`string`&&n?n(t):t)};switch(e.name){case`LCP`:o(`vital.lcp.url`,a(`url`),t),o(`vital.lcp.target`,a(`target`)),o(`vital.lcp.element_render_delay`,a(`elementRenderDelay`)),o(`vital.lcp.resource_load_duration`,a(`resourceLoadDuration`));break;case`CLS`:o(`vital.cls.load_state`,a(`loadState`));break;case`INP`:o(`vital.inp.interaction_target`,a(`interactionTarget`)),o(`vital.inp.interaction_type`,a(`interactionType`)),o(`vital.inp.input_delay`,a(`inputDelay`)),o(`vital.inp.processing_duration`,a(`processingDuration`)),o(`vital.inp.presentation_delay`,a(`presentationDelay`));break;case`TTFB`:o(`vital.ttfb.waiting_duration`,a(`waitingDuration`)),o(`vital.ttfb.dns_duration`,a(`dnsDuration`)),o(`vital.ttfb.connection_duration`,a(`connectionDuration`)),o(`vital.ttfb.request_duration`,a(`requestDuration`));break;default:break}return i},Uu=()=>{let e,t=!1;return{name:`web-vitals`,init(n){return U(function*(){if(typeof window>`u`)return;let r;try{r=yield Promise.resolve().then(()=>(Au(),Ll))}catch(e){if(n.config.debug){var i;(i=globalThis.console)==null||i.warn(`[bk-ot] web-vitals load failed:`,e)}return}if(t)return;let{onFCP:a,onLCP:o,onTTFB:s}=r,c=(e,t,r,i=r==null?Date.now():r)=>{if(!n.isSampled())return;let a=e.name.toLowerCase(),o=W(W(W(W({},n.config.hooks.getPageAttributes()),t),$({outcome:No(e.rating),spanType:X.vital})),{},{[J.vitalMetric]:a,[J.vitalValue]:e.value,"vital.id":e.id},Hu(e,n.config.hooks.redactUrl));n.startSpan(Q({attributes:o,spanType:X.vital}),o,{contextTime:r,startTime:i}).end(i)},l=e=>{if(t||!Number.isFinite(e.value)||!n.isSampled())return;let r=e.entries[0],i=r&&typeof performance<`u`?performance.timeOrigin+r.startTime:void 0;c(e,i===void 0?n.getRuntimeAttributes():n.getRuntimeAttributesAt(i),i)},u,d,f,p=(e,t,n)=>{c(e,t,n,Date.now())},m=()=>{let e=u;if(!e||!n.isSampled())return;p({attribution:{},entries:[],id:q(`vital`),name:`CLS`,rating:Iu(`CLS`,e.cls),value:e.cls},e.runtimeAttributes,e.startedAt);let t=Vu(e);t&&p({attribution:{inputDelay:t.inputDelay,interactionTarget:t.interactionTarget,interactionType:t.interactionType,presentationDelay:t.presentationDelay,processingDuration:t.processingDuration},entries:[],id:q(`vital`),name:`INP`,rating:Iu(`INP`,t.duration),value:t.duration},e.runtimeAttributes,e.startedAt)},h=n.onViewChange(e=>{var t;let r=u;if(r&&Fu(r.id,e.id)){r.runtimeAttributes=W(W(W({},r.runtimeAttributes),{},{[J.viewId]:e.id},e.name?{[J.viewName]:e.name}:{}),{},{[J.viewUrl]:e.url,[J.viewUrlTemplate]:e.urlTemplate});return}m(),u=e.id?{cls:0,clsWindowValue:0,interactionCountAtStart:Ru(),interactionIdMax:0,interactionIdMin:1/0,inpCandidates:[],id:e.id,runtimeAttributes:n.getRuntimeAttributes(),startedAt:(t=e.startedAt)==null?Date.now():t}:void 0});if(typeof PerformanceObserver<`u`){var g,_;(g=PerformanceObserver.supportedEntryTypes)!=null&&g.includes(`layout-shift`)&&(f=new PerformanceObserver(e=>{if(u)for(let t of e.getEntries())performance.timeOrigin+t.startTime<u.startedAt||zu(u,t)}),f.observe({buffered:!0,type:`layout-shift`})),(_=PerformanceObserver.supportedEntryTypes)!=null&&_.includes(`event`)&&(d=new PerformanceObserver(e=>{if(u)for(let t of e.getEntries())performance.timeOrigin+t.startTime<u.startedAt||!t.interactionId||!Number.isFinite(t.duration)||Bu(u,t)}),d.observe({buffered:!0,durationThreshold:40,type:`event`}))}a(l),o(l),s(l),e=()=>{m(),u=void 0,h(),f==null||f.disconnect(),d==null||d.disconnect()}})()},shutdown(){t=!0,e==null||e(),e=void 0}}};G();var Wu=(e,t)=>{let n={"network.protocol.name":`websocket`,"url.full":t(e)};try{let t=new URL(e,typeof location>`u`?`http://localhost`:location.href);n[`server.address`]=t.hostname,t.port&&(n[`server.port`]=Number(t.port)),n[`url.scheme`]=t.protocol.replace(`:`,``)}catch(e){}return n},Gu=(e,t,n,r)=>{let i=q(`websocket`),a=Wu(n,t.config.hooks.redactUrl),o=!1,s=(e,n,o={})=>{if(r()||!t.isSampled())return;let s=e===`error`,c=W(W(W({},a),$({outcome:s?Y.error:Y.success,spanType:X.websocket})),{},{[J.websocketPhase]:e,"websocket.connection.id":i},o);t.startSpan(Q({attributes:c,spanType:X.websocket}),c,{kind:Ve.CLIENT,startTime:n}).end(n)};s(`connect`,Date.now()),e.addEventListener(`open`,()=>{o=!0,s(`open`,Date.now())}),e.addEventListener(`error`,()=>{s(`error`,Date.now(),{"websocket.error.phase":o?`runtime`:`connect`})}),e.addEventListener(`close`,e=>{s(`close`,Date.now(),{"websocket.close.code":e.code,"websocket.close.reason":e.reason,"websocket.close.was_clean":e.wasClean})})},Ku=()=>{let e,t,n=!1;return{name:`websocket`,init(r){if(typeof window>`u`||window.WebSocket===void 0)return;let i=window.WebSocket;e=i,t=new Proxy(i,{construct(e,t,i){let a=Reflect.construct(e,t,i);if(n||!r.isSampled())return a;let o=t[0]==null?``:String(t[0]);return o&&!Eo(r.config,o)&&Gu(a,r,o,()=>n),a}}),window.WebSocket=t},shutdown(){n=!0,typeof window<`u`&&e&&window.WebSocket===t&&(window.WebSocket=e),t=void 0,e=void 0}}};I();var qu=class{constructor(){F(this,`listeners`,new Set),F(this,`notify`,e=>{this.listeners.forEach(t=>t(e))}),F(this,`subscribe`,e=>(this.listeners.add(e),()=>this.listeners.delete(e)))}},Ju=`0.0.33`;G();var Yu=e=>e.trim().replace(/\/+$/,``),Xu=e=>{var t;let n=e.token||e.headers?W(W({},e.token?{Authorization:`Bearer ${e.token}`}:{}),(t=e.headers)==null?{}:t):void 0;return{concurrencyLimit:e.concurrencyLimit,endpoint:`${Yu(e.endpoint)}/v1/rum`,headers:n,timeoutMillis:e.timeoutMillis}},Zu=e=>typeof e!=`number`||!Number.isFinite(e)?1:Math.max(0,Math.min(1,e)),Qu=e=>e,$u=e=>{if(!e)return e;try{let t=new URL(e,typeof location>`u`?`http://localhost`:location.href);return t.username=``,t.password=``,t.search=``,t.hash=``,t.href}catch(t){return e.replace(/[?#].*$/,``)}},ed=e=>{try{return new URL(e,typeof location>`u`?`http://localhost`:location.href).pathname||`/`}catch(t){return e||`/`}},td=e=>So(ed(e)),nd=(e,t)=>n=>{try{let e=t==null?void 0:t(n);if(e)return e}catch(t){var r;e.debug&&((r=globalThis.console)==null||r.warn(`[bk-ot] url template hook failed:`,t))}return td(n)},rd=e=>{var t;return{environment:(t=e.environment)==null?`production`:t,name:e.name,version:e.version}},id=(e,t,n)=>W(W(W({[J.deploymentEnvironmentName]:e.environment},t===!1?{}:Vc()),{},{[J.serviceName]:e.name},e.version?{[J.serviceVersion]:e.version}:{}),{},{[J.sessionSampleRate]:n,"telemetry.sdk.language":`webjs`,"telemetry.sdk.name":`blueking`,"telemetry.sdk.version":Ju}),ad=e=>{var t;if(!e)throw Error(`[bk-ot] transport is required.`);if(!((t=e.endpoint)!=null&&t.trim()))throw Error(`[bk-ot] transport.endpoint is required.`)},od=e=>{var t,n,r,i,a,o,s,c,l,u,d,f,p;return{beforeSend:(t=e.tracking)==null?void 0:t.beforeSend,getPageAttributes:(n=(r=e.context)==null||(r=r.attributes)==null?void 0:r.page)==null?(()=>({})):n,getErrorAttributes:(i=(a=e.context)==null||(a=a.attributes)==null?void 0:a.error)==null?(()=>({})):i,getCustomAttributes:(o=(s=e.context)==null||(s=s.attributes)==null?void 0:s.custom)==null?(()=>({})):o,getRequestUrlTemplate:nd(e,typeof((c=e.tracking)==null?void 0:c.request)==`object`?e.tracking.request.getUrlTemplate:void 0),getViewUrlTemplate:nd(e,typeof((l=e.tracking)==null?void 0:l.view)==`object`?e.tracking.view.getUrlTemplate:void 0),redactAttributes:(u=(d=e.privacy)==null?void 0:d.redactAttributes)==null?Qu:u,redactUrl:(f=(p=e.privacy)==null?void 0:p.redactUrl)==null?$u:f}},sd=e=>{var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;if(!(!((t=e.application)==null||(t=t.name)==null)&&t.trim()))throw Error(`[bk-ot] application.name is required.`);ad(e.transport);let _=rd(e.application),v=typeof((n=e.tracking)==null?void 0:n.view)==`object`?e.tracking.view:void 0,y=od(e),b=Zu((r=e.session)==null?void 0:r.sampleRate);return{application:_,autoStart:(i=e.autoStart)==null?!0:i,debug:(a=e.debug)==null?!1:a,enabled:(o=e.enabled)==null?!0:o,extensions:{instrumentations:[...(s=(c=e.extensions)==null?void 0:c.instrumentations)==null?[]:s],plugins:[...(l=(u=e.extensions)==null?void 0:u.plugins)==null?[]:l]},hooks:y,resourceAttributes:y.redactAttributes(id(_,(d=e.tracking)==null?void 0:d.device,b)),session:W(W({},e.session),{},{sampleRate:b}),spanBatch:e.transport.batch,spanProcessor:(f=e.transport.processor)==null?`batch`:f,tracking:(p=e.tracking)==null?{}:p,trackingConsent:(m=(h=e.privacy)==null?void 0:h.trackingConsent)==null?`granted`:m,transport:Xu(e.transport),user:(g=e.context)==null?void 0:g.user,view:{excludedActivityUrls:v==null?void 0:v.excludedActivityUrls,loadingTime:(v==null?void 0:v.loadingTime)!==!1,tracking:(v==null?void 0:v.tracking)===`manual`?`manual`:`auto`}}};I();var cd=(e,t)=>typeof e.enabled==`function`?e.enabled(t):e.enabled!==!1,ld=class{constructor(e){F(this,`plugins`,void 0),F(this,`startedPlugins`,[]),this.plugins=e}flush(){var e=this;return U(function*(){yield Promise.all(e.startedPlugins.map(e=>Promise.resolve().then(()=>{var t;return(t=e.flush)==null?void 0:t.call(e)})))})()}shutdown(){var e=this;return U(function*(){let t=[...e.startedPlugins].reverse();for(let e of t){var n;yield(n=e.shutdown)==null?void 0:n.call(e)}e.startedPlugins=[]})()}start(e){var t=this;return U(function*(){for(let r of t.plugins)if(cd(r,e.config))try{yield r.init(e),t.startedPlugins.push(r)}catch(t){if(e.config.debug){var n;(n=globalThis.console)==null||n.warn(`[bk-ot] plugin "${r.name}" init failed:`,t)}}})()}};I(),G();var ud=new Set(Object.values(J)),dd=e=>{if(typeof e==`string`&&e.length>0)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;--t){let n=e[t];if(typeof n==`string`&&n.length>0)return n}},fd=class{constructor(e={},t){F(this,`actionHistory`,[]),F(this,`attributes`,{}),F(this,`queuedViewCommands`,[]),F(this,`recordAssociation`,(e,t,n,r)=>{let i=e.at(-1);if(i&&i.endedAt===void 0&&(i.endedAt=Math.max(i.startedAt,n)),r){let r={};for(let e of t){let t=this.attributes[e];t!==void 0&&(r[e]=t)}e.push({attributes:r,startedAt:n})}e.length>100&&e.splice(0,e.length-100)}),F(this,`sessionHistory`,[]),F(this,`sampled`,!1),F(this,`samplingHistory`,[]),F(this,`sessionLifecycleListeners`,new Set),F(this,`setOptionalAttribute`,(e,t)=>{if(t===void 0){delete this.attributes[e];return}this.attributes[e]=t}),F(this,`user`,{}),F(this,`view`,{}),F(this,`viewAttributeKeys`,new Set),F(this,`viewChangeListeners`,new Set),F(this,`viewCommandListeners`,new Set),F(this,`viewHistory`,[]),F(this,`viewScopedAttributeKeys`,new Set),F(this,`dispatchViewCommand`,e=>{if(this.viewCommandListeners.size===0){this.queuedViewCommands.push(e);return}this.viewCommandListeners.forEach(t=>t(e))}),F(this,`getAttributes`,()=>W({},this.attributes)),F(this,`getAttributesAt`,e=>{if(!Number.isFinite(e))return this.getAttributes();let t=this.getAttributes(),n=(n,r)=>{for(let e of r)delete t[e];let i=[...n].reverse().find(t=>t.startedAt<=e&&(t.endedAt===void 0||e<t.endedAt));i&&Object.assign(t,i.attributes)};return n(this.sessionHistory,[J.sessionId,J.sessionHasReplay]),n(this.viewHistory,this.viewScopedAttributeKeys),n(this.actionHistory,[J.actionId]),t}),F(this,`getUser`,()=>W({},this.user)),F(this,`getView`,()=>W({},this.view)),F(this,`isSessionActive`,()=>typeof this.attributes[J.sessionId]==`string`),F(this,`isSessionSampledAt`,e=>{var t,n;return Number.isFinite(e)?(t=(n=[...this.samplingHistory].reverse().find(t=>t.startedAt<=e&&(t.endedAt===void 0||e<t.endedAt)))==null?void 0:n.sampled)==null?!1:t:this.sampled}),F(this,`isViewActive`,()=>typeof this.attributes[J.viewId]==`string`),F(this,`notifySessionLifecycle`,e=>{this.sessionLifecycleListeners.forEach(t=>t(e))}),F(this,`onSessionLifecycle`,e=>(this.sessionLifecycleListeners.add(e),()=>this.sessionLifecycleListeners.delete(e))),F(this,`onViewChange`,e=>(this.viewChangeListeners.add(e),this.view.id&&e(this.getView()),()=>this.viewChangeListeners.delete(e))),F(this,`onViewCommand`,e=>{for(this.viewCommandListeners.add(e);this.queuedViewCommands.length;)e(this.queuedViewCommands.shift());return()=>this.viewCommandListeners.delete(e)}),F(this,`setAttributes`,(e,t=Date.now())=>{for(let[t,n]of Object.entries(e)){if(n===void 0){delete this.attributes[t];continue}this.attributes[t]=n}if(J.sessionId in e&&this.recordAssociation(this.sessionHistory,[J.sessionId,J.sessionHasReplay],t,typeof this.attributes[J.sessionId]==`string`),J.actionId in e){let e=dd(this.attributes[J.actionId]);e===void 0?delete this.attributes[J.actionId]:this.attributes[J.actionId]=e,this.recordAssociation(this.actionHistory,[J.actionId],t,typeof this.attributes[J.actionId]==`string`)}}),F(this,`setUser`,e=>{if(this.user=W(W({},this.user),e),`id`in e){if(e.id===void 0){delete this.attributes[J.userId];return}this.attributes[J.userId]=e.id}}),F(this,`setSessionSampled`,(e,t=Date.now())=>{if(e===this.sampled)return;let n=this.samplingHistory.at(-1);n&&n.endedAt===void 0&&(n.endedAt=Math.max(n.startedAt,t)),this.sampled=e,e&&this.samplingHistory.push({sampled:e,startedAt:t}),this.samplingHistory.length>100&&this.samplingHistory.splice(0,this.samplingHistory.length-100)}),F(this,`setView`,(e,t=(t=>(t=e.startedAt)==null?Date.now():t)())=>{var n;this.viewAttributeKeys.forEach(e=>delete this.attributes[e]),this.viewAttributeKeys.clear();let r={};for(let[t,i]of Object.entries((n=e.attributes)==null?{}:n))i===void 0||ud.has(t)||(r[t]=i,this.attributes[t]=i,this.viewAttributeKeys.add(t),this.viewScopedAttributeKeys.add(t));this.view=W(W({},e),{},{attributes:r}),this.setOptionalAttribute(J.viewId,e.id),this.setOptionalAttribute(J.viewUrl,e.url),this.setOptionalAttribute(J.viewUrlTemplate,e.urlTemplate),this.setOptionalAttribute(J.viewLoadingType,e.loadingType),this.setOptionalAttribute(J.viewName,e.name),[J.viewId,J.viewUrl,J.viewUrlTemplate,J.viewLoadingType,J.viewName].forEach(e=>this.viewScopedAttributeKeys.add(e)),this.recordAssociation(this.viewHistory,this.viewScopedAttributeKeys,t,typeof e.id==`string`&&e.id.length>0),this.viewChangeListeners.forEach(e=>e(this.getView()))}),this.setAttributes(e),t&&this.setUser(t)}},pd=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t=Math.imul(t^e.charCodeAt(n),16777619);return t+=t<<13,t^=t>>>7,t+=t<<3,t^=t>>>17,t+=t<<5,(t>>>0)/4294967296},md=({application:e,session:t},n)=>t.sampleRate<=0?!1:t.sampleRate>=1?!0:pd(`${e.name}\0${n}`)<t.sampleRate;I(),G();var hd=e=>({url:e.endpoint,headers:e.headers,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis}),gd=`bk-rum`,_d=class{constructor(e){this.isSampled=e}shouldSample(){return{decision:this.isSampled()?K.RECORD_AND_SAMPLED:K.NOT_RECORD}}toString(){return`RumSessionSampler`}},vd,yd=()=>{if(vd)vd.users+=1;else{let e=new lt().enable(),t=Ue.setGlobalContextManager(e);t||e.disable(),vd={contextManager:t?e:void 0,ownsContext:t,ownsPropagator:Qe.setGlobalPropagator(new Rr),users:1}}let e=!1;return()=>{e||!vd||(e=!0,--vd.users,!(vd.users>0)&&(vd.ownsContext&&Ue.disable(),vd.ownsPropagator&&Qe.disable(),vd=void 0))}},bd=(e,t)=>t?new Proxy(e,{get(e,t,n){if(t===`export`)return(t,n)=>{var r;return(r=globalThis.console)==null||r.log(`[bk-ot][rum]`,t),e.export(t,n)};let r=Reflect.get(e,t,n);return typeof r==`function`?r.bind(e):r}}):e,xd=e=>[Dc(e.tracking.request)],Sd=e=>[Il(e.session),...Td(e.tracking.device,!0,Uc),ns(),bl(),lc(Cd(e.tracking.resource,!0))],Cd=(e,t)=>e===void 0?t:e!==!1,wd=e=>typeof e==`object`&&e?e:void 0,Td=(e,t,n)=>Cd(e,t)?[n(wd(e))]:[],Ed=e=>[...Td(e.error,!0,Kc),...Td(e.webVitals,!0,Uu),...Td(e.blankScreen,!0,_s),...Td(e.action,!0,es),...Td(e.websocket,!1,Ku),...Td(e.longTask,!1,Qc),...Td(e.cspViolation,!1,Ac)],Dd=class{assertBeforeStart(e){if(this.phase!==`idle`)throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`)}createPluginContext(){return{applyRedact:this.applyRedact,config:this.config,flush:this.flush,getRuntimeAttributes:this.getRuntimeAttributes,getRuntimeAttributesAt:this.getRuntimeAttributesAt,isSampled:this.isSampled,isSessionActive:this.isSessionActive,isViewActive:this.isViewActive,notifySessionLifecycle:this.notifySessionLifecycle,notifyActivity:this.activityObserver.notify,onActivity:this.activityObserver.subscribe,onSessionLifecycle:this.onSessionLifecycle,onViewCommand:this.runtimeContext.onViewCommand,onViewChange:this.runtimeContext.onViewChange,registerInstrumentations:this.registerInstrumentations,setRuntimeAttributes:this.setRuntimeAttributes,setUser:this.setUser,setView:this.runtimeContext.setView,startSpan:this.startSpan,tracer:this.tracer}}createPluginManager(){var e;return new ld([...Sd(this.config),...xd(this.config),...Ed(this.config.tracking),...(e=this.config.extensions.plugins)==null?[]:e])}constructor(e){var t=this;F(this,`activityObserver`,new qu),F(this,`flushProviders`,U(function*(){yield t.tracerProvider.forceFlush()})),F(this,`phase`,`idle`),F(this,`pluginManager`,void 0),F(this,`registeredInstrumentations`,void 0),F(this,`releaseOtelGlobals`,void 0),F(this,`runtimeContext`,void 0),F(this,`sampled`,!1),F(this,`startCollection`,U(function*(){if(t.pluginManager||!t.config.enabled||t.config.trackingConsent!==`granted`)return;t.releaseOtelGlobals=yd();let e=t.createPluginManager();t.pluginManager=e;try{var n;yield e.start(t.createPluginContext()),t.registerInstrumentations((n=t.config.extensions.instrumentations)==null?[]:n)}catch(n){var r,i,a;for(yield e.shutdown(),t.pluginManager=void 0;t.registeredInstrumentations.length;)(r=t.registeredInstrumentations.pop())==null||(i=r.disable)==null||i.call(r);throw(a=t.releaseOtelGlobals)==null||a.call(t),t.releaseOtelGlobals=void 0,n}})),F(this,`stopCollection`,function(){var e=U(function*(e){var n,r,i;let a=t.pluginManager;if(a){for(yield a.shutdown(),t.pluginManager=void 0;t.registeredInstrumentations.length;)(n=t.registeredInstrumentations.pop())==null||(r=n.disable)==null||r.call(n);t.setRuntimeAttributes({[J.sessionHasReplay]:void 0,[J.sessionId]:void 0}),e&&(yield t.flushProviders()),(i=t.releaseOtelGlobals)==null||i.call(t),t.releaseOtelGlobals=void 0}});return function(t){return e.apply(this,arguments)}}()),F(this,`teardownCallbacks`,[]),F(this,`tracerProvider`,void 0),F(this,`applyRedact`,e=>this.config.hooks.redactAttributes(e)),F(this,`config`,void 0),F(this,`flush`,U(function*(){var e;yield(e=t.pluginManager)==null?void 0:e.flush(),yield t.flushProviders()})),F(this,`getRuntimeAttributes`,()=>this.runtimeContext.getAttributes()),F(this,`getRuntimeAttributesAt`,e=>this.runtimeContext.getAttributesAt(e)),F(this,`isSampled`,()=>this.sampled),F(this,`isSessionActive`,()=>this.runtimeContext.isSessionActive()),F(this,`isViewActive`,()=>this.runtimeContext.isViewActive()),F(this,`notifySessionLifecycle`,e=>{this.runtimeContext.notifySessionLifecycle(e)}),F(this,`onSessionLifecycle`,e=>this.runtimeContext.onSessionLifecycle(e)),F(this,`registerInstrumentations`,e=>{e.length&&(e.forEach(e=>{e.setTracerProvider(this.tracerProvider),e.getConfig().enabled||e.enable()}),this.registeredInstrumentations.push(...e))}),F(this,`reportAction`,({attributes:e={},name:t})=>{if(!this.isSampled())return;let n=q(`action`),r=Date.now(),i=W(W(W(W({},this.config.hooks.getPageAttributes()),e),$({spanType:X.action})),{},{[J.actionId]:n,[J.actionName]:t,[J.actionType]:`custom`});this.startSpan(Q({attributes:i,spanType:X.action}),i,{rumSpanType:X.action,startTime:r}).end(r)}),F(this,`reportCustomEvent`,({attributes:e={},error:t,name:n})=>{if(!this.isSampled()){if(this.config.debug){var r;(r=globalThis.console)==null||r.warn(`[bk-ot] custom event dropped (not sampled):`,n)}return}let i=Date.now(),a=W(W(W(W({},this.config.hooks.getPageAttributes()),this.config.hooks.getCustomAttributes()),e),$({outcome:t?Y.error:Y.success,spanType:X.custom})),o=this.startSpan(Q({attributes:a,nameHint:n,spanType:X.custom}),a,{startTime:i});t&&(o.recordException(t),o.setStatus({code:He.ERROR,message:t.message})),o.end(i)}),F(this,`setRuntimeAttributes`,(e,t)=>{let n=W({},e),r=t==null?Date.now():t;if(J.sessionId in e){let t=e[J.sessionId];this.sampled=this.config.enabled&&typeof t==`string`&&t.length>0?md(this.config,t):!1,this.runtimeContext.setSessionSampled(this.sampled,r)}this.runtimeContext.setAttributes(n,r)}),F(this,`setTrackingConsent`,function(){var e=U(function*(e){t.config.trackingConsent!==e&&(t.config.trackingConsent=e,t.phase===`started`&&(e===`granted`?yield t.startCollection():yield t.stopCollection(!0)))});return function(t){return e.apply(this,arguments)}}()),F(this,`setUser`,e=>{this.runtimeContext.setUser(e)}),F(this,`setViewLoadingTime`,()=>{this.isSampled()&&this.runtimeContext.dispatchViewCommand({time:Date.now(),type:`set_loading_time`})}),F(this,`setViewName`,e=>{this.isSampled()&&this.runtimeContext.dispatchViewCommand({name:e,type:`set_name`})}),F(this,`shutdown`,U(function*(){if(t.phase!==`stopped`){for(yield t.stopCollection(!1),yield t.flushProviders();t.teardownCallbacks.length;){var e;(e=t.teardownCallbacks.pop())==null||e()}yield t.tracerProvider.shutdown(),t.phase=`stopped`}})),F(this,`start`,U(function*(){if(!(t.phase===`started`||t.phase===`starting`)){if(t.phase===`stopped`)throw Error(`[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.`);if(!t.config.enabled){t.phase=`started`;return}t.phase=`starting`;try{if(yield t.startCollection(),typeof window<`u`&&typeof document<`u`){let e=()=>{t.flush()},n=()=>{document.visibilityState===`hidden`&&t.flush()};window.addEventListener(`pagehide`,e),document.addEventListener(`visibilitychange`,n),t.teardownCallbacks.push(()=>window.removeEventListener(`pagehide`,e),()=>document.removeEventListener(`visibilitychange`,n))}}catch(n){for(;t.teardownCallbacks.length;){var e;(e=t.teardownCallbacks.pop())==null||e()}throw yield t.stopCollection(!1),t.phase=`idle`,n}t.phase=`started`}})),F(this,`startSpan`,(e,t={},n)=>{var r,i;let a=(r=n==null?void 0:n.contextTime)==null?typeof(n==null?void 0:n.startTime)==`number`?n.startTime:void 0:r;if(!this.isSampled()||a!==void 0&&!this.runtimeContext.isSessionSampledAt(a))return this.tracer.startSpan(e);let o=a===void 0?this.getRuntimeAttributes():this.runtimeContext.getAttributesAt(a),s=this.applyRedact(W(W({},o),t)),c=n!=null&&n.rumSpanType?Q({attributes:s,spanType:n.rumSpanType}):e;return this.tracer.startSpan(c,{kind:(i=n==null?void 0:n.kind)==null?Ve.INTERNAL:i,links:n==null?void 0:n.links,startTime:n==null?void 0:n.startTime,attributes:s})}),F(this,`startView`,(e={})=>{this.isSampled()&&this.runtimeContext.dispatchViewCommand({options:e,type:`start`})}),F(this,`tracer`,void 0),F(this,`use`,e=>{var t;return this.assertBeforeStart(`use`),(t=this.config.extensions.plugins)==null||t.push(e),this}),F(this,`useInstrumentation`,e=>{var t;return this.assertBeforeStart(`useInstrumentation`),this.config.enabled&&((t=this.config.extensions.instrumentations)==null||t.push(e)),this}),this.config=sd(e),this.runtimeContext=new fd({},this.config.user);let n=Ni(this.config.resourceAttributes),r=(()=>{let e=bd(new Aa(hd(this.config.transport)),this.config.debug);return[new Es(this.config.spanProcessor===`simple`?new mo(e):new Ka(e,this.config.spanBatch),this.config,()=>this.applyRedact(W(W({},this.runtimeContext.getAttributes()),this.config.hooks.getPageAttributes())))]})();this.tracerProvider=new vo({resource:n,sampler:new _d(this.isSampled),spanProcessors:r}),this.tracer=this.tracerProvider.getTracer(gd),this.registeredInstrumentations=[],this.config.autoStart&&this.start().catch(e=>{var t;(t=globalThis.console)==null||t.warn(`[bk-ot] auto start failed:`,e)})}};return typeof window<`u`&&Object.assign(window,{BkOpenTelemetry:Dd}),Dd})();
|