firebase 13.2.0-eap-sql.a9a137e67 → 13.2.0-eap-sql.b903ef716
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/app/dist/esm/index.esm.js +1 -1
- package/app/dist/index.cjs.js +1 -1
- package/app/dist/index.mjs +1 -1
- package/compat/app/dist/esm/index.esm.js +1 -1
- package/compat/app/dist/index.cjs.js +1 -1
- package/compat/app/dist/index.mjs +1 -1
- package/compat/dist/esm/index.esm.js +2 -2
- package/compat/dist/index.node.cjs +2 -2
- package/compat/dist/index.rn.cjs.js +2 -2
- package/firebase-ai.js +1 -1
- package/firebase-analytics-compat.js +1 -1
- package/firebase-analytics.js +1 -1
- package/firebase-app-check-compat.js +1 -1
- package/firebase-app-check.js +1 -1
- package/firebase-app-compat.js +2 -2
- package/firebase-app.js +5 -5
- package/firebase-auth-compat.js +1 -1
- package/firebase-auth-cordova.js +1 -1
- package/firebase-auth-web-extension.js +1 -1
- package/firebase-auth.js +1 -1
- package/firebase-compat.js +6 -6
- package/firebase-crashlytics.js +1 -1
- package/firebase-data-connect.js +1 -1
- package/firebase-database-compat.js +1 -1
- package/firebase-database.js +1 -1
- package/firebase-firestore-compat.js +2 -2
- package/firebase-firestore-lite-pipelines.js +1 -1
- package/firebase-firestore-lite.js +1 -1
- package/firebase-firestore-pipelines.js +1 -1
- package/firebase-firestore.js +1 -1
- package/firebase-functions-compat.js +1 -1
- package/firebase-functions.js +1 -1
- package/firebase-installations-compat.js +1 -1
- package/firebase-installations.js +1 -1
- package/firebase-messaging-compat.js +1 -1
- package/firebase-messaging-sw.js +1 -1
- package/firebase-messaging.js +1 -1
- package/firebase-performance-compat.js +1 -1
- package/firebase-performance-standalone-compat.js +7 -7
- package/firebase-performance.js +1 -1
- package/firebase-remote-config-compat.js +1 -1
- package/firebase-remote-config.js +1 -1
- package/firebase-sql.js +1 -1
- package/firebase-sql.js.map +1 -1
- package/firebase-storage-compat.js +1 -1
- package/firebase-storage.js +1 -1
- package/package.json +31 -31
package/firebase-crashlytics.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{registerVersion as _,_registerComponent as w,_getProvider,getApp as E}from"https://www.gstatic.com/firebasejs/13.2.0-eap-sql.a9a137e67/firebase-app.js";import*as C from"path";import P from"path";import R from"module";import L from"tty";import I from"worker_threads";import*as k from"fs";import{readFileSync as F}from"fs";import*as j from"zlib";import{Readable as $}from"stream";class FirebaseError extends Error{constructor(_,w,E){super(w),this.code=_,this.customData=E,this.name="FirebaseError",Object.setPrototypeOf(this,FirebaseError.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ErrorFactory.prototype.create)}}class ErrorFactory{constructor(_,w,E){this.service=_,this.serviceName=w,this.errors=E}create(_,...w){const E=w[0]||{},C=`${this.service}/${_}`,P=this.errors[_],R=P?function replaceTemplate(_,w){try{let E=0,C="";for(;E<_.length;){const P=_.indexOf("{$",E);if(-1===P){C+=_.substring(E);break}const R=_.indexOf("}",P+2);if(-1===R){C+=_.substring(E);break}const L=_.substring(P+2,R),I=w[L];C+=_.substring(E,P)+(null!=I?String(I):`<${L}?>`),E=R+1}return C}catch(w){return _}}(P,E):"Error",L=`${this.serviceName}: ${R} (${C}).`;return new FirebaseError(C,L,E)}}function deepEqual(_,w){if(_===w)return!0;const E=Object.keys(_),C=Object.keys(w);for(const P of E){if(!C.includes(P))return!1;const E=_[P],R=w[P];if(isObject$1(E)&&isObject$1(R)){if(!deepEqual(E,R))return!1}else if(E!==R)return!1}for(const _ of C)if(!E.includes(_))return!1;return!0}function isObject$1(_){return null!==_&&"object"==typeof _}class Component{constructor(_,w,E){this.name=_,this.instanceFactory=w,this.type=E,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(_){return this.instantiationMode=_,this}setMultipleInstances(_){return this.multipleInstances=_,this}setServiceProps(_){return this.serviceProps=_,this}setInstanceCreatedCallback(_){return this.onInstanceCreated=_,this}}var V,H,z;!function(_){_.LAZY="LAZY",_.EAGER="EAGER",_.EXPLICIT="EXPLICIT"}(V||(V={})),function(_){_.PUBLIC="PUBLIC",_.PRIVATE="PRIVATE",_.VERSION="VERSION"}(H||(H={})),function(_){_[_.UNSPECIFIED=0]="UNSPECIFIED",_[_.TRACE=1]="TRACE",_[_.TRACE2=2]="TRACE2",_[_.TRACE3=3]="TRACE3",_[_.TRACE4=4]="TRACE4",_[_.DEBUG=5]="DEBUG",_[_.DEBUG2=6]="DEBUG2",_[_.DEBUG3=7]="DEBUG3",_[_.DEBUG4=8]="DEBUG4",_[_.INFO=9]="INFO",_[_.INFO2=10]="INFO2",_[_.INFO3=11]="INFO3",_[_.INFO4=12]="INFO4",_[_.WARN=13]="WARN",_[_.WARN2=14]="WARN2",_[_.WARN3=15]="WARN3",_[_.WARN4=16]="WARN4",_[_.ERROR=17]="ERROR",_[_.ERROR2=18]="ERROR2",_[_.ERROR3=19]="ERROR3",_[_.ERROR4=20]="ERROR4",_[_.FATAL=21]="FATAL",_[_.FATAL2=22]="FATAL2",_[_.FATAL3=23]="FATAL3",_[_.FATAL4=24]="FATAL4"}(z||(z={}));class NoopLogger{emit(_){}enabled(){return!1}}const q=new NoopLogger;const G=Symbol.for("io.opentelemetry.js.api.logs"),K=globalThis;const Q=new class NoopLoggerProvider{getLogger(_,w,E){return new NoopLogger}};class ProxyLogger{constructor(_,w,E,C){this._provider=_,this.name=w,this.version=E,this.options=C}emit(_){this._getLogger().emit(_)}enabled(_){return this._getLogger().enabled(_)}_getLogger(){if(this._delegate)return this._delegate;const _=this._provider._getDelegateLogger(this.name,this.version,this.options);return _?(this._delegate=_,this._delegate):q}}class ProxyLoggerProvider{getLogger(_,w,E){var C;return null!==(C=this._getDelegateLogger(_,w,E))&&void 0!==C?C:new ProxyLogger(this,_,w,E)}_getDelegate(){var _;return null!==(_=this._delegate)&&void 0!==_?_:Q}_setDelegate(_){this._delegate=_}_getDelegateLogger(_,w,E){var C;return null===(C=this._delegate)||void 0===C?void 0:C.getLogger(_,w,E)}}class LogsAPI{constructor(){this._proxyLoggerProvider=new ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new LogsAPI),this._instance}setGlobalLoggerProvider(_){return K[G]?this.getLoggerProvider():(K[G]=function makeGetter(_,w,E){return C=>C===_?w:E}(1,_,Q),this._proxyLoggerProvider._setDelegate(_),_)}getLoggerProvider(){var _,w;return null!==(w=null===(_=K[G])||void 0===_?void 0:_.call(K,1))&&void 0!==w?w:this._proxyLoggerProvider}getLogger(_,w,E){return this.getLoggerProvider().getLogger(_,w,E)}disable(){delete K[G],this._proxyLoggerProvider=new ProxyLoggerProvider}}const X=LogsAPI.getInstance(),J="1.9.1",Z=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;const Y=function _makeCompatibilityCheck(_){const w=new Set([_]),E=new Set,C=_.match(Z);if(!C)return()=>!1;const P=+C[1],R=+C[2],L=+C[3];if(null!=C[4])return function isExactmatch(w){return w===_};function _reject(_){return E.add(_),!1}function _accept(_){return w.add(_),!0}return function isCompatible(_){if(w.has(_))return!0;if(E.has(_))return!1;const C=_.match(Z);if(!C)return _reject(_);const I=+C[1],k=+C[2],F=+C[3];return null!=C[4]||P!==I?_reject(_):0===P?R===k&&L<=F?_accept(_):_reject(_):R<=k?_accept(_):_reject(_)}}(J),ee=J.split(".")[0],te=Symbol.for(`opentelemetry.js.api.${ee}`),re="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{};function registerGlobal(_,w,E,C=!1){var P;const R=re[te]=null!==(P=re[te])&&void 0!==P?P:{version:J};if(!C&&R[_]){const w=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${_}`);return E.error(w.stack||w.message),!1}if(R.version!==J){const w=new Error(`@opentelemetry/api: Registration of version v${R.version} for ${_} does not match previously registered API v${J}`);return E.error(w.stack||w.message),!1}return R[_]=w,E.debug(`@opentelemetry/api: Registered a global for ${_} v${J}.`),!0}function getGlobal(_){var w,E;const C=null===(w=re[te])||void 0===w?void 0:w.version;if(C&&Y(C))return null===(E=re[te])||void 0===E?void 0:E[_]}function unregisterGlobal(_,w){w.debug(`@opentelemetry/api: Unregistering a global for ${_} v${J}.`);const E=re[te];E&&delete E[_]}class DiagComponentLogger{constructor(_){this._namespace=_.namespace||"DiagComponentLogger"}debug(..._){return logProxy("debug",this._namespace,_)}error(..._){return logProxy("error",this._namespace,_)}info(..._){return logProxy("info",this._namespace,_)}warn(..._){return logProxy("warn",this._namespace,_)}verbose(..._){return logProxy("verbose",this._namespace,_)}}function logProxy(_,w,E){const C=getGlobal("diag");if(C)return C[_](w,...E)}var ne;!function(_){_[_.NONE=0]="NONE",_[_.ERROR=30]="ERROR",_[_.WARN=50]="WARN",_[_.INFO=60]="INFO",_[_.DEBUG=70]="DEBUG",_[_.VERBOSE=80]="VERBOSE",_[_.ALL=9999]="ALL"}(ne||(ne={}));class DiagAPI{static instance(){return this._instance||(this._instance=new DiagAPI),this._instance}constructor(){function _logProxy(_){return function(...w){const E=getGlobal("diag");if(E)return E[_](...w)}}const _=this;_.setLogger=(w,E={logLevel:ne.INFO})=>{var C,P,R;if(w===_){const w=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return _.error(null!==(C=w.stack)&&void 0!==C?C:w.message),!1}"number"==typeof E&&(E={logLevel:E});const L=getGlobal("diag"),I=function createLogLevelDiagLogger(_,w){function _filterFunc(E,C){const P=w[E];return"function"==typeof P&&_>=C?P.bind(w):function(){}}return _<ne.NONE?_=ne.NONE:_>ne.ALL&&(_=ne.ALL),w=w||{},{error:_filterFunc("error",ne.ERROR),warn:_filterFunc("warn",ne.WARN),info:_filterFunc("info",ne.INFO),debug:_filterFunc("debug",ne.DEBUG),verbose:_filterFunc("verbose",ne.VERBOSE)}}(null!==(P=E.logLevel)&&void 0!==P?P:ne.INFO,w);if(L&&!E.suppressOverrideMessage){const _=null!==(R=(new Error).stack)&&void 0!==R?R:"<failed to generate stacktrace>";L.warn(`Current logger will be overwritten from ${_}`),I.warn(`Current logger will overwrite one already registered from ${_}`)}return registerGlobal("diag",I,_,!0)},_.disable=()=>{unregisterGlobal("diag",_)},_.createComponentLogger=_=>new DiagComponentLogger(_),_.verbose=_logProxy("verbose"),_.debug=_logProxy("debug"),_.info=_logProxy("info"),_.warn=_logProxy("warn"),_.error=_logProxy("error")}}class BaggageImpl{constructor(_){this._entries=_?new Map(_):new Map}getEntry(_){const w=this._entries.get(_);if(w)return Object.assign({},w)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(_,w){const E=new BaggageImpl(this._entries);return E._entries.set(_,w),E}removeEntry(_){const w=new BaggageImpl(this._entries);return w._entries.delete(_),w}removeEntries(..._){const w=new BaggageImpl(this._entries);for(const E of _)w._entries.delete(E);return w}clear(){return new BaggageImpl}}const oe=Symbol("BaggageEntryMetadata"),ie=DiagAPI.instance();function createBaggage(_={}){return new BaggageImpl(new Map(Object.entries(_)))}function baggageEntryMetadataFromString(_){return"string"!=typeof _&&(ie.error("Cannot create baggage metadata from unknown type: "+typeof _),_=""),{__TYPE__:oe,toString:()=>_}}function createContextKey(_){return Symbol.for(_)}class BaseContext{constructor(_){const w=this;w._currentContext=_?new Map(_):new Map,w.getValue=_=>w._currentContext.get(_),w.setValue=(_,E)=>{const C=new BaseContext(w._currentContext);return C._currentContext.set(_,E),C},w.deleteValue=_=>{const E=new BaseContext(w._currentContext);return E._currentContext.delete(_),E}}}const se=new BaseContext;class NoopMetric{}class NoopObservableMetric{addCallback(_){}removeCallback(_){}}const ae=new class NoopMeter{constructor(){}createGauge(_,w){return ue}createHistogram(_,w){return le}createCounter(_,w){return ce}createUpDownCounter(_,w){return pe}createObservableGauge(_,w){return fe}createObservableCounter(_,w){return de}createObservableUpDownCounter(_,w){return he}addBatchObservableCallback(_,w){}removeBatchObservableCallback(_){}},ce=new class NoopCounterMetric extends NoopMetric{add(_,w){}},ue=new class NoopGaugeMetric extends NoopMetric{record(_,w){}},le=new class NoopHistogramMetric extends NoopMetric{record(_,w){}},pe=new class NoopUpDownCounterMetric extends NoopMetric{add(_,w){}},de=new class NoopObservableCounterMetric extends NoopObservableMetric{},fe=new class NoopObservableGaugeMetric extends NoopObservableMetric{},he=new class NoopObservableUpDownCounterMetric extends NoopObservableMetric{};function createNoopMeter(){return ae}const ge={get(_,w){if(null!=_)return _[w]},keys:_=>null==_?[]:Object.keys(_)},me={set(_,w,E){null!=_&&(_[w]=E)}};const ye="context",be=new class NoopContextManager{active(){return se}with(_,w,E,...C){return w.call(E,...C)}bind(_,w){return w}enable(){return this}disable(){return this}};class ContextAPI{constructor(){}static getInstance(){return this._instance||(this._instance=new ContextAPI),this._instance}setGlobalContextManager(_){return registerGlobal(ye,_,DiagAPI.instance())}active(){return this._getContextManager().active()}with(_,w,E,...C){return this._getContextManager().with(_,w,E,...C)}bind(_,w){return this._getContextManager().bind(_,w)}_getContextManager(){return getGlobal(ye)||be}disable(){this._getContextManager().disable(),unregisterGlobal(ye,DiagAPI.instance())}}var _e;!function(_){_[_.NONE=0]="NONE",_[_.SAMPLED=1]="SAMPLED"}(_e||(_e={}));const ve="0000000000000000",Se="00000000000000000000000000000000",we={traceId:Se,spanId:ve,traceFlags:_e.NONE};class NonRecordingSpan{constructor(_=we){this._spanContext=_}spanContext(){return this._spanContext}setAttribute(_,w){return this}setAttributes(_){return this}addEvent(_,w){return this}addLink(_){return this}addLinks(_){return this}setStatus(_){return this}updateName(_){return this}end(_){}isRecording(){return!1}recordException(_,w){}}const Ee=createContextKey("OpenTelemetry Context Key SPAN");function getSpan(_){return _.getValue(Ee)||void 0}function getActiveSpan(){return getSpan(ContextAPI.getInstance().active())}function setSpan(_,w){return _.setValue(Ee,w)}function deleteSpan(_){return _.deleteValue(Ee)}function setSpanContext(_,w){return setSpan(_,new NonRecordingSpan(w))}function getSpanContext(_){var w;return null===(w=getSpan(_))||void 0===w?void 0:w.spanContext()}const Te=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 isValidHex(_,w){if("string"!=typeof _||_.length!==w)return!1;let E=0;for(let w=0;w<_.length;w+=4)E+=(0|Te[_.charCodeAt(w)])+(0|Te[_.charCodeAt(w+1)])+(0|Te[_.charCodeAt(w+2)])+(0|Te[_.charCodeAt(w+3)]);return E===w}function isValidTraceId(_){return isValidHex(_,32)&&_!==Se}function isSpanContextValid(_){return isValidTraceId(_.traceId)&&function isValidSpanId(_){return isValidHex(_,16)&&_!==ve}(_.spanId)}function wrapSpanContext(_){return new NonRecordingSpan(_)}const Ae=ContextAPI.getInstance();class NoopTracer{startSpan(_,w,E=Ae.active()){if(Boolean(null==w?void 0:w.root))return new NonRecordingSpan;const C=E&&getSpanContext(E);return function isSpanContext(_){return null!==_&&"object"==typeof _&&"spanId"in _&&"string"==typeof _.spanId&&"traceId"in _&&"string"==typeof _.traceId&&"traceFlags"in _&&"number"==typeof _.traceFlags}(C)&&isSpanContextValid(C)?new NonRecordingSpan(C):new NonRecordingSpan}startActiveSpan(_,w,E,C){let P,R,L;if(arguments.length<2)return;2===arguments.length?L=w:3===arguments.length?(P=w,L=E):(P=w,R=E,L=C);const I=null!=R?R:Ae.active(),k=this.startSpan(_,P,I),F=setSpan(I,k);return Ae.with(F,L,void 0,k)}}const Oe=new NoopTracer;class ProxyTracer{constructor(_,w,E,C){this._provider=_,this.name=w,this.version=E,this.options=C}startSpan(_,w,E){return this._getTracer().startSpan(_,w,E)}startActiveSpan(_,w,E,C){const P=this._getTracer();return Reflect.apply(P.startActiveSpan,P,arguments)}_getTracer(){if(this._delegate)return this._delegate;const _=this._provider.getDelegateTracer(this.name,this.version,this.options);return _?(this._delegate=_,this._delegate):Oe}}const Ce=new class NoopTracerProvider{getTracer(_,w,E){return new NoopTracer}};class ProxyTracerProvider{getTracer(_,w,E){var C;return null!==(C=this.getDelegateTracer(_,w,E))&&void 0!==C?C:new ProxyTracer(this,_,w,E)}getDelegate(){var _;return null!==(_=this._delegate)&&void 0!==_?_:Ce}setDelegate(_){this._delegate=_}getDelegateTracer(_,w,E){var C;return null===(C=this._delegate)||void 0===C?void 0:C.getTracer(_,w,E)}}var Pe,Re,xe;!function(_){_[_.NOT_RECORD=0]="NOT_RECORD",_[_.RECORD=1]="RECORD",_[_.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Pe||(Pe={})),function(_){_[_.INTERNAL=0]="INTERNAL",_[_.SERVER=1]="SERVER",_[_.CLIENT=2]="CLIENT",_[_.PRODUCER=3]="PRODUCER",_[_.CONSUMER=4]="CONSUMER"}(Re||(Re={})),function(_){_[_.UNSET=0]="UNSET",_[_.OK=1]="OK",_[_.ERROR=2]="ERROR"}(xe||(xe={}));const Le=ContextAPI.getInstance(),Ie=DiagAPI.instance();const Ne=new class NoopMeterProvider{getMeter(_,w,E){return ae}},De="metrics";class MetricsAPI{constructor(){}static getInstance(){return this._instance||(this._instance=new MetricsAPI),this._instance}setGlobalMeterProvider(_){return registerGlobal(De,_,DiagAPI.instance())}getMeterProvider(){return getGlobal(De)||Ne}getMeter(_,w,E){return this.getMeterProvider().getMeter(_,w,E)}disable(){unregisterGlobal(De,DiagAPI.instance())}}const ke=MetricsAPI.getInstance();const Fe=createContextKey("OpenTelemetry Baggage Key");function getBaggage(_){return _.getValue(Fe)||void 0}function getActiveBaggage(){return getBaggage(ContextAPI.getInstance().active())}function setBaggage(_,w){return _.setValue(Fe,w)}function deleteBaggage(_){return _.deleteValue(Fe)}const je="propagation",Me=new class NoopTextMapPropagator{inject(_,w){}extract(_,w){return _}fields(){return[]}};class PropagationAPI{constructor(){this.createBaggage=createBaggage,this.getBaggage=getBaggage,this.getActiveBaggage=getActiveBaggage,this.setBaggage=setBaggage,this.deleteBaggage=deleteBaggage}static getInstance(){return this._instance||(this._instance=new PropagationAPI),this._instance}setGlobalPropagator(_){return registerGlobal(je,_,DiagAPI.instance())}inject(_,w,E=me){return this._getGlobalPropagator().inject(_,w,E)}extract(_,w,E=ge){return this._getGlobalPropagator().extract(_,w,E)}fields(){return this._getGlobalPropagator().fields()}disable(){unregisterGlobal(je,DiagAPI.instance())}_getGlobalPropagator(){return getGlobal(je)||Me}}const $e=PropagationAPI.getInstance(),Be="trace";class TraceAPI{constructor(){this._proxyTracerProvider=new ProxyTracerProvider,this.wrapSpanContext=wrapSpanContext,this.isSpanContextValid=isSpanContextValid,this.deleteSpan=deleteSpan,this.getSpan=getSpan,this.getActiveSpan=getActiveSpan,this.getSpanContext=getSpanContext,this.setSpan=setSpan,this.setSpanContext=setSpanContext}static getInstance(){return this._instance||(this._instance=new TraceAPI),this._instance}setGlobalTracerProvider(_){const w=registerGlobal(Be,this._proxyTracerProvider,DiagAPI.instance());return w&&this._proxyTracerProvider.setDelegate(_),w}getTracerProvider(){return getGlobal(Be)||this._proxyTracerProvider}getTracer(_,w){return this.getTracerProvider().getTracer(_,w)}disable(){unregisterGlobal(Be,DiagAPI.instance()),this._proxyTracerProvider=new ProxyTracerProvider}}const Ue=TraceAPI.getInstance(),Ve=createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function suppressTracing$2(_){return _.setValue(Ve,!0)}function isTracingSuppressed$1(_){return!0===_.getValue(Ve)}const He="baggage";function parsePairKeyValue$1(_){if(!_)return;const w=_.indexOf(";"),E=-1===w?_:_.substring(0,w),C=E.indexOf("=");if(C<=0)return;const P=E.substring(0,C).trim(),R=E.substring(C+1).trim();if(!P||!R)return;let L,I,k;try{L=decodeURIComponent(P),I=decodeURIComponent(R)}catch{return}if(-1!==w&&w<_.length-1){k=baggageEntryMetadataFromString(_.substring(w+1))}return{key:L,value:I,metadata:k}}function parseBaggageHeaderString(_,w,E,C){let P=0;for(;P<_.length&&E<180;){const R=_.indexOf(",",P),L=-1===R?_.length:R,I=L-P;if(I<=4096){const R=parsePairKeyValue$1(_.substring(P,L));if(R){const _=(0===E?0:1)+I;if(C+_>8192)break;w[R.key]=R.metadata?{value:R.value,metadata:R.metadata}:{value:R.value},E++,C+=_}}if(-1===R)break;P=R+1}return[E,C]}class W3CBaggagePropagator{inject(_,w,E){const C=$e.getBaggage(_);if(!C||isTracingSuppressed$1(_))return;const P=function getKeyPairs(_){return _.getAllEntries().map((([_,w])=>{let E=`${encodeURIComponent(_)}=${encodeURIComponent(w.value)}`;return void 0!==w.metadata&&(E+=";"+w.metadata.toString()),E}))}(C).filter((_=>_.length<=4096)).slice(0,180),R=function serializeKeyPairs(_){return _.reduce(((_,w)=>{const E=`${_}${""!==_?",":""}${w}`;return E.length>8192?_:E}),"")}(P);R.length>0&&E.set(w,He,R)}extract(_,w,E){const C=E.get(w,He);if(!C)return _;const P={};let R=0,L=0;if(Array.isArray(C))for(let _=0;_<C.length;_++)[R,L]=parseBaggageHeaderString(C[_],P,R,L);else[R]=parseBaggageHeaderString(C,P,R,L);return 0===R?_:$e.setBaggage(_,$e.createBaggage(P))}fields(){return[He]}}var ze="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},qe={},We={},Ge=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var _={},w=Symbol("test"),E=Object(w);if("string"==typeof w)return!1;if("[object Symbol]"!==Object.prototype.toString.call(w))return!1;if("[object Symbol]"!==Object.prototype.toString.call(E))return!1;for(var C in _[w]=42,_)return!1;if("function"==typeof Object.keys&&0!==Object.keys(_).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(_).length)return!1;var P=Object.getOwnPropertySymbols(_);if(1!==P.length||P[0]!==w)return!1;if(!Object.prototype.propertyIsEnumerable.call(_,w))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var R=Object.getOwnPropertyDescriptor(_,w);if(42!==R.value||!0!==R.enumerable)return!1}return!0},Ke=Ge,Qe=function hasToStringTagShams(){return Ke()&&!!Symbol.toStringTag},Xe=Object,Je=Error,Ze=EvalError,Ye=RangeError,et=ReferenceError,tt=SyntaxError,rt=TypeError,nt=URIError,ot=Math.abs,it=Math.floor,st=Math.max,at=Math.min,ct=Math.pow,ut=Math.round,lt=Number.isNaN||function isNaN(_){return _!=_},pt=lt,dt=Object.getOwnPropertyDescriptor;if(dt)try{dt([],"length")}catch(e){dt=null}var ft=dt,ht=Object.defineProperty||!1;if(ht)try{ht({},"a",{value:1})}catch(e){ht=!1}var gt,mt=ht,yt="undefined"!=typeof Symbol&&Symbol,bt=Ge,_t="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null,vt=Xe.getPrototypeOf||null,St=Object.prototype.toString,wt=Math.max,Et=function concatty(_,w){for(var E=[],C=0;C<_.length;C+=1)E[C]=_[C];for(var P=0;P<w.length;P+=1)E[P+_.length]=w[P];return E},Tt=function bind(_){var w=this;if("function"!=typeof w||"[object Function]"!==St.apply(w))throw new TypeError("Function.prototype.bind called on incompatible "+w);for(var E,C=function slicy(_,w){for(var E=[],C=w,P=0;C<_.length;C+=1,P+=1)E[P]=_[C];return E}(arguments,1),P=wt(0,w.length-C.length),R=[],L=0;L<P;L++)R[L]="$"+L;if(E=Function("binder","return function ("+function(_,w){for(var E="",C=0;C<_.length;C+=1)E+=_[C],C+1<_.length&&(E+=w);return E}(R,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof E){var P=w.apply(this,Et(C,arguments));return Object(P)===P?P:this}return w.apply(_,Et(C,arguments))})),w.prototype){var I=function Empty(){};I.prototype=w.prototype,E.prototype=new I,I.prototype=null}return E},At=Function.prototype.bind||Tt,Ot=Function.prototype.call,Ct=Function.prototype.apply,Pt=Ct,Rt=Ot,xt="undefined"!=typeof Reflect&&Reflect&&Reflect.apply||At.call(Rt,Pt),Lt=At,It=rt,Nt=Ot,Dt=xt,kt=function callBindBasic(_){if(_.length<1||"function"!=typeof _[0])throw new It("a function is required");return Dt(Lt,Nt,_)},Ft=kt,jt=ft;try{gt=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var Mt,$t=!!gt&&jt&&jt(Object.prototype,"__proto__"),Bt=Object,Ut=Bt.getPrototypeOf,Vt=$t&&"function"==typeof $t.get?Ft([$t.get]):"function"==typeof Ut&&function getDunder(_){return Ut(null==_?_:Bt(_))},Ht=_t,zt=vt,qt=Vt,Wt=Ht?function getProto(_){return Ht(_)}:zt?function getProto(_){if(!_||"object"!=typeof _&&"function"!=typeof _)throw new TypeError("getProto: not an object");return zt(_)}:qt?function getProto(_){return qt(_)}:null,Gt=Function.prototype.call,Kt=Object.prototype.hasOwnProperty,Qt=At.call(Gt,Kt),Xt=Xe,Jt=Je,Zt=Ze,Yt=Ye,er=et,tr=tt,rr=rt,nr=nt,or=ot,ir=it,sr=st,ar=at,cr=ct,ur=ut,lr=function sign(_){return pt(_)||0===_?_:_<0?-1:1},pr=Function,getEvalledConstructor=function(_){try{return pr('"use strict"; return ('+_+").constructor;")()}catch(_){}},dr=ft,fr=mt,throwTypeError=function(){throw new rr},hr=dr?function(){try{return throwTypeError}catch(_){try{return dr(arguments,"callee").get}catch(_){return throwTypeError}}}():throwTypeError,gr=function hasNativeSymbols(){return"function"==typeof yt&&("function"==typeof Symbol&&("symbol"==typeof yt("foo")&&("symbol"==typeof Symbol("bar")&&bt())))}(),mr=Wt,yr=vt,br=_t,_r=Ct,vr=Ot,Sr={},wr="undefined"!=typeof Uint8Array&&mr?mr(Uint8Array):Mt,Er={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?Mt:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Mt:ArrayBuffer,"%ArrayIteratorPrototype%":gr&&mr?mr([][Symbol.iterator]()):Mt,"%AsyncFromSyncIteratorPrototype%":Mt,"%AsyncFunction%":Sr,"%AsyncGenerator%":Sr,"%AsyncGeneratorFunction%":Sr,"%AsyncIteratorPrototype%":Sr,"%Atomics%":"undefined"==typeof Atomics?Mt:Atomics,"%BigInt%":"undefined"==typeof BigInt?Mt:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Mt:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Mt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Mt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Jt,"%eval%":eval,"%EvalError%":Zt,"%Float32Array%":"undefined"==typeof Float32Array?Mt:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Mt:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Mt:FinalizationRegistry,"%Function%":pr,"%GeneratorFunction%":Sr,"%Int8Array%":"undefined"==typeof Int8Array?Mt:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Mt:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Mt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gr&&mr?mr(mr([][Symbol.iterator]())):Mt,"%JSON%":"object"==typeof JSON?JSON:Mt,"%Map%":"undefined"==typeof Map?Mt:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&gr&&mr?mr((new Map)[Symbol.iterator]()):Mt,"%Math%":Math,"%Number%":Number,"%Object%":Xt,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Mt:Promise,"%Proxy%":"undefined"==typeof Proxy?Mt:Proxy,"%RangeError%":Yt,"%ReferenceError%":er,"%Reflect%":"undefined"==typeof Reflect?Mt:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Mt:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&gr&&mr?mr((new Set)[Symbol.iterator]()):Mt,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Mt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gr&&mr?mr(""[Symbol.iterator]()):Mt,"%Symbol%":gr?Symbol:Mt,"%SyntaxError%":tr,"%ThrowTypeError%":hr,"%TypedArray%":wr,"%TypeError%":rr,"%Uint8Array%":"undefined"==typeof Uint8Array?Mt:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Mt:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Mt:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Mt:Uint32Array,"%URIError%":nr,"%WeakMap%":"undefined"==typeof WeakMap?Mt:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Mt:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Mt:WeakSet,"%Function.prototype.call%":vr,"%Function.prototype.apply%":_r,"%Object.defineProperty%":fr,"%Object.getPrototypeOf%":yr,"%Math.abs%":or,"%Math.floor%":ir,"%Math.max%":sr,"%Math.min%":ar,"%Math.pow%":cr,"%Math.round%":ur,"%Math.sign%":lr,"%Reflect.getPrototypeOf%":br};if(mr)try{null.error}catch(e){var Tr=mr(mr(e));Er["%Error.prototype%"]=Tr}var Ar=function doEval(_){var w;if("%AsyncFunction%"===_)w=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===_)w=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===_)w=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===_){var E=doEval("%AsyncGeneratorFunction%");E&&(w=E.prototype)}else if("%AsyncIteratorPrototype%"===_){var C=doEval("%AsyncGenerator%");C&&mr&&(w=mr(C.prototype))}return Er[_]=w,w},Or={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Cr=At,Pr=Qt,Rr=Cr.call(vr,Array.prototype.concat),xr=Cr.call(_r,Array.prototype.splice),Lr=Cr.call(vr,String.prototype.replace),Ir=Cr.call(vr,String.prototype.slice),Nr=Cr.call(vr,RegExp.prototype.exec),Dr=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,kr=/\\(\\)?/g,Fr=function getBaseIntrinsic(_,w){var E,C=_;if(Pr(Or,C)&&(C="%"+(E=Or[C])[0]+"%"),Pr(Er,C)){var P=Er[C];if(P===Sr&&(P=Ar(C)),void 0===P&&!w)throw new rr("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:E,name:C,value:P}}throw new tr("intrinsic "+_+" does not exist!")},jr=function GetIntrinsic(_,w){if("string"!=typeof _||0===_.length)throw new rr("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof w)throw new rr('"allowMissing" argument must be a boolean');if(null===Nr(/^%?[^%]*%?$/,_))throw new tr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var E=function stringToPath(_){var w=Ir(_,0,1),E=Ir(_,-1);if("%"===w&&"%"!==E)throw new tr("invalid intrinsic syntax, expected closing `%`");if("%"===E&&"%"!==w)throw new tr("invalid intrinsic syntax, expected opening `%`");var C=[];return Lr(_,Dr,(function(_,w,E,P){C[C.length]=E?Lr(P,kr,"$1"):w||_})),C}(_),C=E.length>0?E[0]:"",P=Fr("%"+C+"%",w),R=P.name,L=P.value,I=!1,k=P.alias;k&&(C=k[0],xr(E,Rr([0,1],k)));for(var F=1,j=!0;F<E.length;F+=1){var $=E[F],V=Ir($,0,1),H=Ir($,-1);if(('"'===V||"'"===V||"`"===V||'"'===H||"'"===H||"`"===H)&&V!==H)throw new tr("property names with quotes must have matching quotes");if("constructor"!==$&&j||(I=!0),Pr(Er,R="%"+(C+="."+$)+"%"))L=Er[R];else if(null!=L){if(!($ in L)){if(!w)throw new rr("base intrinsic for "+_+" exists, but the property is not available.");return}if(dr&&F+1>=E.length){var z=dr(L,$);L=(j=!!z)&&"get"in z&&!("originalValue"in z.get)?z.get:L[$]}else j=Pr(L,$),L=L[$];j&&!I&&(Er[R]=L)}}return L},Mr=jr,$r=kt,Br=$r([Mr("%String.prototype.indexOf%")]),Ur=function callBoundIntrinsic(_,w){var E=Mr(_,!!w);return"function"==typeof E&&Br(_,".prototype.")>-1?$r([E]):E},Vr=Qe(),Hr=Ur("Object.prototype.toString"),zr=function isArguments(_){return!(Vr&&_&&"object"==typeof _&&Symbol.toStringTag in _)&&"[object Arguments]"===Hr(_)},qr=function isArguments(_){return!!zr(_)||null!==_&&"object"==typeof _&&"length"in _&&"number"==typeof _.length&&_.length>=0&&"[object Array]"!==Hr(_)&&"callee"in _&&"[object Function]"===Hr(_.callee)},Wr=function(){return zr(arguments)}();zr.isLegacyArguments=qr;var Gr,Kr=Wr?zr:qr,Qr=Ur,Xr=Qe(),Jr=Qt,Zr=ft;if(Xr){var Yr=Qr("RegExp.prototype.exec"),en={},throwRegexMarker=function(){throw en},tn={toString:throwRegexMarker,valueOf:throwRegexMarker};"symbol"==typeof Symbol.toPrimitive&&(tn[Symbol.toPrimitive]=throwRegexMarker),Gr=function isRegex(_){if(!_||"object"!=typeof _)return!1;var w=Zr(_,"lastIndex");if(!(w&&Jr(w,"value")))return!1;try{Yr(_,tn)}catch(_){return _===en}}}else{var rn=Qr("Object.prototype.toString");Gr=function isRegex(_){return!(!_||"object"!=typeof _&&"function"!=typeof _)&&"[object RegExp]"===rn(_)}}var nn,on,sn,an=Gr,cn=Ur("RegExp.prototype.exec"),un=rt,ln=Ur,pn=function regexTester(_){if(!an(_))throw new un("`regex` must be a RegExp");return function test(w){return null!==cn(_,w)}},dn=pn(/^\s*(?:function)?\*/),fn=Qe(),hn=Wt,gn=ln("Object.prototype.toString"),mn=ln("Function.prototype.toString"),yn=function isGeneratorFunction(_){if("function"!=typeof _)return!1;if(dn(mn(_)))return!0;if(!fn)return"[object GeneratorFunction]"===gn(_);if(!hn)return!1;if(void 0===nn){var w=function(){if(!fn)return!1;try{return Function("return function*() {}")()}catch(_){}}();nn=!!w&&hn(w)}return hn(_)===nn},bn=Function.prototype.toString,_n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof _n&&"function"==typeof Object.defineProperty)try{on=Object.defineProperty({},"length",{get:function(){throw sn}}),sn={},_n((function(){throw 42}),null,on)}catch(Ul){Ul!==sn&&(_n=null)}else _n=null;var vn=/^\s*class\b/,Sn=function isES6ClassFunction(_){try{var w=bn.call(_);return vn.test(w)}catch(_){return!1}},wn=function tryFunctionToStr(_){try{return!Sn(_)&&(bn.call(_),!0)}catch(_){return!1}},En=Object.prototype.toString,Tn="function"==typeof Symbol&&!!Symbol.toStringTag,An=!(0 in[,]),On=function isDocumentDotAll(){return!1};if("object"==typeof document){var Cn=document.all;En.call(Cn)===En.call(document.all)&&(On=function isDocumentDotAll(_){if((An||!_)&&(void 0===_||"object"==typeof _))try{var w=En.call(_);return("[object HTMLAllCollection]"===w||"[object HTML document.all class]"===w||"[object HTMLCollection]"===w||"[object Object]"===w)&&null==_("")}catch(_){}return!1})}var Pn=_n?function isCallable(_){if(On(_))return!0;if(!_)return!1;if("function"!=typeof _&&"object"!=typeof _)return!1;try{_n(_,null,on)}catch(_){if(_!==sn)return!1}return!Sn(_)&&wn(_)}:function isCallable(_){if(On(_))return!0;if(!_)return!1;if("function"!=typeof _&&"object"!=typeof _)return!1;if(Tn)return wn(_);if(Sn(_))return!1;var w=En.call(_);return!("[object Function]"!==w&&"[object GeneratorFunction]"!==w&&!/^\[object HTML/.test(w))&&wn(_)},Rn=Pn,xn=Object.prototype.toString,Ln=Object.prototype.hasOwnProperty,In=function forEach(_,w,E){if(!Rn(w))throw new TypeError("iterator must be a function");var C;arguments.length>=3&&(C=E),"[object Array]"===xn.call(_)?function forEachArray(_,w,E){for(var C=0,P=_.length;C<P;C++)Ln.call(_,C)&&(null==E?w(_[C],C,_):w.call(E,_[C],C,_))}(_,w,C):"string"==typeof _?function forEachString(_,w,E){for(var C=0,P=_.length;C<P;C++)null==E?w(_.charAt(C),C,_):w.call(E,_.charAt(C),C,_)}(_,w,C):function forEachObject(_,w,E){for(var C in _)Ln.call(_,C)&&(null==E?w(_[C],C,_):w.call(E,_[C],C,_))}(_,w,C)},Nn=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Dn="undefined"==typeof globalThis?ze:globalThis,kn={exports:{}},Fn=mt,jn=tt,Mn=rt,$n=ft,Bn=mt,Un=function hasPropertyDescriptors(){return!!Bn};Un.hasArrayLengthDefineBug=function hasArrayLengthDefineBug(){if(!Bn)return null;try{return 1!==Bn([],"length",{value:1}).length}catch(_){return!0}};var Vn=jr,Hn=function defineDataProperty(_,w,E){if(!_||"object"!=typeof _&&"function"!=typeof _)throw new Mn("`obj` must be an object or a function`");if("string"!=typeof w&&"symbol"!=typeof w)throw new Mn("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new Mn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new Mn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new Mn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new Mn("`loose`, if provided, must be a boolean");var C=arguments.length>3?arguments[3]:null,P=arguments.length>4?arguments[4]:null,R=arguments.length>5?arguments[5]:null,L=arguments.length>6&&arguments[6],I=!!$n&&$n(_,w);if(Fn)Fn(_,w,{configurable:null===R&&I?I.configurable:!R,enumerable:null===C&&I?I.enumerable:!C,value:E,writable:null===P&&I?I.writable:!P});else{if(!L&&(C||P||R))throw new jn("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");_[w]=E}},zn=Un(),qn=ft,Wn=rt,Gn=Vn("%Math.floor%"),Kn=function setFunctionLength(_,w){if("function"!=typeof _)throw new Wn("`fn` is not a function");if("number"!=typeof w||w<0||w>4294967295||Gn(w)!==w)throw new Wn("`length` must be a positive 32-bit integer");var E=arguments.length>2&&!!arguments[2],C=!0,P=!0;if("length"in _&&qn){var R=qn(_,"length");R&&!R.configurable&&(C=!1),R&&!R.writable&&(P=!1)}return(C||P||!E)&&(zn?Hn(_,"length",w,!0,!0):Hn(_,"length",w)),_},Qn=At,Xn=Ct,Jn=xt,Zn=function applyBind(){return Jn(Qn,Xn,arguments)};!function(_){var w=Kn,E=mt,C=kt,P=Zn;_.exports=function callBind(_){var E=C(arguments),P=_.length-(arguments.length-1);return w(E,1+(P>0?P:0),!0)},E?E(_.exports,"apply",{value:P}):_.exports.apply=P}(kn);var Yn=In,eo=function availableTypedArrays(){for(var _=[],w=0;w<Nn.length;w++)"function"==typeof Dn[Nn[w]]&&(_[_.length]=Nn[w]);return _},to=kn.exports,ro=Ur,no=ft,oo=ro("Object.prototype.toString"),io=Qe(),so="undefined"==typeof globalThis?ze:globalThis,ao=eo(),co=ro("String.prototype.slice"),uo=Object.getPrototypeOf,lo=ro("Array.prototype.indexOf",!0)||function indexOf(_,w){for(var E=0;E<_.length;E+=1)if(_[E]===w)return E;return-1},po={__proto__:null};Yn(ao,io&&no&&uo?function(_){var w=new so[_];if(Symbol.toStringTag in w){var E=uo(w),C=no(E,Symbol.toStringTag);if(!C){var P=uo(E);C=no(P,Symbol.toStringTag)}po["$"+_]=to(C.get)}}:function(_){var w=new so[_],E=w.slice||w.set;E&&(po["$"+_]=to(E))});var fo=function whichTypedArray(_){if(!_||"object"!=typeof _)return!1;if(!io){var w=co(oo(_),8,-1);return lo(ao,w)>-1?w:"Object"===w&&function tryAllSlices(_){var w=!1;return Yn(po,(function(E,C){if(!w)try{E(_),w=co(C,1)}catch(_){}})),w}(_)}return no?function tryAllTypedArrays(_){var w=!1;return Yn(po,(function(E,C){if(!w)try{"$"+E(_)===C&&(w=co(C,1))}catch(_){}})),w}(_):null},ho=fo,go=function isTypedArray(_){return!!ho(_)};!function(_){var w=Kr,E=yn,C=fo,P=go;function uncurryThis(_){return _.call.bind(_)}var R="undefined"!=typeof BigInt,L="undefined"!=typeof Symbol,I=uncurryThis(Object.prototype.toString),k=uncurryThis(Number.prototype.valueOf),F=uncurryThis(String.prototype.valueOf),j=uncurryThis(Boolean.prototype.valueOf);if(R)var $=uncurryThis(BigInt.prototype.valueOf);if(L)var V=uncurryThis(Symbol.prototype.valueOf);function checkBoxedPrimitive(_,w){if("object"!=typeof _)return!1;try{return w(_),!0}catch(_){return!1}}function isMapToString(_){return"[object Map]"===I(_)}function isSetToString(_){return"[object Set]"===I(_)}function isWeakMapToString(_){return"[object WeakMap]"===I(_)}function isWeakSetToString(_){return"[object WeakSet]"===I(_)}function isArrayBufferToString(_){return"[object ArrayBuffer]"===I(_)}function isArrayBuffer(_){return"undefined"!=typeof ArrayBuffer&&(isArrayBufferToString.working?isArrayBufferToString(_):_ instanceof ArrayBuffer)}function isDataViewToString(_){return"[object DataView]"===I(_)}function isDataView(_){return"undefined"!=typeof DataView&&(isDataViewToString.working?isDataViewToString(_):_ instanceof DataView)}_.isArgumentsObject=w,_.isGeneratorFunction=E,_.isTypedArray=P,_.isPromise=function isPromise(_){return"undefined"!=typeof Promise&&_ instanceof Promise||null!==_&&"object"==typeof _&&"function"==typeof _.then&&"function"==typeof _.catch},_.isArrayBufferView=function isArrayBufferView(_){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(_):P(_)||isDataView(_)},_.isUint8Array=function isUint8Array(_){return"Uint8Array"===C(_)},_.isUint8ClampedArray=function isUint8ClampedArray(_){return"Uint8ClampedArray"===C(_)},_.isUint16Array=function isUint16Array(_){return"Uint16Array"===C(_)},_.isUint32Array=function isUint32Array(_){return"Uint32Array"===C(_)},_.isInt8Array=function isInt8Array(_){return"Int8Array"===C(_)},_.isInt16Array=function isInt16Array(_){return"Int16Array"===C(_)},_.isInt32Array=function isInt32Array(_){return"Int32Array"===C(_)},_.isFloat32Array=function isFloat32Array(_){return"Float32Array"===C(_)},_.isFloat64Array=function isFloat64Array(_){return"Float64Array"===C(_)},_.isBigInt64Array=function isBigInt64Array(_){return"BigInt64Array"===C(_)},_.isBigUint64Array=function isBigUint64Array(_){return"BigUint64Array"===C(_)},isMapToString.working="undefined"!=typeof Map&&isMapToString(new Map),_.isMap=function isMap(_){return"undefined"!=typeof Map&&(isMapToString.working?isMapToString(_):_ instanceof Map)},isSetToString.working="undefined"!=typeof Set&&isSetToString(new Set),_.isSet=function isSet(_){return"undefined"!=typeof Set&&(isSetToString.working?isSetToString(_):_ instanceof Set)},isWeakMapToString.working="undefined"!=typeof WeakMap&&isWeakMapToString(new WeakMap),_.isWeakMap=function isWeakMap(_){return"undefined"!=typeof WeakMap&&(isWeakMapToString.working?isWeakMapToString(_):_ instanceof WeakMap)},isWeakSetToString.working="undefined"!=typeof WeakSet&&isWeakSetToString(new WeakSet),_.isWeakSet=function isWeakSet(_){return isWeakSetToString(_)},isArrayBufferToString.working="undefined"!=typeof ArrayBuffer&&isArrayBufferToString(new ArrayBuffer),_.isArrayBuffer=isArrayBuffer,isDataViewToString.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&isDataViewToString(new DataView(new ArrayBuffer(1),0,1)),_.isDataView=isDataView;var H="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function isSharedArrayBufferToString(_){return"[object SharedArrayBuffer]"===I(_)}function isSharedArrayBuffer(_){return void 0!==H&&(void 0===isSharedArrayBufferToString.working&&(isSharedArrayBufferToString.working=isSharedArrayBufferToString(new H)),isSharedArrayBufferToString.working?isSharedArrayBufferToString(_):_ instanceof H)}function isNumberObject(_){return checkBoxedPrimitive(_,k)}function isStringObject(_){return checkBoxedPrimitive(_,F)}function isBooleanObject(_){return checkBoxedPrimitive(_,j)}function isBigIntObject(_){return R&&checkBoxedPrimitive(_,$)}function isSymbolObject(_){return L&&checkBoxedPrimitive(_,V)}_.isSharedArrayBuffer=isSharedArrayBuffer,_.isAsyncFunction=function isAsyncFunction(_){return"[object AsyncFunction]"===I(_)},_.isMapIterator=function isMapIterator(_){return"[object Map Iterator]"===I(_)},_.isSetIterator=function isSetIterator(_){return"[object Set Iterator]"===I(_)},_.isGeneratorObject=function isGeneratorObject(_){return"[object Generator]"===I(_)},_.isWebAssemblyCompiledModule=function isWebAssemblyCompiledModule(_){return"[object WebAssembly.Module]"===I(_)},_.isNumberObject=isNumberObject,_.isStringObject=isStringObject,_.isBooleanObject=isBooleanObject,_.isBigIntObject=isBigIntObject,_.isSymbolObject=isSymbolObject,_.isBoxedPrimitive=function isBoxedPrimitive(_){return isNumberObject(_)||isStringObject(_)||isBooleanObject(_)||isBigIntObject(_)||isSymbolObject(_)},_.isAnyArrayBuffer=function isAnyArrayBuffer(_){return"undefined"!=typeof Uint8Array&&(isArrayBuffer(_)||isSharedArrayBuffer(_))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(w){Object.defineProperty(_,w,{enumerable:!1,value:function(){throw new Error(w+" is not supported in userland")}})}))}(We);var mo,yo=function isBuffer(_){return _ instanceof Buffer},bo={exports:{}},_o={exports:{}};"function"==typeof Object.create?_o.exports=function inherits(_,w){w&&(_.super_=w,_.prototype=Object.create(w.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:_o.exports=function inherits(_,w){if(w){_.super_=w;var TempCtor=function(){};TempCtor.prototype=w.prototype,_.prototype=new TempCtor,_.prototype.constructor=_}};try{var vo=require("util");if("function"!=typeof vo.inherits)throw"";bo.exports=vo.inherits}catch(e){bo.exports=_o.exports}!function(_){var w=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(_){for(var w=Object.keys(_),E={},C=0;C<w.length;C++)E[w[C]]=Object.getOwnPropertyDescriptor(_,w[C]);return E},E=/%[sdj%]/g;_.format=function(_){if(!isString(_)){for(var w=[],C=0;C<arguments.length;C++)w.push(inspect(arguments[C]));return w.join(" ")}C=1;for(var P=arguments,R=P.length,L=String(_).replace(E,(function(_){if("%%"===_)return"%";if(C>=R)return _;switch(_){case"%s":return String(P[C++]);case"%d":return Number(P[C++]);case"%j":try{return JSON.stringify(P[C++])}catch(_){return"[Circular]"}default:return _}})),I=P[C];C<R;I=P[++C])isNull(I)||!isObject(I)?L+=" "+I:L+=" "+inspect(I);return L},_.deprecate=function(w,E){if("undefined"!=typeof process&&!0===process.noDeprecation)return w;if("undefined"==typeof process)return function(){return _.deprecate(w,E).apply(this,arguments)};var C=!1;return function deprecated(){if(!C){if(process.throwDeprecation)throw new Error(E);process.traceDeprecation?console.trace(E):console.error(E),C=!0}return w.apply(this,arguments)}};var C={},P=/^$/;if(process.env.NODE_DEBUG){var R=process.env.NODE_DEBUG;R=R.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),P=new RegExp("^"+R+"$","i")}function inspect(w,E){var C={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(C.depth=arguments[2]),arguments.length>=4&&(C.colors=arguments[3]),isBoolean(E)?C.showHidden=E:E&&_._extend(C,E),isUndefined(C.showHidden)&&(C.showHidden=!1),isUndefined(C.depth)&&(C.depth=2),isUndefined(C.colors)&&(C.colors=!1),isUndefined(C.customInspect)&&(C.customInspect=!0),C.colors&&(C.stylize=stylizeWithColor),formatValue(C,w,C.depth)}function stylizeWithColor(_,w){var E=inspect.styles[w];return E?"["+inspect.colors[E][0]+"m"+_+"["+inspect.colors[E][1]+"m":_}function stylizeNoColor(_,w){return _}function formatValue(w,E,C){if(w.customInspect&&E&&isFunction(E.inspect)&&E.inspect!==_.inspect&&(!E.constructor||E.constructor.prototype!==E)){var P=E.inspect(C,w);return isString(P)||(P=formatValue(w,P,C)),P}var R=function formatPrimitive(_,w){if(isUndefined(w))return _.stylize("undefined","undefined");if(isString(w)){var E="'"+JSON.stringify(w).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return _.stylize(E,"string")}if(isNumber(w))return _.stylize(""+w,"number");if(isBoolean(w))return _.stylize(""+w,"boolean");if(isNull(w))return _.stylize("null","null")}(w,E);if(R)return R;var L=Object.keys(E),I=function arrayToHash(_){var w={};return _.forEach((function(_,E){w[_]=!0})),w}(L);if(w.showHidden&&(L=Object.getOwnPropertyNames(E)),isError(E)&&(L.indexOf("message")>=0||L.indexOf("description")>=0))return formatError(E);if(0===L.length){if(isFunction(E)){var k=E.name?": "+E.name:"";return w.stylize("[Function"+k+"]","special")}if(isRegExp(E))return w.stylize(RegExp.prototype.toString.call(E),"regexp");if(isDate(E))return w.stylize(Date.prototype.toString.call(E),"date");if(isError(E))return formatError(E)}var F,j="",$=!1,V=["{","}"];(isArray(E)&&($=!0,V=["[","]"]),isFunction(E))&&(j=" [Function"+(E.name?": "+E.name:"")+"]");return isRegExp(E)&&(j=" "+RegExp.prototype.toString.call(E)),isDate(E)&&(j=" "+Date.prototype.toUTCString.call(E)),isError(E)&&(j=" "+formatError(E)),0!==L.length||$&&0!=E.length?C<0?isRegExp(E)?w.stylize(RegExp.prototype.toString.call(E),"regexp"):w.stylize("[Object]","special"):(w.seen.push(E),F=$?function formatArray(_,w,E,C,P){for(var R=[],L=0,I=w.length;L<I;++L)hasOwnProperty(w,String(L))?R.push(formatProperty(_,w,E,C,String(L),!0)):R.push("");return P.forEach((function(P){P.match(/^\d+$/)||R.push(formatProperty(_,w,E,C,P,!0))})),R}(w,E,C,I,L):L.map((function(_){return formatProperty(w,E,C,I,_,$)})),w.seen.pop(),function reduceToSingleString(_,w,E){var C=_.reduce((function(_,w){return w.indexOf("\n"),_+w.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(C>60)return E[0]+(""===w?"":w+"\n ")+" "+_.join(",\n ")+" "+E[1];return E[0]+w+" "+_.join(", ")+" "+E[1]}(F,j,V)):V[0]+j+V[1]}function formatError(_){return"["+Error.prototype.toString.call(_)+"]"}function formatProperty(_,w,E,C,P,R){var L,I,k;if((k=Object.getOwnPropertyDescriptor(w,P)||{value:w[P]}).get?I=k.set?_.stylize("[Getter/Setter]","special"):_.stylize("[Getter]","special"):k.set&&(I=_.stylize("[Setter]","special")),hasOwnProperty(C,P)||(L="["+P+"]"),I||(_.seen.indexOf(k.value)<0?(I=isNull(E)?formatValue(_,k.value,null):formatValue(_,k.value,E-1)).indexOf("\n")>-1&&(I=R?I.split("\n").map((function(_){return" "+_})).join("\n").slice(2):"\n"+I.split("\n").map((function(_){return" "+_})).join("\n")):I=_.stylize("[Circular]","special")),isUndefined(L)){if(R&&P.match(/^\d+$/))return I;(L=JSON.stringify(""+P)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(L=L.slice(1,-1),L=_.stylize(L,"name")):(L=L.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),L=_.stylize(L,"string"))}return L+": "+I}function isArray(_){return Array.isArray(_)}function isBoolean(_){return"boolean"==typeof _}function isNull(_){return null===_}function isNumber(_){return"number"==typeof _}function isString(_){return"string"==typeof _}function isUndefined(_){return void 0===_}function isRegExp(_){return isObject(_)&&"[object RegExp]"===objectToString(_)}function isObject(_){return"object"==typeof _&&null!==_}function isDate(_){return isObject(_)&&"[object Date]"===objectToString(_)}function isError(_){return isObject(_)&&("[object Error]"===objectToString(_)||_ instanceof Error)}function isFunction(_){return"function"==typeof _}function objectToString(_){return Object.prototype.toString.call(_)}function pad(_){return _<10?"0"+_.toString(10):_.toString(10)}_.debuglog=function(w){if(w=w.toUpperCase(),!C[w])if(P.test(w)){var E=process.pid;C[w]=function(){var C=_.format.apply(_,arguments);console.error("%s %d: %s",w,E,C)}}else C[w]=function(){};return C[w]},_.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},_.types=We,_.isArray=isArray,_.isBoolean=isBoolean,_.isNull=isNull,_.isNullOrUndefined=function isNullOrUndefined(_){return null==_},_.isNumber=isNumber,_.isString=isString,_.isSymbol=function isSymbol(_){return"symbol"==typeof _},_.isUndefined=isUndefined,_.isRegExp=isRegExp,_.types.isRegExp=isRegExp,_.isObject=isObject,_.isDate=isDate,_.types.isDate=isDate,_.isError=isError,_.types.isNativeError=isError,_.isFunction=isFunction,_.isPrimitive=function isPrimitive(_){return null===_||"boolean"==typeof _||"number"==typeof _||"string"==typeof _||"symbol"==typeof _||void 0===_},_.isBuffer=yo;var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function hasOwnProperty(_,w){return Object.prototype.hasOwnProperty.call(_,w)}_.log=function(){console.log("%s - %s",function timestamp(){var _=new Date,w=[pad(_.getHours()),pad(_.getMinutes()),pad(_.getSeconds())].join(":");return[_.getDate(),L[_.getMonth()],w].join(" ")}(),_.format.apply(_,arguments))},_.inherits=bo.exports,_._extend=function(_,w){if(!w||!isObject(w))return _;for(var E=Object.keys(w),C=E.length;C--;)_[E[C]]=w[E[C]];return _};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function callbackifyOnRejected(_,w){if(!_){var E=new Error("Promise was rejected with a falsy value");E.reason=_,_=E}return w(_)}_.promisify=function promisify(_){if("function"!=typeof _)throw new TypeError('The "original" argument must be of type Function');if(I&&_[I]){var E;if("function"!=typeof(E=_[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(E,I,{value:E,enumerable:!1,writable:!1,configurable:!0}),E}function E(){for(var w,E,C=new Promise((function(_,C){w=_,E=C})),P=[],R=0;R<arguments.length;R++)P.push(arguments[R]);P.push((function(_,C){_?E(_):w(C)}));try{_.apply(this,P)}catch(_){E(_)}return C}return Object.setPrototypeOf(E,Object.getPrototypeOf(_)),I&&Object.defineProperty(E,I,{value:E,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(E,w(_))},_.promisify.custom=I,_.callbackify=function callbackify(_){if("function"!=typeof _)throw new TypeError('The "original" argument must be of type Function');function callbackified(){for(var w=[],E=0;E<arguments.length;E++)w.push(arguments[E]);var C=w.pop();if("function"!=typeof C)throw new TypeError("The last argument must be of type Function");var P=this,cb=function(){return C.apply(P,arguments)};_.apply(this,w).then((function(_){process.nextTick(cb.bind(null,null,_))}),(function(_){process.nextTick(callbackifyOnRejected.bind(null,_,cb))}))}return Object.setPrototypeOf(callbackified,Object.getPrototypeOf(_)),Object.defineProperties(callbackified,w(_)),callbackified}}(qe),function(_){_[_.SUCCESS=0]="SUCCESS",_[_.FAILED=1]="FAILED"}(mo||(mo={}));class CompositePropagator{constructor(_={}){this._propagators=_.propagators??[];const w=new Set;for(const _ of this._propagators){const E="function"==typeof _.fields?_.fields():[];for(const _ of E)w.add(_)}this._fields=Array.from(w)}inject(_,w,E){for(const C of this._propagators)try{C.inject(_,w,E)}catch(_){Ie.warn(`Failed to inject with ${C.constructor.name}. Err: ${_.message}`)}}extract(_,w,E){return this._propagators.reduce(((_,C)=>{try{return C.extract(_,w,E)}catch(_){Ie.warn(`Failed to extract with ${C.constructor.name}. Err: ${_.message}`)}return _}),_)}fields(){return this._fields.slice()}}const So="[_0-9a-z-*/]",wo=new RegExp(`^(?:${`[a-z]${So}{0,255}`}|${`[a-z0-9]${So}{0,240}@[a-z]${So}{0,13}`})$`),Eo=/^[ -~]{0,255}[!-~]$/,To=/,|=/;function validateKey(_){return wo.test(_)}function validateValue(_){return Eo.test(_)&&!To.test(_)}class TraceState{constructor(_){this._rawTraceState="string"==typeof _?_:"",this._length=this._rawTraceState.length}set(_,w){if(!validateKey(_)||!validateValue(w))return this;const E=this._getState(),C=E.get(_);let P=this._length;if(P+="string"==typeof C?w.length-C.length:_.length+w.length+(E.size>0?2:1),P>512)return this;const R=new Map(E);return R.delete(_),R.set(_,w),this._fromState(R,P)}unset(_){const w=this._getState(),E=w.get(_);if("string"!=typeof E)return this;let C=this._length-(_.length+E.length+1);w.size>1&&(C-=1);const P=new Map(w);return P.delete(_),this._fromState(P,C)}get(_){return this._getState().get(_)}serialize(){let _="",w=0;for(const E of this._getState())w>0&&(_=","+_),_=`${E[0]}=${E[1]}`+_,w++;return _}_getState(){if(this._internalState)return this._internalState;const _=this._rawTraceState.split(","),w=new Map;let E=0;for(const C of _){const _=C.trim(),P=_.indexOf("=");if(-1===P)continue;const R=_.slice(0,P),L=_.slice(P+1);if(!validateKey(R)||!validateValue(L))continue;const I=E+_.length+(w.size>0?1:0);if(!(I>512)&&(w.set(R,L),E=I,w.size>=32))break}return this._length=E,this._internalState=new Map(Array.from(w.entries()).reverse()),this._internalState}_fromState(_,w){const E=Object.create(TraceState.prototype);return E._internalState=_,E._length=w,E}}const Ao="traceparent",Oo="tracestate",Co=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class W3CTraceContextPropagator{inject(_,w,E){const C=Ue.getSpanContext(_);if(!C||isTracingSuppressed$1(_)||!isSpanContextValid(C))return;const P=`00-${C.traceId}-${C.spanId}-0${Number(C.traceFlags||_e.NONE).toString(16)}`;E.set(w,Ao,P),C.traceState&&E.set(w,Oo,C.traceState.serialize())}extract(_,w,E){const C=E.get(w,Ao);if(!C)return _;const P=Array.isArray(C)?C[0]:C;if("string"!=typeof P)return _;const R=function parseTraceParent(_){const w=Co.exec(_);return w?"00"===w[1]&&w[5]?null:{traceId:w[2],spanId:w[3],traceFlags:parseInt(w[4],16)}:null}(P);if(!R)return _;R.isRemote=!0;const L=E.get(w,Oo);if(L){const _=Array.isArray(L)?L.join(","):L;R.traceState=new TraceState("string"==typeof _?_:void 0)}return Ue.setSpanContext(_,R)}fields(){return[Ao,Oo]}}const Po={},Ro=createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function parseKeyPairsIntoRecord(_){const w={};return"string"==typeof _&&_.length>0&&_.split(",").forEach((_=>{const E=function parsePairKeyValue(_){if(!_)return;const w=_.indexOf(";"),E=-1===w?_:_.substring(0,w),C=E.indexOf("=");if(C<=0)return;const P=E.substring(0,C).trim(),R=E.substring(C+1).trim();if(!P||!R)return;let L,I,k;try{L=decodeURIComponent(P),I=decodeURIComponent(R)}catch{return}-1!==w&&w<_.length-1&&(k=baggageEntryMetadataFromString(_.substring(w+1)));return{key:L,value:I,metadata:k}}(_);void 0!==E&&E.value.length>0&&(w[E.key]=E.value)})),w}let xo=function loggingErrorHandler$1(){return _=>{Ie.error(function stringifyException$1(_){return"string"==typeof _?_:JSON.stringify(function flattenException$1(_){const w={};let E=_;for(;null!==E;)Object.getOwnPropertyNames(E).forEach((_=>{if(w[_])return;const C=E[_];C&&(w[_]=String(C))})),E=Object.getPrototypeOf(E);return w}(_))}(_))}}();function globalErrorHandler$1(_){try{xo(_)}catch{}}function getStringFromEnv$1(_){const w=process.env[_];if(null!=w&&""!==w.trim())return w}function getStringListFromEnv(_){return getStringFromEnv$1(_)?.split(",").map((_=>_.trim())).filter((_=>""!==_))}const Lo="error.type",Io="exception.message",No="exception.stacktrace",Do="exception.type",ko="http.request.method",Fo="http.request.method_original",jo="http.response.status_code",Mo="server.address",$o="server.port",Bo="service.name",Uo="telemetry.sdk.language",Vo="nodejs",Ho="telemetry.sdk.name",zo="telemetry.sdk.version",qo="url.full",Wo="process.runtime.name",Go={[Ho]:"opentelemetry",[Wo]:"node",[Uo]:Vo,[zo]:"2.9.0"},Ko=performance,Qo=Math.pow(10,6),Xo=Math.pow(10,9);function millisToHrTime$1(_){const w=_/1e3;return[Math.trunc(w),Math.round(_%1e3*Qo)]}function hrTime$1(_){return function addHrTimes$1(_,w){const E=[_[0]+w[0],_[1]+w[1]];E[1]>=Xo&&(E[1]-=Xo,E[0]+=1);return E}(millisToHrTime$1(Ko.timeOrigin),millisToHrTime$1("number"==typeof _?_:Ko.now()))}function timeInputToHrTime(_){if(function isTimeInputHrTime$1(_){return Array.isArray(_)&&2===_.length&&"number"==typeof _[0]&&"number"==typeof _[1]}(_))return _;if("number"==typeof _)return _<Ko.timeOrigin/2?hrTime$1(_):millisToHrTime$1(_);if(_ instanceof Date)return millisToHrTime$1(_.getTime());throw TypeError("Invalid input type")}function hrTimeToNanoseconds(_){return _[0]*Xo+_[1]}var Jo;!function(_){_[_.SUCCESS=0]="SUCCESS",_[_.FAILED=1]="FAILED"}(Jo||(Jo={}));class TimeoutError extends Error{constructor(_){super(_),Object.setPrototypeOf(this,TimeoutError.prototype)}}function urlMatches(_,w){return"string"==typeof w?_===w:!!_.match(w)}function isUrlIgnored(_,w){if(!w)return!1;for(const E of w)if(urlMatches(_,E))return!0;return!1}let Zo,Yo=class Deferred{constructor(){this._promise=new Promise(((_,w)=>{this._resolve=_,this._reject=w}))}get promise(){return this._promise}resolve(_){this._resolve(_)}reject(_){this._reject(_)}},ei=class BindOnceFuture{constructor(_,w){this._isCalled=!1,this._deferred=new Yo,this._callback=_,this._that=w}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(..._){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,..._)).then((_=>this._deferred.resolve(_)),(_=>this._deferred.reject(_)))}catch(_){this._deferred.reject(_)}}return this._deferred.promise}};function defaultServiceName$1(){if(void 0===Zo)try{const _=globalThis.process.argv0;Zo=_?`unknown_service:${_}`:"unknown_service"}catch{Zo="unknown_service"}return Zo}const isPromiseLike$2=_=>null!==_&&"object"==typeof _&&"function"==typeof _.then;let ti=class ResourceImpl{static FromAttributeList(_,w){const E=new ResourceImpl({},w);return E._rawAttributes=guardedRawAttributes$2(_),E._asyncAttributesPending=_.filter((([_,w])=>isPromiseLike$2(w))).length>0,E}constructor(_,w){this._asyncAttributesPending=!1;const E=_.attributes??{};this._rawAttributes=Object.entries(E).map((([_,w])=>(isPromiseLike$2(w)&&(this._asyncAttributesPending=!0),[_,w]))),this._rawAttributes=guardedRawAttributes$2(this._rawAttributes),this._schemaUrl=function validateSchemaUrl$2(_){if("string"==typeof _||void 0===_)return _;return void Ie.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",_)}(w?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let _=0;_<this._rawAttributes.length;_++){const[w,E]=this._rawAttributes[_];this._rawAttributes[_]=[w,isPromiseLike$2(E)?await E:E]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Ie.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const _={};for(const[w,E]of this._rawAttributes)isPromiseLike$2(E)?Ie.debug(`Unsettled resource attribute ${w} skipped`):null!=E&&(_[w]??(_[w]=E));return this._asyncAttributesPending||(this._memoizedAttributes=_),_}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(_){if(null==_)return this;const w=function mergeSchemaUrl$2(_,w){const E=_?.schemaUrl,C=w?.schemaUrl,P=void 0===E||""===E,R=void 0===C||""===C;if(P)return C;if(R)return E;if(E===C)return E;return void Ie.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',E,C)}(this,_),E=w?{schemaUrl:w}:void 0;return ResourceImpl.FromAttributeList([..._.getRawAttributes(),...this.getRawAttributes()],E)}};function defaultResource$1(){return function resourceFromAttributes$2(_,w){return ti.FromAttributeList(Object.entries(_),w)}({[Bo]:defaultServiceName$1(),[Uo]:Go[Uo],[Ho]:Go[Ho],[zo]:Go[zo]})}function guardedRawAttributes$2(_){return _.map((([_,w])=>isPromiseLike$2(w)?[_,w.catch((w=>{Ie.debug("promise rejection for resource attribute: %s - %s",_,w)}))]:[_,w]))}function isLogAttributeValue(_){return isLogAttributeValueInternal(_,new WeakSet)}function isLogAttributeValueInternal(_,w){if(null==_)return!0;if("string"==typeof _||"number"==typeof _||"boolean"==typeof _)return!0;if(_ instanceof Uint8Array)return!0;if("object"==typeof _){if(w.has(_))return!1;if(w.add(_),Array.isArray(_)){for(const E of _)if(!isLogAttributeValueInternal(E,w))return!1;return!0}const E=_;if(E.constructor!==Object&&void 0!==E.constructor)return!1;for(const _ in E)if(Object.prototype.hasOwnProperty.call(E,_)&&!isLogAttributeValueInternal(E[_],w))return!1;return!0}return!1}var ri;function addAttribute(_,w,E,C,P){if(0===C.length)return Ie.warn(`Invalid attribute key: ${C}`),ri.DROP_INVALID;if(!isLogAttributeValue(P))return Ie.warn(`Invalid attribute value set for key: ${C}`),ri.DROP_INVALID;const R=!Object.prototype.hasOwnProperty.call(_,C);return R&&E>=w.attributeCountLimit?ri.DROP_LIMIT_REACHED:(_[C]=truncateToSize(P,w.attributeValueLengthLimit),R?ri.ADD_NEW:ri.ADD_OVERWRITE_EXISTING)}function truncateToSize(_,w){if(w<=0)return Ie.warn(`Attribute value limit must be positive, got ${w}`),_;if(null==_)return _;if("string"==typeof _)return _.length<=w?_:_.substring(0,w);if(_ instanceof Uint8Array)return _;if(Array.isArray(_))return _.map((_=>truncateToSize(_,w)));if("object"==typeof _){const E={};for(const[C,P]of Object.entries(_))E[C]=truncateToSize(P,w);return E}return _}function normalizeScopeAttributes(_,w){if(null==w)return{};const E={};let C=0,P=0;for(const[R,L]of Object.entries(w)){const w=addAttribute(E,_,C,R,L);w===ri.ADD_NEW?C+=1:(w===ri.DROP_INVALID||w===ri.DROP_LIMIT_REACHED)&&(P+=1)}return{attributes:C>0?E:void 0,droppedAttributesCount:P}}!function(_){_[_.DROP_INVALID=0]="DROP_INVALID",_[_.DROP_LIMIT_REACHED=1]="DROP_LIMIT_REACHED",_[_.ADD_NEW=2]="ADD_NEW",_[_.ADD_OVERWRITE_EXISTING=3]="ADD_OVERWRITE_EXISTING"}(ri||(ri={}));class LogRecordImpl{set severityText(_){this._isLogRecordReadonly()||(this._severityText=_)}get severityText(){return this._severityText}set severityNumber(_){this._isLogRecordReadonly()||(this._severityNumber=_)}get severityNumber(){return this._severityNumber}set body(_){this._isLogRecordReadonly()||(this._body=_)}get body(){return this._body}get eventName(){return this._eventName}set eventName(_){this._isLogRecordReadonly()||(this._eventName=_)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(_,w,E){this.attributes={},this._attributesCount=0,this._droppedAttributesCount=0,this._isReadonly=!1;const{timestamp:C,observedTimestamp:P,eventName:R,severityNumber:L,severityText:I,body:k,attributes:F={},exception:j,context:$}=E,V=Date.now();if(this.hrTime=timeInputToHrTime(C??V),this.hrTimeObserved=timeInputToHrTime(P??V),$){const _=Ue.getSpanContext($);_&&isSpanContextValid(_)&&(this.spanContext=_)}this.severityNumber=L,this.severityText=I,this.body=k,this.resource=_.resource,this.instrumentationScope=w,this._logRecordLimits=_.logRecordLimits,this._eventName=R,this.setAttributes(F),null!=j&&this._setException(j)}setAttribute(_,w){if(this._isLogRecordReadonly())return this;const E=addAttribute(this.attributes,this._logRecordLimits,this._attributesCount,_,w);return 1===E?(this._droppedAttributesCount++,1===this._droppedAttributesCount&&Ie.warn("Dropping extra attributes.")):2===E&&this._attributesCount++,this}setAttributes(_){for(const[w,E]of Object.entries(_))this.setAttribute(w,E);return this}setBody(_){return this.body=_,this}setEventName(_){return this.eventName=_,this}setSeverityNumber(_){return this.severityNumber=_,this}setSeverityText(_){return this.severityText=_,this}_makeReadonly(){this._isReadonly=!0}_setException(_){let w=!1;if("string"==typeof _||"number"==typeof _)Object.hasOwn(this.attributes,Io)||this.setAttribute(Io,String(_)),w=!0;else if(_&&"object"==typeof _){const E=_;E.code?(Object.hasOwn(this.attributes,Do)||this.setAttribute(Do,E.code.toString()),w=!0):E.name&&(Object.hasOwn(this.attributes,Do)||this.setAttribute(Do,E.name),w=!0),E.message&&(Object.hasOwn(this.attributes,Io)||this.setAttribute(Io,E.message),w=!0),E.stack&&(Object.hasOwn(this.attributes,No)||this.setAttribute(No,E.stack),w=!0)}w||Ie.warn(`Failed to record an exception ${_}`)}_isLogRecordReadonly(){return this._isReadonly&&Ie.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class Logger{constructor(_,w){this._instrumentationScope=_,this._sharedState=w,this._loggerConfig=this._sharedState.getLoggerConfig(this._instrumentationScope)}emit(_){const w=_.context||Le.active();if(!this.enabled(_))return;const E=new LogRecordImpl(this._sharedState,this._instrumentationScope,{context:w,..._});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(E,w),E._makeReadonly()}enabled(_){if(this._sharedState.hasShutdown)return!1;const w=this._loggerConfig;if(w.disabled)return!1;const E=_?.severityNumber;if("number"==typeof E&&E!==z.UNSPECIFIED&&E<w.minimumSeverity)return!1;const C=_?.context||Le.active();if(w.traceBased){const _=Ue.getSpanContext(C);if(_&&isSpanContextValid(_)){if(!((_.traceFlags&_e.SAMPLED)===_e.SAMPLED))return!1}}const P={context:C,instrumentationScope:this._instrumentationScope,severityNumber:_?.severityNumber,eventName:_?.eventName};for(const _ of this._sharedState.processors)if(!_.enabled||_.enabled(P))return!0;return!1}}class NoopLogRecordProcessor{forceFlush(){return Promise.resolve()}onEmit(_,w){}shutdown(){return Promise.resolve()}enabled(_){return!1}}class MultiLogRecordProcessor{constructor(_,w){this.processors=_,this.forceFlushTimeoutMillis=w}async forceFlush(){const _=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map((w=>function callWithTimeout(_,w){let E;const C=new Promise((function timeoutFunction(_,C){E=setTimeout((function timeoutHandler(){C(new TimeoutError("Operation timed out."))}),w)}));return Promise.race([_,C]).then((_=>(clearTimeout(E),_)),(_=>{throw clearTimeout(E),_}))}(w.forceFlush(),_))))}onEmit(_,w){this.processors.forEach((E=>E.onEmit(_,w)))}async shutdown(){await Promise.all(this.processors.map((_=>_.shutdown())))}enabled(_){for(const w of this.processors)if(!w.enabled||w.enabled(_))return!0;return!1}}function normalizeAnyValue(_){if(void 0===_)return["u",null];if(null===_)return["n",null];const w=typeof _;return"string"===w?["s",_]:"boolean"===w?["b",_]:"number"===w?Number.isNaN(_)?["nan",null]:_===1/0?["inf",null]:_===-1/0?["-inf",null]:Object.is(_,-0)?["n0",null]:["d",_]:_ instanceof Uint8Array?["bytes",Array.from(_)]:Array.isArray(_)?["arr",_.map(normalizeAnyValue)]:["map",Object.entries(_).sort((([_],[w])=>_.localeCompare(w))).map((([_,w])=>[_,normalizeAnyValue(w)]))]}function getInstrumentationScopeKey(_){return JSON.stringify([_.name,_.version||"",_.schemaUrl||"",normalizeAnyValue(_.attributes),_.droppedAttributesCount??0])}class LoggerMetrics{constructor(_){this.createdLogs=_.createCounter("otel.sdk.log.created",{unit:"{log_record}",description:"The number of logs submitted to enabled SDK Loggers."})}emitLog(){this.createdLogs.add(1)}}const ni={disabled:!1,minimumSeverity:z.UNSPECIFIED,traceBased:!1},DEFAULT_LOGGER_CONFIGURATOR=()=>({...ni});class LoggerProviderSharedState{constructor(_,w,E,C,P,R){this.loggers=new Map,this.registeredLogRecordProcessors=[],this.hasShutdown=!1,this._loggerConfigs=new Map,this.resource=_,this.forceFlushTimeoutMillis=w,this.logRecordLimits=E,this.processors=C,C.length>0?(this.registeredLogRecordProcessors=C,this.activeProcessor=new MultiLogRecordProcessor(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new NoopLogRecordProcessor,this._loggerConfigurator=P??DEFAULT_LOGGER_CONFIGURATOR;const L=R?R.getMeter("@opentelemetry/sdk-logs","0.220.0"):createNoopMeter();this.loggerMetrics=new LoggerMetrics(L)}getLoggerConfig(_){const w=getInstrumentationScopeKey(_);let E=this._loggerConfigs.get(w);return E||(E=this._loggerConfigurator(_),this._loggerConfigs.set(w,E),E)}}class LoggerProvider{constructor(_={}){const w={resource:_.resource??defaultResource$1(),forceFlushTimeoutMillis:_.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:_.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:_.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:_.loggerConfigurator??DEFAULT_LOGGER_CONFIGURATOR,processors:_.processors??[],meterProvider:_.meterProvider};this._sharedState=new LoggerProviderSharedState(w.resource,w.forceFlushTimeoutMillis,w.logRecordLimits,w.processors,w.loggerConfigurator,w.meterProvider),this._shutdownOnce=new ei(this._shutdown,this)}getLogger(_,w,E){if(this._shutdownOnce.isCalled)return Ie.warn("A shutdown LoggerProvider cannot provide a Logger"),function createNoopLogger(){return q}();_||Ie.warn("Logger requested without instrumentation scope name.");const C={name:_||"unknown",version:w,schemaUrl:E?.schemaUrl,...normalizeScopeAttributes(this._sharedState.logRecordLimits,E?.attributes)},P=getInstrumentationScopeKey(C);return this._sharedState.loggers.has(P)||this._sharedState.loggers.set(P,new Logger(C,this._sharedState)),this._sharedState.loggers.get(P)}forceFlush(){return this._shutdownOnce.isCalled?(Ie.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Ie.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.hasShutdown=!0,this._sharedState.activeProcessor.shutdown()}}class ExportOperation{constructor(_,w,E){this._exportScheduledPromise=new Promise((_=>{this._exportScheduledResolve=_})),this._exportCompleted=this._executeExport(_,w,E)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(_,w,E){try{await async function waitForResources(_){const w=[];for(let E=0,C=_.length;E<C;E++){const C=_[E];C.resource.asyncAttributesPending&&C.resource.waitForAsyncAttributes&&w.push(C.resource.waitForAsyncAttributes())}null!=w&&w.length>0&&await Promise.all(w)}(w),await Le.with(function suppressTracing$1(_){return _.setValue(Ro,!0)}(Le.active()),(async()=>this._exportWithTimeout(_,w,E)))}catch(_){globalErrorHandler$1(_),this._exportScheduledResolve()}}async _exportWithTimeout(_,w,E){return new Promise(((C,P)=>{const R=setTimeout((()=>{P(new Error("Timeout"))}),E);_.export(w,(_=>{clearTimeout(R),_.code===Jo.SUCCESS?C():P(_.error??new Error("BatchLogRecordProcessor: log record export failed"))})),this._exportScheduledResolve()}))}}class BatchLogRecordProcessorBase{constructor(_){this._currentExport=null,this._finishedLogRecords=[],this._flushing=!1,this._exporter=_.exporter,this._maxExportBatchSize=_.maxExportBatchSize??512,this._maxQueueSize=_.maxQueueSize??2048,this._scheduledDelayMillis=_.scheduledDelayMillis??1e3,this._exportTimeoutMillis=_.exportTimeoutMillis??3e4,this._shutdownOnce=new ei(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ie.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(_){this._shutdownOnce.isCalled||this._addToBuffer(_)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(_){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(_),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let _=this._finishedLogRecords;this._finishedLogRecords=[],this._clearTimer();const w=this._currentExport;for(null!==w&&(await this._exporter.forceFlush(),await w.exportCompleted,this._currentExport=null);_.length>0;){let w;_.length<=this._maxExportBatchSize?(w=_,_=[]):w=_.splice(0,this._maxExportBatchSize);const E=new ExportOperation(this._exporter,w,this._exportTimeoutMillis);this._currentExport=E;try{await E.exportScheduled,await this._exporter.forceFlush(),await E.exportCompleted}catch(_){globalErrorHandler$1(_)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(0===this._finishedLogRecords.length)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){const _=this._finishedLogRecords;return this._finishedLogRecords=[],_}return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();const _=this._extractBatch();if(null===_)return;const w=new ExportOperation(this._exporter,_,this._exportTimeoutMillis);this._currentExport=w,w.exportCompleted.then((()=>{this._currentExport=null,this._maybeStartTimer()})).catch((_=>{this._currentExport=null,globalErrorHandler$1(_),this._maybeStartTimer()}))}_maybeStartTimer(){this._shutdownOnce.isCalled||this._flushing||0!==this._finishedLogRecords.length&&null===this._currentExport&&(this._finishedLogRecords.length>=this._maxExportBatchSize?this._exportOneBatch():void 0===this._timer&&(this._timer=setTimeout((()=>{this._timer=void 0,this._exportOneBatch()}),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref()))}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class BatchLogRecordProcessor extends BatchLogRecordProcessorBase{onShutdown(){}}const oi="service.name",isPromiseLike$1=_=>null!==_&&"object"==typeof _&&"function"==typeof _.then;let ii=class ResourceImpl{static FromAttributeList(_,w){const E=new ResourceImpl({},w);return E._rawAttributes=guardedRawAttributes$1(_),E._asyncAttributesPending=_.filter((([_,w])=>isPromiseLike$1(w))).length>0,E}constructor(_,w){this._asyncAttributesPending=!1;const E=_.attributes??{};this._rawAttributes=Object.entries(E).map((([_,w])=>(isPromiseLike$1(w)&&(this._asyncAttributesPending=!0),[_,w]))),this._rawAttributes=guardedRawAttributes$1(this._rawAttributes),this._schemaUrl=function validateSchemaUrl$1(_){if("string"==typeof _||void 0===_)return _;return void Ie.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",_)}(w?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let _=0;_<this._rawAttributes.length;_++){const[w,E]=this._rawAttributes[_];this._rawAttributes[_]=[w,isPromiseLike$1(E)?await E:E]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Ie.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const _={};for(const[w,E]of this._rawAttributes)isPromiseLike$1(E)?Ie.debug(`Unsettled resource attribute ${w} skipped`):null!=E&&(_[w]??(_[w]=E));return this._asyncAttributesPending||(this._memoizedAttributes=_),_}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(_){if(null==_)return this;const w=function mergeSchemaUrl$1(_,w){const E=_?.schemaUrl,C=w?.schemaUrl,P=void 0===E||""===E,R=void 0===C||""===C;if(P)return C;if(R)return E;if(E===C)return E;return void Ie.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',E,C)}(this,_),E=w?{schemaUrl:w}:void 0;return ResourceImpl.FromAttributeList([..._.getRawAttributes(),...this.getRawAttributes()],E)}};function resourceFromAttributes$1(_,w){return ii.FromAttributeList(Object.entries(_),w)}function guardedRawAttributes$1(_){return _.map((([_,w])=>isPromiseLike$1(w)?[_,w.catch((w=>{Ie.debug("promise rejection for resource attribute: %s - %s",_,w)}))]:[_,w]))}function estimateVarintSize(_){return _<0?10:_<128?1:_<16384?2:_<2097152?3:_<268435456?4:_<34359738368?5:_<4398046511104?6:_<562949953421312?7:_<72057594037927940?8:9}class ProtobufWriter{constructor(_=65536){this.pos=0,this._buffer=new Uint8Array(_),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(_){const w=this.pos+_;if(w<=this._buffer.length)return;Ie.debug("ProtobufWriter: estimated size was too small, growing buffer.");let E=2*this._buffer.length;for(;E<w;)E*=2;const C=new Uint8Array(E);C.set(this._buffer),this._buffer=C,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){const _=this.pos;return this._ensureCapacity(1),this.pos+=1,_}finishLengthDelimited(_,w){const E=w>>>0,C=estimateVarintSize(E);if(C>1){const w=C-1;this._ensureCapacity(w),this._buffer.copyWithin(_+C,_+1,this.pos),this.pos+=w}let P=_;E<128?this._buffer[P]=E:E<16384?(this._buffer[P++]=127&E|128,this._buffer[P]=E>>>7):E<2097152?(this._buffer[P++]=127&E|128,this._buffer[P++]=E>>>7&127|128,this._buffer[P]=E>>>14):E<268435456?(this._buffer[P++]=127&E|128,this._buffer[P++]=E>>>7&127|128,this._buffer[P++]=E>>>14&127|128,this._buffer[P]=E>>>21):(this._buffer[P++]=127&E|128,this._buffer[P++]=E>>>7&127|128,this._buffer[P++]=E>>>14&127|128,this._buffer[P++]=E>>>21&127|128,this._buffer[P]=E>>>28)}writeSint32(_){this.writeVarint((_<<1^_>>31)>>>0)}writeSfixed64(_){let w,E;if(_>=0)w=_>>>0,E=_/4294967296>>>0;else{const C=Math.abs(_);w=C>>>0,E=C/4294967296>>>0,w=~w>>>0,E=~E>>>0,w=w+1>>>0,0===w&&(E=E+1>>>0)}this.writeFixed64(w,E)}writeVarint(_){if(this._ensureCapacity(estimateVarintSize(_)),_>=0&&_<=4294967295){let w=_>>>0;for(;w>127;)this._buffer[this.pos++]=127&w|128,w>>>=7;this._buffer[this.pos++]=w}else{let w,E;if(_>=0)w=_>>>0,E=_/4294967296>>>0;else{const C=Math.abs(_);w=C>>>0,E=C/4294967296>>>0,w=~w>>>0,E=~E>>>0,w=w+1>>>0,0===w&&(E=E+1>>>0)}for(;E>0||w>127;)this._buffer[this.pos++]=127&w|128,w=(w>>>7|E<<25)>>>0,E>>>=7;this._buffer[this.pos++]=127&w}}writeFixed32(_){this._ensureCapacity(4);const w=_>>>0;this._buffer[this.pos++]=255&w,this._buffer[this.pos++]=w>>>8&255,this._buffer[this.pos++]=w>>>16&255,this._buffer[this.pos++]=w>>>24&255}writeFixed64(_,w){this._ensureCapacity(8);const E=_>>>0,C=w>>>0;this._buffer[this.pos++]=255&E,this._buffer[this.pos++]=E>>>8&255,this._buffer[this.pos++]=E>>>16&255,this._buffer[this.pos++]=E>>>24&255,this._buffer[this.pos++]=255&C,this._buffer[this.pos++]=C>>>8&255,this._buffer[this.pos++]=C>>>16&255,this._buffer[this.pos++]=C>>>24&255}writeBytes(_){this.writeVarint(_.length),this._ensureCapacity(_.length),this._buffer.set(_,this.pos),this.pos+=_.length}writeTag(_,w){this.writeVarint(_<<3|w)}writeDouble(_){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,_,!0),this.pos+=8}writeString(_){let w=!0;const E=_.length;for(let C=0;C<E;C++)if(_.charCodeAt(C)>127){w=!1;break}if(w){this.writeVarint(E),this._ensureCapacity(E);for(let w=0;w<E;w++)this._buffer[this.pos++]=_.charCodeAt(w)}else{const w=this._textEncoder.encode(_);this.writeBytes(w)}}}function intValue(_){return _>=48&&_<=57?_-48:_>=97&&_<=102?_-87:_-55}function hexToBinary(_){const w=new Uint8Array(_.length/2);let E=0;for(let C=0;C<_.length;C+=2){const P=intValue(_.charCodeAt(C)),R=intValue(_.charCodeAt(C+1));w[E++]=P<<4|R}return w}function writeHrTimeAsFixed64(_,w){const E=w[0],C=1e9,P=(65535&E)*C,R=(E/65536>>>0)*C,L=(P>>>0)+(65536*(65535&R)>>>0)+w[1],I=L>>>0,k=Math.floor(P/4294967296)+(R/65536>>>0)+Math.floor(L/4294967296)>>>0;_.writeFixed64(I,k)}function writeAttributes(_,w,E){for(const C in w){if(!Object.prototype.hasOwnProperty.call(w,C))continue;const P=w[C];_.writeTag(E,2);const R=_.startLengthDelimited(),L=_.pos;writeKeyValue(_,C,P),_.finishLengthDelimited(R,_.pos-L)}}function writeKeyValue(_,w,E){_.writeTag(1,2),_.writeString(w),_.writeTag(2,2);const C=_.startLengthDelimited(),P=_.pos;writeAnyValue(_,E),_.finishLengthDelimited(C,_.pos-P)}const si=-0x8000000000000000,ai=2**63;function writeAnyValue(_,w){const E=typeof w;if("string"===E)_.writeTag(1,2),_.writeString(w);else if("boolean"===E)_.writeTag(2,0),_.writeVarint(w?1:0);else if("number"===E){const E=w;Number.isInteger(E)&&E>=si&&E<ai?(_.writeTag(3,0),_.writeVarint(E)):(_.writeTag(4,1),_.writeDouble(E))}else if(w instanceof Uint8Array)_.writeTag(7,2),_.writeBytes(w);else if(Array.isArray(w)){_.writeTag(5,2);const E=_.startLengthDelimited(),C=_.pos;for(const E of w){_.writeTag(1,2);const w=_.startLengthDelimited(),C=_.pos;writeAnyValue(_,E),_.finishLengthDelimited(w,_.pos-C)}_.finishLengthDelimited(E,_.pos-C)}else if("object"===E&&null!=w){_.writeTag(6,2);const E=_.startLengthDelimited(),C=_.pos,P=w;for(const w in P){if(!Object.prototype.hasOwnProperty.call(P,w))continue;const E=P[w];_.writeTag(1,2);const C=_.startLengthDelimited(),R=_.pos;_.writeTag(1,2),_.writeString(w),_.writeTag(2,2);const L=_.startLengthDelimited(),I=_.pos;writeAnyValue(_,E),_.finishLengthDelimited(L,_.pos-I),_.finishLengthDelimited(C,_.pos-R)}_.finishLengthDelimited(E,_.pos-C)}}class ProtobufSizeEstimator{constructor(){this.pos=0}startLengthDelimited(){return this.pos}finishLengthDelimited(_,w){this.pos+=estimateVarintSize(w)}writeVarint(_){this.pos+=estimateVarintSize(_)}writeSint32(_){this.pos+=estimateVarintSize((_<<1^_>>31)>>>0)}writeSfixed64(_){this.pos+=8}writeFixed32(_){this.pos+=4}writeFixed64(_,w){this.pos+=8}writeBytes(_){this.pos+=estimateVarintSize(_.length),this.pos+=_.length}writeTag(_,w){this.writeVarint(_<<3|w)}writeDouble(_){this.pos+=8}writeString(_){const w=function utf8ByteLength(_){const w=_.length;let E=0;for(let C=0;C<w;C++){const w=_.charCodeAt(C);w<128?E+=1:w<2048?E+=2:w<55296||w>=57344?E+=3:(C++,E+=4)}return E}(_);this.pos+=estimateVarintSize(w),this.pos+=w}}class ProtobufReader{constructor(_){this.pos=0,this._buf=_,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){const _=this.readVarint();return{fieldNumber:_>>>3,wireType:7&_}}readVarint(){let _=0,w=0,E=!1;for(;this.pos<this._buf.length;){const C=this._buf[this.pos++];if(_+=(127&C)*Math.pow(2,w),w+=7,!(128&C)){E=!0;break}}if(!E)throw new Error("Truncated buffer: unexpected end of data while reading varint");return _}readBytes(){const _=this.readVarint();if(this.pos+_>this._buf.length)throw new Error(`Truncated buffer: expected ${_} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);const w=this._buf.subarray(this.pos,this.pos+_);return this.pos+=_,w}readString(){return this._textDecoder.decode(this.readBytes())}skip(_){switch(_){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${_}, cannot safely skip`)}}}function buildSpanFlags(_,w){let E=255&_|256;return w&&(E|=512),E}function serializeEvent(_,w){const E=_.startLengthDelimited(),C=_.pos;_.writeTag(1,1),writeHrTimeAsFixed64(_,w.time),_.writeTag(2,2),_.writeString(w.name),w.attributes&&writeAttributes(_,w.attributes,3),_.writeTag(4,0),_.writeVarint(w.droppedAttributesCount||0),_.finishLengthDelimited(E,_.pos-C)}function serializeLink(_,w){const E=_.startLengthDelimited(),C=_.pos,P=w.context;_.writeTag(1,2),_.writeBytes(hexToBinary(P.traceId)),_.writeTag(2,2),_.writeBytes(hexToBinary(P.spanId));const R=P.traceState?.serialize();R&&(_.writeTag(3,2),_.writeString(R)),w.attributes&&writeAttributes(_,w.attributes,4),_.writeTag(5,0),_.writeVarint(w.droppedAttributesCount||0);const L=buildSpanFlags(P.traceFlags,P.isRemote);L&&(_.writeTag(6,5),_.writeFixed32(L)),_.finishLengthDelimited(E,_.pos-C)}function serializeSpan(_,w){const E=_.startLengthDelimited(),C=_.pos,P=w.spanContext();_.writeTag(1,2),_.writeBytes(hexToBinary(P.traceId)),_.writeTag(2,2),_.writeBytes(hexToBinary(P.spanId));const R=P.traceState?.serialize();R&&(_.writeTag(3,2),_.writeString(R)),w.parentSpanContext?.spanId&&(_.writeTag(4,2),_.writeBytes(hexToBinary(w.parentSpanContext.spanId))),_.writeTag(5,2),_.writeString(w.name);const L=null==w.kind?0:w.kind+1;0!==L&&(_.writeTag(6,0),_.writeVarint(L)),_.writeTag(7,1),writeHrTimeAsFixed64(_,w.startTime),_.writeTag(8,1),writeHrTimeAsFixed64(_,w.endTime),w.attributes&&writeAttributes(_,w.attributes,9),_.writeTag(10,0),_.writeVarint(w.droppedAttributesCount);for(const E of w.events)_.writeTag(11,2),serializeEvent(_,E);_.writeTag(12,0),_.writeVarint(w.droppedEventsCount);for(const E of w.links)_.writeTag(13,2),serializeLink(_,E);_.writeTag(14,0),_.writeVarint(w.droppedLinksCount),_.writeTag(15,2),function serializeStatus(_,w){const E=_.startLengthDelimited(),C=_.pos;w.message&&(_.writeTag(2,2),_.writeString(w.message)),_.writeTag(3,0),_.writeVarint(w.code),_.finishLengthDelimited(E,_.pos-C)}(_,w.status);const I=buildSpanFlags(P.traceFlags,w.parentSpanContext?.isRemote);I&&(_.writeTag(16,5),_.writeFixed32(I)),_.finishLengthDelimited(E,_.pos-C)}function serializeScopeSpans(_,w,E){const C=_.startLengthDelimited(),P=_.pos;!function writeInstrumentationScope(_,w,E){_.writeTag(E,2);const C=_.startLengthDelimited(),P=_.pos;_.writeTag(1,2),_.writeString(w.name),w.version&&(_.writeTag(2,2),_.writeString(w.version)),w.attributes&&writeAttributes(_,w.attributes,3),w.droppedAttributesCount&&(_.writeTag(4,0),_.writeVarint(w.droppedAttributesCount)),_.finishLengthDelimited(C,_.pos-P)}(_,w,1);for(const w of E)_.writeTag(2,2),serializeSpan(_,w);w.schemaUrl&&(_.writeTag(3,2),_.writeString(w.schemaUrl)),_.finishLengthDelimited(C,_.pos-P)}function serializeResourceSpans(_,w,E){const C=_.startLengthDelimited(),P=_.pos;!function writeResource(_,w,E){_.writeTag(E,2);const C=_.startLengthDelimited(),P=_.pos;w.attributes&&writeAttributes(_,w.attributes,1),_.writeTag(2,0),_.writeVarint(0),_.finishLengthDelimited(C,_.pos-P)}(_,w,1);for(const w of E.values()){_.writeTag(2,2);serializeScopeSpans(_,w[0].instrumentationScope,w)}w.schemaUrl&&(_.writeTag(3,2),_.writeString(w.schemaUrl)),_.finishLengthDelimited(C,_.pos-P)}function serializeTraceExportRequest(_){const w=function createResourceMap$2(_){const w=new Map;for(const E of _){const _=E.resource,C=E.instrumentationScope;let P=w.get(_);P||(P=new Map,w.set(_,P));let R=P.get(C);R||(R=[],P.set(C,R)),R.push(E)}return w}(_),E=new ProtobufSizeEstimator;for(const[_,C]of w)E.writeTag(1,2),serializeResourceSpans(E,_,C);const C=new ProtobufWriter(E.pos);for(const[_,E]of w)C.writeTag(1,2),serializeResourceSpans(C,_,E);return C.finish()}function deserializePartialSuccess(_){const w=new ProtobufReader(_),E={};for(;!w.isAtEnd();){const{fieldNumber:_,wireType:C}=w.readTag();switch(_){case 1:0===C?E.rejectedSpans=w.readVarint():w.skip(C);break;case 2:2===C?E.errorMessage=w.readString():w.skip(C);break;default:w.skip(C)}}return E}const ci={serializeRequest:_=>serializeTraceExportRequest(_),deserializeResponse:_=>function deserializeExportTraceServiceResponse(_){const w=new ProtobufReader(_),E={};for(;!w.isAtEnd();){const{fieldNumber:_,wireType:C}=w.readTag();1===_&&2===C?E.partialSuccess=deserializePartialSuccess(w.readBytes()):w.skip(C)}return E}(_)};function createResource(_,w){const E={attributes:toAttributes(_.attributes,w),droppedAttributesCount:0},C=_.schemaUrl;return C&&""!==C&&(E.schemaUrl=C),E}function createInstrumentationScope(_,w){const E={name:_.name,version:_.version};return _.attributes&&Object.keys(_.attributes).length>0&&(E.attributes=toAttributes(_.attributes,w),E.droppedAttributesCount=_.droppedAttributesCount??0),E}function toAttributes(_,w){return Object.keys(_).map((E=>function toKeyValue(_,w,E){return{key:_,value:toAnyValue(w,E)}}(E,_[E],w)))}function toAnyValue(_,w){const E=typeof _;if("string"===E)return{stringValue:_};if("number"===E)return Number.isInteger(_)?{intValue:_}:{doubleValue:_};if("boolean"===E)return{boolValue:_};if(_ instanceof Uint8Array)return{bytesValue:w.encodeUint8Array(_)};if(Array.isArray(_)){const E=new Array(_.length);for(let C=0;C<_.length;C++)E[C]=toAnyValue(_[C],w);return{arrayValue:{values:E}}}if("object"===E&&null!=_){const E=Object.keys(_),C=new Array(E.length);for(let P=0;P<E.length;P++)C[P]={key:E[P],value:toAnyValue(_[E[P]],w)};return{kvlistValue:{values:C}}}return{}}function logRecordsToResourceLogs(_,w){const E=function createResourceMap$1(_){const w=new Map;for(const E of _){const{resource:_,instrumentationScope:C}=E;let P=w.get(_);P||(P=new Map,w.set(_,P));let R=P.get(C);R||(R=[],P.set(C,R)),R.push(E)}return w}(_);return Array.from(E,(([_,E])=>{const C=createResource(_,w);return{resource:C,scopeLogs:Array.from(E,(([,_])=>({scope:createInstrumentationScope(_[0].instrumentationScope,w),logRecords:_.map((_=>function toLogRecord(_,w){return{timeUnixNano:w.encodeHrTime(_.hrTime),observedTimeUnixNano:w.encodeHrTime(_.hrTimeObserved),severityNumber:_.severityNumber,severityText:_.severityText,body:toAnyValue(_.body,w),eventName:_.eventName,attributes:toAttributes(_.attributes,w),droppedAttributesCount:_.droppedAttributesCount,flags:_.spanContext?.traceFlags,traceId:w.encodeOptionalSpanContext(_.spanContext?.traceId),spanId:w.encodeOptionalSpanContext(_.spanContext?.spanId)}}(_,w))),schemaUrl:_[0].instrumentationScope.schemaUrl}))),schemaUrl:C.schemaUrl}}))}const ui="undefined"!=typeof BigInt?function encodeAsString(_){const w=function hrTimeToNanos(_){const w=BigInt(1e9);return BigInt(Math.trunc(_[0]))*w+BigInt(Math.trunc(_[1]))}(_);return w.toString()}:hrTimeToNanoseconds;function identity(_){return _}const li={encodeHrTime:ui,encodeSpanContext:identity,encodeOptionalSpanContext:identity,encodeUint8Array:_=>{if("undefined"!=typeof Buffer)return Buffer.from(_).toString("base64");const w=new Array(_.length);for(let E=0;E<_.length;E++)w[E]=String.fromCharCode(_[E]);return btoa(w.join(""))}},pi={serializeRequest:_=>{const w=function createExportLogsServiceRequest(_,w){return{resourceLogs:logRecordsToResourceLogs(_,w)}}(_,li);return(new TextEncoder).encode(JSON.stringify(w))},deserializeResponse:_=>{if(0===_.length)return{};const w=new TextDecoder;try{return JSON.parse(w.decode(_))}catch(_){return Ie.warn(`Failed to parse logs export response: ${_.message}. Returning empty response`),{}}}};function buildSpanFlagsFrom(_,w){let E=255&_|256;return w&&(E|=512),E}function sdkSpanToOtlpSpan(_,w){const E=_.spanContext(),C=_.status,P=_.parentSpanContext?.spanId?w.encodeSpanContext(_.parentSpanContext?.spanId):void 0;return{traceId:w.encodeSpanContext(E.traceId),spanId:w.encodeSpanContext(E.spanId),parentSpanId:P,traceState:E.traceState?.serialize(),name:_.name,kind:null==_.kind?0:_.kind+1,startTimeUnixNano:w.encodeHrTime(_.startTime),endTimeUnixNano:w.encodeHrTime(_.endTime),attributes:toAttributes(_.attributes,w),droppedAttributesCount:_.droppedAttributesCount,events:_.events.map((_=>function toOtlpSpanEvent(_,w){return{attributes:_.attributes?toAttributes(_.attributes,w):[],name:_.name,timeUnixNano:w.encodeHrTime(_.time),droppedAttributesCount:_.droppedAttributesCount||0}}(_,w))),droppedEventsCount:_.droppedEventsCount,status:{code:C.code,message:C.message},links:_.links.map((_=>function toOtlpLink(_,w){return{attributes:_.attributes?toAttributes(_.attributes,w):[],spanId:w.encodeSpanContext(_.context.spanId),traceId:w.encodeSpanContext(_.context.traceId),traceState:_.context.traceState?.serialize(),droppedAttributesCount:_.droppedAttributesCount||0,flags:buildSpanFlagsFrom(_.context.traceFlags,_.context.isRemote)}}(_,w))),droppedLinksCount:_.droppedLinksCount,flags:buildSpanFlagsFrom(E.traceFlags,_.parentSpanContext?.isRemote)}}function spanRecordsToResourceSpans(_,w){const E=function createResourceMap(_){const w=new Map;for(const E of _){let _=w.get(E.resource);_||(_=new Map,w.set(E.resource,_));const C=`${E.instrumentationScope.name}@${E.instrumentationScope.version||""}:${E.instrumentationScope.schemaUrl||""}`;let P=_.get(C);P||(P=[],_.set(C,P)),P.push(E)}return w}(_),C=[],P=E.entries();let R=P.next();for(;!R.done;){const[_,E]=R.value,L=[],I=E.values();let k=I.next();for(;!k.done;){const _=k.value;if(_.length>0){const E=_.map((_=>sdkSpanToOtlpSpan(_,w)));L.push({scope:createInstrumentationScope(_[0].instrumentationScope,w),spans:E,schemaUrl:_[0].instrumentationScope.schemaUrl})}k=I.next()}const F=createResource(_,w),j={resource:F,scopeSpans:L,schemaUrl:F.schemaUrl};C.push(j),R=P.next()}return C}const di={serializeRequest:_=>{const w=function createExportTraceServiceRequest(_,w){return{resourceSpans:spanRecordsToResourceSpans(_,w)}}(_,li);return(new TextEncoder).encode(JSON.stringify(w))},deserializeResponse:_=>{if(0===_.length)return{};const w=new TextDecoder;try{return JSON.parse(w.decode(_))}catch(_){return Ie.warn(`Failed to parse trace export response: ${_.message}. Returning empty response`),{}}}};class OTLPExporterBase{constructor(_){this._delegate=_}export(_,w){this._delegate.export(_,w)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class OTLPExporterError extends Error{constructor(_,w,E){super(_),this.name="OTLPExporterError",this.data=E,this.code=w}}function validateTimeoutMillis(_){if(Number.isFinite(_)&&_>0)return _;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${_}')`)}function wrapStaticHeadersInFunction(_){if(null!=_)return async()=>_}function mergeOtlpSharedConfigurationWithDefaults(_,w,E){return{timeoutMillis:validateTimeoutMillis(_.timeoutMillis??w.timeoutMillis??E.timeoutMillis),concurrencyLimit:_.concurrencyLimit??w.concurrencyLimit??E.concurrencyLimit,compression:_.compression??w.compression??E.compression}}class BoundedQueueExportPromiseHandler{constructor(_){this._sendingPromises=[],this._concurrencyLimit=_}pushPromise(_){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(_);const popPromise=()=>{const w=this._sendingPromises.indexOf(_);this._sendingPromises.splice(w,1)};_.then(popPromise,popPromise)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function createBoundedQueueExportPromiseHandler(_){return new BoundedQueueExportPromiseHandler(_.concurrencyLimit)}function createLoggingPartialSuccessResponseHandler(){return{handleResponse(_){null!=_&&function isPartialSuccessResponse(_){return Object.prototype.hasOwnProperty.call(_,"partialSuccess")}(_)&&null!=_.partialSuccess&&0!==Object.keys(_.partialSuccess).length&&Ie.warn("Received Partial Success response:",JSON.stringify(_.partialSuccess))}}}class OTLPExportDelegate{constructor(_,w,E,C,P){this._transport=_,this._serializer=w,this._responseHandler=E,this._promiseQueue=C,this._timeout=P,this._diagLogger=Ie.createComponentLogger({namespace:"OTLPExportDelegate"})}export(_,w){if(this._diagLogger.debug("items to be sent",_),this._promiseQueue.hasReachedLimit())return void w({code:Jo.FAILED,error:new Error("Concurrent export limit reached")});const E=this._serializer.serializeRequest(_);null!=E?this._promiseQueue.pushPromise(this._transport.send(E,this._timeout).then((_=>{if("success"!==_.status)"failure"===_.status&&_.error?w({code:Jo.FAILED,error:_.error}):"retryable"===_.status?w({code:Jo.FAILED,error:_.error??new OTLPExporterError("Export failed with retryable status")}):w({code:Jo.FAILED,error:new OTLPExporterError("Export failed with unknown error")});else{if(null!=_.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(_.data))}catch(w){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",w,_.data)}w({code:Jo.SUCCESS})}}),(_=>w({code:Jo.FAILED,error:_})))):w({code:Jo.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function createOtlpExportDelegate(_,w){return new OTLPExportDelegate(_.transport,_.serializer,createLoggingPartialSuccessResponseHandler(),_.promiseHandler,w.timeout)}function createOtlpNetworkExportDelegate(_,w,E){return createOtlpExportDelegate({transport:E,serializer:w,promiseHandler:createBoundedQueueExportPromiseHandler(_)},{timeout:_.timeoutMillis})}let fi,hi;const gi=new WeakMap,mi=new WeakMap,yi=new WeakMap,bi=new WeakMap,_i=new WeakMap;let vi={get(_,w,E){if(_ instanceof IDBTransaction){if("done"===w)return mi.get(_);if("objectStoreNames"===w)return _.objectStoreNames||yi.get(_);if("store"===w)return E.objectStoreNames[1]?void 0:E.objectStore(E.objectStoreNames[0])}return wrap$1(_[w])},set:(_,w,E)=>(_[w]=E,!0),has:(_,w)=>_ instanceof IDBTransaction&&("done"===w||"store"===w)||w in _};function wrapFunction(_){return _!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?function getCursorAdvanceMethods(){return hi||(hi=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}().includes(_)?function(...w){return _.apply(unwrap$1(this),w),wrap$1(gi.get(this))}:function(...w){return wrap$1(_.apply(unwrap$1(this),w))}:function(w,...E){const C=_.call(unwrap$1(this),w,...E);return yi.set(C,w.sort?w.sort():[w]),wrap$1(C)}}function transformCachableValue(_){return"function"==typeof _?wrapFunction(_):(_ instanceof IDBTransaction&&function cacheDonePromiseForTransaction(_){if(mi.has(_))return;const w=new Promise(((w,E)=>{const unlisten=()=>{_.removeEventListener("complete",complete),_.removeEventListener("error",error),_.removeEventListener("abort",error)},complete=()=>{w(),unlisten()},error=()=>{E(_.error||new DOMException("AbortError","AbortError")),unlisten()};_.addEventListener("complete",complete),_.addEventListener("error",error),_.addEventListener("abort",error)}));mi.set(_,w)}(_),w=_,function getIdbProxyableTypes(){return fi||(fi=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}().some((_=>w instanceof _))?new Proxy(_,vi):_);var w}function wrap$1(_){if(_ instanceof IDBRequest)return function promisifyRequest(_){const w=new Promise(((w,E)=>{const unlisten=()=>{_.removeEventListener("success",success),_.removeEventListener("error",error)},success=()=>{w(wrap$1(_.result)),unlisten()},error=()=>{E(_.error),unlisten()};_.addEventListener("success",success),_.addEventListener("error",error)}));return w.then((w=>{w instanceof IDBCursor&&gi.set(w,_)})).catch((()=>{})),_i.set(w,_),w}(_);if(bi.has(_))return bi.get(_);const w=transformCachableValue(_);return w!==_&&(bi.set(_,w),_i.set(w,_)),w}const unwrap$1=_=>_i.get(_);const Si=["get","getKey","getAll","getAllKeys","count"],wi=["put","add","delete","clear"],Ei=new Map;function getMethod(_,w){if(!(_ instanceof IDBDatabase)||w in _||"string"!=typeof w)return;if(Ei.get(w))return Ei.get(w);const E=w.replace(/FromIndex$/,""),C=w!==E,P=wi.includes(E);if(!(E in(C?IDBIndex:IDBObjectStore).prototype)||!P&&!Si.includes(E))return;const method=async function(_,...w){const R=this.transaction(_,P?"readwrite":"readonly");let L=R.store;return C&&(L=L.index(w.shift())),(await Promise.all([L[E](...w),P&&R.done]))[0]};return Ei.set(w,method),method}!function replaceTraps(_){vi=_(vi)}((_=>({..._,get:(w,E,C)=>getMethod(w,E)||_.get(w,E,C),has:(w,E)=>!!getMethod(w,E)||_.has(w,E)})));const Ti="@firebase/installations",Ai="0.6.24-eap-sql.a9a137e67",Oi=1e4,Ci=`w:${Ai}`,Pi="FIS_v2",Ri=36e5,xi=new ErrorFactory("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function isServerError(_){return _ instanceof FirebaseError&&_.code.includes("request-failed")}function getInstallationsEndpoint({projectId:_}){return`https://firebaseinstallations.googleapis.com/v1/projects/${_}/installations`}function extractAuthTokenInfoFromResponse(_){return{token:_.token,requestStatus:2,expiresIn:(w=_.expiresIn,Number(w.replace("s","000"))),creationTime:Date.now()};var w}async function getErrorFromResponse(_,w){const E=(await w.json()).error;return xi.create("request-failed",{requestName:_,serverCode:E.code,serverMessage:E.message,serverStatus:E.status})}function getHeaders({apiKey:_}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":_})}function getHeadersWithAuth(_,{refreshToken:w}){const E=getHeaders(_);return E.append("Authorization",function getAuthorizationHeader(_){return`${Pi} ${_}`}(w)),E}async function retryIfServerError(_){const w=await _();return w.status>=500&&w.status<600?_():w}function sleep(_){return new Promise((w=>{setTimeout(w,_)}))}const Li=/^[cdef][\w-]{21}$/;function generateFid(){try{const _=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(_),_[0]=112+_[0]%16;const w=function encode$1(_){const w=function bufferToBase64UrlSafe(_){return btoa(String.fromCharCode(..._)).replace(/\+/g,"-").replace(/\//g,"_")}(_);return w.substr(0,22)}(_);return Li.test(w)?w:""}catch{return""}}function getKey(_){return`${_.appName}!${_.appId}`}const Ii=new Map;function fidChanged(_,w){const E=getKey(_);callFidChangeCallbacks(E,w),function broadcastFidChange(_,w){const E=function getBroadcastChannel(){!Ni&&"BroadcastChannel"in self&&(Ni=new BroadcastChannel("[Firebase] FID Change"),Ni.onmessage=_=>{callFidChangeCallbacks(_.data.key,_.data.fid)});return Ni}();E&&E.postMessage({key:_,fid:w});!function closeBroadcastChannel(){0===Ii.size&&Ni&&(Ni.close(),Ni=null)}()}(E,w)}function callFidChangeCallbacks(_,w){const E=Ii.get(_);if(E)for(const _ of E)_(w)}let Ni=null;const Di="firebase-installations-store";let ki=null;function getDbPromise(){return ki||(ki=function openDB(_,w,{blocked:E,upgrade:C,blocking:P,terminated:R}={}){const L=indexedDB.open(_,w),I=wrap$1(L);return C&&L.addEventListener("upgradeneeded",(_=>{C(wrap$1(L.result),_.oldVersion,_.newVersion,wrap$1(L.transaction),_)})),E&&L.addEventListener("blocked",(_=>E(_.oldVersion,_.newVersion,_))),I.then((_=>{R&&_.addEventListener("close",(()=>R())),P&&_.addEventListener("versionchange",(_=>P(_.oldVersion,_.newVersion,_)))})).catch((()=>{})),I}("firebase-installations-database",1,{upgrade:(_,w)=>{if(0===w)_.createObjectStore(Di)}})),ki}async function set(_,w){const E=getKey(_),C=(await getDbPromise()).transaction(Di,"readwrite"),P=C.objectStore(Di),R=await P.get(E);return await P.put(w,E),await C.done,R&&R.fid===w.fid||fidChanged(_,w.fid),w}async function remove(_){const w=getKey(_),E=(await getDbPromise()).transaction(Di,"readwrite");await E.objectStore(Di).delete(w),await E.done}async function update(_,w){const E=getKey(_),C=(await getDbPromise()).transaction(Di,"readwrite"),P=C.objectStore(Di),R=await P.get(E),L=w(R);return void 0===L?await P.delete(E):await P.put(L,E),await C.done,!L||R&&R.fid===L.fid||fidChanged(_,L.fid),L}async function getInstallationEntry(_){let w;const E=await update(_.appConfig,(E=>{const C=function updateOrCreateInstallationEntry(_){const w=_||{fid:generateFid(),registrationStatus:0};return clearTimedOutRequest(w)}(E),P=function triggerRegistrationIfNecessary(_,w){if(0===w.registrationStatus){if(!navigator.onLine){return{installationEntry:w,registrationPromise:Promise.reject(xi.create("app-offline"))}}const E={fid:w.fid,registrationStatus:1,registrationTime:Date.now()},C=async function registerInstallation(_,w){try{const E=await async function createInstallationRequest({appConfig:_,heartbeatServiceProvider:w},{fid:E}){const C=getInstallationsEndpoint(_),P=getHeaders(_),R=w.getImmediate({optional:!0});if(R){const _=await R.getHeartbeatsHeader();_&&P.append("x-firebase-client",_)}const L={fid:E,authVersion:Pi,appId:_.appId,sdkVersion:Ci},I={method:"POST",headers:P,body:JSON.stringify(L)},k=await retryIfServerError((()=>fetch(C,I)));if(k.ok){const _=await k.json();return{fid:_.fid||E,registrationStatus:2,refreshToken:_.refreshToken,authToken:extractAuthTokenInfoFromResponse(_.authToken)}}throw await getErrorFromResponse("Create Installation",k)}(_,w);return set(_.appConfig,E)}catch(E){throw isServerError(E)&&409===E.customData.serverCode?await remove(_.appConfig):await set(_.appConfig,{fid:w.fid,registrationStatus:0}),E}}(_,E);return{installationEntry:E,registrationPromise:C}}return 1===w.registrationStatus?{installationEntry:w,registrationPromise:waitUntilFidRegistration(_)}:{installationEntry:w}}(_,C);return w=P.registrationPromise,P.installationEntry}));return""===E.fid?{installationEntry:await w}:{installationEntry:E,registrationPromise:w}}async function waitUntilFidRegistration(_){let w=await updateInstallationRequest(_.appConfig);for(;1===w.registrationStatus;)await sleep(100),w=await updateInstallationRequest(_.appConfig);if(0===w.registrationStatus){const{installationEntry:w,registrationPromise:E}=await getInstallationEntry(_);return E||w}return w}function updateInstallationRequest(_){return update(_,(_=>{if(!_)throw xi.create("installation-not-found");return clearTimedOutRequest(_)}))}function clearTimedOutRequest(_){return function hasInstallationRequestTimedOut(_){return 1===_.registrationStatus&&_.registrationTime+Oi<Date.now()}(_)?{fid:_.fid,registrationStatus:0}:_}async function generateAuthTokenRequest({appConfig:_,heartbeatServiceProvider:w},E){const C=function getGenerateAuthTokenEndpoint(_,{fid:w}){return`${getInstallationsEndpoint(_)}/${w}/authTokens:generate`}(_,E),P=getHeadersWithAuth(_,E),R=w.getImmediate({optional:!0});if(R){const _=await R.getHeartbeatsHeader();_&&P.append("x-firebase-client",_)}const L={installation:{sdkVersion:Ci,appId:_.appId}},I={method:"POST",headers:P,body:JSON.stringify(L)},k=await retryIfServerError((()=>fetch(C,I)));if(k.ok){return extractAuthTokenInfoFromResponse(await k.json())}throw await getErrorFromResponse("Generate Auth Token",k)}async function refreshAuthToken(_,w=!1){let E;const C=await update(_.appConfig,(C=>{if(!isEntryRegistered(C))throw xi.create("not-registered");const P=C.authToken;if(!w&&function isAuthTokenValid(_){return 2===_.requestStatus&&!function isAuthTokenExpired(_){const w=Date.now();return w<_.creationTime||_.creationTime+_.expiresIn<w+Ri}(_)}(P))return C;if(1===P.requestStatus)return E=async function waitUntilAuthTokenRequest(_,w){let E=await updateAuthTokenRequest(_.appConfig);for(;1===E.authToken.requestStatus;)await sleep(100),E=await updateAuthTokenRequest(_.appConfig);const C=E.authToken;return 0===C.requestStatus?refreshAuthToken(_,w):C}(_,w),C;{if(!navigator.onLine)throw xi.create("app-offline");const w=function makeAuthTokenRequestInProgressEntry(_){const w={requestStatus:1,requestTime:Date.now()};return{..._,authToken:w}}(C);return E=async function fetchAuthTokenFromServer(_,w){try{const E=await generateAuthTokenRequest(_,w),C={...w,authToken:E};return await set(_.appConfig,C),E}catch(E){if(!isServerError(E)||401!==E.customData.serverCode&&404!==E.customData.serverCode){const E={...w,authToken:{requestStatus:0}};await set(_.appConfig,E)}else await remove(_.appConfig);throw E}}(_,w),w}}));return E?await E:C.authToken}function updateAuthTokenRequest(_){return update(_,(_=>{if(!isEntryRegistered(_))throw xi.create("not-registered");return function hasAuthTokenRequestTimedOut(_){return 1===_.requestStatus&&_.requestTime+Oi<Date.now()}(_.authToken)?{..._,authToken:{requestStatus:0}}:_}))}function isEntryRegistered(_){return void 0!==_&&2===_.registrationStatus}async function getToken(_,w=!1){const E=_;await async function completeInstallationRegistration(_){const{registrationPromise:w}=await getInstallationEntry(_);w&&await w}(E);return(await refreshAuthToken(E,w)).token}function getMissingValueError(_){return xi.create("missing-app-config-values",{valueName:_})}const Fi="installations",publicFactory=_=>{const w=_.getProvider("app").getImmediate(),E=function extractAppConfig(_){if(!_||!_.options)throw getMissingValueError("App Configuration");if(!_.name)throw getMissingValueError("App Name");const w=["projectId","apiKey","appId"];for(const E of w)if(!_.options[E])throw getMissingValueError(E);return{appName:_.name,projectId:_.options.projectId,apiKey:_.options.apiKey,appId:_.options.appId}}(w);return{app:w,appConfig:E,heartbeatServiceProvider:_getProvider(w,"heartbeat"),_delete:()=>Promise.resolve()}},internalFactory=_=>{const w=_.getProvider("app").getImmediate(),E=_getProvider(w,Fi).getImmediate();return{getId:()=>async function getId(_){const w=_,{installationEntry:E,registrationPromise:C}=await getInstallationEntry(w);return C?C.catch(console.error):refreshAuthToken(w).catch(console.error),E.fid}(E),getToken:_=>getToken(E,_)}};function registerInstrumentations(_){const w=_.tracerProvider||Ue.getTracerProvider(),E=_.meterProvider||ke.getMeterProvider(),C=_.loggerProvider||X.getLoggerProvider(),P=_.instrumentations?.flat()??[];return function enableInstrumentations(_,w,E,C){for(let P=0,R=_.length;P<R;P++){const R=_[P];w&&R.setTracerProvider(w),E&&R.setMeterProvider(E),C&&R.setLoggerProvider&&R.setLoggerProvider(C),R.getConfig().enabled||R.enable()}}(P,w,E,C),()=>{!function disableInstrumentations(_){_.forEach((_=>_.disable()))}(P)}}!function registerInstallations(){w(new Component(Fi,publicFactory,"PUBLIC")),w(new Component("installations-internal",internalFactory,"PRIVATE"))}(),_(Ti,Ai),_(Ti,Ai,"esm2020");const ji=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Mi=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,$i={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function satisfies(_,w,E){if(!function _validateVersion(_){return"string"==typeof _&&ji.test(_)}(_))return Ie.error(`Invalid version: ${_}`),!1;if(!w)return!0;w=w.replace(/([<>=~^]+)\s+/g,"$1");const C=function _parseVersion(_){const w=_.match(ji);if(!w)return void Ie.error(`Invalid version: ${_}`);const E=w.groups.version,C=w.groups.prerelease,P=w.groups.build,R=E.split("."),L=C?.split(".");return{op:void 0,version:E,versionSegments:R,versionSegmentCount:R.length,prerelease:C,prereleaseSegments:L,prereleaseSegmentCount:L?L.length:0,build:P}}(_);if(!C)return!1;const P=[],R=_doSatisfies(C,w,P,E);return R&&!E?.includePrerelease?function _doPreleaseCheck(_,w){if(_.prerelease)return w.some((w=>w.prerelease&&w.version===_.version));return!0}(C,P):R}function _doSatisfies(_,w,E,C){if(w.includes("||")){const P=w.trim().split("||");for(const w of P)if(_checkRange(_,w,E,C))return!0;return!1}if(w.includes(" - "))w=function replaceHyphen(_,w){const E=Gi;return _.replace(E,((_,E,C,P,R,L,I,k,F,j,$,V)=>`${E=isX(C)?"":isX(P)?`>=${C}.0.0${w?.includePrerelease?"-0":""}`:isX(R)?`>=${C}.${P}.0${w?.includePrerelease?"-0":""}`:L?`>=${E}`:`>=${E}${w?.includePrerelease?"-0":""}`} ${k=isX(F)?"":isX(j)?`<${+F+1}.0.0-0`:isX($)?`<${F}.${+j+1}.0-0`:V?`<=${F}.${j}.${$}-${V}`:w?.includePrerelease?`<${F}.${j}.${+$+1}-0`:`<=${k}`}`.trim()))}(w,C);else if(w.includes(" ")){const P=w.trim().replace(/\s{2,}/g," ").split(" ");for(const w of P)if(!_checkRange(_,w,E,C))return!1;return!0}return _checkRange(_,w,E,C)}function _checkRange(_,w,E,C){if(w=function _normalizeRange(_,w){return _=_.trim(),_=function replaceCaret(_,w){const E=Qi,C=w?.includePrerelease?"-0":"";return _.replace(E,((_,w,E,P,R)=>{let L;return L=isX(w)?"":isX(E)?`>=${w}.0.0${C} <${+w+1}.0.0-0`:isX(P)?"0"===w?`>=${w}.${E}.0${C} <${w}.${+E+1}.0-0`:`>=${w}.${E}.0${C} <${+w+1}.0.0-0`:R?"0"===w?"0"===E?`>=${w}.${E}.${P}-${R} <${w}.${E}.${+P+1}-0`:`>=${w}.${E}.${P}-${R} <${w}.${+E+1}.0-0`:`>=${w}.${E}.${P}-${R} <${+w+1}.0.0-0`:"0"===w?"0"===E?`>=${w}.${E}.${P}${C} <${w}.${E}.${+P+1}-0`:`>=${w}.${E}.${P}${C} <${w}.${+E+1}.0-0`:`>=${w}.${E}.${P} <${+w+1}.0.0-0`,L}))}(_,w),_=function replaceTilde(_){const w=Ki;return _.replace(w,((_,w,E,C,P)=>{let R;return R=isX(w)?"":isX(E)?`>=${w}.0.0 <${+w+1}.0.0-0`:isX(C)?`>=${w}.${E}.0 <${w}.${+E+1}.0-0`:P?`>=${w}.${E}.${C}-${P} <${w}.${+E+1}.0-0`:`>=${w}.${E}.${C} <${w}.${+E+1}.0-0`,R}))}(_),_=function replaceXRange(_,w){const E=Wi;return _.replace(E,((_,E,C,P,R,L)=>{const I=isX(C),k=I||isX(P),F=k||isX(R),j=F;return"="===E&&j&&(E=""),L=w?.includePrerelease?"-0":"",I?_=">"===E||"<"===E?"<0.0.0-0":"*":E&&j?(k&&(P=0),R=0,">"===E?(E=">=",k?(C=+C+1,P=0,R=0):(P=+P+1,R=0)):"<="===E&&(E="<",k?C=+C+1:P=+P+1),"<"===E&&(L="-0"),_=`${E+C}.${P}.${R}${L}`):k?_=`>=${C}.0.0${L} <${+C+1}.0.0-0`:F&&(_=`>=${C}.${P}.0${L} <${C}.${+P+1}.0-0`),_}))}(_,w),_=_.trim(),_}(w,C),w.includes(" "))return _doSatisfies(_,w,E,C);{const C=function _parseRange(_){if(!_)return{};const w=_.match(Mi);if(!w)return Ie.error(`Invalid range: ${_}`),{invalid:!0};let E=w.groups.op;const C=w.groups.version,P=w.groups.prerelease,R=w.groups.build,L=C.split("."),I=P?.split(".");"=="===E&&(E="=");return{op:E||"=",version:C,versionSegments:L,versionSegmentCount:L.length,prerelease:P,prereleaseSegments:I,prereleaseSegmentCount:I?I.length:0,build:R}}(w);return E.push(C),function _satisfies(_,w){if(w.invalid)return!1;if(!w.version||_isWildcard(w.version))return!0;let E=_compareVersionSegments(_.versionSegments||[],w.versionSegments||[]);if(0===E){const C=_.prereleaseSegments||[],P=w.prereleaseSegments||[];E=C.length||P.length?!C.length&&P.length?1:C.length&&!P.length?-1:_compareVersionSegments(C,P):0}return $i[w.op]?.includes(E)}(_,C)}}function isX(_){return!_||"x"===_.toLowerCase()||"*"===_}function _isWildcard(_){return"*"===_||"x"===_||"X"===_}function _parseVersionString(_){const w=parseInt(_,10);return isNaN(w)?_:w}function _compareVersionStrings(_,w){if(_isWildcard(_)||_isWildcard(w))return 0;const[E,C]=function _normalizeVersionType(_,w){if(typeof _==typeof w){if("number"==typeof _)return[_,w];if("string"==typeof _)return[_,w];throw new Error("Version segments can only be strings or numbers")}return[String(_),String(w)]}(_parseVersionString(_),_parseVersionString(w));return E>C?1:E<C?-1:0}function _compareVersionSegments(_,w){for(let E=0;E<Math.max(_.length,w.length);E++){const C=_compareVersionStrings(_[E]||"0",w[E]||"0");if(0!==C)return C}return 0}const Bi="[a-zA-Z0-9-]",Ui="0|[1-9]\\d*",Vi=`(?:${Ui}|${`\\d*[a-zA-Z-]${Bi}*`})`,Hi=`${Bi}+`,zi=`${Ui}|x|X|\\*`,qi=`[v=\\s]*(${zi})(?:\\.(${zi})(?:\\.(${zi})(?:${`(?:-(${Vi}(?:\\.${Vi})*))`})?${`(?:\\+(${Hi}(?:\\.${Hi})*))`}?)?)?`,Wi=new RegExp(`^((?:<|>)?=?)\\s*${qi}$`),Gi=new RegExp(`^\\s*(${qi})\\s+-\\s+(${qi})\\s*$`),Ki=new RegExp(`^(?:~>?)${qi}$`),Qi=new RegExp(`^(?:\\^)${qi}$`);let Xi=console.error.bind(console);function defineProperty$1(_,w,E){const C=!!_[w]&&Object.prototype.propertyIsEnumerable.call(_,w);Object.defineProperty(_,w,{configurable:!0,enumerable:C,writable:!0,value:E})}const wrap=(_,w,E)=>{if(!_||!_[w])return void Xi("no original function "+String(w)+" to wrap");if(!E)return Xi("no wrapper function"),void Xi((new Error).stack);const C=_[w];if("function"!=typeof C||"function"!=typeof E)return void Xi("original object and wrapper must be functions");const P=E(C,w);return defineProperty$1(P,"__original",C),defineProperty$1(P,"__unwrap",(()=>{_[w]===P&&defineProperty$1(_,w,C)})),defineProperty$1(P,"__wrapped",!0),defineProperty$1(_,w,P),P},massWrap=(_,w,E)=>{if(!_)return Xi("must provide one or more modules to patch"),void Xi((new Error).stack);Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{wrap(_,w,E)}))})):Xi("must provide one or more functions to wrap on modules")},unwrap=(_,w)=>{if(!_||!_[w])return Xi("no function to unwrap."),void Xi((new Error).stack);const E=_[w];E.__unwrap?E.__unwrap():Xi("no original to unwrap to -- has "+String(w)+" already been unwrapped?")},massUnwrap=(_,w)=>{if(!_)return Xi("must provide one or more modules to patch"),void Xi((new Error).stack);Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{unwrap(_,w)}))})):Xi("must provide one or more functions to unwrap on modules")};class InstrumentationAbstract{constructor(_,w,E){this._config={},this._wrap=wrap,this._unwrap=unwrap,this._massWrap=massWrap,this._massUnwrap=massUnwrap,this.instrumentationName=_,this.instrumentationVersion=w,this.setConfig(E),this._diag=Ie.createComponentLogger({namespace:_}),this._tracer=Ue.getTracer(_,w),this._meter=ke.getMeter(_,w),this._logger=X.getLogger(_,w),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(_){this._meter=_.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(_){this._logger=_.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const _=this.init()??[];return Array.isArray(_)?_:[_]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(_){this._config={enabled:!0,..._}}setTracerProvider(_){this._tracer=_.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(_,w,E,C){if(_)try{_(E,C)}catch(_){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:w},_)}}}var Ji={exports:{}},Zi={exports:{}},Yi={exports:{}},es=1e3,ts=6e4,rs=60*ts,ns=24*rs,os=7*ns,is=365.25*ns,ms=function(_,w){w=w||{};var E=typeof _;if("string"===E&&_.length>0)return function parse$2(_){if((_=String(_)).length>100)return;var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(!w)return;var E=parseFloat(w[1]);switch((w[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return E*is;case"weeks":case"week":case"w":return E*os;case"days":case"day":case"d":return E*ns;case"hours":case"hour":case"hrs":case"hr":case"h":return E*rs;case"minutes":case"minute":case"mins":case"min":case"m":return E*ts;case"seconds":case"second":case"secs":case"sec":case"s":return E*es;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return E;default:return}}(_);if("number"===E&&isFinite(_))return w.long?function fmtLong(_){var w=Math.abs(_);if(w>=ns)return plural(_,w,ns,"day");if(w>=rs)return plural(_,w,rs,"hour");if(w>=ts)return plural(_,w,ts,"minute");if(w>=es)return plural(_,w,es,"second");return _+" ms"}(_):function fmtShort(_){var w=Math.abs(_);if(w>=ns)return Math.round(_/ns)+"d";if(w>=rs)return Math.round(_/rs)+"h";if(w>=ts)return Math.round(_/ts)+"m";if(w>=es)return Math.round(_/es)+"s";return _+"ms"}(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function plural(_,w,E,C){var P=w>=1.5*E;return Math.round(_/E)+" "+C+(P?"s":"")}var ss=function setup(_){function createDebug(_){let w,E,C,P=null;function debug(..._){if(!debug.enabled)return;const E=debug,C=Number(new Date),P=C-(w||C);E.diff=P,E.prev=w,E.curr=C,w=C,_[0]=createDebug.coerce(_[0]),"string"!=typeof _[0]&&_.unshift("%O");let R=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,((w,C)=>{if("%%"===w)return"%";R++;const P=createDebug.formatters[C];if("function"==typeof P){const C=_[R];w=P.call(E,C),_.splice(R,1),R--}return w})),createDebug.formatArgs.call(E,_);(E.log||createDebug.log).apply(E,_)}return debug.namespace=_,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(_),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==P?P:(E!==createDebug.namespaces&&(E=createDebug.namespaces,C=createDebug.enabled(_)),C),set:_=>{P=_}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(_,w){const E=createDebug(this.namespace+(void 0===w?":":w)+_);return E.log=this.log,E}function matchesTemplate(_,w){let E=0,C=0,P=-1,R=0;for(;E<_.length;)if(C<w.length&&(w[C]===_[E]||"*"===w[C]))"*"===w[C]?(P=C,R=E,C++):(E++,C++);else{if(-1===P)return!1;C=P+1,R++,E=R}for(;C<w.length&&"*"===w[C];)C++;return C===w.length}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=function coerce(_){if(_ instanceof Error)return _.stack||_.message;return _},createDebug.disable=function disable(){const _=[...createDebug.names,...createDebug.skips.map((_=>"-"+_))].join(",");return createDebug.enable(""),_},createDebug.enable=function enable(_){createDebug.save(_),createDebug.namespaces=_,createDebug.names=[],createDebug.skips=[];const w=("string"==typeof _?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const _ of w)"-"===_[0]?createDebug.skips.push(_.slice(1)):createDebug.names.push(_)},createDebug.enabled=function enabled(_){for(const w of createDebug.skips)if(matchesTemplate(_,w))return!1;for(const w of createDebug.names)if(matchesTemplate(_,w))return!0;return!1},createDebug.humanize=ms,createDebug.destroy=function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(_).forEach((w=>{createDebug[w]=_[w]})),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function selectColor(_){let w=0;for(let E=0;E<_.length;E++)w=(w<<5)-w+_.charCodeAt(E),w|=0;return createDebug.colors[Math.abs(w)%createDebug.colors.length]},createDebug.enable(createDebug.load()),createDebug};!function(_,w){w.formatArgs=function formatArgs(w){if(w[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+w[0]+(this.useColors?"%c ":" ")+"+"+_.exports.humanize(this.diff),!this.useColors)return;const E="color: "+this.color;w.splice(1,0,E,"color: inherit");let C=0,P=0;w[0].replace(/%[a-zA-Z%]/g,(_=>{"%%"!==_&&(C++,"%c"===_&&(P=C))})),w.splice(P,0,E)},w.save=function save(_){try{_?w.storage.setItem("debug",_):w.storage.removeItem("debug")}catch(_){}},w.load=function load(){let _;try{_=w.storage.getItem("debug")||w.storage.getItem("DEBUG")}catch(_){}!_&&"undefined"!=typeof process&&"env"in process&&(_=process.env.DEBUG);return _},w.useColors=function useColors(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let _;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(_=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(_[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},w.storage=function localstorage(){try{return localStorage}catch(_){}}(),w.destroy=(()=>{let _=!1;return()=>{_||(_=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],w.log=console.debug||console.log||(()=>{}),_.exports=ss(w);const{formatters:E}=_.exports;E.j=function(_){try{return JSON.stringify(_)}catch(_){return"[UnexpectedJSONParseError]: "+_.message}}}(Yi,Yi.exports);var as={exports:{}};!function(_,w){const E=L,C=qe;w.init=function init(_){_.inspectOpts={};const E=Object.keys(w.inspectOpts);for(let C=0;C<E.length;C++)_.inspectOpts[E[C]]=w.inspectOpts[E[C]]},w.log=function log(..._){return process.stderr.write(C.formatWithOptions(w.inspectOpts,..._)+"\n")},w.formatArgs=function formatArgs(E){const{namespace:C,useColors:P}=this;if(P){const w=this.color,P="[3"+(w<8?w:"8;5;"+w),R=` ${P};1m${C} [0m`;E[0]=R+E[0].split("\n").join("\n"+R),E.push(P+"m+"+_.exports.humanize(this.diff)+"[0m")}else E[0]=function getDate(){if(w.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+C+" "+E[0]},w.save=function save(_){_?process.env.DEBUG=_:delete process.env.DEBUG},w.load=function load(){return process.env.DEBUG},w.useColors=function useColors(){return"colors"in w.inspectOpts?Boolean(w.inspectOpts.colors):E.isatty(process.stderr.fd)},w.destroy=C.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),w.colors=[6,2,3,4,5,1];try{const _=require("supports-color");_&&(_.stderr||_).level>=2&&(w.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(_){}w.inspectOpts=Object.keys(process.env).filter((_=>/^debug_/i.test(_))).reduce(((_,w)=>{const E=w.substring(6).toLowerCase().replace(/_([a-z])/g,((_,w)=>w.toUpperCase()));let C=process.env[w];return C=!!/^(yes|on|true|enabled)$/i.test(C)||!/^(no|off|false|disabled)$/i.test(C)&&("null"===C?null:Number(C)),_[E]=C,_}),{}),_.exports=ss(w);const{formatters:P}=_.exports;P.o=function(_){return this.inspectOpts.colors=this.useColors,C.inspect(_,this.inspectOpts).split("\n").map((_=>_.trim())).join(" ")},P.O=function(_){return this.inspectOpts.colors=this.useColors,C.inspect(_,this.inspectOpts)}}(as,as.exports),"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Zi.exports=Yi.exports:Zi.exports=as.exports;var cs=P.sep,moduleDetailsFromPath$2=function(_){var w=_.split(cs),E=w.lastIndexOf("node_modules");if(-1!==E&&w[E+1]){for(var C="@"===w[E+1][0],P=C?w[E+1]+"/"+w[E+2]:w[E+1],R=C?3:2,L="",I=E+R-1,k=0;k<=I;k++)L+=k===I?w[k]:w[k]+cs;for(var F="",j=w.length-1,$=E+R;$<=j;$++)F+=$===j?w[$]:w[$]+cs;return{name:P,basedir:L,path:F}}};const us=P,ls=R,ps=Zi.exports("require-in-the-middle"),ds=moduleDetailsFromPath$2;Ji.exports=Hook$1;var fs=Ji.exports.Hook=Hook$1;let hs,gs;if(ls.isBuiltin)gs=ls.isBuiltin;else{if(!ls.builtinModules)throw new Error("'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0");gs=_=>!!_.startsWith("node:")||(void 0===hs&&(hs=new Set(ls.builtinModules)),hs.has(_))}const ys=/([/\\]index)?(\.js)?$/;class ExportsCache{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(_,w){if(this._localCache.has(_))return!0;if(w)return!1;{const w=require.cache[_];return!(!w||!(this._kRitmExports in w))}}get(_,w){const E=this._localCache.get(_);if(void 0!==E)return E;if(!w){const w=require.cache[_];return w&&w[this._kRitmExports]}}set(_,w,E){E?this._localCache.set(_,w):_ in require.cache?require.cache[_][this._kRitmExports]=w:(ps('non-core module is unexpectedly not in require.cache: "%s"',_),this._localCache.set(_,w))}}function Hook$1(_,w,E){if(this instanceof Hook$1==!1)return new Hook$1(_,w,E);if("function"==typeof _?(E=_,_=null,w=null):"function"==typeof w&&(E=w,w=null),"function"!=typeof ls._resolveFilename)return console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof ls._resolveFilename),void console.error("Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues",process.version);this._cache=new ExportsCache,this._unhooked=!1,this._origRequire=ls.prototype.require;const C=this,P=new Set,R=!!w&&!0===w.internals,L=Array.isArray(_);function patchedRequire(w,I){const k=w[0],F=gs(k);let j,$,V;if(F){if(j=k,k.startsWith("node:")){const _=k.slice(5);gs(_)&&(j=_)}}else{if(I)return ps("call to process.getBuiltinModule with unknown built-in id"),C._origGetBuiltinModule.apply(this,w);try{j=ls._resolveFilename(k,this)}catch(_){return ps('Module._resolveFilename("%s") threw %j, calling original Module.require',k,_.message),C._origRequire.apply(this,w)}}if(ps("processing %s module require('%s'): %s",!0===F?"core":"non-core",k,j),!0===C._cache.has(j,F))return ps("returning already patched cached module: %s",j),C._cache.get(j,F);const H=P.has(j);!1===H&&P.add(j);const z=I?C._origGetBuiltinModule.apply(this,w):C._origRequire.apply(this,w);if(!0===H)return ps("module is in the process of being patched already - ignoring: %s",j),z;if(P.delete(j),!0===F){if(!0===L&&!1===_.includes(j))return ps("ignoring core module not on whitelist: %s",j),z;$=j}else if(!0===L&&_.includes(j)){const _=us.parse(j);$=_.name,V=_.dir}else{const w=ds(j);if(void 0===w)return ps("could not parse filename: %s",j),z;$=w.name,V=w.basedir;const E=function resolveModuleName(_){const w="/"!==us.sep?_.path.split(us.sep).join("/"):_.path;return us.posix.join(_.name,w).replace(ys,"")}(w);ps("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",$,k,E,V);let P=!1;if(L){if(!k.startsWith(".")&&_.includes(k)&&($=k,P=!0),!_.includes($)&&!_.includes(E))return z;_.includes(E)&&E!==$&&($=E,P=!0)}if(!P){let _;try{_=require.resolve($,{paths:[V]})}catch(_){return ps("could not resolve module: %s",$),C._cache.set(j,z,F),z}if(_!==j){if(!0!==R)return ps("ignoring require of non-main module file: %s",_),C._cache.set(j,z,F),z;$=$+us.sep+us.relative(V,j),ps("preparing to process require of internal file: %s",$)}}}C._cache.set(j,z,F),ps("calling require hook: %s",$);const q=E(z,$,V);return C._cache.set(j,q,F),ps("returning module: %s",$),q}ps("registering require hook"),this._require=ls.prototype.require=function(_){return!0===C._unhooked?(ps("ignoring require call - module is soft-unhooked"),C._origRequire.apply(this,arguments)):patchedRequire.call(this,arguments,!1)},"function"==typeof process.getBuiltinModule&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(_){return!0===C._unhooked?(ps("ignoring process.getBuiltinModule call - module is soft-unhooked"),C._origGetBuiltinModule.apply(this,arguments)):patchedRequire.call(this,arguments,!0)})}Hook$1.prototype.unhook=function(){this._unhooked=!0,this._require===ls.prototype.require?(ls.prototype.require=this._origRequire,ps("require unhook successful")):ps("require unhook unsuccessful"),void 0!==process.getBuiltinModule&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,ps("process.getBuiltinModule unhook successful")):ps("process.getBuiltinModule unhook unsuccessful"))};const bs="/";class ModuleNameTrieNode{constructor(){this.hooks=[],this.children=new Map}}class ModuleNameTrie{constructor(){this._trie=new ModuleNameTrieNode,this._counter=0}insert(_){let w=this._trie;for(const E of _.moduleName.split(bs)){let _=w.children.get(E);_||(_=new ModuleNameTrieNode,w.children.set(E,_)),w=_}w.hooks.push({hook:_,insertedId:this._counter++})}search(_,{maintainInsertionOrder:w,fullOnly:E}={}){let C=this._trie;const P=[];let R=!0;for(const w of _.split(bs)){const _=C.children.get(w);if(!_){R=!1;break}E||P.push(..._.hooks),C=_}return E&&R&&P.push(...C.hooks),0===P.length?[]:1===P.length?[P[0].hook]:(w&&P.sort(((_,w)=>_.insertedId-w.insertedId)),P.map((({hook:_})=>_)))}}const _s=["afterEach","after","beforeEach","before","describe","it"].every((_=>"function"==typeof global[_]));class RequireInTheMiddleSingleton{constructor(){this._moduleNameTrie=new ModuleNameTrie,this._initialize()}_initialize(){new fs(null,{internals:!0},((_,w,E)=>{const P=function normalizePathSeparators(_){return C.sep!==bs?_.split(C.sep).join(bs):_}(w),R=this._moduleNameTrie.search(P,{maintainInsertionOrder:!0,fullOnly:void 0===E});for(const{onRequire:C}of R)_=C(_,w,E);return _}))}register(_,w){const E={moduleName:_,onRequire:w};return this._moduleNameTrie.insert(E),E}static getInstance(){return _s?new RequireInTheMiddleSingleton:this._instance=this._instance??new RequireInTheMiddleSingleton}}var vs,Ss,ws={exports:{}},Es={},Ts={exports:{}};vs=Ts,Ss=Ts.exports,function(_){var w=Ss&&!Ss.nodeType&&Ss,E=vs&&!vs.nodeType&&vs,C="object"==typeof ze&&ze;C.global!==C&&C.window!==C&&C.self!==C||(_=C);var P,R,L=2147483647,I=36,k=/^xn--/,F=/[^\x20-\x7E]/,j=/[\x2E\u3002\uFF0E\uFF61]/g,$={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=Math.floor,H=String.fromCharCode;function error(_){throw new RangeError($[_])}function map(_,w){for(var E=_.length,C=[];E--;)C[E]=w(_[E]);return C}function mapDomain(_,w){var E=_.split("@"),C="";return E.length>1&&(C=E[0]+"@",_=E[1]),C+map((_=_.replace(j,".")).split("."),w).join(".")}function ucs2decode(_){for(var w,E,C=[],P=0,R=_.length;P<R;)(w=_.charCodeAt(P++))>=55296&&w<=56319&&P<R?56320==(64512&(E=_.charCodeAt(P++)))?C.push(((1023&w)<<10)+(1023&E)+65536):(C.push(w),P--):C.push(w);return C}function ucs2encode(_){return map(_,(function(_){var w="";return _>65535&&(w+=H((_-=65536)>>>10&1023|55296),_=56320|1023&_),w+=H(_)})).join("")}function digitToBasic(_,w){return _+22+75*(_<26)-((0!=w)<<5)}function adapt(_,w,E){var C=0;for(_=E?V(_/700):_>>1,_+=V(_/w);_>455;C+=I)_=V(_/35);return V(C+36*_/(_+38))}function decode(_){var w,E,C,P,R,k,F,j,$,H,z,q=[],G=_.length,K=0,Q=128,X=72;for((E=_.lastIndexOf("-"))<0&&(E=0),C=0;C<E;++C)_.charCodeAt(C)>=128&&error("not-basic"),q.push(_.charCodeAt(C));for(P=E>0?E+1:0;P<G;){for(R=K,k=1,F=I;P>=G&&error("invalid-input"),((j=(z=_.charCodeAt(P++))-48<10?z-22:z-65<26?z-65:z-97<26?z-97:I)>=I||j>V((L-K)/k))&&error("overflow"),K+=j*k,!(j<($=F<=X?1:F>=X+26?26:F-X));F+=I)k>V(L/(H=I-$))&&error("overflow"),k*=H;X=adapt(K-R,w=q.length+1,0==R),V(K/w)>L-Q&&error("overflow"),Q+=V(K/w),K%=w,q.splice(K++,0,Q)}return ucs2encode(q)}function encode(_){var w,E,C,P,R,k,F,j,$,z,q,G,K,Q,X,J=[];for(G=(_=ucs2decode(_)).length,w=128,E=0,R=72,k=0;k<G;++k)(q=_[k])<128&&J.push(H(q));for(C=P=J.length,P&&J.push("-");C<G;){for(F=L,k=0;k<G;++k)(q=_[k])>=w&&q<F&&(F=q);for(F-w>V((L-E)/(K=C+1))&&error("overflow"),E+=(F-w)*K,w=F,k=0;k<G;++k)if((q=_[k])<w&&++E>L&&error("overflow"),q==w){for(j=E,$=I;!(j<(z=$<=R?1:$>=R+26?26:$-R));$+=I)X=j-z,Q=I-z,J.push(H(digitToBasic(z+X%Q,0))),j=V(X/Q);J.push(H(digitToBasic(j,0))),R=adapt(E,K,C==P),E=0,++C}++E,++w}return J.join("")}if(P={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:function toASCII(_){return mapDomain(_,(function(_){return F.test(_)?"xn--"+encode(_):_}))},toUnicode:function toUnicode(_){return mapDomain(_,(function(_){return k.test(_)?decode(_.slice(4).toLowerCase()):_}))}},w&&E)if(vs.exports==w)E.exports=P;else for(R in P)P.hasOwnProperty(R)&&(w[R]=P[R]);else _.punycode=P}(ze);var As=qe.inspect,Os="function"==typeof Map&&Map.prototype,Cs=Object.getOwnPropertyDescriptor&&Os?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ps=Os&&Cs&&"function"==typeof Cs.get?Cs.get:null,Rs=Os&&Map.prototype.forEach,xs="function"==typeof Set&&Set.prototype,Ls=Object.getOwnPropertyDescriptor&&xs?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Is=xs&&Ls&&"function"==typeof Ls.get?Ls.get:null,Ns=xs&&Set.prototype.forEach,Ds="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,ks="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Fs="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,js=Boolean.prototype.valueOf,Ms=Object.prototype.toString,$s=Function.prototype.toString,Bs=String.prototype.match,Us=String.prototype.slice,Vs=String.prototype.replace,Hs=String.prototype.toUpperCase,zs=String.prototype.toLowerCase,qs=RegExp.prototype.test,Ws=Array.prototype.concat,Gs=Array.prototype.join,Ks=Array.prototype.slice,Qs=Math.floor,Xs="function"==typeof BigInt?BigInt.prototype.valueOf:null,Js=Object.getOwnPropertySymbols,Zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Ys="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ea="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ys||"symbol")?Symbol.toStringTag:null,ta=Object.prototype.propertyIsEnumerable,ra=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(_){return _.__proto__}:null);function addNumericSeparator$1(_,w){if(_===1/0||_===-1/0||_!=_||_&&_>-1e3&&_<1e3||qs.call(/e/,w))return w;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof _){var C=_<0?-Qs(-_):Qs(_);if(C!==_){var P=String(C),R=Us.call(w,P.length+1);return Vs.call(P,E,"$&_")+"."+Vs.call(Vs.call(R,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Vs.call(w,E,"$&_")}var na=As,oa=na.custom,ia=isSymbol$1(oa)?oa:null,sa={__proto__:null,double:'"',single:"'"},aa={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ca=function inspect_(_,w,E,C){var P=w||{};if(has$4(P,"quoteStyle")&&!has$4(sa,P.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$4(P,"maxStringLength")&&("number"==typeof P.maxStringLength?P.maxStringLength<0&&P.maxStringLength!==1/0:null!==P.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var R=!has$4(P,"customInspect")||P.customInspect;if("boolean"!=typeof R&&"symbol"!==R)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$4(P,"indent")&&null!==P.indent&&"\t"!==P.indent&&!(parseInt(P.indent,10)===P.indent&&P.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$4(P,"numericSeparator")&&"boolean"!=typeof P.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var L=P.numericSeparator;if(void 0===_)return"undefined";if(null===_)return"null";if("boolean"==typeof _)return _?"true":"false";if("string"==typeof _)return inspectString$1(_,P);if("number"==typeof _){if(0===_)return 1/0/_>0?"0":"-0";var I=String(_);return L?addNumericSeparator$1(_,I):I}if("bigint"==typeof _){var k=String(_)+"n";return L?addNumericSeparator$1(_,k):k}var F=void 0===P.depth?5:P.depth;if(void 0===E&&(E=0),E>=F&&F>0&&"object"==typeof _)return isArray$5(_)?"[Array]":"[Object]";var j=function getIndent$1(_,w){var E;if("\t"===_.indent)E="\t";else{if(!("number"==typeof _.indent&&_.indent>0))return null;E=Gs.call(Array(_.indent+1)," ")}return{base:E,prev:Gs.call(Array(w+1),E)}}(P,E);if(void 0===C)C=[];else if(indexOf$1(C,_)>=0)return"[Circular]";function inspect(_,w,R){if(w&&(C=Ks.call(C)).push(w),R){var L={depth:P.depth};return has$4(P,"quoteStyle")&&(L.quoteStyle=P.quoteStyle),inspect_(_,L,E+1,C)}return inspect_(_,P,E+1,C)}if("function"==typeof _&&!isRegExp$2(_)){var $=function nameOf$1(_){if(_.name)return _.name;var w=Bs.call($s.call(_),/^function\s*([\w$]+)/);if(w)return w[1];return null}(_),V=arrObjKeys$1(_,inspect);return"[Function"+($?": "+$:" (anonymous)")+"]"+(V.length>0?" { "+Gs.call(V,", ")+" }":"")}if(isSymbol$1(_)){var H=Ys?Vs.call(String(_),/^(Symbol\(.*\))_[^)]*$/,"$1"):Zs.call(_);return"object"!=typeof _||Ys?H:markBoxed$1(H)}if(function isElement$1(_){if(!_||"object"!=typeof _)return!1;if("undefined"!=typeof HTMLElement&&_ instanceof HTMLElement)return!0;return"string"==typeof _.nodeName&&"function"==typeof _.getAttribute}(_)){for(var z="<"+zs.call(String(_.nodeName)),q=_.attributes||[],G=0;G<q.length;G++)z+=" "+q[G].name+"="+wrapQuotes$1(quote$1(q[G].value),"double",P);return z+=">",_.childNodes&&_.childNodes.length&&(z+="..."),z+="</"+zs.call(String(_.nodeName))+">"}if(isArray$5(_)){if(0===_.length)return"[]";var K=arrObjKeys$1(_,inspect);return j&&!function singleLineValues$1(_){for(var w=0;w<_.length;w++)if(indexOf$1(_[w],"\n")>=0)return!1;return!0}(K)?"["+indentedJoin$1(K,j)+"]":"[ "+Gs.call(K,", ")+" ]"}if(function isError$1(_){return"[object Error]"===toStr$1(_)&&canTrustToString(_)}(_)){var Q=arrObjKeys$1(_,inspect);return"cause"in Error.prototype||!("cause"in _)||ta.call(_,"cause")?0===Q.length?"["+String(_)+"]":"{ ["+String(_)+"] "+Gs.call(Q,", ")+" }":"{ ["+String(_)+"] "+Gs.call(Ws.call("[cause]: "+inspect(_.cause),Q),", ")+" }"}if("object"==typeof _&&R){if(ia&&"function"==typeof _[ia]&&na)return na(_,{depth:F-E});if("symbol"!==R&&"function"==typeof _.inspect)return _.inspect()}if(function isMap$1(_){if(!Ps||!_||"object"!=typeof _)return!1;try{Ps.call(_);try{Is.call(_)}catch(_){return!0}return _ instanceof Map}catch(_){}return!1}(_)){var X=[];return Rs&&Rs.call(_,(function(w,E){X.push(inspect(E,_,!0)+" => "+inspect(w,_))})),collectionOf$1("Map",Ps.call(_),X,j)}if(function isSet$1(_){if(!Is||!_||"object"!=typeof _)return!1;try{Is.call(_);try{Ps.call(_)}catch(_){return!0}return _ instanceof Set}catch(_){}return!1}(_)){var J=[];return Ns&&Ns.call(_,(function(w){J.push(inspect(w,_))})),collectionOf$1("Set",Is.call(_),J,j)}if(function isWeakMap$1(_){if(!Ds||!_||"object"!=typeof _)return!1;try{Ds.call(_,Ds);try{ks.call(_,ks)}catch(_){return!0}return _ instanceof WeakMap}catch(_){}return!1}(_))return weakCollectionOf$1("WeakMap");if(function isWeakSet$1(_){if(!ks||!_||"object"!=typeof _)return!1;try{ks.call(_,ks);try{Ds.call(_,Ds)}catch(_){return!0}return _ instanceof WeakSet}catch(_){}return!1}(_))return weakCollectionOf$1("WeakSet");if(function isWeakRef$1(_){if(!Fs||!_||"object"!=typeof _)return!1;try{return Fs.call(_),!0}catch(_){}return!1}(_))return weakCollectionOf$1("WeakRef");if(function isNumber$1(_){return"[object Number]"===toStr$1(_)&&canTrustToString(_)}(_))return markBoxed$1(inspect(Number(_)));if(function isBigInt$1(_){if(!_||"object"!=typeof _||!Xs)return!1;try{return Xs.call(_),!0}catch(_){}return!1}(_))return markBoxed$1(inspect(Xs.call(_)));if(function isBoolean$1(_){return"[object Boolean]"===toStr$1(_)&&canTrustToString(_)}(_))return markBoxed$1(js.call(_));if(function isString$1(_){return"[object String]"===toStr$1(_)&&canTrustToString(_)}(_))return markBoxed$1(inspect(String(_)));if("undefined"!=typeof window&&_===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&_===globalThis||void 0!==ze&&_===ze)return"{ [object globalThis] }";if(!function isDate$1(_){return"[object Date]"===toStr$1(_)&&canTrustToString(_)}(_)&&!isRegExp$2(_)){var Z=arrObjKeys$1(_,inspect),Y=ra?ra(_)===Object.prototype:_ instanceof Object||_.constructor===Object,ee=_ instanceof Object?"":"null prototype",te=!Y&&ea&&Object(_)===_&&ea in _?Us.call(toStr$1(_),8,-1):ee?"Object":"",re=(Y||"function"!=typeof _.constructor?"":_.constructor.name?_.constructor.name+" ":"")+(te||ee?"["+Gs.call(Ws.call([],te||[],ee||[]),": ")+"] ":"");return 0===Z.length?re+"{}":j?re+"{"+indentedJoin$1(Z,j)+"}":re+"{ "+Gs.call(Z,", ")+" }"}return String(_)};function wrapQuotes$1(_,w,E){var C=E.quoteStyle||w,P=sa[C];return P+_+P}function quote$1(_){return Vs.call(String(_),/"/g,""")}function canTrustToString(_){return!ea||!("object"==typeof _&&(ea in _||void 0!==_[ea]))}function isArray$5(_){return"[object Array]"===toStr$1(_)&&canTrustToString(_)}function isRegExp$2(_){return"[object RegExp]"===toStr$1(_)&&canTrustToString(_)}function isSymbol$1(_){if(Ys)return _&&"object"==typeof _&&_ instanceof Symbol;if("symbol"==typeof _)return!0;if(!_||"object"!=typeof _||!Zs)return!1;try{return Zs.call(_),!0}catch(_){}return!1}var ua=Object.prototype.hasOwnProperty||function(_){return _ in this};function has$4(_,w){return ua.call(_,w)}function toStr$1(_){return Ms.call(_)}function indexOf$1(_,w){if(_.indexOf)return _.indexOf(w);for(var E=0,C=_.length;E<C;E++)if(_[E]===w)return E;return-1}function inspectString$1(_,w){if(_.length>w.maxStringLength){var E=_.length-w.maxStringLength,C="... "+E+" more character"+(E>1?"s":"");return inspectString$1(Us.call(_,0,w.maxStringLength),w)+C}var P=aa[w.quoteStyle||"single"];return P.lastIndex=0,wrapQuotes$1(Vs.call(Vs.call(_,P,"\\$1"),/[\x00-\x1f]/g,lowbyte$1),"single",w)}function lowbyte$1(_){var w=_.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[w];return E?"\\"+E:"\\x"+(w<16?"0":"")+Hs.call(w.toString(16))}function markBoxed$1(_){return"Object("+_+")"}function weakCollectionOf$1(_){return _+" { ? }"}function collectionOf$1(_,w,E,C){return _+" ("+w+") {"+(C?indentedJoin$1(E,C):Gs.call(E,", "))+"}"}function indentedJoin$1(_,w){if(0===_.length)return"";var E="\n"+w.prev+w.base;return E+Gs.call(_,","+E)+"\n"+w.prev}function arrObjKeys$1(_,w){var E=isArray$5(_),C=[];if(E){C.length=_.length;for(var P=0;P<_.length;P++)C[P]=has$4(_,P)?w(_[P],_):""}var R,L="function"==typeof Js?Js(_):[];if(Ys){R={};for(var I=0;I<L.length;I++)R["$"+L[I]]=L[I]}for(var k in _)has$4(_,k)&&(E&&String(Number(k))===k&&k<_.length||Ys&&R["$"+k]instanceof Symbol||(qs.call(/[^\w$]/,k)?C.push(w(k,_)+": "+w(_[k],_)):C.push(k+": "+w(_[k],_))));if("function"==typeof Js)for(var F=0;F<L.length;F++)ta.call(_,L[F])&&C.push("["+w(L[F])+"]: "+w(_[L[F]],_));return C}var la=ca,pa=rt,listGetNode=function(_,w,E){for(var C,P=_;null!=(C=P.next);P=C)if(C.key===w)return P.next=C.next,E||(C.next=_.next,_.next=C),C},da=qe.inspect,fa="function"==typeof Map&&Map.prototype,ha=Object.getOwnPropertyDescriptor&&fa?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ga=fa&&ha&&"function"==typeof ha.get?ha.get:null,ma=fa&&Map.prototype.forEach,ya="function"==typeof Set&&Set.prototype,ba=Object.getOwnPropertyDescriptor&&ya?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_a=ya&&ba&&"function"==typeof ba.get?ba.get:null,va=ya&&Set.prototype.forEach,Sa="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,wa="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Ea="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Ta=Boolean.prototype.valueOf,Aa=Object.prototype.toString,Oa=Function.prototype.toString,Ca=String.prototype.match,Pa=String.prototype.slice,Ra=String.prototype.replace,xa=String.prototype.toUpperCase,La=String.prototype.toLowerCase,Ia=RegExp.prototype.test,Na=Array.prototype.concat,Da=Array.prototype.join,ka=Array.prototype.slice,Fa=Math.floor,ja="function"==typeof BigInt?BigInt.prototype.valueOf:null,Ma=Object.getOwnPropertySymbols,$a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Ba="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Ua="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ba||"symbol")?Symbol.toStringTag:null,Va=Object.prototype.propertyIsEnumerable,Ha=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(_){return _.__proto__}:null);function addNumericSeparator(_,w){if(_===1/0||_===-1/0||_!=_||_&&_>-1e3&&_<1e3||Ia.call(/e/,w))return w;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof _){var C=_<0?-Fa(-_):Fa(_);if(C!==_){var P=String(C),R=Pa.call(w,P.length+1);return Ra.call(P,E,"$&_")+"."+Ra.call(Ra.call(R,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ra.call(w,E,"$&_")}var za=da,qa=za.custom,Wa=isSymbol(qa)?qa:null,Ga={__proto__:null,double:'"',single:"'"},Ka={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Qa=function inspect_(_,w,E,C){var P=w||{};if(has$3(P,"quoteStyle")&&!has$3(Ga,P.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(P,"maxStringLength")&&("number"==typeof P.maxStringLength?P.maxStringLength<0&&P.maxStringLength!==1/0:null!==P.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var R=!has$3(P,"customInspect")||P.customInspect;if("boolean"!=typeof R&&"symbol"!==R)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(P,"indent")&&null!==P.indent&&"\t"!==P.indent&&!(parseInt(P.indent,10)===P.indent&&P.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(P,"numericSeparator")&&"boolean"!=typeof P.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var L=P.numericSeparator;if(void 0===_)return"undefined";if(null===_)return"null";if("boolean"==typeof _)return _?"true":"false";if("string"==typeof _)return inspectString(_,P);if("number"==typeof _){if(0===_)return 1/0/_>0?"0":"-0";var I=String(_);return L?addNumericSeparator(_,I):I}if("bigint"==typeof _){var k=String(_)+"n";return L?addNumericSeparator(_,k):k}var F=void 0===P.depth?5:P.depth;if(void 0===E&&(E=0),E>=F&&F>0&&"object"==typeof _)return isArray$4(_)?"[Array]":"[Object]";var j=function getIndent(_,w){var E;if("\t"===_.indent)E="\t";else{if(!("number"==typeof _.indent&&_.indent>0))return null;E=Da.call(Array(_.indent+1)," ")}return{base:E,prev:Da.call(Array(w+1),E)}}(P,E);if(void 0===C)C=[];else if(indexOf(C,_)>=0)return"[Circular]";function inspect(_,w,R){if(w&&(C=ka.call(C)).push(w),R){var L={depth:P.depth};return has$3(P,"quoteStyle")&&(L.quoteStyle=P.quoteStyle),inspect_(_,L,E+1,C)}return inspect_(_,P,E+1,C)}if("function"==typeof _&&!isRegExp$1(_)){var $=function nameOf(_){if(_.name)return _.name;var w=Ca.call(Oa.call(_),/^function\s*([\w$]+)/);if(w)return w[1];return null}(_),V=arrObjKeys(_,inspect);return"[Function"+($?": "+$:" (anonymous)")+"]"+(V.length>0?" { "+Da.call(V,", ")+" }":"")}if(isSymbol(_)){var H=Ba?Ra.call(String(_),/^(Symbol\(.*\))_[^)]*$/,"$1"):$a.call(_);return"object"!=typeof _||Ba?H:markBoxed(H)}if(function isElement(_){if(!_||"object"!=typeof _)return!1;if("undefined"!=typeof HTMLElement&&_ instanceof HTMLElement)return!0;return"string"==typeof _.nodeName&&"function"==typeof _.getAttribute}(_)){for(var z="<"+La.call(String(_.nodeName)),q=_.attributes||[],G=0;G<q.length;G++)z+=" "+q[G].name+"="+wrapQuotes(quote(q[G].value),"double",P);return z+=">",_.childNodes&&_.childNodes.length&&(z+="..."),z+="</"+La.call(String(_.nodeName))+">"}if(isArray$4(_)){if(0===_.length)return"[]";var K=arrObjKeys(_,inspect);return j&&!function singleLineValues(_){for(var w=0;w<_.length;w++)if(indexOf(_[w],"\n")>=0)return!1;return!0}(K)?"["+indentedJoin(K,j)+"]":"[ "+Da.call(K,", ")+" ]"}if(function isError(_){return!("[object Error]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_)){var Q=arrObjKeys(_,inspect);return"cause"in Error.prototype||!("cause"in _)||Va.call(_,"cause")?0===Q.length?"["+String(_)+"]":"{ ["+String(_)+"] "+Da.call(Q,", ")+" }":"{ ["+String(_)+"] "+Da.call(Na.call("[cause]: "+inspect(_.cause),Q),", ")+" }"}if("object"==typeof _&&R){if(Wa&&"function"==typeof _[Wa]&&za)return za(_,{depth:F-E});if("symbol"!==R&&"function"==typeof _.inspect)return _.inspect()}if(function isMap(_){if(!ga||!_||"object"!=typeof _)return!1;try{ga.call(_);try{_a.call(_)}catch(_){return!0}return _ instanceof Map}catch(_){}return!1}(_)){var X=[];return ma&&ma.call(_,(function(w,E){X.push(inspect(E,_,!0)+" => "+inspect(w,_))})),collectionOf("Map",ga.call(_),X,j)}if(function isSet(_){if(!_a||!_||"object"!=typeof _)return!1;try{_a.call(_);try{ga.call(_)}catch(_){return!0}return _ instanceof Set}catch(_){}return!1}(_)){var J=[];return va&&va.call(_,(function(w){J.push(inspect(w,_))})),collectionOf("Set",_a.call(_),J,j)}if(function isWeakMap(_){if(!Sa||!_||"object"!=typeof _)return!1;try{Sa.call(_,Sa);try{wa.call(_,wa)}catch(_){return!0}return _ instanceof WeakMap}catch(_){}return!1}(_))return weakCollectionOf("WeakMap");if(function isWeakSet(_){if(!wa||!_||"object"!=typeof _)return!1;try{wa.call(_,wa);try{Sa.call(_,Sa)}catch(_){return!0}return _ instanceof WeakSet}catch(_){}return!1}(_))return weakCollectionOf("WeakSet");if(function isWeakRef(_){if(!Ea||!_||"object"!=typeof _)return!1;try{return Ea.call(_),!0}catch(_){}return!1}(_))return weakCollectionOf("WeakRef");if(function isNumber(_){return!("[object Number]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_))return markBoxed(inspect(Number(_)));if(function isBigInt(_){if(!_||"object"!=typeof _||!ja)return!1;try{return ja.call(_),!0}catch(_){}return!1}(_))return markBoxed(inspect(ja.call(_)));if(function isBoolean(_){return!("[object Boolean]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_))return markBoxed(Ta.call(_));if(function isString(_){return!("[object String]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_))return markBoxed(inspect(String(_)));if("undefined"!=typeof window&&_===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&_===globalThis||void 0!==ze&&_===ze)return"{ [object globalThis] }";if(!function isDate(_){return!("[object Date]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_)&&!isRegExp$1(_)){var Z=arrObjKeys(_,inspect),Y=Ha?Ha(_)===Object.prototype:_ instanceof Object||_.constructor===Object,ee=_ instanceof Object?"":"null prototype",te=!Y&&Ua&&Object(_)===_&&Ua in _?Pa.call(toStr(_),8,-1):ee?"Object":"",re=(Y||"function"!=typeof _.constructor?"":_.constructor.name?_.constructor.name+" ":"")+(te||ee?"["+Da.call(Na.call([],te||[],ee||[]),": ")+"] ":"");return 0===Z.length?re+"{}":j?re+"{"+indentedJoin(Z,j)+"}":re+"{ "+Da.call(Z,", ")+" }"}return String(_)};function wrapQuotes(_,w,E){var C=E.quoteStyle||w,P=Ga[C];return P+_+P}function quote(_){return Ra.call(String(_),/"/g,""")}function isArray$4(_){return!("[object Array]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}function isRegExp$1(_){return!("[object RegExp]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}function isSymbol(_){if(Ba)return _&&"object"==typeof _&&_ instanceof Symbol;if("symbol"==typeof _)return!0;if(!_||"object"!=typeof _||!$a)return!1;try{return $a.call(_),!0}catch(_){}return!1}var Xa=Object.prototype.hasOwnProperty||function(_){return _ in this};function has$3(_,w){return Xa.call(_,w)}function toStr(_){return Aa.call(_)}function indexOf(_,w){if(_.indexOf)return _.indexOf(w);for(var E=0,C=_.length;E<C;E++)if(_[E]===w)return E;return-1}function inspectString(_,w){if(_.length>w.maxStringLength){var E=_.length-w.maxStringLength,C="... "+E+" more character"+(E>1?"s":"");return inspectString(Pa.call(_,0,w.maxStringLength),w)+C}var P=Ka[w.quoteStyle||"single"];return P.lastIndex=0,wrapQuotes(Ra.call(Ra.call(_,P,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",w)}function lowbyte(_){var w=_.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[w];return E?"\\"+E:"\\x"+(w<16?"0":"")+xa.call(w.toString(16))}function markBoxed(_){return"Object("+_+")"}function weakCollectionOf(_){return _+" { ? }"}function collectionOf(_,w,E,C){return _+" ("+w+") {"+(C?indentedJoin(E,C):Da.call(E,", "))+"}"}function indentedJoin(_,w){if(0===_.length)return"";var E="\n"+w.prev+w.base;return E+Da.call(_,","+E)+"\n"+w.prev}function arrObjKeys(_,w){var E=isArray$4(_),C=[];if(E){C.length=_.length;for(var P=0;P<_.length;P++)C[P]=has$3(_,P)?w(_[P],_):""}var R,L="function"==typeof Ma?Ma(_):[];if(Ba){R={};for(var I=0;I<L.length;I++)R["$"+L[I]]=L[I]}for(var k in _)has$3(_,k)&&(E&&String(Number(k))===k&&k<_.length||Ba&&R["$"+k]instanceof Symbol||(Ia.call(/[^\w$]/,k)?C.push(w(k,_)+": "+w(_[k],_)):C.push(k+": "+w(_[k],_))));if("function"==typeof Ma)for(var F=0;F<L.length;F++)Va.call(_,L[F])&&C.push("["+w(L[F])+"]: "+w(_[L[F]],_));return C}var Ja=Ur,Za=Qa,Ya=rt,ec=jr("%Map%",!0),tc=Ja("Map.prototype.get",!0),rc=Ja("Map.prototype.set",!0),nc=Ja("Map.prototype.has",!0),oc=Ja("Map.prototype.delete",!0),ic=Ja("Map.prototype.size",!0),sc=!!ec&&function getSideChannelMap(){var _,w={assert:function(_){if(!w.has(_))throw new Ya("Side channel does not contain "+Za(_))},delete:function(w){if(_){var E=oc(_,w);return 0===ic(_)&&(_=void 0),E}return!1},get:function(w){if(_)return tc(_,w)},has:function(w){return!!_&&nc(_,w)},set:function(w,E){_||(_=new ec),rc(_,w,E)}};return w},ac=Ur,cc=Qa,uc=sc,lc=rt,pc=jr("%WeakMap%",!0),dc=ac("WeakMap.prototype.get",!0),fc=ac("WeakMap.prototype.set",!0),hc=ac("WeakMap.prototype.has",!0),gc=ac("WeakMap.prototype.delete",!0),mc=rt,yc=ca,bc=function getSideChannelList(){var _,w={assert:function(_){if(!w.has(_))throw new pa("Side channel does not contain "+la(_))},delete:function(w){var E=function(_,w){if(_)return listGetNode(_,w,!0)}(_,w);return E&&_&&!_.next&&(_=void 0),!!E},get:function(w){return function(_,w){if(_){var E=listGetNode(_,w);return E&&E.value}}(_,w)},has:function(w){return function(_,w){return!!_&&!!listGetNode(_,w)}(_,w)},set:function(w,E){_||(_={next:void 0}),function(_,w,E){var C=listGetNode(_,w);C?C.value=E:_.next={key:w,next:_.next,value:E}}(_,w,E)}};return w},_c=(pc?function getSideChannelWeakMap(){var _,w,E={assert:function(_){if(!E.has(_))throw new lc("Side channel does not contain "+cc(_))},delete:function(E){if(pc&&E&&("object"==typeof E||"function"==typeof E)){if(_)return gc(_,E)}else if(uc&&w)return w.delete(E);return!1},get:function(E){return pc&&E&&("object"==typeof E||"function"==typeof E)&&_?dc(_,E):w&&w.get(E)},has:function(E){return pc&&E&&("object"==typeof E||"function"==typeof E)&&_?hc(_,E):!!w&&w.has(E)},set:function(E,C){pc&&E&&("object"==typeof E||"function"==typeof E)?(_||(_=new pc),fc(_,E,C)):uc&&(w||(w=uc()),w.set(E,C))}};return E}:uc)||sc||bc,vc=function getSideChannel(){var _,w={assert:function(_){if(!w.has(_)){var E=_&&Object(_)===_?"the given object key":yc(_);throw new mc("Side channel does not contain "+E)}},delete:function(w){return!!_&&_.delete(w)},get:function(w){return _&&_.get(w)},has:function(w){return!!_&&_.has(w)},set:function(w,E){_||(_=_c()),_.set(w,E)}};return w},Sc=String.prototype.replace,wc=/%20/g,Ec="RFC3986",Tc={default:Ec,formatters:{RFC1738:function(_){return Sc.call(_,wc,"+")},RFC3986:function(_){return String(_)}},RFC1738:"RFC1738",RFC3986:Ec},Ac=Tc,Oc=vc,Cc=mt,Pc=Object.prototype.hasOwnProperty,Rc=Array.isArray,xc=Oc(),Lc=function markOverflow(_,w){return xc.set(_,w),_},Ic=function isOverflow(_){return xc.has(_)},Nc=function getMaxIndex(_){return xc.get(_)},Dc=function setMaxIndex(_,w){xc.set(_,w)},kc=function(){for(var _=[],w=0;w<256;++w)_[_.length]="%"+((w<16?"0":"")+w.toString(16)).toUpperCase();return _}(),Fc=function arrayToObject(_,w){for(var E=w&&w.plainObjects?{__proto__:null}:{},C=0;C<_.length;++C)void 0!==_[C]&&(E[C]=_[C]);return E},jc=function setProperty(_,w,E){"__proto__"===w&&Cc?Cc(_,w,{configurable:!0,enumerable:!0,value:E,writable:!0}):_[w]=E},Mc=1024,$c={arrayToObject:Fc,assign:function assignSingleSource(_,w){return Object.keys(w).reduce((function(_,E){return jc(_,E,w[E]),_}),_)},combine:function combine(_,w,E,C,P){if(Ic(_)){if(P)throw new RangeError("Array limit exceeded. Only "+E+" element"+(1===E?"":"s")+" allowed in an array.");for(var R=Rc(w)?w:[w],L=Nc(_),I=0;I<R.length;++I)_[L+=1]=R[I];return Dc(_,L),_}var k=[].concat(_,w);if(k.length>E){if(P)throw new RangeError("Array limit exceeded. Only "+E+" element"+(1===E?"":"s")+" allowed in an array.");return Lc(Fc(k,{plainObjects:C}),k.length-1)}return k},compact:function compact(_){for(var w=[{obj:{o:_},prop:"o"}],E=Oc(),C=0;C<w.length;++C)for(var P=w[C],R=P.obj[P.prop],L=Object.keys(R),I=0;I<L.length;++I){var k=L[I],F=R[k];"object"!=typeof F||null===F||E.has(F)||(w[w.length]={obj:R,prop:k},E.set(F,!0))}return function compactQueue(_){for(;_.length>1;){var w=_.pop(),E=w.obj[w.prop];if(Rc(E)){for(var C=[],P=0;P<E.length;++P)void 0!==E[P]&&(C[C.length]=E[P]);w.obj[w.prop]=C}}}(w),_},decode:function(_,w,E){var C=_.replace(/\+/g," ");if("iso-8859-1"===E)return C.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(C)}catch(_){return C}},encode:function encode(_,w,E,C,P){if(0===_.length)return _;var R=_;if("symbol"==typeof _?R=Symbol.prototype.toString.call(_):"string"!=typeof _&&(R=String(_)),"iso-8859-1"===E)return escape(R).replace(/%u[0-9a-f]{4}/gi,(function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"}));for(var L="",I=0;I<R.length;I+=Mc){var k=R.length>=Mc?R.slice(I,I+Mc):R;if(I+Mc<R.length){var F=k.charCodeAt(k.length-1);F>=55296&&F<=56319&&(k=k.slice(0,-1),I-=1)}for(var j=[],$=0;$<k.length;++$){var V=k.charCodeAt($);45===V||46===V||95===V||126===V||V>=48&&V<=57||V>=65&&V<=90||V>=97&&V<=122||P===Ac.RFC1738&&(40===V||41===V)?j[j.length]=k.charAt($):V<128?j[j.length]=kc[V]:V<2048?j[j.length]=kc[192|V>>6]+kc[128|63&V]:V<55296||V>=57344?j[j.length]=kc[224|V>>12]+kc[128|V>>6&63]+kc[128|63&V]:($+=1,V=65536+((1023&V)<<10|1023&k.charCodeAt($)),j[j.length]=kc[240|V>>18]+kc[128|V>>12&63]+kc[128|V>>6&63]+kc[128|63&V])}L+=j.join("")}return L},isBuffer:function isBuffer(_){return!(!_||"object"!=typeof _)&&!(!_.constructor||"function"!=typeof _.constructor.isBuffer||!_.constructor.isBuffer(_))},isOverflow:Ic,isRegExp:function isRegExp(_){return"[object RegExp]"===Object.prototype.toString.call(_)},markOverflow:Lc,maybeMap:function maybeMap(_,w){if(Rc(_)){for(var E=[],C=0;C<_.length;C+=1)E[E.length]=w(_[C]);return E}return w(_)},merge:function merge(_,w,E){if(!w)return _;if("object"!=typeof w&&"function"!=typeof w){if(Rc(_)){var C=_.length;if(E&&"number"==typeof E.arrayLimit&&C>=E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");return Lc(Fc(_.concat(w),E),C)}_[C]=w}else{if(!_||"object"!=typeof _)return[_,w];if(Ic(_)){var P=Nc(_)+1;_[P]=w,Dc(_,P)}else{if(E&&E.strictMerge)return[_,w];(E&&(E.plainObjects||E.allowPrototypes)||!Pc.call(Object.prototype,w))&&(_[w]=!0)}}return _}if(!_||"object"!=typeof _){if(Ic(w)){for(var R=Object.keys(w),L=E&&E.plainObjects?{__proto__:null,0:_}:{0:_},I=0;I<R.length;I++){L[parseInt(R[I],10)+1]=w[R[I]]}return Lc(L,Nc(w)+1)}var k=[_].concat(w);if(E&&"number"==typeof E.arrayLimit&&k.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");return Lc(Fc(k,E),k.length-1)}return k}var F=_;if(Rc(_)&&!Rc(w)&&(F=Fc(_,E)),Rc(_)&&Rc(w)){if(w.forEach((function(w,C){if(Pc.call(_,C)){var P=_[C];P&&"object"==typeof P&&w&&"object"==typeof w?_[C]=merge(P,w,E):_[_.length]=w}else _[C]=w})),E&&"number"==typeof E.arrayLimit&&_.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");return Lc(Fc(_,E),_.length-1)}return _}return Object.keys(w).reduce((function(_,C){var P=w[C];if(Pc.call(_,C)?jc(_,C,merge(_[C],P,E)):jc(_,C,P),Ic(w)&&!Ic(_)&&Lc(_,Nc(w)),Ic(_)){var R=parseInt(C,10);String(R)===C&&R>=0&&R>Nc(_)&&Dc(_,R)}return _}),F)}},Bc=vc,Uc=$c,Vc=Tc,Hc=Object.prototype.hasOwnProperty,zc={brackets:function brackets(_){return _+"[]"},comma:"comma",indices:function indices(_,w){return _+"["+w+"]"},repeat:function repeat(_){return _}},qc=Array.isArray,Wc=Array.prototype.push,pushToArray=function(_,w){Wc.apply(_,qc(w)?w:[w])},Gc=Date.prototype.toISOString,Kc=Vc.default,Qc={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",depth:1/0,encode:!0,encodeDotInKeys:!1,encoder:Uc.encode,encodeValuesOnly:!1,filter:void 0,format:Kc,formatter:Vc.formatters[Kc],indices:!1,serializeDate:function serializeDate(_){return Gc.call(_)},skipNulls:!1,strictNullHandling:!1},Xc={},Jc=function stringify(_,w,E,C,P,R,L,I,k,F,j,$,V,H,z,q,G,K,Q,X){var J=_;if(X>Q)throw new RangeError("Input depth exceeded depth option of "+Q);for(var Z=K,Y=0,ee=!1;void 0!==(Z=Z.get(Xc))&&!ee;){var te=Z.get(_);if(Y+=1,void 0!==te){if(te===Y)throw new RangeError("Cyclic object value");ee=!0}void 0===Z.get(Xc)&&(Y=0)}if((J="function"==typeof F?F(w,J):J)instanceof Date?J=V(J):"comma"===E&&qc(J)&&(J=Uc.maybeMap(J,(function(_){return _ instanceof Date?V(_):_}))),null===J){if(R)return z(k&&!q?k(w,Qc.encoder,G,"key",H):w);J=""}if(function isNonNullishPrimitive(_){return"string"==typeof _||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _}(J)||Uc.isBuffer(J))return k?[z(q?w:k(w,Qc.encoder,G,"key",H))+"="+z(k(J,Qc.encoder,G,"value",H))]:[z(w)+"="+z(String(J))];var re,ne=[];if(void 0===J)return ne;if("comma"===E&&qc(J))q&&k&&(J=Uc.maybeMap(J,(function(_){return null==_?_:k(_)}))),re=[{value:J.length>0?J.join(",")||null:void 0}];else if(qc(F))re=F;else{var oe=Object.keys(J);re=j?oe.sort(j):oe}var ie=I?String(w).replace(/\./g,"%2E"):String(w),se=C&&qc(J)&&1===J.length?ie+"[]":ie;if(P&&qc(J)&&0===J.length&&0===Object.keys(J).length)return se+"[]";for(var ae=0;ae<re.length;++ae){var ce=re[ae],ue="object"==typeof ce&&ce&&void 0!==ce.value?ce.value:J[ce];if(!L||null!==ue){var le=$&&I?String(ce).replace(/\./g,"%2E"):String(ce),pe=qc(J)?"function"==typeof E?E(se,le):se:se+($?"."+le:"["+le+"]");K.set(_,Y);var de=Bc();de.set(Xc,K),pushToArray(ne,stringify(ue,pe,E,C,P,R,L,I,"comma"===E&&q&&qc(J)?null:k,F,j,$,V,H,z,q,G,de,Q,X+1))}}return ne},Zc=$c,Yc=Object.prototype.hasOwnProperty,eu=Array.isArray,tu={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Zc.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},interpretNumericEntities=function(_){return _.replace(/&#(\d+);/g,(function(_,w){return String.fromCharCode(parseInt(w,10))}))},parseArrayValue=function(_,w,E){if(_&&"string"==typeof _&&w.comma&&_.indexOf(",")>-1){if(w.throwOnLimitExceeded)for(var C=0,P=_.indexOf(",");P>-1;){if((C+=1)>=w.arrayLimit)throw new RangeError("Array limit exceeded. Only "+w.arrayLimit+" element"+(1===w.arrayLimit?"":"s")+" allowed in an array.");P=_.indexOf(",",P+1)}return _.split(",")}if(w.throwOnLimitExceeded&&E>=w.arrayLimit)throw new RangeError("Array limit exceeded. Only "+w.arrayLimit+" element"+(1===w.arrayLimit?"":"s")+" allowed in an array.");return _},ru=function parseQueryStringKeys(_,w,E,C){if(_){var P=function splitKeyIntoSegments(_,w){var E=w.allowDots?_.replace(/\.([^.[]+)/g,"[$1]"):_;if(w.depth<=0){if(!w.plainObjects&&Yc.call(Object.prototype,E)&&!w.allowPrototypes)return;return[E]}var C=[],P=E.indexOf("["),R=P>=0?E.slice(0,P):E;if(R){if(!w.plainObjects&&Yc.call(Object.prototype,R)&&!w.allowPrototypes)return;C[C.length]=R}for(var L=E.length,I=P,k=0;I>=0&&k<w.depth;){for(var F=1,j=I+1,$=-1;j<L&&$<0;){var V=E.charCodeAt(j);91===V?F+=1:93===V&&0==(F-=1)&&($=j),j+=1}if($<0)return C[C.length]="["+E.slice(I)+"]",C;var H=E.slice(I,$+1),z=H.slice(1,-1);if(!w.plainObjects&&Yc.call(Object.prototype,z)&&!w.allowPrototypes)return;C[C.length]=H,k+=1,I=E.indexOf("[",$+1)}if(I>=0){if(!0===w.strictDepth)throw new RangeError("Input depth exceeded depth option of "+w.depth+" and strictDepth is true");C[C.length]="["+E.slice(I)+"]"}return C}(_,E);if(P)return function(_,w,E,C){var P=0;if(_.length>0&&"[]"===_[_.length-1]){var R=_.slice(0,-1).join("");P=Array.isArray(w)&&w[R]?w[R].length:0}for(var L=C?w:parseArrayValue(w,E,P),I=_.length-1;I>=0;--I){var k,F=_[I];if("[]"===F&&E.parseArrays)k=Zc.isOverflow(L)?L:E.allowEmptyArrays&&(""===L||E.strictNullHandling&&null===L)?[]:Zc.combine([],L,E.arrayLimit,E.plainObjects,E.throwOnLimitExceeded);else{k=E.plainObjects?{__proto__:null}:{};var j="["===F.charAt(0)&&"]"===F.charAt(F.length-1)?F.slice(1,-1):F,$=E.decodeDotInKeys?j.replace(/%2E/g,"."):j,V=parseInt($,10),H=!isNaN(V)&&F!==$&&String(V)===$&&V>=0&&E.parseArrays;if(E.parseArrays||""!==$)if(H&&V<E.arrayLimit)(k=[])[V]=L;else{if(H&&E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");H?(k[V]=L,Zc.markOverflow(k,V)):"__proto__"!==$&&(k[$]=L)}else k={0:L}}L=k}return L}(P,w,E,C)}},stringify=function(_,w){var E,C=_,P=function normalizeStringifyOptions(_){if(!_)return Qc;if(void 0!==_.allowEmptyArrays&&"boolean"!=typeof _.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==_.encodeDotInKeys&&"boolean"!=typeof _.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==_.encoder&&void 0!==_.encoder&&"function"!=typeof _.encoder)throw new TypeError("Encoder has to be a function.");var w=_.charset||Qc.charset;if(void 0!==_.charset&&"utf-8"!==_.charset&&"iso-8859-1"!==_.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=Vc.default;if(void 0!==_.format){if(!Hc.call(Vc.formatters,_.format))throw new TypeError("Unknown format option provided.");E=_.format}var C,P=Vc.formatters[E],R=Qc.filter;if(("function"==typeof _.filter||qc(_.filter))&&(R=_.filter),C=_.arrayFormat in zc?_.arrayFormat:"indices"in _?_.indices?"indices":"repeat":Qc.arrayFormat,"commaRoundTrip"in _&&"boolean"!=typeof _.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var L=void 0===_.allowDots?!0===_.encodeDotInKeys||Qc.allowDots:!!_.allowDots;return{addQueryPrefix:"boolean"==typeof _.addQueryPrefix?_.addQueryPrefix:Qc.addQueryPrefix,allowDots:L,allowEmptyArrays:"boolean"==typeof _.allowEmptyArrays?!!_.allowEmptyArrays:Qc.allowEmptyArrays,arrayFormat:C,charset:w,charsetSentinel:"boolean"==typeof _.charsetSentinel?_.charsetSentinel:Qc.charsetSentinel,commaRoundTrip:!!_.commaRoundTrip,delimiter:void 0===_.delimiter?Qc.delimiter:_.delimiter,depth:"number"==typeof _.depth?_.depth:Qc.depth,encode:"boolean"==typeof _.encode?_.encode:Qc.encode,encodeDotInKeys:"boolean"==typeof _.encodeDotInKeys?_.encodeDotInKeys:Qc.encodeDotInKeys,encoder:"function"==typeof _.encoder?_.encoder:Qc.encoder,encodeValuesOnly:"boolean"==typeof _.encodeValuesOnly?_.encodeValuesOnly:Qc.encodeValuesOnly,filter:R,format:E,formatter:P,serializeDate:"function"==typeof _.serializeDate?_.serializeDate:Qc.serializeDate,skipNulls:"boolean"==typeof _.skipNulls?_.skipNulls:Qc.skipNulls,sort:"function"==typeof _.sort?_.sort:null,strictNullHandling:"boolean"==typeof _.strictNullHandling?_.strictNullHandling:Qc.strictNullHandling}}(w);"function"==typeof P.filter?C=(0,P.filter)("",C):qc(P.filter)&&(E=P.filter);var R=[];if("object"!=typeof C||null===C)return"";var L=zc[P.arrayFormat],I="comma"===L&&P.commaRoundTrip;E||(E=Object.keys(C)),P.sort&&E.sort(P.sort);for(var k=Bc(),F=0;F<E.length;++F){var j=E[F];if(null!=j){var $=C[j];if(!P.skipNulls||null!==$){var V=P.encodeDotInKeys?String(j).replace(/\./g,"%2E"):String(j);pushToArray(R,Jc($,V,L,I,P.allowEmptyArrays,P.strictNullHandling,P.skipNulls,P.encodeDotInKeys,P.encode?P.encoder:null,P.filter,P.sort,P.allowDots,P.serializeDate,P.format,P.formatter,P.encodeValuesOnly,P.charset,k,P.depth,0))}}}var H=R.join(P.delimiter),z=!0===P.addQueryPrefix?"?":"";return P.charsetSentinel&&("iso-8859-1"===P.charset?z+="utf8=%26%2310003%3B"+P.delimiter:z+="utf8=%E2%9C%93"+P.delimiter),H.length>0?z+H:""},parse=function(_,w){var E=function normalizeParseOptions(_){if(!_)return tu;if(void 0!==_.allowEmptyArrays&&"boolean"!=typeof _.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==_.decodeDotInKeys&&"boolean"!=typeof _.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==_.decoder&&void 0!==_.decoder&&"function"!=typeof _.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==_.charset&&"utf-8"!==_.charset&&"iso-8859-1"!==_.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==_.throwOnLimitExceeded&&"boolean"!=typeof _.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var w=void 0===_.charset?tu.charset:_.charset,E=void 0===_.duplicates?tu.duplicates:_.duplicates;if("combine"!==E&&"first"!==E&&"last"!==E)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===_.allowDots?!0===_.decodeDotInKeys||tu.allowDots:!!_.allowDots,allowEmptyArrays:"boolean"==typeof _.allowEmptyArrays?!!_.allowEmptyArrays:tu.allowEmptyArrays,allowPrototypes:"boolean"==typeof _.allowPrototypes?_.allowPrototypes:tu.allowPrototypes,allowSparse:"boolean"==typeof _.allowSparse?_.allowSparse:tu.allowSparse,arrayLimit:"number"==typeof _.arrayLimit?_.arrayLimit:tu.arrayLimit,charset:w,charsetSentinel:"boolean"==typeof _.charsetSentinel?_.charsetSentinel:tu.charsetSentinel,comma:"boolean"==typeof _.comma?_.comma:tu.comma,decodeDotInKeys:"boolean"==typeof _.decodeDotInKeys?_.decodeDotInKeys:tu.decodeDotInKeys,decoder:"function"==typeof _.decoder?_.decoder:tu.decoder,delimiter:"string"==typeof _.delimiter||Zc.isRegExp(_.delimiter)?_.delimiter:tu.delimiter,depth:"number"==typeof _.depth||!1===_.depth?+_.depth:tu.depth,duplicates:E,ignoreQueryPrefix:!0===_.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof _.interpretNumericEntities?_.interpretNumericEntities:tu.interpretNumericEntities,parameterLimit:"number"==typeof _.parameterLimit?_.parameterLimit:tu.parameterLimit,parseArrays:!1!==_.parseArrays,plainObjects:"boolean"==typeof _.plainObjects?_.plainObjects:tu.plainObjects,strictDepth:"boolean"==typeof _.strictDepth?!!_.strictDepth:tu.strictDepth,strictMerge:"boolean"==typeof _.strictMerge?!!_.strictMerge:tu.strictMerge,strictNullHandling:"boolean"==typeof _.strictNullHandling?_.strictNullHandling:tu.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof _.throwOnLimitExceeded&&_.throwOnLimitExceeded}}(w);if(""===_||null==_)return E.plainObjects?{__proto__:null}:{};for(var C="string"==typeof _?function parseQueryStringValues(_,w){var E={__proto__:null},C=w.ignoreQueryPrefix?_.replace(/^\?/,""):_;C=C.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var P=w.parameterLimit===1/0?void 0:w.parameterLimit,R=C.split(w.delimiter,w.throwOnLimitExceeded&&void 0!==P?P+1:P);if(w.throwOnLimitExceeded&&void 0!==P&&R.length>P)throw new RangeError("Parameter limit exceeded. Only "+P+" parameter"+(1===P?"":"s")+" allowed.");var L,I=-1,k=w.charset;if(w.charsetSentinel)for(L=0;L<R.length;++L)0===R[L].indexOf("utf8=")&&("utf8=%E2%9C%93"===R[L]?k="utf-8":"utf8=%26%2310003%3B"===R[L]&&(k="iso-8859-1"),I=L,L=R.length);for(L=0;L<R.length;++L)if(L!==I){var F,j,$=R[L],V=$.indexOf("]="),H=-1===V?$.indexOf("="):V+1;if(-1===H?(F=w.decoder($,tu.decoder,k,"key"),j=w.strictNullHandling?null:""):null!==(F=w.decoder($.slice(0,H),tu.decoder,k,"key"))&&(j=Zc.maybeMap(parseArrayValue($.slice(H+1),w,eu(E[F])?E[F].length:0),(function(_){return w.decoder(_,tu.decoder,k,"value")}))),j&&w.interpretNumericEntities&&"iso-8859-1"===k&&(j=interpretNumericEntities(String(j))),$.indexOf("[]=")>-1&&(j=eu(j)?[j]:j),w.comma&&eu(j)&&j.length>w.arrayLimit&&(j=Zc.combine([],j,w.arrayLimit,w.plainObjects,w.throwOnLimitExceeded)),null!==F){var z=Yc.call(E,F);z&&("combine"===w.duplicates||$.indexOf("[]=")>-1)?E[F]=Zc.combine(E[F],j,w.arrayLimit,w.plainObjects,w.throwOnLimitExceeded):z&&"last"!==w.duplicates||(E[F]=j)}}return E}(_,E):_,P=E.plainObjects?{__proto__:null}:{},R=Object.keys(C),L=0;L<R.length;++L){var I=R[L],k=ru(I,C[I],E,"string"==typeof _);P=Zc.merge(P,k,E)}return!0===E.allowSparse?P:Zc.compact(P)},nu={formats:Tc,parse:parse,stringify:stringify},ou=Ts.exports;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var iu=/^([a-z0-9.+-]+:)/i,su=/:[0-9]*$/,au=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,cu=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),uu=["'"].concat(cu),lu=["%","/","?",";","#"].concat(uu),pu=["/","?","#"],du=/^[+a-z0-9A-Z_-]{0,63}$/,fu=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hu={javascript:!0,"javascript:":!0},gu={javascript:!0,"javascript:":!0},mu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},yu=nu;function urlParse(_,w,E){if(_&&"object"==typeof _&&_ instanceof Url)return _;var C=new Url;return C.parse(_,w,E),C}function __classPrivateFieldGet(_,w,E,C){if("a"===E&&!C)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof w?_!==w||!C:!w.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===E?C:"a"===E?C.call(_):C?C.value:w.get(_)}function __classPrivateFieldSet(_,w,E,C,P){if("m"===C)throw new TypeError("Private method is not writable");if("a"===C&&!P)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof w?_!==w||!P:!w.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===C?P.call(_,E):P?P.value=E:w.set(_,E),E}Url.prototype.parse=function(_,w,E){if("string"!=typeof _)throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var C=_.indexOf("?"),P=-1!==C&&C<_.indexOf("#")?"?":"#",R=_.split(P);R[0]=R[0].replace(/\\/g,"/");var L=_=R.join(P);if(L=L.trim(),!E&&1===_.split("#").length){var I=au.exec(L);if(I)return this.path=L,this.href=L,this.pathname=I[1],I[2]?(this.search=I[2],this.query=w?yu.parse(this.search.substr(1)):this.search.substr(1)):w&&(this.search="",this.query={}),this}var k=iu.exec(L);if(k){var F=(k=k[0]).toLowerCase();this.protocol=F,L=L.substr(k.length)}if(E||k||L.match(/^\/\/[^@/]+@[^@/]+/)){var j="//"===L.substr(0,2);!j||k&&gu[k]||(L=L.substr(2),this.slashes=!0)}if(!gu[k]&&(j||k&&!mu[k])){for(var $,V,H=-1,z=0;z<pu.length;z++){-1!==(q=L.indexOf(pu[z]))&&(-1===H||q<H)&&(H=q)}-1!==(V=-1===H?L.lastIndexOf("@"):L.lastIndexOf("@",H))&&($=L.slice(0,V),L=L.slice(V+1),this.auth=decodeURIComponent($)),H=-1;for(z=0;z<lu.length;z++){var q;-1!==(q=L.indexOf(lu[z]))&&(-1===H||q<H)&&(H=q)}-1===H&&(H=L.length),this.host=L.slice(0,H),L=L.slice(H),this.parseHost(),this.hostname=this.hostname||"";var G="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!G)for(var K=this.hostname.split(/\./),Q=(z=0,K.length);z<Q;z++){var X=K[z];if(X&&!X.match(du)){for(var J="",Z=0,Y=X.length;Z<Y;Z++)X.charCodeAt(Z)>127?J+="x":J+=X[Z];if(!J.match(du)){var ee=K.slice(0,z),te=K.slice(z+1),re=X.match(fu);re&&(ee.push(re[1]),te.unshift(re[2])),te.length&&(L="/"+te.join(".")+L),this.hostname=ee.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),G||(this.hostname=ou.toASCII(this.hostname));var ne=this.port?":"+this.port:"",oe=this.hostname||"";this.host=oe+ne,this.href+=this.host,G&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==L[0]&&(L="/"+L))}if(!hu[F])for(z=0,Q=uu.length;z<Q;z++){var ie=uu[z];if(-1!==L.indexOf(ie)){var se=encodeURIComponent(ie);se===ie&&(se=escape(ie)),L=L.split(ie).join(se)}}var ae=L.indexOf("#");-1!==ae&&(this.hash=L.substr(ae),L=L.slice(0,ae));var ce=L.indexOf("?");if(-1!==ce?(this.search=L.substr(ce),this.query=L.substr(ce+1),w&&(this.query=yu.parse(this.query)),L=L.slice(0,ce)):w&&(this.search="",this.query={}),L&&(this.pathname=L),mu[F]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){ne=this.pathname||"";var ue=this.search||"";this.path=ne+ue}return this.href=this.format(),this},Url.prototype.format=function(){var _=this.auth||"";_&&(_=(_=encodeURIComponent(_)).replace(/%3A/i,":"),_+="@");var w=this.protocol||"",E=this.pathname||"",C=this.hash||"",P=!1,R="";this.host?P=_+this.host:this.hostname&&(P=_+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(R=yu.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var L=this.search||R&&"?"+R||"";return w&&":"!==w.substr(-1)&&(w+=":"),this.slashes||(!w||mu[w])&&!1!==P?(P="//"+(P||""),E&&"/"!==E.charAt(0)&&(E="/"+E)):P||(P=""),C&&"#"!==C.charAt(0)&&(C="#"+C),L&&"?"!==L.charAt(0)&&(L="?"+L),w+P+(E=E.replace(/[?#]/g,(function(_){return encodeURIComponent(_)})))+(L=L.replace("#","%23"))+C},Url.prototype.resolve=function(_){return this.resolveObject(urlParse(_,!1,!0)).format()},Url.prototype.resolveObject=function(_){if("string"==typeof _){var w=new Url;w.parse(_,!1,!0),_=w}for(var E=new Url,C=Object.keys(this),P=0;P<C.length;P++){var R=C[P];E[R]=this[R]}if(E.hash=_.hash,""===_.href)return E.href=E.format(),E;if(_.slashes&&!_.protocol){for(var L=Object.keys(_),I=0;I<L.length;I++){var k=L[I];"protocol"!==k&&(E[k]=_[k])}return mu[E.protocol]&&E.hostname&&!E.pathname&&(E.pathname="/",E.path=E.pathname),E.href=E.format(),E}if(_.protocol&&_.protocol!==E.protocol){if(!mu[_.protocol]){for(var F=Object.keys(_),j=0;j<F.length;j++){var $=F[j];E[$]=_[$]}return E.href=E.format(),E}if(E.protocol=_.protocol,_.host||gu[_.protocol])E.pathname=_.pathname;else{for(var V=(_.pathname||"").split("/");V.length&&!(_.host=V.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),""!==V[0]&&V.unshift(""),V.length<2&&V.unshift(""),E.pathname=V.join("/")}if(E.search=_.search,E.query=_.query,E.host=_.host||"",E.auth=_.auth,E.hostname=_.hostname||_.host,E.port=_.port,E.pathname||E.search){var H=E.pathname||"",z=E.search||"";E.path=H+z}return E.slashes=E.slashes||_.slashes,E.href=E.format(),E}var q=E.pathname&&"/"===E.pathname.charAt(0),G=_.host||_.pathname&&"/"===_.pathname.charAt(0),K=G||q||E.host&&_.pathname,Q=K,X=E.pathname&&E.pathname.split("/")||[],J=(V=_.pathname&&_.pathname.split("/")||[],E.protocol&&!mu[E.protocol]);if(J&&(E.hostname="",E.port=null,E.host&&(""===X[0]?X[0]=E.host:X.unshift(E.host)),E.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&(""===V[0]?V[0]=_.host:V.unshift(_.host)),_.host=null),K=K&&(""===V[0]||""===X[0])),G)E.host=_.host||""===_.host?_.host:E.host,E.hostname=_.hostname||""===_.hostname?_.hostname:E.hostname,E.search=_.search,E.query=_.query,X=V;else if(V.length)X||(X=[]),X.pop(),X=X.concat(V),E.search=_.search,E.query=_.query;else if(null!=_.search){if(J)E.host=X.shift(),E.hostname=E.host,(re=!!(E.host&&E.host.indexOf("@")>0)&&E.host.split("@"))&&(E.auth=re.shift(),E.hostname=re.shift(),E.host=E.hostname);return E.search=_.search,E.query=_.query,null===E.pathname&&null===E.search||(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.href=E.format(),E}if(!X.length)return E.pathname=null,E.search?E.path="/"+E.search:E.path=null,E.href=E.format(),E;for(var Z=X.slice(-1)[0],Y=(E.host||_.host||X.length>1)&&("."===Z||".."===Z)||""===Z,ee=0,te=X.length;te>=0;te--)"."===(Z=X[te])?X.splice(te,1):".."===Z?(X.splice(te,1),ee++):ee&&(X.splice(te,1),ee--);if(!K&&!Q)for(;ee--;ee)X.unshift("..");!K||""===X[0]||X[0]&&"/"===X[0].charAt(0)||X.unshift(""),Y&&"/"!==X.join("/").substr(-1)&&X.push("");var re,ne=""===X[0]||X[0]&&"/"===X[0].charAt(0);J&&(E.hostname=ne?"":X.length?X.shift():"",E.host=E.hostname,(re=!!(E.host&&E.host.indexOf("@")>0)&&E.host.split("@"))&&(E.auth=re.shift(),E.hostname=re.shift(),E.host=E.hostname));return(K=K||E.host&&X.length)&&!ne&&X.unshift(""),X.length>0?E.pathname=X.join("/"):(E.pathname=null,E.path=null),null===E.pathname&&null===E.search||(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.auth=_.auth||E.auth,E.slashes=E.slashes||_.slashes,E.href=E.format(),E},Url.prototype.parseHost=function(){var _=this.host,w=su.exec(_);w&&(":"!==(w=w[0])&&(this.port=w.substr(1)),_=_.substr(0,_.length-w.length)),_&&(this.hostname=_)},Es.parse=urlParse,Es.resolve=function urlResolve(_,w){return urlParse(_,!1,!0).resolve(w)},Es.resolveObject=function urlResolveObject(_,w){return _?urlParse(_,!1,!0).resolveObject(w):w},Es.format=function urlFormat(_){return"string"==typeof _&&(_=urlParse(_)),_ instanceof Url?_.format():Url.prototype.format.call(_)},Es.Url=Url,"function"==typeof SuppressedError&&SuppressedError;var bu,_u,vu,Su,wu,Eu,Tu,Au,Ou,Cu={};const Pu=[],Ru=new WeakMap;let xu,Lu,Iu;const Nu=new Map,Du=[];function readExport(_,w){return"module.exports"!==w||Object.hasOwn(_,w)?_[w]:_.default}function setExport(_,w,E){return Ru.get(_).write(w,E)}const ku={defineProperty:function defineExport(_,w,E){if(!("value"in E))throw new Error("Getters/setters are not supported for exports property descriptors.");return setExport(_,w,E.value)},set:setExport};function setLegacyExport(_,w,E){const C=xu.get(_)?.[w];return"function"!=typeof C||C(E)}function getLegacyExport(_,w){if(w===Symbol.toStringTag)return"Module";const E=Lu.get(_)[w];return"function"==typeof E?E():void 0}function defineLegacyExport(_,w,E){if(!("value"in E))throw new Error("Getters/setters are not supported for exports property descriptors.");return setLegacyExport(_,w,E.value)}const Fu=[0,10,50];_u=new WeakMap,vu=new WeakMap,Su=new WeakMap,wu=new WeakMap,bu=new WeakSet,Eu=function _ModuleBinder_bind(_,w,E){let C;try{C=readExport(E,_),__classPrivateFieldGet(this,vu,"f").call(this,w,C),this.namespace[_]=C}catch(_){if(!(_ instanceof ReferenceError))throw _}void 0===C&&__classPrivateFieldSet(this,wu,__classPrivateFieldGet(this,wu,"f")??[],"f").push(__classPrivateFieldGet(this,bu,"m",Tu).call(this,_,w,E)),__classPrivateFieldGet(this,_u,"f")[_]=w},Tu=function _ModuleBinder_makeUpdater(_,w,E){return()=>{if(!0===__classPrivateFieldGet(this,Su,"f")?.[_])return!0;try{const C=readExport(E,_);return void 0!==C&&(__classPrivateFieldGet(this,vu,"f").call(this,w,C),this.namespace[_]=C,!0)}catch(_){if(_ instanceof ReferenceError)return!1;throw _}}},Au=function _ModuleBinder_flushOnce(){const _=__classPrivateFieldGet(this,wu,"f");if(void 0===_)return;let w;for(const E of _)!0!==E()&&(w??(w=[])).push(E);__classPrivateFieldSet(this,wu,w,"f")},Ou=function _ModuleBinder_scheduleRetry(_){if(void 0===__classPrivateFieldGet(this,wu,"f"))return;if(_>=Fu.length)return void __classPrivateFieldSet(this,wu,void 0,"f");const w=setTimeout((()=>{__classPrivateFieldGet(this,bu,"m",Au).call(this),__classPrivateFieldGet(this,bu,"m",_ModuleBinder_scheduleRetry).call(this,_+1)}),Fu[_]);w&&"function"==typeof w.unref&&w.unref()},Cu.register=function register(_,w,E,C,P){if(5===arguments.length)return void function registerLegacy(_,w,E,C,P){xu??(xu=new WeakMap),Lu??(Lu=new WeakMap),Iu??(Iu={defineProperty:defineLegacyExport,get:getLegacyExport,set:setLegacyExport}),Nu.set(_,P),xu.set(w,E),Lu.set(w,C);const R=new Proxy(w,Iu);Pu.forEach((w=>w(_,R,P))),Du.push([_,R,P])}(_,w,E,C,P);const{namespace:R}=w;Nu.set(_,E),Ru.set(R,w);const L=new Proxy(R,ku);Pu.forEach((w=>w(_,L,E))),Du.push([_,L,E])},Cu.ModuleBinder=class ModuleBinder{constructor(_,w,E,C){if(bu.add(this),this.namespace=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}}),_u.set(this,Object.create(null)),vu.set(this,void 0),Su.set(this,void 0),wu.set(this,void 0),__classPrivateFieldSet(this,vu,E,"f"),void 0!==w)for(let E=0;E<w.length;E++)__classPrivateFieldGet(this,bu,"m",Eu).call(this,w[E],E,C?.[E]??_)}write(_,w){const E=__classPrivateFieldGet(this,_u,"f")[_];return void 0!==E&&(__classPrivateFieldGet(this,vu,"f").call(this,E,w),void 0!==__classPrivateFieldGet(this,wu,"f")&&(__classPrivateFieldSet(this,Su,__classPrivateFieldGet(this,Su,"f")??Object.create(null),"f"),__classPrivateFieldGet(this,Su,"f")[_]=!0),this.namespace[_]=w),!0}flush(){void 0!==__classPrivateFieldGet(this,wu,"f")&&queueMicrotask((()=>{__classPrivateFieldGet(this,bu,"m",Au).call(this),__classPrivateFieldGet(this,bu,"m",Ou).call(this,0)}))}},Cu.importHooks=Pu,Cu.specifiers=Nu,Cu.toHook=Du;const ju=P,Mu=moduleDetailsFromPath$2,{fileURLToPath:$u}=Es,{MessageChannel:Bu}=I;let{isBuiltin:Uu}=R;Uu||(Uu=()=>!0);const{importHooks:Vu,specifiers:Hu,toHook:zu}=Cu;function isPackageSpecifier(_,w){if("win32"===process.platform&&_.includes("/")&&(w=w.replaceAll(ju.sep,"/")),w.endsWith(_))return!0;if(!(process.env.TURBOPACK??process.argv.includes("--turbo")))return!1;const E=_.lastIndexOf("-");return-1!==E&&w.endsWith(_.slice(0,E))}function addHook(_){Vu.push(_),zu.forEach((([w,E,C])=>_(w,E,C)))}function removeHook(_){const w=Vu.indexOf(_);w>-1&&Vu.splice(w,1)}function callHookFn(_,w,E,C){const P=_(w,E,C);P&&P!==w&&"default"in w&&(w.default=P)}let qu;function Hook(_,w,E){if(this instanceof Hook==!1)return new Hook(_,w,E);"function"==typeof _?(E=_,_=null,w=null):"function"==typeof w&&(E=w,w=null);const C=!!w&&!0===w.internals;qu&&Array.isArray(_)&&qu(_),this._iitmHook=(w,P,R)=>{const L=w;let I,k;if(L.startsWith("node:")){const _=w.slice(5);Uu(_)&&(w=_)}else if(L.startsWith("file://")){const _=Error.stackTraceLimit;Error.stackTraceLimit=0;try{I=$u(w),w=I}catch(_){}if(Error.stackTraceLimit=_,I){const _=Mu(I);_&&(w=_.name,k=_.basedir)}}if(_)for(const F of _)if(I&&F===I)callHookFn(E,P,I,void 0);else if(F===w)if(k){if(isPackageSpecifier(Hu.get(L),k))callHookFn(E,P,w,k);else if(C){const _=w+ju.sep+ju.relative(k,I);callHookFn(E,P,_,k)}}else callHookFn(E,P,w,k);else F===R&&callHookFn(E,P,R,k);else callHookFn(E,P,w,k)},addHook(this._iitmHook)}Hook.prototype.unhook=function(){removeHook(this._iitmHook)},ws.exports=Hook;var Wu,Gu=ws.exports.Hook=Hook;function safeExecuteInTheMiddle(_,w,E){let C,P;try{P=_()}catch(_){C=_}finally{return w(C,P),P}}ws.exports.addHook=addHook,ws.exports.removeHook=removeHook,ws.exports.createAddHookMessageChannel=function createAddHookMessageChannel(){const{port1:_,port2:w}=new Bu;let E,C=0;return qu=w=>{C++,_.postMessage(w)},_.on("message",(()=>{C--,E&&C<=0&&E()})).unref(),{registerOptions:{data:{addHookMessagePort:w,include:[]},transferList:[w]},addHookMessagePort:w,waitForAllMessagesAcknowledged:function waitForAllMessagesAcknowledged(){const _=setInterval((()=>{}),1e3),w=new Promise((_=>{E=_})).then((()=>{clearInterval(_)}));return 0===C&&E(),w}}};class InstrumentationBase extends InstrumentationAbstract{constructor(_,w,E){super(_,w,E),this._hooks=[],this._requireInTheMiddleSingleton=RequireInTheMiddleSingleton.getInstance(),this._enabled=!1,this._wrap=(_,w,E)=>{if(function isWrapped(_){return"function"==typeof _&&"function"==typeof _.__original&&"function"==typeof _.__unwrap&&!0===_.__wrapped}(_[w])&&this._unwrap(_,w),qe.types.isProxy(_)){const C=wrap(Object.assign({},_),w,E);return Object.defineProperty(_,w,{value:C}),C}return wrap(_,w,E)},this._unwrap=(_,w)=>qe.types.isProxy(_)?Object.defineProperty(_,w,{value:_[w]}):unwrap(_,w),this._massWrap=(_,w,E)=>{_?(Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{this._wrap(_,w,E)}))})):Ie.error("must provide one or more functions to wrap on modules")):Ie.error("must provide one or more modules to patch")},this._massUnwrap=(_,w)=>{_?(Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{this._unwrap(_,w)}))})):Ie.error("must provide one or more functions to wrap on modules")):Ie.error("must provide one or more modules to patch")};let C=this.init();C&&!Array.isArray(C)&&(C=[C]),this._modules=C||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){const _=globalThis.require;_?.resolve&&_?.cache&&this._modules.forEach((w=>{const{name:E}=w;try{const w=_.resolve(E);_.cache[w]?.loaded&&this._diag.warn(`Module ${E} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${E}`)}catch{}}))}_extractPackageVersion(_){try{const w=F(C.join(_,"package.json"),{encoding:"utf8"}),E=JSON.parse(w).version;return"string"==typeof E?E:void 0}catch{Ie.warn("Failed extracting version",_)}}_onRequire(_,w,E,P){if(!P)return"function"==typeof _.patch&&(_.moduleExports=w,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:_.name}),_.patch(w)):w;const R=this._extractPackageVersion(P);if(_.moduleVersion=R,_.name===E)return isSupported(_.supportedVersions,R,_.includePrerelease)&&"function"==typeof _.patch&&(_.moduleExports=w,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:_.name,version:_.moduleVersion,baseDir:P}),_.patch(w,_.moduleVersion)):w;const L=_.files??[],I=C.normalize(E),k=L.filter((w=>w.name===I&&isSupported(w.supportedVersions,R,_.includePrerelease)));return k.reduce(((w,E)=>(E.moduleExports=w,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:_.name,version:_.moduleVersion,fileName:E.name,baseDir:P}),E.patch(w,_.moduleVersion)):w)),w)}enable(){if(!this._enabled)if(this._enabled=!0,this._hooks.length>0)for(const _ of this._modules){"function"==typeof _.patch&&_.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:_.name,version:_.moduleVersion}),_.patch(_.moduleExports,_.moduleVersion));for(const w of _.files)w.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:_.name,version:_.moduleVersion,fileName:w.name}),w.patch(w.moduleExports,_.moduleVersion))}else{this._warnOnPreloadedModules();for(const _ of this._modules){const hookFn=(w,E,P)=>{if(!P&&C.isAbsolute(E)){const _=C.parse(E);E=_.name,P=_.dir}return this._onRequire(_,w,E,P)},onRequire=(w,E,C)=>this._onRequire(_,w,E,C),w=C.isAbsolute(_.name)?new fs([_.name],{internals:!0},onRequire):this._requireInTheMiddleSingleton.register(_.name,onRequire);this._hooks.push(w);const E=new Gu([_.name],{internals:!0},hookFn);this._hooks.push(E)}}}disable(){if(this._enabled){this._enabled=!1;for(const _ of this._modules){"function"==typeof _.unpatch&&_.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:_.name,version:_.moduleVersion}),_.unpatch(_.moduleExports,_.moduleVersion));for(const w of _.files)w.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:_.name,version:_.moduleVersion,fileName:w.name}),w.unpatch(w.moduleExports,_.moduleVersion))}}}isEnabled(){return this._enabled}}function isSupported(_,w,E){return void 0===w?_.includes("*"):_.some((_=>satisfies(w,_,{includePrerelease:E})))}function semconvStabilityFromStr(_,w){let E=Wu.OLD;const C=w?.split(",").map((_=>_.trim())).filter((_=>""!==_));for(const w of C??[]){if(w.toLowerCase()===_+"/dup"){E=Wu.DUPLICATE;break}w.toLowerCase()===_&&(E=Wu.STABLE)}return E}!function(_){_[_.STABLE=1]="STABLE",_[_.OLD=2]="OLD",_[_.DUPLICATE=3]="DUPLICATE"}(Wu||(Wu={}));var Ku="0.6.0";const Qu="browser.navigation_timing.type",Xu="url.full",Ju="browser.navigation_timing.dom_complete",Zu="browser.navigation_timing.dom_content_loaded_event_end",Yu="browser.navigation_timing.dom_content_loaded_event_start",el="browser.navigation_timing.dom_interactive",tl="browser.navigation_timing.load_event_end",rl="browser.navigation_timing.load_event_start",nl="browser.navigation_timing.redirect_count",ol="browser.navigation_timing.unload_event_end",il="browser.navigation_timing.unload_event_start",sl="browser.resource_timing.duration",al="browser.resource_timing.fetch_start",cl="browser.resource_timing.domain_lookup_start",ul="browser.resource_timing.domain_lookup_end",ll="browser.resource_timing.connect_start",pl="browser.resource_timing.connect_end",dl="browser.resource_timing.secure_connection_start",fl="browser.resource_timing.request_start",hl="browser.resource_timing.response_start",gl="browser.resource_timing.response_end",ml="browser.resource_timing.transfer_size",yl="browser.resource_timing.encoded_body_size",bl="browser.resource_timing.decoded_body_size";var _l=class extends InstrumentationBase{constructor(_={}){super("@opentelemetry/browser-instrumentation/navigation-timing",Ku,_),this._retryCount=0,this._didEmit=!1}init(){return[]}enable(){this._isEnabled||(this._isEnabled=!0,this._onLoad=()=>this._tryEmitOrSchedule(),this._onPageHide=()=>this._handleUnload(),this._tryEmitOrSchedule(),this._didEmit||window.addEventListener("pagehide",this._onPageHide))}disable(){this._isEnabled=!1,this._unsubscribeAll(),this._lastEntry=void 0,this._didEmit=!1,this._retryCount=0}_getLatestNavigationEntry(){const _=performance?.getEntriesByType?.("navigation");if(_&&0!==_.length)return _[_.length-1]}_calculateBackoffDelay(){return 50*this._retryCount}_tryEmitOrSchedule(){if(this._didEmit)return;const _=this._getLatestNavigationEntry();if(_&&(this._lastEntry=_),_&&_.loadEventEnd>0)return void this._emitAndCleanup(_);if("complete"!==document.readyState)return void window.addEventListener("load",this._onLoad,{once:!0});if(void 0!==this._completeDelayTimeoutId)return;if(this._retryCount>5)return void(this._lastEntry?(this._diag.warn("Navigation timing: retries exhausted, emitting incomplete entry"),this._emitAndCleanup(this._lastEntry)):(this._diag.warn("Navigation timing: retries exhausted with no entry available"),this._unsubscribeAll()));const w=this._calculateBackoffDelay();this._retryCount++,this._completeDelayTimeoutId=window.setTimeout((()=>{this._completeDelayTimeoutId=void 0,this._tryEmitOrSchedule()}),w)}_handleUnload(){if(this._didEmit)return;const _=this._getLatestNavigationEntry()??this._lastEntry;_?this._emitAndCleanup(_):(this._diag.warn("Navigation timing: no entry available at unload"),this._unsubscribeAll())}_emitAndCleanup(_){this._didEmit||(this._didEmit=!0,this._emitNavigationTiming(_),this._lastEntry=void 0,this._unsubscribeAll())}_emitNavigationTiming(_){_&&this.logger.emit({eventName:"browser.navigation_timing",severityNumber:z.INFO,attributes:{[Qu]:_.type,[Xu]:_.name,[sl]:_.duration,[Ju]:_.domComplete,[Zu]:_.domContentLoadedEventEnd,[Yu]:_.domContentLoadedEventStart,[el]:_.domInteractive,[tl]:_.loadEventEnd,[rl]:_.loadEventStart,[nl]:_.redirectCount,[ol]:_.unloadEventEnd,[il]:_.unloadEventStart,[al]:_.fetchStart,[cl]:_.domainLookupStart,[ul]:_.domainLookupEnd,[ll]:_.connectStart,[pl]:_.connectEnd,[dl]:_.secureConnectionStart,[fl]:_.requestStart,[hl]:_.responseStart,[gl]:_.responseEnd,[ml]:_.transferSize,[yl]:_.encodedBodySize,[bl]:_.decodedBodySize}})}_unsubscribeAll(){this._completeDelayTimeoutId&&(clearTimeout(this._completeDelayTimeoutId),this._completeDelayTimeoutId=void 0),this._onLoad&&window.removeEventListener("load",this._onLoad),this._onPageHide&&window.removeEventListener("pagehide",this._onPageHide)}};const getElementCSSSelector=(_,{useIdForTargetElement:w=!1,useIdForAncestors:E=!1}={})=>{if(_.nodeType===Node.DOCUMENT_NODE)return"";const C=_,P=getNodeSelector(C,w||E);if(P.startsWith("#"))return P;const R=C.parentElement,L=R?getElementCSSSelector(R,{useIdForAncestors:E,useIdForTargetElement:!1}):"";return L?`${L} > ${P}`:P},getNodeSelector=(_,w=!1)=>{if(_.nodeType!==Node.ELEMENT_NODE)return"";const E=_,C=E.getAttribute("id");if(w&&C&&1===E.ownerDocument.querySelectorAll(`#${CSS.escape(C)}`).length)return`#${CSS.escape(C)}`;let P=getFullClassSelector(E);const R=getNthChild(E);return R>0&&(P+=`:nth-child(${R})`),P},getNthChild=_=>{if(!_.parentElement)return 0;const w=getFullClassSelector(_),E=Array.from(_.parentElement.children).filter((_=>getFullClassSelector(_)===w));return E.length>1?E.indexOf(_)+1:0},getFullClassSelector=_=>_.localName+(_.classList.length>0?Array.from(_.classList).map((_=>`.${CSS.escape(_)}`)).join(""):""),vl="browser.mouse_event.button",Sl="browser.page.x",wl="browser.page.y",El="browser.tag_name",Tl="browser.element.attributes",Al="browser.css_selector",Ol=["click"];var Cl=class extends InstrumentationBase{constructor(_={}){super("@opentelemetry/browser-instrumentation/user-action",Ku,_)}init(){return[]}_getMouseButtonFromMouseEvent(_){switch(_.button){case 0:default:return"left";case 1:return"middle";case 2:return"right"}}onClick(_){const w=_.target;if(!(w instanceof HTMLElement))return;if(w.hasAttribute("disabled"))return;const E=getElementCSSSelector(w,{useIdForTargetElement:!0,useIdForAncestors:!0}),C={};for(const _ of w.attributes)_.name.startsWith("data-otel-")&&(C[_.name.slice(10)]=_.value);this.logger.emit({severityNumber:z.INFO,eventName:"browser.user_action.click",attributes:{[Sl]:_.pageX,[wl]:_.pageY,[El]:w.tagName,[Tl]:C,[vl]:this._getMouseButtonFromMouseEvent(_),[Al]:E}})}enable(){const _=this._config.autoCapturedActions??Ol;this._onClickHandler||(this._onClickHandler=this.onClick.bind(this)),_.includes("click")&&document.addEventListener("click",this._onClickHandler,!0)}disable(){this._onClickHandler&&document.removeEventListener("click",this._onClickHandler,!0)}};const Pl="browser.web_vital.name",Rl="browser.web_vital.value",xl="browser.web_vital.rating",Ll="browser.web_vital.delta",Il="browser.web_vital.id",Nl="browser.web_vital.navigation_type";class t{constructor(){this.o=0,this.i=[]}u(_){if(_.hadRecentInput)return;const w=this.i[0],E=this.i.at(-1);this.o&&w&&E&&_.startTime-E.startTime<1e3&&_.startTime-w.startTime<5e3?(this.o+=_.value,this.i.push(_)):(this.o=_.value,this.i=[_]),this.t?.(_)}}const e=()=>{const _=performance.getEntriesByType("navigation")[0];if(_&&_.responseStart>0&&_.responseStart<performance.now())return _},n=_=>{if("loading"===document.readyState)return"loading";const w=e();if(w){if(_<w.domInteractive)return"loading";if(0===w.domContentLoadedEventStart||_<w.domContentLoadedEventStart)return"dom-interactive";if(0===w.domComplete||_<w.domComplete)return"dom-content-loaded"}return"complete"},o=_=>{const w=_.nodeName;return 1===_.nodeType?w.toLowerCase():w.toUpperCase().replace(/^#/,"")},i=_=>{let w="";try{for(;9!==_?.nodeType;){const E=_,C=E.id?"#"+E.id:[o(E),...Array.from(E.classList).sort()].join(".");if(w.length+C.length>99)return w||C;if(w=w?C+">"+w:C,E.id)break;_=E.parentNode}}catch{}return w},Dl=new WeakMap;function s(_,w){let E=Dl.get(w);return E||(E=new WeakMap,Dl.set(w,E)),E.get(_)||E.set(_,new w),E.get(_)}let kl=-1;const c=()=>kl,u=_=>{addEventListener("pageshow",(w=>{w.persisted&&(kl=w.timeStamp,_(w))}),!0)},f=(_,w,E,C)=>{let P,R;return L=>{w.value>=0&&(L||C)&&(R=w.value-(P??0),(R||void 0===P)&&(P=w.value,w.delta=R,w.rating=((_,w)=>_>w[1]?"poor":_>w[0]?"needs-improvement":"good")(w.value,E),_(w)))}},l=_=>{requestAnimationFrame((()=>requestAnimationFrame(_)))},d=()=>e()?.activationStart??0,h=(_,w=-1)=>{const E=e();let C="navigate";return c()>=0?C="back-forward-cache":E&&(document.prerendering||d()>0?C="prerender":document.wasDiscarded?C="restore":E.type&&(C=E.type.replace(/_/g,"-"))),{name:_,value:w,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:C}},m=(_,w,E={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(_)){const C=new PerformanceObserver((_=>{queueMicrotask((()=>{w(_.getEntries())}))}));return C.observe({type:_,buffered:!0,...E}),C}}catch{}},g=_=>{let w=!1;return()=>{w||(_(),w=!0)}};let Fl=-1;const jl=new Set,v=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,b=_=>{if("hidden"===document.visibilityState){if("visibilitychange"===_.type)for(const _ of jl)_();isFinite(Fl)||(Fl="visibilitychange"===_.type?_.timeStamp:0,removeEventListener("prerenderingchange",b,!0))}},M=()=>{if(Fl<0){const _=d(),w=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find((w=>"hidden"===w.name&&w.startTime>=_))?.startTime;Fl=w??v(),addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0),u((()=>{setTimeout((()=>{Fl=v()}))}))}return{get firstHiddenTime(){return Fl},onHidden(_){jl.add(_)}}},T=_=>{document.prerendering?addEventListener("prerenderingchange",_,!0):_()},Ml=[1800,3e3],D=(_,w={})=>{T((()=>{const E=M();let C,P=h("FCP");const R=m("paint",(_=>{for(const w of _)"first-contentful-paint"===w.name&&(R.disconnect(),w.startTime<E.firstHiddenTime&&(P.value=Math.max(w.startTime-d(),0),P.entries.push(w),C(!0)))}));R&&(C=f(_,P,Ml,w.reportAllChanges),u((E=>{P=h("FCP"),C=f(_,P,Ml,w.reportAllChanges),l((()=>{P.value=performance.now()-E.timeStamp,C(!0)}))})))}))},$l=[.1,.25],S=_=>_.find((_=>1===_.node?.nodeType))||_[0];let Bl=0,Ul=1/0,Vl=0;const B=_=>{for(const w of _)w.interactionId&&(Ul=Math.min(Ul,w.interactionId),Vl=Math.max(Vl,w.interactionId),Bl=Vl?(Vl-Ul)/7+1:0)};let Hl;const O=()=>Hl?Bl:performance.interactionCount??0;let zl=0;class A{constructor(){this.l=[],this.h=new Map}v(){zl=O(),this.l.length=0,this.h.clear()}M(){const _=Math.min(this.l.length-1,Math.floor((O()-zl)/50));return this.l[_]}u(_){if(this.m?.(_),!_.interactionId&&"first-input"!==_.entryType)return;const w=this.l.at(-1);let E=this.h.get(_.interactionId);if(E||this.l.length<10||_.duration>w.T){if(E?_.duration>E.T?(E.entries=[_],E.T=_.duration):_.duration===E.T&&_.startTime===E.entries[0].startTime&&E.entries.push(_):(E={id:_.interactionId,entries:[_],T:_.duration},this.h.set(E.id,E),this.l.push(E)),this.l.sort(((_,w)=>w.T-_.T)),this.l.length>10){const _=this.l.splice(10);for(const w of _)this.h.delete(w.id)}this.p?.(E)}}}const W=_=>{const w=globalThis.requestIdleCallback||setTimeout,E=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)_();else{const C=g(_);let P=-1;const r=()=>{E(P),C()};addEventListener("visibilitychange",r,{once:!0,capture:!0}),P=w((()=>{removeEventListener("visibilitychange",r,{capture:!0}),C()}))}},ql=[200,500],x=(_,w={})=>{const E=s(w=Object.assign({},w),A);let C=[],P=[],R=0;const L=new WeakMap,I=new WeakMap;let k=!1;const p=()=>{k||(W(y),k=!0)},y=()=>{const _=new Set(E.l.map((_=>L.get(_.entries[0])))),w=P.length-10;P=P.filter(((E,C)=>C>=w||_.has(E)));const I=new Set;for(const _ of P){const w=v(_.startTime,_.processingEnd);for(const _ of w)I.add(_)}C=C.filter((_=>_.startTime>R||I.has(_))),k=!1};E.m=_=>{const E=_.startTime+_.duration;let C;R=Math.max(R,_.processingEnd);for(let R=P.length-1;R>=0;R--){const L=P[R];if(Math.abs(E-L.renderTime)<=8){C=L,C.startTime=Math.min(_.startTime,C.startTime),C.processingStart=Math.min(_.processingStart,C.processingStart),C.processingEnd=Math.max(_.processingEnd,C.processingEnd),!1!==w.includeProcessedEventEntries&&C.entries.push(_);break}}C||(C={startTime:_.startTime,processingStart:_.processingStart,processingEnd:_.processingEnd,renderTime:E,entries:!1!==w.includeProcessedEventEntries?[_]:[]},P.push(C)),(_.interactionId||"first-input"===_.entryType)&&L.set(_,C),p()},E.p=_=>{if(!I.get(_)){const E=_.entries.find((_=>_.target))?.target;if(E){const C=w.generateTarget?.(E)??i(E);I.set(_,C)}else{const w=_.entries.find((_=>_.targetSelector))?.targetSelector;w&&I.set(_,w)}}};const v=(_,w)=>{const E=[];for(const P of C)if(!(P.startTime+P.duration<_)){if(P.startTime>w)break;E.push(P)}return E};m("long-animation-frame",(_=>{C=C.concat(_),p()})),((_,w={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const E=M();T((()=>{"interactionCount"in performance||Hl||(Hl=m("event",B,{durationThreshold:0}));let C,P=h("INP");const R=s(w,A),a=_=>{W((()=>{for(const w of _)R.u(w);const w=R.M();w&&w.T!==P.value&&(P.value=w.T,P.entries=w.entries,C())}))},L=m("event",a,{durationThreshold:w.durationThreshold??40});C=f(_,P,ql,w.reportAllChanges),L&&(L.observe({type:"first-input",buffered:!0}),E.onHidden((()=>{a(L.takeRecords()),C(!0)})),u((()=>{R.v(),P=h("INP"),C=f(_,P,ql,w.reportAllChanges)})))}))})((w=>{_((_=>{const w=_.entries[0],C=L.get(w),P=w.processingStart,R=Math.max(w.startTime+w.duration,P),k=Math.min(C.processingEnd,R),F=C.entries.sort(((_,w)=>_.processingStart-w.processingStart)),j=v(w.startTime,k),$=E.h.get(w.interactionId),V={interactionTarget:I.get($),interactionType:w.name.startsWith("key")?"keyboard":"pointer",interactionTime:w.startTime,nextPaintTime:R,processedEventEntries:F,longAnimationFrameEntries:j,inputDelay:P-w.startTime,processingDuration:k-P,presentationDelay:R-k,loadState:n(w.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(_=>{if(!_.longAnimationFrameEntries?.length)return;const w=_.interactionTime,E=_.inputDelay,C=_.processingDuration;let P,R,L=0,I=0,k=0,F=0;for(const k of _.longAnimationFrameEntries){I=I+k.startTime+k.duration-k.styleAndLayoutStart;for(const _ of k.scripts){const k=_.startTime+_.duration;if(k<w)continue;const j=k-Math.max(w,_.startTime),$=_.duration?j/_.duration*_.forcedStyleAndLayoutDuration:0;L+=j-$,I+=$,j>F&&(R=_.startTime<w+E?"input-delay":_.startTime>=w+E+C?"presentation-delay":"processing-duration",P=_,F=j)}}const j=_.longAnimationFrameEntries.at(-1),$=j?j.startTime+j.duration:0;$>=w+E+C&&(k=_.nextPaintTime-$),P&&R&&(_.longestScript={entry:P,subpart:R,intersectingDuration:F}),_.totalScriptDuration=L,_.totalStyleAndLayoutDuration=I,_.totalPaintDuration=k,_.totalUnattributedDuration=_.nextPaintTime-w-L-I-k})(V),Object.assign(_,{attribution:V})})(w))}),w)};class N{u(_){this.m?.(_)}}const Wl=[2500,4e3],Gl=[800,1800],U=_=>{document.prerendering?T((()=>U(_))):"complete"!==document.readyState?addEventListener("load",(()=>U(_)),!0):setTimeout(_)};var Kl=class extends InstrumentationBase{constructor(_={}){super("@opentelemetry/browser-instrumentation/web-vitals",Ku,_),this._applyCustomLogRecordData=_.applyCustomLogRecordData,this._includeRawAttribution=_.includeRawAttribution??!1}init(){return[]}enable(){"undefined"!=typeof PerformanceObserver?(this._isEnabled=!0,this._listenersRegistered?this._diag.debug("Listeners already registered, resuming emission"):(this._listenersRegistered=!0,this._diag.debug("Registering listeners"),((_,w={})=>{const E=s(w=Object.assign({},w),t),C=new WeakMap;E.t=_=>{if(_?.sources?.length){const E=S(_.sources),P=E?.node;if(P){const _=w.generateTarget?.(P)??i(P);C.set(E,_)}}},((_,w={})=>{const E=M();D(g((()=>{let C,P=h("CLS",0);const R=s(w,t),c=_=>{for(const w of _)R.u(w);R.o>P.value&&(P.value=R.o,P.entries=R.i,C())},L=m("layout-shift",c);L&&(C=f(_,P,$l,w.reportAllChanges),E.onHidden((()=>{c(L.takeRecords()),C(!0)})),u((()=>{R.o=0,P=h("CLS",0),C=f(_,P,$l,w.reportAllChanges),l(C)})),setTimeout(C))})))})((w=>{_((_=>{let w={};if(_.entries.length){const E=_.entries.reduce(((_,w)=>_.value>w.value?_:w));if(E?.sources?.length){const _=S(E.sources);_&&(w={largestShiftTarget:C.get(_),largestShiftTime:E.startTime,largestShiftValue:E.value,largestShiftSource:_,largestShiftEntry:E,loadState:n(E.startTime)})}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))),x((_=>this._emitWebVital(_))),((_,w={})=>{const E=s(w=Object.assign({},w),N),C=new WeakMap;E.m=_=>{const E=_.element;if(E){const P=w.generateTarget?.(E)??i(E);C.set(_,P)}else _.id&&C.set(_,`#${_.id}`)},((_,w={})=>{T((()=>{const E=M();let C,P=h("LCP");const R=s(w,N),a=_=>{w.reportAllChanges||(_=_.slice(-1));for(const w of _)R.u(w),w.startTime<E.firstHiddenTime&&(P.value=Math.max(w.startTime-d(),0),P.entries=[w],C())},L=m("largest-contentful-paint",a);if(L){C=f(_,P,Wl,w.reportAllChanges);const E=g((()=>{a(L.takeRecords()),L.disconnect(),C(!0)})),r=_=>{_.isTrusted&&(W(E),removeEventListener(_.type,r,{capture:!0}))};for(const _ of["keydown","click","visibilitychange"])addEventListener(_,r,{capture:!0});u((E=>{P=h("LCP"),C=f(_,P,Wl,w.reportAllChanges),l((()=>{P.value=performance.now()-E.timeStamp,C(!0)}))}))}}))})((w=>{_((_=>{let w={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:_.value};if(_.entries.length){const E=_.entries.at(-1),P=E.url&&performance.getEntriesByType("resource").find((_=>_.name===E.url));w.target=C.get(E),w.lcpEntry=E,E.url&&(w.url=E.url),P&&(w.lcpResourceEntry=P);const R=e();if(R){const E=R.activationStart||0,C=Math.max(0,R.responseStart-E),L=Math.max(C,P?(P.requestStart||P.startTime)-E:0),I=Math.min(_.value,Math.max(L,P?P.responseEnd-E:0));w={...w,timeToFirstByte:C,resourceLoadDelay:L-C,resourceLoadDuration:I-L,elementRenderDelay:_.value-I,navigationEntry:R}}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))),((_,w={})=>{D((w=>{_((_=>{let w={timeToFirstByte:0,firstByteToFCP:_.value,loadState:n(c())};if(_.entries.length){const E=e(),C=_.entries.at(-1);if(E){const P=E.activationStart||0,R=Math.max(0,E.responseStart-P);w={timeToFirstByte:R,firstByteToFCP:_.value-R,loadState:n(_.entries[0].startTime),navigationEntry:E,fcpEntry:C}}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))),((_,w={})=>{((_,w={})=>{let E=h("TTFB"),C=f(_,E,Gl,w.reportAllChanges);U((()=>{const P=e();P&&(E.value=Math.max(P.responseStart-d(),0),E.entries=[P],C(!0),u((()=>{E=h("TTFB",0),C=f(_,E,Gl,w.reportAllChanges),C(!0)})))}))})((w=>{_((_=>{let w={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(_.entries.length){const E=_.entries[0],C=E.activationStart||0,P=Math.max((E.workerStart||E.fetchStart)-C,0),R=Math.max(E.domainLookupStart-C,0),L=Math.max(E.connectStart-C,0),I=Math.max(E.connectEnd-C,0);w={waitingDuration:P,cacheDuration:R-P,dnsDuration:L-R,connectionDuration:I-L,requestDuration:_.value-I,navigationEntry:E}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))))):this._diag.debug("PerformanceObserver not supported, web vitals will not be collected")}disable(){this._isEnabled=!1,this._diag.debug("Instrumentation disabled, pausing emission")}_getTimestampForMetric(_){if("CLS"===_.name){const{attribution:w}=_;return void 0!==w.largestShiftTime?w.largestShiftTime:void 0}if("INP"===_.name){const{attribution:w}=_;return w.interactionTime}return _.value}_emitWebVital(_){if(!this._isEnabled)return;const w={[Pl]:_.name.toLowerCase(),[Rl]:_.value,[Ll]:_.delta,[xl]:_.rating,[Il]:_.id,[Nl]:_.navigationType},E=this._getTimestampForMetric(_),C={eventName:"browser.web_vital",severityNumber:z.INFO,attributes:w,...this._includeRawAttribution?{body:JSON.stringify(_.attribution)}:{},...void 0!==E?{timestamp:E}:{}};this._applyCustomLogRecordData&&safeExecuteInTheMiddle((()=>this._applyCustomLogRecordData?.(C)),(_=>{_&&this._diag.error("applyCustomLogRecordData hook failed",_)})),this.logger.emit(C)}};const Ql=createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function sanitizeAttributes(_){const w={};if("object"!=typeof _||null==_)return w;for(const E in _){if(!Object.prototype.hasOwnProperty.call(_,E))continue;if(!isAttributeKey(E)){Ie.warn(`Invalid attribute key: ${E}`);continue}const C=_[E];isAttributeValue(C)?Array.isArray(C)?w[E]=C.slice():w[E]=C:Ie.warn(`Invalid attribute value set for key: ${E}`)}return w}function isAttributeKey(_){return"string"==typeof _&&""!==_}function isAttributeValue(_){return null==_||(Array.isArray(_)?function isHomogeneousAttributeValueArray(_){let w;for(const E of _){if(null==E)continue;const _=typeof E;if(_!==w){if(!w){if(isValidPrimitiveAttributeValueType(_)){w=_;continue}return!1}return!1}}return!0}(_):isValidPrimitiveAttributeValueType(typeof _))}function isValidPrimitiveAttributeValueType(_){switch(_){case"number":case"boolean":case"string":return!0}return!1}let Xl=function loggingErrorHandler(){return _=>{Ie.error(function stringifyException(_){return"string"==typeof _?_:JSON.stringify(function flattenException(_){const w={};let E=_;for(;null!==E;)Object.getOwnPropertyNames(E).forEach((_=>{if(w[_])return;const C=E[_];C&&(w[_]=String(C))})),E=Object.getPrototypeOf(E);return w}(_))}(_))}}();function globalErrorHandler(_){try{Xl(_)}catch{}}function getNumberFromEnv(_){const w=process.env[_];if(null==w||""===w.trim())return;const E=Number(w);if(!isNaN(E))return E;Ie.warn(`Unknown value ${qe.inspect(w)} for ${_}, expected a number, using defaults`)}const Jl="process.runtime.name",Zl={[Ho]:"opentelemetry",[Jl]:"node",[Uo]:Vo,[zo]:"2.10.0"},Yl=performance,ep=Math.pow(10,6),tp=Math.pow(10,9);function millisToHrTime(_){const w=_/1e3;return[Math.trunc(w),Math.round(_%1e3*ep)]}function isTimeInputHrTime(_){return Array.isArray(_)&&2===_.length&&"number"==typeof _[0]&&"number"==typeof _[1]}function isTimeInput(_){return isTimeInputHrTime(_)||"number"==typeof _||_ instanceof Date}function addHrTimes(_,w){const E=[_[0]+w[0],_[1]+w[1]];return E[1]>=tp&&(E[1]-=tp,E[0]+=1),E}var rp;!function(_){_[_.SUCCESS=0]="SUCCESS",_[_.FAILED=1]="FAILED"}(rp||(rp={}));const np="[object Null]",op="[object Undefined]",ip=Function.prototype.toString,sp=ip.call(Object),ap=Object.getPrototypeOf,cp=Object.prototype,up=cp.hasOwnProperty,lp=Symbol?Symbol.toStringTag:void 0,pp=cp.toString;function isPlainObject(_){if(!function isObjectLike(_){return null!=_&&"object"==typeof _}(_)||"[object Object]"!==function baseGetTag(_){if(null==_)return void 0===_?op:np;return lp&&lp in Object(_)?function getRawTag(_){const w=up.call(_,lp),E=_[lp];let C=!1;try{_[lp]=void 0,C=!0}catch{}const P=pp.call(_);C&&(w?_[lp]=E:delete _[lp]);return P}(_):function objectToString(_){return pp.call(_)}(_)}(_))return!1;const w=ap(_);if(null===w)return!0;const E=up.call(w,"constructor")&&w.constructor;return"function"==typeof E&&E instanceof E&&ip.call(E)===sp}function takeValue(_){return isArray(_)?_.slice():_}function mergeTwoObjects(_,w,E=0,C){let P;if(!(E>20)){if(E++,isPrimitive(_)||isPrimitive(w)||isFunction(w))P=takeValue(w);else if(isArray(_)){if(P=_.slice(),isArray(w))for(let _=0,E=w.length;_<E;_++)P.push(takeValue(w[_]));else if(isObject(w)){const _=Object.keys(w);for(let E=0,C=_.length;E<C;E++){const C=_[E];"__proto__"!==C&&"constructor"!==C&&"prototype"!==C&&(P[C]=takeValue(w[C]))}}}else if(isObject(_))if(isObject(w)){if(!function shouldMerge(_,w){if(!isPlainObject(_)||!isPlainObject(w))return!1;return!0}(_,w))return w;P=Object.assign({},_);const R=Object.keys(w);for(let L=0,I=R.length;L<I;L++){const I=R[L];if("__proto__"===I||"constructor"===I||"prototype"===I)continue;const k=w[I];if(isPrimitive(k))void 0===k?delete P[I]:P[I]=k;else{const R=P[I],L=k;if(wasObjectReferenced(_,I,C)||wasObjectReferenced(w,I,C))delete P[I];else{if(isObject(R)&&isObject(L)){const E=C.get(R)||[],P=C.get(L)||[];E.push({obj:_,key:I}),P.push({obj:w,key:I}),C.set(R,E),C.set(L,P)}P[I]=mergeTwoObjects(P[I],k,E,C)}}}}else P=w;return P}}function wasObjectReferenced(_,w,E){const C=E.get(_[w])||[];for(let E=0,P=C.length;E<P;E++){const P=C[E];if(P.key===w&&P.obj===_)return!0}return!1}function isArray(_){return Array.isArray(_)}function isFunction(_){return"function"==typeof _}function isObject(_){return!isPrimitive(_)&&!isArray(_)&&!isFunction(_)&&"object"==typeof _}function isPrimitive(_){return"string"==typeof _||"number"==typeof _||"boolean"==typeof _||void 0===_||_ instanceof Date||_ instanceof RegExp||null===_}class Deferred{constructor(){this._promise=new Promise(((_,w)=>{this._resolve=_,this._reject=w}))}get promise(){return this._promise}resolve(_){this._resolve(_)}reject(_){this._reject(_)}}class BindOnceFuture{constructor(_,w){this._isCalled=!1,this._deferred=new Deferred,this._callback=_,this._that=w}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(..._){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,..._)).then((_=>this._deferred.resolve(_)),(_=>this._deferred.reject(_)))}catch(_){this._deferred.reject(_)}}return this._deferred.promise}}let dp;function defaultServiceName(){if(void 0===dp)try{const _=globalThis.process.argv0;dp=_?`unknown_service:${_}`:"unknown_service"}catch{dp="unknown_service"}return dp}const isPromiseLike=_=>null!==_&&"object"==typeof _&&"function"==typeof _.then;class ResourceImpl{static FromAttributeList(_,w){const E=new ResourceImpl({},w);return E._rawAttributes=guardedRawAttributes(_),E._asyncAttributesPending=_.filter((([_,w])=>isPromiseLike(w))).length>0,E}constructor(_,w){this._asyncAttributesPending=!1;const E=_.attributes??{};this._rawAttributes=Object.entries(E).map((([_,w])=>(isPromiseLike(w)&&(this._asyncAttributesPending=!0),[_,w]))),this._rawAttributes=guardedRawAttributes(this._rawAttributes),this._schemaUrl=function validateSchemaUrl(_){if("string"==typeof _||void 0===_)return _;return void Ie.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",_)}(w?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let _=0;_<this._rawAttributes.length;_++){const[w,E]=this._rawAttributes[_];this._rawAttributes[_]=[w,isPromiseLike(E)?await E:E]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Ie.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const _={};for(const[w,E]of this._rawAttributes)isPromiseLike(E)?Ie.debug(`Unsettled resource attribute ${w} skipped`):null!=E&&(_[w]??(_[w]=E));return this._asyncAttributesPending||(this._memoizedAttributes=_),_}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(_){if(null==_)return this;const w=function mergeSchemaUrl(_,w){const E=_?.schemaUrl,C=w?.schemaUrl,P=void 0===E||""===E,R=void 0===C||""===C;if(P)return C;if(R)return E;if(E===C)return E;return void Ie.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',E,C)}(this,_),E=w?{schemaUrl:w}:void 0;return ResourceImpl.FromAttributeList([..._.getRawAttributes(),...this.getRawAttributes()],E)}}function defaultResource(){return function resourceFromAttributes(_,w){return ResourceImpl.FromAttributeList(Object.entries(_),w)}({[Bo]:defaultServiceName(),[Uo]:Zl[Uo],[Ho]:Zl[Ho],[zo]:Zl[zo]})}function guardedRawAttributes(_){return _.map((([_,w])=>isPromiseLike(w)?[_,w.catch((w=>{Ie.debug("promise rejection for resource attribute: %s - %s",_,w)}))]:[_,w]))}const fp=Symbol.for("nodejs.util.inspect.custom");function settledResourceAttributes(_){const w={};for(const[E,C]of _.getRawAttributes())"function"!=typeof C?.then&&null!=C&&(w[E]??(w[E]=C));return w}function formatInspect(_,w,E,C,P){if("number"==typeof E&&E<0){const w=`[${_}]`;return C?.stylize?C.stylize(w,"special"):w}if("function"!=typeof P||!C)return w;return`${_} ${P(w,{...C,depth:null==C.depth?C.depth:C.depth-1})}`}class SpanImpl{constructor(_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this._attributesCount=0,this.status={code:xe.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1];const w=Date.now();if(this._spanContext=_.spanContext,this._performanceStartTime=Yl.now(),this._performanceOffset=w-(this._performanceStartTime+Yl.timeOrigin),this._startTimeProvided=null!=_.startTime,this._spanLimits=_.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=_.spanProcessor,this.name=_.name,this.parentSpanContext=_.parentSpanContext,this.kind=_.kind,_.links)for(const w of _.links)this.addLink(w);this.startTime=this._getTime(_.startTime??w),this.resource=_.resource,this.instrumentationScope=_.scope,this._recordEndMetrics=_.recordEndMetrics,null!=_.attributes&&this.setAttributes(_.attributes),this._spanProcessor.onStart(this,_.context)}spanContext(){return this._spanContext}setAttribute(_,w){if(null==w||this._isSpanEnded())return this;if(0===_.length)return Ie.warn(`Invalid attribute key: ${_}`),this;if(!isAttributeValue(w))return Ie.warn(`Invalid attribute value set for key: ${_}`),this;const{attributeCountLimit:E}=this._spanLimits,C=!Object.prototype.hasOwnProperty.call(this.attributes,_);return void 0!==E&&this._attributesCount>=E&&C?(this._droppedAttributesCount++,this):(this.attributes[_]=this._truncateToSize(w),C&&this._attributesCount++,this)}setAttributes(_){for(const w in _)Object.prototype.hasOwnProperty.call(_,w)&&this.setAttribute(w,_[w]);return this}addEvent(_,w,E){if(this._isSpanEnded())return this;const{eventCountLimit:C}=this._spanLimits;if(0===C)return Ie.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==C&&this.events.length>=C&&(0===this._droppedEventsCount&&Ie.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),isTimeInput(w)&&(isTimeInput(E)||(E=w),w=void 0);const P=sanitizeAttributes(w),{attributePerEventCountLimit:R}=this._spanLimits,L={};let I=0,k=0;for(const _ in P){if(!Object.prototype.hasOwnProperty.call(P,_))continue;const w=P[_];void 0!==R&&k>=R?I++:(L[_]=this._truncateToSize(w),k++)}return this.events.push({name:_,attributes:L,time:this._getTime(E),droppedAttributesCount:I}),this}addLink(_){if(this._isSpanEnded())return this;const{linkCountLimit:w}=this._spanLimits;if(0===w)return this._droppedLinksCount++,this;void 0!==w&&this.links.length>=w&&(0===this._droppedLinksCount&&Ie.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);const{attributePerLinkCountLimit:E}=this._spanLimits,C=sanitizeAttributes(_.attributes),P={};let R=0,L=0;for(const _ in C){if(!Object.prototype.hasOwnProperty.call(C,_))continue;const w=C[_];void 0!==E&&L>=E?R++:(P[_]=this._truncateToSize(w),L++)}const I={context:_.context};return L>0&&(I.attributes=P),R>0&&(I.droppedAttributesCount=R),this.links.push(I),this}addLinks(_){for(const w of _)this.addLink(w);return this}setStatus(_){if(this._isSpanEnded())return this;if(_.code===xe.UNSET)return this;if(this.status.code===xe.OK)return this;const w={code:_.code};return _.code===xe.ERROR&&("string"==typeof _.message?w.message=_.message:null!=_.message&&Ie.warn(`Dropping invalid status.message of type '${typeof _.message}', expected 'string'`)),this.status=w,this}updateName(_){return this._isSpanEnded()||(this.name=_),this}end(_){this._isSpanEnded()?Ie.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(_),this._duration=function hrTimeDuration(_,w){let E=w[0]-_[0],C=w[1]-_[1];return C<0&&(E-=1,C+=tp),[E,C]}(this.startTime,this.endTime),this._duration[0]<0&&(Ie.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&&Ie.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Ie.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(_){if("number"==typeof _&&_<=Yl.now())return function hrTime(_){return addHrTimes(millisToHrTime(Yl.timeOrigin),millisToHrTime("number"==typeof _?_:Yl.now()))}(_+this._performanceOffset);if("number"==typeof _)return millisToHrTime(_);if(_ instanceof Date)return millisToHrTime(_.getTime());if(isTimeInputHrTime(_))return _;if(this._startTimeProvided)return millisToHrTime(Date.now());const w=Yl.now()-this._performanceStartTime;return addHrTimes(this.startTime,millisToHrTime(w))}isRecording(){return!1===this._ended}recordException(_,w){const E={};"string"==typeof _?E[Io]=_:_&&(_.code?E[Do]=_.code.toString():_.name&&(E[Do]=_.name),_.message&&(E[Io]=_.message),_.stack&&(E[No]=_.stack)),E[Do]||E[Io]?this.addEvent("exception",E,w):Ie.warn(`Failed to record an exception ${_}`)}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){const _=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Ie.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,_)}return this._ended}_truncateToLimitUtil(_,w){return _.length<=w?_:_.substring(0,w)}_truncateToSize(_){const w=this._attributeValueLengthLimit;return w<=0?(Ie.warn(`Attribute value limit must be positive, got ${w}`),_):"string"==typeof _?this._truncateToLimitUtil(_,w):Array.isArray(_)?_.map((_=>"string"==typeof _?this._truncateToLimitUtil(_,w):_)):_}[fp](_,w,E){return formatInspect("SpanImpl",{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:settledResourceAttributes(this.resource)}},_,w,E)}}var hp;!function(_){_[_.NOT_RECORD=0]="NOT_RECORD",_[_.RECORD=1]="RECORD",_[_.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(hp||(hp={}));const gp="otel.component.name",mp="otel.component.type",yp="otel.span.parent.origin",bp="otel.span.sampling_result";class TracerMetrics{constructor(_){this.startedSpans=_.createCounter("otel.sdk.span.started",{unit:"{span}",description:"The number of created spans."}),this.liveSpans=_.createUpDownCounter("otel.sdk.span.live",{unit:"{span}",description:"The number of currently live spans."})}startSpan(_,w){const E=function samplingDecisionToString(_){switch(_){case hp.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case hp.RECORD:return"RECORD_ONLY";case hp.NOT_RECORD:return"DROP"}}(w);if(this.startedSpans.add(1,{[yp]:parentOrigin(_),[bp]:E}),w===hp.NOT_RECORD)return()=>{};const C={[bp]:E};return this.liveSpans.add(1,C),()=>{this.liveSpans.add(-1,C)}}}function parentOrigin(_){return _?_.isRemote?"remote":"local":"none"}class Tracer{constructor(_,w){this.instrumentationScope=_,this._sampler=w.sampler,this._spanLimits=w.spanLimits,this._resource=w.resource,this._idGenerator=w.idGenerator,this._spanProcessor=w.spanProcessor;const E=w.meterProvider.getMeter("@opentelemetry/sdk-trace","2.10.0");this._tracerMetrics=new TracerMetrics(E)}startSpan(_,w={},E=Le.active()){w.root&&(E=Ue.deleteSpan(E));const C=Ue.getSpan(E);if(function isTracingSuppressed(_){return!0===_.getValue(Ql)}(E)){Ie.debug("Instrumentation suppressed, returning Noop Span");return Ue.wrapSpanContext(we)}const P=C?.spanContext(),R=this._idGenerator.generateSpanId();let L,I,k;P&&Ue.isSpanContextValid(P)?(I=P.traceId,k=P.traceState,L=P):I=this._idGenerator.generateTraceId();const F=w.kind??Re.INTERNAL,j=(w.links??[]).map((_=>({context:_.context,attributes:sanitizeAttributes(_.attributes)}))),$=sanitizeAttributes(w.attributes),V=this._sampler.shouldSample(E,I,_,F,$,j),H=this._tracerMetrics.startSpan(P,V.decision);k=V.traceState??k;const z={traceId:I,spanId:R,traceFlags:V.decision===Pe.RECORD_AND_SAMPLED?_e.SAMPLED:_e.NONE,traceState:k};if(V.decision===Pe.NOT_RECORD){Ie.debug("Recording is off, propagating context in a non-recording span");return Ue.wrapSpanContext(z)}const q=sanitizeAttributes(Object.assign($,V.attributes));return new SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:E,spanContext:z,name:_,kind:F,links:j,parentSpanContext:L,attributes:q,startTime:w.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:H})}startActiveSpan(_,w,E,C){let P,R,L;if(arguments.length<2)return;2===arguments.length?L=w:3===arguments.length?(P=w,L=E):(P=w,R=E,L=C);const I=R??Le.active(),k=this.startSpan(_,P,I),F=Ue.setSpan(I,k);return Le.with(F,L,void 0,k)}[fp](_,w,E){return formatInspect("Tracer",{instrumentationScope:this.instrumentationScope,resource:{attributes:settledResourceAttributes(this._resource)},spanLimits:this._spanLimits},_,w,E)}}class MultiSpanProcessor{constructor(_){this._spanProcessors=_}forceFlush(){const _=[];for(const w of this._spanProcessors)_.push(w.forceFlush());return new Promise((w=>{Promise.all(_).then((()=>{w()})).catch((_=>{globalErrorHandler(_||new Error("MultiSpanProcessor: forceFlush failed")),w()}))}))}onStart(_,w){for(const E of this._spanProcessors)E.onStart(_,w)}onEnding(_){for(const w of this._spanProcessors)w.onEnding&&w.onEnding(_)}onEnd(_){for(const w of this._spanProcessors)w.onEnd(_)}shutdown(){const _=[];for(const w of this._spanProcessors)_.push(w.shutdown());return new Promise(((w,E)=>{Promise.all(_).then((()=>{w()}),E)}))}}class AlwaysOffSampler{shouldSample(){return{decision:hp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class AlwaysOnSampler{shouldSample(){return{decision:hp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class ParentBasedSampler{constructor(_){this._root=_.root,this._root||(globalErrorHandler(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new AlwaysOnSampler),this._remoteParentSampled=_.remoteParentSampled??new AlwaysOnSampler,this._remoteParentNotSampled=_.remoteParentNotSampled??new AlwaysOffSampler,this._localParentSampled=_.localParentSampled??new AlwaysOnSampler,this._localParentNotSampled=_.localParentNotSampled??new AlwaysOffSampler}shouldSample(_,w,E,C,P,R){const L=Ue.getSpanContext(_);return L&&isSpanContextValid(L)?L.isRemote?L.traceFlags&_e.SAMPLED?this._remoteParentSampled.shouldSample(_,w,E,C,P,R):this._remoteParentNotSampled.shouldSample(_,w,E,C,P,R):L.traceFlags&_e.SAMPLED?this._localParentSampled.shouldSample(_,w,E,C,P,R):this._localParentNotSampled.shouldSample(_,w,E,C,P,R):this._root.shouldSample(_,w,E,C,P,R)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}const _p=new Map;class SpanProcessorMetrics{constructor(_,w,E){const C=_p.get(_)??0;if(_p.set(_,C+1),this.standardAttrs={[mp]:_,[gp]:`${_}/${C}`},this.droppedAttrs={...this.standardAttrs,[Lo]:"queue_full"},this.processedSpans=w.createCounter("otel.sdk.processor.span.processed",{unit:"{span}",description:"The number of spans for which the processing has finished, either successful or failed."}),E){const{capacity:_,getQueueSize:C}=E;w.createUpDownCounter("otel.sdk.processor.span.queue.capacity",{unit:"{span}",description:"The maximum number of spans the queue of a given instance of an SDK span processor can hold."}).add(_,this.standardAttrs),this.queueSize=w.createObservableUpDownCounter("otel.sdk.processor.span.queue.size",{unit:"{span}",description:"The number of spans in the queue of a given instance of an SDK span processor."}),this.queueSizeCallback=_=>_.observe(C(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(_){this.processedSpans.add(_,this.droppedAttrs)}finishSpans(_,w){if(!w)return void this.processedSpans.add(_,this.standardAttrs);const E={...this.standardAttrs,[Lo]:w.name};this.processedSpans.add(_,E)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}}class BatchSpanProcessorBase{constructor(_){this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0,this._exporter=_.exporter,this._maxExportBatchSize=_.maxExportBatchSize??512,this._maxQueueSize=_.maxQueueSize??2048,this._scheduledDelayMillis=_.scheduledDelayMillis??5e3,this._exportTimeoutMillis=_.exportTimeoutMillis??3e4,this._shutdownOnce=new BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ie.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize);const w=_.selfObsMeterProvider?_.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):createNoopMeter();this._metrics=new SpanProcessorMetrics("batching_span_processor",w,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(_,w){}onEnd(_){this._shutdownOnce.isCalled||_.spanContext().traceFlags&_e.SAMPLED&&this._addToBuffer(_)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then((()=>this.onShutdown())).then((()=>this._flushAll())).then((()=>(this._metrics.shutdown(),this._exporter.shutdown())))}_addToBuffer(_){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Ie.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++,void this._metrics.dropSpans(1);this._droppedSpansCount>0&&(Ie.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(_),this._maybeStartTimer()}_flushAll(){return new Promise(((_,w)=>{const E=[];for(let _=0,w=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);_<w;_++)E.push(this._flushOneBatch());Promise.all(E).then((()=>{_()})).catch(w)}))}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise(((_,w)=>{const E=setTimeout((()=>{w(new Error("Timeout"))}),this._exportTimeoutMillis);Le.with(function suppressTracing(_){return _.setValue(Ql,!0)}(Le.active()),(()=>{let C;this._finishedSpans.length<=this._maxExportBatchSize?(C=this._finishedSpans,this._finishedSpans=[]):C=this._finishedSpans.splice(0,this._maxExportBatchSize);const doExport=()=>this._exporter.export(C,(P=>{clearTimeout(E),this._metrics.finishSpans(C.length,P.error),P.code===rp.SUCCESS?_():w(P.error??new Error("BatchSpanProcessor: span export failed"))}));let P=null;for(let _=0,w=C.length;_<w;_++){const w=C[_];w.resource.asyncAttributesPending&&w.resource.waitForAsyncAttributes&&(P??(P=[]),P.push(w.resource.waitForAsyncAttributes()))}null===P?doExport():Promise.all(P).then(doExport,(_=>{globalErrorHandler(_),w(_)}))}))}))}_maybeStartTimer(){if(this._isExporting)return;const flush=()=>{this._isExporting=!0,this._flushOneBatch().finally((()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())})).catch((_=>{this._isExporting=!1,globalErrorHandler(_)}))};if(this._finishedSpans.length>=this._maxExportBatchSize)return flush();void 0===this._timer&&(this._timer=setTimeout((()=>flush()),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}let vp=class BatchSpanProcessor extends BatchSpanProcessorBase{onShutdown(){}};class RandomIdGenerator{constructor(){this.generateTraceId=getIdGenerator(16),this.generateSpanId=getIdGenerator(8)}}const Sp=Buffer.allocUnsafe(16);function getIdGenerator(_){return function generateId(){for(let w=0;w<_/4;w++)Sp.writeUInt32BE(Math.random()*2**32>>>0,4*w);for(let w=0;w<_&&!(Sp[w]>0);w++)w===_-1&&(Sp[_-1]=1);return Sp.toString("hex",0,_)}}var wp,Ep;!function(_){_[_.resolved=0]="resolved",_[_.timeout=1]="timeout",_[_.error=2]="error",_[_.unresolved=3]="unresolved"}(wp||(wp={}));class TracerProvider{constructor(_={}){this._tracers=new Map,this._forceFlushTimeoutMillis=_.forceFlushTimeoutMillis??3e4,this._resource=_.resource??defaultResource();const w=_.spanProcessors??[];this._activeSpanProcessor=new MultiSpanProcessor(w),this._tracerOptions={resource:this._resource,sampler:_.sampler??new ParentBasedSampler({root:new AlwaysOnSampler}),spanLimits:{attributeCountLimit:_.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:_.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:_.spanLimits?.eventCountLimit??128,linkCountLimit:_.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:_.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:_.spanLimits?.attributePerLinkCountLimit??128},idGenerator:_.idGenerator||new RandomIdGenerator,spanProcessor:this._activeSpanProcessor,meterProvider:_.meterProvider??{getMeter:()=>createNoopMeter()}}}getTracer(_,w,E){const C=`${_}@${w||""}:${E?.schemaUrl||""}`;return this._tracers.has(C)||this._tracers.set(C,new Tracer({name:_,version:w,schemaUrl:E?.schemaUrl},this._tracerOptions)),this._tracers.get(C)}forceFlush(){const _=this._forceFlushTimeoutMillis,w=this._activeSpanProcessor._spanProcessors.map((w=>new Promise((E=>{let C;const P=setTimeout((()=>{E(new Error(`Span processor did not completed within timeout period of ${_} ms`)),C=wp.timeout}),_);w.forceFlush().then((()=>{clearTimeout(P),C!==wp.timeout&&(C=wp.resolved,E(C))})).catch((_=>{clearTimeout(P),C=wp.error,E(_)}))}))));return new Promise(((_,E)=>{Promise.all(w).then((w=>{const C=w.filter((_=>_!==wp.resolved));C.length>0?E(C):_()})).catch((_=>E([_])))}))}shutdown(){return this._activeSpanProcessor.shutdown()}[fp](_,w,E){const C=this._activeSpanProcessor._spanProcessors,P={resource:{attributes:settledResourceAttributes(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:C.map((_=>_.constructor?.name??"SpanProcessor"))};return formatInspect("TracerProvider",P,_,w,E)}}class TraceIdRatioBasedSampler{constructor(_=0){this._ratio=this._normalize(_),this._upperBound=1===this._ratio?4294967296:Math.floor(4294967295*this._ratio)}shouldSample(_,w){return{decision:isValidTraceId(w)&&this._accumulate(w)<this._upperBound?hp.RECORD_AND_SAMPLED:hp.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(_){return"number"!=typeof _||isNaN(_)?0:_>=1?1:_<=0?0:_}_accumulate(_){let w=0;for(let E=0;E<32;E+=8){let C=0;for(let w=0;w<8;w++){const P=_.charCodeAt(E+w);C=C<<4|(P<58?P-48:P<71?P-55:P-87)}w=(w^C)>>>0}return w}}!function(_){_.AlwaysOff="always_off",_.AlwaysOn="always_on",_.ParentBasedAlwaysOff="parentbased_always_off",_.ParentBasedAlwaysOn="parentbased_always_on",_.ParentBasedTraceIdRatio="parentbased_traceidratio",_.TraceIdRatio="traceidratio"}(Ep||(Ep={}));function buildSamplerFromEnv(){const _=function getStringFromEnv(_){const w=process.env[_];if(null!=w&&""!==w.trim())return w}("OTEL_TRACES_SAMPLER")??Ep.ParentBasedAlwaysOn;switch(_){case Ep.AlwaysOn:return new AlwaysOnSampler;case Ep.AlwaysOff:return new AlwaysOffSampler;case Ep.ParentBasedAlwaysOn:return new ParentBasedSampler({root:new AlwaysOnSampler});case Ep.ParentBasedAlwaysOff:return new ParentBasedSampler({root:new AlwaysOffSampler});case Ep.TraceIdRatio:return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv());case Ep.ParentBasedTraceIdRatio:return new ParentBasedSampler({root:new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv())});default:return Ie.error(`OTEL_TRACES_SAMPLER value "${_}" invalid, defaulting to "${Ep.ParentBasedAlwaysOn}".`),new ParentBasedSampler({root:new AlwaysOnSampler})}}function getSamplerProbabilityFromEnv(){const _=getNumberFromEnv("OTEL_TRACES_SAMPLER_ARG");return null==_?(Ie.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1):_<0||_>1?(Ie.error(`OTEL_TRACES_SAMPLER_ARG=${_} was given, but it is out of range ([0..1]), defaulting to 1.`),1):_}const Tp=1/0;class BasicTracerProvider extends TracerProvider{constructor(_={}){const w=function merge(..._){let w=_.shift();const E=new WeakMap;for(;_.length>0;)w=mergeTwoObjects(w,_.shift(),0,E);return w}({},function loadDefaultConfig(){return{sampler:buildSamplerFromEnv(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:getNumberFromEnv("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:getNumberFromEnv("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}(),function reconfigureLimits(_){const w=Object.assign({},_.spanLimits);return w.attributeCountLimit=_.spanLimits?.attributeCountLimit??_.generalLimits?.attributeCountLimit??getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,w.attributeValueLengthLimit=_.spanLimits?.attributeValueLengthLimit??_.generalLimits?.attributeValueLengthLimit??getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Tp,Object.assign({},_,{spanLimits:w})}(_));delete w.generalLimits,super(w)}}class BatchSpanProcessor extends vp{constructor(_,w){w||(w={});const E=[["maxExportBatchSize","OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],["maxQueueSize","OTEL_BSP_MAX_QUEUE_SIZE"],["scheduledDelayMillis","OTEL_BSP_SCHEDULE_DELAY"],["exportTimeoutMillis","OTEL_BSP_EXPORT_TIMEOUT"]];for(const[_,C]of E)if(void 0===w[_]){const E=getNumberFromEnv(C);void 0!==E&&(w[_]=E)}super({exporter:_,...w})}}class StackContextManager{constructor(){this._enabled=!1,this._currentContext=se}_bindFunction(_=se,w){const E=this,contextWrapper=function(...C){return E.with(_,(()=>w.apply(this,C)))};return Object.defineProperty(contextWrapper,"length",{enumerable:!1,configurable:!0,writable:!1,value:w.length}),contextWrapper}active(){return this._currentContext}bind(_,w){return void 0===_&&(_=this.active()),"function"==typeof w?this._bindFunction(_,w):w}disable(){return this._currentContext=se,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=se),this}with(_,w,E,...C){const P=this._currentContext;this._currentContext=_||se;try{return w.call(E,...C)}finally{this._currentContext=P}}}class WebTracerProvider extends BasicTracerProvider{constructor(_={}){super(_)}register(_={}){Ue.setGlobalTracerProvider(this),function setupPropagator(_){null!==_&&(void 0!==_?$e.setGlobalPropagator(_):$e.setGlobalPropagator(new CompositePropagator({propagators:[new W3CTraceContextPropagator,new W3CBaggagePropagator]})))}(_.propagator),function setupContextManager(_){if(null!==_){if(void 0===_){const _=new StackContextManager;return _.enable(),void Le.setGlobalContextManager(_)}_.enable(),Le.setGlobalContextManager(_)}}(_.contextManager)}}var Ap;!function(_){_.CONNECT_END="connectEnd",_.CONNECT_START="connectStart",_.DECODED_BODY_SIZE="decodedBodySize",_.DOM_COMPLETE="domComplete",_.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",_.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",_.DOM_INTERACTIVE="domInteractive",_.DOMAIN_LOOKUP_END="domainLookupEnd",_.DOMAIN_LOOKUP_START="domainLookupStart",_.ENCODED_BODY_SIZE="encodedBodySize",_.FETCH_START="fetchStart",_.LOAD_EVENT_END="loadEventEnd",_.LOAD_EVENT_START="loadEventStart",_.NAVIGATION_START="navigationStart",_.REDIRECT_END="redirectEnd",_.REDIRECT_START="redirectStart",_.REQUEST_START="requestStart",_.RESPONSE_END="responseEnd",_.RESPONSE_START="responseStart",_.SECURE_CONNECTION_START="secureConnectionStart",_.START_TIME="startTime",_.UNLOAD_EVENT_END="unloadEventEnd",_.UNLOAD_EVENT_START="unloadEventStart"}(Ap||(Ap={}));let Op;function addSpanNetworkEvent$1(_,w,E,C=!0){if(function hasKey$1(_,w){return w in _}(E,w)&&"number"==typeof E[w]&&(!C||0!==E[w]))return _.addEvent(w,E[w])}function addSpanNetworkEvents$1(_,w,E=!1,C,P){if(void 0===C&&(C=0!==w[Ap.START_TIME]),E||(addSpanNetworkEvent$1(_,Ap.FETCH_START,w,C),addSpanNetworkEvent$1(_,Ap.DOMAIN_LOOKUP_START,w,C),addSpanNetworkEvent$1(_,Ap.DOMAIN_LOOKUP_END,w,C),addSpanNetworkEvent$1(_,Ap.CONNECT_START,w,C),addSpanNetworkEvent$1(_,Ap.SECURE_CONNECTION_START,w,C),addSpanNetworkEvent$1(_,Ap.CONNECT_END,w,C),addSpanNetworkEvent$1(_,Ap.REQUEST_START,w,C),addSpanNetworkEvent$1(_,Ap.RESPONSE_START,w,C),addSpanNetworkEvent$1(_,Ap.RESPONSE_END,w,C)),!P){const E=w[Ap.ENCODED_BODY_SIZE];void 0!==E&&_.setAttribute("http.response_content_length",E);const C=w[Ap.DECODED_BODY_SIZE];void 0!==C&&E!==C&&_.setAttribute("http.response_content_length_uncompressed",C)}}function getOrigin(){return"undefined"!=typeof location?location.origin:void 0}function getResource(_,w,E,C,P=new WeakSet,R){const L=parseUrl(_),I=function filterResourcesForSpan(_,w,E,C,P,R){const L=hrTimeToNanoseconds(w),I=hrTimeToNanoseconds(E);let k=C.filter((w=>{const E=hrTimeToNanoseconds(timeInputToHrTime(w[Ap.FETCH_START])),C=hrTimeToNanoseconds(timeInputToHrTime(w[Ap.RESPONSE_END]));return w.initiatorType.toLowerCase()===(R||"xmlhttprequest")&&w.name===_&&E>=L&&C<=I}));k.length>0&&(k=k.filter((_=>!P.has(_))));return k}(_=L.toString(),w,E,C,P,R);if(0===I.length)return{mainRequest:void 0};if(1===I.length)return{mainRequest:I[0]};const k=function sortResources(_){return _.slice().sort(((_,w)=>{const E=_[Ap.FETCH_START],C=w[Ap.FETCH_START];return E>C?1:E<C?-1:0}))}(I);if(L.origin!==getOrigin()&&k.length>1){let _=k[0],w=function findMainRequest(_,w,E){const C=hrTimeToNanoseconds(E),P=hrTimeToNanoseconds(timeInputToHrTime(w));let R,L=_[1];const I=_.length;for(let w=1;w<I;w++){const E=_[w],I=hrTimeToNanoseconds(timeInputToHrTime(E[Ap.FETCH_START])),k=C-hrTimeToNanoseconds(timeInputToHrTime(E[Ap.RESPONSE_END]));I>=P&&(!R||k<R)&&(R=k,L=E)}return L}(k,_[Ap.RESPONSE_END],E);const C=_[Ap.RESPONSE_END];return w[Ap.FETCH_START]<C&&(w=_,_=void 0),{corsPreFlightRequest:_,mainRequest:w}}return{mainRequest:I[0]}}function parseUrl(_){if("function"==typeof URL)return new URL(_,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const w=function getUrlNormalizingAnchor(){return Op||(Op=document.createElement("a")),Op}();return w.href=_,w}function shouldPropagateTraceHeaders(_,w){let E=w||[];("string"==typeof E||E instanceof RegExp)&&(E=[E]);return parseUrl(_).origin===getOrigin()||E.some((w=>urlMatches(_,w)))}var Cp;!function(_){_.METHOD_OPEN="open",_.METHOD_SEND="send",_.EVENT_ABORT="abort",_.EVENT_ERROR="error",_.EVENT_LOAD="loaded",_.EVENT_TIMEOUT="timeout"}(Cp||(Cp={}));const Pp=Ie.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function getXHRBodyLength$1(_){return function isDocument$1(_){return"undefined"!=typeof Document&&_ instanceof Document}(_)?(new XMLSerializer).serializeToString(document).length:"string"==typeof _?getByteLength$1(_):_ instanceof Blob?_.size:_ instanceof FormData?function getFormDataSize$1(_){let w=0;for(const[E,C]of _.entries())w+=E.length,C instanceof Blob?w+=C.size:w+=C.length;return w}(_):_ instanceof URLSearchParams?getByteLength$1(_.toString()):void 0!==_.byteLength?_.byteLength:void Pp.warn("unknown body type")}const Rp=new TextEncoder;function getByteLength$1(_){return Rp.encode(_).byteLength}function normalizeHttpRequestMethod$1(_){const w=function getKnownMethods$1(){if(void 0===Lp){const _=getStringListFromEnv("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");_&&_.length>0?(Lp={},_.forEach((_=>{Lp[_]=!0}))):Lp=xp}return Lp}(),E=_.toUpperCase();return E in w?E:"_OTHER"}const xp={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let Lp;const Ip={"https:":"443","http:":"80"};const Np="0.220.0";var Dp;(Dp||(Dp={})).HTTP_STATUS_TEXT="http.status_text";class XMLHttpRequestInstrumentation extends InstrumentationBase{constructor(_={}){super("@opentelemetry/instrumentation-xml-http-request",Np,_),this.component="xml-http-request",this.version=Np,this.moduleName=this.component,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet,this._semconvStability=semconvStabilityFromStr("http",_?.semconvStabilityOptIn)}init(){}_addHeaders(_,w){if(!shouldPropagateTraceHeaders(parseUrl(w).href,this.getConfig().propagateTraceHeaderCorsUrls)){const _={};return $e.inject(Le.active(),_),void(Object.keys(_).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const E={};$e.inject(Le.active(),E),Object.keys(E).forEach((w=>{_.setRequestHeader(w,String(E[w]))}))}_addChildSpan(_,w){Le.with(Ue.setSpan(Le.active(),_),(()=>{const _=this.tracer.startSpan("CORS Preflight",{startTime:w[Ap.FETCH_START]}),E=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(_,w,this.getConfig().ignoreNetworkEvents,void 0,E),_.end(w[Ap.RESPONSE_END])}))}_addFinalSpanAttributes(_,w,E){if(this._semconvStability&Wu.OLD){if(void 0!==w.status&&_.setAttribute("http.status_code",w.status),void 0!==w.statusText&&_.setAttribute(Dp.HTTP_STATUS_TEXT,w.statusText),"string"==typeof E){const w=parseUrl(E);_.setAttribute("http.host",w.host),_.setAttribute("http.scheme",w.protocol.replace(":",""))}_.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&Wu.STABLE&&w.status&&_.setAttribute(jo,w.status)}_applyAttributesAfterXHR(_,w){const E=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof E&&safeExecuteInTheMiddle((()=>E(_,w)),(_=>{_&&this._diag.error("applyCustomAttributesOnSpan",_)}))}_addResourceObserver(_,w){const E=this._xhrMem.get(_);E&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(E.createdResources={observer:new PerformanceObserver((_=>{const C=_.getEntries(),P=parseUrl(w);C.forEach((_=>{"xmlhttprequest"===_.initiatorType&&_.name===P.href&&E.createdResources&&E.createdResources.entries.push(_)}))})),entries:[]},E.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Ko.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(_,w,E,C,P){if(!(E&&C&&P&&_.createdResources))return;let R=_.createdResources.entries;R&&R.length||(R=Ko.getEntriesByType("resource"));const L=getResource(parseUrl(E).href,C,P,R,this._usedResources);if(L.mainRequest){const _=L.mainRequest;this._markResourceAsUsed(_);const E=L.corsPreFlightRequest;E&&(this._addChildSpan(w,E),this._markResourceAsUsed(E));const C=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(w,_,this.getConfig().ignoreNetworkEvents,void 0,C)}}_cleanPreviousSpanInformation(_){const w=this._xhrMem.get(_);if(w){const E=w.callbackToRemoveEvents;E&&E(),this._xhrMem.delete(_)}}_createSpan(_,w,E){const C=parseUrl(w);if(isUrlIgnored(C.href,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let P="";const R={};if(this._semconvStability&Wu.OLD&&(P=E.toUpperCase(),R["http.method"]=E,R["http.url"]=C.toString()),this._semconvStability&Wu.STABLE){const _=E,w=normalizeHttpRequestMethod$1(E);P||(P=w),R[ko]=w,w!==_&&(R[Fo]=_),R[qo]=C.toString(),R[Mo]=C.hostname;const L=function serverPortFromUrl$1(_){const w=Number(_.port||Ip[_.protocol]);return w&&!isNaN(w)?w:void 0}(C);L&&(R[$o]=L)}const L=this.tracer.startSpan(P,{kind:Re.CLIENT,attributes:R});return L.addEvent(Cp.METHOD_OPEN),this._cleanPreviousSpanInformation(_),this._xhrMem.set(_,{span:L,spanUrl:w}),L}_markResourceAsUsed(_){this._usedResources.add(_)}_patchOpen(){return _=>{const w=this;return function patchOpen(...E){if(!w._isEnabled)return _.apply(this,E);const C=E[0],P=E[1];return w._createSpan(this,P,C),_.apply(this,E)}}}_patchSend(){const _=this;function endSpan(w,E,C,P){const R=_._xhrMem.get(E);if(!R)return;if(R.status=E.status,R.statusText=E.statusText,_._xhrMem.delete(E),R.span){const w=R.span;_._applyAttributesAfterXHR(w,E),_._semconvStability&Wu.STABLE&&(C?P&&(w.setStatus({code:xe.ERROR,message:P}),w.setAttribute(Lo,P)):R.status&&R.status>=400&&(w.setStatus({code:xe.ERROR}),w.setAttribute(Lo,String(R.status))))}const L=hrTime$1(),I=Date.now();setTimeout((()=>{!function endSpanTimeout(w,E,C,P){const R=E.callbackToRemoveEvents;"function"==typeof R&&R();const{span:L,spanUrl:I,sendStartTime:k}=E;L&&(_._findResourceAndAddNetworkEvents(E,L,I,k,C),L.addEvent(w,P),_._addFinalSpanAttributes(L,E,I),L.end(P),_._tasksCount--),_._clearResources()}(w,R,L,I)}),300)}function onError(){endSpan(Cp.EVENT_ERROR,this,!0,"error")}function onAbort(){endSpan(Cp.EVENT_ABORT,this,!1)}function onTimeout(){endSpan(Cp.EVENT_TIMEOUT,this,!0,"timeout")}function onLoad(){this.status<299?endSpan(Cp.EVENT_LOAD,this,!1):endSpan(Cp.EVENT_ERROR,this,!1)}return w=>function patchSend(...E){if(!_._isEnabled)return w.apply(this,E);const C=_._xhrMem.get(this);if(!C)return w.apply(this,E);const P=C.span,R=C.spanUrl;if(P&&R){if(_.getConfig().measureRequestSize&&E?.[0]){const w=getXHRBodyLength$1(E[0]);void 0!==w&&(_._semconvStability&Wu.OLD&&P.setAttribute("http.request_content_length_uncompressed",w),_._semconvStability&Wu.STABLE&&P.setAttribute("http.request.body.size",w))}Le.with(Ue.setSpan(Le.active(),P),(()=>{_._tasksCount++,C.sendStartTime=hrTime$1(),P.addEvent(Cp.METHOD_SEND),this.addEventListener("abort",onAbort),this.addEventListener("error",onError),this.addEventListener("load",onLoad),this.addEventListener("timeout",onTimeout),C.callbackToRemoveEvents=()=>{!function unregister(w){w.removeEventListener("abort",onAbort),w.removeEventListener("error",onError),w.removeEventListener("load",onLoad),w.removeEventListener("timeout",onTimeout);const E=_._xhrMem.get(w);E&&(E.callbackToRemoveEvents=void 0)}(this),C.createdResources&&C.createdResources.observer.disconnect()},_._addHeaders(this,R),_._addResourceObserver(this,R)}))}return w.apply(this,E)}}enable(){if(!this._isEnabled){if(this._isXhrPatched)return this._diag.debug("reactivating existing patch on",this.moduleName,this.version),void(this._isEnabled=!0);try{this._diag.debug("applying patch to",this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(_){this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.warn("Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.",_)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}}var kp;!function(_){_.COMPONENT="component",_.HTTP_STATUS_TEXT="http.status_text"}(kp||(kp={}));const Fp=Ie.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function getFetchBodyLength(..._){if(_[0]instanceof URL||"string"==typeof _[0]){const w=_[1];if(!w?.body)return Promise.resolve();if(w.body instanceof ReadableStream){const{body:_,length:E}=function _getBodyNonDestructively(_){if(!_.pipeThrough)return Fp.warn("Platform has ReadableStream but not pipeThrough!"),{body:_,length:Promise.resolve(void 0)};let w,E=0;const C=new Promise((_=>{w=_})),P=new TransformStream({start(){},async transform(_,w){const C=await _;E+=C.byteLength,w.enqueue(_)},flush(){w(E)}});return{body:_.pipeThrough(P),length:C}}(w.body);return w.body=_,E}return Promise.resolve(function getXHRBodyLength(_){if(function isDocument(_){return"undefined"!=typeof Document&&_ instanceof Document}(_))return(new XMLSerializer).serializeToString(document).length;if("string"==typeof _)return getByteLength(_);if(_ instanceof Blob)return _.size;if(_ instanceof FormData)return function getFormDataSize(_){let w=0;for(const[E,C]of _.entries())w+=E.length,C instanceof Blob?w+=C.size:w+=C.length;return w}(_);if(_ instanceof URLSearchParams)return getByteLength(_.toString());if(void 0!==_.byteLength)return _.byteLength;return void Fp.warn("unknown body type")}(w.body))}{const w=_[0];return w?.body?w.clone().text().then((_=>getByteLength(_))):Promise.resolve()}}const jp=new TextEncoder;function getByteLength(_){return jp.encode(_).byteLength}const Mp={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let $p;function getKnownMethods(){if(void 0===$p){const _=getStringListFromEnv("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");_&&_.length>0?($p={},_.forEach((_=>{$p[_]=!0}))):$p=Mp}return $p}const Bp={"https:":"443","http:":"80"};const Up="0.220.0",Vp="undefined"!=typeof PerformanceObserver;class FetchInstrumentation extends InstrumentationBase{constructor(_={}){super("@opentelemetry/instrumentation-fetch",Up,_),this.component="fetch",this.version=Up,this.moduleName=this.component,this._usedResources=new WeakSet,this._tasksCount=0,this._semconvStability=semconvStabilityFromStr("http",_?.semconvStabilityOptIn)}init(){}_addChildSpan(_,w){const E=this.tracer.startSpan("CORS Preflight",{startTime:w[Ap.FETCH_START]},Ue.setSpan(Le.active(),_)),C=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(E,w,this.getConfig().ignoreNetworkEvents,void 0,C),E.end(w[Ap.RESPONSE_END])}_addFinalSpanAttributes(_,w){const E=parseUrl(w.url);if(this._semconvStability&Wu.OLD&&(_.setAttribute("http.status_code",w.status),null!=w.statusText&&_.setAttribute(kp.HTTP_STATUS_TEXT,w.statusText),_.setAttribute("http.host",E.host),_.setAttribute("http.scheme",E.protocol.replace(":","")),"undefined"!=typeof navigator&&_.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&Wu.STABLE){_.setAttribute(jo,w.status),_.setAttribute(Mo,E.hostname);const C=function serverPortFromUrl(_){const w=Number(_.port||Bp[_.protocol]);return w&&!isNaN(w)?w:void 0}(E);C&&_.setAttribute($o,C)}}_addHeaders(_,w){if(!shouldPropagateTraceHeaders(w,this.getConfig().propagateTraceHeaderCorsUrls)){const _={};return $e.inject(Le.active(),_),void(Object.keys(_).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(_ instanceof Request)$e.inject(Le.active(),_.headers,{set:(_,w,E)=>_.set(w,"string"==typeof E?E:String(E))});else{const w=new Headers(_.headers);$e.inject(Le.active(),w,{set:(_,w,E)=>_.set(w,"string"==typeof E?E:String(E))}),_.headers=w}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(_,w={}){if(isUrlIgnored(_,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let E="";const C={};if(this._semconvStability&Wu.OLD){const P=(w.method||"GET").toUpperCase();E=`HTTP ${P}`,C[kp.COMPONENT]=this.moduleName,C["http.method"]=P,C["http.url"]=_}if(this._semconvStability&Wu.STABLE){const P=w.method,R=function normalizeHttpRequestMethod(_){const w=getKnownMethods(),E=_.toUpperCase();return E in w?E:"_OTHER"}(w.method||"GET");E||(E=R),C[ko]=R,R!==P&&(C[Fo]=P),C[qo]=_}return this.tracer.startSpan(E,{kind:Re.CLIENT,attributes:C})}_findResourceAndAddNetworkEvents(_,w,E){let C=w.entries;if(!C.length){if(!performance.getEntriesByType)return;C=performance.getEntriesByType("resource")}const P=getResource(w.spanUrl,w.startTime,E,C,this._usedResources,"fetch");if(P.mainRequest){const w=P.mainRequest;this._markResourceAsUsed(w);const E=P.corsPreFlightRequest;E&&(this._addChildSpan(_,E),this._markResourceAsUsed(E));const C=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(_,w,this.getConfig().ignoreNetworkEvents,void 0,C)}}_markResourceAsUsed(_){this._usedResources.add(_)}_endSpan(_,w,E){const C=millisToHrTime$1(Date.now()),P=hrTime$1();this._addFinalSpanAttributes(_,E),this._semconvStability&Wu.STABLE&&E.status>=400&&(_.setStatus({code:xe.ERROR}),_.setAttribute(Lo,String(E.status))),setTimeout((()=>{w.observer?.disconnect(),this._findResourceAndAddNetworkEvents(_,w,P),this._tasksCount--,this._clearResources(),_.end(C)}),300)}_patchConstructor(){return _=>{const w=this;return function patchConstructor(...E){if(!w._isEnabled)return _.apply(this,E);const C=this,P=parseUrl(E[0]instanceof Request?E[0].url:String(E[0])).href;let R;R=E[0]instanceof Request?null!=E[1]?new Request(E[0],E[1]):E[0]:E[1]||{};const L=w._createSpan(P,R);if(!L)return _.apply(this,E);const I=w._prepareSpanData(P);function endSpanOnError(_,E){w._applyAttributesAfterFetch(_,R,E),w._endSpan(_,I,{status:E.status||0,statusText:E.message,url:P})}function endSpanOnSuccess(_,E){w._applyAttributesAfterFetch(_,R,E),E.status>=200&&E.status<400?w._endSpan(_,I,E):w._endSpan(_,I,{status:E.status,statusText:E.statusText,url:P})}function onSuccess(_,E){try{const w=E.clone().body;if(w){const C=w.getReader(),read=()=>{C.read().then((({done:w})=>{w?endSpanOnSuccess(_,E):read()}),(w=>{endSpanOnError(_,w)}))};read()}else endSpanOnSuccess(_,E)}catch(E){w._diag.error("Failed to read fetch response body",E),w._endSpan(_,I,{status:0,url:P})}return E}function onError(_,E){try{endSpanOnError(_,E)}catch(C){w._diag.error("Failed to end span on fetch error",C),w._endSpan(_,I,{status:E.status||0,url:P})}throw E}return w.getConfig().measureRequestSize&&getFetchBodyLength(...E).then((_=>{_&&(w._semconvStability&Wu.OLD&&L.setAttribute("http.request_content_length_uncompressed",_),w._semconvStability&Wu.STABLE&&L.setAttribute("http.request.body.size",_))})).catch((_=>{w._diag.warn("getFetchBodyLength",_)})),Le.with(Ue.setSpan(Le.active(),L),(()=>(w._callRequestHook(L,R),w._addHeaders(R,P),w._tasksCount++,_.apply(C,R instanceof Request?[R]:[P,R]).then(onSuccess.bind(C,L),onError.bind(C,L)))))}}}_applyAttributesAfterFetch(_,w,E){const C=this.getConfig().applyCustomAttributesOnSpan;C&&safeExecuteInTheMiddle((()=>C(_,w,E)),(_=>{_&&this._diag.error("applyCustomAttributesOnSpan",_)}))}_callRequestHook(_,w){const E=this.getConfig().requestHook;E&&safeExecuteInTheMiddle((()=>E(_,w)),(_=>{_&&this._diag.error("requestHook",_)}))}_prepareSpanData(_){const w=hrTime$1(),E=[];if("function"!=typeof PerformanceObserver)return{entries:E,startTime:w,spanUrl:_};const C=new PerformanceObserver((w=>{w.getEntries().forEach((w=>{"fetch"===w.initiatorType&&w.name===_&&E.push(w)}))}));return C.observe({entryTypes:["resource"]}),{entries:E,observer:C,startTime:w,spanUrl:_}}enable(){if(Vp){if(!this._isEnabled){if(this._isFetchPatched)return this._diag.debug("fetch constructor already patched"),void(this._isEnabled=!0);try{this._wrap(globalThis,"fetch",this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(_){this._diag.warn("Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.",_)}}}else this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()")}disable(){Vp&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}}const Hp=performance;var zp;!function(_){_.CONNECT_END="connectEnd",_.CONNECT_START="connectStart",_.DECODED_BODY_SIZE="decodedBodySize",_.DOM_COMPLETE="domComplete",_.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",_.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",_.DOM_INTERACTIVE="domInteractive",_.DOMAIN_LOOKUP_END="domainLookupEnd",_.DOMAIN_LOOKUP_START="domainLookupStart",_.ENCODED_BODY_SIZE="encodedBodySize",_.FETCH_START="fetchStart",_.LOAD_EVENT_END="loadEventEnd",_.LOAD_EVENT_START="loadEventStart",_.NAVIGATION_START="navigationStart",_.REDIRECT_END="redirectEnd",_.REDIRECT_START="redirectStart",_.REQUEST_START="requestStart",_.RESPONSE_END="responseEnd",_.RESPONSE_START="responseStart",_.SECURE_CONNECTION_START="secureConnectionStart",_.START_TIME="startTime",_.UNLOAD_EVENT_END="unloadEventEnd",_.UNLOAD_EVENT_START="unloadEventStart"}(zp||(zp={}));function hasKey(_,w){return w in _}function addSpanNetworkEvent(_,w,E,C=!0){if(hasKey(E,w)&&"number"==typeof E[w]&&(!C||0!==E[w]))return _.addEvent(w,E[w])}function addSpanNetworkEvents(_,w,E=!1,C,P){if(void 0===C&&(C=0!==w[zp.START_TIME]),E||(addSpanNetworkEvent(_,zp.FETCH_START,w,C),addSpanNetworkEvent(_,zp.DOMAIN_LOOKUP_START,w,C),addSpanNetworkEvent(_,zp.DOMAIN_LOOKUP_END,w,C),addSpanNetworkEvent(_,zp.CONNECT_START,w,C),addSpanNetworkEvent(_,zp.SECURE_CONNECTION_START,w,C),addSpanNetworkEvent(_,zp.CONNECT_END,w,C),addSpanNetworkEvent(_,zp.REQUEST_START,w,C),addSpanNetworkEvent(_,zp.RESPONSE_START,w,C),addSpanNetworkEvent(_,zp.RESPONSE_END,w,C)),!P){const E=w[zp.ENCODED_BODY_SIZE];void 0!==E&&_.setAttribute("http.response_content_length",E);const C=w[zp.DECODED_BODY_SIZE];void 0!==C&&E!==C&&_.setAttribute("http.response_content_length_uncompressed",C)}}var qp;!function(_){_.DOCUMENT_LOAD="documentLoad",_.DOCUMENT_FETCH="documentFetch",_.RESOURCE_FETCH="resourceFetch"}(qp||(qp={}));const Wp="http.url";var Gp;!function(_){_.FIRST_PAINT="firstPaint",_.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Gp||(Gp={}));const Kp={"first-paint":Gp.FIRST_PAINT,"first-contentful-paint":Gp.FIRST_CONTENTFUL_PAINT};class DocumentLoadInstrumentation extends InstrumentationBase{constructor(_={}){super("@opentelemetry/instrumentation-document-load","0.65.0",_),this.component="document-load",this.version="1",this.moduleName=this.component,this._semconvStability=semconvStabilityFromStr("http",_?.semconvStabilityOptIn)}init(){}_onDocumentLoaded(){window.setTimeout((()=>{this._collectPerformance()}))}_addResourcesSpans(_){const w=Hp.getEntriesByType?.("resource");w&&w.forEach((w=>{this._initResourceSpan(w,_)}))}_collectPerformance(){const _=Array.from(document.getElementsByTagName("meta")).find((_=>"traceparent"===_.getAttribute("name"))),w=(()=>{const _={},w=Hp.getEntriesByType?.("navigation")[0];if(w)Object.values(zp).forEach((E=>{if(hasKey(w,E)){const C=w[E];"number"==typeof C&&(_[E]=C)}}));else{const w=Hp.timing;w&&Object.values(zp).forEach((E=>{if(hasKey(w,E)){const C=w[E];"number"==typeof C&&(_[E]=C)}}))}return _})(),E=_&&_.content||"";Le.with($e.extract(se,{traceparent:E}),(()=>{const _=this._startSpan(qp.DOCUMENT_LOAD,zp.FETCH_START,w);_&&(Le.with(Ue.setSpan(Le.active(),_),(()=>{const _=this._startSpan(qp.DOCUMENT_FETCH,zp.FETCH_START,w);_&&(this._semconvStability&Wu.OLD&&_.setAttribute(Wp,location.href),this._semconvStability&Wu.STABLE&&_.setAttribute(qo,location.href),Le.with(Ue.setSpan(Le.active(),_),(()=>{const E=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents(_,w,this.getConfig().ignoreNetworkEvents,void 0,E),this._addCustomAttributesOnSpan(_,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(_,zp.RESPONSE_END,w)})))})),this._semconvStability&Wu.OLD&&(_.setAttribute(Wp,location.href),_.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&Wu.STABLE&&(_.setAttribute(qo,location.href),_.setAttribute("user_agent.original",navigator.userAgent)),this._addResourcesSpans(_),this.getConfig().ignoreNetworkEvents||(addSpanNetworkEvent(_,zp.FETCH_START,w),addSpanNetworkEvent(_,zp.UNLOAD_EVENT_START,w),addSpanNetworkEvent(_,zp.UNLOAD_EVENT_END,w),addSpanNetworkEvent(_,zp.DOM_INTERACTIVE,w),addSpanNetworkEvent(_,zp.DOM_CONTENT_LOADED_EVENT_START,w),addSpanNetworkEvent(_,zp.DOM_CONTENT_LOADED_EVENT_END,w),addSpanNetworkEvent(_,zp.DOM_COMPLETE,w),addSpanNetworkEvent(_,zp.LOAD_EVENT_START,w),addSpanNetworkEvent(_,zp.LOAD_EVENT_END,w)),this.getConfig().ignorePerformancePaintEvents||(_=>{const w=Hp.getEntriesByType?.("paint");w&&w.forEach((({name:w,startTime:E})=>{hasKey(Kp,w)&&_.addEvent(Kp[w],E)}))})(_),this._addCustomAttributesOnSpan(_,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(_,zp.LOAD_EVENT_END,w))}))}_endSpan(_,w,E){_&&(hasKey(E,w)?_.end(E[w]):_.end())}_initResourceSpan(_,w){const E=this._startSpan(qp.RESOURCE_FETCH,zp.FETCH_START,_,w);if(E){this._semconvStability&Wu.OLD&&E.setAttribute(Wp,_.name),this._semconvStability&Wu.STABLE&&E.setAttribute(qo,_.name);const w=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents(E,_,this.getConfig().ignoreNetworkEvents,void 0,w),this._addCustomAttributesOnResourceSpan(E,_,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(E,zp.RESPONSE_END,_)}}_startSpan(_,w,E,C){if(hasKey(E,w)&&"number"==typeof E[w]){return this.tracer.startSpan(_,{startTime:E[w]},C?Ue.setSpan(Le.active(),C):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(_,w){w&&safeExecuteInTheMiddle((()=>w(_)),(_=>{_&&this._diag.error("addCustomAttributesOnSpan",_)}))}_addCustomAttributesOnResourceSpan(_,w,E){E&&safeExecuteInTheMiddle((()=>E(_,w)),(_=>{_&&this._diag.error("addCustomAttributesOnResourceSpan",_)}))}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}function mergeHeaders(_,w,E){return async()=>{const C={...await E()},P={};return null!=w&&Object.assign(P,await w()),null!=_&&Object.assign(P,function validateAndNormalizeHeaders(_){const w={};return Object.entries(_??{}).forEach((([_,E])=>{void 0!==E?w[_]=String(E):Ie.warn(`Header "${_}" has invalid value (${E}) and will be ignored`)})),w}(await _())),Object.assign(P,C)}}function validateUserProvidedUrl(_){if(null!=_)try{const w=globalThis.location?.href;return new URL(_,w).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${_}'`)}}function mergeOtlpHttpConfigurationWithDefaults(_,w,E){return{...mergeOtlpSharedConfigurationWithDefaults(_,w,E),headers:mergeHeaders(_.headers,w.headers,E.headers),url:validateUserProvidedUrl(_.url)??w.url??E.url}}function getHttpConfigurationDefaults(_,w){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:async()=>_,url:"http://localhost:4318/"+w}}function httpAgentFactoryFromOptions(_){return async w=>{const E="http:"===w,C=E?import("http"):import("https"),{Agent:P}=await C;if(E){const{ca:w,cert:E,key:C,...R}=_;return new P(R)}return new P(_)}}function isExportHTTPErrorRetryable(_){return 429===_||502===_||503===_||504===_}function parseRetryAfterToMills$2(_){if(null==_)return;const w=Number.parseInt(_,10);if(Number.isInteger(w))return w>0?1e3*w:-1;const E=new Date(_).getTime()-Date.now();return E>=0?E:0}const Qp="OTel-OTLP-Exporter-JavaScript/0.220.0",Xp=4194304;function sendWithHttp(_,w,E,C,P,R,L,I){return new Promise((k=>{const F=new URL(w);E["User-Agent"]=P?`${P} ${Qp}`:Qp;const V=_(F,{method:"POST",headers:E,agent:R},(_=>{const w=[];let E=0;_.on("data",(C=>{if(E+=C.length,E>Xp){const w=new Error("OTLP export response body exceeded size limit of 4194304 bytes");return k({status:"failure",error:w}),void _.destroy()}w.push(C)})),_.on("end",(()=>{if(_.statusCode&&_.statusCode<=299)k({status:"success",data:Buffer.concat(w)});else if(_.statusCode&&isExportHTTPErrorRetryable(_.statusCode))k({status:"retryable",retryInMillis:parseRetryAfterToMills$2(_.headers["retry-after"])});else{const E=new OTLPExporterError(_.statusMessage,_.statusCode,Buffer.concat(w).toString());k({status:"failure",error:E})}})),_.on("error",(w=>{_.statusCode&&_.statusCode<=299?k({status:"success"}):_.statusCode&&isExportHTTPErrorRetryable(_.statusCode)?k({status:"retryable",error:w,retryInMillis:parseRetryAfterToMills$2(_.headers["retry-after"])}):k({status:"failure",error:w})}))}));V.setTimeout(I,(()=>{V.destroy(),k({status:"retryable",error:new Error("Request timed out")})})),V.on("error",(_=>{!function isHttpTransportNetworkErrorRetryable(_){const w=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);if("code"in _&&"string"==typeof _.code)return w.has(_.code);return!1}(_)?k({status:"failure",error:_}):k({status:"retryable",error:_})})),function compressAndSend(_,w,E,C){let P=function readableFromUint8Array(_){const w=new $;return w.push(_),w.push(null),w}(E);"gzip"===w&&(_.setHeader("Content-Encoding","gzip"),P=P.on("error",C).pipe(j.createGzip()).on("error",C));P.pipe(_).on("error",C)}(V,C,L,(_=>{k({status:"failure",error:_})}))}))}class HttpExporterTransport{constructor(_){this._utils=null,this._parameters=_}async send(_,w){const{agent:E,request:C}=await this._loadUtils(),P=await this._parameters.headers();return sendWithHttp(C,this._parameters.url,P,this._parameters.compression,this._parameters.userAgent,E,_,w)}shutdown(){}async _loadUtils(){let _=this._utils;if(null===_){const w=new URL(this._parameters.url).protocol,[E,C]=await Promise.all([this._parameters.agentFactory(w),requestFunctionFactory(w)]);_=this._utils={agent:E,request:C}}return _}}async function requestFunctionFactory(_){const w="http:"===_?import("http"):import("https"),{request:E}=await w;return E}class RetryingTransport{constructor(_){this._transport=_}retry(_,w,E){return new Promise(((C,P)=>{setTimeout((()=>{this._transport.send(_,w).then(C,P)}),E)}))}async send(_,w){let E=5,C=1e3;const P=Date.now()+w;let R=await this._transport.send(_,w);for(;"retryable"===R.status&&E>0;){E--;const w=Math.max(Math.min(C*(.4*Math.random()-.2+1),5e3),0);C*=1.5;const L=R.retryInMillis??w,I=P-Date.now();if(L>I)return Ie.info(`Export retry time ${Math.round(L)}ms exceeds remaining timeout ${Math.round(I)}ms, not retrying further.`),R;Ie.verbose(`Scheduling export retry in ${Math.round(L)}ms`),R=await this.retry(_,I,L)}return"success"===R.status?Ie.verbose(`Export succeeded after ${5-E} retry attempts.`):"retryable"===R.status?Ie.info("Export failed after maximum retry attempts (5)."):Ie.info(`Export failed with non-retryable error: ${R.error}`),R}shutdown(){return this._transport.shutdown()}}function createRetryingTransport(_){return new RetryingTransport(_.transport)}function parseAndValidateTimeoutFromEnv(_){const w=function getNumberFromEnv$1(_){const w=process.env[_];if(null==w||""===w.trim())return;const E=Number(w);if(!isNaN(E))return E;Ie.warn(`Unknown value ${qe.inspect(w)} for ${_}, expected a number, using defaults`)}(_);if(null!=w){if(Number.isFinite(w)&&w>0)return w;Ie.warn(`Configuration: ${_} is invalid, expected number greater than 0 (actual: ${w})`)}}function getTimeoutFromEnv(_){const w=parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${_}_TIMEOUT`),E=parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT");return w??E}function parseAndValidateCompressionFromEnv(_){const w=getStringFromEnv$1(_)?.trim();if(null==w||"none"===w||"gzip"===w)return w;Ie.warn(`Configuration: ${_} is invalid, expected 'none' or 'gzip' (actual: '${w}')`)}function getCompressionFromEnv(_){const w=parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${_}_COMPRESSION`),E=parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION");return w??E}function getSharedConfigurationFromEnvironment(_){return{timeoutMillis:getTimeoutFromEnv(_),compression:getCompressionFromEnv(_)}}function getStaticHeadersFromEnv(_){const w=getStringFromEnv$1(`OTEL_EXPORTER_OTLP_${_}_HEADERS`),E=getStringFromEnv$1("OTEL_EXPORTER_OTLP_HEADERS"),C=parseKeyPairsIntoRecord(w),P=parseKeyPairsIntoRecord(E);if(0!==Object.keys(C).length||0!==Object.keys(P).length)return Object.assign({},parseKeyPairsIntoRecord(E),parseKeyPairsIntoRecord(w))}function getNonSpecificUrlFromEnv(_){const w=getStringFromEnv$1("OTEL_EXPORTER_OTLP_ENDPOINT");if(void 0!==w)return function appendResourcePathToUrl(_,w){try{new URL(_)}catch{return void Ie.warn(`Configuration: Could not parse environment-provided export URL: '${_}', falling back to undefined`)}_.endsWith("/")||(_+="/"),_+=w;try{new URL(_)}catch{return void Ie.warn(`Configuration: Provided URL appended with '${w}' is not a valid URL, using 'undefined' instead of '${_}'`)}return _}(w,_)}function getSpecificUrlFromEnv(_){const w=getStringFromEnv$1(`OTEL_EXPORTER_OTLP_${_}_ENDPOINT`);if(void 0!==w)return function appendRootPathToUrlIfNeeded(_){try{return new URL(_).toString()}catch{return void Ie.warn(`Configuration: Could not parse environment-provided export URL: '${_}', falling back to undefined`)}}(w)}function readFileFromEnv(_,w,E){const P=getStringFromEnv$1(_),R=getStringFromEnv$1(w),L=P??R;if(null!=L)try{return k.readFileSync(C.resolve(process.cwd(),L))}catch{return void Ie.warn(E)}}function getClientCertificateFromEnv(_){return readFileFromEnv(`OTEL_EXPORTER_OTLP_${_}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function getClientKeyFromEnv(_){return readFileFromEnv(`OTEL_EXPORTER_OTLP_${_}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function getRootCertificateFromEnv(_){return readFileFromEnv(`OTEL_EXPORTER_OTLP_${_}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function convertLegacyHeaders(_){return"function"==typeof _.headers?_.headers:wrapStaticHeadersInFunction(_.headers)}function convertLegacyAgentOptions(_){if("function"==typeof _.httpAgentOptions)return _.httpAgentOptions;let w=_.httpAgentOptions;return null!=_.keepAlive&&(w={keepAlive:_.keepAlive,...w}),null!=w?httpAgentFactoryFromOptions(w):void 0}function convertLegacyHttpOptions(_,w,E,C){return _.metadata&&Ie.warn("Metadata cannot be set when using http"),function mergeOtlpNodeHttpConfigurationWithDefaults(_,w,E){return{...mergeOtlpHttpConfigurationWithDefaults(_,w,E),agentFactory:_.agentFactory??w.agentFactory??E.agentFactory,userAgent:_.userAgent}}({url:_.url,headers:convertLegacyHeaders(_),concurrencyLimit:_.concurrencyLimit,timeoutMillis:_.timeoutMillis,compression:_.compression,agentFactory:convertLegacyAgentOptions(_),userAgent:_.userAgent},function getNodeHttpConfigurationFromEnvironment(_,w){return{...getSharedConfigurationFromEnvironment(_),url:getSpecificUrlFromEnv(_)??getNonSpecificUrlFromEnv(w),headers:wrapStaticHeadersInFunction(getStaticHeadersFromEnv(_)),agentFactory:httpAgentFactoryFromOptions({keepAlive:!0,ca:getRootCertificateFromEnv(_),cert:getClientCertificateFromEnv(_),key:getClientKeyFromEnv(_)})}}(w,E),function getNodeHttpConfigurationDefaults(_,w){return{...getHttpConfigurationDefaults(_,w),agentFactory:httpAgentFactoryFromOptions({keepAlive:!0})}}(C,E))}let Jp=class OTLPTraceExporter extends OTLPExporterBase{constructor(_={}){super(function createOtlpHttpExportDelegate(_,w){return createOtlpExportDelegate({transport:createRetryingTransport({transport:(E=_,new HttpExporterTransport(E))}),serializer:w,promiseHandler:createBoundedQueueExportPromiseHandler(_)},{timeout:_.timeoutMillis});var E}(convertLegacyHttpOptions(_,"TRACES","v1/traces",{"Content-Type":"application/x-protobuf"}),ci))}};const Zp="global",Yp="gcp.project_id",ed="gcp.firebase.app_id",td="cloud.region",rd="gcp.firebase.domain";var nd;function isSpan(_){return"function"==typeof _.spanContext}function getSpanId(_){return _.spanContext().spanId}function isRootEvent(_){return isSpan(_)?void 0===_.parentSpanContext:void 0===_.spanContext?.traceId}!function(_){_[_.RootSpan=0]="RootSpan",_[_.RootLog=1]="RootLog",_[_.ChildSpan=2]="ChildSpan",_[_.ChildLog=3]="ChildLog"}(nd||(nd={}));class TraceEvents{constructor(){this.logs=new Set,this.spans=new Map,this.isTraceQueuedForExport=!1}add(_){isSpan(_)?this.spans.set(getSpanId(_),_):this.logs.add(_)}has(_){return isSpan(_)?this.spans.has(getSpanId(_)):this.logs.has(_)}}class TelemetryStore{constructor(_=TelemetryStore.DEFAULT_BUFFER_LIMIT,w){this._telemetryBufferMap=new Map,this._totalTelemetryCount=0,this._shouldAddLimitLog=!1,this._bufferLimit=_,this._rootTelemetryQueue=new RootTelemetryQueue(w)}get totalTelemetryCount(){return this._totalTelemetryCount}add(_){const w=this._getEventId(_);if(isRootEvent(_)&&this._telemetryBufferMap.has(w))return;if(!isRootEvent(_)&&!this._telemetryBufferMap.has(w))return;if(!this._bufferHasCapacity()){if(this._isQueueEmpty())return void(this._shouldAddLimitLog=!0);this._evictOldest()}const E=function getEventType(_){return isSpan(_)?isRootEvent(_)?nd.RootSpan:nd.ChildSpan:isRootEvent(_)?nd.RootLog:nd.ChildLog}(_);switch(E){case nd.RootSpan:{const E=new TraceEvents;return E.add(_),this._telemetryBufferMap.set(w,E),void this._totalTelemetryCount++}case nd.RootLog:return this._telemetryBufferMap.set(w,_),this._rootTelemetryQueue.isFull()&&this._evictOldest(),this._rootTelemetryQueue.enqueue(w),void this._totalTelemetryCount++;case nd.ChildSpan:case nd.ChildLog:{const E=this._telemetryBufferMap.get(w);return void(E&&E instanceof TraceEvents&&!E.has(_)&&(E.add(_),this._totalTelemetryCount++))}}}update(_){if(!isRootEvent(_))return;const w=this._getEventId(_),E=this._telemetryBufferMap.get(w);if(E&&E instanceof TraceEvents){if(E.isTraceQueuedForExport)return;this._rootTelemetryQueue.isFull()&&this._evictOldest(),this._rootTelemetryQueue.enqueue(w),E.isTraceQueuedForExport=!0}}getSpansToExport(){const _=[];for(const w of this._rootTelemetryQueue.getValues()){const E=this._telemetryBufferMap.get(w);E instanceof TraceEvents&&_.push(...E.spans.values())}return _}getLogsToExport(){const _=[];if(this._shouldAddLimitLog){const w={severityNumber:z.INFO,body:"Telemetry buffer limit reached. Some telemetry events were dropped."};_.push(w)}for(const w of this._rootTelemetryQueue.getValues()){const E=this._telemetryBufferMap.get(w);E instanceof TraceEvents?_.push(...E.logs):E&&_.push(E)}return _}clear(){this._rootTelemetryQueue.clear(),this._telemetryBufferMap.clear(),this._totalTelemetryCount=0,this._shouldAddLimitLog=!1}_getEventId(_){return isSpan(_)?_.spanContext().traceId:_.spanContext?.traceId??function generateUuid$1(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues){const _=new Uint8Array(16);crypto.getRandomValues(_),_[6]=15&_[6]|64,_[8]=63&_[8]|128;const w=Array.from(_,(_=>_.toString(16).padStart(2,"0"))).join("");return`${w.slice(0,8)}-${w.slice(8,12)}-${w.slice(12,16)}-${w.slice(16,20)}-${w.slice(20,32)}`}throw new Error("Web Crypto API is not available to generate a UUID.")}()}_bufferHasCapacity(){return this._totalTelemetryCount<this._bufferLimit}_isQueueEmpty(){return 0===this._rootTelemetryQueue.size}_evictOldest(){const _=this._rootTelemetryQueue.dequeue();_&&this._maybeEvictIdFromBuffer(_)}_maybeEvictIdFromBuffer(_){const w=this._telemetryBufferMap.get(_);w&&(this._totalTelemetryCount-=w instanceof TraceEvents?w.spans.size+w.logs.size:1,this._telemetryBufferMap.delete(_))}}TelemetryStore.DEFAULT_BUFFER_LIMIT=1e3;class RootTelemetryQueue{constructor(_=RootTelemetryQueue.DEFAULT_LIMIT){if(this._limit=_,this._head=0,this._tail=0,this._size=0,_<=0)throw new Error("Limit must be a positive integer greater than 0");this._items=new Array(this._limit).fill(void 0)}get size(){return this._size}isFull(){return this._size===this._limit}enqueue(_){this._size!==this._limit&&(this._items[this._tail]=_,this._tail=(this._tail+1)%this._limit,this._size++)}dequeue(){if(0===this._size)return;const _=this._items[this._head];return this._items[this._head]=void 0,this._head=(this._head+1)%this._limit,this._size--,_}peek(){if(0!==this._size)return this._items[this._head]}getValues(){const _=[];for(let w=0;w<this._size;w++){const E=(this._head+w)%this._items.length;this._items[E]&&_.push(this._items[E])}return _}clear(){this._items.fill(void 0),this._head=0,this._tail=0,this._size=0}}RootTelemetryQueue.DEFAULT_LIMIT=100;class OnErrorLogRecordProcessor extends BatchLogRecordProcessor{constructor(_,w){super({exporter:_,disableAutoFlushOnDocumentHide:!0}),this._store=w}onEmit(_){"good"!==_.attributes?.["browser.web_vital.rating"]&&this._store.add(_)}shutdown(){return this._store.clear(),super.shutdown()}onErrorOccurred(){const _=this._store.getLogsToExport();for(const w of _)super.onEmit(w)}}class OnErrorSpanProcessor extends BatchSpanProcessor{constructor(_,w){super(_),this._store=w}onStart(_,w){this._store.add(_)}onEnd(_){this._store.update(_)}shutdown(){return this._store.clear(),super.shutdown()}onErrorOccurred(){const _=this._store.getSpansToExport();for(const w of _)super.onEnd(w)}}class FirebaseAttributesSpanProcessor{constructor(_){this.attributesStore=_}onStart(_,w){const E=this.attributesStore.getSpanAttributes();for(const[w,C]of Object.entries(E))void 0!==C&&void 0===_.attributes?.[w]&&_.setAttribute(w,C)}onEnd(_){_.attributes&&delete _.attributes["user_agent.original"]}async forceFlush(){}async shutdown(){}}let od,id=class FetchTransport{constructor(_){this.parameters=_}async send(_,w){const E=new AbortController,C=setTimeout((()=>E.abort()),w);try{const w=new Headers(this.parameters.headers);if(this.parameters.dynamicHeaderProviders&&this.parameters.dynamicHeaderProviders.length>0){const _=this.parameters.dynamicHeaderProviders.map((async _=>{try{return await _.getHeader()}catch(_){return Ie.debug(`Failed to retrieve dynamic header: ${_}`),null}})),E=await Promise.all(_);for(const _ of E)_&&w.append(..._)}const C=_.byteLength<6e4,P={method:"POST",headers:w,signal:E.signal,keepalive:C,mode:"cors",body:_},R=await Le.with(suppressTracing$2(Le.active()),(()=>fetch(this.parameters.url,P)));if(R.status>=200&&R.status<=299)return Ie.debug("response success"),{status:"success"};if(function isExportRetryable$1(_){return[429,502,503,504].includes(_)}(R.status)){const _=function parseRetryAfterToMills$1(_){if(null==_)return;const w=Number.parseInt(_,10);if(Number.isInteger(w))return w>0?1e3*w:-1;const E=new Date(_).getTime()-Date.now();return E>=0?E:0}(R.headers.get("Retry-After"));return{status:"retryable",retryInMillis:_}}return{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(_){return _ instanceof Error?{status:"failure",error:_}:{status:"failure",error:new Error(`Fetch request errored: ${_}`)}}finally{clearTimeout(C)}}shutdown(){}};function createTracingProvider(_,w,E,C,P=[]){if("undefined"==typeof window)return{tracingProvider:Ue.getTracerProvider()};const R=function getTelemetryEndpointUrl$1(_={}){const w=_||{};if(w.endpointUrl){let _=w.endpointUrl.length;for(;_>0&&"/"===w.endpointUrl[_-1];)_--;return w.endpointUrl.slice(0,_)}const E=w.region||Zp;return E!==Zp?`https://clienttelemetry.${E}.rep.googleapis.com`:"https://clienttelemetry.googleapis.com"}(w),{projectId:L,appId:I,apiKey:k}=_.options,F=w.region||Zp,j={[rd]:window.location.hostname};L&&(j[Yp]=L),I&&(j[ed]=I),F!==Zp&&(j[td]=F);const $=resourceFromAttributes$1(j),V=`${R}/v1/traces`;let H;H="http://localhost:4318"===R?new Jp({url:V,headers:{"X-Goog-User-Project":L||"",...k?{"X-Goog-Api-Key":k}:{}}}):new OTLPTraceExporter({url:V,headers:{"Content-Type":"application/json",...k?{"X-Goog-Api-Key":k}:{}}},P,E);const z=new OnErrorSpanProcessor(H,C),q=new WebTracerProvider({resource:$,spanProcessors:[new FirebaseAttributesSpanProcessor(E),z]});q.register({propagator:new CompositePropagator({propagators:[new W3CTraceContextPropagator]})});const G=`^${R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,K={ignoreUrls:[new RegExp(G)],semconvStabilityOptIn:"http"};return od&&od(),od=registerInstrumentations({instrumentations:[new FetchInstrumentation(K),new XMLHttpRequestInstrumentation(K),new DocumentLoadInstrumentation({semconvStabilityOptIn:"http"})]}),{tracingProvider:q,onErrorSpanProcessor:z}}class OTLPTraceExporter extends OTLPExporterBase{constructor(_={},w=[],E){super(createOtlpNetworkExportDelegate({timeoutMillis:1e4,concurrencyLimit:5},di,new id({url:_.url,headers:new Headers("object"==typeof _.headers?_.headers:{}),dynamicHeaderProviders:w}))),this.attributesStore=E}async export(_,w){const E=await(this.attributesStore?.getInstallationIdAttribute());E&&_.forEach((_=>{Object.assign(_.attributes,E)})),super.export(_,w)}}const sd=new Set;function unregisterLoggerInstrumentations(){for(const _ of sd)_();sd.clear()}class BreadcrumbsFeatureImpl{constructor(){this.name="breadcrumbs"}createTelemetryStore(){return new TelemetryStore}createLogRecordProcessor(_,w){return new OnErrorLogRecordProcessor(_,w)}initializeLoggerInstrumentations(_){if("undefined"==typeof window)return;const w=new _l({enabled:!1}),E=new Kl({enabled:!1,includeRawAttribution:!0});this._unregisterLoggerInstrumentationsFn&&(this._unregisterLoggerInstrumentationsFn(),sd.delete(this._unregisterLoggerInstrumentationsFn));const C=registerInstrumentations({loggerProvider:_,instrumentations:[w,E,new Cl({autoCapturedActions:["click"]})]});Object.defineProperty(this,"_unregisterLoggerInstrumentationsFn",{value:C,writable:!0,configurable:!0,enumerable:!1}),sd.add(C)}createTracingProvider(_,w,E,C,P=[]){return createTracingProvider(_,w,E,C,P)}unregisterInstrumentations(){this._unregisterLoggerInstrumentationsFn&&(this._unregisterLoggerInstrumentationsFn(),sd.delete(this._unregisterLoggerInstrumentationsFn),this._unregisterLoggerInstrumentationsFn=void 0),function unregisterTracingInstrumentations(){od&&(od(),od=void 0)}()}}function breadcrumbs(){return new BreadcrumbsFeatureImpl}var ad="@firebase/crashlytics",cd="0.1.0-eap-sql.a9a137e67";const ud="crashlytics",ld="global",pd="gcp.project_id",dd="gcp.firebase.app_id",fd="cloud.region",hd=Symbol("firebase_crashlytics_logged"),gd="app.installation.id",md="firebasecrashlytics.sessionid",yd="app.build_id",bd="session.id",_d="app.screen.id",vd="logging.googleapis.com/trace",Sd="logging.googleapis.com/spanId",wd="gcp.resource.name",Ed="session.id",Td="service.version",Ad="app.screen.id";class AttributesStore{constructor(_,w,E){this._projectId=_.projectId,this._region=w?.region||ld,this.updateOptions(w);const C=this.getSessionIdFromStorage();C&&(this._sessionId=C),this._installations=E?.getImmediate({optional:!0})??null,this._installations||E?.get().then((_=>this._installations=_)).catch((()=>{}))}updateOptions(_){const w=_?.appVersion?_.appVersion:Po?.appVersion?Po.appVersion:"unset";this._appVersion=w,this._customAttributes=_?.customAttributes?{..._.customAttributes}:void 0}get sessionId(){return this._sessionId}setSessionId(_){if(this._sessionId=_,"undefined"!=typeof sessionStorage)try{sessionStorage.setItem(md,_)}catch(_){}}setRoutePathProvider(_){this._routePathProvider=_}getLogAttributes(_){const w={};this._customAttributes&&Object.assign(w,this._customAttributes),this._appVersion&&(w[yd]=this._appVersion),this._sessionId&&(w[bd]=this._sessionId);const E=this._routePathProvider?.();return E&&(w[_d]=E),_?{...w,..._}:w}getSpanAttributes(){const _={};this._projectId&&(_[wd]=`//clienttelemetry.googleapis.com/projects/${this._projectId}/locations/${this._region}/`),this._appVersion&&(_[Td]=this._appVersion),this._sessionId&&(_[Ed]=this._sessionId);const w=this._routePathProvider?.();return w&&(_[Ad]=w),_}async getInstallationIdAttribute(){if(!this._installations)return null;if(this._iid)return{[gd]:this._iid};const _=await this._installations.getId();return _?(this._iid=_,{[gd]:_}):null}getSessionIdFromStorage(){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(md)||void 0}catch(_){}}}function getCrashlytics(_=E(),w){const C=_getProvider(_,ud);if(C.isInitialized()){const _=C.getImmediate();if(deepEqual(w||{},C.getOptions()))return _;throw new Error("getCrashlytics() cannot be called with different options")}const P=C.initialize({options:w});return w&&(P.options=w),P}function recordError(_,w,E){if(!_)return;if(w&&"object"==typeof w)try{w[hd]=!0}catch(_){}const{loggerProvider:C,telemetryStore:P,onErrorSpanProcessor:R,onErrorLogRecordProcessor:L}=_,I=C.getLogger("error-logger"),k=E?{...E}:{};w instanceof Error?I.emit({severityNumber:z.ERROR,body:w.message,attributes:{"exception.type":w.name||"Error","exception.stacktrace":w.stack||"No stack trace available","exception.message":w.message,...k}}):"string"==typeof w?I.emit({severityNumber:z.ERROR,body:w,attributes:k}):I.emit({severityNumber:z.ERROR,body:"Unknown error type: "+typeof w,attributes:k}),R&&R.onErrorOccurred(),L&&L.onErrorOccurred(),P&&P.clear()}function log(_,w,E){if(!_)return;const{loggerProvider:C}=_,P=C.getLogger("custom-logger"),R=E?{...E}:{};P.emit({severityNumber:z.INFO,body:w,attributes:R})}function logViewBoundary(_,w,E){const{loggerProvider:C,attributesStore:P,options:R}=_;if(!getBreadcrumbsFeature(R))return;const L=C.getLogger("view-boundary-logger"),I=P.getLogAttributes({[_d]:w,...E});L.emit({severityNumber:z.INFO,body:"Navigation event",attributes:I})}function getBreadcrumbsFeature(_){return _?.features?.find((_=>Boolean(_&&"breadcrumbs"===_.name)))}function startNewSession(_){const{loggerProvider:w,attributesStore:E}=_;if("undefined"!=typeof sessionStorage)try{const _=function generateUuid(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues){const _=new Uint8Array(16);crypto.getRandomValues(_),_[6]=15&_[6]|64,_[8]=63&_[8]|128;const w=Array.from(_,(_=>_.toString(16).padStart(2,"0"))).join("");return`${w.slice(0,8)}-${w.slice(8,12)}-${w.slice(12,16)}-${w.slice(16,20)}-${w.slice(20,32)}`}throw new Error("Web Crypto API is not available to generate a UUID.")}();E.setSessionId(_);const C=E.getLogAttributes();w.getLogger("session-logger").emit({severityNumber:z.DEBUG,body:"Session created",attributes:C})}catch(_){}}function registerListeners(_){if("undefined"!=typeof window&&"undefined"!=typeof document){const onVisibilityChange=async()=>{!getBreadcrumbsFeature(_.options)||"visible"!==document.visibilityState&&"hidden"!==document.visibilityState||function logVisibilityEvent(_,w){const{loggerProvider:E,attributesStore:C}=_,P=E.getLogger("visibility-logger"),R=C.getLogAttributes(),L="hidden"===w?"Background lifecycle event":"Foreground lifecycle event";P.emit({severityNumber:z.INFO,body:L,attributes:R})}(_,document.visibilityState),"hidden"===document.visibilityState&&await flush(_)},onPageHide=async()=>{await flush(_)};return window.addEventListener("visibilitychange",onVisibilityChange),window.addEventListener("pagehide",onPageHide),()=>{window.removeEventListener("visibilitychange",onVisibilityChange),window.removeEventListener("pagehide",onPageHide)}}return()=>{}}let Od=null;function flush(_){return _.loggerProvider.forceFlush().catch((_=>{console.error("Error flushing logs from Firebase Crashlytics:",_)}))}class CrashlyticsService{constructor(_,w,E,C,P,R,L){this.app=_,this.loggerProvider=w,this.tracingProvider=E,this.attributesStore=C,this.telemetryStore=P,this.onErrorLogRecordProcessor=R,this.onErrorSpanProcessor=L}unsubscribeListeners(_){this._unsubscribeListeners=_}async _delete(){this._unsubscribeListeners&&this._unsubscribeListeners(),getBreadcrumbsFeature(this._options)?.unregisterInstrumentations();const _=[];if(this.loggerProvider&&"function"==typeof this.loggerProvider.shutdown&&_.push(this.loggerProvider.shutdown().catch((_=>{console.warn("Error shutting down logger provider:",_)}))),this.tracingProvider){const w=this.tracingProvider;"function"==typeof w.shutdown&&_.push(w.shutdown().catch((_=>{console.warn("Error shutting down tracing provider:",_)})))}await Promise.all(_)}set options(_){this._options=_,this.attributesStore.updateOptions(_)}get options(){return this._options}}class FetchTransport{constructor(_){this.parameters=_}async send(_,w){const E=new AbortController,C=setTimeout((()=>E.abort()),w);try{const w=new Headers(this.parameters.headers);if(this.parameters.dynamicHeaderProviders&&this.parameters.dynamicHeaderProviders.length>0){const _=this.parameters.dynamicHeaderProviders.map((async _=>{try{return await _.getHeader()}catch(_){return Ie.debug(`Failed to retrieve dynamic header: ${_}`),null}})),E=await Promise.all(_);for(const _ of E)_&&w.append(..._)}const C=_.byteLength<6e4,P={method:"POST",headers:w,signal:E.signal,keepalive:C,mode:"cors",body:_},R=await Le.with(suppressTracing$2(Le.active()),(()=>fetch(this.parameters.url,P)));if(R.status>=200&&R.status<=299)return Ie.debug("response success"),{status:"success"};if(function isExportRetryable(_){return[429,502,503,504].includes(_)}(R.status)){const _=function parseRetryAfterToMills(_){if(null==_)return;const w=Number.parseInt(_,10);if(Number.isInteger(w))return w>0?1e3*w:-1;const E=new Date(_).getTime()-Date.now();return E>=0?E:0}(R.headers.get("Retry-After"));return{status:"retryable",retryInMillis:_}}return{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(_){return _ instanceof Error?{status:"failure",error:_}:{status:"failure",error:new Error(`Fetch request errored: ${_}`)}}finally{clearTimeout(C)}}shutdown(){}}class FirebaseAttributesLogProcessor{constructor(_,w){this.attributesStore=_,this.projectId=w}onEmit(_,w){var E,C,P,R,L;_.attributes||(_.attributes={});const I=this.attributesStore.getLogAttributes();for(const[w,C]of Object.entries(I))void 0!==C&&((E=_.attributes)[w]??(E[w]=C));const k=_.spanContext??(w?Ue.getSpanContext(w):void 0)??Ue.getActiveSpan()?.spanContext();k?.traceId&&k?.spanId&&this.projectId&&((C=_.attributes)[P=vd]??(C[P]=`projects/${this.projectId}/traces/${k.traceId}`),(R=_.attributes)[L=Sd]??(R[L]=k.spanId))}async forceFlush(){}async shutdown(){}}function createLoggerProvider(_,w={},E,C,P=[]){const R=function getTelemetryEndpointUrl(_={}){const w=_||{};if(w.endpointUrl){let _=w.endpointUrl.length;for(;_>0&&"/"===w.endpointUrl[_-1];)_--;return w.endpointUrl.slice(0,_)}const E=w.region||ld;return E!==ld?`https://clienttelemetry.${E}.rep.googleapis.com`:"https://clienttelemetry.googleapis.com"}(w),{projectId:L,appId:I,apiKey:k}=_.options,F=w.region||ld,j=`${R}/v1/logs`,$={[oi]:"firebase_telemetry_service"};L&&($[pd]=L),I&&($[dd]=I),F!==ld&&($[fd]=F);const V=resourceFromAttributes$1($),H=new OTLPLogExporter({url:j,headers:{"Content-Type":"application/json",...k?{"X-Goog-Api-Key":k}:{}}},P,E);let z;const q=[new FirebaseAttributesLogProcessor(E,L)],G=getBreadcrumbsFeature(w);G?(z=G.createLogRecordProcessor(H,C??G.createTelemetryStore()),q.push(z)):q.push(new BatchLogRecordProcessor({exporter:H,disableAutoFlushOnDocumentHide:!0}));const K=new LoggerProvider({resource:V,processors:q,logRecordLimits:{}});return w.registerGlobalLoggerProvider&&X.setGlobalLoggerProvider(K),G&&"undefined"!=typeof window&&G.initializeLoggerInstrumentations(K),{loggerProvider:K,onErrorLogRecordProcessor:z}}class OTLPLogExporter extends OTLPExporterBase{constructor(_={},w=[],E){super(createOtlpNetworkExportDelegate({timeoutMillis:1e4,concurrencyLimit:5},pi,new FetchTransport({url:_.url,headers:new Headers("object"==typeof _.headers?_.headers:{}),dynamicHeaderProviders:w}))),this.attributesStore=E,this.endpointUrl=_.url}async export(_,w){const E=_.filter((_=>!function isTelemetryUrl(_,w){return!!("string"==typeof _&&_&&(/^https?:\/\/clienttelemetry\.(googleapis\.com|[a-z0-9-]+\.rep\.googleapis\.com)(\/|$)/.test(_)||w&&_.startsWith(w)))}(_.attributes?.["url.full"]||_.attributes?.["http.url"]||_.attributes?.["resource.url"],this.endpointUrl)));if(0===E.length)return void w({code:mo.SUCCESS});const C=await this.attributesStore.getInstallationIdAttribute();C&&E.forEach((_=>{Object.assign(_.attributes,C)})),super.export(E,w)}async shutdown(){console.log("OTLPLogExporter: shutdown called")}async forceFlush(){console.log("OTLPLogExporter: forceFlush called")}}class AppCheckProvider{constructor(_){this.appCheck=_?.getImmediate({optional:!0}),this.appCheck||_?.get().then((_=>this.appCheck=_)).catch()}async getHeader(){if(!this.appCheck)return null;const _=await this.appCheck.getToken();return!_||_.error?null:["X-Firebase-AppCheck",_.token]}}!function registerCrashlytics(){w(new Component(ud,((_,{options:w})=>{const E=w||{},C=_.getProvider("app").getImmediate(),P=_.getProvider("app-check-internal"),R=_.getProvider("installations-internal"),L=new AttributesStore(C.options,E,R),I=getBreadcrumbsFeature(E),k=I?.createTelemetryStore(),F=[new AppCheckProvider(P)],{loggerProvider:j,onErrorLogRecordProcessor:$}=createLoggerProvider(C,E,L,k,F),{tracingProvider:V,onErrorSpanProcessor:H}=I&&k?I.createTracingProvider(C,E,L,k,F):{tracingProvider:null,onErrorSpanProcessor:void 0},z=new CrashlyticsService(C,j,V,L,k,$,H);w&&(z.options=E),L.sessionId||startNewSession(z);const q=registerListeners(z),G=!1!==E.captureUnhandledErrors?function registerGlobalErrorListeners(_){if("undefined"==typeof window||!1===_.options?.captureUnhandledErrors)return()=>{};if(Od){if(Od.crashlytics===_)return()=>{};Od.unsubscribe()}const errorListener=w=>{w.error&&w.error[hd]||recordError(_,w.error)},unhandledRejectionListener=w=>{w.reason&&w.reason[hd]||recordError(_,w.reason)};try{window.addEventListener("error",errorListener),window.addEventListener("unhandledrejection",unhandledRejectionListener)}catch(_){return console.warn("Firebase Crashlytics was not initialized:\n",_),()=>{}}let w=!1;const unsubscribe=()=>{w||(w=!0,Od?.unsubscribe===unsubscribe&&(Od=null),window.removeEventListener("error",errorListener),window.removeEventListener("unhandledrejection",unhandledRejectionListener))};return Od={crashlytics:_,unsubscribe:unsubscribe},unsubscribe}(z):()=>{};return z.unsubscribeListeners((()=>{q(),G()})),z}),"PUBLIC").setMultipleInstances(!0)),_(ad,cd),_(ad,cd,"esm2020")}();export{breadcrumbs,flush,getCrashlytics,log,logViewBoundary,recordError,unregisterLoggerInstrumentations};
|
|
1
|
+
import{registerVersion as _,_registerComponent as w,_getProvider,getApp as E}from"https://www.gstatic.com/firebasejs/13.2.0-eap-sql.b903ef716/firebase-app.js";import*as C from"path";import P from"path";import R from"module";import L from"tty";import I from"worker_threads";import*as k from"fs";import{readFileSync as F}from"fs";import*as j from"zlib";import{Readable as $}from"stream";class FirebaseError extends Error{constructor(_,w,E){super(w),this.code=_,this.customData=E,this.name="FirebaseError",Object.setPrototypeOf(this,FirebaseError.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ErrorFactory.prototype.create)}}class ErrorFactory{constructor(_,w,E){this.service=_,this.serviceName=w,this.errors=E}create(_,...w){const E=w[0]||{},C=`${this.service}/${_}`,P=this.errors[_],R=P?function replaceTemplate(_,w){try{let E=0,C="";for(;E<_.length;){const P=_.indexOf("{$",E);if(-1===P){C+=_.substring(E);break}const R=_.indexOf("}",P+2);if(-1===R){C+=_.substring(E);break}const L=_.substring(P+2,R),I=w[L];C+=_.substring(E,P)+(null!=I?String(I):`<${L}?>`),E=R+1}return C}catch(w){return _}}(P,E):"Error",L=`${this.serviceName}: ${R} (${C}).`;return new FirebaseError(C,L,E)}}function deepEqual(_,w){if(_===w)return!0;const E=Object.keys(_),C=Object.keys(w);for(const P of E){if(!C.includes(P))return!1;const E=_[P],R=w[P];if(isObject$1(E)&&isObject$1(R)){if(!deepEqual(E,R))return!1}else if(E!==R)return!1}for(const _ of C)if(!E.includes(_))return!1;return!0}function isObject$1(_){return null!==_&&"object"==typeof _}class Component{constructor(_,w,E){this.name=_,this.instanceFactory=w,this.type=E,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(_){return this.instantiationMode=_,this}setMultipleInstances(_){return this.multipleInstances=_,this}setServiceProps(_){return this.serviceProps=_,this}setInstanceCreatedCallback(_){return this.onInstanceCreated=_,this}}var V,H,z;!function(_){_.LAZY="LAZY",_.EAGER="EAGER",_.EXPLICIT="EXPLICIT"}(V||(V={})),function(_){_.PUBLIC="PUBLIC",_.PRIVATE="PRIVATE",_.VERSION="VERSION"}(H||(H={})),function(_){_[_.UNSPECIFIED=0]="UNSPECIFIED",_[_.TRACE=1]="TRACE",_[_.TRACE2=2]="TRACE2",_[_.TRACE3=3]="TRACE3",_[_.TRACE4=4]="TRACE4",_[_.DEBUG=5]="DEBUG",_[_.DEBUG2=6]="DEBUG2",_[_.DEBUG3=7]="DEBUG3",_[_.DEBUG4=8]="DEBUG4",_[_.INFO=9]="INFO",_[_.INFO2=10]="INFO2",_[_.INFO3=11]="INFO3",_[_.INFO4=12]="INFO4",_[_.WARN=13]="WARN",_[_.WARN2=14]="WARN2",_[_.WARN3=15]="WARN3",_[_.WARN4=16]="WARN4",_[_.ERROR=17]="ERROR",_[_.ERROR2=18]="ERROR2",_[_.ERROR3=19]="ERROR3",_[_.ERROR4=20]="ERROR4",_[_.FATAL=21]="FATAL",_[_.FATAL2=22]="FATAL2",_[_.FATAL3=23]="FATAL3",_[_.FATAL4=24]="FATAL4"}(z||(z={}));class NoopLogger{emit(_){}enabled(){return!1}}const q=new NoopLogger;const G=Symbol.for("io.opentelemetry.js.api.logs"),K=globalThis;const Q=new class NoopLoggerProvider{getLogger(_,w,E){return new NoopLogger}};class ProxyLogger{constructor(_,w,E,C){this._provider=_,this.name=w,this.version=E,this.options=C}emit(_){this._getLogger().emit(_)}enabled(_){return this._getLogger().enabled(_)}_getLogger(){if(this._delegate)return this._delegate;const _=this._provider._getDelegateLogger(this.name,this.version,this.options);return _?(this._delegate=_,this._delegate):q}}class ProxyLoggerProvider{getLogger(_,w,E){var C;return null!==(C=this._getDelegateLogger(_,w,E))&&void 0!==C?C:new ProxyLogger(this,_,w,E)}_getDelegate(){var _;return null!==(_=this._delegate)&&void 0!==_?_:Q}_setDelegate(_){this._delegate=_}_getDelegateLogger(_,w,E){var C;return null===(C=this._delegate)||void 0===C?void 0:C.getLogger(_,w,E)}}class LogsAPI{constructor(){this._proxyLoggerProvider=new ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new LogsAPI),this._instance}setGlobalLoggerProvider(_){return K[G]?this.getLoggerProvider():(K[G]=function makeGetter(_,w,E){return C=>C===_?w:E}(1,_,Q),this._proxyLoggerProvider._setDelegate(_),_)}getLoggerProvider(){var _,w;return null!==(w=null===(_=K[G])||void 0===_?void 0:_.call(K,1))&&void 0!==w?w:this._proxyLoggerProvider}getLogger(_,w,E){return this.getLoggerProvider().getLogger(_,w,E)}disable(){delete K[G],this._proxyLoggerProvider=new ProxyLoggerProvider}}const X=LogsAPI.getInstance(),J="1.9.1",Z=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;const Y=function _makeCompatibilityCheck(_){const w=new Set([_]),E=new Set,C=_.match(Z);if(!C)return()=>!1;const P=+C[1],R=+C[2],L=+C[3];if(null!=C[4])return function isExactmatch(w){return w===_};function _reject(_){return E.add(_),!1}function _accept(_){return w.add(_),!0}return function isCompatible(_){if(w.has(_))return!0;if(E.has(_))return!1;const C=_.match(Z);if(!C)return _reject(_);const I=+C[1],k=+C[2],F=+C[3];return null!=C[4]||P!==I?_reject(_):0===P?R===k&&L<=F?_accept(_):_reject(_):R<=k?_accept(_):_reject(_)}}(J),ee=J.split(".")[0],te=Symbol.for(`opentelemetry.js.api.${ee}`),re="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{};function registerGlobal(_,w,E,C=!1){var P;const R=re[te]=null!==(P=re[te])&&void 0!==P?P:{version:J};if(!C&&R[_]){const w=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${_}`);return E.error(w.stack||w.message),!1}if(R.version!==J){const w=new Error(`@opentelemetry/api: Registration of version v${R.version} for ${_} does not match previously registered API v${J}`);return E.error(w.stack||w.message),!1}return R[_]=w,E.debug(`@opentelemetry/api: Registered a global for ${_} v${J}.`),!0}function getGlobal(_){var w,E;const C=null===(w=re[te])||void 0===w?void 0:w.version;if(C&&Y(C))return null===(E=re[te])||void 0===E?void 0:E[_]}function unregisterGlobal(_,w){w.debug(`@opentelemetry/api: Unregistering a global for ${_} v${J}.`);const E=re[te];E&&delete E[_]}class DiagComponentLogger{constructor(_){this._namespace=_.namespace||"DiagComponentLogger"}debug(..._){return logProxy("debug",this._namespace,_)}error(..._){return logProxy("error",this._namespace,_)}info(..._){return logProxy("info",this._namespace,_)}warn(..._){return logProxy("warn",this._namespace,_)}verbose(..._){return logProxy("verbose",this._namespace,_)}}function logProxy(_,w,E){const C=getGlobal("diag");if(C)return C[_](w,...E)}var ne;!function(_){_[_.NONE=0]="NONE",_[_.ERROR=30]="ERROR",_[_.WARN=50]="WARN",_[_.INFO=60]="INFO",_[_.DEBUG=70]="DEBUG",_[_.VERBOSE=80]="VERBOSE",_[_.ALL=9999]="ALL"}(ne||(ne={}));class DiagAPI{static instance(){return this._instance||(this._instance=new DiagAPI),this._instance}constructor(){function _logProxy(_){return function(...w){const E=getGlobal("diag");if(E)return E[_](...w)}}const _=this;_.setLogger=(w,E={logLevel:ne.INFO})=>{var C,P,R;if(w===_){const w=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return _.error(null!==(C=w.stack)&&void 0!==C?C:w.message),!1}"number"==typeof E&&(E={logLevel:E});const L=getGlobal("diag"),I=function createLogLevelDiagLogger(_,w){function _filterFunc(E,C){const P=w[E];return"function"==typeof P&&_>=C?P.bind(w):function(){}}return _<ne.NONE?_=ne.NONE:_>ne.ALL&&(_=ne.ALL),w=w||{},{error:_filterFunc("error",ne.ERROR),warn:_filterFunc("warn",ne.WARN),info:_filterFunc("info",ne.INFO),debug:_filterFunc("debug",ne.DEBUG),verbose:_filterFunc("verbose",ne.VERBOSE)}}(null!==(P=E.logLevel)&&void 0!==P?P:ne.INFO,w);if(L&&!E.suppressOverrideMessage){const _=null!==(R=(new Error).stack)&&void 0!==R?R:"<failed to generate stacktrace>";L.warn(`Current logger will be overwritten from ${_}`),I.warn(`Current logger will overwrite one already registered from ${_}`)}return registerGlobal("diag",I,_,!0)},_.disable=()=>{unregisterGlobal("diag",_)},_.createComponentLogger=_=>new DiagComponentLogger(_),_.verbose=_logProxy("verbose"),_.debug=_logProxy("debug"),_.info=_logProxy("info"),_.warn=_logProxy("warn"),_.error=_logProxy("error")}}class BaggageImpl{constructor(_){this._entries=_?new Map(_):new Map}getEntry(_){const w=this._entries.get(_);if(w)return Object.assign({},w)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(_,w){const E=new BaggageImpl(this._entries);return E._entries.set(_,w),E}removeEntry(_){const w=new BaggageImpl(this._entries);return w._entries.delete(_),w}removeEntries(..._){const w=new BaggageImpl(this._entries);for(const E of _)w._entries.delete(E);return w}clear(){return new BaggageImpl}}const oe=Symbol("BaggageEntryMetadata"),ie=DiagAPI.instance();function createBaggage(_={}){return new BaggageImpl(new Map(Object.entries(_)))}function baggageEntryMetadataFromString(_){return"string"!=typeof _&&(ie.error("Cannot create baggage metadata from unknown type: "+typeof _),_=""),{__TYPE__:oe,toString:()=>_}}function createContextKey(_){return Symbol.for(_)}class BaseContext{constructor(_){const w=this;w._currentContext=_?new Map(_):new Map,w.getValue=_=>w._currentContext.get(_),w.setValue=(_,E)=>{const C=new BaseContext(w._currentContext);return C._currentContext.set(_,E),C},w.deleteValue=_=>{const E=new BaseContext(w._currentContext);return E._currentContext.delete(_),E}}}const se=new BaseContext;class NoopMetric{}class NoopObservableMetric{addCallback(_){}removeCallback(_){}}const ae=new class NoopMeter{constructor(){}createGauge(_,w){return ue}createHistogram(_,w){return le}createCounter(_,w){return ce}createUpDownCounter(_,w){return pe}createObservableGauge(_,w){return fe}createObservableCounter(_,w){return de}createObservableUpDownCounter(_,w){return he}addBatchObservableCallback(_,w){}removeBatchObservableCallback(_){}},ce=new class NoopCounterMetric extends NoopMetric{add(_,w){}},ue=new class NoopGaugeMetric extends NoopMetric{record(_,w){}},le=new class NoopHistogramMetric extends NoopMetric{record(_,w){}},pe=new class NoopUpDownCounterMetric extends NoopMetric{add(_,w){}},de=new class NoopObservableCounterMetric extends NoopObservableMetric{},fe=new class NoopObservableGaugeMetric extends NoopObservableMetric{},he=new class NoopObservableUpDownCounterMetric extends NoopObservableMetric{};function createNoopMeter(){return ae}const ge={get(_,w){if(null!=_)return _[w]},keys:_=>null==_?[]:Object.keys(_)},me={set(_,w,E){null!=_&&(_[w]=E)}};const ye="context",be=new class NoopContextManager{active(){return se}with(_,w,E,...C){return w.call(E,...C)}bind(_,w){return w}enable(){return this}disable(){return this}};class ContextAPI{constructor(){}static getInstance(){return this._instance||(this._instance=new ContextAPI),this._instance}setGlobalContextManager(_){return registerGlobal(ye,_,DiagAPI.instance())}active(){return this._getContextManager().active()}with(_,w,E,...C){return this._getContextManager().with(_,w,E,...C)}bind(_,w){return this._getContextManager().bind(_,w)}_getContextManager(){return getGlobal(ye)||be}disable(){this._getContextManager().disable(),unregisterGlobal(ye,DiagAPI.instance())}}var _e;!function(_){_[_.NONE=0]="NONE",_[_.SAMPLED=1]="SAMPLED"}(_e||(_e={}));const ve="0000000000000000",Se="00000000000000000000000000000000",we={traceId:Se,spanId:ve,traceFlags:_e.NONE};class NonRecordingSpan{constructor(_=we){this._spanContext=_}spanContext(){return this._spanContext}setAttribute(_,w){return this}setAttributes(_){return this}addEvent(_,w){return this}addLink(_){return this}addLinks(_){return this}setStatus(_){return this}updateName(_){return this}end(_){}isRecording(){return!1}recordException(_,w){}}const Ee=createContextKey("OpenTelemetry Context Key SPAN");function getSpan(_){return _.getValue(Ee)||void 0}function getActiveSpan(){return getSpan(ContextAPI.getInstance().active())}function setSpan(_,w){return _.setValue(Ee,w)}function deleteSpan(_){return _.deleteValue(Ee)}function setSpanContext(_,w){return setSpan(_,new NonRecordingSpan(w))}function getSpanContext(_){var w;return null===(w=getSpan(_))||void 0===w?void 0:w.spanContext()}const Te=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 isValidHex(_,w){if("string"!=typeof _||_.length!==w)return!1;let E=0;for(let w=0;w<_.length;w+=4)E+=(0|Te[_.charCodeAt(w)])+(0|Te[_.charCodeAt(w+1)])+(0|Te[_.charCodeAt(w+2)])+(0|Te[_.charCodeAt(w+3)]);return E===w}function isValidTraceId(_){return isValidHex(_,32)&&_!==Se}function isSpanContextValid(_){return isValidTraceId(_.traceId)&&function isValidSpanId(_){return isValidHex(_,16)&&_!==ve}(_.spanId)}function wrapSpanContext(_){return new NonRecordingSpan(_)}const Ae=ContextAPI.getInstance();class NoopTracer{startSpan(_,w,E=Ae.active()){if(Boolean(null==w?void 0:w.root))return new NonRecordingSpan;const C=E&&getSpanContext(E);return function isSpanContext(_){return null!==_&&"object"==typeof _&&"spanId"in _&&"string"==typeof _.spanId&&"traceId"in _&&"string"==typeof _.traceId&&"traceFlags"in _&&"number"==typeof _.traceFlags}(C)&&isSpanContextValid(C)?new NonRecordingSpan(C):new NonRecordingSpan}startActiveSpan(_,w,E,C){let P,R,L;if(arguments.length<2)return;2===arguments.length?L=w:3===arguments.length?(P=w,L=E):(P=w,R=E,L=C);const I=null!=R?R:Ae.active(),k=this.startSpan(_,P,I),F=setSpan(I,k);return Ae.with(F,L,void 0,k)}}const Oe=new NoopTracer;class ProxyTracer{constructor(_,w,E,C){this._provider=_,this.name=w,this.version=E,this.options=C}startSpan(_,w,E){return this._getTracer().startSpan(_,w,E)}startActiveSpan(_,w,E,C){const P=this._getTracer();return Reflect.apply(P.startActiveSpan,P,arguments)}_getTracer(){if(this._delegate)return this._delegate;const _=this._provider.getDelegateTracer(this.name,this.version,this.options);return _?(this._delegate=_,this._delegate):Oe}}const Ce=new class NoopTracerProvider{getTracer(_,w,E){return new NoopTracer}};class ProxyTracerProvider{getTracer(_,w,E){var C;return null!==(C=this.getDelegateTracer(_,w,E))&&void 0!==C?C:new ProxyTracer(this,_,w,E)}getDelegate(){var _;return null!==(_=this._delegate)&&void 0!==_?_:Ce}setDelegate(_){this._delegate=_}getDelegateTracer(_,w,E){var C;return null===(C=this._delegate)||void 0===C?void 0:C.getTracer(_,w,E)}}var Pe,Re,xe;!function(_){_[_.NOT_RECORD=0]="NOT_RECORD",_[_.RECORD=1]="RECORD",_[_.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Pe||(Pe={})),function(_){_[_.INTERNAL=0]="INTERNAL",_[_.SERVER=1]="SERVER",_[_.CLIENT=2]="CLIENT",_[_.PRODUCER=3]="PRODUCER",_[_.CONSUMER=4]="CONSUMER"}(Re||(Re={})),function(_){_[_.UNSET=0]="UNSET",_[_.OK=1]="OK",_[_.ERROR=2]="ERROR"}(xe||(xe={}));const Le=ContextAPI.getInstance(),Ie=DiagAPI.instance();const Ne=new class NoopMeterProvider{getMeter(_,w,E){return ae}},De="metrics";class MetricsAPI{constructor(){}static getInstance(){return this._instance||(this._instance=new MetricsAPI),this._instance}setGlobalMeterProvider(_){return registerGlobal(De,_,DiagAPI.instance())}getMeterProvider(){return getGlobal(De)||Ne}getMeter(_,w,E){return this.getMeterProvider().getMeter(_,w,E)}disable(){unregisterGlobal(De,DiagAPI.instance())}}const ke=MetricsAPI.getInstance();const Fe=createContextKey("OpenTelemetry Baggage Key");function getBaggage(_){return _.getValue(Fe)||void 0}function getActiveBaggage(){return getBaggage(ContextAPI.getInstance().active())}function setBaggage(_,w){return _.setValue(Fe,w)}function deleteBaggage(_){return _.deleteValue(Fe)}const je="propagation",Me=new class NoopTextMapPropagator{inject(_,w){}extract(_,w){return _}fields(){return[]}};class PropagationAPI{constructor(){this.createBaggage=createBaggage,this.getBaggage=getBaggage,this.getActiveBaggage=getActiveBaggage,this.setBaggage=setBaggage,this.deleteBaggage=deleteBaggage}static getInstance(){return this._instance||(this._instance=new PropagationAPI),this._instance}setGlobalPropagator(_){return registerGlobal(je,_,DiagAPI.instance())}inject(_,w,E=me){return this._getGlobalPropagator().inject(_,w,E)}extract(_,w,E=ge){return this._getGlobalPropagator().extract(_,w,E)}fields(){return this._getGlobalPropagator().fields()}disable(){unregisterGlobal(je,DiagAPI.instance())}_getGlobalPropagator(){return getGlobal(je)||Me}}const $e=PropagationAPI.getInstance(),Be="trace";class TraceAPI{constructor(){this._proxyTracerProvider=new ProxyTracerProvider,this.wrapSpanContext=wrapSpanContext,this.isSpanContextValid=isSpanContextValid,this.deleteSpan=deleteSpan,this.getSpan=getSpan,this.getActiveSpan=getActiveSpan,this.getSpanContext=getSpanContext,this.setSpan=setSpan,this.setSpanContext=setSpanContext}static getInstance(){return this._instance||(this._instance=new TraceAPI),this._instance}setGlobalTracerProvider(_){const w=registerGlobal(Be,this._proxyTracerProvider,DiagAPI.instance());return w&&this._proxyTracerProvider.setDelegate(_),w}getTracerProvider(){return getGlobal(Be)||this._proxyTracerProvider}getTracer(_,w){return this.getTracerProvider().getTracer(_,w)}disable(){unregisterGlobal(Be,DiagAPI.instance()),this._proxyTracerProvider=new ProxyTracerProvider}}const Ue=TraceAPI.getInstance(),Ve=createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function suppressTracing$2(_){return _.setValue(Ve,!0)}function isTracingSuppressed$1(_){return!0===_.getValue(Ve)}const He="baggage";function parsePairKeyValue$1(_){if(!_)return;const w=_.indexOf(";"),E=-1===w?_:_.substring(0,w),C=E.indexOf("=");if(C<=0)return;const P=E.substring(0,C).trim(),R=E.substring(C+1).trim();if(!P||!R)return;let L,I,k;try{L=decodeURIComponent(P),I=decodeURIComponent(R)}catch{return}if(-1!==w&&w<_.length-1){k=baggageEntryMetadataFromString(_.substring(w+1))}return{key:L,value:I,metadata:k}}function parseBaggageHeaderString(_,w,E,C){let P=0;for(;P<_.length&&E<180;){const R=_.indexOf(",",P),L=-1===R?_.length:R,I=L-P;if(I<=4096){const R=parsePairKeyValue$1(_.substring(P,L));if(R){const _=(0===E?0:1)+I;if(C+_>8192)break;w[R.key]=R.metadata?{value:R.value,metadata:R.metadata}:{value:R.value},E++,C+=_}}if(-1===R)break;P=R+1}return[E,C]}class W3CBaggagePropagator{inject(_,w,E){const C=$e.getBaggage(_);if(!C||isTracingSuppressed$1(_))return;const P=function getKeyPairs(_){return _.getAllEntries().map((([_,w])=>{let E=`${encodeURIComponent(_)}=${encodeURIComponent(w.value)}`;return void 0!==w.metadata&&(E+=";"+w.metadata.toString()),E}))}(C).filter((_=>_.length<=4096)).slice(0,180),R=function serializeKeyPairs(_){return _.reduce(((_,w)=>{const E=`${_}${""!==_?",":""}${w}`;return E.length>8192?_:E}),"")}(P);R.length>0&&E.set(w,He,R)}extract(_,w,E){const C=E.get(w,He);if(!C)return _;const P={};let R=0,L=0;if(Array.isArray(C))for(let _=0;_<C.length;_++)[R,L]=parseBaggageHeaderString(C[_],P,R,L);else[R]=parseBaggageHeaderString(C,P,R,L);return 0===R?_:$e.setBaggage(_,$e.createBaggage(P))}fields(){return[He]}}var ze="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},qe={},We={},Ge=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var _={},w=Symbol("test"),E=Object(w);if("string"==typeof w)return!1;if("[object Symbol]"!==Object.prototype.toString.call(w))return!1;if("[object Symbol]"!==Object.prototype.toString.call(E))return!1;for(var C in _[w]=42,_)return!1;if("function"==typeof Object.keys&&0!==Object.keys(_).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(_).length)return!1;var P=Object.getOwnPropertySymbols(_);if(1!==P.length||P[0]!==w)return!1;if(!Object.prototype.propertyIsEnumerable.call(_,w))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var R=Object.getOwnPropertyDescriptor(_,w);if(42!==R.value||!0!==R.enumerable)return!1}return!0},Ke=Ge,Qe=function hasToStringTagShams(){return Ke()&&!!Symbol.toStringTag},Xe=Object,Je=Error,Ze=EvalError,Ye=RangeError,et=ReferenceError,tt=SyntaxError,rt=TypeError,nt=URIError,ot=Math.abs,it=Math.floor,st=Math.max,at=Math.min,ct=Math.pow,ut=Math.round,lt=Number.isNaN||function isNaN(_){return _!=_},pt=lt,dt=Object.getOwnPropertyDescriptor;if(dt)try{dt([],"length")}catch(e){dt=null}var ft=dt,ht=Object.defineProperty||!1;if(ht)try{ht({},"a",{value:1})}catch(e){ht=!1}var gt,mt=ht,yt="undefined"!=typeof Symbol&&Symbol,bt=Ge,_t="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null,vt=Xe.getPrototypeOf||null,St=Object.prototype.toString,wt=Math.max,Et=function concatty(_,w){for(var E=[],C=0;C<_.length;C+=1)E[C]=_[C];for(var P=0;P<w.length;P+=1)E[P+_.length]=w[P];return E},Tt=function bind(_){var w=this;if("function"!=typeof w||"[object Function]"!==St.apply(w))throw new TypeError("Function.prototype.bind called on incompatible "+w);for(var E,C=function slicy(_,w){for(var E=[],C=w,P=0;C<_.length;C+=1,P+=1)E[P]=_[C];return E}(arguments,1),P=wt(0,w.length-C.length),R=[],L=0;L<P;L++)R[L]="$"+L;if(E=Function("binder","return function ("+function(_,w){for(var E="",C=0;C<_.length;C+=1)E+=_[C],C+1<_.length&&(E+=w);return E}(R,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof E){var P=w.apply(this,Et(C,arguments));return Object(P)===P?P:this}return w.apply(_,Et(C,arguments))})),w.prototype){var I=function Empty(){};I.prototype=w.prototype,E.prototype=new I,I.prototype=null}return E},At=Function.prototype.bind||Tt,Ot=Function.prototype.call,Ct=Function.prototype.apply,Pt=Ct,Rt=Ot,xt="undefined"!=typeof Reflect&&Reflect&&Reflect.apply||At.call(Rt,Pt),Lt=At,It=rt,Nt=Ot,Dt=xt,kt=function callBindBasic(_){if(_.length<1||"function"!=typeof _[0])throw new It("a function is required");return Dt(Lt,Nt,_)},Ft=kt,jt=ft;try{gt=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var Mt,$t=!!gt&&jt&&jt(Object.prototype,"__proto__"),Bt=Object,Ut=Bt.getPrototypeOf,Vt=$t&&"function"==typeof $t.get?Ft([$t.get]):"function"==typeof Ut&&function getDunder(_){return Ut(null==_?_:Bt(_))},Ht=_t,zt=vt,qt=Vt,Wt=Ht?function getProto(_){return Ht(_)}:zt?function getProto(_){if(!_||"object"!=typeof _&&"function"!=typeof _)throw new TypeError("getProto: not an object");return zt(_)}:qt?function getProto(_){return qt(_)}:null,Gt=Function.prototype.call,Kt=Object.prototype.hasOwnProperty,Qt=At.call(Gt,Kt),Xt=Xe,Jt=Je,Zt=Ze,Yt=Ye,er=et,tr=tt,rr=rt,nr=nt,or=ot,ir=it,sr=st,ar=at,cr=ct,ur=ut,lr=function sign(_){return pt(_)||0===_?_:_<0?-1:1},pr=Function,getEvalledConstructor=function(_){try{return pr('"use strict"; return ('+_+").constructor;")()}catch(_){}},dr=ft,fr=mt,throwTypeError=function(){throw new rr},hr=dr?function(){try{return throwTypeError}catch(_){try{return dr(arguments,"callee").get}catch(_){return throwTypeError}}}():throwTypeError,gr=function hasNativeSymbols(){return"function"==typeof yt&&("function"==typeof Symbol&&("symbol"==typeof yt("foo")&&("symbol"==typeof Symbol("bar")&&bt())))}(),mr=Wt,yr=vt,br=_t,_r=Ct,vr=Ot,Sr={},wr="undefined"!=typeof Uint8Array&&mr?mr(Uint8Array):Mt,Er={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?Mt:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Mt:ArrayBuffer,"%ArrayIteratorPrototype%":gr&&mr?mr([][Symbol.iterator]()):Mt,"%AsyncFromSyncIteratorPrototype%":Mt,"%AsyncFunction%":Sr,"%AsyncGenerator%":Sr,"%AsyncGeneratorFunction%":Sr,"%AsyncIteratorPrototype%":Sr,"%Atomics%":"undefined"==typeof Atomics?Mt:Atomics,"%BigInt%":"undefined"==typeof BigInt?Mt:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Mt:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Mt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Mt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Jt,"%eval%":eval,"%EvalError%":Zt,"%Float32Array%":"undefined"==typeof Float32Array?Mt:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Mt:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Mt:FinalizationRegistry,"%Function%":pr,"%GeneratorFunction%":Sr,"%Int8Array%":"undefined"==typeof Int8Array?Mt:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Mt:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Mt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gr&&mr?mr(mr([][Symbol.iterator]())):Mt,"%JSON%":"object"==typeof JSON?JSON:Mt,"%Map%":"undefined"==typeof Map?Mt:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&gr&&mr?mr((new Map)[Symbol.iterator]()):Mt,"%Math%":Math,"%Number%":Number,"%Object%":Xt,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Mt:Promise,"%Proxy%":"undefined"==typeof Proxy?Mt:Proxy,"%RangeError%":Yt,"%ReferenceError%":er,"%Reflect%":"undefined"==typeof Reflect?Mt:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Mt:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&gr&&mr?mr((new Set)[Symbol.iterator]()):Mt,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Mt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gr&&mr?mr(""[Symbol.iterator]()):Mt,"%Symbol%":gr?Symbol:Mt,"%SyntaxError%":tr,"%ThrowTypeError%":hr,"%TypedArray%":wr,"%TypeError%":rr,"%Uint8Array%":"undefined"==typeof Uint8Array?Mt:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Mt:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Mt:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Mt:Uint32Array,"%URIError%":nr,"%WeakMap%":"undefined"==typeof WeakMap?Mt:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Mt:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Mt:WeakSet,"%Function.prototype.call%":vr,"%Function.prototype.apply%":_r,"%Object.defineProperty%":fr,"%Object.getPrototypeOf%":yr,"%Math.abs%":or,"%Math.floor%":ir,"%Math.max%":sr,"%Math.min%":ar,"%Math.pow%":cr,"%Math.round%":ur,"%Math.sign%":lr,"%Reflect.getPrototypeOf%":br};if(mr)try{null.error}catch(e){var Tr=mr(mr(e));Er["%Error.prototype%"]=Tr}var Ar=function doEval(_){var w;if("%AsyncFunction%"===_)w=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===_)w=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===_)w=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===_){var E=doEval("%AsyncGeneratorFunction%");E&&(w=E.prototype)}else if("%AsyncIteratorPrototype%"===_){var C=doEval("%AsyncGenerator%");C&&mr&&(w=mr(C.prototype))}return Er[_]=w,w},Or={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Cr=At,Pr=Qt,Rr=Cr.call(vr,Array.prototype.concat),xr=Cr.call(_r,Array.prototype.splice),Lr=Cr.call(vr,String.prototype.replace),Ir=Cr.call(vr,String.prototype.slice),Nr=Cr.call(vr,RegExp.prototype.exec),Dr=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,kr=/\\(\\)?/g,Fr=function getBaseIntrinsic(_,w){var E,C=_;if(Pr(Or,C)&&(C="%"+(E=Or[C])[0]+"%"),Pr(Er,C)){var P=Er[C];if(P===Sr&&(P=Ar(C)),void 0===P&&!w)throw new rr("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:E,name:C,value:P}}throw new tr("intrinsic "+_+" does not exist!")},jr=function GetIntrinsic(_,w){if("string"!=typeof _||0===_.length)throw new rr("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof w)throw new rr('"allowMissing" argument must be a boolean');if(null===Nr(/^%?[^%]*%?$/,_))throw new tr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var E=function stringToPath(_){var w=Ir(_,0,1),E=Ir(_,-1);if("%"===w&&"%"!==E)throw new tr("invalid intrinsic syntax, expected closing `%`");if("%"===E&&"%"!==w)throw new tr("invalid intrinsic syntax, expected opening `%`");var C=[];return Lr(_,Dr,(function(_,w,E,P){C[C.length]=E?Lr(P,kr,"$1"):w||_})),C}(_),C=E.length>0?E[0]:"",P=Fr("%"+C+"%",w),R=P.name,L=P.value,I=!1,k=P.alias;k&&(C=k[0],xr(E,Rr([0,1],k)));for(var F=1,j=!0;F<E.length;F+=1){var $=E[F],V=Ir($,0,1),H=Ir($,-1);if(('"'===V||"'"===V||"`"===V||'"'===H||"'"===H||"`"===H)&&V!==H)throw new tr("property names with quotes must have matching quotes");if("constructor"!==$&&j||(I=!0),Pr(Er,R="%"+(C+="."+$)+"%"))L=Er[R];else if(null!=L){if(!($ in L)){if(!w)throw new rr("base intrinsic for "+_+" exists, but the property is not available.");return}if(dr&&F+1>=E.length){var z=dr(L,$);L=(j=!!z)&&"get"in z&&!("originalValue"in z.get)?z.get:L[$]}else j=Pr(L,$),L=L[$];j&&!I&&(Er[R]=L)}}return L},Mr=jr,$r=kt,Br=$r([Mr("%String.prototype.indexOf%")]),Ur=function callBoundIntrinsic(_,w){var E=Mr(_,!!w);return"function"==typeof E&&Br(_,".prototype.")>-1?$r([E]):E},Vr=Qe(),Hr=Ur("Object.prototype.toString"),zr=function isArguments(_){return!(Vr&&_&&"object"==typeof _&&Symbol.toStringTag in _)&&"[object Arguments]"===Hr(_)},qr=function isArguments(_){return!!zr(_)||null!==_&&"object"==typeof _&&"length"in _&&"number"==typeof _.length&&_.length>=0&&"[object Array]"!==Hr(_)&&"callee"in _&&"[object Function]"===Hr(_.callee)},Wr=function(){return zr(arguments)}();zr.isLegacyArguments=qr;var Gr,Kr=Wr?zr:qr,Qr=Ur,Xr=Qe(),Jr=Qt,Zr=ft;if(Xr){var Yr=Qr("RegExp.prototype.exec"),en={},throwRegexMarker=function(){throw en},tn={toString:throwRegexMarker,valueOf:throwRegexMarker};"symbol"==typeof Symbol.toPrimitive&&(tn[Symbol.toPrimitive]=throwRegexMarker),Gr=function isRegex(_){if(!_||"object"!=typeof _)return!1;var w=Zr(_,"lastIndex");if(!(w&&Jr(w,"value")))return!1;try{Yr(_,tn)}catch(_){return _===en}}}else{var rn=Qr("Object.prototype.toString");Gr=function isRegex(_){return!(!_||"object"!=typeof _&&"function"!=typeof _)&&"[object RegExp]"===rn(_)}}var nn,on,sn,an=Gr,cn=Ur("RegExp.prototype.exec"),un=rt,ln=Ur,pn=function regexTester(_){if(!an(_))throw new un("`regex` must be a RegExp");return function test(w){return null!==cn(_,w)}},dn=pn(/^\s*(?:function)?\*/),fn=Qe(),hn=Wt,gn=ln("Object.prototype.toString"),mn=ln("Function.prototype.toString"),yn=function isGeneratorFunction(_){if("function"!=typeof _)return!1;if(dn(mn(_)))return!0;if(!fn)return"[object GeneratorFunction]"===gn(_);if(!hn)return!1;if(void 0===nn){var w=function(){if(!fn)return!1;try{return Function("return function*() {}")()}catch(_){}}();nn=!!w&&hn(w)}return hn(_)===nn},bn=Function.prototype.toString,_n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof _n&&"function"==typeof Object.defineProperty)try{on=Object.defineProperty({},"length",{get:function(){throw sn}}),sn={},_n((function(){throw 42}),null,on)}catch(Ul){Ul!==sn&&(_n=null)}else _n=null;var vn=/^\s*class\b/,Sn=function isES6ClassFunction(_){try{var w=bn.call(_);return vn.test(w)}catch(_){return!1}},wn=function tryFunctionToStr(_){try{return!Sn(_)&&(bn.call(_),!0)}catch(_){return!1}},En=Object.prototype.toString,Tn="function"==typeof Symbol&&!!Symbol.toStringTag,An=!(0 in[,]),On=function isDocumentDotAll(){return!1};if("object"==typeof document){var Cn=document.all;En.call(Cn)===En.call(document.all)&&(On=function isDocumentDotAll(_){if((An||!_)&&(void 0===_||"object"==typeof _))try{var w=En.call(_);return("[object HTMLAllCollection]"===w||"[object HTML document.all class]"===w||"[object HTMLCollection]"===w||"[object Object]"===w)&&null==_("")}catch(_){}return!1})}var Pn=_n?function isCallable(_){if(On(_))return!0;if(!_)return!1;if("function"!=typeof _&&"object"!=typeof _)return!1;try{_n(_,null,on)}catch(_){if(_!==sn)return!1}return!Sn(_)&&wn(_)}:function isCallable(_){if(On(_))return!0;if(!_)return!1;if("function"!=typeof _&&"object"!=typeof _)return!1;if(Tn)return wn(_);if(Sn(_))return!1;var w=En.call(_);return!("[object Function]"!==w&&"[object GeneratorFunction]"!==w&&!/^\[object HTML/.test(w))&&wn(_)},Rn=Pn,xn=Object.prototype.toString,Ln=Object.prototype.hasOwnProperty,In=function forEach(_,w,E){if(!Rn(w))throw new TypeError("iterator must be a function");var C;arguments.length>=3&&(C=E),"[object Array]"===xn.call(_)?function forEachArray(_,w,E){for(var C=0,P=_.length;C<P;C++)Ln.call(_,C)&&(null==E?w(_[C],C,_):w.call(E,_[C],C,_))}(_,w,C):"string"==typeof _?function forEachString(_,w,E){for(var C=0,P=_.length;C<P;C++)null==E?w(_.charAt(C),C,_):w.call(E,_.charAt(C),C,_)}(_,w,C):function forEachObject(_,w,E){for(var C in _)Ln.call(_,C)&&(null==E?w(_[C],C,_):w.call(E,_[C],C,_))}(_,w,C)},Nn=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Dn="undefined"==typeof globalThis?ze:globalThis,kn={exports:{}},Fn=mt,jn=tt,Mn=rt,$n=ft,Bn=mt,Un=function hasPropertyDescriptors(){return!!Bn};Un.hasArrayLengthDefineBug=function hasArrayLengthDefineBug(){if(!Bn)return null;try{return 1!==Bn([],"length",{value:1}).length}catch(_){return!0}};var Vn=jr,Hn=function defineDataProperty(_,w,E){if(!_||"object"!=typeof _&&"function"!=typeof _)throw new Mn("`obj` must be an object or a function`");if("string"!=typeof w&&"symbol"!=typeof w)throw new Mn("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new Mn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new Mn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new Mn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new Mn("`loose`, if provided, must be a boolean");var C=arguments.length>3?arguments[3]:null,P=arguments.length>4?arguments[4]:null,R=arguments.length>5?arguments[5]:null,L=arguments.length>6&&arguments[6],I=!!$n&&$n(_,w);if(Fn)Fn(_,w,{configurable:null===R&&I?I.configurable:!R,enumerable:null===C&&I?I.enumerable:!C,value:E,writable:null===P&&I?I.writable:!P});else{if(!L&&(C||P||R))throw new jn("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");_[w]=E}},zn=Un(),qn=ft,Wn=rt,Gn=Vn("%Math.floor%"),Kn=function setFunctionLength(_,w){if("function"!=typeof _)throw new Wn("`fn` is not a function");if("number"!=typeof w||w<0||w>4294967295||Gn(w)!==w)throw new Wn("`length` must be a positive 32-bit integer");var E=arguments.length>2&&!!arguments[2],C=!0,P=!0;if("length"in _&&qn){var R=qn(_,"length");R&&!R.configurable&&(C=!1),R&&!R.writable&&(P=!1)}return(C||P||!E)&&(zn?Hn(_,"length",w,!0,!0):Hn(_,"length",w)),_},Qn=At,Xn=Ct,Jn=xt,Zn=function applyBind(){return Jn(Qn,Xn,arguments)};!function(_){var w=Kn,E=mt,C=kt,P=Zn;_.exports=function callBind(_){var E=C(arguments),P=_.length-(arguments.length-1);return w(E,1+(P>0?P:0),!0)},E?E(_.exports,"apply",{value:P}):_.exports.apply=P}(kn);var Yn=In,eo=function availableTypedArrays(){for(var _=[],w=0;w<Nn.length;w++)"function"==typeof Dn[Nn[w]]&&(_[_.length]=Nn[w]);return _},to=kn.exports,ro=Ur,no=ft,oo=ro("Object.prototype.toString"),io=Qe(),so="undefined"==typeof globalThis?ze:globalThis,ao=eo(),co=ro("String.prototype.slice"),uo=Object.getPrototypeOf,lo=ro("Array.prototype.indexOf",!0)||function indexOf(_,w){for(var E=0;E<_.length;E+=1)if(_[E]===w)return E;return-1},po={__proto__:null};Yn(ao,io&&no&&uo?function(_){var w=new so[_];if(Symbol.toStringTag in w){var E=uo(w),C=no(E,Symbol.toStringTag);if(!C){var P=uo(E);C=no(P,Symbol.toStringTag)}po["$"+_]=to(C.get)}}:function(_){var w=new so[_],E=w.slice||w.set;E&&(po["$"+_]=to(E))});var fo=function whichTypedArray(_){if(!_||"object"!=typeof _)return!1;if(!io){var w=co(oo(_),8,-1);return lo(ao,w)>-1?w:"Object"===w&&function tryAllSlices(_){var w=!1;return Yn(po,(function(E,C){if(!w)try{E(_),w=co(C,1)}catch(_){}})),w}(_)}return no?function tryAllTypedArrays(_){var w=!1;return Yn(po,(function(E,C){if(!w)try{"$"+E(_)===C&&(w=co(C,1))}catch(_){}})),w}(_):null},ho=fo,go=function isTypedArray(_){return!!ho(_)};!function(_){var w=Kr,E=yn,C=fo,P=go;function uncurryThis(_){return _.call.bind(_)}var R="undefined"!=typeof BigInt,L="undefined"!=typeof Symbol,I=uncurryThis(Object.prototype.toString),k=uncurryThis(Number.prototype.valueOf),F=uncurryThis(String.prototype.valueOf),j=uncurryThis(Boolean.prototype.valueOf);if(R)var $=uncurryThis(BigInt.prototype.valueOf);if(L)var V=uncurryThis(Symbol.prototype.valueOf);function checkBoxedPrimitive(_,w){if("object"!=typeof _)return!1;try{return w(_),!0}catch(_){return!1}}function isMapToString(_){return"[object Map]"===I(_)}function isSetToString(_){return"[object Set]"===I(_)}function isWeakMapToString(_){return"[object WeakMap]"===I(_)}function isWeakSetToString(_){return"[object WeakSet]"===I(_)}function isArrayBufferToString(_){return"[object ArrayBuffer]"===I(_)}function isArrayBuffer(_){return"undefined"!=typeof ArrayBuffer&&(isArrayBufferToString.working?isArrayBufferToString(_):_ instanceof ArrayBuffer)}function isDataViewToString(_){return"[object DataView]"===I(_)}function isDataView(_){return"undefined"!=typeof DataView&&(isDataViewToString.working?isDataViewToString(_):_ instanceof DataView)}_.isArgumentsObject=w,_.isGeneratorFunction=E,_.isTypedArray=P,_.isPromise=function isPromise(_){return"undefined"!=typeof Promise&&_ instanceof Promise||null!==_&&"object"==typeof _&&"function"==typeof _.then&&"function"==typeof _.catch},_.isArrayBufferView=function isArrayBufferView(_){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(_):P(_)||isDataView(_)},_.isUint8Array=function isUint8Array(_){return"Uint8Array"===C(_)},_.isUint8ClampedArray=function isUint8ClampedArray(_){return"Uint8ClampedArray"===C(_)},_.isUint16Array=function isUint16Array(_){return"Uint16Array"===C(_)},_.isUint32Array=function isUint32Array(_){return"Uint32Array"===C(_)},_.isInt8Array=function isInt8Array(_){return"Int8Array"===C(_)},_.isInt16Array=function isInt16Array(_){return"Int16Array"===C(_)},_.isInt32Array=function isInt32Array(_){return"Int32Array"===C(_)},_.isFloat32Array=function isFloat32Array(_){return"Float32Array"===C(_)},_.isFloat64Array=function isFloat64Array(_){return"Float64Array"===C(_)},_.isBigInt64Array=function isBigInt64Array(_){return"BigInt64Array"===C(_)},_.isBigUint64Array=function isBigUint64Array(_){return"BigUint64Array"===C(_)},isMapToString.working="undefined"!=typeof Map&&isMapToString(new Map),_.isMap=function isMap(_){return"undefined"!=typeof Map&&(isMapToString.working?isMapToString(_):_ instanceof Map)},isSetToString.working="undefined"!=typeof Set&&isSetToString(new Set),_.isSet=function isSet(_){return"undefined"!=typeof Set&&(isSetToString.working?isSetToString(_):_ instanceof Set)},isWeakMapToString.working="undefined"!=typeof WeakMap&&isWeakMapToString(new WeakMap),_.isWeakMap=function isWeakMap(_){return"undefined"!=typeof WeakMap&&(isWeakMapToString.working?isWeakMapToString(_):_ instanceof WeakMap)},isWeakSetToString.working="undefined"!=typeof WeakSet&&isWeakSetToString(new WeakSet),_.isWeakSet=function isWeakSet(_){return isWeakSetToString(_)},isArrayBufferToString.working="undefined"!=typeof ArrayBuffer&&isArrayBufferToString(new ArrayBuffer),_.isArrayBuffer=isArrayBuffer,isDataViewToString.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&isDataViewToString(new DataView(new ArrayBuffer(1),0,1)),_.isDataView=isDataView;var H="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function isSharedArrayBufferToString(_){return"[object SharedArrayBuffer]"===I(_)}function isSharedArrayBuffer(_){return void 0!==H&&(void 0===isSharedArrayBufferToString.working&&(isSharedArrayBufferToString.working=isSharedArrayBufferToString(new H)),isSharedArrayBufferToString.working?isSharedArrayBufferToString(_):_ instanceof H)}function isNumberObject(_){return checkBoxedPrimitive(_,k)}function isStringObject(_){return checkBoxedPrimitive(_,F)}function isBooleanObject(_){return checkBoxedPrimitive(_,j)}function isBigIntObject(_){return R&&checkBoxedPrimitive(_,$)}function isSymbolObject(_){return L&&checkBoxedPrimitive(_,V)}_.isSharedArrayBuffer=isSharedArrayBuffer,_.isAsyncFunction=function isAsyncFunction(_){return"[object AsyncFunction]"===I(_)},_.isMapIterator=function isMapIterator(_){return"[object Map Iterator]"===I(_)},_.isSetIterator=function isSetIterator(_){return"[object Set Iterator]"===I(_)},_.isGeneratorObject=function isGeneratorObject(_){return"[object Generator]"===I(_)},_.isWebAssemblyCompiledModule=function isWebAssemblyCompiledModule(_){return"[object WebAssembly.Module]"===I(_)},_.isNumberObject=isNumberObject,_.isStringObject=isStringObject,_.isBooleanObject=isBooleanObject,_.isBigIntObject=isBigIntObject,_.isSymbolObject=isSymbolObject,_.isBoxedPrimitive=function isBoxedPrimitive(_){return isNumberObject(_)||isStringObject(_)||isBooleanObject(_)||isBigIntObject(_)||isSymbolObject(_)},_.isAnyArrayBuffer=function isAnyArrayBuffer(_){return"undefined"!=typeof Uint8Array&&(isArrayBuffer(_)||isSharedArrayBuffer(_))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(w){Object.defineProperty(_,w,{enumerable:!1,value:function(){throw new Error(w+" is not supported in userland")}})}))}(We);var mo,yo=function isBuffer(_){return _ instanceof Buffer},bo={exports:{}},_o={exports:{}};"function"==typeof Object.create?_o.exports=function inherits(_,w){w&&(_.super_=w,_.prototype=Object.create(w.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:_o.exports=function inherits(_,w){if(w){_.super_=w;var TempCtor=function(){};TempCtor.prototype=w.prototype,_.prototype=new TempCtor,_.prototype.constructor=_}};try{var vo=require("util");if("function"!=typeof vo.inherits)throw"";bo.exports=vo.inherits}catch(e){bo.exports=_o.exports}!function(_){var w=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(_){for(var w=Object.keys(_),E={},C=0;C<w.length;C++)E[w[C]]=Object.getOwnPropertyDescriptor(_,w[C]);return E},E=/%[sdj%]/g;_.format=function(_){if(!isString(_)){for(var w=[],C=0;C<arguments.length;C++)w.push(inspect(arguments[C]));return w.join(" ")}C=1;for(var P=arguments,R=P.length,L=String(_).replace(E,(function(_){if("%%"===_)return"%";if(C>=R)return _;switch(_){case"%s":return String(P[C++]);case"%d":return Number(P[C++]);case"%j":try{return JSON.stringify(P[C++])}catch(_){return"[Circular]"}default:return _}})),I=P[C];C<R;I=P[++C])isNull(I)||!isObject(I)?L+=" "+I:L+=" "+inspect(I);return L},_.deprecate=function(w,E){if("undefined"!=typeof process&&!0===process.noDeprecation)return w;if("undefined"==typeof process)return function(){return _.deprecate(w,E).apply(this,arguments)};var C=!1;return function deprecated(){if(!C){if(process.throwDeprecation)throw new Error(E);process.traceDeprecation?console.trace(E):console.error(E),C=!0}return w.apply(this,arguments)}};var C={},P=/^$/;if(process.env.NODE_DEBUG){var R=process.env.NODE_DEBUG;R=R.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),P=new RegExp("^"+R+"$","i")}function inspect(w,E){var C={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(C.depth=arguments[2]),arguments.length>=4&&(C.colors=arguments[3]),isBoolean(E)?C.showHidden=E:E&&_._extend(C,E),isUndefined(C.showHidden)&&(C.showHidden=!1),isUndefined(C.depth)&&(C.depth=2),isUndefined(C.colors)&&(C.colors=!1),isUndefined(C.customInspect)&&(C.customInspect=!0),C.colors&&(C.stylize=stylizeWithColor),formatValue(C,w,C.depth)}function stylizeWithColor(_,w){var E=inspect.styles[w];return E?"["+inspect.colors[E][0]+"m"+_+"["+inspect.colors[E][1]+"m":_}function stylizeNoColor(_,w){return _}function formatValue(w,E,C){if(w.customInspect&&E&&isFunction(E.inspect)&&E.inspect!==_.inspect&&(!E.constructor||E.constructor.prototype!==E)){var P=E.inspect(C,w);return isString(P)||(P=formatValue(w,P,C)),P}var R=function formatPrimitive(_,w){if(isUndefined(w))return _.stylize("undefined","undefined");if(isString(w)){var E="'"+JSON.stringify(w).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return _.stylize(E,"string")}if(isNumber(w))return _.stylize(""+w,"number");if(isBoolean(w))return _.stylize(""+w,"boolean");if(isNull(w))return _.stylize("null","null")}(w,E);if(R)return R;var L=Object.keys(E),I=function arrayToHash(_){var w={};return _.forEach((function(_,E){w[_]=!0})),w}(L);if(w.showHidden&&(L=Object.getOwnPropertyNames(E)),isError(E)&&(L.indexOf("message")>=0||L.indexOf("description")>=0))return formatError(E);if(0===L.length){if(isFunction(E)){var k=E.name?": "+E.name:"";return w.stylize("[Function"+k+"]","special")}if(isRegExp(E))return w.stylize(RegExp.prototype.toString.call(E),"regexp");if(isDate(E))return w.stylize(Date.prototype.toString.call(E),"date");if(isError(E))return formatError(E)}var F,j="",$=!1,V=["{","}"];(isArray(E)&&($=!0,V=["[","]"]),isFunction(E))&&(j=" [Function"+(E.name?": "+E.name:"")+"]");return isRegExp(E)&&(j=" "+RegExp.prototype.toString.call(E)),isDate(E)&&(j=" "+Date.prototype.toUTCString.call(E)),isError(E)&&(j=" "+formatError(E)),0!==L.length||$&&0!=E.length?C<0?isRegExp(E)?w.stylize(RegExp.prototype.toString.call(E),"regexp"):w.stylize("[Object]","special"):(w.seen.push(E),F=$?function formatArray(_,w,E,C,P){for(var R=[],L=0,I=w.length;L<I;++L)hasOwnProperty(w,String(L))?R.push(formatProperty(_,w,E,C,String(L),!0)):R.push("");return P.forEach((function(P){P.match(/^\d+$/)||R.push(formatProperty(_,w,E,C,P,!0))})),R}(w,E,C,I,L):L.map((function(_){return formatProperty(w,E,C,I,_,$)})),w.seen.pop(),function reduceToSingleString(_,w,E){var C=_.reduce((function(_,w){return w.indexOf("\n"),_+w.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(C>60)return E[0]+(""===w?"":w+"\n ")+" "+_.join(",\n ")+" "+E[1];return E[0]+w+" "+_.join(", ")+" "+E[1]}(F,j,V)):V[0]+j+V[1]}function formatError(_){return"["+Error.prototype.toString.call(_)+"]"}function formatProperty(_,w,E,C,P,R){var L,I,k;if((k=Object.getOwnPropertyDescriptor(w,P)||{value:w[P]}).get?I=k.set?_.stylize("[Getter/Setter]","special"):_.stylize("[Getter]","special"):k.set&&(I=_.stylize("[Setter]","special")),hasOwnProperty(C,P)||(L="["+P+"]"),I||(_.seen.indexOf(k.value)<0?(I=isNull(E)?formatValue(_,k.value,null):formatValue(_,k.value,E-1)).indexOf("\n")>-1&&(I=R?I.split("\n").map((function(_){return" "+_})).join("\n").slice(2):"\n"+I.split("\n").map((function(_){return" "+_})).join("\n")):I=_.stylize("[Circular]","special")),isUndefined(L)){if(R&&P.match(/^\d+$/))return I;(L=JSON.stringify(""+P)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(L=L.slice(1,-1),L=_.stylize(L,"name")):(L=L.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),L=_.stylize(L,"string"))}return L+": "+I}function isArray(_){return Array.isArray(_)}function isBoolean(_){return"boolean"==typeof _}function isNull(_){return null===_}function isNumber(_){return"number"==typeof _}function isString(_){return"string"==typeof _}function isUndefined(_){return void 0===_}function isRegExp(_){return isObject(_)&&"[object RegExp]"===objectToString(_)}function isObject(_){return"object"==typeof _&&null!==_}function isDate(_){return isObject(_)&&"[object Date]"===objectToString(_)}function isError(_){return isObject(_)&&("[object Error]"===objectToString(_)||_ instanceof Error)}function isFunction(_){return"function"==typeof _}function objectToString(_){return Object.prototype.toString.call(_)}function pad(_){return _<10?"0"+_.toString(10):_.toString(10)}_.debuglog=function(w){if(w=w.toUpperCase(),!C[w])if(P.test(w)){var E=process.pid;C[w]=function(){var C=_.format.apply(_,arguments);console.error("%s %d: %s",w,E,C)}}else C[w]=function(){};return C[w]},_.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},_.types=We,_.isArray=isArray,_.isBoolean=isBoolean,_.isNull=isNull,_.isNullOrUndefined=function isNullOrUndefined(_){return null==_},_.isNumber=isNumber,_.isString=isString,_.isSymbol=function isSymbol(_){return"symbol"==typeof _},_.isUndefined=isUndefined,_.isRegExp=isRegExp,_.types.isRegExp=isRegExp,_.isObject=isObject,_.isDate=isDate,_.types.isDate=isDate,_.isError=isError,_.types.isNativeError=isError,_.isFunction=isFunction,_.isPrimitive=function isPrimitive(_){return null===_||"boolean"==typeof _||"number"==typeof _||"string"==typeof _||"symbol"==typeof _||void 0===_},_.isBuffer=yo;var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function hasOwnProperty(_,w){return Object.prototype.hasOwnProperty.call(_,w)}_.log=function(){console.log("%s - %s",function timestamp(){var _=new Date,w=[pad(_.getHours()),pad(_.getMinutes()),pad(_.getSeconds())].join(":");return[_.getDate(),L[_.getMonth()],w].join(" ")}(),_.format.apply(_,arguments))},_.inherits=bo.exports,_._extend=function(_,w){if(!w||!isObject(w))return _;for(var E=Object.keys(w),C=E.length;C--;)_[E[C]]=w[E[C]];return _};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function callbackifyOnRejected(_,w){if(!_){var E=new Error("Promise was rejected with a falsy value");E.reason=_,_=E}return w(_)}_.promisify=function promisify(_){if("function"!=typeof _)throw new TypeError('The "original" argument must be of type Function');if(I&&_[I]){var E;if("function"!=typeof(E=_[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(E,I,{value:E,enumerable:!1,writable:!1,configurable:!0}),E}function E(){for(var w,E,C=new Promise((function(_,C){w=_,E=C})),P=[],R=0;R<arguments.length;R++)P.push(arguments[R]);P.push((function(_,C){_?E(_):w(C)}));try{_.apply(this,P)}catch(_){E(_)}return C}return Object.setPrototypeOf(E,Object.getPrototypeOf(_)),I&&Object.defineProperty(E,I,{value:E,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(E,w(_))},_.promisify.custom=I,_.callbackify=function callbackify(_){if("function"!=typeof _)throw new TypeError('The "original" argument must be of type Function');function callbackified(){for(var w=[],E=0;E<arguments.length;E++)w.push(arguments[E]);var C=w.pop();if("function"!=typeof C)throw new TypeError("The last argument must be of type Function");var P=this,cb=function(){return C.apply(P,arguments)};_.apply(this,w).then((function(_){process.nextTick(cb.bind(null,null,_))}),(function(_){process.nextTick(callbackifyOnRejected.bind(null,_,cb))}))}return Object.setPrototypeOf(callbackified,Object.getPrototypeOf(_)),Object.defineProperties(callbackified,w(_)),callbackified}}(qe),function(_){_[_.SUCCESS=0]="SUCCESS",_[_.FAILED=1]="FAILED"}(mo||(mo={}));class CompositePropagator{constructor(_={}){this._propagators=_.propagators??[];const w=new Set;for(const _ of this._propagators){const E="function"==typeof _.fields?_.fields():[];for(const _ of E)w.add(_)}this._fields=Array.from(w)}inject(_,w,E){for(const C of this._propagators)try{C.inject(_,w,E)}catch(_){Ie.warn(`Failed to inject with ${C.constructor.name}. Err: ${_.message}`)}}extract(_,w,E){return this._propagators.reduce(((_,C)=>{try{return C.extract(_,w,E)}catch(_){Ie.warn(`Failed to extract with ${C.constructor.name}. Err: ${_.message}`)}return _}),_)}fields(){return this._fields.slice()}}const So="[_0-9a-z-*/]",wo=new RegExp(`^(?:${`[a-z]${So}{0,255}`}|${`[a-z0-9]${So}{0,240}@[a-z]${So}{0,13}`})$`),Eo=/^[ -~]{0,255}[!-~]$/,To=/,|=/;function validateKey(_){return wo.test(_)}function validateValue(_){return Eo.test(_)&&!To.test(_)}class TraceState{constructor(_){this._rawTraceState="string"==typeof _?_:"",this._length=this._rawTraceState.length}set(_,w){if(!validateKey(_)||!validateValue(w))return this;const E=this._getState(),C=E.get(_);let P=this._length;if(P+="string"==typeof C?w.length-C.length:_.length+w.length+(E.size>0?2:1),P>512)return this;const R=new Map(E);return R.delete(_),R.set(_,w),this._fromState(R,P)}unset(_){const w=this._getState(),E=w.get(_);if("string"!=typeof E)return this;let C=this._length-(_.length+E.length+1);w.size>1&&(C-=1);const P=new Map(w);return P.delete(_),this._fromState(P,C)}get(_){return this._getState().get(_)}serialize(){let _="",w=0;for(const E of this._getState())w>0&&(_=","+_),_=`${E[0]}=${E[1]}`+_,w++;return _}_getState(){if(this._internalState)return this._internalState;const _=this._rawTraceState.split(","),w=new Map;let E=0;for(const C of _){const _=C.trim(),P=_.indexOf("=");if(-1===P)continue;const R=_.slice(0,P),L=_.slice(P+1);if(!validateKey(R)||!validateValue(L))continue;const I=E+_.length+(w.size>0?1:0);if(!(I>512)&&(w.set(R,L),E=I,w.size>=32))break}return this._length=E,this._internalState=new Map(Array.from(w.entries()).reverse()),this._internalState}_fromState(_,w){const E=Object.create(TraceState.prototype);return E._internalState=_,E._length=w,E}}const Ao="traceparent",Oo="tracestate",Co=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class W3CTraceContextPropagator{inject(_,w,E){const C=Ue.getSpanContext(_);if(!C||isTracingSuppressed$1(_)||!isSpanContextValid(C))return;const P=`00-${C.traceId}-${C.spanId}-0${Number(C.traceFlags||_e.NONE).toString(16)}`;E.set(w,Ao,P),C.traceState&&E.set(w,Oo,C.traceState.serialize())}extract(_,w,E){const C=E.get(w,Ao);if(!C)return _;const P=Array.isArray(C)?C[0]:C;if("string"!=typeof P)return _;const R=function parseTraceParent(_){const w=Co.exec(_);return w?"00"===w[1]&&w[5]?null:{traceId:w[2],spanId:w[3],traceFlags:parseInt(w[4],16)}:null}(P);if(!R)return _;R.isRemote=!0;const L=E.get(w,Oo);if(L){const _=Array.isArray(L)?L.join(","):L;R.traceState=new TraceState("string"==typeof _?_:void 0)}return Ue.setSpanContext(_,R)}fields(){return[Ao,Oo]}}const Po={},Ro=createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function parseKeyPairsIntoRecord(_){const w={};return"string"==typeof _&&_.length>0&&_.split(",").forEach((_=>{const E=function parsePairKeyValue(_){if(!_)return;const w=_.indexOf(";"),E=-1===w?_:_.substring(0,w),C=E.indexOf("=");if(C<=0)return;const P=E.substring(0,C).trim(),R=E.substring(C+1).trim();if(!P||!R)return;let L,I,k;try{L=decodeURIComponent(P),I=decodeURIComponent(R)}catch{return}-1!==w&&w<_.length-1&&(k=baggageEntryMetadataFromString(_.substring(w+1)));return{key:L,value:I,metadata:k}}(_);void 0!==E&&E.value.length>0&&(w[E.key]=E.value)})),w}let xo=function loggingErrorHandler$1(){return _=>{Ie.error(function stringifyException$1(_){return"string"==typeof _?_:JSON.stringify(function flattenException$1(_){const w={};let E=_;for(;null!==E;)Object.getOwnPropertyNames(E).forEach((_=>{if(w[_])return;const C=E[_];C&&(w[_]=String(C))})),E=Object.getPrototypeOf(E);return w}(_))}(_))}}();function globalErrorHandler$1(_){try{xo(_)}catch{}}function getStringFromEnv$1(_){const w=process.env[_];if(null!=w&&""!==w.trim())return w}function getStringListFromEnv(_){return getStringFromEnv$1(_)?.split(",").map((_=>_.trim())).filter((_=>""!==_))}const Lo="error.type",Io="exception.message",No="exception.stacktrace",Do="exception.type",ko="http.request.method",Fo="http.request.method_original",jo="http.response.status_code",Mo="server.address",$o="server.port",Bo="service.name",Uo="telemetry.sdk.language",Vo="nodejs",Ho="telemetry.sdk.name",zo="telemetry.sdk.version",qo="url.full",Wo="process.runtime.name",Go={[Ho]:"opentelemetry",[Wo]:"node",[Uo]:Vo,[zo]:"2.9.0"},Ko=performance,Qo=Math.pow(10,6),Xo=Math.pow(10,9);function millisToHrTime$1(_){const w=_/1e3;return[Math.trunc(w),Math.round(_%1e3*Qo)]}function hrTime$1(_){return function addHrTimes$1(_,w){const E=[_[0]+w[0],_[1]+w[1]];E[1]>=Xo&&(E[1]-=Xo,E[0]+=1);return E}(millisToHrTime$1(Ko.timeOrigin),millisToHrTime$1("number"==typeof _?_:Ko.now()))}function timeInputToHrTime(_){if(function isTimeInputHrTime$1(_){return Array.isArray(_)&&2===_.length&&"number"==typeof _[0]&&"number"==typeof _[1]}(_))return _;if("number"==typeof _)return _<Ko.timeOrigin/2?hrTime$1(_):millisToHrTime$1(_);if(_ instanceof Date)return millisToHrTime$1(_.getTime());throw TypeError("Invalid input type")}function hrTimeToNanoseconds(_){return _[0]*Xo+_[1]}var Jo;!function(_){_[_.SUCCESS=0]="SUCCESS",_[_.FAILED=1]="FAILED"}(Jo||(Jo={}));class TimeoutError extends Error{constructor(_){super(_),Object.setPrototypeOf(this,TimeoutError.prototype)}}function urlMatches(_,w){return"string"==typeof w?_===w:!!_.match(w)}function isUrlIgnored(_,w){if(!w)return!1;for(const E of w)if(urlMatches(_,E))return!0;return!1}let Zo,Yo=class Deferred{constructor(){this._promise=new Promise(((_,w)=>{this._resolve=_,this._reject=w}))}get promise(){return this._promise}resolve(_){this._resolve(_)}reject(_){this._reject(_)}},ei=class BindOnceFuture{constructor(_,w){this._isCalled=!1,this._deferred=new Yo,this._callback=_,this._that=w}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(..._){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,..._)).then((_=>this._deferred.resolve(_)),(_=>this._deferred.reject(_)))}catch(_){this._deferred.reject(_)}}return this._deferred.promise}};function defaultServiceName$1(){if(void 0===Zo)try{const _=globalThis.process.argv0;Zo=_?`unknown_service:${_}`:"unknown_service"}catch{Zo="unknown_service"}return Zo}const isPromiseLike$2=_=>null!==_&&"object"==typeof _&&"function"==typeof _.then;let ti=class ResourceImpl{static FromAttributeList(_,w){const E=new ResourceImpl({},w);return E._rawAttributes=guardedRawAttributes$2(_),E._asyncAttributesPending=_.filter((([_,w])=>isPromiseLike$2(w))).length>0,E}constructor(_,w){this._asyncAttributesPending=!1;const E=_.attributes??{};this._rawAttributes=Object.entries(E).map((([_,w])=>(isPromiseLike$2(w)&&(this._asyncAttributesPending=!0),[_,w]))),this._rawAttributes=guardedRawAttributes$2(this._rawAttributes),this._schemaUrl=function validateSchemaUrl$2(_){if("string"==typeof _||void 0===_)return _;return void Ie.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",_)}(w?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let _=0;_<this._rawAttributes.length;_++){const[w,E]=this._rawAttributes[_];this._rawAttributes[_]=[w,isPromiseLike$2(E)?await E:E]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Ie.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const _={};for(const[w,E]of this._rawAttributes)isPromiseLike$2(E)?Ie.debug(`Unsettled resource attribute ${w} skipped`):null!=E&&(_[w]??(_[w]=E));return this._asyncAttributesPending||(this._memoizedAttributes=_),_}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(_){if(null==_)return this;const w=function mergeSchemaUrl$2(_,w){const E=_?.schemaUrl,C=w?.schemaUrl,P=void 0===E||""===E,R=void 0===C||""===C;if(P)return C;if(R)return E;if(E===C)return E;return void Ie.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',E,C)}(this,_),E=w?{schemaUrl:w}:void 0;return ResourceImpl.FromAttributeList([..._.getRawAttributes(),...this.getRawAttributes()],E)}};function defaultResource$1(){return function resourceFromAttributes$2(_,w){return ti.FromAttributeList(Object.entries(_),w)}({[Bo]:defaultServiceName$1(),[Uo]:Go[Uo],[Ho]:Go[Ho],[zo]:Go[zo]})}function guardedRawAttributes$2(_){return _.map((([_,w])=>isPromiseLike$2(w)?[_,w.catch((w=>{Ie.debug("promise rejection for resource attribute: %s - %s",_,w)}))]:[_,w]))}function isLogAttributeValue(_){return isLogAttributeValueInternal(_,new WeakSet)}function isLogAttributeValueInternal(_,w){if(null==_)return!0;if("string"==typeof _||"number"==typeof _||"boolean"==typeof _)return!0;if(_ instanceof Uint8Array)return!0;if("object"==typeof _){if(w.has(_))return!1;if(w.add(_),Array.isArray(_)){for(const E of _)if(!isLogAttributeValueInternal(E,w))return!1;return!0}const E=_;if(E.constructor!==Object&&void 0!==E.constructor)return!1;for(const _ in E)if(Object.prototype.hasOwnProperty.call(E,_)&&!isLogAttributeValueInternal(E[_],w))return!1;return!0}return!1}var ri;function addAttribute(_,w,E,C,P){if(0===C.length)return Ie.warn(`Invalid attribute key: ${C}`),ri.DROP_INVALID;if(!isLogAttributeValue(P))return Ie.warn(`Invalid attribute value set for key: ${C}`),ri.DROP_INVALID;const R=!Object.prototype.hasOwnProperty.call(_,C);return R&&E>=w.attributeCountLimit?ri.DROP_LIMIT_REACHED:(_[C]=truncateToSize(P,w.attributeValueLengthLimit),R?ri.ADD_NEW:ri.ADD_OVERWRITE_EXISTING)}function truncateToSize(_,w){if(w<=0)return Ie.warn(`Attribute value limit must be positive, got ${w}`),_;if(null==_)return _;if("string"==typeof _)return _.length<=w?_:_.substring(0,w);if(_ instanceof Uint8Array)return _;if(Array.isArray(_))return _.map((_=>truncateToSize(_,w)));if("object"==typeof _){const E={};for(const[C,P]of Object.entries(_))E[C]=truncateToSize(P,w);return E}return _}function normalizeScopeAttributes(_,w){if(null==w)return{};const E={};let C=0,P=0;for(const[R,L]of Object.entries(w)){const w=addAttribute(E,_,C,R,L);w===ri.ADD_NEW?C+=1:(w===ri.DROP_INVALID||w===ri.DROP_LIMIT_REACHED)&&(P+=1)}return{attributes:C>0?E:void 0,droppedAttributesCount:P}}!function(_){_[_.DROP_INVALID=0]="DROP_INVALID",_[_.DROP_LIMIT_REACHED=1]="DROP_LIMIT_REACHED",_[_.ADD_NEW=2]="ADD_NEW",_[_.ADD_OVERWRITE_EXISTING=3]="ADD_OVERWRITE_EXISTING"}(ri||(ri={}));class LogRecordImpl{set severityText(_){this._isLogRecordReadonly()||(this._severityText=_)}get severityText(){return this._severityText}set severityNumber(_){this._isLogRecordReadonly()||(this._severityNumber=_)}get severityNumber(){return this._severityNumber}set body(_){this._isLogRecordReadonly()||(this._body=_)}get body(){return this._body}get eventName(){return this._eventName}set eventName(_){this._isLogRecordReadonly()||(this._eventName=_)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(_,w,E){this.attributes={},this._attributesCount=0,this._droppedAttributesCount=0,this._isReadonly=!1;const{timestamp:C,observedTimestamp:P,eventName:R,severityNumber:L,severityText:I,body:k,attributes:F={},exception:j,context:$}=E,V=Date.now();if(this.hrTime=timeInputToHrTime(C??V),this.hrTimeObserved=timeInputToHrTime(P??V),$){const _=Ue.getSpanContext($);_&&isSpanContextValid(_)&&(this.spanContext=_)}this.severityNumber=L,this.severityText=I,this.body=k,this.resource=_.resource,this.instrumentationScope=w,this._logRecordLimits=_.logRecordLimits,this._eventName=R,this.setAttributes(F),null!=j&&this._setException(j)}setAttribute(_,w){if(this._isLogRecordReadonly())return this;const E=addAttribute(this.attributes,this._logRecordLimits,this._attributesCount,_,w);return 1===E?(this._droppedAttributesCount++,1===this._droppedAttributesCount&&Ie.warn("Dropping extra attributes.")):2===E&&this._attributesCount++,this}setAttributes(_){for(const[w,E]of Object.entries(_))this.setAttribute(w,E);return this}setBody(_){return this.body=_,this}setEventName(_){return this.eventName=_,this}setSeverityNumber(_){return this.severityNumber=_,this}setSeverityText(_){return this.severityText=_,this}_makeReadonly(){this._isReadonly=!0}_setException(_){let w=!1;if("string"==typeof _||"number"==typeof _)Object.hasOwn(this.attributes,Io)||this.setAttribute(Io,String(_)),w=!0;else if(_&&"object"==typeof _){const E=_;E.code?(Object.hasOwn(this.attributes,Do)||this.setAttribute(Do,E.code.toString()),w=!0):E.name&&(Object.hasOwn(this.attributes,Do)||this.setAttribute(Do,E.name),w=!0),E.message&&(Object.hasOwn(this.attributes,Io)||this.setAttribute(Io,E.message),w=!0),E.stack&&(Object.hasOwn(this.attributes,No)||this.setAttribute(No,E.stack),w=!0)}w||Ie.warn(`Failed to record an exception ${_}`)}_isLogRecordReadonly(){return this._isReadonly&&Ie.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class Logger{constructor(_,w){this._instrumentationScope=_,this._sharedState=w,this._loggerConfig=this._sharedState.getLoggerConfig(this._instrumentationScope)}emit(_){const w=_.context||Le.active();if(!this.enabled(_))return;const E=new LogRecordImpl(this._sharedState,this._instrumentationScope,{context:w,..._});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(E,w),E._makeReadonly()}enabled(_){if(this._sharedState.hasShutdown)return!1;const w=this._loggerConfig;if(w.disabled)return!1;const E=_?.severityNumber;if("number"==typeof E&&E!==z.UNSPECIFIED&&E<w.minimumSeverity)return!1;const C=_?.context||Le.active();if(w.traceBased){const _=Ue.getSpanContext(C);if(_&&isSpanContextValid(_)){if(!((_.traceFlags&_e.SAMPLED)===_e.SAMPLED))return!1}}const P={context:C,instrumentationScope:this._instrumentationScope,severityNumber:_?.severityNumber,eventName:_?.eventName};for(const _ of this._sharedState.processors)if(!_.enabled||_.enabled(P))return!0;return!1}}class NoopLogRecordProcessor{forceFlush(){return Promise.resolve()}onEmit(_,w){}shutdown(){return Promise.resolve()}enabled(_){return!1}}class MultiLogRecordProcessor{constructor(_,w){this.processors=_,this.forceFlushTimeoutMillis=w}async forceFlush(){const _=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map((w=>function callWithTimeout(_,w){let E;const C=new Promise((function timeoutFunction(_,C){E=setTimeout((function timeoutHandler(){C(new TimeoutError("Operation timed out."))}),w)}));return Promise.race([_,C]).then((_=>(clearTimeout(E),_)),(_=>{throw clearTimeout(E),_}))}(w.forceFlush(),_))))}onEmit(_,w){this.processors.forEach((E=>E.onEmit(_,w)))}async shutdown(){await Promise.all(this.processors.map((_=>_.shutdown())))}enabled(_){for(const w of this.processors)if(!w.enabled||w.enabled(_))return!0;return!1}}function normalizeAnyValue(_){if(void 0===_)return["u",null];if(null===_)return["n",null];const w=typeof _;return"string"===w?["s",_]:"boolean"===w?["b",_]:"number"===w?Number.isNaN(_)?["nan",null]:_===1/0?["inf",null]:_===-1/0?["-inf",null]:Object.is(_,-0)?["n0",null]:["d",_]:_ instanceof Uint8Array?["bytes",Array.from(_)]:Array.isArray(_)?["arr",_.map(normalizeAnyValue)]:["map",Object.entries(_).sort((([_],[w])=>_.localeCompare(w))).map((([_,w])=>[_,normalizeAnyValue(w)]))]}function getInstrumentationScopeKey(_){return JSON.stringify([_.name,_.version||"",_.schemaUrl||"",normalizeAnyValue(_.attributes),_.droppedAttributesCount??0])}class LoggerMetrics{constructor(_){this.createdLogs=_.createCounter("otel.sdk.log.created",{unit:"{log_record}",description:"The number of logs submitted to enabled SDK Loggers."})}emitLog(){this.createdLogs.add(1)}}const ni={disabled:!1,minimumSeverity:z.UNSPECIFIED,traceBased:!1},DEFAULT_LOGGER_CONFIGURATOR=()=>({...ni});class LoggerProviderSharedState{constructor(_,w,E,C,P,R){this.loggers=new Map,this.registeredLogRecordProcessors=[],this.hasShutdown=!1,this._loggerConfigs=new Map,this.resource=_,this.forceFlushTimeoutMillis=w,this.logRecordLimits=E,this.processors=C,C.length>0?(this.registeredLogRecordProcessors=C,this.activeProcessor=new MultiLogRecordProcessor(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new NoopLogRecordProcessor,this._loggerConfigurator=P??DEFAULT_LOGGER_CONFIGURATOR;const L=R?R.getMeter("@opentelemetry/sdk-logs","0.220.0"):createNoopMeter();this.loggerMetrics=new LoggerMetrics(L)}getLoggerConfig(_){const w=getInstrumentationScopeKey(_);let E=this._loggerConfigs.get(w);return E||(E=this._loggerConfigurator(_),this._loggerConfigs.set(w,E),E)}}class LoggerProvider{constructor(_={}){const w={resource:_.resource??defaultResource$1(),forceFlushTimeoutMillis:_.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:_.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:_.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:_.loggerConfigurator??DEFAULT_LOGGER_CONFIGURATOR,processors:_.processors??[],meterProvider:_.meterProvider};this._sharedState=new LoggerProviderSharedState(w.resource,w.forceFlushTimeoutMillis,w.logRecordLimits,w.processors,w.loggerConfigurator,w.meterProvider),this._shutdownOnce=new ei(this._shutdown,this)}getLogger(_,w,E){if(this._shutdownOnce.isCalled)return Ie.warn("A shutdown LoggerProvider cannot provide a Logger"),function createNoopLogger(){return q}();_||Ie.warn("Logger requested without instrumentation scope name.");const C={name:_||"unknown",version:w,schemaUrl:E?.schemaUrl,...normalizeScopeAttributes(this._sharedState.logRecordLimits,E?.attributes)},P=getInstrumentationScopeKey(C);return this._sharedState.loggers.has(P)||this._sharedState.loggers.set(P,new Logger(C,this._sharedState)),this._sharedState.loggers.get(P)}forceFlush(){return this._shutdownOnce.isCalled?(Ie.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Ie.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.hasShutdown=!0,this._sharedState.activeProcessor.shutdown()}}class ExportOperation{constructor(_,w,E){this._exportScheduledPromise=new Promise((_=>{this._exportScheduledResolve=_})),this._exportCompleted=this._executeExport(_,w,E)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(_,w,E){try{await async function waitForResources(_){const w=[];for(let E=0,C=_.length;E<C;E++){const C=_[E];C.resource.asyncAttributesPending&&C.resource.waitForAsyncAttributes&&w.push(C.resource.waitForAsyncAttributes())}null!=w&&w.length>0&&await Promise.all(w)}(w),await Le.with(function suppressTracing$1(_){return _.setValue(Ro,!0)}(Le.active()),(async()=>this._exportWithTimeout(_,w,E)))}catch(_){globalErrorHandler$1(_),this._exportScheduledResolve()}}async _exportWithTimeout(_,w,E){return new Promise(((C,P)=>{const R=setTimeout((()=>{P(new Error("Timeout"))}),E);_.export(w,(_=>{clearTimeout(R),_.code===Jo.SUCCESS?C():P(_.error??new Error("BatchLogRecordProcessor: log record export failed"))})),this._exportScheduledResolve()}))}}class BatchLogRecordProcessorBase{constructor(_){this._currentExport=null,this._finishedLogRecords=[],this._flushing=!1,this._exporter=_.exporter,this._maxExportBatchSize=_.maxExportBatchSize??512,this._maxQueueSize=_.maxQueueSize??2048,this._scheduledDelayMillis=_.scheduledDelayMillis??1e3,this._exportTimeoutMillis=_.exportTimeoutMillis??3e4,this._shutdownOnce=new ei(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ie.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(_){this._shutdownOnce.isCalled||this._addToBuffer(_)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(_){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(_),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let _=this._finishedLogRecords;this._finishedLogRecords=[],this._clearTimer();const w=this._currentExport;for(null!==w&&(await this._exporter.forceFlush(),await w.exportCompleted,this._currentExport=null);_.length>0;){let w;_.length<=this._maxExportBatchSize?(w=_,_=[]):w=_.splice(0,this._maxExportBatchSize);const E=new ExportOperation(this._exporter,w,this._exportTimeoutMillis);this._currentExport=E;try{await E.exportScheduled,await this._exporter.forceFlush(),await E.exportCompleted}catch(_){globalErrorHandler$1(_)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(0===this._finishedLogRecords.length)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){const _=this._finishedLogRecords;return this._finishedLogRecords=[],_}return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();const _=this._extractBatch();if(null===_)return;const w=new ExportOperation(this._exporter,_,this._exportTimeoutMillis);this._currentExport=w,w.exportCompleted.then((()=>{this._currentExport=null,this._maybeStartTimer()})).catch((_=>{this._currentExport=null,globalErrorHandler$1(_),this._maybeStartTimer()}))}_maybeStartTimer(){this._shutdownOnce.isCalled||this._flushing||0!==this._finishedLogRecords.length&&null===this._currentExport&&(this._finishedLogRecords.length>=this._maxExportBatchSize?this._exportOneBatch():void 0===this._timer&&(this._timer=setTimeout((()=>{this._timer=void 0,this._exportOneBatch()}),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref()))}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class BatchLogRecordProcessor extends BatchLogRecordProcessorBase{onShutdown(){}}const oi="service.name",isPromiseLike$1=_=>null!==_&&"object"==typeof _&&"function"==typeof _.then;let ii=class ResourceImpl{static FromAttributeList(_,w){const E=new ResourceImpl({},w);return E._rawAttributes=guardedRawAttributes$1(_),E._asyncAttributesPending=_.filter((([_,w])=>isPromiseLike$1(w))).length>0,E}constructor(_,w){this._asyncAttributesPending=!1;const E=_.attributes??{};this._rawAttributes=Object.entries(E).map((([_,w])=>(isPromiseLike$1(w)&&(this._asyncAttributesPending=!0),[_,w]))),this._rawAttributes=guardedRawAttributes$1(this._rawAttributes),this._schemaUrl=function validateSchemaUrl$1(_){if("string"==typeof _||void 0===_)return _;return void Ie.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",_)}(w?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let _=0;_<this._rawAttributes.length;_++){const[w,E]=this._rawAttributes[_];this._rawAttributes[_]=[w,isPromiseLike$1(E)?await E:E]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Ie.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const _={};for(const[w,E]of this._rawAttributes)isPromiseLike$1(E)?Ie.debug(`Unsettled resource attribute ${w} skipped`):null!=E&&(_[w]??(_[w]=E));return this._asyncAttributesPending||(this._memoizedAttributes=_),_}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(_){if(null==_)return this;const w=function mergeSchemaUrl$1(_,w){const E=_?.schemaUrl,C=w?.schemaUrl,P=void 0===E||""===E,R=void 0===C||""===C;if(P)return C;if(R)return E;if(E===C)return E;return void Ie.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',E,C)}(this,_),E=w?{schemaUrl:w}:void 0;return ResourceImpl.FromAttributeList([..._.getRawAttributes(),...this.getRawAttributes()],E)}};function resourceFromAttributes$1(_,w){return ii.FromAttributeList(Object.entries(_),w)}function guardedRawAttributes$1(_){return _.map((([_,w])=>isPromiseLike$1(w)?[_,w.catch((w=>{Ie.debug("promise rejection for resource attribute: %s - %s",_,w)}))]:[_,w]))}function estimateVarintSize(_){return _<0?10:_<128?1:_<16384?2:_<2097152?3:_<268435456?4:_<34359738368?5:_<4398046511104?6:_<562949953421312?7:_<72057594037927940?8:9}class ProtobufWriter{constructor(_=65536){this.pos=0,this._buffer=new Uint8Array(_),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(_){const w=this.pos+_;if(w<=this._buffer.length)return;Ie.debug("ProtobufWriter: estimated size was too small, growing buffer.");let E=2*this._buffer.length;for(;E<w;)E*=2;const C=new Uint8Array(E);C.set(this._buffer),this._buffer=C,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){const _=this.pos;return this._ensureCapacity(1),this.pos+=1,_}finishLengthDelimited(_,w){const E=w>>>0,C=estimateVarintSize(E);if(C>1){const w=C-1;this._ensureCapacity(w),this._buffer.copyWithin(_+C,_+1,this.pos),this.pos+=w}let P=_;E<128?this._buffer[P]=E:E<16384?(this._buffer[P++]=127&E|128,this._buffer[P]=E>>>7):E<2097152?(this._buffer[P++]=127&E|128,this._buffer[P++]=E>>>7&127|128,this._buffer[P]=E>>>14):E<268435456?(this._buffer[P++]=127&E|128,this._buffer[P++]=E>>>7&127|128,this._buffer[P++]=E>>>14&127|128,this._buffer[P]=E>>>21):(this._buffer[P++]=127&E|128,this._buffer[P++]=E>>>7&127|128,this._buffer[P++]=E>>>14&127|128,this._buffer[P++]=E>>>21&127|128,this._buffer[P]=E>>>28)}writeSint32(_){this.writeVarint((_<<1^_>>31)>>>0)}writeSfixed64(_){let w,E;if(_>=0)w=_>>>0,E=_/4294967296>>>0;else{const C=Math.abs(_);w=C>>>0,E=C/4294967296>>>0,w=~w>>>0,E=~E>>>0,w=w+1>>>0,0===w&&(E=E+1>>>0)}this.writeFixed64(w,E)}writeVarint(_){if(this._ensureCapacity(estimateVarintSize(_)),_>=0&&_<=4294967295){let w=_>>>0;for(;w>127;)this._buffer[this.pos++]=127&w|128,w>>>=7;this._buffer[this.pos++]=w}else{let w,E;if(_>=0)w=_>>>0,E=_/4294967296>>>0;else{const C=Math.abs(_);w=C>>>0,E=C/4294967296>>>0,w=~w>>>0,E=~E>>>0,w=w+1>>>0,0===w&&(E=E+1>>>0)}for(;E>0||w>127;)this._buffer[this.pos++]=127&w|128,w=(w>>>7|E<<25)>>>0,E>>>=7;this._buffer[this.pos++]=127&w}}writeFixed32(_){this._ensureCapacity(4);const w=_>>>0;this._buffer[this.pos++]=255&w,this._buffer[this.pos++]=w>>>8&255,this._buffer[this.pos++]=w>>>16&255,this._buffer[this.pos++]=w>>>24&255}writeFixed64(_,w){this._ensureCapacity(8);const E=_>>>0,C=w>>>0;this._buffer[this.pos++]=255&E,this._buffer[this.pos++]=E>>>8&255,this._buffer[this.pos++]=E>>>16&255,this._buffer[this.pos++]=E>>>24&255,this._buffer[this.pos++]=255&C,this._buffer[this.pos++]=C>>>8&255,this._buffer[this.pos++]=C>>>16&255,this._buffer[this.pos++]=C>>>24&255}writeBytes(_){this.writeVarint(_.length),this._ensureCapacity(_.length),this._buffer.set(_,this.pos),this.pos+=_.length}writeTag(_,w){this.writeVarint(_<<3|w)}writeDouble(_){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,_,!0),this.pos+=8}writeString(_){let w=!0;const E=_.length;for(let C=0;C<E;C++)if(_.charCodeAt(C)>127){w=!1;break}if(w){this.writeVarint(E),this._ensureCapacity(E);for(let w=0;w<E;w++)this._buffer[this.pos++]=_.charCodeAt(w)}else{const w=this._textEncoder.encode(_);this.writeBytes(w)}}}function intValue(_){return _>=48&&_<=57?_-48:_>=97&&_<=102?_-87:_-55}function hexToBinary(_){const w=new Uint8Array(_.length/2);let E=0;for(let C=0;C<_.length;C+=2){const P=intValue(_.charCodeAt(C)),R=intValue(_.charCodeAt(C+1));w[E++]=P<<4|R}return w}function writeHrTimeAsFixed64(_,w){const E=w[0],C=1e9,P=(65535&E)*C,R=(E/65536>>>0)*C,L=(P>>>0)+(65536*(65535&R)>>>0)+w[1],I=L>>>0,k=Math.floor(P/4294967296)+(R/65536>>>0)+Math.floor(L/4294967296)>>>0;_.writeFixed64(I,k)}function writeAttributes(_,w,E){for(const C in w){if(!Object.prototype.hasOwnProperty.call(w,C))continue;const P=w[C];_.writeTag(E,2);const R=_.startLengthDelimited(),L=_.pos;writeKeyValue(_,C,P),_.finishLengthDelimited(R,_.pos-L)}}function writeKeyValue(_,w,E){_.writeTag(1,2),_.writeString(w),_.writeTag(2,2);const C=_.startLengthDelimited(),P=_.pos;writeAnyValue(_,E),_.finishLengthDelimited(C,_.pos-P)}const si=-0x8000000000000000,ai=2**63;function writeAnyValue(_,w){const E=typeof w;if("string"===E)_.writeTag(1,2),_.writeString(w);else if("boolean"===E)_.writeTag(2,0),_.writeVarint(w?1:0);else if("number"===E){const E=w;Number.isInteger(E)&&E>=si&&E<ai?(_.writeTag(3,0),_.writeVarint(E)):(_.writeTag(4,1),_.writeDouble(E))}else if(w instanceof Uint8Array)_.writeTag(7,2),_.writeBytes(w);else if(Array.isArray(w)){_.writeTag(5,2);const E=_.startLengthDelimited(),C=_.pos;for(const E of w){_.writeTag(1,2);const w=_.startLengthDelimited(),C=_.pos;writeAnyValue(_,E),_.finishLengthDelimited(w,_.pos-C)}_.finishLengthDelimited(E,_.pos-C)}else if("object"===E&&null!=w){_.writeTag(6,2);const E=_.startLengthDelimited(),C=_.pos,P=w;for(const w in P){if(!Object.prototype.hasOwnProperty.call(P,w))continue;const E=P[w];_.writeTag(1,2);const C=_.startLengthDelimited(),R=_.pos;_.writeTag(1,2),_.writeString(w),_.writeTag(2,2);const L=_.startLengthDelimited(),I=_.pos;writeAnyValue(_,E),_.finishLengthDelimited(L,_.pos-I),_.finishLengthDelimited(C,_.pos-R)}_.finishLengthDelimited(E,_.pos-C)}}class ProtobufSizeEstimator{constructor(){this.pos=0}startLengthDelimited(){return this.pos}finishLengthDelimited(_,w){this.pos+=estimateVarintSize(w)}writeVarint(_){this.pos+=estimateVarintSize(_)}writeSint32(_){this.pos+=estimateVarintSize((_<<1^_>>31)>>>0)}writeSfixed64(_){this.pos+=8}writeFixed32(_){this.pos+=4}writeFixed64(_,w){this.pos+=8}writeBytes(_){this.pos+=estimateVarintSize(_.length),this.pos+=_.length}writeTag(_,w){this.writeVarint(_<<3|w)}writeDouble(_){this.pos+=8}writeString(_){const w=function utf8ByteLength(_){const w=_.length;let E=0;for(let C=0;C<w;C++){const w=_.charCodeAt(C);w<128?E+=1:w<2048?E+=2:w<55296||w>=57344?E+=3:(C++,E+=4)}return E}(_);this.pos+=estimateVarintSize(w),this.pos+=w}}class ProtobufReader{constructor(_){this.pos=0,this._buf=_,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){const _=this.readVarint();return{fieldNumber:_>>>3,wireType:7&_}}readVarint(){let _=0,w=0,E=!1;for(;this.pos<this._buf.length;){const C=this._buf[this.pos++];if(_+=(127&C)*Math.pow(2,w),w+=7,!(128&C)){E=!0;break}}if(!E)throw new Error("Truncated buffer: unexpected end of data while reading varint");return _}readBytes(){const _=this.readVarint();if(this.pos+_>this._buf.length)throw new Error(`Truncated buffer: expected ${_} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);const w=this._buf.subarray(this.pos,this.pos+_);return this.pos+=_,w}readString(){return this._textDecoder.decode(this.readBytes())}skip(_){switch(_){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${_}, cannot safely skip`)}}}function buildSpanFlags(_,w){let E=255&_|256;return w&&(E|=512),E}function serializeEvent(_,w){const E=_.startLengthDelimited(),C=_.pos;_.writeTag(1,1),writeHrTimeAsFixed64(_,w.time),_.writeTag(2,2),_.writeString(w.name),w.attributes&&writeAttributes(_,w.attributes,3),_.writeTag(4,0),_.writeVarint(w.droppedAttributesCount||0),_.finishLengthDelimited(E,_.pos-C)}function serializeLink(_,w){const E=_.startLengthDelimited(),C=_.pos,P=w.context;_.writeTag(1,2),_.writeBytes(hexToBinary(P.traceId)),_.writeTag(2,2),_.writeBytes(hexToBinary(P.spanId));const R=P.traceState?.serialize();R&&(_.writeTag(3,2),_.writeString(R)),w.attributes&&writeAttributes(_,w.attributes,4),_.writeTag(5,0),_.writeVarint(w.droppedAttributesCount||0);const L=buildSpanFlags(P.traceFlags,P.isRemote);L&&(_.writeTag(6,5),_.writeFixed32(L)),_.finishLengthDelimited(E,_.pos-C)}function serializeSpan(_,w){const E=_.startLengthDelimited(),C=_.pos,P=w.spanContext();_.writeTag(1,2),_.writeBytes(hexToBinary(P.traceId)),_.writeTag(2,2),_.writeBytes(hexToBinary(P.spanId));const R=P.traceState?.serialize();R&&(_.writeTag(3,2),_.writeString(R)),w.parentSpanContext?.spanId&&(_.writeTag(4,2),_.writeBytes(hexToBinary(w.parentSpanContext.spanId))),_.writeTag(5,2),_.writeString(w.name);const L=null==w.kind?0:w.kind+1;0!==L&&(_.writeTag(6,0),_.writeVarint(L)),_.writeTag(7,1),writeHrTimeAsFixed64(_,w.startTime),_.writeTag(8,1),writeHrTimeAsFixed64(_,w.endTime),w.attributes&&writeAttributes(_,w.attributes,9),_.writeTag(10,0),_.writeVarint(w.droppedAttributesCount);for(const E of w.events)_.writeTag(11,2),serializeEvent(_,E);_.writeTag(12,0),_.writeVarint(w.droppedEventsCount);for(const E of w.links)_.writeTag(13,2),serializeLink(_,E);_.writeTag(14,0),_.writeVarint(w.droppedLinksCount),_.writeTag(15,2),function serializeStatus(_,w){const E=_.startLengthDelimited(),C=_.pos;w.message&&(_.writeTag(2,2),_.writeString(w.message)),_.writeTag(3,0),_.writeVarint(w.code),_.finishLengthDelimited(E,_.pos-C)}(_,w.status);const I=buildSpanFlags(P.traceFlags,w.parentSpanContext?.isRemote);I&&(_.writeTag(16,5),_.writeFixed32(I)),_.finishLengthDelimited(E,_.pos-C)}function serializeScopeSpans(_,w,E){const C=_.startLengthDelimited(),P=_.pos;!function writeInstrumentationScope(_,w,E){_.writeTag(E,2);const C=_.startLengthDelimited(),P=_.pos;_.writeTag(1,2),_.writeString(w.name),w.version&&(_.writeTag(2,2),_.writeString(w.version)),w.attributes&&writeAttributes(_,w.attributes,3),w.droppedAttributesCount&&(_.writeTag(4,0),_.writeVarint(w.droppedAttributesCount)),_.finishLengthDelimited(C,_.pos-P)}(_,w,1);for(const w of E)_.writeTag(2,2),serializeSpan(_,w);w.schemaUrl&&(_.writeTag(3,2),_.writeString(w.schemaUrl)),_.finishLengthDelimited(C,_.pos-P)}function serializeResourceSpans(_,w,E){const C=_.startLengthDelimited(),P=_.pos;!function writeResource(_,w,E){_.writeTag(E,2);const C=_.startLengthDelimited(),P=_.pos;w.attributes&&writeAttributes(_,w.attributes,1),_.writeTag(2,0),_.writeVarint(0),_.finishLengthDelimited(C,_.pos-P)}(_,w,1);for(const w of E.values()){_.writeTag(2,2);serializeScopeSpans(_,w[0].instrumentationScope,w)}w.schemaUrl&&(_.writeTag(3,2),_.writeString(w.schemaUrl)),_.finishLengthDelimited(C,_.pos-P)}function serializeTraceExportRequest(_){const w=function createResourceMap$2(_){const w=new Map;for(const E of _){const _=E.resource,C=E.instrumentationScope;let P=w.get(_);P||(P=new Map,w.set(_,P));let R=P.get(C);R||(R=[],P.set(C,R)),R.push(E)}return w}(_),E=new ProtobufSizeEstimator;for(const[_,C]of w)E.writeTag(1,2),serializeResourceSpans(E,_,C);const C=new ProtobufWriter(E.pos);for(const[_,E]of w)C.writeTag(1,2),serializeResourceSpans(C,_,E);return C.finish()}function deserializePartialSuccess(_){const w=new ProtobufReader(_),E={};for(;!w.isAtEnd();){const{fieldNumber:_,wireType:C}=w.readTag();switch(_){case 1:0===C?E.rejectedSpans=w.readVarint():w.skip(C);break;case 2:2===C?E.errorMessage=w.readString():w.skip(C);break;default:w.skip(C)}}return E}const ci={serializeRequest:_=>serializeTraceExportRequest(_),deserializeResponse:_=>function deserializeExportTraceServiceResponse(_){const w=new ProtobufReader(_),E={};for(;!w.isAtEnd();){const{fieldNumber:_,wireType:C}=w.readTag();1===_&&2===C?E.partialSuccess=deserializePartialSuccess(w.readBytes()):w.skip(C)}return E}(_)};function createResource(_,w){const E={attributes:toAttributes(_.attributes,w),droppedAttributesCount:0},C=_.schemaUrl;return C&&""!==C&&(E.schemaUrl=C),E}function createInstrumentationScope(_,w){const E={name:_.name,version:_.version};return _.attributes&&Object.keys(_.attributes).length>0&&(E.attributes=toAttributes(_.attributes,w),E.droppedAttributesCount=_.droppedAttributesCount??0),E}function toAttributes(_,w){return Object.keys(_).map((E=>function toKeyValue(_,w,E){return{key:_,value:toAnyValue(w,E)}}(E,_[E],w)))}function toAnyValue(_,w){const E=typeof _;if("string"===E)return{stringValue:_};if("number"===E)return Number.isInteger(_)?{intValue:_}:{doubleValue:_};if("boolean"===E)return{boolValue:_};if(_ instanceof Uint8Array)return{bytesValue:w.encodeUint8Array(_)};if(Array.isArray(_)){const E=new Array(_.length);for(let C=0;C<_.length;C++)E[C]=toAnyValue(_[C],w);return{arrayValue:{values:E}}}if("object"===E&&null!=_){const E=Object.keys(_),C=new Array(E.length);for(let P=0;P<E.length;P++)C[P]={key:E[P],value:toAnyValue(_[E[P]],w)};return{kvlistValue:{values:C}}}return{}}function logRecordsToResourceLogs(_,w){const E=function createResourceMap$1(_){const w=new Map;for(const E of _){const{resource:_,instrumentationScope:C}=E;let P=w.get(_);P||(P=new Map,w.set(_,P));let R=P.get(C);R||(R=[],P.set(C,R)),R.push(E)}return w}(_);return Array.from(E,(([_,E])=>{const C=createResource(_,w);return{resource:C,scopeLogs:Array.from(E,(([,_])=>({scope:createInstrumentationScope(_[0].instrumentationScope,w),logRecords:_.map((_=>function toLogRecord(_,w){return{timeUnixNano:w.encodeHrTime(_.hrTime),observedTimeUnixNano:w.encodeHrTime(_.hrTimeObserved),severityNumber:_.severityNumber,severityText:_.severityText,body:toAnyValue(_.body,w),eventName:_.eventName,attributes:toAttributes(_.attributes,w),droppedAttributesCount:_.droppedAttributesCount,flags:_.spanContext?.traceFlags,traceId:w.encodeOptionalSpanContext(_.spanContext?.traceId),spanId:w.encodeOptionalSpanContext(_.spanContext?.spanId)}}(_,w))),schemaUrl:_[0].instrumentationScope.schemaUrl}))),schemaUrl:C.schemaUrl}}))}const ui="undefined"!=typeof BigInt?function encodeAsString(_){const w=function hrTimeToNanos(_){const w=BigInt(1e9);return BigInt(Math.trunc(_[0]))*w+BigInt(Math.trunc(_[1]))}(_);return w.toString()}:hrTimeToNanoseconds;function identity(_){return _}const li={encodeHrTime:ui,encodeSpanContext:identity,encodeOptionalSpanContext:identity,encodeUint8Array:_=>{if("undefined"!=typeof Buffer)return Buffer.from(_).toString("base64");const w=new Array(_.length);for(let E=0;E<_.length;E++)w[E]=String.fromCharCode(_[E]);return btoa(w.join(""))}},pi={serializeRequest:_=>{const w=function createExportLogsServiceRequest(_,w){return{resourceLogs:logRecordsToResourceLogs(_,w)}}(_,li);return(new TextEncoder).encode(JSON.stringify(w))},deserializeResponse:_=>{if(0===_.length)return{};const w=new TextDecoder;try{return JSON.parse(w.decode(_))}catch(_){return Ie.warn(`Failed to parse logs export response: ${_.message}. Returning empty response`),{}}}};function buildSpanFlagsFrom(_,w){let E=255&_|256;return w&&(E|=512),E}function sdkSpanToOtlpSpan(_,w){const E=_.spanContext(),C=_.status,P=_.parentSpanContext?.spanId?w.encodeSpanContext(_.parentSpanContext?.spanId):void 0;return{traceId:w.encodeSpanContext(E.traceId),spanId:w.encodeSpanContext(E.spanId),parentSpanId:P,traceState:E.traceState?.serialize(),name:_.name,kind:null==_.kind?0:_.kind+1,startTimeUnixNano:w.encodeHrTime(_.startTime),endTimeUnixNano:w.encodeHrTime(_.endTime),attributes:toAttributes(_.attributes,w),droppedAttributesCount:_.droppedAttributesCount,events:_.events.map((_=>function toOtlpSpanEvent(_,w){return{attributes:_.attributes?toAttributes(_.attributes,w):[],name:_.name,timeUnixNano:w.encodeHrTime(_.time),droppedAttributesCount:_.droppedAttributesCount||0}}(_,w))),droppedEventsCount:_.droppedEventsCount,status:{code:C.code,message:C.message},links:_.links.map((_=>function toOtlpLink(_,w){return{attributes:_.attributes?toAttributes(_.attributes,w):[],spanId:w.encodeSpanContext(_.context.spanId),traceId:w.encodeSpanContext(_.context.traceId),traceState:_.context.traceState?.serialize(),droppedAttributesCount:_.droppedAttributesCount||0,flags:buildSpanFlagsFrom(_.context.traceFlags,_.context.isRemote)}}(_,w))),droppedLinksCount:_.droppedLinksCount,flags:buildSpanFlagsFrom(E.traceFlags,_.parentSpanContext?.isRemote)}}function spanRecordsToResourceSpans(_,w){const E=function createResourceMap(_){const w=new Map;for(const E of _){let _=w.get(E.resource);_||(_=new Map,w.set(E.resource,_));const C=`${E.instrumentationScope.name}@${E.instrumentationScope.version||""}:${E.instrumentationScope.schemaUrl||""}`;let P=_.get(C);P||(P=[],_.set(C,P)),P.push(E)}return w}(_),C=[],P=E.entries();let R=P.next();for(;!R.done;){const[_,E]=R.value,L=[],I=E.values();let k=I.next();for(;!k.done;){const _=k.value;if(_.length>0){const E=_.map((_=>sdkSpanToOtlpSpan(_,w)));L.push({scope:createInstrumentationScope(_[0].instrumentationScope,w),spans:E,schemaUrl:_[0].instrumentationScope.schemaUrl})}k=I.next()}const F=createResource(_,w),j={resource:F,scopeSpans:L,schemaUrl:F.schemaUrl};C.push(j),R=P.next()}return C}const di={serializeRequest:_=>{const w=function createExportTraceServiceRequest(_,w){return{resourceSpans:spanRecordsToResourceSpans(_,w)}}(_,li);return(new TextEncoder).encode(JSON.stringify(w))},deserializeResponse:_=>{if(0===_.length)return{};const w=new TextDecoder;try{return JSON.parse(w.decode(_))}catch(_){return Ie.warn(`Failed to parse trace export response: ${_.message}. Returning empty response`),{}}}};class OTLPExporterBase{constructor(_){this._delegate=_}export(_,w){this._delegate.export(_,w)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class OTLPExporterError extends Error{constructor(_,w,E){super(_),this.name="OTLPExporterError",this.data=E,this.code=w}}function validateTimeoutMillis(_){if(Number.isFinite(_)&&_>0)return _;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${_}')`)}function wrapStaticHeadersInFunction(_){if(null!=_)return async()=>_}function mergeOtlpSharedConfigurationWithDefaults(_,w,E){return{timeoutMillis:validateTimeoutMillis(_.timeoutMillis??w.timeoutMillis??E.timeoutMillis),concurrencyLimit:_.concurrencyLimit??w.concurrencyLimit??E.concurrencyLimit,compression:_.compression??w.compression??E.compression}}class BoundedQueueExportPromiseHandler{constructor(_){this._sendingPromises=[],this._concurrencyLimit=_}pushPromise(_){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(_);const popPromise=()=>{const w=this._sendingPromises.indexOf(_);this._sendingPromises.splice(w,1)};_.then(popPromise,popPromise)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function createBoundedQueueExportPromiseHandler(_){return new BoundedQueueExportPromiseHandler(_.concurrencyLimit)}function createLoggingPartialSuccessResponseHandler(){return{handleResponse(_){null!=_&&function isPartialSuccessResponse(_){return Object.prototype.hasOwnProperty.call(_,"partialSuccess")}(_)&&null!=_.partialSuccess&&0!==Object.keys(_.partialSuccess).length&&Ie.warn("Received Partial Success response:",JSON.stringify(_.partialSuccess))}}}class OTLPExportDelegate{constructor(_,w,E,C,P){this._transport=_,this._serializer=w,this._responseHandler=E,this._promiseQueue=C,this._timeout=P,this._diagLogger=Ie.createComponentLogger({namespace:"OTLPExportDelegate"})}export(_,w){if(this._diagLogger.debug("items to be sent",_),this._promiseQueue.hasReachedLimit())return void w({code:Jo.FAILED,error:new Error("Concurrent export limit reached")});const E=this._serializer.serializeRequest(_);null!=E?this._promiseQueue.pushPromise(this._transport.send(E,this._timeout).then((_=>{if("success"!==_.status)"failure"===_.status&&_.error?w({code:Jo.FAILED,error:_.error}):"retryable"===_.status?w({code:Jo.FAILED,error:_.error??new OTLPExporterError("Export failed with retryable status")}):w({code:Jo.FAILED,error:new OTLPExporterError("Export failed with unknown error")});else{if(null!=_.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(_.data))}catch(w){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",w,_.data)}w({code:Jo.SUCCESS})}}),(_=>w({code:Jo.FAILED,error:_})))):w({code:Jo.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function createOtlpExportDelegate(_,w){return new OTLPExportDelegate(_.transport,_.serializer,createLoggingPartialSuccessResponseHandler(),_.promiseHandler,w.timeout)}function createOtlpNetworkExportDelegate(_,w,E){return createOtlpExportDelegate({transport:E,serializer:w,promiseHandler:createBoundedQueueExportPromiseHandler(_)},{timeout:_.timeoutMillis})}let fi,hi;const gi=new WeakMap,mi=new WeakMap,yi=new WeakMap,bi=new WeakMap,_i=new WeakMap;let vi={get(_,w,E){if(_ instanceof IDBTransaction){if("done"===w)return mi.get(_);if("objectStoreNames"===w)return _.objectStoreNames||yi.get(_);if("store"===w)return E.objectStoreNames[1]?void 0:E.objectStore(E.objectStoreNames[0])}return wrap$1(_[w])},set:(_,w,E)=>(_[w]=E,!0),has:(_,w)=>_ instanceof IDBTransaction&&("done"===w||"store"===w)||w in _};function wrapFunction(_){return _!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?function getCursorAdvanceMethods(){return hi||(hi=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}().includes(_)?function(...w){return _.apply(unwrap$1(this),w),wrap$1(gi.get(this))}:function(...w){return wrap$1(_.apply(unwrap$1(this),w))}:function(w,...E){const C=_.call(unwrap$1(this),w,...E);return yi.set(C,w.sort?w.sort():[w]),wrap$1(C)}}function transformCachableValue(_){return"function"==typeof _?wrapFunction(_):(_ instanceof IDBTransaction&&function cacheDonePromiseForTransaction(_){if(mi.has(_))return;const w=new Promise(((w,E)=>{const unlisten=()=>{_.removeEventListener("complete",complete),_.removeEventListener("error",error),_.removeEventListener("abort",error)},complete=()=>{w(),unlisten()},error=()=>{E(_.error||new DOMException("AbortError","AbortError")),unlisten()};_.addEventListener("complete",complete),_.addEventListener("error",error),_.addEventListener("abort",error)}));mi.set(_,w)}(_),w=_,function getIdbProxyableTypes(){return fi||(fi=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}().some((_=>w instanceof _))?new Proxy(_,vi):_);var w}function wrap$1(_){if(_ instanceof IDBRequest)return function promisifyRequest(_){const w=new Promise(((w,E)=>{const unlisten=()=>{_.removeEventListener("success",success),_.removeEventListener("error",error)},success=()=>{w(wrap$1(_.result)),unlisten()},error=()=>{E(_.error),unlisten()};_.addEventListener("success",success),_.addEventListener("error",error)}));return w.then((w=>{w instanceof IDBCursor&&gi.set(w,_)})).catch((()=>{})),_i.set(w,_),w}(_);if(bi.has(_))return bi.get(_);const w=transformCachableValue(_);return w!==_&&(bi.set(_,w),_i.set(w,_)),w}const unwrap$1=_=>_i.get(_);const Si=["get","getKey","getAll","getAllKeys","count"],wi=["put","add","delete","clear"],Ei=new Map;function getMethod(_,w){if(!(_ instanceof IDBDatabase)||w in _||"string"!=typeof w)return;if(Ei.get(w))return Ei.get(w);const E=w.replace(/FromIndex$/,""),C=w!==E,P=wi.includes(E);if(!(E in(C?IDBIndex:IDBObjectStore).prototype)||!P&&!Si.includes(E))return;const method=async function(_,...w){const R=this.transaction(_,P?"readwrite":"readonly");let L=R.store;return C&&(L=L.index(w.shift())),(await Promise.all([L[E](...w),P&&R.done]))[0]};return Ei.set(w,method),method}!function replaceTraps(_){vi=_(vi)}((_=>({..._,get:(w,E,C)=>getMethod(w,E)||_.get(w,E,C),has:(w,E)=>!!getMethod(w,E)||_.has(w,E)})));const Ti="@firebase/installations",Ai="0.6.24-eap-sql.b903ef716",Oi=1e4,Ci=`w:${Ai}`,Pi="FIS_v2",Ri=36e5,xi=new ErrorFactory("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function isServerError(_){return _ instanceof FirebaseError&&_.code.includes("request-failed")}function getInstallationsEndpoint({projectId:_}){return`https://firebaseinstallations.googleapis.com/v1/projects/${_}/installations`}function extractAuthTokenInfoFromResponse(_){return{token:_.token,requestStatus:2,expiresIn:(w=_.expiresIn,Number(w.replace("s","000"))),creationTime:Date.now()};var w}async function getErrorFromResponse(_,w){const E=(await w.json()).error;return xi.create("request-failed",{requestName:_,serverCode:E.code,serverMessage:E.message,serverStatus:E.status})}function getHeaders({apiKey:_}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":_})}function getHeadersWithAuth(_,{refreshToken:w}){const E=getHeaders(_);return E.append("Authorization",function getAuthorizationHeader(_){return`${Pi} ${_}`}(w)),E}async function retryIfServerError(_){const w=await _();return w.status>=500&&w.status<600?_():w}function sleep(_){return new Promise((w=>{setTimeout(w,_)}))}const Li=/^[cdef][\w-]{21}$/;function generateFid(){try{const _=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(_),_[0]=112+_[0]%16;const w=function encode$1(_){const w=function bufferToBase64UrlSafe(_){return btoa(String.fromCharCode(..._)).replace(/\+/g,"-").replace(/\//g,"_")}(_);return w.substr(0,22)}(_);return Li.test(w)?w:""}catch{return""}}function getKey(_){return`${_.appName}!${_.appId}`}const Ii=new Map;function fidChanged(_,w){const E=getKey(_);callFidChangeCallbacks(E,w),function broadcastFidChange(_,w){const E=function getBroadcastChannel(){!Ni&&"BroadcastChannel"in self&&(Ni=new BroadcastChannel("[Firebase] FID Change"),Ni.onmessage=_=>{callFidChangeCallbacks(_.data.key,_.data.fid)});return Ni}();E&&E.postMessage({key:_,fid:w});!function closeBroadcastChannel(){0===Ii.size&&Ni&&(Ni.close(),Ni=null)}()}(E,w)}function callFidChangeCallbacks(_,w){const E=Ii.get(_);if(E)for(const _ of E)_(w)}let Ni=null;const Di="firebase-installations-store";let ki=null;function getDbPromise(){return ki||(ki=function openDB(_,w,{blocked:E,upgrade:C,blocking:P,terminated:R}={}){const L=indexedDB.open(_,w),I=wrap$1(L);return C&&L.addEventListener("upgradeneeded",(_=>{C(wrap$1(L.result),_.oldVersion,_.newVersion,wrap$1(L.transaction),_)})),E&&L.addEventListener("blocked",(_=>E(_.oldVersion,_.newVersion,_))),I.then((_=>{R&&_.addEventListener("close",(()=>R())),P&&_.addEventListener("versionchange",(_=>P(_.oldVersion,_.newVersion,_)))})).catch((()=>{})),I}("firebase-installations-database",1,{upgrade:(_,w)=>{if(0===w)_.createObjectStore(Di)}})),ki}async function set(_,w){const E=getKey(_),C=(await getDbPromise()).transaction(Di,"readwrite"),P=C.objectStore(Di),R=await P.get(E);return await P.put(w,E),await C.done,R&&R.fid===w.fid||fidChanged(_,w.fid),w}async function remove(_){const w=getKey(_),E=(await getDbPromise()).transaction(Di,"readwrite");await E.objectStore(Di).delete(w),await E.done}async function update(_,w){const E=getKey(_),C=(await getDbPromise()).transaction(Di,"readwrite"),P=C.objectStore(Di),R=await P.get(E),L=w(R);return void 0===L?await P.delete(E):await P.put(L,E),await C.done,!L||R&&R.fid===L.fid||fidChanged(_,L.fid),L}async function getInstallationEntry(_){let w;const E=await update(_.appConfig,(E=>{const C=function updateOrCreateInstallationEntry(_){const w=_||{fid:generateFid(),registrationStatus:0};return clearTimedOutRequest(w)}(E),P=function triggerRegistrationIfNecessary(_,w){if(0===w.registrationStatus){if(!navigator.onLine){return{installationEntry:w,registrationPromise:Promise.reject(xi.create("app-offline"))}}const E={fid:w.fid,registrationStatus:1,registrationTime:Date.now()},C=async function registerInstallation(_,w){try{const E=await async function createInstallationRequest({appConfig:_,heartbeatServiceProvider:w},{fid:E}){const C=getInstallationsEndpoint(_),P=getHeaders(_),R=w.getImmediate({optional:!0});if(R){const _=await R.getHeartbeatsHeader();_&&P.append("x-firebase-client",_)}const L={fid:E,authVersion:Pi,appId:_.appId,sdkVersion:Ci},I={method:"POST",headers:P,body:JSON.stringify(L)},k=await retryIfServerError((()=>fetch(C,I)));if(k.ok){const _=await k.json();return{fid:_.fid||E,registrationStatus:2,refreshToken:_.refreshToken,authToken:extractAuthTokenInfoFromResponse(_.authToken)}}throw await getErrorFromResponse("Create Installation",k)}(_,w);return set(_.appConfig,E)}catch(E){throw isServerError(E)&&409===E.customData.serverCode?await remove(_.appConfig):await set(_.appConfig,{fid:w.fid,registrationStatus:0}),E}}(_,E);return{installationEntry:E,registrationPromise:C}}return 1===w.registrationStatus?{installationEntry:w,registrationPromise:waitUntilFidRegistration(_)}:{installationEntry:w}}(_,C);return w=P.registrationPromise,P.installationEntry}));return""===E.fid?{installationEntry:await w}:{installationEntry:E,registrationPromise:w}}async function waitUntilFidRegistration(_){let w=await updateInstallationRequest(_.appConfig);for(;1===w.registrationStatus;)await sleep(100),w=await updateInstallationRequest(_.appConfig);if(0===w.registrationStatus){const{installationEntry:w,registrationPromise:E}=await getInstallationEntry(_);return E||w}return w}function updateInstallationRequest(_){return update(_,(_=>{if(!_)throw xi.create("installation-not-found");return clearTimedOutRequest(_)}))}function clearTimedOutRequest(_){return function hasInstallationRequestTimedOut(_){return 1===_.registrationStatus&&_.registrationTime+Oi<Date.now()}(_)?{fid:_.fid,registrationStatus:0}:_}async function generateAuthTokenRequest({appConfig:_,heartbeatServiceProvider:w},E){const C=function getGenerateAuthTokenEndpoint(_,{fid:w}){return`${getInstallationsEndpoint(_)}/${w}/authTokens:generate`}(_,E),P=getHeadersWithAuth(_,E),R=w.getImmediate({optional:!0});if(R){const _=await R.getHeartbeatsHeader();_&&P.append("x-firebase-client",_)}const L={installation:{sdkVersion:Ci,appId:_.appId}},I={method:"POST",headers:P,body:JSON.stringify(L)},k=await retryIfServerError((()=>fetch(C,I)));if(k.ok){return extractAuthTokenInfoFromResponse(await k.json())}throw await getErrorFromResponse("Generate Auth Token",k)}async function refreshAuthToken(_,w=!1){let E;const C=await update(_.appConfig,(C=>{if(!isEntryRegistered(C))throw xi.create("not-registered");const P=C.authToken;if(!w&&function isAuthTokenValid(_){return 2===_.requestStatus&&!function isAuthTokenExpired(_){const w=Date.now();return w<_.creationTime||_.creationTime+_.expiresIn<w+Ri}(_)}(P))return C;if(1===P.requestStatus)return E=async function waitUntilAuthTokenRequest(_,w){let E=await updateAuthTokenRequest(_.appConfig);for(;1===E.authToken.requestStatus;)await sleep(100),E=await updateAuthTokenRequest(_.appConfig);const C=E.authToken;return 0===C.requestStatus?refreshAuthToken(_,w):C}(_,w),C;{if(!navigator.onLine)throw xi.create("app-offline");const w=function makeAuthTokenRequestInProgressEntry(_){const w={requestStatus:1,requestTime:Date.now()};return{..._,authToken:w}}(C);return E=async function fetchAuthTokenFromServer(_,w){try{const E=await generateAuthTokenRequest(_,w),C={...w,authToken:E};return await set(_.appConfig,C),E}catch(E){if(!isServerError(E)||401!==E.customData.serverCode&&404!==E.customData.serverCode){const E={...w,authToken:{requestStatus:0}};await set(_.appConfig,E)}else await remove(_.appConfig);throw E}}(_,w),w}}));return E?await E:C.authToken}function updateAuthTokenRequest(_){return update(_,(_=>{if(!isEntryRegistered(_))throw xi.create("not-registered");return function hasAuthTokenRequestTimedOut(_){return 1===_.requestStatus&&_.requestTime+Oi<Date.now()}(_.authToken)?{..._,authToken:{requestStatus:0}}:_}))}function isEntryRegistered(_){return void 0!==_&&2===_.registrationStatus}async function getToken(_,w=!1){const E=_;await async function completeInstallationRegistration(_){const{registrationPromise:w}=await getInstallationEntry(_);w&&await w}(E);return(await refreshAuthToken(E,w)).token}function getMissingValueError(_){return xi.create("missing-app-config-values",{valueName:_})}const Fi="installations",publicFactory=_=>{const w=_.getProvider("app").getImmediate(),E=function extractAppConfig(_){if(!_||!_.options)throw getMissingValueError("App Configuration");if(!_.name)throw getMissingValueError("App Name");const w=["projectId","apiKey","appId"];for(const E of w)if(!_.options[E])throw getMissingValueError(E);return{appName:_.name,projectId:_.options.projectId,apiKey:_.options.apiKey,appId:_.options.appId}}(w);return{app:w,appConfig:E,heartbeatServiceProvider:_getProvider(w,"heartbeat"),_delete:()=>Promise.resolve()}},internalFactory=_=>{const w=_.getProvider("app").getImmediate(),E=_getProvider(w,Fi).getImmediate();return{getId:()=>async function getId(_){const w=_,{installationEntry:E,registrationPromise:C}=await getInstallationEntry(w);return C?C.catch(console.error):refreshAuthToken(w).catch(console.error),E.fid}(E),getToken:_=>getToken(E,_)}};function registerInstrumentations(_){const w=_.tracerProvider||Ue.getTracerProvider(),E=_.meterProvider||ke.getMeterProvider(),C=_.loggerProvider||X.getLoggerProvider(),P=_.instrumentations?.flat()??[];return function enableInstrumentations(_,w,E,C){for(let P=0,R=_.length;P<R;P++){const R=_[P];w&&R.setTracerProvider(w),E&&R.setMeterProvider(E),C&&R.setLoggerProvider&&R.setLoggerProvider(C),R.getConfig().enabled||R.enable()}}(P,w,E,C),()=>{!function disableInstrumentations(_){_.forEach((_=>_.disable()))}(P)}}!function registerInstallations(){w(new Component(Fi,publicFactory,"PUBLIC")),w(new Component("installations-internal",internalFactory,"PRIVATE"))}(),_(Ti,Ai),_(Ti,Ai,"esm2020");const ji=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Mi=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,$i={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function satisfies(_,w,E){if(!function _validateVersion(_){return"string"==typeof _&&ji.test(_)}(_))return Ie.error(`Invalid version: ${_}`),!1;if(!w)return!0;w=w.replace(/([<>=~^]+)\s+/g,"$1");const C=function _parseVersion(_){const w=_.match(ji);if(!w)return void Ie.error(`Invalid version: ${_}`);const E=w.groups.version,C=w.groups.prerelease,P=w.groups.build,R=E.split("."),L=C?.split(".");return{op:void 0,version:E,versionSegments:R,versionSegmentCount:R.length,prerelease:C,prereleaseSegments:L,prereleaseSegmentCount:L?L.length:0,build:P}}(_);if(!C)return!1;const P=[],R=_doSatisfies(C,w,P,E);return R&&!E?.includePrerelease?function _doPreleaseCheck(_,w){if(_.prerelease)return w.some((w=>w.prerelease&&w.version===_.version));return!0}(C,P):R}function _doSatisfies(_,w,E,C){if(w.includes("||")){const P=w.trim().split("||");for(const w of P)if(_checkRange(_,w,E,C))return!0;return!1}if(w.includes(" - "))w=function replaceHyphen(_,w){const E=Gi;return _.replace(E,((_,E,C,P,R,L,I,k,F,j,$,V)=>`${E=isX(C)?"":isX(P)?`>=${C}.0.0${w?.includePrerelease?"-0":""}`:isX(R)?`>=${C}.${P}.0${w?.includePrerelease?"-0":""}`:L?`>=${E}`:`>=${E}${w?.includePrerelease?"-0":""}`} ${k=isX(F)?"":isX(j)?`<${+F+1}.0.0-0`:isX($)?`<${F}.${+j+1}.0-0`:V?`<=${F}.${j}.${$}-${V}`:w?.includePrerelease?`<${F}.${j}.${+$+1}-0`:`<=${k}`}`.trim()))}(w,C);else if(w.includes(" ")){const P=w.trim().replace(/\s{2,}/g," ").split(" ");for(const w of P)if(!_checkRange(_,w,E,C))return!1;return!0}return _checkRange(_,w,E,C)}function _checkRange(_,w,E,C){if(w=function _normalizeRange(_,w){return _=_.trim(),_=function replaceCaret(_,w){const E=Qi,C=w?.includePrerelease?"-0":"";return _.replace(E,((_,w,E,P,R)=>{let L;return L=isX(w)?"":isX(E)?`>=${w}.0.0${C} <${+w+1}.0.0-0`:isX(P)?"0"===w?`>=${w}.${E}.0${C} <${w}.${+E+1}.0-0`:`>=${w}.${E}.0${C} <${+w+1}.0.0-0`:R?"0"===w?"0"===E?`>=${w}.${E}.${P}-${R} <${w}.${E}.${+P+1}-0`:`>=${w}.${E}.${P}-${R} <${w}.${+E+1}.0-0`:`>=${w}.${E}.${P}-${R} <${+w+1}.0.0-0`:"0"===w?"0"===E?`>=${w}.${E}.${P}${C} <${w}.${E}.${+P+1}-0`:`>=${w}.${E}.${P}${C} <${w}.${+E+1}.0-0`:`>=${w}.${E}.${P} <${+w+1}.0.0-0`,L}))}(_,w),_=function replaceTilde(_){const w=Ki;return _.replace(w,((_,w,E,C,P)=>{let R;return R=isX(w)?"":isX(E)?`>=${w}.0.0 <${+w+1}.0.0-0`:isX(C)?`>=${w}.${E}.0 <${w}.${+E+1}.0-0`:P?`>=${w}.${E}.${C}-${P} <${w}.${+E+1}.0-0`:`>=${w}.${E}.${C} <${w}.${+E+1}.0-0`,R}))}(_),_=function replaceXRange(_,w){const E=Wi;return _.replace(E,((_,E,C,P,R,L)=>{const I=isX(C),k=I||isX(P),F=k||isX(R),j=F;return"="===E&&j&&(E=""),L=w?.includePrerelease?"-0":"",I?_=">"===E||"<"===E?"<0.0.0-0":"*":E&&j?(k&&(P=0),R=0,">"===E?(E=">=",k?(C=+C+1,P=0,R=0):(P=+P+1,R=0)):"<="===E&&(E="<",k?C=+C+1:P=+P+1),"<"===E&&(L="-0"),_=`${E+C}.${P}.${R}${L}`):k?_=`>=${C}.0.0${L} <${+C+1}.0.0-0`:F&&(_=`>=${C}.${P}.0${L} <${C}.${+P+1}.0-0`),_}))}(_,w),_=_.trim(),_}(w,C),w.includes(" "))return _doSatisfies(_,w,E,C);{const C=function _parseRange(_){if(!_)return{};const w=_.match(Mi);if(!w)return Ie.error(`Invalid range: ${_}`),{invalid:!0};let E=w.groups.op;const C=w.groups.version,P=w.groups.prerelease,R=w.groups.build,L=C.split("."),I=P?.split(".");"=="===E&&(E="=");return{op:E||"=",version:C,versionSegments:L,versionSegmentCount:L.length,prerelease:P,prereleaseSegments:I,prereleaseSegmentCount:I?I.length:0,build:R}}(w);return E.push(C),function _satisfies(_,w){if(w.invalid)return!1;if(!w.version||_isWildcard(w.version))return!0;let E=_compareVersionSegments(_.versionSegments||[],w.versionSegments||[]);if(0===E){const C=_.prereleaseSegments||[],P=w.prereleaseSegments||[];E=C.length||P.length?!C.length&&P.length?1:C.length&&!P.length?-1:_compareVersionSegments(C,P):0}return $i[w.op]?.includes(E)}(_,C)}}function isX(_){return!_||"x"===_.toLowerCase()||"*"===_}function _isWildcard(_){return"*"===_||"x"===_||"X"===_}function _parseVersionString(_){const w=parseInt(_,10);return isNaN(w)?_:w}function _compareVersionStrings(_,w){if(_isWildcard(_)||_isWildcard(w))return 0;const[E,C]=function _normalizeVersionType(_,w){if(typeof _==typeof w){if("number"==typeof _)return[_,w];if("string"==typeof _)return[_,w];throw new Error("Version segments can only be strings or numbers")}return[String(_),String(w)]}(_parseVersionString(_),_parseVersionString(w));return E>C?1:E<C?-1:0}function _compareVersionSegments(_,w){for(let E=0;E<Math.max(_.length,w.length);E++){const C=_compareVersionStrings(_[E]||"0",w[E]||"0");if(0!==C)return C}return 0}const Bi="[a-zA-Z0-9-]",Ui="0|[1-9]\\d*",Vi=`(?:${Ui}|${`\\d*[a-zA-Z-]${Bi}*`})`,Hi=`${Bi}+`,zi=`${Ui}|x|X|\\*`,qi=`[v=\\s]*(${zi})(?:\\.(${zi})(?:\\.(${zi})(?:${`(?:-(${Vi}(?:\\.${Vi})*))`})?${`(?:\\+(${Hi}(?:\\.${Hi})*))`}?)?)?`,Wi=new RegExp(`^((?:<|>)?=?)\\s*${qi}$`),Gi=new RegExp(`^\\s*(${qi})\\s+-\\s+(${qi})\\s*$`),Ki=new RegExp(`^(?:~>?)${qi}$`),Qi=new RegExp(`^(?:\\^)${qi}$`);let Xi=console.error.bind(console);function defineProperty$1(_,w,E){const C=!!_[w]&&Object.prototype.propertyIsEnumerable.call(_,w);Object.defineProperty(_,w,{configurable:!0,enumerable:C,writable:!0,value:E})}const wrap=(_,w,E)=>{if(!_||!_[w])return void Xi("no original function "+String(w)+" to wrap");if(!E)return Xi("no wrapper function"),void Xi((new Error).stack);const C=_[w];if("function"!=typeof C||"function"!=typeof E)return void Xi("original object and wrapper must be functions");const P=E(C,w);return defineProperty$1(P,"__original",C),defineProperty$1(P,"__unwrap",(()=>{_[w]===P&&defineProperty$1(_,w,C)})),defineProperty$1(P,"__wrapped",!0),defineProperty$1(_,w,P),P},massWrap=(_,w,E)=>{if(!_)return Xi("must provide one or more modules to patch"),void Xi((new Error).stack);Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{wrap(_,w,E)}))})):Xi("must provide one or more functions to wrap on modules")},unwrap=(_,w)=>{if(!_||!_[w])return Xi("no function to unwrap."),void Xi((new Error).stack);const E=_[w];E.__unwrap?E.__unwrap():Xi("no original to unwrap to -- has "+String(w)+" already been unwrapped?")},massUnwrap=(_,w)=>{if(!_)return Xi("must provide one or more modules to patch"),void Xi((new Error).stack);Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{unwrap(_,w)}))})):Xi("must provide one or more functions to unwrap on modules")};class InstrumentationAbstract{constructor(_,w,E){this._config={},this._wrap=wrap,this._unwrap=unwrap,this._massWrap=massWrap,this._massUnwrap=massUnwrap,this.instrumentationName=_,this.instrumentationVersion=w,this.setConfig(E),this._diag=Ie.createComponentLogger({namespace:_}),this._tracer=Ue.getTracer(_,w),this._meter=ke.getMeter(_,w),this._logger=X.getLogger(_,w),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(_){this._meter=_.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(_){this._logger=_.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const _=this.init()??[];return Array.isArray(_)?_:[_]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(_){this._config={enabled:!0,..._}}setTracerProvider(_){this._tracer=_.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(_,w,E,C){if(_)try{_(E,C)}catch(_){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:w},_)}}}var Ji={exports:{}},Zi={exports:{}},Yi={exports:{}},es=1e3,ts=6e4,rs=60*ts,ns=24*rs,os=7*ns,is=365.25*ns,ms=function(_,w){w=w||{};var E=typeof _;if("string"===E&&_.length>0)return function parse$2(_){if((_=String(_)).length>100)return;var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(!w)return;var E=parseFloat(w[1]);switch((w[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return E*is;case"weeks":case"week":case"w":return E*os;case"days":case"day":case"d":return E*ns;case"hours":case"hour":case"hrs":case"hr":case"h":return E*rs;case"minutes":case"minute":case"mins":case"min":case"m":return E*ts;case"seconds":case"second":case"secs":case"sec":case"s":return E*es;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return E;default:return}}(_);if("number"===E&&isFinite(_))return w.long?function fmtLong(_){var w=Math.abs(_);if(w>=ns)return plural(_,w,ns,"day");if(w>=rs)return plural(_,w,rs,"hour");if(w>=ts)return plural(_,w,ts,"minute");if(w>=es)return plural(_,w,es,"second");return _+" ms"}(_):function fmtShort(_){var w=Math.abs(_);if(w>=ns)return Math.round(_/ns)+"d";if(w>=rs)return Math.round(_/rs)+"h";if(w>=ts)return Math.round(_/ts)+"m";if(w>=es)return Math.round(_/es)+"s";return _+"ms"}(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function plural(_,w,E,C){var P=w>=1.5*E;return Math.round(_/E)+" "+C+(P?"s":"")}var ss=function setup(_){function createDebug(_){let w,E,C,P=null;function debug(..._){if(!debug.enabled)return;const E=debug,C=Number(new Date),P=C-(w||C);E.diff=P,E.prev=w,E.curr=C,w=C,_[0]=createDebug.coerce(_[0]),"string"!=typeof _[0]&&_.unshift("%O");let R=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,((w,C)=>{if("%%"===w)return"%";R++;const P=createDebug.formatters[C];if("function"==typeof P){const C=_[R];w=P.call(E,C),_.splice(R,1),R--}return w})),createDebug.formatArgs.call(E,_);(E.log||createDebug.log).apply(E,_)}return debug.namespace=_,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(_),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==P?P:(E!==createDebug.namespaces&&(E=createDebug.namespaces,C=createDebug.enabled(_)),C),set:_=>{P=_}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(_,w){const E=createDebug(this.namespace+(void 0===w?":":w)+_);return E.log=this.log,E}function matchesTemplate(_,w){let E=0,C=0,P=-1,R=0;for(;E<_.length;)if(C<w.length&&(w[C]===_[E]||"*"===w[C]))"*"===w[C]?(P=C,R=E,C++):(E++,C++);else{if(-1===P)return!1;C=P+1,R++,E=R}for(;C<w.length&&"*"===w[C];)C++;return C===w.length}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=function coerce(_){if(_ instanceof Error)return _.stack||_.message;return _},createDebug.disable=function disable(){const _=[...createDebug.names,...createDebug.skips.map((_=>"-"+_))].join(",");return createDebug.enable(""),_},createDebug.enable=function enable(_){createDebug.save(_),createDebug.namespaces=_,createDebug.names=[],createDebug.skips=[];const w=("string"==typeof _?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const _ of w)"-"===_[0]?createDebug.skips.push(_.slice(1)):createDebug.names.push(_)},createDebug.enabled=function enabled(_){for(const w of createDebug.skips)if(matchesTemplate(_,w))return!1;for(const w of createDebug.names)if(matchesTemplate(_,w))return!0;return!1},createDebug.humanize=ms,createDebug.destroy=function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(_).forEach((w=>{createDebug[w]=_[w]})),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function selectColor(_){let w=0;for(let E=0;E<_.length;E++)w=(w<<5)-w+_.charCodeAt(E),w|=0;return createDebug.colors[Math.abs(w)%createDebug.colors.length]},createDebug.enable(createDebug.load()),createDebug};!function(_,w){w.formatArgs=function formatArgs(w){if(w[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+w[0]+(this.useColors?"%c ":" ")+"+"+_.exports.humanize(this.diff),!this.useColors)return;const E="color: "+this.color;w.splice(1,0,E,"color: inherit");let C=0,P=0;w[0].replace(/%[a-zA-Z%]/g,(_=>{"%%"!==_&&(C++,"%c"===_&&(P=C))})),w.splice(P,0,E)},w.save=function save(_){try{_?w.storage.setItem("debug",_):w.storage.removeItem("debug")}catch(_){}},w.load=function load(){let _;try{_=w.storage.getItem("debug")||w.storage.getItem("DEBUG")}catch(_){}!_&&"undefined"!=typeof process&&"env"in process&&(_=process.env.DEBUG);return _},w.useColors=function useColors(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let _;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(_=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(_[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},w.storage=function localstorage(){try{return localStorage}catch(_){}}(),w.destroy=(()=>{let _=!1;return()=>{_||(_=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],w.log=console.debug||console.log||(()=>{}),_.exports=ss(w);const{formatters:E}=_.exports;E.j=function(_){try{return JSON.stringify(_)}catch(_){return"[UnexpectedJSONParseError]: "+_.message}}}(Yi,Yi.exports);var as={exports:{}};!function(_,w){const E=L,C=qe;w.init=function init(_){_.inspectOpts={};const E=Object.keys(w.inspectOpts);for(let C=0;C<E.length;C++)_.inspectOpts[E[C]]=w.inspectOpts[E[C]]},w.log=function log(..._){return process.stderr.write(C.formatWithOptions(w.inspectOpts,..._)+"\n")},w.formatArgs=function formatArgs(E){const{namespace:C,useColors:P}=this;if(P){const w=this.color,P="[3"+(w<8?w:"8;5;"+w),R=` ${P};1m${C} [0m`;E[0]=R+E[0].split("\n").join("\n"+R),E.push(P+"m+"+_.exports.humanize(this.diff)+"[0m")}else E[0]=function getDate(){if(w.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+C+" "+E[0]},w.save=function save(_){_?process.env.DEBUG=_:delete process.env.DEBUG},w.load=function load(){return process.env.DEBUG},w.useColors=function useColors(){return"colors"in w.inspectOpts?Boolean(w.inspectOpts.colors):E.isatty(process.stderr.fd)},w.destroy=C.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),w.colors=[6,2,3,4,5,1];try{const _=require("supports-color");_&&(_.stderr||_).level>=2&&(w.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(_){}w.inspectOpts=Object.keys(process.env).filter((_=>/^debug_/i.test(_))).reduce(((_,w)=>{const E=w.substring(6).toLowerCase().replace(/_([a-z])/g,((_,w)=>w.toUpperCase()));let C=process.env[w];return C=!!/^(yes|on|true|enabled)$/i.test(C)||!/^(no|off|false|disabled)$/i.test(C)&&("null"===C?null:Number(C)),_[E]=C,_}),{}),_.exports=ss(w);const{formatters:P}=_.exports;P.o=function(_){return this.inspectOpts.colors=this.useColors,C.inspect(_,this.inspectOpts).split("\n").map((_=>_.trim())).join(" ")},P.O=function(_){return this.inspectOpts.colors=this.useColors,C.inspect(_,this.inspectOpts)}}(as,as.exports),"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Zi.exports=Yi.exports:Zi.exports=as.exports;var cs=P.sep,moduleDetailsFromPath$2=function(_){var w=_.split(cs),E=w.lastIndexOf("node_modules");if(-1!==E&&w[E+1]){for(var C="@"===w[E+1][0],P=C?w[E+1]+"/"+w[E+2]:w[E+1],R=C?3:2,L="",I=E+R-1,k=0;k<=I;k++)L+=k===I?w[k]:w[k]+cs;for(var F="",j=w.length-1,$=E+R;$<=j;$++)F+=$===j?w[$]:w[$]+cs;return{name:P,basedir:L,path:F}}};const us=P,ls=R,ps=Zi.exports("require-in-the-middle"),ds=moduleDetailsFromPath$2;Ji.exports=Hook$1;var fs=Ji.exports.Hook=Hook$1;let hs,gs;if(ls.isBuiltin)gs=ls.isBuiltin;else{if(!ls.builtinModules)throw new Error("'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0");gs=_=>!!_.startsWith("node:")||(void 0===hs&&(hs=new Set(ls.builtinModules)),hs.has(_))}const ys=/([/\\]index)?(\.js)?$/;class ExportsCache{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(_,w){if(this._localCache.has(_))return!0;if(w)return!1;{const w=require.cache[_];return!(!w||!(this._kRitmExports in w))}}get(_,w){const E=this._localCache.get(_);if(void 0!==E)return E;if(!w){const w=require.cache[_];return w&&w[this._kRitmExports]}}set(_,w,E){E?this._localCache.set(_,w):_ in require.cache?require.cache[_][this._kRitmExports]=w:(ps('non-core module is unexpectedly not in require.cache: "%s"',_),this._localCache.set(_,w))}}function Hook$1(_,w,E){if(this instanceof Hook$1==!1)return new Hook$1(_,w,E);if("function"==typeof _?(E=_,_=null,w=null):"function"==typeof w&&(E=w,w=null),"function"!=typeof ls._resolveFilename)return console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof ls._resolveFilename),void console.error("Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues",process.version);this._cache=new ExportsCache,this._unhooked=!1,this._origRequire=ls.prototype.require;const C=this,P=new Set,R=!!w&&!0===w.internals,L=Array.isArray(_);function patchedRequire(w,I){const k=w[0],F=gs(k);let j,$,V;if(F){if(j=k,k.startsWith("node:")){const _=k.slice(5);gs(_)&&(j=_)}}else{if(I)return ps("call to process.getBuiltinModule with unknown built-in id"),C._origGetBuiltinModule.apply(this,w);try{j=ls._resolveFilename(k,this)}catch(_){return ps('Module._resolveFilename("%s") threw %j, calling original Module.require',k,_.message),C._origRequire.apply(this,w)}}if(ps("processing %s module require('%s'): %s",!0===F?"core":"non-core",k,j),!0===C._cache.has(j,F))return ps("returning already patched cached module: %s",j),C._cache.get(j,F);const H=P.has(j);!1===H&&P.add(j);const z=I?C._origGetBuiltinModule.apply(this,w):C._origRequire.apply(this,w);if(!0===H)return ps("module is in the process of being patched already - ignoring: %s",j),z;if(P.delete(j),!0===F){if(!0===L&&!1===_.includes(j))return ps("ignoring core module not on whitelist: %s",j),z;$=j}else if(!0===L&&_.includes(j)){const _=us.parse(j);$=_.name,V=_.dir}else{const w=ds(j);if(void 0===w)return ps("could not parse filename: %s",j),z;$=w.name,V=w.basedir;const E=function resolveModuleName(_){const w="/"!==us.sep?_.path.split(us.sep).join("/"):_.path;return us.posix.join(_.name,w).replace(ys,"")}(w);ps("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",$,k,E,V);let P=!1;if(L){if(!k.startsWith(".")&&_.includes(k)&&($=k,P=!0),!_.includes($)&&!_.includes(E))return z;_.includes(E)&&E!==$&&($=E,P=!0)}if(!P){let _;try{_=require.resolve($,{paths:[V]})}catch(_){return ps("could not resolve module: %s",$),C._cache.set(j,z,F),z}if(_!==j){if(!0!==R)return ps("ignoring require of non-main module file: %s",_),C._cache.set(j,z,F),z;$=$+us.sep+us.relative(V,j),ps("preparing to process require of internal file: %s",$)}}}C._cache.set(j,z,F),ps("calling require hook: %s",$);const q=E(z,$,V);return C._cache.set(j,q,F),ps("returning module: %s",$),q}ps("registering require hook"),this._require=ls.prototype.require=function(_){return!0===C._unhooked?(ps("ignoring require call - module is soft-unhooked"),C._origRequire.apply(this,arguments)):patchedRequire.call(this,arguments,!1)},"function"==typeof process.getBuiltinModule&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(_){return!0===C._unhooked?(ps("ignoring process.getBuiltinModule call - module is soft-unhooked"),C._origGetBuiltinModule.apply(this,arguments)):patchedRequire.call(this,arguments,!0)})}Hook$1.prototype.unhook=function(){this._unhooked=!0,this._require===ls.prototype.require?(ls.prototype.require=this._origRequire,ps("require unhook successful")):ps("require unhook unsuccessful"),void 0!==process.getBuiltinModule&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,ps("process.getBuiltinModule unhook successful")):ps("process.getBuiltinModule unhook unsuccessful"))};const bs="/";class ModuleNameTrieNode{constructor(){this.hooks=[],this.children=new Map}}class ModuleNameTrie{constructor(){this._trie=new ModuleNameTrieNode,this._counter=0}insert(_){let w=this._trie;for(const E of _.moduleName.split(bs)){let _=w.children.get(E);_||(_=new ModuleNameTrieNode,w.children.set(E,_)),w=_}w.hooks.push({hook:_,insertedId:this._counter++})}search(_,{maintainInsertionOrder:w,fullOnly:E}={}){let C=this._trie;const P=[];let R=!0;for(const w of _.split(bs)){const _=C.children.get(w);if(!_){R=!1;break}E||P.push(..._.hooks),C=_}return E&&R&&P.push(...C.hooks),0===P.length?[]:1===P.length?[P[0].hook]:(w&&P.sort(((_,w)=>_.insertedId-w.insertedId)),P.map((({hook:_})=>_)))}}const _s=["afterEach","after","beforeEach","before","describe","it"].every((_=>"function"==typeof global[_]));class RequireInTheMiddleSingleton{constructor(){this._moduleNameTrie=new ModuleNameTrie,this._initialize()}_initialize(){new fs(null,{internals:!0},((_,w,E)=>{const P=function normalizePathSeparators(_){return C.sep!==bs?_.split(C.sep).join(bs):_}(w),R=this._moduleNameTrie.search(P,{maintainInsertionOrder:!0,fullOnly:void 0===E});for(const{onRequire:C}of R)_=C(_,w,E);return _}))}register(_,w){const E={moduleName:_,onRequire:w};return this._moduleNameTrie.insert(E),E}static getInstance(){return _s?new RequireInTheMiddleSingleton:this._instance=this._instance??new RequireInTheMiddleSingleton}}var vs,Ss,ws={exports:{}},Es={},Ts={exports:{}};vs=Ts,Ss=Ts.exports,function(_){var w=Ss&&!Ss.nodeType&&Ss,E=vs&&!vs.nodeType&&vs,C="object"==typeof ze&&ze;C.global!==C&&C.window!==C&&C.self!==C||(_=C);var P,R,L=2147483647,I=36,k=/^xn--/,F=/[^\x20-\x7E]/,j=/[\x2E\u3002\uFF0E\uFF61]/g,$={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=Math.floor,H=String.fromCharCode;function error(_){throw new RangeError($[_])}function map(_,w){for(var E=_.length,C=[];E--;)C[E]=w(_[E]);return C}function mapDomain(_,w){var E=_.split("@"),C="";return E.length>1&&(C=E[0]+"@",_=E[1]),C+map((_=_.replace(j,".")).split("."),w).join(".")}function ucs2decode(_){for(var w,E,C=[],P=0,R=_.length;P<R;)(w=_.charCodeAt(P++))>=55296&&w<=56319&&P<R?56320==(64512&(E=_.charCodeAt(P++)))?C.push(((1023&w)<<10)+(1023&E)+65536):(C.push(w),P--):C.push(w);return C}function ucs2encode(_){return map(_,(function(_){var w="";return _>65535&&(w+=H((_-=65536)>>>10&1023|55296),_=56320|1023&_),w+=H(_)})).join("")}function digitToBasic(_,w){return _+22+75*(_<26)-((0!=w)<<5)}function adapt(_,w,E){var C=0;for(_=E?V(_/700):_>>1,_+=V(_/w);_>455;C+=I)_=V(_/35);return V(C+36*_/(_+38))}function decode(_){var w,E,C,P,R,k,F,j,$,H,z,q=[],G=_.length,K=0,Q=128,X=72;for((E=_.lastIndexOf("-"))<0&&(E=0),C=0;C<E;++C)_.charCodeAt(C)>=128&&error("not-basic"),q.push(_.charCodeAt(C));for(P=E>0?E+1:0;P<G;){for(R=K,k=1,F=I;P>=G&&error("invalid-input"),((j=(z=_.charCodeAt(P++))-48<10?z-22:z-65<26?z-65:z-97<26?z-97:I)>=I||j>V((L-K)/k))&&error("overflow"),K+=j*k,!(j<($=F<=X?1:F>=X+26?26:F-X));F+=I)k>V(L/(H=I-$))&&error("overflow"),k*=H;X=adapt(K-R,w=q.length+1,0==R),V(K/w)>L-Q&&error("overflow"),Q+=V(K/w),K%=w,q.splice(K++,0,Q)}return ucs2encode(q)}function encode(_){var w,E,C,P,R,k,F,j,$,z,q,G,K,Q,X,J=[];for(G=(_=ucs2decode(_)).length,w=128,E=0,R=72,k=0;k<G;++k)(q=_[k])<128&&J.push(H(q));for(C=P=J.length,P&&J.push("-");C<G;){for(F=L,k=0;k<G;++k)(q=_[k])>=w&&q<F&&(F=q);for(F-w>V((L-E)/(K=C+1))&&error("overflow"),E+=(F-w)*K,w=F,k=0;k<G;++k)if((q=_[k])<w&&++E>L&&error("overflow"),q==w){for(j=E,$=I;!(j<(z=$<=R?1:$>=R+26?26:$-R));$+=I)X=j-z,Q=I-z,J.push(H(digitToBasic(z+X%Q,0))),j=V(X/Q);J.push(H(digitToBasic(j,0))),R=adapt(E,K,C==P),E=0,++C}++E,++w}return J.join("")}if(P={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:function toASCII(_){return mapDomain(_,(function(_){return F.test(_)?"xn--"+encode(_):_}))},toUnicode:function toUnicode(_){return mapDomain(_,(function(_){return k.test(_)?decode(_.slice(4).toLowerCase()):_}))}},w&&E)if(vs.exports==w)E.exports=P;else for(R in P)P.hasOwnProperty(R)&&(w[R]=P[R]);else _.punycode=P}(ze);var As=qe.inspect,Os="function"==typeof Map&&Map.prototype,Cs=Object.getOwnPropertyDescriptor&&Os?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ps=Os&&Cs&&"function"==typeof Cs.get?Cs.get:null,Rs=Os&&Map.prototype.forEach,xs="function"==typeof Set&&Set.prototype,Ls=Object.getOwnPropertyDescriptor&&xs?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Is=xs&&Ls&&"function"==typeof Ls.get?Ls.get:null,Ns=xs&&Set.prototype.forEach,Ds="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,ks="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Fs="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,js=Boolean.prototype.valueOf,Ms=Object.prototype.toString,$s=Function.prototype.toString,Bs=String.prototype.match,Us=String.prototype.slice,Vs=String.prototype.replace,Hs=String.prototype.toUpperCase,zs=String.prototype.toLowerCase,qs=RegExp.prototype.test,Ws=Array.prototype.concat,Gs=Array.prototype.join,Ks=Array.prototype.slice,Qs=Math.floor,Xs="function"==typeof BigInt?BigInt.prototype.valueOf:null,Js=Object.getOwnPropertySymbols,Zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Ys="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ea="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ys||"symbol")?Symbol.toStringTag:null,ta=Object.prototype.propertyIsEnumerable,ra=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(_){return _.__proto__}:null);function addNumericSeparator$1(_,w){if(_===1/0||_===-1/0||_!=_||_&&_>-1e3&&_<1e3||qs.call(/e/,w))return w;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof _){var C=_<0?-Qs(-_):Qs(_);if(C!==_){var P=String(C),R=Us.call(w,P.length+1);return Vs.call(P,E,"$&_")+"."+Vs.call(Vs.call(R,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Vs.call(w,E,"$&_")}var na=As,oa=na.custom,ia=isSymbol$1(oa)?oa:null,sa={__proto__:null,double:'"',single:"'"},aa={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ca=function inspect_(_,w,E,C){var P=w||{};if(has$4(P,"quoteStyle")&&!has$4(sa,P.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$4(P,"maxStringLength")&&("number"==typeof P.maxStringLength?P.maxStringLength<0&&P.maxStringLength!==1/0:null!==P.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var R=!has$4(P,"customInspect")||P.customInspect;if("boolean"!=typeof R&&"symbol"!==R)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$4(P,"indent")&&null!==P.indent&&"\t"!==P.indent&&!(parseInt(P.indent,10)===P.indent&&P.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$4(P,"numericSeparator")&&"boolean"!=typeof P.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var L=P.numericSeparator;if(void 0===_)return"undefined";if(null===_)return"null";if("boolean"==typeof _)return _?"true":"false";if("string"==typeof _)return inspectString$1(_,P);if("number"==typeof _){if(0===_)return 1/0/_>0?"0":"-0";var I=String(_);return L?addNumericSeparator$1(_,I):I}if("bigint"==typeof _){var k=String(_)+"n";return L?addNumericSeparator$1(_,k):k}var F=void 0===P.depth?5:P.depth;if(void 0===E&&(E=0),E>=F&&F>0&&"object"==typeof _)return isArray$5(_)?"[Array]":"[Object]";var j=function getIndent$1(_,w){var E;if("\t"===_.indent)E="\t";else{if(!("number"==typeof _.indent&&_.indent>0))return null;E=Gs.call(Array(_.indent+1)," ")}return{base:E,prev:Gs.call(Array(w+1),E)}}(P,E);if(void 0===C)C=[];else if(indexOf$1(C,_)>=0)return"[Circular]";function inspect(_,w,R){if(w&&(C=Ks.call(C)).push(w),R){var L={depth:P.depth};return has$4(P,"quoteStyle")&&(L.quoteStyle=P.quoteStyle),inspect_(_,L,E+1,C)}return inspect_(_,P,E+1,C)}if("function"==typeof _&&!isRegExp$2(_)){var $=function nameOf$1(_){if(_.name)return _.name;var w=Bs.call($s.call(_),/^function\s*([\w$]+)/);if(w)return w[1];return null}(_),V=arrObjKeys$1(_,inspect);return"[Function"+($?": "+$:" (anonymous)")+"]"+(V.length>0?" { "+Gs.call(V,", ")+" }":"")}if(isSymbol$1(_)){var H=Ys?Vs.call(String(_),/^(Symbol\(.*\))_[^)]*$/,"$1"):Zs.call(_);return"object"!=typeof _||Ys?H:markBoxed$1(H)}if(function isElement$1(_){if(!_||"object"!=typeof _)return!1;if("undefined"!=typeof HTMLElement&&_ instanceof HTMLElement)return!0;return"string"==typeof _.nodeName&&"function"==typeof _.getAttribute}(_)){for(var z="<"+zs.call(String(_.nodeName)),q=_.attributes||[],G=0;G<q.length;G++)z+=" "+q[G].name+"="+wrapQuotes$1(quote$1(q[G].value),"double",P);return z+=">",_.childNodes&&_.childNodes.length&&(z+="..."),z+="</"+zs.call(String(_.nodeName))+">"}if(isArray$5(_)){if(0===_.length)return"[]";var K=arrObjKeys$1(_,inspect);return j&&!function singleLineValues$1(_){for(var w=0;w<_.length;w++)if(indexOf$1(_[w],"\n")>=0)return!1;return!0}(K)?"["+indentedJoin$1(K,j)+"]":"[ "+Gs.call(K,", ")+" ]"}if(function isError$1(_){return"[object Error]"===toStr$1(_)&&canTrustToString(_)}(_)){var Q=arrObjKeys$1(_,inspect);return"cause"in Error.prototype||!("cause"in _)||ta.call(_,"cause")?0===Q.length?"["+String(_)+"]":"{ ["+String(_)+"] "+Gs.call(Q,", ")+" }":"{ ["+String(_)+"] "+Gs.call(Ws.call("[cause]: "+inspect(_.cause),Q),", ")+" }"}if("object"==typeof _&&R){if(ia&&"function"==typeof _[ia]&&na)return na(_,{depth:F-E});if("symbol"!==R&&"function"==typeof _.inspect)return _.inspect()}if(function isMap$1(_){if(!Ps||!_||"object"!=typeof _)return!1;try{Ps.call(_);try{Is.call(_)}catch(_){return!0}return _ instanceof Map}catch(_){}return!1}(_)){var X=[];return Rs&&Rs.call(_,(function(w,E){X.push(inspect(E,_,!0)+" => "+inspect(w,_))})),collectionOf$1("Map",Ps.call(_),X,j)}if(function isSet$1(_){if(!Is||!_||"object"!=typeof _)return!1;try{Is.call(_);try{Ps.call(_)}catch(_){return!0}return _ instanceof Set}catch(_){}return!1}(_)){var J=[];return Ns&&Ns.call(_,(function(w){J.push(inspect(w,_))})),collectionOf$1("Set",Is.call(_),J,j)}if(function isWeakMap$1(_){if(!Ds||!_||"object"!=typeof _)return!1;try{Ds.call(_,Ds);try{ks.call(_,ks)}catch(_){return!0}return _ instanceof WeakMap}catch(_){}return!1}(_))return weakCollectionOf$1("WeakMap");if(function isWeakSet$1(_){if(!ks||!_||"object"!=typeof _)return!1;try{ks.call(_,ks);try{Ds.call(_,Ds)}catch(_){return!0}return _ instanceof WeakSet}catch(_){}return!1}(_))return weakCollectionOf$1("WeakSet");if(function isWeakRef$1(_){if(!Fs||!_||"object"!=typeof _)return!1;try{return Fs.call(_),!0}catch(_){}return!1}(_))return weakCollectionOf$1("WeakRef");if(function isNumber$1(_){return"[object Number]"===toStr$1(_)&&canTrustToString(_)}(_))return markBoxed$1(inspect(Number(_)));if(function isBigInt$1(_){if(!_||"object"!=typeof _||!Xs)return!1;try{return Xs.call(_),!0}catch(_){}return!1}(_))return markBoxed$1(inspect(Xs.call(_)));if(function isBoolean$1(_){return"[object Boolean]"===toStr$1(_)&&canTrustToString(_)}(_))return markBoxed$1(js.call(_));if(function isString$1(_){return"[object String]"===toStr$1(_)&&canTrustToString(_)}(_))return markBoxed$1(inspect(String(_)));if("undefined"!=typeof window&&_===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&_===globalThis||void 0!==ze&&_===ze)return"{ [object globalThis] }";if(!function isDate$1(_){return"[object Date]"===toStr$1(_)&&canTrustToString(_)}(_)&&!isRegExp$2(_)){var Z=arrObjKeys$1(_,inspect),Y=ra?ra(_)===Object.prototype:_ instanceof Object||_.constructor===Object,ee=_ instanceof Object?"":"null prototype",te=!Y&&ea&&Object(_)===_&&ea in _?Us.call(toStr$1(_),8,-1):ee?"Object":"",re=(Y||"function"!=typeof _.constructor?"":_.constructor.name?_.constructor.name+" ":"")+(te||ee?"["+Gs.call(Ws.call([],te||[],ee||[]),": ")+"] ":"");return 0===Z.length?re+"{}":j?re+"{"+indentedJoin$1(Z,j)+"}":re+"{ "+Gs.call(Z,", ")+" }"}return String(_)};function wrapQuotes$1(_,w,E){var C=E.quoteStyle||w,P=sa[C];return P+_+P}function quote$1(_){return Vs.call(String(_),/"/g,""")}function canTrustToString(_){return!ea||!("object"==typeof _&&(ea in _||void 0!==_[ea]))}function isArray$5(_){return"[object Array]"===toStr$1(_)&&canTrustToString(_)}function isRegExp$2(_){return"[object RegExp]"===toStr$1(_)&&canTrustToString(_)}function isSymbol$1(_){if(Ys)return _&&"object"==typeof _&&_ instanceof Symbol;if("symbol"==typeof _)return!0;if(!_||"object"!=typeof _||!Zs)return!1;try{return Zs.call(_),!0}catch(_){}return!1}var ua=Object.prototype.hasOwnProperty||function(_){return _ in this};function has$4(_,w){return ua.call(_,w)}function toStr$1(_){return Ms.call(_)}function indexOf$1(_,w){if(_.indexOf)return _.indexOf(w);for(var E=0,C=_.length;E<C;E++)if(_[E]===w)return E;return-1}function inspectString$1(_,w){if(_.length>w.maxStringLength){var E=_.length-w.maxStringLength,C="... "+E+" more character"+(E>1?"s":"");return inspectString$1(Us.call(_,0,w.maxStringLength),w)+C}var P=aa[w.quoteStyle||"single"];return P.lastIndex=0,wrapQuotes$1(Vs.call(Vs.call(_,P,"\\$1"),/[\x00-\x1f]/g,lowbyte$1),"single",w)}function lowbyte$1(_){var w=_.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[w];return E?"\\"+E:"\\x"+(w<16?"0":"")+Hs.call(w.toString(16))}function markBoxed$1(_){return"Object("+_+")"}function weakCollectionOf$1(_){return _+" { ? }"}function collectionOf$1(_,w,E,C){return _+" ("+w+") {"+(C?indentedJoin$1(E,C):Gs.call(E,", "))+"}"}function indentedJoin$1(_,w){if(0===_.length)return"";var E="\n"+w.prev+w.base;return E+Gs.call(_,","+E)+"\n"+w.prev}function arrObjKeys$1(_,w){var E=isArray$5(_),C=[];if(E){C.length=_.length;for(var P=0;P<_.length;P++)C[P]=has$4(_,P)?w(_[P],_):""}var R,L="function"==typeof Js?Js(_):[];if(Ys){R={};for(var I=0;I<L.length;I++)R["$"+L[I]]=L[I]}for(var k in _)has$4(_,k)&&(E&&String(Number(k))===k&&k<_.length||Ys&&R["$"+k]instanceof Symbol||(qs.call(/[^\w$]/,k)?C.push(w(k,_)+": "+w(_[k],_)):C.push(k+": "+w(_[k],_))));if("function"==typeof Js)for(var F=0;F<L.length;F++)ta.call(_,L[F])&&C.push("["+w(L[F])+"]: "+w(_[L[F]],_));return C}var la=ca,pa=rt,listGetNode=function(_,w,E){for(var C,P=_;null!=(C=P.next);P=C)if(C.key===w)return P.next=C.next,E||(C.next=_.next,_.next=C),C},da=qe.inspect,fa="function"==typeof Map&&Map.prototype,ha=Object.getOwnPropertyDescriptor&&fa?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ga=fa&&ha&&"function"==typeof ha.get?ha.get:null,ma=fa&&Map.prototype.forEach,ya="function"==typeof Set&&Set.prototype,ba=Object.getOwnPropertyDescriptor&&ya?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_a=ya&&ba&&"function"==typeof ba.get?ba.get:null,va=ya&&Set.prototype.forEach,Sa="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,wa="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Ea="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Ta=Boolean.prototype.valueOf,Aa=Object.prototype.toString,Oa=Function.prototype.toString,Ca=String.prototype.match,Pa=String.prototype.slice,Ra=String.prototype.replace,xa=String.prototype.toUpperCase,La=String.prototype.toLowerCase,Ia=RegExp.prototype.test,Na=Array.prototype.concat,Da=Array.prototype.join,ka=Array.prototype.slice,Fa=Math.floor,ja="function"==typeof BigInt?BigInt.prototype.valueOf:null,Ma=Object.getOwnPropertySymbols,$a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Ba="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Ua="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ba||"symbol")?Symbol.toStringTag:null,Va=Object.prototype.propertyIsEnumerable,Ha=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(_){return _.__proto__}:null);function addNumericSeparator(_,w){if(_===1/0||_===-1/0||_!=_||_&&_>-1e3&&_<1e3||Ia.call(/e/,w))return w;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof _){var C=_<0?-Fa(-_):Fa(_);if(C!==_){var P=String(C),R=Pa.call(w,P.length+1);return Ra.call(P,E,"$&_")+"."+Ra.call(Ra.call(R,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ra.call(w,E,"$&_")}var za=da,qa=za.custom,Wa=isSymbol(qa)?qa:null,Ga={__proto__:null,double:'"',single:"'"},Ka={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Qa=function inspect_(_,w,E,C){var P=w||{};if(has$3(P,"quoteStyle")&&!has$3(Ga,P.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(P,"maxStringLength")&&("number"==typeof P.maxStringLength?P.maxStringLength<0&&P.maxStringLength!==1/0:null!==P.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var R=!has$3(P,"customInspect")||P.customInspect;if("boolean"!=typeof R&&"symbol"!==R)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(P,"indent")&&null!==P.indent&&"\t"!==P.indent&&!(parseInt(P.indent,10)===P.indent&&P.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(P,"numericSeparator")&&"boolean"!=typeof P.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var L=P.numericSeparator;if(void 0===_)return"undefined";if(null===_)return"null";if("boolean"==typeof _)return _?"true":"false";if("string"==typeof _)return inspectString(_,P);if("number"==typeof _){if(0===_)return 1/0/_>0?"0":"-0";var I=String(_);return L?addNumericSeparator(_,I):I}if("bigint"==typeof _){var k=String(_)+"n";return L?addNumericSeparator(_,k):k}var F=void 0===P.depth?5:P.depth;if(void 0===E&&(E=0),E>=F&&F>0&&"object"==typeof _)return isArray$4(_)?"[Array]":"[Object]";var j=function getIndent(_,w){var E;if("\t"===_.indent)E="\t";else{if(!("number"==typeof _.indent&&_.indent>0))return null;E=Da.call(Array(_.indent+1)," ")}return{base:E,prev:Da.call(Array(w+1),E)}}(P,E);if(void 0===C)C=[];else if(indexOf(C,_)>=0)return"[Circular]";function inspect(_,w,R){if(w&&(C=ka.call(C)).push(w),R){var L={depth:P.depth};return has$3(P,"quoteStyle")&&(L.quoteStyle=P.quoteStyle),inspect_(_,L,E+1,C)}return inspect_(_,P,E+1,C)}if("function"==typeof _&&!isRegExp$1(_)){var $=function nameOf(_){if(_.name)return _.name;var w=Ca.call(Oa.call(_),/^function\s*([\w$]+)/);if(w)return w[1];return null}(_),V=arrObjKeys(_,inspect);return"[Function"+($?": "+$:" (anonymous)")+"]"+(V.length>0?" { "+Da.call(V,", ")+" }":"")}if(isSymbol(_)){var H=Ba?Ra.call(String(_),/^(Symbol\(.*\))_[^)]*$/,"$1"):$a.call(_);return"object"!=typeof _||Ba?H:markBoxed(H)}if(function isElement(_){if(!_||"object"!=typeof _)return!1;if("undefined"!=typeof HTMLElement&&_ instanceof HTMLElement)return!0;return"string"==typeof _.nodeName&&"function"==typeof _.getAttribute}(_)){for(var z="<"+La.call(String(_.nodeName)),q=_.attributes||[],G=0;G<q.length;G++)z+=" "+q[G].name+"="+wrapQuotes(quote(q[G].value),"double",P);return z+=">",_.childNodes&&_.childNodes.length&&(z+="..."),z+="</"+La.call(String(_.nodeName))+">"}if(isArray$4(_)){if(0===_.length)return"[]";var K=arrObjKeys(_,inspect);return j&&!function singleLineValues(_){for(var w=0;w<_.length;w++)if(indexOf(_[w],"\n")>=0)return!1;return!0}(K)?"["+indentedJoin(K,j)+"]":"[ "+Da.call(K,", ")+" ]"}if(function isError(_){return!("[object Error]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_)){var Q=arrObjKeys(_,inspect);return"cause"in Error.prototype||!("cause"in _)||Va.call(_,"cause")?0===Q.length?"["+String(_)+"]":"{ ["+String(_)+"] "+Da.call(Q,", ")+" }":"{ ["+String(_)+"] "+Da.call(Na.call("[cause]: "+inspect(_.cause),Q),", ")+" }"}if("object"==typeof _&&R){if(Wa&&"function"==typeof _[Wa]&&za)return za(_,{depth:F-E});if("symbol"!==R&&"function"==typeof _.inspect)return _.inspect()}if(function isMap(_){if(!ga||!_||"object"!=typeof _)return!1;try{ga.call(_);try{_a.call(_)}catch(_){return!0}return _ instanceof Map}catch(_){}return!1}(_)){var X=[];return ma&&ma.call(_,(function(w,E){X.push(inspect(E,_,!0)+" => "+inspect(w,_))})),collectionOf("Map",ga.call(_),X,j)}if(function isSet(_){if(!_a||!_||"object"!=typeof _)return!1;try{_a.call(_);try{ga.call(_)}catch(_){return!0}return _ instanceof Set}catch(_){}return!1}(_)){var J=[];return va&&va.call(_,(function(w){J.push(inspect(w,_))})),collectionOf("Set",_a.call(_),J,j)}if(function isWeakMap(_){if(!Sa||!_||"object"!=typeof _)return!1;try{Sa.call(_,Sa);try{wa.call(_,wa)}catch(_){return!0}return _ instanceof WeakMap}catch(_){}return!1}(_))return weakCollectionOf("WeakMap");if(function isWeakSet(_){if(!wa||!_||"object"!=typeof _)return!1;try{wa.call(_,wa);try{Sa.call(_,Sa)}catch(_){return!0}return _ instanceof WeakSet}catch(_){}return!1}(_))return weakCollectionOf("WeakSet");if(function isWeakRef(_){if(!Ea||!_||"object"!=typeof _)return!1;try{return Ea.call(_),!0}catch(_){}return!1}(_))return weakCollectionOf("WeakRef");if(function isNumber(_){return!("[object Number]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_))return markBoxed(inspect(Number(_)));if(function isBigInt(_){if(!_||"object"!=typeof _||!ja)return!1;try{return ja.call(_),!0}catch(_){}return!1}(_))return markBoxed(inspect(ja.call(_)));if(function isBoolean(_){return!("[object Boolean]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_))return markBoxed(Ta.call(_));if(function isString(_){return!("[object String]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_))return markBoxed(inspect(String(_)));if("undefined"!=typeof window&&_===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&_===globalThis||void 0!==ze&&_===ze)return"{ [object globalThis] }";if(!function isDate(_){return!("[object Date]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}(_)&&!isRegExp$1(_)){var Z=arrObjKeys(_,inspect),Y=Ha?Ha(_)===Object.prototype:_ instanceof Object||_.constructor===Object,ee=_ instanceof Object?"":"null prototype",te=!Y&&Ua&&Object(_)===_&&Ua in _?Pa.call(toStr(_),8,-1):ee?"Object":"",re=(Y||"function"!=typeof _.constructor?"":_.constructor.name?_.constructor.name+" ":"")+(te||ee?"["+Da.call(Na.call([],te||[],ee||[]),": ")+"] ":"");return 0===Z.length?re+"{}":j?re+"{"+indentedJoin(Z,j)+"}":re+"{ "+Da.call(Z,", ")+" }"}return String(_)};function wrapQuotes(_,w,E){var C=E.quoteStyle||w,P=Ga[C];return P+_+P}function quote(_){return Ra.call(String(_),/"/g,""")}function isArray$4(_){return!("[object Array]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}function isRegExp$1(_){return!("[object RegExp]"!==toStr(_)||Ua&&"object"==typeof _&&Ua in _)}function isSymbol(_){if(Ba)return _&&"object"==typeof _&&_ instanceof Symbol;if("symbol"==typeof _)return!0;if(!_||"object"!=typeof _||!$a)return!1;try{return $a.call(_),!0}catch(_){}return!1}var Xa=Object.prototype.hasOwnProperty||function(_){return _ in this};function has$3(_,w){return Xa.call(_,w)}function toStr(_){return Aa.call(_)}function indexOf(_,w){if(_.indexOf)return _.indexOf(w);for(var E=0,C=_.length;E<C;E++)if(_[E]===w)return E;return-1}function inspectString(_,w){if(_.length>w.maxStringLength){var E=_.length-w.maxStringLength,C="... "+E+" more character"+(E>1?"s":"");return inspectString(Pa.call(_,0,w.maxStringLength),w)+C}var P=Ka[w.quoteStyle||"single"];return P.lastIndex=0,wrapQuotes(Ra.call(Ra.call(_,P,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",w)}function lowbyte(_){var w=_.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[w];return E?"\\"+E:"\\x"+(w<16?"0":"")+xa.call(w.toString(16))}function markBoxed(_){return"Object("+_+")"}function weakCollectionOf(_){return _+" { ? }"}function collectionOf(_,w,E,C){return _+" ("+w+") {"+(C?indentedJoin(E,C):Da.call(E,", "))+"}"}function indentedJoin(_,w){if(0===_.length)return"";var E="\n"+w.prev+w.base;return E+Da.call(_,","+E)+"\n"+w.prev}function arrObjKeys(_,w){var E=isArray$4(_),C=[];if(E){C.length=_.length;for(var P=0;P<_.length;P++)C[P]=has$3(_,P)?w(_[P],_):""}var R,L="function"==typeof Ma?Ma(_):[];if(Ba){R={};for(var I=0;I<L.length;I++)R["$"+L[I]]=L[I]}for(var k in _)has$3(_,k)&&(E&&String(Number(k))===k&&k<_.length||Ba&&R["$"+k]instanceof Symbol||(Ia.call(/[^\w$]/,k)?C.push(w(k,_)+": "+w(_[k],_)):C.push(k+": "+w(_[k],_))));if("function"==typeof Ma)for(var F=0;F<L.length;F++)Va.call(_,L[F])&&C.push("["+w(L[F])+"]: "+w(_[L[F]],_));return C}var Ja=Ur,Za=Qa,Ya=rt,ec=jr("%Map%",!0),tc=Ja("Map.prototype.get",!0),rc=Ja("Map.prototype.set",!0),nc=Ja("Map.prototype.has",!0),oc=Ja("Map.prototype.delete",!0),ic=Ja("Map.prototype.size",!0),sc=!!ec&&function getSideChannelMap(){var _,w={assert:function(_){if(!w.has(_))throw new Ya("Side channel does not contain "+Za(_))},delete:function(w){if(_){var E=oc(_,w);return 0===ic(_)&&(_=void 0),E}return!1},get:function(w){if(_)return tc(_,w)},has:function(w){return!!_&&nc(_,w)},set:function(w,E){_||(_=new ec),rc(_,w,E)}};return w},ac=Ur,cc=Qa,uc=sc,lc=rt,pc=jr("%WeakMap%",!0),dc=ac("WeakMap.prototype.get",!0),fc=ac("WeakMap.prototype.set",!0),hc=ac("WeakMap.prototype.has",!0),gc=ac("WeakMap.prototype.delete",!0),mc=rt,yc=ca,bc=function getSideChannelList(){var _,w={assert:function(_){if(!w.has(_))throw new pa("Side channel does not contain "+la(_))},delete:function(w){var E=function(_,w){if(_)return listGetNode(_,w,!0)}(_,w);return E&&_&&!_.next&&(_=void 0),!!E},get:function(w){return function(_,w){if(_){var E=listGetNode(_,w);return E&&E.value}}(_,w)},has:function(w){return function(_,w){return!!_&&!!listGetNode(_,w)}(_,w)},set:function(w,E){_||(_={next:void 0}),function(_,w,E){var C=listGetNode(_,w);C?C.value=E:_.next={key:w,next:_.next,value:E}}(_,w,E)}};return w},_c=(pc?function getSideChannelWeakMap(){var _,w,E={assert:function(_){if(!E.has(_))throw new lc("Side channel does not contain "+cc(_))},delete:function(E){if(pc&&E&&("object"==typeof E||"function"==typeof E)){if(_)return gc(_,E)}else if(uc&&w)return w.delete(E);return!1},get:function(E){return pc&&E&&("object"==typeof E||"function"==typeof E)&&_?dc(_,E):w&&w.get(E)},has:function(E){return pc&&E&&("object"==typeof E||"function"==typeof E)&&_?hc(_,E):!!w&&w.has(E)},set:function(E,C){pc&&E&&("object"==typeof E||"function"==typeof E)?(_||(_=new pc),fc(_,E,C)):uc&&(w||(w=uc()),w.set(E,C))}};return E}:uc)||sc||bc,vc=function getSideChannel(){var _,w={assert:function(_){if(!w.has(_)){var E=_&&Object(_)===_?"the given object key":yc(_);throw new mc("Side channel does not contain "+E)}},delete:function(w){return!!_&&_.delete(w)},get:function(w){return _&&_.get(w)},has:function(w){return!!_&&_.has(w)},set:function(w,E){_||(_=_c()),_.set(w,E)}};return w},Sc=String.prototype.replace,wc=/%20/g,Ec="RFC3986",Tc={default:Ec,formatters:{RFC1738:function(_){return Sc.call(_,wc,"+")},RFC3986:function(_){return String(_)}},RFC1738:"RFC1738",RFC3986:Ec},Ac=Tc,Oc=vc,Cc=mt,Pc=Object.prototype.hasOwnProperty,Rc=Array.isArray,xc=Oc(),Lc=function markOverflow(_,w){return xc.set(_,w),_},Ic=function isOverflow(_){return xc.has(_)},Nc=function getMaxIndex(_){return xc.get(_)},Dc=function setMaxIndex(_,w){xc.set(_,w)},kc=function(){for(var _=[],w=0;w<256;++w)_[_.length]="%"+((w<16?"0":"")+w.toString(16)).toUpperCase();return _}(),Fc=function arrayToObject(_,w){for(var E=w&&w.plainObjects?{__proto__:null}:{},C=0;C<_.length;++C)void 0!==_[C]&&(E[C]=_[C]);return E},jc=function setProperty(_,w,E){"__proto__"===w&&Cc?Cc(_,w,{configurable:!0,enumerable:!0,value:E,writable:!0}):_[w]=E},Mc=1024,$c={arrayToObject:Fc,assign:function assignSingleSource(_,w){return Object.keys(w).reduce((function(_,E){return jc(_,E,w[E]),_}),_)},combine:function combine(_,w,E,C,P){if(Ic(_)){if(P)throw new RangeError("Array limit exceeded. Only "+E+" element"+(1===E?"":"s")+" allowed in an array.");for(var R=Rc(w)?w:[w],L=Nc(_),I=0;I<R.length;++I)_[L+=1]=R[I];return Dc(_,L),_}var k=[].concat(_,w);if(k.length>E){if(P)throw new RangeError("Array limit exceeded. Only "+E+" element"+(1===E?"":"s")+" allowed in an array.");return Lc(Fc(k,{plainObjects:C}),k.length-1)}return k},compact:function compact(_){for(var w=[{obj:{o:_},prop:"o"}],E=Oc(),C=0;C<w.length;++C)for(var P=w[C],R=P.obj[P.prop],L=Object.keys(R),I=0;I<L.length;++I){var k=L[I],F=R[k];"object"!=typeof F||null===F||E.has(F)||(w[w.length]={obj:R,prop:k},E.set(F,!0))}return function compactQueue(_){for(;_.length>1;){var w=_.pop(),E=w.obj[w.prop];if(Rc(E)){for(var C=[],P=0;P<E.length;++P)void 0!==E[P]&&(C[C.length]=E[P]);w.obj[w.prop]=C}}}(w),_},decode:function(_,w,E){var C=_.replace(/\+/g," ");if("iso-8859-1"===E)return C.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(C)}catch(_){return C}},encode:function encode(_,w,E,C,P){if(0===_.length)return _;var R=_;if("symbol"==typeof _?R=Symbol.prototype.toString.call(_):"string"!=typeof _&&(R=String(_)),"iso-8859-1"===E)return escape(R).replace(/%u[0-9a-f]{4}/gi,(function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"}));for(var L="",I=0;I<R.length;I+=Mc){var k=R.length>=Mc?R.slice(I,I+Mc):R;if(I+Mc<R.length){var F=k.charCodeAt(k.length-1);F>=55296&&F<=56319&&(k=k.slice(0,-1),I-=1)}for(var j=[],$=0;$<k.length;++$){var V=k.charCodeAt($);45===V||46===V||95===V||126===V||V>=48&&V<=57||V>=65&&V<=90||V>=97&&V<=122||P===Ac.RFC1738&&(40===V||41===V)?j[j.length]=k.charAt($):V<128?j[j.length]=kc[V]:V<2048?j[j.length]=kc[192|V>>6]+kc[128|63&V]:V<55296||V>=57344?j[j.length]=kc[224|V>>12]+kc[128|V>>6&63]+kc[128|63&V]:($+=1,V=65536+((1023&V)<<10|1023&k.charCodeAt($)),j[j.length]=kc[240|V>>18]+kc[128|V>>12&63]+kc[128|V>>6&63]+kc[128|63&V])}L+=j.join("")}return L},isBuffer:function isBuffer(_){return!(!_||"object"!=typeof _)&&!(!_.constructor||"function"!=typeof _.constructor.isBuffer||!_.constructor.isBuffer(_))},isOverflow:Ic,isRegExp:function isRegExp(_){return"[object RegExp]"===Object.prototype.toString.call(_)},markOverflow:Lc,maybeMap:function maybeMap(_,w){if(Rc(_)){for(var E=[],C=0;C<_.length;C+=1)E[E.length]=w(_[C]);return E}return w(_)},merge:function merge(_,w,E){if(!w)return _;if("object"!=typeof w&&"function"!=typeof w){if(Rc(_)){var C=_.length;if(E&&"number"==typeof E.arrayLimit&&C>=E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");return Lc(Fc(_.concat(w),E),C)}_[C]=w}else{if(!_||"object"!=typeof _)return[_,w];if(Ic(_)){var P=Nc(_)+1;_[P]=w,Dc(_,P)}else{if(E&&E.strictMerge)return[_,w];(E&&(E.plainObjects||E.allowPrototypes)||!Pc.call(Object.prototype,w))&&(_[w]=!0)}}return _}if(!_||"object"!=typeof _){if(Ic(w)){for(var R=Object.keys(w),L=E&&E.plainObjects?{__proto__:null,0:_}:{0:_},I=0;I<R.length;I++){L[parseInt(R[I],10)+1]=w[R[I]]}return Lc(L,Nc(w)+1)}var k=[_].concat(w);if(E&&"number"==typeof E.arrayLimit&&k.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");return Lc(Fc(k,E),k.length-1)}return k}var F=_;if(Rc(_)&&!Rc(w)&&(F=Fc(_,E)),Rc(_)&&Rc(w)){if(w.forEach((function(w,C){if(Pc.call(_,C)){var P=_[C];P&&"object"==typeof P&&w&&"object"==typeof w?_[C]=merge(P,w,E):_[_.length]=w}else _[C]=w})),E&&"number"==typeof E.arrayLimit&&_.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");return Lc(Fc(_,E),_.length-1)}return _}return Object.keys(w).reduce((function(_,C){var P=w[C];if(Pc.call(_,C)?jc(_,C,merge(_[C],P,E)):jc(_,C,P),Ic(w)&&!Ic(_)&&Lc(_,Nc(w)),Ic(_)){var R=parseInt(C,10);String(R)===C&&R>=0&&R>Nc(_)&&Dc(_,R)}return _}),F)}},Bc=vc,Uc=$c,Vc=Tc,Hc=Object.prototype.hasOwnProperty,zc={brackets:function brackets(_){return _+"[]"},comma:"comma",indices:function indices(_,w){return _+"["+w+"]"},repeat:function repeat(_){return _}},qc=Array.isArray,Wc=Array.prototype.push,pushToArray=function(_,w){Wc.apply(_,qc(w)?w:[w])},Gc=Date.prototype.toISOString,Kc=Vc.default,Qc={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",depth:1/0,encode:!0,encodeDotInKeys:!1,encoder:Uc.encode,encodeValuesOnly:!1,filter:void 0,format:Kc,formatter:Vc.formatters[Kc],indices:!1,serializeDate:function serializeDate(_){return Gc.call(_)},skipNulls:!1,strictNullHandling:!1},Xc={},Jc=function stringify(_,w,E,C,P,R,L,I,k,F,j,$,V,H,z,q,G,K,Q,X){var J=_;if(X>Q)throw new RangeError("Input depth exceeded depth option of "+Q);for(var Z=K,Y=0,ee=!1;void 0!==(Z=Z.get(Xc))&&!ee;){var te=Z.get(_);if(Y+=1,void 0!==te){if(te===Y)throw new RangeError("Cyclic object value");ee=!0}void 0===Z.get(Xc)&&(Y=0)}if((J="function"==typeof F?F(w,J):J)instanceof Date?J=V(J):"comma"===E&&qc(J)&&(J=Uc.maybeMap(J,(function(_){return _ instanceof Date?V(_):_}))),null===J){if(R)return z(k&&!q?k(w,Qc.encoder,G,"key",H):w);J=""}if(function isNonNullishPrimitive(_){return"string"==typeof _||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _}(J)||Uc.isBuffer(J))return k?[z(q?w:k(w,Qc.encoder,G,"key",H))+"="+z(k(J,Qc.encoder,G,"value",H))]:[z(w)+"="+z(String(J))];var re,ne=[];if(void 0===J)return ne;if("comma"===E&&qc(J))q&&k&&(J=Uc.maybeMap(J,(function(_){return null==_?_:k(_)}))),re=[{value:J.length>0?J.join(",")||null:void 0}];else if(qc(F))re=F;else{var oe=Object.keys(J);re=j?oe.sort(j):oe}var ie=I?String(w).replace(/\./g,"%2E"):String(w),se=C&&qc(J)&&1===J.length?ie+"[]":ie;if(P&&qc(J)&&0===J.length&&0===Object.keys(J).length)return se+"[]";for(var ae=0;ae<re.length;++ae){var ce=re[ae],ue="object"==typeof ce&&ce&&void 0!==ce.value?ce.value:J[ce];if(!L||null!==ue){var le=$&&I?String(ce).replace(/\./g,"%2E"):String(ce),pe=qc(J)?"function"==typeof E?E(se,le):se:se+($?"."+le:"["+le+"]");K.set(_,Y);var de=Bc();de.set(Xc,K),pushToArray(ne,stringify(ue,pe,E,C,P,R,L,I,"comma"===E&&q&&qc(J)?null:k,F,j,$,V,H,z,q,G,de,Q,X+1))}}return ne},Zc=$c,Yc=Object.prototype.hasOwnProperty,eu=Array.isArray,tu={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Zc.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},interpretNumericEntities=function(_){return _.replace(/&#(\d+);/g,(function(_,w){return String.fromCharCode(parseInt(w,10))}))},parseArrayValue=function(_,w,E){if(_&&"string"==typeof _&&w.comma&&_.indexOf(",")>-1){if(w.throwOnLimitExceeded)for(var C=0,P=_.indexOf(",");P>-1;){if((C+=1)>=w.arrayLimit)throw new RangeError("Array limit exceeded. Only "+w.arrayLimit+" element"+(1===w.arrayLimit?"":"s")+" allowed in an array.");P=_.indexOf(",",P+1)}return _.split(",")}if(w.throwOnLimitExceeded&&E>=w.arrayLimit)throw new RangeError("Array limit exceeded. Only "+w.arrayLimit+" element"+(1===w.arrayLimit?"":"s")+" allowed in an array.");return _},ru=function parseQueryStringKeys(_,w,E,C){if(_){var P=function splitKeyIntoSegments(_,w){var E=w.allowDots?_.replace(/\.([^.[]+)/g,"[$1]"):_;if(w.depth<=0){if(!w.plainObjects&&Yc.call(Object.prototype,E)&&!w.allowPrototypes)return;return[E]}var C=[],P=E.indexOf("["),R=P>=0?E.slice(0,P):E;if(R){if(!w.plainObjects&&Yc.call(Object.prototype,R)&&!w.allowPrototypes)return;C[C.length]=R}for(var L=E.length,I=P,k=0;I>=0&&k<w.depth;){for(var F=1,j=I+1,$=-1;j<L&&$<0;){var V=E.charCodeAt(j);91===V?F+=1:93===V&&0==(F-=1)&&($=j),j+=1}if($<0)return C[C.length]="["+E.slice(I)+"]",C;var H=E.slice(I,$+1),z=H.slice(1,-1);if(!w.plainObjects&&Yc.call(Object.prototype,z)&&!w.allowPrototypes)return;C[C.length]=H,k+=1,I=E.indexOf("[",$+1)}if(I>=0){if(!0===w.strictDepth)throw new RangeError("Input depth exceeded depth option of "+w.depth+" and strictDepth is true");C[C.length]="["+E.slice(I)+"]"}return C}(_,E);if(P)return function(_,w,E,C){var P=0;if(_.length>0&&"[]"===_[_.length-1]){var R=_.slice(0,-1).join("");P=Array.isArray(w)&&w[R]?w[R].length:0}for(var L=C?w:parseArrayValue(w,E,P),I=_.length-1;I>=0;--I){var k,F=_[I];if("[]"===F&&E.parseArrays)k=Zc.isOverflow(L)?L:E.allowEmptyArrays&&(""===L||E.strictNullHandling&&null===L)?[]:Zc.combine([],L,E.arrayLimit,E.plainObjects,E.throwOnLimitExceeded);else{k=E.plainObjects?{__proto__:null}:{};var j="["===F.charAt(0)&&"]"===F.charAt(F.length-1)?F.slice(1,-1):F,$=E.decodeDotInKeys?j.replace(/%2E/g,"."):j,V=parseInt($,10),H=!isNaN(V)&&F!==$&&String(V)===$&&V>=0&&E.parseArrays;if(E.parseArrays||""!==$)if(H&&V<E.arrayLimit)(k=[])[V]=L;else{if(H&&E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(1===E.arrayLimit?"":"s")+" allowed in an array.");H?(k[V]=L,Zc.markOverflow(k,V)):"__proto__"!==$&&(k[$]=L)}else k={0:L}}L=k}return L}(P,w,E,C)}},stringify=function(_,w){var E,C=_,P=function normalizeStringifyOptions(_){if(!_)return Qc;if(void 0!==_.allowEmptyArrays&&"boolean"!=typeof _.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==_.encodeDotInKeys&&"boolean"!=typeof _.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==_.encoder&&void 0!==_.encoder&&"function"!=typeof _.encoder)throw new TypeError("Encoder has to be a function.");var w=_.charset||Qc.charset;if(void 0!==_.charset&&"utf-8"!==_.charset&&"iso-8859-1"!==_.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=Vc.default;if(void 0!==_.format){if(!Hc.call(Vc.formatters,_.format))throw new TypeError("Unknown format option provided.");E=_.format}var C,P=Vc.formatters[E],R=Qc.filter;if(("function"==typeof _.filter||qc(_.filter))&&(R=_.filter),C=_.arrayFormat in zc?_.arrayFormat:"indices"in _?_.indices?"indices":"repeat":Qc.arrayFormat,"commaRoundTrip"in _&&"boolean"!=typeof _.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var L=void 0===_.allowDots?!0===_.encodeDotInKeys||Qc.allowDots:!!_.allowDots;return{addQueryPrefix:"boolean"==typeof _.addQueryPrefix?_.addQueryPrefix:Qc.addQueryPrefix,allowDots:L,allowEmptyArrays:"boolean"==typeof _.allowEmptyArrays?!!_.allowEmptyArrays:Qc.allowEmptyArrays,arrayFormat:C,charset:w,charsetSentinel:"boolean"==typeof _.charsetSentinel?_.charsetSentinel:Qc.charsetSentinel,commaRoundTrip:!!_.commaRoundTrip,delimiter:void 0===_.delimiter?Qc.delimiter:_.delimiter,depth:"number"==typeof _.depth?_.depth:Qc.depth,encode:"boolean"==typeof _.encode?_.encode:Qc.encode,encodeDotInKeys:"boolean"==typeof _.encodeDotInKeys?_.encodeDotInKeys:Qc.encodeDotInKeys,encoder:"function"==typeof _.encoder?_.encoder:Qc.encoder,encodeValuesOnly:"boolean"==typeof _.encodeValuesOnly?_.encodeValuesOnly:Qc.encodeValuesOnly,filter:R,format:E,formatter:P,serializeDate:"function"==typeof _.serializeDate?_.serializeDate:Qc.serializeDate,skipNulls:"boolean"==typeof _.skipNulls?_.skipNulls:Qc.skipNulls,sort:"function"==typeof _.sort?_.sort:null,strictNullHandling:"boolean"==typeof _.strictNullHandling?_.strictNullHandling:Qc.strictNullHandling}}(w);"function"==typeof P.filter?C=(0,P.filter)("",C):qc(P.filter)&&(E=P.filter);var R=[];if("object"!=typeof C||null===C)return"";var L=zc[P.arrayFormat],I="comma"===L&&P.commaRoundTrip;E||(E=Object.keys(C)),P.sort&&E.sort(P.sort);for(var k=Bc(),F=0;F<E.length;++F){var j=E[F];if(null!=j){var $=C[j];if(!P.skipNulls||null!==$){var V=P.encodeDotInKeys?String(j).replace(/\./g,"%2E"):String(j);pushToArray(R,Jc($,V,L,I,P.allowEmptyArrays,P.strictNullHandling,P.skipNulls,P.encodeDotInKeys,P.encode?P.encoder:null,P.filter,P.sort,P.allowDots,P.serializeDate,P.format,P.formatter,P.encodeValuesOnly,P.charset,k,P.depth,0))}}}var H=R.join(P.delimiter),z=!0===P.addQueryPrefix?"?":"";return P.charsetSentinel&&("iso-8859-1"===P.charset?z+="utf8=%26%2310003%3B"+P.delimiter:z+="utf8=%E2%9C%93"+P.delimiter),H.length>0?z+H:""},parse=function(_,w){var E=function normalizeParseOptions(_){if(!_)return tu;if(void 0!==_.allowEmptyArrays&&"boolean"!=typeof _.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==_.decodeDotInKeys&&"boolean"!=typeof _.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==_.decoder&&void 0!==_.decoder&&"function"!=typeof _.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==_.charset&&"utf-8"!==_.charset&&"iso-8859-1"!==_.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==_.throwOnLimitExceeded&&"boolean"!=typeof _.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var w=void 0===_.charset?tu.charset:_.charset,E=void 0===_.duplicates?tu.duplicates:_.duplicates;if("combine"!==E&&"first"!==E&&"last"!==E)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===_.allowDots?!0===_.decodeDotInKeys||tu.allowDots:!!_.allowDots,allowEmptyArrays:"boolean"==typeof _.allowEmptyArrays?!!_.allowEmptyArrays:tu.allowEmptyArrays,allowPrototypes:"boolean"==typeof _.allowPrototypes?_.allowPrototypes:tu.allowPrototypes,allowSparse:"boolean"==typeof _.allowSparse?_.allowSparse:tu.allowSparse,arrayLimit:"number"==typeof _.arrayLimit?_.arrayLimit:tu.arrayLimit,charset:w,charsetSentinel:"boolean"==typeof _.charsetSentinel?_.charsetSentinel:tu.charsetSentinel,comma:"boolean"==typeof _.comma?_.comma:tu.comma,decodeDotInKeys:"boolean"==typeof _.decodeDotInKeys?_.decodeDotInKeys:tu.decodeDotInKeys,decoder:"function"==typeof _.decoder?_.decoder:tu.decoder,delimiter:"string"==typeof _.delimiter||Zc.isRegExp(_.delimiter)?_.delimiter:tu.delimiter,depth:"number"==typeof _.depth||!1===_.depth?+_.depth:tu.depth,duplicates:E,ignoreQueryPrefix:!0===_.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof _.interpretNumericEntities?_.interpretNumericEntities:tu.interpretNumericEntities,parameterLimit:"number"==typeof _.parameterLimit?_.parameterLimit:tu.parameterLimit,parseArrays:!1!==_.parseArrays,plainObjects:"boolean"==typeof _.plainObjects?_.plainObjects:tu.plainObjects,strictDepth:"boolean"==typeof _.strictDepth?!!_.strictDepth:tu.strictDepth,strictMerge:"boolean"==typeof _.strictMerge?!!_.strictMerge:tu.strictMerge,strictNullHandling:"boolean"==typeof _.strictNullHandling?_.strictNullHandling:tu.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof _.throwOnLimitExceeded&&_.throwOnLimitExceeded}}(w);if(""===_||null==_)return E.plainObjects?{__proto__:null}:{};for(var C="string"==typeof _?function parseQueryStringValues(_,w){var E={__proto__:null},C=w.ignoreQueryPrefix?_.replace(/^\?/,""):_;C=C.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var P=w.parameterLimit===1/0?void 0:w.parameterLimit,R=C.split(w.delimiter,w.throwOnLimitExceeded&&void 0!==P?P+1:P);if(w.throwOnLimitExceeded&&void 0!==P&&R.length>P)throw new RangeError("Parameter limit exceeded. Only "+P+" parameter"+(1===P?"":"s")+" allowed.");var L,I=-1,k=w.charset;if(w.charsetSentinel)for(L=0;L<R.length;++L)0===R[L].indexOf("utf8=")&&("utf8=%E2%9C%93"===R[L]?k="utf-8":"utf8=%26%2310003%3B"===R[L]&&(k="iso-8859-1"),I=L,L=R.length);for(L=0;L<R.length;++L)if(L!==I){var F,j,$=R[L],V=$.indexOf("]="),H=-1===V?$.indexOf("="):V+1;if(-1===H?(F=w.decoder($,tu.decoder,k,"key"),j=w.strictNullHandling?null:""):null!==(F=w.decoder($.slice(0,H),tu.decoder,k,"key"))&&(j=Zc.maybeMap(parseArrayValue($.slice(H+1),w,eu(E[F])?E[F].length:0),(function(_){return w.decoder(_,tu.decoder,k,"value")}))),j&&w.interpretNumericEntities&&"iso-8859-1"===k&&(j=interpretNumericEntities(String(j))),$.indexOf("[]=")>-1&&(j=eu(j)?[j]:j),w.comma&&eu(j)&&j.length>w.arrayLimit&&(j=Zc.combine([],j,w.arrayLimit,w.plainObjects,w.throwOnLimitExceeded)),null!==F){var z=Yc.call(E,F);z&&("combine"===w.duplicates||$.indexOf("[]=")>-1)?E[F]=Zc.combine(E[F],j,w.arrayLimit,w.plainObjects,w.throwOnLimitExceeded):z&&"last"!==w.duplicates||(E[F]=j)}}return E}(_,E):_,P=E.plainObjects?{__proto__:null}:{},R=Object.keys(C),L=0;L<R.length;++L){var I=R[L],k=ru(I,C[I],E,"string"==typeof _);P=Zc.merge(P,k,E)}return!0===E.allowSparse?P:Zc.compact(P)},nu={formats:Tc,parse:parse,stringify:stringify},ou=Ts.exports;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var iu=/^([a-z0-9.+-]+:)/i,su=/:[0-9]*$/,au=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,cu=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),uu=["'"].concat(cu),lu=["%","/","?",";","#"].concat(uu),pu=["/","?","#"],du=/^[+a-z0-9A-Z_-]{0,63}$/,fu=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hu={javascript:!0,"javascript:":!0},gu={javascript:!0,"javascript:":!0},mu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},yu=nu;function urlParse(_,w,E){if(_&&"object"==typeof _&&_ instanceof Url)return _;var C=new Url;return C.parse(_,w,E),C}function __classPrivateFieldGet(_,w,E,C){if("a"===E&&!C)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof w?_!==w||!C:!w.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===E?C:"a"===E?C.call(_):C?C.value:w.get(_)}function __classPrivateFieldSet(_,w,E,C,P){if("m"===C)throw new TypeError("Private method is not writable");if("a"===C&&!P)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof w?_!==w||!P:!w.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===C?P.call(_,E):P?P.value=E:w.set(_,E),E}Url.prototype.parse=function(_,w,E){if("string"!=typeof _)throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var C=_.indexOf("?"),P=-1!==C&&C<_.indexOf("#")?"?":"#",R=_.split(P);R[0]=R[0].replace(/\\/g,"/");var L=_=R.join(P);if(L=L.trim(),!E&&1===_.split("#").length){var I=au.exec(L);if(I)return this.path=L,this.href=L,this.pathname=I[1],I[2]?(this.search=I[2],this.query=w?yu.parse(this.search.substr(1)):this.search.substr(1)):w&&(this.search="",this.query={}),this}var k=iu.exec(L);if(k){var F=(k=k[0]).toLowerCase();this.protocol=F,L=L.substr(k.length)}if(E||k||L.match(/^\/\/[^@/]+@[^@/]+/)){var j="//"===L.substr(0,2);!j||k&&gu[k]||(L=L.substr(2),this.slashes=!0)}if(!gu[k]&&(j||k&&!mu[k])){for(var $,V,H=-1,z=0;z<pu.length;z++){-1!==(q=L.indexOf(pu[z]))&&(-1===H||q<H)&&(H=q)}-1!==(V=-1===H?L.lastIndexOf("@"):L.lastIndexOf("@",H))&&($=L.slice(0,V),L=L.slice(V+1),this.auth=decodeURIComponent($)),H=-1;for(z=0;z<lu.length;z++){var q;-1!==(q=L.indexOf(lu[z]))&&(-1===H||q<H)&&(H=q)}-1===H&&(H=L.length),this.host=L.slice(0,H),L=L.slice(H),this.parseHost(),this.hostname=this.hostname||"";var G="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!G)for(var K=this.hostname.split(/\./),Q=(z=0,K.length);z<Q;z++){var X=K[z];if(X&&!X.match(du)){for(var J="",Z=0,Y=X.length;Z<Y;Z++)X.charCodeAt(Z)>127?J+="x":J+=X[Z];if(!J.match(du)){var ee=K.slice(0,z),te=K.slice(z+1),re=X.match(fu);re&&(ee.push(re[1]),te.unshift(re[2])),te.length&&(L="/"+te.join(".")+L),this.hostname=ee.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),G||(this.hostname=ou.toASCII(this.hostname));var ne=this.port?":"+this.port:"",oe=this.hostname||"";this.host=oe+ne,this.href+=this.host,G&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==L[0]&&(L="/"+L))}if(!hu[F])for(z=0,Q=uu.length;z<Q;z++){var ie=uu[z];if(-1!==L.indexOf(ie)){var se=encodeURIComponent(ie);se===ie&&(se=escape(ie)),L=L.split(ie).join(se)}}var ae=L.indexOf("#");-1!==ae&&(this.hash=L.substr(ae),L=L.slice(0,ae));var ce=L.indexOf("?");if(-1!==ce?(this.search=L.substr(ce),this.query=L.substr(ce+1),w&&(this.query=yu.parse(this.query)),L=L.slice(0,ce)):w&&(this.search="",this.query={}),L&&(this.pathname=L),mu[F]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){ne=this.pathname||"";var ue=this.search||"";this.path=ne+ue}return this.href=this.format(),this},Url.prototype.format=function(){var _=this.auth||"";_&&(_=(_=encodeURIComponent(_)).replace(/%3A/i,":"),_+="@");var w=this.protocol||"",E=this.pathname||"",C=this.hash||"",P=!1,R="";this.host?P=_+this.host:this.hostname&&(P=_+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(R=yu.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var L=this.search||R&&"?"+R||"";return w&&":"!==w.substr(-1)&&(w+=":"),this.slashes||(!w||mu[w])&&!1!==P?(P="//"+(P||""),E&&"/"!==E.charAt(0)&&(E="/"+E)):P||(P=""),C&&"#"!==C.charAt(0)&&(C="#"+C),L&&"?"!==L.charAt(0)&&(L="?"+L),w+P+(E=E.replace(/[?#]/g,(function(_){return encodeURIComponent(_)})))+(L=L.replace("#","%23"))+C},Url.prototype.resolve=function(_){return this.resolveObject(urlParse(_,!1,!0)).format()},Url.prototype.resolveObject=function(_){if("string"==typeof _){var w=new Url;w.parse(_,!1,!0),_=w}for(var E=new Url,C=Object.keys(this),P=0;P<C.length;P++){var R=C[P];E[R]=this[R]}if(E.hash=_.hash,""===_.href)return E.href=E.format(),E;if(_.slashes&&!_.protocol){for(var L=Object.keys(_),I=0;I<L.length;I++){var k=L[I];"protocol"!==k&&(E[k]=_[k])}return mu[E.protocol]&&E.hostname&&!E.pathname&&(E.pathname="/",E.path=E.pathname),E.href=E.format(),E}if(_.protocol&&_.protocol!==E.protocol){if(!mu[_.protocol]){for(var F=Object.keys(_),j=0;j<F.length;j++){var $=F[j];E[$]=_[$]}return E.href=E.format(),E}if(E.protocol=_.protocol,_.host||gu[_.protocol])E.pathname=_.pathname;else{for(var V=(_.pathname||"").split("/");V.length&&!(_.host=V.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),""!==V[0]&&V.unshift(""),V.length<2&&V.unshift(""),E.pathname=V.join("/")}if(E.search=_.search,E.query=_.query,E.host=_.host||"",E.auth=_.auth,E.hostname=_.hostname||_.host,E.port=_.port,E.pathname||E.search){var H=E.pathname||"",z=E.search||"";E.path=H+z}return E.slashes=E.slashes||_.slashes,E.href=E.format(),E}var q=E.pathname&&"/"===E.pathname.charAt(0),G=_.host||_.pathname&&"/"===_.pathname.charAt(0),K=G||q||E.host&&_.pathname,Q=K,X=E.pathname&&E.pathname.split("/")||[],J=(V=_.pathname&&_.pathname.split("/")||[],E.protocol&&!mu[E.protocol]);if(J&&(E.hostname="",E.port=null,E.host&&(""===X[0]?X[0]=E.host:X.unshift(E.host)),E.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&(""===V[0]?V[0]=_.host:V.unshift(_.host)),_.host=null),K=K&&(""===V[0]||""===X[0])),G)E.host=_.host||""===_.host?_.host:E.host,E.hostname=_.hostname||""===_.hostname?_.hostname:E.hostname,E.search=_.search,E.query=_.query,X=V;else if(V.length)X||(X=[]),X.pop(),X=X.concat(V),E.search=_.search,E.query=_.query;else if(null!=_.search){if(J)E.host=X.shift(),E.hostname=E.host,(re=!!(E.host&&E.host.indexOf("@")>0)&&E.host.split("@"))&&(E.auth=re.shift(),E.hostname=re.shift(),E.host=E.hostname);return E.search=_.search,E.query=_.query,null===E.pathname&&null===E.search||(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.href=E.format(),E}if(!X.length)return E.pathname=null,E.search?E.path="/"+E.search:E.path=null,E.href=E.format(),E;for(var Z=X.slice(-1)[0],Y=(E.host||_.host||X.length>1)&&("."===Z||".."===Z)||""===Z,ee=0,te=X.length;te>=0;te--)"."===(Z=X[te])?X.splice(te,1):".."===Z?(X.splice(te,1),ee++):ee&&(X.splice(te,1),ee--);if(!K&&!Q)for(;ee--;ee)X.unshift("..");!K||""===X[0]||X[0]&&"/"===X[0].charAt(0)||X.unshift(""),Y&&"/"!==X.join("/").substr(-1)&&X.push("");var re,ne=""===X[0]||X[0]&&"/"===X[0].charAt(0);J&&(E.hostname=ne?"":X.length?X.shift():"",E.host=E.hostname,(re=!!(E.host&&E.host.indexOf("@")>0)&&E.host.split("@"))&&(E.auth=re.shift(),E.hostname=re.shift(),E.host=E.hostname));return(K=K||E.host&&X.length)&&!ne&&X.unshift(""),X.length>0?E.pathname=X.join("/"):(E.pathname=null,E.path=null),null===E.pathname&&null===E.search||(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.auth=_.auth||E.auth,E.slashes=E.slashes||_.slashes,E.href=E.format(),E},Url.prototype.parseHost=function(){var _=this.host,w=su.exec(_);w&&(":"!==(w=w[0])&&(this.port=w.substr(1)),_=_.substr(0,_.length-w.length)),_&&(this.hostname=_)},Es.parse=urlParse,Es.resolve=function urlResolve(_,w){return urlParse(_,!1,!0).resolve(w)},Es.resolveObject=function urlResolveObject(_,w){return _?urlParse(_,!1,!0).resolveObject(w):w},Es.format=function urlFormat(_){return"string"==typeof _&&(_=urlParse(_)),_ instanceof Url?_.format():Url.prototype.format.call(_)},Es.Url=Url,"function"==typeof SuppressedError&&SuppressedError;var bu,_u,vu,Su,wu,Eu,Tu,Au,Ou,Cu={};const Pu=[],Ru=new WeakMap;let xu,Lu,Iu;const Nu=new Map,Du=[];function readExport(_,w){return"module.exports"!==w||Object.hasOwn(_,w)?_[w]:_.default}function setExport(_,w,E){return Ru.get(_).write(w,E)}const ku={defineProperty:function defineExport(_,w,E){if(!("value"in E))throw new Error("Getters/setters are not supported for exports property descriptors.");return setExport(_,w,E.value)},set:setExport};function setLegacyExport(_,w,E){const C=xu.get(_)?.[w];return"function"!=typeof C||C(E)}function getLegacyExport(_,w){if(w===Symbol.toStringTag)return"Module";const E=Lu.get(_)[w];return"function"==typeof E?E():void 0}function defineLegacyExport(_,w,E){if(!("value"in E))throw new Error("Getters/setters are not supported for exports property descriptors.");return setLegacyExport(_,w,E.value)}const Fu=[0,10,50];_u=new WeakMap,vu=new WeakMap,Su=new WeakMap,wu=new WeakMap,bu=new WeakSet,Eu=function _ModuleBinder_bind(_,w,E){let C;try{C=readExport(E,_),__classPrivateFieldGet(this,vu,"f").call(this,w,C),this.namespace[_]=C}catch(_){if(!(_ instanceof ReferenceError))throw _}void 0===C&&__classPrivateFieldSet(this,wu,__classPrivateFieldGet(this,wu,"f")??[],"f").push(__classPrivateFieldGet(this,bu,"m",Tu).call(this,_,w,E)),__classPrivateFieldGet(this,_u,"f")[_]=w},Tu=function _ModuleBinder_makeUpdater(_,w,E){return()=>{if(!0===__classPrivateFieldGet(this,Su,"f")?.[_])return!0;try{const C=readExport(E,_);return void 0!==C&&(__classPrivateFieldGet(this,vu,"f").call(this,w,C),this.namespace[_]=C,!0)}catch(_){if(_ instanceof ReferenceError)return!1;throw _}}},Au=function _ModuleBinder_flushOnce(){const _=__classPrivateFieldGet(this,wu,"f");if(void 0===_)return;let w;for(const E of _)!0!==E()&&(w??(w=[])).push(E);__classPrivateFieldSet(this,wu,w,"f")},Ou=function _ModuleBinder_scheduleRetry(_){if(void 0===__classPrivateFieldGet(this,wu,"f"))return;if(_>=Fu.length)return void __classPrivateFieldSet(this,wu,void 0,"f");const w=setTimeout((()=>{__classPrivateFieldGet(this,bu,"m",Au).call(this),__classPrivateFieldGet(this,bu,"m",_ModuleBinder_scheduleRetry).call(this,_+1)}),Fu[_]);w&&"function"==typeof w.unref&&w.unref()},Cu.register=function register(_,w,E,C,P){if(5===arguments.length)return void function registerLegacy(_,w,E,C,P){xu??(xu=new WeakMap),Lu??(Lu=new WeakMap),Iu??(Iu={defineProperty:defineLegacyExport,get:getLegacyExport,set:setLegacyExport}),Nu.set(_,P),xu.set(w,E),Lu.set(w,C);const R=new Proxy(w,Iu);Pu.forEach((w=>w(_,R,P))),Du.push([_,R,P])}(_,w,E,C,P);const{namespace:R}=w;Nu.set(_,E),Ru.set(R,w);const L=new Proxy(R,ku);Pu.forEach((w=>w(_,L,E))),Du.push([_,L,E])},Cu.ModuleBinder=class ModuleBinder{constructor(_,w,E,C){if(bu.add(this),this.namespace=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}}),_u.set(this,Object.create(null)),vu.set(this,void 0),Su.set(this,void 0),wu.set(this,void 0),__classPrivateFieldSet(this,vu,E,"f"),void 0!==w)for(let E=0;E<w.length;E++)__classPrivateFieldGet(this,bu,"m",Eu).call(this,w[E],E,C?.[E]??_)}write(_,w){const E=__classPrivateFieldGet(this,_u,"f")[_];return void 0!==E&&(__classPrivateFieldGet(this,vu,"f").call(this,E,w),void 0!==__classPrivateFieldGet(this,wu,"f")&&(__classPrivateFieldSet(this,Su,__classPrivateFieldGet(this,Su,"f")??Object.create(null),"f"),__classPrivateFieldGet(this,Su,"f")[_]=!0),this.namespace[_]=w),!0}flush(){void 0!==__classPrivateFieldGet(this,wu,"f")&&queueMicrotask((()=>{__classPrivateFieldGet(this,bu,"m",Au).call(this),__classPrivateFieldGet(this,bu,"m",Ou).call(this,0)}))}},Cu.importHooks=Pu,Cu.specifiers=Nu,Cu.toHook=Du;const ju=P,Mu=moduleDetailsFromPath$2,{fileURLToPath:$u}=Es,{MessageChannel:Bu}=I;let{isBuiltin:Uu}=R;Uu||(Uu=()=>!0);const{importHooks:Vu,specifiers:Hu,toHook:zu}=Cu;function isPackageSpecifier(_,w){if("win32"===process.platform&&_.includes("/")&&(w=w.replaceAll(ju.sep,"/")),w.endsWith(_))return!0;if(!(process.env.TURBOPACK??process.argv.includes("--turbo")))return!1;const E=_.lastIndexOf("-");return-1!==E&&w.endsWith(_.slice(0,E))}function addHook(_){Vu.push(_),zu.forEach((([w,E,C])=>_(w,E,C)))}function removeHook(_){const w=Vu.indexOf(_);w>-1&&Vu.splice(w,1)}function callHookFn(_,w,E,C){const P=_(w,E,C);P&&P!==w&&"default"in w&&(w.default=P)}let qu;function Hook(_,w,E){if(this instanceof Hook==!1)return new Hook(_,w,E);"function"==typeof _?(E=_,_=null,w=null):"function"==typeof w&&(E=w,w=null);const C=!!w&&!0===w.internals;qu&&Array.isArray(_)&&qu(_),this._iitmHook=(w,P,R)=>{const L=w;let I,k;if(L.startsWith("node:")){const _=w.slice(5);Uu(_)&&(w=_)}else if(L.startsWith("file://")){const _=Error.stackTraceLimit;Error.stackTraceLimit=0;try{I=$u(w),w=I}catch(_){}if(Error.stackTraceLimit=_,I){const _=Mu(I);_&&(w=_.name,k=_.basedir)}}if(_)for(const F of _)if(I&&F===I)callHookFn(E,P,I,void 0);else if(F===w)if(k){if(isPackageSpecifier(Hu.get(L),k))callHookFn(E,P,w,k);else if(C){const _=w+ju.sep+ju.relative(k,I);callHookFn(E,P,_,k)}}else callHookFn(E,P,w,k);else F===R&&callHookFn(E,P,R,k);else callHookFn(E,P,w,k)},addHook(this._iitmHook)}Hook.prototype.unhook=function(){removeHook(this._iitmHook)},ws.exports=Hook;var Wu,Gu=ws.exports.Hook=Hook;function safeExecuteInTheMiddle(_,w,E){let C,P;try{P=_()}catch(_){C=_}finally{return w(C,P),P}}ws.exports.addHook=addHook,ws.exports.removeHook=removeHook,ws.exports.createAddHookMessageChannel=function createAddHookMessageChannel(){const{port1:_,port2:w}=new Bu;let E,C=0;return qu=w=>{C++,_.postMessage(w)},_.on("message",(()=>{C--,E&&C<=0&&E()})).unref(),{registerOptions:{data:{addHookMessagePort:w,include:[]},transferList:[w]},addHookMessagePort:w,waitForAllMessagesAcknowledged:function waitForAllMessagesAcknowledged(){const _=setInterval((()=>{}),1e3),w=new Promise((_=>{E=_})).then((()=>{clearInterval(_)}));return 0===C&&E(),w}}};class InstrumentationBase extends InstrumentationAbstract{constructor(_,w,E){super(_,w,E),this._hooks=[],this._requireInTheMiddleSingleton=RequireInTheMiddleSingleton.getInstance(),this._enabled=!1,this._wrap=(_,w,E)=>{if(function isWrapped(_){return"function"==typeof _&&"function"==typeof _.__original&&"function"==typeof _.__unwrap&&!0===_.__wrapped}(_[w])&&this._unwrap(_,w),qe.types.isProxy(_)){const C=wrap(Object.assign({},_),w,E);return Object.defineProperty(_,w,{value:C}),C}return wrap(_,w,E)},this._unwrap=(_,w)=>qe.types.isProxy(_)?Object.defineProperty(_,w,{value:_[w]}):unwrap(_,w),this._massWrap=(_,w,E)=>{_?(Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{this._wrap(_,w,E)}))})):Ie.error("must provide one or more functions to wrap on modules")):Ie.error("must provide one or more modules to patch")},this._massUnwrap=(_,w)=>{_?(Array.isArray(_)||(_=[_]),w&&Array.isArray(w)?_.forEach((_=>{w.forEach((w=>{this._unwrap(_,w)}))})):Ie.error("must provide one or more functions to wrap on modules")):Ie.error("must provide one or more modules to patch")};let C=this.init();C&&!Array.isArray(C)&&(C=[C]),this._modules=C||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){const _=globalThis.require;_?.resolve&&_?.cache&&this._modules.forEach((w=>{const{name:E}=w;try{const w=_.resolve(E);_.cache[w]?.loaded&&this._diag.warn(`Module ${E} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${E}`)}catch{}}))}_extractPackageVersion(_){try{const w=F(C.join(_,"package.json"),{encoding:"utf8"}),E=JSON.parse(w).version;return"string"==typeof E?E:void 0}catch{Ie.warn("Failed extracting version",_)}}_onRequire(_,w,E,P){if(!P)return"function"==typeof _.patch&&(_.moduleExports=w,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:_.name}),_.patch(w)):w;const R=this._extractPackageVersion(P);if(_.moduleVersion=R,_.name===E)return isSupported(_.supportedVersions,R,_.includePrerelease)&&"function"==typeof _.patch&&(_.moduleExports=w,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:_.name,version:_.moduleVersion,baseDir:P}),_.patch(w,_.moduleVersion)):w;const L=_.files??[],I=C.normalize(E),k=L.filter((w=>w.name===I&&isSupported(w.supportedVersions,R,_.includePrerelease)));return k.reduce(((w,E)=>(E.moduleExports=w,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:_.name,version:_.moduleVersion,fileName:E.name,baseDir:P}),E.patch(w,_.moduleVersion)):w)),w)}enable(){if(!this._enabled)if(this._enabled=!0,this._hooks.length>0)for(const _ of this._modules){"function"==typeof _.patch&&_.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:_.name,version:_.moduleVersion}),_.patch(_.moduleExports,_.moduleVersion));for(const w of _.files)w.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:_.name,version:_.moduleVersion,fileName:w.name}),w.patch(w.moduleExports,_.moduleVersion))}else{this._warnOnPreloadedModules();for(const _ of this._modules){const hookFn=(w,E,P)=>{if(!P&&C.isAbsolute(E)){const _=C.parse(E);E=_.name,P=_.dir}return this._onRequire(_,w,E,P)},onRequire=(w,E,C)=>this._onRequire(_,w,E,C),w=C.isAbsolute(_.name)?new fs([_.name],{internals:!0},onRequire):this._requireInTheMiddleSingleton.register(_.name,onRequire);this._hooks.push(w);const E=new Gu([_.name],{internals:!0},hookFn);this._hooks.push(E)}}}disable(){if(this._enabled){this._enabled=!1;for(const _ of this._modules){"function"==typeof _.unpatch&&_.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:_.name,version:_.moduleVersion}),_.unpatch(_.moduleExports,_.moduleVersion));for(const w of _.files)w.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:_.name,version:_.moduleVersion,fileName:w.name}),w.unpatch(w.moduleExports,_.moduleVersion))}}}isEnabled(){return this._enabled}}function isSupported(_,w,E){return void 0===w?_.includes("*"):_.some((_=>satisfies(w,_,{includePrerelease:E})))}function semconvStabilityFromStr(_,w){let E=Wu.OLD;const C=w?.split(",").map((_=>_.trim())).filter((_=>""!==_));for(const w of C??[]){if(w.toLowerCase()===_+"/dup"){E=Wu.DUPLICATE;break}w.toLowerCase()===_&&(E=Wu.STABLE)}return E}!function(_){_[_.STABLE=1]="STABLE",_[_.OLD=2]="OLD",_[_.DUPLICATE=3]="DUPLICATE"}(Wu||(Wu={}));var Ku="0.6.0";const Qu="browser.navigation_timing.type",Xu="url.full",Ju="browser.navigation_timing.dom_complete",Zu="browser.navigation_timing.dom_content_loaded_event_end",Yu="browser.navigation_timing.dom_content_loaded_event_start",el="browser.navigation_timing.dom_interactive",tl="browser.navigation_timing.load_event_end",rl="browser.navigation_timing.load_event_start",nl="browser.navigation_timing.redirect_count",ol="browser.navigation_timing.unload_event_end",il="browser.navigation_timing.unload_event_start",sl="browser.resource_timing.duration",al="browser.resource_timing.fetch_start",cl="browser.resource_timing.domain_lookup_start",ul="browser.resource_timing.domain_lookup_end",ll="browser.resource_timing.connect_start",pl="browser.resource_timing.connect_end",dl="browser.resource_timing.secure_connection_start",fl="browser.resource_timing.request_start",hl="browser.resource_timing.response_start",gl="browser.resource_timing.response_end",ml="browser.resource_timing.transfer_size",yl="browser.resource_timing.encoded_body_size",bl="browser.resource_timing.decoded_body_size";var _l=class extends InstrumentationBase{constructor(_={}){super("@opentelemetry/browser-instrumentation/navigation-timing",Ku,_),this._retryCount=0,this._didEmit=!1}init(){return[]}enable(){this._isEnabled||(this._isEnabled=!0,this._onLoad=()=>this._tryEmitOrSchedule(),this._onPageHide=()=>this._handleUnload(),this._tryEmitOrSchedule(),this._didEmit||window.addEventListener("pagehide",this._onPageHide))}disable(){this._isEnabled=!1,this._unsubscribeAll(),this._lastEntry=void 0,this._didEmit=!1,this._retryCount=0}_getLatestNavigationEntry(){const _=performance?.getEntriesByType?.("navigation");if(_&&0!==_.length)return _[_.length-1]}_calculateBackoffDelay(){return 50*this._retryCount}_tryEmitOrSchedule(){if(this._didEmit)return;const _=this._getLatestNavigationEntry();if(_&&(this._lastEntry=_),_&&_.loadEventEnd>0)return void this._emitAndCleanup(_);if("complete"!==document.readyState)return void window.addEventListener("load",this._onLoad,{once:!0});if(void 0!==this._completeDelayTimeoutId)return;if(this._retryCount>5)return void(this._lastEntry?(this._diag.warn("Navigation timing: retries exhausted, emitting incomplete entry"),this._emitAndCleanup(this._lastEntry)):(this._diag.warn("Navigation timing: retries exhausted with no entry available"),this._unsubscribeAll()));const w=this._calculateBackoffDelay();this._retryCount++,this._completeDelayTimeoutId=window.setTimeout((()=>{this._completeDelayTimeoutId=void 0,this._tryEmitOrSchedule()}),w)}_handleUnload(){if(this._didEmit)return;const _=this._getLatestNavigationEntry()??this._lastEntry;_?this._emitAndCleanup(_):(this._diag.warn("Navigation timing: no entry available at unload"),this._unsubscribeAll())}_emitAndCleanup(_){this._didEmit||(this._didEmit=!0,this._emitNavigationTiming(_),this._lastEntry=void 0,this._unsubscribeAll())}_emitNavigationTiming(_){_&&this.logger.emit({eventName:"browser.navigation_timing",severityNumber:z.INFO,attributes:{[Qu]:_.type,[Xu]:_.name,[sl]:_.duration,[Ju]:_.domComplete,[Zu]:_.domContentLoadedEventEnd,[Yu]:_.domContentLoadedEventStart,[el]:_.domInteractive,[tl]:_.loadEventEnd,[rl]:_.loadEventStart,[nl]:_.redirectCount,[ol]:_.unloadEventEnd,[il]:_.unloadEventStart,[al]:_.fetchStart,[cl]:_.domainLookupStart,[ul]:_.domainLookupEnd,[ll]:_.connectStart,[pl]:_.connectEnd,[dl]:_.secureConnectionStart,[fl]:_.requestStart,[hl]:_.responseStart,[gl]:_.responseEnd,[ml]:_.transferSize,[yl]:_.encodedBodySize,[bl]:_.decodedBodySize}})}_unsubscribeAll(){this._completeDelayTimeoutId&&(clearTimeout(this._completeDelayTimeoutId),this._completeDelayTimeoutId=void 0),this._onLoad&&window.removeEventListener("load",this._onLoad),this._onPageHide&&window.removeEventListener("pagehide",this._onPageHide)}};const getElementCSSSelector=(_,{useIdForTargetElement:w=!1,useIdForAncestors:E=!1}={})=>{if(_.nodeType===Node.DOCUMENT_NODE)return"";const C=_,P=getNodeSelector(C,w||E);if(P.startsWith("#"))return P;const R=C.parentElement,L=R?getElementCSSSelector(R,{useIdForAncestors:E,useIdForTargetElement:!1}):"";return L?`${L} > ${P}`:P},getNodeSelector=(_,w=!1)=>{if(_.nodeType!==Node.ELEMENT_NODE)return"";const E=_,C=E.getAttribute("id");if(w&&C&&1===E.ownerDocument.querySelectorAll(`#${CSS.escape(C)}`).length)return`#${CSS.escape(C)}`;let P=getFullClassSelector(E);const R=getNthChild(E);return R>0&&(P+=`:nth-child(${R})`),P},getNthChild=_=>{if(!_.parentElement)return 0;const w=getFullClassSelector(_),E=Array.from(_.parentElement.children).filter((_=>getFullClassSelector(_)===w));return E.length>1?E.indexOf(_)+1:0},getFullClassSelector=_=>_.localName+(_.classList.length>0?Array.from(_.classList).map((_=>`.${CSS.escape(_)}`)).join(""):""),vl="browser.mouse_event.button",Sl="browser.page.x",wl="browser.page.y",El="browser.tag_name",Tl="browser.element.attributes",Al="browser.css_selector",Ol=["click"];var Cl=class extends InstrumentationBase{constructor(_={}){super("@opentelemetry/browser-instrumentation/user-action",Ku,_)}init(){return[]}_getMouseButtonFromMouseEvent(_){switch(_.button){case 0:default:return"left";case 1:return"middle";case 2:return"right"}}onClick(_){const w=_.target;if(!(w instanceof HTMLElement))return;if(w.hasAttribute("disabled"))return;const E=getElementCSSSelector(w,{useIdForTargetElement:!0,useIdForAncestors:!0}),C={};for(const _ of w.attributes)_.name.startsWith("data-otel-")&&(C[_.name.slice(10)]=_.value);this.logger.emit({severityNumber:z.INFO,eventName:"browser.user_action.click",attributes:{[Sl]:_.pageX,[wl]:_.pageY,[El]:w.tagName,[Tl]:C,[vl]:this._getMouseButtonFromMouseEvent(_),[Al]:E}})}enable(){const _=this._config.autoCapturedActions??Ol;this._onClickHandler||(this._onClickHandler=this.onClick.bind(this)),_.includes("click")&&document.addEventListener("click",this._onClickHandler,!0)}disable(){this._onClickHandler&&document.removeEventListener("click",this._onClickHandler,!0)}};const Pl="browser.web_vital.name",Rl="browser.web_vital.value",xl="browser.web_vital.rating",Ll="browser.web_vital.delta",Il="browser.web_vital.id",Nl="browser.web_vital.navigation_type";class t{constructor(){this.o=0,this.i=[]}u(_){if(_.hadRecentInput)return;const w=this.i[0],E=this.i.at(-1);this.o&&w&&E&&_.startTime-E.startTime<1e3&&_.startTime-w.startTime<5e3?(this.o+=_.value,this.i.push(_)):(this.o=_.value,this.i=[_]),this.t?.(_)}}const e=()=>{const _=performance.getEntriesByType("navigation")[0];if(_&&_.responseStart>0&&_.responseStart<performance.now())return _},n=_=>{if("loading"===document.readyState)return"loading";const w=e();if(w){if(_<w.domInteractive)return"loading";if(0===w.domContentLoadedEventStart||_<w.domContentLoadedEventStart)return"dom-interactive";if(0===w.domComplete||_<w.domComplete)return"dom-content-loaded"}return"complete"},o=_=>{const w=_.nodeName;return 1===_.nodeType?w.toLowerCase():w.toUpperCase().replace(/^#/,"")},i=_=>{let w="";try{for(;9!==_?.nodeType;){const E=_,C=E.id?"#"+E.id:[o(E),...Array.from(E.classList).sort()].join(".");if(w.length+C.length>99)return w||C;if(w=w?C+">"+w:C,E.id)break;_=E.parentNode}}catch{}return w},Dl=new WeakMap;function s(_,w){let E=Dl.get(w);return E||(E=new WeakMap,Dl.set(w,E)),E.get(_)||E.set(_,new w),E.get(_)}let kl=-1;const c=()=>kl,u=_=>{addEventListener("pageshow",(w=>{w.persisted&&(kl=w.timeStamp,_(w))}),!0)},f=(_,w,E,C)=>{let P,R;return L=>{w.value>=0&&(L||C)&&(R=w.value-(P??0),(R||void 0===P)&&(P=w.value,w.delta=R,w.rating=((_,w)=>_>w[1]?"poor":_>w[0]?"needs-improvement":"good")(w.value,E),_(w)))}},l=_=>{requestAnimationFrame((()=>requestAnimationFrame(_)))},d=()=>e()?.activationStart??0,h=(_,w=-1)=>{const E=e();let C="navigate";return c()>=0?C="back-forward-cache":E&&(document.prerendering||d()>0?C="prerender":document.wasDiscarded?C="restore":E.type&&(C=E.type.replace(/_/g,"-"))),{name:_,value:w,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:C}},m=(_,w,E={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(_)){const C=new PerformanceObserver((_=>{queueMicrotask((()=>{w(_.getEntries())}))}));return C.observe({type:_,buffered:!0,...E}),C}}catch{}},g=_=>{let w=!1;return()=>{w||(_(),w=!0)}};let Fl=-1;const jl=new Set,v=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,b=_=>{if("hidden"===document.visibilityState){if("visibilitychange"===_.type)for(const _ of jl)_();isFinite(Fl)||(Fl="visibilitychange"===_.type?_.timeStamp:0,removeEventListener("prerenderingchange",b,!0))}},M=()=>{if(Fl<0){const _=d(),w=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find((w=>"hidden"===w.name&&w.startTime>=_))?.startTime;Fl=w??v(),addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0),u((()=>{setTimeout((()=>{Fl=v()}))}))}return{get firstHiddenTime(){return Fl},onHidden(_){jl.add(_)}}},T=_=>{document.prerendering?addEventListener("prerenderingchange",_,!0):_()},Ml=[1800,3e3],D=(_,w={})=>{T((()=>{const E=M();let C,P=h("FCP");const R=m("paint",(_=>{for(const w of _)"first-contentful-paint"===w.name&&(R.disconnect(),w.startTime<E.firstHiddenTime&&(P.value=Math.max(w.startTime-d(),0),P.entries.push(w),C(!0)))}));R&&(C=f(_,P,Ml,w.reportAllChanges),u((E=>{P=h("FCP"),C=f(_,P,Ml,w.reportAllChanges),l((()=>{P.value=performance.now()-E.timeStamp,C(!0)}))})))}))},$l=[.1,.25],S=_=>_.find((_=>1===_.node?.nodeType))||_[0];let Bl=0,Ul=1/0,Vl=0;const B=_=>{for(const w of _)w.interactionId&&(Ul=Math.min(Ul,w.interactionId),Vl=Math.max(Vl,w.interactionId),Bl=Vl?(Vl-Ul)/7+1:0)};let Hl;const O=()=>Hl?Bl:performance.interactionCount??0;let zl=0;class A{constructor(){this.l=[],this.h=new Map}v(){zl=O(),this.l.length=0,this.h.clear()}M(){const _=Math.min(this.l.length-1,Math.floor((O()-zl)/50));return this.l[_]}u(_){if(this.m?.(_),!_.interactionId&&"first-input"!==_.entryType)return;const w=this.l.at(-1);let E=this.h.get(_.interactionId);if(E||this.l.length<10||_.duration>w.T){if(E?_.duration>E.T?(E.entries=[_],E.T=_.duration):_.duration===E.T&&_.startTime===E.entries[0].startTime&&E.entries.push(_):(E={id:_.interactionId,entries:[_],T:_.duration},this.h.set(E.id,E),this.l.push(E)),this.l.sort(((_,w)=>w.T-_.T)),this.l.length>10){const _=this.l.splice(10);for(const w of _)this.h.delete(w.id)}this.p?.(E)}}}const W=_=>{const w=globalThis.requestIdleCallback||setTimeout,E=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)_();else{const C=g(_);let P=-1;const r=()=>{E(P),C()};addEventListener("visibilitychange",r,{once:!0,capture:!0}),P=w((()=>{removeEventListener("visibilitychange",r,{capture:!0}),C()}))}},ql=[200,500],x=(_,w={})=>{const E=s(w=Object.assign({},w),A);let C=[],P=[],R=0;const L=new WeakMap,I=new WeakMap;let k=!1;const p=()=>{k||(W(y),k=!0)},y=()=>{const _=new Set(E.l.map((_=>L.get(_.entries[0])))),w=P.length-10;P=P.filter(((E,C)=>C>=w||_.has(E)));const I=new Set;for(const _ of P){const w=v(_.startTime,_.processingEnd);for(const _ of w)I.add(_)}C=C.filter((_=>_.startTime>R||I.has(_))),k=!1};E.m=_=>{const E=_.startTime+_.duration;let C;R=Math.max(R,_.processingEnd);for(let R=P.length-1;R>=0;R--){const L=P[R];if(Math.abs(E-L.renderTime)<=8){C=L,C.startTime=Math.min(_.startTime,C.startTime),C.processingStart=Math.min(_.processingStart,C.processingStart),C.processingEnd=Math.max(_.processingEnd,C.processingEnd),!1!==w.includeProcessedEventEntries&&C.entries.push(_);break}}C||(C={startTime:_.startTime,processingStart:_.processingStart,processingEnd:_.processingEnd,renderTime:E,entries:!1!==w.includeProcessedEventEntries?[_]:[]},P.push(C)),(_.interactionId||"first-input"===_.entryType)&&L.set(_,C),p()},E.p=_=>{if(!I.get(_)){const E=_.entries.find((_=>_.target))?.target;if(E){const C=w.generateTarget?.(E)??i(E);I.set(_,C)}else{const w=_.entries.find((_=>_.targetSelector))?.targetSelector;w&&I.set(_,w)}}};const v=(_,w)=>{const E=[];for(const P of C)if(!(P.startTime+P.duration<_)){if(P.startTime>w)break;E.push(P)}return E};m("long-animation-frame",(_=>{C=C.concat(_),p()})),((_,w={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const E=M();T((()=>{"interactionCount"in performance||Hl||(Hl=m("event",B,{durationThreshold:0}));let C,P=h("INP");const R=s(w,A),a=_=>{W((()=>{for(const w of _)R.u(w);const w=R.M();w&&w.T!==P.value&&(P.value=w.T,P.entries=w.entries,C())}))},L=m("event",a,{durationThreshold:w.durationThreshold??40});C=f(_,P,ql,w.reportAllChanges),L&&(L.observe({type:"first-input",buffered:!0}),E.onHidden((()=>{a(L.takeRecords()),C(!0)})),u((()=>{R.v(),P=h("INP"),C=f(_,P,ql,w.reportAllChanges)})))}))})((w=>{_((_=>{const w=_.entries[0],C=L.get(w),P=w.processingStart,R=Math.max(w.startTime+w.duration,P),k=Math.min(C.processingEnd,R),F=C.entries.sort(((_,w)=>_.processingStart-w.processingStart)),j=v(w.startTime,k),$=E.h.get(w.interactionId),V={interactionTarget:I.get($),interactionType:w.name.startsWith("key")?"keyboard":"pointer",interactionTime:w.startTime,nextPaintTime:R,processedEventEntries:F,longAnimationFrameEntries:j,inputDelay:P-w.startTime,processingDuration:k-P,presentationDelay:R-k,loadState:n(w.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(_=>{if(!_.longAnimationFrameEntries?.length)return;const w=_.interactionTime,E=_.inputDelay,C=_.processingDuration;let P,R,L=0,I=0,k=0,F=0;for(const k of _.longAnimationFrameEntries){I=I+k.startTime+k.duration-k.styleAndLayoutStart;for(const _ of k.scripts){const k=_.startTime+_.duration;if(k<w)continue;const j=k-Math.max(w,_.startTime),$=_.duration?j/_.duration*_.forcedStyleAndLayoutDuration:0;L+=j-$,I+=$,j>F&&(R=_.startTime<w+E?"input-delay":_.startTime>=w+E+C?"presentation-delay":"processing-duration",P=_,F=j)}}const j=_.longAnimationFrameEntries.at(-1),$=j?j.startTime+j.duration:0;$>=w+E+C&&(k=_.nextPaintTime-$),P&&R&&(_.longestScript={entry:P,subpart:R,intersectingDuration:F}),_.totalScriptDuration=L,_.totalStyleAndLayoutDuration=I,_.totalPaintDuration=k,_.totalUnattributedDuration=_.nextPaintTime-w-L-I-k})(V),Object.assign(_,{attribution:V})})(w))}),w)};class N{u(_){this.m?.(_)}}const Wl=[2500,4e3],Gl=[800,1800],U=_=>{document.prerendering?T((()=>U(_))):"complete"!==document.readyState?addEventListener("load",(()=>U(_)),!0):setTimeout(_)};var Kl=class extends InstrumentationBase{constructor(_={}){super("@opentelemetry/browser-instrumentation/web-vitals",Ku,_),this._applyCustomLogRecordData=_.applyCustomLogRecordData,this._includeRawAttribution=_.includeRawAttribution??!1}init(){return[]}enable(){"undefined"!=typeof PerformanceObserver?(this._isEnabled=!0,this._listenersRegistered?this._diag.debug("Listeners already registered, resuming emission"):(this._listenersRegistered=!0,this._diag.debug("Registering listeners"),((_,w={})=>{const E=s(w=Object.assign({},w),t),C=new WeakMap;E.t=_=>{if(_?.sources?.length){const E=S(_.sources),P=E?.node;if(P){const _=w.generateTarget?.(P)??i(P);C.set(E,_)}}},((_,w={})=>{const E=M();D(g((()=>{let C,P=h("CLS",0);const R=s(w,t),c=_=>{for(const w of _)R.u(w);R.o>P.value&&(P.value=R.o,P.entries=R.i,C())},L=m("layout-shift",c);L&&(C=f(_,P,$l,w.reportAllChanges),E.onHidden((()=>{c(L.takeRecords()),C(!0)})),u((()=>{R.o=0,P=h("CLS",0),C=f(_,P,$l,w.reportAllChanges),l(C)})),setTimeout(C))})))})((w=>{_((_=>{let w={};if(_.entries.length){const E=_.entries.reduce(((_,w)=>_.value>w.value?_:w));if(E?.sources?.length){const _=S(E.sources);_&&(w={largestShiftTarget:C.get(_),largestShiftTime:E.startTime,largestShiftValue:E.value,largestShiftSource:_,largestShiftEntry:E,loadState:n(E.startTime)})}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))),x((_=>this._emitWebVital(_))),((_,w={})=>{const E=s(w=Object.assign({},w),N),C=new WeakMap;E.m=_=>{const E=_.element;if(E){const P=w.generateTarget?.(E)??i(E);C.set(_,P)}else _.id&&C.set(_,`#${_.id}`)},((_,w={})=>{T((()=>{const E=M();let C,P=h("LCP");const R=s(w,N),a=_=>{w.reportAllChanges||(_=_.slice(-1));for(const w of _)R.u(w),w.startTime<E.firstHiddenTime&&(P.value=Math.max(w.startTime-d(),0),P.entries=[w],C())},L=m("largest-contentful-paint",a);if(L){C=f(_,P,Wl,w.reportAllChanges);const E=g((()=>{a(L.takeRecords()),L.disconnect(),C(!0)})),r=_=>{_.isTrusted&&(W(E),removeEventListener(_.type,r,{capture:!0}))};for(const _ of["keydown","click","visibilitychange"])addEventListener(_,r,{capture:!0});u((E=>{P=h("LCP"),C=f(_,P,Wl,w.reportAllChanges),l((()=>{P.value=performance.now()-E.timeStamp,C(!0)}))}))}}))})((w=>{_((_=>{let w={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:_.value};if(_.entries.length){const E=_.entries.at(-1),P=E.url&&performance.getEntriesByType("resource").find((_=>_.name===E.url));w.target=C.get(E),w.lcpEntry=E,E.url&&(w.url=E.url),P&&(w.lcpResourceEntry=P);const R=e();if(R){const E=R.activationStart||0,C=Math.max(0,R.responseStart-E),L=Math.max(C,P?(P.requestStart||P.startTime)-E:0),I=Math.min(_.value,Math.max(L,P?P.responseEnd-E:0));w={...w,timeToFirstByte:C,resourceLoadDelay:L-C,resourceLoadDuration:I-L,elementRenderDelay:_.value-I,navigationEntry:R}}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))),((_,w={})=>{D((w=>{_((_=>{let w={timeToFirstByte:0,firstByteToFCP:_.value,loadState:n(c())};if(_.entries.length){const E=e(),C=_.entries.at(-1);if(E){const P=E.activationStart||0,R=Math.max(0,E.responseStart-P);w={timeToFirstByte:R,firstByteToFCP:_.value-R,loadState:n(_.entries[0].startTime),navigationEntry:E,fcpEntry:C}}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))),((_,w={})=>{((_,w={})=>{let E=h("TTFB"),C=f(_,E,Gl,w.reportAllChanges);U((()=>{const P=e();P&&(E.value=Math.max(P.responseStart-d(),0),E.entries=[P],C(!0),u((()=>{E=h("TTFB",0),C=f(_,E,Gl,w.reportAllChanges),C(!0)})))}))})((w=>{_((_=>{let w={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(_.entries.length){const E=_.entries[0],C=E.activationStart||0,P=Math.max((E.workerStart||E.fetchStart)-C,0),R=Math.max(E.domainLookupStart-C,0),L=Math.max(E.connectStart-C,0),I=Math.max(E.connectEnd-C,0);w={waitingDuration:P,cacheDuration:R-P,dnsDuration:L-R,connectionDuration:I-L,requestDuration:_.value-I,navigationEntry:E}}return Object.assign(_,{attribution:w})})(w))}),w)})((_=>this._emitWebVital(_))))):this._diag.debug("PerformanceObserver not supported, web vitals will not be collected")}disable(){this._isEnabled=!1,this._diag.debug("Instrumentation disabled, pausing emission")}_getTimestampForMetric(_){if("CLS"===_.name){const{attribution:w}=_;return void 0!==w.largestShiftTime?w.largestShiftTime:void 0}if("INP"===_.name){const{attribution:w}=_;return w.interactionTime}return _.value}_emitWebVital(_){if(!this._isEnabled)return;const w={[Pl]:_.name.toLowerCase(),[Rl]:_.value,[Ll]:_.delta,[xl]:_.rating,[Il]:_.id,[Nl]:_.navigationType},E=this._getTimestampForMetric(_),C={eventName:"browser.web_vital",severityNumber:z.INFO,attributes:w,...this._includeRawAttribution?{body:JSON.stringify(_.attribution)}:{},...void 0!==E?{timestamp:E}:{}};this._applyCustomLogRecordData&&safeExecuteInTheMiddle((()=>this._applyCustomLogRecordData?.(C)),(_=>{_&&this._diag.error("applyCustomLogRecordData hook failed",_)})),this.logger.emit(C)}};const Ql=createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function sanitizeAttributes(_){const w={};if("object"!=typeof _||null==_)return w;for(const E in _){if(!Object.prototype.hasOwnProperty.call(_,E))continue;if(!isAttributeKey(E)){Ie.warn(`Invalid attribute key: ${E}`);continue}const C=_[E];isAttributeValue(C)?Array.isArray(C)?w[E]=C.slice():w[E]=C:Ie.warn(`Invalid attribute value set for key: ${E}`)}return w}function isAttributeKey(_){return"string"==typeof _&&""!==_}function isAttributeValue(_){return null==_||(Array.isArray(_)?function isHomogeneousAttributeValueArray(_){let w;for(const E of _){if(null==E)continue;const _=typeof E;if(_!==w){if(!w){if(isValidPrimitiveAttributeValueType(_)){w=_;continue}return!1}return!1}}return!0}(_):isValidPrimitiveAttributeValueType(typeof _))}function isValidPrimitiveAttributeValueType(_){switch(_){case"number":case"boolean":case"string":return!0}return!1}let Xl=function loggingErrorHandler(){return _=>{Ie.error(function stringifyException(_){return"string"==typeof _?_:JSON.stringify(function flattenException(_){const w={};let E=_;for(;null!==E;)Object.getOwnPropertyNames(E).forEach((_=>{if(w[_])return;const C=E[_];C&&(w[_]=String(C))})),E=Object.getPrototypeOf(E);return w}(_))}(_))}}();function globalErrorHandler(_){try{Xl(_)}catch{}}function getNumberFromEnv(_){const w=process.env[_];if(null==w||""===w.trim())return;const E=Number(w);if(!isNaN(E))return E;Ie.warn(`Unknown value ${qe.inspect(w)} for ${_}, expected a number, using defaults`)}const Jl="process.runtime.name",Zl={[Ho]:"opentelemetry",[Jl]:"node",[Uo]:Vo,[zo]:"2.10.0"},Yl=performance,ep=Math.pow(10,6),tp=Math.pow(10,9);function millisToHrTime(_){const w=_/1e3;return[Math.trunc(w),Math.round(_%1e3*ep)]}function isTimeInputHrTime(_){return Array.isArray(_)&&2===_.length&&"number"==typeof _[0]&&"number"==typeof _[1]}function isTimeInput(_){return isTimeInputHrTime(_)||"number"==typeof _||_ instanceof Date}function addHrTimes(_,w){const E=[_[0]+w[0],_[1]+w[1]];return E[1]>=tp&&(E[1]-=tp,E[0]+=1),E}var rp;!function(_){_[_.SUCCESS=0]="SUCCESS",_[_.FAILED=1]="FAILED"}(rp||(rp={}));const np="[object Null]",op="[object Undefined]",ip=Function.prototype.toString,sp=ip.call(Object),ap=Object.getPrototypeOf,cp=Object.prototype,up=cp.hasOwnProperty,lp=Symbol?Symbol.toStringTag:void 0,pp=cp.toString;function isPlainObject(_){if(!function isObjectLike(_){return null!=_&&"object"==typeof _}(_)||"[object Object]"!==function baseGetTag(_){if(null==_)return void 0===_?op:np;return lp&&lp in Object(_)?function getRawTag(_){const w=up.call(_,lp),E=_[lp];let C=!1;try{_[lp]=void 0,C=!0}catch{}const P=pp.call(_);C&&(w?_[lp]=E:delete _[lp]);return P}(_):function objectToString(_){return pp.call(_)}(_)}(_))return!1;const w=ap(_);if(null===w)return!0;const E=up.call(w,"constructor")&&w.constructor;return"function"==typeof E&&E instanceof E&&ip.call(E)===sp}function takeValue(_){return isArray(_)?_.slice():_}function mergeTwoObjects(_,w,E=0,C){let P;if(!(E>20)){if(E++,isPrimitive(_)||isPrimitive(w)||isFunction(w))P=takeValue(w);else if(isArray(_)){if(P=_.slice(),isArray(w))for(let _=0,E=w.length;_<E;_++)P.push(takeValue(w[_]));else if(isObject(w)){const _=Object.keys(w);for(let E=0,C=_.length;E<C;E++){const C=_[E];"__proto__"!==C&&"constructor"!==C&&"prototype"!==C&&(P[C]=takeValue(w[C]))}}}else if(isObject(_))if(isObject(w)){if(!function shouldMerge(_,w){if(!isPlainObject(_)||!isPlainObject(w))return!1;return!0}(_,w))return w;P=Object.assign({},_);const R=Object.keys(w);for(let L=0,I=R.length;L<I;L++){const I=R[L];if("__proto__"===I||"constructor"===I||"prototype"===I)continue;const k=w[I];if(isPrimitive(k))void 0===k?delete P[I]:P[I]=k;else{const R=P[I],L=k;if(wasObjectReferenced(_,I,C)||wasObjectReferenced(w,I,C))delete P[I];else{if(isObject(R)&&isObject(L)){const E=C.get(R)||[],P=C.get(L)||[];E.push({obj:_,key:I}),P.push({obj:w,key:I}),C.set(R,E),C.set(L,P)}P[I]=mergeTwoObjects(P[I],k,E,C)}}}}else P=w;return P}}function wasObjectReferenced(_,w,E){const C=E.get(_[w])||[];for(let E=0,P=C.length;E<P;E++){const P=C[E];if(P.key===w&&P.obj===_)return!0}return!1}function isArray(_){return Array.isArray(_)}function isFunction(_){return"function"==typeof _}function isObject(_){return!isPrimitive(_)&&!isArray(_)&&!isFunction(_)&&"object"==typeof _}function isPrimitive(_){return"string"==typeof _||"number"==typeof _||"boolean"==typeof _||void 0===_||_ instanceof Date||_ instanceof RegExp||null===_}class Deferred{constructor(){this._promise=new Promise(((_,w)=>{this._resolve=_,this._reject=w}))}get promise(){return this._promise}resolve(_){this._resolve(_)}reject(_){this._reject(_)}}class BindOnceFuture{constructor(_,w){this._isCalled=!1,this._deferred=new Deferred,this._callback=_,this._that=w}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(..._){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,..._)).then((_=>this._deferred.resolve(_)),(_=>this._deferred.reject(_)))}catch(_){this._deferred.reject(_)}}return this._deferred.promise}}let dp;function defaultServiceName(){if(void 0===dp)try{const _=globalThis.process.argv0;dp=_?`unknown_service:${_}`:"unknown_service"}catch{dp="unknown_service"}return dp}const isPromiseLike=_=>null!==_&&"object"==typeof _&&"function"==typeof _.then;class ResourceImpl{static FromAttributeList(_,w){const E=new ResourceImpl({},w);return E._rawAttributes=guardedRawAttributes(_),E._asyncAttributesPending=_.filter((([_,w])=>isPromiseLike(w))).length>0,E}constructor(_,w){this._asyncAttributesPending=!1;const E=_.attributes??{};this._rawAttributes=Object.entries(E).map((([_,w])=>(isPromiseLike(w)&&(this._asyncAttributesPending=!0),[_,w]))),this._rawAttributes=guardedRawAttributes(this._rawAttributes),this._schemaUrl=function validateSchemaUrl(_){if("string"==typeof _||void 0===_)return _;return void Ie.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",_)}(w?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let _=0;_<this._rawAttributes.length;_++){const[w,E]=this._rawAttributes[_];this._rawAttributes[_]=[w,isPromiseLike(E)?await E:E]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Ie.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const _={};for(const[w,E]of this._rawAttributes)isPromiseLike(E)?Ie.debug(`Unsettled resource attribute ${w} skipped`):null!=E&&(_[w]??(_[w]=E));return this._asyncAttributesPending||(this._memoizedAttributes=_),_}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(_){if(null==_)return this;const w=function mergeSchemaUrl(_,w){const E=_?.schemaUrl,C=w?.schemaUrl,P=void 0===E||""===E,R=void 0===C||""===C;if(P)return C;if(R)return E;if(E===C)return E;return void Ie.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',E,C)}(this,_),E=w?{schemaUrl:w}:void 0;return ResourceImpl.FromAttributeList([..._.getRawAttributes(),...this.getRawAttributes()],E)}}function defaultResource(){return function resourceFromAttributes(_,w){return ResourceImpl.FromAttributeList(Object.entries(_),w)}({[Bo]:defaultServiceName(),[Uo]:Zl[Uo],[Ho]:Zl[Ho],[zo]:Zl[zo]})}function guardedRawAttributes(_){return _.map((([_,w])=>isPromiseLike(w)?[_,w.catch((w=>{Ie.debug("promise rejection for resource attribute: %s - %s",_,w)}))]:[_,w]))}const fp=Symbol.for("nodejs.util.inspect.custom");function settledResourceAttributes(_){const w={};for(const[E,C]of _.getRawAttributes())"function"!=typeof C?.then&&null!=C&&(w[E]??(w[E]=C));return w}function formatInspect(_,w,E,C,P){if("number"==typeof E&&E<0){const w=`[${_}]`;return C?.stylize?C.stylize(w,"special"):w}if("function"!=typeof P||!C)return w;return`${_} ${P(w,{...C,depth:null==C.depth?C.depth:C.depth-1})}`}class SpanImpl{constructor(_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this._attributesCount=0,this.status={code:xe.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1];const w=Date.now();if(this._spanContext=_.spanContext,this._performanceStartTime=Yl.now(),this._performanceOffset=w-(this._performanceStartTime+Yl.timeOrigin),this._startTimeProvided=null!=_.startTime,this._spanLimits=_.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=_.spanProcessor,this.name=_.name,this.parentSpanContext=_.parentSpanContext,this.kind=_.kind,_.links)for(const w of _.links)this.addLink(w);this.startTime=this._getTime(_.startTime??w),this.resource=_.resource,this.instrumentationScope=_.scope,this._recordEndMetrics=_.recordEndMetrics,null!=_.attributes&&this.setAttributes(_.attributes),this._spanProcessor.onStart(this,_.context)}spanContext(){return this._spanContext}setAttribute(_,w){if(null==w||this._isSpanEnded())return this;if(0===_.length)return Ie.warn(`Invalid attribute key: ${_}`),this;if(!isAttributeValue(w))return Ie.warn(`Invalid attribute value set for key: ${_}`),this;const{attributeCountLimit:E}=this._spanLimits,C=!Object.prototype.hasOwnProperty.call(this.attributes,_);return void 0!==E&&this._attributesCount>=E&&C?(this._droppedAttributesCount++,this):(this.attributes[_]=this._truncateToSize(w),C&&this._attributesCount++,this)}setAttributes(_){for(const w in _)Object.prototype.hasOwnProperty.call(_,w)&&this.setAttribute(w,_[w]);return this}addEvent(_,w,E){if(this._isSpanEnded())return this;const{eventCountLimit:C}=this._spanLimits;if(0===C)return Ie.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==C&&this.events.length>=C&&(0===this._droppedEventsCount&&Ie.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),isTimeInput(w)&&(isTimeInput(E)||(E=w),w=void 0);const P=sanitizeAttributes(w),{attributePerEventCountLimit:R}=this._spanLimits,L={};let I=0,k=0;for(const _ in P){if(!Object.prototype.hasOwnProperty.call(P,_))continue;const w=P[_];void 0!==R&&k>=R?I++:(L[_]=this._truncateToSize(w),k++)}return this.events.push({name:_,attributes:L,time:this._getTime(E),droppedAttributesCount:I}),this}addLink(_){if(this._isSpanEnded())return this;const{linkCountLimit:w}=this._spanLimits;if(0===w)return this._droppedLinksCount++,this;void 0!==w&&this.links.length>=w&&(0===this._droppedLinksCount&&Ie.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);const{attributePerLinkCountLimit:E}=this._spanLimits,C=sanitizeAttributes(_.attributes),P={};let R=0,L=0;for(const _ in C){if(!Object.prototype.hasOwnProperty.call(C,_))continue;const w=C[_];void 0!==E&&L>=E?R++:(P[_]=this._truncateToSize(w),L++)}const I={context:_.context};return L>0&&(I.attributes=P),R>0&&(I.droppedAttributesCount=R),this.links.push(I),this}addLinks(_){for(const w of _)this.addLink(w);return this}setStatus(_){if(this._isSpanEnded())return this;if(_.code===xe.UNSET)return this;if(this.status.code===xe.OK)return this;const w={code:_.code};return _.code===xe.ERROR&&("string"==typeof _.message?w.message=_.message:null!=_.message&&Ie.warn(`Dropping invalid status.message of type '${typeof _.message}', expected 'string'`)),this.status=w,this}updateName(_){return this._isSpanEnded()||(this.name=_),this}end(_){this._isSpanEnded()?Ie.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(_),this._duration=function hrTimeDuration(_,w){let E=w[0]-_[0],C=w[1]-_[1];return C<0&&(E-=1,C+=tp),[E,C]}(this.startTime,this.endTime),this._duration[0]<0&&(Ie.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&&Ie.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Ie.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(_){if("number"==typeof _&&_<=Yl.now())return function hrTime(_){return addHrTimes(millisToHrTime(Yl.timeOrigin),millisToHrTime("number"==typeof _?_:Yl.now()))}(_+this._performanceOffset);if("number"==typeof _)return millisToHrTime(_);if(_ instanceof Date)return millisToHrTime(_.getTime());if(isTimeInputHrTime(_))return _;if(this._startTimeProvided)return millisToHrTime(Date.now());const w=Yl.now()-this._performanceStartTime;return addHrTimes(this.startTime,millisToHrTime(w))}isRecording(){return!1===this._ended}recordException(_,w){const E={};"string"==typeof _?E[Io]=_:_&&(_.code?E[Do]=_.code.toString():_.name&&(E[Do]=_.name),_.message&&(E[Io]=_.message),_.stack&&(E[No]=_.stack)),E[Do]||E[Io]?this.addEvent("exception",E,w):Ie.warn(`Failed to record an exception ${_}`)}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){const _=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Ie.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,_)}return this._ended}_truncateToLimitUtil(_,w){return _.length<=w?_:_.substring(0,w)}_truncateToSize(_){const w=this._attributeValueLengthLimit;return w<=0?(Ie.warn(`Attribute value limit must be positive, got ${w}`),_):"string"==typeof _?this._truncateToLimitUtil(_,w):Array.isArray(_)?_.map((_=>"string"==typeof _?this._truncateToLimitUtil(_,w):_)):_}[fp](_,w,E){return formatInspect("SpanImpl",{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:settledResourceAttributes(this.resource)}},_,w,E)}}var hp;!function(_){_[_.NOT_RECORD=0]="NOT_RECORD",_[_.RECORD=1]="RECORD",_[_.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(hp||(hp={}));const gp="otel.component.name",mp="otel.component.type",yp="otel.span.parent.origin",bp="otel.span.sampling_result";class TracerMetrics{constructor(_){this.startedSpans=_.createCounter("otel.sdk.span.started",{unit:"{span}",description:"The number of created spans."}),this.liveSpans=_.createUpDownCounter("otel.sdk.span.live",{unit:"{span}",description:"The number of currently live spans."})}startSpan(_,w){const E=function samplingDecisionToString(_){switch(_){case hp.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case hp.RECORD:return"RECORD_ONLY";case hp.NOT_RECORD:return"DROP"}}(w);if(this.startedSpans.add(1,{[yp]:parentOrigin(_),[bp]:E}),w===hp.NOT_RECORD)return()=>{};const C={[bp]:E};return this.liveSpans.add(1,C),()=>{this.liveSpans.add(-1,C)}}}function parentOrigin(_){return _?_.isRemote?"remote":"local":"none"}class Tracer{constructor(_,w){this.instrumentationScope=_,this._sampler=w.sampler,this._spanLimits=w.spanLimits,this._resource=w.resource,this._idGenerator=w.idGenerator,this._spanProcessor=w.spanProcessor;const E=w.meterProvider.getMeter("@opentelemetry/sdk-trace","2.10.0");this._tracerMetrics=new TracerMetrics(E)}startSpan(_,w={},E=Le.active()){w.root&&(E=Ue.deleteSpan(E));const C=Ue.getSpan(E);if(function isTracingSuppressed(_){return!0===_.getValue(Ql)}(E)){Ie.debug("Instrumentation suppressed, returning Noop Span");return Ue.wrapSpanContext(we)}const P=C?.spanContext(),R=this._idGenerator.generateSpanId();let L,I,k;P&&Ue.isSpanContextValid(P)?(I=P.traceId,k=P.traceState,L=P):I=this._idGenerator.generateTraceId();const F=w.kind??Re.INTERNAL,j=(w.links??[]).map((_=>({context:_.context,attributes:sanitizeAttributes(_.attributes)}))),$=sanitizeAttributes(w.attributes),V=this._sampler.shouldSample(E,I,_,F,$,j),H=this._tracerMetrics.startSpan(P,V.decision);k=V.traceState??k;const z={traceId:I,spanId:R,traceFlags:V.decision===Pe.RECORD_AND_SAMPLED?_e.SAMPLED:_e.NONE,traceState:k};if(V.decision===Pe.NOT_RECORD){Ie.debug("Recording is off, propagating context in a non-recording span");return Ue.wrapSpanContext(z)}const q=sanitizeAttributes(Object.assign($,V.attributes));return new SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:E,spanContext:z,name:_,kind:F,links:j,parentSpanContext:L,attributes:q,startTime:w.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:H})}startActiveSpan(_,w,E,C){let P,R,L;if(arguments.length<2)return;2===arguments.length?L=w:3===arguments.length?(P=w,L=E):(P=w,R=E,L=C);const I=R??Le.active(),k=this.startSpan(_,P,I),F=Ue.setSpan(I,k);return Le.with(F,L,void 0,k)}[fp](_,w,E){return formatInspect("Tracer",{instrumentationScope:this.instrumentationScope,resource:{attributes:settledResourceAttributes(this._resource)},spanLimits:this._spanLimits},_,w,E)}}class MultiSpanProcessor{constructor(_){this._spanProcessors=_}forceFlush(){const _=[];for(const w of this._spanProcessors)_.push(w.forceFlush());return new Promise((w=>{Promise.all(_).then((()=>{w()})).catch((_=>{globalErrorHandler(_||new Error("MultiSpanProcessor: forceFlush failed")),w()}))}))}onStart(_,w){for(const E of this._spanProcessors)E.onStart(_,w)}onEnding(_){for(const w of this._spanProcessors)w.onEnding&&w.onEnding(_)}onEnd(_){for(const w of this._spanProcessors)w.onEnd(_)}shutdown(){const _=[];for(const w of this._spanProcessors)_.push(w.shutdown());return new Promise(((w,E)=>{Promise.all(_).then((()=>{w()}),E)}))}}class AlwaysOffSampler{shouldSample(){return{decision:hp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class AlwaysOnSampler{shouldSample(){return{decision:hp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class ParentBasedSampler{constructor(_){this._root=_.root,this._root||(globalErrorHandler(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new AlwaysOnSampler),this._remoteParentSampled=_.remoteParentSampled??new AlwaysOnSampler,this._remoteParentNotSampled=_.remoteParentNotSampled??new AlwaysOffSampler,this._localParentSampled=_.localParentSampled??new AlwaysOnSampler,this._localParentNotSampled=_.localParentNotSampled??new AlwaysOffSampler}shouldSample(_,w,E,C,P,R){const L=Ue.getSpanContext(_);return L&&isSpanContextValid(L)?L.isRemote?L.traceFlags&_e.SAMPLED?this._remoteParentSampled.shouldSample(_,w,E,C,P,R):this._remoteParentNotSampled.shouldSample(_,w,E,C,P,R):L.traceFlags&_e.SAMPLED?this._localParentSampled.shouldSample(_,w,E,C,P,R):this._localParentNotSampled.shouldSample(_,w,E,C,P,R):this._root.shouldSample(_,w,E,C,P,R)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}const _p=new Map;class SpanProcessorMetrics{constructor(_,w,E){const C=_p.get(_)??0;if(_p.set(_,C+1),this.standardAttrs={[mp]:_,[gp]:`${_}/${C}`},this.droppedAttrs={...this.standardAttrs,[Lo]:"queue_full"},this.processedSpans=w.createCounter("otel.sdk.processor.span.processed",{unit:"{span}",description:"The number of spans for which the processing has finished, either successful or failed."}),E){const{capacity:_,getQueueSize:C}=E;w.createUpDownCounter("otel.sdk.processor.span.queue.capacity",{unit:"{span}",description:"The maximum number of spans the queue of a given instance of an SDK span processor can hold."}).add(_,this.standardAttrs),this.queueSize=w.createObservableUpDownCounter("otel.sdk.processor.span.queue.size",{unit:"{span}",description:"The number of spans in the queue of a given instance of an SDK span processor."}),this.queueSizeCallback=_=>_.observe(C(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(_){this.processedSpans.add(_,this.droppedAttrs)}finishSpans(_,w){if(!w)return void this.processedSpans.add(_,this.standardAttrs);const E={...this.standardAttrs,[Lo]:w.name};this.processedSpans.add(_,E)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}}class BatchSpanProcessorBase{constructor(_){this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0,this._exporter=_.exporter,this._maxExportBatchSize=_.maxExportBatchSize??512,this._maxQueueSize=_.maxQueueSize??2048,this._scheduledDelayMillis=_.scheduledDelayMillis??5e3,this._exportTimeoutMillis=_.exportTimeoutMillis??3e4,this._shutdownOnce=new BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ie.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize);const w=_.selfObsMeterProvider?_.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):createNoopMeter();this._metrics=new SpanProcessorMetrics("batching_span_processor",w,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(_,w){}onEnd(_){this._shutdownOnce.isCalled||_.spanContext().traceFlags&_e.SAMPLED&&this._addToBuffer(_)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then((()=>this.onShutdown())).then((()=>this._flushAll())).then((()=>(this._metrics.shutdown(),this._exporter.shutdown())))}_addToBuffer(_){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Ie.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++,void this._metrics.dropSpans(1);this._droppedSpansCount>0&&(Ie.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(_),this._maybeStartTimer()}_flushAll(){return new Promise(((_,w)=>{const E=[];for(let _=0,w=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);_<w;_++)E.push(this._flushOneBatch());Promise.all(E).then((()=>{_()})).catch(w)}))}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise(((_,w)=>{const E=setTimeout((()=>{w(new Error("Timeout"))}),this._exportTimeoutMillis);Le.with(function suppressTracing(_){return _.setValue(Ql,!0)}(Le.active()),(()=>{let C;this._finishedSpans.length<=this._maxExportBatchSize?(C=this._finishedSpans,this._finishedSpans=[]):C=this._finishedSpans.splice(0,this._maxExportBatchSize);const doExport=()=>this._exporter.export(C,(P=>{clearTimeout(E),this._metrics.finishSpans(C.length,P.error),P.code===rp.SUCCESS?_():w(P.error??new Error("BatchSpanProcessor: span export failed"))}));let P=null;for(let _=0,w=C.length;_<w;_++){const w=C[_];w.resource.asyncAttributesPending&&w.resource.waitForAsyncAttributes&&(P??(P=[]),P.push(w.resource.waitForAsyncAttributes()))}null===P?doExport():Promise.all(P).then(doExport,(_=>{globalErrorHandler(_),w(_)}))}))}))}_maybeStartTimer(){if(this._isExporting)return;const flush=()=>{this._isExporting=!0,this._flushOneBatch().finally((()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())})).catch((_=>{this._isExporting=!1,globalErrorHandler(_)}))};if(this._finishedSpans.length>=this._maxExportBatchSize)return flush();void 0===this._timer&&(this._timer=setTimeout((()=>flush()),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}let vp=class BatchSpanProcessor extends BatchSpanProcessorBase{onShutdown(){}};class RandomIdGenerator{constructor(){this.generateTraceId=getIdGenerator(16),this.generateSpanId=getIdGenerator(8)}}const Sp=Buffer.allocUnsafe(16);function getIdGenerator(_){return function generateId(){for(let w=0;w<_/4;w++)Sp.writeUInt32BE(Math.random()*2**32>>>0,4*w);for(let w=0;w<_&&!(Sp[w]>0);w++)w===_-1&&(Sp[_-1]=1);return Sp.toString("hex",0,_)}}var wp,Ep;!function(_){_[_.resolved=0]="resolved",_[_.timeout=1]="timeout",_[_.error=2]="error",_[_.unresolved=3]="unresolved"}(wp||(wp={}));class TracerProvider{constructor(_={}){this._tracers=new Map,this._forceFlushTimeoutMillis=_.forceFlushTimeoutMillis??3e4,this._resource=_.resource??defaultResource();const w=_.spanProcessors??[];this._activeSpanProcessor=new MultiSpanProcessor(w),this._tracerOptions={resource:this._resource,sampler:_.sampler??new ParentBasedSampler({root:new AlwaysOnSampler}),spanLimits:{attributeCountLimit:_.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:_.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:_.spanLimits?.eventCountLimit??128,linkCountLimit:_.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:_.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:_.spanLimits?.attributePerLinkCountLimit??128},idGenerator:_.idGenerator||new RandomIdGenerator,spanProcessor:this._activeSpanProcessor,meterProvider:_.meterProvider??{getMeter:()=>createNoopMeter()}}}getTracer(_,w,E){const C=`${_}@${w||""}:${E?.schemaUrl||""}`;return this._tracers.has(C)||this._tracers.set(C,new Tracer({name:_,version:w,schemaUrl:E?.schemaUrl},this._tracerOptions)),this._tracers.get(C)}forceFlush(){const _=this._forceFlushTimeoutMillis,w=this._activeSpanProcessor._spanProcessors.map((w=>new Promise((E=>{let C;const P=setTimeout((()=>{E(new Error(`Span processor did not completed within timeout period of ${_} ms`)),C=wp.timeout}),_);w.forceFlush().then((()=>{clearTimeout(P),C!==wp.timeout&&(C=wp.resolved,E(C))})).catch((_=>{clearTimeout(P),C=wp.error,E(_)}))}))));return new Promise(((_,E)=>{Promise.all(w).then((w=>{const C=w.filter((_=>_!==wp.resolved));C.length>0?E(C):_()})).catch((_=>E([_])))}))}shutdown(){return this._activeSpanProcessor.shutdown()}[fp](_,w,E){const C=this._activeSpanProcessor._spanProcessors,P={resource:{attributes:settledResourceAttributes(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:C.map((_=>_.constructor?.name??"SpanProcessor"))};return formatInspect("TracerProvider",P,_,w,E)}}class TraceIdRatioBasedSampler{constructor(_=0){this._ratio=this._normalize(_),this._upperBound=1===this._ratio?4294967296:Math.floor(4294967295*this._ratio)}shouldSample(_,w){return{decision:isValidTraceId(w)&&this._accumulate(w)<this._upperBound?hp.RECORD_AND_SAMPLED:hp.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(_){return"number"!=typeof _||isNaN(_)?0:_>=1?1:_<=0?0:_}_accumulate(_){let w=0;for(let E=0;E<32;E+=8){let C=0;for(let w=0;w<8;w++){const P=_.charCodeAt(E+w);C=C<<4|(P<58?P-48:P<71?P-55:P-87)}w=(w^C)>>>0}return w}}!function(_){_.AlwaysOff="always_off",_.AlwaysOn="always_on",_.ParentBasedAlwaysOff="parentbased_always_off",_.ParentBasedAlwaysOn="parentbased_always_on",_.ParentBasedTraceIdRatio="parentbased_traceidratio",_.TraceIdRatio="traceidratio"}(Ep||(Ep={}));function buildSamplerFromEnv(){const _=function getStringFromEnv(_){const w=process.env[_];if(null!=w&&""!==w.trim())return w}("OTEL_TRACES_SAMPLER")??Ep.ParentBasedAlwaysOn;switch(_){case Ep.AlwaysOn:return new AlwaysOnSampler;case Ep.AlwaysOff:return new AlwaysOffSampler;case Ep.ParentBasedAlwaysOn:return new ParentBasedSampler({root:new AlwaysOnSampler});case Ep.ParentBasedAlwaysOff:return new ParentBasedSampler({root:new AlwaysOffSampler});case Ep.TraceIdRatio:return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv());case Ep.ParentBasedTraceIdRatio:return new ParentBasedSampler({root:new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv())});default:return Ie.error(`OTEL_TRACES_SAMPLER value "${_}" invalid, defaulting to "${Ep.ParentBasedAlwaysOn}".`),new ParentBasedSampler({root:new AlwaysOnSampler})}}function getSamplerProbabilityFromEnv(){const _=getNumberFromEnv("OTEL_TRACES_SAMPLER_ARG");return null==_?(Ie.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1):_<0||_>1?(Ie.error(`OTEL_TRACES_SAMPLER_ARG=${_} was given, but it is out of range ([0..1]), defaulting to 1.`),1):_}const Tp=1/0;class BasicTracerProvider extends TracerProvider{constructor(_={}){const w=function merge(..._){let w=_.shift();const E=new WeakMap;for(;_.length>0;)w=mergeTwoObjects(w,_.shift(),0,E);return w}({},function loadDefaultConfig(){return{sampler:buildSamplerFromEnv(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:getNumberFromEnv("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:getNumberFromEnv("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}(),function reconfigureLimits(_){const w=Object.assign({},_.spanLimits);return w.attributeCountLimit=_.spanLimits?.attributeCountLimit??_.generalLimits?.attributeCountLimit??getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,w.attributeValueLengthLimit=_.spanLimits?.attributeValueLengthLimit??_.generalLimits?.attributeValueLengthLimit??getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Tp,Object.assign({},_,{spanLimits:w})}(_));delete w.generalLimits,super(w)}}class BatchSpanProcessor extends vp{constructor(_,w){w||(w={});const E=[["maxExportBatchSize","OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],["maxQueueSize","OTEL_BSP_MAX_QUEUE_SIZE"],["scheduledDelayMillis","OTEL_BSP_SCHEDULE_DELAY"],["exportTimeoutMillis","OTEL_BSP_EXPORT_TIMEOUT"]];for(const[_,C]of E)if(void 0===w[_]){const E=getNumberFromEnv(C);void 0!==E&&(w[_]=E)}super({exporter:_,...w})}}class StackContextManager{constructor(){this._enabled=!1,this._currentContext=se}_bindFunction(_=se,w){const E=this,contextWrapper=function(...C){return E.with(_,(()=>w.apply(this,C)))};return Object.defineProperty(contextWrapper,"length",{enumerable:!1,configurable:!0,writable:!1,value:w.length}),contextWrapper}active(){return this._currentContext}bind(_,w){return void 0===_&&(_=this.active()),"function"==typeof w?this._bindFunction(_,w):w}disable(){return this._currentContext=se,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=se),this}with(_,w,E,...C){const P=this._currentContext;this._currentContext=_||se;try{return w.call(E,...C)}finally{this._currentContext=P}}}class WebTracerProvider extends BasicTracerProvider{constructor(_={}){super(_)}register(_={}){Ue.setGlobalTracerProvider(this),function setupPropagator(_){null!==_&&(void 0!==_?$e.setGlobalPropagator(_):$e.setGlobalPropagator(new CompositePropagator({propagators:[new W3CTraceContextPropagator,new W3CBaggagePropagator]})))}(_.propagator),function setupContextManager(_){if(null!==_){if(void 0===_){const _=new StackContextManager;return _.enable(),void Le.setGlobalContextManager(_)}_.enable(),Le.setGlobalContextManager(_)}}(_.contextManager)}}var Ap;!function(_){_.CONNECT_END="connectEnd",_.CONNECT_START="connectStart",_.DECODED_BODY_SIZE="decodedBodySize",_.DOM_COMPLETE="domComplete",_.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",_.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",_.DOM_INTERACTIVE="domInteractive",_.DOMAIN_LOOKUP_END="domainLookupEnd",_.DOMAIN_LOOKUP_START="domainLookupStart",_.ENCODED_BODY_SIZE="encodedBodySize",_.FETCH_START="fetchStart",_.LOAD_EVENT_END="loadEventEnd",_.LOAD_EVENT_START="loadEventStart",_.NAVIGATION_START="navigationStart",_.REDIRECT_END="redirectEnd",_.REDIRECT_START="redirectStart",_.REQUEST_START="requestStart",_.RESPONSE_END="responseEnd",_.RESPONSE_START="responseStart",_.SECURE_CONNECTION_START="secureConnectionStart",_.START_TIME="startTime",_.UNLOAD_EVENT_END="unloadEventEnd",_.UNLOAD_EVENT_START="unloadEventStart"}(Ap||(Ap={}));let Op;function addSpanNetworkEvent$1(_,w,E,C=!0){if(function hasKey$1(_,w){return w in _}(E,w)&&"number"==typeof E[w]&&(!C||0!==E[w]))return _.addEvent(w,E[w])}function addSpanNetworkEvents$1(_,w,E=!1,C,P){if(void 0===C&&(C=0!==w[Ap.START_TIME]),E||(addSpanNetworkEvent$1(_,Ap.FETCH_START,w,C),addSpanNetworkEvent$1(_,Ap.DOMAIN_LOOKUP_START,w,C),addSpanNetworkEvent$1(_,Ap.DOMAIN_LOOKUP_END,w,C),addSpanNetworkEvent$1(_,Ap.CONNECT_START,w,C),addSpanNetworkEvent$1(_,Ap.SECURE_CONNECTION_START,w,C),addSpanNetworkEvent$1(_,Ap.CONNECT_END,w,C),addSpanNetworkEvent$1(_,Ap.REQUEST_START,w,C),addSpanNetworkEvent$1(_,Ap.RESPONSE_START,w,C),addSpanNetworkEvent$1(_,Ap.RESPONSE_END,w,C)),!P){const E=w[Ap.ENCODED_BODY_SIZE];void 0!==E&&_.setAttribute("http.response_content_length",E);const C=w[Ap.DECODED_BODY_SIZE];void 0!==C&&E!==C&&_.setAttribute("http.response_content_length_uncompressed",C)}}function getOrigin(){return"undefined"!=typeof location?location.origin:void 0}function getResource(_,w,E,C,P=new WeakSet,R){const L=parseUrl(_),I=function filterResourcesForSpan(_,w,E,C,P,R){const L=hrTimeToNanoseconds(w),I=hrTimeToNanoseconds(E);let k=C.filter((w=>{const E=hrTimeToNanoseconds(timeInputToHrTime(w[Ap.FETCH_START])),C=hrTimeToNanoseconds(timeInputToHrTime(w[Ap.RESPONSE_END]));return w.initiatorType.toLowerCase()===(R||"xmlhttprequest")&&w.name===_&&E>=L&&C<=I}));k.length>0&&(k=k.filter((_=>!P.has(_))));return k}(_=L.toString(),w,E,C,P,R);if(0===I.length)return{mainRequest:void 0};if(1===I.length)return{mainRequest:I[0]};const k=function sortResources(_){return _.slice().sort(((_,w)=>{const E=_[Ap.FETCH_START],C=w[Ap.FETCH_START];return E>C?1:E<C?-1:0}))}(I);if(L.origin!==getOrigin()&&k.length>1){let _=k[0],w=function findMainRequest(_,w,E){const C=hrTimeToNanoseconds(E),P=hrTimeToNanoseconds(timeInputToHrTime(w));let R,L=_[1];const I=_.length;for(let w=1;w<I;w++){const E=_[w],I=hrTimeToNanoseconds(timeInputToHrTime(E[Ap.FETCH_START])),k=C-hrTimeToNanoseconds(timeInputToHrTime(E[Ap.RESPONSE_END]));I>=P&&(!R||k<R)&&(R=k,L=E)}return L}(k,_[Ap.RESPONSE_END],E);const C=_[Ap.RESPONSE_END];return w[Ap.FETCH_START]<C&&(w=_,_=void 0),{corsPreFlightRequest:_,mainRequest:w}}return{mainRequest:I[0]}}function parseUrl(_){if("function"==typeof URL)return new URL(_,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const w=function getUrlNormalizingAnchor(){return Op||(Op=document.createElement("a")),Op}();return w.href=_,w}function shouldPropagateTraceHeaders(_,w){let E=w||[];("string"==typeof E||E instanceof RegExp)&&(E=[E]);return parseUrl(_).origin===getOrigin()||E.some((w=>urlMatches(_,w)))}var Cp;!function(_){_.METHOD_OPEN="open",_.METHOD_SEND="send",_.EVENT_ABORT="abort",_.EVENT_ERROR="error",_.EVENT_LOAD="loaded",_.EVENT_TIMEOUT="timeout"}(Cp||(Cp={}));const Pp=Ie.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function getXHRBodyLength$1(_){return function isDocument$1(_){return"undefined"!=typeof Document&&_ instanceof Document}(_)?(new XMLSerializer).serializeToString(document).length:"string"==typeof _?getByteLength$1(_):_ instanceof Blob?_.size:_ instanceof FormData?function getFormDataSize$1(_){let w=0;for(const[E,C]of _.entries())w+=E.length,C instanceof Blob?w+=C.size:w+=C.length;return w}(_):_ instanceof URLSearchParams?getByteLength$1(_.toString()):void 0!==_.byteLength?_.byteLength:void Pp.warn("unknown body type")}const Rp=new TextEncoder;function getByteLength$1(_){return Rp.encode(_).byteLength}function normalizeHttpRequestMethod$1(_){const w=function getKnownMethods$1(){if(void 0===Lp){const _=getStringListFromEnv("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");_&&_.length>0?(Lp={},_.forEach((_=>{Lp[_]=!0}))):Lp=xp}return Lp}(),E=_.toUpperCase();return E in w?E:"_OTHER"}const xp={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let Lp;const Ip={"https:":"443","http:":"80"};const Np="0.220.0";var Dp;(Dp||(Dp={})).HTTP_STATUS_TEXT="http.status_text";class XMLHttpRequestInstrumentation extends InstrumentationBase{constructor(_={}){super("@opentelemetry/instrumentation-xml-http-request",Np,_),this.component="xml-http-request",this.version=Np,this.moduleName=this.component,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet,this._semconvStability=semconvStabilityFromStr("http",_?.semconvStabilityOptIn)}init(){}_addHeaders(_,w){if(!shouldPropagateTraceHeaders(parseUrl(w).href,this.getConfig().propagateTraceHeaderCorsUrls)){const _={};return $e.inject(Le.active(),_),void(Object.keys(_).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const E={};$e.inject(Le.active(),E),Object.keys(E).forEach((w=>{_.setRequestHeader(w,String(E[w]))}))}_addChildSpan(_,w){Le.with(Ue.setSpan(Le.active(),_),(()=>{const _=this.tracer.startSpan("CORS Preflight",{startTime:w[Ap.FETCH_START]}),E=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(_,w,this.getConfig().ignoreNetworkEvents,void 0,E),_.end(w[Ap.RESPONSE_END])}))}_addFinalSpanAttributes(_,w,E){if(this._semconvStability&Wu.OLD){if(void 0!==w.status&&_.setAttribute("http.status_code",w.status),void 0!==w.statusText&&_.setAttribute(Dp.HTTP_STATUS_TEXT,w.statusText),"string"==typeof E){const w=parseUrl(E);_.setAttribute("http.host",w.host),_.setAttribute("http.scheme",w.protocol.replace(":",""))}_.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&Wu.STABLE&&w.status&&_.setAttribute(jo,w.status)}_applyAttributesAfterXHR(_,w){const E=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof E&&safeExecuteInTheMiddle((()=>E(_,w)),(_=>{_&&this._diag.error("applyCustomAttributesOnSpan",_)}))}_addResourceObserver(_,w){const E=this._xhrMem.get(_);E&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(E.createdResources={observer:new PerformanceObserver((_=>{const C=_.getEntries(),P=parseUrl(w);C.forEach((_=>{"xmlhttprequest"===_.initiatorType&&_.name===P.href&&E.createdResources&&E.createdResources.entries.push(_)}))})),entries:[]},E.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Ko.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(_,w,E,C,P){if(!(E&&C&&P&&_.createdResources))return;let R=_.createdResources.entries;R&&R.length||(R=Ko.getEntriesByType("resource"));const L=getResource(parseUrl(E).href,C,P,R,this._usedResources);if(L.mainRequest){const _=L.mainRequest;this._markResourceAsUsed(_);const E=L.corsPreFlightRequest;E&&(this._addChildSpan(w,E),this._markResourceAsUsed(E));const C=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(w,_,this.getConfig().ignoreNetworkEvents,void 0,C)}}_cleanPreviousSpanInformation(_){const w=this._xhrMem.get(_);if(w){const E=w.callbackToRemoveEvents;E&&E(),this._xhrMem.delete(_)}}_createSpan(_,w,E){const C=parseUrl(w);if(isUrlIgnored(C.href,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let P="";const R={};if(this._semconvStability&Wu.OLD&&(P=E.toUpperCase(),R["http.method"]=E,R["http.url"]=C.toString()),this._semconvStability&Wu.STABLE){const _=E,w=normalizeHttpRequestMethod$1(E);P||(P=w),R[ko]=w,w!==_&&(R[Fo]=_),R[qo]=C.toString(),R[Mo]=C.hostname;const L=function serverPortFromUrl$1(_){const w=Number(_.port||Ip[_.protocol]);return w&&!isNaN(w)?w:void 0}(C);L&&(R[$o]=L)}const L=this.tracer.startSpan(P,{kind:Re.CLIENT,attributes:R});return L.addEvent(Cp.METHOD_OPEN),this._cleanPreviousSpanInformation(_),this._xhrMem.set(_,{span:L,spanUrl:w}),L}_markResourceAsUsed(_){this._usedResources.add(_)}_patchOpen(){return _=>{const w=this;return function patchOpen(...E){if(!w._isEnabled)return _.apply(this,E);const C=E[0],P=E[1];return w._createSpan(this,P,C),_.apply(this,E)}}}_patchSend(){const _=this;function endSpan(w,E,C,P){const R=_._xhrMem.get(E);if(!R)return;if(R.status=E.status,R.statusText=E.statusText,_._xhrMem.delete(E),R.span){const w=R.span;_._applyAttributesAfterXHR(w,E),_._semconvStability&Wu.STABLE&&(C?P&&(w.setStatus({code:xe.ERROR,message:P}),w.setAttribute(Lo,P)):R.status&&R.status>=400&&(w.setStatus({code:xe.ERROR}),w.setAttribute(Lo,String(R.status))))}const L=hrTime$1(),I=Date.now();setTimeout((()=>{!function endSpanTimeout(w,E,C,P){const R=E.callbackToRemoveEvents;"function"==typeof R&&R();const{span:L,spanUrl:I,sendStartTime:k}=E;L&&(_._findResourceAndAddNetworkEvents(E,L,I,k,C),L.addEvent(w,P),_._addFinalSpanAttributes(L,E,I),L.end(P),_._tasksCount--),_._clearResources()}(w,R,L,I)}),300)}function onError(){endSpan(Cp.EVENT_ERROR,this,!0,"error")}function onAbort(){endSpan(Cp.EVENT_ABORT,this,!1)}function onTimeout(){endSpan(Cp.EVENT_TIMEOUT,this,!0,"timeout")}function onLoad(){this.status<299?endSpan(Cp.EVENT_LOAD,this,!1):endSpan(Cp.EVENT_ERROR,this,!1)}return w=>function patchSend(...E){if(!_._isEnabled)return w.apply(this,E);const C=_._xhrMem.get(this);if(!C)return w.apply(this,E);const P=C.span,R=C.spanUrl;if(P&&R){if(_.getConfig().measureRequestSize&&E?.[0]){const w=getXHRBodyLength$1(E[0]);void 0!==w&&(_._semconvStability&Wu.OLD&&P.setAttribute("http.request_content_length_uncompressed",w),_._semconvStability&Wu.STABLE&&P.setAttribute("http.request.body.size",w))}Le.with(Ue.setSpan(Le.active(),P),(()=>{_._tasksCount++,C.sendStartTime=hrTime$1(),P.addEvent(Cp.METHOD_SEND),this.addEventListener("abort",onAbort),this.addEventListener("error",onError),this.addEventListener("load",onLoad),this.addEventListener("timeout",onTimeout),C.callbackToRemoveEvents=()=>{!function unregister(w){w.removeEventListener("abort",onAbort),w.removeEventListener("error",onError),w.removeEventListener("load",onLoad),w.removeEventListener("timeout",onTimeout);const E=_._xhrMem.get(w);E&&(E.callbackToRemoveEvents=void 0)}(this),C.createdResources&&C.createdResources.observer.disconnect()},_._addHeaders(this,R),_._addResourceObserver(this,R)}))}return w.apply(this,E)}}enable(){if(!this._isEnabled){if(this._isXhrPatched)return this._diag.debug("reactivating existing patch on",this.moduleName,this.version),void(this._isEnabled=!0);try{this._diag.debug("applying patch to",this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(_){this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.warn("Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.",_)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}}var kp;!function(_){_.COMPONENT="component",_.HTTP_STATUS_TEXT="http.status_text"}(kp||(kp={}));const Fp=Ie.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function getFetchBodyLength(..._){if(_[0]instanceof URL||"string"==typeof _[0]){const w=_[1];if(!w?.body)return Promise.resolve();if(w.body instanceof ReadableStream){const{body:_,length:E}=function _getBodyNonDestructively(_){if(!_.pipeThrough)return Fp.warn("Platform has ReadableStream but not pipeThrough!"),{body:_,length:Promise.resolve(void 0)};let w,E=0;const C=new Promise((_=>{w=_})),P=new TransformStream({start(){},async transform(_,w){const C=await _;E+=C.byteLength,w.enqueue(_)},flush(){w(E)}});return{body:_.pipeThrough(P),length:C}}(w.body);return w.body=_,E}return Promise.resolve(function getXHRBodyLength(_){if(function isDocument(_){return"undefined"!=typeof Document&&_ instanceof Document}(_))return(new XMLSerializer).serializeToString(document).length;if("string"==typeof _)return getByteLength(_);if(_ instanceof Blob)return _.size;if(_ instanceof FormData)return function getFormDataSize(_){let w=0;for(const[E,C]of _.entries())w+=E.length,C instanceof Blob?w+=C.size:w+=C.length;return w}(_);if(_ instanceof URLSearchParams)return getByteLength(_.toString());if(void 0!==_.byteLength)return _.byteLength;return void Fp.warn("unknown body type")}(w.body))}{const w=_[0];return w?.body?w.clone().text().then((_=>getByteLength(_))):Promise.resolve()}}const jp=new TextEncoder;function getByteLength(_){return jp.encode(_).byteLength}const Mp={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let $p;function getKnownMethods(){if(void 0===$p){const _=getStringListFromEnv("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");_&&_.length>0?($p={},_.forEach((_=>{$p[_]=!0}))):$p=Mp}return $p}const Bp={"https:":"443","http:":"80"};const Up="0.220.0",Vp="undefined"!=typeof PerformanceObserver;class FetchInstrumentation extends InstrumentationBase{constructor(_={}){super("@opentelemetry/instrumentation-fetch",Up,_),this.component="fetch",this.version=Up,this.moduleName=this.component,this._usedResources=new WeakSet,this._tasksCount=0,this._semconvStability=semconvStabilityFromStr("http",_?.semconvStabilityOptIn)}init(){}_addChildSpan(_,w){const E=this.tracer.startSpan("CORS Preflight",{startTime:w[Ap.FETCH_START]},Ue.setSpan(Le.active(),_)),C=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(E,w,this.getConfig().ignoreNetworkEvents,void 0,C),E.end(w[Ap.RESPONSE_END])}_addFinalSpanAttributes(_,w){const E=parseUrl(w.url);if(this._semconvStability&Wu.OLD&&(_.setAttribute("http.status_code",w.status),null!=w.statusText&&_.setAttribute(kp.HTTP_STATUS_TEXT,w.statusText),_.setAttribute("http.host",E.host),_.setAttribute("http.scheme",E.protocol.replace(":","")),"undefined"!=typeof navigator&&_.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&Wu.STABLE){_.setAttribute(jo,w.status),_.setAttribute(Mo,E.hostname);const C=function serverPortFromUrl(_){const w=Number(_.port||Bp[_.protocol]);return w&&!isNaN(w)?w:void 0}(E);C&&_.setAttribute($o,C)}}_addHeaders(_,w){if(!shouldPropagateTraceHeaders(w,this.getConfig().propagateTraceHeaderCorsUrls)){const _={};return $e.inject(Le.active(),_),void(Object.keys(_).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(_ instanceof Request)$e.inject(Le.active(),_.headers,{set:(_,w,E)=>_.set(w,"string"==typeof E?E:String(E))});else{const w=new Headers(_.headers);$e.inject(Le.active(),w,{set:(_,w,E)=>_.set(w,"string"==typeof E?E:String(E))}),_.headers=w}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(_,w={}){if(isUrlIgnored(_,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let E="";const C={};if(this._semconvStability&Wu.OLD){const P=(w.method||"GET").toUpperCase();E=`HTTP ${P}`,C[kp.COMPONENT]=this.moduleName,C["http.method"]=P,C["http.url"]=_}if(this._semconvStability&Wu.STABLE){const P=w.method,R=function normalizeHttpRequestMethod(_){const w=getKnownMethods(),E=_.toUpperCase();return E in w?E:"_OTHER"}(w.method||"GET");E||(E=R),C[ko]=R,R!==P&&(C[Fo]=P),C[qo]=_}return this.tracer.startSpan(E,{kind:Re.CLIENT,attributes:C})}_findResourceAndAddNetworkEvents(_,w,E){let C=w.entries;if(!C.length){if(!performance.getEntriesByType)return;C=performance.getEntriesByType("resource")}const P=getResource(w.spanUrl,w.startTime,E,C,this._usedResources,"fetch");if(P.mainRequest){const w=P.mainRequest;this._markResourceAsUsed(w);const E=P.corsPreFlightRequest;E&&(this._addChildSpan(_,E),this._markResourceAsUsed(E));const C=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents$1(_,w,this.getConfig().ignoreNetworkEvents,void 0,C)}}_markResourceAsUsed(_){this._usedResources.add(_)}_endSpan(_,w,E){const C=millisToHrTime$1(Date.now()),P=hrTime$1();this._addFinalSpanAttributes(_,E),this._semconvStability&Wu.STABLE&&E.status>=400&&(_.setStatus({code:xe.ERROR}),_.setAttribute(Lo,String(E.status))),setTimeout((()=>{w.observer?.disconnect(),this._findResourceAndAddNetworkEvents(_,w,P),this._tasksCount--,this._clearResources(),_.end(C)}),300)}_patchConstructor(){return _=>{const w=this;return function patchConstructor(...E){if(!w._isEnabled)return _.apply(this,E);const C=this,P=parseUrl(E[0]instanceof Request?E[0].url:String(E[0])).href;let R;R=E[0]instanceof Request?null!=E[1]?new Request(E[0],E[1]):E[0]:E[1]||{};const L=w._createSpan(P,R);if(!L)return _.apply(this,E);const I=w._prepareSpanData(P);function endSpanOnError(_,E){w._applyAttributesAfterFetch(_,R,E),w._endSpan(_,I,{status:E.status||0,statusText:E.message,url:P})}function endSpanOnSuccess(_,E){w._applyAttributesAfterFetch(_,R,E),E.status>=200&&E.status<400?w._endSpan(_,I,E):w._endSpan(_,I,{status:E.status,statusText:E.statusText,url:P})}function onSuccess(_,E){try{const w=E.clone().body;if(w){const C=w.getReader(),read=()=>{C.read().then((({done:w})=>{w?endSpanOnSuccess(_,E):read()}),(w=>{endSpanOnError(_,w)}))};read()}else endSpanOnSuccess(_,E)}catch(E){w._diag.error("Failed to read fetch response body",E),w._endSpan(_,I,{status:0,url:P})}return E}function onError(_,E){try{endSpanOnError(_,E)}catch(C){w._diag.error("Failed to end span on fetch error",C),w._endSpan(_,I,{status:E.status||0,url:P})}throw E}return w.getConfig().measureRequestSize&&getFetchBodyLength(...E).then((_=>{_&&(w._semconvStability&Wu.OLD&&L.setAttribute("http.request_content_length_uncompressed",_),w._semconvStability&Wu.STABLE&&L.setAttribute("http.request.body.size",_))})).catch((_=>{w._diag.warn("getFetchBodyLength",_)})),Le.with(Ue.setSpan(Le.active(),L),(()=>(w._callRequestHook(L,R),w._addHeaders(R,P),w._tasksCount++,_.apply(C,R instanceof Request?[R]:[P,R]).then(onSuccess.bind(C,L),onError.bind(C,L)))))}}}_applyAttributesAfterFetch(_,w,E){const C=this.getConfig().applyCustomAttributesOnSpan;C&&safeExecuteInTheMiddle((()=>C(_,w,E)),(_=>{_&&this._diag.error("applyCustomAttributesOnSpan",_)}))}_callRequestHook(_,w){const E=this.getConfig().requestHook;E&&safeExecuteInTheMiddle((()=>E(_,w)),(_=>{_&&this._diag.error("requestHook",_)}))}_prepareSpanData(_){const w=hrTime$1(),E=[];if("function"!=typeof PerformanceObserver)return{entries:E,startTime:w,spanUrl:_};const C=new PerformanceObserver((w=>{w.getEntries().forEach((w=>{"fetch"===w.initiatorType&&w.name===_&&E.push(w)}))}));return C.observe({entryTypes:["resource"]}),{entries:E,observer:C,startTime:w,spanUrl:_}}enable(){if(Vp){if(!this._isEnabled){if(this._isFetchPatched)return this._diag.debug("fetch constructor already patched"),void(this._isEnabled=!0);try{this._wrap(globalThis,"fetch",this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(_){this._diag.warn("Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.",_)}}}else this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()")}disable(){Vp&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}}const Hp=performance;var zp;!function(_){_.CONNECT_END="connectEnd",_.CONNECT_START="connectStart",_.DECODED_BODY_SIZE="decodedBodySize",_.DOM_COMPLETE="domComplete",_.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",_.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",_.DOM_INTERACTIVE="domInteractive",_.DOMAIN_LOOKUP_END="domainLookupEnd",_.DOMAIN_LOOKUP_START="domainLookupStart",_.ENCODED_BODY_SIZE="encodedBodySize",_.FETCH_START="fetchStart",_.LOAD_EVENT_END="loadEventEnd",_.LOAD_EVENT_START="loadEventStart",_.NAVIGATION_START="navigationStart",_.REDIRECT_END="redirectEnd",_.REDIRECT_START="redirectStart",_.REQUEST_START="requestStart",_.RESPONSE_END="responseEnd",_.RESPONSE_START="responseStart",_.SECURE_CONNECTION_START="secureConnectionStart",_.START_TIME="startTime",_.UNLOAD_EVENT_END="unloadEventEnd",_.UNLOAD_EVENT_START="unloadEventStart"}(zp||(zp={}));function hasKey(_,w){return w in _}function addSpanNetworkEvent(_,w,E,C=!0){if(hasKey(E,w)&&"number"==typeof E[w]&&(!C||0!==E[w]))return _.addEvent(w,E[w])}function addSpanNetworkEvents(_,w,E=!1,C,P){if(void 0===C&&(C=0!==w[zp.START_TIME]),E||(addSpanNetworkEvent(_,zp.FETCH_START,w,C),addSpanNetworkEvent(_,zp.DOMAIN_LOOKUP_START,w,C),addSpanNetworkEvent(_,zp.DOMAIN_LOOKUP_END,w,C),addSpanNetworkEvent(_,zp.CONNECT_START,w,C),addSpanNetworkEvent(_,zp.SECURE_CONNECTION_START,w,C),addSpanNetworkEvent(_,zp.CONNECT_END,w,C),addSpanNetworkEvent(_,zp.REQUEST_START,w,C),addSpanNetworkEvent(_,zp.RESPONSE_START,w,C),addSpanNetworkEvent(_,zp.RESPONSE_END,w,C)),!P){const E=w[zp.ENCODED_BODY_SIZE];void 0!==E&&_.setAttribute("http.response_content_length",E);const C=w[zp.DECODED_BODY_SIZE];void 0!==C&&E!==C&&_.setAttribute("http.response_content_length_uncompressed",C)}}var qp;!function(_){_.DOCUMENT_LOAD="documentLoad",_.DOCUMENT_FETCH="documentFetch",_.RESOURCE_FETCH="resourceFetch"}(qp||(qp={}));const Wp="http.url";var Gp;!function(_){_.FIRST_PAINT="firstPaint",_.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Gp||(Gp={}));const Kp={"first-paint":Gp.FIRST_PAINT,"first-contentful-paint":Gp.FIRST_CONTENTFUL_PAINT};class DocumentLoadInstrumentation extends InstrumentationBase{constructor(_={}){super("@opentelemetry/instrumentation-document-load","0.65.0",_),this.component="document-load",this.version="1",this.moduleName=this.component,this._semconvStability=semconvStabilityFromStr("http",_?.semconvStabilityOptIn)}init(){}_onDocumentLoaded(){window.setTimeout((()=>{this._collectPerformance()}))}_addResourcesSpans(_){const w=Hp.getEntriesByType?.("resource");w&&w.forEach((w=>{this._initResourceSpan(w,_)}))}_collectPerformance(){const _=Array.from(document.getElementsByTagName("meta")).find((_=>"traceparent"===_.getAttribute("name"))),w=(()=>{const _={},w=Hp.getEntriesByType?.("navigation")[0];if(w)Object.values(zp).forEach((E=>{if(hasKey(w,E)){const C=w[E];"number"==typeof C&&(_[E]=C)}}));else{const w=Hp.timing;w&&Object.values(zp).forEach((E=>{if(hasKey(w,E)){const C=w[E];"number"==typeof C&&(_[E]=C)}}))}return _})(),E=_&&_.content||"";Le.with($e.extract(se,{traceparent:E}),(()=>{const _=this._startSpan(qp.DOCUMENT_LOAD,zp.FETCH_START,w);_&&(Le.with(Ue.setSpan(Le.active(),_),(()=>{const _=this._startSpan(qp.DOCUMENT_FETCH,zp.FETCH_START,w);_&&(this._semconvStability&Wu.OLD&&_.setAttribute(Wp,location.href),this._semconvStability&Wu.STABLE&&_.setAttribute(qo,location.href),Le.with(Ue.setSpan(Le.active(),_),(()=>{const E=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents(_,w,this.getConfig().ignoreNetworkEvents,void 0,E),this._addCustomAttributesOnSpan(_,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(_,zp.RESPONSE_END,w)})))})),this._semconvStability&Wu.OLD&&(_.setAttribute(Wp,location.href),_.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&Wu.STABLE&&(_.setAttribute(qo,location.href),_.setAttribute("user_agent.original",navigator.userAgent)),this._addResourcesSpans(_),this.getConfig().ignoreNetworkEvents||(addSpanNetworkEvent(_,zp.FETCH_START,w),addSpanNetworkEvent(_,zp.UNLOAD_EVENT_START,w),addSpanNetworkEvent(_,zp.UNLOAD_EVENT_END,w),addSpanNetworkEvent(_,zp.DOM_INTERACTIVE,w),addSpanNetworkEvent(_,zp.DOM_CONTENT_LOADED_EVENT_START,w),addSpanNetworkEvent(_,zp.DOM_CONTENT_LOADED_EVENT_END,w),addSpanNetworkEvent(_,zp.DOM_COMPLETE,w),addSpanNetworkEvent(_,zp.LOAD_EVENT_START,w),addSpanNetworkEvent(_,zp.LOAD_EVENT_END,w)),this.getConfig().ignorePerformancePaintEvents||(_=>{const w=Hp.getEntriesByType?.("paint");w&&w.forEach((({name:w,startTime:E})=>{hasKey(Kp,w)&&_.addEvent(Kp[w],E)}))})(_),this._addCustomAttributesOnSpan(_,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(_,zp.LOAD_EVENT_END,w))}))}_endSpan(_,w,E){_&&(hasKey(E,w)?_.end(E[w]):_.end())}_initResourceSpan(_,w){const E=this._startSpan(qp.RESOURCE_FETCH,zp.FETCH_START,_,w);if(E){this._semconvStability&Wu.OLD&&E.setAttribute(Wp,_.name),this._semconvStability&Wu.STABLE&&E.setAttribute(qo,_.name);const w=!(this._semconvStability&Wu.OLD);addSpanNetworkEvents(E,_,this.getConfig().ignoreNetworkEvents,void 0,w),this._addCustomAttributesOnResourceSpan(E,_,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(E,zp.RESPONSE_END,_)}}_startSpan(_,w,E,C){if(hasKey(E,w)&&"number"==typeof E[w]){return this.tracer.startSpan(_,{startTime:E[w]},C?Ue.setSpan(Le.active(),C):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(_,w){w&&safeExecuteInTheMiddle((()=>w(_)),(_=>{_&&this._diag.error("addCustomAttributesOnSpan",_)}))}_addCustomAttributesOnResourceSpan(_,w,E){E&&safeExecuteInTheMiddle((()=>E(_,w)),(_=>{_&&this._diag.error("addCustomAttributesOnResourceSpan",_)}))}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}function mergeHeaders(_,w,E){return async()=>{const C={...await E()},P={};return null!=w&&Object.assign(P,await w()),null!=_&&Object.assign(P,function validateAndNormalizeHeaders(_){const w={};return Object.entries(_??{}).forEach((([_,E])=>{void 0!==E?w[_]=String(E):Ie.warn(`Header "${_}" has invalid value (${E}) and will be ignored`)})),w}(await _())),Object.assign(P,C)}}function validateUserProvidedUrl(_){if(null!=_)try{const w=globalThis.location?.href;return new URL(_,w).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${_}'`)}}function mergeOtlpHttpConfigurationWithDefaults(_,w,E){return{...mergeOtlpSharedConfigurationWithDefaults(_,w,E),headers:mergeHeaders(_.headers,w.headers,E.headers),url:validateUserProvidedUrl(_.url)??w.url??E.url}}function getHttpConfigurationDefaults(_,w){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:async()=>_,url:"http://localhost:4318/"+w}}function httpAgentFactoryFromOptions(_){return async w=>{const E="http:"===w,C=E?import("http"):import("https"),{Agent:P}=await C;if(E){const{ca:w,cert:E,key:C,...R}=_;return new P(R)}return new P(_)}}function isExportHTTPErrorRetryable(_){return 429===_||502===_||503===_||504===_}function parseRetryAfterToMills$2(_){if(null==_)return;const w=Number.parseInt(_,10);if(Number.isInteger(w))return w>0?1e3*w:-1;const E=new Date(_).getTime()-Date.now();return E>=0?E:0}const Qp="OTel-OTLP-Exporter-JavaScript/0.220.0",Xp=4194304;function sendWithHttp(_,w,E,C,P,R,L,I){return new Promise((k=>{const F=new URL(w);E["User-Agent"]=P?`${P} ${Qp}`:Qp;const V=_(F,{method:"POST",headers:E,agent:R},(_=>{const w=[];let E=0;_.on("data",(C=>{if(E+=C.length,E>Xp){const w=new Error("OTLP export response body exceeded size limit of 4194304 bytes");return k({status:"failure",error:w}),void _.destroy()}w.push(C)})),_.on("end",(()=>{if(_.statusCode&&_.statusCode<=299)k({status:"success",data:Buffer.concat(w)});else if(_.statusCode&&isExportHTTPErrorRetryable(_.statusCode))k({status:"retryable",retryInMillis:parseRetryAfterToMills$2(_.headers["retry-after"])});else{const E=new OTLPExporterError(_.statusMessage,_.statusCode,Buffer.concat(w).toString());k({status:"failure",error:E})}})),_.on("error",(w=>{_.statusCode&&_.statusCode<=299?k({status:"success"}):_.statusCode&&isExportHTTPErrorRetryable(_.statusCode)?k({status:"retryable",error:w,retryInMillis:parseRetryAfterToMills$2(_.headers["retry-after"])}):k({status:"failure",error:w})}))}));V.setTimeout(I,(()=>{V.destroy(),k({status:"retryable",error:new Error("Request timed out")})})),V.on("error",(_=>{!function isHttpTransportNetworkErrorRetryable(_){const w=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);if("code"in _&&"string"==typeof _.code)return w.has(_.code);return!1}(_)?k({status:"failure",error:_}):k({status:"retryable",error:_})})),function compressAndSend(_,w,E,C){let P=function readableFromUint8Array(_){const w=new $;return w.push(_),w.push(null),w}(E);"gzip"===w&&(_.setHeader("Content-Encoding","gzip"),P=P.on("error",C).pipe(j.createGzip()).on("error",C));P.pipe(_).on("error",C)}(V,C,L,(_=>{k({status:"failure",error:_})}))}))}class HttpExporterTransport{constructor(_){this._utils=null,this._parameters=_}async send(_,w){const{agent:E,request:C}=await this._loadUtils(),P=await this._parameters.headers();return sendWithHttp(C,this._parameters.url,P,this._parameters.compression,this._parameters.userAgent,E,_,w)}shutdown(){}async _loadUtils(){let _=this._utils;if(null===_){const w=new URL(this._parameters.url).protocol,[E,C]=await Promise.all([this._parameters.agentFactory(w),requestFunctionFactory(w)]);_=this._utils={agent:E,request:C}}return _}}async function requestFunctionFactory(_){const w="http:"===_?import("http"):import("https"),{request:E}=await w;return E}class RetryingTransport{constructor(_){this._transport=_}retry(_,w,E){return new Promise(((C,P)=>{setTimeout((()=>{this._transport.send(_,w).then(C,P)}),E)}))}async send(_,w){let E=5,C=1e3;const P=Date.now()+w;let R=await this._transport.send(_,w);for(;"retryable"===R.status&&E>0;){E--;const w=Math.max(Math.min(C*(.4*Math.random()-.2+1),5e3),0);C*=1.5;const L=R.retryInMillis??w,I=P-Date.now();if(L>I)return Ie.info(`Export retry time ${Math.round(L)}ms exceeds remaining timeout ${Math.round(I)}ms, not retrying further.`),R;Ie.verbose(`Scheduling export retry in ${Math.round(L)}ms`),R=await this.retry(_,I,L)}return"success"===R.status?Ie.verbose(`Export succeeded after ${5-E} retry attempts.`):"retryable"===R.status?Ie.info("Export failed after maximum retry attempts (5)."):Ie.info(`Export failed with non-retryable error: ${R.error}`),R}shutdown(){return this._transport.shutdown()}}function createRetryingTransport(_){return new RetryingTransport(_.transport)}function parseAndValidateTimeoutFromEnv(_){const w=function getNumberFromEnv$1(_){const w=process.env[_];if(null==w||""===w.trim())return;const E=Number(w);if(!isNaN(E))return E;Ie.warn(`Unknown value ${qe.inspect(w)} for ${_}, expected a number, using defaults`)}(_);if(null!=w){if(Number.isFinite(w)&&w>0)return w;Ie.warn(`Configuration: ${_} is invalid, expected number greater than 0 (actual: ${w})`)}}function getTimeoutFromEnv(_){const w=parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${_}_TIMEOUT`),E=parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT");return w??E}function parseAndValidateCompressionFromEnv(_){const w=getStringFromEnv$1(_)?.trim();if(null==w||"none"===w||"gzip"===w)return w;Ie.warn(`Configuration: ${_} is invalid, expected 'none' or 'gzip' (actual: '${w}')`)}function getCompressionFromEnv(_){const w=parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${_}_COMPRESSION`),E=parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION");return w??E}function getSharedConfigurationFromEnvironment(_){return{timeoutMillis:getTimeoutFromEnv(_),compression:getCompressionFromEnv(_)}}function getStaticHeadersFromEnv(_){const w=getStringFromEnv$1(`OTEL_EXPORTER_OTLP_${_}_HEADERS`),E=getStringFromEnv$1("OTEL_EXPORTER_OTLP_HEADERS"),C=parseKeyPairsIntoRecord(w),P=parseKeyPairsIntoRecord(E);if(0!==Object.keys(C).length||0!==Object.keys(P).length)return Object.assign({},parseKeyPairsIntoRecord(E),parseKeyPairsIntoRecord(w))}function getNonSpecificUrlFromEnv(_){const w=getStringFromEnv$1("OTEL_EXPORTER_OTLP_ENDPOINT");if(void 0!==w)return function appendResourcePathToUrl(_,w){try{new URL(_)}catch{return void Ie.warn(`Configuration: Could not parse environment-provided export URL: '${_}', falling back to undefined`)}_.endsWith("/")||(_+="/"),_+=w;try{new URL(_)}catch{return void Ie.warn(`Configuration: Provided URL appended with '${w}' is not a valid URL, using 'undefined' instead of '${_}'`)}return _}(w,_)}function getSpecificUrlFromEnv(_){const w=getStringFromEnv$1(`OTEL_EXPORTER_OTLP_${_}_ENDPOINT`);if(void 0!==w)return function appendRootPathToUrlIfNeeded(_){try{return new URL(_).toString()}catch{return void Ie.warn(`Configuration: Could not parse environment-provided export URL: '${_}', falling back to undefined`)}}(w)}function readFileFromEnv(_,w,E){const P=getStringFromEnv$1(_),R=getStringFromEnv$1(w),L=P??R;if(null!=L)try{return k.readFileSync(C.resolve(process.cwd(),L))}catch{return void Ie.warn(E)}}function getClientCertificateFromEnv(_){return readFileFromEnv(`OTEL_EXPORTER_OTLP_${_}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function getClientKeyFromEnv(_){return readFileFromEnv(`OTEL_EXPORTER_OTLP_${_}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function getRootCertificateFromEnv(_){return readFileFromEnv(`OTEL_EXPORTER_OTLP_${_}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function convertLegacyHeaders(_){return"function"==typeof _.headers?_.headers:wrapStaticHeadersInFunction(_.headers)}function convertLegacyAgentOptions(_){if("function"==typeof _.httpAgentOptions)return _.httpAgentOptions;let w=_.httpAgentOptions;return null!=_.keepAlive&&(w={keepAlive:_.keepAlive,...w}),null!=w?httpAgentFactoryFromOptions(w):void 0}function convertLegacyHttpOptions(_,w,E,C){return _.metadata&&Ie.warn("Metadata cannot be set when using http"),function mergeOtlpNodeHttpConfigurationWithDefaults(_,w,E){return{...mergeOtlpHttpConfigurationWithDefaults(_,w,E),agentFactory:_.agentFactory??w.agentFactory??E.agentFactory,userAgent:_.userAgent}}({url:_.url,headers:convertLegacyHeaders(_),concurrencyLimit:_.concurrencyLimit,timeoutMillis:_.timeoutMillis,compression:_.compression,agentFactory:convertLegacyAgentOptions(_),userAgent:_.userAgent},function getNodeHttpConfigurationFromEnvironment(_,w){return{...getSharedConfigurationFromEnvironment(_),url:getSpecificUrlFromEnv(_)??getNonSpecificUrlFromEnv(w),headers:wrapStaticHeadersInFunction(getStaticHeadersFromEnv(_)),agentFactory:httpAgentFactoryFromOptions({keepAlive:!0,ca:getRootCertificateFromEnv(_),cert:getClientCertificateFromEnv(_),key:getClientKeyFromEnv(_)})}}(w,E),function getNodeHttpConfigurationDefaults(_,w){return{...getHttpConfigurationDefaults(_,w),agentFactory:httpAgentFactoryFromOptions({keepAlive:!0})}}(C,E))}let Jp=class OTLPTraceExporter extends OTLPExporterBase{constructor(_={}){super(function createOtlpHttpExportDelegate(_,w){return createOtlpExportDelegate({transport:createRetryingTransport({transport:(E=_,new HttpExporterTransport(E))}),serializer:w,promiseHandler:createBoundedQueueExportPromiseHandler(_)},{timeout:_.timeoutMillis});var E}(convertLegacyHttpOptions(_,"TRACES","v1/traces",{"Content-Type":"application/x-protobuf"}),ci))}};const Zp="global",Yp="gcp.project_id",ed="gcp.firebase.app_id",td="cloud.region",rd="gcp.firebase.domain";var nd;function isSpan(_){return"function"==typeof _.spanContext}function getSpanId(_){return _.spanContext().spanId}function isRootEvent(_){return isSpan(_)?void 0===_.parentSpanContext:void 0===_.spanContext?.traceId}!function(_){_[_.RootSpan=0]="RootSpan",_[_.RootLog=1]="RootLog",_[_.ChildSpan=2]="ChildSpan",_[_.ChildLog=3]="ChildLog"}(nd||(nd={}));class TraceEvents{constructor(){this.logs=new Set,this.spans=new Map,this.isTraceQueuedForExport=!1}add(_){isSpan(_)?this.spans.set(getSpanId(_),_):this.logs.add(_)}has(_){return isSpan(_)?this.spans.has(getSpanId(_)):this.logs.has(_)}}class TelemetryStore{constructor(_=TelemetryStore.DEFAULT_BUFFER_LIMIT,w){this._telemetryBufferMap=new Map,this._totalTelemetryCount=0,this._shouldAddLimitLog=!1,this._bufferLimit=_,this._rootTelemetryQueue=new RootTelemetryQueue(w)}get totalTelemetryCount(){return this._totalTelemetryCount}add(_){const w=this._getEventId(_);if(isRootEvent(_)&&this._telemetryBufferMap.has(w))return;if(!isRootEvent(_)&&!this._telemetryBufferMap.has(w))return;if(!this._bufferHasCapacity()){if(this._isQueueEmpty())return void(this._shouldAddLimitLog=!0);this._evictOldest()}const E=function getEventType(_){return isSpan(_)?isRootEvent(_)?nd.RootSpan:nd.ChildSpan:isRootEvent(_)?nd.RootLog:nd.ChildLog}(_);switch(E){case nd.RootSpan:{const E=new TraceEvents;return E.add(_),this._telemetryBufferMap.set(w,E),void this._totalTelemetryCount++}case nd.RootLog:return this._telemetryBufferMap.set(w,_),this._rootTelemetryQueue.isFull()&&this._evictOldest(),this._rootTelemetryQueue.enqueue(w),void this._totalTelemetryCount++;case nd.ChildSpan:case nd.ChildLog:{const E=this._telemetryBufferMap.get(w);return void(E&&E instanceof TraceEvents&&!E.has(_)&&(E.add(_),this._totalTelemetryCount++))}}}update(_){if(!isRootEvent(_))return;const w=this._getEventId(_),E=this._telemetryBufferMap.get(w);if(E&&E instanceof TraceEvents){if(E.isTraceQueuedForExport)return;this._rootTelemetryQueue.isFull()&&this._evictOldest(),this._rootTelemetryQueue.enqueue(w),E.isTraceQueuedForExport=!0}}getSpansToExport(){const _=[];for(const w of this._rootTelemetryQueue.getValues()){const E=this._telemetryBufferMap.get(w);E instanceof TraceEvents&&_.push(...E.spans.values())}return _}getLogsToExport(){const _=[];if(this._shouldAddLimitLog){const w={severityNumber:z.INFO,body:"Telemetry buffer limit reached. Some telemetry events were dropped."};_.push(w)}for(const w of this._rootTelemetryQueue.getValues()){const E=this._telemetryBufferMap.get(w);E instanceof TraceEvents?_.push(...E.logs):E&&_.push(E)}return _}clear(){this._rootTelemetryQueue.clear(),this._telemetryBufferMap.clear(),this._totalTelemetryCount=0,this._shouldAddLimitLog=!1}_getEventId(_){return isSpan(_)?_.spanContext().traceId:_.spanContext?.traceId??function generateUuid$1(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues){const _=new Uint8Array(16);crypto.getRandomValues(_),_[6]=15&_[6]|64,_[8]=63&_[8]|128;const w=Array.from(_,(_=>_.toString(16).padStart(2,"0"))).join("");return`${w.slice(0,8)}-${w.slice(8,12)}-${w.slice(12,16)}-${w.slice(16,20)}-${w.slice(20,32)}`}throw new Error("Web Crypto API is not available to generate a UUID.")}()}_bufferHasCapacity(){return this._totalTelemetryCount<this._bufferLimit}_isQueueEmpty(){return 0===this._rootTelemetryQueue.size}_evictOldest(){const _=this._rootTelemetryQueue.dequeue();_&&this._maybeEvictIdFromBuffer(_)}_maybeEvictIdFromBuffer(_){const w=this._telemetryBufferMap.get(_);w&&(this._totalTelemetryCount-=w instanceof TraceEvents?w.spans.size+w.logs.size:1,this._telemetryBufferMap.delete(_))}}TelemetryStore.DEFAULT_BUFFER_LIMIT=1e3;class RootTelemetryQueue{constructor(_=RootTelemetryQueue.DEFAULT_LIMIT){if(this._limit=_,this._head=0,this._tail=0,this._size=0,_<=0)throw new Error("Limit must be a positive integer greater than 0");this._items=new Array(this._limit).fill(void 0)}get size(){return this._size}isFull(){return this._size===this._limit}enqueue(_){this._size!==this._limit&&(this._items[this._tail]=_,this._tail=(this._tail+1)%this._limit,this._size++)}dequeue(){if(0===this._size)return;const _=this._items[this._head];return this._items[this._head]=void 0,this._head=(this._head+1)%this._limit,this._size--,_}peek(){if(0!==this._size)return this._items[this._head]}getValues(){const _=[];for(let w=0;w<this._size;w++){const E=(this._head+w)%this._items.length;this._items[E]&&_.push(this._items[E])}return _}clear(){this._items.fill(void 0),this._head=0,this._tail=0,this._size=0}}RootTelemetryQueue.DEFAULT_LIMIT=100;class OnErrorLogRecordProcessor extends BatchLogRecordProcessor{constructor(_,w){super({exporter:_,disableAutoFlushOnDocumentHide:!0}),this._store=w}onEmit(_){"good"!==_.attributes?.["browser.web_vital.rating"]&&this._store.add(_)}shutdown(){return this._store.clear(),super.shutdown()}onErrorOccurred(){const _=this._store.getLogsToExport();for(const w of _)super.onEmit(w)}}class OnErrorSpanProcessor extends BatchSpanProcessor{constructor(_,w){super(_),this._store=w}onStart(_,w){this._store.add(_)}onEnd(_){this._store.update(_)}shutdown(){return this._store.clear(),super.shutdown()}onErrorOccurred(){const _=this._store.getSpansToExport();for(const w of _)super.onEnd(w)}}class FirebaseAttributesSpanProcessor{constructor(_){this.attributesStore=_}onStart(_,w){const E=this.attributesStore.getSpanAttributes();for(const[w,C]of Object.entries(E))void 0!==C&&void 0===_.attributes?.[w]&&_.setAttribute(w,C)}onEnd(_){_.attributes&&delete _.attributes["user_agent.original"]}async forceFlush(){}async shutdown(){}}let od,id=class FetchTransport{constructor(_){this.parameters=_}async send(_,w){const E=new AbortController,C=setTimeout((()=>E.abort()),w);try{const w=new Headers(this.parameters.headers);if(this.parameters.dynamicHeaderProviders&&this.parameters.dynamicHeaderProviders.length>0){const _=this.parameters.dynamicHeaderProviders.map((async _=>{try{return await _.getHeader()}catch(_){return Ie.debug(`Failed to retrieve dynamic header: ${_}`),null}})),E=await Promise.all(_);for(const _ of E)_&&w.append(..._)}const C=_.byteLength<6e4,P={method:"POST",headers:w,signal:E.signal,keepalive:C,mode:"cors",body:_},R=await Le.with(suppressTracing$2(Le.active()),(()=>fetch(this.parameters.url,P)));if(R.status>=200&&R.status<=299)return Ie.debug("response success"),{status:"success"};if(function isExportRetryable$1(_){return[429,502,503,504].includes(_)}(R.status)){const _=function parseRetryAfterToMills$1(_){if(null==_)return;const w=Number.parseInt(_,10);if(Number.isInteger(w))return w>0?1e3*w:-1;const E=new Date(_).getTime()-Date.now();return E>=0?E:0}(R.headers.get("Retry-After"));return{status:"retryable",retryInMillis:_}}return{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(_){return _ instanceof Error?{status:"failure",error:_}:{status:"failure",error:new Error(`Fetch request errored: ${_}`)}}finally{clearTimeout(C)}}shutdown(){}};function createTracingProvider(_,w,E,C,P=[]){if("undefined"==typeof window)return{tracingProvider:Ue.getTracerProvider()};const R=function getTelemetryEndpointUrl$1(_={}){const w=_||{};if(w.endpointUrl){let _=w.endpointUrl.length;for(;_>0&&"/"===w.endpointUrl[_-1];)_--;return w.endpointUrl.slice(0,_)}const E=w.region||Zp;return E!==Zp?`https://clienttelemetry.${E}.rep.googleapis.com`:"https://clienttelemetry.googleapis.com"}(w),{projectId:L,appId:I,apiKey:k}=_.options,F=w.region||Zp,j={[rd]:window.location.hostname};L&&(j[Yp]=L),I&&(j[ed]=I),F!==Zp&&(j[td]=F);const $=resourceFromAttributes$1(j),V=`${R}/v1/traces`;let H;H="http://localhost:4318"===R?new Jp({url:V,headers:{"X-Goog-User-Project":L||"",...k?{"X-Goog-Api-Key":k}:{}}}):new OTLPTraceExporter({url:V,headers:{"Content-Type":"application/json",...k?{"X-Goog-Api-Key":k}:{}}},P,E);const z=new OnErrorSpanProcessor(H,C),q=new WebTracerProvider({resource:$,spanProcessors:[new FirebaseAttributesSpanProcessor(E),z]});q.register({propagator:new CompositePropagator({propagators:[new W3CTraceContextPropagator]})});const G=`^${R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,K={ignoreUrls:[new RegExp(G)],semconvStabilityOptIn:"http"};return od&&od(),od=registerInstrumentations({instrumentations:[new FetchInstrumentation(K),new XMLHttpRequestInstrumentation(K),new DocumentLoadInstrumentation({semconvStabilityOptIn:"http"})]}),{tracingProvider:q,onErrorSpanProcessor:z}}class OTLPTraceExporter extends OTLPExporterBase{constructor(_={},w=[],E){super(createOtlpNetworkExportDelegate({timeoutMillis:1e4,concurrencyLimit:5},di,new id({url:_.url,headers:new Headers("object"==typeof _.headers?_.headers:{}),dynamicHeaderProviders:w}))),this.attributesStore=E}async export(_,w){const E=await(this.attributesStore?.getInstallationIdAttribute());E&&_.forEach((_=>{Object.assign(_.attributes,E)})),super.export(_,w)}}const sd=new Set;function unregisterLoggerInstrumentations(){for(const _ of sd)_();sd.clear()}class BreadcrumbsFeatureImpl{constructor(){this.name="breadcrumbs"}createTelemetryStore(){return new TelemetryStore}createLogRecordProcessor(_,w){return new OnErrorLogRecordProcessor(_,w)}initializeLoggerInstrumentations(_){if("undefined"==typeof window)return;const w=new _l({enabled:!1}),E=new Kl({enabled:!1,includeRawAttribution:!0});this._unregisterLoggerInstrumentationsFn&&(this._unregisterLoggerInstrumentationsFn(),sd.delete(this._unregisterLoggerInstrumentationsFn));const C=registerInstrumentations({loggerProvider:_,instrumentations:[w,E,new Cl({autoCapturedActions:["click"]})]});Object.defineProperty(this,"_unregisterLoggerInstrumentationsFn",{value:C,writable:!0,configurable:!0,enumerable:!1}),sd.add(C)}createTracingProvider(_,w,E,C,P=[]){return createTracingProvider(_,w,E,C,P)}unregisterInstrumentations(){this._unregisterLoggerInstrumentationsFn&&(this._unregisterLoggerInstrumentationsFn(),sd.delete(this._unregisterLoggerInstrumentationsFn),this._unregisterLoggerInstrumentationsFn=void 0),function unregisterTracingInstrumentations(){od&&(od(),od=void 0)}()}}function breadcrumbs(){return new BreadcrumbsFeatureImpl}var ad="@firebase/crashlytics",cd="0.1.0-eap-sql.b903ef716";const ud="crashlytics",ld="global",pd="gcp.project_id",dd="gcp.firebase.app_id",fd="cloud.region",hd=Symbol("firebase_crashlytics_logged"),gd="app.installation.id",md="firebasecrashlytics.sessionid",yd="app.build_id",bd="session.id",_d="app.screen.id",vd="logging.googleapis.com/trace",Sd="logging.googleapis.com/spanId",wd="gcp.resource.name",Ed="session.id",Td="service.version",Ad="app.screen.id";class AttributesStore{constructor(_,w,E){this._projectId=_.projectId,this._region=w?.region||ld,this.updateOptions(w);const C=this.getSessionIdFromStorage();C&&(this._sessionId=C),this._installations=E?.getImmediate({optional:!0})??null,this._installations||E?.get().then((_=>this._installations=_)).catch((()=>{}))}updateOptions(_){const w=_?.appVersion?_.appVersion:Po?.appVersion?Po.appVersion:"unset";this._appVersion=w,this._customAttributes=_?.customAttributes?{..._.customAttributes}:void 0}get sessionId(){return this._sessionId}setSessionId(_){if(this._sessionId=_,"undefined"!=typeof sessionStorage)try{sessionStorage.setItem(md,_)}catch(_){}}setRoutePathProvider(_){this._routePathProvider=_}getLogAttributes(_){const w={};this._customAttributes&&Object.assign(w,this._customAttributes),this._appVersion&&(w[yd]=this._appVersion),this._sessionId&&(w[bd]=this._sessionId);const E=this._routePathProvider?.();return E&&(w[_d]=E),_?{...w,..._}:w}getSpanAttributes(){const _={};this._projectId&&(_[wd]=`//clienttelemetry.googleapis.com/projects/${this._projectId}/locations/${this._region}/`),this._appVersion&&(_[Td]=this._appVersion),this._sessionId&&(_[Ed]=this._sessionId);const w=this._routePathProvider?.();return w&&(_[Ad]=w),_}async getInstallationIdAttribute(){if(!this._installations)return null;if(this._iid)return{[gd]:this._iid};const _=await this._installations.getId();return _?(this._iid=_,{[gd]:_}):null}getSessionIdFromStorage(){if("undefined"!=typeof sessionStorage)try{return sessionStorage.getItem(md)||void 0}catch(_){}}}function getCrashlytics(_=E(),w){const C=_getProvider(_,ud);if(C.isInitialized()){const _=C.getImmediate();if(deepEqual(w||{},C.getOptions()))return _;throw new Error("getCrashlytics() cannot be called with different options")}const P=C.initialize({options:w});return w&&(P.options=w),P}function recordError(_,w,E){if(!_)return;if(w&&"object"==typeof w)try{w[hd]=!0}catch(_){}const{loggerProvider:C,telemetryStore:P,onErrorSpanProcessor:R,onErrorLogRecordProcessor:L}=_,I=C.getLogger("error-logger"),k=E?{...E}:{};w instanceof Error?I.emit({severityNumber:z.ERROR,body:w.message,attributes:{"exception.type":w.name||"Error","exception.stacktrace":w.stack||"No stack trace available","exception.message":w.message,...k}}):"string"==typeof w?I.emit({severityNumber:z.ERROR,body:w,attributes:k}):I.emit({severityNumber:z.ERROR,body:"Unknown error type: "+typeof w,attributes:k}),R&&R.onErrorOccurred(),L&&L.onErrorOccurred(),P&&P.clear()}function log(_,w,E){if(!_)return;const{loggerProvider:C}=_,P=C.getLogger("custom-logger"),R=E?{...E}:{};P.emit({severityNumber:z.INFO,body:w,attributes:R})}function logViewBoundary(_,w,E){const{loggerProvider:C,attributesStore:P,options:R}=_;if(!getBreadcrumbsFeature(R))return;const L=C.getLogger("view-boundary-logger"),I=P.getLogAttributes({[_d]:w,...E});L.emit({severityNumber:z.INFO,body:"Navigation event",attributes:I})}function getBreadcrumbsFeature(_){return _?.features?.find((_=>Boolean(_&&"breadcrumbs"===_.name)))}function startNewSession(_){const{loggerProvider:w,attributesStore:E}=_;if("undefined"!=typeof sessionStorage)try{const _=function generateUuid(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues){const _=new Uint8Array(16);crypto.getRandomValues(_),_[6]=15&_[6]|64,_[8]=63&_[8]|128;const w=Array.from(_,(_=>_.toString(16).padStart(2,"0"))).join("");return`${w.slice(0,8)}-${w.slice(8,12)}-${w.slice(12,16)}-${w.slice(16,20)}-${w.slice(20,32)}`}throw new Error("Web Crypto API is not available to generate a UUID.")}();E.setSessionId(_);const C=E.getLogAttributes();w.getLogger("session-logger").emit({severityNumber:z.DEBUG,body:"Session created",attributes:C})}catch(_){}}function registerListeners(_){if("undefined"!=typeof window&&"undefined"!=typeof document){const onVisibilityChange=async()=>{!getBreadcrumbsFeature(_.options)||"visible"!==document.visibilityState&&"hidden"!==document.visibilityState||function logVisibilityEvent(_,w){const{loggerProvider:E,attributesStore:C}=_,P=E.getLogger("visibility-logger"),R=C.getLogAttributes(),L="hidden"===w?"Background lifecycle event":"Foreground lifecycle event";P.emit({severityNumber:z.INFO,body:L,attributes:R})}(_,document.visibilityState),"hidden"===document.visibilityState&&await flush(_)},onPageHide=async()=>{await flush(_)};return window.addEventListener("visibilitychange",onVisibilityChange),window.addEventListener("pagehide",onPageHide),()=>{window.removeEventListener("visibilitychange",onVisibilityChange),window.removeEventListener("pagehide",onPageHide)}}return()=>{}}let Od=null;function flush(_){return _.loggerProvider.forceFlush().catch((_=>{console.error("Error flushing logs from Firebase Crashlytics:",_)}))}class CrashlyticsService{constructor(_,w,E,C,P,R,L){this.app=_,this.loggerProvider=w,this.tracingProvider=E,this.attributesStore=C,this.telemetryStore=P,this.onErrorLogRecordProcessor=R,this.onErrorSpanProcessor=L}unsubscribeListeners(_){this._unsubscribeListeners=_}async _delete(){this._unsubscribeListeners&&this._unsubscribeListeners(),getBreadcrumbsFeature(this._options)?.unregisterInstrumentations();const _=[];if(this.loggerProvider&&"function"==typeof this.loggerProvider.shutdown&&_.push(this.loggerProvider.shutdown().catch((_=>{console.warn("Error shutting down logger provider:",_)}))),this.tracingProvider){const w=this.tracingProvider;"function"==typeof w.shutdown&&_.push(w.shutdown().catch((_=>{console.warn("Error shutting down tracing provider:",_)})))}await Promise.all(_)}set options(_){this._options=_,this.attributesStore.updateOptions(_)}get options(){return this._options}}class FetchTransport{constructor(_){this.parameters=_}async send(_,w){const E=new AbortController,C=setTimeout((()=>E.abort()),w);try{const w=new Headers(this.parameters.headers);if(this.parameters.dynamicHeaderProviders&&this.parameters.dynamicHeaderProviders.length>0){const _=this.parameters.dynamicHeaderProviders.map((async _=>{try{return await _.getHeader()}catch(_){return Ie.debug(`Failed to retrieve dynamic header: ${_}`),null}})),E=await Promise.all(_);for(const _ of E)_&&w.append(..._)}const C=_.byteLength<6e4,P={method:"POST",headers:w,signal:E.signal,keepalive:C,mode:"cors",body:_},R=await Le.with(suppressTracing$2(Le.active()),(()=>fetch(this.parameters.url,P)));if(R.status>=200&&R.status<=299)return Ie.debug("response success"),{status:"success"};if(function isExportRetryable(_){return[429,502,503,504].includes(_)}(R.status)){const _=function parseRetryAfterToMills(_){if(null==_)return;const w=Number.parseInt(_,10);if(Number.isInteger(w))return w>0?1e3*w:-1;const E=new Date(_).getTime()-Date.now();return E>=0?E:0}(R.headers.get("Retry-After"));return{status:"retryable",retryInMillis:_}}return{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(_){return _ instanceof Error?{status:"failure",error:_}:{status:"failure",error:new Error(`Fetch request errored: ${_}`)}}finally{clearTimeout(C)}}shutdown(){}}class FirebaseAttributesLogProcessor{constructor(_,w){this.attributesStore=_,this.projectId=w}onEmit(_,w){var E,C,P,R,L;_.attributes||(_.attributes={});const I=this.attributesStore.getLogAttributes();for(const[w,C]of Object.entries(I))void 0!==C&&((E=_.attributes)[w]??(E[w]=C));const k=_.spanContext??(w?Ue.getSpanContext(w):void 0)??Ue.getActiveSpan()?.spanContext();k?.traceId&&k?.spanId&&this.projectId&&((C=_.attributes)[P=vd]??(C[P]=`projects/${this.projectId}/traces/${k.traceId}`),(R=_.attributes)[L=Sd]??(R[L]=k.spanId))}async forceFlush(){}async shutdown(){}}function createLoggerProvider(_,w={},E,C,P=[]){const R=function getTelemetryEndpointUrl(_={}){const w=_||{};if(w.endpointUrl){let _=w.endpointUrl.length;for(;_>0&&"/"===w.endpointUrl[_-1];)_--;return w.endpointUrl.slice(0,_)}const E=w.region||ld;return E!==ld?`https://clienttelemetry.${E}.rep.googleapis.com`:"https://clienttelemetry.googleapis.com"}(w),{projectId:L,appId:I,apiKey:k}=_.options,F=w.region||ld,j=`${R}/v1/logs`,$={[oi]:"firebase_telemetry_service"};L&&($[pd]=L),I&&($[dd]=I),F!==ld&&($[fd]=F);const V=resourceFromAttributes$1($),H=new OTLPLogExporter({url:j,headers:{"Content-Type":"application/json",...k?{"X-Goog-Api-Key":k}:{}}},P,E);let z;const q=[new FirebaseAttributesLogProcessor(E,L)],G=getBreadcrumbsFeature(w);G?(z=G.createLogRecordProcessor(H,C??G.createTelemetryStore()),q.push(z)):q.push(new BatchLogRecordProcessor({exporter:H,disableAutoFlushOnDocumentHide:!0}));const K=new LoggerProvider({resource:V,processors:q,logRecordLimits:{}});return w.registerGlobalLoggerProvider&&X.setGlobalLoggerProvider(K),G&&"undefined"!=typeof window&&G.initializeLoggerInstrumentations(K),{loggerProvider:K,onErrorLogRecordProcessor:z}}class OTLPLogExporter extends OTLPExporterBase{constructor(_={},w=[],E){super(createOtlpNetworkExportDelegate({timeoutMillis:1e4,concurrencyLimit:5},pi,new FetchTransport({url:_.url,headers:new Headers("object"==typeof _.headers?_.headers:{}),dynamicHeaderProviders:w}))),this.attributesStore=E,this.endpointUrl=_.url}async export(_,w){const E=_.filter((_=>!function isTelemetryUrl(_,w){return!!("string"==typeof _&&_&&(/^https?:\/\/clienttelemetry\.(googleapis\.com|[a-z0-9-]+\.rep\.googleapis\.com)(\/|$)/.test(_)||w&&_.startsWith(w)))}(_.attributes?.["url.full"]||_.attributes?.["http.url"]||_.attributes?.["resource.url"],this.endpointUrl)));if(0===E.length)return void w({code:mo.SUCCESS});const C=await this.attributesStore.getInstallationIdAttribute();C&&E.forEach((_=>{Object.assign(_.attributes,C)})),super.export(E,w)}async shutdown(){console.log("OTLPLogExporter: shutdown called")}async forceFlush(){console.log("OTLPLogExporter: forceFlush called")}}class AppCheckProvider{constructor(_){this.appCheck=_?.getImmediate({optional:!0}),this.appCheck||_?.get().then((_=>this.appCheck=_)).catch()}async getHeader(){if(!this.appCheck)return null;const _=await this.appCheck.getToken();return!_||_.error?null:["X-Firebase-AppCheck",_.token]}}!function registerCrashlytics(){w(new Component(ud,((_,{options:w})=>{const E=w||{},C=_.getProvider("app").getImmediate(),P=_.getProvider("app-check-internal"),R=_.getProvider("installations-internal"),L=new AttributesStore(C.options,E,R),I=getBreadcrumbsFeature(E),k=I?.createTelemetryStore(),F=[new AppCheckProvider(P)],{loggerProvider:j,onErrorLogRecordProcessor:$}=createLoggerProvider(C,E,L,k,F),{tracingProvider:V,onErrorSpanProcessor:H}=I&&k?I.createTracingProvider(C,E,L,k,F):{tracingProvider:null,onErrorSpanProcessor:void 0},z=new CrashlyticsService(C,j,V,L,k,$,H);w&&(z.options=E),L.sessionId||startNewSession(z);const q=registerListeners(z),G=!1!==E.captureUnhandledErrors?function registerGlobalErrorListeners(_){if("undefined"==typeof window||!1===_.options?.captureUnhandledErrors)return()=>{};if(Od){if(Od.crashlytics===_)return()=>{};Od.unsubscribe()}const errorListener=w=>{w.error&&w.error[hd]||recordError(_,w.error)},unhandledRejectionListener=w=>{w.reason&&w.reason[hd]||recordError(_,w.reason)};try{window.addEventListener("error",errorListener),window.addEventListener("unhandledrejection",unhandledRejectionListener)}catch(_){return console.warn("Firebase Crashlytics was not initialized:\n",_),()=>{}}let w=!1;const unsubscribe=()=>{w||(w=!0,Od?.unsubscribe===unsubscribe&&(Od=null),window.removeEventListener("error",errorListener),window.removeEventListener("unhandledrejection",unhandledRejectionListener))};return Od={crashlytics:_,unsubscribe:unsubscribe},unsubscribe}(z):()=>{};return z.unsubscribeListeners((()=>{q(),G()})),z}),"PUBLIC").setMultipleInstances(!0)),_(ad,cd),_(ad,cd,"esm2020")}();export{breadcrumbs,flush,getCrashlytics,log,logViewBoundary,recordError,unregisterLoggerInstrumentations};
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=firebase-crashlytics.js.map
|