1(()=>{"use strict";var t,e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(t||(t={}));class r{_promise;_resolve;_reject;constructor(){this._promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}class n{_callback;_that;_isCalled=!1;_deferred=new r;constructor(t,e){this._callback=t,this._that=e}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then((t=>this._deferred.resolve(t)),(t=>this._deferred.reject(t)))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}var o="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof e.g?e.g:{},i="1.9.0",s=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,a=function(t){var e=new Set([t]),r=new Set,n=t.match(s);if(!n)return function(){return!1};var o=+n[1],i=+n[2],a=+n[3];if(null!=n[4])return function(e){return e===t};function u(t){return r.add(t),!1}function c(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var n=t.match(s);if(!n)return u(t);var l=+n[1],p=+n[2],d=+n[3];return null!=n[4]||o!==l?u(t):0===o?i===p&&a<=d?c(t):u(t):i<=p?c(t):u(t)}}(i),u=i.split(".")[0],c=Symbol.for("opentelemetry.js.api."+u),l=o;function p(t,e,r,n){var o;void 0===n&&(n=!1);var s=l[c]=null!==(o=l[c])&&void 0!==o?o:{version:i};if(!n&&s[t]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(a.stack||a.message),!1}return s.version!==i?(a=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+i),r.error(a.stack||a.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+i+"."),!0)}function d(t){var e,r,n=null===(e=l[c])||void 0===e?void 0:e.version;if(n&&a(n))return null===(r=l[c])||void 0===r?void 0:r[t]}function h(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+i+".");var r=l[c];r&&delete r[t]}var f,g=function(){function t(t){this._namespace=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("debug",this._namespace,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("error",this._namespace,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("info",this._namespace,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("warn",this._namespace,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("verbose",this._namespace,t)},t}();function m(t,e,r){var n=d("diag");if(n)return r.unshift(e),n[t].apply(n,function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(f||(f={}));var _=function(){function t(){function t(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=d("diag");if(n)return n[t].apply(n,function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}(e),!1))}}var e=this;e.setLogger=function(t,r){var n,o,i;if(void 0===r&&(r={logLevel:f.INFO}),t===e){var s=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(n=s.stack)&&void 0!==n?n:s.message),!1}"number"==typeof r&&(r={logLevel:r});var a=d("diag"),u=function(t,e){function r(r,n){var o=e[r];return"function"==typeof o&&t>=n?o.bind(e):function(){}}return t<f.NONE?t=f.NONE:t>f.ALL&&(t=f.ALL),e=e||{},{error:r("error",f.ERROR),warn:r("warn",f.WARN),info:r("info",f.INFO),debug:r("debug",f.DEBUG),verbose
1:r("verbose",f.VERBOSE)}}(null!==(o=r.logLevel)&&void 0!==o?o:f.INFO,t);if(a&&!r.suppressOverrideMessage){var c=null!==(i=(new Error).stack)&&void 0!==i?i:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+c),u.warn("Current logger will overwrite one already registered from "+c)}return p("diag",u,e,!0)},e.disable=function(){h("diag",e)},e.createComponentLogger=function(t){return new g(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}(),y=_.instance();function v(t){try{(t=>{y.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){const e={};let r=t;for(;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(e[t])return;const n=r[t];n&&(e[t]=String(n))})),r=Object.getPrototypeOf(r);return e}(t))}(t))})(t)}catch{}}function b(t){return Symbol.for(t)}var w=new function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(t){return r._currentContext.get(t)},r.setValue=function(e,n){var o=new t(r._currentContext);return o._currentContext.set(e,n),o},r.deleteValue=function(e){var n=new t(r._currentContext);return n._currentContext.delete(e),n}},S=function(){function t(){}return t.prototype.active=function(){return w},t.prototype.with=function(t,e,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];return e.call.apply(e,function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}(n),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),E="context",T=new S,C=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return p(E,t,_.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(t,e,r){for(var n,o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];return(n=this._getContextManager()).with.apply(n,function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([t,e,r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}(o),!1))},t.prototype.bind=function(t,e){return this._getContextManager().bind(t,e)},t.prototype._getContextManager=function(){return d(E)||T},t.prototype.disable=function(){this._getContextManager().disable(),h(E,_.instance())},t}(),A=C.getInstance();const O=b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function L(t){return!0===t.getValue(O)}const P=function(t,e){return new Promise((r=>{A.with(A.active().setValue(O,!0),(()=>{t.export(e,(t=>{r(t)}))}))}))};var N;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(N||(N={}));const R=Function.prototype.toString,x=R.call(Object),D=Object.getPrototypeOf,I=Object.prototype,M=I.hasOwnProperty,j=Symbol?Symbol.toStringTag:void 0,k=I.toString;function U(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||"[object Object]"!==function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?function(t){const e=M.call(t,j),r=t[j];let n=!1;try{t[j]=void 0,n=!0}catch{}const o=k.call(t);return n&&(e?t[j]=r:delete t[j]),o}(t):function(t){return k.call(t)}(t)}(t))return!1;const e=D(t);if(null===e)return!0;const r=M.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&R.call(r)===x}function F(t){return V(t)?t.slice():t}function B(t,e,r=0,n){let o;if(!(r>20)){if(r++,G(t)||G(e)||H(e))o=F(e);else if(V(t)){if(o=t.slice(),V(e))for(let t=0,r=e.length;t<r;t++)o.push(F(e[t]));else if(z(e)){const t=Object.keys(e);for(let r=0,n=t.length;r<n;r++){const n=t[r];o[n]=F(e[n])}}}else if(z(t))if(z(e)){if(!function(t,e){return!(!U(t)||!U(e))}(t,e))return e;o=Object.assign({},t);const i=Object.keys(e);for(let s=0,a=i.length;s<a;s++){const a=i[s],u=e[a];if(G(u))void 0===u?delete o[a]:o[a]=u;else{const i=o[a],s=u;if($(t,a,n)||$(e,a,n))delete o[a];else{if(z(i)&&z(s)){const r=n.get(i)||[],o=n.get(s)||[];r.push({obj:t,key:a}),o.push({obj:e,key:a}),n.set(i,r),n.set(s,o)}o[a]=B(o[a],u,r,n)}}}}else o=e;return o}}function $(t,e,r){const n=r.get(t[e])||[];for(let r=0,o=n.length;r<o;r++){const o=n[r];if(o.key===e&&o.obj===t)return!0}return!1}function V(t){return Array.isArray(t)}function H(t){return"function"==typeof t}function z(t){return!G(t)&&!V(t)&&!H(t)&&"object"==typeof t}function G(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}const q="exception.message",K="exception.type",Q="service.name",W="telemetry.sdk.language",X="telemetry.sdk.name",Y="telemetry.sdk.version",J="process.runtime.name",Z={[X]:"opentelemetry",[J]:"browser",[W]:"webjs",[Y]:"2.1.0"},tt=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class et{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,e){const r=new et({},e);return r._rawAttributes=ot(t),r._asyncAttributesPending=t.filter((([t,e])=>tt(e))).length>0,r}constructor(t,e){const r=t.attributes??{};this._rawAttributes=Object.entries(r).map((([t,e])=>(tt(e)&&(this._asyncAttributesPending=!0),[t,e]))),this._rawAttributes=ot(this._rawAttributes),this._schemaUrl=function(t){if("string"==typeof t||void 0===t)return t;y.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(e?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){const[e,r]=this._rawAttributes[t];this._rawAttributes[t]=[e,tt(r)?await r:r]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&y.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const t={};for(const[e,r]of this._rawAttributes)tt(r)?y.debug(`Unsettled resource attribute ${e} skipped`):null!=r&&(t[e]??=r);return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(null==t)return this;const e=function(t,e){const r=t?.schemaUrl,n=e?.schemaUrl;return void 0===r||""===r?n:void 0===n||""===n||r===n?r:void y.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}(this,t),r=e?{schemaUrl:e}:void 0;return et.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}function rt(t,e){return et.FromAttributeList(Object.entries(t),e)}function nt(){return rt({[Q]:"unknown_service",[W]:Z[W],[X]:Z[X],[Y]:Z[Y]})}function ot(t){return t.map((([t,e])=>tt(e)?[t,e.catch((e=>{y.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,e]))}var it="0000000000000000",st="00000000000000000000000000000000",at={traceId:st,spanId:it,traceFlags:t.NONE},ut=function(){function t(t){void 0===t&&(t=at),this._spanContext=t}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),ct=b("OpenTelemetry Context Key SPAN");function lt(t){return t.getValue(ct)||void 0}function pt(){return lt(C.getInstance().active())}function dt(t,e){return t.setValue(ct,e)}function ht(t){return t.deleteValue(ct)}function ft(t,e){return dt(t,new ut(e))}function gt(t){var e;return null===(e=lt(t))||void 0===e?void 0:e.spanContext()}var mt=/^([0-9a-f]{32})$/i,_t=/^[0-9a-f]{16}$/i;function yt(t){return mt.test(t)&&t!==st}function vt(t){return yt(t.traceId)&&(e=t.spanId,_t.test(e)&&e!==it);var e}function bt(t){return new ut(t)}var wt,St,Et,Tt=C.getInstance(),Ct=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Tt.active()),Boolean(null==e?void 0:e.root))return new ut;var n,o=r&>(r);return"object"==typeof(n=o)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&vt(o)?new ut(o):new ut},t.prototype.startActiveSpan=function(t,e,r,n){var o,i,s;if(!(arguments.length<2)){2===arguments.length?s=e:3===arguments.length?(o=e,s=r):(o=e,i=r,s=n);var a=null!=i?i:Tt.active(),u=this.startSpan(t,o,a),c=dt(a,u);return Tt.with(c,s,void 0,u)}},t}(),At=new Ct,Ot=function(){function t(t,e,r,n){this._provider=t,this.name=e,this.version=r,this.options=n}return t.prototype.startSpan=function(t,e,r){return this._getTracer().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,n){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):At},t}(),Lt=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Ct},t}()),Pt=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var n;return null!==(n=this.getDelegateTracer(t,e,r))&&void 0!==n?n:new Ot(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this._delegate)&&void 0!==t?t:Lt},t.prototype.setDelegate=function(t){this._delegate=t},t.prototype.getDelegateTracer=function(t,e,r){var n;return null===(n=this._delegate)||void 0===n?void 0:n.getTracer(t,e,r)},t}(),Nt="trace",Rt=function(){function t(){this._proxyTracerProvider=new Pt,this.wrapSpanContext=bt,this.isSpanContextValid=vt,this.deleteSpan=ht,this.get
1Span=lt,this.getActiveSpan=pt,this.getSpanContext=gt,this.setSpan=dt,this.setSpanContext=ft}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=p(Nt,this._proxyTracerProvider,_.instance());return e&&this._proxyTracerProvider.setDelegate(t),e},t.prototype.getTracerProvider=function(){return d(Nt)||this._proxyTracerProvider},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){h(Nt,_.instance()),this._proxyTracerProvider=new Pt},t}().getInstance();function xt(t){const e={};if("object"!=typeof t||null==t)return e;for(const[r,n]of Object.entries(t))Dt(r)?It(n)?Array.isArray(n)?e[r]=n.slice():e[r]=n:y.warn(`Invalid attribute value set for key: ${r}`):y.warn(`Invalid attribute key: ${r}`);return e}function Dt(t){return"string"==typeof t&&t.length>0}function It(t){return null==t||(Array.isArray(t)?function(t){let e;for(const r of t)if(null!=r){if(!e){if(Mt(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}(t):Mt(t))}function Mt(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}!function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"}(wt||(wt={})),function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(St||(St={})),function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"}(Et||(Et={}));const jt=performance,kt=Math.pow(10,6),Ut=Math.pow(10,9);function Ft(t){const e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*kt)]}function Bt(){let t=jt.timeOrigin;if("number"!=typeof t){const e=jt;t=e.timing&&e.timing.fetchStart}return t}function $t(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}function Vt(t){return $t(t)||"number"==typeof t||t instanceof Date}function Ht(t,e){const r=[t[0]+e[0],t[1]+e[1]];return r[1]>=Ut&&(r[1]-=Ut,r[0]+=1),r}class zt{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Et.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(t){const e=Date.now();this._spanContext=t.spanContext,this._performanceStartTime=jt.now(),this._performanceOffset=e-(this._performanceStartTime+Bt()),this._startTimeProvided=null!=t.startTime,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,this.links=t.links||[],this.startTime=this._getTime(t.startTime??e),this.resource=t.resource,this.instrumentationScope=t.scope,null!=t.attributes&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,e){if(null==e||this._isSpanEnded())return this;if(0===t.length)return y.warn(`Invalid attribute key: ${t}`),this;if(!It(e))return y.warn(`Invalid attribute value set for key: ${t}`),this;const{attributeCountLimit:r}=this._spanLimits;return void 0!==r&&Object.keys(this.attributes).length>=r&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(e),this)}setAttributes(t){for(const[e,r]of Object.entries(t))this.setAttribute(e,r);return this}addEvent(t,e,r){if(this._isSpanEnded())return this;const{eventCountLimit:n}=this._spanLimits;if(0===n)return y.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==n&&this.events.length>=n&&(0===this._droppedEventsCount&&y.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Vt(e)&&(Vt(r)||(r=e),e=void 0);const o=xt(e);return this.events.push({name:t,attributes:o,time:this._getTime(r),droppedAttributesCount:0}),this}addLink(t){return this.links.push(t),this}addLinks(t){return this.links.push(...t),this}setStatus(t){return this._isSpanEnded()||(this.status={...t},null!=this.status.message&&"string"!=typeof t.message&&(y.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`),delete this.status.message)),this}updateName(t){return this._isSpanEnded()||(this.name=t),this}end(t){this._isSpanEnded()?y.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this._ended=!0,this.endTime=this._getTime(t),this._duration=function(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=Ut),[r,n]}(this.startTime,this.endTime),this._duration[0]<0&&(y.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&&y.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(t){if("number"==typeof t&&t<=jt.now())return e=t+this._performanceOffset,Ht(Ft(Bt()),Ft("number"==typeof e?e:jt.now()));var e;if("number"==typeof t)return Ft(t);if(t instanceof Date)return Ft(t.getTime());if($t(t))return t;if(this._startTimeProvided)return Ft(Date.now());const r=jt.now()-this._performanceStartTime;return Ht(this.startTime,Ft(r))}isRecording(){return!1===this._ended}recordException(t,e){const r={};"string"==typeof t?r[q]=t:t&&(t.code?r[K]=t.code.toString():t.name&&(r[K]=t.name),t.message&&(r[q]=t.message),t.stack&&(r["exception.stacktrace"]=t.stack)),r[K]||r[q]?this.addEvent("exception",r,e):y.warn(`Failed to record an exception ${t}`)}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 t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);y.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,e){return t.length<=e?t:t.substring(0,e)}_truncateToSize(t){const e=this._attributeValueLengthLimit;return e<=0?(y.warn(`Attribute value limit must be positive, got ${e}
1`),t):"string"==typeof t?this._truncateToLimitUtil(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this._truncateToLimitUtil(t,e):t)):t}}var Gt,qt;!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Gt||(Gt={}));class Kt{shouldSample(){return{decision:Gt.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Qt{shouldSample(){return{decision:Gt.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Wt{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(t){this._root=t.root,this._root||(v(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Qt),this._remoteParentSampled=t.remoteParentSampled??new Qt,this._remoteParentNotSampled=t.remoteParentNotSampled??new Kt,this._localParentSampled=t.localParentSampled??new Qt,this._localParentNotSampled=t.localParentNotSampled??new Kt}shouldSample(e,r,n,o,i,s){const a=Rt.getSpanContext(e);return a&&vt(a)?a.isRemote?a.traceFlags&t.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,i,s):this._remoteParentNotSampled.shouldSample(e,r,n,o,i,s):a.traceFlags&t.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,i,s):this._localParentNotSampled.shouldSample(e,r,n,o,i,s):this._root.shouldSample(e,r,n,o,i,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Xt{_ratio;_upperBound;constructor(t=0){this._ratio=t,this._ratio=this._normalize(t),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(t,e){return{decision:yt(e)&&this._accumulate(e)<this._upperBound?Gt.RECORD_AND_SAMPLED:Gt.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return"number"!=typeof t||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let e=0;for(let r=0;r<t.length/8;r++){const n=8*r;e=(e^parseInt(t.slice(n,n+8),16))>>>0}return e}}function Yt(){return{sampler:Jt(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Jt(){const t=qt.ParentBasedAlwaysOn;switch(t){case qt.AlwaysOn:return new Qt;case qt.AlwaysOff:return new Kt;case qt.ParentBasedAlwaysOn:return new Wt({root:new Qt});case qt.ParentBasedAlwaysOff:return new Wt({root:new Kt});case qt.TraceIdRatio:return new Xt(Zt());case qt.ParentBasedTraceIdRatio:return new Wt({root:new Xt(Zt())});default:return y.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${qt.ParentBasedAlwaysOn}".`),new Wt({root:new Qt})}}function Zt(){return y.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}!function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"}(qt||(qt={}));const te=1/0;class ee{generateTraceId=ne(16);generateSpanId=ne(8)}const re=Array(32);function ne(t){return function(){for(let e=0;e<2*t;e++)re[e]=Math.floor(16*Math.random())+48,re[e]>=58&&(re[e]+=39);return String.fromCharCode.apply(null,re.slice(0,2*t))}}class oe{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(t,e,r,n){const o=function(t){const e={sampler:Jt()},r=Yt(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}(e);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=e.idGenerator||new ee,this._resource=r,this._spanProcessor=n,this.instrumentationScope=t}startSpan(e,r={},n=A.active()){r.root&&(n=Rt.deleteSpan(n));const o=Rt.getSpan(n);if(L(n))return y.debug("Instrumentation suppressed, returning Noop Span"),Rt.wrapSpanContext(at);const i=o?.spanContext(),s=this._idGenerator.generateSpanId();let a,u,c;i&&Rt.isSpanContextValid(i)?(u=i.traceId,c=i.traceState,a=i):u=this._idGenerator.generateTraceId();const l=r.kind??wt.INTERNAL,p=(r.links??[]).map((t=>({context:t.context,attributes:xt(t.attributes)}))),d=xt(r.attributes),h=this._sampler.shouldSample(n,u,e,l,d,p);c=h.traceState??c;const f={traceId:u,spanId:s,traceFlags:h.decision===St.RECORD_AND_SAMPLED?t.SAMPLED:t.NONE,traceState:c};if(h.decision===St.NOT_RECORD)return y.debug("Recording is off, prop
1agating context in a non-recording span"),Rt.wrapSpanContext(f);const g=xt(Object.assign(d,h.attributes));return new zt({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:f,name:e,kind:l,links:p,parentSpanContext:a,attributes:g,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(t,e,r,n){let o,i,s;if(arguments.length<2)return;2===arguments.length?s=e:3===arguments.length?(o=e,s=r):(o=e,i=r,s=n);const a=i??A.active(),u=this.startSpan(t,o,a),c=Rt.setSpan(a,u);return A.with(c,s,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class ie{_spanProcessors;constructor(t){this._spanProcessors=t}forceFlush(){const t=[];for(const e of this._spanProcessors)t.push(e.forceFlush());return new Promise((e=>{Promise.all(t).then((()=>{e()})).catch((t=>{v(t||new Error("MultiSpanProcessor: forceFlush failed")),e()}))}))}onStart(t,e){for(const r of this._spanProcessors)r.onStart(t,e)}onEnd(t){for(const e of this._spanProcessors)e.onEnd(t)}shutdown(){const t=[];for(const e of this._spanProcessors)t.push(e.shutdown());return new Promise(((e,r)=>{Promise.all(t).then((()=>{e()}),r)}))}}var se;!function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"}(se||(se={}));class ae{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(t={}){const e=function(...t){let e=t.shift();const r=new WeakMap;for(;t.length>0;)e=B(e,t.shift(),0,r);return e}({},Yt(),function(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??128,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??te,Object.assign({},t,{spanLimits:e})}(t));this._resource=e.resource??nt(),this._config=Object.assign({},e,{resource:this._resource});const r=[];t.spanProcessors?.length&&r.push(...t.spanProcessors),this._activeSpanProcessor=new ie(r)}getTracer(t,e,r){const n=`${t}@${e||""}:${r?.schemaUrl||""}`;return this._tracers.has(n)||this._tracers.set(n,new oe({name:t,version:e,schemaUrl:r?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(n)}forceFlush(){const t=this._config.forceFlushTimeoutMillis,e=this._activeSpanProcessor._spanProcessors.map((e=>new Promise((r=>{let n;const o=setTimeout((()=>{r(new Error(`Span processor did not completed within timeout period of ${t} ms`)),n=se.timeout}),t);e.forceFlush().then((()=>{clearTimeout(o),n!==se.timeout&&(n=se.resolved,r(n))})).catch((t=>{clearTimeout(o),n=se.error,r(t)}))}))));return new Promise(((t,r)=>{Promise.all(e).then((e=>{const n=e.filter((t=>t!==se.resolved));n.length>0?r(n):t()})).catch((t=>r([t])))}))}shutdown(){return this._activeSpanProcessor.shutdown()}}class ue{_enabled=!1;_currentContext=w;_bindFunction(t=w,e){const r=this,n=function(...n){return r.with(t,(()=>e.apply(this,n)))};return Object.defineProperty(n,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),n}active(){return this._currentContext}bind(t,e){return void 0===t&&(t=this.active()),"function"==typeof e?this._bindFunction(t,e):e}disable(){return this._currentContext=w,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=w),this}with(t,e,r,...n){const o=this._currentContext;this._currentContext=t||w;try{return e.call(r,...n)}finally{this._currentContext=o}}}var ce=function(){function t(){}return t.prototype.inject=function(t,e){},t.prototype.extract=function(t,e){return t},t.prototype.fields=function(){return[]},t}(),le={get:function(t,e){if(null!=t)return t[e]},keys:function(t){return null==t?[]:Object.keys(t)}},pe={set:function(t,e,r){null!=t&&(t[e]=r)}},de=b("OpenTelemetry Baggage Key");function he(t){return t.getValue(de)||void 0}function fe(){return he(C.getInstance().active())}function ge(t,e){return t.setValue(de,e)}function me(t){return t.deleteValue(de)}var _e=function(){function t(t){this._entries=t?new Map(t):new Map}return t.prototype.getEntry=function(t){var e=this._entries.get(t);if(e)return Object.assign({},e)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map((function(t){var e=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}(t,2);return[e[0],e[1]]}))},t.prototype.setEntry=function(e,r){var n=new t(this._entries);
1return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=new t(this._entries);try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),a=s.next();!a.done;a=s.next()){var u=a.value;i._entries.delete(u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return i},t.prototype.clear=function(){return new t},t}(),ye=Symbol("BaggageEntryMetadata"),ve=_.instance();function be(t){return void 0===t&&(t={}),new _e(new Map(Object.entries(t)))}var we="propagation",Se=new ce,Ee=function(){function t(){this.createBaggage=be,this.getBaggage=he,this.getActiveBaggage=fe,this.setBaggage=ge,this.deleteBaggage=me}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(t){return p(we,t,_.instance())},t.prototype.inject=function(t,e,r){return void 0===r&&(r=pe),this._getGlobalPropagator().inject(t,e,r)},t.prototype.extract=function(t,e,r){return void 0===r&&(r=le),this._getGlobalPropagator().extract(t,e,r)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){h(we,_.instance())},t.prototype._getGlobalPropagator=function(){return d(we)||Se},t}().getInstance();class Te{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map((t=>"function"==typeof t.fields?t.fields():[])).reduce(((t,e)=>t.concat(e)),[])))}inject(t,e,r){for(const n of this._propagators)try{n.inject(t,e,r)}catch(t){y.warn(`Failed to inject with ${n.constructor.name}. Err: ${t.message}`)}}extract(t,e,r){return this._propagators.reduce(((t,n)=>{try{return n.extract(t,e,r)}catch(t){y.warn(`Failed to extract with ${n.constructor.name}. Err: ${t.message}`)}return t}),t)}fields(){return this._fields.slice()}}const Ce="[_0-9a-z-*/]",Ae=new RegExp(`^(?:[a-z]${Ce}{0,255}|[a-z0-9]${Ce}{0,240}@[a-z]${Ce}{0,13})$`),Oe=/^[ -~]{0,255}[!-~]$/,Le=/,|=/;class Pe{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,e){const r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,e),r}unset(t){const e=this._clone();return e._internalState.delete(t),e}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce(((t,e)=>(t.push(e+"="+this.get(e)),t)),[]).join(",")}_parse(t){t.length>512||(this._internalState=t.split(",").reverse().reduce(((t,e)=>{const r=e.trim(),n=r.indexOf("=");if(-1!==n){const o=r.slice(0,n),i=r.slice(n+1,e.length);(function(t){return Ae.test(t)})(o)&&function(t){return Oe.test(t)&&!Le.test(t)}(i)&&t.set(o,i)}return t}),new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const t=new Pe;return t._internalState=new Map(this._internalState),t}}const Ne="traceparent",Re="tracestate",xe=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class De{inject(e,r,n){const o=Rt.getSpanContext(e);if(!o||L(e)||!vt(o))return;const i=`00-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||t.NONE).toString(16)}`;n.set(r,Ne,i),o.traceState&&n.set(r,Re,o.traceState.serialize())}extract(t,e,r){const n=r.get(e,Ne);if(!n)return t;const o=Array.isArray(n)?n[0]:n;if("string"!=typeof o)return t;const i=function(t){const e=xe.exec(t);return e?"00"===e[1]&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}:null}(o);if(!i)return t;i.isRemote=!0;const s=r.get(e,Re);if(s){const t=Array.isArray(s)?s.join(","):s;i.traceState=new Pe("string"==typeof t?t:void 0)}return Rt.setSpanContext(t,i)}fields(){return[Ne,Re]}}const Ie="baggage";class Me{inject(t,e,r){const n=Ee.getBaggage(t);if(!n||L(t))return;const o=function(t){return t.getAllEntries().map((([t,e])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(e.value)}`;return void 0!==e.metadata&&(r+=";"+e.metadata.toString()),r}))}(n).filter((t=>t.length<=4096)).slice(0,180),i=function(t){return t.reduce(((t,e)=>{const r=`${t}${""!==t?",":""}${e}`;return r.length>8192?t:r}),"")}(o);i.length>0&&r.set(e,Ie,i)}extract(t,e,r){const n=r.get(e,Ie),o=Array.isArray(n)?n.join(","):n;if(!o)return t;const i={};return 0===o.length?t:(o.split(",").forEach((t=>{const e=function(t){const e=t.split(";");if(e.length<=0)return;const r=e.shift();if(!r)return;const n=r.indexOf("=");if(n<=0)return;const o=decodeURIComponent(r.substring(0,n).trim()),i=decodeURIComponent(r.substring(n+1).trim());let s;var a;return e.length>0&&("string"!=typeof(a=e.join(";"))&&(ve.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),s={__TYPE__:ye,toString:function(){return a}}),{key:o,value:i,metadata:s}}(t);if(e){const t={value:e.value};e.metadata&&(t.metadata=e.metadata),i[e.key]=t}})),0===Object.entries(i).length?t:Ee.setBaggage(t,Ee.createBaggage(i)))}fields(){return[Ie]}}var je;function ke(t,e){return e in t}function Ue(t,e,r,n=!0){if(ke(r,e)&&"number"==typeof r[e]&&(!n||0!==r[e]))return t.addEvent(e,r[e])}function Fe(t,e,r=!1,n,o){if(void 0===n&&(n=0!==e[je.START_TIME]),r||(Ue(t,je.FETCH_START,e,n),Ue(t,je.DOMAIN_LOOKUP_START,e,n),Ue(t,je.DOMAIN_LOOKUP_END,e,n),Ue(t,je.CONNECT_START,e,n),Ue(t,je.SECURE_CONNECTION_START,e,n),Ue(t,je.CONNECT_END,e,n),Ue(t,je.REQUEST_START,e,n),Ue(t,je.RESPONSE_START,e,n),Ue(t,je.RESPONSE_END,e,n)),!o){const r=e[je.ENCODED_BODY_SIZE];void 0!==r&&t.setAttribute("http.response_content_length",r);const n=e[je.DECODED_BODY_SIZE];void 0!==n&&r!==n&&t.setAttribute("http.response_content_length_uncompressed",n)}}!function(t){t.CONNECT_END="connectEnd",t.CONNECT_START="connectStart",t.DECODED_BODY_SIZE="decodedBodySize",t.DOM_COMPLETE="domComplete",t.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",t.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",t.DOM_INTERACTIVE="domInteractive",t.DOMAIN_LOOKUP_END="domainLookupEnd",t.DOMAIN_LOOKUP_START="domainLookupStart",t.ENCODED_BODY_SIZE="encodedBodySize",t.FETCH_START="fetchStart",t.LOAD_EVENT_END="loadEventEnd",t.LOAD_EVENT_START="loadEventStart",t.NAVIGATION_START="navigationStart",t.REDIRECT_END="redirectEnd",t.REDIRECT_START="redirectStart",t.REQUEST_START="requestStart",t.RESPONSE_END="responseEnd",t.RESPONSE_START="responseStart",t.SECURE_CONNECTION_START="secureConnectionStart",t.START_TIME="startTime",t.UNLOAD_EVENT_END="unloadEventEnd",t.UNLOAD_EVENT_START="unloadEventStart"}(je||(je={}));var Be,$e=(Be=function(t,e){return Be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Be(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}Be(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),Ve=function(){function t(){}return t.prototype.createGauge=function(t,e){return tr},t.prototype.createHistogram=function(t,e){return er},t.prototype.createCounter=function(t,e){return Ze},t.prototype.createUpDownCounter=function(t,e){return rr},t.prototype.createObservableGauge=function(t,e){return or},t.prototype.createObservableCounter=function(t,e){return nr},t.prototype.createObservableUpDownCounter=function(t,e){return ir},t.prototype.addBatchObservableCallback=function(t,e){},t.prototype.removeBatchObservableCallback=function(t){},t}(),He=function(){},ze=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype.add=function(t,e){},e}(He),Ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype.add=function(t,e){},e}(He),qe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype.record=function(t,e){},e}(He),Ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype.record=function(t,e){},e}(He),Qe=function(){function t(){}return t.prototype.addCallback=function(t){},t.prototype.removeCallback=function(t){},t}(),We=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e}(Qe),Xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e}(Qe),Ye=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e}(Qe),Je=new Ve,Ze=new ze,tr=new qe,er=new Ke,rr=new Ge,nr=new We,or=ne
1w Xe,ir=new Ye,sr=new(function(){function t(){}return t.prototype.getMeter=function(t,e,r){return Je},t}()),ar="metrics",ur=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(t){return p(ar,t,_.instance())},t.prototype.getMeterProvider=function(){return d(ar)||sr},t.prototype.getMeter=function(t,e,r){return this.getMeterProvider().getMeter(t,e,r)},t.prototype.disable=function(){h(ar,_.instance())},t}().getInstance();const cr="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof e.g?e.g:{},lr=Symbol.for("io.opentelemetry.js.api.logs"),pr=cr;class dr{emit(t){}}const hr=new dr,fr=new class{getLogger(t,e,r){return new dr}};class gr{constructor(t,e,r,n){this._provider=t,this.name=e,this.version=r,this.options=n}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;const t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):hr}}class mr{getLogger(t,e,r){var n;return null!==(n=this._getDelegateLogger(t,e,r))&&void 0!==n?n:new gr(this,t,e,r)}_getDelegate(){var t;return null!==(t=this._delegate)&&void 0!==t?t:fr}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,e,r){var n;return null===(n=this._delegate)||void 0===n?void 0:n.getLogger(t,e,r)}}class _r{constructor(){this._proxyLoggerProvider=new mr}static getInstance(){return this._instance||(this._instance=new _r),this._instance}setGlobalLoggerProvider(t){return pr[lr]?this.getLoggerProvider():(pr[lr]=(e=t,r=fr,t=>1===t?e:r),this._proxyLoggerProvider._setDelegate(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=pr[lr])||void 0===t?void 0:t.call(pr,1))&&void 0!==e?e:this._proxyLoggerProvider}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete pr[lr],this._proxyLoggerProvider=new mr}}const yr=_r.getInstance();let vr=console.error.bind(console);function br(t,e,r){const n=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}const wr=(t,e,r)=>{if(!t||!t[e])return void vr("no original function "+String(e)+" to wrap");if(!r)return vr("no wrapper function"),void vr((new Error).stack);const n=t[e];if("function"!=typeof n||"function"!=typeof r)return void vr("original object and wrapper must be functions");const o=r(n,e);return br(o,"__original",n),br(o,"__unwrap",(()=>{t[e]===o&&br(t,e,n)}
1)),br(o,"__wrapped",!0),br(t,e,o),o},Sr=(t,e,r)=>{if(!t)return vr("must provide one or more modules to patch"),void vr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((t=>{e.forEach((e=>{wr(t,e,r)}))})):vr("must provide one or more functions to wrap on modules")},Er=(t,e)=>{if(!t||!t[e])return vr("no function to unwrap."),void vr((new Error).stack);const r=t[e];r.__unwrap?r.__unwrap():vr("no original to unwrap to -- has "+String(e)+" already been unwrapped?")},Tr=(t,e)=>{if(!t)return vr("must provide one or more modules to patch"),void vr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((t=>{e.forEach((e=>{Er(t,e)}))})):vr("must provide one or more functions to unwrap on modules")};function Cr(t){t&&t.logger&&("function"!=typeof t.logger?vr("new logger isn't a function, not replacing"):vr=t.logger)}Cr.wrap=wr,Cr.massWrap=Sr,Cr.unwrap=Er,Cr.massUnwrap=Tr;class Ar{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,e,r){this.instrumentationName=t,this.instrumentationVersion=e,this.setConfig(r),this._diag=y.createComponentLogger({namespace:t}),this._tracer=Rt.getTracer(t,e),this._meter=ur.getMeter(t,e),this._logger=yr.getLogger(t,e),this._updateMetricInstruments()}_wrap=wr;_unwrap=Er;_massWrap=Sr;_massUnwrap=Tr;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,e,r,n){if(t)try{t(r,n)}catch(t){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:e},t)}}}class Or extends Ar{constructor(t,e,r){super(t,e,r),this._config.enabled&&this.enable()}}function Lr(t,e,r){let n,o;try{o=t()}catch(t){n=t}finally{if(e(n,o),n&&!r)throw n;return o}}var Pr;!function(t){t.DOCUMENT_LOAD="documentLoad",t.DOCUMENT_FETCH="documentFetch",t.RESOURCE_FETCH="resourceFetch"}(Pr||(Pr={}));const Nr="http.url";var Rr;!function(t){t.FIRST_PAINT="firstPaint",t.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Rr||(Rr={}));const xr={"first-paint":Rr.FIRST_PAINT,"first-contentful-paint":Rr.FIRST_CONTENTFUL_PAINT};class Dr{_delegate;constructor(t){this._delegate=t}export(t,e){this._delegate.export(t,e)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}function Ir(t){const e={attributes:Mr(t.attributes),droppedAttributesCount:0},r=t.schemaUrl;return r&&""!==r&&(e.schemaUrl=r),e}function Mr(t){return Object.keys(t).map((e=>jr(e,t[e])))}function jr(t,e){return{key:t,value:kr(e)}}function kr(t){const e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(kr)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((([t,e])=>jr(t,e)))}}:{}}function Ur(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Fr(t){const e=new Uint8Array(t.length/2);let r=0;for(let n=0;n<t.length;n+=2){const o=Ur(t.charCodeAt(n)),i=Ur(t.charCodeAt(n+1));e[r++]=o<<4|i}return e}function Br(t){const e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function $r(t){return e=Br(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))};var e}const Vr="undefined"!=typeof BigInt?function(t){return Br(t).toString()}:function(t){return t[0]*Ut+t[1]};function Hr(t){return t}function zr(t){if(void 0!==t)return Fr(t)}const Gr={encodeHrTime:$r,encodeSpanContext:Fr,encodeOptionalSpanContext:zr};function qr(t,e){const r=t.spanContext(),n=t.status,o=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:o,traceState:r.traceState?.serialize(),name:t.name,kind:null==t.kind?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:Mr(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map((t=>function(t,e){return{attributes:t.attributes?Mr(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}(t,e))),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map((t=>function(t,e){return{attributes:t.attributes?Mr(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}(t,e))),droppedLinksCount:t.droppedLinksCount}}function Kr(t,e){const r=function(t){const e=new Map;for(const r of t){let t=e.get(r.resource);t||(t=new Map,e.set(r.resource,t));const n=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let o=t.get(n);o||(o=[],t.set(n,o)),o.push(r)}return e}(t),n=[],o=r.entries();let i=o.next();for(;!i.done;){const[t,r]=i.value,a=[],u=r.values();let c=u.next();for(;!c.done;){const t=c.value;if(t.length>0){const r=t.map((t=>qr(t,e)));a.push({scope:(s=t[0].instrumentationScope,{name:s.name,version:s.version}),spans:r,schemaUrl:t[0].instrumentationScope.schemaUrl})}c=u.next()}const l=Ir(t),p={resource:l,scopeSpans:a,schemaUrl:l.schemaUrl};n.push(p),i=o.next()}var s;return n}const Qr={serializeRequest:t=>{const e=function(t,e){const r=function(t){if(void 0===t)return Gr;const e=t.useLongBits??!0,r=t.useHex??!1;return{encodeHrTime:e?$r:Vr,encodeSpanContext:r?Hr:Fr,encodeOptionalSpanContext:r?Hr:zr}}(e);return{resourceSpans:Kr(t,r)}}(t,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(e))},deserializeResponse:t=>{if(0===t.length)return{};const e=new TextDecoder;return JSON.parse(e.decode(t))}};class Wr{_transport;constructor(t){this._transport=t}retry(t,e,r){return new Promise(((n,o)=>{setTimeout((()=>{this._transport.send(t,e).then(n,o)}),r)}))}async send(t,e){const r=Date.now()+e;let n=await this._transport.send(t,e),o=5,i=1e3;for(;"retryable"===n.status&&o>0;){o--;const e=Math.max(Math.min(i,5e3)+(.4*Math.random()-.2),0);i*=1.5;const s=n.retryInMillis??e,a=r-Date.now();if(s>a)return n;n=await this.retry(t,a,s)}return n}shutdown(){return this._transport.shutdown()}}function Xr(t){return new Wr(t.transport)}function Yr(t){return[429,502,503,504].includes(t)}function Jr(t){if(null==t)return;const e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;const r=new Date(t).getTime()-Date.now();return r>=0?r:0}class Zr{_parameters;constructor(t){this._parameters=t}send(t,e){return new Promise((r=>{const n=new XMLHttpRequest;n.timeout=e,n.open("POST",this._parameters.url);const o=this._parameters.headers();
1Object.entries(o).forEach((([t,e])=>{n.setRequestHeader(t,e)})),n.ontimeout=t=>{r({status:"failure",error:new Error("XHR request timed out")})},n.onreadystatechange=()=>{n.status>=200&&n.status<=299?(y.debug("XHR success"),r({status:"success"})):n.status&&Yr(n.status)?r({status:"retryable",retryInMillis:Jr(n.getResponseHeader("Retry-After"))}):0!==n.status&&r({status:"failure",error:new Error("XHR request failed with non-retryable status")})},n.onabort=()=>{r({status:"failure",error:new Error("XHR request aborted")})},n.onerror=()=>{r({status:"failure",error:new Error("XHR request errored")})},n.send(t)}))}shutdown(){}}class tn{_params;constructor(t){this._params=t}send(t){return new Promise((e=>{navigator.sendBeacon(this._params.url,new Blob([t],{type:this._params.blobType}))?(y.debug("SendBeacon success"),e({status:"success"})):e({status:"failure",error:new Error("SendBeacon failed")})}))}shutdown(){}}class en{_concurrencyLimit;_sendingPromises=[];constructor(t){this._concurrencyLimit=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);const e=()=>{const e=this._sendingPromises.indexOf(t);this._sendingPromises.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function rn(t){return new en(t.concurrencyLimit)}
1class nn extends Error{code;name="OTLPExporterError";data;constructor(t,e,r){super(t),this.data=r,this.code=e}}class on{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(t,e,r,n,o){this._transport=t,this._serializer=e,this._responseHandler=r,this._promiseQueue=n,this._timeout=o,this._diagLogger=y.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit())return void e({code:N.FAILED,error:new Error("Concurrent export limit reached")});const r=this._serializer.serializeRequest(t);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then((t=>{if("success"!==t.status)"failure"===t.status&&t.error?e({code:N.FAILED,error:t.error}):"retryable"===t.status?e({code:N.FAILED,error:new nn("Export failed with retryable status")}):e({code:N.FAILED,error:new nn("Export failed with unknown error")});else{if(null!=t.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(t.data))}catch(e){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:N.SUCCESS})}}),(t=>e({code:N.FAILED,error:t})))):e({code:N.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 sn(t,e,r){return n={transport:r,serializer:e,promiseHandler:rn(t)},o={timeout:t.timeoutMillis},new on(n.transport,n.serializer,{handleResponse(t){null!=t&&function(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&y.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},n.promiseHandler,o.timeout);var n,o}class an{_parameters;constructor(t){this._parameters=t}async send(t,e){const r=new AbortController,n=setTimeout((()=>r.abort()),e);try{const e=!!globalThis.location,n=new URL(this._parameters.url),o=await fetch(n.href,{method:"POST",headers:this._parameters.headers(),body:t,signal:r.signal,keepalive:e,mode:e?globalThis.location?.origin===n.origin?"same-origin":"cors":"no-cors"});if(o.status>=200&&o.status<=299)return y.debug("response success"),{status:"success"};if(Yr(o.status)){return{status:"retryable",retryInMillis:Jr(o.headers.get("Retry-After"))}}return{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(t){return"AbortError"===t?.name?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}shutdown(){}}function un(t,e){return sn(t,e,Xr({transport:(r=t,new Zr(r))}));var r}function cn(t,e){return sn(t,e,Xr({transport:(r=t,new an(r))}));var r}function ln(t,e){return sn(t,e,Xr({transport:(r={url:t.url,blobType:t.headers()["Content-Type"]},new tn(r))}));var r}function pn(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function dn(t){if(null!=t)return()=>t}function hn(t,e,r){return{timeoutMillis:pn(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function fn(t,e,r){const n={...r()},o={};return()=>(null!=e&&Object.assign(o,e()),null!=t&&Object.assign(o,t()),Object.assign(o,n))}function gn(t){if(null!=t)try{const e=globalThis.location?.href;return new URL(t,e).href}
1catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function mn(t,e,r,n){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?cn:un:ln)(function(t,e,r){return n={url:t.url,timeoutMillis:t.timeoutMillis,headers:dn(t.headers),concurrencyLimit:t.concurrencyLimit},o={},i=function(t,e){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>t,url:"http://localhost:4318/"+e}}(r,e),{...hn(n,o,i),headers:fn((s=n.headers,()=>{const t={};return Object.entries(s?.()??{}).forEach((([e,r])=>{void 0!==r?t[e]=String(r):y.warn(`Header "${e}" has invalid value (${r}) and will be ignored`)})),t}),o.headers,i.headers),url:gn(n.url)??o.url??i.url};var n,o,i,s}(t,r,n),e)}const _n=new class extends Dr{constructor(t={}){super(mn(t,Qr,"v1/traces",{"Content-Type":"application/json"}))}}({url:"/.cloud/rum/otel-rum-collector",headers:{}}),yn={export(t,e){const r=t.filter((t=>"documentFetch"===t.name));0!==r.length?_n.export(r,e):e({code:0})},shutdown:()=>_n.shutdown(),forceFlush:()=>Promise.resolve()};new class extends ae{constructor(t={}){super(t)}register(t={}){var e;Rt.setGlobalTracerProvider(this),null!==(e=t.propagator)&&(void 0!==e?Ee.setGlobalPropagator(e):Ee.setGlobalPropagator(new Te({propagators:[new De,new Me]}))),function(t){if(null!==t){if(void 0===t){const t=new ue;return t.enable(),void A.setGlobalContextManager(t)}t.enable(),A.setGlobalContextManager(t)}}(t.contextManager)}}({resource:nt().merge(rt({"service.name":"elementor-otel-rum"})),spanProcessors:[new class{_exporter;_shutdownOnce;_pendingExports;constructor(t){this._exporter=t,this._shutdownOnce=new n(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(t,e){}onEnd(e){if(this._shutdownOnce.isCalled)return;if(!(e.spanContext().traceFlags&t.SAMPLED))return;const r=this._doExport(e).catch((t=>v(t)));this._pendingExports.add(r),r.finally((()=>this._pendingExports.delete(r)))}async _doExport(t){t.resource.asyncAttributesPending&&await(t.resource.waitForAsyncAttributes?.());const e=await P(this._exporter,[t]);if(e.code!==N.SUCCESS)throw e.error??new Error(`SimpleSpanProcessor: span export failed (status ${e})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}(yn)]}).register(),function(t){const e=t.tracerProvider||Rt.getTracerProvider(),r=t.meterProvider||ur.getMeterProvider(),n=t.loggerProvider||yr.getLoggerProvider();!function(t,e,r,n){for(let o=0,i=t.length;o<i;o++){const i=t[o];e&&i.setTracerProvider(e),r&&i.setMeterProvider(r),n&&i.setLoggerProvider&&i.setLoggerProvider(n),i.getConfig().enabled||i.enable()}}(t.instrumentations?.flat()??[],e,r,n)}({instrumentations:[new class extends Or{component="document-load";version="1";moduleName=this.component;constructor(t={}){super("@opentelemetry/instrumentation-document-load","0.50.0",t)}init(){}_onDocumentLoaded(){window.setTimeout((()=>{this._collectPerformance()}))}_addResourcesSpans(t){const e=jt.getEntriesByType?.("resource");e&&e.forEach((e=>{this._initResourceSpan(e,t)}))}_collectPerformance(){const t=Array.from(document.getElementsByTagName("meta")).find((t=>t.getAttribute("name")===Ne)),e=(()=>{const t={},e=jt.getEntriesByType?.("navigation")[0];if(e)Object.values(je).forEach((r=>{if(ke(e,r)){const n=e[r];"number"==typeof n&&(t[r]=n)}}));else{const e=jt.timing;e&&Object.values(je).forEach((r=>{if(ke(e,r)){const n=e[r];"number"==typeof n&&(t[r]=n)}}))}return t})(),r=t&&t.content||"";A.with(Ee.extract(w,{traceparent:r}),(()=>{const t=this._startSpan(Pr.DOCUMENT_LOAD,je.FETCH_START,e);t&&(A.with(Rt.setSpan(A.active(),t),(()=>{const t=this._startSpan(Pr.DOCUMENT_FETCH,je.FETCH_START,e);
1t&&(t.setAttribute(Nr,location.href),A.with(Rt.setSpan(A.active(),t),(()=>{Fe(t,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(t,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(t,je.RESPONSE_END,e)})))})),t.setAttribute(Nr,location.href),t.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(t),this.getConfig().ignoreNetworkEvents||(Ue(t,je.FETCH_START,e),Ue(t,je.UNLOAD_EVENT_START,e),Ue(t,je.UNLOAD_EVENT_END,e),Ue(t,je.DOM_INTERACTIVE,e),Ue(t,je.DOM_CONTENT_LOADED_EVENT_START,e),Ue(t,je.DOM_CONTENT_LOADED_EVENT_END,e),Ue(t,je.DOM_COMPLETE,e),Ue(t,je.LOAD_EVENT_START,e),Ue(t,je.LOAD_EVENT_END,e)),this.getConfig().ignorePerformancePaintEvents||(t=>{const e=jt.getEntriesByType?.("paint");e&&e.forEach((({name:e,startTime:r})=>{ke(xr,e)&&t.addEvent(xr[e],r)}))})(t),this._addCustomAttributesOnSpan(t,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(t,je.LOAD_EVENT_END,e))}))}_endSpan(t,e,r){t&&(ke(r,e)?t.end(r[e]):t.end())}_initResourceSpan(t,e){const r=this._startSpan(Pr.RESOURCE_FETCH,je.FETCH_START,t,e);r&&(r.setAttribute(Nr,t.name),Fe(r,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(r,t,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(r,je.RESPONSE_END,t))}_startSpan(t,e,r,n){if(ke(r,e)&&"number"==typeof r[e])return this.tracer.startSpan(t,{startTime:r[e]},n?Rt.setSpan(A.active(),n):void 0)}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(t,e){e&&Lr((()=>e(t)),(t=>{t&&this._diag.error("addCustomAttributesOnSpan",t)}),!0)}_addCustomAttributesOnResourceSpan(t,e,r){r&&Lr((()=>r(t,e)),(t=>{t&&this._diag.error("addCustomAttributesOnResourceSpan",t)}),!0)}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}]})})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.