@tanagram/lore 0.1.8 → 0.1.10

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.
Files changed (3) hide show
  1. package/README.md +14 -0
  2. package/dist/index.js +81 -41
  3. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,69 +1,109 @@
1
1
  #!/usr/bin/env node
2
- var b3=Object.create;var qd=Object.defineProperty;var C3=Object.getOwnPropertyDescriptor;var P3=Object.getOwnPropertyNames;var M3=Object.getPrototypeOf,x3=Object.prototype.hasOwnProperty;var U=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var z=(t,e)=>()=>(t&&(e=t(t=0)),e);var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),US=(t,e)=>{for(var n in e)qd(t,n,{get:e[n],enumerable:!0})},eC=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of P3(e))!x3.call(t,o)&&o!==n&&qd(t,o,{get:()=>e[o],enumerable:!(r=C3(e,o))||r.enumerable});return t};var K=(t,e,n)=>(n=t!=null?b3(M3(t)):{},eC(e||!t||!t.__esModule?qd(n,"default",{value:t,enumerable:!0}):n,t)),N=t=>eC(qd({},"__esModule",{value:!0}),t);var Ro,wS=z(()=>{Ro="1.9.1"});function v3(t){let e=new Set([t]),n=new Set,r=t.match(tC);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(c){return c===t};function s(a){return n.add(a),!1}function i(a){return e.add(a),!0}return function(c){if(e.has(c))return!0;if(n.has(c))return!1;let l=c.match(tC);if(!l)return s(c);let p={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return p.prerelease!=null||o.major!==p.major?s(c):o.major===0?o.minor===p.minor&&o.patch<=p.patch?i(c):s(c):o.minor<=p.minor?i(c):s(c)}}var tC,nC,rC=z(()=>{wS();tC=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;nC=v3(Ro)});function kr(t,e,n,r=!1){var o;let s=pl[ll]=(o=pl[ll])!==null&&o!==void 0?o:{version:Ro};if(!r&&s[t]){let i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return n.error(i.stack||i.message),!1}if(s.version!==Ro){let i=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${Ro}`);return n.error(i.stack||i.message),!1}return s[t]=e,n.debug(`@opentelemetry/api: Registered a global for ${t} v${Ro}.`),!0}function vn(t){var e,n;let r=(e=pl[ll])===null||e===void 0?void 0:e.version;if(!(!r||!nC(r)))return(n=pl[ll])===null||n===void 0?void 0:n[t]}function Gr(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${Ro}.`);let n=pl[ll];n&&delete n[t]}var L3,ll,pl,hi=z(()=>{wS();rC();L3=Ro.split(".")[0],ll=Symbol.for(`opentelemetry.js.api.${L3}`),pl=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function dl(t,e,n){let r=vn("diag");if(r)return r[t](e,...n)}var $d,oC=z(()=>{hi();$d=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return dl("debug",this._namespace,e)}error(...e){return dl("error",this._namespace,e)}info(...e){return dl("info",this._namespace,e)}warn(...e){return dl("warn",this._namespace,e)}verbose(...e){return dl("verbose",this._namespace,e)}}});var pt,Yd=z(()=>{(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"})(pt||(pt={}))});function sC(t,e){t<pt.NONE?t=pt.NONE:t>pt.ALL&&(t=pt.ALL),e=e||{};function n(r,o){let s=e[r];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return{error:n("error",pt.ERROR),warn:n("warn",pt.WARN),info:n("info",pt.INFO),debug:n("debug",pt.DEBUG),verbose:n("verbose",pt.VERBOSE)}}var iC=z(()=>{Yd()});var D3,Et,Ei=z(()=>{oC();iC();Yd();hi();D3="diag",Et=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(o){return function(...s){let i=vn("diag");if(i)return i[o](...s)}}let n=this,r=(o,s={logLevel:pt.INFO})=>{var i,a,c;if(o===n){let d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=d.stack)!==null&&i!==void 0?i:d.message),!1}typeof s=="number"&&(s={logLevel:s});let l=vn("diag"),p=sC((a=s.logLevel)!==null&&a!==void 0?a:pt.INFO,o);if(l&&!s.suppressOverrideMessage){let d=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";l.warn(`Current logger will be overwritten from ${d}`),p.warn(`Current logger will overwrite one already registered from ${d}`)}return kr("diag",p,n,!0)};n.setLogger=r,n.disable=()=>{Gr(D3,n)},n.createComponentLogger=o=>new $d(o),n.verbose=e("verbose"),n.debug=e("debug"),n.info=e("info"),n.warn=e("warn"),n.error=e("error")}}});var Wd,aC=z(()=>{Wd=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let n=this._entries.get(e);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,n){let r=new t(this._entries);return r._entries.set(e,n),r}removeEntry(e){let n=new t(this._entries);return n._entries.delete(e),n}removeEntries(...e){let n=new t(this._entries);for(let r of e)n._entries.delete(r);return n}clear(){return new t}}});var cC,uC=z(()=>{cC=Symbol("BaggageEntryMetadata")});function lC(t={}){return new Wd(new Map(Object.entries(t)))}function pC(t){return typeof t!="string"&&(U3.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:cC,toString(){return t}}}var U3,kS=z(()=>{Ei();aC();uC();U3=Et.instance()});function Ln(t){return Symbol.for(t)}var GS,Ba,_l=z(()=>{GS=class t{constructor(e){let n=this;n._currentContext=e?new Map(e):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let s=new t(n._currentContext);return s._currentContext.set(r,o),s},n.deleteValue=r=>{let o=new t(n._currentContext);return o._currentContext.delete(r),o}}},Ba=new GS});var BS,jS,zd,dC=z(()=>{BS=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],jS={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(jS[e]=console[e])}zd=class{constructor(){function e(n){return function(...r){let o=jS[n];if(typeof o!="function"&&(o=jS.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<BS.length;n++)this[BS[n].n]=e(BS[n].c)}}});function _C(){return KS}var HS,ja,VS,FS,qS,$S,fl,YS,WS,zS,KS,w3,k3,G3,B3,j3,H3,V3,QS=z(()=>{HS=class{constructor(){}createGauge(e,n){return k3}createHistogram(e,n){return G3}createCounter(e,n){return w3}createUpDownCounter(e,n){return B3}createObservableGauge(e,n){return H3}createObservableCounter(e,n){return j3}createObservableUpDownCounter(e,n){return V3}addBatchObservableCallback(e,n){}removeBatchObservableCallback(e){}},ja=class{},VS=class extends ja{add(e,n){}},FS=class extends ja{add(e,n){}},qS=class extends ja{record(e,n){}},$S=class extends ja{record(e,n){}},fl=class{addCallback(e){}removeCallback(e){}},YS=class extends fl{},WS=class extends fl{},zS=class extends fl{},KS=new HS,w3=new VS,k3=new qS,G3=new $S,B3=new FS,j3=new YS,H3=new WS,V3=new zS});var Kd,fC=z(()=>{(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Kd||(Kd={}))});var Qd,Xd,XS=z(()=>{Qd={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},Xd={set(t,e,n){t!=null&&(t[e]=n)}}});var Jd,mC=z(()=>{_l();Jd=class{active(){return Ba}with(e,n,r,...o){return n.call(r,...o)}bind(e,n){return n}enable(){return this}disable(){return this}}});var JS,F3,Br,ml=z(()=>{mC();hi();Ei();JS="context",F3=new Jd,Br=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return kr(JS,e,Et.instance())}active(){return this._getContextManager().active()}with(e,n,r,...o){return this._getContextManager().with(e,n,r,...o)}bind(e,n){return this._getContextManager().bind(e,n)}_getContextManager(){return vn(JS)||F3}disable(){this._getContextManager().disable(),Gr(JS,Et.instance())}}});var Vt,ZS=z(()=>{(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Vt||(Vt={}))});var Tl,Si,Zd,e_=z(()=>{ZS();Tl="0000000000000000",Si="00000000000000000000000000000000",Zd={traceId:Si,spanId:Tl,traceFlags:Vt.NONE}});var jr,t_=z(()=>{e_();jr=class{constructor(e=Zd){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,n){return this}setAttributes(e){return this}addEvent(e,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,n){}}});function n_(t){return t.getValue(eg)||void 0}function TC(){return n_(Br.getInstance().active())}function hl(t,e){return t.setValue(eg,e)}function hC(t){return t.deleteValue(eg)}function EC(t,e){return hl(t,new jr(e))}function r_(t){var e;return(e=n_(t))===null||e===void 0?void 0:e.spanContext()}var eg,tg=z(()=>{_l();t_();ml();eg=Ln("OpenTelemetry Context Key SPAN")});function SC(t,e){if(typeof t!="string"||t.length!==e)return!1;let n=0;for(let r=0;r<t.length;r+=4)n+=(o_[t.charCodeAt(r)]|0)+(o_[t.charCodeAt(r+1)]|0)+(o_[t.charCodeAt(r+2)]|0)+(o_[t.charCodeAt(r+3)]|0);return n===e}function ng(t){return SC(t,32)&&t!==Si}function rg(t){return SC(t,16)&&t!==Tl}function yo(t){return ng(t.traceId)&&rg(t.spanId)}function gC(t){return new jr(t)}var o_,s_=z(()=>{e_();t_();o_=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 q3(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var og,Ha,sg=z(()=>{ml();tg();t_();s_();og=Br.getInstance(),Ha=class{startSpan(e,n,r=og.active()){if(!!n?.root)return new jr;let s=r&&r_(r);return q3(s)&&yo(s)?new jr(s):new jr}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??og.active(),l=this.startSpan(e,s,c),p=hl(c,l);return og.with(p,a,void 0,l)}}});var $3,Va,ig=z(()=>{sg();$3=new Ha,Va=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}startSpan(e,n,r){return this._getTracer().startSpan(e,n,r)}startActiveSpan(e,n,r,o){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):$3}}});var i_,AC=z(()=>{sg();i_=class{getTracer(e,n,r){return new Ha}}});var Y3,gi,ag=z(()=>{ig();AC();Y3=new i_,gi=class{getTracer(e,n,r){var o;return(o=this.getDelegateTracer(e,n,r))!==null&&o!==void 0?o:new Va(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Y3}setDelegate(e){this._delegate=e}getDelegateTracer(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,n,r)}}});var a_,RC=z(()=>{(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(a_||(a_={}))});var Oe,yC=z(()=>{(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"})(Oe||(Oe={}))});var Be,IC=z(()=>{(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Be||(Be={}))});function NC(t){return K3.test(t)}function OC(t){return Q3.test(t)&&!X3.test(t)}var cg,W3,z3,K3,Q3,X3,bC=z(()=>{cg="[_0-9a-z-*/]",W3=`[a-z]${cg}{0,255}`,z3=`[a-z0-9]${cg}{0,240}@[a-z]${cg}{0,13}`,K3=new RegExp(`^(?:${W3}|${z3})$`),Q3=/^[ -~]{0,255}[!-~]$/,X3=/,|=/});var CC,J3,PC,MC,c_,xC=z(()=>{bC();CC=32,J3=512,PC=",",MC="=",c_=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,n)=>(e.push(n+MC+this.get(n)),e),[]).join(PC)}_parse(e){e.length>J3||(this._internalState=e.split(PC).reduceRight((n,r)=>{let o=r.trim(),s=o.indexOf(MC);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);NC(i)&&OC(a)&&n.set(i,a)}return n},new Map),this._internalState.size>CC&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,CC))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function vC(t){return new c_(t)}var LC=z(()=>{xC()});var P,DC=z(()=>{ml();P=Br.getInstance()});var Dn,UC=z(()=>{Ei();Dn=Et.instance()});var ug,wC,kC=z(()=>{QS();ug=class{getMeter(e,n,r){return KS}},wC=new ug});var lg,u_,GC=z(()=>{kC();hi();Ei();lg="metrics",u_=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return kr(lg,e,Et.instance())}getMeterProvider(){return vn(lg)||wC}getMeter(e,n,r){return this.getMeterProvider().getMeter(e,n,r)}disable(){Gr(lg,Et.instance())}}});var pg,BC=z(()=>{GC();pg=u_.getInstance()});var l_,jC=z(()=>{l_=class{inject(e,n){}extract(e,n){return e}fields(){return[]}}});function _g(t){return t.getValue(dg)||void 0}function HC(){return _g(Br.getInstance().active())}function VC(t,e){return t.setValue(dg,e)}function FC(t){return t.deleteValue(dg)}var dg,qC=z(()=>{ml();_l();dg=Ln("OpenTelemetry Baggage Key")});var fg,Z3,p_,$C=z(()=>{hi();jC();XS();qC();kS();Ei();fg="propagation",Z3=new l_,p_=class t{constructor(){this.createBaggage=lC,this.getBaggage=_g,this.getActiveBaggage=HC,this.setBaggage=VC,this.deleteBaggage=FC}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return kr(fg,e,Et.instance())}inject(e,n,r=Xd){return this._getGlobalPropagator().inject(e,n,r)}extract(e,n,r=Qd){return this._getGlobalPropagator().extract(e,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Gr(fg,Et.instance())}_getGlobalPropagator(){return vn(fg)||Z3}}});var Er,YC=z(()=>{$C();Er=p_.getInstance()});var mg,d_,WC=z(()=>{hi();ag();s_();tg();Ei();mg="trace",d_=class t{constructor(){this._proxyTracerProvider=new gi,this.wrapSpanContext=gC,this.isSpanContextValid=yo,this.deleteSpan=hC,this.getSpan=n_,this.getActiveSpan=TC,this.getSpanContext=r_,this.setSpan=hl,this.setSpanContext=EC}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let n=kr(mg,this._proxyTracerProvider,Et.instance());return n&&this._proxyTracerProvider.setDelegate(e),n}getTracerProvider(){return vn(mg)||this._proxyTracerProvider}getTracer(e,n){return this.getTracerProvider().getTracer(e,n)}disable(){Gr(mg,Et.instance()),this._proxyTracerProvider=new gi}}});var X,zC=z(()=>{WC();X=d_.getInstance()});var v={};US(v,{DiagConsoleLogger:()=>zd,DiagLogLevel:()=>pt,INVALID_SPANID:()=>Tl,INVALID_SPAN_CONTEXT:()=>Zd,INVALID_TRACEID:()=>Si,ProxyTracer:()=>Va,ProxyTracerProvider:()=>gi,ROOT_CONTEXT:()=>Ba,SamplingDecision:()=>a_,SpanKind:()=>Oe,SpanStatusCode:()=>Be,TraceFlags:()=>Vt,ValueType:()=>Kd,baggageEntryMetadataFromString:()=>pC,context:()=>P,createContextKey:()=>Ln,createNoopMeter:()=>_C,createTraceState:()=>vC,default:()=>e9,defaultTextMapGetter:()=>Qd,defaultTextMapSetter:()=>Xd,diag:()=>Dn,isSpanContextValid:()=>yo,isValidSpanId:()=>rg,isValidTraceId:()=>ng,metrics:()=>pg,propagation:()=>Er,trace:()=>X});var e9,b=z(()=>{kS();_l();dC();Yd();QS();fC();XS();ig();ag();RC();yC();IC();ZS();LC();s_();e_();DC();UC();BC();YC();zC();e9={context:P,diag:Dn,metrics:pg,propagation:Er,trace:X}});var El=E(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.isTracingSuppressed=ts.unsuppressTracing=ts.suppressTracing=void 0;var t9=(b(),N(v)),Tg=(0,t9.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function n9(t){return t.setValue(Tg,!0)}ts.suppressTracing=n9;function r9(t){return t.deleteValue(Tg)}ts.unsuppressTracing=r9;function o9(t){return t.getValue(Tg)===!0}ts.isTracingSuppressed=o9});var hg=E(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.BAGGAGE_MAX_TOTAL_LENGTH=Ft.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Ft.BAGGAGE_MAX_NAME_VALUE_PAIRS=Ft.BAGGAGE_HEADER=Ft.BAGGAGE_ITEMS_SEPARATOR=Ft.BAGGAGE_PROPERTIES_SEPARATOR=Ft.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Ft.BAGGAGE_KEY_PAIR_SEPARATOR="=";Ft.BAGGAGE_PROPERTIES_SEPARATOR=";";Ft.BAGGAGE_ITEMS_SEPARATOR=",";Ft.BAGGAGE_HEADER="baggage";Ft.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Ft.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Ft.BAGGAGE_MAX_TOTAL_LENGTH=8192});var Eg=E(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.parseKeyPairsIntoRecord=Hr.parsePairKeyValue=Hr.getKeyPairs=Hr.serializeKeyPairs=void 0;var s9=(b(),N(v)),Fa=hg();function i9(t){return t.reduce((e,n)=>{let r=`${e}${e!==""?Fa.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Fa.BAGGAGE_MAX_TOTAL_LENGTH?e:r},"")}Hr.serializeKeyPairs=i9;function a9(t){return t.getAllEntries().map(([e,n])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Fa.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}Hr.getKeyPairs=a9;function KC(t){if(!t)return;let e=t.indexOf(Fa.BAGGAGE_PROPERTIES_SEPARATOR),n=e===-1?t:t.substring(0,e),r=n.indexOf(Fa.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),s=n.substring(r+1).trim();if(!o||!s)return;let i,a;try{i=decodeURIComponent(o),a=decodeURIComponent(s)}catch{return}let c;if(e!==-1&&e<t.length-1){let l=t.substring(e+1);c=(0,s9.baggageEntryMetadataFromString)(l)}return{key:i,value:a,metadata:c}}Hr.parsePairKeyValue=KC;function c9(t){let e={};return typeof t=="string"&&t.length>0&&t.split(Fa.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=KC(n);r!==void 0&&r.value.length>0&&(e[r.key]=r.value)}),e}Hr.parseKeyPairsIntoRecord=c9});var QC=E(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});__.W3CBaggagePropagator=void 0;var Sg=(b(),N(v)),u9=El(),Ai=hg(),gg=Eg(),Ag=class{inject(e,n,r){let o=Sg.propagation.getBaggage(e);if(!o||(0,u9.isTracingSuppressed)(e))return;let s=(0,gg.getKeyPairs)(o).filter(a=>a.length<=Ai.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Ai.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,gg.serializeKeyPairs)(s);i.length>0&&r.set(n,Ai.BAGGAGE_HEADER,i)}extract(e,n,r){let o=r.get(n,Ai.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(Ai.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let i={};return s.length===0||(s.split(Ai.BAGGAGE_ITEMS_SEPARATOR).forEach(c=>{let l=(0,gg.parsePairKeyValue)(c);if(l){let p={value:l.value};l.metadata&&(p.metadata=l.metadata),i[l.key]=p}}),Object.entries(i).length===0)?e:Sg.propagation.setBaggage(e,Sg.propagation.createBaggage(i))}fields(){return[Ai.BAGGAGE_HEADER]}};__.W3CBaggagePropagator=Ag});var XC=E(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});f_.AnchoredClock=void 0;var Rg=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,n){this._monotonicClock=n,this._epochMillis=e.now(),this._performanceMillis=n.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};f_.AnchoredClock=Rg});var nP=E(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.isAttributeValue=ns.isAttributeKey=ns.sanitizeAttributes=void 0;var JC=(b(),N(v));function l9(t){let e={};if(typeof t!="object"||t==null)return e;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(!ZC(n)){JC.diag.warn(`Invalid attribute key: ${n}`);continue}let r=t[n];if(!eP(r)){JC.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?e[n]=r.slice():e[n]=r}return e}ns.sanitizeAttributes=l9;function ZC(t){return typeof t=="string"&&t!==""}ns.isAttributeKey=ZC;function eP(t){return t==null?!0:Array.isArray(t)?p9(t):tP(typeof t)}ns.isAttributeValue=eP;function p9(t){let e;for(let n of t){if(n==null)continue;let r=typeof n;if(r!==e){if(!e){if(tP(r)){e=r;continue}return!1}return!1}}return!0}function tP(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}});var yg=E(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});m_.loggingErrorHandler=void 0;var d9=(b(),N(v));function _9(){return t=>{d9.diag.error(f9(t))}}m_.loggingErrorHandler=_9;function f9(t){return typeof t=="string"?t:JSON.stringify(m9(t))}function m9(t){let e={},n=t;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(e[r])return;let o=n[r];o&&(e[r]=String(o))}),n=Object.getPrototypeOf(n);return e}});var oP=E(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.globalErrorHandler=qa.setGlobalErrorHandler=void 0;var T9=yg(),rP=(0,T9.loggingErrorHandler)();function h9(t){rP=t}qa.setGlobalErrorHandler=h9;function E9(t){try{rP(t)}catch{}}qa.globalErrorHandler=E9});var cP=E(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.getStringListFromEnv=Vr.getBooleanFromEnv=Vr.getStringFromEnv=Vr.getNumberFromEnv=void 0;var sP=(b(),N(v)),iP=U("util");function S9(t){let e=process.env[t];if(e==null||e.trim()==="")return;let n=Number(e);if(isNaN(n)){sP.diag.warn(`Unknown value ${(0,iP.inspect)(e)} for ${t}, expected a number, using defaults`);return}return n}Vr.getNumberFromEnv=S9;function aP(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}Vr.getStringFromEnv=aP;function g9(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||sP.diag.warn(`Unknown value ${(0,iP.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Vr.getBooleanFromEnv=g9;function A9(t){return aP(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}Vr.getStringListFromEnv=A9});var uP=E(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});T_._globalThis=void 0;T_._globalThis=globalThis});var lP=E(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});h_.VERSION=void 0;h_.VERSION="2.6.1"});function We(t){let e={},n=t.length;for(let r=0;r<n;r++){let o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var Ig=z(()=>{});var pP,dP,_P,fP,mP,TP,hP,EP,SP,gP,AP,RP,yP,IP,NP,OP,bP,CP,PP,MP,xP,vP,LP,DP,UP,wP,kP,GP,BP,jP,HP,VP,FP,qP,$P,YP,WP,zP,KP,QP,XP,JP,ZP,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,pM,dM,_M,fM,mM,TM,hM,EM,SM,gM,AM,RM,yM,IM,NM,OM,bM,CM,PM,MM,xM,vM,LM,DM,UM,wM,kM,GM,BM,jM,HM,VM,FM,qM,$M,YM,WM,zM,KM,QM,XM,JM,ZM,ex,tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,px,dx,_x,fx,mx,Tx,hx,Ex,Sx,gx,Ax,Rx,yx,Ix,Nx,Ox,bx,Cx,Px,Mx,R9,Ng,y9,I9,N9,O9,Og,b9,C9,P9,M9,x9,v9,L9,D9,U9,w9,k9,G9,B9,j9,H9,V9,F9,q9,bg,$9,Y9,W9,z9,K9,Q9,X9,J9,Z9,eQ,tQ,nQ,Cg,rQ,oQ,Pg,Mg,sQ,iQ,aQ,cQ,uQ,lQ,pQ,dQ,_Q,fQ,mQ,TQ,hQ,EQ,SQ,gQ,AQ,Sl,$a,xg,RQ,yQ,Ri,IQ,NQ,OQ,bQ,vg,Lg,CQ,Dg,PQ,MQ,xQ,vQ,LQ,DQ,UQ,wQ,kQ,GQ,BQ,jQ,HQ,VQ,FQ,qQ,$Q,YQ,WQ,zQ,KQ,QQ,XQ,Ug,JQ,ZQ,eX,tX,nX,rX,oX,sX,iX,aX,cX,uX,lX,pX,dX,_X,fX,mX,TX,wg,hX,kg,EX,SX,gX,AX,RX,yX,IX,NX,OX,xx,vx,Lx,Dx,Ux,wx,kx,Gx,Bx,jx,Hx,Vx,Fx,qx,$x,Yx,Wx,zx,Kx,Qx,Xx,Jx,Zx,ev,tv,nv,rv,ov,sv,iv,av,cv,uv,lv,pv,dv,_v,fv,mv,Tv,hv,Ev,Sv,gv,Av,Rv,yv,bX,CX,PX,MX,xX,vX,LX,DX,UX,wX,kX,GX,BX,jX,HX,VX,FX,qX,$X,YX,WX,zX,KX,QX,XX,JX,ZX,eJ,tJ,nJ,rJ,oJ,sJ,iJ,aJ,cJ,uJ,lJ,pJ,dJ,_J,fJ,mJ,TJ,hJ,EJ,SJ,gJ,Iv,Nv,Ov,bv,Cv,Pv,Mv,xv,vv,Lv,Dv,AJ,RJ,yJ,IJ,NJ,OJ,bJ,CJ,PJ,MJ,xJ,vJ,Uv,wv,kv,Gv,Bv,LJ,DJ,UJ,wJ,kJ,GJ,jv,Hv,Vv,BJ,jJ,HJ,VJ,Fv,qv,$v,Yv,FJ,qJ,$J,YJ,WJ,Wv,zv,Kv,Qv,Xv,Jv,Zv,zJ,KJ,QJ,XJ,JJ,ZJ,eZ,tZ,eL,tL,nL,rL,oL,nZ,rZ,oZ,sZ,iZ,aZ,sL,iL,aL,cL,uL,lL,pL,dL,_L,fL,mL,TL,hL,EL,SL,gL,AL,RL,yL,IL,NL,cZ,uZ,lZ,pZ,dZ,_Z,fZ,mZ,TZ,hZ,EZ,SZ,gZ,AZ,RZ,yZ,IZ,NZ,OZ,bZ,CZ,PZ,OL,bL,CL,PL,ML,MZ,xZ,vZ,LZ,DZ,UZ,xL,vL,wZ,kZ,GZ,LL,DL,BZ,jZ,HZ,UL,wL,kL,GL,BL,jL,HL,VL,FL,qL,$L,YL,WL,zL,KL,QL,XL,VZ,FZ,qZ,$Z,YZ,WZ,zZ,KZ,QZ,XZ,JZ,ZZ,e5,t5,n5,r5,o5,s5,JL,ZL,i5,a5,c5,e0=z(()=>{Ig();pP="aws.lambda.invoked_arn",dP="db.system",_P="db.connection_string",fP="db.user",mP="db.jdbc.driver_classname",TP="db.name",hP="db.statement",EP="db.operation",SP="db.mssql.instance_name",gP="db.cassandra.keyspace",AP="db.cassandra.page_size",RP="db.cassandra.consistency_level",yP="db.cassandra.table",IP="db.cassandra.idempotence",NP="db.cassandra.speculative_execution_count",OP="db.cassandra.coordinator.id",bP="db.cassandra.coordinator.dc",CP="db.hbase.namespace",PP="db.redis.database_index",MP="db.mongodb.collection",xP="db.sql.table",vP="exception.type",LP="exception.message",DP="exception.stacktrace",UP="exception.escaped",wP="faas.trigger",kP="faas.execution",GP="faas.document.collection",BP="faas.document.operation",jP="faas.document.time",HP="faas.document.name",VP="faas.time",FP="faas.cron",qP="faas.coldstart",$P="faas.invoked_name",YP="faas.invoked_provider",WP="faas.invoked_region",zP="net.transport",KP="net.peer.ip",QP="net.peer.port",XP="net.peer.name",JP="net.host.ip",ZP="net.host.port",eM="net.host.name",tM="net.host.connection.type",nM="net.host.connection.subtype",rM="net.host.carrier.name",oM="net.host.carrier.mcc",sM="net.host.carrier.mnc",iM="net.host.carrier.icc",aM="peer.service",cM="enduser.id",uM="enduser.role",lM="enduser.scope",pM="thread.id",dM="thread.name",_M="code.function",fM="code.namespace",mM="code.filepath",TM="code.lineno",hM="http.method",EM="http.url",SM="http.target",gM="http.host",AM="http.scheme",RM="http.status_code",yM="http.flavor",IM="http.user_agent",NM="http.request_content_length",OM="http.request_content_length_uncompressed",bM="http.response_content_length",CM="http.response_content_length_uncompressed",PM="http.server_name",MM="http.route",xM="http.client_ip",vM="aws.dynamodb.table_names",LM="aws.dynamodb.consumed_capacity",DM="aws.dynamodb.item_collection_metrics",UM="aws.dynamodb.provisioned_read_capacity",wM="aws.dynamodb.provisioned_write_capacity",kM="aws.dynamodb.consistent_read",GM="aws.dynamodb.projection",BM="aws.dynamodb.limit",jM="aws.dynamodb.attributes_to_get",HM="aws.dynamodb.index_name",VM="aws.dynamodb.select",FM="aws.dynamodb.global_secondary_indexes",qM="aws.dynamodb.local_secondary_indexes",$M="aws.dynamodb.exclusive_start_table",YM="aws.dynamodb.table_count",WM="aws.dynamodb.scan_forward",zM="aws.dynamodb.segment",KM="aws.dynamodb.total_segments",QM="aws.dynamodb.count",XM="aws.dynamodb.scanned_count",JM="aws.dynamodb.attribute_definitions",ZM="aws.dynamodb.global_secondary_index_updates",ex="messaging.system",tx="messaging.destination",nx="messaging.destination_kind",rx="messaging.temp_destination",ox="messaging.protocol",sx="messaging.protocol_version",ix="messaging.url",ax="messaging.message_id",cx="messaging.conversation_id",ux="messaging.message_payload_size_bytes",lx="messaging.message_payload_compressed_size_bytes",px="messaging.operation",dx="messaging.consumer_id",_x="messaging.rabbitmq.routing_key",fx="messaging.kafka.message_key",mx="messaging.kafka.consumer_group",Tx="messaging.kafka.client_id",hx="messaging.kafka.partition",Ex="messaging.kafka.tombstone",Sx="rpc.system",gx="rpc.service",Ax="rpc.method",Rx="rpc.grpc.status_code",yx="rpc.jsonrpc.version",Ix="rpc.jsonrpc.request_id",Nx="rpc.jsonrpc.error_code",Ox="rpc.jsonrpc.error_message",bx="message.type",Cx="message.id",Px="message.compressed_size",Mx="message.uncompressed_size",R9=pP,Ng=dP,y9=_P,I9=fP,N9=mP,O9=TP,Og=hP,b9=EP,C9=SP,P9=gP,M9=AP,x9=RP,v9=yP,L9=IP,D9=NP,U9=OP,w9=bP,k9=CP,G9=PP,B9=MP,j9=xP,H9=vP,V9=LP,F9=DP,q9=UP,bg=wP,$9=kP,Y9=GP,W9=BP,z9=jP,K9=HP,Q9=VP,X9=FP,J9=qP,Z9=$P,eQ=YP,tQ=WP,nQ=zP,Cg=KP,rQ=QP,oQ=XP,Pg=JP,Mg=ZP,sQ=eM,iQ=tM,aQ=nM,cQ=rM,uQ=oM,lQ=sM,pQ=iM,dQ=aM,_Q=cM,fQ=uM,mQ=lM,TQ=pM,hQ=dM,EQ=_M,SQ=fM,gQ=mM,AQ=TM,Sl=hM,$a=EM,xg=SM,RQ=gM,yQ=AM,Ri=RM,IQ=yM,NQ=IM,OQ=NM,bQ=OM,vg=bM,Lg=CM,CQ=PM,Dg=MM,PQ=xM,MQ=vM,xQ=LM,vQ=DM,LQ=UM,DQ=wM,UQ=kM,wQ=GM,kQ=BM,GQ=jM,BQ=HM,jQ=VM,HQ=FM,VQ=qM,FQ=$M,qQ=YM,$Q=WM,YQ=zM,WQ=KM,zQ=QM,KQ=XM,QQ=JM,XQ=ZM,Ug=ex,JQ=tx,ZQ=nx,eX=rx,tX=ox,nX=sx,rX=ix,oX=ax,sX=cx,iX=ux,aX=lx,cX=px,uX=dx,lX=_x,pX=fx,dX=mx,_X=Tx,fX=hx,mX=Ex,TX=Sx,wg=gx,hX=Ax,kg=Rx,EX=yx,SX=Ix,gX=Nx,AX=Ox,RX=bx,yX=Cx,IX=Px,NX=Mx,OX=We([pP,dP,_P,fP,mP,TP,hP,EP,SP,gP,AP,RP,yP,IP,NP,OP,bP,CP,PP,MP,xP,vP,LP,DP,UP,wP,kP,GP,BP,jP,HP,VP,FP,qP,$P,YP,WP,zP,KP,QP,XP,JP,ZP,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,pM,dM,_M,fM,mM,TM,hM,EM,SM,gM,AM,RM,yM,IM,NM,OM,bM,CM,PM,MM,xM,vM,LM,DM,UM,wM,kM,GM,BM,jM,HM,VM,FM,qM,$M,YM,WM,zM,KM,QM,XM,JM,ZM,ex,tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,px,dx,_x,fx,mx,Tx,hx,Ex,Sx,gx,Ax,Rx,yx,Ix,Nx,Ox,bx,Cx,Px,Mx]),xx="other_sql",vx="mssql",Lx="mysql",Dx="oracle",Ux="db2",wx="postgresql",kx="redshift",Gx="hive",Bx="cloudscape",jx="hsqldb",Hx="progress",Vx="maxdb",Fx="hanadb",qx="ingres",$x="firstsql",Yx="edb",Wx="cache",zx="adabas",Kx="firebird",Qx="derby",Xx="filemaker",Jx="informix",Zx="instantdb",ev="interbase",tv="mariadb",nv="netezza",rv="pervasive",ov="pointbase",sv="sqlite",iv="sybase",av="teradata",cv="vertica",uv="h2",lv="coldfusion",pv="cassandra",dv="hbase",_v="mongodb",fv="redis",mv="couchbase",Tv="couchdb",hv="cosmosdb",Ev="dynamodb",Sv="neo4j",gv="geode",Av="elasticsearch",Rv="memcached",yv="cockroachdb",bX=xx,CX=vx,PX=Lx,MX=Dx,xX=Ux,vX=wx,LX=kx,DX=Gx,UX=Bx,wX=jx,kX=Hx,GX=Vx,BX=Fx,jX=qx,HX=$x,VX=Yx,FX=Wx,qX=zx,$X=Kx,YX=Qx,WX=Xx,zX=Jx,KX=Zx,QX=ev,XX=tv,JX=nv,ZX=rv,eJ=ov,tJ=sv,nJ=iv,rJ=av,oJ=cv,sJ=uv,iJ=lv,aJ=pv,cJ=dv,uJ=_v,lJ=fv,pJ=mv,dJ=Tv,_J=hv,fJ=Ev,mJ=Sv,TJ=gv,hJ=Av,EJ=Rv,SJ=yv,gJ=We([xx,vx,Lx,Dx,Ux,wx,kx,Gx,Bx,jx,Hx,Vx,Fx,qx,$x,Yx,Wx,zx,Kx,Qx,Xx,Jx,Zx,ev,tv,nv,rv,ov,sv,iv,av,cv,uv,lv,pv,dv,_v,fv,mv,Tv,hv,Ev,Sv,gv,Av,Rv,yv]),Iv="all",Nv="each_quorum",Ov="quorum",bv="local_quorum",Cv="one",Pv="two",Mv="three",xv="local_one",vv="any",Lv="serial",Dv="local_serial",AJ=Iv,RJ=Nv,yJ=Ov,IJ=bv,NJ=Cv,OJ=Pv,bJ=Mv,CJ=xv,PJ=vv,MJ=Lv,xJ=Dv,vJ=We([Iv,Nv,Ov,bv,Cv,Pv,Mv,xv,vv,Lv,Dv]),Uv="datasource",wv="http",kv="pubsub",Gv="timer",Bv="other",LJ=Uv,DJ=wv,UJ=kv,wJ=Gv,kJ=Bv,GJ=We([Uv,wv,kv,Gv,Bv]),jv="insert",Hv="edit",Vv="delete",BJ=jv,jJ=Hv,HJ=Vv,VJ=We([jv,Hv,Vv]),Fv="alibaba_cloud",qv="aws",$v="azure",Yv="gcp",FJ=Fv,qJ=qv,$J=$v,YJ=Yv,WJ=We([Fv,qv,$v,Yv]),Wv="ip_tcp",zv="ip_udp",Kv="ip",Qv="unix",Xv="pipe",Jv="inproc",Zv="other",zJ=Wv,KJ=zv,QJ=Kv,XJ=Qv,JJ=Xv,ZJ=Jv,eZ=Zv,tZ=We([Wv,zv,Kv,Qv,Xv,Jv,Zv]),eL="wifi",tL="wired",nL="cell",rL="unavailable",oL="unknown",nZ=eL,rZ=tL,oZ=nL,sZ=rL,iZ=oL,aZ=We([eL,tL,nL,rL,oL]),sL="gprs",iL="edge",aL="umts",cL="cdma",uL="evdo_0",lL="evdo_a",pL="cdma2000_1xrtt",dL="hsdpa",_L="hsupa",fL="hspa",mL="iden",TL="evdo_b",hL="lte",EL="ehrpd",SL="hspap",gL="gsm",AL="td_scdma",RL="iwlan",yL="nr",IL="nrnsa",NL="lte_ca",cZ=sL,uZ=iL,lZ=aL,pZ=cL,dZ=uL,_Z=lL,fZ=pL,mZ=dL,TZ=_L,hZ=fL,EZ=mL,SZ=TL,gZ=hL,AZ=EL,RZ=SL,yZ=gL,IZ=AL,NZ=RL,OZ=yL,bZ=IL,CZ=NL,PZ=We([sL,iL,aL,cL,uL,lL,pL,dL,_L,fL,mL,TL,hL,EL,SL,gL,AL,RL,yL,IL,NL]),OL="1.0",bL="1.1",CL="2.0",PL="SPDY",ML="QUIC",MZ=OL,xZ=bL,vZ=CL,LZ=PL,DZ=ML,UZ={HTTP_1_0:OL,HTTP_1_1:bL,HTTP_2_0:CL,SPDY:PL,QUIC:ML},xL="queue",vL="topic",wZ=xL,kZ=vL,GZ=We([xL,vL]),LL="receive",DL="process",BZ=LL,jZ=DL,HZ=We([LL,DL]),UL=0,wL=1,kL=2,GL=3,BL=4,jL=5,HL=6,VL=7,FL=8,qL=9,$L=10,YL=11,WL=12,zL=13,KL=14,QL=15,XL=16,VZ=UL,FZ=wL,qZ=kL,$Z=GL,YZ=BL,WZ=jL,zZ=HL,KZ=VL,QZ=FL,XZ=qL,JZ=$L,ZZ=YL,e5=WL,t5=zL,n5=KL,r5=QL,o5=XL,s5={OK:UL,CANCELLED:wL,UNKNOWN:kL,INVALID_ARGUMENT:GL,DEADLINE_EXCEEDED:BL,NOT_FOUND:jL,ALREADY_EXISTS:HL,PERMISSION_DENIED:VL,RESOURCE_EXHAUSTED:FL,FAILED_PRECONDITION:qL,ABORTED:$L,OUT_OF_RANGE:YL,UNIMPLEMENTED:WL,INTERNAL:zL,UNAVAILABLE:KL,DATA_LOSS:QL,UNAUTHENTICATED:XL},JL="SENT",ZL="RECEIVED",i5=JL,a5=ZL,c5=We([JL,ZL])});var t0=z(()=>{e0()});var n0,r0,o0,s0,i0,a0,c0,u0,l0,p0,d0,_0,f0,m0,T0,h0,E0,S0,g0,A0,R0,y0,I0,N0,O0,b0,C0,P0,M0,x0,v0,L0,D0,U0,w0,k0,G0,B0,j0,H0,V0,F0,q0,$0,Y0,W0,z0,K0,Q0,X0,J0,Z0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,pD,dD,_D,fD,mD,TD,hD,ED,SD,gD,AD,RD,yD,ID,ND,OD,bD,CD,u5,l5,p5,d5,_5,f5,m5,T5,h5,E5,S5,g5,A5,R5,y5,I5,N5,O5,b5,C5,P5,M5,x5,v5,L5,D5,U5,w5,k5,G5,B5,j5,H5,V5,F5,q5,$5,Y5,W5,z5,K5,Q5,X5,J5,Z5,e6,t6,n6,r6,o6,s6,i6,a6,c6,u6,l6,p6,d6,_6,f6,m6,T6,h6,E6,S6,g6,A6,R6,y6,I6,N6,Gg,O6,b6,C6,P6,M6,x6,v6,L6,D6,U6,PD,MD,xD,vD,w6,k6,G6,B6,j6,LD,DD,UD,wD,kD,GD,BD,jD,HD,VD,FD,qD,$D,YD,WD,zD,KD,H6,V6,F6,q6,$6,Y6,W6,z6,K6,Q6,X6,J6,Z6,e8,t8,n8,r8,o8,QD,XD,s8,i8,a8,JD,ZD,eU,tU,nU,rU,oU,c8,u8,l8,p8,d8,_8,f8,m8,sU,iU,aU,cU,uU,lU,pU,dU,_U,fU,mU,T8,h8,E8,S8,g8,A8,R8,y8,I8,N8,O8,b8,TU,hU,EU,SU,gU,AU,RU,yU,IU,NU,C8,P8,M8,x8,v8,L8,D8,U8,w8,k8,G8,OU=z(()=>{Ig();n0="cloud.provider",r0="cloud.account.id",o0="cloud.region",s0="cloud.availability_zone",i0="cloud.platform",a0="aws.ecs.container.arn",c0="aws.ecs.cluster.arn",u0="aws.ecs.launchtype",l0="aws.ecs.task.arn",p0="aws.ecs.task.family",d0="aws.ecs.task.revision",_0="aws.eks.cluster.arn",f0="aws.log.group.names",m0="aws.log.group.arns",T0="aws.log.stream.names",h0="aws.log.stream.arns",E0="container.name",S0="container.id",g0="container.runtime",A0="container.image.name",R0="container.image.tag",y0="deployment.environment",I0="device.id",N0="device.model.identifier",O0="device.model.name",b0="faas.name",C0="faas.id",P0="faas.version",M0="faas.instance",x0="faas.max_memory",v0="host.id",L0="host.name",D0="host.type",U0="host.arch",w0="host.image.name",k0="host.image.id",G0="host.image.version",B0="k8s.cluster.name",j0="k8s.node.name",H0="k8s.node.uid",V0="k8s.namespace.name",F0="k8s.pod.uid",q0="k8s.pod.name",$0="k8s.container.name",Y0="k8s.replicaset.uid",W0="k8s.replicaset.name",z0="k8s.deployment.uid",K0="k8s.deployment.name",Q0="k8s.statefulset.uid",X0="k8s.statefulset.name",J0="k8s.daemonset.uid",Z0="k8s.daemonset.name",eD="k8s.job.uid",tD="k8s.job.name",nD="k8s.cronjob.uid",rD="k8s.cronjob.name",oD="os.type",sD="os.description",iD="os.name",aD="os.version",cD="process.pid",uD="process.executable.name",lD="process.executable.path",pD="process.command",dD="process.command_line",_D="process.command_args",fD="process.owner",mD="process.runtime.name",TD="process.runtime.version",hD="process.runtime.description",ED="service.name",SD="service.namespace",gD="service.instance.id",AD="service.version",RD="telemetry.sdk.name",yD="telemetry.sdk.language",ID="telemetry.sdk.version",ND="telemetry.auto.version",OD="webengine.name",bD="webengine.version",CD="webengine.description",u5=n0,l5=r0,p5=o0,d5=s0,_5=i0,f5=a0,m5=c0,T5=u0,h5=l0,E5=p0,S5=d0,g5=_0,A5=f0,R5=m0,y5=T0,I5=h0,N5=E0,O5=S0,b5=g0,C5=A0,P5=R0,M5=y0,x5=I0,v5=N0,L5=O0,D5=b0,U5=C0,w5=P0,k5=M0,G5=x0,B5=v0,j5=L0,H5=D0,V5=U0,F5=w0,q5=k0,$5=G0,Y5=B0,W5=j0,z5=H0,K5=V0,Q5=F0,X5=q0,J5=$0,Z5=Y0,e6=W0,t6=z0,n6=K0,r6=Q0,o6=X0,s6=J0,i6=Z0,a6=eD,c6=tD,u6=nD,l6=rD,p6=oD,d6=sD,_6=iD,f6=aD,m6=cD,T6=uD,h6=lD,E6=pD,S6=dD,g6=_D,A6=fD,R6=mD,y6=TD,I6=hD,N6=ED,Gg=SD,O6=gD,b6=AD,C6=RD,P6=yD,M6=ID,x6=ND,v6=OD,L6=bD,D6=CD,U6=We([n0,r0,o0,s0,i0,a0,c0,u0,l0,p0,d0,_0,f0,m0,T0,h0,E0,S0,g0,A0,R0,y0,I0,N0,O0,b0,C0,P0,M0,x0,v0,L0,D0,U0,w0,k0,G0,B0,j0,H0,V0,F0,q0,$0,Y0,W0,z0,K0,Q0,X0,J0,Z0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,pD,dD,_D,fD,mD,TD,hD,ED,SD,gD,AD,RD,yD,ID,ND,OD,bD,CD]),PD="alibaba_cloud",MD="aws",xD="azure",vD="gcp",w6=PD,k6=MD,G6=xD,B6=vD,j6=We([PD,MD,xD,vD]),LD="alibaba_cloud_ecs",DD="alibaba_cloud_fc",UD="aws_ec2",wD="aws_ecs",kD="aws_eks",GD="aws_lambda",BD="aws_elastic_beanstalk",jD="azure_vm",HD="azure_container_instances",VD="azure_aks",FD="azure_functions",qD="azure_app_service",$D="gcp_compute_engine",YD="gcp_cloud_run",WD="gcp_kubernetes_engine",zD="gcp_cloud_functions",KD="gcp_app_engine",H6=LD,V6=DD,F6=UD,q6=wD,$6=kD,Y6=GD,W6=BD,z6=jD,K6=HD,Q6=VD,X6=FD,J6=qD,Z6=$D,e8=YD,t8=WD,n8=zD,r8=KD,o8=We([LD,DD,UD,wD,kD,GD,BD,jD,HD,VD,FD,qD,$D,YD,WD,zD,KD]),QD="ec2",XD="fargate",s8=QD,i8=XD,a8=We([QD,XD]),JD="amd64",ZD="arm32",eU="arm64",tU="ia64",nU="ppc32",rU="ppc64",oU="x86",c8=JD,u8=ZD,l8=eU,p8=tU,d8=nU,_8=rU,f8=oU,m8=We([JD,ZD,eU,tU,nU,rU,oU]),sU="windows",iU="linux",aU="darwin",cU="freebsd",uU="netbsd",lU="openbsd",pU="dragonflybsd",dU="hpux",_U="aix",fU="solaris",mU="z_os",T8=sU,h8=iU,E8=aU,S8=cU,g8=uU,A8=lU,R8=pU,y8=dU,I8=_U,N8=fU,O8=mU,b8=We([sU,iU,aU,cU,uU,lU,pU,dU,_U,fU,mU]),TU="cpp",hU="dotnet",EU="erlang",SU="go",gU="java",AU="nodejs",RU="php",yU="python",IU="ruby",NU="webjs",C8=TU,P8=hU,M8=EU,x8=SU,v8=gU,L8=AU,D8=RU,U8=yU,w8=IU,k8=NU,G8=We([TU,hU,EU,SU,gU,AU,RU,yU,IU,NU])});var bU=z(()=>{OU()});var B8,j8,H8,V8,F8,q8,$8,Y8,W8,z8,K8,Q8,X8,J8,Z8,e7,t7,n7,r7,o7,s7,i7,a7,c7,u7,Bg,jg,l7,Ya,p7,Hg,Vg,d7,yi,_7,f7,m7,T7,h7,E7,S7,g7,A7,R7,Fg,y7,I7,N7,O7,b7,C7,Ii,P7,M7,x7,v7,L7,D7,U7,w7,k7,G7,B7,j7,H7,Io,No,V7,F7,q7,$7,Y7,W7,z7,K7,Q7,X7,J7,Z7,eee,tee,nee,ree,qg,$g,oee,Yg,Wg,see,iee,aee,cee,uee,lee,pee,dee,_ee,fee,mee,Tee,hee,Eee,zg,Kg,See,Qg,gee,Xg,Aee,Ree,yee,Iee,Nee,Oee,bee,Cee,Pee,Mee,xee,vee,Lee,Dee,Uee,wee,kee,Gee,Bee,jee,Hee,Vee,Fee,qee,rs,$ee,Yee,Wee,Jg,CU=z(()=>{B8="aspnetcore.diagnostics.exception.result",j8="aborted",H8="handled",V8="skipped",F8="unhandled",q8="aspnetcore.diagnostics.handler.type",$8="aspnetcore.rate_limiting.policy",Y8="aspnetcore.rate_limiting.result",W8="acquired",z8="endpoint_limiter",K8="global_limiter",Q8="request_canceled",X8="aspnetcore.request.is_unhandled",J8="aspnetcore.routing.is_fallback",Z8="aspnetcore.routing.match_status",e7="failure",t7="success",n7="aspnetcore.user.is_authenticated",r7="client.address",o7="client.port",s7="code.column.number",i7="code.file.path",a7="code.function.name",c7="code.line.number",u7="code.stacktrace",Bg="db.collection.name",jg="db.namespace",l7="db.operation.batch.size",Ya="db.operation.name",p7="db.query.summary",Hg="db.query.text",Vg="db.response.status_code",d7="db.stored_procedure.name",yi="db.system.name",_7="mariadb",f7="microsoft.sql_server",m7="mysql",T7="postgresql",h7="dotnet.gc.heap.generation",E7="gen0",S7="gen1",g7="gen2",A7="loh",R7="poh",Fg="error.type",y7="_OTHER",I7="exception.escaped",N7="exception.message",O7="exception.stacktrace",b7="exception.type",C7=t=>`http.request.header.${t}`,Ii="http.request.method",P7="_OTHER",M7="CONNECT",x7="DELETE",v7="GET",L7="HEAD",D7="OPTIONS",U7="PATCH",w7="POST",k7="PUT",G7="TRACE",B7="http.request.method_original",j7="http.request.resend_count",H7=t=>`http.response.header.${t}`,Io="http.response.status_code",No="http.route",V7="jvm.gc.action",F7="jvm.gc.name",q7="jvm.memory.pool.name",$7="jvm.memory.type",Y7="heap",W7="non_heap",z7="jvm.thread.daemon",K7="jvm.thread.state",Q7="blocked",X7="new",J7="runnable",Z7="terminated",eee="timed_waiting",tee="waiting",nee="network.local.address",ree="network.local.port",qg="network.peer.address",$g="network.peer.port",oee="network.protocol.name",Yg="network.protocol.version",Wg="network.transport",see="pipe",iee="quic",aee="tcp",cee="udp",uee="unix",lee="network.type",pee="ipv4",dee="ipv6",_ee="otel.scope.name",fee="otel.scope.version",mee="otel.status_code",Tee="ERROR",hee="OK",Eee="otel.status_description",zg="server.address",Kg="server.port",See="service.instance.id",Qg="service.name",gee="service.namespace",Xg="service.version",Aee="signalr.connection.status",Ree="app_shutdown",yee="normal_closure",Iee="timeout",Nee="signalr.transport",Oee="long_polling",bee="server_sent_events",Cee="web_sockets",Pee="telemetry.sdk.language",Mee="cpp",xee="dotnet",vee="erlang",Lee="go",Dee="java",Uee="nodejs",wee="php",kee="python",Gee="ruby",Bee="rust",jee="swift",Hee="webjs",Vee="telemetry.sdk.name",Fee="telemetry.sdk.version",qee="url.fragment",rs="url.full",$ee="url.path",Yee="url.query",Wee="url.scheme",Jg="user_agent.original"});var zee,Kee,Qee,Xee,Jee,Zee,ete,tte,nte,rte,ote,ste,ite,ate,cte,ute,lte,pte,dte,_te,fte,mte,Tte,hte,Ete,Ste,gte,Ate,Rte,yte,Ite,Nte,Ote,bte,Cte,Pte,Mte,xte,vte,Lte,Dte,Ute,wte,kte,Gte,Bte,jte,Hte,Vte,Fte,qte,PU=z(()=>{zee="aspnetcore.diagnostics.exceptions",Kee="aspnetcore.rate_limiting.active_request_leases",Qee="aspnetcore.rate_limiting.queued_requests",Xee="aspnetcore.rate_limiting.request.time_in_queue",Jee="aspnetcore.rate_limiting.request_lease.duration",Zee="aspnetcore.rate_limiting.requests",ete="aspnetcore.routing.match_attempts",tte="db.client.operation.duration",nte="dotnet.assembly.count",rte="dotnet.exceptions",ote="dotnet.gc.collections",ste="dotnet.gc.heap.total_allocated",ite="dotnet.gc.last_collection.heap.fragmentation.size",ate="dotnet.gc.last_collection.heap.size",cte="dotnet.gc.last_collection.memory.committed_size",ute="dotnet.gc.pause.time",lte="dotnet.jit.compilation.time",pte="dotnet.jit.compiled_il.size",dte="dotnet.jit.compiled_methods",_te="dotnet.monitor.lock_contentions",fte="dotnet.process.cpu.count",mte="dotnet.process.cpu.time",Tte="dotnet.process.memory.working_set",hte="dotnet.thread_pool.queue.length",Ete="dotnet.thread_pool.thread.count",Ste="dotnet.thread_pool.work_item.count",gte="dotnet.timer.count",Ate="http.client.request.duration",Rte="http.server.request.duration",yte="jvm.class.count",Ite="jvm.class.loaded",Nte="jvm.class.unloaded",Ote="jvm.cpu.count",bte="jvm.cpu.recent_utilization",Cte="jvm.cpu.time",Pte="jvm.gc.duration",Mte="jvm.memory.committed",xte="jvm.memory.limit",vte="jvm.memory.used",Lte="jvm.memory.used_after_last_gc",Dte="jvm.thread.count",Ute="kestrel.active_connections",wte="kestrel.active_tls_handshakes",kte="kestrel.connection.duration",Gte="kestrel.queued_connections",Bte="kestrel.queued_requests",jte="kestrel.rejected_connections",Hte="kestrel.tls_handshake.duration",Vte="kestrel.upgraded_connections",Fte="signalr.server.active_connections",qte="signalr.server.connection.duration"});var $te,MU=z(()=>{$te="exception"});var Ae={};US(Ae,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>j8,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>H8,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>V8,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>F8,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>W8,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>z8,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>K8,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Q8,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>e7,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>t7,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>B8,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>q8,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>$8,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Y8,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>X8,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>J8,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Z8,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>n7,ATTR_CLIENT_ADDRESS:()=>r7,ATTR_CLIENT_PORT:()=>o7,ATTR_CODE_COLUMN_NUMBER:()=>s7,ATTR_CODE_FILE_PATH:()=>i7,ATTR_CODE_FUNCTION_NAME:()=>a7,ATTR_CODE_LINE_NUMBER:()=>c7,ATTR_CODE_STACKTRACE:()=>u7,ATTR_DB_COLLECTION_NAME:()=>Bg,ATTR_DB_NAMESPACE:()=>jg,ATTR_DB_OPERATION_BATCH_SIZE:()=>l7,ATTR_DB_OPERATION_NAME:()=>Ya,ATTR_DB_QUERY_SUMMARY:()=>p7,ATTR_DB_QUERY_TEXT:()=>Hg,ATTR_DB_RESPONSE_STATUS_CODE:()=>Vg,ATTR_DB_STORED_PROCEDURE_NAME:()=>d7,ATTR_DB_SYSTEM_NAME:()=>yi,ATTR_DOTNET_GC_HEAP_GENERATION:()=>h7,ATTR_ERROR_TYPE:()=>Fg,ATTR_EXCEPTION_ESCAPED:()=>I7,ATTR_EXCEPTION_MESSAGE:()=>N7,ATTR_EXCEPTION_STACKTRACE:()=>O7,ATTR_EXCEPTION_TYPE:()=>b7,ATTR_HTTP_REQUEST_HEADER:()=>C7,ATTR_HTTP_REQUEST_METHOD:()=>Ii,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>B7,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>j7,ATTR_HTTP_RESPONSE_HEADER:()=>H7,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>Io,ATTR_HTTP_ROUTE:()=>No,ATTR_JVM_GC_ACTION:()=>V7,ATTR_JVM_GC_NAME:()=>F7,ATTR_JVM_MEMORY_POOL_NAME:()=>q7,ATTR_JVM_MEMORY_TYPE:()=>$7,ATTR_JVM_THREAD_DAEMON:()=>z7,ATTR_JVM_THREAD_STATE:()=>K7,ATTR_NETWORK_LOCAL_ADDRESS:()=>nee,ATTR_NETWORK_LOCAL_PORT:()=>ree,ATTR_NETWORK_PEER_ADDRESS:()=>qg,ATTR_NETWORK_PEER_PORT:()=>$g,ATTR_NETWORK_PROTOCOL_NAME:()=>oee,ATTR_NETWORK_PROTOCOL_VERSION:()=>Yg,ATTR_NETWORK_TRANSPORT:()=>Wg,ATTR_NETWORK_TYPE:()=>lee,ATTR_OTEL_SCOPE_NAME:()=>_ee,ATTR_OTEL_SCOPE_VERSION:()=>fee,ATTR_OTEL_STATUS_CODE:()=>mee,ATTR_OTEL_STATUS_DESCRIPTION:()=>Eee,ATTR_SERVER_ADDRESS:()=>zg,ATTR_SERVER_PORT:()=>Kg,ATTR_SERVICE_INSTANCE_ID:()=>See,ATTR_SERVICE_NAME:()=>Qg,ATTR_SERVICE_NAMESPACE:()=>gee,ATTR_SERVICE_VERSION:()=>Xg,ATTR_SIGNALR_CONNECTION_STATUS:()=>Aee,ATTR_SIGNALR_TRANSPORT:()=>Nee,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Pee,ATTR_TELEMETRY_SDK_NAME:()=>Vee,ATTR_TELEMETRY_SDK_VERSION:()=>Fee,ATTR_URL_FRAGMENT:()=>qee,ATTR_URL_FULL:()=>rs,ATTR_URL_PATH:()=>$ee,ATTR_URL_QUERY:()=>Yee,ATTR_URL_SCHEME:()=>Wee,ATTR_USER_AGENT_ORIGINAL:()=>Jg,AWSECSLAUNCHTYPEVALUES_EC2:()=>s8,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>i8,AwsEcsLaunchtypeValues:()=>a8,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>H6,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>V6,CLOUDPLATFORMVALUES_AWS_EC2:()=>F6,CLOUDPLATFORMVALUES_AWS_ECS:()=>q6,CLOUDPLATFORMVALUES_AWS_EKS:()=>$6,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>W6,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Y6,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Q6,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>J6,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>K6,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>X6,CLOUDPLATFORMVALUES_AZURE_VM:()=>z6,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>r8,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>n8,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>e8,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Z6,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>t8,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>w6,CLOUDPROVIDERVALUES_AWS:()=>k6,CLOUDPROVIDERVALUES_AZURE:()=>G6,CLOUDPROVIDERVALUES_GCP:()=>B6,CloudPlatformValues:()=>o8,CloudProviderValues:()=>j6,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>AJ,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>PJ,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>RJ,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>CJ,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>IJ,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>xJ,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>NJ,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>yJ,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>MJ,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>bJ,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>OJ,DBSYSTEMVALUES_ADABAS:()=>qX,DBSYSTEMVALUES_CACHE:()=>FX,DBSYSTEMVALUES_CASSANDRA:()=>aJ,DBSYSTEMVALUES_CLOUDSCAPE:()=>UX,DBSYSTEMVALUES_COCKROACHDB:()=>SJ,DBSYSTEMVALUES_COLDFUSION:()=>iJ,DBSYSTEMVALUES_COSMOSDB:()=>_J,DBSYSTEMVALUES_COUCHBASE:()=>pJ,DBSYSTEMVALUES_COUCHDB:()=>dJ,DBSYSTEMVALUES_DB2:()=>xX,DBSYSTEMVALUES_DERBY:()=>YX,DBSYSTEMVALUES_DYNAMODB:()=>fJ,DBSYSTEMVALUES_EDB:()=>VX,DBSYSTEMVALUES_ELASTICSEARCH:()=>hJ,DBSYSTEMVALUES_FILEMAKER:()=>WX,DBSYSTEMVALUES_FIREBIRD:()=>$X,DBSYSTEMVALUES_FIRSTSQL:()=>HX,DBSYSTEMVALUES_GEODE:()=>TJ,DBSYSTEMVALUES_H2:()=>sJ,DBSYSTEMVALUES_HANADB:()=>BX,DBSYSTEMVALUES_HBASE:()=>cJ,DBSYSTEMVALUES_HIVE:()=>DX,DBSYSTEMVALUES_HSQLDB:()=>wX,DBSYSTEMVALUES_INFORMIX:()=>zX,DBSYSTEMVALUES_INGRES:()=>jX,DBSYSTEMVALUES_INSTANTDB:()=>KX,DBSYSTEMVALUES_INTERBASE:()=>QX,DBSYSTEMVALUES_MARIADB:()=>XX,DBSYSTEMVALUES_MAXDB:()=>GX,DBSYSTEMVALUES_MEMCACHED:()=>EJ,DBSYSTEMVALUES_MONGODB:()=>uJ,DBSYSTEMVALUES_MSSQL:()=>CX,DBSYSTEMVALUES_MYSQL:()=>PX,DBSYSTEMVALUES_NEO4J:()=>mJ,DBSYSTEMVALUES_NETEZZA:()=>JX,DBSYSTEMVALUES_ORACLE:()=>MX,DBSYSTEMVALUES_OTHER_SQL:()=>bX,DBSYSTEMVALUES_PERVASIVE:()=>ZX,DBSYSTEMVALUES_POINTBASE:()=>eJ,DBSYSTEMVALUES_POSTGRESQL:()=>vX,DBSYSTEMVALUES_PROGRESS:()=>kX,DBSYSTEMVALUES_REDIS:()=>lJ,DBSYSTEMVALUES_REDSHIFT:()=>LX,DBSYSTEMVALUES_SQLITE:()=>tJ,DBSYSTEMVALUES_SYBASE:()=>nJ,DBSYSTEMVALUES_TERADATA:()=>rJ,DBSYSTEMVALUES_VERTICA:()=>oJ,DB_SYSTEM_NAME_VALUE_MARIADB:()=>_7,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>f7,DB_SYSTEM_NAME_VALUE_MYSQL:()=>m7,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>T7,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>E7,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>S7,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>g7,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>A7,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>R7,DbCassandraConsistencyLevelValues:()=>vJ,DbSystemValues:()=>gJ,ERROR_TYPE_VALUE_OTHER:()=>y7,EVENT_EXCEPTION:()=>$te,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>HJ,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>jJ,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>BJ,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>FJ,FAASINVOKEDPROVIDERVALUES_AWS:()=>qJ,FAASINVOKEDPROVIDERVALUES_AZURE:()=>$J,FAASINVOKEDPROVIDERVALUES_GCP:()=>YJ,FAASTRIGGERVALUES_DATASOURCE:()=>LJ,FAASTRIGGERVALUES_HTTP:()=>DJ,FAASTRIGGERVALUES_OTHER:()=>kJ,FAASTRIGGERVALUES_PUBSUB:()=>UJ,FAASTRIGGERVALUES_TIMER:()=>wJ,FaasDocumentOperationValues:()=>VJ,FaasInvokedProviderValues:()=>WJ,FaasTriggerValues:()=>GJ,HOSTARCHVALUES_AMD64:()=>c8,HOSTARCHVALUES_ARM32:()=>u8,HOSTARCHVALUES_ARM64:()=>l8,HOSTARCHVALUES_IA64:()=>p8,HOSTARCHVALUES_PPC32:()=>d8,HOSTARCHVALUES_PPC64:()=>_8,HOSTARCHVALUES_X86:()=>f8,HTTPFLAVORVALUES_HTTP_1_0:()=>MZ,HTTPFLAVORVALUES_HTTP_1_1:()=>xZ,HTTPFLAVORVALUES_HTTP_2_0:()=>vZ,HTTPFLAVORVALUES_QUIC:()=>DZ,HTTPFLAVORVALUES_SPDY:()=>LZ,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>M7,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>x7,HTTP_REQUEST_METHOD_VALUE_GET:()=>v7,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>L7,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>D7,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>P7,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>U7,HTTP_REQUEST_METHOD_VALUE_POST:()=>w7,HTTP_REQUEST_METHOD_VALUE_PUT:()=>k7,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>G7,HostArchValues:()=>m8,HttpFlavorValues:()=>UZ,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Y7,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>W7,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Q7,JVM_THREAD_STATE_VALUE_NEW:()=>X7,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>J7,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Z7,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>eee,JVM_THREAD_STATE_VALUE_WAITING:()=>tee,MESSAGETYPEVALUES_RECEIVED:()=>a5,MESSAGETYPEVALUES_SENT:()=>i5,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>wZ,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>kZ,MESSAGINGOPERATIONVALUES_PROCESS:()=>jZ,MESSAGINGOPERATIONVALUES_RECEIVE:()=>BZ,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>zee,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Kee,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Qee,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Zee,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Jee,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Xee,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>ete,METRIC_DB_CLIENT_OPERATION_DURATION:()=>tte,METRIC_DOTNET_ASSEMBLY_COUNT:()=>nte,METRIC_DOTNET_EXCEPTIONS:()=>rte,METRIC_DOTNET_GC_COLLECTIONS:()=>ote,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>ste,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>ite,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>ate,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>cte,METRIC_DOTNET_GC_PAUSE_TIME:()=>ute,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>lte,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>pte,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>dte,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>_te,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>fte,METRIC_DOTNET_PROCESS_CPU_TIME:()=>mte,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>Tte,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>hte,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Ete,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>Ste,METRIC_DOTNET_TIMER_COUNT:()=>gte,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Ate,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Rte,METRIC_JVM_CLASS_COUNT:()=>yte,METRIC_JVM_CLASS_LOADED:()=>Ite,METRIC_JVM_CLASS_UNLOADED:()=>Nte,METRIC_JVM_CPU_COUNT:()=>Ote,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>bte,METRIC_JVM_CPU_TIME:()=>Cte,METRIC_JVM_GC_DURATION:()=>Pte,METRIC_JVM_MEMORY_COMMITTED:()=>Mte,METRIC_JVM_MEMORY_LIMIT:()=>xte,METRIC_JVM_MEMORY_USED:()=>vte,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Lte,METRIC_JVM_THREAD_COUNT:()=>Dte,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Ute,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>wte,METRIC_KESTREL_CONNECTION_DURATION:()=>kte,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Gte,METRIC_KESTREL_QUEUED_REQUESTS:()=>Bte,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>jte,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Hte,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Vte,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Fte,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>qte,MessageTypeValues:()=>c5,MessagingDestinationKindValues:()=>GZ,MessagingOperationValues:()=>HZ,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>pZ,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>fZ,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>uZ,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>AZ,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>dZ,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>_Z,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>SZ,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>cZ,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>yZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>mZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>hZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>RZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>TZ,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>EZ,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>NZ,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>gZ,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>CZ,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>OZ,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>bZ,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>IZ,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>lZ,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>oZ,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>sZ,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>iZ,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>nZ,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>rZ,NETTRANSPORTVALUES_INPROC:()=>ZJ,NETTRANSPORTVALUES_IP:()=>QJ,NETTRANSPORTVALUES_IP_TCP:()=>zJ,NETTRANSPORTVALUES_IP_UDP:()=>KJ,NETTRANSPORTVALUES_OTHER:()=>eZ,NETTRANSPORTVALUES_PIPE:()=>JJ,NETTRANSPORTVALUES_UNIX:()=>XJ,NETWORK_TRANSPORT_VALUE_PIPE:()=>see,NETWORK_TRANSPORT_VALUE_QUIC:()=>iee,NETWORK_TRANSPORT_VALUE_TCP:()=>aee,NETWORK_TRANSPORT_VALUE_UDP:()=>cee,NETWORK_TRANSPORT_VALUE_UNIX:()=>uee,NETWORK_TYPE_VALUE_IPV4:()=>pee,NETWORK_TYPE_VALUE_IPV6:()=>dee,NetHostConnectionSubtypeValues:()=>PZ,NetHostConnectionTypeValues:()=>aZ,NetTransportValues:()=>tZ,OSTYPEVALUES_AIX:()=>I8,OSTYPEVALUES_DARWIN:()=>E8,OSTYPEVALUES_DRAGONFLYBSD:()=>R8,OSTYPEVALUES_FREEBSD:()=>S8,OSTYPEVALUES_HPUX:()=>y8,OSTYPEVALUES_LINUX:()=>h8,OSTYPEVALUES_NETBSD:()=>g8,OSTYPEVALUES_OPENBSD:()=>A8,OSTYPEVALUES_SOLARIS:()=>N8,OSTYPEVALUES_WINDOWS:()=>T8,OSTYPEVALUES_Z_OS:()=>O8,OTEL_STATUS_CODE_VALUE_ERROR:()=>Tee,OTEL_STATUS_CODE_VALUE_OK:()=>hee,OsTypeValues:()=>b8,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>JZ,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>zZ,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>FZ,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>r5,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>YZ,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>XZ,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>t5,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>$Z,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>WZ,RPCGRPCSTATUSCODEVALUES_OK:()=>VZ,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>ZZ,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>KZ,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>QZ,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>o5,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>n5,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>e5,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>qZ,RpcGrpcStatusCodeValues:()=>s5,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>GQ,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>QQ,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>UQ,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>xQ,SEMATTRS_AWS_DYNAMODB_COUNT:()=>zQ,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>FQ,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>HQ,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>XQ,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>BQ,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>vQ,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>kQ,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>VQ,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>wQ,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>LQ,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>DQ,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>KQ,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>$Q,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>YQ,SEMATTRS_AWS_DYNAMODB_SELECT:()=>jQ,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>qQ,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>MQ,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>WQ,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>R9,SEMATTRS_CODE_FILEPATH:()=>gQ,SEMATTRS_CODE_FUNCTION:()=>EQ,SEMATTRS_CODE_LINENO:()=>AQ,SEMATTRS_CODE_NAMESPACE:()=>SQ,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>x9,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>w9,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>U9,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>L9,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>P9,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>M9,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>D9,SEMATTRS_DB_CASSANDRA_TABLE:()=>v9,SEMATTRS_DB_CONNECTION_STRING:()=>y9,SEMATTRS_DB_HBASE_NAMESPACE:()=>k9,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>N9,SEMATTRS_DB_MONGODB_COLLECTION:()=>B9,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>C9,SEMATTRS_DB_NAME:()=>O9,SEMATTRS_DB_OPERATION:()=>b9,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>G9,SEMATTRS_DB_SQL_TABLE:()=>j9,SEMATTRS_DB_STATEMENT:()=>Og,SEMATTRS_DB_SYSTEM:()=>Ng,SEMATTRS_DB_USER:()=>I9,SEMATTRS_ENDUSER_ID:()=>_Q,SEMATTRS_ENDUSER_ROLE:()=>fQ,SEMATTRS_ENDUSER_SCOPE:()=>mQ,SEMATTRS_EXCEPTION_ESCAPED:()=>q9,SEMATTRS_EXCEPTION_MESSAGE:()=>V9,SEMATTRS_EXCEPTION_STACKTRACE:()=>F9,SEMATTRS_EXCEPTION_TYPE:()=>H9,SEMATTRS_FAAS_COLDSTART:()=>J9,SEMATTRS_FAAS_CRON:()=>X9,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Y9,SEMATTRS_FAAS_DOCUMENT_NAME:()=>K9,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>W9,SEMATTRS_FAAS_DOCUMENT_TIME:()=>z9,SEMATTRS_FAAS_EXECUTION:()=>$9,SEMATTRS_FAAS_INVOKED_NAME:()=>Z9,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>eQ,SEMATTRS_FAAS_INVOKED_REGION:()=>tQ,SEMATTRS_FAAS_TIME:()=>Q9,SEMATTRS_FAAS_TRIGGER:()=>bg,SEMATTRS_HTTP_CLIENT_IP:()=>PQ,SEMATTRS_HTTP_FLAVOR:()=>IQ,SEMATTRS_HTTP_HOST:()=>RQ,SEMATTRS_HTTP_METHOD:()=>Sl,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>OQ,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>bQ,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>vg,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Lg,SEMATTRS_HTTP_ROUTE:()=>Dg,SEMATTRS_HTTP_SCHEME:()=>yQ,SEMATTRS_HTTP_SERVER_NAME:()=>CQ,SEMATTRS_HTTP_STATUS_CODE:()=>Ri,SEMATTRS_HTTP_TARGET:()=>xg,SEMATTRS_HTTP_URL:()=>$a,SEMATTRS_HTTP_USER_AGENT:()=>NQ,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>IX,SEMATTRS_MESSAGE_ID:()=>yX,SEMATTRS_MESSAGE_TYPE:()=>RX,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>NX,SEMATTRS_MESSAGING_CONSUMER_ID:()=>uX,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>sX,SEMATTRS_MESSAGING_DESTINATION:()=>JQ,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>ZQ,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>_X,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>dX,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>pX,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>fX,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>mX,SEMATTRS_MESSAGING_MESSAGE_ID:()=>oX,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>aX,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>iX,SEMATTRS_MESSAGING_OPERATION:()=>cX,SEMATTRS_MESSAGING_PROTOCOL:()=>tX,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>nX,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>lX,SEMATTRS_MESSAGING_SYSTEM:()=>Ug,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>eX,SEMATTRS_MESSAGING_URL:()=>rX,SEMATTRS_NET_HOST_CARRIER_ICC:()=>pQ,SEMATTRS_NET_HOST_CARRIER_MCC:()=>uQ,SEMATTRS_NET_HOST_CARRIER_MNC:()=>lQ,SEMATTRS_NET_HOST_CARRIER_NAME:()=>cQ,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>aQ,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>iQ,SEMATTRS_NET_HOST_IP:()=>Pg,SEMATTRS_NET_HOST_NAME:()=>sQ,SEMATTRS_NET_HOST_PORT:()=>Mg,SEMATTRS_NET_PEER_IP:()=>Cg,SEMATTRS_NET_PEER_NAME:()=>oQ,SEMATTRS_NET_PEER_PORT:()=>rQ,SEMATTRS_NET_TRANSPORT:()=>nQ,SEMATTRS_PEER_SERVICE:()=>dQ,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>kg,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>gX,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>AX,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>SX,SEMATTRS_RPC_JSONRPC_VERSION:()=>EX,SEMATTRS_RPC_METHOD:()=>hX,SEMATTRS_RPC_SERVICE:()=>wg,SEMATTRS_RPC_SYSTEM:()=>TX,SEMATTRS_THREAD_ID:()=>TQ,SEMATTRS_THREAD_NAME:()=>hQ,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>m5,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>f5,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>T5,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>h5,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>E5,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>S5,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>g5,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>R5,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>A5,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>I5,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>y5,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>l5,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>d5,SEMRESATTRS_CLOUD_PLATFORM:()=>_5,SEMRESATTRS_CLOUD_PROVIDER:()=>u5,SEMRESATTRS_CLOUD_REGION:()=>p5,SEMRESATTRS_CONTAINER_ID:()=>O5,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>C5,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>P5,SEMRESATTRS_CONTAINER_NAME:()=>N5,SEMRESATTRS_CONTAINER_RUNTIME:()=>b5,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>M5,SEMRESATTRS_DEVICE_ID:()=>x5,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>v5,SEMRESATTRS_DEVICE_MODEL_NAME:()=>L5,SEMRESATTRS_FAAS_ID:()=>U5,SEMRESATTRS_FAAS_INSTANCE:()=>k5,SEMRESATTRS_FAAS_MAX_MEMORY:()=>G5,SEMRESATTRS_FAAS_NAME:()=>D5,SEMRESATTRS_FAAS_VERSION:()=>w5,SEMRESATTRS_HOST_ARCH:()=>V5,SEMRESATTRS_HOST_ID:()=>B5,SEMRESATTRS_HOST_IMAGE_ID:()=>q5,SEMRESATTRS_HOST_IMAGE_NAME:()=>F5,SEMRESATTRS_HOST_IMAGE_VERSION:()=>$5,SEMRESATTRS_HOST_NAME:()=>j5,SEMRESATTRS_HOST_TYPE:()=>H5,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Y5,SEMRESATTRS_K8S_CONTAINER_NAME:()=>J5,SEMRESATTRS_K8S_CRONJOB_NAME:()=>l6,SEMRESATTRS_K8S_CRONJOB_UID:()=>u6,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>i6,SEMRESATTRS_K8S_DAEMONSET_UID:()=>s6,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>n6,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>t6,SEMRESATTRS_K8S_JOB_NAME:()=>c6,SEMRESATTRS_K8S_JOB_UID:()=>a6,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>K5,SEMRESATTRS_K8S_NODE_NAME:()=>W5,SEMRESATTRS_K8S_NODE_UID:()=>z5,SEMRESATTRS_K8S_POD_NAME:()=>X5,SEMRESATTRS_K8S_POD_UID:()=>Q5,SEMRESATTRS_K8S_REPLICASET_NAME:()=>e6,SEMRESATTRS_K8S_REPLICASET_UID:()=>Z5,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>o6,SEMRESATTRS_K8S_STATEFULSET_UID:()=>r6,SEMRESATTRS_OS_DESCRIPTION:()=>d6,SEMRESATTRS_OS_NAME:()=>_6,SEMRESATTRS_OS_TYPE:()=>p6,SEMRESATTRS_OS_VERSION:()=>f6,SEMRESATTRS_PROCESS_COMMAND:()=>E6,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>g6,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>S6,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>T6,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>h6,SEMRESATTRS_PROCESS_OWNER:()=>A6,SEMRESATTRS_PROCESS_PID:()=>m6,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>I6,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>R6,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>y6,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>O6,SEMRESATTRS_SERVICE_NAME:()=>N6,SEMRESATTRS_SERVICE_NAMESPACE:()=>Gg,SEMRESATTRS_SERVICE_VERSION:()=>b6,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>x6,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>P6,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>C6,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>M6,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>D6,SEMRESATTRS_WEBENGINE_NAME:()=>v6,SEMRESATTRS_WEBENGINE_VERSION:()=>L6,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Ree,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>yee,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Iee,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Oee,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>bee,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Cee,SemanticAttributes:()=>OX,SemanticResourceAttributes:()=>U6,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>C8,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>P8,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>M8,TELEMETRYSDKLANGUAGEVALUES_GO:()=>x8,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>v8,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>L8,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>D8,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>U8,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>w8,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>k8,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Mee,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>xee,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>vee,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>Lee,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Dee,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Uee,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>wee,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>kee,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Gee,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Bee,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>jee,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Hee,TelemetrySdkLanguageValues:()=>G8});var le=z(()=>{t0();bU();CU();PU();MU()});var xU=E(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});E_.ATTR_PROCESS_RUNTIME_NAME=void 0;E_.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var vU=E(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.SDK_INFO=void 0;var Yte=lP(),S_=(le(),N(Ae)),Wte=xU();g_.SDK_INFO={[S_.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[Wte.ATTR_PROCESS_RUNTIME_NAME]:"node",[S_.ATTR_TELEMETRY_SDK_LANGUAGE]:S_.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[S_.ATTR_TELEMETRY_SDK_VERSION]:Yte.VERSION}});var LU=E(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.otperformance=qt.SDK_INFO=qt._globalThis=qt.getStringListFromEnv=qt.getNumberFromEnv=qt.getBooleanFromEnv=qt.getStringFromEnv=void 0;var A_=cP();Object.defineProperty(qt,"getStringFromEnv",{enumerable:!0,get:function(){return A_.getStringFromEnv}});Object.defineProperty(qt,"getBooleanFromEnv",{enumerable:!0,get:function(){return A_.getBooleanFromEnv}});Object.defineProperty(qt,"getNumberFromEnv",{enumerable:!0,get:function(){return A_.getNumberFromEnv}});Object.defineProperty(qt,"getStringListFromEnv",{enumerable:!0,get:function(){return A_.getStringListFromEnv}});var zte=uP();Object.defineProperty(qt,"_globalThis",{enumerable:!0,get:function(){return zte._globalThis}});var Kte=vU();Object.defineProperty(qt,"SDK_INFO",{enumerable:!0,get:function(){return Kte.SDK_INFO}});qt.otperformance=performance});var Zg=E($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.getStringListFromEnv=$t.getNumberFromEnv=$t.getStringFromEnv=$t.getBooleanFromEnv=$t.otperformance=$t._globalThis=$t.SDK_INFO=void 0;var Ni=LU();Object.defineProperty($t,"SDK_INFO",{enumerable:!0,get:function(){return Ni.SDK_INFO}});Object.defineProperty($t,"_globalThis",{enumerable:!0,get:function(){return Ni._globalThis}});Object.defineProperty($t,"otperformance",{enumerable:!0,get:function(){return Ni.otperformance}});Object.defineProperty($t,"getBooleanFromEnv",{enumerable:!0,get:function(){return Ni.getBooleanFromEnv}});Object.defineProperty($t,"getStringFromEnv",{enumerable:!0,get:function(){return Ni.getStringFromEnv}});Object.defineProperty($t,"getNumberFromEnv",{enumerable:!0,get:function(){return Ni.getNumberFromEnv}});Object.defineProperty($t,"getStringListFromEnv",{enumerable:!0,get:function(){return Ni.getStringListFromEnv}})});var kU=E(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.addHrTimes=be.isTimeInput=be.isTimeInputHrTime=be.hrTimeToMicroseconds=be.hrTimeToMilliseconds=be.hrTimeToNanoseconds=be.hrTimeToTimeStamp=be.hrTimeDuration=be.timeInputToHrTime=be.hrTime=be.getTimeOrigin=be.millisToHrTime=void 0;var R_=Zg(),DU=9,Qte=6,Xte=Math.pow(10,Qte),y_=Math.pow(10,DU);function gl(t){let e=t/1e3,n=Math.trunc(e),r=Math.round(t%1e3*Xte);return[n,r]}be.millisToHrTime=gl;function Jte(){return R_.otperformance.timeOrigin}be.getTimeOrigin=Jte;function UU(t){let e=gl(R_.otperformance.timeOrigin),n=gl(typeof t=="number"?t:R_.otperformance.now());return wU(e,n)}be.hrTime=UU;function Zte(t){if(eA(t))return t;if(typeof t=="number")return t<R_.otperformance.timeOrigin?UU(t):gl(t);if(t instanceof Date)return gl(t.getTime());throw TypeError("Invalid input type")}be.timeInputToHrTime=Zte;function ene(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=y_),[n,r]}be.hrTimeDuration=ene;function tne(t){let e=DU,n=`${"0".repeat(e)}${t[1]}Z`,r=n.substring(n.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",r)}be.hrTimeToTimeStamp=tne;function nne(t){return t[0]*y_+t[1]}be.hrTimeToNanoseconds=nne;function rne(t){return t[0]*1e3+t[1]/1e6}be.hrTimeToMilliseconds=rne;function one(t){return t[0]*1e6+t[1]/1e3}be.hrTimeToMicroseconds=one;function eA(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}be.isTimeInputHrTime=eA;function sne(t){return eA(t)||typeof t=="number"||t instanceof Date}be.isTimeInput=sne;function wU(t,e){let n=[t[0]+e[0],t[1]+e[1]];return n[1]>=y_&&(n[1]-=y_,n[0]+=1),n}be.addHrTimes=wU});var GU=E(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_.unrefTimer=void 0;function ine(t){typeof t!="number"&&t.unref()}I_.unrefTimer=ine});var BU=E(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.ExportResultCode=void 0;var ane;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(ane=Al.ExportResultCode||(Al.ExportResultCode={}))});var HU=E(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.CompositePropagator=void 0;var jU=(b(),N(v)),tA=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(e,n,r){for(let o of this._propagators)try{o.inject(e,n,r)}catch(s){jU.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,n,r){return this._propagators.reduce((o,s)=>{try{return s.extract(o,n,r)}catch(i){jU.diag.warn(`Failed to extract with ${s.constructor.name}. Err: ${i.message}`)}return o},e)}fields(){return this._fields.slice()}};N_.CompositePropagator=tA});var VU=E(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.validateValue=Wa.validateKey=void 0;var nA="[_0-9a-z-*/]",cne=`[a-z]${nA}{0,255}`,une=`[a-z0-9]${nA}{0,240}@[a-z]${nA}{0,13}`,lne=new RegExp(`^(?:${cne}|${une})$`),pne=/^[ -~]{0,255}[!-~]$/,dne=/,|=/;function _ne(t){return lne.test(t)}Wa.validateKey=_ne;function fne(t){return pne.test(t)&&!dne.test(t)}Wa.validateValue=fne});var oA=E(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.TraceState=void 0;var FU=VU(),qU=32,mne=512,$U=",",YU="=",rA=class t{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,n)=>(e.push(n+YU+this.get(n)),e),[]).join($U)}_parse(e){e.length>mne||(this._internalState=e.split($U).reverse().reduce((n,r)=>{let o=r.trim(),s=o.indexOf(YU);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);(0,FU.validateKey)(i)&&(0,FU.validateValue)(a)&&n.set(i,a)}return n},new Map),this._internalState.size>qU&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,qU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};O_.TraceState=rA});var zU=E(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.W3CTraceContextPropagator=Yt.parseTraceParent=Yt.TRACE_STATE_HEADER=Yt.TRACE_PARENT_HEADER=void 0;var b_=(b(),N(v)),Tne=El(),hne=oA();Yt.TRACE_PARENT_HEADER="traceparent";Yt.TRACE_STATE_HEADER="tracestate";var Ene="00",Sne="(?!ff)[\\da-f]{2}",gne="(?![0]{32})[\\da-f]{32}",Ane="(?![0]{16})[\\da-f]{16}",Rne="[\\da-f]{2}",yne=new RegExp(`^\\s?(${Sne})-(${gne})-(${Ane})-(${Rne})(-.*)?\\s?$`);function WU(t){let e=yne.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}Yt.parseTraceParent=WU;var sA=class{inject(e,n,r){let o=b_.trace.getSpanContext(e);if(!o||(0,Tne.isTracingSuppressed)(e)||!(0,b_.isSpanContextValid)(o))return;let s=`${Ene}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||b_.TraceFlags.NONE).toString(16)}`;r.set(n,Yt.TRACE_PARENT_HEADER,s),o.traceState&&r.set(n,Yt.TRACE_STATE_HEADER,o.traceState.serialize())}extract(e,n,r){let o=r.get(n,Yt.TRACE_PARENT_HEADER);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let i=WU(s);if(!i)return e;i.isRemote=!0;let a=r.get(n,Yt.TRACE_STATE_HEADER);if(a){let c=Array.isArray(a)?a.join(","):a;i.traceState=new hne.TraceState(typeof c=="string"?c:void 0)}return b_.trace.setSpanContext(e,i)}fields(){return[Yt.TRACE_PARENT_HEADER,Yt.TRACE_STATE_HEADER]}};Yt.W3CTraceContextPropagator=sA});var KU=E(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.getRPCMetadata=Sr.deleteRPCMetadata=Sr.setRPCMetadata=Sr.RPCType=void 0;var Ine=(b(),N(v)),iA=(0,Ine.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Nne;(function(t){t.HTTP="http"})(Nne=Sr.RPCType||(Sr.RPCType={}));function One(t,e){return t.setValue(iA,e)}Sr.setRPCMetadata=One;function bne(t){return t.deleteValue(iA)}Sr.deleteRPCMetadata=bne;function Cne(t){return t.getValue(iA)}Sr.getRPCMetadata=Cne});var ew=E(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.isPlainObject=void 0;var Pne="[object Object]",Mne="[object Null]",xne="[object Undefined]",vne=Function.prototype,QU=vne.toString,Lne=QU.call(Object),Dne=Object.getPrototypeOf,XU=Object.prototype,JU=XU.hasOwnProperty,Oi=Symbol?Symbol.toStringTag:void 0,ZU=XU.toString;function Une(t){if(!wne(t)||kne(t)!==Pne)return!1;let e=Dne(t);if(e===null)return!0;let n=JU.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&QU.call(n)===Lne}C_.isPlainObject=Une;function wne(t){return t!=null&&typeof t=="object"}function kne(t){return t==null?t===void 0?xne:Mne:Oi&&Oi in Object(t)?Gne(t):Bne(t)}function Gne(t){let e=JU.call(t,Oi),n=t[Oi],r=!1;try{t[Oi]=void 0,r=!0}catch{}let o=ZU.call(t);return r&&(e?t[Oi]=n:delete t[Oi]),o}function Bne(t){return ZU.call(t)}});var sw=E(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});x_.merge=void 0;var tw=ew(),jne=20;function Hne(...t){let e=t.shift(),n=new WeakMap;for(;t.length>0;)e=rw(e,t.shift(),0,n);return e}x_.merge=Hne;function aA(t){return M_(t)?t.slice():t}function rw(t,e,n=0,r){let o;if(!(n>jne)){if(n++,P_(t)||P_(e)||ow(e))o=aA(e);else if(M_(t)){if(o=t.slice(),M_(e))for(let s=0,i=e.length;s<i;s++)o.push(aA(e[s]));else if(Rl(e)){let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i];o[c]=aA(e[c])}}}else if(Rl(t))if(Rl(e)){if(!Vne(t,e))return e;o=Object.assign({},t);let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i],l=e[c];if(P_(l))typeof l>"u"?delete o[c]:o[c]=l;else{let p=o[c],d=l;if(nw(t,c,r)||nw(e,c,r))delete o[c];else{if(Rl(p)&&Rl(d)){let _=r.get(p)||[],f=r.get(d)||[];_.push({obj:t,key:c}),f.push({obj:e,key:c}),r.set(p,_),r.set(d,f)}o[c]=rw(o[c],l,n,r)}}}}else o=e;return o}}function nw(t,e,n){let r=n.get(t[e])||[];for(let o=0,s=r.length;o<s;o++){let i=r[o];if(i.key===e&&i.obj===t)return!0}return!1}function M_(t){return Array.isArray(t)}function ow(t){return typeof t=="function"}function Rl(t){return!P_(t)&&!M_(t)&&!ow(t)&&typeof t=="object"}function P_(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function Vne(t,e){return!(!(0,tw.isPlainObject)(t)||!(0,tw.isPlainObject)(e))}});var iw=E(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.callWithTimeout=za.TimeoutError=void 0;var v_=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};za.TimeoutError=v_;function Fne(t,e){let n,r=new Promise(function(s,i){n=setTimeout(function(){i(new v_("Operation timed out."))},e)});return Promise.race([t,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}za.callWithTimeout=Fne});var cw=E(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.isUrlIgnored=Ka.urlMatches=void 0;function aw(t,e){return typeof e=="string"?t===e:!!t.match(e)}Ka.urlMatches=aw;function qne(t,e){if(!e)return!1;for(let n of e)if(aw(t,n))return!0;return!1}Ka.isUrlIgnored=qne});var uw=E(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});L_.Deferred=void 0;var cA=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,n)=>{this._resolve=e,this._reject=n})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};L_.Deferred=cA});var lw=E(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});D_.BindOnceFuture=void 0;var $ne=uw(),uA=class{_isCalled=!1;_deferred=new $ne.Deferred;_callback;_that;constructor(e,n){this._callback=e,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};D_.BindOnceFuture=uA});var dw=E(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});U_.diagLogLevelFromString=void 0;var Oo=(b(),N(v)),pw={ALL:Oo.DiagLogLevel.ALL,VERBOSE:Oo.DiagLogLevel.VERBOSE,DEBUG:Oo.DiagLogLevel.DEBUG,INFO:Oo.DiagLogLevel.INFO,WARN:Oo.DiagLogLevel.WARN,ERROR:Oo.DiagLogLevel.ERROR,NONE:Oo.DiagLogLevel.NONE};function Yne(t){if(t==null)return;let e=pw[t.toUpperCase()];return e??(Oo.diag.warn(`Unknown log level "${t}", expected one of ${Object.keys(pw)}, using default`),Oo.DiagLogLevel.INFO)}U_.diagLogLevelFromString=Yne});var fw=E(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_._export=void 0;var _w=(b(),N(v)),Wne=El();function zne(t,e){return new Promise(n=>{_w.context.with((0,Wne.suppressTracing)(_w.context.active()),()=>{t.export(e,n)})})}w_._export=zne});var he=E(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.internal=y.diagLogLevelFromString=y.BindOnceFuture=y.urlMatches=y.isUrlIgnored=y.callWithTimeout=y.TimeoutError=y.merge=y.TraceState=y.unsuppressTracing=y.suppressTracing=y.isTracingSuppressed=y.setRPCMetadata=y.getRPCMetadata=y.deleteRPCMetadata=y.RPCType=y.parseTraceParent=y.W3CTraceContextPropagator=y.TRACE_STATE_HEADER=y.TRACE_PARENT_HEADER=y.CompositePropagator=y.otperformance=y.getStringListFromEnv=y.getNumberFromEnv=y.getBooleanFromEnv=y.getStringFromEnv=y._globalThis=y.SDK_INFO=y.parseKeyPairsIntoRecord=y.ExportResultCode=y.unrefTimer=y.timeInputToHrTime=y.millisToHrTime=y.isTimeInputHrTime=y.isTimeInput=y.hrTimeToTimeStamp=y.hrTimeToNanoseconds=y.hrTimeToMilliseconds=y.hrTimeToMicroseconds=y.hrTimeDuration=y.hrTime=y.getTimeOrigin=y.addHrTimes=y.loggingErrorHandler=y.setGlobalErrorHandler=y.globalErrorHandler=y.sanitizeAttributes=y.isAttributeValue=y.AnchoredClock=y.W3CBaggagePropagator=void 0;var Kne=QC();Object.defineProperty(y,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Kne.W3CBaggagePropagator}});var Qne=XC();Object.defineProperty(y,"AnchoredClock",{enumerable:!0,get:function(){return Qne.AnchoredClock}});var mw=nP();Object.defineProperty(y,"isAttributeValue",{enumerable:!0,get:function(){return mw.isAttributeValue}});Object.defineProperty(y,"sanitizeAttributes",{enumerable:!0,get:function(){return mw.sanitizeAttributes}});var Tw=oP();Object.defineProperty(y,"globalErrorHandler",{enumerable:!0,get:function(){return Tw.globalErrorHandler}});Object.defineProperty(y,"setGlobalErrorHandler",{enumerable:!0,get:function(){return Tw.setGlobalErrorHandler}});var Xne=yg();Object.defineProperty(y,"loggingErrorHandler",{enumerable:!0,get:function(){return Xne.loggingErrorHandler}});var zn=kU();Object.defineProperty(y,"addHrTimes",{enumerable:!0,get:function(){return zn.addHrTimes}});Object.defineProperty(y,"getTimeOrigin",{enumerable:!0,get:function(){return zn.getTimeOrigin}});Object.defineProperty(y,"hrTime",{enumerable:!0,get:function(){return zn.hrTime}});Object.defineProperty(y,"hrTimeDuration",{enumerable:!0,get:function(){return zn.hrTimeDuration}});Object.defineProperty(y,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return zn.hrTimeToMicroseconds}});Object.defineProperty(y,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return zn.hrTimeToMilliseconds}});Object.defineProperty(y,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return zn.hrTimeToNanoseconds}});Object.defineProperty(y,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return zn.hrTimeToTimeStamp}});Object.defineProperty(y,"isTimeInput",{enumerable:!0,get:function(){return zn.isTimeInput}});Object.defineProperty(y,"isTimeInputHrTime",{enumerable:!0,get:function(){return zn.isTimeInputHrTime}});Object.defineProperty(y,"millisToHrTime",{enumerable:!0,get:function(){return zn.millisToHrTime}});Object.defineProperty(y,"timeInputToHrTime",{enumerable:!0,get:function(){return zn.timeInputToHrTime}});var Jne=GU();Object.defineProperty(y,"unrefTimer",{enumerable:!0,get:function(){return Jne.unrefTimer}});var Zne=BU();Object.defineProperty(y,"ExportResultCode",{enumerable:!0,get:function(){return Zne.ExportResultCode}});var ere=Eg();Object.defineProperty(y,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return ere.parseKeyPairsIntoRecord}});var bi=Zg();Object.defineProperty(y,"SDK_INFO",{enumerable:!0,get:function(){return bi.SDK_INFO}});Object.defineProperty(y,"_globalThis",{enumerable:!0,get:function(){return bi._globalThis}});Object.defineProperty(y,"getStringFromEnv",{enumerable:!0,get:function(){return bi.getStringFromEnv}});Object.defineProperty(y,"getBooleanFromEnv",{enumerable:!0,get:function(){return bi.getBooleanFromEnv}});Object.defineProperty(y,"getNumberFromEnv",{enumerable:!0,get:function(){return bi.getNumberFromEnv}});Object.defineProperty(y,"getStringListFromEnv",{enumerable:!0,get:function(){return bi.getStringListFromEnv}});Object.defineProperty(y,"otperformance",{enumerable:!0,get:function(){return bi.otperformance}});var tre=HU();Object.defineProperty(y,"CompositePropagator",{enumerable:!0,get:function(){return tre.CompositePropagator}});var k_=zU();Object.defineProperty(y,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return k_.TRACE_PARENT_HEADER}});Object.defineProperty(y,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return k_.TRACE_STATE_HEADER}});Object.defineProperty(y,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return k_.W3CTraceContextPropagator}});Object.defineProperty(y,"parseTraceParent",{enumerable:!0,get:function(){return k_.parseTraceParent}});var G_=KU();Object.defineProperty(y,"RPCType",{enumerable:!0,get:function(){return G_.RPCType}});Object.defineProperty(y,"deleteRPCMetadata",{enumerable:!0,get:function(){return G_.deleteRPCMetadata}});Object.defineProperty(y,"getRPCMetadata",{enumerable:!0,get:function(){return G_.getRPCMetadata}});Object.defineProperty(y,"setRPCMetadata",{enumerable:!0,get:function(){return G_.setRPCMetadata}});var lA=El();Object.defineProperty(y,"isTracingSuppressed",{enumerable:!0,get:function(){return lA.isTracingSuppressed}});Object.defineProperty(y,"suppressTracing",{enumerable:!0,get:function(){return lA.suppressTracing}});Object.defineProperty(y,"unsuppressTracing",{enumerable:!0,get:function(){return lA.unsuppressTracing}});var nre=oA();Object.defineProperty(y,"TraceState",{enumerable:!0,get:function(){return nre.TraceState}});var rre=sw();Object.defineProperty(y,"merge",{enumerable:!0,get:function(){return rre.merge}});var hw=iw();Object.defineProperty(y,"TimeoutError",{enumerable:!0,get:function(){return hw.TimeoutError}});Object.defineProperty(y,"callWithTimeout",{enumerable:!0,get:function(){return hw.callWithTimeout}});var Ew=cw();Object.defineProperty(y,"isUrlIgnored",{enumerable:!0,get:function(){return Ew.isUrlIgnored}});Object.defineProperty(y,"urlMatches",{enumerable:!0,get:function(){return Ew.urlMatches}});var ore=lw();Object.defineProperty(y,"BindOnceFuture",{enumerable:!0,get:function(){return ore.BindOnceFuture}});var sre=dw();Object.defineProperty(y,"diagLogLevelFromString",{enumerable:!0,get:function(){return sre.diagLogLevelFromString}});var ire=fw();y.internal={_export:ire._export}});var Sw=E(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});B_.VERSION=void 0;B_.VERSION="0.214.0"});var gw=E(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.SeverityNumber=void 0;var are;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(are=yl.SeverityNumber||(yl.SeverityNumber={}))});var H_=E(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.NOOP_LOGGER=Qa.NoopLogger=void 0;var j_=class{emit(e){}};Qa.NoopLogger=j_;Qa.NOOP_LOGGER=new j_});var Aw=E(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.API_BACKWARDS_COMPATIBILITY_VERSION=Fr.makeGetter=Fr._global=Fr.GLOBAL_LOGS_API_KEY=void 0;Fr.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Fr._global=globalThis;function cre(t,e,n){return r=>r===t?e:n}Fr.makeGetter=cre;Fr.API_BACKWARDS_COMPATIBILITY_VERSION=1});var pA=E(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.NOOP_LOGGER_PROVIDER=Xa.NoopLoggerProvider=void 0;var ure=H_(),V_=class{getLogger(e,n,r){return new ure.NoopLogger}};Xa.NoopLoggerProvider=V_;Xa.NOOP_LOGGER_PROVIDER=new V_});var Rw=E(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.ProxyLogger=void 0;var lre=H_(),dA=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):lre.NOOP_LOGGER}};F_.ProxyLogger=dA});var yw=E(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.ProxyLoggerProvider=void 0;var pre=pA(),dre=Rw(),_A=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new dre.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:pre.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};q_.ProxyLoggerProvider=_A});var Nw=E($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});$_.LogsAPI=void 0;var Kn=Aw(),_re=pA(),Iw=yw(),fA=class t{constructor(){this._proxyLoggerProvider=new Iw.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Kn._global[Kn.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Kn._global[Kn.GLOBAL_LOGS_API_KEY]=(0,Kn.makeGetter)(Kn.API_BACKWARDS_COMPATIBILITY_VERSION,e,_re.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=Kn._global[Kn.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(Kn._global,Kn.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete Kn._global[Kn.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Iw.ProxyLoggerProvider}};$_.LogsAPI=fA});var mA=E(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.logs=qr.NoopLogger=qr.NOOP_LOGGER=qr.SeverityNumber=void 0;var fre=gw();Object.defineProperty(qr,"SeverityNumber",{enumerable:!0,get:function(){return fre.SeverityNumber}});var Ow=H_();Object.defineProperty(qr,"NOOP_LOGGER",{enumerable:!0,get:function(){return Ow.NOOP_LOGGER}});Object.defineProperty(qr,"NoopLogger",{enumerable:!0,get:function(){return Ow.NoopLogger}});var mre=Nw();qr.logs=mre.LogsAPI.getInstance()});var bw=E(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.disableInstrumentations=Ja.enableInstrumentations=void 0;function Tre(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Ja.enableInstrumentations=Tre;function hre(t){t.forEach(e=>e.disable())}Ja.disableInstrumentations=hre});var Mw=E(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});Y_.registerInstrumentations=void 0;var Cw=(b(),N(v)),Ere=mA(),Pw=bw();function Sre(t){let e=t.tracerProvider||Cw.trace.getTracerProvider(),n=t.meterProvider||Cw.metrics.getMeterProvider(),r=t.loggerProvider||Ere.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,Pw.enableInstrumentations)(o,e,n,r),()=>{(0,Pw.disableInstrumentations)(o)}}Y_.registerInstrumentations=Sre});var Bw=E(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});W_.satisfies=void 0;var SA=(b(),N(v)),Uw=/^(?: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-]+)*))?$/,gre=/^(?<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-]+)*))?$/,Are={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Rre(t,e,n){if(!yre(t))return SA.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=bre(t);if(!r)return!1;let o=[],s=ww(r,e,o,n);return s&&!n?.includePrerelease?Nre(r,o):s}W_.satisfies=Rre;function yre(t){return typeof t=="string"&&Uw.test(t)}function ww(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(TA(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=zre(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!TA(t,s,n,r))return!1;return!0}return TA(t,e,n,r)}function TA(t,e,n,r){if(e=Ore(e,r),e.includes(" "))return ww(t,e,n,r);{let o=Cre(e);return n.push(o),Ire(t,o)}}function Ire(t,e){if(e.invalid)return!1;if(!e.version||EA(e.version))return!0;let n=vw(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=vw(r,o)}return Are[e.op]?.includes(n)}function Nre(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function Ore(t,e){return t=t.trim(),t=Yre(t,e),t=$re(t),t=Wre(t,e),t=t.trim(),t}function rn(t){return!t||t.toLowerCase()==="x"||t==="*"}function bre(t){let e=t.match(Uw);if(!e){SA.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function Cre(t){if(!t)return{};let e=t.match(gre);if(!e)return SA.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function EA(t){return t==="*"||t==="x"||t==="X"}function xw(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Pre(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function Mre(t,e){if(EA(t)||EA(e))return 0;let[n,r]=Pre(xw(t),xw(e));return n>r?1:n<r?-1:0}function vw(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=Mre(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var kw="[a-zA-Z0-9-]",Gw="0|[1-9]\\d*",xre=`\\d*[a-zA-Z-]${kw}*`,vre="((?:<|>)?=?)",Lw=`(?:${Gw}|${xre})`,Lre=`(?:-(${Lw}(?:\\.${Lw})*))`,Dw=`${kw}+`,Dre=`(?:\\+(${Dw}(?:\\.${Dw})*))`,hA=`${Gw}|x|X|\\*`,Il=`[v=\\s]*(${hA})(?:\\.(${hA})(?:\\.(${hA})(?:${Lre})?${Dre}?)?)?`,Ure=`^${vre}\\s*${Il}$`,wre=new RegExp(Ure),kre=`^\\s*(${Il})\\s+-\\s+(${Il})\\s*$`,Gre=new RegExp(kre),Bre="(?:~>?)",jre=`^${Bre}${Il}$`,Hre=new RegExp(jre),Vre="(?:\\^)",Fre=`^${Vre}${Il}$`,qre=new RegExp(Fre);function $re(t){let e=Hre;return t.replace(e,(n,r,o,s,i)=>{let a;return rn(r)?a="":rn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:rn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function Yre(t,e){let n=qre,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let l;return rn(s)?l="":rn(i)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:rn(a)?s==="0"?l=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?l=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,l})}function Wre(t,e){let n=wre;return t.replace(n,(r,o,s,i,a,c)=>{let l=rn(s),p=l||rn(i),d=p||rn(a),_=d;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",l?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function zre(t,e){let n=Gre;return t.replace(n,(r,o,s,i,a,c,l,p,d,_,f,m)=>(rn(s)?o="":rn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:rn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,rn(d)?p="":rn(_)?p=`<${+d+1}.0.0-0`:rn(f)?p=`<${d}.${+_+1}.0-0`:m?p=`<=${d}.${_}.${f}-${m}`:e?.includePrerelease?p=`<${d}.${_}.${+f+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var gA=E(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.massUnwrap=Mt.unwrap=Mt.massWrap=Mt.wrap=void 0;var on=console.error.bind(console);function Nl(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var Kre=(t,e,n)=>{if(!t||!t[e]){on("no original function "+String(e)+" to wrap");return}if(!n){on("no wrapper function"),on(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){on("original object and wrapper must be functions");return}let o=n(r,e);return Nl(o,"__original",r),Nl(o,"__unwrap",()=>{t[e]===o&&Nl(t,e,r)}),Nl(o,"__wrapped",!0),Nl(t,e,o),o};Mt.wrap=Kre;var Qre=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{on("must provide one or more modules to patch"),on(new Error().stack);return}if(!(e&&Array.isArray(e))){on("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Mt.wrap)(r,o,n)})})};Mt.massWrap=Qre;var Xre=(t,e)=>{if(!t||!t[e]){on("no function to unwrap."),on(new Error().stack);return}let n=t[e];if(!n.__unwrap)on("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Mt.unwrap=Xre;var Jre=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{on("must provide one or more modules to patch"),on(new Error().stack);return}if(!(e&&Array.isArray(e))){on("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Mt.unwrap)(n,r)})})};Mt.massUnwrap=Jre;function Ol(t){t&&t.logger&&(typeof t.logger!="function"?on("new logger isn't a function, not replacing"):on=t.logger)}Mt.default=Ol;Ol.wrap=Mt.wrap;Ol.massWrap=Mt.massWrap;Ol.unwrap=Mt.unwrap;Ol.massUnwrap=Mt.massUnwrap});var jw=E(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});K_.InstrumentationAbstract=void 0;var AA=(b(),N(v)),Zre=mA(),z_=gA(),RA=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=AA.diag.createComponentLogger({namespace:e}),this._tracer=AA.trace.getTracer(e,n),this._meter=AA.metrics.getMeter(e,n),this._logger=Zre.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=z_.wrap;_unwrap=z_.unwrap;_massWrap=z_.massWrap;_massUnwrap=z_.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};K_.InstrumentationAbstract=RA});var Vw=E((hve,Hw)=>{var Za=1e3,ec=Za*60,tc=ec*60,Ci=tc*24,eoe=Ci*7,toe=Ci*365.25;Hw.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return noe(t);if(n==="number"&&isFinite(t))return e.long?ooe(t):roe(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function noe(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*toe;case"weeks":case"week":case"w":return n*eoe;case"days":case"day":case"d":return n*Ci;case"hours":case"hour":case"hrs":case"hr":case"h":return n*tc;case"minutes":case"minute":case"mins":case"min":case"m":return n*ec;case"seconds":case"second":case"secs":case"sec":case"s":return n*Za;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function roe(t){var e=Math.abs(t);return e>=Ci?Math.round(t/Ci)+"d":e>=tc?Math.round(t/tc)+"h":e>=ec?Math.round(t/ec)+"m":e>=Za?Math.round(t/Za)+"s":t+"ms"}function ooe(t){var e=Math.abs(t);return e>=Ci?Q_(t,e,Ci,"day"):e>=tc?Q_(t,e,tc,"hour"):e>=ec?Q_(t,e,ec,"minute"):e>=Za?Q_(t,e,Za,"second"):t+" ms"}function Q_(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}});var yA=E((Eve,Fw)=>{function soe(t){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Vw(),n.destroy=l,Object.keys(t).forEach(p=>{n[p]=t[p]}),n.names=[],n.skips=[],n.formatters={};function e(p){let d=0;for(let _=0;_<p.length;_++)d=(d<<5)-d+p.charCodeAt(_),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=e;function n(p){let d,_=null,f,m;function T(...h){if(!T.enabled)return;let S=T,R=Number(new Date),I=R-(d||R);S.diff=I,S.prev=d,S.curr=R,d=R,h[0]=n.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let x=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(B,se)=>{if(B==="%%")return"%";x++;let ve=n.formatters[se];if(typeof ve=="function"){let nn=h[x];B=ve.call(S,nn),h.splice(x,1),x--}return B}),n.formatArgs.call(S,h),(S.log||n.log).apply(S,h)}return T.namespace=p,T.useColors=n.useColors(),T.color=n.selectColor(p),T.extend=r,T.destroy=n.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(f!==n.namespaces&&(f=n.namespaces,m=n.enabled(p)),m),set:h=>{_=h}}),typeof n.init=="function"&&n.init(T),T}function r(p,d){let _=n(this.namespace+(typeof d>"u"?":":d)+p);return _.log=this.log,_}function o(p){n.save(p),n.namespaces=p,n.names=[],n.skips=[];let d=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of d)_[0]==="-"?n.skips.push(_.slice(1)):n.names.push(_)}function s(p,d){let _=0,f=0,m=-1,T=0;for(;_<p.length;)if(f<d.length&&(d[f]===p[_]||d[f]==="*"))d[f]==="*"?(m=f,T=_,f++):(_++,f++);else if(m!==-1)f=m+1,T++,_=T;else return!1;for(;f<d.length&&d[f]==="*";)f++;return f===d.length}function i(){let p=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),p}function a(p){for(let d of n.skips)if(s(p,d))return!1;for(let d of n.names)if(s(p,d))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Fw.exports=soe});var qw=E((En,X_)=>{En.formatArgs=aoe;En.save=coe;En.load=uoe;En.useColors=ioe;En.storage=loe();En.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();En.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"];function ioe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function aoe(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+X_.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),t.splice(r,0,e)}En.log=console.debug||console.log||(()=>{});function coe(t){try{t?En.storage.setItem("debug",t):En.storage.removeItem("debug")}catch{}}function uoe(){let t;try{t=En.storage.getItem("debug")||En.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function loe(){try{return localStorage}catch{}}X_.exports=yA()(En);var{formatters:poe}=X_.exports;poe.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Yw=E((Sve,$w)=>{"use strict";$w.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),o=e.indexOf("--");return r!==-1&&(o===-1||r<o)}});var Kw=E((gve,zw)=>{"use strict";var doe=U("os"),Ww=U("tty"),Qn=Yw(),{env:St}=process,os;Qn("no-color")||Qn("no-colors")||Qn("color=false")||Qn("color=never")?os=0:(Qn("color")||Qn("colors")||Qn("color=true")||Qn("color=always"))&&(os=1);"FORCE_COLOR"in St&&(St.FORCE_COLOR==="true"?os=1:St.FORCE_COLOR==="false"?os=0:os=St.FORCE_COLOR.length===0?1:Math.min(parseInt(St.FORCE_COLOR,10),3));function IA(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function NA(t,e){if(os===0)return 0;if(Qn("color=16m")||Qn("color=full")||Qn("color=truecolor"))return 3;if(Qn("color=256"))return 2;if(t&&!e&&os===void 0)return 0;let n=os||0;if(St.TERM==="dumb")return n;if(process.platform==="win32"){let r=doe.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in St)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in St)||St.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in St)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(St.TEAMCITY_VERSION)?1:0;if(St.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in St){let r=parseInt((St.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(St.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(St.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(St.TERM)||"COLORTERM"in St?1:n}function _oe(t){let e=NA(t,t&&t.isTTY);return IA(e)}zw.exports={supportsColor:_oe,stdout:IA(NA(!0,Ww.isatty(1))),stderr:IA(NA(!0,Ww.isatty(2)))}});var Xw=E((gt,Z_)=>{var foe=U("tty"),J_=U("util");gt.init=Aoe;gt.log=Eoe;gt.formatArgs=Toe;gt.save=Soe;gt.load=goe;gt.useColors=moe;gt.destroy=J_.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gt.colors=[6,2,3,4,5,1];try{let t=Kw();t&&(t.stderr||t).level>=2&&(gt.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{}gt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function moe(){return"colors"in gt.inspectOpts?!!gt.inspectOpts.colors:foe.isatty(process.stderr.fd)}function Toe(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
2
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
3
+ var G9=Object.create;var o_=Object.defineProperty;var B9=Object.getOwnPropertyDescriptor;var j9=Object.getOwnPropertyNames;var H9=Object.getPrototypeOf,F9=Object.prototype.hasOwnProperty;var U=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var z=(t,e)=>()=>(t&&(e=t(t=0)),e);var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),sg=(t,e)=>{for(var n in e)o_(t,n,{get:e[n],enumerable:!0})},kC=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j9(e))!F9.call(t,o)&&o!==n&&o_(t,o,{get:()=>e[o],enumerable:!(r=B9(e,o))||r.enumerable});return t};var K=(t,e,n)=>(n=t!=null?G9(H9(t)):{},kC(e||!t||!t.__esModule?o_(n,"default",{value:t,enumerable:!0}):n,t)),O=t=>kC(o_({},"__esModule",{value:!0}),t);var Oo,ig=z(()=>{Oo="1.9.1"});function V9(t){let e=new Set([t]),n=new Set,r=t.match(GC);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(c){return c===t};function s(a){return n.add(a),!1}function i(a){return e.add(a),!0}return function(c){if(e.has(c))return!0;if(n.has(c))return!1;let l=c.match(GC);if(!l)return s(c);let p={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return p.prerelease!=null||o.major!==p.major?s(c):o.major===0?o.minor===p.minor&&o.patch<=p.patch?i(c):s(c):o.minor<=p.minor?i(c):s(c)}}var GC,BC,jC=z(()=>{ig();GC=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;BC=V9(Oo)});function jr(t,e,n,r=!1){var o;let s=Sl[El]=(o=Sl[El])!==null&&o!==void 0?o:{version:Oo};if(!r&&s[t]){let i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return n.error(i.stack||i.message),!1}if(s.version!==Oo){let i=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${Oo}`);return n.error(i.stack||i.message),!1}return s[t]=e,n.debug(`@opentelemetry/api: Registered a global for ${t} v${Oo}.`),!0}function Dn(t){var e,n;let r=(e=Sl[El])===null||e===void 0?void 0:e.version;if(!(!r||!BC(r)))return(n=Sl[El])===null||n===void 0?void 0:n[t]}function Hr(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${Oo}.`);let n=Sl[El];n&&delete n[t]}var q9,El,Sl,Ii=z(()=>{ig();jC();q9=Oo.split(".")[0],El=Symbol.for(`opentelemetry.js.api.${q9}`),Sl=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function gl(t,e,n){let r=Dn("diag");if(r)return r[t](e,...n)}var s_,HC=z(()=>{Ii();s_=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return gl("debug",this._namespace,e)}error(...e){return gl("error",this._namespace,e)}info(...e){return gl("info",this._namespace,e)}warn(...e){return gl("warn",this._namespace,e)}verbose(...e){return gl("verbose",this._namespace,e)}}});var dt,i_=z(()=>{(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"})(dt||(dt={}))});function FC(t,e){t<dt.NONE?t=dt.NONE:t>dt.ALL&&(t=dt.ALL),e=e||{};function n(r,o){let s=e[r];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return{error:n("error",dt.ERROR),warn:n("warn",dt.WARN),info:n("info",dt.INFO),debug:n("debug",dt.DEBUG),verbose:n("verbose",dt.VERBOSE)}}var VC=z(()=>{i_()});var $9,St,Oi=z(()=>{HC();VC();i_();Ii();$9="diag",St=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(o){return function(...s){let i=Dn("diag");if(i)return i[o](...s)}}let n=this,r=(o,s={logLevel:dt.INFO})=>{var i,a,c;if(o===n){let d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=d.stack)!==null&&i!==void 0?i:d.message),!1}typeof s=="number"&&(s={logLevel:s});let l=Dn("diag"),p=FC((a=s.logLevel)!==null&&a!==void 0?a:dt.INFO,o);if(l&&!s.suppressOverrideMessage){let d=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";l.warn(`Current logger will be overwritten from ${d}`),p.warn(`Current logger will overwrite one already registered from ${d}`)}return jr("diag",p,n,!0)};n.setLogger=r,n.disable=()=>{Hr($9,n)},n.createComponentLogger=o=>new s_(o),n.verbose=e("verbose"),n.debug=e("debug"),n.info=e("info"),n.warn=e("warn"),n.error=e("error")}}});var a_,qC=z(()=>{a_=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let n=this._entries.get(e);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,n){let r=new t(this._entries);return r._entries.set(e,n),r}removeEntry(e){let n=new t(this._entries);return n._entries.delete(e),n}removeEntries(...e){let n=new t(this._entries);for(let r of e)n._entries.delete(r);return n}clear(){return new t}}});var $C,YC=z(()=>{$C=Symbol("BaggageEntryMetadata")});function WC(t={}){return new a_(new Map(Object.entries(t)))}function zC(t){return typeof t!="string"&&(Y9.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:$C,toString(){return t}}}var Y9,ag=z(()=>{Oi();qC();YC();Y9=St.instance()});function Un(t){return Symbol.for(t)}var cg,Wa,Al=z(()=>{cg=class t{constructor(e){let n=this;n._currentContext=e?new Map(e):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let s=new t(n._currentContext);return s._currentContext.set(r,o),s},n.deleteValue=r=>{let o=new t(n._currentContext);return o._currentContext.delete(r),o}}},Wa=new cg});var ug,lg,c_,KC=z(()=>{ug=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],lg={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(lg[e]=console[e])}c_=class{constructor(){function e(n){return function(...r){let o=lg[n];if(typeof o!="function"&&(o=lg.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<ug.length;n++)this[ug[n].n]=e(ug[n].c)}}});function QC(){return Sg}var pg,za,dg,_g,fg,mg,Rl,hg,Tg,Eg,Sg,W9,z9,K9,Q9,X9,J9,Z9,gg=z(()=>{pg=class{constructor(){}createGauge(e,n){return z9}createHistogram(e,n){return K9}createCounter(e,n){return W9}createUpDownCounter(e,n){return Q9}createObservableGauge(e,n){return J9}createObservableCounter(e,n){return X9}createObservableUpDownCounter(e,n){return Z9}addBatchObservableCallback(e,n){}removeBatchObservableCallback(e){}},za=class{},dg=class extends za{add(e,n){}},_g=class extends za{add(e,n){}},fg=class extends za{record(e,n){}},mg=class extends za{record(e,n){}},Rl=class{addCallback(e){}removeCallback(e){}},hg=class extends Rl{},Tg=class extends Rl{},Eg=class extends Rl{},Sg=new pg,W9=new dg,z9=new fg,K9=new mg,Q9=new _g,X9=new hg,J9=new Tg,Z9=new Eg});var u_,XC=z(()=>{(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(u_||(u_={}))});var l_,p_,Ag=z(()=>{l_={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},p_={set(t,e,n){t!=null&&(t[e]=n)}}});var d_,JC=z(()=>{Al();d_=class{active(){return Wa}with(e,n,r,...o){return n.call(r,...o)}bind(e,n){return n}enable(){return this}disable(){return this}}});var Rg,eQ,Fr,yl=z(()=>{JC();Ii();Oi();Rg="context",eQ=new d_,Fr=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return jr(Rg,e,St.instance())}active(){return this._getContextManager().active()}with(e,n,r,...o){return this._getContextManager().with(e,n,r,...o)}bind(e,n){return this._getContextManager().bind(e,n)}_getContextManager(){return Dn(Rg)||eQ}disable(){this._getContextManager().disable(),Hr(Rg,St.instance())}}});var Vt,yg=z(()=>{(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Vt||(Vt={}))});var Il,Ni,__,f_=z(()=>{yg();Il="0000000000000000",Ni="00000000000000000000000000000000",__={traceId:Ni,spanId:Il,traceFlags:Vt.NONE}});var Vr,m_=z(()=>{f_();Vr=class{constructor(e=__){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,n){return this}setAttributes(e){return this}addEvent(e,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,n){}}});function h_(t){return t.getValue(Ig)||void 0}function ZC(){return h_(Fr.getInstance().active())}function Ol(t,e){return t.setValue(Ig,e)}function eP(t){return t.deleteValue(Ig)}function tP(t,e){return Ol(t,new Vr(e))}function T_(t){var e;return(e=h_(t))===null||e===void 0?void 0:e.spanContext()}var Ig,Og=z(()=>{Al();m_();yl();Ig=Un("OpenTelemetry Context Key SPAN")});function nP(t,e){if(typeof t!="string"||t.length!==e)return!1;let n=0;for(let r=0;r<t.length;r+=4)n+=(E_[t.charCodeAt(r)]|0)+(E_[t.charCodeAt(r+1)]|0)+(E_[t.charCodeAt(r+2)]|0)+(E_[t.charCodeAt(r+3)]|0);return n===e}function Ng(t){return nP(t,32)&&t!==Ni}function bg(t){return nP(t,16)&&t!==Il}function No(t){return Ng(t.traceId)&&bg(t.spanId)}function rP(t){return new Vr(t)}var E_,S_=z(()=>{f_();m_();E_=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 tQ(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var Cg,Ka,Pg=z(()=>{yl();Og();m_();S_();Cg=Fr.getInstance(),Ka=class{startSpan(e,n,r=Cg.active()){if(!!n?.root)return new Vr;let s=r&&T_(r);return tQ(s)&&No(s)?new Vr(s):new Vr}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??Cg.active(),l=this.startSpan(e,s,c),p=Ol(c,l);return Cg.with(p,a,void 0,l)}}});var nQ,Qa,Mg=z(()=>{Pg();nQ=new Ka,Qa=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}startSpan(e,n,r){return this._getTracer().startSpan(e,n,r)}startActiveSpan(e,n,r,o){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):nQ}}});var g_,oP=z(()=>{Pg();g_=class{getTracer(e,n,r){return new Ka}}});var rQ,bi,xg=z(()=>{Mg();oP();rQ=new g_,bi=class{getTracer(e,n,r){var o;return(o=this.getDelegateTracer(e,n,r))!==null&&o!==void 0?o:new Qa(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:rQ}setDelegate(e){this._delegate=e}getDelegateTracer(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,n,r)}}});var A_,sP=z(()=>{(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(A_||(A_={}))});var Ne,iP=z(()=>{(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"})(Ne||(Ne={}))});var Be,aP=z(()=>{(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Be||(Be={}))});function cP(t){return iQ.test(t)}function uP(t){return aQ.test(t)&&!cQ.test(t)}var vg,oQ,sQ,iQ,aQ,cQ,lP=z(()=>{vg="[_0-9a-z-*/]",oQ=`[a-z]${vg}{0,255}`,sQ=`[a-z0-9]${vg}{0,240}@[a-z]${vg}{0,13}`,iQ=new RegExp(`^(?:${oQ}|${sQ})$`),aQ=/^[ -~]{0,255}[!-~]$/,cQ=/,|=/});var pP,uQ,dP,_P,R_,fP=z(()=>{lP();pP=32,uQ=512,dP=",",_P="=",R_=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,n)=>(e.push(n+_P+this.get(n)),e),[]).join(dP)}_parse(e){e.length>uQ||(this._internalState=e.split(dP).reduceRight((n,r)=>{let o=r.trim(),s=o.indexOf(_P);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);cP(i)&&uP(a)&&n.set(i,a)}return n},new Map),this._internalState.size>pP&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,pP))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function mP(t){return new R_(t)}var hP=z(()=>{fP()});var P,TP=z(()=>{yl();P=Fr.getInstance()});var wn,EP=z(()=>{Oi();wn=St.instance()});var Lg,SP,gP=z(()=>{gg();Lg=class{getMeter(e,n,r){return Sg}},SP=new Lg});var Dg,y_,AP=z(()=>{gP();Ii();Oi();Dg="metrics",y_=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return jr(Dg,e,St.instance())}getMeterProvider(){return Dn(Dg)||SP}getMeter(e,n,r){return this.getMeterProvider().getMeter(e,n,r)}disable(){Hr(Dg,St.instance())}}});var Ug,RP=z(()=>{AP();Ug=y_.getInstance()});var I_,yP=z(()=>{I_=class{inject(e,n){}extract(e,n){return e}fields(){return[]}}});function kg(t){return t.getValue(wg)||void 0}function IP(){return kg(Fr.getInstance().active())}function OP(t,e){return t.setValue(wg,e)}function NP(t){return t.deleteValue(wg)}var wg,bP=z(()=>{yl();Al();wg=Un("OpenTelemetry Baggage Key")});var Gg,lQ,O_,CP=z(()=>{Ii();yP();Ag();bP();ag();Oi();Gg="propagation",lQ=new I_,O_=class t{constructor(){this.createBaggage=WC,this.getBaggage=kg,this.getActiveBaggage=IP,this.setBaggage=OP,this.deleteBaggage=NP}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return jr(Gg,e,St.instance())}inject(e,n,r=p_){return this._getGlobalPropagator().inject(e,n,r)}extract(e,n,r=l_){return this._getGlobalPropagator().extract(e,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Hr(Gg,St.instance())}_getGlobalPropagator(){return Dn(Gg)||lQ}}});var Ar,PP=z(()=>{CP();Ar=O_.getInstance()});var Bg,N_,MP=z(()=>{Ii();xg();S_();Og();Oi();Bg="trace",N_=class t{constructor(){this._proxyTracerProvider=new bi,this.wrapSpanContext=rP,this.isSpanContextValid=No,this.deleteSpan=eP,this.getSpan=h_,this.getActiveSpan=ZC,this.getSpanContext=T_,this.setSpan=Ol,this.setSpanContext=tP}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let n=jr(Bg,this._proxyTracerProvider,St.instance());return n&&this._proxyTracerProvider.setDelegate(e),n}getTracerProvider(){return Dn(Bg)||this._proxyTracerProvider}getTracer(e,n){return this.getTracerProvider().getTracer(e,n)}disable(){Hr(Bg,St.instance()),this._proxyTracerProvider=new bi}}});var X,xP=z(()=>{MP();X=N_.getInstance()});var v={};sg(v,{DiagConsoleLogger:()=>c_,DiagLogLevel:()=>dt,INVALID_SPANID:()=>Il,INVALID_SPAN_CONTEXT:()=>__,INVALID_TRACEID:()=>Ni,ProxyTracer:()=>Qa,ProxyTracerProvider:()=>bi,ROOT_CONTEXT:()=>Wa,SamplingDecision:()=>A_,SpanKind:()=>Ne,SpanStatusCode:()=>Be,TraceFlags:()=>Vt,ValueType:()=>u_,baggageEntryMetadataFromString:()=>zC,context:()=>P,createContextKey:()=>Un,createNoopMeter:()=>QC,createTraceState:()=>mP,default:()=>pQ,defaultTextMapGetter:()=>l_,defaultTextMapSetter:()=>p_,diag:()=>wn,isSpanContextValid:()=>No,isValidSpanId:()=>bg,isValidTraceId:()=>Ng,metrics:()=>Ug,propagation:()=>Ar,trace:()=>X});var pQ,b=z(()=>{ag();Al();KC();i_();gg();XC();Ag();Mg();xg();sP();iP();aP();yg();hP();S_();f_();TP();EP();RP();PP();xP();pQ={context:P,diag:wn,metrics:Ug,propagation:Ar,trace:X}});var Nl=E(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.isTracingSuppressed=is.unsuppressTracing=is.suppressTracing=void 0;var dQ=(b(),O(v)),jg=(0,dQ.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function _Q(t){return t.setValue(jg,!0)}is.suppressTracing=_Q;function fQ(t){return t.deleteValue(jg)}is.unsuppressTracing=fQ;function mQ(t){return t.getValue(jg)===!0}is.isTracingSuppressed=mQ});var Hg=E(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.BAGGAGE_MAX_TOTAL_LENGTH=qt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=qt.BAGGAGE_MAX_NAME_VALUE_PAIRS=qt.BAGGAGE_HEADER=qt.BAGGAGE_ITEMS_SEPARATOR=qt.BAGGAGE_PROPERTIES_SEPARATOR=qt.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;qt.BAGGAGE_KEY_PAIR_SEPARATOR="=";qt.BAGGAGE_PROPERTIES_SEPARATOR=";";qt.BAGGAGE_ITEMS_SEPARATOR=",";qt.BAGGAGE_HEADER="baggage";qt.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;qt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;qt.BAGGAGE_MAX_TOTAL_LENGTH=8192});var Fg=E(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.parseKeyPairsIntoRecord=qr.parsePairKeyValue=qr.getKeyPairs=qr.serializeKeyPairs=void 0;var hQ=(b(),O(v)),Xa=Hg();function TQ(t){return t.reduce((e,n)=>{let r=`${e}${e!==""?Xa.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Xa.BAGGAGE_MAX_TOTAL_LENGTH?e:r},"")}qr.serializeKeyPairs=TQ;function EQ(t){return t.getAllEntries().map(([e,n])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Xa.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}qr.getKeyPairs=EQ;function vP(t){if(!t)return;let e=t.indexOf(Xa.BAGGAGE_PROPERTIES_SEPARATOR),n=e===-1?t:t.substring(0,e),r=n.indexOf(Xa.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),s=n.substring(r+1).trim();if(!o||!s)return;let i,a;try{i=decodeURIComponent(o),a=decodeURIComponent(s)}catch{return}let c;if(e!==-1&&e<t.length-1){let l=t.substring(e+1);c=(0,hQ.baggageEntryMetadataFromString)(l)}return{key:i,value:a,metadata:c}}qr.parsePairKeyValue=vP;function SQ(t){let e={};return typeof t=="string"&&t.length>0&&t.split(Xa.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=vP(n);r!==void 0&&r.value.length>0&&(e[r.key]=r.value)}),e}qr.parseKeyPairsIntoRecord=SQ});var LP=E(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});b_.W3CBaggagePropagator=void 0;var Vg=(b(),O(v)),gQ=Nl(),Ci=Hg(),qg=Fg(),$g=class{inject(e,n,r){let o=Vg.propagation.getBaggage(e);if(!o||(0,gQ.isTracingSuppressed)(e))return;let s=(0,qg.getKeyPairs)(o).filter(a=>a.length<=Ci.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Ci.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,qg.serializeKeyPairs)(s);i.length>0&&r.set(n,Ci.BAGGAGE_HEADER,i)}extract(e,n,r){let o=r.get(n,Ci.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(Ci.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let i={};return s.length===0||(s.split(Ci.BAGGAGE_ITEMS_SEPARATOR).forEach(c=>{let l=(0,qg.parsePairKeyValue)(c);if(l){let p={value:l.value};l.metadata&&(p.metadata=l.metadata),i[l.key]=p}}),Object.entries(i).length===0)?e:Vg.propagation.setBaggage(e,Vg.propagation.createBaggage(i))}fields(){return[Ci.BAGGAGE_HEADER]}};b_.W3CBaggagePropagator=$g});var DP=E(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.AnchoredClock=void 0;var Yg=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,n){this._monotonicClock=n,this._epochMillis=e.now(),this._performanceMillis=n.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};C_.AnchoredClock=Yg});var BP=E(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.isAttributeValue=as.isAttributeKey=as.sanitizeAttributes=void 0;var UP=(b(),O(v));function AQ(t){let e={};if(typeof t!="object"||t==null)return e;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(!wP(n)){UP.diag.warn(`Invalid attribute key: ${n}`);continue}let r=t[n];if(!kP(r)){UP.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?e[n]=r.slice():e[n]=r}return e}as.sanitizeAttributes=AQ;function wP(t){return typeof t=="string"&&t!==""}as.isAttributeKey=wP;function kP(t){return t==null?!0:Array.isArray(t)?RQ(t):GP(typeof t)}as.isAttributeValue=kP;function RQ(t){let e;for(let n of t){if(n==null)continue;let r=typeof n;if(r!==e){if(!e){if(GP(r)){e=r;continue}return!1}return!1}}return!0}function GP(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}});var Wg=E(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});P_.loggingErrorHandler=void 0;var yQ=(b(),O(v));function IQ(){return t=>{yQ.diag.error(OQ(t))}}P_.loggingErrorHandler=IQ;function OQ(t){return typeof t=="string"?t:JSON.stringify(NQ(t))}function NQ(t){let e={},n=t;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(e[r])return;let o=n[r];o&&(e[r]=String(o))}),n=Object.getPrototypeOf(n);return e}});var HP=E(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.globalErrorHandler=Ja.setGlobalErrorHandler=void 0;var bQ=Wg(),jP=(0,bQ.loggingErrorHandler)();function CQ(t){jP=t}Ja.setGlobalErrorHandler=CQ;function PQ(t){try{jP(t)}catch{}}Ja.globalErrorHandler=PQ});var $P=E($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.getStringListFromEnv=$r.getBooleanFromEnv=$r.getStringFromEnv=$r.getNumberFromEnv=void 0;var FP=(b(),O(v)),VP=U("util");function MQ(t){let e=process.env[t];if(e==null||e.trim()==="")return;let n=Number(e);if(isNaN(n)){FP.diag.warn(`Unknown value ${(0,VP.inspect)(e)} for ${t}, expected a number, using defaults`);return}return n}$r.getNumberFromEnv=MQ;function qP(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}$r.getStringFromEnv=qP;function xQ(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||FP.diag.warn(`Unknown value ${(0,VP.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}$r.getBooleanFromEnv=xQ;function vQ(t){return qP(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}$r.getStringListFromEnv=vQ});var YP=E(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});M_._globalThis=void 0;M_._globalThis=globalThis});var WP=E(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});x_.VERSION=void 0;x_.VERSION="2.6.1"});function We(t){let e={},n=t.length;for(let r=0;r<n;r++){let o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var zg=z(()=>{});var zP,KP,QP,XP,JP,ZP,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,pM,dM,_M,fM,mM,hM,TM,EM,SM,gM,AM,RM,yM,IM,OM,NM,bM,CM,PM,MM,xM,vM,LM,DM,UM,wM,kM,GM,BM,jM,HM,FM,VM,qM,$M,YM,WM,zM,KM,QM,XM,JM,ZM,ex,tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,px,dx,_x,fx,mx,hx,Tx,Ex,Sx,gx,Ax,Rx,yx,Ix,Ox,Nx,bx,Cx,Px,Mx,xx,vx,Lx,Dx,Ux,wx,kx,Gx,Bx,jx,Hx,Fx,Vx,qx,$x,Yx,Wx,zx,Kx,Qx,Xx,Jx,Zx,ev,tv,nv,rv,ov,sv,iv,av,cv,uv,lv,pv,dv,_v,LQ,Kg,DQ,UQ,wQ,kQ,Qg,GQ,BQ,jQ,HQ,FQ,VQ,qQ,$Q,YQ,WQ,zQ,KQ,QQ,XQ,JQ,ZQ,eX,tX,Xg,nX,rX,oX,sX,iX,aX,cX,uX,lX,pX,dX,_X,Jg,fX,mX,Zg,eA,hX,TX,EX,SX,gX,AX,RX,yX,IX,OX,NX,bX,CX,PX,MX,xX,vX,bl,Za,tA,LX,DX,Pi,UX,wX,kX,GX,nA,rA,BX,oA,jX,HX,FX,VX,qX,$X,YX,WX,zX,KX,QX,XX,JX,ZX,eJ,tJ,nJ,rJ,oJ,sJ,iJ,aJ,cJ,sA,uJ,lJ,pJ,dJ,_J,fJ,mJ,hJ,TJ,EJ,SJ,gJ,AJ,RJ,yJ,IJ,OJ,NJ,bJ,iA,CJ,aA,PJ,MJ,xJ,vJ,LJ,DJ,UJ,wJ,kJ,fv,mv,hv,Tv,Ev,Sv,gv,Av,Rv,yv,Iv,Ov,Nv,bv,Cv,Pv,Mv,xv,vv,Lv,Dv,Uv,wv,kv,Gv,Bv,jv,Hv,Fv,Vv,qv,$v,Yv,Wv,zv,Kv,Qv,Xv,Jv,Zv,eL,tL,nL,rL,oL,sL,iL,GJ,BJ,jJ,HJ,FJ,VJ,qJ,$J,YJ,WJ,zJ,KJ,QJ,XJ,JJ,ZJ,e5,t5,n5,r5,o5,s5,i5,a5,c5,u5,l5,p5,d5,_5,f5,m5,h5,T5,E5,S5,g5,A5,R5,y5,I5,O5,N5,b5,C5,P5,M5,x5,aL,cL,uL,lL,pL,dL,_L,fL,mL,hL,TL,v5,L5,D5,U5,w5,k5,G5,B5,j5,H5,F5,V5,EL,SL,gL,AL,RL,q5,$5,Y5,W5,z5,K5,yL,IL,OL,Q5,X5,J5,Z5,NL,bL,CL,PL,eZ,tZ,nZ,rZ,oZ,ML,xL,vL,LL,DL,UL,wL,sZ,iZ,aZ,cZ,uZ,lZ,pZ,dZ,kL,GL,BL,jL,HL,_Z,fZ,mZ,hZ,TZ,EZ,FL,VL,qL,$L,YL,WL,zL,KL,QL,XL,JL,ZL,e0,t0,n0,r0,o0,s0,i0,a0,c0,SZ,gZ,AZ,RZ,yZ,IZ,OZ,NZ,bZ,CZ,PZ,MZ,xZ,vZ,LZ,DZ,UZ,wZ,kZ,GZ,BZ,jZ,u0,l0,p0,d0,_0,HZ,FZ,VZ,qZ,$Z,YZ,f0,m0,WZ,zZ,KZ,h0,T0,QZ,XZ,JZ,E0,S0,g0,A0,R0,y0,I0,O0,N0,b0,C0,P0,M0,x0,v0,L0,D0,ZZ,e6,t6,n6,r6,o6,s6,i6,a6,c6,u6,l6,p6,d6,_6,f6,m6,h6,U0,w0,T6,E6,S6,k0=z(()=>{zg();zP="aws.lambda.invoked_arn",KP="db.system",QP="db.connection_string",XP="db.user",JP="db.jdbc.driver_classname",ZP="db.name",eM="db.statement",tM="db.operation",nM="db.mssql.instance_name",rM="db.cassandra.keyspace",oM="db.cassandra.page_size",sM="db.cassandra.consistency_level",iM="db.cassandra.table",aM="db.cassandra.idempotence",cM="db.cassandra.speculative_execution_count",uM="db.cassandra.coordinator.id",lM="db.cassandra.coordinator.dc",pM="db.hbase.namespace",dM="db.redis.database_index",_M="db.mongodb.collection",fM="db.sql.table",mM="exception.type",hM="exception.message",TM="exception.stacktrace",EM="exception.escaped",SM="faas.trigger",gM="faas.execution",AM="faas.document.collection",RM="faas.document.operation",yM="faas.document.time",IM="faas.document.name",OM="faas.time",NM="faas.cron",bM="faas.coldstart",CM="faas.invoked_name",PM="faas.invoked_provider",MM="faas.invoked_region",xM="net.transport",vM="net.peer.ip",LM="net.peer.port",DM="net.peer.name",UM="net.host.ip",wM="net.host.port",kM="net.host.name",GM="net.host.connection.type",BM="net.host.connection.subtype",jM="net.host.carrier.name",HM="net.host.carrier.mcc",FM="net.host.carrier.mnc",VM="net.host.carrier.icc",qM="peer.service",$M="enduser.id",YM="enduser.role",WM="enduser.scope",zM="thread.id",KM="thread.name",QM="code.function",XM="code.namespace",JM="code.filepath",ZM="code.lineno",ex="http.method",tx="http.url",nx="http.target",rx="http.host",ox="http.scheme",sx="http.status_code",ix="http.flavor",ax="http.user_agent",cx="http.request_content_length",ux="http.request_content_length_uncompressed",lx="http.response_content_length",px="http.response_content_length_uncompressed",dx="http.server_name",_x="http.route",fx="http.client_ip",mx="aws.dynamodb.table_names",hx="aws.dynamodb.consumed_capacity",Tx="aws.dynamodb.item_collection_metrics",Ex="aws.dynamodb.provisioned_read_capacity",Sx="aws.dynamodb.provisioned_write_capacity",gx="aws.dynamodb.consistent_read",Ax="aws.dynamodb.projection",Rx="aws.dynamodb.limit",yx="aws.dynamodb.attributes_to_get",Ix="aws.dynamodb.index_name",Ox="aws.dynamodb.select",Nx="aws.dynamodb.global_secondary_indexes",bx="aws.dynamodb.local_secondary_indexes",Cx="aws.dynamodb.exclusive_start_table",Px="aws.dynamodb.table_count",Mx="aws.dynamodb.scan_forward",xx="aws.dynamodb.segment",vx="aws.dynamodb.total_segments",Lx="aws.dynamodb.count",Dx="aws.dynamodb.scanned_count",Ux="aws.dynamodb.attribute_definitions",wx="aws.dynamodb.global_secondary_index_updates",kx="messaging.system",Gx="messaging.destination",Bx="messaging.destination_kind",jx="messaging.temp_destination",Hx="messaging.protocol",Fx="messaging.protocol_version",Vx="messaging.url",qx="messaging.message_id",$x="messaging.conversation_id",Yx="messaging.message_payload_size_bytes",Wx="messaging.message_payload_compressed_size_bytes",zx="messaging.operation",Kx="messaging.consumer_id",Qx="messaging.rabbitmq.routing_key",Xx="messaging.kafka.message_key",Jx="messaging.kafka.consumer_group",Zx="messaging.kafka.client_id",ev="messaging.kafka.partition",tv="messaging.kafka.tombstone",nv="rpc.system",rv="rpc.service",ov="rpc.method",sv="rpc.grpc.status_code",iv="rpc.jsonrpc.version",av="rpc.jsonrpc.request_id",cv="rpc.jsonrpc.error_code",uv="rpc.jsonrpc.error_message",lv="message.type",pv="message.id",dv="message.compressed_size",_v="message.uncompressed_size",LQ=zP,Kg=KP,DQ=QP,UQ=XP,wQ=JP,kQ=ZP,Qg=eM,GQ=tM,BQ=nM,jQ=rM,HQ=oM,FQ=sM,VQ=iM,qQ=aM,$Q=cM,YQ=uM,WQ=lM,zQ=pM,KQ=dM,QQ=_M,XQ=fM,JQ=mM,ZQ=hM,eX=TM,tX=EM,Xg=SM,nX=gM,rX=AM,oX=RM,sX=yM,iX=IM,aX=OM,cX=NM,uX=bM,lX=CM,pX=PM,dX=MM,_X=xM,Jg=vM,fX=LM,mX=DM,Zg=UM,eA=wM,hX=kM,TX=GM,EX=BM,SX=jM,gX=HM,AX=FM,RX=VM,yX=qM,IX=$M,OX=YM,NX=WM,bX=zM,CX=KM,PX=QM,MX=XM,xX=JM,vX=ZM,bl=ex,Za=tx,tA=nx,LX=rx,DX=ox,Pi=sx,UX=ix,wX=ax,kX=cx,GX=ux,nA=lx,rA=px,BX=dx,oA=_x,jX=fx,HX=mx,FX=hx,VX=Tx,qX=Ex,$X=Sx,YX=gx,WX=Ax,zX=Rx,KX=yx,QX=Ix,XX=Ox,JX=Nx,ZX=bx,eJ=Cx,tJ=Px,nJ=Mx,rJ=xx,oJ=vx,sJ=Lx,iJ=Dx,aJ=Ux,cJ=wx,sA=kx,uJ=Gx,lJ=Bx,pJ=jx,dJ=Hx,_J=Fx,fJ=Vx,mJ=qx,hJ=$x,TJ=Yx,EJ=Wx,SJ=zx,gJ=Kx,AJ=Qx,RJ=Xx,yJ=Jx,IJ=Zx,OJ=ev,NJ=tv,bJ=nv,iA=rv,CJ=ov,aA=sv,PJ=iv,MJ=av,xJ=cv,vJ=uv,LJ=lv,DJ=pv,UJ=dv,wJ=_v,kJ=We([zP,KP,QP,XP,JP,ZP,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,pM,dM,_M,fM,mM,hM,TM,EM,SM,gM,AM,RM,yM,IM,OM,NM,bM,CM,PM,MM,xM,vM,LM,DM,UM,wM,kM,GM,BM,jM,HM,FM,VM,qM,$M,YM,WM,zM,KM,QM,XM,JM,ZM,ex,tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,px,dx,_x,fx,mx,hx,Tx,Ex,Sx,gx,Ax,Rx,yx,Ix,Ox,Nx,bx,Cx,Px,Mx,xx,vx,Lx,Dx,Ux,wx,kx,Gx,Bx,jx,Hx,Fx,Vx,qx,$x,Yx,Wx,zx,Kx,Qx,Xx,Jx,Zx,ev,tv,nv,rv,ov,sv,iv,av,cv,uv,lv,pv,dv,_v]),fv="other_sql",mv="mssql",hv="mysql",Tv="oracle",Ev="db2",Sv="postgresql",gv="redshift",Av="hive",Rv="cloudscape",yv="hsqldb",Iv="progress",Ov="maxdb",Nv="hanadb",bv="ingres",Cv="firstsql",Pv="edb",Mv="cache",xv="adabas",vv="firebird",Lv="derby",Dv="filemaker",Uv="informix",wv="instantdb",kv="interbase",Gv="mariadb",Bv="netezza",jv="pervasive",Hv="pointbase",Fv="sqlite",Vv="sybase",qv="teradata",$v="vertica",Yv="h2",Wv="coldfusion",zv="cassandra",Kv="hbase",Qv="mongodb",Xv="redis",Jv="couchbase",Zv="couchdb",eL="cosmosdb",tL="dynamodb",nL="neo4j",rL="geode",oL="elasticsearch",sL="memcached",iL="cockroachdb",GJ=fv,BJ=mv,jJ=hv,HJ=Tv,FJ=Ev,VJ=Sv,qJ=gv,$J=Av,YJ=Rv,WJ=yv,zJ=Iv,KJ=Ov,QJ=Nv,XJ=bv,JJ=Cv,ZJ=Pv,e5=Mv,t5=xv,n5=vv,r5=Lv,o5=Dv,s5=Uv,i5=wv,a5=kv,c5=Gv,u5=Bv,l5=jv,p5=Hv,d5=Fv,_5=Vv,f5=qv,m5=$v,h5=Yv,T5=Wv,E5=zv,S5=Kv,g5=Qv,A5=Xv,R5=Jv,y5=Zv,I5=eL,O5=tL,N5=nL,b5=rL,C5=oL,P5=sL,M5=iL,x5=We([fv,mv,hv,Tv,Ev,Sv,gv,Av,Rv,yv,Iv,Ov,Nv,bv,Cv,Pv,Mv,xv,vv,Lv,Dv,Uv,wv,kv,Gv,Bv,jv,Hv,Fv,Vv,qv,$v,Yv,Wv,zv,Kv,Qv,Xv,Jv,Zv,eL,tL,nL,rL,oL,sL,iL]),aL="all",cL="each_quorum",uL="quorum",lL="local_quorum",pL="one",dL="two",_L="three",fL="local_one",mL="any",hL="serial",TL="local_serial",v5=aL,L5=cL,D5=uL,U5=lL,w5=pL,k5=dL,G5=_L,B5=fL,j5=mL,H5=hL,F5=TL,V5=We([aL,cL,uL,lL,pL,dL,_L,fL,mL,hL,TL]),EL="datasource",SL="http",gL="pubsub",AL="timer",RL="other",q5=EL,$5=SL,Y5=gL,W5=AL,z5=RL,K5=We([EL,SL,gL,AL,RL]),yL="insert",IL="edit",OL="delete",Q5=yL,X5=IL,J5=OL,Z5=We([yL,IL,OL]),NL="alibaba_cloud",bL="aws",CL="azure",PL="gcp",eZ=NL,tZ=bL,nZ=CL,rZ=PL,oZ=We([NL,bL,CL,PL]),ML="ip_tcp",xL="ip_udp",vL="ip",LL="unix",DL="pipe",UL="inproc",wL="other",sZ=ML,iZ=xL,aZ=vL,cZ=LL,uZ=DL,lZ=UL,pZ=wL,dZ=We([ML,xL,vL,LL,DL,UL,wL]),kL="wifi",GL="wired",BL="cell",jL="unavailable",HL="unknown",_Z=kL,fZ=GL,mZ=BL,hZ=jL,TZ=HL,EZ=We([kL,GL,BL,jL,HL]),FL="gprs",VL="edge",qL="umts",$L="cdma",YL="evdo_0",WL="evdo_a",zL="cdma2000_1xrtt",KL="hsdpa",QL="hsupa",XL="hspa",JL="iden",ZL="evdo_b",e0="lte",t0="ehrpd",n0="hspap",r0="gsm",o0="td_scdma",s0="iwlan",i0="nr",a0="nrnsa",c0="lte_ca",SZ=FL,gZ=VL,AZ=qL,RZ=$L,yZ=YL,IZ=WL,OZ=zL,NZ=KL,bZ=QL,CZ=XL,PZ=JL,MZ=ZL,xZ=e0,vZ=t0,LZ=n0,DZ=r0,UZ=o0,wZ=s0,kZ=i0,GZ=a0,BZ=c0,jZ=We([FL,VL,qL,$L,YL,WL,zL,KL,QL,XL,JL,ZL,e0,t0,n0,r0,o0,s0,i0,a0,c0]),u0="1.0",l0="1.1",p0="2.0",d0="SPDY",_0="QUIC",HZ=u0,FZ=l0,VZ=p0,qZ=d0,$Z=_0,YZ={HTTP_1_0:u0,HTTP_1_1:l0,HTTP_2_0:p0,SPDY:d0,QUIC:_0},f0="queue",m0="topic",WZ=f0,zZ=m0,KZ=We([f0,m0]),h0="receive",T0="process",QZ=h0,XZ=T0,JZ=We([h0,T0]),E0=0,S0=1,g0=2,A0=3,R0=4,y0=5,I0=6,O0=7,N0=8,b0=9,C0=10,P0=11,M0=12,x0=13,v0=14,L0=15,D0=16,ZZ=E0,e6=S0,t6=g0,n6=A0,r6=R0,o6=y0,s6=I0,i6=O0,a6=N0,c6=b0,u6=C0,l6=P0,p6=M0,d6=x0,_6=v0,f6=L0,m6=D0,h6={OK:E0,CANCELLED:S0,UNKNOWN:g0,INVALID_ARGUMENT:A0,DEADLINE_EXCEEDED:R0,NOT_FOUND:y0,ALREADY_EXISTS:I0,PERMISSION_DENIED:O0,RESOURCE_EXHAUSTED:N0,FAILED_PRECONDITION:b0,ABORTED:C0,OUT_OF_RANGE:P0,UNIMPLEMENTED:M0,INTERNAL:x0,UNAVAILABLE:v0,DATA_LOSS:L0,UNAUTHENTICATED:D0},U0="SENT",w0="RECEIVED",T6=U0,E6=w0,S6=We([U0,w0])});var G0=z(()=>{k0()});var B0,j0,H0,F0,V0,q0,$0,Y0,W0,z0,K0,Q0,X0,J0,Z0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,pD,dD,_D,fD,mD,hD,TD,ED,SD,gD,AD,RD,yD,ID,OD,ND,bD,CD,PD,MD,xD,vD,LD,DD,UD,wD,kD,GD,BD,jD,HD,FD,VD,qD,$D,YD,WD,zD,KD,QD,XD,JD,ZD,eU,tU,nU,rU,oU,sU,iU,aU,cU,uU,lU,pU,g6,A6,R6,y6,I6,O6,N6,b6,C6,P6,M6,x6,v6,L6,D6,U6,w6,k6,G6,B6,j6,H6,F6,V6,q6,$6,Y6,W6,z6,K6,Q6,X6,J6,Z6,e8,t8,n8,r8,o8,s8,i8,a8,c8,u8,l8,p8,d8,_8,f8,m8,h8,T8,E8,S8,g8,A8,R8,y8,I8,O8,N8,b8,C8,P8,M8,x8,v8,L8,D8,U8,w8,cA,k8,G8,B8,j8,H8,F8,V8,q8,$8,Y8,dU,_U,fU,mU,W8,z8,K8,Q8,X8,hU,TU,EU,SU,gU,AU,RU,yU,IU,OU,NU,bU,CU,PU,MU,xU,vU,J8,Z8,e7,t7,n7,r7,o7,s7,i7,a7,c7,u7,l7,p7,d7,_7,f7,m7,LU,DU,h7,T7,E7,UU,wU,kU,GU,BU,jU,HU,S7,g7,A7,R7,y7,I7,O7,N7,FU,VU,qU,$U,YU,WU,zU,KU,QU,XU,JU,b7,C7,P7,M7,x7,v7,L7,D7,U7,w7,k7,G7,ZU,ew,tw,nw,rw,ow,sw,iw,aw,cw,B7,j7,H7,F7,V7,q7,$7,Y7,W7,z7,K7,uw=z(()=>{zg();B0="cloud.provider",j0="cloud.account.id",H0="cloud.region",F0="cloud.availability_zone",V0="cloud.platform",q0="aws.ecs.container.arn",$0="aws.ecs.cluster.arn",Y0="aws.ecs.launchtype",W0="aws.ecs.task.arn",z0="aws.ecs.task.family",K0="aws.ecs.task.revision",Q0="aws.eks.cluster.arn",X0="aws.log.group.names",J0="aws.log.group.arns",Z0="aws.log.stream.names",eD="aws.log.stream.arns",tD="container.name",nD="container.id",rD="container.runtime",oD="container.image.name",sD="container.image.tag",iD="deployment.environment",aD="device.id",cD="device.model.identifier",uD="device.model.name",lD="faas.name",pD="faas.id",dD="faas.version",_D="faas.instance",fD="faas.max_memory",mD="host.id",hD="host.name",TD="host.type",ED="host.arch",SD="host.image.name",gD="host.image.id",AD="host.image.version",RD="k8s.cluster.name",yD="k8s.node.name",ID="k8s.node.uid",OD="k8s.namespace.name",ND="k8s.pod.uid",bD="k8s.pod.name",CD="k8s.container.name",PD="k8s.replicaset.uid",MD="k8s.replicaset.name",xD="k8s.deployment.uid",vD="k8s.deployment.name",LD="k8s.statefulset.uid",DD="k8s.statefulset.name",UD="k8s.daemonset.uid",wD="k8s.daemonset.name",kD="k8s.job.uid",GD="k8s.job.name",BD="k8s.cronjob.uid",jD="k8s.cronjob.name",HD="os.type",FD="os.description",VD="os.name",qD="os.version",$D="process.pid",YD="process.executable.name",WD="process.executable.path",zD="process.command",KD="process.command_line",QD="process.command_args",XD="process.owner",JD="process.runtime.name",ZD="process.runtime.version",eU="process.runtime.description",tU="service.name",nU="service.namespace",rU="service.instance.id",oU="service.version",sU="telemetry.sdk.name",iU="telemetry.sdk.language",aU="telemetry.sdk.version",cU="telemetry.auto.version",uU="webengine.name",lU="webengine.version",pU="webengine.description",g6=B0,A6=j0,R6=H0,y6=F0,I6=V0,O6=q0,N6=$0,b6=Y0,C6=W0,P6=z0,M6=K0,x6=Q0,v6=X0,L6=J0,D6=Z0,U6=eD,w6=tD,k6=nD,G6=rD,B6=oD,j6=sD,H6=iD,F6=aD,V6=cD,q6=uD,$6=lD,Y6=pD,W6=dD,z6=_D,K6=fD,Q6=mD,X6=hD,J6=TD,Z6=ED,e8=SD,t8=gD,n8=AD,r8=RD,o8=yD,s8=ID,i8=OD,a8=ND,c8=bD,u8=CD,l8=PD,p8=MD,d8=xD,_8=vD,f8=LD,m8=DD,h8=UD,T8=wD,E8=kD,S8=GD,g8=BD,A8=jD,R8=HD,y8=FD,I8=VD,O8=qD,N8=$D,b8=YD,C8=WD,P8=zD,M8=KD,x8=QD,v8=XD,L8=JD,D8=ZD,U8=eU,w8=tU,cA=nU,k8=rU,G8=oU,B8=sU,j8=iU,H8=aU,F8=cU,V8=uU,q8=lU,$8=pU,Y8=We([B0,j0,H0,F0,V0,q0,$0,Y0,W0,z0,K0,Q0,X0,J0,Z0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,pD,dD,_D,fD,mD,hD,TD,ED,SD,gD,AD,RD,yD,ID,OD,ND,bD,CD,PD,MD,xD,vD,LD,DD,UD,wD,kD,GD,BD,jD,HD,FD,VD,qD,$D,YD,WD,zD,KD,QD,XD,JD,ZD,eU,tU,nU,rU,oU,sU,iU,aU,cU,uU,lU,pU]),dU="alibaba_cloud",_U="aws",fU="azure",mU="gcp",W8=dU,z8=_U,K8=fU,Q8=mU,X8=We([dU,_U,fU,mU]),hU="alibaba_cloud_ecs",TU="alibaba_cloud_fc",EU="aws_ec2",SU="aws_ecs",gU="aws_eks",AU="aws_lambda",RU="aws_elastic_beanstalk",yU="azure_vm",IU="azure_container_instances",OU="azure_aks",NU="azure_functions",bU="azure_app_service",CU="gcp_compute_engine",PU="gcp_cloud_run",MU="gcp_kubernetes_engine",xU="gcp_cloud_functions",vU="gcp_app_engine",J8=hU,Z8=TU,e7=EU,t7=SU,n7=gU,r7=AU,o7=RU,s7=yU,i7=IU,a7=OU,c7=NU,u7=bU,l7=CU,p7=PU,d7=MU,_7=xU,f7=vU,m7=We([hU,TU,EU,SU,gU,AU,RU,yU,IU,OU,NU,bU,CU,PU,MU,xU,vU]),LU="ec2",DU="fargate",h7=LU,T7=DU,E7=We([LU,DU]),UU="amd64",wU="arm32",kU="arm64",GU="ia64",BU="ppc32",jU="ppc64",HU="x86",S7=UU,g7=wU,A7=kU,R7=GU,y7=BU,I7=jU,O7=HU,N7=We([UU,wU,kU,GU,BU,jU,HU]),FU="windows",VU="linux",qU="darwin",$U="freebsd",YU="netbsd",WU="openbsd",zU="dragonflybsd",KU="hpux",QU="aix",XU="solaris",JU="z_os",b7=FU,C7=VU,P7=qU,M7=$U,x7=YU,v7=WU,L7=zU,D7=KU,U7=QU,w7=XU,k7=JU,G7=We([FU,VU,qU,$U,YU,WU,zU,KU,QU,XU,JU]),ZU="cpp",ew="dotnet",tw="erlang",nw="go",rw="java",ow="nodejs",sw="php",iw="python",aw="ruby",cw="webjs",B7=ZU,j7=ew,H7=tw,F7=nw,V7=rw,q7=ow,$7=sw,Y7=iw,W7=aw,z7=cw,K7=We([ZU,ew,tw,nw,rw,ow,sw,iw,aw,cw])});var lw=z(()=>{uw()});var Q7,X7,J7,Z7,eee,tee,nee,ree,oee,see,iee,aee,cee,uee,lee,pee,dee,_ee,fee,mee,hee,Tee,Eee,See,gee,uA,lA,Aee,ec,Ree,pA,dA,yee,Mi,Iee,Oee,Nee,bee,Cee,Pee,Mee,xee,vee,Lee,_A,Dee,Uee,wee,kee,Gee,Bee,xi,jee,Hee,Fee,Vee,qee,$ee,Yee,Wee,zee,Kee,Qee,Xee,Jee,bo,Co,Zee,ete,tte,nte,rte,ote,ste,ite,ate,cte,ute,lte,pte,dte,_te,fte,fA,mA,mte,hA,TA,hte,Tte,Ete,Ste,gte,Ate,Rte,yte,Ite,Ote,Nte,bte,Cte,Pte,EA,SA,Mte,gA,xte,AA,vte,Lte,Dte,Ute,wte,kte,Gte,Bte,jte,Hte,Fte,Vte,qte,$te,Yte,Wte,zte,Kte,Qte,Xte,Jte,Zte,ene,tne,cs,nne,rne,one,RA,pw=z(()=>{Q7="aspnetcore.diagnostics.exception.result",X7="aborted",J7="handled",Z7="skipped",eee="unhandled",tee="aspnetcore.diagnostics.handler.type",nee="aspnetcore.rate_limiting.policy",ree="aspnetcore.rate_limiting.result",oee="acquired",see="endpoint_limiter",iee="global_limiter",aee="request_canceled",cee="aspnetcore.request.is_unhandled",uee="aspnetcore.routing.is_fallback",lee="aspnetcore.routing.match_status",pee="failure",dee="success",_ee="aspnetcore.user.is_authenticated",fee="client.address",mee="client.port",hee="code.column.number",Tee="code.file.path",Eee="code.function.name",See="code.line.number",gee="code.stacktrace",uA="db.collection.name",lA="db.namespace",Aee="db.operation.batch.size",ec="db.operation.name",Ree="db.query.summary",pA="db.query.text",dA="db.response.status_code",yee="db.stored_procedure.name",Mi="db.system.name",Iee="mariadb",Oee="microsoft.sql_server",Nee="mysql",bee="postgresql",Cee="dotnet.gc.heap.generation",Pee="gen0",Mee="gen1",xee="gen2",vee="loh",Lee="poh",_A="error.type",Dee="_OTHER",Uee="exception.escaped",wee="exception.message",kee="exception.stacktrace",Gee="exception.type",Bee=t=>`http.request.header.${t}`,xi="http.request.method",jee="_OTHER",Hee="CONNECT",Fee="DELETE",Vee="GET",qee="HEAD",$ee="OPTIONS",Yee="PATCH",Wee="POST",zee="PUT",Kee="TRACE",Qee="http.request.method_original",Xee="http.request.resend_count",Jee=t=>`http.response.header.${t}`,bo="http.response.status_code",Co="http.route",Zee="jvm.gc.action",ete="jvm.gc.name",tte="jvm.memory.pool.name",nte="jvm.memory.type",rte="heap",ote="non_heap",ste="jvm.thread.daemon",ite="jvm.thread.state",ate="blocked",cte="new",ute="runnable",lte="terminated",pte="timed_waiting",dte="waiting",_te="network.local.address",fte="network.local.port",fA="network.peer.address",mA="network.peer.port",mte="network.protocol.name",hA="network.protocol.version",TA="network.transport",hte="pipe",Tte="quic",Ete="tcp",Ste="udp",gte="unix",Ate="network.type",Rte="ipv4",yte="ipv6",Ite="otel.scope.name",Ote="otel.scope.version",Nte="otel.status_code",bte="ERROR",Cte="OK",Pte="otel.status_description",EA="server.address",SA="server.port",Mte="service.instance.id",gA="service.name",xte="service.namespace",AA="service.version",vte="signalr.connection.status",Lte="app_shutdown",Dte="normal_closure",Ute="timeout",wte="signalr.transport",kte="long_polling",Gte="server_sent_events",Bte="web_sockets",jte="telemetry.sdk.language",Hte="cpp",Fte="dotnet",Vte="erlang",qte="go",$te="java",Yte="nodejs",Wte="php",zte="python",Kte="ruby",Qte="rust",Xte="swift",Jte="webjs",Zte="telemetry.sdk.name",ene="telemetry.sdk.version",tne="url.fragment",cs="url.full",nne="url.path",rne="url.query",one="url.scheme",RA="user_agent.original"});var sne,ine,ane,cne,une,lne,pne,dne,_ne,fne,mne,hne,Tne,Ene,Sne,gne,Ane,Rne,yne,Ine,One,Nne,bne,Cne,Pne,Mne,xne,vne,Lne,Dne,Une,wne,kne,Gne,Bne,jne,Hne,Fne,Vne,qne,$ne,Yne,Wne,zne,Kne,Qne,Xne,Jne,Zne,ere,tre,dw=z(()=>{sne="aspnetcore.diagnostics.exceptions",ine="aspnetcore.rate_limiting.active_request_leases",ane="aspnetcore.rate_limiting.queued_requests",cne="aspnetcore.rate_limiting.request.time_in_queue",une="aspnetcore.rate_limiting.request_lease.duration",lne="aspnetcore.rate_limiting.requests",pne="aspnetcore.routing.match_attempts",dne="db.client.operation.duration",_ne="dotnet.assembly.count",fne="dotnet.exceptions",mne="dotnet.gc.collections",hne="dotnet.gc.heap.total_allocated",Tne="dotnet.gc.last_collection.heap.fragmentation.size",Ene="dotnet.gc.last_collection.heap.size",Sne="dotnet.gc.last_collection.memory.committed_size",gne="dotnet.gc.pause.time",Ane="dotnet.jit.compilation.time",Rne="dotnet.jit.compiled_il.size",yne="dotnet.jit.compiled_methods",Ine="dotnet.monitor.lock_contentions",One="dotnet.process.cpu.count",Nne="dotnet.process.cpu.time",bne="dotnet.process.memory.working_set",Cne="dotnet.thread_pool.queue.length",Pne="dotnet.thread_pool.thread.count",Mne="dotnet.thread_pool.work_item.count",xne="dotnet.timer.count",vne="http.client.request.duration",Lne="http.server.request.duration",Dne="jvm.class.count",Une="jvm.class.loaded",wne="jvm.class.unloaded",kne="jvm.cpu.count",Gne="jvm.cpu.recent_utilization",Bne="jvm.cpu.time",jne="jvm.gc.duration",Hne="jvm.memory.committed",Fne="jvm.memory.limit",Vne="jvm.memory.used",qne="jvm.memory.used_after_last_gc",$ne="jvm.thread.count",Yne="kestrel.active_connections",Wne="kestrel.active_tls_handshakes",zne="kestrel.connection.duration",Kne="kestrel.queued_connections",Qne="kestrel.queued_requests",Xne="kestrel.rejected_connections",Jne="kestrel.tls_handshake.duration",Zne="kestrel.upgraded_connections",ere="signalr.server.active_connections",tre="signalr.server.connection.duration"});var nre,_w=z(()=>{nre="exception"});var Ae={};sg(Ae,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>X7,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>J7,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Z7,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>eee,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>oee,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>see,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>iee,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>aee,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>pee,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>dee,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Q7,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>tee,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>nee,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>ree,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>cee,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>uee,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>lee,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>_ee,ATTR_CLIENT_ADDRESS:()=>fee,ATTR_CLIENT_PORT:()=>mee,ATTR_CODE_COLUMN_NUMBER:()=>hee,ATTR_CODE_FILE_PATH:()=>Tee,ATTR_CODE_FUNCTION_NAME:()=>Eee,ATTR_CODE_LINE_NUMBER:()=>See,ATTR_CODE_STACKTRACE:()=>gee,ATTR_DB_COLLECTION_NAME:()=>uA,ATTR_DB_NAMESPACE:()=>lA,ATTR_DB_OPERATION_BATCH_SIZE:()=>Aee,ATTR_DB_OPERATION_NAME:()=>ec,ATTR_DB_QUERY_SUMMARY:()=>Ree,ATTR_DB_QUERY_TEXT:()=>pA,ATTR_DB_RESPONSE_STATUS_CODE:()=>dA,ATTR_DB_STORED_PROCEDURE_NAME:()=>yee,ATTR_DB_SYSTEM_NAME:()=>Mi,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Cee,ATTR_ERROR_TYPE:()=>_A,ATTR_EXCEPTION_ESCAPED:()=>Uee,ATTR_EXCEPTION_MESSAGE:()=>wee,ATTR_EXCEPTION_STACKTRACE:()=>kee,ATTR_EXCEPTION_TYPE:()=>Gee,ATTR_HTTP_REQUEST_HEADER:()=>Bee,ATTR_HTTP_REQUEST_METHOD:()=>xi,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Qee,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Xee,ATTR_HTTP_RESPONSE_HEADER:()=>Jee,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>bo,ATTR_HTTP_ROUTE:()=>Co,ATTR_JVM_GC_ACTION:()=>Zee,ATTR_JVM_GC_NAME:()=>ete,ATTR_JVM_MEMORY_POOL_NAME:()=>tte,ATTR_JVM_MEMORY_TYPE:()=>nte,ATTR_JVM_THREAD_DAEMON:()=>ste,ATTR_JVM_THREAD_STATE:()=>ite,ATTR_NETWORK_LOCAL_ADDRESS:()=>_te,ATTR_NETWORK_LOCAL_PORT:()=>fte,ATTR_NETWORK_PEER_ADDRESS:()=>fA,ATTR_NETWORK_PEER_PORT:()=>mA,ATTR_NETWORK_PROTOCOL_NAME:()=>mte,ATTR_NETWORK_PROTOCOL_VERSION:()=>hA,ATTR_NETWORK_TRANSPORT:()=>TA,ATTR_NETWORK_TYPE:()=>Ate,ATTR_OTEL_SCOPE_NAME:()=>Ite,ATTR_OTEL_SCOPE_VERSION:()=>Ote,ATTR_OTEL_STATUS_CODE:()=>Nte,ATTR_OTEL_STATUS_DESCRIPTION:()=>Pte,ATTR_SERVER_ADDRESS:()=>EA,ATTR_SERVER_PORT:()=>SA,ATTR_SERVICE_INSTANCE_ID:()=>Mte,ATTR_SERVICE_NAME:()=>gA,ATTR_SERVICE_NAMESPACE:()=>xte,ATTR_SERVICE_VERSION:()=>AA,ATTR_SIGNALR_CONNECTION_STATUS:()=>vte,ATTR_SIGNALR_TRANSPORT:()=>wte,ATTR_TELEMETRY_SDK_LANGUAGE:()=>jte,ATTR_TELEMETRY_SDK_NAME:()=>Zte,ATTR_TELEMETRY_SDK_VERSION:()=>ene,ATTR_URL_FRAGMENT:()=>tne,ATTR_URL_FULL:()=>cs,ATTR_URL_PATH:()=>nne,ATTR_URL_QUERY:()=>rne,ATTR_URL_SCHEME:()=>one,ATTR_USER_AGENT_ORIGINAL:()=>RA,AWSECSLAUNCHTYPEVALUES_EC2:()=>h7,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>T7,AwsEcsLaunchtypeValues:()=>E7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>J8,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Z8,CLOUDPLATFORMVALUES_AWS_EC2:()=>e7,CLOUDPLATFORMVALUES_AWS_ECS:()=>t7,CLOUDPLATFORMVALUES_AWS_EKS:()=>n7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>o7,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>r7,CLOUDPLATFORMVALUES_AZURE_AKS:()=>a7,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>u7,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>i7,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>c7,CLOUDPLATFORMVALUES_AZURE_VM:()=>s7,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>f7,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>_7,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>p7,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>l7,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>d7,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>W8,CLOUDPROVIDERVALUES_AWS:()=>z8,CLOUDPROVIDERVALUES_AZURE:()=>K8,CLOUDPROVIDERVALUES_GCP:()=>Q8,CloudPlatformValues:()=>m7,CloudProviderValues:()=>X8,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>v5,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>j5,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>L5,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>B5,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>U5,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>F5,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>w5,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>D5,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>H5,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>G5,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>k5,DBSYSTEMVALUES_ADABAS:()=>t5,DBSYSTEMVALUES_CACHE:()=>e5,DBSYSTEMVALUES_CASSANDRA:()=>E5,DBSYSTEMVALUES_CLOUDSCAPE:()=>YJ,DBSYSTEMVALUES_COCKROACHDB:()=>M5,DBSYSTEMVALUES_COLDFUSION:()=>T5,DBSYSTEMVALUES_COSMOSDB:()=>I5,DBSYSTEMVALUES_COUCHBASE:()=>R5,DBSYSTEMVALUES_COUCHDB:()=>y5,DBSYSTEMVALUES_DB2:()=>FJ,DBSYSTEMVALUES_DERBY:()=>r5,DBSYSTEMVALUES_DYNAMODB:()=>O5,DBSYSTEMVALUES_EDB:()=>ZJ,DBSYSTEMVALUES_ELASTICSEARCH:()=>C5,DBSYSTEMVALUES_FILEMAKER:()=>o5,DBSYSTEMVALUES_FIREBIRD:()=>n5,DBSYSTEMVALUES_FIRSTSQL:()=>JJ,DBSYSTEMVALUES_GEODE:()=>b5,DBSYSTEMVALUES_H2:()=>h5,DBSYSTEMVALUES_HANADB:()=>QJ,DBSYSTEMVALUES_HBASE:()=>S5,DBSYSTEMVALUES_HIVE:()=>$J,DBSYSTEMVALUES_HSQLDB:()=>WJ,DBSYSTEMVALUES_INFORMIX:()=>s5,DBSYSTEMVALUES_INGRES:()=>XJ,DBSYSTEMVALUES_INSTANTDB:()=>i5,DBSYSTEMVALUES_INTERBASE:()=>a5,DBSYSTEMVALUES_MARIADB:()=>c5,DBSYSTEMVALUES_MAXDB:()=>KJ,DBSYSTEMVALUES_MEMCACHED:()=>P5,DBSYSTEMVALUES_MONGODB:()=>g5,DBSYSTEMVALUES_MSSQL:()=>BJ,DBSYSTEMVALUES_MYSQL:()=>jJ,DBSYSTEMVALUES_NEO4J:()=>N5,DBSYSTEMVALUES_NETEZZA:()=>u5,DBSYSTEMVALUES_ORACLE:()=>HJ,DBSYSTEMVALUES_OTHER_SQL:()=>GJ,DBSYSTEMVALUES_PERVASIVE:()=>l5,DBSYSTEMVALUES_POINTBASE:()=>p5,DBSYSTEMVALUES_POSTGRESQL:()=>VJ,DBSYSTEMVALUES_PROGRESS:()=>zJ,DBSYSTEMVALUES_REDIS:()=>A5,DBSYSTEMVALUES_REDSHIFT:()=>qJ,DBSYSTEMVALUES_SQLITE:()=>d5,DBSYSTEMVALUES_SYBASE:()=>_5,DBSYSTEMVALUES_TERADATA:()=>f5,DBSYSTEMVALUES_VERTICA:()=>m5,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Iee,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Oee,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Nee,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>bee,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Pee,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Mee,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>xee,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>vee,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Lee,DbCassandraConsistencyLevelValues:()=>V5,DbSystemValues:()=>x5,ERROR_TYPE_VALUE_OTHER:()=>Dee,EVENT_EXCEPTION:()=>nre,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>J5,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>X5,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Q5,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>eZ,FAASINVOKEDPROVIDERVALUES_AWS:()=>tZ,FAASINVOKEDPROVIDERVALUES_AZURE:()=>nZ,FAASINVOKEDPROVIDERVALUES_GCP:()=>rZ,FAASTRIGGERVALUES_DATASOURCE:()=>q5,FAASTRIGGERVALUES_HTTP:()=>$5,FAASTRIGGERVALUES_OTHER:()=>z5,FAASTRIGGERVALUES_PUBSUB:()=>Y5,FAASTRIGGERVALUES_TIMER:()=>W5,FaasDocumentOperationValues:()=>Z5,FaasInvokedProviderValues:()=>oZ,FaasTriggerValues:()=>K5,HOSTARCHVALUES_AMD64:()=>S7,HOSTARCHVALUES_ARM32:()=>g7,HOSTARCHVALUES_ARM64:()=>A7,HOSTARCHVALUES_IA64:()=>R7,HOSTARCHVALUES_PPC32:()=>y7,HOSTARCHVALUES_PPC64:()=>I7,HOSTARCHVALUES_X86:()=>O7,HTTPFLAVORVALUES_HTTP_1_0:()=>HZ,HTTPFLAVORVALUES_HTTP_1_1:()=>FZ,HTTPFLAVORVALUES_HTTP_2_0:()=>VZ,HTTPFLAVORVALUES_QUIC:()=>$Z,HTTPFLAVORVALUES_SPDY:()=>qZ,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Hee,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Fee,HTTP_REQUEST_METHOD_VALUE_GET:()=>Vee,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>qee,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>$ee,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>jee,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Yee,HTTP_REQUEST_METHOD_VALUE_POST:()=>Wee,HTTP_REQUEST_METHOD_VALUE_PUT:()=>zee,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Kee,HostArchValues:()=>N7,HttpFlavorValues:()=>YZ,JVM_MEMORY_TYPE_VALUE_HEAP:()=>rte,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>ote,JVM_THREAD_STATE_VALUE_BLOCKED:()=>ate,JVM_THREAD_STATE_VALUE_NEW:()=>cte,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>ute,JVM_THREAD_STATE_VALUE_TERMINATED:()=>lte,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>pte,JVM_THREAD_STATE_VALUE_WAITING:()=>dte,MESSAGETYPEVALUES_RECEIVED:()=>E6,MESSAGETYPEVALUES_SENT:()=>T6,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>WZ,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>zZ,MESSAGINGOPERATIONVALUES_PROCESS:()=>XZ,MESSAGINGOPERATIONVALUES_RECEIVE:()=>QZ,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>sne,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>ine,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>ane,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>lne,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>une,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>cne,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>pne,METRIC_DB_CLIENT_OPERATION_DURATION:()=>dne,METRIC_DOTNET_ASSEMBLY_COUNT:()=>_ne,METRIC_DOTNET_EXCEPTIONS:()=>fne,METRIC_DOTNET_GC_COLLECTIONS:()=>mne,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>hne,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>Tne,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Ene,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Sne,METRIC_DOTNET_GC_PAUSE_TIME:()=>gne,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Ane,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Rne,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>yne,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Ine,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>One,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Nne,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>bne,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>Cne,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Pne,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>Mne,METRIC_DOTNET_TIMER_COUNT:()=>xne,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>vne,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Lne,METRIC_JVM_CLASS_COUNT:()=>Dne,METRIC_JVM_CLASS_LOADED:()=>Une,METRIC_JVM_CLASS_UNLOADED:()=>wne,METRIC_JVM_CPU_COUNT:()=>kne,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Gne,METRIC_JVM_CPU_TIME:()=>Bne,METRIC_JVM_GC_DURATION:()=>jne,METRIC_JVM_MEMORY_COMMITTED:()=>Hne,METRIC_JVM_MEMORY_LIMIT:()=>Fne,METRIC_JVM_MEMORY_USED:()=>Vne,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>qne,METRIC_JVM_THREAD_COUNT:()=>$ne,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Yne,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Wne,METRIC_KESTREL_CONNECTION_DURATION:()=>zne,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Kne,METRIC_KESTREL_QUEUED_REQUESTS:()=>Qne,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Xne,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Jne,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Zne,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>ere,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>tre,MessageTypeValues:()=>S6,MessagingDestinationKindValues:()=>KZ,MessagingOperationValues:()=>JZ,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>RZ,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>OZ,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>gZ,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>vZ,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>yZ,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>IZ,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>MZ,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>SZ,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>DZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>NZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>CZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>LZ,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>bZ,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>PZ,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>wZ,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>xZ,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>BZ,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>kZ,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>GZ,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>UZ,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>AZ,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>mZ,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>hZ,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>TZ,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>_Z,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>fZ,NETTRANSPORTVALUES_INPROC:()=>lZ,NETTRANSPORTVALUES_IP:()=>aZ,NETTRANSPORTVALUES_IP_TCP:()=>sZ,NETTRANSPORTVALUES_IP_UDP:()=>iZ,NETTRANSPORTVALUES_OTHER:()=>pZ,NETTRANSPORTVALUES_PIPE:()=>uZ,NETTRANSPORTVALUES_UNIX:()=>cZ,NETWORK_TRANSPORT_VALUE_PIPE:()=>hte,NETWORK_TRANSPORT_VALUE_QUIC:()=>Tte,NETWORK_TRANSPORT_VALUE_TCP:()=>Ete,NETWORK_TRANSPORT_VALUE_UDP:()=>Ste,NETWORK_TRANSPORT_VALUE_UNIX:()=>gte,NETWORK_TYPE_VALUE_IPV4:()=>Rte,NETWORK_TYPE_VALUE_IPV6:()=>yte,NetHostConnectionSubtypeValues:()=>jZ,NetHostConnectionTypeValues:()=>EZ,NetTransportValues:()=>dZ,OSTYPEVALUES_AIX:()=>U7,OSTYPEVALUES_DARWIN:()=>P7,OSTYPEVALUES_DRAGONFLYBSD:()=>L7,OSTYPEVALUES_FREEBSD:()=>M7,OSTYPEVALUES_HPUX:()=>D7,OSTYPEVALUES_LINUX:()=>C7,OSTYPEVALUES_NETBSD:()=>x7,OSTYPEVALUES_OPENBSD:()=>v7,OSTYPEVALUES_SOLARIS:()=>w7,OSTYPEVALUES_WINDOWS:()=>b7,OSTYPEVALUES_Z_OS:()=>k7,OTEL_STATUS_CODE_VALUE_ERROR:()=>bte,OTEL_STATUS_CODE_VALUE_OK:()=>Cte,OsTypeValues:()=>G7,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>u6,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>s6,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>e6,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>f6,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>r6,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>c6,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>d6,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>n6,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>o6,RPCGRPCSTATUSCODEVALUES_OK:()=>ZZ,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>l6,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>i6,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>a6,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>m6,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>_6,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>p6,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>t6,RpcGrpcStatusCodeValues:()=>h6,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>KX,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>aJ,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>YX,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>FX,SEMATTRS_AWS_DYNAMODB_COUNT:()=>sJ,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>eJ,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>JX,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>cJ,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>QX,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>VX,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>zX,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>ZX,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>WX,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>qX,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>$X,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>iJ,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>nJ,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>rJ,SEMATTRS_AWS_DYNAMODB_SELECT:()=>XX,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>tJ,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>HX,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>oJ,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>LQ,SEMATTRS_CODE_FILEPATH:()=>xX,SEMATTRS_CODE_FUNCTION:()=>PX,SEMATTRS_CODE_LINENO:()=>vX,SEMATTRS_CODE_NAMESPACE:()=>MX,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>FQ,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>WQ,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>YQ,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>qQ,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>jQ,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>HQ,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>$Q,SEMATTRS_DB_CASSANDRA_TABLE:()=>VQ,SEMATTRS_DB_CONNECTION_STRING:()=>DQ,SEMATTRS_DB_HBASE_NAMESPACE:()=>zQ,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>wQ,SEMATTRS_DB_MONGODB_COLLECTION:()=>QQ,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>BQ,SEMATTRS_DB_NAME:()=>kQ,SEMATTRS_DB_OPERATION:()=>GQ,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>KQ,SEMATTRS_DB_SQL_TABLE:()=>XQ,SEMATTRS_DB_STATEMENT:()=>Qg,SEMATTRS_DB_SYSTEM:()=>Kg,SEMATTRS_DB_USER:()=>UQ,SEMATTRS_ENDUSER_ID:()=>IX,SEMATTRS_ENDUSER_ROLE:()=>OX,SEMATTRS_ENDUSER_SCOPE:()=>NX,SEMATTRS_EXCEPTION_ESCAPED:()=>tX,SEMATTRS_EXCEPTION_MESSAGE:()=>ZQ,SEMATTRS_EXCEPTION_STACKTRACE:()=>eX,SEMATTRS_EXCEPTION_TYPE:()=>JQ,SEMATTRS_FAAS_COLDSTART:()=>uX,SEMATTRS_FAAS_CRON:()=>cX,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>rX,SEMATTRS_FAAS_DOCUMENT_NAME:()=>iX,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>oX,SEMATTRS_FAAS_DOCUMENT_TIME:()=>sX,SEMATTRS_FAAS_EXECUTION:()=>nX,SEMATTRS_FAAS_INVOKED_NAME:()=>lX,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>pX,SEMATTRS_FAAS_INVOKED_REGION:()=>dX,SEMATTRS_FAAS_TIME:()=>aX,SEMATTRS_FAAS_TRIGGER:()=>Xg,SEMATTRS_HTTP_CLIENT_IP:()=>jX,SEMATTRS_HTTP_FLAVOR:()=>UX,SEMATTRS_HTTP_HOST:()=>LX,SEMATTRS_HTTP_METHOD:()=>bl,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>kX,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>GX,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>nA,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>rA,SEMATTRS_HTTP_ROUTE:()=>oA,SEMATTRS_HTTP_SCHEME:()=>DX,SEMATTRS_HTTP_SERVER_NAME:()=>BX,SEMATTRS_HTTP_STATUS_CODE:()=>Pi,SEMATTRS_HTTP_TARGET:()=>tA,SEMATTRS_HTTP_URL:()=>Za,SEMATTRS_HTTP_USER_AGENT:()=>wX,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>UJ,SEMATTRS_MESSAGE_ID:()=>DJ,SEMATTRS_MESSAGE_TYPE:()=>LJ,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>wJ,SEMATTRS_MESSAGING_CONSUMER_ID:()=>gJ,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>hJ,SEMATTRS_MESSAGING_DESTINATION:()=>uJ,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>lJ,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>IJ,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>yJ,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>RJ,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>OJ,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>NJ,SEMATTRS_MESSAGING_MESSAGE_ID:()=>mJ,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>EJ,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>TJ,SEMATTRS_MESSAGING_OPERATION:()=>SJ,SEMATTRS_MESSAGING_PROTOCOL:()=>dJ,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>_J,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>AJ,SEMATTRS_MESSAGING_SYSTEM:()=>sA,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>pJ,SEMATTRS_MESSAGING_URL:()=>fJ,SEMATTRS_NET_HOST_CARRIER_ICC:()=>RX,SEMATTRS_NET_HOST_CARRIER_MCC:()=>gX,SEMATTRS_NET_HOST_CARRIER_MNC:()=>AX,SEMATTRS_NET_HOST_CARRIER_NAME:()=>SX,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>EX,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>TX,SEMATTRS_NET_HOST_IP:()=>Zg,SEMATTRS_NET_HOST_NAME:()=>hX,SEMATTRS_NET_HOST_PORT:()=>eA,SEMATTRS_NET_PEER_IP:()=>Jg,SEMATTRS_NET_PEER_NAME:()=>mX,SEMATTRS_NET_PEER_PORT:()=>fX,SEMATTRS_NET_TRANSPORT:()=>_X,SEMATTRS_PEER_SERVICE:()=>yX,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>aA,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>xJ,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>vJ,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>MJ,SEMATTRS_RPC_JSONRPC_VERSION:()=>PJ,SEMATTRS_RPC_METHOD:()=>CJ,SEMATTRS_RPC_SERVICE:()=>iA,SEMATTRS_RPC_SYSTEM:()=>bJ,SEMATTRS_THREAD_ID:()=>bX,SEMATTRS_THREAD_NAME:()=>CX,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>N6,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>O6,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>b6,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>C6,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>P6,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>M6,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>x6,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>L6,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>v6,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>U6,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>D6,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>A6,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>y6,SEMRESATTRS_CLOUD_PLATFORM:()=>I6,SEMRESATTRS_CLOUD_PROVIDER:()=>g6,SEMRESATTRS_CLOUD_REGION:()=>R6,SEMRESATTRS_CONTAINER_ID:()=>k6,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>B6,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>j6,SEMRESATTRS_CONTAINER_NAME:()=>w6,SEMRESATTRS_CONTAINER_RUNTIME:()=>G6,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>H6,SEMRESATTRS_DEVICE_ID:()=>F6,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>V6,SEMRESATTRS_DEVICE_MODEL_NAME:()=>q6,SEMRESATTRS_FAAS_ID:()=>Y6,SEMRESATTRS_FAAS_INSTANCE:()=>z6,SEMRESATTRS_FAAS_MAX_MEMORY:()=>K6,SEMRESATTRS_FAAS_NAME:()=>$6,SEMRESATTRS_FAAS_VERSION:()=>W6,SEMRESATTRS_HOST_ARCH:()=>Z6,SEMRESATTRS_HOST_ID:()=>Q6,SEMRESATTRS_HOST_IMAGE_ID:()=>t8,SEMRESATTRS_HOST_IMAGE_NAME:()=>e8,SEMRESATTRS_HOST_IMAGE_VERSION:()=>n8,SEMRESATTRS_HOST_NAME:()=>X6,SEMRESATTRS_HOST_TYPE:()=>J6,SEMRESATTRS_K8S_CLUSTER_NAME:()=>r8,SEMRESATTRS_K8S_CONTAINER_NAME:()=>u8,SEMRESATTRS_K8S_CRONJOB_NAME:()=>A8,SEMRESATTRS_K8S_CRONJOB_UID:()=>g8,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>T8,SEMRESATTRS_K8S_DAEMONSET_UID:()=>h8,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>_8,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>d8,SEMRESATTRS_K8S_JOB_NAME:()=>S8,SEMRESATTRS_K8S_JOB_UID:()=>E8,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>i8,SEMRESATTRS_K8S_NODE_NAME:()=>o8,SEMRESATTRS_K8S_NODE_UID:()=>s8,SEMRESATTRS_K8S_POD_NAME:()=>c8,SEMRESATTRS_K8S_POD_UID:()=>a8,SEMRESATTRS_K8S_REPLICASET_NAME:()=>p8,SEMRESATTRS_K8S_REPLICASET_UID:()=>l8,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>m8,SEMRESATTRS_K8S_STATEFULSET_UID:()=>f8,SEMRESATTRS_OS_DESCRIPTION:()=>y8,SEMRESATTRS_OS_NAME:()=>I8,SEMRESATTRS_OS_TYPE:()=>R8,SEMRESATTRS_OS_VERSION:()=>O8,SEMRESATTRS_PROCESS_COMMAND:()=>P8,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>x8,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>M8,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>b8,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>C8,SEMRESATTRS_PROCESS_OWNER:()=>v8,SEMRESATTRS_PROCESS_PID:()=>N8,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>U8,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>L8,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>D8,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>k8,SEMRESATTRS_SERVICE_NAME:()=>w8,SEMRESATTRS_SERVICE_NAMESPACE:()=>cA,SEMRESATTRS_SERVICE_VERSION:()=>G8,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>F8,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>j8,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>B8,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>H8,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>$8,SEMRESATTRS_WEBENGINE_NAME:()=>V8,SEMRESATTRS_WEBENGINE_VERSION:()=>q8,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Lte,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Dte,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Ute,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>kte,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Gte,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Bte,SemanticAttributes:()=>kJ,SemanticResourceAttributes:()=>Y8,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>B7,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>j7,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>H7,TELEMETRYSDKLANGUAGEVALUES_GO:()=>F7,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>V7,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>q7,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>$7,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Y7,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>W7,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>z7,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Hte,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Fte,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Vte,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>qte,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>$te,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Yte,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>Wte,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>zte,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Kte,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Qte,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Xte,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Jte,TelemetrySdkLanguageValues:()=>K7});var le=z(()=>{G0();lw();pw();dw();_w()});var fw=E(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.ATTR_PROCESS_RUNTIME_NAME=void 0;v_.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var mw=E(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});D_.SDK_INFO=void 0;var rre=WP(),L_=(le(),O(Ae)),ore=fw();D_.SDK_INFO={[L_.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[ore.ATTR_PROCESS_RUNTIME_NAME]:"node",[L_.ATTR_TELEMETRY_SDK_LANGUAGE]:L_.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[L_.ATTR_TELEMETRY_SDK_VERSION]:rre.VERSION}});var hw=E($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.otperformance=$t.SDK_INFO=$t._globalThis=$t.getStringListFromEnv=$t.getNumberFromEnv=$t.getBooleanFromEnv=$t.getStringFromEnv=void 0;var U_=$P();Object.defineProperty($t,"getStringFromEnv",{enumerable:!0,get:function(){return U_.getStringFromEnv}});Object.defineProperty($t,"getBooleanFromEnv",{enumerable:!0,get:function(){return U_.getBooleanFromEnv}});Object.defineProperty($t,"getNumberFromEnv",{enumerable:!0,get:function(){return U_.getNumberFromEnv}});Object.defineProperty($t,"getStringListFromEnv",{enumerable:!0,get:function(){return U_.getStringListFromEnv}});var sre=YP();Object.defineProperty($t,"_globalThis",{enumerable:!0,get:function(){return sre._globalThis}});var ire=mw();Object.defineProperty($t,"SDK_INFO",{enumerable:!0,get:function(){return ire.SDK_INFO}});$t.otperformance=performance});var yA=E(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.getStringListFromEnv=Yt.getNumberFromEnv=Yt.getStringFromEnv=Yt.getBooleanFromEnv=Yt.otperformance=Yt._globalThis=Yt.SDK_INFO=void 0;var vi=hw();Object.defineProperty(Yt,"SDK_INFO",{enumerable:!0,get:function(){return vi.SDK_INFO}});Object.defineProperty(Yt,"_globalThis",{enumerable:!0,get:function(){return vi._globalThis}});Object.defineProperty(Yt,"otperformance",{enumerable:!0,get:function(){return vi.otperformance}});Object.defineProperty(Yt,"getBooleanFromEnv",{enumerable:!0,get:function(){return vi.getBooleanFromEnv}});Object.defineProperty(Yt,"getStringFromEnv",{enumerable:!0,get:function(){return vi.getStringFromEnv}});Object.defineProperty(Yt,"getNumberFromEnv",{enumerable:!0,get:function(){return vi.getNumberFromEnv}});Object.defineProperty(Yt,"getStringListFromEnv",{enumerable:!0,get:function(){return vi.getStringListFromEnv}})});var gw=E(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.addHrTimes=be.isTimeInput=be.isTimeInputHrTime=be.hrTimeToMicroseconds=be.hrTimeToMilliseconds=be.hrTimeToNanoseconds=be.hrTimeToTimeStamp=be.hrTimeDuration=be.timeInputToHrTime=be.hrTime=be.getTimeOrigin=be.millisToHrTime=void 0;var w_=yA(),Tw=9,are=6,cre=Math.pow(10,are),k_=Math.pow(10,Tw);function Cl(t){let e=t/1e3,n=Math.trunc(e),r=Math.round(t%1e3*cre);return[n,r]}be.millisToHrTime=Cl;function ure(){return w_.otperformance.timeOrigin}be.getTimeOrigin=ure;function Ew(t){let e=Cl(w_.otperformance.timeOrigin),n=Cl(typeof t=="number"?t:w_.otperformance.now());return Sw(e,n)}be.hrTime=Ew;function lre(t){if(IA(t))return t;if(typeof t=="number")return t<w_.otperformance.timeOrigin?Ew(t):Cl(t);if(t instanceof Date)return Cl(t.getTime());throw TypeError("Invalid input type")}be.timeInputToHrTime=lre;function pre(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=k_),[n,r]}be.hrTimeDuration=pre;function dre(t){let e=Tw,n=`${"0".repeat(e)}${t[1]}Z`,r=n.substring(n.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",r)}be.hrTimeToTimeStamp=dre;function _re(t){return t[0]*k_+t[1]}be.hrTimeToNanoseconds=_re;function fre(t){return t[0]*1e3+t[1]/1e6}be.hrTimeToMilliseconds=fre;function mre(t){return t[0]*1e6+t[1]/1e3}be.hrTimeToMicroseconds=mre;function IA(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}be.isTimeInputHrTime=IA;function hre(t){return IA(t)||typeof t=="number"||t instanceof Date}be.isTimeInput=hre;function Sw(t,e){let n=[t[0]+e[0],t[1]+e[1]];return n[1]>=k_&&(n[1]-=k_,n[0]+=1),n}be.addHrTimes=Sw});var Aw=E(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});G_.unrefTimer=void 0;function Tre(t){typeof t!="number"&&t.unref()}G_.unrefTimer=Tre});var Rw=E(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.ExportResultCode=void 0;var Ere;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Ere=Pl.ExportResultCode||(Pl.ExportResultCode={}))});var Iw=E(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});B_.CompositePropagator=void 0;var yw=(b(),O(v)),OA=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(e,n,r){for(let o of this._propagators)try{o.inject(e,n,r)}catch(s){yw.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,n,r){return this._propagators.reduce((o,s)=>{try{return s.extract(o,n,r)}catch(i){yw.diag.warn(`Failed to extract with ${s.constructor.name}. Err: ${i.message}`)}return o},e)}fields(){return this._fields.slice()}};B_.CompositePropagator=OA});var Ow=E(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.validateValue=tc.validateKey=void 0;var NA="[_0-9a-z-*/]",Sre=`[a-z]${NA}{0,255}`,gre=`[a-z0-9]${NA}{0,240}@[a-z]${NA}{0,13}`,Are=new RegExp(`^(?:${Sre}|${gre})$`),Rre=/^[ -~]{0,255}[!-~]$/,yre=/,|=/;function Ire(t){return Are.test(t)}tc.validateKey=Ire;function Ore(t){return Rre.test(t)&&!yre.test(t)}tc.validateValue=Ore});var CA=E(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});j_.TraceState=void 0;var Nw=Ow(),bw=32,Nre=512,Cw=",",Pw="=",bA=class t{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,n)=>(e.push(n+Pw+this.get(n)),e),[]).join(Cw)}_parse(e){e.length>Nre||(this._internalState=e.split(Cw).reverse().reduce((n,r)=>{let o=r.trim(),s=o.indexOf(Pw);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);(0,Nw.validateKey)(i)&&(0,Nw.validateValue)(a)&&n.set(i,a)}return n},new Map),this._internalState.size>bw&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,bw))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};j_.TraceState=bA});var xw=E(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.W3CTraceContextPropagator=Wt.parseTraceParent=Wt.TRACE_STATE_HEADER=Wt.TRACE_PARENT_HEADER=void 0;var H_=(b(),O(v)),bre=Nl(),Cre=CA();Wt.TRACE_PARENT_HEADER="traceparent";Wt.TRACE_STATE_HEADER="tracestate";var Pre="00",Mre="(?!ff)[\\da-f]{2}",xre="(?![0]{32})[\\da-f]{32}",vre="(?![0]{16})[\\da-f]{16}",Lre="[\\da-f]{2}",Dre=new RegExp(`^\\s?(${Mre})-(${xre})-(${vre})-(${Lre})(-.*)?\\s?$`);function Mw(t){let e=Dre.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}Wt.parseTraceParent=Mw;var PA=class{inject(e,n,r){let o=H_.trace.getSpanContext(e);if(!o||(0,bre.isTracingSuppressed)(e)||!(0,H_.isSpanContextValid)(o))return;let s=`${Pre}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||H_.TraceFlags.NONE).toString(16)}`;r.set(n,Wt.TRACE_PARENT_HEADER,s),o.traceState&&r.set(n,Wt.TRACE_STATE_HEADER,o.traceState.serialize())}extract(e,n,r){let o=r.get(n,Wt.TRACE_PARENT_HEADER);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let i=Mw(s);if(!i)return e;i.isRemote=!0;let a=r.get(n,Wt.TRACE_STATE_HEADER);if(a){let c=Array.isArray(a)?a.join(","):a;i.traceState=new Cre.TraceState(typeof c=="string"?c:void 0)}return H_.trace.setSpanContext(e,i)}fields(){return[Wt.TRACE_PARENT_HEADER,Wt.TRACE_STATE_HEADER]}};Wt.W3CTraceContextPropagator=PA});var vw=E(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.getRPCMetadata=Rr.deleteRPCMetadata=Rr.setRPCMetadata=Rr.RPCType=void 0;var Ure=(b(),O(v)),MA=(0,Ure.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),wre;(function(t){t.HTTP="http"})(wre=Rr.RPCType||(Rr.RPCType={}));function kre(t,e){return t.setValue(MA,e)}Rr.setRPCMetadata=kre;function Gre(t){return t.deleteValue(MA)}Rr.deleteRPCMetadata=Gre;function Bre(t){return t.getValue(MA)}Rr.getRPCMetadata=Bre});var kw=E(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.isPlainObject=void 0;var jre="[object Object]",Hre="[object Null]",Fre="[object Undefined]",Vre=Function.prototype,Lw=Vre.toString,qre=Lw.call(Object),$re=Object.getPrototypeOf,Dw=Object.prototype,Uw=Dw.hasOwnProperty,Li=Symbol?Symbol.toStringTag:void 0,ww=Dw.toString;function Yre(t){if(!Wre(t)||zre(t)!==jre)return!1;let e=$re(t);if(e===null)return!0;let n=Uw.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Lw.call(n)===qre}F_.isPlainObject=Yre;function Wre(t){return t!=null&&typeof t=="object"}function zre(t){return t==null?t===void 0?Fre:Hre:Li&&Li in Object(t)?Kre(t):Qre(t)}function Kre(t){let e=Uw.call(t,Li),n=t[Li],r=!1;try{t[Li]=void 0,r=!0}catch{}let o=ww.call(t);return r&&(e?t[Li]=n:delete t[Li]),o}function Qre(t){return ww.call(t)}});var Fw=E($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});$_.merge=void 0;var Gw=kw(),Xre=20;function Jre(...t){let e=t.shift(),n=new WeakMap;for(;t.length>0;)e=jw(e,t.shift(),0,n);return e}$_.merge=Jre;function xA(t){return q_(t)?t.slice():t}function jw(t,e,n=0,r){let o;if(!(n>Xre)){if(n++,V_(t)||V_(e)||Hw(e))o=xA(e);else if(q_(t)){if(o=t.slice(),q_(e))for(let s=0,i=e.length;s<i;s++)o.push(xA(e[s]));else if(Ml(e)){let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i];o[c]=xA(e[c])}}}else if(Ml(t))if(Ml(e)){if(!Zre(t,e))return e;o=Object.assign({},t);let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i],l=e[c];if(V_(l))typeof l>"u"?delete o[c]:o[c]=l;else{let p=o[c],d=l;if(Bw(t,c,r)||Bw(e,c,r))delete o[c];else{if(Ml(p)&&Ml(d)){let _=r.get(p)||[],f=r.get(d)||[];_.push({obj:t,key:c}),f.push({obj:e,key:c}),r.set(p,_),r.set(d,f)}o[c]=jw(o[c],l,n,r)}}}}else o=e;return o}}function Bw(t,e,n){let r=n.get(t[e])||[];for(let o=0,s=r.length;o<s;o++){let i=r[o];if(i.key===e&&i.obj===t)return!0}return!1}function q_(t){return Array.isArray(t)}function Hw(t){return typeof t=="function"}function Ml(t){return!V_(t)&&!q_(t)&&!Hw(t)&&typeof t=="object"}function V_(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function Zre(t,e){return!(!(0,Gw.isPlainObject)(t)||!(0,Gw.isPlainObject)(e))}});var Vw=E(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.callWithTimeout=nc.TimeoutError=void 0;var Y_=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};nc.TimeoutError=Y_;function eoe(t,e){let n,r=new Promise(function(s,i){n=setTimeout(function(){i(new Y_("Operation timed out."))},e)});return Promise.race([t,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}nc.callWithTimeout=eoe});var $w=E(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.isUrlIgnored=rc.urlMatches=void 0;function qw(t,e){return typeof e=="string"?t===e:!!t.match(e)}rc.urlMatches=qw;function toe(t,e){if(!e)return!1;for(let n of e)if(qw(t,n))return!0;return!1}rc.isUrlIgnored=toe});var Yw=E(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});W_.Deferred=void 0;var vA=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,n)=>{this._resolve=e,this._reject=n})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};W_.Deferred=vA});var Ww=E(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});z_.BindOnceFuture=void 0;var noe=Yw(),LA=class{_isCalled=!1;_deferred=new noe.Deferred;_callback;_that;constructor(e,n){this._callback=e,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};z_.BindOnceFuture=LA});var Kw=E(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});K_.diagLogLevelFromString=void 0;var Po=(b(),O(v)),zw={ALL:Po.DiagLogLevel.ALL,VERBOSE:Po.DiagLogLevel.VERBOSE,DEBUG:Po.DiagLogLevel.DEBUG,INFO:Po.DiagLogLevel.INFO,WARN:Po.DiagLogLevel.WARN,ERROR:Po.DiagLogLevel.ERROR,NONE:Po.DiagLogLevel.NONE};function roe(t){if(t==null)return;let e=zw[t.toUpperCase()];return e??(Po.diag.warn(`Unknown log level "${t}", expected one of ${Object.keys(zw)}, using default`),Po.DiagLogLevel.INFO)}K_.diagLogLevelFromString=roe});var Xw=E(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});Q_._export=void 0;var Qw=(b(),O(v)),ooe=Nl();function soe(t,e){return new Promise(n=>{Qw.context.with((0,ooe.suppressTracing)(Qw.context.active()),()=>{t.export(e,n)})})}Q_._export=soe});var Te=E(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.internal=y.diagLogLevelFromString=y.BindOnceFuture=y.urlMatches=y.isUrlIgnored=y.callWithTimeout=y.TimeoutError=y.merge=y.TraceState=y.unsuppressTracing=y.suppressTracing=y.isTracingSuppressed=y.setRPCMetadata=y.getRPCMetadata=y.deleteRPCMetadata=y.RPCType=y.parseTraceParent=y.W3CTraceContextPropagator=y.TRACE_STATE_HEADER=y.TRACE_PARENT_HEADER=y.CompositePropagator=y.otperformance=y.getStringListFromEnv=y.getNumberFromEnv=y.getBooleanFromEnv=y.getStringFromEnv=y._globalThis=y.SDK_INFO=y.parseKeyPairsIntoRecord=y.ExportResultCode=y.unrefTimer=y.timeInputToHrTime=y.millisToHrTime=y.isTimeInputHrTime=y.isTimeInput=y.hrTimeToTimeStamp=y.hrTimeToNanoseconds=y.hrTimeToMilliseconds=y.hrTimeToMicroseconds=y.hrTimeDuration=y.hrTime=y.getTimeOrigin=y.addHrTimes=y.loggingErrorHandler=y.setGlobalErrorHandler=y.globalErrorHandler=y.sanitizeAttributes=y.isAttributeValue=y.AnchoredClock=y.W3CBaggagePropagator=void 0;var ioe=LP();Object.defineProperty(y,"W3CBaggagePropagator",{enumerable:!0,get:function(){return ioe.W3CBaggagePropagator}});var aoe=DP();Object.defineProperty(y,"AnchoredClock",{enumerable:!0,get:function(){return aoe.AnchoredClock}});var Jw=BP();Object.defineProperty(y,"isAttributeValue",{enumerable:!0,get:function(){return Jw.isAttributeValue}});Object.defineProperty(y,"sanitizeAttributes",{enumerable:!0,get:function(){return Jw.sanitizeAttributes}});var Zw=HP();Object.defineProperty(y,"globalErrorHandler",{enumerable:!0,get:function(){return Zw.globalErrorHandler}});Object.defineProperty(y,"setGlobalErrorHandler",{enumerable:!0,get:function(){return Zw.setGlobalErrorHandler}});var coe=Wg();Object.defineProperty(y,"loggingErrorHandler",{enumerable:!0,get:function(){return coe.loggingErrorHandler}});var Qn=gw();Object.defineProperty(y,"addHrTimes",{enumerable:!0,get:function(){return Qn.addHrTimes}});Object.defineProperty(y,"getTimeOrigin",{enumerable:!0,get:function(){return Qn.getTimeOrigin}});Object.defineProperty(y,"hrTime",{enumerable:!0,get:function(){return Qn.hrTime}});Object.defineProperty(y,"hrTimeDuration",{enumerable:!0,get:function(){return Qn.hrTimeDuration}});Object.defineProperty(y,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Qn.hrTimeToMicroseconds}});Object.defineProperty(y,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Qn.hrTimeToMilliseconds}});Object.defineProperty(y,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Qn.hrTimeToNanoseconds}});Object.defineProperty(y,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Qn.hrTimeToTimeStamp}});Object.defineProperty(y,"isTimeInput",{enumerable:!0,get:function(){return Qn.isTimeInput}});Object.defineProperty(y,"isTimeInputHrTime",{enumerable:!0,get:function(){return Qn.isTimeInputHrTime}});Object.defineProperty(y,"millisToHrTime",{enumerable:!0,get:function(){return Qn.millisToHrTime}});Object.defineProperty(y,"timeInputToHrTime",{enumerable:!0,get:function(){return Qn.timeInputToHrTime}});var uoe=Aw();Object.defineProperty(y,"unrefTimer",{enumerable:!0,get:function(){return uoe.unrefTimer}});var loe=Rw();Object.defineProperty(y,"ExportResultCode",{enumerable:!0,get:function(){return loe.ExportResultCode}});var poe=Fg();Object.defineProperty(y,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return poe.parseKeyPairsIntoRecord}});var Di=yA();Object.defineProperty(y,"SDK_INFO",{enumerable:!0,get:function(){return Di.SDK_INFO}});Object.defineProperty(y,"_globalThis",{enumerable:!0,get:function(){return Di._globalThis}});Object.defineProperty(y,"getStringFromEnv",{enumerable:!0,get:function(){return Di.getStringFromEnv}});Object.defineProperty(y,"getBooleanFromEnv",{enumerable:!0,get:function(){return Di.getBooleanFromEnv}});Object.defineProperty(y,"getNumberFromEnv",{enumerable:!0,get:function(){return Di.getNumberFromEnv}});Object.defineProperty(y,"getStringListFromEnv",{enumerable:!0,get:function(){return Di.getStringListFromEnv}});Object.defineProperty(y,"otperformance",{enumerable:!0,get:function(){return Di.otperformance}});var doe=Iw();Object.defineProperty(y,"CompositePropagator",{enumerable:!0,get:function(){return doe.CompositePropagator}});var X_=xw();Object.defineProperty(y,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return X_.TRACE_PARENT_HEADER}});Object.defineProperty(y,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return X_.TRACE_STATE_HEADER}});Object.defineProperty(y,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return X_.W3CTraceContextPropagator}});Object.defineProperty(y,"parseTraceParent",{enumerable:!0,get:function(){return X_.parseTraceParent}});var J_=vw();Object.defineProperty(y,"RPCType",{enumerable:!0,get:function(){return J_.RPCType}});Object.defineProperty(y,"deleteRPCMetadata",{enumerable:!0,get:function(){return J_.deleteRPCMetadata}});Object.defineProperty(y,"getRPCMetadata",{enumerable:!0,get:function(){return J_.getRPCMetadata}});Object.defineProperty(y,"setRPCMetadata",{enumerable:!0,get:function(){return J_.setRPCMetadata}});var DA=Nl();Object.defineProperty(y,"isTracingSuppressed",{enumerable:!0,get:function(){return DA.isTracingSuppressed}});Object.defineProperty(y,"suppressTracing",{enumerable:!0,get:function(){return DA.suppressTracing}});Object.defineProperty(y,"unsuppressTracing",{enumerable:!0,get:function(){return DA.unsuppressTracing}});var _oe=CA();Object.defineProperty(y,"TraceState",{enumerable:!0,get:function(){return _oe.TraceState}});var foe=Fw();Object.defineProperty(y,"merge",{enumerable:!0,get:function(){return foe.merge}});var ek=Vw();Object.defineProperty(y,"TimeoutError",{enumerable:!0,get:function(){return ek.TimeoutError}});Object.defineProperty(y,"callWithTimeout",{enumerable:!0,get:function(){return ek.callWithTimeout}});var tk=$w();Object.defineProperty(y,"isUrlIgnored",{enumerable:!0,get:function(){return tk.isUrlIgnored}});Object.defineProperty(y,"urlMatches",{enumerable:!0,get:function(){return tk.urlMatches}});var moe=Ww();Object.defineProperty(y,"BindOnceFuture",{enumerable:!0,get:function(){return moe.BindOnceFuture}});var hoe=Kw();Object.defineProperty(y,"diagLogLevelFromString",{enumerable:!0,get:function(){return hoe.diagLogLevelFromString}});var Toe=Xw();y.internal={_export:Toe._export}});var nk=E(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});Z_.VERSION=void 0;Z_.VERSION="0.214.0"});var rk=E(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.SeverityNumber=void 0;var Eoe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Eoe=xl.SeverityNumber||(xl.SeverityNumber={}))});var tf=E(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.NOOP_LOGGER=oc.NoopLogger=void 0;var ef=class{emit(e){}};oc.NoopLogger=ef;oc.NOOP_LOGGER=new ef});var ok=E(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.API_BACKWARDS_COMPATIBILITY_VERSION=Yr.makeGetter=Yr._global=Yr.GLOBAL_LOGS_API_KEY=void 0;Yr.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Yr._global=globalThis;function Soe(t,e,n){return r=>r===t?e:n}Yr.makeGetter=Soe;Yr.API_BACKWARDS_COMPATIBILITY_VERSION=1});var UA=E(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.NOOP_LOGGER_PROVIDER=sc.NoopLoggerProvider=void 0;var goe=tf(),nf=class{getLogger(e,n,r){return new goe.NoopLogger}};sc.NoopLoggerProvider=nf;sc.NOOP_LOGGER_PROVIDER=new nf});var sk=E(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.ProxyLogger=void 0;var Aoe=tf(),wA=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Aoe.NOOP_LOGGER}};rf.ProxyLogger=wA});var ik=E(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.ProxyLoggerProvider=void 0;var Roe=UA(),yoe=sk(),kA=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new yoe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Roe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};of.ProxyLoggerProvider=kA});var ck=E(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.LogsAPI=void 0;var Xn=ok(),Ioe=UA(),ak=ik(),GA=class t{constructor(){this._proxyLoggerProvider=new ak.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Xn._global[Xn.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Xn._global[Xn.GLOBAL_LOGS_API_KEY]=(0,Xn.makeGetter)(Xn.API_BACKWARDS_COMPATIBILITY_VERSION,e,Ioe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=Xn._global[Xn.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(Xn._global,Xn.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete Xn._global[Xn.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new ak.ProxyLoggerProvider}};sf.LogsAPI=GA});var BA=E(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.logs=Wr.NoopLogger=Wr.NOOP_LOGGER=Wr.SeverityNumber=void 0;var Ooe=rk();Object.defineProperty(Wr,"SeverityNumber",{enumerable:!0,get:function(){return Ooe.SeverityNumber}});var uk=tf();Object.defineProperty(Wr,"NOOP_LOGGER",{enumerable:!0,get:function(){return uk.NOOP_LOGGER}});Object.defineProperty(Wr,"NoopLogger",{enumerable:!0,get:function(){return uk.NoopLogger}});var Noe=ck();Wr.logs=Noe.LogsAPI.getInstance()});var lk=E(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.disableInstrumentations=ic.enableInstrumentations=void 0;function boe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}ic.enableInstrumentations=boe;function Coe(t){t.forEach(e=>e.disable())}ic.disableInstrumentations=Coe});var _k=E(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.registerInstrumentations=void 0;var pk=(b(),O(v)),Poe=BA(),dk=lk();function Moe(t){let e=t.tracerProvider||pk.trace.getTracerProvider(),n=t.meterProvider||pk.metrics.getMeterProvider(),r=t.loggerProvider||Poe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,dk.enableInstrumentations)(o,e,n,r),()=>{(0,dk.disableInstrumentations)(o)}}af.registerInstrumentations=Moe});var Rk=E(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.satisfies=void 0;var VA=(b(),O(v)),Ek=/^(?: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-]+)*))?$/,xoe=/^(?<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-]+)*))?$/,voe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Loe(t,e,n){if(!Doe(t))return VA.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=Goe(t);if(!r)return!1;let o=[],s=Sk(r,e,o,n);return s&&!n?.includePrerelease?woe(r,o):s}cf.satisfies=Loe;function Doe(t){return typeof t=="string"&&Ek.test(t)}function Sk(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(jA(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=sse(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!jA(t,s,n,r))return!1;return!0}return jA(t,e,n,r)}function jA(t,e,n,r){if(e=koe(e,r),e.includes(" "))return Sk(t,e,n,r);{let o=Boe(e);return n.push(o),Uoe(t,o)}}function Uoe(t,e){if(e.invalid)return!1;if(!e.version||FA(e.version))return!0;let n=mk(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=mk(r,o)}return voe[e.op]?.includes(n)}function woe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function koe(t,e){return t=t.trim(),t=rse(t,e),t=nse(t),t=ose(t,e),t=t.trim(),t}function sn(t){return!t||t.toLowerCase()==="x"||t==="*"}function Goe(t){let e=t.match(Ek);if(!e){VA.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function Boe(t){if(!t)return{};let e=t.match(xoe);if(!e)return VA.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function FA(t){return t==="*"||t==="x"||t==="X"}function fk(t){let e=parseInt(t,10);return isNaN(e)?t:e}function joe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function Hoe(t,e){if(FA(t)||FA(e))return 0;let[n,r]=joe(fk(t),fk(e));return n>r?1:n<r?-1:0}function mk(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=Hoe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var gk="[a-zA-Z0-9-]",Ak="0|[1-9]\\d*",Foe=`\\d*[a-zA-Z-]${gk}*`,Voe="((?:<|>)?=?)",hk=`(?:${Ak}|${Foe})`,qoe=`(?:-(${hk}(?:\\.${hk})*))`,Tk=`${gk}+`,$oe=`(?:\\+(${Tk}(?:\\.${Tk})*))`,HA=`${Ak}|x|X|\\*`,vl=`[v=\\s]*(${HA})(?:\\.(${HA})(?:\\.(${HA})(?:${qoe})?${$oe}?)?)?`,Yoe=`^${Voe}\\s*${vl}$`,Woe=new RegExp(Yoe),zoe=`^\\s*(${vl})\\s+-\\s+(${vl})\\s*$`,Koe=new RegExp(zoe),Qoe="(?:~>?)",Xoe=`^${Qoe}${vl}$`,Joe=new RegExp(Xoe),Zoe="(?:\\^)",ese=`^${Zoe}${vl}$`,tse=new RegExp(ese);function nse(t){let e=Joe;return t.replace(e,(n,r,o,s,i)=>{let a;return sn(r)?a="":sn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:sn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function rse(t,e){let n=tse,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let l;return sn(s)?l="":sn(i)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:sn(a)?s==="0"?l=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?l=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,l})}function ose(t,e){let n=Woe;return t.replace(n,(r,o,s,i,a,c)=>{let l=sn(s),p=l||sn(i),d=p||sn(a),_=d;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",l?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function sse(t,e){let n=Koe;return t.replace(n,(r,o,s,i,a,c,l,p,d,_,f,m)=>(sn(s)?o="":sn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:sn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,sn(d)?p="":sn(_)?p=`<${+d+1}.0.0-0`:sn(f)?p=`<${d}.${+_+1}.0-0`:m?p=`<=${d}.${_}.${f}-${m}`:e?.includePrerelease?p=`<${d}.${_}.${+f+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var qA=E(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.massUnwrap=vt.unwrap=vt.massWrap=vt.wrap=void 0;var an=console.error.bind(console);function Ll(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var ise=(t,e,n)=>{if(!t||!t[e]){an("no original function "+String(e)+" to wrap");return}if(!n){an("no wrapper function"),an(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){an("original object and wrapper must be functions");return}let o=n(r,e);return Ll(o,"__original",r),Ll(o,"__unwrap",()=>{t[e]===o&&Ll(t,e,r)}),Ll(o,"__wrapped",!0),Ll(t,e,o),o};vt.wrap=ise;var ase=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{an("must provide one or more modules to patch"),an(new Error().stack);return}if(!(e&&Array.isArray(e))){an("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,vt.wrap)(r,o,n)})})};vt.massWrap=ase;var cse=(t,e)=>{if(!t||!t[e]){an("no function to unwrap."),an(new Error().stack);return}let n=t[e];if(!n.__unwrap)an("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};vt.unwrap=cse;var use=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{an("must provide one or more modules to patch"),an(new Error().stack);return}if(!(e&&Array.isArray(e))){an("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,vt.unwrap)(n,r)})})};vt.massUnwrap=use;function Dl(t){t&&t.logger&&(typeof t.logger!="function"?an("new logger isn't a function, not replacing"):an=t.logger)}vt.default=Dl;Dl.wrap=vt.wrap;Dl.massWrap=vt.massWrap;Dl.unwrap=vt.unwrap;Dl.massUnwrap=vt.massUnwrap});var yk=E(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.InstrumentationAbstract=void 0;var $A=(b(),O(v)),lse=BA(),uf=qA(),YA=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=$A.diag.createComponentLogger({namespace:e}),this._tracer=$A.trace.getTracer(e,n),this._meter=$A.metrics.getMeter(e,n),this._logger=lse.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=uf.wrap;_unwrap=uf.unwrap;_massWrap=uf.massWrap;_massUnwrap=uf.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};lf.InstrumentationAbstract=YA});var Ok=E((j0e,Ik)=>{var ac=1e3,cc=ac*60,uc=cc*60,Ui=uc*24,pse=Ui*7,dse=Ui*365.25;Ik.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return _se(t);if(n==="number"&&isFinite(t))return e.long?mse(t):fse(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function _se(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*dse;case"weeks":case"week":case"w":return n*pse;case"days":case"day":case"d":return n*Ui;case"hours":case"hour":case"hrs":case"hr":case"h":return n*uc;case"minutes":case"minute":case"mins":case"min":case"m":return n*cc;case"seconds":case"second":case"secs":case"sec":case"s":return n*ac;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fse(t){var e=Math.abs(t);return e>=Ui?Math.round(t/Ui)+"d":e>=uc?Math.round(t/uc)+"h":e>=cc?Math.round(t/cc)+"m":e>=ac?Math.round(t/ac)+"s":t+"ms"}function mse(t){var e=Math.abs(t);return e>=Ui?pf(t,e,Ui,"day"):e>=uc?pf(t,e,uc,"hour"):e>=cc?pf(t,e,cc,"minute"):e>=ac?pf(t,e,ac,"second"):t+" ms"}function pf(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}});var WA=E((H0e,Nk)=>{function hse(t){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Ok(),n.destroy=l,Object.keys(t).forEach(p=>{n[p]=t[p]}),n.names=[],n.skips=[],n.formatters={};function e(p){let d=0;for(let _=0;_<p.length;_++)d=(d<<5)-d+p.charCodeAt(_),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=e;function n(p){let d,_=null,f,m;function h(...T){if(!h.enabled)return;let S=h,R=Number(new Date),I=R-(d||R);S.diff=I,S.prev=d,S.curr=R,d=R,T[0]=n.coerce(T[0]),typeof T[0]!="string"&&T.unshift("%O");let x=0;T[0]=T[0].replace(/%([a-zA-Z%])/g,(B,se)=>{if(B==="%%")return"%";x++;let ve=n.formatters[se];if(typeof ve=="function"){let on=T[x];B=ve.call(S,on),T.splice(x,1),x--}return B}),n.formatArgs.call(S,T),(S.log||n.log).apply(S,T)}return h.namespace=p,h.useColors=n.useColors(),h.color=n.selectColor(p),h.extend=r,h.destroy=n.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(f!==n.namespaces&&(f=n.namespaces,m=n.enabled(p)),m),set:T=>{_=T}}),typeof n.init=="function"&&n.init(h),h}function r(p,d){let _=n(this.namespace+(typeof d>"u"?":":d)+p);return _.log=this.log,_}function o(p){n.save(p),n.namespaces=p,n.names=[],n.skips=[];let d=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of d)_[0]==="-"?n.skips.push(_.slice(1)):n.names.push(_)}function s(p,d){let _=0,f=0,m=-1,h=0;for(;_<p.length;)if(f<d.length&&(d[f]===p[_]||d[f]==="*"))d[f]==="*"?(m=f,h=_,f++):(_++,f++);else if(m!==-1)f=m+1,h++,_=h;else return!1;for(;f<d.length&&d[f]==="*";)f++;return f===d.length}function i(){let p=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),p}function a(p){for(let d of n.skips)if(s(p,d))return!1;for(let d of n.names)if(s(p,d))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Nk.exports=hse});var bk=E((gn,df)=>{gn.formatArgs=Ese;gn.save=Sse;gn.load=gse;gn.useColors=Tse;gn.storage=Ase();gn.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();gn.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"];function Tse(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ese(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+df.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),t.splice(r,0,e)}gn.log=console.debug||console.log||(()=>{});function Sse(t){try{t?gn.storage.setItem("debug",t):gn.storage.removeItem("debug")}catch{}}function gse(){let t;try{t=gn.storage.getItem("debug")||gn.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Ase(){try{return localStorage}catch{}}df.exports=WA()(gn);var{formatters:Rse}=df.exports;Rse.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Pk=E((F0e,Ck)=>{"use strict";Ck.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),o=e.indexOf("--");return r!==-1&&(o===-1||r<o)}});var vk=E((V0e,xk)=>{"use strict";var yse=U("os"),Mk=U("tty"),Jn=Pk(),{env:gt}=process,us;Jn("no-color")||Jn("no-colors")||Jn("color=false")||Jn("color=never")?us=0:(Jn("color")||Jn("colors")||Jn("color=true")||Jn("color=always"))&&(us=1);"FORCE_COLOR"in gt&&(gt.FORCE_COLOR==="true"?us=1:gt.FORCE_COLOR==="false"?us=0:us=gt.FORCE_COLOR.length===0?1:Math.min(parseInt(gt.FORCE_COLOR,10),3));function zA(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function KA(t,e){if(us===0)return 0;if(Jn("color=16m")||Jn("color=full")||Jn("color=truecolor"))return 3;if(Jn("color=256"))return 2;if(t&&!e&&us===void 0)return 0;let n=us||0;if(gt.TERM==="dumb")return n;if(process.platform==="win32"){let r=yse.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in gt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in gt)||gt.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in gt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(gt.TEAMCITY_VERSION)?1:0;if(gt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in gt){let r=parseInt((gt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(gt.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(gt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(gt.TERM)||"COLORTERM"in gt?1:n}function Ise(t){let e=KA(t,t&&t.isTTY);return zA(e)}xk.exports={supportsColor:Ise,stdout:zA(KA(!0,Mk.isatty(1))),stderr:zA(KA(!0,Mk.isatty(2)))}});var Dk=E((At,ff)=>{var Ose=U("tty"),_f=U("util");At.init=vse;At.log=Pse;At.formatArgs=bse;At.save=Mse;At.load=xse;At.useColors=Nse;At.destroy=_f.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");At.colors=[6,2,3,4,5,1];try{let t=vk();t&&(t.stderr||t).level>=2&&(At.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{}At.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function Nse(){return"colors"in At.inspectOpts?!!At.inspectOpts.colors:Ose.isatty(process.stderr.fd)}function bse(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
3
4
  `).join(`
4
- `+s),t.push(o+"m+"+Z_.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=hoe()+e+" "+t[0]}function hoe(){return gt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Eoe(...t){return process.stderr.write(J_.formatWithOptions(gt.inspectOpts,...t)+`
5
- `)}function Soe(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function goe(){return process.env.DEBUG}function Aoe(t){t.inspectOpts={};let e=Object.keys(gt.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=gt.inspectOpts[e[n]]}Z_.exports=yA()(gt);var{formatters:Qw}=Z_.exports;Qw.o=function(t){return this.inspectOpts.colors=this.useColors,J_.inspect(t,this.inspectOpts).split(`
6
- `).map(e=>e.trim()).join(" ")};Qw.O=function(t){return this.inspectOpts.colors=this.useColors,J_.inspect(t,this.inspectOpts)}});var Jw=E((Ave,OA)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?OA.exports=qw():OA.exports=Xw()});var ef=E((Rve,Zw)=>{"use strict";var bA=U("path").sep;Zw.exports=function(t){var e=t.split(bA),n=e.lastIndexOf("node_modules");if(n!==-1&&e[n+1]){for(var r=e[n+1][0]==="@",o=r?e[n+1]+"/"+e[n+2]:e[n+1],s=r?3:2,i="",a=n+s-1,c=0;c<=a;c++)c===a?i+=e[c]:i+=e[c]+bA;for(var l="",p=e.length-1,d=n+s;d<=p;d++)d===p?l+=e[d]:l+=e[d]+bA;return{name:o,basedir:i,path:l}}}});var Pi=E((yve,MA)=>{"use strict";var nc=U("path"),gr=U("module"),ze=Jw()("require-in-the-middle"),Roe=ef();MA.exports=bl;MA.exports.Hook=bl;var CA,tf;if(gr.isBuiltin)tf=gr.isBuiltin;else if(gr.builtinModules)tf=t=>t.startsWith("node:")?!0:(CA===void 0&&(CA=new Set(gr.builtinModules)),CA.has(t));else throw new Error("'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0");var yoe=/([/\\]index)?(\.js)?$/,PA=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,n){if(this._localCache.has(e))return!0;if(n)return!1;{let r=U.cache[e];return!!(r&&this._kRitmExports in r)}}get(e,n){let r=this._localCache.get(e);if(r!==void 0)return r;if(!n){let o=U.cache[e];return o&&o[this._kRitmExports]}}set(e,n,r){r?this._localCache.set(e,n):e in U.cache?U.cache[e][this._kRitmExports]=n:(ze('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,n))}};function bl(t,e,n){if(!(this instanceof bl))return new bl(t,e,n);if(typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null),typeof gr._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof gr._resolveFilename),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);return}this._cache=new PA,this._unhooked=!1,this._origRequire=gr.prototype.require;let r=this,o=new Set,s=e?e.internals===!0:!1,i=Array.isArray(t);ze("registering require hook"),this._require=gr.prototype.require=function(c){return r._unhooked===!0?(ze("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(c){return r._unhooked===!0?(ze("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)});function a(c,l){let p=c[0],d=tf(p),_;if(d){if(_=p,p.startsWith("node:")){let R=p.slice(5);tf(R)&&(_=R)}}else{if(l)return ze("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,c);try{_=gr._resolveFilename(p,this)}catch(R){return ze('Module._resolveFilename("%s") threw %j, calling original Module.require',p,R.message),r._origRequire.apply(this,c)}}let f,m;if(ze("processing %s module require('%s'): %s",d===!0?"core":"non-core",p,_),r._cache.has(_,d)===!0)return ze("returning already patched cached module: %s",_),r._cache.get(_,d);let T=o.has(_);T===!1&&o.add(_);let h=l?r._origGetBuiltinModule.apply(this,c):r._origRequire.apply(this,c);if(T===!0)return ze("module is in the process of being patched already - ignoring: %s",_),h;if(o.delete(_),d===!0){if(i===!0&&t.includes(_)===!1)return ze("ignoring core module not on whitelist: %s",_),h;f=_}else if(i===!0&&t.includes(_)){let R=nc.parse(_);f=R.name,m=R.dir}else{let R=Roe(_);if(R===void 0)return ze("could not parse filename: %s",_),h;f=R.name,m=R.basedir;let I=Ioe(R);ze("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",f,p,I,m);let x=!1;if(i){if(!p.startsWith(".")&&t.includes(p)&&(f=p,x=!0),!t.includes(f)&&!t.includes(I))return h;t.includes(I)&&I!==f&&(f=I,x=!0)}if(!x){let V;try{V=U.resolve(f,{paths:[m]})}catch{return ze("could not resolve module: %s",f),r._cache.set(_,h,d),h}if(V!==_)if(s===!0)f=f+nc.sep+nc.relative(m,_),ze("preparing to process require of internal file: %s",f);else return ze("ignoring require of non-main module file: %s",V),r._cache.set(_,h,d),h}}r._cache.set(_,h,d),ze("calling require hook: %s",f);let S=n(h,f,m);return r._cache.set(_,S,d),ze("returning module: %s",f),S}}bl.prototype.unhook=function(){this._unhooked=!0,this._require===gr.prototype.require?(gr.prototype.require=this._origRequire,ze("require unhook successful")):ze("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,ze("process.getBuiltinModule unhook successful")):ze("process.getBuiltinModule unhook unsuccessful"))};function Ioe(t){let e=nc.sep!=="/"?t.path.split(nc.sep).join("/"):t.path;return nc.posix.join(t.name,e).replace(yoe,"")}});var ek=E(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.ModuleNameTrie=ss.ModuleNameSeparator=void 0;ss.ModuleNameSeparator="/";var nf=class{hooks=[];children=new Map},xA=class{_trie=new nf;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(ss.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new nf,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(ss.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};ss.ModuleNameTrie=xA});var nk=E(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.RequireInTheMiddleSingleton=void 0;var Noe=Pi(),tk=U("path"),vA=ek(),Ooe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),LA=class t{_moduleNameTrie=new vA.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new Noe.Hook(null,{internals:!0},(e,n,r)=>{let o=boe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return Ooe?new t:this._instance=this._instance??new t}};rf.RequireInTheMiddleSingleton=LA;function boe(t){return tk.sep!==vA.ModuleNameSeparator?t.split(tk.sep).join(vA.ModuleNameSeparator):t}});var ak=E(Cl=>{var rk=[],DA=new WeakMap,ok=new WeakMap,sk=new Map,ik=[],Coe={set(t,e,n){let r=DA.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=ok.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=DA.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function Poe(t,e,n,r,o){sk.set(t,o),DA.set(e,n),ok.set(e,r);let s=new Proxy(e,Coe);rk.forEach(i=>i(t,s,o)),ik.push([t,s,o])}Cl.register=Poe;Cl.importHooks=rk;Cl.specifiers=sk;Cl.toHook=ik});var GA=E((Cve,oc)=>{var ck=U("path"),Moe=ef(),{fileURLToPath:xoe}=U("url"),{MessageChannel:voe}=U("worker_threads"),{isBuiltin:UA}=U("module");UA||(UA=()=>!0);var{importHooks:wA,specifiers:Loe,toHook:Doe}=ak();function uk(t){wA.push(t),Doe.forEach(([e,n,r])=>t(e,n,r))}function lk(t){let e=wA.indexOf(t);e>-1&&wA.splice(e,1)}function rc(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var kA;function Uoe(){let{port1:t,port2:e}=new voe,n=0,r;kA=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(l=>{r=l}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function Pl(t,e,n){if(!(this instanceof Pl))return new Pl(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;kA&&Array.isArray(t)&&kA(t),this._iitmHook=(o,s,i)=>{let a=o,c=a.startsWith("node:"),l,p;if(c){let d=o.slice(5);UA(d)&&(o=d)}else if(a.startsWith("file://")){let d=Error.stackTraceLimit;Error.stackTraceLimit=0;try{l=xoe(o),o=l}catch{}if(Error.stackTraceLimit=d,l){let _=Moe(l);_&&(o=_.name,p=_.basedir)}}if(t)for(let d of t)if(l&&d===l)rc(n,s,l,void 0);else if(d===o){if(!p)rc(n,s,o,p);else if(p.endsWith(Loe.get(a)))rc(n,s,o,p);else if(r){let _=o+ck.sep+ck.relative(p,l);rc(n,s,_,p)}}else d===i&&rc(n,s,i,p);else rc(n,s,o,p)},uk(this._iitmHook)}Pl.prototype.unhook=function(){lk(this._iitmHook)};oc.exports=Pl;oc.exports.Hook=Pl;oc.exports.addHook=uk;oc.exports.removeHook=lk;oc.exports.createAddHookMessageChannel=Uoe});var BA=E(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.isWrapped=is.safeExecuteInTheMiddleAsync=is.safeExecuteInTheMiddle=void 0;function woe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}is.safeExecuteInTheMiddle=woe;async function koe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(await e(r,o),r&&!n)throw r;return o}}is.safeExecuteInTheMiddleAsync=koe;function Goe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}is.isWrapped=Goe});var _k=E(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.InstrumentationBase=void 0;var Ml=U("path"),pk=U("util"),Boe=Bw(),jA=gA(),joe=jw(),Hoe=nk(),Voe=GA(),xl=(b(),N(v)),Foe=Pi(),qoe=U("fs"),$oe=BA(),HA=class extends joe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=Hoe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,$oe.isWrapped)(e[n])&&this._unwrap(e,n),pk.types.isProxy(e)){let o=(0,jA.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,jA.wrap)(e,n,r)};_unwrap=(e,n)=>pk.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,jA.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{xl.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){xl.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{xl.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){xl.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){let e=globalThis.require;!e?.resolve||!e?.cache||this._modules.forEach(n=>{let{name:r}=n;try{let o=e.resolve(r);e.cache[o]?.loaded&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,qoe.readFileSync)(Ml.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{xl.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return dk(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=Ml.normalize(r);return i.filter(l=>l.name===a&&dk(l.supportedVersions,s,e.includePrerelease)).reduce((l,p)=>(p.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&Ml.isAbsolute(a)){let l=Ml.parse(a);a=l.name,c=l.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=Ml.isAbsolute(e.name)?new Foe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new Voe.Hook([e.name],{internals:!0},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};of.InstrumentationBase=HA;function dk(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,Boe.satisfies)(e,r,{includePrerelease:n}))}});var fk=E(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.normalize=void 0;var Yoe=U("path");Object.defineProperty(sf,"normalize",{enumerable:!0,get:function(){return Yoe.normalize}})});var mk=E(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.normalize=sc.InstrumentationBase=void 0;var Woe=_k();Object.defineProperty(sc,"InstrumentationBase",{enumerable:!0,get:function(){return Woe.InstrumentationBase}});var zoe=fk();Object.defineProperty(sc,"normalize",{enumerable:!0,get:function(){return zoe.normalize}})});var VA=E(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.normalize=ic.InstrumentationBase=void 0;var Tk=mk();Object.defineProperty(ic,"InstrumentationBase",{enumerable:!0,get:function(){return Tk.InstrumentationBase}});Object.defineProperty(ic,"normalize",{enumerable:!0,get:function(){return Tk.normalize}})});var hk=E(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.InstrumentationNodeModuleDefinition=void 0;var FA=class{files;name;supportedVersions;patch;unpatch;constructor(e,n,r,o,s){this.files=s||[],this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o}};af.InstrumentationNodeModuleDefinition=FA});var Ek=E(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.InstrumentationNodeModuleFile=void 0;var Koe=VA(),qA=class{name;supportedVersions;patch;unpatch;constructor(e,n,r,o){this.name=(0,Koe.normalize)(e),this.supportedVersions=n,this.patch=r,this.unpatch=o}};cf.InstrumentationNodeModuleFile=qA});var Sk=E(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.semconvStabilityFromStr=Mi.SemconvStability=void 0;var uf;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(uf=Mi.SemconvStability||(Mi.SemconvStability={}));function Qoe(t,e){let n=uf.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=uf.DUPLICATE;break}else o.toLowerCase()===t&&(n=uf.STABLE);return n}Mi.semconvStabilityFromStr=Qoe});var ne=E(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.semconvStabilityFromStr=tt.SemconvStability=tt.safeExecuteInTheMiddleAsync=tt.safeExecuteInTheMiddle=tt.isWrapped=tt.InstrumentationNodeModuleFile=tt.InstrumentationNodeModuleDefinition=tt.InstrumentationBase=tt.registerInstrumentations=void 0;var Xoe=Mw();Object.defineProperty(tt,"registerInstrumentations",{enumerable:!0,get:function(){return Xoe.registerInstrumentations}});var Joe=VA();Object.defineProperty(tt,"InstrumentationBase",{enumerable:!0,get:function(){return Joe.InstrumentationBase}});var Zoe=hk();Object.defineProperty(tt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return Zoe.InstrumentationNodeModuleDefinition}});var ese=Ek();Object.defineProperty(tt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return ese.InstrumentationNodeModuleFile}});var $A=BA();Object.defineProperty(tt,"isWrapped",{enumerable:!0,get:function(){return $A.isWrapped}});Object.defineProperty(tt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return $A.safeExecuteInTheMiddle}});Object.defineProperty(tt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return $A.safeExecuteInTheMiddleAsync}});var gk=Sk();Object.defineProperty(tt,"SemconvStability",{enumerable:!0,get:function(){return gk.SemconvStability}});Object.defineProperty(tt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return gk.semconvStabilityFromStr}})});var Ak=E(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.HTTP_FLAVOR_VALUE_HTTP_1_1=q.NET_TRANSPORT_VALUE_IP_UDP=q.NET_TRANSPORT_VALUE_IP_TCP=q.ATTR_NET_TRANSPORT=q.ATTR_NET_PEER_PORT=q.ATTR_NET_PEER_NAME=q.ATTR_NET_PEER_IP=q.ATTR_NET_HOST_PORT=q.ATTR_NET_HOST_NAME=q.ATTR_NET_HOST_IP=q.ATTR_HTTP_USER_AGENT=q.ATTR_HTTP_URL=q.ATTR_HTTP_TARGET=q.ATTR_HTTP_STATUS_CODE=q.ATTR_HTTP_SERVER_NAME=q.ATTR_HTTP_SCHEME=q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=q.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=q.ATTR_HTTP_REQUEST_CONTENT_LENGTH=q.ATTR_HTTP_METHOD=q.ATTR_HTTP_HOST=q.ATTR_HTTP_FLAVOR=q.ATTR_HTTP_CLIENT_IP=q.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST=q.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT=q.ATTR_USER_AGENT_SYNTHETIC_TYPE=void 0;q.ATTR_USER_AGENT_SYNTHETIC_TYPE="user_agent.synthetic.type";q.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT="bot";q.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST="test";q.ATTR_HTTP_CLIENT_IP="http.client_ip";q.ATTR_HTTP_FLAVOR="http.flavor";q.ATTR_HTTP_HOST="http.host";q.ATTR_HTTP_METHOD="http.method";q.ATTR_HTTP_REQUEST_CONTENT_LENGTH="http.request_content_length";q.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED="http.response_content_length_uncompressed";q.ATTR_HTTP_SCHEME="http.scheme";q.ATTR_HTTP_SERVER_NAME="http.server_name";q.ATTR_HTTP_STATUS_CODE="http.status_code";q.ATTR_HTTP_TARGET="http.target";q.ATTR_HTTP_URL="http.url";q.ATTR_HTTP_USER_AGENT="http.user_agent";q.ATTR_NET_HOST_IP="net.host.ip";q.ATTR_NET_HOST_NAME="net.host.name";q.ATTR_NET_HOST_PORT="net.host.port";q.ATTR_NET_PEER_IP="net.peer.ip";q.ATTR_NET_PEER_NAME="net.peer.name";q.ATTR_NET_PEER_PORT="net.peer.port";q.ATTR_NET_TRANSPORT="net.transport";q.NET_TRANSPORT_VALUE_IP_TCP="ip_tcp";q.NET_TRANSPORT_VALUE_IP_UDP="ip_udp";q.HTTP_FLAVOR_VALUE_HTTP_1_1="1.1"});var Rk=E(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.AttributeNames=void 0;var tse;(function(t){t.HTTP_ERROR_NAME="http.error_name",t.HTTP_ERROR_MESSAGE="http.error_message",t.HTTP_STATUS_TEXT="http.status_text"})(tse=vl.AttributeNames||(vl.AttributeNames={}))});var YA=E($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.DEFAULT_QUERY_STRINGS_TO_REDACT=$r.STR_REDACTED=$r.SYNTHETIC_BOT_NAMES=$r.SYNTHETIC_TEST_NAMES=void 0;$r.SYNTHETIC_TEST_NAMES=["alwayson"];$r.SYNTHETIC_BOT_NAMES=["googlebot","bingbot"];$r.STR_REDACTED="REDACTED";$r.DEFAULT_QUERY_STRINGS_TO_REDACT=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"]});var Ik=E((Hve,yk)=>{"use strict";var nse=U("util");function WA(t,e){Error.captureStackTrace(this,WA),this.name=this.constructor.name,this.message=t,this.input=e}nse.inherits(WA,Error);yk.exports=WA});var Ok=E((Vve,Nk)=>{"use strict";function rse(t){return t===34||t===40||t===41||t===44||t===47||t>=58&&t<=64||t>=91&&t<=93||t===123||t===125}function ose(t){return t===33||t>=35&&t<=39||t===42||t===43||t===45||t===46||t>=48&&t<=57||t>=65&&t<=90||t>=94&&t<=122||t===124||t===126}function sse(t){return t>=32&&t<=126}function ise(t){return t>=128&&t<=255}Nk.exports={isDelimiter:rse,isTokenChar:ose,isExtended:ise,isPrint:sse}});var xk=E((Fve,Mk)=>{"use strict";var ase=U("util"),ac=Ik(),lf=Ok(),cse=lf.isDelimiter,bk=lf.isTokenChar,Ck=lf.isExtended,use=lf.isPrint;function Pk(t){return t.replace(/\\(.)/g,"$1")}function Ll(t,e){return ase.format("Unexpected character '%s' at index %d",t.charAt(e),e)}function lse(t){for(var e=!1,n=!1,r=!1,o={},s=[],i=-1,a=-1,c,l,p=0;p<t.length;p++)if(l=t.charCodeAt(p),c===void 0){if(p!==0&&i===-1&&(l===32||l===9))continue;if(bk(l))i===-1&&(i=p);else if(l===61&&i!==-1)c=t.slice(i,p).toLowerCase(),i=-1;else throw new ac(Ll(t,p),t)}else if(n&&(l===9||use(l)||Ck(l)))n=!1;else if(bk(l)){if(a!==-1)throw new ac(Ll(t,p),t);i===-1&&(i=p)}else if(cse(l)||Ck(l))if(r)l===34?(r=!1,a=p):l===92?(i===-1&&(i=p),n=e=!0):i===-1&&(i=p);else if(l===34&&t.charCodeAt(p-1)===61)r=!0;else if((l===44||l===59)&&(i!==-1||a!==-1))i!==-1?(a===-1&&(a=p),o[c]=e?Pk(t.slice(i,a)):t.slice(i,a)):o[c]="",l===44&&(s.push(o),o={}),c=void 0,i=a=-1;else throw new ac(Ll(t,p),t);else if(l===32||l===9){if(a!==-1)continue;if(r)i===-1&&(i=p);else if(i!==-1)a=p;else throw new ac(Ll(t,p),t)}else throw new ac(Ll(t,p),t);if(c===void 0||r||i===-1&&a===-1||l===32||l===9)throw new ac("Unexpected end of input",t);return i!==-1?(a===-1&&(a=p),o[c]=e?Pk(t.slice(i,a)):t.slice(i,a)):o[c]="",s.push(o),s}Mk.exports=lse});var jk=E($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.headerCapture=$.getIncomingStableRequestMetricAttributesOnResponse=$.getIncomingRequestMetricAttributesOnResponse=$.getIncomingRequestAttributesOnResponse=$.getIncomingRequestMetricAttributes=$.getIncomingRequestAttributes=$.getRemoteClientAddress=$.getOutgoingStableRequestMetricAttributesOnResponse=$.getOutgoingRequestMetricAttributesOnResponse=$.getOutgoingRequestAttributesOnResponse=$.setAttributesFromHttpKind=$.getOutgoingRequestMetricAttributes=$.getOutgoingRequestAttributes=$.extractHostnameAndPort=$.isValidOptionsType=$.getRequestInfo=$.isCompressed=$.setResponseContentLengthAttribute=$.setRequestContentLengthAttribute=$.setSpanWithError=$.satisfiesPattern=$.parseResponseStatus=$.getAbsoluteUrl=void 0;var Dl=(b(),N(v)),ae=(le(),N(Ae)),F=Ak(),vk=he(),Un=ne(),pse=U("url"),df=Rk(),Lk=YA(),pf=YA(),dse=xk(),_se=(t,e,n="http:",r=Array.from(pf.DEFAULT_QUERY_STRINGS_TO_REDACT))=>{let o=t||{},s=o.protocol||n,i=(o.port||"").toString(),a=o.path||"/",c=o.host||o.hostname||e.host||"localhost";if(c.indexOf(":")===-1&&i&&i!=="80"&&i!=="443"&&(c+=`:${i}`),a.includes("?"))try{let p=new URL(a,"http://localhost"),d=r||[];for(let _ of d)p.searchParams.get(_)&&p.searchParams.set(_,pf.STR_REDACTED);a=`${p.pathname}${p.search}`}catch{}let l=o.auth?`${pf.STR_REDACTED}:${pf.STR_REDACTED}@`:"";return`${s}//${l}${c}${a}`};$.getAbsoluteUrl=_se;var fse=(t,e)=>{let n=t===Dl.SpanKind.CLIENT?400:500;return e&&e>=100&&e<n?Dl.SpanStatusCode.UNSET:Dl.SpanStatusCode.ERROR};$.parseResponseStatus=fse;var mse=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")};$.satisfiesPattern=mse;var Tse=(t,e,n)=>{let r=e.message;n&Un.SemconvStability.OLD&&(t.setAttribute(df.AttributeNames.HTTP_ERROR_NAME,e.name),t.setAttribute(df.AttributeNames.HTTP_ERROR_MESSAGE,r)),n&Un.SemconvStability.STABLE&&t.setAttribute(ae.ATTR_ERROR_TYPE,e.name),t.setStatus({code:Dl.SpanStatusCode.ERROR,message:r}),t.recordException(e)};$.setSpanWithError=Tse;var hse=(t,e)=>{let n=Uk(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[F.ATTR_HTTP_REQUEST_CONTENT_LENGTH]=n:e[F.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setRequestContentLengthAttribute=hse;var Ese=(t,e)=>{let n=Uk(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[F.ATTR_HTTP_RESPONSE_CONTENT_LENGTH]=n:e[F.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setResponseContentLengthAttribute=Ese;function Uk(t){let e=t["content-length"];if(e===void 0)return null;let n=parseInt(e,10);return isNaN(n)?null:n}var Sse=t=>{let e=t["content-encoding"];return!!e&&e!=="identity"};$.isCompressed=Sse;function gse(t){let{hostname:e,pathname:n,port:r,username:o,password:s,search:i,protocol:a,hash:c,href:l,origin:p,host:d}=new URL(t),_={protocol:a,hostname:e&&e[0]==="["?e.slice(1,-1):e,hash:c,search:i,pathname:n,path:`${n||""}${i||""}`,href:l,origin:p,host:d};return r!==""&&(_.port=Number(r)),(o||s)&&(_.auth=`${decodeURIComponent(o)}:${decodeURIComponent(s)}`),_}var Ase=(t,e,n)=>{let r,o,s,i=!1;if(typeof e=="string"){try{let c=gse(e);s=c,r=c.pathname||"/"}catch(c){i=!0,t.verbose("Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:",c),s={path:e},r=s.path||"/"}o=`${s.protocol||"http:"}//${s.host}`,n!==void 0&&Object.assign(s,n)}else if(e instanceof pse.URL)s={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,path:`${e.pathname||""}${e.search||""}`},e.port!==""&&(s.port=Number(e.port)),(e.username||e.password)&&(s.auth=`${e.username}:${e.password}`),r=e.pathname,o=e.origin,n!==void 0&&Object.assign(s,n);else{s=Object.assign({protocol:e.host?"http:":void 0},e);let c=s.host||(s.port!=null?`${s.hostname}${s.port}`:s.hostname);if(o=`${s.protocol||"http:"}//${c}`,r=e.pathname,!r&&s.path)try{r=new URL(s.path,o).pathname||"/"}catch{r="/"}}let a=s.method?s.method.toUpperCase():"GET";return{origin:o,pathname:r,method:a,optionsParsed:s,invalidUrl:i}};$.getRequestInfo=Ase;var Rse=t=>{if(!t)return!1;let e=typeof t;return e==="string"||e==="object"&&!Array.isArray(t)};$.isValidOptionsType=Rse;var yse=t=>{if(t.hostname&&t.port)return{hostname:t.hostname,port:t.port};let e=t.host?.match(/^([^:/ ]+)(:\d{1,5})?/)||null,n=t.hostname||(e===null?"localhost":e[1]),r=t.port;return r||(e&&e[2]?r=e[2].substring(1):r=t.protocol==="https:"?"443":"80"),{hostname:n,port:r}};$.extractHostnameAndPort=yse;var Ise=(t,e,n,r)=>{let o=e.hostname,s=e.port,i=t.method??"GET",a=Gk(i),c=t.headers||{},l=c["user-agent"],p=(0,$.getAbsoluteUrl)(t,c,`${e.component}:`,e.redactedQueryParams),d={[F.ATTR_HTTP_URL]:p,[F.ATTR_HTTP_METHOD]:i,[F.ATTR_HTTP_TARGET]:t.path||"/",[F.ATTR_NET_PEER_NAME]:o,[F.ATTR_HTTP_HOST]:c.host??`${o}:${s}`},_={[ae.ATTR_HTTP_REQUEST_METHOD]:a,[ae.ATTR_SERVER_ADDRESS]:o,[ae.ATTR_SERVER_PORT]:Number(s),[ae.ATTR_URL_FULL]:p,[ae.ATTR_USER_AGENT_ORIGINAL]:l};switch(i!==a&&(_[ae.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=i),r&&l&&(_[F.ATTR_USER_AGENT_SYNTHETIC_TYPE]=wk(l)),l!==void 0&&(d[F.ATTR_HTTP_USER_AGENT]=l),n){case Un.SemconvStability.STABLE:return Object.assign(_,e.hookAttributes);case Un.SemconvStability.OLD:return Object.assign(d,e.hookAttributes)}return Object.assign(d,_,e.hookAttributes)};$.getOutgoingRequestAttributes=Ise;var Nse=t=>{let e={};return e[F.ATTR_HTTP_METHOD]=t[F.ATTR_HTTP_METHOD],e[F.ATTR_NET_PEER_NAME]=t[F.ATTR_NET_PEER_NAME],e};$.getOutgoingRequestMetricAttributes=Nse;var Ose=(t,e)=>{t&&(e[F.ATTR_HTTP_FLAVOR]=t,t.toUpperCase()!=="QUIC"?e[F.ATTR_NET_TRANSPORT]=F.NET_TRANSPORT_VALUE_IP_TCP:e[F.ATTR_NET_TRANSPORT]=F.NET_TRANSPORT_VALUE_IP_UDP)};$.setAttributesFromHttpKind=Ose;var wk=t=>{let e=String(t).toLowerCase();for(let n of Lk.SYNTHETIC_TEST_NAMES)if(e.includes(n))return F.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST;for(let n of Lk.SYNTHETIC_BOT_NAMES)if(e.includes(n))return F.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT},bse=(t,e)=>{let{statusCode:n,statusMessage:r,httpVersion:o,socket:s}=t,i={},a={};if(n!=null&&(a[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]=n),s){let{remoteAddress:c,remotePort:l}=s;i[F.ATTR_NET_PEER_IP]=c,i[F.ATTR_NET_PEER_PORT]=l,a[ae.ATTR_NETWORK_PEER_ADDRESS]=c,a[ae.ATTR_NETWORK_PEER_PORT]=l,a[ae.ATTR_NETWORK_PROTOCOL_VERSION]=t.httpVersion}switch((0,$.setResponseContentLengthAttribute)(t,i),n&&(i[F.ATTR_HTTP_STATUS_CODE]=n,i[df.AttributeNames.HTTP_STATUS_TEXT]=(r||"").toUpperCase()),(0,$.setAttributesFromHttpKind)(o,i),e){case Un.SemconvStability.STABLE:return a;case Un.SemconvStability.OLD:return i}return Object.assign(i,a)};$.getOutgoingRequestAttributesOnResponse=bse;var Cse=t=>{let e={};return e[F.ATTR_NET_PEER_PORT]=t[F.ATTR_NET_PEER_PORT],e[F.ATTR_HTTP_STATUS_CODE]=t[F.ATTR_HTTP_STATUS_CODE],e[F.ATTR_HTTP_FLAVOR]=t[F.ATTR_HTTP_FLAVOR],e};$.getOutgoingRequestMetricAttributesOnResponse=Cse;var Pse=t=>{let e={};return t[ae.ATTR_NETWORK_PROTOCOL_VERSION]&&(e[ae.ATTR_NETWORK_PROTOCOL_VERSION]=t[ae.ATTR_NETWORK_PROTOCOL_VERSION]),t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(e[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]=t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]),e};$.getOutgoingStableRequestMetricAttributesOnResponse=Pse;function as(t,e){let n=t.split(":");if(n.length===1)return e==="http"?{host:n[0],port:"80"}:e==="https"?{host:n[0],port:"443"}:{host:n[0]};if(n.length===2)return{host:n[0],port:n[1]};if(n[0].startsWith("[")){if(n[n.length-1].endsWith("]")){if(e==="http")return{host:t,port:"80"};if(e==="https")return{host:t,port:"443"}}else if(n[n.length-2].endsWith("]"))return{host:n.slice(0,-1).join(":"),port:n[n.length-1]}}return{host:t}}function Mse(t,e){let n=t.headers.forwarded;if(n){for(let s of Bk(n))if(s.host)return as(s.host,s.proto)}let r=t.headers["x-forwarded-host"];if(typeof r=="string")return typeof t.headers["x-forwarded-proto"]=="string"?as(r,t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?as(r,t.headers["x-forwarded-proto"][0]):as(r);if(Array.isArray(r)&&typeof r[0]=="string"&&r[0].length>0)return typeof t.headers["x-forwarded-proto"]=="string"?as(r[0],t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?as(r[0],t.headers["x-forwarded-proto"][0]):as(r[0]);let o=t.headers.host;return typeof o=="string"&&o.length>0?as(o,e):null}function kk(t){let e=t.headers.forwarded;if(e){for(let o of Bk(e))if(o.for)return Dk(o.for)}let n=t.headers["x-forwarded-for"];if(n){let o;if(typeof n=="string"?o=n:Array.isArray(n)&&(o=n[0]),typeof o=="string")return o=o.split(",")[0].trim(),Dk(o)}let r=t.socket.remoteAddress;return r||null}$.getRemoteClientAddress=kk;function Dk(t){try{let{hostname:e}=new URL(`http://${t}`);return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}catch{return t}}function xse(t,e,n){try{if(e.headers.host)return new URL(e.url??"/",`${t}://${e.headers.host}`);{let r=new URL(e.url??"/",`${t}://localhost`);return{pathname:r.pathname,search:r.search,toString:function(){return r.pathname+r.search}}}}catch(r){return n.verbose("Unable to get URL from request",r),{}}}var vse=(t,e,n)=>{let{component:r,enableSyntheticSourceDetection:o,hookAttributes:s,semconvStability:i,serverName:a}=e,{headers:c,httpVersion:l,method:p}=t,{host:d,"user-agent":_,"x-forwarded-for":f}=c,m=xse(r,t,n),T,h;if(i!==Un.SemconvStability.OLD){let S=Gk(p),R=Mse(t,r),I=kk(t);T={[ae.ATTR_HTTP_REQUEST_METHOD]:S,[ae.ATTR_URL_SCHEME]:r,[ae.ATTR_SERVER_ADDRESS]:R?.host,[ae.ATTR_NETWORK_PEER_ADDRESS]:t.socket.remoteAddress,[ae.ATTR_NETWORK_PEER_PORT]:t.socket.remotePort,[ae.ATTR_NETWORK_PROTOCOL_VERSION]:t.httpVersion,[ae.ATTR_USER_AGENT_ORIGINAL]:_},m.pathname!=null&&(T[ae.ATTR_URL_PATH]=m.pathname),m.search&&(T[ae.ATTR_URL_QUERY]=m.search.slice(1)),I!=null&&(T[ae.ATTR_CLIENT_ADDRESS]=I),R?.port!=null&&(T[ae.ATTR_SERVER_PORT]=Number(R.port)),p!==S&&(T[ae.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=p),o&&_&&(T[F.ATTR_USER_AGENT_SYNTHETIC_TYPE]=wk(_))}if(i!==Un.SemconvStability.STABLE){let S=d?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost";h={[F.ATTR_HTTP_URL]:m.toString(),[F.ATTR_HTTP_HOST]:d,[F.ATTR_NET_HOST_NAME]:S,[F.ATTR_HTTP_METHOD]:p,[F.ATTR_HTTP_SCHEME]:r},typeof f=="string"&&(h[F.ATTR_HTTP_CLIENT_IP]=f.split(",")[0]),typeof a=="string"&&(h[F.ATTR_HTTP_SERVER_NAME]=a),m.pathname&&(h[F.ATTR_HTTP_TARGET]=m.pathname+m.search||"/"),_!==void 0&&(h[F.ATTR_HTTP_USER_AGENT]=_),(0,$.setRequestContentLengthAttribute)(t,h),(0,$.setAttributesFromHttpKind)(l,h)}switch(i){case Un.SemconvStability.STABLE:return Object.assign(T,s);case Un.SemconvStability.OLD:return Object.assign(h,s);default:return Object.assign(h,T,s)}};$.getIncomingRequestAttributes=vse;var Lse=t=>{let e={};return e[F.ATTR_HTTP_SCHEME]=t[F.ATTR_HTTP_SCHEME],e[F.ATTR_HTTP_METHOD]=t[F.ATTR_HTTP_METHOD],e[F.ATTR_NET_HOST_NAME]=t[F.ATTR_NET_HOST_NAME],e[F.ATTR_HTTP_FLAVOR]=t[F.ATTR_HTTP_FLAVOR],e};$.getIncomingRequestMetricAttributes=Lse;var Dse=(t,e,n)=>{let{socket:r}=t,{statusCode:o,statusMessage:s}=e,i={[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]:o},a=(0,vk.getRPCMetadata)(Dl.context.active()),c={};if(r){let{localAddress:l,localPort:p,remoteAddress:d,remotePort:_}=r;c[F.ATTR_NET_HOST_IP]=l,c[F.ATTR_NET_HOST_PORT]=p,c[F.ATTR_NET_PEER_IP]=d,c[F.ATTR_NET_PEER_PORT]=_}switch(c[F.ATTR_HTTP_STATUS_CODE]=o,c[df.AttributeNames.HTTP_STATUS_TEXT]=(s||"").toUpperCase(),a?.type===vk.RPCType.HTTP&&a.route!==void 0&&(c[ae.ATTR_HTTP_ROUTE]=a.route,i[ae.ATTR_HTTP_ROUTE]=a.route),n){case Un.SemconvStability.STABLE:return i;case Un.SemconvStability.OLD:return c}return Object.assign(c,i)};$.getIncomingRequestAttributesOnResponse=Dse;var Use=t=>{let e={};return e[F.ATTR_HTTP_STATUS_CODE]=t[F.ATTR_HTTP_STATUS_CODE],e[F.ATTR_NET_HOST_PORT]=t[F.ATTR_NET_HOST_PORT],t[ae.ATTR_HTTP_ROUTE]!==void 0&&(e[ae.ATTR_HTTP_ROUTE]=t[ae.ATTR_HTTP_ROUTE]),e};$.getIncomingRequestMetricAttributesOnResponse=Use;var wse=t=>{let e={};return t[ae.ATTR_HTTP_ROUTE]!==void 0&&(e[ae.ATTR_HTTP_ROUTE]=t[ae.ATTR_HTTP_ROUTE]),t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(e[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]=t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]),e};$.getIncomingStableRequestMetricAttributesOnResponse=wse;function kse(t,e,n){let r=new Map;for(let o=0,s=e.length;o<s;o++){let i=e[o].toLowerCase();n&Un.SemconvStability.STABLE?r.set(i,i):r.set(i,i.replaceAll("-","_"))}return o=>{let s={};for(let i of r.keys()){let a=o(i);if(a===void 0)continue;let c=r.get(i),l=`http.${t}.header.${c}`;typeof a=="string"?s[l]=[a]:Array.isArray(a)?s[l]=a:s[l]=[a]}return s}}$.headerCapture=kse;var Gse=new Set(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH","QUERY"]);function Gk(t){if(t==null)return"GET";let e=t.toUpperCase();return Gse.has(e)?e:"_OTHER"}function Bk(t){try{return dse(t)}catch{return[]}}});var Hk=E(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.HttpInstrumentation=void 0;var oe=(b(),N(v)),cs=he(),Bse=U("url"),jse=Sw(),At=ne(),zA=U("events"),Le=(le(),N(Ae)),Ke=jk(),KA=class extends At.InstrumentationBase{_spanNotEnded=new WeakSet;_headerCapture;_httpPatched=!1;_httpsPatched=!1;_semconvStability=At.SemconvStability.OLD;constructor(e={}){super("@opentelemetry/instrumentation-http",jse.VERSION,e),this._semconvStability=(0,At.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._headerCapture=this._createHeaderCapture(this._semconvStability)}_updateMetricInstruments(){this._oldHttpServerDurationHistogram=this.meter.createHistogram("http.server.duration",{description:"Measures the duration of inbound HTTP requests.",unit:"ms",valueType:oe.ValueType.DOUBLE}),this._oldHttpClientDurationHistogram=this.meter.createHistogram("http.client.duration",{description:"Measures the duration of outbound HTTP requests.",unit:"ms",valueType:oe.ValueType.DOUBLE}),this._stableHttpServerDurationHistogram=this.meter.createHistogram(Le.METRIC_HTTP_SERVER_REQUEST_DURATION,{description:"Duration of HTTP server requests.",unit:"s",valueType:oe.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}}),this._stableHttpClientDurationHistogram=this.meter.createHistogram(Le.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:"Duration of HTTP client requests.",unit:"s",valueType:oe.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}_recordServerDuration(e,n,r){this._semconvStability&At.SemconvStability.OLD&&this._oldHttpServerDurationHistogram.record(e,n),this._semconvStability&At.SemconvStability.STABLE&&this._stableHttpServerDurationHistogram.record(e/1e3,r)}_recordClientDuration(e,n,r){this._semconvStability&At.SemconvStability.OLD&&this._oldHttpClientDurationHistogram.record(e,n),this._semconvStability&At.SemconvStability.STABLE&&this._stableHttpClientDurationHistogram.record(e/1e3,r)}setConfig(e={}){super.setConfig(e),this._headerCapture=this._createHeaderCapture(this._semconvStability)}init(){return[this._getHttpsInstrumentation(),this._getHttpInstrumentation()]}_getHttpInstrumentation(){return new At.InstrumentationNodeModuleDefinition("http",["*"],e=>{if(this._httpPatched)return e;this._httpPatched=!0;let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchOutgoingRequestFunction("http")),o=this._wrap(e,"get",this._getPatchOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("http")),e},e=>{this._httpPatched=!1,e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getHttpsInstrumentation(){return new At.InstrumentationNodeModuleDefinition("https",["*"],e=>{if(this._httpsPatched)return e;this._httpsPatched=!0;let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchHttpsOutgoingRequestFunction("https")),o=this._wrap(e,"get",this._getPatchHttpsOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("https")),e},e=>{this._httpsPatched=!1,e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getPatchIncomingRequestFunction(e){return n=>this._incomingRequestFunction(e,n)}_getPatchOutgoingRequestFunction(e){return n=>this._outgoingRequestFunction(e,n)}_getPatchOutgoingGetFunction(e){return n=>function(o,...s){let i=e(o,...s);return i.end(),i}}_getPatchHttpsOutgoingRequestFunction(e){return n=>{let r=this;return function(s,...i){return e==="https"&&typeof s=="object"&&s?.constructor?.name!=="URL"&&(s=Object.assign({},s),r._setDefaultOptions(s)),r._getPatchOutgoingRequestFunction(e)(n)(s,...i)}}}_setDefaultOptions(e){e.protocol=e.protocol||"https:",e.port=e.port||443}_getPatchHttpsOutgoingGetFunction(e){return n=>{let r=this;return function(s,...i){return r._getPatchOutgoingGetFunction(e)(n)(s,...i)}}}_traceClientRequest(e,n,r,o,s){this.getConfig().requestHook&&this._callRequestHook(n,e);let i=!1;return e.prependListener("response",a=>{this._diag.debug("outgoingRequest on response()"),e.listenerCount("response")<=1&&a.resume();let c=(0,Ke.getOutgoingRequestAttributesOnResponse)(a,this._semconvStability);n.setAttributes(c),o=Object.assign(o,(0,Ke.getOutgoingRequestMetricAttributesOnResponse)(c)),s=Object.assign(s,(0,Ke.getOutgoingStableRequestMetricAttributesOnResponse)(c)),this.getConfig().responseHook&&this._callResponseHook(n,a),n.setAttributes(this._headerCapture.client.captureRequestHeaders(p=>e.getHeader(p))),n.setAttributes(this._headerCapture.client.captureResponseHeaders(p=>a.headers[p])),oe.context.bind(oe.context.active(),a);let l=()=>{if(this._diag.debug("outgoingRequest on end()"),i)return;i=!0;let p;a.aborted&&!a.complete?p={code:oe.SpanStatusCode.ERROR}:p={code:(0,Ke.parseResponseStatus)(oe.SpanKind.CLIENT,a.statusCode)},n.setStatus(p),this.getConfig().applyCustomAttributesOnSpan&&(0,At.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(n,e,a),()=>{},!0),this._closeHttpSpan(n,oe.SpanKind.CLIENT,r,o,s)};a.on("end",l),a.on(zA.errorMonitor,p=>{this._diag.debug("outgoingRequest on error()",p),!i&&(i=!0,this._onOutgoingRequestError(n,o,s,r,p))})}),e.on("close",()=>{this._diag.debug("outgoingRequest on request close()"),!(e.aborted||i)&&(i=!0,this._closeHttpSpan(n,oe.SpanKind.CLIENT,r,o,s))}),e.on(zA.errorMonitor,a=>{this._diag.debug("outgoingRequest on request error()",a),!i&&(i=!0,this._onOutgoingRequestError(n,o,s,r,a))}),this._diag.debug("http.ClientRequest return request"),e}_incomingRequestFunction(e,n){let r=this;return function(s,...i){if(s!=="request")return n.apply(this,[s,...i]);let a=i[0],c=i[1],l=a.method||"GET";if(r._diag.debug(`${e} instrumentation incomingRequest`),(0,At.safeExecuteInTheMiddle)(()=>r.getConfig().ignoreIncomingRequestHook?.(a),I=>{I!=null&&r._diag.error("caught ignoreIncomingRequestHook error: ",I)},!0))return oe.context.with((0,cs.suppressTracing)(oe.context.active()),()=>(oe.context.bind(oe.context.active(),a),oe.context.bind(oe.context.active(),c),n.apply(this,[s,...i])));let p=a.headers,d=(0,Ke.getIncomingRequestAttributes)(a,{component:e,serverName:r.getConfig().serverName,hookAttributes:r._callStartSpanHook(a,r.getConfig().startIncomingSpanHook),semconvStability:r._semconvStability,enableSyntheticSourceDetection:r.getConfig().enableSyntheticSourceDetection||!1},r._diag);Object.assign(d,r._headerCapture.server.captureRequestHeaders(I=>a.headers[I]));let _={kind:oe.SpanKind.SERVER,attributes:d},f=(0,cs.hrTime)(),m=(0,Ke.getIncomingRequestMetricAttributes)(d),T={[Le.ATTR_HTTP_REQUEST_METHOD]:d[Le.ATTR_HTTP_REQUEST_METHOD],[Le.ATTR_URL_SCHEME]:d[Le.ATTR_URL_SCHEME]};d[Le.ATTR_NETWORK_PROTOCOL_VERSION]&&(T[Le.ATTR_NETWORK_PROTOCOL_VERSION]=d[Le.ATTR_NETWORK_PROTOCOL_VERSION]);let h=oe.propagation.extract(oe.ROOT_CONTEXT,p),S=r._startHttpSpan(l,_,h),R={type:cs.RPCType.HTTP,span:S};return oe.context.with((0,cs.setRPCMetadata)(oe.trace.setSpan(h,S),R),()=>{oe.context.bind(oe.context.active(),a),oe.context.bind(oe.context.active(),c),r.getConfig().requestHook&&r._callRequestHook(S,a),r.getConfig().responseHook&&r._callResponseHook(S,c);let I=!1;return c.on("close",()=>{I||r._onServerResponseFinish(a,c,S,m,T,f)}),c.on(zA.errorMonitor,x=>{I=!0,r._onServerResponseError(S,m,T,f,x)}),(0,At.safeExecuteInTheMiddle)(()=>n.apply(this,[s,...i]),x=>{if(x)throw r._onServerResponseError(S,m,T,f,x),x})})}}_outgoingRequestFunction(e,n){let r=this;return function(s,...i){if(!(0,Ke.isValidOptionsType)(s))return n.apply(this,[s,...i]);let a=typeof i[0]=="object"&&(typeof s=="string"||s instanceof Bse.URL)?i.shift():void 0,{method:c,invalidUrl:l,optionsParsed:p}=(0,Ke.getRequestInfo)(r._diag,s,a);if((0,At.safeExecuteInTheMiddle)(()=>r.getConfig().ignoreOutgoingRequestHook?.(p),V=>{V!=null&&r._diag.error("caught ignoreOutgoingRequestHook error: ",V)},!0))return n.apply(this,[p,...i]);let{hostname:d,port:_}=(0,Ke.extractHostnameAndPort)(p),f=(0,Ke.getOutgoingRequestAttributes)(p,{component:e,port:_,hostname:d,hookAttributes:r._callStartSpanHook(p,r.getConfig().startOutgoingSpanHook),redactedQueryParams:r.getConfig().redactedQueryParams},r._semconvStability,r.getConfig().enableSyntheticSourceDetection||!1),m=(0,cs.hrTime)(),T=(0,Ke.getOutgoingRequestMetricAttributes)(f),h={[Le.ATTR_HTTP_REQUEST_METHOD]:f[Le.ATTR_HTTP_REQUEST_METHOD],[Le.ATTR_SERVER_ADDRESS]:f[Le.ATTR_SERVER_ADDRESS],[Le.ATTR_SERVER_PORT]:f[Le.ATTR_SERVER_PORT]};f[Le.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(h[Le.ATTR_HTTP_RESPONSE_STATUS_CODE]=f[Le.ATTR_HTTP_RESPONSE_STATUS_CODE]),f[Le.ATTR_NETWORK_PROTOCOL_VERSION]&&(h[Le.ATTR_NETWORK_PROTOCOL_VERSION]=f[Le.ATTR_NETWORK_PROTOCOL_VERSION]);let S={kind:oe.SpanKind.CLIENT,attributes:f},R=r._startHttpSpan(c,S),I=oe.context.active(),x=oe.trace.setSpan(I,R);return p.headers?p.headers=Object.assign({},p.headers):p.headers={},oe.propagation.inject(x,p.headers),oe.context.with(x,()=>{let V=i[i.length-1];typeof V=="function"&&(i[i.length-1]=oe.context.bind(I,V));let B=(0,At.safeExecuteInTheMiddle)(()=>l?n.apply(this,[s,...i]):n.apply(this,[p,...i]),se=>{if(se)throw r._onOutgoingRequestError(R,T,h,m,se),se});return r._diag.debug(`${e} instrumentation outgoingRequest`),oe.context.bind(I,B),r._traceClientRequest(B,R,m,T,h)})}}_onServerResponseFinish(e,n,r,o,s,i){let a=(0,Ke.getIncomingRequestAttributesOnResponse)(e,n,this._semconvStability);o=Object.assign(o,(0,Ke.getIncomingRequestMetricAttributesOnResponse)(a)),s=Object.assign(s,(0,Ke.getIncomingStableRequestMetricAttributesOnResponse)(a)),r.setAttributes(this._headerCapture.server.captureResponseHeaders(l=>n.getHeader(l))),r.setAttributes(a).setStatus({code:(0,Ke.parseResponseStatus)(oe.SpanKind.SERVER,n.statusCode)});let c=a[Le.ATTR_HTTP_ROUTE];c&&r.updateName(`${e.method||"GET"} ${c}`),this.getConfig().applyCustomAttributesOnSpan&&(0,At.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(r,e,n),()=>{},!0),this._closeHttpSpan(r,oe.SpanKind.SERVER,i,o,s)}_onOutgoingRequestError(e,n,r,o,s){(0,Ke.setSpanWithError)(e,s,this._semconvStability),r[Le.ATTR_ERROR_TYPE]=s.name,this._closeHttpSpan(e,oe.SpanKind.CLIENT,o,n,r)}_onServerResponseError(e,n,r,o,s){(0,Ke.setSpanWithError)(e,s,this._semconvStability),r[Le.ATTR_ERROR_TYPE]=s.name,this._closeHttpSpan(e,oe.SpanKind.SERVER,o,n,r)}_startHttpSpan(e,n,r=oe.context.active()){let o=n.kind===oe.SpanKind.CLIENT?this.getConfig().requireParentforOutgoingSpans:this.getConfig().requireParentforIncomingSpans,s,i=oe.trace.getSpan(r);return o===!0&&(!i||!oe.trace.isSpanContextValid(i.spanContext()))?s=oe.trace.wrapSpanContext(oe.INVALID_SPAN_CONTEXT):o===!0&&i?.spanContext().isRemote?s=i:s=this.tracer.startSpan(e,n,r),this._spanNotEnded.add(s),s}_closeHttpSpan(e,n,r,o,s){if(!this._spanNotEnded.has(e))return;e.end(),this._spanNotEnded.delete(e);let i=(0,cs.hrTimeToMilliseconds)((0,cs.hrTimeDuration)(r,(0,cs.hrTime)()));n===oe.SpanKind.SERVER?this._recordServerDuration(i,o,s):n===oe.SpanKind.CLIENT&&this._recordClientDuration(i,o,s)}_callResponseHook(e,n){(0,At.safeExecuteInTheMiddle)(()=>this.getConfig().responseHook(e,n),()=>{},!0)}_callRequestHook(e,n){(0,At.safeExecuteInTheMiddle)(()=>this.getConfig().requestHook(e,n),()=>{},!0)}_callStartSpanHook(e,n){if(typeof n=="function")return(0,At.safeExecuteInTheMiddle)(()=>n(e),()=>{},!0)}_createHeaderCapture(e){let n=this.getConfig();return{client:{captureRequestHeaders:(0,Ke.headerCapture)("request",n.headersToSpanAttributes?.client?.requestHeaders??[],e),captureResponseHeaders:(0,Ke.headerCapture)("response",n.headersToSpanAttributes?.client?.responseHeaders??[],e)},server:{captureRequestHeaders:(0,Ke.headerCapture)("request",n.headersToSpanAttributes?.server?.requestHeaders??[],e),captureResponseHeaders:(0,Ke.headerCapture)("response",n.headersToSpanAttributes?.server?.responseHeaders??[],e)}}}};_f.HttpInstrumentation=KA});var Vk=E(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.HttpInstrumentation=void 0;var Hse=Hk();Object.defineProperty(ff,"HttpInstrumentation",{enumerable:!0,get:function(){return Hse.HttpInstrumentation}})});var zy=E(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.AbstractAsyncHooksContextManager=void 0;var Rle=U("events"),yle=["addListener","on","once","prependListener","prependOnceListener"],Wy=class{bind(e,n){return n instanceof Rle.EventEmitter?this._bindEventEmitter(e,n):typeof n=="function"?this._bindFunction(e,n):n}_bindFunction(e,n){let r=this,o=function(...s){return r.with(e,()=>n.apply(this,s))};return Object.defineProperty(o,"length",{enumerable:!1,configurable:!0,writable:!1,value:n.length}),o}_bindEventEmitter(e,n){return this._getPatchMap(n)!==void 0||(this._createPatchMap(n),yle.forEach(o=>{n[o]!==void 0&&(n[o]=this._patchAddListener(n,n[o],e))}),typeof n.removeListener=="function"&&(n.removeListener=this._patchRemoveListener(n,n.removeListener)),typeof n.off=="function"&&(n.off=this._patchRemoveListener(n,n.off)),typeof n.removeAllListeners=="function"&&(n.removeAllListeners=this._patchRemoveAllListeners(n,n.removeAllListeners))),n}_patchRemoveListener(e,n){let r=this;return function(o,s){let i=r._getPatchMap(e)?.[o];if(i===void 0)return n.call(this,o,s);let a=i.get(s);return n.call(this,o,a||s)}}_patchRemoveAllListeners(e,n){let r=this;return function(o){let s=r._getPatchMap(e);return s!==void 0&&(arguments.length===0?r._createPatchMap(e):s[o]!==void 0&&delete s[o]),n.apply(this,arguments)}}_patchAddListener(e,n,r){let o=this;return function(s,i){if(o._wrapped)return n.call(this,s,i);let a=o._getPatchMap(e);a===void 0&&(a=o._createPatchMap(e));let c=a[s];c===void 0&&(c=new WeakMap,a[s]=c);let l=o.bind(r,i);c.set(i,l),o._wrapped=!0;try{return n.call(this,s,l)}finally{o._wrapped=!1}}}_createPatchMap(e){let n=Object.create(null);return e[this._kOtListeners]=n,n}_getPatchMap(e){return e[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1};Om.AbstractAsyncHooksContextManager=Wy});var Yj=E(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.AsyncHooksContextManager=void 0;var Ile=(b(),N(v)),Nle=U("async_hooks"),Ole=zy(),Ky=class extends Ole.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super(),this._asyncHook=Nle.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??Ile.ROOT_CONTEXT}with(e,n,r,...o){this._enterContext(e);try{return n.call(r,...o)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,n){if(n==="TIMERWRAP")return;let r=this._stack[this._stack.length-1];r!==void 0&&this._contexts.set(e,r)}_destroy(e){this._contexts.delete(e)}_before(e){let n=this._contexts.get(e);n!==void 0&&this._enterContext(n)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};bm.AsyncHooksContextManager=Ky});var Wj=E(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.AsyncLocalStorageContextManager=void 0;var ble=(b(),N(v)),Cle=U("async_hooks"),Ple=zy(),Qy=class extends Ple.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super(),this._asyncLocalStorage=new Cle.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??ble.ROOT_CONTEXT}with(e,n,r,...o){let s=r==null?n:n.bind(r);return this._asyncLocalStorage.run(e,s,...o)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};Cm.AsyncLocalStorageContextManager=Qy});var zj=E(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.AsyncLocalStorageContextManager=Hc.AsyncHooksContextManager=void 0;var Mle=Yj();Object.defineProperty(Hc,"AsyncHooksContextManager",{enumerable:!0,get:function(){return Mle.AsyncHooksContextManager}});var xle=Wj();Object.defineProperty(Hc,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return xle.AsyncLocalStorageContextManager}})});var Xy=E(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc._clearDefaultServiceNameCache=Vc.defaultServiceName=void 0;var Rp;function vle(){if(Rp===void 0)try{let t=globalThis.process.argv0;Rp=t?`unknown_service:${t}`:"unknown_service"}catch{Rp="unknown_service"}return Rp}Vc.defaultServiceName=vle;function Lle(){Rp=void 0}Vc._clearDefaultServiceNameCache=Lle});var Kj=E(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.isPromiseLike=void 0;var Dle=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";Pm.isPromiseLike=Dle});var eI=E(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.defaultResource=Jr.emptyResource=Jr.resourceFromDetectedResource=Jr.resourceFromAttributes=void 0;var Ip=(b(),N(v)),Jy=he(),Ji=(le(),N(Ae)),Ule=Xy(),yp=Kj(),Mm=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,n){let r=new t({},n);return r._rawAttributes=Qj(e),r._asyncAttributesPending=e.filter(([o,s])=>(0,yp.isPromiseLike)(s)).length>0,r}constructor(e,n){let r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([o,s])=>((0,yp.isPromiseLike)(s)&&(this._asyncAttributesPending=!0),[o,s])),this._rawAttributes=Qj(this._rawAttributes),this._schemaUrl=Ble(n?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[n,r]=this._rawAttributes[e];this._rawAttributes[e]=[n,(0,yp.isPromiseLike)(r)?await r:r]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Ip.diag.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[n,r]of this._rawAttributes){if((0,yp.isPromiseLike)(r)){Ip.diag.debug(`Unsettled resource attribute ${n} skipped`);continue}r!=null&&(e[n]??=r)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(e==null)return this;let n=jle(this,e),r=n?{schemaUrl:n}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],r)}};function Zy(t,e){return Mm.FromAttributeList(Object.entries(t),e)}Jr.resourceFromAttributes=Zy;function wle(t,e){return new Mm(t,e)}Jr.resourceFromDetectedResource=wle;function kle(){return Zy({})}Jr.emptyResource=kle;function Gle(){return Zy({[Ji.ATTR_SERVICE_NAME]:(0,Ule.defaultServiceName)(),[Ji.ATTR_TELEMETRY_SDK_LANGUAGE]:Jy.SDK_INFO[Ji.ATTR_TELEMETRY_SDK_LANGUAGE],[Ji.ATTR_TELEMETRY_SDK_NAME]:Jy.SDK_INFO[Ji.ATTR_TELEMETRY_SDK_NAME],[Ji.ATTR_TELEMETRY_SDK_VERSION]:Jy.SDK_INFO[Ji.ATTR_TELEMETRY_SDK_VERSION]})}Jr.defaultResource=Gle;function Qj(t){return t.map(([e,n])=>(0,yp.isPromiseLike)(n)?[e,n.catch(r=>{Ip.diag.debug("promise rejection for resource attribute: %s - %s",e,r)})]:[e,n])}function Ble(t){if(typeof t=="string"||t===void 0)return t;Ip.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function jle(t,e){let n=t?.schemaUrl,r=e?.schemaUrl,o=n===void 0||n==="",s=r===void 0||r==="";if(o)return r;if(s||n===r)return n;Ip.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',n,r)}});var Jj=E(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.detectResources=void 0;var Xj=(b(),N(v)),tI=eI(),Hle=(t={})=>(t.detectors||[]).map(n=>{try{let r=(0,tI.resourceFromDetectedResource)(n.detect(t));return Xj.diag.debug(`${n.constructor.name} found resource.`,r),r}catch(r){return Xj.diag.debug(`${n.constructor.name} failed: ${r.message}`),(0,tI.emptyResource)()}}).reduce((n,r)=>n.merge(r),(0,tI.emptyResource)());xm.detectResources=Hle});var eH=E(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.envDetector=void 0;var Vle=(b(),N(v)),Fle=(le(),N(Ae)),Zj=he(),nI=class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";detect(e){let n={},r=(0,Zj.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),o=(0,Zj.getStringFromEnv)("OTEL_SERVICE_NAME");if(r)try{let s=this._parseResourceAttributes(r);Object.assign(n,s)}catch(s){Vle.diag.debug(`EnvDetector failed: ${s instanceof Error?s.message:s}`)}return o&&(n[Fle.ATTR_SERVICE_NAME]=o),{attributes:n}}_parseResourceAttributes(e){if(!e)return{};let n={},r=e.split(this._COMMA_SEPARATOR);for(let o of r){let s=o.split(this._LABEL_KEY_VALUE_SPLITTER);if(s.length!==2)throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${o}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[i,a]=s,c=i.trim(),l=a.trim();if(c.length===0)throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${o}".`);let p,d;try{p=decodeURIComponent(c),d=decodeURIComponent(l)}catch(_){throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${o}": ${_ instanceof Error?_.message:_}`)}if(p.length>this._MAX_LENGTH)throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${p}".`);if(d.length>this._MAX_LENGTH)throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${p}".`);n[p]=d}return n}};vm.envDetector=new nI});var Np=E(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.ATTR_WEBENGINE_VERSION=L.ATTR_WEBENGINE_NAME=L.ATTR_WEBENGINE_DESCRIPTION=L.ATTR_SERVICE_NAMESPACE=L.ATTR_SERVICE_INSTANCE_ID=L.ATTR_PROCESS_RUNTIME_VERSION=L.ATTR_PROCESS_RUNTIME_NAME=L.ATTR_PROCESS_RUNTIME_DESCRIPTION=L.ATTR_PROCESS_PID=L.ATTR_PROCESS_OWNER=L.ATTR_PROCESS_EXECUTABLE_PATH=L.ATTR_PROCESS_EXECUTABLE_NAME=L.ATTR_PROCESS_COMMAND_ARGS=L.ATTR_PROCESS_COMMAND=L.ATTR_OS_VERSION=L.ATTR_OS_TYPE=L.ATTR_K8S_POD_NAME=L.ATTR_K8S_NAMESPACE_NAME=L.ATTR_K8S_DEPLOYMENT_NAME=L.ATTR_K8S_CLUSTER_NAME=L.ATTR_HOST_TYPE=L.ATTR_HOST_NAME=L.ATTR_HOST_IMAGE_VERSION=L.ATTR_HOST_IMAGE_NAME=L.ATTR_HOST_IMAGE_ID=L.ATTR_HOST_ID=L.ATTR_HOST_ARCH=L.ATTR_CONTAINER_NAME=L.ATTR_CONTAINER_IMAGE_TAGS=L.ATTR_CONTAINER_IMAGE_NAME=L.ATTR_CONTAINER_ID=L.ATTR_CLOUD_REGION=L.ATTR_CLOUD_PROVIDER=L.ATTR_CLOUD_AVAILABILITY_ZONE=L.ATTR_CLOUD_ACCOUNT_ID=void 0;L.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";L.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";L.ATTR_CLOUD_PROVIDER="cloud.provider";L.ATTR_CLOUD_REGION="cloud.region";L.ATTR_CONTAINER_ID="container.id";L.ATTR_CONTAINER_IMAGE_NAME="container.image.name";L.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";L.ATTR_CONTAINER_NAME="container.name";L.ATTR_HOST_ARCH="host.arch";L.ATTR_HOST_ID="host.id";L.ATTR_HOST_IMAGE_ID="host.image.id";L.ATTR_HOST_IMAGE_NAME="host.image.name";L.ATTR_HOST_IMAGE_VERSION="host.image.version";L.ATTR_HOST_NAME="host.name";L.ATTR_HOST_TYPE="host.type";L.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";L.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";L.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";L.ATTR_K8S_POD_NAME="k8s.pod.name";L.ATTR_OS_TYPE="os.type";L.ATTR_OS_VERSION="os.version";L.ATTR_PROCESS_COMMAND="process.command";L.ATTR_PROCESS_COMMAND_ARGS="process.command_args";L.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";L.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";L.ATTR_PROCESS_OWNER="process.owner";L.ATTR_PROCESS_PID="process.pid";L.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";L.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";L.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";L.ATTR_SERVICE_INSTANCE_ID="service.instance.id";L.ATTR_SERVICE_NAMESPACE="service.namespace";L.ATTR_WEBENGINE_DESCRIPTION="webengine.description";L.ATTR_WEBENGINE_NAME="webengine.name";L.ATTR_WEBENGINE_VERSION="webengine.version"});var Dm=E(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.execAsync=void 0;var qle=U("child_process"),$le=U("util");Lm.execAsync=$le.promisify(qle.exec)});var tH=E(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.getMachineId=void 0;var Yle=Dm(),Wle=(b(),N(v));async function zle(){try{let e=(await(0,Yle.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
7
- `).find(r=>r.includes("IOPlatformUUID"));if(!e)return;let n=e.split('" = "');if(n.length===2)return n[1].slice(0,-1)}catch(t){Wle.diag.debug(`error reading machine id: ${t}`)}}Um.getMachineId=zle});var nH=E(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.getMachineId=void 0;var Kle=U("fs"),Qle=(b(),N(v));async function Xle(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await Kle.promises.readFile(e,{encoding:"utf8"})).trim()}catch(n){Qle.diag.debug(`error reading machine id: ${n}`)}}wm.getMachineId=Xle});var oH=E(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.getMachineId=void 0;var Jle=U("fs"),Zle=Dm(),rH=(b(),N(v));async function epe(){try{return(await Jle.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){rH.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,Zle.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){rH.diag.debug(`error reading machine id: ${t}`)}}km.getMachineId=epe});var iH=E(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.getMachineId=void 0;var sH=U("process"),tpe=Dm(),npe=(b(),N(v));async function rpe(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";sH.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in sH.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let r=(await(0,tpe.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(r.length===2)return r[1].trim()}catch(n){npe.diag.debug(`error reading machine id: ${n}`)}}Gm.getMachineId=rpe});var aH=E(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.getMachineId=void 0;var ope=(b(),N(v));async function spe(){ope.diag.debug("could not read machine-id: unsupported platform")}Bm.getMachineId=spe});var cH=E(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});jm.getMachineId=void 0;var ipe=U("process"),Zi;async function ape(){if(!Zi)switch(ipe.platform){case"darwin":Zi=(await Promise.resolve().then(()=>K(tH()))).getMachineId;break;case"linux":Zi=(await Promise.resolve().then(()=>K(nH()))).getMachineId;break;case"freebsd":Zi=(await Promise.resolve().then(()=>K(oH()))).getMachineId;break;case"win32":Zi=(await Promise.resolve().then(()=>K(iH()))).getMachineId;break;default:Zi=(await Promise.resolve().then(()=>K(aH()))).getMachineId;break}return Zi()}jm.getMachineId=ape});var rI=E(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.normalizeType=Fc.normalizeArch=void 0;var cpe=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};Fc.normalizeArch=cpe;var upe=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};Fc.normalizeType=upe});var lH=E(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.hostDetector=void 0;var oI=Np(),uH=U("os"),lpe=cH(),ppe=rI(),sI=class{detect(e){return{attributes:{[oI.ATTR_HOST_NAME]:(0,uH.hostname)(),[oI.ATTR_HOST_ARCH]:(0,ppe.normalizeArch)((0,uH.arch)()),[oI.ATTR_HOST_ID]:(0,lpe.getMachineId)()}}}};Hm.hostDetector=new sI});var _H=E(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.osDetector=void 0;var pH=Np(),dH=U("os"),dpe=rI(),iI=class{detect(e){return{attributes:{[pH.ATTR_OS_TYPE]:(0,dpe.normalizeType)((0,dH.platform)()),[pH.ATTR_OS_VERSION]:(0,dH.release)()}}}};Vm.osDetector=new iI});var fH=E(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.processDetector=void 0;var _pe=(b(),N(v)),Go=Np(),fpe=U("os"),aI=class{detect(e){let n={[Go.ATTR_PROCESS_PID]:process.pid,[Go.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[Go.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[Go.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Go.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[Go.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[Go.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(n[Go.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let r=fpe.userInfo();n[Go.ATTR_PROCESS_OWNER]=r.username}catch(r){_pe.diag.debug(`error obtaining process owner: ${r}`)}return{attributes:n}}};Fm.processDetector=new aI});var mH=E(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.serviceInstanceIdDetector=void 0;var mpe=Np(),Tpe=U("crypto"),cI=class{detect(e){return{attributes:{[mpe.ATTR_SERVICE_INSTANCE_ID]:(0,Tpe.randomUUID)()}}}};qm.serviceInstanceIdDetector=new cI});var TH=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.serviceInstanceIdDetector=Zr.processDetector=Zr.osDetector=Zr.hostDetector=void 0;var hpe=lH();Object.defineProperty(Zr,"hostDetector",{enumerable:!0,get:function(){return hpe.hostDetector}});var Epe=_H();Object.defineProperty(Zr,"osDetector",{enumerable:!0,get:function(){return Epe.osDetector}});var Spe=fH();Object.defineProperty(Zr,"processDetector",{enumerable:!0,get:function(){return Spe.processDetector}});var gpe=mH();Object.defineProperty(Zr,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return gpe.serviceInstanceIdDetector}})});var hH=E(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.serviceInstanceIdDetector=eo.processDetector=eo.osDetector=eo.hostDetector=void 0;var $m=TH();Object.defineProperty(eo,"hostDetector",{enumerable:!0,get:function(){return $m.hostDetector}});Object.defineProperty(eo,"osDetector",{enumerable:!0,get:function(){return $m.osDetector}});Object.defineProperty(eo,"processDetector",{enumerable:!0,get:function(){return $m.processDetector}});Object.defineProperty(eo,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return $m.serviceInstanceIdDetector}})});var EH=E(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.noopDetector=qc.NoopDetector=void 0;var Ym=class{detect(){return{attributes:{}}}};qc.NoopDetector=Ym;qc.noopDetector=new Ym});var SH=E(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.noopDetector=yn.serviceInstanceIdDetector=yn.processDetector=yn.osDetector=yn.hostDetector=yn.envDetector=void 0;var Ape=eH();Object.defineProperty(yn,"envDetector",{enumerable:!0,get:function(){return Ape.envDetector}});var Wm=hH();Object.defineProperty(yn,"hostDetector",{enumerable:!0,get:function(){return Wm.hostDetector}});Object.defineProperty(yn,"osDetector",{enumerable:!0,get:function(){return Wm.osDetector}});Object.defineProperty(yn,"processDetector",{enumerable:!0,get:function(){return Wm.processDetector}});Object.defineProperty(yn,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Wm.serviceInstanceIdDetector}});var Rpe=EH();Object.defineProperty(yn,"noopDetector",{enumerable:!0,get:function(){return Rpe.noopDetector}})});var lI=E(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.defaultServiceName=Ve.emptyResource=Ve.defaultResource=Ve.resourceFromAttributes=Ve.serviceInstanceIdDetector=Ve.processDetector=Ve.osDetector=Ve.hostDetector=Ve.envDetector=Ve.detectResources=void 0;var ype=Jj();Object.defineProperty(Ve,"detectResources",{enumerable:!0,get:function(){return ype.detectResources}});var Op=SH();Object.defineProperty(Ve,"envDetector",{enumerable:!0,get:function(){return Op.envDetector}});Object.defineProperty(Ve,"hostDetector",{enumerable:!0,get:function(){return Op.hostDetector}});Object.defineProperty(Ve,"osDetector",{enumerable:!0,get:function(){return Op.osDetector}});Object.defineProperty(Ve,"processDetector",{enumerable:!0,get:function(){return Op.processDetector}});Object.defineProperty(Ve,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Op.serviceInstanceIdDetector}});var uI=eI();Object.defineProperty(Ve,"resourceFromAttributes",{enumerable:!0,get:function(){return uI.resourceFromAttributes}});Object.defineProperty(Ve,"defaultResource",{enumerable:!0,get:function(){return uI.defaultResource}});Object.defineProperty(Ve,"emptyResource",{enumerable:!0,get:function(){return uI.emptyResource}});var Ipe=Xy();Object.defineProperty(Ve,"defaultServiceName",{enumerable:!0,get:function(){return Ipe.defaultServiceName}})});var gH=E(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.ExceptionEventName=void 0;zm.ExceptionEventName="exception"});var AH=E(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.SpanImpl=void 0;var Ut=(b(),N(v)),wt=he(),ea=(le(),N(Ae)),Npe=gH(),pI=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:Ut.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let n=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=wt.otperformance.now(),this._performanceOffset=n-(this._performanceStartTime+wt.otperformance.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let r of e.links)this.addLink(r);this.startTime=this._getTime(e.startTime??n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,n){if(n==null||this._isSpanEnded())return this;if(e.length===0)return Ut.diag.warn(`Invalid attribute key: ${e}`),this;if(!(0,wt.isAttributeValue)(n))return Ut.diag.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:r}=this._spanLimits,o=!Object.prototype.hasOwnProperty.call(this.attributes,e);return r!==void 0&&this._attributesCount>=r&&o?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(n),o&&this._attributesCount++,this)}setAttributes(e){for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.setAttribute(n,e[n]);return this}addEvent(e,n,r){if(this._isSpanEnded())return this;let{eventCountLimit:o}=this._spanLimits;if(o===0)return Ut.diag.warn("No events allowed."),this._droppedEventsCount++,this;o!==void 0&&this.events.length>=o&&(this._droppedEventsCount===0&&Ut.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,wt.isTimeInput)(n)&&((0,wt.isTimeInput)(r)||(r=n),n=void 0);let s=(0,wt.sanitizeAttributes)(n),{attributePerEventCountLimit:i}=this._spanLimits,a={},c=0,l=0;for(let p in s){if(!Object.prototype.hasOwnProperty.call(s,p))continue;let d=s[p];if(i!==void 0&&l>=i){c++;continue}a[p]=this._truncateToSize(d),l++}return this.events.push({name:e,attributes:a,time:this._getTime(r),droppedAttributesCount:c}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:n}=this._spanLimits;if(n===0)return this._droppedLinksCount++,this;n!==void 0&&this.links.length>=n&&(this._droppedLinksCount===0&&Ut.diag.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:r}=this._spanLimits,o=(0,wt.sanitizeAttributes)(e.attributes),s={},i=0,a=0;for(let l in o){if(!Object.prototype.hasOwnProperty.call(o,l))continue;let p=o[l];if(r!==void 0&&a>=r){i++;continue}s[l]=this._truncateToSize(p),a++}let c={context:e.context};return a>0&&(c.attributes=s),i>0&&(c.droppedAttributesCount=i),this.links.push(c),this}addLinks(e){for(let n of e)this.addLink(n);return this}setStatus(e){if(this._isSpanEnded())return this;if(e.code===Ut.SpanStatusCode.UNSET)return this;if(this.status.code===Ut.SpanStatusCode.OK)return this;let n={code:e.code};return e.code===Ut.SpanStatusCode.ERROR&&(typeof e.message=="string"?n.message=e.message:e.message!=null&&Ut.diag.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=n,this}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Ut.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=(0,wt.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(Ut.diag.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&&Ut.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Ut.diag.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(e){if(typeof e=="number"&&e<=wt.otperformance.now())return(0,wt.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,wt.millisToHrTime)(e);if(e instanceof Date)return(0,wt.millisToHrTime)(e.getTime());if((0,wt.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,wt.millisToHrTime)(Date.now());let n=wt.otperformance.now()-this._performanceStartTime;return(0,wt.addHrTimes)(this.startTime,(0,wt.millisToHrTime)(n))}isRecording(){return this._ended===!1}recordException(e,n){let r={};typeof e=="string"?r[ea.ATTR_EXCEPTION_MESSAGE]=e:e&&(e.code?r[ea.ATTR_EXCEPTION_TYPE]=e.code.toString():e.name&&(r[ea.ATTR_EXCEPTION_TYPE]=e.name),e.message&&(r[ea.ATTR_EXCEPTION_MESSAGE]=e.message),e.stack&&(r[ea.ATTR_EXCEPTION_STACKTRACE]=e.stack)),r[ea.ATTR_EXCEPTION_TYPE]||r[ea.ATTR_EXCEPTION_MESSAGE]?this.addEvent(Npe.ExceptionEventName,r,n):Ut.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Ut.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,n){return e.length<=n?e:e.substring(0,n)}_truncateToSize(e){let n=this._attributeValueLengthLimit;return n<=0?(Ut.diag.warn(`Attribute value limit must be positive, got ${n}`),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(r=>typeof r=="string"?this._truncateToLimitUtil(r,n):r):e}};Km.SpanImpl=pI});var $c=E(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.SamplingDecision=void 0;var Ope;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Ope=bp.SamplingDecision||(bp.SamplingDecision={}))});var Xm=E(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.AlwaysOffSampler=void 0;var bpe=$c(),dI=class{shouldSample(){return{decision:bpe.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};Qm.AlwaysOffSampler=dI});var Zm=E(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.AlwaysOnSampler=void 0;var Cpe=$c(),_I=class{shouldSample(){return{decision:Cpe.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Jm.AlwaysOnSampler=_I});var TI=E(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});tT.ParentBasedSampler=void 0;var eT=(b(),N(v)),Ppe=he(),RH=Xm(),fI=Zm(),mI=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||((0,Ppe.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new fI.AlwaysOnSampler),this._remoteParentSampled=e.remoteParentSampled??new fI.AlwaysOnSampler,this._remoteParentNotSampled=e.remoteParentNotSampled??new RH.AlwaysOffSampler,this._localParentSampled=e.localParentSampled??new fI.AlwaysOnSampler,this._localParentNotSampled=e.localParentNotSampled??new RH.AlwaysOffSampler}shouldSample(e,n,r,o,s,i){let a=eT.trace.getSpanContext(e);return!a||!(0,eT.isSpanContextValid)(a)?this._root.shouldSample(e,n,r,o,s,i):a.isRemote?a.traceFlags&eT.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,n,r,o,s,i):this._remoteParentNotSampled.shouldSample(e,n,r,o,s,i):a.traceFlags&eT.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,n,r,o,s,i):this._localParentNotSampled.shouldSample(e,n,r,o,s,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};tT.ParentBasedSampler=mI});var EI=E(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});nT.TraceIdRatioBasedSampler=void 0;var Mpe=(b(),N(v)),yH=$c(),hI=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,n){return{decision:(0,Mpe.isValidTraceId)(n)&&this._accumulate(n)<this._upperBound?yH.SamplingDecision.RECORD_AND_SAMPLED:yH.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let n=0;for(let r=0;r<e.length/8;r++){let o=r*8,s=parseInt(e.slice(o,o+8),16);n=(n^s)>>>0}return n}};nT.TraceIdRatioBasedSampler=hI});var AI=E(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.buildSamplerFromEnv=Yc.loadDefaultConfig=void 0;var gI=(b(),N(v)),to=he(),IH=Xm(),SI=Zm(),rT=TI(),NH=EI(),no;(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"})(no||(no={}));var oT=1;function xpe(){return{sampler:bH(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,to.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,to.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,to.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,to.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,to.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,to.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,to.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,to.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}Yc.loadDefaultConfig=xpe;function bH(){let t=(0,to.getStringFromEnv)("OTEL_TRACES_SAMPLER")??no.ParentBasedAlwaysOn;switch(t){case no.AlwaysOn:return new SI.AlwaysOnSampler;case no.AlwaysOff:return new IH.AlwaysOffSampler;case no.ParentBasedAlwaysOn:return new rT.ParentBasedSampler({root:new SI.AlwaysOnSampler});case no.ParentBasedAlwaysOff:return new rT.ParentBasedSampler({root:new IH.AlwaysOffSampler});case no.TraceIdRatio:return new NH.TraceIdRatioBasedSampler(OH());case no.ParentBasedTraceIdRatio:return new rT.ParentBasedSampler({root:new NH.TraceIdRatioBasedSampler(OH())});default:return gI.diag.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${no.ParentBasedAlwaysOn}".`),new rT.ParentBasedSampler({root:new SI.AlwaysOnSampler})}}Yc.buildSamplerFromEnv=bH;function OH(){let t=(0,to.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");return t==null?(gI.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${oT}.`),oT):t<0||t>1?(gI.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t} was given, but it is out of range ([0..1]), defaulting to ${oT}.`),oT):t}});var RI=E(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.reconfigureLimits=or.mergeConfig=or.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=or.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var CH=AI(),sT=he();or.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;or.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function vpe(t){let e={sampler:(0,CH.buildSamplerFromEnv)()},n=(0,CH.loadDefaultConfig)(),r=Object.assign({},n,e,t);return r.generalLimits=Object.assign({},n.generalLimits,t.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,t.spanLimits||{}),r}or.mergeConfig=vpe;function Lpe(t){let e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??(0,sT.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,sT.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??or.DEFAULT_ATTRIBUTE_COUNT_LIMIT,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??(0,sT.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,sT.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??or.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},t,{spanLimits:e})}or.reconfigureLimits=Lpe});var PH=E(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});iT.BatchSpanProcessorBase=void 0;var Wc=(b(),N(v)),Bo=he(),yI=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,n){this._exporter=e,this._maxExportBatchSize=typeof n?.maxExportBatchSize=="number"?n.maxExportBatchSize:(0,Bo.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof n?.maxQueueSize=="number"?n.maxQueueSize:(0,Bo.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof n?.scheduledDelayMillis=="number"?n.scheduledDelayMillis:(0,Bo.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=typeof n?.exportTimeoutMillis=="number"?n.exportTimeoutMillis:(0,Bo.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new Bo.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Wc.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,n){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&Wc.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Wc.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Wc.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,n)=>{let r=[],o=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,i=o;s<i;s++)r.push(this._flushOneBatch());Promise.all(r).then(()=>{e()}).catch(n)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,n)=>{let r=setTimeout(()=>{n(new Error("Timeout"))},this._exportTimeoutMillis);Wc.context.with((0,Bo.suppressTracing)(Wc.context.active()),()=>{let o;this._finishedSpans.length<=this._maxExportBatchSize?(o=this._finishedSpans,this._finishedSpans=[]):o=this._finishedSpans.splice(0,this._maxExportBatchSize);let s=()=>this._exporter.export(o,a=>{clearTimeout(r),a.code===Bo.ExportResultCode.SUCCESS?e():n(a.error??new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let a=0,c=o.length;a<c;a++){let l=o[a];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(i??=[],i.push(l.resource.waitForAsyncAttributes()))}i===null?s():Promise.all(i).then(s,a=>{(0,Bo.globalErrorHandler)(a),n(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,Bo.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};iT.BatchSpanProcessorBase=yI});var MH=E(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});aT.BatchSpanProcessor=void 0;var Dpe=PH(),II=class extends Dpe.BatchSpanProcessorBase{onShutdown(){}};aT.BatchSpanProcessor=II});var LH=E(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});uT.RandomIdGenerator=void 0;var Upe=8,vH=16,NI=class{generateTraceId=xH(vH);generateSpanId=xH(Upe)};uT.RandomIdGenerator=NI;var cT=Buffer.allocUnsafe(vH);function xH(t){return function(){for(let n=0;n<t/4;n++)cT.writeUInt32BE(Math.random()*2**32>>>0,n*4);for(let n=0;n<t&&!(cT[n]>0);n++)n===t-1&&(cT[t-1]=1);return cT.toString("hex",0,t)}}});var DH=E(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.RandomIdGenerator=zc.BatchSpanProcessor=void 0;var wpe=MH();Object.defineProperty(zc,"BatchSpanProcessor",{enumerable:!0,get:function(){return wpe.BatchSpanProcessor}});var kpe=LH();Object.defineProperty(zc,"RandomIdGenerator",{enumerable:!0,get:function(){return kpe.RandomIdGenerator}})});var OI=E(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.RandomIdGenerator=Kc.BatchSpanProcessor=void 0;var UH=DH();Object.defineProperty(Kc,"BatchSpanProcessor",{enumerable:!0,get:function(){return UH.BatchSpanProcessor}});Object.defineProperty(Kc,"RandomIdGenerator",{enumerable:!0,get:function(){return UH.RandomIdGenerator}})});var wH=E(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.METRIC_OTEL_SDK_SPAN_STARTED=ro.METRIC_OTEL_SDK_SPAN_LIVE=ro.ATTR_OTEL_SPAN_SAMPLING_RESULT=ro.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;ro.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";ro.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";ro.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";ro.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var kH=E(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});pT.TracerMetrics=void 0;var lT=$c(),Cp=wH(),bI=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(Cp.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=e.createUpDownCounter(Cp.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(e,n){let r=Bpe(n);if(this.startedSpans.add(1,{[Cp.ATTR_OTEL_SPAN_PARENT_ORIGIN]:Gpe(e),[Cp.ATTR_OTEL_SPAN_SAMPLING_RESULT]:r}),n===lT.SamplingDecision.NOT_RECORD)return()=>{};let o={[Cp.ATTR_OTEL_SPAN_SAMPLING_RESULT]:r};return this.liveSpans.add(1,o),()=>{this.liveSpans.add(-1,o)}}};pT.TracerMetrics=bI;function Gpe(t){return t?t.isRemote?"remote":"local":"none"}function Bpe(t){switch(t){case lT.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case lT.SamplingDecision.RECORD:return"RECORD_ONLY";case lT.SamplingDecision.NOT_RECORD:return"DROP"}}});var GH=E(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});dT.VERSION=void 0;dT.VERSION="2.6.1"});var BH=E(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});fT.Tracer=void 0;var Nt=(b(),N(v)),_T=he(),jpe=AH(),Hpe=RI(),Vpe=OI(),Fpe=kH(),qpe=GH(),CI=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,n,r,o){let s=(0,Hpe.mergeConfig)(n);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=n.idGenerator||new Vpe.RandomIdGenerator,this._resource=r,this._spanProcessor=o,this.instrumentationScope=e;let i=s.meterProvider?s.meterProvider.getMeter("@opentelemetry/sdk-trace",qpe.VERSION):Nt.createNoopMeter();this._tracerMetrics=new Fpe.TracerMetrics(i)}startSpan(e,n={},r=Nt.context.active()){n.root&&(r=Nt.trace.deleteSpan(r));let o=Nt.trace.getSpan(r);if((0,_T.isTracingSuppressed)(r))return Nt.diag.debug("Instrumentation suppressed, returning Noop Span"),Nt.trace.wrapSpanContext(Nt.INVALID_SPAN_CONTEXT);let s=o?.spanContext(),i=this._idGenerator.generateSpanId(),a,c,l;!s||!Nt.trace.isSpanContextValid(s)?c=this._idGenerator.generateTraceId():(c=s.traceId,l=s.traceState,a=s);let p=n.kind??Nt.SpanKind.INTERNAL,d=(n.links??[]).map(I=>({context:I.context,attributes:(0,_T.sanitizeAttributes)(I.attributes)})),_=(0,_T.sanitizeAttributes)(n.attributes),f=this._sampler.shouldSample(r,c,e,p,_,d),m=this._tracerMetrics.startSpan(s,f.decision);l=f.traceState??l;let T=f.decision===Nt.SamplingDecision.RECORD_AND_SAMPLED?Nt.TraceFlags.SAMPLED:Nt.TraceFlags.NONE,h={traceId:c,spanId:i,traceFlags:T,traceState:l};if(f.decision===Nt.SamplingDecision.NOT_RECORD)return Nt.diag.debug("Recording is off, propagating context in a non-recording span"),Nt.trace.wrapSpanContext(h);let S=(0,_T.sanitizeAttributes)(Object.assign(_,f.attributes));return new jpe.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:h,name:e,kind:p,links:d,parentSpanContext:a,attributes:S,startTime:n.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:m})}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??Nt.context.active(),l=this.startSpan(e,s,c),p=Nt.trace.setSpan(c,l);return Nt.context.with(p,a,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};fT.Tracer=CI});var jH=E(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});mT.MultiSpanProcessor=void 0;var $pe=he(),PI=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let n of this._spanProcessors)e.push(n.forceFlush());return new Promise(n=>{Promise.all(e).then(()=>{n()}).catch(r=>{(0,$pe.globalErrorHandler)(r||new Error("MultiSpanProcessor: forceFlush failed")),n()})})}onStart(e,n){for(let r of this._spanProcessors)r.onStart(e,n)}onEnding(e){for(let n of this._spanProcessors)n.onEnding&&n.onEnding(e)}onEnd(e){for(let n of this._spanProcessors)n.onEnd(e)}shutdown(){let e=[];for(let n of this._spanProcessors)e.push(n.shutdown());return new Promise((n,r)=>{Promise.all(e).then(()=>{n()},r)})}};mT.MultiSpanProcessor=PI});var HH=E(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.BasicTracerProvider=ta.ForceFlushState=void 0;var Ype=he(),Wpe=lI(),zpe=BH(),Kpe=AI(),Qpe=jH(),Xpe=RI(),Qc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Qc=ta.ForceFlushState||(ta.ForceFlushState={}));var MI=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let n=(0,Ype.merge)({},(0,Kpe.loadDefaultConfig)(),(0,Xpe.reconfigureLimits)(e));this._resource=n.resource??(0,Wpe.defaultResource)(),this._config=Object.assign({},n,{resource:this._resource});let r=[];e.spanProcessors?.length&&r.push(...e.spanProcessors),this._activeSpanProcessor=new Qpe.MultiSpanProcessor(r)}getTracer(e,n,r){let o=`${e}@${n||""}:${r?.schemaUrl||""}`;return this._tracers.has(o)||this._tracers.set(o,new zpe.Tracer({name:e,version:n,schemaUrl:r?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(o)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,n=this._activeSpanProcessor._spanProcessors.map(r=>new Promise(o=>{let s,i=setTimeout(()=>{o(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=Qc.timeout},e);r.forceFlush().then(()=>{clearTimeout(i),s!==Qc.timeout&&(s=Qc.resolved,o(s))}).catch(a=>{clearTimeout(i),s=Qc.error,o(a)})}));return new Promise((r,o)=>{Promise.all(n).then(s=>{let i=s.filter(a=>a!==Qc.resolved);i.length>0?o(i):r()}).catch(s=>o([s]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};ta.BasicTracerProvider=MI});var VH=E(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});TT.ConsoleSpanExporter=void 0;var xI=he(),vI=class{export(e,n){return this._sendSpans(e,n)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,xI.hrTimeToMicroseconds)(e.startTime),duration:(0,xI.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,n){for(let r of e)console.dir(this._exportInfo(r),{depth:3});if(n)return n({code:xI.ExportResultCode.SUCCESS})}};TT.ConsoleSpanExporter=vI});var qH=E(hT=>{"use strict";Object.defineProperty(hT,"__esModule",{value:!0});hT.InMemorySpanExporter=void 0;var FH=he(),LI=class{_finishedSpans=[];_stopped=!1;export(e,n){if(this._stopped)return n({code:FH.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>n({code:FH.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};hT.InMemorySpanExporter=LI});var $H=E(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});ST.SimpleSpanProcessor=void 0;var Jpe=(b(),N(v)),ET=he(),DI=class{_exporter;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e,this._shutdownOnce=new ET.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,n){}onEnd(e){if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&Jpe.TraceFlags.SAMPLED))return;let n=this._doExport(e).catch(r=>(0,ET.globalErrorHandler)(r));this._pendingExports.add(n),n.finally(()=>this._pendingExports.delete(n))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let n=await ET.internal._export(this._exporter,[e]);if(n.code!==ET.ExportResultCode.SUCCESS)throw n.error??new Error(`SimpleSpanProcessor: span export failed (status ${n})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};ST.SimpleSpanProcessor=DI});var YH=E(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});gT.NoopSpanProcessor=void 0;var UI=class{onStart(e,n){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};gT.NoopSpanProcessor=UI});var wI=E(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.SamplingDecision=Ce.TraceIdRatioBasedSampler=Ce.ParentBasedSampler=Ce.AlwaysOnSampler=Ce.AlwaysOffSampler=Ce.NoopSpanProcessor=Ce.SimpleSpanProcessor=Ce.InMemorySpanExporter=Ce.ConsoleSpanExporter=Ce.RandomIdGenerator=Ce.BatchSpanProcessor=Ce.BasicTracerProvider=void 0;var Zpe=HH();Object.defineProperty(Ce,"BasicTracerProvider",{enumerable:!0,get:function(){return Zpe.BasicTracerProvider}});var WH=OI();Object.defineProperty(Ce,"BatchSpanProcessor",{enumerable:!0,get:function(){return WH.BatchSpanProcessor}});Object.defineProperty(Ce,"RandomIdGenerator",{enumerable:!0,get:function(){return WH.RandomIdGenerator}});var ede=VH();Object.defineProperty(Ce,"ConsoleSpanExporter",{enumerable:!0,get:function(){return ede.ConsoleSpanExporter}});var tde=qH();Object.defineProperty(Ce,"InMemorySpanExporter",{enumerable:!0,get:function(){return tde.InMemorySpanExporter}});var nde=$H();Object.defineProperty(Ce,"SimpleSpanProcessor",{enumerable:!0,get:function(){return nde.SimpleSpanProcessor}});var rde=YH();Object.defineProperty(Ce,"NoopSpanProcessor",{enumerable:!0,get:function(){return rde.NoopSpanProcessor}});var ode=Xm();Object.defineProperty(Ce,"AlwaysOffSampler",{enumerable:!0,get:function(){return ode.AlwaysOffSampler}});var sde=Zm();Object.defineProperty(Ce,"AlwaysOnSampler",{enumerable:!0,get:function(){return sde.AlwaysOnSampler}});var ide=TI();Object.defineProperty(Ce,"ParentBasedSampler",{enumerable:!0,get:function(){return ide.ParentBasedSampler}});var ade=EI();Object.defineProperty(Ce,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return ade.TraceIdRatioBasedSampler}});var cde=$c();Object.defineProperty(Ce,"SamplingDecision",{enumerable:!0,get:function(){return cde.SamplingDecision}})});var gF=E(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.PACKAGE_NAME=tu.PACKAGE_VERSION=void 0;tu.PACKAGE_VERSION="0.24.0";tu.PACKAGE_NAME="@opentelemetry/instrumentation-undici"});var RF=E(UT=>{"use strict";Object.defineProperty(UT,"__esModule",{value:!0});UT.UndiciInstrumentation=void 0;var lN=U("diagnostics_channel"),xfe=U("url"),kp=ne(),Vn=(b(),N(v)),DT=he(),ot=(le(),N(Ae)),AF=gF(),pN=class extends kp.InstrumentationBase{_recordFromReq=new WeakMap;constructor(e={}){super(AF.PACKAGE_NAME,AF.PACKAGE_VERSION,e)}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs.length=0}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this.subscribeToChannel("undici:request:create",this.onRequestCreated.bind(this)),this.subscribeToChannel("undici:client:sendHeaders",this.onRequestHeaders.bind(this)),this.subscribeToChannel("undici:request:headers",this.onResponseHeaders.bind(this)),this.subscribeToChannel("undici:request:trailers",this.onDone.bind(this)),this.subscribeToChannel("undici:request:error",this.onError.bind(this)))}_updateMetricInstruments(){this._httpClientDurationHistogram=this.meter.createHistogram(ot.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:"Measures the duration of outbound HTTP requests.",unit:"s",valueType:Vn.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}subscribeToChannel(e,n){let[r,o]=process.version.replace("v","").split(".").map(a=>Number(a)),s=r>18||r===18&&o>=19,i;if(s)lN.subscribe?.(e,n),i=()=>lN.unsubscribe?.(e,n);else{let a=lN.channel(e);a.subscribe(n),i=()=>a.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:i})}parseRequestHeaders(e){let n=new Map;if(Array.isArray(e.headers))for(let r=0;r<e.headers.length;r+=2){let o=e.headers[r],s=e.headers[r+1];typeof o=="string"&&n.set(o.toLowerCase(),s)}else if(typeof e.headers=="string"){let r=e.headers.split(`\r
8
- `);for(let o of r){if(!o)continue;let s=o.indexOf(":");if(s===-1)continue;let i=o.substring(0,s).toLowerCase(),a=o.substring(s+1).trim(),c=n.get(i);c&&Array.isArray(c)?c.push(a):c?n.set(i,[c,a]):n.set(i,a)}}return n}onRequestCreated({request:e}){let n=this.getConfig(),r=n.enabled!==!1;if((0,kp.safeExecuteInTheMiddle)(()=>!r||e.method==="CONNECT"||n.ignoreRequestHook?.(e),B=>B&&this._diag.error("caught ignoreRequestHook error: ",B),!0))return;let s=(0,DT.hrTime)(),i;try{i=new xfe.URL(e.path,e.origin)}catch(B){this._diag.warn("could not determine url.full:",B);return}let a=i.protocol.replace(":",""),c=this.getRequestMethod(e.method),l={[ot.ATTR_HTTP_REQUEST_METHOD]:c,[ot.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:e.method,[ot.ATTR_URL_FULL]:i.toString(),[ot.ATTR_URL_PATH]:i.pathname,[ot.ATTR_URL_QUERY]:i.search,[ot.ATTR_URL_SCHEME]:a},p={https:"443",http:"80"},d=i.hostname,_=i.port||p[a];l[ot.ATTR_SERVER_ADDRESS]=d,_&&!isNaN(Number(_))&&(l[ot.ATTR_SERVER_PORT]=Number(_));let m=this.parseRequestHeaders(e).get("user-agent");if(m){let B=Array.isArray(m)?m[m.length-1]:m;l[ot.ATTR_USER_AGENT_ORIGINAL]=B}let T=(0,kp.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(e),B=>B&&this._diag.error("caught startSpanHook error: ",B),!0);T&&Object.entries(T).forEach(([B,se])=>{l[B]=se});let h=Vn.context.active(),S=Vn.trace.getSpan(h),R;n.requireParentforSpans&&(!S||!Vn.trace.isSpanContextValid(S.spanContext()))?R=Vn.trace.wrapSpanContext(Vn.INVALID_SPAN_CONTEXT):R=this.tracer.startSpan(c==="_OTHER"?"HTTP":c,{kind:Vn.SpanKind.CLIENT,attributes:l},h),(0,kp.safeExecuteInTheMiddle)(()=>n.requestHook?.(R,e),B=>B&&this._diag.error("caught requestHook error: ",B),!0);let I=Vn.trace.setSpan(Vn.context.active(),R),x={};Vn.propagation.inject(I,x);let V=Object.entries(x);for(let B=0;B<V.length;B++){let[se,ve]=V[B];typeof e.addHeader=="function"?e.addHeader(se,ve):typeof e.headers=="string"?e.headers+=`${se}: ${ve}\r
9
- `:Array.isArray(e.headers)&&e.headers.push(se,ve)}this._recordFromReq.set(e,{span:R,attributes:l,startTime:s})}onRequestHeaders({request:e,socket:n}){let r=this._recordFromReq.get(e);if(!r)return;let o=this.getConfig(),{span:s}=r,{remoteAddress:i,remotePort:a}=n,c={[ot.ATTR_NETWORK_PEER_ADDRESS]:i,[ot.ATTR_NETWORK_PEER_PORT]:a};if(o.headersToSpanAttributes?.requestHeaders){let l=new Set(o.headersToSpanAttributes.requestHeaders.map(d=>d.toLowerCase())),p=this.parseRequestHeaders(e);for(let[d,_]of p.entries())if(l.has(d)){let f=Array.isArray(_)?_:[_];c[`http.request.header.${d}`]=f}}s.setAttributes(c)}onResponseHeaders({request:e,response:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s}=r,i={[ot.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},a=this.getConfig();if((0,kp.safeExecuteInTheMiddle)(()=>a.responseHook?.(o,{request:e,response:n}),c=>c&&this._diag.error("caught responseHook error: ",c),!0),a.headersToSpanAttributes?.responseHeaders){let c=new Set;a.headersToSpanAttributes?.responseHeaders.forEach(l=>c.add(l.toLowerCase()));for(let l=0;l<n.headers.length;l=l+2){let p=n.headers[l].toString().toLowerCase(),d=n.headers[l+1];if(c.has(p)){let _=`http.response.header.${p}`;Object.hasOwn(i,_)?i[_].push(d.toString()):i[_]=[d.toString()]}}}o.setAttributes(i),o.setStatus({code:n.statusCode>=400?Vn.SpanStatusCode.ERROR:Vn.SpanStatusCode.UNSET}),r.attributes=Object.assign(s,i)}onDone({request:e}){let n=this._recordFromReq.get(e);if(!n)return;let{span:r,attributes:o,startTime:s}=n;r.end(),this._recordFromReq.delete(e),this.recordRequestDuration(o,s)}onError({request:e,error:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s,startTime:i}=r;o.recordException(n),o.setStatus({code:Vn.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(e),s[ot.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(s,i)}recordRequestDuration(e,n){let r={};[ot.ATTR_HTTP_RESPONSE_STATUS_CODE,ot.ATTR_HTTP_REQUEST_METHOD,ot.ATTR_SERVER_ADDRESS,ot.ATTR_SERVER_PORT,ot.ATTR_URL_SCHEME,ot.ATTR_ERROR_TYPE].forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,DT.hrTimeToMilliseconds)((0,DT.hrTimeDuration)(n,(0,DT.hrTime)()))/1e3;this._httpClientDurationHistogram.record(s,r)}getRequestMethod(e){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return e.toUpperCase()in n?e.toUpperCase():"_OTHER"}};UT.UndiciInstrumentation=pN});var yF=E(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0});wT.UndiciInstrumentation=void 0;var vfe=RF();Object.defineProperty(wT,"UndiciInstrumentation",{enumerable:!0,get:function(){return vfe.UndiciInstrumentation}})});var kT=E(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.ExpressLayerType=void 0;var Gfe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(Gfe=Gp.ExpressLayerType||(Gp.ExpressLayerType={}))});var GT=E(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.AttributeNames=void 0;var Bfe;(function(t){t.EXPRESS_TYPE="express.type",t.EXPRESS_NAME="express.name"})(Bfe=Bp.AttributeNames||(Bp.AttributeNames={}))});var dN=E(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu._LAYERS_STORE_PROPERTY=nu.kLayerPatched=void 0;nu.kLayerPatched=Symbol("express-layer-patched");nu._LAYERS_STORE_PROPERTY="__ot_middlewares"});var MF=E(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.getActualMatchedRoute=st.getConstructedRoute=st.getLayerPath=st.asErrorAndMessage=st.isLayerIgnored=st.getLayerMetadata=st.getRouterPath=st.storeLayerPath=void 0;var _N=kT(),ru=GT(),na=dN(),jfe=(t,e)=>(Array.isArray(t[na._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,na._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e===void 0?{isLayerPathStored:!1}:(t[na._LAYERS_STORE_PROPERTY].push(e),{isLayerPathStored:!0}));st.storeLayerPath=jfe;var Hfe=(t,e)=>{let n=e.handle?.stack?.[0];return n?.route?.path?`${t}${n.route.path}`:n?.handle?.stack?(0,st.getRouterPath)(t,n):t};st.getRouterPath=Hfe;var Vfe=(t,e,n)=>{if(e.name==="router"){let r=(0,st.getRouterPath)("",e),o=r||n||t||"/";return{attributes:{[ru.AttributeNames.EXPRESS_NAME]:o,[ru.AttributeNames.EXPRESS_TYPE]:_N.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return e.name==="bound dispatch"||e.name==="handle"?{attributes:{[ru.AttributeNames.EXPRESS_NAME]:(t||n)??"request handler",[ru.AttributeNames.EXPRESS_TYPE]:_N.ExpressLayerType.REQUEST_HANDLER},name:`request handler${e.path?` - ${t||n}`:""}`}:{attributes:{[ru.AttributeNames.EXPRESS_NAME]:e.name,[ru.AttributeNames.EXPRESS_TYPE]:_N.ExpressLayerType.MIDDLEWARE},name:`middleware - ${e.name}`}};st.getLayerMetadata=Vfe;var Ffe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")},qfe=(t,e,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(e))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(Ffe(t,r))return!0}catch{}return!1};st.isLayerIgnored=qfe;var $fe=t=>t instanceof Error?[t,t.message]:[String(t),String(t)];st.asErrorAndMessage=$fe;var Yfe=t=>{let e=t[0];return Array.isArray(e)?e.map(n=>CF(n)||"").join(","):CF(e)};st.getLayerPath=Yfe;var CF=t=>{if(typeof t=="string")return t;if(t instanceof RegExp||typeof t=="number")return t.toString()};function PF(t){let n=(Array.isArray(t[na._LAYERS_STORE_PROPERTY])?t[na._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}st.getConstructedRoute=PF;function Wfe(t){let e=Array.isArray(t[na._LAYERS_STORE_PROPERTY])?t[na._LAYERS_STORE_PROPERTY]:[];if(e.length===0)return;if(e.every(s=>s==="/"))return t.originalUrl==="/"?"/":void 0;let n=PF(t);if(n==="*"||n.includes("/")&&(n.includes(",")||n.includes("\\")||n.includes("*")||n.includes("[")))return n;let r=n.startsWith("/")?n:`/${n}`;return r.length>0&&(t.originalUrl===r||t.originalUrl.startsWith(r)||zfe(r))?r:void 0}st.getActualMatchedRoute=Wfe;function zfe(t){return t.includes(":")||t.includes("*")}});var xF=E(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.PACKAGE_NAME=ou.PACKAGE_VERSION=void 0;ou.PACKAGE_VERSION="0.62.0";ou.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var wF=E(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});jT.ExpressInstrumentation=void 0;var vF=he(),In=(b(),N(v)),LF=kT(),DF=GT(),io=MF(),UF=xF(),su=ne(),Kfe=(le(),N(Ae)),BT=dN(),fN=class extends su.InstrumentationBase{constructor(e={}){super(UF.PACKAGE_NAME,UF.PACKAGE_VERSION,e)}init(){return[new su.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],e=>{let n=typeof e?.Router?.prototype?.route=="function",r=n?e.Router.prototype:e.Router;return(0,su.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,su.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,su.isWrapped)(e.application.use)&&this._unwrap(e.application,"use"),this._wrap(e.application,"use",this._getAppUsePatch(n)),e},e=>{if(e===void 0)return;let r=typeof e?.Router?.prototype?.route=="function"?e.Router.prototype:e.Router;this._unwrap(r,"route"),this._unwrap(r,"use"),this._unwrap(e.application,"use")})]}_getRoutePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,io.getLayerPath)(o)),s}}}_getRouterUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,io.getLayerPath)(o)),s}}}_getAppUsePatch(e){let n=this;return function(r){return function(...s){let i=e?this.router:this._router,a=r.apply(this,s);if(i){let c=i.stack[i.stack.length-1];n._applyPatch(c,(0,io.getLayerPath)(s))}return a}}}_applyPatch(e,n){let r=this;e[BT.kLayerPatched]!==!0&&(e[BT.kLayerPatched]=!0,this._wrap(e,"handle",o=>{if(o.length===4)return o;let s=function(i,a){let{isLayerPathStored:c}=(0,io.storeLayerPath)(i,n),l=(0,io.getConstructedRoute)(i),p=(0,io.getActualMatchedRoute)(i),d={[Kfe.ATTR_HTTP_ROUTE]:p},_=(0,io.getLayerMetadata)(l,e,n),f=_.attributes[DF.AttributeNames.EXPRESS_TYPE],m=(0,vF.getRPCMetadata)(In.context.active());if(m?.type===vF.RPCType.HTTP&&(m.route=p),(0,io.isLayerIgnored)(_.name,f,r.getConfig()))return f===LF.ExpressLayerType.MIDDLEWARE&&i[BT._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(In.trace.getSpan(In.context.active())===void 0)return o.apply(this,arguments);let T=r._getSpanName({request:i,layerType:f,route:l},_.name),h=r.tracer.startSpan(T,{attributes:Object.assign(d,_.attributes)}),S=In.context.active(),R=In.trace.setSpan(S,h),{requestHook:I}=r.getConfig();I&&(0,su.safeExecuteInTheMiddle)(()=>I(h,{request:i,layerType:f,route:l}),ve=>{ve&&In.diag.error("express instrumentation: request hook failed",ve)},!0);let x=!1;_.attributes[DF.AttributeNames.EXPRESS_TYPE]===LF.ExpressLayerType.ROUTER&&(h.end(),x=!0,R=S);let V=()=>{x===!1&&(x=!0,h.end())},B=Array.from(arguments),se=B.findIndex(ve=>typeof ve=="function");se>=0&&(arguments[se]=function(){let ve=arguments[0],nn=![void 0,null,"route","router"].includes(ve);if(!x&&nn){let[ka,Ga]=(0,io.asErrorAndMessage)(ve);h.recordException(ka),h.setStatus({code:In.SpanStatusCode.ERROR,message:Ga})}x===!1&&(x=!0,i.res?.removeListener("finish",V),h.end()),!(i.route&&nn)&&c&&i[BT._LAYERS_STORE_PROPERTY].pop();let Ao=B[se],es=In.context.active(),Ti=In.trace.getSpan(S),ht=Ti?In.trace.setSpan(es,Ti):es;return In.context.bind(ht,Ao).apply(this,arguments)});try{return In.context.bind(R,o).apply(this,arguments)}catch(ve){let[nn,Ao]=(0,io.asErrorAndMessage)(ve);throw h.recordException(nn),h.setStatus({code:In.SpanStatusCode.ERROR,message:Ao}),ve}finally{x||a.once("finish",V)}};for(let i in o)Object.defineProperty(s,i,{get(){return o[i]},set(a){o[i]=a}});return s}))}_getSpanName(e,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(e,n)??n}catch(o){return In.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};jT.ExpressInstrumentation=fN});var kF=E(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.AttributeNames=ws.ExpressLayerType=ws.ExpressInstrumentation=void 0;var Qfe=wF();Object.defineProperty(ws,"ExpressInstrumentation",{enumerable:!0,get:function(){return Qfe.ExpressInstrumentation}});var Xfe=kT();Object.defineProperty(ws,"ExpressLayerType",{enumerable:!0,get:function(){return Xfe.ExpressLayerType}});var Jfe=GT();Object.defineProperty(ws,"AttributeNames",{enumerable:!0,get:function(){return Jfe.AttributeNames}})});var VF=E(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.SeverityNumber=void 0;var nme;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(nme=jp.SeverityNumber||(jp.SeverityNumber={}))});var FT=E(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.NOOP_LOGGER=iu.NoopLogger=void 0;var VT=class{emit(e){}};iu.NoopLogger=VT;iu.NOOP_LOGGER=new VT});var FF=E(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.API_BACKWARDS_COMPATIBILITY_VERSION=ao.makeGetter=ao._global=ao.GLOBAL_LOGS_API_KEY=void 0;ao.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");ao._global=globalThis;function rme(t,e,n){return r=>r===t?e:n}ao.makeGetter=rme;ao.API_BACKWARDS_COMPATIBILITY_VERSION=1});var mN=E(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.NOOP_LOGGER_PROVIDER=au.NoopLoggerProvider=void 0;var ome=FT(),qT=class{getLogger(e,n,r){return new ome.NoopLogger}};au.NoopLoggerProvider=qT;au.NOOP_LOGGER_PROVIDER=new qT});var qF=E($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});$T.ProxyLogger=void 0;var sme=FT(),TN=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):sme.NOOP_LOGGER}};$T.ProxyLogger=TN});var $F=E(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});YT.ProxyLoggerProvider=void 0;var ime=mN(),ame=qF(),hN=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new ame.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:ime.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};YT.ProxyLoggerProvider=hN});var WF=E(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});WT.LogsAPI=void 0;var sr=FF(),cme=mN(),YF=$F(),EN=class t{constructor(){this._proxyLoggerProvider=new YF.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return sr._global[sr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(sr._global[sr.GLOBAL_LOGS_API_KEY]=(0,sr.makeGetter)(sr.API_BACKWARDS_COMPATIBILITY_VERSION,e,cme.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=sr._global[sr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(sr._global,sr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete sr._global[sr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new YF.ProxyLoggerProvider}};WT.LogsAPI=EN});var SN=E(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.logs=co.NoopLogger=co.NOOP_LOGGER=co.SeverityNumber=void 0;var ume=VF();Object.defineProperty(co,"SeverityNumber",{enumerable:!0,get:function(){return ume.SeverityNumber}});var zF=FT();Object.defineProperty(co,"NOOP_LOGGER",{enumerable:!0,get:function(){return zF.NOOP_LOGGER}});Object.defineProperty(co,"NoopLogger",{enumerable:!0,get:function(){return zF.NoopLogger}});var lme=WF();co.logs=lme.LogsAPI.getInstance()});var KF=E(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.disableInstrumentations=cu.enableInstrumentations=void 0;function pme(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}cu.enableInstrumentations=pme;function dme(t){t.forEach(e=>e.disable())}cu.disableInstrumentations=dme});var JF=E(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});zT.registerInstrumentations=void 0;var QF=(b(),N(v)),_me=SN(),XF=KF();function fme(t){let e=t.tracerProvider||QF.trace.getTracerProvider(),n=t.meterProvider||QF.metrics.getMeterProvider(),r=t.loggerProvider||_me.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,XF.enableInstrumentations)(o,e,n,r),()=>{(0,XF.disableInstrumentations)(o)}}zT.registerInstrumentations=fme});var aq=E(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});KT.satisfies=void 0;var yN=(b(),N(v)),rq=/^(?: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-]+)*))?$/,mme=/^(?<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-]+)*))?$/,Tme={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function hme(t,e,n){if(!Eme(t))return yN.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=Rme(t);if(!r)return!1;let o=[],s=oq(r,e,o,n);return s&&!n?.includePrerelease?gme(r,o):s}KT.satisfies=hme;function Eme(t){return typeof t=="string"&&rq.test(t)}function oq(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(gN(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=Fme(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!gN(t,s,n,r))return!1;return!0}return gN(t,e,n,r)}function gN(t,e,n,r){if(e=Ame(e,r),e.includes(" "))return oq(t,e,n,r);{let o=yme(e);return n.push(o),Sme(t,o)}}function Sme(t,e){if(e.invalid)return!1;if(!e.version||RN(e.version))return!0;let n=eq(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=eq(r,o)}return Tme[e.op]?.includes(n)}function gme(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function Ame(t,e){return t=t.trim(),t=Hme(t,e),t=jme(t),t=Vme(t,e),t=t.trim(),t}function pn(t){return!t||t.toLowerCase()==="x"||t==="*"}function Rme(t){let e=t.match(rq);if(!e){yN.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function yme(t){if(!t)return{};let e=t.match(mme);if(!e)return yN.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function RN(t){return t==="*"||t==="x"||t==="X"}function ZF(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Ime(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function Nme(t,e){if(RN(t)||RN(e))return 0;let[n,r]=Ime(ZF(t),ZF(e));return n>r?1:n<r?-1:0}function eq(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=Nme(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var sq="[a-zA-Z0-9-]",iq="0|[1-9]\\d*",Ome=`\\d*[a-zA-Z-]${sq}*`,bme="((?:<|>)?=?)",tq=`(?:${iq}|${Ome})`,Cme=`(?:-(${tq}(?:\\.${tq})*))`,nq=`${sq}+`,Pme=`(?:\\+(${nq}(?:\\.${nq})*))`,AN=`${iq}|x|X|\\*`,Hp=`[v=\\s]*(${AN})(?:\\.(${AN})(?:\\.(${AN})(?:${Cme})?${Pme}?)?)?`,Mme=`^${bme}\\s*${Hp}$`,xme=new RegExp(Mme),vme=`^\\s*(${Hp})\\s+-\\s+(${Hp})\\s*$`,Lme=new RegExp(vme),Dme="(?:~>?)",Ume=`^${Dme}${Hp}$`,wme=new RegExp(Ume),kme="(?:\\^)",Gme=`^${kme}${Hp}$`,Bme=new RegExp(Gme);function jme(t){let e=wme;return t.replace(e,(n,r,o,s,i)=>{let a;return pn(r)?a="":pn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:pn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function Hme(t,e){let n=Bme,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let l;return pn(s)?l="":pn(i)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:pn(a)?s==="0"?l=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?l=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,l})}function Vme(t,e){let n=xme;return t.replace(n,(r,o,s,i,a,c)=>{let l=pn(s),p=l||pn(i),d=p||pn(a),_=d;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",l?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function Fme(t,e){let n=Lme;return t.replace(n,(r,o,s,i,a,c,l,p,d,_,f,m)=>(pn(s)?o="":pn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:pn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,pn(d)?p="":pn(_)?p=`<${+d+1}.0.0-0`:pn(f)?p=`<${d}.${+_+1}.0-0`:m?p=`<=${d}.${_}.${f}-${m}`:e?.includePrerelease?p=`<${d}.${_}.${+f+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var IN=E(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.massUnwrap=kt.unwrap=kt.massWrap=kt.wrap=void 0;var dn=console.error.bind(console);function Vp(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var qme=(t,e,n)=>{if(!t||!t[e]){dn("no original function "+String(e)+" to wrap");return}if(!n){dn("no wrapper function"),dn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){dn("original object and wrapper must be functions");return}let o=n(r,e);return Vp(o,"__original",r),Vp(o,"__unwrap",()=>{t[e]===o&&Vp(t,e,r)}),Vp(o,"__wrapped",!0),Vp(t,e,o),o};kt.wrap=qme;var $me=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{dn("must provide one or more modules to patch"),dn(new Error().stack);return}if(!(e&&Array.isArray(e))){dn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,kt.wrap)(r,o,n)})})};kt.massWrap=$me;var Yme=(t,e)=>{if(!t||!t[e]){dn("no function to unwrap."),dn(new Error().stack);return}let n=t[e];if(!n.__unwrap)dn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};kt.unwrap=Yme;var Wme=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{dn("must provide one or more modules to patch"),dn(new Error().stack);return}if(!(e&&Array.isArray(e))){dn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,kt.unwrap)(n,r)})})};kt.massUnwrap=Wme;function Fp(t){t&&t.logger&&(typeof t.logger!="function"?dn("new logger isn't a function, not replacing"):dn=t.logger)}kt.default=Fp;Fp.wrap=kt.wrap;Fp.massWrap=kt.massWrap;Fp.unwrap=kt.unwrap;Fp.massUnwrap=kt.massUnwrap});var cq=E(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});XT.InstrumentationAbstract=void 0;var NN=(b(),N(v)),zme=SN(),QT=IN(),ON=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=NN.diag.createComponentLogger({namespace:e}),this._tracer=NN.trace.getTracer(e,n),this._meter=NN.metrics.getMeter(e,n),this._logger=zme.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=QT.wrap;_unwrap=QT.unwrap;_massWrap=QT.massWrap;_massUnwrap=QT.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};XT.InstrumentationAbstract=ON});var uq=E(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.ModuleNameTrie=ks.ModuleNameSeparator=void 0;ks.ModuleNameSeparator="/";var JT=class{hooks=[];children=new Map},bN=class{_trie=new JT;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(ks.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new JT,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(ks.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};ks.ModuleNameTrie=bN});var pq=E(ZT=>{"use strict";Object.defineProperty(ZT,"__esModule",{value:!0});ZT.RequireInTheMiddleSingleton=void 0;var Kme=Pi(),lq=U("path"),CN=uq(),Qme=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),PN=class t{_moduleNameTrie=new CN.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new Kme.Hook(null,{internals:!0},(e,n,r)=>{let o=Xme(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return Qme?new t:this._instance=this._instance??new t}};ZT.RequireInTheMiddleSingleton=PN;function Xme(t){return lq.sep!==CN.ModuleNameSeparator?t.split(lq.sep).join(CN.ModuleNameSeparator):t}});var Tq=E(qp=>{var dq=[],MN=new WeakMap,_q=new WeakMap,fq=new Map,mq=[],Jme={set(t,e,n){let r=MN.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=_q.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=MN.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function Zme(t,e,n,r,o){fq.set(t,o),MN.set(e,n),_q.set(e,r);let s=new Proxy(e,Jme);dq.forEach(i=>i(t,s,o)),mq.push([t,s,o])}qp.register=Zme;qp.importHooks=dq;qp.specifiers=fq;qp.toHook=mq});var DN=E((WYe,lu)=>{var hq=U("path"),eTe=ef(),{fileURLToPath:tTe}=U("url"),{MessageChannel:nTe}=U("worker_threads"),{isBuiltin:xN}=U("module");xN||(xN=()=>!0);var{importHooks:vN,specifiers:rTe,toHook:oTe}=Tq();function Eq(t){vN.push(t),oTe.forEach(([e,n,r])=>t(e,n,r))}function Sq(t){let e=vN.indexOf(t);e>-1&&vN.splice(e,1)}function uu(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var LN;function sTe(){let{port1:t,port2:e}=new nTe,n=0,r;LN=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(l=>{r=l}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function $p(t,e,n){if(!(this instanceof $p))return new $p(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;LN&&Array.isArray(t)&&LN(t),this._iitmHook=(o,s,i)=>{let a=o,c=a.startsWith("node:"),l,p;if(c){let d=o.slice(5);xN(d)&&(o=d)}else if(a.startsWith("file://")){let d=Error.stackTraceLimit;Error.stackTraceLimit=0;try{l=tTe(o),o=l}catch{}if(Error.stackTraceLimit=d,l){let _=eTe(l);_&&(o=_.name,p=_.basedir)}}if(t)for(let d of t)if(l&&d===l)uu(n,s,l,void 0);else if(d===o){if(!p)uu(n,s,o,p);else if(p.endsWith(rTe.get(a)))uu(n,s,o,p);else if(r){let _=o+hq.sep+hq.relative(p,l);uu(n,s,_,p)}}else d===i&&uu(n,s,i,p);else uu(n,s,o,p)},Eq(this._iitmHook)}$p.prototype.unhook=function(){Sq(this._iitmHook)};lu.exports=$p;lu.exports.Hook=$p;lu.exports.addHook=Eq;lu.exports.removeHook=Sq;lu.exports.createAddHookMessageChannel=sTe});var UN=E(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.isWrapped=Gs.safeExecuteInTheMiddleAsync=Gs.safeExecuteInTheMiddle=void 0;function iTe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Gs.safeExecuteInTheMiddle=iTe;async function aTe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(await e(r,o),r&&!n)throw r;return o}}Gs.safeExecuteInTheMiddleAsync=aTe;function cTe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}Gs.isWrapped=cTe});var Rq=E(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.InstrumentationBase=void 0;var Yp=U("path"),gq=U("util"),uTe=aq(),wN=IN(),lTe=cq(),pTe=pq(),dTe=DN(),Wp=(b(),N(v)),_Te=Pi(),fTe=U("fs"),mTe=UN(),kN=class extends lTe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=pTe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,mTe.isWrapped)(e[n])&&this._unwrap(e,n),gq.types.isProxy(e)){let o=(0,wN.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,wN.wrap)(e,n,r)};_unwrap=(e,n)=>gq.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,wN.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Wp.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Wp.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Wp.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Wp.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=U.resolve(n);U.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,fTe.readFileSync)(Yp.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Wp.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return Aq(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=Yp.normalize(r);return i.filter(l=>l.name===a&&Aq(l.supportedVersions,s,e.includePrerelease)).reduce((l,p)=>(p.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&Yp.isAbsolute(a)){let l=Yp.parse(a);a=l.name,c=l.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=Yp.isAbsolute(e.name)?new _Te.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new dTe.Hook([e.name],{internals:!0},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};eh.InstrumentationBase=kN;function Aq(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,uTe.satisfies)(e,r,{includePrerelease:n}))}});var yq=E(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.normalize=void 0;var TTe=U("path");Object.defineProperty(th,"normalize",{enumerable:!0,get:function(){return TTe.normalize}})});var Iq=E(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.normalize=pu.InstrumentationBase=void 0;var hTe=Rq();Object.defineProperty(pu,"InstrumentationBase",{enumerable:!0,get:function(){return hTe.InstrumentationBase}});var ETe=yq();Object.defineProperty(pu,"normalize",{enumerable:!0,get:function(){return ETe.normalize}})});var GN=E(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.normalize=du.InstrumentationBase=void 0;var Nq=Iq();Object.defineProperty(du,"InstrumentationBase",{enumerable:!0,get:function(){return Nq.InstrumentationBase}});Object.defineProperty(du,"normalize",{enumerable:!0,get:function(){return Nq.normalize}})});var Oq=E(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.InstrumentationNodeModuleDefinition=void 0;var BN=class{files;name;supportedVersions;patch;unpatch;constructor(e,n,r,o,s){this.files=s||[],this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o}};nh.InstrumentationNodeModuleDefinition=BN});var bq=E(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.InstrumentationNodeModuleFile=void 0;var STe=GN(),jN=class{name;supportedVersions;patch;unpatch;constructor(e,n,r,o){this.name=(0,STe.normalize)(e),this.supportedVersions=n,this.patch=r,this.unpatch=o}};rh.InstrumentationNodeModuleFile=jN});var Cq=E(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.semconvStabilityFromStr=ra.SemconvStability=void 0;var oh;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(oh=ra.SemconvStability||(ra.SemconvStability={}));function gTe(t,e){let n=oh.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=oh.DUPLICATE;break}else o.toLowerCase()===t&&(n=oh.STABLE);return n}ra.semconvStabilityFromStr=gTe});var Mq=E(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.semconvStabilityFromStr=it.SemconvStability=it.safeExecuteInTheMiddleAsync=it.safeExecuteInTheMiddle=it.isWrapped=it.InstrumentationNodeModuleFile=it.InstrumentationNodeModuleDefinition=it.InstrumentationBase=it.registerInstrumentations=void 0;var ATe=JF();Object.defineProperty(it,"registerInstrumentations",{enumerable:!0,get:function(){return ATe.registerInstrumentations}});var RTe=GN();Object.defineProperty(it,"InstrumentationBase",{enumerable:!0,get:function(){return RTe.InstrumentationBase}});var yTe=Oq();Object.defineProperty(it,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return yTe.InstrumentationNodeModuleDefinition}});var ITe=bq();Object.defineProperty(it,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return ITe.InstrumentationNodeModuleFile}});var HN=UN();Object.defineProperty(it,"isWrapped",{enumerable:!0,get:function(){return HN.isWrapped}});Object.defineProperty(it,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return HN.safeExecuteInTheMiddle}});Object.defineProperty(it,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return HN.safeExecuteInTheMiddleAsync}});var Pq=Cq();Object.defineProperty(it,"SemconvStability",{enumerable:!0,get:function(){return Pq.SemconvStability}});Object.defineProperty(it,"semconvStabilityFromStr",{enumerable:!0,get:function(){return Pq.semconvStabilityFromStr}})});var xq=E((oWe,NTe)=>{NTe.exports={name:"@fastify/otel",version:"0.18.0",description:"Official Fastify OpenTelemetry Instrumentation",main:"index.js",type:"commonjs",types:"types/index.d.ts",scripts:{lint:"eslint","lint:fix":"eslint --fix",test:"npm run test:all && npm run test:typescript","test:unit":"c8 --100 node --test","test:all":"npm run test:v4 && npm run test:v5","test:v4":"cross-env FASTIFY_VERSION=fastifyv4 npm run test:unit","test:v5":"cross-env FASTIFY_VERSION=fastify npm run test:unit","test:coverage":"c8 node --test && c8 report --reporter=html","test:typescript":"tsd"},repository:{type:"git",url:"git+https://github.com/fastify/otel.git"},keywords:["plugin","helper","fastify","instrumentation","otel","opentelemetry"],author:"Carlos Fuentes - @metcoder95 (https://metcoder.dev)",license:"MIT",bugs:{url:"https://github.com/fastify/otel/issues"},homepage:"https://github.com/fastify/otel#readme",funding:[{type:"github",url:"https://github.com/sponsors/fastify"},{type:"opencollective",url:"https://opencollective.com/fastify"}],devDependencies:{"@fastify/type-provider-typebox":"^6.1.0","@opentelemetry/context-async-hooks":"^2.0.0","@opentelemetry/contrib-test-utils":"^0.59.0","@opentelemetry/instrumentation-http":"^0.212.0","@opentelemetry/propagator-jaeger":"^2.0.0","@opentelemetry/sdk-trace-base":"^2.0.0","@opentelemetry/sdk-trace-node":"^2.2.0","@types/node":"^25.0.3",c8:"^11.0.0","cross-env":"^10.0.0",eslint:"^9.16.0",fastify:"^5.1.0","fastify-plugin":"^5.1.0",fastifyv4:"npm:fastify@^4.0.0",neostandard:"^0.12.0",tsd:"^0.33.0"},dependencies:{"@opentelemetry/core":"^2.0.0","@opentelemetry/instrumentation":"^0.212.0","@opentelemetry/semantic-conventions":"^1.28.0",minimatch:"^10.2.4"},peerDependencies:{"@opentelemetry/api":"^1.9.0"},tsd:{directory:"types"}}});var Lq=E(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.range=oa.balanced=void 0;var OTe=(t,e,n)=>{let r=t instanceof RegExp?vq(t,n):t,o=e instanceof RegExp?vq(e,n):e,s=r!==null&&o!=null&&(0,oa.range)(r,o,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+o.length)}};oa.balanced=OTe;var vq=(t,e)=>{let n=e.match(t);return n?n[0]:null},bTe=(t,e,n)=>{let r,o,s,i,a,c=n.indexOf(t),l=n.indexOf(e,c+1),p=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],s=n.length;p>=0&&!a;){if(p===c)r.push(p),c=n.indexOf(t,p+1);else if(r.length===1){let d=r.pop();d!==void 0&&(a=[d,l])}else o=r.pop(),o!==void 0&&o<s&&(s=o,i=l),l=n.indexOf(e,p+1);p=c<l&&c>=0?c:l}r.length&&i!==void 0&&(a=[s,i])}return a};oa.range=bTe});var jq=E(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.EXPANSION_MAX=void 0;_u.expand=jTe;var Dq=Lq(),Uq="\0SLASH"+Math.random()+"\0",wq="\0OPEN"+Math.random()+"\0",FN="\0CLOSE"+Math.random()+"\0",kq="\0COMMA"+Math.random()+"\0",Gq="\0PERIOD"+Math.random()+"\0",CTe=new RegExp(Uq,"g"),PTe=new RegExp(wq,"g"),MTe=new RegExp(FN,"g"),xTe=new RegExp(kq,"g"),vTe=new RegExp(Gq,"g"),LTe=/\\\\/g,DTe=/\\{/g,UTe=/\\}/g,wTe=/\\,/g,kTe=/\\\./g;_u.EXPANSION_MAX=1e5;function VN(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function GTe(t){return t.replace(LTe,Uq).replace(DTe,wq).replace(UTe,FN).replace(wTe,kq).replace(kTe,Gq)}function BTe(t){return t.replace(CTe,"\\").replace(PTe,"{").replace(MTe,"}").replace(xTe,",").replace(vTe,".")}function Bq(t){if(!t)return[""];let e=[],n=(0,Dq.balanced)("{","}",t);if(!n)return t.split(",");let{pre:r,body:o,post:s}=n,i=r.split(",");i[i.length-1]+="{"+o+"}";let a=Bq(s);return s.length&&(i[i.length-1]+=a.shift(),i.push.apply(i,a)),e.push.apply(e,i),e}function jTe(t,e={}){if(!t)return[];let{max:n=_u.EXPANSION_MAX}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),zp(GTe(t),n,!0).map(BTe)}function HTe(t){return"{"+t+"}"}function VTe(t){return/^-?0\d/.test(t)}function FTe(t,e){return t<=e}function qTe(t,e){return t>=e}function zp(t,e,n){let r=[],o=(0,Dq.balanced)("{","}",t);if(!o)return[t];let s=o.pre,i=o.post.length?zp(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let a=0;a<i.length&&a<e;a++){let c=s+"{"+o.body+"}"+i[a];r.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),l=a||c,p=o.body.indexOf(",")>=0;if(!l&&!p)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+FN+o.post,zp(t,e,!0)):[t];let d;if(l)d=o.body.split(/\.\./);else if(d=Bq(o.body),d.length===1&&d[0]!==void 0&&(d=zp(d[0],e,!1).map(HTe),d.length===1))return i.map(f=>o.pre+d[0]+f);let _;if(l&&d[0]!==void 0&&d[1]!==void 0){let f=VN(d[0]),m=VN(d[1]),T=Math.max(d[0].length,d[1].length),h=d.length===3&&d[2]!==void 0?Math.abs(VN(d[2])):1,S=FTe;m<f&&(h*=-1,S=qTe);let I=d.some(VTe);_=[];for(let x=f;S(x,m);x+=h){let V;if(c)V=String.fromCharCode(x),V==="\\"&&(V="");else if(V=String(x),I){let B=T-V.length;if(B>0){let se=new Array(B+1).join("0");x<0?V="-"+se+V.slice(1):V=se+V}}_.push(V)}}else{_=[];for(let f=0;f<d.length;f++)_.push.apply(_,zp(d[f],e,!1))}for(let f=0;f<_.length;f++)for(let m=0;m<i.length&&r.length<e;m++){let T=s+_[f]+i[m];(!n||l||T)&&r.push(T)}}return r}});var Hq=E(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.assertValidPattern=void 0;var $Te=1024*64,YTe=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>$Te)throw new TypeError("pattern is too long")};sh.assertValidPattern=YTe});var Fq=E(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.parseClass=void 0;var WTe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Kp=t=>t.replace(/[[\]\\-]/g,"\\$&"),zTe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Vq=t=>t.join(""),KTe=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],s=n+1,i=!1,a=!1,c=!1,l=!1,p=n,d="";e:for(;s<t.length;){let T=t.charAt(s);if((T==="!"||T==="^")&&s===n+1){l=!0,s++;continue}if(T==="]"&&i&&!c){p=s+1;break}if(i=!0,T==="\\"&&!c){c=!0,s++;continue}if(T==="["&&!c){for(let[h,[S,R,I]]of Object.entries(WTe))if(t.startsWith(h,s)){if(d)return["$.",!1,t.length-n,!0];s+=h.length,I?o.push(S):r.push(S),a=a||R;continue e}}if(c=!1,d){T>d?r.push(Kp(d)+"-"+Kp(T)):T===d&&r.push(Kp(T)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(Kp(T+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=T,s+=2;continue}r.push(Kp(T)),s++}if(p<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,t.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let T=r[0].length===2?r[0].slice(-1):r[0];return[zTe(T),!1,p-n,!1]}let _="["+(l?"^":"")+Vq(r)+"]",f="["+(l?"":"^")+Vq(o)+"]";return[r.length&&o.length?"("+_+"|"+f+")":r.length?_:f,a,p-n,!0]};ih.parseClass=KTe});var ch=E(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.unescape=void 0;var QTe=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!0}={})=>n?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");ah.unescape=QTe});var YN=E(dh=>{"use strict";var Nn;Object.defineProperty(dh,"__esModule",{value:!0});dh.AST=void 0;var XTe=Fq(),uh=ch(),JTe=new Set(["!","?","+","*","@"]),qN=t=>JTe.has(t),qq=t=>qN(t.type),ZTe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),ehe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),the=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),$q=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),nhe="(?!(?:^|/)\\.\\.?(?:$|/))",lh="(?!\\.)",rhe=new Set(["[","."]),ohe=new Set(["..","."]),she=new Set("().*{}+?[]^$\\!"),ihe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),$N="[^/]",Yq=$N+"*?",Wq=$N+"+?",ahe=0,ph=class{type;#n;#r;#o=!1;#e=[];#t;#a;#u;#c=!1;#s;#i;#l=!1;id=++ahe;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#n.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,n,r={}){this.type=e,e&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#u=this.#n===this?[]:this.#n.#u,e==="!"&&!this.#n.#c&&this.#u.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#i!==void 0?this.#i:this.type?this.#i=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#i=this.#e.map(e=>String(e)).join("")}#h(){if(this!==this.#n)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let n=e,r=n.#t;for(;r;){for(let o=n.#a+1;!r.type&&o<r.#e.length;o++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof Nn&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let e=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#c&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let e=this.#t;for(let n=0;n<this.#a;n++){let r=e.#e[n];if(!(r instanceof Nn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let e=this.#t?this.#t.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new Nn(this.type,e);for(let r of this.#e)n.copyIn(r);return n}static#p(e,n,r,o,s){let i=o.maxExtglobRecursion??2,a=!1,c=!1,l=-1,p=!1;if(n.type===null){let T=r,h="";for(;T<e.length;){let S=e.charAt(T++);if(a||S==="\\"){a=!a,h+=S;continue}if(c){T===l+1?(S==="^"||S==="!")&&(p=!0):S==="]"&&!(T===l+2&&p)&&(c=!1),h+=S;continue}else if(S==="["){c=!0,l=T,p=!1,h+=S;continue}if(!o.noext&&qN(S)&&e.charAt(T)==="("&&s<=i){n.push(h),h="";let I=new Nn(S,n);T=Nn.#p(e,I,T,o,s+1),n.push(I);continue}h+=S}return n.push(h),T}let d=r+1,_=new Nn(null,n),f=[],m="";for(;d<e.length;){let T=e.charAt(d++);if(a||T==="\\"){a=!a,m+=T;continue}if(c){d===l+1?(T==="^"||T==="!")&&(p=!0):T==="]"&&!(d===l+2&&p)&&(c=!1),m+=T;continue}else if(T==="["){c=!0,l=d,p=!1,m+=T;continue}if(!o.noext&&qN(T)&&e.charAt(d)==="("&&(s<=i||n&&n.#d(T))){let S=n&&n.#d(T)?0:1;_.push(m),m="";let R=new Nn(T,_);_.push(R),d=Nn.#p(e,R,d,o,s+S);continue}if(T==="|"){_.push(m),m="",f.push(_),_=new Nn(null,n);continue}if(T===")")return m===""&&n.#e.length===0&&(n.#l=!0),_.push(m),m="",n.push(...f,_),d;m+=T}return n.type=null,n.#r=void 0,n.#e=[e.substring(r-1)],d}#E(e){return this.#f(e,ehe)}#f(e,n=ZTe){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let r=e.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#d(r.type,n)}#d(e,n=the){return!!n.get(this.type)?.includes(e)}#S(e,n){let r=e.#e[0],o=new Nn(null,r,this.options);o.#e.push(""),r.push(o),this.#m(e,n)}#m(e,n){let r=e.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#i=void 0}#g(e){return!!$q.get(this.type)?.has(e)}#A(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#g(n.type)}#R(e){let n=$q.get(this.type),r=e.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let s of this.#e)typeof s=="object"&&(s.#t=this);this.type=o,this.#i=void 0,this.#l=!1}static fromGlob(e,n={}){let r=new Nn(null,void 0,n);return Nn.#p(e,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let e=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#s}toRegExpSource(e){let n=e??!!this.#s.dot;if(this.#n===this&&(this.#_(),this.#h()),!qq(this)){let c=this.isStart()&&this.isEnd()&&!this.#e.some(f=>typeof f!="string"),l=this.#e.map(f=>{let[m,T,h,S]=typeof f=="string"?Nn.#y(f,this.#r,c):f.toRegExpSource(e);return this.#r=this.#r||h,this.#o=this.#o||S,m}).join(""),p="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&ohe.has(this.#e[0]))){let m=rhe,T=n&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),h=!n&&!e&&m.has(l.charAt(0));p=T?nhe:h?lh:""}let d="";return this.isEnd()&&this.#n.#c&&this.#t?.type==="!"&&(d="(?:$|\\/)"),[p+l+d,(0,uh.unescape)(l),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#T(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),l=this;return l.#e=[c],l.type=null,l.#r=void 0,[c,(0,uh.unescape)(this.toString()),!1,!1]}let i=!r||e||n||!lh?"":this.#T(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!n?lh:"")+Wq;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?lh:"")+Yq+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`;a=o+s+c}return[a,(0,uh.unescape)(s),this.#r=!!this.#r,this.#o]}#_(){if(qq(this)){let e=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#_(),this.#f(o)?(n=!1,this.#m(o,r)):this.#E(o)?(n=!1,this.#S(o,r)):this.#A(o)&&(n=!1,this.#R(o)))}}while(!n&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#_();this.#i=void 0}#T(e){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,s,i]=n.toRegExpSource(e);return this.#o=this.#o||i,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#y(e,n,r=!1){let o=!1,s="",i=!1,a=!1;for(let c=0;c<e.length;c++){let l=e.charAt(c);if(o){o=!1,s+=(she.has(l)?"\\":"")+l;continue}if(l==="*"){if(a)continue;a=!0,s+=r&&/^[*]+$/.test(e)?Wq:Yq,n=!0;continue}else a=!1;if(l==="\\"){c===e.length-1?s+="\\\\":o=!0;continue}if(l==="["){let[p,d,_,f]=(0,XTe.parseClass)(e,c);if(_){s+=p,i=i||d,c+=_-1,n=n||f;continue}}if(l==="?"){s+=$N,n=!0;continue}s+=ihe(l)}return[s,(0,uh.unescape)(e),!!n,i]}};dh.AST=ph;Nn=ph});var WN=E(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.escape=void 0;var che=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!1}={})=>n?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");_h.escape=che});var e$=E(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.unescape=k.escape=k.AST=k.Minimatch=k.match=k.makeRe=k.braceExpand=k.defaults=k.filter=k.GLOBSTAR=k.sep=k.minimatch=void 0;var uhe=jq(),fh=Hq(),Qq=YN(),lhe=WN(),phe=ch(),dhe=(t,e,n={})=>((0,fh.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new sa(e,n).match(t));k.minimatch=dhe;var _he=/^\*+([^+@!?\*\[\(]*)$/,fhe=t=>e=>!e.startsWith(".")&&e.endsWith(t),mhe=t=>e=>e.endsWith(t),The=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),hhe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Ehe=/^\*+\.\*+$/,She=t=>!t.startsWith(".")&&t.includes("."),ghe=t=>t!=="."&&t!==".."&&t.includes("."),Ahe=/^\.\*+$/,Rhe=t=>t!=="."&&t!==".."&&t.startsWith("."),yhe=/^\*+$/,Ihe=t=>t.length!==0&&!t.startsWith("."),Nhe=t=>t.length!==0&&t!=="."&&t!=="..",Ohe=/^\?+([^+@!?\*\[\(]*)?$/,bhe=([t,e=""])=>{let n=Xq([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},Che=([t,e=""])=>{let n=Jq([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},Phe=([t,e=""])=>{let n=Jq([t]);return e?r=>n(r)&&r.endsWith(e):n},Mhe=([t,e=""])=>{let n=Xq([t]);return e?r=>n(r)&&r.endsWith(e):n},Xq=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},Jq=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},Zq=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",zq={win32:{sep:"\\"},posix:{sep:"/"}};k.sep=Zq==="win32"?zq.win32.sep:zq.posix.sep;k.minimatch.sep=k.sep;k.GLOBSTAR=Symbol("globstar **");k.minimatch.GLOBSTAR=k.GLOBSTAR;var xhe="[^/]",vhe=xhe+"*?",Lhe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Dhe="(?:(?!(?:\\/|^)\\.).)*?",Uhe=(t,e={})=>n=>(0,k.minimatch)(n,t,e);k.filter=Uhe;k.minimatch.filter=k.filter;var ir=(t,e={})=>Object.assign({},t,e),whe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return k.minimatch;let e=k.minimatch;return Object.assign((r,o,s={})=>e(r,o,ir(t,s)),{Minimatch:class extends e.Minimatch{constructor(o,s={}){super(o,ir(t,s))}static defaults(o){return e.defaults(ir(t,o)).Minimatch}},AST:class extends e.AST{constructor(o,s,i={}){super(o,s,ir(t,i))}static fromGlob(o,s={}){return e.AST.fromGlob(o,ir(t,s))}},unescape:(r,o={})=>e.unescape(r,ir(t,o)),escape:(r,o={})=>e.escape(r,ir(t,o)),filter:(r,o={})=>e.filter(r,ir(t,o)),defaults:r=>e.defaults(ir(t,r)),makeRe:(r,o={})=>e.makeRe(r,ir(t,o)),braceExpand:(r,o={})=>e.braceExpand(r,ir(t,o)),match:(r,o,s={})=>e.match(r,o,ir(t,s)),sep:e.sep,GLOBSTAR:k.GLOBSTAR})};k.defaults=whe;k.minimatch.defaults=k.defaults;var khe=(t,e={})=>((0,fh.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,uhe.expand)(t,{max:e.braceExpandMax}));k.braceExpand=khe;k.minimatch.braceExpand=k.braceExpand;var Ghe=(t,e={})=>new sa(t,e).makeRe();k.makeRe=Ghe;k.minimatch.makeRe=k.makeRe;var Bhe=(t,e,n={})=>{let r=new sa(e,n);return t=t.filter(o=>r.match(o)),r.options.nonull&&!t.length&&t.push(e),t};k.match=Bhe;k.minimatch.match=k.match;var Kq=/[?*]|[+@!]\(.*?\)|\[|\]/,jhe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),sa=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,n={}){(0,fh.assertValidPattern)(e),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=e,this.platform=n.platform||Zq,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,i,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!Kq.test(s[2]))&&!Kq.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(p=>this.parse(p))];if(l)return[s[0],...s.slice(1).map(p=>this.parse(p))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let o=0;o<e[r].length;o++)e[r][o]==="**"&&(e[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,o)=>{let s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let s=e[o];o===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let o=e[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let a=r[o+1],c=r[o+2],l=r[o+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(o,1);let p=r.slice(0);p[o]="**",e.push(p),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){let a=r[i];i===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(i,1),i--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let o=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(o){e[n]=[],e[r]=o;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let o=0,s=0,i=[],a="";for(;o<e.length&&s<n.length;)if(e[o]===n[s])i.push(a==="b"?n[s]:e[o]),o++,s++;else if(r&&e[o]==="**"&&n[s]===e[o+1])i.push(e[o]),o++;else if(r&&n[s]==="**"&&e[o]===n[s+1])i.push(n[s]),s++;else if(e[o]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",i.push(e[o]),o++,s++}else if(n[s]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(a==="a")return!1;a="b",i.push(n[s]),o++,s++}else return!1;return e.length===n.length&&i}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let o=0;o<e.length&&e.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let o=0,s=0;if(this.isWindows){let a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),c=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),l=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),p=!l&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),d=c?3:a?0:void 0,_=p?3:l?0:void 0;if(typeof d=="number"&&typeof _=="number"){let[f,m]=[e[d],n[_]];f.toLowerCase()===m.toLowerCase()&&(n[_]=f,s=_,o=d)}}let{optimizationLevel:i=1}=this.options;return i>=2&&(e=this.levelTwoFileOptimize(e)),n.includes(k.GLOBSTAR)?this.#n(e,n,r,o,s):this.#o(e,n,r,o,s)}#n(e,n,r,o,s){let i=n.indexOf(k.GLOBSTAR,s),a=n.lastIndexOf(k.GLOBSTAR),[c,l,p]=r?[n.slice(s,i),n.slice(i+1),[]]:[n.slice(s,i),n.slice(i+1,a),n.slice(a+1)];if(c.length){let R=e.slice(o,o+c.length);if(!this.#o(R,c,r,0,0))return!1;o+=c.length,s+=c.length}let d=0;if(p.length){if(p.length+o>e.length)return!1;let R=e.length-p.length;if(this.#o(e,p,r,R,0))d=p.length;else{if(e[e.length-1]!==""||o+p.length===e.length||(R--,!this.#o(e,p,r,R,0)))return!1;d=p.length+1}}if(!l.length){let R=!!d;for(let I=o;I<e.length-d;I++){let x=String(e[I]);if(R=!0,x==="."||x===".."||!this.options.dot&&x.startsWith("."))return!1}return r||R}let _=[[[],0]],f=_[0],m=0,T=[0];for(let R of l)R===k.GLOBSTAR?(T.push(m),f=[[],0],_.push(f)):(f[0].push(R),m++);let h=_.length-1,S=e.length-d;for(let R of _)R[1]=S-(T[h--]+R[0].length);return!!this.#r(e,_,o,0,r,0,!!d)}#r(e,n,r,o,s,i,a){let c=n[o];if(!c){for(let d=r;d<e.length;d++){a=!0;let _=e[d];if(_==="."||_===".."||!this.options.dot&&_.startsWith("."))return!1}return a}let[l,p]=c;for(;r<=p;){if(this.#o(e.slice(0,r+l.length),l,s,r,0)&&i<this.maxGlobstarRecursion){let f=this.#r(e,n,r+l.length,o+1,s,i+1,a);if(f!==!1)return f}let _=e[r];if(_==="."||_===".."||!this.options.dot&&_.startsWith("."))return!1;r++}return s||null}#o(e,n,r,o,s){let i,a,c,l;for(i=o,a=s,l=e.length,c=n.length;i<l&&a<c;i++,a++){this.debug("matchOne loop");let p=n[a],d=e[i];if(this.debug(n,p,d),p===!1||p===k.GLOBSTAR)return!1;let _;if(typeof p=="string"?(_=d===p,this.debug("string match",p,d,_)):(_=p.test(d),this.debug("pattern match",p,d,_)),!_)return!1}if(i===l&&a===c)return!0;if(i===l)return r;if(a===c)return i===l-1&&e[i]==="";throw new Error("wtf?")}braceExpand(){return(0,k.braceExpand)(this.pattern,this.options)}parse(e){(0,fh.assertValidPattern)(e);let n=this.options;if(e==="**")return k.GLOBSTAR;if(e==="")return"";let r,o=null;(r=e.match(yhe))?o=n.dot?Nhe:Ihe:(r=e.match(_he))?o=(n.nocase?n.dot?hhe:The:n.dot?mhe:fhe)(r[1]):(r=e.match(Ohe))?o=(n.nocase?n.dot?Che:bhe:n.dot?Phe:Mhe)(r):(r=e.match(Ehe))?o=n.dot?ghe:She:(r=e.match(Ahe))&&(o=Rhe);let s=Qq.AST.fromGlob(e,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?vhe:n.dot?Lhe:Dhe,o=new Set(n.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(d=>{if(d instanceof RegExp)for(let _ of d.flags.split(""))o.add(_);return typeof d=="string"?jhe(d):d===k.GLOBSTAR?k.GLOBSTAR:d._src});l.forEach((d,_)=>{let f=l[_+1],m=l[_-1];d!==k.GLOBSTAR||m===k.GLOBSTAR||(m===void 0?f!==void 0&&f!==k.GLOBSTAR?l[_+1]="(?:\\/|"+r+"\\/)?"+f:l[_]=r:f===void 0?l[_-1]=m+"(?:\\/|\\/"+r+")?":f!==k.GLOBSTAR&&(l[_-1]=m+"(?:\\/|\\/"+r+"\\/)"+f,l[_+1]=k.GLOBSTAR))});let p=l.filter(d=>d!==k.GLOBSTAR);if(this.partial&&p.length>=1){let d=[];for(let _=1;_<=p.length;_++)d.push(p.slice(0,_).join("/"));return"(?:"+d.join("|")+")"}return p.join("/")}).join("|"),[i,a]=e.length>1?["(?:",")"]:["",""];s="^"+i+s+a+"$",this.partial&&(s="^(?:\\/|"+i+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let a=o.length-2;!i&&a>=0;a--)i=o[a];for(let a=0;a<s.length;a++){let c=s[a],l=o;if(r.matchBase&&c.length===1&&(l=[i]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return k.minimatch.defaults(e).Minimatch}};k.Minimatch=sa;var Hhe=YN();Object.defineProperty(k,"AST",{enumerable:!0,get:function(){return Hhe.AST}});var Vhe=WN();Object.defineProperty(k,"escape",{enumerable:!0,get:function(){return Vhe.escape}});var Fhe=ch();Object.defineProperty(k,"unescape",{enumerable:!0,get:function(){return Fhe.unescape}});k.minimatch.AST=Qq.AST;k.minimatch.Minimatch=sa;k.minimatch.escape=lhe.escape;k.minimatch.unescape=phe.unescape});var a$=E((mWe,QN)=>{"use strict";var t$=U("node:diagnostics_channel"),{context:mh,trace:zN,SpanStatusCode:Th,propagation:KN,diag:qhe}=(b(),N(v)),{getRPCMetadata:$he,RPCType:Yhe}=he(),{ATTR_HTTP_ROUTE:hh,ATTR_HTTP_RESPONSE_STATUS_CODE:n$,ATTR_HTTP_REQUEST_METHOD:Whe,ATTR_URL_PATH:zhe}=(le(),N(Ae)),{InstrumentationBase:Khe}=Mq(),{version:Qhe,name:r$}=xq(),Xhe=">=4.0.0 <6",o$=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],Me={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},Bs={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Ho="anonymous",js=Symbol("fastify otel instance"),Hs=Symbol("fastify otel request spans"),Qp=Symbol("fastify otel request context"),s$=Symbol("fastify otel addhook original"),i$=Symbol("fastify otel setnotfound original"),Xp=Symbol("fastify otel ignore path"),Jp=Symbol("fastify otel record exceptions"),Eh=class extends Khe{logger=null;_requestHook=null;_lifecycleHook=null;constructor(e){if(super(r$,Qhe,e),this.logger=qhe.createComponentLogger({namespace:r$}),this[Xp]=null,this[Jp]=!0,e?.recordExceptions!=null){if(typeof e.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[Jp]=e.recordExceptions}if(typeof e?.requestHook=="function"&&(this._requestHook=e.requestHook),typeof e?.lifecycleHook=="function"&&(this._lifecycleHook=e.lifecycleHook),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=null;this[Xp]=o=>typeof n=="function"?n(o):(r==null&&(r=e$().minimatch),r(o.url,n))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=e=>{this.plugin()(e.fastify,void 0,()=>{});let n=(r,o,s)=>{s()};n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",e.fastify.register(n)},t$.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(t$.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:Xhe,name:"@fastify/otel"},n;function n(r,o,s){r.decorate(js,e),r.decorate(s$,r.addHook),r.decorate(i$,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let f=this[Qp],m=this[Hs];return{enabled:this.routeOptions.config?.otel!==!1,span:m,tracer:e.tracer,context:f,inject:(T,h)=>KN.inject(f,T,h),extract:(T,h)=>KN.extract(f,T,h)}}),r.decorateRequest(Hs,null),r.decorateRequest(Qp,null),r.addHook("onRoute",function(f){if(e[Xp]?.(f)===!0){e.logger.debug(`Ignoring route instrumentation ${f.method} ${f.url} because it matches the ignore path`);return}if(f.config?.otel===!1){e.logger.debug(`Ignoring route instrumentation ${f.method} ${f.url} because it is disabled`);return}for(let m of o$)if(f[m]!=null){let T=f[m];if(typeof T=="function")f[m]=d(T,m,{[Me.HOOK_NAME]:`${this.pluginName} - route -> ${m}`,[Me.FASTIFY_TYPE]:Bs.ROUTE,[hh]:f.url,[Me.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:Ho});else if(Array.isArray(T)){let h=[];for(let S of T)h.push(d(S,m,{[Me.HOOK_NAME]:`${this.pluginName} - route -> ${m}`,[Me.FASTIFY_TYPE]:Bs.ROUTE,[hh]:f.url,[Me.HOOK_CALLBACK_NAME]:S.name?.length>0?S.name:Ho}));f[m]=h}}f.onSend!=null?f.onSend=Array.isArray(f.onSend)?[...f.onSend,i]:[f.onSend,i]:f.onSend=i,f.onError!=null?f.onError=Array.isArray(f.onError)?[...f.onError,a]:[f.onError,a]:f.onError=a,f.handler=d(f.handler,"handler",{[Me.HOOK_NAME]:`${this.pluginName} - route-handler`,[Me.FASTIFY_TYPE]:Bs.HANDLER,[hh]:f.url,[Me.HOOK_CALLBACK_NAME]:f.handler.name.length>0?f.handler.name:Ho})}),r.addHook("onRequest",function(f,m,T){if(this[js].isEnabled()===!1||f.routeOptions.config?.otel===!1)return T();if(this[js][Xp]?.({url:f.url,method:f.method})===!0)return this[js].logger.debug(`Ignoring request ${f.method} ${f.url} because it matches the ignore path`),T();let h=mh.active();zN.getSpan(h)==null&&(h=KN.extract(h,f.headers));let S=$he(h);f.routeOptions.url!=null&&S?.type===Yhe.HTTP&&(S.route=f.routeOptions.url);let R={[Me.ROOT]:"@fastify/otel",[Whe]:f.method,[zhe]:f.url};f.routeOptions.url!=null&&(R[hh]=f.routeOptions.url);let I=this[js].tracer.startSpan("request",{attributes:R},h);try{this[js]._requestHook?.(I,f)}catch(x){this[js].logger.error({err:x},"requestHook threw")}f[Qp]=zN.setSpan(h,I),f[Hs]=I,mh.with(f[Qp],()=>{T()})}),r.addHook("onResponse",function(f,m,T){let h=f[Hs];h!=null&&(h.setAttributes({[n$]:m.statusCode}),h.end()),f[Hs]=null,T()}),r.addHook=c,r.setNotFoundHandler=l,s();function i(_,f,m,T){let h=_[Hs];h!=null&&(f.statusCode>=500&&h.setStatus({code:Th.ERROR}),h.setAttributes({[n$]:f.statusCode}),h.end()),_[Hs]=null,T(null,m)}function a(_,f,m,T){let h=_[Hs];h!=null&&(h.setStatus({code:Th.ERROR,message:m.message}),e[Jp]!==!1&&h.recordException(m)),T()}function c(_,f){let m=this[s$];return o$.includes(_)?m.call(this,_,d(f,_,{[Me.HOOK_NAME]:`${this.pluginName} - ${_}`,[Me.FASTIFY_TYPE]:Bs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:f.name?.length>0?f.name:Ho})):m.call(this,_,f)}function l(_,f){let m=this[i$];typeof _=="function"?(f=d(_,"notFoundHandler",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Me.FASTIFY_TYPE]:Bs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:Ho}),m.call(this,f)):(_.preValidation!=null&&(_.preValidation=d(_.preValidation,"notFoundHandler - preValidation",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[Me.FASTIFY_TYPE]:Bs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:_.preValidation.name?.length>0?_.preValidation.name:Ho})),_.preHandler!=null&&(_.preHandler=d(_.preHandler,"notFoundHandler - preHandler",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[Me.FASTIFY_TYPE]:Bs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:_.preHandler.name?.length>0?_.preHandler.name:Ho})),f=d(f,"notFoundHandler",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Me.FASTIFY_TYPE]:Bs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:f.name?.length>0?f.name:Ho}),m.call(this,_,f))}function p(_){for(let f of _)if(f?.routeOptions&&f.url&&f.method)return f;return null}function d(_,f,m={}){return function(...h){let S=this[js],R=p(h);if(R===null)return S.logger.debug(`Ignoring route instrumentation because ${f} was called without a Fastify request argument`),_.call(this,...h);if(S.isEnabled()===!1||R.routeOptions.config?.otel===!1)return S.logger.debug(`Ignoring route instrumentation ${R.routeOptions.method} ${R.routeOptions.url} because it is disabled`),_.call(this,...h);if(S[Xp]?.({url:R.url,method:R.method})===!0)return S.logger.debug(`Ignoring route instrumentation ${R.routeOptions.method} ${R.routeOptions.url} because it matches the ignore path`),_.call(this,...h);let I=R[Qp]??mh.active(),x=_.name?.length>0?_.name:this.pluginName??Ho,V=S.tracer.startSpan(`${f} - ${x}`,{attributes:m},I);if(S._lifecycleHook!=null)try{S._lifecycleHook(V,{hookName:f,request:R,handler:x})}catch(B){S.logger.error({err:B},"Execution of lifecycleHook failed")}return mh.with(zN.setSpan(I,V),function(){try{let B=_.call(this,...h);return typeof B?.then=="function"?B.then(se=>(V.end(),se),se=>(V.setStatus({code:Th.ERROR,message:se.message}),S[Jp]!==!1&&V.recordException(se),V.end(),Promise.reject(se))):(V.end(),B)}catch(B){throw V.setStatus({code:Th.ERROR,message:B.message}),S[Jp]!==!1&&V.recordException(B),V.end(),B}},this)}}}}};QN.exports=Eh;QN.exports.FastifyOtelInstrumentation=Eh});var ZN=E(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.SpanNames=xr.TokenKind=xr.AllowedOperationTypes=void 0;var iEe;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(iEe=xr.AllowedOperationTypes||(xr.AllowedOperationTypes={}));var aEe;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(aEe=xr.TokenKind||(xr.TokenKind={}));var cEe;(function(t){t.EXECUTE="graphql.execute",t.PARSE="graphql.parse",t.RESOLVE="graphql.resolve",t.VALIDATE="graphql.validate",t.SCHEMA_VALIDATE="graphql.validateSchema",t.SCHEMA_PARSE="graphql.parseSchema"})(cEe=xr.SpanNames||(xr.SpanNames={}))});var eO=E(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.AttributeNames=void 0;var uEe;(function(t){t.SOURCE="graphql.source",t.FIELD_NAME="graphql.field.name",t.FIELD_PATH="graphql.field.path",t.FIELD_TYPE="graphql.field.type",t.PARENT_NAME="graphql.parent.name",t.OPERATION_TYPE="graphql.operation.type",t.OPERATION_NAME="graphql.operation.name",t.VARIABLES="graphql.variables.",t.ERROR_VALIDATION_NAME="graphql.validation.error"})(uEe=nd.AttributeNames||(nd.AttributeNames={}))});var yh=E(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.OTEL_GRAPHQL_DATA_SYMBOL=fu.OTEL_PATCHED_SYMBOL=void 0;fu.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");fu.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var S$=E(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});Ih.OPERATION_NOT_SUPPORTED=void 0;var UWe=yh();Ih.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var L$=E(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.wrapFieldResolver=mt.wrapFields=mt.getSourceFromLocation=mt.getOperation=mt.endSpan=mt.addSpanSource=mt.addInputVariableAttributes=mt.isPromise=void 0;var mu=(b(),N(v)),Vs=ZN(),aa=eO(),Fo=yh(),g$=Object.values(Vs.AllowedOperationTypes),lEe=t=>typeof t?.then=="function";mt.isPromise=lEe;var pEe=t=>typeof t=="object"&&t!==null;function tO(t,e,n){Array.isArray(n)?n.forEach((r,o)=>{tO(t,`${e}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{tO(t,`${e}.${r}`,o)}):t.setAttribute(`${aa.AttributeNames.VARIABLES}${String(e)}`,n)}function dEe(t,e){Object.entries(e).forEach(([n,r])=>{tO(t,n,r)})}mt.addInputVariableAttributes=dEe;function I$(t,e,n,r,o){let s=P$(e,n,r,o);t.setAttribute(aa.AttributeNames.SOURCE,s)}mt.addSpanSource=I$;function _Ee(t,e,n,r,o){let s=N$(n,o);if(s)return{field:s,spanAdded:!1};let a=e().flatResolveSpans?b$(n):O$(n,o);return s={span:fEe(t,e,n,r,o,a)},hEe(n,o,s),{field:s,spanAdded:!0}}function fEe(t,e,n,r,o,s){let i={[aa.AttributeNames.FIELD_NAME]:r.fieldName,[aa.AttributeNames.FIELD_PATH]:o.join("."),[aa.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[aa.AttributeNames.PARENT_NAME]:r.parentType.name},a=t.startSpan(`${Vs.SpanNames.RESOLVE} ${i[aa.AttributeNames.FIELD_PATH]}`,{attributes:i},s?mu.trace.setSpan(mu.context.active(),s):void 0),c=n[Fo.OTEL_GRAPHQL_DATA_SYMBOL].source,l=r.fieldNodes.find(p=>p.kind==="Field");return l&&I$(a,c.loc,e().allowValues,l.loc?.start,l.loc?.end),a}function mEe(t,e){e&&t.recordException(e),t.end()}mt.endSpan=mEe;function TEe(t,e){if(!(!t||!Array.isArray(t.definitions)))return e?t.definitions.filter(n=>g$.indexOf(n?.operation)!==-1).find(n=>e===n?.name?.value):t.definitions.find(n=>g$.indexOf(n?.operation)!==-1)}mt.getOperation=TEe;function hEe(t,e,n){return t[Fo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]=n}function N$(t,e){return t[Fo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]}function O$(t,e){for(let n=e.length-1;n>0;n--){let r=N$(t,e.slice(0,n));if(r)return r.span}return b$(t)}function b$(t){return t[Fo.OTEL_GRAPHQL_DATA_SYMBOL].span}function EEe(t,e){let n=[],r=e;for(;r;){let o=r.key;t&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function SEe(t){return C$(`
10
- `,t)}function A$(t){return C$(" ",t)}function C$(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}var gEe=[Vs.TokenKind.FLOAT,Vs.TokenKind.STRING,Vs.TokenKind.INT,Vs.TokenKind.BLOCK_STRING];function P$(t,e=!1,n,r){let o="";if(t?.startToken){let s=typeof n=="number"?n:t.start,i=typeof r=="number"?r:t.end,a=t.startToken.next,c=1;for(;a;){if(a.start<s){a=a.next,c=a?.line;continue}if(a.end>i){a=a.next,c=a?.line;continue}let l=a.value||a.kind,p="";!e&&gEe.indexOf(a.kind)>=0&&(l="*"),a.kind===Vs.TokenKind.STRING&&(l=`"${l}"`),a.kind===Vs.TokenKind.EOF&&(l=""),a.line>c?(o+=SEe(a.line-c),c=a.line,p=A$(a.column-1)):a.line===a.prev?.line&&(p=A$(a.start-(a.prev?.end||0))),o+=p+l,a&&(a=a.next)}}return o}mt.getSourceFromLocation=P$;function M$(t,e,n){if(!t||t[Fo.OTEL_PATCHED_SYMBOL])return;let r=t.getFields();t[Fo.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let s=r[o];if(s&&(s.resolve&&(s.resolve=v$(e,n,s.resolve)),s.type)){let i=x$(s.type);for(let a of i)M$(a,e,n)}})}mt.wrapFields=M$;function x$(t){return"ofType"in t?x$(t.ofType):AEe(t)?t.getTypes():REe(t)?[t]:[]}function AEe(t){return"getTypes"in t&&typeof t.getTypes=="function"}function REe(t){return"getFields"in t&&typeof t.getFields=="function"}var R$=(t,e,n)=>{n&&(t.recordException(e),t.setStatus({code:mu.SpanStatusCode.ERROR,message:e.message}),t.end())},y$=(t,e)=>{e&&t.end()};function v$(t,e,n,r=!1){if(o[Fo.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(s,i,a,c){if(!n)return;let l=e();if(l.ignoreTrivialResolveSpans&&r&&(pEe(s)||typeof s=="function")&&typeof s[c.fieldName]!="function")return n.call(this,s,i,a,c);if(!a[Fo.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,s,i,a,c);let p=EEe(l.mergeItems,c&&c.path),d=p.filter(m=>typeof m=="string").length,_,f=!1;if(l.depth>=0&&l.depth<d)_=O$(a,p);else{let{field:m,spanAdded:T}=_Ee(t,e,a,c,p);_=m.span,f=T}return mu.context.with(mu.trace.setSpan(mu.context.active(),_),()=>{try{let m=n.call(this,s,i,a,c);return(0,mt.isPromise)(m)?m.then(T=>(y$(_,f),T),T=>{throw R$(_,T,f),T}):(y$(_,f),m)}catch(m){throw R$(_,m,f),m}})}return o[Fo.OTEL_PATCHED_SYMBOL]=!0,o}mt.wrapFieldResolver=v$});var D$=E(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.PACKAGE_NAME=Tu.PACKAGE_VERSION=void 0;Tu.PACKAGE_VERSION="0.62.0";Tu.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var k$=E(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.GraphQLInstrumentation=void 0;var qo=(b(),N(v)),ar=ne(),rd=ZN(),Nh=eO(),nO=yh(),yEe=S$(),Kt=L$(),U$=D$(),w$={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},Oh=[">=14.0.0 <17"],rO=class extends ar.InstrumentationBase{constructor(e={}){super(U$.PACKAGE_NAME,U$.PACKAGE_VERSION,{...w$,...e})}setConfig(e={}){super.setConfig({...w$,...e})}init(){let e=new ar.InstrumentationNodeModuleDefinition("graphql",Oh);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new ar.InstrumentationNodeModuleFile("graphql/execution/execute.js",Oh,e=>((0,ar.isWrapped)(e.execute)&&this._unwrap(e,"execute"),this._wrap(e,"execute",this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,"execute")})}_addPatchingParser(){return new ar.InstrumentationNodeModuleFile("graphql/language/parser.js",Oh,e=>((0,ar.isWrapped)(e.parse)&&this._unwrap(e,"parse"),this._wrap(e,"parse",this._patchParse()),e),e=>{e&&this._unwrap(e,"parse")})}_addPatchingValidate(){return new ar.InstrumentationNodeModuleFile("graphql/validation/validate.js",Oh,e=>((0,ar.isWrapped)(e.validate)&&this._unwrap(e,"validate"),this._wrap(e,"validate",this._patchValidate()),e),e=>{e&&this._unwrap(e,"validate")})}_patchExecute(e){let n=this;return function(o){return function(){let i;if(arguments.length>=2){let l=arguments;i=n._wrapExecuteArgs(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],e)}else{let l=arguments[0];i=n._wrapExecuteArgs(l.schema,l.document,l.rootValue,l.contextValue,l.variableValues,l.operationName,l.fieldResolver,l.typeResolver,e)}let a=(0,Kt.getOperation)(i.document,i.operationName),c=n._createExecuteSpan(a,i);return i.contextValue[nO.OTEL_GRAPHQL_DATA_SYMBOL]={source:i.document?i.document||i.document[nO.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:c,fields:{}},qo.context.with(qo.trace.setSpan(qo.context.active(),c),()=>(0,ar.safeExecuteInTheMiddle)(()=>o.apply(this,[i]),(l,p)=>{n._handleExecutionResult(c,l,p)}))}}}_handleExecutionResult(e,n,r){let o=this.getConfig();if(r===void 0||n){(0,Kt.endSpan)(e,n);return}if((0,Kt.isPromise)(r))r.then(s=>{if(typeof o.responseHook!="function"){(0,Kt.endSpan)(e);return}this._executeResponseHook(e,s)},s=>{(0,Kt.endSpan)(e,s)});else{if(typeof o.responseHook!="function"){(0,Kt.endSpan)(e);return}this._executeResponseHook(e,r)}}_executeResponseHook(e,n){let{responseHook:r}=this.getConfig();r&&(0,ar.safeExecuteInTheMiddle)(()=>{r(e,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,Kt.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(r){return function(s,i){return e._parse(this,r,s,i)}}}_patchValidate(){let e=this;return function(r){return function(s,i,a,c,l){return e._validate(this,r,s,i,a,l,c)}}}_parse(e,n,r,o){let s=this.getConfig(),i=this.tracer.startSpan(rd.SpanNames.PARSE);return qo.context.with(qo.trace.setSpan(qo.context.active(),i),()=>(0,ar.safeExecuteInTheMiddle)(()=>n.call(e,r,o),(a,c)=>{c&&((0,Kt.getOperation)(c)?c.loc&&(0,Kt.addSpanSource)(i,c.loc,s.allowValues):i.updateName(rd.SpanNames.SCHEMA_PARSE)),(0,Kt.endSpan)(i,a)}))}_validate(e,n,r,o,s,i,a){let c=this.tracer.startSpan(rd.SpanNames.VALIDATE,{});return qo.context.with(qo.trace.setSpan(qo.context.active(),c),()=>(0,ar.safeExecuteInTheMiddle)(()=>n.call(e,r,o,s,a,i),(l,p)=>{o.loc||c.updateName(rd.SpanNames.SCHEMA_VALIDATE),p&&p.length&&c.recordException({name:Nh.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(p)}),(0,Kt.endSpan)(c,l)}))}_createExecuteSpan(e,n){let r=this.getConfig(),o=this.tracer.startSpan(rd.SpanNames.EXECUTE,{});if(e){let{operation:s,name:i}=e;o.setAttribute(Nh.AttributeNames.OPERATION_TYPE,s);let a=i?.value;a?(o.setAttribute(Nh.AttributeNames.OPERATION_NAME,a),o.updateName(`${s} ${a}`)):o.updateName(s)}else{let s=" ";n.operationName&&(s=` "${n.operationName}" `),s=yEe.OPERATION_NOT_SUPPORTED.replace("$operationName$",s),o.setAttribute(Nh.AttributeNames.OPERATION_NAME,s)}return n.document?.loc&&(0,Kt.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,Kt.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(e,n,r,o,s,i,a,c,l){if(o||(o={}),o[nO.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c};let p=a==null,d=a??l;return a=(0,Kt.wrapFieldResolver)(this.tracer,()=>this.getConfig(),d,p),e&&((0,Kt.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,Kt.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c}}};bh.GraphQLInstrumentation=rO});var G$=E(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.GraphQLInstrumentation=void 0;var IEe=k$();Object.defineProperty(Ch,"GraphQLInstrumentation",{enumerable:!0,get:function(){return IEe.GraphQLInstrumentation}})});var q$=E(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.EVENT_LISTENERS_SET=void 0;Ph.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var $$=E(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.bufferTextMapGetter=void 0;Mh.bufferTextMapGetter={get(t,e){if(!t)return;let n=Object.keys(t);for(let r of n)if(r===e||r.toLowerCase()===e)return t[r]?.toString()},keys(t){return t?Object.keys(t):[]}}});var Y$=E(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.METRIC_MESSAGING_PROCESS_DURATION=_e.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=_e.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=_e.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=_e.MESSAGING_SYSTEM_VALUE_KAFKA=_e.MESSAGING_OPERATION_TYPE_VALUE_SEND=_e.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=_e.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=_e.ATTR_MESSAGING_SYSTEM=_e.ATTR_MESSAGING_OPERATION_TYPE=_e.ATTR_MESSAGING_OPERATION_NAME=_e.ATTR_MESSAGING_KAFKA_OFFSET=_e.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=_e.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=_e.ATTR_MESSAGING_DESTINATION_PARTITION_ID=_e.ATTR_MESSAGING_DESTINATION_NAME=_e.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;_e.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";_e.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";_e.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";_e.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";_e.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";_e.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";_e.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";_e.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";_e.ATTR_MESSAGING_SYSTEM="messaging.system";_e.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";_e.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";_e.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";_e.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";_e.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";_e.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";_e.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";_e.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var W$=E(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.PACKAGE_NAME=hu.PACKAGE_VERSION=void 0;hu.PACKAGE_VERSION="0.23.0";hu.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var Z$=E(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.KafkaJsInstrumentation=void 0;var ye=(b(),N(v)),cr=ne(),Eu=(le(),N(Ae)),z$=q$(),K$=$$(),G=Y$(),Q$=W$();function xh(t,e,n){return r=>{t.add(e,{...n,...r?{[Eu.ATTR_ERROR_TYPE]:r}:{}})}}function X$(t,e,n){return r=>{t.record((Date.now()-e)/1e3,{...n,...r?{[Eu.ATTR_ERROR_TYPE]:r}:{}})}}var J$=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],oO=class extends cr.InstrumentationBase{constructor(e={}){super(Q$.PACKAGE_NAME,Q$.PACKAGE_VERSION,e)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(G.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:J$}}),this._sentMessages=this.meter.createCounter(G.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(G.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(G.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:J$}})}init(){let e=r=>{(0,cr.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,cr.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new cr.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(e(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),e)}_getConsumerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,cr.isWrapped)(s.run)&&e._unwrap(s,"run"),e._wrap(s,"run",e._getConsumerRunPatch()),e._setKafkaEventListeners(s),s}}_setKafkaEventListeners(e){e[z$.EVENT_LISTENERS_SET]||(e.events?.REQUEST&&e.on(e.events.REQUEST,this._recordClientDurationMetric.bind(this)),e[z$.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(e){let[n,r]=e.payload.broker.split(":");this._clientDuration.record(e.payload.duration/1e3,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:`${e.payload.apiName}`,[Eu.ATTR_SERVER_ADDRESS]:n,[Eu.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,cr.isWrapped)(s.sendBatch)&&e._unwrap(s,"sendBatch"),e._wrap(s,"sendBatch",e._getSendBatchPatch()),(0,cr.isWrapped)(s.send)&&e._unwrap(s,"send"),e._wrap(s,"send",e._getSendPatch()),(0,cr.isWrapped)(s.transaction)&&e._unwrap(s,"transaction"),e._wrap(s,"transaction",e._getProducerTransactionPatch()),e._setKafkaEventListeners(s),s}}_getConsumerRunPatch(){let e=this;return n=>function(...o){let s=o[0];return s?.eachMessage&&((0,cr.isWrapped)(s.eachMessage)&&e._unwrap(s,"eachMessage"),e._wrap(s,"eachMessage",e._getConsumerEachMessagePatch())),s?.eachBatch&&((0,cr.isWrapped)(s.eachBatch)&&e._unwrap(s,"eachBatch"),e._wrap(s,"eachBatch",e._getConsumerEachBatchPatch())),n.call(this,s)}}_getConsumerEachMessagePatch(){let e=this;return n=>function(...o){let s=o[0],i=ye.propagation.extract(ye.ROOT_CONTEXT,s.message.headers,K$.bufferTextMapGetter),a=e._startConsumerSpan({topic:s.topic,message:s.message,operationType:G.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:i,attributes:{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}}),c=[X$(e._processDuration,Date.now(),{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}),xh(e._consumedMessages,1,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)})],l=ye.context.with(ye.trace.setSpan(i,a),()=>n.apply(this,o));return e._endSpansOnPromise([a],c,l)}}_getConsumerEachBatchPatch(){return e=>{let n=this;return function(...o){let s=o[0],i=n._startConsumerSpan({topic:s.batch.topic,message:void 0,operationType:G.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:ye.ROOT_CONTEXT,attributes:{[G.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:s.batch.messages.length,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}});return ye.context.with(ye.trace.setSpan(ye.context.active(),i),()=>{let a=Date.now(),c=[],l=[xh(n._consumedMessages,s.batch.messages.length,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)})];s.batch.messages.forEach(d=>{let _=ye.propagation.extract(ye.ROOT_CONTEXT,d.headers,K$.bufferTextMapGetter),f=ye.trace.getSpan(_)?.spanContext(),m;f&&(m={context:f}),c.push(n._startConsumerSpan({topic:s.batch.topic,message:d,operationType:G.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:m,attributes:{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}})),l.push(X$(n._processDuration,a,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}))});let p=e.apply(this,o);return c.unshift(i),n._endSpansOnPromise(c,l,p)})}}}_getProducerTransactionPatch(){let e=this;return n=>function(...o){let s=e.tracer.startSpan("transaction"),i=n.apply(this,o);return i.then(a=>{let c=a.send;a.send=function(...f){return ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>e._getSendPatch()(c).apply(this,f).catch(T=>{throw s.setStatus({code:ye.SpanStatusCode.ERROR,message:T?.message}),s.recordException(T),T}))};let l=a.sendBatch;a.sendBatch=function(...f){return ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>e._getSendBatchPatch()(l).apply(this,f).catch(T=>{throw s.setStatus({code:ye.SpanStatusCode.ERROR,message:T?.message}),s.recordException(T),T}))};let p=a.commit;a.commit=function(...f){let m=p.apply(this,f).then(()=>{s.setStatus({code:ye.SpanStatusCode.OK})});return e._endSpansOnPromise([s],[],m)};let d=a.abort;a.abort=function(...f){let m=d.apply(this,f);return e._endSpansOnPromise([s],[],m)}}).catch(a=>{s.setStatus({code:ye.SpanStatusCode.ERROR,message:a?.message}),s.recordException(a),s.end()}),i}}_getSendBatchPatch(){let e=this;return n=>function(...o){let i=o[0].topicMessages||[],a=[],c=[];i.forEach(p=>{p.messages.forEach(d=>{a.push(e._startProducerSpan(p.topic,d)),c.push(xh(e._sentMessages,1,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"send",[G.ATTR_MESSAGING_DESTINATION_NAME]:p.topic,...d.partition!==void 0?{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(d.partition)}:{}}))})});let l=n.apply(this,o);return e._endSpansOnPromise(a,c,l)}}_getSendPatch(){let e=this;return n=>function(...o){let s=o[0],i=s.messages.map(l=>e._startProducerSpan(s.topic,l)),a=s.messages.map(l=>xh(e._sentMessages,1,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"send",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,...l.partition!==void 0?{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(l.partition)}:{}})),c=n.apply(this,o);return e._endSpansOnPromise(i,a,c)}}_endSpansOnPromise(e,n,r){return Promise.resolve(r).then(o=>(n.forEach(s=>s()),o)).catch(o=>{let s,i=Eu.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?s=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(s=o.message,i=o.constructor.name),n.forEach(a=>a(i)),e.forEach(a=>{a.setAttribute(Eu.ATTR_ERROR_TYPE,i),a.setStatus({code:ye.SpanStatusCode.ERROR,message:s})}),o}).finally(()=>{e.forEach(o=>o.end())})}_startConsumerSpan({topic:e,message:n,operationType:r,ctx:o,link:s,attributes:i}){let a=r===G.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,c=this.tracer.startSpan(`${a} ${e}`,{kind:r===G.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?ye.SpanKind.CLIENT:ye.SpanKind.CONSUMER,attributes:{...i,[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_DESTINATION_NAME]:e,[G.ATTR_MESSAGING_OPERATION_TYPE]:r,[G.ATTR_MESSAGING_OPERATION_NAME]:a,[G.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[G.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[G.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:s?[s]:[]},o),{consumerHook:l}=this.getConfig();return l&&n&&(0,cr.safeExecuteInTheMiddle)(()=>l(c,{topic:e,message:n}),p=>{p&&this._diag.error("consumerHook error",p)},!0),c}_startProducerSpan(e,n){let r=this.tracer.startSpan(`send ${e}`,{kind:ye.SpanKind.PRODUCER,attributes:{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_DESTINATION_NAME]:e,[G.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[G.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[G.ATTR_MESSAGING_OPERATION_NAME]:"send",[G.ATTR_MESSAGING_OPERATION_TYPE]:G.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},ye.propagation.inject(ye.trace.setSpan(ye.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,cr.safeExecuteInTheMiddle)(()=>o(r,{topic:e,message:n}),s=>{s&&this._diag.error("producerHook error",s)},!0),r}};vh.KafkaJsInstrumentation=oO});var eY=E(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.KafkaJsInstrumentation=void 0;var bEe=Z$();Object.defineProperty(Lh,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return bEe.KafkaJsInstrumentation}})});var sY=E(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.PACKAGE_NAME=Su.PACKAGE_VERSION=void 0;Su.PACKAGE_VERSION="0.58.0";Su.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var uY=E(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.LruMemoizerInstrumentation=void 0;var iY=(b(),N(v)),aY=ne(),cY=sY(),sO=class extends aY.InstrumentationBase{constructor(e={}){super(cY.PACKAGE_NAME,cY.PACKAGE_VERSION,e)}init(){return[new aY.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],e=>{let n=function(){let r=e.apply(this,arguments);return function(){let o=[...arguments],s=o.pop(),i=typeof s=="function"?iY.context.bind(iY.context.active(),s):s;return o.push(i),r.apply(this,o)}};return n.sync=e.sync,n},void 0)]}};Dh.LruMemoizerInstrumentation=sO});var lY=E(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.LruMemoizerInstrumentation=void 0;var PEe=uY();Object.defineProperty(Uh,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return PEe.LruMemoizerInstrumentation}})});var mY=E(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.METRIC_DB_CLIENT_CONNECTIONS_USAGE=De.DB_SYSTEM_VALUE_MONGODB=De.DB_SYSTEM_NAME_VALUE_MONGODB=De.ATTR_NET_PEER_PORT=De.ATTR_NET_PEER_NAME=De.ATTR_DB_SYSTEM=De.ATTR_DB_STATEMENT=De.ATTR_DB_OPERATION=De.ATTR_DB_NAME=De.ATTR_DB_MONGODB_COLLECTION=De.ATTR_DB_CONNECTION_STRING=void 0;De.ATTR_DB_CONNECTION_STRING="db.connection_string";De.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";De.ATTR_DB_NAME="db.name";De.ATTR_DB_OPERATION="db.operation";De.ATTR_DB_STATEMENT="db.statement";De.ATTR_DB_SYSTEM="db.system";De.ATTR_NET_PEER_NAME="net.peer.name";De.ATTR_NET_PEER_PORT="net.peer.port";De.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";De.DB_SYSTEM_VALUE_MONGODB="mongodb";De.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var TY=E(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.MongodbCommandType=void 0;var xEe;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.AGGREGATE="aggregate",t.UNKNOWN="unknown"})(xEe=od.MongodbCommandType||(od.MongodbCommandType={}))});var hY=E(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.PACKAGE_NAME=gu.PACKAGE_VERSION=void 0;gu.PACKAGE_VERSION="0.67.0";gu.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var gY=E(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.MongoDBInstrumentation=void 0;var we=(b(),N(v)),fe=ne(),$o=(le(),N(Ae)),Fn=mY(),ca=TY(),EY=hY(),SY={requireParentSpan:!0},iO=class t extends fe.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(EY.PACKAGE_NAME,EY.PACKAGE_VERSION,{...SY,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,fe.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,fe.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...SY,...e})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(Fn.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsage?.add(e,{"pool.name":n,state:r})}init(){let{v3PatchConnection:e,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:s,v4PatchConnectionPromise:i,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:l}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:p,v4UnpatchSessions:d}=this._getV4SessionsPatches();return[new fe.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new fe.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],e,n)]),new fe.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],s,a),new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],i,a),new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],c,l),new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new fe.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],p,d)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,fe.isWrapped)(e.insert)&&this._unwrap(e,"insert"),this._wrap(e,"insert",this._getV3PatchOperation("insert")),(0,fe.isWrapped)(e.remove)&&this._unwrap(e,"remove"),this._wrap(e,"remove",this._getV3PatchOperation("remove")),(0,fe.isWrapped)(e.update)&&this._unwrap(e,"update"),this._wrap(e,"update",this._getV3PatchOperation("update")),(0,fe.isWrapped)(e.command)&&this._unwrap(e,"command"),this._wrap(e,"command",this._getV3PatchCommand()),(0,fe.isWrapped)(e.query)&&this._unwrap(e,"query"),this._wrap(e,"query",this._getV3PatchFind()),(0,fe.isWrapped)(e.getMore)&&this._unwrap(e,"getMore"),this._wrap(e,"getMore",this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,"insert"),this._unwrap(e,"remove"),this._unwrap(e,"update"),this._unwrap(e,"command"),this._unwrap(e,"query"),this._unwrap(e,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,fe.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),this._wrap(e.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,fe.isWrapped)(e.release)&&this._unwrap(e,"release"),this._wrap(e.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,fe.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),(0,fe.isWrapped)(e.release)&&this._unwrap(e,"release"))}}}_getV4AcquireCommand(){let e=this;return n=>function(){let o=this.sessions.length,s=n.call(this),i=this.sessions.length;return o===i?e._connCountAdd(1,e._poolName,"used"):o-1===i&&(e._connCountAdd(-1,e._poolName,"idle"),e._connCountAdd(1,e._poolName,"used")),s}}_getV4ReleaseCommand(){let e=this;return n=>function(o){let s=n.call(this,o);return e._connCountAdd(-1,e._poolName,"used"),e._connCountAdd(1,e._poolName,"idle"),s}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let n=e.ConnectionPool.prototype;return(0,fe.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,fe.isWrapped)(e.connect)&&this._unwrap(e,"connect"),this._wrap(e,"connect",this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,"connect")}}}_getV4ConnectionPoolCheckOut(){return e=>function(r){let o=we.context.bind(we.context.active(),r);return e.call(this,o)}}_getV4ConnectCommand(){let e=this;return n=>function(o,s){if(n.length===1){let a=n.call(this,o);return a&&typeof a.then=="function"&&a.then(()=>e.setPoolName(o),()=>{}),a}let i=function(a,c){if(a||!c){s(a,c);return}e.setPoolName(o),s(a,c)};return n.call(this,o,i)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,fe.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,fe.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,"command")}}}_getV3PatchOperation(e){let n=this;return r=>function(s,i,a,c,l){let p=we.trace.getSpan(we.context.active()),d=n._checkSkipInstrumentation(p),_=typeof c=="function"?c:l;if(d||typeof _!="function"||typeof a!="object")return typeof c=="function"?r.call(this,s,i,a,c):r.call(this,s,i,a,c,l);let f=n._getV3SpanAttributes(i,s,a[0],e),m=n._spanNameFromAttrs(f),T=n.tracer.startSpan(m,{kind:we.SpanKind.CLIENT,attributes:f}),h=n._patchEnd(T,_);return typeof c=="function"?r.call(this,s,i,a,h):r.call(this,s,i,a,c,h)}}_getV3PatchCommand(){let e=this;return n=>function(o,s,i,a,c){let l=we.trace.getSpan(we.context.active()),p=e._checkSkipInstrumentation(l),d=typeof a=="function"?a:c;if(p||typeof d!="function"||typeof i!="object")return typeof a=="function"?n.call(this,o,s,i,a):n.call(this,o,s,i,a,c);let _=t._getCommandType(i),f=_===ca.MongodbCommandType.UNKNOWN?void 0:_,m=e._getV3SpanAttributes(s,o,i,f),T=e._spanNameFromAttrs(m),h=e.tracer.startSpan(T,{kind:we.SpanKind.CLIENT,attributes:m}),S=e._patchEnd(h,d);return typeof a=="function"?n.call(this,o,s,i,S):n.call(this,o,s,i,a,S)}}_getV4PatchCommandCallback(){let e=this;return n=>function(o,s,i,a){let c=we.trace.getSpan(we.context.active()),l=e._checkSkipInstrumentation(c),p=a,d=Object.keys(s)[0];if(typeof s!="object"||s.ismaster||s.hello)return n.call(this,o,s,i,a);let _;if(!l){let m=e._getV4SpanAttributes(this,o,s,d),T=e._spanNameFromAttrs(m);_=e.tracer.startSpan(T,{kind:we.SpanKind.CLIENT,attributes:m})}let f=e._patchEnd(_,p,this.id,d);return n.call(this,o,s,i,f)}}_getV4PatchCommandPromise(){let e=this;return n=>function(...o){let[s,i]=o,a=we.trace.getSpan(we.context.active()),c=e._checkSkipInstrumentation(a),l=Object.keys(i)[0],p=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return n.apply(this,o);let d;if(!c){let m=e._getV4SpanAttributes(this,s,i,l),T=e._spanNameFromAttrs(m);d=e.tracer.startSpan(T,{kind:we.SpanKind.CLIENT,attributes:m})}let _=e._patchEnd(d,p,this.id,l),f=n.apply(this,o);return f.then(m=>_(null,m),m=>_(m)),f}}_getV3PatchFind(){let e=this;return n=>function(o,s,i,a,c,l){let p=we.trace.getSpan(we.context.active()),d=e._checkSkipInstrumentation(p),_=typeof c=="function"?c:l;if(d||typeof _!="function"||typeof i!="object")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,l);let f=e._getV3SpanAttributes(s,o,i,"find"),m=e._spanNameFromAttrs(f),T=e.tracer.startSpan(m,{kind:we.SpanKind.CLIENT,attributes:f}),h=e._patchEnd(T,_);return typeof c=="function"?n.call(this,o,s,i,a,h):n.call(this,o,s,i,a,c,h)}}_getV3PatchCursor(){let e=this;return n=>function(o,s,i,a,c,l){let p=we.trace.getSpan(we.context.active()),d=e._checkSkipInstrumentation(p),_=typeof c=="function"?c:l;if(d||typeof _!="function")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,l);let f=e._getV3SpanAttributes(s,o,i.cmd,"getMore"),m=e._spanNameFromAttrs(f),T=e.tracer.startSpan(m,{kind:we.SpanKind.CLIENT,attributes:f}),h=e._patchEnd(T,_);return typeof c=="function"?n.call(this,o,s,i,a,h):n.call(this,o,s,i,a,c,h)}}static _getCommandType(e){return e.createIndexes!==void 0?ca.MongodbCommandType.CREATE_INDEXES:e.findandmodify!==void 0?ca.MongodbCommandType.FIND_AND_MODIFY:e.ismaster!==void 0?ca.MongodbCommandType.IS_MASTER:e.count!==void 0?ca.MongodbCommandType.COUNT:e.aggregate!==void 0?ca.MongodbCommandType.AGGREGATE:ca.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(e,n,r,o){let s,i;if(e){let c=typeof e.address=="string"?e.address.split(":"):"";c.length===2&&(s=c[0],i=c[1])}let a;return r?.documents&&r.documents[0]?a=r.documents[0]:r?.cursors?a=r.cursors:a=r,this._getSpanAttributes(n.db,n.collection,s,i,a,o)}_getV3SpanAttributes(e,n,r,o){let s,i;if(n&&n.s&&(s=n.s.options?.host??n.s.host,i=(n.s.options?.port??n.s.port)?.toString(),s==null||i==null)){let p=n.description?.address;if(p){let d=p.split(":");s=d[0],i=d[1]}}let[a,c]=e.toString().split("."),l=r?.query??r?.q??r;return this._getSpanAttributes(a,c,s,i,l,o)}_getSpanAttributes(e,n,r,o,s,i){let a={};if(this._dbSemconvStability&fe.SemconvStability.OLD&&(a[Fn.ATTR_DB_SYSTEM]=Fn.DB_SYSTEM_VALUE_MONGODB,a[Fn.ATTR_DB_NAME]=e,a[Fn.ATTR_DB_MONGODB_COLLECTION]=n,a[Fn.ATTR_DB_OPERATION]=i,a[Fn.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${e}`),this._dbSemconvStability&fe.SemconvStability.STABLE&&(a[$o.ATTR_DB_SYSTEM_NAME]=Fn.DB_SYSTEM_NAME_VALUE_MONGODB,a[$o.ATTR_DB_NAMESPACE]=e,a[$o.ATTR_DB_OPERATION_NAME]=i,a[$o.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&fe.SemconvStability.OLD&&(a[Fn.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&fe.SemconvStability.STABLE&&(a[$o.ATTR_SERVER_ADDRESS]=r);let c=parseInt(o,10);isNaN(c)||(this._netSemconvStability&fe.SemconvStability.OLD&&(a[Fn.ATTR_NET_PEER_PORT]=c),this._netSemconvStability&fe.SemconvStability.STABLE&&(a[$o.ATTR_SERVER_PORT]=c))}if(s){let{dbStatementSerializer:c}=this.getConfig(),l=typeof c=="function"?c:this._defaultDbStatementSerializer.bind(this);(0,fe.safeExecuteInTheMiddle)(()=>{let p=l(s);this._dbSemconvStability&fe.SemconvStability.OLD&&(a[Fn.ATTR_DB_STATEMENT]=p),this._dbSemconvStability&fe.SemconvStability.STABLE&&(a[$o.ATTR_DB_QUERY_TEXT]=p)},p=>{p&&this._diag.error("Error running dbStatementSerializer hook",p)},!0)}return a}_spanNameFromAttrs(e){let n;return this._dbSemconvStability&fe.SemconvStability.STABLE?n=[e[$o.ATTR_DB_OPERATION_NAME],e[$o.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||Fn.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${e[Fn.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let e=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":e.has(r)?"[Circular]":(e.add(r),r)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(e):JSON.stringify(e,this._getDefaultDbStatementReplacer())}_handleExecutionResult(e,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,fe.safeExecuteInTheMiddle)(()=>{r(e,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(e,n,r,o){let s=we.context.active(),i=this,a=!1;return function(...l){if(!a){a=!0;let p=l[0];if(e){if(p instanceof Error)e.setStatus({code:we.SpanStatusCode.ERROR,message:p.message});else{let d=l[1];i._handleExecutionResult(e,d)}e.end()}o==="endSessions"&&i._connCountAdd(-1,i._poolName,"idle")}return we.context.with(s,()=>n.apply(this,l))}}setPoolName(e){let n=e.hostAddress?.host,r=e.hostAddress?.port,o=e.dbName,s=`mongodb://${n}:${r}/${o}`;this._poolName=s}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}};wh.MongoDBInstrumentation=iO});var AY=E(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.MongodbCommandType=void 0;var vEe;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.UNKNOWN="unknown"})(vEe=sd.MongodbCommandType||(sd.MongodbCommandType={}))});var RY=E(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.MongodbCommandType=Au.MongoDBInstrumentation=void 0;var LEe=gY();Object.defineProperty(Au,"MongoDBInstrumentation",{enumerable:!0,get:function(){return LEe.MongoDBInstrumentation}});var DEe=AY();Object.defineProperty(Au,"MongodbCommandType",{enumerable:!0,get:function(){return DEe.MongodbCommandType}})});var cO=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.DB_SYSTEM_NAME_VALUE_MONGODB=at.ATTR_NET_PEER_PORT=at.ATTR_NET_PEER_NAME=at.ATTR_DB_USER=at.ATTR_DB_SYSTEM=at.ATTR_DB_STATEMENT=at.ATTR_DB_OPERATION=at.ATTR_DB_NAME=at.ATTR_DB_MONGODB_COLLECTION=void 0;at.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";at.ATTR_DB_NAME="db.name";at.ATTR_DB_OPERATION="db.operation";at.ATTR_DB_STATEMENT="db.statement";at.ATTR_DB_SYSTEM="db.system";at.ATTR_DB_USER="db.user";at.ATTR_NET_PEER_NAME="net.peer.name";at.ATTR_NET_PEER_PORT="net.peer.port";at.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var PY=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.handleCallbackResponse=Fs.handlePromiseResponse=Fs.getAttributesFromCollection=void 0;var bY=(b(),N(v)),ad=ne(),id=cO(),kh=(le(),N(Ae));function jEe(t,e,n){let r={};return e&ad.SemconvStability.OLD&&(r[id.ATTR_DB_MONGODB_COLLECTION]=t.name,r[id.ATTR_DB_NAME]=t.conn.name,r[id.ATTR_DB_USER]=t.conn.user),e&ad.SemconvStability.STABLE&&(r[kh.ATTR_DB_COLLECTION_NAME]=t.name,r[kh.ATTR_DB_NAMESPACE]=t.conn.name),n&ad.SemconvStability.OLD&&(r[id.ATTR_NET_PEER_NAME]=t.conn.host,r[id.ATTR_NET_PEER_PORT]=t.conn.port),n&ad.SemconvStability.STABLE&&(r[kh.ATTR_SERVER_ADDRESS]=t.conn.host,r[kh.ATTR_SERVER_PORT]=t.conn.port),r}Fs.getAttributesFromCollection=jEe;function CY(t,e={}){t.recordException(e),t.setStatus({code:bY.SpanStatusCode.ERROR,message:`${e.message} ${e.code?`
11
- Mongoose Error Code: ${e.code}`:""}`})}function uO(t,e,n,r=void 0){n&&(0,ad.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&bY.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function HEe(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(uO(e,o,n,r),o)).catch(o=>{throw CY(e,o),o}).finally(()=>e.end()):(uO(e,t,n,r),e.end(),t)}Fs.handlePromiseResponse=HEe;function VEe(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(c,l)=>(c?CY(r,c):uO(r,l,s,i),r.end(),t(c,l)),e.apply(n,o)}Fs.handleCallbackResponse=VEe});var MY=E(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.PACKAGE_NAME=Ru.PACKAGE_VERSION=void 0;Ru.PACKAGE_VERSION="0.60.0";Ru.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var UY=E(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.MongooseInstrumentation=On._ALREADY_INSTRUMENTED=On._STORED_PARENT_SPAN=void 0;var Tt=(b(),N(v)),FEe=he(),lO=PY(),Gt=ne(),xY=MY(),qs=cO(),ua=(le(),N(Ae)),Gh=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],qEe=["remove","count","findOneAndRemove",...Gh],$Ee=["count","findOneAndRemove",...Gh],YEe=[...Gh];function vY(t){return t?t.startsWith("6.")||t.startsWith("5.")?qEe:t.startsWith("7.")?$Ee:YEe:Gh}function LY(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function DY(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}On._STORED_PARENT_SPAN=Symbol("stored-parent-span");On._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var pO=class extends Gt.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(xY.PACKAGE_NAME,xY.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Gt.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Gt.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Gt.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,LY(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),DY(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),vY(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=vY(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,LY(n)&&this._unwrap(r.Model.prototype,"remove"),DY(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return r.apply(this,arguments);let i=this[On._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let p=c("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Gt.SemconvStability.OLD&&(a[qs.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&Gt.SemconvStability.STABLE&&(a[ua.ATTR_DB_QUERY_TEXT]=p)}let l=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(l,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[On._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return r.apply(this,arguments);let i=this[On._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let p=c(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Gt.SemconvStability.OLD&&(a[qs.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&Gt.SemconvStability.STABLE&&(a[ua.ATTR_DB_QUERY_TEXT]=p)}let l=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(l,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let l={},{dbStatementSerializer:p}=r.getConfig();if(p){let _=p(e,c);r._dbSemconvStability&Gt.SemconvStability.OLD&&(l[qs.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&Gt.SemconvStability.STABLE&&(l[ua.ATTR_DB_QUERY_TEXT]=_)}let d=r._startSpan(this.constructor.collection,this.constructor.modelName,e,l);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(d,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return o.apply(this,arguments);let l=c,p=i,d=a;typeof i=="function"?(l=i,p=void 0,d=void 0):typeof a=="function"&&(l=a,d=void 0);let _={},f=r.getConfig().dbStatementSerializer;if(f){let h=f(e,{condition:{_id:this._id},updates:p,options:d});r._dbSemconvStability&Gt.SemconvStability.OLD&&(_[qs.ATTR_DB_STATEMENT]=h),r._dbSemconvStability&Gt.SemconvStability.STABLE&&(_[ua.ATTR_DB_QUERY_TEXT]=h)}let m=r._startSpan(this.constructor.collection,this.constructor.modelName,e,_),T=r._handleResponse(m,o,this,arguments,l,n);return T&&typeof T=="object"&&(T[On._ALREADY_INSTRUMENTED]=!0),T}}patchModelStatic(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(c=a,a=void 0);let l={};switch(e){case"insertMany":l.documents=i;break;case"bulkWrite":l.operations=i;break;default:l.document=i;break}a!==void 0&&(l.options=a);let p={},{dbStatementSerializer:d}=r.getConfig();if(d){let f=d(e,l);r._dbSemconvStability&Gt.SemconvStability.OLD&&(p[qs.ATTR_DB_STATEMENT]=f),r._dbSemconvStability&Gt.SemconvStability.STABLE&&(p[ua.ATTR_DB_QUERY_TEXT]=f)}let _=r._startSpan(this.collection,this.modelName,e,p);return r._handleResponse(_,o,this,arguments,c,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=Tt.trace.getSpan(Tt.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[On._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[On._STORED_PARENT_SPAN]=Tt.trace.getSpan(Tt.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,lO.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Gt.SemconvStability.OLD&&(i[qs.ATTR_DB_OPERATION]=r,i[qs.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Gt.SemconvStability.STABLE&&(i[ua.ATTR_DB_OPERATION_NAME]=r,i[ua.ATTR_DB_SYSTEM_NAME]=qs.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&Gt.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:Tt.SpanKind.CLIENT,attributes:i},s?Tt.trace.setSpan(Tt.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,lO.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,lO.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?Tt.context.with((0,FEe.suppressTracing)(Tt.context.active()),e):e()}};On.MongooseInstrumentation=pO});var wY=E(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.MongooseInstrumentation=void 0;var WEe=UY();Object.defineProperty(Bh,"MongooseInstrumentation",{enumerable:!0,get:function(){return WEe.MongooseInstrumentation}})});var HY=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ct.DB_SYSTEM_VALUE_MYSQL=ct.ATTR_NET_PEER_PORT=ct.ATTR_NET_PEER_NAME=ct.ATTR_DB_USER=ct.ATTR_DB_SYSTEM=ct.ATTR_DB_STATEMENT=ct.ATTR_DB_NAME=ct.ATTR_DB_CONNECTION_STRING=void 0;ct.ATTR_DB_CONNECTION_STRING="db.connection_string";ct.ATTR_DB_NAME="db.name";ct.ATTR_DB_STATEMENT="db.statement";ct.ATTR_DB_SYSTEM="db.system";ct.ATTR_DB_USER="db.user";ct.ATTR_NET_PEER_NAME="net.peer.name";ct.ATTR_NET_PEER_PORT="net.peer.port";ct.DB_SYSTEM_VALUE_MYSQL="mysql";ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var VY=E(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.AttributeNames=void 0;var KEe;(function(t){t.MYSQL_VALUES="db.mysql.values"})(KEe=cd.AttributeNames||(cd.AttributeNames={}))});var FY=E(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.getPoolNameOld=Qt.arrayStringifyHelper=Qt.getSpanName=Qt.getDbValues=Qt.getDbQueryText=Qt.getJDBCString=Qt.getConfig=void 0;function QEe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}Qt.getConfig=QEe;function XEe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}Qt.getJDBCString=XEe;function JEe(t){return typeof t=="string"?t:t.sql}Qt.getDbQueryText=JEe;function ZEe(t,e){return dO(typeof t=="string"?e:e||t.values)}Qt.getDbValues=ZEe;function eSe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Qt.getSpanName=eSe;function dO(t){return t?`[${t.toString()}]`:""}Qt.arrayStringifyHelper=dO;function tSe(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}Qt.getPoolNameOld=tSe});var qY=E(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.PACKAGE_NAME=yu.PACKAGE_VERSION=void 0;yu.PACKAGE_VERSION="0.60.0";yu.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var YY=E(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.MySQLInstrumentation=void 0;var bn=(b(),N(v)),ur=ne(),Iu=(le(),N(Ae)),Yo=HY(),nSe=VY(),la=FY(),$Y=qY(),_O=class extends ur.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super($Y.PACKAGE_NAME,$Y.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ur.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ur.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Yo.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new ur.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,ur.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,ur.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,ur.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,l=(0,la.getPoolNameOld)(e);r._connCountAdd(-c,l,"used"),r._connCountAdd(-a,l,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),l=a[c].pool;r._setPoolCallbacks(l,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=bn.context.active();return function(o,s){s&&((0,ur.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&bn.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:c,port:l,database:p,user:d}=(0,la.getConfig)(e.config),_=parseInt(l,10),f=(0,la.getDbQueryText)(o);r._dbSemconvStability&ur.SemconvStability.OLD&&(a[Yo.ATTR_DB_SYSTEM]=Yo.DB_SYSTEM_VALUE_MYSQL,a[Yo.ATTR_DB_CONNECTION_STRING]=(0,la.getJDBCString)(c,l,p),a[Yo.ATTR_DB_NAME]=p,a[Yo.ATTR_DB_USER]=d,a[Yo.ATTR_DB_STATEMENT]=f),r._dbSemconvStability&ur.SemconvStability.STABLE&&(a[Iu.ATTR_DB_SYSTEM_NAME]=Iu.DB_SYSTEM_NAME_VALUE_MYSQL,a[Iu.ATTR_DB_NAMESPACE]=p,a[Iu.ATTR_DB_QUERY_TEXT]=f),r._netSemconvStability&ur.SemconvStability.OLD&&(a[Yo.ATTR_NET_PEER_NAME]=c,isNaN(_)||(a[Yo.ATTR_NET_PEER_PORT]=_)),r._netSemconvStability&ur.SemconvStability.STABLE&&(a[Iu.ATTR_SERVER_ADDRESS]=c,isNaN(_)||(a[Iu.ATTR_SERVER_PORT]=_));let m=r.tracer.startSpan((0,la.getSpanName)(o),{kind:bn.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let S;Array.isArray(s)?S=s:arguments[2]&&(S=[s]),m.setAttribute(nSe.AttributeNames.MYSQL_VALUES,(0,la.getDbValues)(o,S))}let T=Array.from(arguments).findIndex(S=>typeof S=="function"),h=bn.context.active();if(T===-1){let S=bn.context.with(bn.trace.setSpan(bn.context.active(),m),()=>n.apply(e,arguments));return bn.context.bind(h,S),S.on("error",R=>m.setStatus({code:bn.SpanStatusCode.ERROR,message:R.message})).on("end",()=>{m.end()})}else return r._wrap(arguments,T,r._patchCallbackQuery(m,h)),bn.context.with(bn.trace.setSpan(bn.context.active(),m),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:bn.SpanStatusCode.ERROR,message:o.message}),e.end(),bn.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,la.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};jh.MySQLInstrumentation=_O});var WY=E(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.MySQLInstrumentation=void 0;var rSe=YY();Object.defineProperty(Hh,"MySQLInstrumentation",{enumerable:!0,get:function(){return rSe.MySQLInstrumentation}})});var fO=E(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.DB_SYSTEM_VALUE_MYSQL=bt.ATTR_NET_PEER_PORT=bt.ATTR_NET_PEER_NAME=bt.ATTR_DB_USER=bt.ATTR_DB_SYSTEM=bt.ATTR_DB_STATEMENT=bt.ATTR_DB_NAME=bt.ATTR_DB_CONNECTION_STRING=void 0;bt.ATTR_DB_CONNECTION_STRING="db.connection_string";bt.ATTR_DB_NAME="db.name";bt.ATTR_DB_STATEMENT="db.statement";bt.ATTR_DB_SYSTEM="db.system";bt.ATTR_DB_USER="db.user";bt.ATTR_NET_PEER_NAME="net.peer.name";bt.ATTR_NET_PEER_PORT="net.peer.port";bt.DB_SYSTEM_VALUE_MYSQL="mysql"});var TO=E(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.addSqlCommenterComment=void 0;var mO=(b(),N(v)),sSe=he();function iSe(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function aSe(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function cSe(t,e){if(typeof e!="string"||e.length===0||iSe(e))return e;let n=new sSe.W3CTraceContextPropagator,r={};n.inject(mO.trace.setSpan(mO.ROOT_CONTEXT,t),r,mO.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=aSe(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}Vh.addSqlCommenterComment=cSe});var JY=E(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.getConnectionPrototypeToInstrument=lr.once=lr.getSpanName=lr.getQueryText=lr.getConnectionAttributes=void 0;var ud=fO(),Fh=ne(),hO=(le(),N(Ae));function uSe(t,e,n){let{host:r,port:o,database:s,user:i}=lSe(t),a={};e&Fh.SemconvStability.OLD&&(a[ud.ATTR_DB_CONNECTION_STRING]=pSe(r,o,s),a[ud.ATTR_DB_NAME]=s,a[ud.ATTR_DB_USER]=i),e&Fh.SemconvStability.STABLE&&(a[hO.ATTR_DB_NAMESPACE]=s);let c=parseInt(o,10);return n&Fh.SemconvStability.OLD&&(a[ud.ATTR_NET_PEER_NAME]=r,isNaN(c)||(a[ud.ATTR_NET_PEER_PORT]=c)),n&Fh.SemconvStability.STABLE&&(a[hO.ATTR_SERVER_ADDRESS]=r,isNaN(c)||(a[hO.ATTR_SERVER_PORT]=c)),a}lr.getConnectionAttributes=uSe;function lSe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function pSe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function dSe(t,e,n,r=!1,o=_Se){let[s,i]=typeof t=="string"?[t,n]:[t.sql,fSe(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}lr.getQueryText=dSe;function _Se(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function fSe(t){return"values"in t}function mSe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}lr.getSpanName=mSe;var TSe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};lr.once=TSe;function hSe(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}lr.getConnectionPrototypeToInstrument=hSe});var ZY=E(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.PACKAGE_NAME=Nu.PACKAGE_VERSION=void 0;Nu.PACKAGE_VERSION="0.60.0";Nu.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var rW=E(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.MySQL2Instrumentation=void 0;var eW=(b(),N(v)),vr=ne(),EO=fO(),tW=TO(),Ou=JY(),nW=ZY(),SO=(le(),N(Ae)),gO=[">=1.4.2 <4"],AO=class extends vr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(nW.PACKAGE_NAME,nW.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,vr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,vr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,vr.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,vr.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new vr.InstrumentationNodeModuleDefinition("mysql2",gO,s=>(n(s),s),()=>{},[new vr.InstrumentationNodeModuleFile("mysql2/promise.js",gO,s=>(n(s),s),()=>{}),new vr.InstrumentationNodeModuleFile("mysql2/lib/connection.js",gO,s=>{let i=(0,Ou.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,Ou.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let{maskStatement:l,maskStatementHook:p,responseHook:d}=o.getConfig(),_=(0,Ou.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),f=(0,Ou.getQueryText)(s,e,c,l,p);o._dbSemconvStability&vr.SemconvStability.OLD&&(_[EO.ATTR_DB_SYSTEM]=EO.DB_SYSTEM_VALUE_MYSQL,_[EO.ATTR_DB_STATEMENT]=f),o._dbSemconvStability&vr.SemconvStability.STABLE&&(_[SO.ATTR_DB_SYSTEM_NAME]=SO.DB_SYSTEM_NAME_VALUE_MYSQL,_[SO.ATTR_DB_QUERY_TEXT]=f);let m=o.tracer.startSpan((0,Ou.getSpanName)(s),{kind:eW.SpanKind.CLIENT,attributes:_});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,tW.addSqlCommenterComment)(m,s):Object.assign(s,{sql:(0,tW.addSqlCommenterComment)(m,s.sql)}));let T=(0,Ou.once)((h,S)=>{h?m.setStatus({code:eW.SpanStatusCode.ERROR,message:h.message}):typeof d=="function"&&(0,vr.safeExecuteInTheMiddle)(()=>{d(m,{queryResults:S})},R=>{R&&o._diag.warn("Failed executing responseHook",R)},!0),m.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(T));let h=r.apply(this,arguments);return h.once("error",S=>{T(S)}).once("result",S=>{T(void 0,S)}),h}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(T)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(T)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};qh.MySQL2Instrumentation=AO});var oW=E($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.MySQL2Instrumentation=void 0;var ESe=rW();Object.defineProperty($h,"MySQL2Instrumentation",{enumerable:!0,get:function(){return ESe.MySQL2Instrumentation}})});var uW=E(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DB_SYSTEM_VALUE_REDIS=Xt.DB_SYSTEM_NAME_VALUE_REDIS=Xt.ATTR_NET_PEER_PORT=Xt.ATTR_NET_PEER_NAME=Xt.ATTR_DB_SYSTEM=Xt.ATTR_DB_STATEMENT=Xt.ATTR_DB_CONNECTION_STRING=void 0;Xt.ATTR_DB_CONNECTION_STRING="db.connection_string";Xt.ATTR_DB_STATEMENT="db.statement";Xt.ATTR_DB_SYSTEM="db.system";Xt.ATTR_NET_PEER_NAME="net.peer.name";Xt.ATTR_NET_PEER_PORT="net.peer.port";Xt.DB_SYSTEM_NAME_VALUE_REDIS="redis";Xt.DB_SYSTEM_VALUE_REDIS="redis"});var lW=E(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.endSpan=void 0;var gSe=(b(),N(v)),ASe=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:gSe.SpanStatusCode.ERROR,message:e.message})),t.end()};Yh.endSpan=ASe});var zh=E(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.defaultDbStatementSerializer=void 0;var RSe=[{regex:/^ECHO/i,args:0},{regex:/^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i,args:1},{regex:/^(HSET|HMSET|LSET|LINSERT)/i,args:2},{regex:/^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i,args:-1}],ySe=(t,e)=>{if(Array.isArray(e)&&e.length){let n=RSe.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};Wh.defaultDbStatementSerializer=ySe});var pW=E(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.PACKAGE_NAME=bu.PACKAGE_VERSION=void 0;bu.PACKAGE_VERSION="0.62.0";bu.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var mW=E(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.IORedisInstrumentation=void 0;var $s=(b(),N(v)),Cn=ne(),Ys=(le(),N(Ae)),Pn=uW(),dW=ne(),ld=lW(),ISe=zh(),_W=pW(),fW={requireParentSpan:!0},RO=class extends Cn.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(_W.PACKAGE_NAME,_W.PACKAGE_VERSION,{...fW,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Cn.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Cn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...fW,...e})}init(){return[new Cn.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Cn.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Cn.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||ISe.defaultDbStatementSerializer,a=$s.trace.getSpan($s.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c={},{host:l,port:p}=this.options,d=i(o.name,o.args);r._dbSemconvStability&Cn.SemconvStability.OLD&&(c[Pn.ATTR_DB_SYSTEM]=Pn.DB_SYSTEM_VALUE_REDIS,c[Pn.ATTR_DB_STATEMENT]=d,c[Pn.ATTR_DB_CONNECTION_STRING]=`redis://${l}:${p}`),r._dbSemconvStability&Cn.SemconvStability.STABLE&&(c[Ys.ATTR_DB_SYSTEM_NAME]=Pn.DB_SYSTEM_NAME_VALUE_REDIS,c[Ys.ATTR_DB_QUERY_TEXT]=d),r._netSemconvStability&Cn.SemconvStability.OLD&&(c[Pn.ATTR_NET_PEER_NAME]=l,c[Pn.ATTR_NET_PEER_PORT]=p),r._netSemconvStability&Cn.SemconvStability.STABLE&&(c[Ys.ATTR_SERVER_ADDRESS]=l,c[Ys.ATTR_SERVER_PORT]=p);let _=r.tracer.startSpan(o.name,{kind:$s.SpanKind.CLIENT,attributes:c}),{requestHook:f}=s;f&&(0,dW.safeExecuteInTheMiddle)(()=>f(_,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),m=>{m&&$s.diag.error("ioredis instrumentation: request hook failed",m)},!0);try{let m=e.apply(this,arguments),T=o.resolve;o.resolve=function(S){(0,dW.safeExecuteInTheMiddle)(()=>s.responseHook?.(_,o.name,o.args,S),R=>{R&&$s.diag.error("ioredis instrumentation: response hook failed",R)},!0),(0,ld.endSpan)(_,null),T(S)};let h=o.reject;return o.reject=function(S){(0,ld.endSpan)(_,S),h(S)},m}catch(m){throw(0,ld.endSpan)(_,m),m}}}_traceConnection(e){let n=this;return function(){let r=$s.trace.getSpan($s.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&Cn.SemconvStability.OLD&&(o[Pn.ATTR_DB_SYSTEM]=Pn.DB_SYSTEM_VALUE_REDIS,o[Pn.ATTR_DB_STATEMENT]="connect",o[Pn.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&Cn.SemconvStability.STABLE&&(o[Ys.ATTR_DB_SYSTEM_NAME]=Pn.DB_SYSTEM_NAME_VALUE_REDIS,o[Ys.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Cn.SemconvStability.OLD&&(o[Pn.ATTR_NET_PEER_NAME]=s,o[Pn.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&Cn.SemconvStability.STABLE&&(o[Ys.ATTR_SERVER_ADDRESS]=s,o[Ys.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:$s.SpanKind.CLIENT,attributes:o});try{let c=e.apply(this,arguments);return(0,ld.endSpan)(a,null),c}catch(c){throw(0,ld.endSpan)(a,c),c}}}};Kh.IORedisInstrumentation=RO});var TW=E(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.IORedisInstrumentation=void 0;var NSe=mW();Object.defineProperty(Qh,"IORedisInstrumentation",{enumerable:!0,get:function(){return NSe.IORedisInstrumentation}})});var Xh=E(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.PACKAGE_NAME=Cu.PACKAGE_VERSION=void 0;Cu.PACKAGE_VERSION="0.62.0";Cu.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var hW=E(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.getTracedCreateStreamTrace=Ws.getTracedCreateClient=Ws.endSpan=void 0;var pd=(b(),N(v)),OSe=(t,e)=>{e&&t.setStatus({code:pd.SpanStatusCode.ERROR,message:e.message}),t.end()};Ws.endSpan=OSe;var bSe=t=>function(){let n=t.apply(this,arguments);return pd.context.bind(pd.context.active(),n)};Ws.getTracedCreateClient=bSe;var CSe=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){pd.context.bind(pd.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};Ws.getTracedCreateStreamTrace=CSe});var Jh=E(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.DB_SYSTEM_VALUE_REDIS=Jt.DB_SYSTEM_NAME_VALUE_REDIS=Jt.ATTR_NET_PEER_PORT=Jt.ATTR_NET_PEER_NAME=Jt.ATTR_DB_SYSTEM=Jt.ATTR_DB_STATEMENT=Jt.ATTR_DB_CONNECTION_STRING=void 0;Jt.ATTR_DB_CONNECTION_STRING="db.connection_string";Jt.ATTR_DB_STATEMENT="db.statement";Jt.ATTR_DB_SYSTEM="db.system";Jt.ATTR_NET_PEER_NAME="net.peer.name";Jt.ATTR_NET_PEER_PORT="net.peer.port";Jt.DB_SYSTEM_NAME_VALUE_REDIS="redis";Jt.DB_SYSTEM_VALUE_REDIS="redis"});var SW=E(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});eE.RedisInstrumentationV2_V3=void 0;var qn=ne(),Zh=hW(),EW=Xh(),dd=(b(),N(v)),_d=(le(),N(Ae)),pa=Jh(),PSe=zh(),yO=class t extends qn.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(EW.PACKAGE_NAME,EW.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,qn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,qn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new qn.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,qn.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,qn.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,qn.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=dd.trace.getSpan(dd.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let c=i?.dbStatementSerializer||PSe.defaultDbStatementSerializer,l={};e._semconvStability&qn.SemconvStability.OLD&&Object.assign(l,{[pa.ATTR_DB_SYSTEM]:pa.DB_SYSTEM_VALUE_REDIS,[pa.ATTR_DB_STATEMENT]:c(s.command,s.args)}),e._semconvStability&qn.SemconvStability.STABLE&&Object.assign(l,{[_d.ATTR_DB_SYSTEM_NAME]:pa.DB_SYSTEM_NAME_VALUE_REDIS,[_d.ATTR_DB_OPERATION_NAME]:s.command,[_d.ATTR_DB_QUERY_TEXT]:c(s.command,s.args)});let p=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:dd.SpanKind.CLIENT,attributes:l});if(this.connection_options){let _={};e._semconvStability&qn.SemconvStability.OLD&&Object.assign(_,{[pa.ATTR_NET_PEER_NAME]:this.connection_options.host,[pa.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&qn.SemconvStability.STABLE&&Object.assign(_,{[_d.ATTR_SERVER_ADDRESS]:this.connection_options.host,[_d.ATTR_SERVER_PORT]:this.connection_options.port}),p.setAttributes(_)}this.address&&e._semconvStability&qn.SemconvStability.OLD&&p.setAttribute(pa.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let d=arguments[0].callback;if(d){let _=dd.context.active();arguments[0].callback=function(m,T){if(i?.responseHook){let h=i.responseHook;(0,qn.safeExecuteInTheMiddle)(()=>{h(p,s.command,s.args,T)},S=>{S&&e._diag.error("Error executing responseHook",S)},!0)}return(0,Zh.endSpan)(p,m),dd.context.with(_,d,this,...arguments)}}try{return r.apply(this,arguments)}catch(_){throw(0,Zh.endSpan)(p,_),_}}}}_getPatchCreateClient(){return function(n){return(0,Zh.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,Zh.getTracedCreateStreamTrace)(n)}}};eE.RedisInstrumentationV2_V3=yO});var AW=E(tE=>{"use strict";Object.defineProperty(tE,"__esModule",{value:!0});tE.getClientAttributes=void 0;var IO=(le(),N(Ae)),Pu=Jh(),gW=ne();function MSe(t,e,n){let r={};return n&gW.SemconvStability.OLD&&Object.assign(r,{[Pu.ATTR_DB_SYSTEM]:Pu.DB_SYSTEM_VALUE_REDIS,[Pu.ATTR_NET_PEER_NAME]:e?.socket?.host,[Pu.ATTR_NET_PEER_PORT]:e?.socket?.port,[Pu.ATTR_DB_CONNECTION_STRING]:xSe(t,e?.url)}),n&gW.SemconvStability.STABLE&&Object.assign(r,{[IO.ATTR_DB_SYSTEM_NAME]:Pu.DB_SYSTEM_NAME_VALUE_REDIS,[IO.ATTR_SERVER_ADDRESS]:e?.socket?.host,[IO.ATTR_SERVER_PORT]:e?.socket?.port}),r}tE.getClientAttributes=MSe;function xSe(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var NW=E(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.RedisInstrumentationV4_V5=void 0;var pr=(b(),N(v)),xe=ne(),RW=AW(),vSe=zh(),yW=Xh(),NO=(le(),N(Ae)),LSe=Jh(),fd=Symbol("opentelemetry.instrumentation.redis.open_spans"),IW=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),OO=class t extends xe.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(yW.PACKAGE_NAME,yW.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,xe.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,xe.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new xe.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,xe.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,xe.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,xe.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new xe.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,xe.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,xe.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,xe.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,xe.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,xe.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new xe.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,xe.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,xe.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,xe.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,xe.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,xe.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,xe.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new xe.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(c,l){let p=e(c,l).args;return n._traceClientCommand(a,this,arguments,p)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let c=this[fd];return n._endSpansWithRedisReplies(c,a,e),a}).catch(a=>{let c=this[fd];if(!c)n._diag.error("cannot find open spans to end for multi/pipeline");else{let l=a.constructor.name==="MultiErrorReply"?a.replies:new Array(c.length).fill(a);n._endSpansWithRedisReplies(c,l,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[IW]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,RW.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:pr.SpanKind.CLIENT,attributes:i});return pr.context.with(pr.trace.setSpan(pr.context.active(),a),()=>r.apply(this)).then(l=>(a.end(),l)).catch(l=>(a.recordException(l),a.setStatus({code:pr.SpanStatusCode.ERROR,message:l.message}),a.end(),Promise.reject(l)))}}}_traceClientCommand(e,n,r,o){if(pr.trace.getSpan(pr.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[IW],a=o[0],c=o.slice(1),l=this.getConfig().dbStatementSerializer||vSe.defaultDbStatementSerializer,p=(0,RW.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&xe.SemconvStability.STABLE&&(p[NO.ATTR_DB_OPERATION_NAME]=a);try{let f=l(a,c);f!=null&&(this._semconvStability&xe.SemconvStability.OLD&&(p[LSe.ATTR_DB_STATEMENT]=f),this._semconvStability&xe.SemconvStability.STABLE&&(p[NO.ATTR_DB_QUERY_TEXT]=f))}catch(f){this._diag.error("dbStatementSerializer throw an exception",f,{commandName:a})}let d=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:pr.SpanKind.CLIENT,attributes:p}),_=pr.context.with(pr.trace.setSpan(pr.context.active(),d),()=>e.apply(n,r));if(typeof _?.then=="function")_.then(f=>{this._endSpanWithResponse(d,a,c,f,void 0)},f=>{this._endSpanWithResponse(d,a,c,null,f)});else{let f=_;f[fd]=f[fd]||[],f[fd].push({span:d,commandName:a,commandArgs:c})}return _}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:c,commandArgs:l}=e[a],p=n[a],[d,_]=p instanceof Error?[null,p]:[p,void 0];this._semconvStability&xe.SemconvStability.STABLE&&c.setAttribute(NO.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(c,o[a],l,d,_)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:pr.SpanStatusCode.ERROR,message:s?.message})),e.end()}};nE.RedisInstrumentationV4_V5=OO});var CW=E(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});rE.RedisInstrumentation=void 0;var DSe=ne(),OW=Xh(),USe=SW(),wSe=NW(),bW={requireParentSpan:!1},bO=class extends DSe.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...bW,...e};super(OW.PACKAGE_NAME,OW.PACKAGE_VERSION,n),this.instrumentationV2_V3=new USe.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new wSe.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...bW,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};rE.RedisInstrumentation=bO});var PW=E(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.RedisInstrumentation=void 0;var kSe=CW();Object.defineProperty(oE,"RedisInstrumentation",{enumerable:!0,get:function(){return kSe.RedisInstrumentation}})});var BW=E(iE=>{"use strict";Object.defineProperty(iE,"__esModule",{value:!0});iE.EVENT_LISTENERS_SET=void 0;iE.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var MO=E(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.AttributeNames=void 0;var qSe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(qSe=hd.AttributeNames||(hd.AttributeNames={}))});var xO=E(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Se.METRIC_DB_CLIENT_CONNECTION_COUNT=Se.DB_SYSTEM_VALUE_POSTGRESQL=Se.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Se.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Se.ATTR_NET_PEER_PORT=Se.ATTR_NET_PEER_NAME=Se.ATTR_DB_USER=Se.ATTR_DB_SYSTEM=Se.ATTR_DB_STATEMENT=Se.ATTR_DB_NAME=Se.ATTR_DB_CONNECTION_STRING=Se.ATTR_DB_CLIENT_CONNECTION_STATE=Se.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Se.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Se.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Se.ATTR_DB_CONNECTION_STRING="db.connection_string";Se.ATTR_DB_NAME="db.name";Se.ATTR_DB_STATEMENT="db.statement";Se.ATTR_DB_SYSTEM="db.system";Se.ATTR_DB_USER="db.user";Se.ATTR_NET_PEER_NAME="net.peer.name";Se.ATTR_NET_PEER_PORT="net.peer.port";Se.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Se.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Se.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Se.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Se.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var vO=E(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.SpanNames=void 0;var $Se;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})($Se=Ed.SpanNames||(Ed.SpanNames={}))});var YW=E(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.sanitizedErrorMessage=me.isObjectWithTextString=me.getErrorMessage=me.patchClientConnectCallback=me.patchCallbackPGPool=me.updateCounter=me.getPoolName=me.patchCallback=me.handleExecutionResult=me.handleConfigQuery=me.shouldSkipInstrumentation=me.getSemanticAttributesFromPoolConnection=me.getSemanticAttributesFromConnection=me.getConnectionString=me.parseAndMaskConnectionString=me.parseNormalizedOperationName=me.getQuerySpanName=void 0;var zs=(b(),N(v)),aE=MO(),dr=(le(),N(Ae)),Fe=xO(),da=ne(),jW=vO();function HW(t,e){if(!e)return jW.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:VW(e.text);return`${jW.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}me.getQuerySpanName=HW;function VW(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}me.parseNormalizedOperationName=VW;function FW(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}me.parseAndMaskConnectionString=FW;function LO(t){if("connectionString"in t&&t.connectionString)return FW(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}me.getConnectionString=LO;function cE(t){if(Number.isInteger(t))return t}function qW(t,e){let n={};return e&da.SemconvStability.OLD&&(n={...n,[Fe.ATTR_DB_SYSTEM]:Fe.DB_SYSTEM_VALUE_POSTGRESQL,[Fe.ATTR_DB_NAME]:t.database,[Fe.ATTR_DB_CONNECTION_STRING]:LO(t),[Fe.ATTR_DB_USER]:t.user,[Fe.ATTR_NET_PEER_NAME]:t.host,[Fe.ATTR_NET_PEER_PORT]:cE(t.port)}),e&da.SemconvStability.STABLE&&(n={...n,[dr.ATTR_DB_SYSTEM_NAME]:dr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dr.ATTR_DB_NAMESPACE]:t.namespace,[dr.ATTR_SERVER_ADDRESS]:t.host,[dr.ATTR_SERVER_PORT]:cE(t.port)}),n}me.getSemanticAttributesFromConnection=qW;function YSe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[aE.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[aE.AttributeNames.MAX_CLIENT]:t.maxClient};return e&da.SemconvStability.OLD&&(r={...r,[Fe.ATTR_DB_SYSTEM]:Fe.DB_SYSTEM_VALUE_POSTGRESQL,[Fe.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Fe.ATTR_DB_CONNECTION_STRING]:LO(t),[Fe.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Fe.ATTR_NET_PEER_PORT]:Number(n?.port)||cE(t.port),[Fe.ATTR_DB_USER]:n?.username??t.user}),e&da.SemconvStability.STABLE&&(r={...r,[dr.ATTR_DB_SYSTEM_NAME]:dr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dr.ATTR_DB_NAMESPACE]:t.namespace,[dr.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[dr.ATTR_SERVER_PORT]:Number(n?.port)||cE(t.port)}),r}me.getSemanticAttributesFromPoolConnection=YSe;function WSe(t){return t.requireParentSpan===!0&&zs.trace.getSpan(zs.context.active())===void 0}me.shouldSkipInstrumentation=WSe;function zSe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=HW(s,r),a=t.startSpan(i,{kind:zs.SpanKind.CLIENT,attributes:qW(o,n)});if(!r)return a;if(r.text&&(n&da.SemconvStability.OLD&&a.setAttribute(Fe.ATTR_DB_STATEMENT,r.text),n&da.SemconvStability.STABLE&&a.setAttribute(dr.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let c=r.values.map(l=>l==null?"null":l instanceof Buffer?l.toString():typeof l=="object"?typeof l.toPostgres=="function"?l.toPostgres():JSON.stringify(l):l.toString());a.setAttribute(aE.AttributeNames.PG_VALUES,c)}catch(c){zs.diag.error("failed to stringify ",r.values,c)}return typeof r.name=="string"&&a.setAttribute(aE.AttributeNames.PG_PLAN,r.name),a}me.handleConfigQuery=zSe;function $W(t,e,n){typeof t.responseHook=="function"&&(0,da.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&zs.diag.error("Error running response hook",r)},!0)}me.handleExecutionResult=$W;function KSe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[dr.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(uE(i)),e.setStatus({code:zs.SpanStatusCode.ERROR,message:i.message})):$W(t,e,a),o(),e.end(),n.call(this,i,a)}}me.patchCallback=KSe;function QSe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}me.getPoolName=QSe;function XSe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[Fe.ATTR_DB_CLIENT_CONNECTION_STATE]:Fe.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Fe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Fe.ATTR_DB_CLIENT_CONNECTION_STATE]:Fe.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Fe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Fe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}me.updateCounter=XSe;function JSe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(uE(r)),t.setStatus({code:zs.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}me.patchCallbackPGPool=JSe;function ZSe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(uE(r)),t.setStatus({code:zs.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}me.patchClientConnectCallback=ZSe;function ege(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}me.getErrorMessage=ege;function tge(t){return typeof t=="object"&&typeof t?.text=="string"}me.isObjectWithTextString=tge;function uE(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}me.sanitizedErrorMessage=uE});var WW=E(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.PACKAGE_NAME=Mu.PACKAGE_VERSION=void 0;Mu.PACKAGE_VERSION="0.66.0";Mu.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var ZW=E(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});pE.PgInstrumentation=void 0;var _n=ne(),Ie=(b(),N(v)),zW=BW(),ke=YW(),KW=TO(),QW=WW(),XW=vO(),lE=he(),Lr=(le(),N(Ae)),Sd=xO();function xu(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var DO=class extends _n.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(QW.PACKAGE_NAME,QW.PACKAGE_VERSION,e),this._semconvStability=(0,_n.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Lr.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Ie.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(Sd.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(Sd.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new _n.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new _n.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new _n.InstrumentationNodeModuleDefinition("pg",e,a=>{let c=xu(a);return this._patchPgClient(c.Client),a},a=>{let c=xu(a);return this._unpatchPgClient(c.Client),a},[o,r]),i=new _n.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let c=xu(a);return(0,_n.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect"),this._wrap(c.prototype,"connect",this._getPoolConnectPatch()),c},a=>{let c=xu(a);(0,_n.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=xu(e);return(0,_n.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,_n.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=xu(e);return(0,_n.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,_n.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ke.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(XW.SpanNames.CONNECT,{kind:Ie.SpanKind.CLIENT,attributes:ke.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let c=Ie.trace.getSpan(Ie.context.active());o=ke.patchClientConnectCallback(i,o),c&&(o=Ie.context.bind(Ie.context.active(),o))}let a=Ie.context.with(Ie.trace.setSpan(Ie.context.active(),i),()=>n.call(this,o));return JW(i,a)}}recordOperationDuration(e,n){let r={},o=[Lr.ATTR_DB_NAMESPACE,Lr.ATTR_ERROR_TYPE,Lr.ATTR_SERVER_PORT,Lr.ATTR_SERVER_ADDRESS,Lr.ATTR_DB_OPERATION_NAME];this._semconvStability&_n.SemconvStability.OLD&&o.push(Sd.ATTR_DB_SYSTEM),this._semconvStability&_n.SemconvStability.STABLE&&o.push(Lr.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,lE.hrTimeToMilliseconds)((0,lE.hrTimeDuration)(n,(0,lE.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ke.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,lE.hrTime)(),i=o[0],a=typeof i=="string",c=ke.isObjectWithTextString(i),l=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,p={[Sd.ATTR_DB_SYSTEM]:Sd.DB_SYSTEM_VALUE_POSTGRESQL,[Lr.ATTR_DB_NAMESPACE]:this.database,[Lr.ATTR_SERVER_PORT]:this.connectionParameters.port,[Lr.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};l?.text&&(p[Lr.ATTR_DB_OPERATION_NAME]=ke.parseNormalizedOperationName(l?.text));let d=()=>{e.recordOperationDuration(p,s)},_=e.getConfig(),f=ke.handleConfigQuery.call(this,e.tracer,_,e._semconvStability,l);if(_.addSqlCommenterCommentToQueries&&(a?o[0]=(0,KW.addSqlCommenterComment)(f,i):c&&!("name"in i)&&(o[0]={...i,text:(0,KW.addSqlCommenterComment)(f,i.text)})),o.length>0){let h=Ie.trace.getSpan(Ie.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ke.patchCallback(_,f,o[o.length-1],p,d),h&&(o[o.length-1]=Ie.context.bind(Ie.context.active(),o[o.length-1]));else if(typeof l?.callback=="function"){let S=ke.patchCallback(e.getConfig(),f,l.callback,p,d);h&&(S=Ie.context.bind(Ie.context.active(),S)),o[0].callback=S}}let{requestHook:m}=_;typeof m=="function"&&l&&(0,_n.safeExecuteInTheMiddle)(()=>{let{database:h,host:S,port:R,user:I}=this.connectionParameters;m(f,{connection:{database:h,host:S,port:R,user:I},query:{text:l.text,values:l.values,name:l.name}})},h=>{h&&e._diag.error("Error running query hook",h)},!0);let T;try{T=n.apply(this,o)}catch(h){throw h instanceof Error&&f.recordException(ke.sanitizedErrorMessage(h)),f.setStatus({code:Ie.SpanStatusCode.ERROR,message:ke.getErrorMessage(h)}),f.end(),h}return T instanceof Promise?T.then(h=>new Promise(S=>{ke.handleExecutionResult(e.getConfig(),f,h),d(),f.end(),S(h)})).catch(h=>new Promise((S,R)=>{h instanceof Error&&f.recordException(ke.sanitizedErrorMessage(h)),f.setStatus({code:Ie.SpanStatusCode.ERROR,message:h.message}),d(),f.end(),R(h)})):T})}_setPoolConnectEventListeners(e){if(e[zW.EVENT_LISTENERS_SET])return;let n=ke.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[zW.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ke.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(XW.SpanNames.POOL_CONNECT,{kind:Ie.SpanKind.CLIENT,attributes:ke.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let c=Ie.trace.getSpan(Ie.context.active());o=ke.patchCallbackPGPool(i,o),c&&(o=Ie.context.bind(Ie.context.active(),o))}let a=Ie.context.with(Ie.trace.setSpan(Ie.context.active(),i),()=>n.call(this,o));return JW(i,a)}}};pE.PgInstrumentation=DO;function JW(t,e){if(!(e instanceof Promise))return e;let n=e;return Ie.context.bind(Ie.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(ke.sanitizedErrorMessage(r)),t.setStatus({code:Ie.SpanStatusCode.ERROR,message:ke.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var ez=E(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.AttributeNames=vu.PgInstrumentation=void 0;var nge=ZW();Object.defineProperty(vu,"PgInstrumentation",{enumerable:!0,get:function(){return nge.PgInstrumentation}});var rge=MO();Object.defineProperty(vu,"AttributeNames",{enumerable:!0,get:function(){return rge.AttributeNames}})});var cz=E(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.SeverityNumber=void 0;var cge;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(cge=gd.SeverityNumber||(gd.SeverityNumber={}))});var _E=E(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.NOOP_LOGGER=Lu.NoopLogger=void 0;var dE=class{emit(e){}};Lu.NoopLogger=dE;Lu.NOOP_LOGGER=new dE});var mE=E(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.NOOP_LOGGER_PROVIDER=Du.NoopLoggerProvider=void 0;var uge=_E(),fE=class{getLogger(e,n,r){return new uge.NoopLogger}};Du.NoopLoggerProvider=fE;Du.NOOP_LOGGER_PROVIDER=new fE});var GO=E(TE=>{"use strict";Object.defineProperty(TE,"__esModule",{value:!0});TE.ProxyLogger=void 0;var lge=_E(),kO=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):lge.NOOP_LOGGER}};TE.ProxyLogger=kO});var jO=E(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.ProxyLoggerProvider=void 0;var pge=mE(),dge=GO(),BO=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new dge.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:pge.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};hE.ProxyLoggerProvider=BO});var uz=E(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});EE._globalThis=void 0;EE._globalThis=typeof globalThis=="object"?globalThis:global});var lz=E(SE=>{"use strict";Object.defineProperty(SE,"__esModule",{value:!0});SE._globalThis=void 0;var _ge=uz();Object.defineProperty(SE,"_globalThis",{enumerable:!0,get:function(){return _ge._globalThis}})});var pz=E(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0});gE._globalThis=void 0;var fge=lz();Object.defineProperty(gE,"_globalThis",{enumerable:!0,get:function(){return fge._globalThis}})});var dz=E(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.API_BACKWARDS_COMPATIBILITY_VERSION=uo.makeGetter=uo._global=uo.GLOBAL_LOGS_API_KEY=void 0;var mge=pz();uo.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");uo._global=mge._globalThis;function Tge(t,e,n){return r=>r===t?e:n}uo.makeGetter=Tge;uo.API_BACKWARDS_COMPATIBILITY_VERSION=1});var fz=E(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});AE.LogsAPI=void 0;var _r=dz(),hge=mE(),_z=jO(),HO=class t{constructor(){this._proxyLoggerProvider=new _z.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return _r._global[_r.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(_r._global[_r.GLOBAL_LOGS_API_KEY]=(0,_r.makeGetter)(_r.API_BACKWARDS_COMPATIBILITY_VERSION,e,hge.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=_r._global[_r.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(_r._global,_r.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete _r._global[_r.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new _z.ProxyLoggerProvider}};AE.LogsAPI=HO});var VO=E(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.logs=Ct.ProxyLoggerProvider=Ct.ProxyLogger=Ct.NoopLoggerProvider=Ct.NOOP_LOGGER_PROVIDER=Ct.NoopLogger=Ct.NOOP_LOGGER=Ct.SeverityNumber=void 0;var Ege=cz();Object.defineProperty(Ct,"SeverityNumber",{enumerable:!0,get:function(){return Ege.SeverityNumber}});var mz=_E();Object.defineProperty(Ct,"NOOP_LOGGER",{enumerable:!0,get:function(){return mz.NOOP_LOGGER}});Object.defineProperty(Ct,"NoopLogger",{enumerable:!0,get:function(){return mz.NoopLogger}});var Tz=mE();Object.defineProperty(Ct,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return Tz.NOOP_LOGGER_PROVIDER}});Object.defineProperty(Ct,"NoopLoggerProvider",{enumerable:!0,get:function(){return Tz.NoopLoggerProvider}});var Sge=GO();Object.defineProperty(Ct,"ProxyLogger",{enumerable:!0,get:function(){return Sge.ProxyLogger}});var gge=jO();Object.defineProperty(Ct,"ProxyLoggerProvider",{enumerable:!0,get:function(){return gge.ProxyLoggerProvider}});var Age=fz();Ct.logs=Age.LogsAPI.getInstance()});var hz=E(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.disableInstrumentations=Uu.enableInstrumentations=void 0;function Rge(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Uu.enableInstrumentations=Rge;function yge(t){t.forEach(e=>e.disable())}Uu.disableInstrumentations=yge});var gz=E(RE=>{"use strict";Object.defineProperty(RE,"__esModule",{value:!0});RE.registerInstrumentations=void 0;var Ez=(b(),N(v)),Ige=VO(),Sz=hz();function Nge(t){let e=t.tracerProvider||Ez.trace.getTracerProvider(),n=t.meterProvider||Ez.metrics.getMeterProvider(),r=t.loggerProvider||Ige.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,Sz.enableInstrumentations)(o,e,n,r),()=>{(0,Sz.disableInstrumentations)(o)}}RE.registerInstrumentations=Nge});var Pz=E(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});yE.satisfies=void 0;var YO=(b(),N(v)),Nz=/^(?: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-]+)*))?$/,Oge=/^(?<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-]+)*))?$/,bge={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Cge(t,e,n){if(!Pge(t))return YO.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=Lge(t);if(!r)return!1;let o=[],s=Oz(r,e,o,n);return s&&!n?.includePrerelease?xge(r,o):s}yE.satisfies=Cge;function Pge(t){return typeof t=="string"&&Nz.test(t)}function Oz(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(FO(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=eAe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!FO(t,s,n,r))return!1;return!0}return FO(t,e,n,r)}function FO(t,e,n,r){if(e=vge(e,r),e.includes(" "))return Oz(t,e,n,r);{let o=Dge(e);return n.push(o),Mge(t,o)}}function Mge(t,e){if(e.invalid)return!1;if(!e.version||$O(e.version))return!0;let n=Rz(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=Rz(r,o)}return bge[e.op]?.includes(n)}function xge(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function vge(t,e){return t=t.trim(),t=Jge(t,e),t=Xge(t),t=Zge(t,e),t=t.trim(),t}function fn(t){return!t||t.toLowerCase()==="x"||t==="*"}function Lge(t){let e=t.match(Nz);if(!e){YO.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function Dge(t){if(!t)return{};let e=t.match(Oge);if(!e)return YO.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function $O(t){return t==="*"||t==="x"||t==="X"}function Az(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Uge(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function wge(t,e){if($O(t)||$O(e))return 0;let[n,r]=Uge(Az(t),Az(e));return n>r?1:n<r?-1:0}function Rz(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=wge(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var bz="[a-zA-Z0-9-]",Cz="0|[1-9]\\d*",kge=`\\d*[a-zA-Z-]${bz}*`,Gge="((?:<|>)?=?)",yz=`(?:${Cz}|${kge})`,Bge=`(?:-(${yz}(?:\\.${yz})*))`,Iz=`${bz}+`,jge=`(?:\\+(${Iz}(?:\\.${Iz})*))`,qO=`${Cz}|x|X|\\*`,Ad=`[v=\\s]*(${qO})(?:\\.(${qO})(?:\\.(${qO})(?:${Bge})?${jge}?)?)?`,Hge=`^${Gge}\\s*${Ad}$`,Vge=new RegExp(Hge),Fge=`^\\s*(${Ad})\\s+-\\s+(${Ad})\\s*$`,qge=new RegExp(Fge),$ge="(?:~>?)",Yge=`^${$ge}${Ad}$`,Wge=new RegExp(Yge),zge="(?:\\^)",Kge=`^${zge}${Ad}$`,Qge=new RegExp(Kge);function Xge(t){let e=Wge;return t.replace(e,(n,r,o,s,i)=>{let a;return fn(r)?a="":fn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:fn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function Jge(t,e){let n=Qge,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let l;return fn(s)?l="":fn(i)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:fn(a)?s==="0"?l=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?l=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,l})}function Zge(t,e){let n=Vge;return t.replace(n,(r,o,s,i,a,c)=>{let l=fn(s),p=l||fn(i),d=p||fn(a),_=d;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",l?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function eAe(t,e){let n=qge;return t.replace(n,(r,o,s,i,a,c,l,p,d,_,f,m)=>(fn(s)?o="":fn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:fn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,fn(d)?p="":fn(_)?p=`<${+d+1}.0.0-0`:fn(f)?p=`<${d}.${+_+1}.0-0`:m?p=`<=${d}.${_}.${f}-${m}`:e?.includePrerelease?p=`<${d}.${_}.${+f+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var WO=E(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.massUnwrap=Bt.unwrap=Bt.massWrap=Bt.wrap=void 0;var mn=console.error.bind(console);function Rd(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var tAe=(t,e,n)=>{if(!t||!t[e]){mn("no original function "+String(e)+" to wrap");return}if(!n){mn("no wrapper function"),mn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){mn("original object and wrapper must be functions");return}let o=n(r,e);return Rd(o,"__original",r),Rd(o,"__unwrap",()=>{t[e]===o&&Rd(t,e,r)}),Rd(o,"__wrapped",!0),Rd(t,e,o),o};Bt.wrap=tAe;var nAe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{mn("must provide one or more modules to patch"),mn(new Error().stack);return}if(!(e&&Array.isArray(e))){mn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Bt.wrap)(r,o,n)})})};Bt.massWrap=nAe;var rAe=(t,e)=>{if(!t||!t[e]){mn("no function to unwrap."),mn(new Error().stack);return}let n=t[e];if(!n.__unwrap)mn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Bt.unwrap=rAe;var oAe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{mn("must provide one or more modules to patch"),mn(new Error().stack);return}if(!(e&&Array.isArray(e))){mn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Bt.unwrap)(n,r)})})};Bt.massUnwrap=oAe;function yd(t){t&&t.logger&&(typeof t.logger!="function"?mn("new logger isn't a function, not replacing"):mn=t.logger)}Bt.default=yd;yd.wrap=Bt.wrap;yd.massWrap=Bt.massWrap;yd.unwrap=Bt.unwrap;yd.massUnwrap=Bt.massUnwrap});var Mz=E(NE=>{"use strict";Object.defineProperty(NE,"__esModule",{value:!0});NE.InstrumentationAbstract=void 0;var zO=(b(),N(v)),sAe=VO(),IE=WO(),KO=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=zO.diag.createComponentLogger({namespace:e}),this._tracer=zO.trace.getTracer(e,n),this._meter=zO.metrics.getMeter(e,n),this._logger=sAe.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=IE.wrap;_unwrap=IE.unwrap;_massWrap=IE.massWrap;_massUnwrap=IE.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};NE.InstrumentationAbstract=KO});var xz=E(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.ModuleNameTrie=Qs.ModuleNameSeparator=void 0;Qs.ModuleNameSeparator="/";var OE=class{hooks=[];children=new Map},QO=class{_trie=new OE;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(Qs.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new OE,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(Qs.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};Qs.ModuleNameTrie=QO});var Lz=E(bE=>{"use strict";Object.defineProperty(bE,"__esModule",{value:!0});bE.RequireInTheMiddleSingleton=void 0;var iAe=Pi(),vz=U("path"),XO=xz(),aAe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),JO=class t{_moduleNameTrie=new XO.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new iAe.Hook(null,{internals:!0},(e,n,r)=>{let o=cAe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return aAe?new t:this._instance=this._instance??new t}};bE.RequireInTheMiddleSingleton=JO;function cAe(t){return vz.sep!==XO.ModuleNameSeparator?t.split(vz.sep).join(XO.ModuleNameSeparator):t}});var ZO=E(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.isWrapped=Xs.safeExecuteInTheMiddleAsync=Xs.safeExecuteInTheMiddle=void 0;function uAe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Xs.safeExecuteInTheMiddle=uAe;async function lAe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Xs.safeExecuteInTheMiddleAsync=lAe;function pAe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}Xs.isWrapped=pAe});var wz=E(CE=>{"use strict";Object.defineProperty(CE,"__esModule",{value:!0});CE.InstrumentationBase=void 0;var Id=U("path"),Dz=U("util"),dAe=Pz(),eb=WO(),_Ae=Mz(),fAe=Lz(),mAe=DN(),Nd=(b(),N(v)),TAe=Pi(),hAe=U("fs"),EAe=ZO(),tb=class extends _Ae.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=fAe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,EAe.isWrapped)(e[n])&&this._unwrap(e,n),Dz.types.isProxy(e)){let o=(0,eb.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,eb.wrap)(e,n,r)};_unwrap=(e,n)=>Dz.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,eb.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Nd.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Nd.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Nd.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Nd.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=U.resolve(n);U.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,hAe.readFileSync)(Id.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Nd.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return Uz(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=Id.normalize(r);return i.filter(l=>l.name===a).filter(l=>Uz(l.supportedVersions,s,e.includePrerelease)).reduce((l,p)=>(p.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&Id.isAbsolute(a)){let l=Id.parse(a);a=l.name,c=l.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=Id.isAbsolute(e.name)?new TAe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new mAe.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};CE.InstrumentationBase=tb;function Uz(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,dAe.satisfies)(e,r,{includePrerelease:n}))}});var kz=E(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});PE.normalize=void 0;var SAe=U("path");Object.defineProperty(PE,"normalize",{enumerable:!0,get:function(){return SAe.normalize}})});var Gz=E(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.normalize=wu.InstrumentationBase=void 0;var gAe=wz();Object.defineProperty(wu,"InstrumentationBase",{enumerable:!0,get:function(){return gAe.InstrumentationBase}});var AAe=kz();Object.defineProperty(wu,"normalize",{enumerable:!0,get:function(){return AAe.normalize}})});var nb=E(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.normalize=ku.InstrumentationBase=void 0;var Bz=Gz();Object.defineProperty(ku,"InstrumentationBase",{enumerable:!0,get:function(){return Bz.InstrumentationBase}});Object.defineProperty(ku,"normalize",{enumerable:!0,get:function(){return Bz.normalize}})});var jz=E(ME=>{"use strict";Object.defineProperty(ME,"__esModule",{value:!0});ME.InstrumentationNodeModuleDefinition=void 0;var rb=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};ME.InstrumentationNodeModuleDefinition=rb});var Hz=E(xE=>{"use strict";Object.defineProperty(xE,"__esModule",{value:!0});xE.InstrumentationNodeModuleFile=void 0;var RAe=nb(),ob=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,RAe.normalize)(e)}};xE.InstrumentationNodeModuleFile=ob});var Vz=E(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.semconvStabilityFromStr=_a.SemconvStability=void 0;var vE;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(vE=_a.SemconvStability||(_a.SemconvStability={}));function yAe(t,e){let n=vE.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=vE.DUPLICATE;break}else o.toLowerCase()===t&&(n=vE.STABLE);return n}_a.semconvStabilityFromStr=yAe});var qz=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.semconvStabilityFromStr=ut.SemconvStability=ut.safeExecuteInTheMiddleAsync=ut.safeExecuteInTheMiddle=ut.isWrapped=ut.InstrumentationNodeModuleFile=ut.InstrumentationNodeModuleDefinition=ut.InstrumentationBase=ut.registerInstrumentations=void 0;var IAe=gz();Object.defineProperty(ut,"registerInstrumentations",{enumerable:!0,get:function(){return IAe.registerInstrumentations}});var NAe=nb();Object.defineProperty(ut,"InstrumentationBase",{enumerable:!0,get:function(){return NAe.InstrumentationBase}});var OAe=jz();Object.defineProperty(ut,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return OAe.InstrumentationNodeModuleDefinition}});var bAe=Hz();Object.defineProperty(ut,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return bAe.InstrumentationNodeModuleFile}});var sb=ZO();Object.defineProperty(ut,"isWrapped",{enumerable:!0,get:function(){return sb.isWrapped}});Object.defineProperty(ut,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return sb.safeExecuteInTheMiddle}});Object.defineProperty(ut,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return sb.safeExecuteInTheMiddleAsync}});var Fz=Vz();Object.defineProperty(ut,"SemconvStability",{enumerable:!0,get:function(){return Fz.SemconvStability}});Object.defineProperty(ut,"semconvStabilityFromStr",{enumerable:!0,get:function(){return Fz.semconvStabilityFromStr}})});var eK=E(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.PACKAGE_NAME=Bu.PACKAGE_VERSION=void 0;Bu.PACKAGE_VERSION="0.60.0";Bu.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var ub=E(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.HapiLifecycleMethodNames=lo.HapiLayerType=lo.handlerPatched=lo.HapiComponentName=void 0;lo.HapiComponentName="@hapi/hapi";lo.handlerPatched=Symbol("hapi-handler-patched");lo.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};lo.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var tK=E(DE=>{"use strict";Object.defineProperty(DE,"__esModule",{value:!0});DE.ATTR_HTTP_METHOD=void 0;DE.ATTR_HTTP_METHOD="http.method"});var lb=E(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.AttributeNames=void 0;var FAe;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(FAe=Od.AttributeNames||(Od.AttributeNames={}))});var oK=E(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.getPluginFromInput=lt.getExtMetadata=lt.getRouteMetadata=lt.isPatchableExtMethod=lt.isDirectExtInput=lt.isLifecycleExtEventObj=lt.isLifecycleExtType=lt.getPluginName=void 0;var nK=(le(),N(Ae)),qAe=tK(),bd=ub(),Js=lb(),rK=ne();function $Ae(t){return t.name?t.name:t.pkg.name}lt.getPluginName=$Ae;var YAe=t=>typeof t=="string"&&bd.HapiLifecycleMethodNames.has(t);lt.isLifecycleExtType=YAe;var WAe=t=>{let e=t?.type;return e!==void 0&&(0,lt.isLifecycleExtType)(e)};lt.isLifecycleExtEventObj=WAe;var zAe=t=>Array.isArray(t)&&t.length<=3&&(0,lt.isLifecycleExtType)(t[0])&&typeof t[1]=="function";lt.isDirectExtInput=zAe;var KAe=t=>!Array.isArray(t);lt.isPatchableExtMethod=KAe;var QAe=(t,e,n)=>{let r={[nK.ATTR_HTTP_ROUTE]:t.path};e&rK.SemconvStability.OLD&&(r[qAe.ATTR_HTTP_METHOD]=t.method),e&rK.SemconvStability.STABLE&&(r[nK.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[Js.AttributeNames.HAPI_TYPE]=bd.HapiLayerType.PLUGIN,r[Js.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[Js.AttributeNames.HAPI_TYPE]=bd.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};lt.getRouteMetadata=QAe;var XAe=(t,e,n)=>{let r=`ext - ${t}`;return n&&n!=="method"&&(r=`ext - ${t} - ${n}`),e?{attributes:{[Js.AttributeNames.EXT_TYPE]:t,[Js.AttributeNames.HAPI_TYPE]:bd.HapiLayerType.EXT,[Js.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ${r}`}:{attributes:{[Js.AttributeNames.EXT_TYPE]:t,[Js.AttributeNames.HAPI_TYPE]:bd.HapiLayerType.EXT},name:r}};lt.getExtMetadata=XAe;var JAe=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;lt.getPluginFromInput=JAe});var aK=E(UE=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0});UE.HapiInstrumentation=void 0;var $n=(b(),N(v)),sK=he(),Cd=ne(),iK=eK(),Pd=ub(),Wo=oK(),pb=class extends Cd.InstrumentationBase{_semconvStability;constructor(e={}){super(iK.PACKAGE_NAME,iK.PACKAGE_VERSION,e),this._semconvStability=(0,Cd.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Cd.InstrumentationNodeModuleDefinition(Pd.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Cd.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Cd.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Wo.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Wo.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,Wo.isLifecycleExtType)(c.type)){let l=c,p=r._wrapExtMethods(l.method,c.type,n);l.method=p,i[a]=l}}return e.apply(this,s)}else if((0,Wo.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,Wo.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Wo.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",l=>n._getServerRoutePatch.bind(n)(l,r)),s._wrap(a,"ext",l=>n._getServerExtPatch.bind(n)(l,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Wo.isPatchableExtMethod)(e))return e[Pd.handlerPatched]===!0?e:(e[Pd.handlerPatched]=!0,async function(...i){if($n.trace.getSpan($n.context.active())===void 0)return await e.apply(this,i);let a=(0,Wo.getExtMetadata)(n,r,e.name),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await $n.context.with($n.trace.setSpan($n.context.active(),c),e,void 0,...i)}catch(l){throw c.recordException(l),c.setStatus({code:$n.SpanStatusCode.ERROR,message:l.message}),l}finally{c.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[Pd.handlerPatched]===!0)return e;e[Pd.handlerPatched]=!0;let o=s=>async function(...i){if($n.trace.getSpan($n.context.active())===void 0)return await s.call(this,...i);let a=(0,sK.getRPCMetadata)($n.context.active());a?.type===sK.RPCType.HTTP&&(a.route=e.path);let c=(0,Wo.getRouteMetadata)(e,r._semconvStability,n),l=r.tracer.startSpan(c.name,{attributes:c.attributes});try{return await $n.context.with($n.trace.setSpan($n.context.active(),l),()=>s.call(this,...i))}catch(p){throw l.recordException(p),l.setStatus({code:$n.SpanStatusCode.ERROR,message:p.message}),p}finally{l.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};UE.HapiInstrumentation=pb});var cK=E(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.AttributeNames=ju.HapiInstrumentation=void 0;var ZAe=aK();Object.defineProperty(ju,"HapiInstrumentation",{enumerable:!0,get:function(){return ZAe.HapiInstrumentation}});var eRe=lb();Object.defineProperty(ju,"AttributeNames",{enumerable:!0,get:function(){return eRe.AttributeNames}})});var GE=E(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.KoaLayerType=void 0;var iRe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(iRe=xd.KoaLayerType||(xd.KoaLayerType={}))});var TK=E(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.PACKAGE_NAME=Hu.PACKAGE_VERSION=void 0;Hu.PACKAGE_VERSION="0.62.0";Hu.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var db=E(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.AttributeNames=void 0;var aRe;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(aRe=vd.AttributeNames||(vd.AttributeNames={}))});var EK=E(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.isLayerIgnored=Vu.getMiddlewareMetadata=void 0;var hK=GE(),BE=db(),cRe=(le(),N(Ae)),uRe=(t,e,n,r)=>n?{attributes:{[BE.AttributeNames.KOA_NAME]:r?.toString(),[BE.AttributeNames.KOA_TYPE]:hK.KoaLayerType.ROUTER,[cRe.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[BE.AttributeNames.KOA_NAME]:e.name??"middleware",[BE.AttributeNames.KOA_TYPE]:hK.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};Vu.getMiddlewareMetadata=uRe;var lRe=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));Vu.isLayerIgnored=lRe});var SK=E(jE=>{"use strict";Object.defineProperty(jE,"__esModule",{value:!0});jE.kLayerPatched=void 0;jE.kLayerPatched=Symbol("koa-layer-patched")});var NK=E(HE=>{"use strict";Object.defineProperty(HE,"__esModule",{value:!0});HE.KoaInstrumentation=void 0;var po=(b(),N(v)),Ld=ne(),gK=GE(),AK=TK(),RK=EK(),yK=he(),IK=SK(),_b=class extends Ld.InstrumentationBase{constructor(e={}){super(AK.PACKAGE_NAME,AK.PACKAGE_VERSION,e)}init(){return new Ld.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Ld.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Ld.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){po.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let c=i[a];i[a]=this._patchLayer(c,!0,s)}}return e}_patchLayer(e,n,r){let o=n?gK.KoaLayerType.ROUTER:gK.KoaLayerType.MIDDLEWARE;return e[IK.kLayerPatched]===!0||(0,RK.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(po.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[IK.kLayerPatched]=!0,po.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(po.trace.getSpan(po.context.active())===void 0)return e(s,i);let c=(0,RK.getMiddlewareMetadata)(s,e,n,r),l=this.tracer.startSpan(c.name,{attributes:c.attributes}),p=(0,yK.getRPCMetadata)(po.context.active());p?.type===yK.RPCType.HTTP&&s._matchedRoute&&(p.route=s._matchedRoute.toString());let{requestHook:d}=this.getConfig();d&&(0,Ld.safeExecuteInTheMiddle)(()=>d(l,{context:s,middlewareLayer:e,layerType:o}),f=>{f&&po.diag.error("koa instrumentation: request hook failed",f)},!0);let _=po.trace.setSpan(po.context.active(),l);return po.context.with(_,async()=>{try{return await e(s,i)}catch(f){throw l.recordException(f),f}finally{l.end()}})})}};HE.KoaInstrumentation=_b});var OK=E(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.KoaLayerType=ei.AttributeNames=ei.KoaInstrumentation=void 0;var pRe=NK();Object.defineProperty(ei,"KoaInstrumentation",{enumerable:!0,get:function(){return pRe.KoaInstrumentation}});var dRe=db();Object.defineProperty(ei,"AttributeNames",{enumerable:!0,get:function(){return dRe.AttributeNames}});var _Re=GE();Object.defineProperty(ei,"KoaLayerType",{enumerable:!0,get:function(){return _Re.KoaLayerType}})});var fb=E(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ConnectNames=Dr.ConnectTypes=Dr.AttributeNames=void 0;var mRe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(mRe=Dr.AttributeNames||(Dr.AttributeNames={}));var TRe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(TRe=Dr.ConnectTypes||(Dr.ConnectTypes={}));var hRe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(hRe=Dr.ConnectNames||(Dr.ConnectNames={}))});var xK=E(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.PACKAGE_NAME=Fu.PACKAGE_VERSION=void 0;Fu.PACKAGE_VERSION="0.57.0";Fu.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var vK=E(VE=>{"use strict";Object.defineProperty(VE,"__esModule",{value:!0});VE._LAYERS_STORE_PROPERTY=void 0;VE._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var LK=E(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.generateRoute=ni.replaceCurrentStackRoute=ni.addNewStackLayer=void 0;var ERe=(b(),N(v)),ti=vK(),SRe=t=>{Array.isArray(t[ti._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,ti._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[ti._LAYERS_STORE_PROPERTY].push("/");let e=t[ti._LAYERS_STORE_PROPERTY].length;return()=>{e===t[ti._LAYERS_STORE_PROPERTY].length?t[ti._LAYERS_STORE_PROPERTY].pop():ERe.diag.warn("Connect: Trying to pop the stack multiple time")}};ni.addNewStackLayer=SRe;var gRe=(t,e)=>{e&&t[ti._LAYERS_STORE_PROPERTY].splice(-1,1,e)};ni.replaceCurrentStackRoute=gRe;var ARe=t=>t[ti._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);ni.generateRoute=ARe});var wK=E(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.ConnectInstrumentation=ri.ANONYMOUS_NAME=void 0;var RRe=(b(),N(v)),DK=he(),qu=fb(),UK=xK(),FE=ne(),yRe=(le(),N(Ae)),mb=LK();ri.ANONYMOUS_NAME="anonymous";var Tb=class extends FE.InstrumentationBase{constructor(e={}){super(UK.PACKAGE_NAME,UK.PACKAGE_VERSION,e)}init(){return[new FE.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,FE.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,FE.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=qu.ConnectTypes.REQUEST_HANDLER,s=qu.ConnectNames.REQUEST_HANDLER,o=e):(r=qu.ConnectTypes.MIDDLEWARE,s=qu.ConnectNames.MIDDLEWARE,o=n.name||ri.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[yRe.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[qu.AttributeNames.CONNECT_TYPE]:r,[qu.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],l=arguments[i],p=arguments[a],d=arguments[c];(0,mb.replaceCurrentStackRoute)(l,e);let _=(0,DK.getRPCMetadata)(RRe.context.active());e&&_?.type===DK.RPCType.HTTP&&(_.route=(0,mb.generateRoute)(l));let f="";e?f=`request handler - ${e}`:f=`middleware - ${n.name||ri.ANONYMOUS_NAME}`;let m=r._startSpan(e,n);r._diag.debug("start span",f);let T=!1;function h(){T?r._diag.debug(`span ${m.name} - already finished`):(T=!0,r._diag.debug(`finishing span ${m.name}`),m.end()),p.removeListener("close",h)}return p.addListener("close",h),arguments[c]=r._patchNext(d,h),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,mb.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};ri.ConnectInstrumentation=Tb});var GK=E(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ConnectTypes=fr.ConnectNames=fr.AttributeNames=fr.ANONYMOUS_NAME=fr.ConnectInstrumentation=void 0;var kK=wK();Object.defineProperty(fr,"ConnectInstrumentation",{enumerable:!0,get:function(){return kK.ConnectInstrumentation}});Object.defineProperty(fr,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return kK.ANONYMOUS_NAME}});var hb=fb();Object.defineProperty(fr,"AttributeNames",{enumerable:!0,get:function(){return hb.AttributeNames}});Object.defineProperty(fr,"ConnectNames",{enumerable:!0,get:function(){return hb.ConnectNames}});Object.defineProperty(fr,"ConnectTypes",{enumerable:!0,get:function(){return hb.ConnectTypes}})});var FK=E(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.DB_SYSTEM_VALUE_MSSQL=Pt.ATTR_NET_PEER_PORT=Pt.ATTR_NET_PEER_NAME=Pt.ATTR_DB_USER=Pt.ATTR_DB_SYSTEM=Pt.ATTR_DB_STATEMENT=Pt.ATTR_DB_SQL_TABLE=Pt.ATTR_DB_NAME=void 0;Pt.ATTR_DB_NAME="db.name";Pt.ATTR_DB_SQL_TABLE="db.sql.table";Pt.ATTR_DB_STATEMENT="db.statement";Pt.ATTR_DB_SYSTEM="db.system";Pt.ATTR_DB_USER="db.user";Pt.ATTR_NET_PEER_NAME="net.peer.name";Pt.ATTR_NET_PEER_PORT="net.peer.port";Pt.DB_SYSTEM_VALUE_MSSQL="mssql"});var qK=E($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.once=$u.getSpanName=void 0;function NRe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}$u.getSpanName=NRe;var ORe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};$u.once=ORe});var $K=E(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.PACKAGE_NAME=Yu.PACKAGE_VERSION=void 0;Yu.PACKAGE_VERSION="0.33.0";Yu.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var QK=E(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.TediousInstrumentation=si.INJECTED_CTX=void 0;var Wu=(b(),N(v)),bRe=U("events"),_o=ne(),fa=(le(),N(Ae)),oi=FK(),YK=qK(),WK=$K(),KK=Symbol("opentelemetry.instrumentation-tedious.current-database");si.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var zK=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function qE(t){Object.defineProperty(this,KK,{value:t,writable:!0})}var Eb=class t extends _o.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(WK.PACKAGE_NAME,WK.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,_o.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,_o.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new _o.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of zK)(0,_o.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,_o.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of zK)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return qE.call(this,this.config?.options?.database),this.removeListener("databaseChange",qE),this.on("databaseChange",qE),this.once("end",()=>{this.removeListener("databaseChange",qE)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Wu.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,c=>{o()});Object.defineProperty(i,si.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[si.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof bRe.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,c=0,l=()=>c++,p=()=>a++,d=this[KK],_=(x=>x.sqlTextOrProcedure==="sp_prepare"&&x.parametersByName?.stmt?.value?x.parametersByName.stmt.value:x.sqlTextOrProcedure)(i),f={};o._dbSemconvStability&_o.SemconvStability.OLD&&(f[oi.ATTR_DB_SYSTEM]=oi.DB_SYSTEM_VALUE_MSSQL,f[oi.ATTR_DB_NAME]=d,f[oi.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,f[oi.ATTR_DB_STATEMENT]=_,f[oi.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&_o.SemconvStability.STABLE&&(f[fa.ATTR_DB_NAMESPACE]=d,f[fa.ATTR_DB_SYSTEM_NAME]=fa.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,f[fa.ATTR_DB_QUERY_TEXT]=_,f[fa.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&_o.SemconvStability.OLD&&(f[oi.ATTR_NET_PEER_NAME]=this.config?.server,f[oi.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&_o.SemconvStability.STABLE&&(f[fa.ATTR_SERVER_ADDRESS]=this.config?.server,f[fa.ATTR_SERVER_PORT]=this.config?.options?.port);let m=o.tracer.startSpan((0,YK.getSpanName)(e,d,_,i.table),{kind:Wu.SpanKind.CLIENT,attributes:f}),T=(0,YK.once)(x=>{i.removeListener("done",l),i.removeListener("doneInProc",l),i.removeListener("doneProc",p),i.removeListener("error",T),this.removeListener("end",T),m.setAttribute("tedious.procedure_count",a),m.setAttribute("tedious.statement_count",c),x&&m.setStatus({code:Wu.SpanStatusCode.ERROR,message:x.message}),m.end()});i.on("done",l),i.on("doneInProc",l),i.on("doneProc",p),i.once("error",T),this.on("end",T),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(T)):o._diag.error("Expected request.callback to be a function");let h=()=>Wu.context.with(Wu.trace.setSpan(Wu.context.active(),m),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return h();let I=o._buildTraceparent(m);o._injectContextInfo(this,n,I).finally(h)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};si.TediousInstrumentation=Eb});var XK=E($E=>{"use strict";Object.defineProperty($E,"__esModule",{value:!0});$E.TediousInstrumentation=void 0;var CRe=QK();Object.defineProperty($E,"TediousInstrumentation",{enumerable:!0,get:function(){return CRe.TediousInstrumentation}})});var n2=E(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.PACKAGE_NAME=zu.PACKAGE_VERSION=void 0;zu.PACKAGE_VERSION="0.57.0";zu.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var o2=E(YE=>{"use strict";Object.defineProperty(YE,"__esModule",{value:!0});YE.GenericPoolInstrumentation=void 0;var Ku=(b(),N(v)),ma=ne(),r2=n2(),Sb="generic-pool",gb=class extends ma.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(r2.PACKAGE_NAME,r2.PACKAGE_VERSION,e)}init(){return[new ma.InstrumentationNodeModuleDefinition(Sb,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,ma.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new ma.InstrumentationNodeModuleDefinition(Sb,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,ma.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new ma.InstrumentationNodeModuleDefinition(Sb,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,ma.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=Ku.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return Ku.context.with(Ku.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=Ku.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return Ku.context.with(Ku.trace.setSpan(i,a),()=>{e.call(this,(c,l)=>{if(a.end(),o)return o(c,l)},s)})}}};YE.GenericPoolInstrumentation=gb});var s2=E(WE=>{"use strict";Object.defineProperty(WE,"__esModule",{value:!0});WE.GenericPoolInstrumentation=void 0;var xRe=o2();Object.defineProperty(WE,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return xRe.GenericPoolInstrumentation}})});var Ab=E(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ATTR_NET_PEER_PORT=fo.ATTR_NET_PEER_NAME=fo.ATTR_MESSAGING_SYSTEM=fo.ATTR_MESSAGING_OPERATION=void 0;fo.ATTR_MESSAGING_OPERATION="messaging.operation";fo.ATTR_MESSAGING_SYSTEM="messaging.system";fo.ATTR_NET_PEER_NAME="net.peer.name";fo.ATTR_NET_PEER_PORT="net.peer.port"});var Rb=E(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.ATTR_MESSAGING_CONVERSATION_ID=qe.OLD_ATTR_MESSAGING_MESSAGE_ID=qe.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=qe.ATTR_MESSAGING_URL=qe.ATTR_MESSAGING_PROTOCOL_VERSION=qe.ATTR_MESSAGING_PROTOCOL=qe.MESSAGING_OPERATION_VALUE_PROCESS=qe.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=qe.ATTR_MESSAGING_DESTINATION_KIND=qe.ATTR_MESSAGING_DESTINATION=void 0;qe.ATTR_MESSAGING_DESTINATION="messaging.destination";qe.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";qe.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";qe.MESSAGING_OPERATION_VALUE_PROCESS="process";qe.ATTR_MESSAGING_PROTOCOL="messaging.protocol";qe.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";qe.ATTR_MESSAGING_URL="messaging.url";qe.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";qe.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";qe.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var yb=E(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.DEFAULT_CONFIG=Ta.EndOperation=void 0;var LRe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(LRe=Ta.EndOperation||(Ta.EndOperation={}));Ta.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var _2=E($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.isConfirmChannelTracing=$e.unmarkConfirmChannelTracing=$e.markConfirmChannelTracing=$e.getConnectionAttributesFromUrl=$e.getConnectionAttributesFromServer=$e.normalizeExchange=$e.CONNECTION_ATTRIBUTES=$e.CHANNEL_CONSUME_TIMEOUT_TIMER=$e.CHANNEL_SPANS_NOT_ENDED=$e.MESSAGE_STORED_SPAN=void 0;var Ib=(b(),N(v)),ii=ne(),zE=(le(),N(Ae)),Dd=Ab(),KE=Rb();$e.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");$e.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");$e.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");$e.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var Nb=(0,Ib.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),DRe=t=>t!==""?t:"<default>";$e.normalizeExchange=DRe;var URe=t=>t.replace(/:[^:@/]*@/,":***@"),l2=(t,e)=>t||(e==="AMQP"?5672:5671),p2=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},d2=t=>t||"localhost",mo=(t,e,n,r)=>n?{[e]:n}:(Ib.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),wRe=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[Dd.ATTR_MESSAGING_SYSTEM]:e}:{}};$e.getConnectionAttributesFromServer=wRe;var kRe=(t,e)=>{let n={[KE.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=p2(r?.protocol);Object.assign(n,{...mo(t,KE.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=d2(r?.hostname);e&ii.SemconvStability.OLD&&Object.assign(n,{...mo(t,Dd.ATTR_NET_PEER_NAME,s,"hostname")}),e&ii.SemconvStability.STABLE&&Object.assign(n,{...mo(t,zE.ATTR_SERVER_ADDRESS,s,"hostname")});let i=l2(r.port,o);e&ii.SemconvStability.OLD&&Object.assign(n,mo(t,Dd.ATTR_NET_PEER_PORT,i,"port")),e&ii.SemconvStability.STABLE&&Object.assign(n,mo(t,zE.ATTR_SERVER_PORT,i,"port"))}else{let r=URe(t);n[KE.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=p2(o.protocol);Object.assign(n,{...mo(r,KE.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=d2(o.hostname);e&ii.SemconvStability.OLD&&Object.assign(n,{...mo(r,Dd.ATTR_NET_PEER_NAME,i,"hostname")}),e&ii.SemconvStability.STABLE&&Object.assign(n,{...mo(r,zE.ATTR_SERVER_ADDRESS,i,"hostname")});let a=l2(o.port?parseInt(o.port):void 0,s);e&ii.SemconvStability.OLD&&Object.assign(n,mo(r,Dd.ATTR_NET_PEER_PORT,a,"port")),e&ii.SemconvStability.STABLE&&Object.assign(n,mo(r,zE.ATTR_SERVER_PORT,a,"port"))}catch(o){Ib.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};$e.getConnectionAttributesFromUrl=kRe;var GRe=t=>t.setValue(Nb,!0);$e.markConfirmChannelTracing=GRe;var BRe=t=>t.deleteValue(Nb);$e.unmarkConfirmChannelTracing=BRe;var jRe=t=>t.getValue(Nb)===!0;$e.isConfirmChannelTracing=jRe});var f2=E(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.PACKAGE_NAME=Qu.PACKAGE_VERSION=void 0;Qu.PACKAGE_VERSION="0.61.0";Qu.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var T2=E(JE=>{"use strict";Object.defineProperty(JE,"__esModule",{value:!0});JE.AmqplibInstrumentation=void 0;var Ge=(b(),N(v)),QE=he(),Ee=ne(),HRe=Ab(),Yn=Rb(),Tn=yb(),Ye=_2(),m2=f2(),XE=[">=0.5.5 <1"],Ob=class extends Ee.InstrumentationBase{_netSemconvStability;constructor(e={}){super(m2.PACKAGE_NAME,m2.PACKAGE_VERSION,{...Tn.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ee.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...Tn.DEFAULT_CONFIG,...e})}init(){let e=new Ee.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",XE,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Ee.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",XE,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Ee.InstrumentationNodeModuleFile("amqplib/lib/connect.js",XE,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Ee.InstrumentationNodeModuleDefinition("amqplib",XE,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,Ee.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,Ee.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,Ee.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Ee.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Ee.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,Tn.EndOperation.Ack)),(0,Ee.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,Tn.EndOperation.Nack)),(0,Ee.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,Tn.EndOperation.Reject)),(0,Ee.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,Tn.EndOperation.AckAll)),(0,Ee.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,Tn.EndOperation.NackAll)),(0,Ee.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Ee.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,Ee.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,Ee.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,Ee.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,Ee.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,Ee.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,Ee.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,Ee.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,Ee.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,Ee.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,c){if(a==null){let l=(0,Ye.getConnectionAttributesFromUrl)(o,n._netSemconvStability),p=(0,Ye.getConnectionAttributesFromServer)(c);c[Ye.CONNECTION_ATTRIBUTES]={...l,...p}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,Tn.EndOperation.ChannelClosed,void 0);let s=this[Ye.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[Ye.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,Tn.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){let l=this,p=n===Tn.EndOperation.Reject?a:c,d=l[Ye.CHANNEL_SPANS_NOT_ENDED]??[],_=d.findIndex(f=>f.msg===i);if(_<0)o.endConsumerSpan(i,e,n,p);else if(n!==Tn.EndOperation.Reject&&a){for(let f=0;f<=_;f++)o.endConsumerSpan(d[f].msg,e,n,p);d.splice(0,_+1)}else o.endConsumerSpan(i,e,n,p),d.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,Ye.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:p}=r.getConfig();if(p){let d=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},p);d.unref(),c[Ye.CHANNEL_CONSUME_TIMEOUT_TIMER]=d}c[Ye.CHANNEL_SPANS_NOT_ENDED]=[]}let l=function(p){if(!p)return i.call(this,p);let d=p.properties.headers??{},_=Ge.propagation.extract(Ge.ROOT_CONTEXT,d),f=p.fields?.exchange,m;if(r._config.useLinksForConsume){let R=_?Ge.trace.getSpan(_)?.spanContext():void 0;_=void 0,R&&(m=[{context:R}])}let T=r.tracer.startSpan(`${s} process`,{kind:Ge.SpanKind.CONSUMER,attributes:{...c?.connection?.[Ye.CONNECTION_ATTRIBUTES],[Yn.ATTR_MESSAGING_DESTINATION]:f,[Yn.ATTR_MESSAGING_DESTINATION_KIND]:Yn.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Yn.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:p.fields?.routingKey,[HRe.ATTR_MESSAGING_OPERATION]:Yn.MESSAGING_OPERATION_VALUE_PROCESS,[Yn.OLD_ATTR_MESSAGING_MESSAGE_ID]:p?.properties.messageId,[Yn.ATTR_MESSAGING_CONVERSATION_ID]:p?.properties.correlationId},links:m},_),{consumeHook:h}=r.getConfig();h&&(0,Ee.safeExecuteInTheMiddle)(()=>h(T,{moduleVersion:e,msg:p}),R=>{R&&Ge.diag.error("amqplib instrumentation: consumerHook error",R)},!0),a?.noAck||(c[Ye.CHANNEL_SPANS_NOT_ENDED].push({msg:p,timeOfConsume:(0,QE.hrTime)()}),p[Ye.MESSAGE_STORED_SPAN]=T);let S=_||Ge.ROOT_CONTEXT;Ge.context.with(Ge.trace.setSpan(S,T),()=>{i.call(this,p)}),a?.noAck&&(r.callConsumeEndHook(T,p,!1,Tn.EndOperation.AutoAck),T.end())};return arguments[1]=l,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,l){let p=this,{span:d,modifiedOptions:_}=r.createPublishSpan(r,s,i,p,c),{publishHook:f}=r.getConfig();f&&(0,Ee.safeExecuteInTheMiddle)(()=>f(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:_,isConfirmChannel:!0}),S=>{S&&Ge.diag.error("amqplib instrumentation: publishHook error",S)},!0);let m=function(S,R){try{l?.call(this,S,R)}finally{let{publishConfirmHook:I}=r.getConfig();I&&(0,Ee.safeExecuteInTheMiddle)(()=>I(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:S}),x=>{x&&Ge.diag.error("amqplib instrumentation: publishConfirmHook error",x)},!0),S&&d.setStatus({code:Ge.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),d.end()}},T=(0,Ye.markConfirmChannelTracing)(Ge.context.active()),h=[...arguments];return h[3]=_,h[4]=Ge.context.bind((0,Ye.unmarkConfirmChannelTracing)(Ge.trace.setSpan(T,d)),m),Ge.context.with(T,n.bind(this,...h))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,Ye.isConfirmChannelTracing)(Ge.context.active()))return n.apply(this,arguments);{let l=this,{span:p,modifiedOptions:d}=r.createPublishSpan(r,s,i,l,c),{publishHook:_}=r.getConfig();_&&(0,Ee.safeExecuteInTheMiddle)(()=>_(p,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:d,isConfirmChannel:!1}),T=>{T&&Ge.diag.error("amqplib instrumentation: publishHook error",T)},!0);let f=[...arguments];f[3]=d;let m=n.apply(this,f);return p.end(),m}}}createPublishSpan(e,n,r,o,s){let i=(0,Ye.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:Ge.SpanKind.PRODUCER,attributes:{...o.connection[Ye.CONNECTION_ATTRIBUTES],[Yn.ATTR_MESSAGING_DESTINATION]:n,[Yn.ATTR_MESSAGING_DESTINATION_KIND]:Yn.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Yn.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[Yn.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[Yn.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),c=s??{};return c.headers=c.headers??{},Ge.propagation.inject(Ge.trace.setSpan(Ge.context.active(),a),c.headers),{span:a,modifiedOptions:c}}endConsumerSpan(e,n,r,o){let s=e[Ye.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:Ge.SpanStatusCode.ERROR,message:r!==Tn.EndOperation.ChannelClosed&&r!==Tn.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[Ye.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[Ye.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[Ye.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,Ee.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&Ge.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,QE.hrTime)(),r=e[Ye.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,QE.hrTimeDuration)(i.timeOfConsume,n);if((0,QE.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,Tn.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};JE.AmqplibInstrumentation=Ob});var E2=E(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.EndOperation=ai.DEFAULT_CONFIG=ai.AmqplibInstrumentation=void 0;var VRe=T2();Object.defineProperty(ai,"AmqplibInstrumentation",{enumerable:!0,get:function(){return VRe.AmqplibInstrumentation}});var h2=yb();Object.defineProperty(ai,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return h2.DEFAULT_CONFIG}});Object.defineProperty(ai,"EndOperation",{enumerable:!0,get:function(){return h2.EndOperation}})});b();var EF=K(Vk(),1);var C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var J=globalThis;var pe="10.47.0";function sn(){return us(J),J}function us(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||pe,e[pe]=e[pe]||{}}function Ar(t,e,n=J){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[pe]=r[pe]||{};return o[t]||(o[t]=e())}var Ul=["debug","info","warn","error","log","assert","trace"],Vse="Sentry Logger ",cc={};function Qe(t){if(!("console"in J))return t();let e=J.console,n={},r=Object.keys(cc);r.forEach(o=>{let s=cc[o];n[o]=e[o],e[o]=s});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function Fse(){XA().enabled=!0}function qse(){XA().enabled=!1}function Fk(){return XA().enabled}function $se(...t){QA("log",...t)}function Yse(...t){QA("warn",...t)}function Wse(...t){QA("error",...t)}function QA(t,...e){C&&Fk()&&Qe(()=>{J.console[t](`${Vse}[${t}]:`,...e)})}function XA(){return C?Ar("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var g={enable:Fse,disable:qse,isEnabled:Fk,log:$se,warn:Yse,error:Wse};var Tf="?",qk=/\(error: (.*)\)/,$k=/captureMessage|captureException/;function hf(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
12
- `);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let l=qk.test(c)?c.replace(qk,"$1"):c;if(!l.match(/\S*Error: /)){for(let p of e){let d=p(l);if(d){s.push(d);break}}if(s.length>=50+o)break}}return Yk(s.slice(o))}}function ZA(t){return Array.isArray(t)?hf(...t):t}function Yk(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(mf(e).function||"")&&e.pop(),e.reverse(),$k.test(mf(e).function||"")&&(e.pop(),$k.test(mf(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||mf(e).filename,function:n.function||Tf}))}function mf(t){return t[t.length-1]||{}}var JA="<anonymous>";function wl(t){try{return!t||typeof t!="function"?JA:t.name||JA}catch{return JA}}function Ef(t){return"__v_isVNode"in t&&t.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function Wk(t){let e=t?.startsWith("file://")?t.slice(7):t;return e?.match(/\/[A-Z]:/)&&(e=e.slice(1)),e}var Sf={},zk={};function uc(t,e){Sf[t]=Sf[t]||[],Sf[t].push(e)}function lc(t,e){if(!zk[t]){zk[t]=!0;try{e()}catch(n){C&&g.error(`Error while instrumenting ${t}`,n)}}}function pc(t,e){let n=t&&Sf[t];if(n)for(let r of n)try{r(e)}catch(o){C&&g.error(`Error while triggering instrumentation handler.
5
+ `+s),t.push(o+"m+"+ff.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Cse()+e+" "+t[0]}function Cse(){return At.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Pse(...t){return process.stderr.write(_f.formatWithOptions(At.inspectOpts,...t)+`
6
+ `)}function Mse(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function xse(){return process.env.DEBUG}function vse(t){t.inspectOpts={};let e=Object.keys(At.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=At.inspectOpts[e[n]]}ff.exports=WA()(At);var{formatters:Lk}=ff.exports;Lk.o=function(t){return this.inspectOpts.colors=this.useColors,_f.inspect(t,this.inspectOpts).split(`
7
+ `).map(e=>e.trim()).join(" ")};Lk.O=function(t){return this.inspectOpts.colors=this.useColors,_f.inspect(t,this.inspectOpts)}});var Uk=E((q0e,QA)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?QA.exports=bk():QA.exports=Dk()});var mf=E(($0e,wk)=>{"use strict";var XA=U("path").sep;wk.exports=function(t){var e=t.split(XA),n=e.lastIndexOf("node_modules");if(n!==-1&&e[n+1]){for(var r=e[n+1][0]==="@",o=r?e[n+1]+"/"+e[n+2]:e[n+1],s=r?3:2,i="",a=n+s-1,c=0;c<=a;c++)c===a?i+=e[c]:i+=e[c]+XA;for(var l="",p=e.length-1,d=n+s;d<=p;d++)d===p?l+=e[d]:l+=e[d]+XA;return{name:o,basedir:i,path:l}}}});var wi=E((Y0e,eR)=>{"use strict";var lc=U("path"),yr=U("module"),ze=Uk()("require-in-the-middle"),Lse=mf();eR.exports=Ul;eR.exports.Hook=Ul;var JA,hf;if(yr.isBuiltin)hf=yr.isBuiltin;else if(yr.builtinModules)hf=t=>t.startsWith("node:")?!0:(JA===void 0&&(JA=new Set(yr.builtinModules)),JA.has(t));else throw new Error("'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0");var Dse=/([/\\]index)?(\.js)?$/,ZA=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,n){if(this._localCache.has(e))return!0;if(n)return!1;{let r=U.cache[e];return!!(r&&this._kRitmExports in r)}}get(e,n){let r=this._localCache.get(e);if(r!==void 0)return r;if(!n){let o=U.cache[e];return o&&o[this._kRitmExports]}}set(e,n,r){r?this._localCache.set(e,n):e in U.cache?U.cache[e][this._kRitmExports]=n:(ze('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,n))}};function Ul(t,e,n){if(!(this instanceof Ul))return new Ul(t,e,n);if(typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null),typeof yr._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof yr._resolveFilename),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);return}this._cache=new ZA,this._unhooked=!1,this._origRequire=yr.prototype.require;let r=this,o=new Set,s=e?e.internals===!0:!1,i=Array.isArray(t);ze("registering require hook"),this._require=yr.prototype.require=function(c){return r._unhooked===!0?(ze("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(c){return r._unhooked===!0?(ze("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)});function a(c,l){let p=c[0],d=hf(p),_;if(d){if(_=p,p.startsWith("node:")){let R=p.slice(5);hf(R)&&(_=R)}}else{if(l)return ze("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,c);try{_=yr._resolveFilename(p,this)}catch(R){return ze('Module._resolveFilename("%s") threw %j, calling original Module.require',p,R.message),r._origRequire.apply(this,c)}}let f,m;if(ze("processing %s module require('%s'): %s",d===!0?"core":"non-core",p,_),r._cache.has(_,d)===!0)return ze("returning already patched cached module: %s",_),r._cache.get(_,d);let h=o.has(_);h===!1&&o.add(_);let T=l?r._origGetBuiltinModule.apply(this,c):r._origRequire.apply(this,c);if(h===!0)return ze("module is in the process of being patched already - ignoring: %s",_),T;if(o.delete(_),d===!0){if(i===!0&&t.includes(_)===!1)return ze("ignoring core module not on whitelist: %s",_),T;f=_}else if(i===!0&&t.includes(_)){let R=lc.parse(_);f=R.name,m=R.dir}else{let R=Lse(_);if(R===void 0)return ze("could not parse filename: %s",_),T;f=R.name,m=R.basedir;let I=Use(R);ze("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",f,p,I,m);let x=!1;if(i){if(!p.startsWith(".")&&t.includes(p)&&(f=p,x=!0),!t.includes(f)&&!t.includes(I))return T;t.includes(I)&&I!==f&&(f=I,x=!0)}if(!x){let F;try{F=U.resolve(f,{paths:[m]})}catch{return ze("could not resolve module: %s",f),r._cache.set(_,T,d),T}if(F!==_)if(s===!0)f=f+lc.sep+lc.relative(m,_),ze("preparing to process require of internal file: %s",f);else return ze("ignoring require of non-main module file: %s",F),r._cache.set(_,T,d),T}}r._cache.set(_,T,d),ze("calling require hook: %s",f);let S=n(T,f,m);return r._cache.set(_,S,d),ze("returning module: %s",f),S}}Ul.prototype.unhook=function(){this._unhooked=!0,this._require===yr.prototype.require?(yr.prototype.require=this._origRequire,ze("require unhook successful")):ze("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,ze("process.getBuiltinModule unhook successful")):ze("process.getBuiltinModule unhook unsuccessful"))};function Use(t){let e=lc.sep!=="/"?t.path.split(lc.sep).join("/"):t.path;return lc.posix.join(t.name,e).replace(Dse,"")}});var kk=E(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.ModuleNameTrie=ls.ModuleNameSeparator=void 0;ls.ModuleNameSeparator="/";var Tf=class{hooks=[];children=new Map},tR=class{_trie=new Tf;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(ls.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new Tf,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(ls.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};ls.ModuleNameTrie=tR});var Bk=E(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.RequireInTheMiddleSingleton=void 0;var wse=wi(),Gk=U("path"),nR=kk(),kse=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),rR=class t{_moduleNameTrie=new nR.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new wse.Hook(null,{internals:!0},(e,n,r)=>{let o=Gse(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return kse?new t:this._instance=this._instance??new t}};Ef.RequireInTheMiddleSingleton=rR;function Gse(t){return Gk.sep!==nR.ModuleNameSeparator?t.split(Gk.sep).join(nR.ModuleNameSeparator):t}});var qk=E(wl=>{var jk=[],oR=new WeakMap,Hk=new WeakMap,Fk=new Map,Vk=[],Bse={set(t,e,n){let r=oR.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=Hk.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=oR.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function jse(t,e,n,r,o){Fk.set(t,o),oR.set(e,n),Hk.set(e,r);let s=new Proxy(e,Bse);jk.forEach(i=>i(t,s,o)),Vk.push([t,s,o])}wl.register=jse;wl.importHooks=jk;wl.specifiers=Fk;wl.toHook=Vk});var cR=E((X0e,dc)=>{var $k=U("path"),Hse=mf(),{fileURLToPath:Fse}=U("url"),{MessageChannel:Vse}=U("worker_threads"),{isBuiltin:sR}=U("module");sR||(sR=()=>!0);var{importHooks:iR,specifiers:qse,toHook:$se}=qk();function Yk(t){iR.push(t),$se.forEach(([e,n,r])=>t(e,n,r))}function Wk(t){let e=iR.indexOf(t);e>-1&&iR.splice(e,1)}function pc(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var aR;function Yse(){let{port1:t,port2:e}=new Vse,n=0,r;aR=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(l=>{r=l}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function kl(t,e,n){if(!(this instanceof kl))return new kl(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;aR&&Array.isArray(t)&&aR(t),this._iitmHook=(o,s,i)=>{let a=o,c=a.startsWith("node:"),l,p;if(c){let d=o.slice(5);sR(d)&&(o=d)}else if(a.startsWith("file://")){let d=Error.stackTraceLimit;Error.stackTraceLimit=0;try{l=Fse(o),o=l}catch{}if(Error.stackTraceLimit=d,l){let _=Hse(l);_&&(o=_.name,p=_.basedir)}}if(t)for(let d of t)if(l&&d===l)pc(n,s,l,void 0);else if(d===o){if(!p)pc(n,s,o,p);else if(p.endsWith(qse.get(a)))pc(n,s,o,p);else if(r){let _=o+$k.sep+$k.relative(p,l);pc(n,s,_,p)}}else d===i&&pc(n,s,i,p);else pc(n,s,o,p)},Yk(this._iitmHook)}kl.prototype.unhook=function(){Wk(this._iitmHook)};dc.exports=kl;dc.exports.Hook=kl;dc.exports.addHook=Yk;dc.exports.removeHook=Wk;dc.exports.createAddHookMessageChannel=Yse});var uR=E(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.isWrapped=ps.safeExecuteInTheMiddleAsync=ps.safeExecuteInTheMiddle=void 0;function Wse(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}ps.safeExecuteInTheMiddle=Wse;async function zse(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(await e(r,o),r&&!n)throw r;return o}}ps.safeExecuteInTheMiddleAsync=zse;function Kse(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}ps.isWrapped=Kse});var Qk=E(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.InstrumentationBase=void 0;var Gl=U("path"),zk=U("util"),Qse=Rk(),lR=qA(),Xse=yk(),Jse=Bk(),Zse=cR(),Bl=(b(),O(v)),eie=wi(),tie=U("fs"),nie=uR(),pR=class extends Xse.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=Jse.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,nie.isWrapped)(e[n])&&this._unwrap(e,n),zk.types.isProxy(e)){let o=(0,lR.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,lR.wrap)(e,n,r)};_unwrap=(e,n)=>zk.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,lR.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Bl.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Bl.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Bl.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Bl.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){let e=globalThis.require;!e?.resolve||!e?.cache||this._modules.forEach(n=>{let{name:r}=n;try{let o=e.resolve(r);e.cache[o]?.loaded&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,tie.readFileSync)(Gl.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Bl.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return Kk(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=Gl.normalize(r);return i.filter(l=>l.name===a&&Kk(l.supportedVersions,s,e.includePrerelease)).reduce((l,p)=>(p.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&Gl.isAbsolute(a)){let l=Gl.parse(a);a=l.name,c=l.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=Gl.isAbsolute(e.name)?new eie.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new Zse.Hook([e.name],{internals:!0},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};Sf.InstrumentationBase=pR;function Kk(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,Qse.satisfies)(e,r,{includePrerelease:n}))}});var Xk=E(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.normalize=void 0;var rie=U("path");Object.defineProperty(gf,"normalize",{enumerable:!0,get:function(){return rie.normalize}})});var Jk=E(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.normalize=_c.InstrumentationBase=void 0;var oie=Qk();Object.defineProperty(_c,"InstrumentationBase",{enumerable:!0,get:function(){return oie.InstrumentationBase}});var sie=Xk();Object.defineProperty(_c,"normalize",{enumerable:!0,get:function(){return sie.normalize}})});var dR=E(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.normalize=fc.InstrumentationBase=void 0;var Zk=Jk();Object.defineProperty(fc,"InstrumentationBase",{enumerable:!0,get:function(){return Zk.InstrumentationBase}});Object.defineProperty(fc,"normalize",{enumerable:!0,get:function(){return Zk.normalize}})});var eG=E(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.InstrumentationNodeModuleDefinition=void 0;var _R=class{files;name;supportedVersions;patch;unpatch;constructor(e,n,r,o,s){this.files=s||[],this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o}};Af.InstrumentationNodeModuleDefinition=_R});var tG=E(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.InstrumentationNodeModuleFile=void 0;var iie=dR(),fR=class{name;supportedVersions;patch;unpatch;constructor(e,n,r,o){this.name=(0,iie.normalize)(e),this.supportedVersions=n,this.patch=r,this.unpatch=o}};Rf.InstrumentationNodeModuleFile=fR});var nG=E(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.semconvStabilityFromStr=ki.SemconvStability=void 0;var yf;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(yf=ki.SemconvStability||(ki.SemconvStability={}));function aie(t,e){let n=yf.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=yf.DUPLICATE;break}else o.toLowerCase()===t&&(n=yf.STABLE);return n}ki.semconvStabilityFromStr=aie});var ne=E(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.semconvStabilityFromStr=tt.SemconvStability=tt.safeExecuteInTheMiddleAsync=tt.safeExecuteInTheMiddle=tt.isWrapped=tt.InstrumentationNodeModuleFile=tt.InstrumentationNodeModuleDefinition=tt.InstrumentationBase=tt.registerInstrumentations=void 0;var cie=_k();Object.defineProperty(tt,"registerInstrumentations",{enumerable:!0,get:function(){return cie.registerInstrumentations}});var uie=dR();Object.defineProperty(tt,"InstrumentationBase",{enumerable:!0,get:function(){return uie.InstrumentationBase}});var lie=eG();Object.defineProperty(tt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return lie.InstrumentationNodeModuleDefinition}});var pie=tG();Object.defineProperty(tt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return pie.InstrumentationNodeModuleFile}});var mR=uR();Object.defineProperty(tt,"isWrapped",{enumerable:!0,get:function(){return mR.isWrapped}});Object.defineProperty(tt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return mR.safeExecuteInTheMiddle}});Object.defineProperty(tt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return mR.safeExecuteInTheMiddleAsync}});var rG=nG();Object.defineProperty(tt,"SemconvStability",{enumerable:!0,get:function(){return rG.SemconvStability}});Object.defineProperty(tt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return rG.semconvStabilityFromStr}})});var oG=E(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.HTTP_FLAVOR_VALUE_HTTP_1_1=q.NET_TRANSPORT_VALUE_IP_UDP=q.NET_TRANSPORT_VALUE_IP_TCP=q.ATTR_NET_TRANSPORT=q.ATTR_NET_PEER_PORT=q.ATTR_NET_PEER_NAME=q.ATTR_NET_PEER_IP=q.ATTR_NET_HOST_PORT=q.ATTR_NET_HOST_NAME=q.ATTR_NET_HOST_IP=q.ATTR_HTTP_USER_AGENT=q.ATTR_HTTP_URL=q.ATTR_HTTP_TARGET=q.ATTR_HTTP_STATUS_CODE=q.ATTR_HTTP_SERVER_NAME=q.ATTR_HTTP_SCHEME=q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=q.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=q.ATTR_HTTP_REQUEST_CONTENT_LENGTH=q.ATTR_HTTP_METHOD=q.ATTR_HTTP_HOST=q.ATTR_HTTP_FLAVOR=q.ATTR_HTTP_CLIENT_IP=q.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST=q.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT=q.ATTR_USER_AGENT_SYNTHETIC_TYPE=void 0;q.ATTR_USER_AGENT_SYNTHETIC_TYPE="user_agent.synthetic.type";q.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT="bot";q.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST="test";q.ATTR_HTTP_CLIENT_IP="http.client_ip";q.ATTR_HTTP_FLAVOR="http.flavor";q.ATTR_HTTP_HOST="http.host";q.ATTR_HTTP_METHOD="http.method";q.ATTR_HTTP_REQUEST_CONTENT_LENGTH="http.request_content_length";q.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";q.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED="http.response_content_length_uncompressed";q.ATTR_HTTP_SCHEME="http.scheme";q.ATTR_HTTP_SERVER_NAME="http.server_name";q.ATTR_HTTP_STATUS_CODE="http.status_code";q.ATTR_HTTP_TARGET="http.target";q.ATTR_HTTP_URL="http.url";q.ATTR_HTTP_USER_AGENT="http.user_agent";q.ATTR_NET_HOST_IP="net.host.ip";q.ATTR_NET_HOST_NAME="net.host.name";q.ATTR_NET_HOST_PORT="net.host.port";q.ATTR_NET_PEER_IP="net.peer.ip";q.ATTR_NET_PEER_NAME="net.peer.name";q.ATTR_NET_PEER_PORT="net.peer.port";q.ATTR_NET_TRANSPORT="net.transport";q.NET_TRANSPORT_VALUE_IP_TCP="ip_tcp";q.NET_TRANSPORT_VALUE_IP_UDP="ip_udp";q.HTTP_FLAVOR_VALUE_HTTP_1_1="1.1"});var sG=E(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.AttributeNames=void 0;var die;(function(t){t.HTTP_ERROR_NAME="http.error_name",t.HTTP_ERROR_MESSAGE="http.error_message",t.HTTP_STATUS_TEXT="http.status_text"})(die=jl.AttributeNames||(jl.AttributeNames={}))});var hR=E(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.DEFAULT_QUERY_STRINGS_TO_REDACT=zr.STR_REDACTED=zr.SYNTHETIC_BOT_NAMES=zr.SYNTHETIC_TEST_NAMES=void 0;zr.SYNTHETIC_TEST_NAMES=["alwayson"];zr.SYNTHETIC_BOT_NAMES=["googlebot","bingbot"];zr.STR_REDACTED="REDACTED";zr.DEFAULT_QUERY_STRINGS_TO_REDACT=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"]});var aG=E((lDe,iG)=>{"use strict";var _ie=U("util");function TR(t,e){Error.captureStackTrace(this,TR),this.name=this.constructor.name,this.message=t,this.input=e}_ie.inherits(TR,Error);iG.exports=TR});var uG=E((pDe,cG)=>{"use strict";function fie(t){return t===34||t===40||t===41||t===44||t===47||t>=58&&t<=64||t>=91&&t<=93||t===123||t===125}function mie(t){return t===33||t>=35&&t<=39||t===42||t===43||t===45||t===46||t>=48&&t<=57||t>=65&&t<=90||t>=94&&t<=122||t===124||t===126}function hie(t){return t>=32&&t<=126}function Tie(t){return t>=128&&t<=255}cG.exports={isDelimiter:fie,isTokenChar:mie,isExtended:Tie,isPrint:hie}});var fG=E((dDe,_G)=>{"use strict";var Eie=U("util"),mc=aG(),If=uG(),Sie=If.isDelimiter,lG=If.isTokenChar,pG=If.isExtended,gie=If.isPrint;function dG(t){return t.replace(/\\(.)/g,"$1")}function Hl(t,e){return Eie.format("Unexpected character '%s' at index %d",t.charAt(e),e)}function Aie(t){for(var e=!1,n=!1,r=!1,o={},s=[],i=-1,a=-1,c,l,p=0;p<t.length;p++)if(l=t.charCodeAt(p),c===void 0){if(p!==0&&i===-1&&(l===32||l===9))continue;if(lG(l))i===-1&&(i=p);else if(l===61&&i!==-1)c=t.slice(i,p).toLowerCase(),i=-1;else throw new mc(Hl(t,p),t)}else if(n&&(l===9||gie(l)||pG(l)))n=!1;else if(lG(l)){if(a!==-1)throw new mc(Hl(t,p),t);i===-1&&(i=p)}else if(Sie(l)||pG(l))if(r)l===34?(r=!1,a=p):l===92?(i===-1&&(i=p),n=e=!0):i===-1&&(i=p);else if(l===34&&t.charCodeAt(p-1)===61)r=!0;else if((l===44||l===59)&&(i!==-1||a!==-1))i!==-1?(a===-1&&(a=p),o[c]=e?dG(t.slice(i,a)):t.slice(i,a)):o[c]="",l===44&&(s.push(o),o={}),c=void 0,i=a=-1;else throw new mc(Hl(t,p),t);else if(l===32||l===9){if(a!==-1)continue;if(r)i===-1&&(i=p);else if(i!==-1)a=p;else throw new mc(Hl(t,p),t)}else throw new mc(Hl(t,p),t);if(c===void 0||r||i===-1&&a===-1||l===32||l===9)throw new mc("Unexpected end of input",t);return i!==-1?(a===-1&&(a=p),o[c]=e?dG(t.slice(i,a)):t.slice(i,a)):o[c]="",s.push(o),s}_G.exports=Aie});var yG=E($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.headerCapture=$.getIncomingStableRequestMetricAttributesOnResponse=$.getIncomingRequestMetricAttributesOnResponse=$.getIncomingRequestAttributesOnResponse=$.getIncomingRequestMetricAttributes=$.getIncomingRequestAttributes=$.getRemoteClientAddress=$.getOutgoingStableRequestMetricAttributesOnResponse=$.getOutgoingRequestMetricAttributesOnResponse=$.getOutgoingRequestAttributesOnResponse=$.setAttributesFromHttpKind=$.getOutgoingRequestMetricAttributes=$.getOutgoingRequestAttributes=$.extractHostnameAndPort=$.isValidOptionsType=$.getRequestInfo=$.isCompressed=$.setResponseContentLengthAttribute=$.setRequestContentLengthAttribute=$.setSpanWithError=$.satisfiesPattern=$.parseResponseStatus=$.getAbsoluteUrl=void 0;var Fl=(b(),O(v)),ae=(le(),O(Ae)),V=oG(),mG=Te(),kn=ne(),Rie=U("url"),Nf=sG(),hG=hR(),Of=hR(),yie=fG(),Iie=(t,e,n="http:",r=Array.from(Of.DEFAULT_QUERY_STRINGS_TO_REDACT))=>{let o=t||{},s=o.protocol||n,i=(o.port||"").toString(),a=o.path||"/",c=o.host||o.hostname||e.host||"localhost";if(c.indexOf(":")===-1&&i&&i!=="80"&&i!=="443"&&(c+=`:${i}`),a.includes("?"))try{let p=new URL(a,"http://localhost"),d=r||[];for(let _ of d)p.searchParams.get(_)&&p.searchParams.set(_,Of.STR_REDACTED);a=`${p.pathname}${p.search}`}catch{}let l=o.auth?`${Of.STR_REDACTED}:${Of.STR_REDACTED}@`:"";return`${s}//${l}${c}${a}`};$.getAbsoluteUrl=Iie;var Oie=(t,e)=>{let n=t===Fl.SpanKind.CLIENT?400:500;return e&&e>=100&&e<n?Fl.SpanStatusCode.UNSET:Fl.SpanStatusCode.ERROR};$.parseResponseStatus=Oie;var Nie=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")};$.satisfiesPattern=Nie;var bie=(t,e,n)=>{let r=e.message;n&kn.SemconvStability.OLD&&(t.setAttribute(Nf.AttributeNames.HTTP_ERROR_NAME,e.name),t.setAttribute(Nf.AttributeNames.HTTP_ERROR_MESSAGE,r)),n&kn.SemconvStability.STABLE&&t.setAttribute(ae.ATTR_ERROR_TYPE,e.name),t.setStatus({code:Fl.SpanStatusCode.ERROR,message:r}),t.recordException(e)};$.setSpanWithError=bie;var Cie=(t,e)=>{let n=EG(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[V.ATTR_HTTP_REQUEST_CONTENT_LENGTH]=n:e[V.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setRequestContentLengthAttribute=Cie;var Pie=(t,e)=>{let n=EG(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[V.ATTR_HTTP_RESPONSE_CONTENT_LENGTH]=n:e[V.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setResponseContentLengthAttribute=Pie;function EG(t){let e=t["content-length"];if(e===void 0)return null;let n=parseInt(e,10);return isNaN(n)?null:n}var Mie=t=>{let e=t["content-encoding"];return!!e&&e!=="identity"};$.isCompressed=Mie;function xie(t){let{hostname:e,pathname:n,port:r,username:o,password:s,search:i,protocol:a,hash:c,href:l,origin:p,host:d}=new URL(t),_={protocol:a,hostname:e&&e[0]==="["?e.slice(1,-1):e,hash:c,search:i,pathname:n,path:`${n||""}${i||""}`,href:l,origin:p,host:d};return r!==""&&(_.port=Number(r)),(o||s)&&(_.auth=`${decodeURIComponent(o)}:${decodeURIComponent(s)}`),_}var vie=(t,e,n)=>{let r,o,s,i=!1;if(typeof e=="string"){try{let c=xie(e);s=c,r=c.pathname||"/"}catch(c){i=!0,t.verbose("Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:",c),s={path:e},r=s.path||"/"}o=`${s.protocol||"http:"}//${s.host}`,n!==void 0&&Object.assign(s,n)}else if(e instanceof Rie.URL)s={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,path:`${e.pathname||""}${e.search||""}`},e.port!==""&&(s.port=Number(e.port)),(e.username||e.password)&&(s.auth=`${e.username}:${e.password}`),r=e.pathname,o=e.origin,n!==void 0&&Object.assign(s,n);else{s=Object.assign({protocol:e.host?"http:":void 0},e);let c=s.host||(s.port!=null?`${s.hostname}${s.port}`:s.hostname);if(o=`${s.protocol||"http:"}//${c}`,r=e.pathname,!r&&s.path)try{r=new URL(s.path,o).pathname||"/"}catch{r="/"}}let a=s.method?s.method.toUpperCase():"GET";return{origin:o,pathname:r,method:a,optionsParsed:s,invalidUrl:i}};$.getRequestInfo=vie;var Lie=t=>{if(!t)return!1;let e=typeof t;return e==="string"||e==="object"&&!Array.isArray(t)};$.isValidOptionsType=Lie;var Die=t=>{if(t.hostname&&t.port)return{hostname:t.hostname,port:t.port};let e=t.host?.match(/^([^:/ ]+)(:\d{1,5})?/)||null,n=t.hostname||(e===null?"localhost":e[1]),r=t.port;return r||(e&&e[2]?r=e[2].substring(1):r=t.protocol==="https:"?"443":"80"),{hostname:n,port:r}};$.extractHostnameAndPort=Die;var Uie=(t,e,n,r)=>{let o=e.hostname,s=e.port,i=t.method??"GET",a=AG(i),c=t.headers||{},l=c["user-agent"],p=(0,$.getAbsoluteUrl)(t,c,`${e.component}:`,e.redactedQueryParams),d={[V.ATTR_HTTP_URL]:p,[V.ATTR_HTTP_METHOD]:i,[V.ATTR_HTTP_TARGET]:t.path||"/",[V.ATTR_NET_PEER_NAME]:o,[V.ATTR_HTTP_HOST]:c.host??`${o}:${s}`},_={[ae.ATTR_HTTP_REQUEST_METHOD]:a,[ae.ATTR_SERVER_ADDRESS]:o,[ae.ATTR_SERVER_PORT]:Number(s),[ae.ATTR_URL_FULL]:p,[ae.ATTR_USER_AGENT_ORIGINAL]:l};switch(i!==a&&(_[ae.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=i),r&&l&&(_[V.ATTR_USER_AGENT_SYNTHETIC_TYPE]=SG(l)),l!==void 0&&(d[V.ATTR_HTTP_USER_AGENT]=l),n){case kn.SemconvStability.STABLE:return Object.assign(_,e.hookAttributes);case kn.SemconvStability.OLD:return Object.assign(d,e.hookAttributes)}return Object.assign(d,_,e.hookAttributes)};$.getOutgoingRequestAttributes=Uie;var wie=t=>{let e={};return e[V.ATTR_HTTP_METHOD]=t[V.ATTR_HTTP_METHOD],e[V.ATTR_NET_PEER_NAME]=t[V.ATTR_NET_PEER_NAME],e};$.getOutgoingRequestMetricAttributes=wie;var kie=(t,e)=>{t&&(e[V.ATTR_HTTP_FLAVOR]=t,t.toUpperCase()!=="QUIC"?e[V.ATTR_NET_TRANSPORT]=V.NET_TRANSPORT_VALUE_IP_TCP:e[V.ATTR_NET_TRANSPORT]=V.NET_TRANSPORT_VALUE_IP_UDP)};$.setAttributesFromHttpKind=kie;var SG=t=>{let e=String(t).toLowerCase();for(let n of hG.SYNTHETIC_TEST_NAMES)if(e.includes(n))return V.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST;for(let n of hG.SYNTHETIC_BOT_NAMES)if(e.includes(n))return V.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT},Gie=(t,e)=>{let{statusCode:n,statusMessage:r,httpVersion:o,socket:s}=t,i={},a={};if(n!=null&&(a[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]=n),s){let{remoteAddress:c,remotePort:l}=s;i[V.ATTR_NET_PEER_IP]=c,i[V.ATTR_NET_PEER_PORT]=l,a[ae.ATTR_NETWORK_PEER_ADDRESS]=c,a[ae.ATTR_NETWORK_PEER_PORT]=l,a[ae.ATTR_NETWORK_PROTOCOL_VERSION]=t.httpVersion}switch((0,$.setResponseContentLengthAttribute)(t,i),n&&(i[V.ATTR_HTTP_STATUS_CODE]=n,i[Nf.AttributeNames.HTTP_STATUS_TEXT]=(r||"").toUpperCase()),(0,$.setAttributesFromHttpKind)(o,i),e){case kn.SemconvStability.STABLE:return a;case kn.SemconvStability.OLD:return i}return Object.assign(i,a)};$.getOutgoingRequestAttributesOnResponse=Gie;var Bie=t=>{let e={};return e[V.ATTR_NET_PEER_PORT]=t[V.ATTR_NET_PEER_PORT],e[V.ATTR_HTTP_STATUS_CODE]=t[V.ATTR_HTTP_STATUS_CODE],e[V.ATTR_HTTP_FLAVOR]=t[V.ATTR_HTTP_FLAVOR],e};$.getOutgoingRequestMetricAttributesOnResponse=Bie;var jie=t=>{let e={};return t[ae.ATTR_NETWORK_PROTOCOL_VERSION]&&(e[ae.ATTR_NETWORK_PROTOCOL_VERSION]=t[ae.ATTR_NETWORK_PROTOCOL_VERSION]),t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(e[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]=t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]),e};$.getOutgoingStableRequestMetricAttributesOnResponse=jie;function ds(t,e){let n=t.split(":");if(n.length===1)return e==="http"?{host:n[0],port:"80"}:e==="https"?{host:n[0],port:"443"}:{host:n[0]};if(n.length===2)return{host:n[0],port:n[1]};if(n[0].startsWith("[")){if(n[n.length-1].endsWith("]")){if(e==="http")return{host:t,port:"80"};if(e==="https")return{host:t,port:"443"}}else if(n[n.length-2].endsWith("]"))return{host:n.slice(0,-1).join(":"),port:n[n.length-1]}}return{host:t}}function Hie(t,e){let n=t.headers.forwarded;if(n){for(let s of RG(n))if(s.host)return ds(s.host,s.proto)}let r=t.headers["x-forwarded-host"];if(typeof r=="string")return typeof t.headers["x-forwarded-proto"]=="string"?ds(r,t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?ds(r,t.headers["x-forwarded-proto"][0]):ds(r);if(Array.isArray(r)&&typeof r[0]=="string"&&r[0].length>0)return typeof t.headers["x-forwarded-proto"]=="string"?ds(r[0],t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?ds(r[0],t.headers["x-forwarded-proto"][0]):ds(r[0]);let o=t.headers.host;return typeof o=="string"&&o.length>0?ds(o,e):null}function gG(t){let e=t.headers.forwarded;if(e){for(let o of RG(e))if(o.for)return TG(o.for)}let n=t.headers["x-forwarded-for"];if(n){let o;if(typeof n=="string"?o=n:Array.isArray(n)&&(o=n[0]),typeof o=="string")return o=o.split(",")[0].trim(),TG(o)}let r=t.socket.remoteAddress;return r||null}$.getRemoteClientAddress=gG;function TG(t){try{let{hostname:e}=new URL(`http://${t}`);return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}catch{return t}}function Fie(t,e,n){try{if(e.headers.host)return new URL(e.url??"/",`${t}://${e.headers.host}`);{let r=new URL(e.url??"/",`${t}://localhost`);return{pathname:r.pathname,search:r.search,toString:function(){return r.pathname+r.search}}}}catch(r){return n.verbose("Unable to get URL from request",r),{}}}var Vie=(t,e,n)=>{let{component:r,enableSyntheticSourceDetection:o,hookAttributes:s,semconvStability:i,serverName:a}=e,{headers:c,httpVersion:l,method:p}=t,{host:d,"user-agent":_,"x-forwarded-for":f}=c,m=Fie(r,t,n),h,T;if(i!==kn.SemconvStability.OLD){let S=AG(p),R=Hie(t,r),I=gG(t);h={[ae.ATTR_HTTP_REQUEST_METHOD]:S,[ae.ATTR_URL_SCHEME]:r,[ae.ATTR_SERVER_ADDRESS]:R?.host,[ae.ATTR_NETWORK_PEER_ADDRESS]:t.socket.remoteAddress,[ae.ATTR_NETWORK_PEER_PORT]:t.socket.remotePort,[ae.ATTR_NETWORK_PROTOCOL_VERSION]:t.httpVersion,[ae.ATTR_USER_AGENT_ORIGINAL]:_},m.pathname!=null&&(h[ae.ATTR_URL_PATH]=m.pathname),m.search&&(h[ae.ATTR_URL_QUERY]=m.search.slice(1)),I!=null&&(h[ae.ATTR_CLIENT_ADDRESS]=I),R?.port!=null&&(h[ae.ATTR_SERVER_PORT]=Number(R.port)),p!==S&&(h[ae.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=p),o&&_&&(h[V.ATTR_USER_AGENT_SYNTHETIC_TYPE]=SG(_))}if(i!==kn.SemconvStability.STABLE){let S=d?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost";T={[V.ATTR_HTTP_URL]:m.toString(),[V.ATTR_HTTP_HOST]:d,[V.ATTR_NET_HOST_NAME]:S,[V.ATTR_HTTP_METHOD]:p,[V.ATTR_HTTP_SCHEME]:r},typeof f=="string"&&(T[V.ATTR_HTTP_CLIENT_IP]=f.split(",")[0]),typeof a=="string"&&(T[V.ATTR_HTTP_SERVER_NAME]=a),m.pathname&&(T[V.ATTR_HTTP_TARGET]=m.pathname+m.search||"/"),_!==void 0&&(T[V.ATTR_HTTP_USER_AGENT]=_),(0,$.setRequestContentLengthAttribute)(t,T),(0,$.setAttributesFromHttpKind)(l,T)}switch(i){case kn.SemconvStability.STABLE:return Object.assign(h,s);case kn.SemconvStability.OLD:return Object.assign(T,s);default:return Object.assign(T,h,s)}};$.getIncomingRequestAttributes=Vie;var qie=t=>{let e={};return e[V.ATTR_HTTP_SCHEME]=t[V.ATTR_HTTP_SCHEME],e[V.ATTR_HTTP_METHOD]=t[V.ATTR_HTTP_METHOD],e[V.ATTR_NET_HOST_NAME]=t[V.ATTR_NET_HOST_NAME],e[V.ATTR_HTTP_FLAVOR]=t[V.ATTR_HTTP_FLAVOR],e};$.getIncomingRequestMetricAttributes=qie;var $ie=(t,e,n)=>{let{socket:r}=t,{statusCode:o,statusMessage:s}=e,i={[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]:o},a=(0,mG.getRPCMetadata)(Fl.context.active()),c={};if(r){let{localAddress:l,localPort:p,remoteAddress:d,remotePort:_}=r;c[V.ATTR_NET_HOST_IP]=l,c[V.ATTR_NET_HOST_PORT]=p,c[V.ATTR_NET_PEER_IP]=d,c[V.ATTR_NET_PEER_PORT]=_}switch(c[V.ATTR_HTTP_STATUS_CODE]=o,c[Nf.AttributeNames.HTTP_STATUS_TEXT]=(s||"").toUpperCase(),a?.type===mG.RPCType.HTTP&&a.route!==void 0&&(c[ae.ATTR_HTTP_ROUTE]=a.route,i[ae.ATTR_HTTP_ROUTE]=a.route),n){case kn.SemconvStability.STABLE:return i;case kn.SemconvStability.OLD:return c}return Object.assign(c,i)};$.getIncomingRequestAttributesOnResponse=$ie;var Yie=t=>{let e={};return e[V.ATTR_HTTP_STATUS_CODE]=t[V.ATTR_HTTP_STATUS_CODE],e[V.ATTR_NET_HOST_PORT]=t[V.ATTR_NET_HOST_PORT],t[ae.ATTR_HTTP_ROUTE]!==void 0&&(e[ae.ATTR_HTTP_ROUTE]=t[ae.ATTR_HTTP_ROUTE]),e};$.getIncomingRequestMetricAttributesOnResponse=Yie;var Wie=t=>{let e={};return t[ae.ATTR_HTTP_ROUTE]!==void 0&&(e[ae.ATTR_HTTP_ROUTE]=t[ae.ATTR_HTTP_ROUTE]),t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(e[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]=t[ae.ATTR_HTTP_RESPONSE_STATUS_CODE]),e};$.getIncomingStableRequestMetricAttributesOnResponse=Wie;function zie(t,e,n){let r=new Map;for(let o=0,s=e.length;o<s;o++){let i=e[o].toLowerCase();n&kn.SemconvStability.STABLE?r.set(i,i):r.set(i,i.replaceAll("-","_"))}return o=>{let s={};for(let i of r.keys()){let a=o(i);if(a===void 0)continue;let c=r.get(i),l=`http.${t}.header.${c}`;typeof a=="string"?s[l]=[a]:Array.isArray(a)?s[l]=a:s[l]=[a]}return s}}$.headerCapture=zie;var Kie=new Set(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH","QUERY"]);function AG(t){if(t==null)return"GET";let e=t.toUpperCase();return Kie.has(e)?e:"_OTHER"}function RG(t){try{return yie(t)}catch{return[]}}});var IG=E(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.HttpInstrumentation=void 0;var oe=(b(),O(v)),_s=Te(),Qie=U("url"),Xie=nk(),Rt=ne(),ER=U("events"),Le=(le(),O(Ae)),Ke=yG(),SR=class extends Rt.InstrumentationBase{_spanNotEnded=new WeakSet;_headerCapture;_httpPatched=!1;_httpsPatched=!1;_semconvStability=Rt.SemconvStability.OLD;constructor(e={}){super("@opentelemetry/instrumentation-http",Xie.VERSION,e),this._semconvStability=(0,Rt.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._headerCapture=this._createHeaderCapture(this._semconvStability)}_updateMetricInstruments(){this._oldHttpServerDurationHistogram=this.meter.createHistogram("http.server.duration",{description:"Measures the duration of inbound HTTP requests.",unit:"ms",valueType:oe.ValueType.DOUBLE}),this._oldHttpClientDurationHistogram=this.meter.createHistogram("http.client.duration",{description:"Measures the duration of outbound HTTP requests.",unit:"ms",valueType:oe.ValueType.DOUBLE}),this._stableHttpServerDurationHistogram=this.meter.createHistogram(Le.METRIC_HTTP_SERVER_REQUEST_DURATION,{description:"Duration of HTTP server requests.",unit:"s",valueType:oe.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}}),this._stableHttpClientDurationHistogram=this.meter.createHistogram(Le.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:"Duration of HTTP client requests.",unit:"s",valueType:oe.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}_recordServerDuration(e,n,r){this._semconvStability&Rt.SemconvStability.OLD&&this._oldHttpServerDurationHistogram.record(e,n),this._semconvStability&Rt.SemconvStability.STABLE&&this._stableHttpServerDurationHistogram.record(e/1e3,r)}_recordClientDuration(e,n,r){this._semconvStability&Rt.SemconvStability.OLD&&this._oldHttpClientDurationHistogram.record(e,n),this._semconvStability&Rt.SemconvStability.STABLE&&this._stableHttpClientDurationHistogram.record(e/1e3,r)}setConfig(e={}){super.setConfig(e),this._headerCapture=this._createHeaderCapture(this._semconvStability)}init(){return[this._getHttpsInstrumentation(),this._getHttpInstrumentation()]}_getHttpInstrumentation(){return new Rt.InstrumentationNodeModuleDefinition("http",["*"],e=>{if(this._httpPatched)return e;this._httpPatched=!0;let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchOutgoingRequestFunction("http")),o=this._wrap(e,"get",this._getPatchOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("http")),e},e=>{this._httpPatched=!1,e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getHttpsInstrumentation(){return new Rt.InstrumentationNodeModuleDefinition("https",["*"],e=>{if(this._httpsPatched)return e;this._httpsPatched=!0;let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchHttpsOutgoingRequestFunction("https")),o=this._wrap(e,"get",this._getPatchHttpsOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("https")),e},e=>{this._httpsPatched=!1,e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getPatchIncomingRequestFunction(e){return n=>this._incomingRequestFunction(e,n)}_getPatchOutgoingRequestFunction(e){return n=>this._outgoingRequestFunction(e,n)}_getPatchOutgoingGetFunction(e){return n=>function(o,...s){let i=e(o,...s);return i.end(),i}}_getPatchHttpsOutgoingRequestFunction(e){return n=>{let r=this;return function(s,...i){return e==="https"&&typeof s=="object"&&s?.constructor?.name!=="URL"&&(s=Object.assign({},s),r._setDefaultOptions(s)),r._getPatchOutgoingRequestFunction(e)(n)(s,...i)}}}_setDefaultOptions(e){e.protocol=e.protocol||"https:",e.port=e.port||443}_getPatchHttpsOutgoingGetFunction(e){return n=>{let r=this;return function(s,...i){return r._getPatchOutgoingGetFunction(e)(n)(s,...i)}}}_traceClientRequest(e,n,r,o,s){this.getConfig().requestHook&&this._callRequestHook(n,e);let i=!1;return e.prependListener("response",a=>{this._diag.debug("outgoingRequest on response()"),e.listenerCount("response")<=1&&a.resume();let c=(0,Ke.getOutgoingRequestAttributesOnResponse)(a,this._semconvStability);n.setAttributes(c),o=Object.assign(o,(0,Ke.getOutgoingRequestMetricAttributesOnResponse)(c)),s=Object.assign(s,(0,Ke.getOutgoingStableRequestMetricAttributesOnResponse)(c)),this.getConfig().responseHook&&this._callResponseHook(n,a),n.setAttributes(this._headerCapture.client.captureRequestHeaders(p=>e.getHeader(p))),n.setAttributes(this._headerCapture.client.captureResponseHeaders(p=>a.headers[p])),oe.context.bind(oe.context.active(),a);let l=()=>{if(this._diag.debug("outgoingRequest on end()"),i)return;i=!0;let p;a.aborted&&!a.complete?p={code:oe.SpanStatusCode.ERROR}:p={code:(0,Ke.parseResponseStatus)(oe.SpanKind.CLIENT,a.statusCode)},n.setStatus(p),this.getConfig().applyCustomAttributesOnSpan&&(0,Rt.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(n,e,a),()=>{},!0),this._closeHttpSpan(n,oe.SpanKind.CLIENT,r,o,s)};a.on("end",l),a.on(ER.errorMonitor,p=>{this._diag.debug("outgoingRequest on error()",p),!i&&(i=!0,this._onOutgoingRequestError(n,o,s,r,p))})}),e.on("close",()=>{this._diag.debug("outgoingRequest on request close()"),!(e.aborted||i)&&(i=!0,this._closeHttpSpan(n,oe.SpanKind.CLIENT,r,o,s))}),e.on(ER.errorMonitor,a=>{this._diag.debug("outgoingRequest on request error()",a),!i&&(i=!0,this._onOutgoingRequestError(n,o,s,r,a))}),this._diag.debug("http.ClientRequest return request"),e}_incomingRequestFunction(e,n){let r=this;return function(s,...i){if(s!=="request")return n.apply(this,[s,...i]);let a=i[0],c=i[1],l=a.method||"GET";if(r._diag.debug(`${e} instrumentation incomingRequest`),(0,Rt.safeExecuteInTheMiddle)(()=>r.getConfig().ignoreIncomingRequestHook?.(a),I=>{I!=null&&r._diag.error("caught ignoreIncomingRequestHook error: ",I)},!0))return oe.context.with((0,_s.suppressTracing)(oe.context.active()),()=>(oe.context.bind(oe.context.active(),a),oe.context.bind(oe.context.active(),c),n.apply(this,[s,...i])));let p=a.headers,d=(0,Ke.getIncomingRequestAttributes)(a,{component:e,serverName:r.getConfig().serverName,hookAttributes:r._callStartSpanHook(a,r.getConfig().startIncomingSpanHook),semconvStability:r._semconvStability,enableSyntheticSourceDetection:r.getConfig().enableSyntheticSourceDetection||!1},r._diag);Object.assign(d,r._headerCapture.server.captureRequestHeaders(I=>a.headers[I]));let _={kind:oe.SpanKind.SERVER,attributes:d},f=(0,_s.hrTime)(),m=(0,Ke.getIncomingRequestMetricAttributes)(d),h={[Le.ATTR_HTTP_REQUEST_METHOD]:d[Le.ATTR_HTTP_REQUEST_METHOD],[Le.ATTR_URL_SCHEME]:d[Le.ATTR_URL_SCHEME]};d[Le.ATTR_NETWORK_PROTOCOL_VERSION]&&(h[Le.ATTR_NETWORK_PROTOCOL_VERSION]=d[Le.ATTR_NETWORK_PROTOCOL_VERSION]);let T=oe.propagation.extract(oe.ROOT_CONTEXT,p),S=r._startHttpSpan(l,_,T),R={type:_s.RPCType.HTTP,span:S};return oe.context.with((0,_s.setRPCMetadata)(oe.trace.setSpan(T,S),R),()=>{oe.context.bind(oe.context.active(),a),oe.context.bind(oe.context.active(),c),r.getConfig().requestHook&&r._callRequestHook(S,a),r.getConfig().responseHook&&r._callResponseHook(S,c);let I=!1;return c.on("close",()=>{I||r._onServerResponseFinish(a,c,S,m,h,f)}),c.on(ER.errorMonitor,x=>{I=!0,r._onServerResponseError(S,m,h,f,x)}),(0,Rt.safeExecuteInTheMiddle)(()=>n.apply(this,[s,...i]),x=>{if(x)throw r._onServerResponseError(S,m,h,f,x),x})})}}_outgoingRequestFunction(e,n){let r=this;return function(s,...i){if(!(0,Ke.isValidOptionsType)(s))return n.apply(this,[s,...i]);let a=typeof i[0]=="object"&&(typeof s=="string"||s instanceof Qie.URL)?i.shift():void 0,{method:c,invalidUrl:l,optionsParsed:p}=(0,Ke.getRequestInfo)(r._diag,s,a);if((0,Rt.safeExecuteInTheMiddle)(()=>r.getConfig().ignoreOutgoingRequestHook?.(p),F=>{F!=null&&r._diag.error("caught ignoreOutgoingRequestHook error: ",F)},!0))return n.apply(this,[p,...i]);let{hostname:d,port:_}=(0,Ke.extractHostnameAndPort)(p),f=(0,Ke.getOutgoingRequestAttributes)(p,{component:e,port:_,hostname:d,hookAttributes:r._callStartSpanHook(p,r.getConfig().startOutgoingSpanHook),redactedQueryParams:r.getConfig().redactedQueryParams},r._semconvStability,r.getConfig().enableSyntheticSourceDetection||!1),m=(0,_s.hrTime)(),h=(0,Ke.getOutgoingRequestMetricAttributes)(f),T={[Le.ATTR_HTTP_REQUEST_METHOD]:f[Le.ATTR_HTTP_REQUEST_METHOD],[Le.ATTR_SERVER_ADDRESS]:f[Le.ATTR_SERVER_ADDRESS],[Le.ATTR_SERVER_PORT]:f[Le.ATTR_SERVER_PORT]};f[Le.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(T[Le.ATTR_HTTP_RESPONSE_STATUS_CODE]=f[Le.ATTR_HTTP_RESPONSE_STATUS_CODE]),f[Le.ATTR_NETWORK_PROTOCOL_VERSION]&&(T[Le.ATTR_NETWORK_PROTOCOL_VERSION]=f[Le.ATTR_NETWORK_PROTOCOL_VERSION]);let S={kind:oe.SpanKind.CLIENT,attributes:f},R=r._startHttpSpan(c,S),I=oe.context.active(),x=oe.trace.setSpan(I,R);return p.headers?p.headers=Object.assign({},p.headers):p.headers={},oe.propagation.inject(x,p.headers),oe.context.with(x,()=>{let F=i[i.length-1];typeof F=="function"&&(i[i.length-1]=oe.context.bind(I,F));let B=(0,Rt.safeExecuteInTheMiddle)(()=>l?n.apply(this,[s,...i]):n.apply(this,[p,...i]),se=>{if(se)throw r._onOutgoingRequestError(R,h,T,m,se),se});return r._diag.debug(`${e} instrumentation outgoingRequest`),oe.context.bind(I,B),r._traceClientRequest(B,R,m,h,T)})}}_onServerResponseFinish(e,n,r,o,s,i){let a=(0,Ke.getIncomingRequestAttributesOnResponse)(e,n,this._semconvStability);o=Object.assign(o,(0,Ke.getIncomingRequestMetricAttributesOnResponse)(a)),s=Object.assign(s,(0,Ke.getIncomingStableRequestMetricAttributesOnResponse)(a)),r.setAttributes(this._headerCapture.server.captureResponseHeaders(l=>n.getHeader(l))),r.setAttributes(a).setStatus({code:(0,Ke.parseResponseStatus)(oe.SpanKind.SERVER,n.statusCode)});let c=a[Le.ATTR_HTTP_ROUTE];c&&r.updateName(`${e.method||"GET"} ${c}`),this.getConfig().applyCustomAttributesOnSpan&&(0,Rt.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(r,e,n),()=>{},!0),this._closeHttpSpan(r,oe.SpanKind.SERVER,i,o,s)}_onOutgoingRequestError(e,n,r,o,s){(0,Ke.setSpanWithError)(e,s,this._semconvStability),r[Le.ATTR_ERROR_TYPE]=s.name,this._closeHttpSpan(e,oe.SpanKind.CLIENT,o,n,r)}_onServerResponseError(e,n,r,o,s){(0,Ke.setSpanWithError)(e,s,this._semconvStability),r[Le.ATTR_ERROR_TYPE]=s.name,this._closeHttpSpan(e,oe.SpanKind.SERVER,o,n,r)}_startHttpSpan(e,n,r=oe.context.active()){let o=n.kind===oe.SpanKind.CLIENT?this.getConfig().requireParentforOutgoingSpans:this.getConfig().requireParentforIncomingSpans,s,i=oe.trace.getSpan(r);return o===!0&&(!i||!oe.trace.isSpanContextValid(i.spanContext()))?s=oe.trace.wrapSpanContext(oe.INVALID_SPAN_CONTEXT):o===!0&&i?.spanContext().isRemote?s=i:s=this.tracer.startSpan(e,n,r),this._spanNotEnded.add(s),s}_closeHttpSpan(e,n,r,o,s){if(!this._spanNotEnded.has(e))return;e.end(),this._spanNotEnded.delete(e);let i=(0,_s.hrTimeToMilliseconds)((0,_s.hrTimeDuration)(r,(0,_s.hrTime)()));n===oe.SpanKind.SERVER?this._recordServerDuration(i,o,s):n===oe.SpanKind.CLIENT&&this._recordClientDuration(i,o,s)}_callResponseHook(e,n){(0,Rt.safeExecuteInTheMiddle)(()=>this.getConfig().responseHook(e,n),()=>{},!0)}_callRequestHook(e,n){(0,Rt.safeExecuteInTheMiddle)(()=>this.getConfig().requestHook(e,n),()=>{},!0)}_callStartSpanHook(e,n){if(typeof n=="function")return(0,Rt.safeExecuteInTheMiddle)(()=>n(e),()=>{},!0)}_createHeaderCapture(e){let n=this.getConfig();return{client:{captureRequestHeaders:(0,Ke.headerCapture)("request",n.headersToSpanAttributes?.client?.requestHeaders??[],e),captureResponseHeaders:(0,Ke.headerCapture)("response",n.headersToSpanAttributes?.client?.responseHeaders??[],e)},server:{captureRequestHeaders:(0,Ke.headerCapture)("request",n.headersToSpanAttributes?.server?.requestHeaders??[],e),captureResponseHeaders:(0,Ke.headerCapture)("response",n.headersToSpanAttributes?.server?.responseHeaders??[],e)}}}};bf.HttpInstrumentation=SR});var OG=E(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.HttpInstrumentation=void 0;var Jie=IG();Object.defineProperty(Cf,"HttpInstrumentation",{enumerable:!0,get:function(){return Jie.HttpInstrumentation}})});var EI=E(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});jm.AbstractAsyncHooksContextManager=void 0;var Lpe=U("events"),Dpe=["addListener","on","once","prependListener","prependOnceListener"],TI=class{bind(e,n){return n instanceof Lpe.EventEmitter?this._bindEventEmitter(e,n):typeof n=="function"?this._bindFunction(e,n):n}_bindFunction(e,n){let r=this,o=function(...s){return r.with(e,()=>n.apply(this,s))};return Object.defineProperty(o,"length",{enumerable:!1,configurable:!0,writable:!1,value:n.length}),o}_bindEventEmitter(e,n){return this._getPatchMap(n)!==void 0||(this._createPatchMap(n),Dpe.forEach(o=>{n[o]!==void 0&&(n[o]=this._patchAddListener(n,n[o],e))}),typeof n.removeListener=="function"&&(n.removeListener=this._patchRemoveListener(n,n.removeListener)),typeof n.off=="function"&&(n.off=this._patchRemoveListener(n,n.off)),typeof n.removeAllListeners=="function"&&(n.removeAllListeners=this._patchRemoveAllListeners(n,n.removeAllListeners))),n}_patchRemoveListener(e,n){let r=this;return function(o,s){let i=r._getPatchMap(e)?.[o];if(i===void 0)return n.call(this,o,s);let a=i.get(s);return n.call(this,o,a||s)}}_patchRemoveAllListeners(e,n){let r=this;return function(o){let s=r._getPatchMap(e);return s!==void 0&&(arguments.length===0?r._createPatchMap(e):s[o]!==void 0&&delete s[o]),n.apply(this,arguments)}}_patchAddListener(e,n,r){let o=this;return function(s,i){if(o._wrapped)return n.call(this,s,i);let a=o._getPatchMap(e);a===void 0&&(a=o._createPatchMap(e));let c=a[s];c===void 0&&(c=new WeakMap,a[s]=c);let l=o.bind(r,i);c.set(i,l),o._wrapped=!0;try{return n.call(this,s,l)}finally{o._wrapped=!1}}}_createPatchMap(e){let n=Object.create(null);return e[this._kOtListeners]=n,n}_getPatchMap(e){return e[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1};jm.AbstractAsyncHooksContextManager=TI});var PH=E(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.AsyncHooksContextManager=void 0;var Upe=(b(),O(v)),wpe=U("async_hooks"),kpe=EI(),SI=class extends kpe.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super(),this._asyncHook=wpe.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??Upe.ROOT_CONTEXT}with(e,n,r,...o){this._enterContext(e);try{return n.call(r,...o)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,n){if(n==="TIMERWRAP")return;let r=this._stack[this._stack.length-1];r!==void 0&&this._contexts.set(e,r)}_destroy(e){this._contexts.delete(e)}_before(e){let n=this._contexts.get(e);n!==void 0&&this._enterContext(n)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};Hm.AsyncHooksContextManager=SI});var MH=E(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.AsyncLocalStorageContextManager=void 0;var Gpe=(b(),O(v)),Bpe=U("async_hooks"),jpe=EI(),gI=class extends jpe.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super(),this._asyncLocalStorage=new Bpe.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??Gpe.ROOT_CONTEXT}with(e,n,r,...o){let s=r==null?n:n.bind(r);return this._asyncLocalStorage.run(e,s,...o)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};Fm.AsyncLocalStorageContextManager=gI});var xH=E(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.AsyncLocalStorageContextManager=Kc.AsyncHooksContextManager=void 0;var Hpe=PH();Object.defineProperty(Kc,"AsyncHooksContextManager",{enumerable:!0,get:function(){return Hpe.AsyncHooksContextManager}});var Fpe=MH();Object.defineProperty(Kc,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return Fpe.AsyncLocalStorageContextManager}})});var AI=E(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc._clearDefaultServiceNameCache=Qc.defaultServiceName=void 0;var Mp;function Vpe(){if(Mp===void 0)try{let t=globalThis.process.argv0;Mp=t?`unknown_service:${t}`:"unknown_service"}catch{Mp="unknown_service"}return Mp}Qc.defaultServiceName=Vpe;function qpe(){Mp=void 0}Qc._clearDefaultServiceNameCache=qpe});var vH=E(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.isPromiseLike=void 0;var $pe=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";Vm.isPromiseLike=$pe});var II=E(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.defaultResource=to.emptyResource=to.resourceFromDetectedResource=to.resourceFromAttributes=void 0;var vp=(b(),O(v)),RI=Te(),sa=(le(),O(Ae)),Ype=AI(),xp=vH(),qm=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,n){let r=new t({},n);return r._rawAttributes=LH(e),r._asyncAttributesPending=e.filter(([o,s])=>(0,xp.isPromiseLike)(s)).length>0,r}constructor(e,n){let r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([o,s])=>((0,xp.isPromiseLike)(s)&&(this._asyncAttributesPending=!0),[o,s])),this._rawAttributes=LH(this._rawAttributes),this._schemaUrl=Qpe(n?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[n,r]=this._rawAttributes[e];this._rawAttributes[e]=[n,(0,xp.isPromiseLike)(r)?await r:r]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&vp.diag.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[n,r]of this._rawAttributes){if((0,xp.isPromiseLike)(r)){vp.diag.debug(`Unsettled resource attribute ${n} skipped`);continue}r!=null&&(e[n]??=r)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(e==null)return this;let n=Xpe(this,e),r=n?{schemaUrl:n}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],r)}};function yI(t,e){return qm.FromAttributeList(Object.entries(t),e)}to.resourceFromAttributes=yI;function Wpe(t,e){return new qm(t,e)}to.resourceFromDetectedResource=Wpe;function zpe(){return yI({})}to.emptyResource=zpe;function Kpe(){return yI({[sa.ATTR_SERVICE_NAME]:(0,Ype.defaultServiceName)(),[sa.ATTR_TELEMETRY_SDK_LANGUAGE]:RI.SDK_INFO[sa.ATTR_TELEMETRY_SDK_LANGUAGE],[sa.ATTR_TELEMETRY_SDK_NAME]:RI.SDK_INFO[sa.ATTR_TELEMETRY_SDK_NAME],[sa.ATTR_TELEMETRY_SDK_VERSION]:RI.SDK_INFO[sa.ATTR_TELEMETRY_SDK_VERSION]})}to.defaultResource=Kpe;function LH(t){return t.map(([e,n])=>(0,xp.isPromiseLike)(n)?[e,n.catch(r=>{vp.diag.debug("promise rejection for resource attribute: %s - %s",e,r)})]:[e,n])}function Qpe(t){if(typeof t=="string"||t===void 0)return t;vp.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function Xpe(t,e){let n=t?.schemaUrl,r=e?.schemaUrl,o=n===void 0||n==="",s=r===void 0||r==="";if(o)return r;if(s||n===r)return n;vp.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',n,r)}});var UH=E($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.detectResources=void 0;var DH=(b(),O(v)),OI=II(),Jpe=(t={})=>(t.detectors||[]).map(n=>{try{let r=(0,OI.resourceFromDetectedResource)(n.detect(t));return DH.diag.debug(`${n.constructor.name} found resource.`,r),r}catch(r){return DH.diag.debug(`${n.constructor.name} failed: ${r.message}`),(0,OI.emptyResource)()}}).reduce((n,r)=>n.merge(r),(0,OI.emptyResource)());$m.detectResources=Jpe});var kH=E(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.envDetector=void 0;var Zpe=(b(),O(v)),ede=(le(),O(Ae)),wH=Te(),NI=class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";detect(e){let n={},r=(0,wH.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),o=(0,wH.getStringFromEnv)("OTEL_SERVICE_NAME");if(r)try{let s=this._parseResourceAttributes(r);Object.assign(n,s)}catch(s){Zpe.diag.debug(`EnvDetector failed: ${s instanceof Error?s.message:s}`)}return o&&(n[ede.ATTR_SERVICE_NAME]=o),{attributes:n}}_parseResourceAttributes(e){if(!e)return{};let n={},r=e.split(this._COMMA_SEPARATOR);for(let o of r){let s=o.split(this._LABEL_KEY_VALUE_SPLITTER);if(s.length!==2)throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${o}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[i,a]=s,c=i.trim(),l=a.trim();if(c.length===0)throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${o}".`);let p,d;try{p=decodeURIComponent(c),d=decodeURIComponent(l)}catch(_){throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${o}": ${_ instanceof Error?_.message:_}`)}if(p.length>this._MAX_LENGTH)throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${p}".`);if(d.length>this._MAX_LENGTH)throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${p}".`);n[p]=d}return n}};Ym.envDetector=new NI});var Lp=E(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.ATTR_WEBENGINE_VERSION=L.ATTR_WEBENGINE_NAME=L.ATTR_WEBENGINE_DESCRIPTION=L.ATTR_SERVICE_NAMESPACE=L.ATTR_SERVICE_INSTANCE_ID=L.ATTR_PROCESS_RUNTIME_VERSION=L.ATTR_PROCESS_RUNTIME_NAME=L.ATTR_PROCESS_RUNTIME_DESCRIPTION=L.ATTR_PROCESS_PID=L.ATTR_PROCESS_OWNER=L.ATTR_PROCESS_EXECUTABLE_PATH=L.ATTR_PROCESS_EXECUTABLE_NAME=L.ATTR_PROCESS_COMMAND_ARGS=L.ATTR_PROCESS_COMMAND=L.ATTR_OS_VERSION=L.ATTR_OS_TYPE=L.ATTR_K8S_POD_NAME=L.ATTR_K8S_NAMESPACE_NAME=L.ATTR_K8S_DEPLOYMENT_NAME=L.ATTR_K8S_CLUSTER_NAME=L.ATTR_HOST_TYPE=L.ATTR_HOST_NAME=L.ATTR_HOST_IMAGE_VERSION=L.ATTR_HOST_IMAGE_NAME=L.ATTR_HOST_IMAGE_ID=L.ATTR_HOST_ID=L.ATTR_HOST_ARCH=L.ATTR_CONTAINER_NAME=L.ATTR_CONTAINER_IMAGE_TAGS=L.ATTR_CONTAINER_IMAGE_NAME=L.ATTR_CONTAINER_ID=L.ATTR_CLOUD_REGION=L.ATTR_CLOUD_PROVIDER=L.ATTR_CLOUD_AVAILABILITY_ZONE=L.ATTR_CLOUD_ACCOUNT_ID=void 0;L.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";L.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";L.ATTR_CLOUD_PROVIDER="cloud.provider";L.ATTR_CLOUD_REGION="cloud.region";L.ATTR_CONTAINER_ID="container.id";L.ATTR_CONTAINER_IMAGE_NAME="container.image.name";L.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";L.ATTR_CONTAINER_NAME="container.name";L.ATTR_HOST_ARCH="host.arch";L.ATTR_HOST_ID="host.id";L.ATTR_HOST_IMAGE_ID="host.image.id";L.ATTR_HOST_IMAGE_NAME="host.image.name";L.ATTR_HOST_IMAGE_VERSION="host.image.version";L.ATTR_HOST_NAME="host.name";L.ATTR_HOST_TYPE="host.type";L.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";L.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";L.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";L.ATTR_K8S_POD_NAME="k8s.pod.name";L.ATTR_OS_TYPE="os.type";L.ATTR_OS_VERSION="os.version";L.ATTR_PROCESS_COMMAND="process.command";L.ATTR_PROCESS_COMMAND_ARGS="process.command_args";L.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";L.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";L.ATTR_PROCESS_OWNER="process.owner";L.ATTR_PROCESS_PID="process.pid";L.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";L.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";L.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";L.ATTR_SERVICE_INSTANCE_ID="service.instance.id";L.ATTR_SERVICE_NAMESPACE="service.namespace";L.ATTR_WEBENGINE_DESCRIPTION="webengine.description";L.ATTR_WEBENGINE_NAME="webengine.name";L.ATTR_WEBENGINE_VERSION="webengine.version"});var zm=E(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.execAsync=void 0;var tde=U("child_process"),nde=U("util");Wm.execAsync=nde.promisify(tde.exec)});var GH=E(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.getMachineId=void 0;var rde=zm(),ode=(b(),O(v));async function sde(){try{let e=(await(0,rde.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
8
+ `).find(r=>r.includes("IOPlatformUUID"));if(!e)return;let n=e.split('" = "');if(n.length===2)return n[1].slice(0,-1)}catch(t){ode.diag.debug(`error reading machine id: ${t}`)}}Km.getMachineId=sde});var BH=E(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.getMachineId=void 0;var ide=U("fs"),ade=(b(),O(v));async function cde(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await ide.promises.readFile(e,{encoding:"utf8"})).trim()}catch(n){ade.diag.debug(`error reading machine id: ${n}`)}}Qm.getMachineId=cde});var HH=E(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.getMachineId=void 0;var ude=U("fs"),lde=zm(),jH=(b(),O(v));async function pde(){try{return(await ude.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){jH.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,lde.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){jH.diag.debug(`error reading machine id: ${t}`)}}Xm.getMachineId=pde});var VH=E(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.getMachineId=void 0;var FH=U("process"),dde=zm(),_de=(b(),O(v));async function fde(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";FH.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in FH.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let r=(await(0,dde.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(r.length===2)return r[1].trim()}catch(n){_de.diag.debug(`error reading machine id: ${n}`)}}Jm.getMachineId=fde});var qH=E(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.getMachineId=void 0;var mde=(b(),O(v));async function hde(){mde.diag.debug("could not read machine-id: unsupported platform")}Zm.getMachineId=hde});var $H=E(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.getMachineId=void 0;var Tde=U("process"),ia;async function Ede(){if(!ia)switch(Tde.platform){case"darwin":ia=(await Promise.resolve().then(()=>K(GH()))).getMachineId;break;case"linux":ia=(await Promise.resolve().then(()=>K(BH()))).getMachineId;break;case"freebsd":ia=(await Promise.resolve().then(()=>K(HH()))).getMachineId;break;case"win32":ia=(await Promise.resolve().then(()=>K(VH()))).getMachineId;break;default:ia=(await Promise.resolve().then(()=>K(qH()))).getMachineId;break}return ia()}eh.getMachineId=Ede});var bI=E(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.normalizeType=Xc.normalizeArch=void 0;var Sde=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};Xc.normalizeArch=Sde;var gde=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};Xc.normalizeType=gde});var WH=E(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.hostDetector=void 0;var CI=Lp(),YH=U("os"),Ade=$H(),Rde=bI(),PI=class{detect(e){return{attributes:{[CI.ATTR_HOST_NAME]:(0,YH.hostname)(),[CI.ATTR_HOST_ARCH]:(0,Rde.normalizeArch)((0,YH.arch)()),[CI.ATTR_HOST_ID]:(0,Ade.getMachineId)()}}}};th.hostDetector=new PI});var QH=E(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.osDetector=void 0;var zH=Lp(),KH=U("os"),yde=bI(),MI=class{detect(e){return{attributes:{[zH.ATTR_OS_TYPE]:(0,yde.normalizeType)((0,KH.platform)()),[zH.ATTR_OS_VERSION]:(0,KH.release)()}}}};nh.osDetector=new MI});var XH=E(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.processDetector=void 0;var Ide=(b(),O(v)),Ho=Lp(),Ode=U("os"),xI=class{detect(e){let n={[Ho.ATTR_PROCESS_PID]:process.pid,[Ho.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[Ho.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[Ho.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Ho.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[Ho.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[Ho.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(n[Ho.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let r=Ode.userInfo();n[Ho.ATTR_PROCESS_OWNER]=r.username}catch(r){Ide.diag.debug(`error obtaining process owner: ${r}`)}return{attributes:n}}};rh.processDetector=new xI});var JH=E(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.serviceInstanceIdDetector=void 0;var Nde=Lp(),bde=U("crypto"),vI=class{detect(e){return{attributes:{[Nde.ATTR_SERVICE_INSTANCE_ID]:(0,bde.randomUUID)()}}}};oh.serviceInstanceIdDetector=new vI});var ZH=E(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.serviceInstanceIdDetector=no.processDetector=no.osDetector=no.hostDetector=void 0;var Cde=WH();Object.defineProperty(no,"hostDetector",{enumerable:!0,get:function(){return Cde.hostDetector}});var Pde=QH();Object.defineProperty(no,"osDetector",{enumerable:!0,get:function(){return Pde.osDetector}});var Mde=XH();Object.defineProperty(no,"processDetector",{enumerable:!0,get:function(){return Mde.processDetector}});var xde=JH();Object.defineProperty(no,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return xde.serviceInstanceIdDetector}})});var eF=E(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.serviceInstanceIdDetector=ro.processDetector=ro.osDetector=ro.hostDetector=void 0;var sh=ZH();Object.defineProperty(ro,"hostDetector",{enumerable:!0,get:function(){return sh.hostDetector}});Object.defineProperty(ro,"osDetector",{enumerable:!0,get:function(){return sh.osDetector}});Object.defineProperty(ro,"processDetector",{enumerable:!0,get:function(){return sh.processDetector}});Object.defineProperty(ro,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return sh.serviceInstanceIdDetector}})});var tF=E(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.noopDetector=Jc.NoopDetector=void 0;var ih=class{detect(){return{attributes:{}}}};Jc.NoopDetector=ih;Jc.noopDetector=new ih});var nF=E(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.noopDetector=On.serviceInstanceIdDetector=On.processDetector=On.osDetector=On.hostDetector=On.envDetector=void 0;var vde=kH();Object.defineProperty(On,"envDetector",{enumerable:!0,get:function(){return vde.envDetector}});var ah=eF();Object.defineProperty(On,"hostDetector",{enumerable:!0,get:function(){return ah.hostDetector}});Object.defineProperty(On,"osDetector",{enumerable:!0,get:function(){return ah.osDetector}});Object.defineProperty(On,"processDetector",{enumerable:!0,get:function(){return ah.processDetector}});Object.defineProperty(On,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return ah.serviceInstanceIdDetector}});var Lde=tF();Object.defineProperty(On,"noopDetector",{enumerable:!0,get:function(){return Lde.noopDetector}})});var DI=E(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.defaultServiceName=Fe.emptyResource=Fe.defaultResource=Fe.resourceFromAttributes=Fe.serviceInstanceIdDetector=Fe.processDetector=Fe.osDetector=Fe.hostDetector=Fe.envDetector=Fe.detectResources=void 0;var Dde=UH();Object.defineProperty(Fe,"detectResources",{enumerable:!0,get:function(){return Dde.detectResources}});var Dp=nF();Object.defineProperty(Fe,"envDetector",{enumerable:!0,get:function(){return Dp.envDetector}});Object.defineProperty(Fe,"hostDetector",{enumerable:!0,get:function(){return Dp.hostDetector}});Object.defineProperty(Fe,"osDetector",{enumerable:!0,get:function(){return Dp.osDetector}});Object.defineProperty(Fe,"processDetector",{enumerable:!0,get:function(){return Dp.processDetector}});Object.defineProperty(Fe,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Dp.serviceInstanceIdDetector}});var LI=II();Object.defineProperty(Fe,"resourceFromAttributes",{enumerable:!0,get:function(){return LI.resourceFromAttributes}});Object.defineProperty(Fe,"defaultResource",{enumerable:!0,get:function(){return LI.defaultResource}});Object.defineProperty(Fe,"emptyResource",{enumerable:!0,get:function(){return LI.emptyResource}});var Ude=AI();Object.defineProperty(Fe,"defaultServiceName",{enumerable:!0,get:function(){return Ude.defaultServiceName}})});var rF=E(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.ExceptionEventName=void 0;ch.ExceptionEventName="exception"});var oF=E(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.SpanImpl=void 0;var kt=(b(),O(v)),Gt=Te(),aa=(le(),O(Ae)),wde=rF(),UI=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:kt.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let n=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=Gt.otperformance.now(),this._performanceOffset=n-(this._performanceStartTime+Gt.otperformance.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let r of e.links)this.addLink(r);this.startTime=this._getTime(e.startTime??n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,n){if(n==null||this._isSpanEnded())return this;if(e.length===0)return kt.diag.warn(`Invalid attribute key: ${e}`),this;if(!(0,Gt.isAttributeValue)(n))return kt.diag.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:r}=this._spanLimits,o=!Object.prototype.hasOwnProperty.call(this.attributes,e);return r!==void 0&&this._attributesCount>=r&&o?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(n),o&&this._attributesCount++,this)}setAttributes(e){for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.setAttribute(n,e[n]);return this}addEvent(e,n,r){if(this._isSpanEnded())return this;let{eventCountLimit:o}=this._spanLimits;if(o===0)return kt.diag.warn("No events allowed."),this._droppedEventsCount++,this;o!==void 0&&this.events.length>=o&&(this._droppedEventsCount===0&&kt.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,Gt.isTimeInput)(n)&&((0,Gt.isTimeInput)(r)||(r=n),n=void 0);let s=(0,Gt.sanitizeAttributes)(n),{attributePerEventCountLimit:i}=this._spanLimits,a={},c=0,l=0;for(let p in s){if(!Object.prototype.hasOwnProperty.call(s,p))continue;let d=s[p];if(i!==void 0&&l>=i){c++;continue}a[p]=this._truncateToSize(d),l++}return this.events.push({name:e,attributes:a,time:this._getTime(r),droppedAttributesCount:c}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:n}=this._spanLimits;if(n===0)return this._droppedLinksCount++,this;n!==void 0&&this.links.length>=n&&(this._droppedLinksCount===0&&kt.diag.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:r}=this._spanLimits,o=(0,Gt.sanitizeAttributes)(e.attributes),s={},i=0,a=0;for(let l in o){if(!Object.prototype.hasOwnProperty.call(o,l))continue;let p=o[l];if(r!==void 0&&a>=r){i++;continue}s[l]=this._truncateToSize(p),a++}let c={context:e.context};return a>0&&(c.attributes=s),i>0&&(c.droppedAttributesCount=i),this.links.push(c),this}addLinks(e){for(let n of e)this.addLink(n);return this}setStatus(e){if(this._isSpanEnded())return this;if(e.code===kt.SpanStatusCode.UNSET)return this;if(this.status.code===kt.SpanStatusCode.OK)return this;let n={code:e.code};return e.code===kt.SpanStatusCode.ERROR&&(typeof e.message=="string"?n.message=e.message:e.message!=null&&kt.diag.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=n,this}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){kt.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=(0,Gt.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(kt.diag.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&&kt.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&kt.diag.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(e){if(typeof e=="number"&&e<=Gt.otperformance.now())return(0,Gt.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,Gt.millisToHrTime)(e);if(e instanceof Date)return(0,Gt.millisToHrTime)(e.getTime());if((0,Gt.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,Gt.millisToHrTime)(Date.now());let n=Gt.otperformance.now()-this._performanceStartTime;return(0,Gt.addHrTimes)(this.startTime,(0,Gt.millisToHrTime)(n))}isRecording(){return this._ended===!1}recordException(e,n){let r={};typeof e=="string"?r[aa.ATTR_EXCEPTION_MESSAGE]=e:e&&(e.code?r[aa.ATTR_EXCEPTION_TYPE]=e.code.toString():e.name&&(r[aa.ATTR_EXCEPTION_TYPE]=e.name),e.message&&(r[aa.ATTR_EXCEPTION_MESSAGE]=e.message),e.stack&&(r[aa.ATTR_EXCEPTION_STACKTRACE]=e.stack)),r[aa.ATTR_EXCEPTION_TYPE]||r[aa.ATTR_EXCEPTION_MESSAGE]?this.addEvent(wde.ExceptionEventName,r,n):kt.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);kt.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,n){return e.length<=n?e:e.substring(0,n)}_truncateToSize(e){let n=this._attributeValueLengthLimit;return n<=0?(kt.diag.warn(`Attribute value limit must be positive, got ${n}`),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(r=>typeof r=="string"?this._truncateToLimitUtil(r,n):r):e}};uh.SpanImpl=UI});var Zc=E(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.SamplingDecision=void 0;var kde;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(kde=Up.SamplingDecision||(Up.SamplingDecision={}))});var ph=E(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.AlwaysOffSampler=void 0;var Gde=Zc(),wI=class{shouldSample(){return{decision:Gde.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};lh.AlwaysOffSampler=wI});var _h=E(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.AlwaysOnSampler=void 0;var Bde=Zc(),kI=class{shouldSample(){return{decision:Bde.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};dh.AlwaysOnSampler=kI});var jI=E(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.ParentBasedSampler=void 0;var fh=(b(),O(v)),jde=Te(),sF=ph(),GI=_h(),BI=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||((0,jde.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new GI.AlwaysOnSampler),this._remoteParentSampled=e.remoteParentSampled??new GI.AlwaysOnSampler,this._remoteParentNotSampled=e.remoteParentNotSampled??new sF.AlwaysOffSampler,this._localParentSampled=e.localParentSampled??new GI.AlwaysOnSampler,this._localParentNotSampled=e.localParentNotSampled??new sF.AlwaysOffSampler}shouldSample(e,n,r,o,s,i){let a=fh.trace.getSpanContext(e);return!a||!(0,fh.isSpanContextValid)(a)?this._root.shouldSample(e,n,r,o,s,i):a.isRemote?a.traceFlags&fh.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,n,r,o,s,i):this._remoteParentNotSampled.shouldSample(e,n,r,o,s,i):a.traceFlags&fh.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,n,r,o,s,i):this._localParentNotSampled.shouldSample(e,n,r,o,s,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};mh.ParentBasedSampler=BI});var FI=E(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.TraceIdRatioBasedSampler=void 0;var Hde=(b(),O(v)),iF=Zc(),HI=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,n){return{decision:(0,Hde.isValidTraceId)(n)&&this._accumulate(n)<this._upperBound?iF.SamplingDecision.RECORD_AND_SAMPLED:iF.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let n=0;for(let r=0;r<e.length/8;r++){let o=r*8,s=parseInt(e.slice(o,o+8),16);n=(n^s)>>>0}return n}};hh.TraceIdRatioBasedSampler=HI});var $I=E(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.buildSamplerFromEnv=eu.loadDefaultConfig=void 0;var qI=(b(),O(v)),oo=Te(),aF=ph(),VI=_h(),Th=jI(),cF=FI(),so;(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"})(so||(so={}));var Eh=1;function Fde(){return{sampler:lF(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,oo.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,oo.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,oo.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,oo.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,oo.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,oo.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,oo.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,oo.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}eu.loadDefaultConfig=Fde;function lF(){let t=(0,oo.getStringFromEnv)("OTEL_TRACES_SAMPLER")??so.ParentBasedAlwaysOn;switch(t){case so.AlwaysOn:return new VI.AlwaysOnSampler;case so.AlwaysOff:return new aF.AlwaysOffSampler;case so.ParentBasedAlwaysOn:return new Th.ParentBasedSampler({root:new VI.AlwaysOnSampler});case so.ParentBasedAlwaysOff:return new Th.ParentBasedSampler({root:new aF.AlwaysOffSampler});case so.TraceIdRatio:return new cF.TraceIdRatioBasedSampler(uF());case so.ParentBasedTraceIdRatio:return new Th.ParentBasedSampler({root:new cF.TraceIdRatioBasedSampler(uF())});default:return qI.diag.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${so.ParentBasedAlwaysOn}".`),new Th.ParentBasedSampler({root:new VI.AlwaysOnSampler})}}eu.buildSamplerFromEnv=lF;function uF(){let t=(0,oo.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");return t==null?(qI.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Eh}.`),Eh):t<0||t>1?(qI.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t} was given, but it is out of range ([0..1]), defaulting to ${Eh}.`),Eh):t}});var YI=E(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.reconfigureLimits=ir.mergeConfig=ir.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=ir.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var pF=$I(),Sh=Te();ir.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;ir.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function Vde(t){let e={sampler:(0,pF.buildSamplerFromEnv)()},n=(0,pF.loadDefaultConfig)(),r=Object.assign({},n,e,t);return r.generalLimits=Object.assign({},n.generalLimits,t.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,t.spanLimits||{}),r}ir.mergeConfig=Vde;function qde(t){let e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??(0,Sh.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,Sh.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??ir.DEFAULT_ATTRIBUTE_COUNT_LIMIT,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??(0,Sh.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,Sh.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??ir.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},t,{spanLimits:e})}ir.reconfigureLimits=qde});var dF=E(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.BatchSpanProcessorBase=void 0;var tu=(b(),O(v)),Fo=Te(),WI=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,n){this._exporter=e,this._maxExportBatchSize=typeof n?.maxExportBatchSize=="number"?n.maxExportBatchSize:(0,Fo.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof n?.maxQueueSize=="number"?n.maxQueueSize:(0,Fo.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof n?.scheduledDelayMillis=="number"?n.scheduledDelayMillis:(0,Fo.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=typeof n?.exportTimeoutMillis=="number"?n.exportTimeoutMillis:(0,Fo.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new Fo.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(tu.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,n){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&tu.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&tu.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(tu.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,n)=>{let r=[],o=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,i=o;s<i;s++)r.push(this._flushOneBatch());Promise.all(r).then(()=>{e()}).catch(n)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,n)=>{let r=setTimeout(()=>{n(new Error("Timeout"))},this._exportTimeoutMillis);tu.context.with((0,Fo.suppressTracing)(tu.context.active()),()=>{let o;this._finishedSpans.length<=this._maxExportBatchSize?(o=this._finishedSpans,this._finishedSpans=[]):o=this._finishedSpans.splice(0,this._maxExportBatchSize);let s=()=>this._exporter.export(o,a=>{clearTimeout(r),a.code===Fo.ExportResultCode.SUCCESS?e():n(a.error??new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let a=0,c=o.length;a<c;a++){let l=o[a];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(i??=[],i.push(l.resource.waitForAsyncAttributes()))}i===null?s():Promise.all(i).then(s,a=>{(0,Fo.globalErrorHandler)(a),n(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,Fo.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};gh.BatchSpanProcessorBase=WI});var _F=E(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.BatchSpanProcessor=void 0;var $de=dF(),zI=class extends $de.BatchSpanProcessorBase{onShutdown(){}};Ah.BatchSpanProcessor=zI});var hF=E(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.RandomIdGenerator=void 0;var Yde=8,mF=16,KI=class{generateTraceId=fF(mF);generateSpanId=fF(Yde)};yh.RandomIdGenerator=KI;var Rh=Buffer.allocUnsafe(mF);function fF(t){return function(){for(let n=0;n<t/4;n++)Rh.writeUInt32BE(Math.random()*2**32>>>0,n*4);for(let n=0;n<t&&!(Rh[n]>0);n++)n===t-1&&(Rh[t-1]=1);return Rh.toString("hex",0,t)}}});var TF=E(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.RandomIdGenerator=nu.BatchSpanProcessor=void 0;var Wde=_F();Object.defineProperty(nu,"BatchSpanProcessor",{enumerable:!0,get:function(){return Wde.BatchSpanProcessor}});var zde=hF();Object.defineProperty(nu,"RandomIdGenerator",{enumerable:!0,get:function(){return zde.RandomIdGenerator}})});var QI=E(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.RandomIdGenerator=ru.BatchSpanProcessor=void 0;var EF=TF();Object.defineProperty(ru,"BatchSpanProcessor",{enumerable:!0,get:function(){return EF.BatchSpanProcessor}});Object.defineProperty(ru,"RandomIdGenerator",{enumerable:!0,get:function(){return EF.RandomIdGenerator}})});var SF=E(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.METRIC_OTEL_SDK_SPAN_STARTED=io.METRIC_OTEL_SDK_SPAN_LIVE=io.ATTR_OTEL_SPAN_SAMPLING_RESULT=io.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;io.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";io.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";io.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";io.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var gF=E(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.TracerMetrics=void 0;var Ih=Zc(),wp=SF(),XI=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(wp.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=e.createUpDownCounter(wp.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(e,n){let r=Qde(n);if(this.startedSpans.add(1,{[wp.ATTR_OTEL_SPAN_PARENT_ORIGIN]:Kde(e),[wp.ATTR_OTEL_SPAN_SAMPLING_RESULT]:r}),n===Ih.SamplingDecision.NOT_RECORD)return()=>{};let o={[wp.ATTR_OTEL_SPAN_SAMPLING_RESULT]:r};return this.liveSpans.add(1,o),()=>{this.liveSpans.add(-1,o)}}};Oh.TracerMetrics=XI;function Kde(t){return t?t.isRemote?"remote":"local":"none"}function Qde(t){switch(t){case Ih.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case Ih.SamplingDecision.RECORD:return"RECORD_ONLY";case Ih.SamplingDecision.NOT_RECORD:return"DROP"}}});var AF=E(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.VERSION=void 0;Nh.VERSION="2.6.1"});var RF=E(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.Tracer=void 0;var Nt=(b(),O(v)),bh=Te(),Xde=oF(),Jde=YI(),Zde=QI(),e_e=gF(),t_e=AF(),JI=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,n,r,o){let s=(0,Jde.mergeConfig)(n);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=n.idGenerator||new Zde.RandomIdGenerator,this._resource=r,this._spanProcessor=o,this.instrumentationScope=e;let i=s.meterProvider?s.meterProvider.getMeter("@opentelemetry/sdk-trace",t_e.VERSION):Nt.createNoopMeter();this._tracerMetrics=new e_e.TracerMetrics(i)}startSpan(e,n={},r=Nt.context.active()){n.root&&(r=Nt.trace.deleteSpan(r));let o=Nt.trace.getSpan(r);if((0,bh.isTracingSuppressed)(r))return Nt.diag.debug("Instrumentation suppressed, returning Noop Span"),Nt.trace.wrapSpanContext(Nt.INVALID_SPAN_CONTEXT);let s=o?.spanContext(),i=this._idGenerator.generateSpanId(),a,c,l;!s||!Nt.trace.isSpanContextValid(s)?c=this._idGenerator.generateTraceId():(c=s.traceId,l=s.traceState,a=s);let p=n.kind??Nt.SpanKind.INTERNAL,d=(n.links??[]).map(I=>({context:I.context,attributes:(0,bh.sanitizeAttributes)(I.attributes)})),_=(0,bh.sanitizeAttributes)(n.attributes),f=this._sampler.shouldSample(r,c,e,p,_,d),m=this._tracerMetrics.startSpan(s,f.decision);l=f.traceState??l;let h=f.decision===Nt.SamplingDecision.RECORD_AND_SAMPLED?Nt.TraceFlags.SAMPLED:Nt.TraceFlags.NONE,T={traceId:c,spanId:i,traceFlags:h,traceState:l};if(f.decision===Nt.SamplingDecision.NOT_RECORD)return Nt.diag.debug("Recording is off, propagating context in a non-recording span"),Nt.trace.wrapSpanContext(T);let S=(0,bh.sanitizeAttributes)(Object.assign(_,f.attributes));return new Xde.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:T,name:e,kind:p,links:d,parentSpanContext:a,attributes:S,startTime:n.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:m})}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??Nt.context.active(),l=this.startSpan(e,s,c),p=Nt.trace.setSpan(c,l);return Nt.context.with(p,a,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};Ch.Tracer=JI});var yF=E(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.MultiSpanProcessor=void 0;var n_e=Te(),ZI=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let n of this._spanProcessors)e.push(n.forceFlush());return new Promise(n=>{Promise.all(e).then(()=>{n()}).catch(r=>{(0,n_e.globalErrorHandler)(r||new Error("MultiSpanProcessor: forceFlush failed")),n()})})}onStart(e,n){for(let r of this._spanProcessors)r.onStart(e,n)}onEnding(e){for(let n of this._spanProcessors)n.onEnding&&n.onEnding(e)}onEnd(e){for(let n of this._spanProcessors)n.onEnd(e)}shutdown(){let e=[];for(let n of this._spanProcessors)e.push(n.shutdown());return new Promise((n,r)=>{Promise.all(e).then(()=>{n()},r)})}};Ph.MultiSpanProcessor=ZI});var IF=E(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.BasicTracerProvider=ca.ForceFlushState=void 0;var r_e=Te(),o_e=DI(),s_e=RF(),i_e=$I(),a_e=yF(),c_e=YI(),ou;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(ou=ca.ForceFlushState||(ca.ForceFlushState={}));var eO=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let n=(0,r_e.merge)({},(0,i_e.loadDefaultConfig)(),(0,c_e.reconfigureLimits)(e));this._resource=n.resource??(0,o_e.defaultResource)(),this._config=Object.assign({},n,{resource:this._resource});let r=[];e.spanProcessors?.length&&r.push(...e.spanProcessors),this._activeSpanProcessor=new a_e.MultiSpanProcessor(r)}getTracer(e,n,r){let o=`${e}@${n||""}:${r?.schemaUrl||""}`;return this._tracers.has(o)||this._tracers.set(o,new s_e.Tracer({name:e,version:n,schemaUrl:r?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(o)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,n=this._activeSpanProcessor._spanProcessors.map(r=>new Promise(o=>{let s,i=setTimeout(()=>{o(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=ou.timeout},e);r.forceFlush().then(()=>{clearTimeout(i),s!==ou.timeout&&(s=ou.resolved,o(s))}).catch(a=>{clearTimeout(i),s=ou.error,o(a)})}));return new Promise((r,o)=>{Promise.all(n).then(s=>{let i=s.filter(a=>a!==ou.resolved);i.length>0?o(i):r()}).catch(s=>o([s]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};ca.BasicTracerProvider=eO});var OF=E(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.ConsoleSpanExporter=void 0;var tO=Te(),nO=class{export(e,n){return this._sendSpans(e,n)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,tO.hrTimeToMicroseconds)(e.startTime),duration:(0,tO.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,n){for(let r of e)console.dir(this._exportInfo(r),{depth:3});if(n)return n({code:tO.ExportResultCode.SUCCESS})}};Mh.ConsoleSpanExporter=nO});var bF=E(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.InMemorySpanExporter=void 0;var NF=Te(),rO=class{_finishedSpans=[];_stopped=!1;export(e,n){if(this._stopped)return n({code:NF.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>n({code:NF.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};xh.InMemorySpanExporter=rO});var CF=E(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.SimpleSpanProcessor=void 0;var u_e=(b(),O(v)),vh=Te(),oO=class{_exporter;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e,this._shutdownOnce=new vh.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,n){}onEnd(e){if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&u_e.TraceFlags.SAMPLED))return;let n=this._doExport(e).catch(r=>(0,vh.globalErrorHandler)(r));this._pendingExports.add(n),n.finally(()=>this._pendingExports.delete(n))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let n=await vh.internal._export(this._exporter,[e]);if(n.code!==vh.ExportResultCode.SUCCESS)throw n.error??new Error(`SimpleSpanProcessor: span export failed (status ${n})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};Lh.SimpleSpanProcessor=oO});var PF=E(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.NoopSpanProcessor=void 0;var sO=class{onStart(e,n){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};Dh.NoopSpanProcessor=sO});var iO=E(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.SamplingDecision=Ce.TraceIdRatioBasedSampler=Ce.ParentBasedSampler=Ce.AlwaysOnSampler=Ce.AlwaysOffSampler=Ce.NoopSpanProcessor=Ce.SimpleSpanProcessor=Ce.InMemorySpanExporter=Ce.ConsoleSpanExporter=Ce.RandomIdGenerator=Ce.BatchSpanProcessor=Ce.BasicTracerProvider=void 0;var l_e=IF();Object.defineProperty(Ce,"BasicTracerProvider",{enumerable:!0,get:function(){return l_e.BasicTracerProvider}});var MF=QI();Object.defineProperty(Ce,"BatchSpanProcessor",{enumerable:!0,get:function(){return MF.BatchSpanProcessor}});Object.defineProperty(Ce,"RandomIdGenerator",{enumerable:!0,get:function(){return MF.RandomIdGenerator}});var p_e=OF();Object.defineProperty(Ce,"ConsoleSpanExporter",{enumerable:!0,get:function(){return p_e.ConsoleSpanExporter}});var d_e=bF();Object.defineProperty(Ce,"InMemorySpanExporter",{enumerable:!0,get:function(){return d_e.InMemorySpanExporter}});var __e=CF();Object.defineProperty(Ce,"SimpleSpanProcessor",{enumerable:!0,get:function(){return __e.SimpleSpanProcessor}});var f_e=PF();Object.defineProperty(Ce,"NoopSpanProcessor",{enumerable:!0,get:function(){return f_e.NoopSpanProcessor}});var m_e=ph();Object.defineProperty(Ce,"AlwaysOffSampler",{enumerable:!0,get:function(){return m_e.AlwaysOffSampler}});var h_e=_h();Object.defineProperty(Ce,"AlwaysOnSampler",{enumerable:!0,get:function(){return h_e.AlwaysOnSampler}});var T_e=jI();Object.defineProperty(Ce,"ParentBasedSampler",{enumerable:!0,get:function(){return T_e.ParentBasedSampler}});var E_e=FI();Object.defineProperty(Ce,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return E_e.TraceIdRatioBasedSampler}});var S_e=Zc();Object.defineProperty(Ce,"SamplingDecision",{enumerable:!0,get:function(){return S_e.SamplingDecision}})});var rq=E(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.PACKAGE_NAME=uu.PACKAGE_VERSION=void 0;uu.PACKAGE_VERSION="0.24.0";uu.PACKAGE_NAME="@opentelemetry/instrumentation-undici"});var sq=E(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.UndiciInstrumentation=void 0;var DO=U("diagnostics_channel"),Fme=U("url"),$p=ne(),qn=(b(),O(v)),zh=Te(),ot=(le(),O(Ae)),oq=rq(),UO=class extends $p.InstrumentationBase{_recordFromReq=new WeakMap;constructor(e={}){super(oq.PACKAGE_NAME,oq.PACKAGE_VERSION,e)}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs.length=0}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this.subscribeToChannel("undici:request:create",this.onRequestCreated.bind(this)),this.subscribeToChannel("undici:client:sendHeaders",this.onRequestHeaders.bind(this)),this.subscribeToChannel("undici:request:headers",this.onResponseHeaders.bind(this)),this.subscribeToChannel("undici:request:trailers",this.onDone.bind(this)),this.subscribeToChannel("undici:request:error",this.onError.bind(this)))}_updateMetricInstruments(){this._httpClientDurationHistogram=this.meter.createHistogram(ot.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:"Measures the duration of outbound HTTP requests.",unit:"s",valueType:qn.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}subscribeToChannel(e,n){let[r,o]=process.version.replace("v","").split(".").map(a=>Number(a)),s=r>18||r===18&&o>=19,i;if(s)DO.subscribe?.(e,n),i=()=>DO.unsubscribe?.(e,n);else{let a=DO.channel(e);a.subscribe(n),i=()=>a.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:i})}parseRequestHeaders(e){let n=new Map;if(Array.isArray(e.headers))for(let r=0;r<e.headers.length;r+=2){let o=e.headers[r],s=e.headers[r+1];typeof o=="string"&&n.set(o.toLowerCase(),s)}else if(typeof e.headers=="string"){let r=e.headers.split(`\r
9
+ `);for(let o of r){if(!o)continue;let s=o.indexOf(":");if(s===-1)continue;let i=o.substring(0,s).toLowerCase(),a=o.substring(s+1).trim(),c=n.get(i);c&&Array.isArray(c)?c.push(a):c?n.set(i,[c,a]):n.set(i,a)}}return n}onRequestCreated({request:e}){let n=this.getConfig(),r=n.enabled!==!1;if((0,$p.safeExecuteInTheMiddle)(()=>!r||e.method==="CONNECT"||n.ignoreRequestHook?.(e),B=>B&&this._diag.error("caught ignoreRequestHook error: ",B),!0))return;let s=(0,zh.hrTime)(),i;try{i=new Fme.URL(e.path,e.origin)}catch(B){this._diag.warn("could not determine url.full:",B);return}let a=i.protocol.replace(":",""),c=this.getRequestMethod(e.method),l={[ot.ATTR_HTTP_REQUEST_METHOD]:c,[ot.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:e.method,[ot.ATTR_URL_FULL]:i.toString(),[ot.ATTR_URL_PATH]:i.pathname,[ot.ATTR_URL_QUERY]:i.search,[ot.ATTR_URL_SCHEME]:a},p={https:"443",http:"80"},d=i.hostname,_=i.port||p[a];l[ot.ATTR_SERVER_ADDRESS]=d,_&&!isNaN(Number(_))&&(l[ot.ATTR_SERVER_PORT]=Number(_));let m=this.parseRequestHeaders(e).get("user-agent");if(m){let B=Array.isArray(m)?m[m.length-1]:m;l[ot.ATTR_USER_AGENT_ORIGINAL]=B}let h=(0,$p.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(e),B=>B&&this._diag.error("caught startSpanHook error: ",B),!0);h&&Object.entries(h).forEach(([B,se])=>{l[B]=se});let T=qn.context.active(),S=qn.trace.getSpan(T),R;n.requireParentforSpans&&(!S||!qn.trace.isSpanContextValid(S.spanContext()))?R=qn.trace.wrapSpanContext(qn.INVALID_SPAN_CONTEXT):R=this.tracer.startSpan(c==="_OTHER"?"HTTP":c,{kind:qn.SpanKind.CLIENT,attributes:l},T),(0,$p.safeExecuteInTheMiddle)(()=>n.requestHook?.(R,e),B=>B&&this._diag.error("caught requestHook error: ",B),!0);let I=qn.trace.setSpan(qn.context.active(),R),x={};qn.propagation.inject(I,x);let F=Object.entries(x);for(let B=0;B<F.length;B++){let[se,ve]=F[B];typeof e.addHeader=="function"?e.addHeader(se,ve):typeof e.headers=="string"?e.headers+=`${se}: ${ve}\r
10
+ `:Array.isArray(e.headers)&&e.headers.push(se,ve)}this._recordFromReq.set(e,{span:R,attributes:l,startTime:s})}onRequestHeaders({request:e,socket:n}){let r=this._recordFromReq.get(e);if(!r)return;let o=this.getConfig(),{span:s}=r,{remoteAddress:i,remotePort:a}=n,c={[ot.ATTR_NETWORK_PEER_ADDRESS]:i,[ot.ATTR_NETWORK_PEER_PORT]:a};if(o.headersToSpanAttributes?.requestHeaders){let l=new Set(o.headersToSpanAttributes.requestHeaders.map(d=>d.toLowerCase())),p=this.parseRequestHeaders(e);for(let[d,_]of p.entries())if(l.has(d)){let f=Array.isArray(_)?_:[_];c[`http.request.header.${d}`]=f}}s.setAttributes(c)}onResponseHeaders({request:e,response:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s}=r,i={[ot.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},a=this.getConfig();if((0,$p.safeExecuteInTheMiddle)(()=>a.responseHook?.(o,{request:e,response:n}),c=>c&&this._diag.error("caught responseHook error: ",c),!0),a.headersToSpanAttributes?.responseHeaders){let c=new Set;a.headersToSpanAttributes?.responseHeaders.forEach(l=>c.add(l.toLowerCase()));for(let l=0;l<n.headers.length;l=l+2){let p=n.headers[l].toString().toLowerCase(),d=n.headers[l+1];if(c.has(p)){let _=`http.response.header.${p}`;Object.hasOwn(i,_)?i[_].push(d.toString()):i[_]=[d.toString()]}}}o.setAttributes(i),o.setStatus({code:n.statusCode>=400?qn.SpanStatusCode.ERROR:qn.SpanStatusCode.UNSET}),r.attributes=Object.assign(s,i)}onDone({request:e}){let n=this._recordFromReq.get(e);if(!n)return;let{span:r,attributes:o,startTime:s}=n;r.end(),this._recordFromReq.delete(e),this.recordRequestDuration(o,s)}onError({request:e,error:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s,startTime:i}=r;o.recordException(n),o.setStatus({code:qn.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(e),s[ot.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(s,i)}recordRequestDuration(e,n){let r={};[ot.ATTR_HTTP_RESPONSE_STATUS_CODE,ot.ATTR_HTTP_REQUEST_METHOD,ot.ATTR_SERVER_ADDRESS,ot.ATTR_SERVER_PORT,ot.ATTR_URL_SCHEME,ot.ATTR_ERROR_TYPE].forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,zh.hrTimeToMilliseconds)((0,zh.hrTimeDuration)(n,(0,zh.hrTime)()))/1e3;this._httpClientDurationHistogram.record(s,r)}getRequestMethod(e){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return e.toUpperCase()in n?e.toUpperCase():"_OTHER"}};Kh.UndiciInstrumentation=UO});var iq=E(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.UndiciInstrumentation=void 0;var Vme=sq();Object.defineProperty(Qh,"UndiciInstrumentation",{enumerable:!0,get:function(){return Vme.UndiciInstrumentation}})});var Xh=E(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.ExpressLayerType=void 0;var Kme;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(Kme=Yp.ExpressLayerType||(Yp.ExpressLayerType={}))});var Jh=E(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.AttributeNames=void 0;var Qme;(function(t){t.EXPRESS_TYPE="express.type",t.EXPRESS_NAME="express.name"})(Qme=Wp.AttributeNames||(Wp.AttributeNames={}))});var wO=E(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu._LAYERS_STORE_PROPERTY=lu.kLayerPatched=void 0;lu.kLayerPatched=Symbol("express-layer-patched");lu._LAYERS_STORE_PROPERTY="__ot_middlewares"});var _q=E(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.getActualMatchedRoute=st.getConstructedRoute=st.getLayerPath=st.asErrorAndMessage=st.isLayerIgnored=st.getLayerMetadata=st.getRouterPath=st.storeLayerPath=void 0;var kO=Xh(),pu=Jh(),ua=wO(),Xme=(t,e)=>(Array.isArray(t[ua._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,ua._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e===void 0?{isLayerPathStored:!1}:(t[ua._LAYERS_STORE_PROPERTY].push(e),{isLayerPathStored:!0}));st.storeLayerPath=Xme;var Jme=(t,e)=>{let n=e.handle?.stack?.[0];return n?.route?.path?`${t}${n.route.path}`:n?.handle?.stack?(0,st.getRouterPath)(t,n):t};st.getRouterPath=Jme;var Zme=(t,e,n)=>{if(e.name==="router"){let r=(0,st.getRouterPath)("",e),o=r||n||t||"/";return{attributes:{[pu.AttributeNames.EXPRESS_NAME]:o,[pu.AttributeNames.EXPRESS_TYPE]:kO.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return e.name==="bound dispatch"||e.name==="handle"?{attributes:{[pu.AttributeNames.EXPRESS_NAME]:(t||n)??"request handler",[pu.AttributeNames.EXPRESS_TYPE]:kO.ExpressLayerType.REQUEST_HANDLER},name:`request handler${e.path?` - ${t||n}`:""}`}:{attributes:{[pu.AttributeNames.EXPRESS_NAME]:e.name,[pu.AttributeNames.EXPRESS_TYPE]:kO.ExpressLayerType.MIDDLEWARE},name:`middleware - ${e.name}`}};st.getLayerMetadata=Zme;var ehe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")},the=(t,e,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(e))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(ehe(t,r))return!0}catch{}return!1};st.isLayerIgnored=the;var nhe=t=>t instanceof Error?[t,t.message]:[String(t),String(t)];st.asErrorAndMessage=nhe;var rhe=t=>{let e=t[0];return Array.isArray(e)?e.map(n=>pq(n)||"").join(","):pq(e)};st.getLayerPath=rhe;var pq=t=>{if(typeof t=="string")return t;if(t instanceof RegExp||typeof t=="number")return t.toString()};function dq(t){let n=(Array.isArray(t[ua._LAYERS_STORE_PROPERTY])?t[ua._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}st.getConstructedRoute=dq;function ohe(t){let e=Array.isArray(t[ua._LAYERS_STORE_PROPERTY])?t[ua._LAYERS_STORE_PROPERTY]:[];if(e.length===0)return;if(e.every(s=>s==="/"))return t.originalUrl==="/"?"/":void 0;let n=dq(t);if(n==="*"||n.includes("/")&&(n.includes(",")||n.includes("\\")||n.includes("*")||n.includes("[")))return n;let r=n.startsWith("/")?n:`/${n}`;return r.length>0&&(t.originalUrl===r||t.originalUrl.startsWith(r)||she(r))?r:void 0}st.getActualMatchedRoute=ohe;function she(t){return t.includes(":")||t.includes("*")}});var fq=E(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.PACKAGE_NAME=du.PACKAGE_VERSION=void 0;du.PACKAGE_VERSION="0.62.0";du.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var Sq=E(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.ExpressInstrumentation=void 0;var mq=Te(),Nn=(b(),O(v)),hq=Xh(),Tq=Jh(),uo=_q(),Eq=fq(),_u=ne(),ihe=(le(),O(Ae)),Zh=wO(),GO=class extends _u.InstrumentationBase{constructor(e={}){super(Eq.PACKAGE_NAME,Eq.PACKAGE_VERSION,e)}init(){return[new _u.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],e=>{let n=typeof e?.Router?.prototype?.route=="function",r=n?e.Router.prototype:e.Router;return(0,_u.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,_u.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,_u.isWrapped)(e.application.use)&&this._unwrap(e.application,"use"),this._wrap(e.application,"use",this._getAppUsePatch(n)),e},e=>{if(e===void 0)return;let r=typeof e?.Router?.prototype?.route=="function"?e.Router.prototype:e.Router;this._unwrap(r,"route"),this._unwrap(r,"use"),this._unwrap(e.application,"use")})]}_getRoutePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,uo.getLayerPath)(o)),s}}}_getRouterUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,uo.getLayerPath)(o)),s}}}_getAppUsePatch(e){let n=this;return function(r){return function(...s){let i=e?this.router:this._router,a=r.apply(this,s);if(i){let c=i.stack[i.stack.length-1];n._applyPatch(c,(0,uo.getLayerPath)(s))}return a}}}_applyPatch(e,n){let r=this;e[Zh.kLayerPatched]!==!0&&(e[Zh.kLayerPatched]=!0,this._wrap(e,"handle",o=>{if(o.length===4)return o;let s=function(i,a){let{isLayerPathStored:c}=(0,uo.storeLayerPath)(i,n),l=(0,uo.getConstructedRoute)(i),p=(0,uo.getActualMatchedRoute)(i),d={[ihe.ATTR_HTTP_ROUTE]:p},_=(0,uo.getLayerMetadata)(l,e,n),f=_.attributes[Tq.AttributeNames.EXPRESS_TYPE],m=(0,mq.getRPCMetadata)(Nn.context.active());if(m?.type===mq.RPCType.HTTP&&(m.route=p),(0,uo.isLayerIgnored)(_.name,f,r.getConfig()))return f===hq.ExpressLayerType.MIDDLEWARE&&i[Zh._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Nn.trace.getSpan(Nn.context.active())===void 0)return o.apply(this,arguments);let h=r._getSpanName({request:i,layerType:f,route:l},_.name),T=r.tracer.startSpan(h,{attributes:Object.assign(d,_.attributes)}),S=Nn.context.active(),R=Nn.trace.setSpan(S,T),{requestHook:I}=r.getConfig();I&&(0,_u.safeExecuteInTheMiddle)(()=>I(T,{request:i,layerType:f,route:l}),ve=>{ve&&Nn.diag.error("express instrumentation: request hook failed",ve)},!0);let x=!1;_.attributes[Tq.AttributeNames.EXPRESS_TYPE]===hq.ExpressLayerType.ROUTER&&(T.end(),x=!0,R=S);let F=()=>{x===!1&&(x=!0,T.end())},B=Array.from(arguments),se=B.findIndex(ve=>typeof ve=="function");se>=0&&(arguments[se]=function(){let ve=arguments[0],on=![void 0,null,"route","router"].includes(ve);if(!x&&on){let[$a,Ya]=(0,uo.asErrorAndMessage)(ve);T.recordException($a),T.setStatus({code:Nn.SpanStatusCode.ERROR,message:Ya})}x===!1&&(x=!0,i.res?.removeListener("finish",F),T.end()),!(i.route&&on)&&c&&i[Zh._LAYERS_STORE_PROPERTY].pop();let Io=B[se],ss=Nn.context.active(),yi=Nn.trace.getSpan(S),Et=yi?Nn.trace.setSpan(ss,yi):ss;return Nn.context.bind(Et,Io).apply(this,arguments)});try{return Nn.context.bind(R,o).apply(this,arguments)}catch(ve){let[on,Io]=(0,uo.asErrorAndMessage)(ve);throw T.recordException(on),T.setStatus({code:Nn.SpanStatusCode.ERROR,message:Io}),ve}finally{x||a.once("finish",F)}};for(let i in o)Object.defineProperty(s,i,{get(){return o[i]},set(a){o[i]=a}});return s}))}_getSpanName(e,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(e,n)??n}catch(o){return Nn.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};eT.ExpressInstrumentation=GO});var gq=E(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.AttributeNames=Hs.ExpressLayerType=Hs.ExpressInstrumentation=void 0;var ahe=Sq();Object.defineProperty(Hs,"ExpressInstrumentation",{enumerable:!0,get:function(){return ahe.ExpressInstrumentation}});var che=Xh();Object.defineProperty(Hs,"ExpressLayerType",{enumerable:!0,get:function(){return che.ExpressLayerType}});var uhe=Jh();Object.defineProperty(Hs,"AttributeNames",{enumerable:!0,get:function(){return uhe.AttributeNames}})});var Oq=E(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.SeverityNumber=void 0;var _he;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(_he=zp.SeverityNumber||(zp.SeverityNumber={}))});var rT=E(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.NOOP_LOGGER=fu.NoopLogger=void 0;var nT=class{emit(e){}};fu.NoopLogger=nT;fu.NOOP_LOGGER=new nT});var Nq=E(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.API_BACKWARDS_COMPATIBILITY_VERSION=lo.makeGetter=lo._global=lo.GLOBAL_LOGS_API_KEY=void 0;lo.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");lo._global=globalThis;function fhe(t,e,n){return r=>r===t?e:n}lo.makeGetter=fhe;lo.API_BACKWARDS_COMPATIBILITY_VERSION=1});var BO=E(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.NOOP_LOGGER_PROVIDER=mu.NoopLoggerProvider=void 0;var mhe=rT(),oT=class{getLogger(e,n,r){return new mhe.NoopLogger}};mu.NoopLoggerProvider=oT;mu.NOOP_LOGGER_PROVIDER=new oT});var bq=E(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});sT.ProxyLogger=void 0;var hhe=rT(),jO=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):hhe.NOOP_LOGGER}};sT.ProxyLogger=jO});var Cq=E(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});iT.ProxyLoggerProvider=void 0;var The=BO(),Ehe=bq(),HO=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new Ehe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:The.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};iT.ProxyLoggerProvider=HO});var Mq=E(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});aT.LogsAPI=void 0;var ar=Nq(),She=BO(),Pq=Cq(),FO=class t{constructor(){this._proxyLoggerProvider=new Pq.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return ar._global[ar.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(ar._global[ar.GLOBAL_LOGS_API_KEY]=(0,ar.makeGetter)(ar.API_BACKWARDS_COMPATIBILITY_VERSION,e,She.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=ar._global[ar.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(ar._global,ar.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete ar._global[ar.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Pq.ProxyLoggerProvider}};aT.LogsAPI=FO});var VO=E(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.logs=po.NoopLogger=po.NOOP_LOGGER=po.SeverityNumber=void 0;var ghe=Oq();Object.defineProperty(po,"SeverityNumber",{enumerable:!0,get:function(){return ghe.SeverityNumber}});var xq=rT();Object.defineProperty(po,"NOOP_LOGGER",{enumerable:!0,get:function(){return xq.NOOP_LOGGER}});Object.defineProperty(po,"NoopLogger",{enumerable:!0,get:function(){return xq.NoopLogger}});var Ahe=Mq();po.logs=Ahe.LogsAPI.getInstance()});var vq=E(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.disableInstrumentations=hu.enableInstrumentations=void 0;function Rhe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}hu.enableInstrumentations=Rhe;function yhe(t){t.forEach(e=>e.disable())}hu.disableInstrumentations=yhe});var Uq=E(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});cT.registerInstrumentations=void 0;var Lq=(b(),O(v)),Ihe=VO(),Dq=vq();function Ohe(t){let e=t.tracerProvider||Lq.trace.getTracerProvider(),n=t.meterProvider||Lq.metrics.getMeterProvider(),r=t.loggerProvider||Ihe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,Dq.enableInstrumentations)(o,e,n,r),()=>{(0,Dq.disableInstrumentations)(o)}}cT.registerInstrumentations=Ohe});var qq=E(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});uT.satisfies=void 0;var WO=(b(),O(v)),jq=/^(?: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-]+)*))?$/,Nhe=/^(?<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-]+)*))?$/,bhe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Che(t,e,n){if(!Phe(t))return WO.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=Lhe(t);if(!r)return!1;let o=[],s=Hq(r,e,o,n);return s&&!n?.includePrerelease?xhe(r,o):s}uT.satisfies=Che;function Phe(t){return typeof t=="string"&&jq.test(t)}function Hq(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(qO(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=eTe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!qO(t,s,n,r))return!1;return!0}return qO(t,e,n,r)}function qO(t,e,n,r){if(e=vhe(e,r),e.includes(" "))return Hq(t,e,n,r);{let o=Dhe(e);return n.push(o),Mhe(t,o)}}function Mhe(t,e){if(e.invalid)return!1;if(!e.version||YO(e.version))return!0;let n=kq(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=kq(r,o)}return bhe[e.op]?.includes(n)}function xhe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function vhe(t,e){return t=t.trim(),t=Jhe(t,e),t=Xhe(t),t=Zhe(t,e),t=t.trim(),t}function _n(t){return!t||t.toLowerCase()==="x"||t==="*"}function Lhe(t){let e=t.match(jq);if(!e){WO.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function Dhe(t){if(!t)return{};let e=t.match(Nhe);if(!e)return WO.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function YO(t){return t==="*"||t==="x"||t==="X"}function wq(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Uhe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function whe(t,e){if(YO(t)||YO(e))return 0;let[n,r]=Uhe(wq(t),wq(e));return n>r?1:n<r?-1:0}function kq(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=whe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var Fq="[a-zA-Z0-9-]",Vq="0|[1-9]\\d*",khe=`\\d*[a-zA-Z-]${Fq}*`,Ghe="((?:<|>)?=?)",Gq=`(?:${Vq}|${khe})`,Bhe=`(?:-(${Gq}(?:\\.${Gq})*))`,Bq=`${Fq}+`,jhe=`(?:\\+(${Bq}(?:\\.${Bq})*))`,$O=`${Vq}|x|X|\\*`,Kp=`[v=\\s]*(${$O})(?:\\.(${$O})(?:\\.(${$O})(?:${Bhe})?${jhe}?)?)?`,Hhe=`^${Ghe}\\s*${Kp}$`,Fhe=new RegExp(Hhe),Vhe=`^\\s*(${Kp})\\s+-\\s+(${Kp})\\s*$`,qhe=new RegExp(Vhe),$he="(?:~>?)",Yhe=`^${$he}${Kp}$`,Whe=new RegExp(Yhe),zhe="(?:\\^)",Khe=`^${zhe}${Kp}$`,Qhe=new RegExp(Khe);function Xhe(t){let e=Whe;return t.replace(e,(n,r,o,s,i)=>{let a;return _n(r)?a="":_n(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:_n(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function Jhe(t,e){let n=Qhe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let l;return _n(s)?l="":_n(i)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:_n(a)?s==="0"?l=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?l=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,l})}function Zhe(t,e){let n=Fhe;return t.replace(n,(r,o,s,i,a,c)=>{let l=_n(s),p=l||_n(i),d=p||_n(a),_=d;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",l?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function eTe(t,e){let n=qhe;return t.replace(n,(r,o,s,i,a,c,l,p,d,_,f,m)=>(_n(s)?o="":_n(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:_n(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,_n(d)?p="":_n(_)?p=`<${+d+1}.0.0-0`:_n(f)?p=`<${d}.${+_+1}.0-0`:m?p=`<=${d}.${_}.${f}-${m}`:e?.includePrerelease?p=`<${d}.${_}.${+f+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var zO=E(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.massUnwrap=Bt.unwrap=Bt.massWrap=Bt.wrap=void 0;var fn=console.error.bind(console);function Qp(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var tTe=(t,e,n)=>{if(!t||!t[e]){fn("no original function "+String(e)+" to wrap");return}if(!n){fn("no wrapper function"),fn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){fn("original object and wrapper must be functions");return}let o=n(r,e);return Qp(o,"__original",r),Qp(o,"__unwrap",()=>{t[e]===o&&Qp(t,e,r)}),Qp(o,"__wrapped",!0),Qp(t,e,o),o};Bt.wrap=tTe;var nTe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{fn("must provide one or more modules to patch"),fn(new Error().stack);return}if(!(e&&Array.isArray(e))){fn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Bt.wrap)(r,o,n)})})};Bt.massWrap=nTe;var rTe=(t,e)=>{if(!t||!t[e]){fn("no function to unwrap."),fn(new Error().stack);return}let n=t[e];if(!n.__unwrap)fn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Bt.unwrap=rTe;var oTe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{fn("must provide one or more modules to patch"),fn(new Error().stack);return}if(!(e&&Array.isArray(e))){fn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Bt.unwrap)(n,r)})})};Bt.massUnwrap=oTe;function Xp(t){t&&t.logger&&(typeof t.logger!="function"?fn("new logger isn't a function, not replacing"):fn=t.logger)}Bt.default=Xp;Xp.wrap=Bt.wrap;Xp.massWrap=Bt.massWrap;Xp.unwrap=Bt.unwrap;Xp.massUnwrap=Bt.massUnwrap});var $q=E(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});pT.InstrumentationAbstract=void 0;var KO=(b(),O(v)),sTe=VO(),lT=zO(),QO=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=KO.diag.createComponentLogger({namespace:e}),this._tracer=KO.trace.getTracer(e,n),this._meter=KO.metrics.getMeter(e,n),this._logger=sTe.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=lT.wrap;_unwrap=lT.unwrap;_massWrap=lT.massWrap;_massUnwrap=lT.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};pT.InstrumentationAbstract=QO});var Yq=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ModuleNameTrie=Fs.ModuleNameSeparator=void 0;Fs.ModuleNameSeparator="/";var dT=class{hooks=[];children=new Map},XO=class{_trie=new dT;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(Fs.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new dT,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(Fs.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};Fs.ModuleNameTrie=XO});var zq=E(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0});_T.RequireInTheMiddleSingleton=void 0;var iTe=wi(),Wq=U("path"),JO=Yq(),aTe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),ZO=class t{_moduleNameTrie=new JO.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new iTe.Hook(null,{internals:!0},(e,n,r)=>{let o=cTe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return aTe?new t:this._instance=this._instance??new t}};_T.RequireInTheMiddleSingleton=ZO;function cTe(t){return Wq.sep!==JO.ModuleNameSeparator?t.split(Wq.sep).join(JO.ModuleNameSeparator):t}});var Zq=E(Jp=>{var Kq=[],eN=new WeakMap,Qq=new WeakMap,Xq=new Map,Jq=[],uTe={set(t,e,n){let r=eN.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=Qq.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=eN.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function lTe(t,e,n,r,o){Xq.set(t,o),eN.set(e,n),Qq.set(e,r);let s=new Proxy(e,uTe);Kq.forEach(i=>i(t,s,o)),Jq.push([t,s,o])}Jp.register=lTe;Jp.importHooks=Kq;Jp.specifiers=Xq;Jp.toHook=Jq});var oN=E((hKe,Eu)=>{var e$=U("path"),pTe=mf(),{fileURLToPath:dTe}=U("url"),{MessageChannel:_Te}=U("worker_threads"),{isBuiltin:tN}=U("module");tN||(tN=()=>!0);var{importHooks:nN,specifiers:fTe,toHook:mTe}=Zq();function t$(t){nN.push(t),mTe.forEach(([e,n,r])=>t(e,n,r))}function n$(t){let e=nN.indexOf(t);e>-1&&nN.splice(e,1)}function Tu(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var rN;function hTe(){let{port1:t,port2:e}=new _Te,n=0,r;rN=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(l=>{r=l}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function Zp(t,e,n){if(!(this instanceof Zp))return new Zp(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;rN&&Array.isArray(t)&&rN(t),this._iitmHook=(o,s,i)=>{let a=o,c=a.startsWith("node:"),l,p;if(c){let d=o.slice(5);tN(d)&&(o=d)}else if(a.startsWith("file://")){let d=Error.stackTraceLimit;Error.stackTraceLimit=0;try{l=dTe(o),o=l}catch{}if(Error.stackTraceLimit=d,l){let _=pTe(l);_&&(o=_.name,p=_.basedir)}}if(t)for(let d of t)if(l&&d===l)Tu(n,s,l,void 0);else if(d===o){if(!p)Tu(n,s,o,p);else if(p.endsWith(fTe.get(a)))Tu(n,s,o,p);else if(r){let _=o+e$.sep+e$.relative(p,l);Tu(n,s,_,p)}}else d===i&&Tu(n,s,i,p);else Tu(n,s,o,p)},t$(this._iitmHook)}Zp.prototype.unhook=function(){n$(this._iitmHook)};Eu.exports=Zp;Eu.exports.Hook=Zp;Eu.exports.addHook=t$;Eu.exports.removeHook=n$;Eu.exports.createAddHookMessageChannel=hTe});var sN=E(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.isWrapped=Vs.safeExecuteInTheMiddleAsync=Vs.safeExecuteInTheMiddle=void 0;function TTe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Vs.safeExecuteInTheMiddle=TTe;async function ETe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(await e(r,o),r&&!n)throw r;return o}}Vs.safeExecuteInTheMiddleAsync=ETe;function STe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}Vs.isWrapped=STe});var s$=E(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});fT.InstrumentationBase=void 0;var ed=U("path"),r$=U("util"),gTe=qq(),iN=zO(),ATe=$q(),RTe=zq(),yTe=oN(),td=(b(),O(v)),ITe=wi(),OTe=U("fs"),NTe=sN(),aN=class extends ATe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=RTe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,NTe.isWrapped)(e[n])&&this._unwrap(e,n),r$.types.isProxy(e)){let o=(0,iN.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,iN.wrap)(e,n,r)};_unwrap=(e,n)=>r$.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,iN.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{td.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){td.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{td.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){td.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=U.resolve(n);U.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,OTe.readFileSync)(ed.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{td.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return o$(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=ed.normalize(r);return i.filter(l=>l.name===a&&o$(l.supportedVersions,s,e.includePrerelease)).reduce((l,p)=>(p.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&ed.isAbsolute(a)){let l=ed.parse(a);a=l.name,c=l.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=ed.isAbsolute(e.name)?new ITe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new yTe.Hook([e.name],{internals:!0},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};fT.InstrumentationBase=aN;function o$(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,gTe.satisfies)(e,r,{includePrerelease:n}))}});var i$=E(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});mT.normalize=void 0;var bTe=U("path");Object.defineProperty(mT,"normalize",{enumerable:!0,get:function(){return bTe.normalize}})});var a$=E(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.normalize=Su.InstrumentationBase=void 0;var CTe=s$();Object.defineProperty(Su,"InstrumentationBase",{enumerable:!0,get:function(){return CTe.InstrumentationBase}});var PTe=i$();Object.defineProperty(Su,"normalize",{enumerable:!0,get:function(){return PTe.normalize}})});var cN=E(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.normalize=gu.InstrumentationBase=void 0;var c$=a$();Object.defineProperty(gu,"InstrumentationBase",{enumerable:!0,get:function(){return c$.InstrumentationBase}});Object.defineProperty(gu,"normalize",{enumerable:!0,get:function(){return c$.normalize}})});var u$=E(hT=>{"use strict";Object.defineProperty(hT,"__esModule",{value:!0});hT.InstrumentationNodeModuleDefinition=void 0;var uN=class{files;name;supportedVersions;patch;unpatch;constructor(e,n,r,o,s){this.files=s||[],this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o}};hT.InstrumentationNodeModuleDefinition=uN});var l$=E(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});TT.InstrumentationNodeModuleFile=void 0;var MTe=cN(),lN=class{name;supportedVersions;patch;unpatch;constructor(e,n,r,o){this.name=(0,MTe.normalize)(e),this.supportedVersions=n,this.patch=r,this.unpatch=o}};TT.InstrumentationNodeModuleFile=lN});var p$=E(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.semconvStabilityFromStr=la.SemconvStability=void 0;var ET;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(ET=la.SemconvStability||(la.SemconvStability={}));function xTe(t,e){let n=ET.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=ET.DUPLICATE;break}else o.toLowerCase()===t&&(n=ET.STABLE);return n}la.semconvStabilityFromStr=xTe});var _$=E(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.semconvStabilityFromStr=it.SemconvStability=it.safeExecuteInTheMiddleAsync=it.safeExecuteInTheMiddle=it.isWrapped=it.InstrumentationNodeModuleFile=it.InstrumentationNodeModuleDefinition=it.InstrumentationBase=it.registerInstrumentations=void 0;var vTe=Uq();Object.defineProperty(it,"registerInstrumentations",{enumerable:!0,get:function(){return vTe.registerInstrumentations}});var LTe=cN();Object.defineProperty(it,"InstrumentationBase",{enumerable:!0,get:function(){return LTe.InstrumentationBase}});var DTe=u$();Object.defineProperty(it,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return DTe.InstrumentationNodeModuleDefinition}});var UTe=l$();Object.defineProperty(it,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return UTe.InstrumentationNodeModuleFile}});var pN=sN();Object.defineProperty(it,"isWrapped",{enumerable:!0,get:function(){return pN.isWrapped}});Object.defineProperty(it,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return pN.safeExecuteInTheMiddle}});Object.defineProperty(it,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return pN.safeExecuteInTheMiddleAsync}});var d$=p$();Object.defineProperty(it,"SemconvStability",{enumerable:!0,get:function(){return d$.SemconvStability}});Object.defineProperty(it,"semconvStabilityFromStr",{enumerable:!0,get:function(){return d$.semconvStabilityFromStr}})});var f$=E((bKe,wTe)=>{wTe.exports={name:"@fastify/otel",version:"0.18.0",description:"Official Fastify OpenTelemetry Instrumentation",main:"index.js",type:"commonjs",types:"types/index.d.ts",scripts:{lint:"eslint","lint:fix":"eslint --fix",test:"npm run test:all && npm run test:typescript","test:unit":"c8 --100 node --test","test:all":"npm run test:v4 && npm run test:v5","test:v4":"cross-env FASTIFY_VERSION=fastifyv4 npm run test:unit","test:v5":"cross-env FASTIFY_VERSION=fastify npm run test:unit","test:coverage":"c8 node --test && c8 report --reporter=html","test:typescript":"tsd"},repository:{type:"git",url:"git+https://github.com/fastify/otel.git"},keywords:["plugin","helper","fastify","instrumentation","otel","opentelemetry"],author:"Carlos Fuentes - @metcoder95 (https://metcoder.dev)",license:"MIT",bugs:{url:"https://github.com/fastify/otel/issues"},homepage:"https://github.com/fastify/otel#readme",funding:[{type:"github",url:"https://github.com/sponsors/fastify"},{type:"opencollective",url:"https://opencollective.com/fastify"}],devDependencies:{"@fastify/type-provider-typebox":"^6.1.0","@opentelemetry/context-async-hooks":"^2.0.0","@opentelemetry/contrib-test-utils":"^0.59.0","@opentelemetry/instrumentation-http":"^0.212.0","@opentelemetry/propagator-jaeger":"^2.0.0","@opentelemetry/sdk-trace-base":"^2.0.0","@opentelemetry/sdk-trace-node":"^2.2.0","@types/node":"^25.0.3",c8:"^11.0.0","cross-env":"^10.0.0",eslint:"^9.16.0",fastify:"^5.1.0","fastify-plugin":"^5.1.0",fastifyv4:"npm:fastify@^4.0.0",neostandard:"^0.12.0",tsd:"^0.33.0"},dependencies:{"@opentelemetry/core":"^2.0.0","@opentelemetry/instrumentation":"^0.212.0","@opentelemetry/semantic-conventions":"^1.28.0",minimatch:"^10.2.4"},peerDependencies:{"@opentelemetry/api":"^1.9.0"},tsd:{directory:"types"}}});var h$=E(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.range=pa.balanced=void 0;var kTe=(t,e,n)=>{let r=t instanceof RegExp?m$(t,n):t,o=e instanceof RegExp?m$(e,n):e,s=r!==null&&o!=null&&(0,pa.range)(r,o,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+o.length)}};pa.balanced=kTe;var m$=(t,e)=>{let n=e.match(t);return n?n[0]:null},GTe=(t,e,n)=>{let r,o,s,i,a,c=n.indexOf(t),l=n.indexOf(e,c+1),p=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],s=n.length;p>=0&&!a;){if(p===c)r.push(p),c=n.indexOf(t,p+1);else if(r.length===1){let d=r.pop();d!==void 0&&(a=[d,l])}else o=r.pop(),o!==void 0&&o<s&&(s=o,i=l),l=n.indexOf(e,p+1);p=c<l&&c>=0?c:l}r.length&&i!==void 0&&(a=[s,i])}return a};pa.range=GTe});var y$=E(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.EXPANSION_MAX=void 0;Au.expand=XTe;var T$=h$(),E$="\0SLASH"+Math.random()+"\0",S$="\0OPEN"+Math.random()+"\0",_N="\0CLOSE"+Math.random()+"\0",g$="\0COMMA"+Math.random()+"\0",A$="\0PERIOD"+Math.random()+"\0",BTe=new RegExp(E$,"g"),jTe=new RegExp(S$,"g"),HTe=new RegExp(_N,"g"),FTe=new RegExp(g$,"g"),VTe=new RegExp(A$,"g"),qTe=/\\\\/g,$Te=/\\{/g,YTe=/\\}/g,WTe=/\\,/g,zTe=/\\\./g;Au.EXPANSION_MAX=1e5;function dN(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function KTe(t){return t.replace(qTe,E$).replace($Te,S$).replace(YTe,_N).replace(WTe,g$).replace(zTe,A$)}function QTe(t){return t.replace(BTe,"\\").replace(jTe,"{").replace(HTe,"}").replace(FTe,",").replace(VTe,".")}function R$(t){if(!t)return[""];let e=[],n=(0,T$.balanced)("{","}",t);if(!n)return t.split(",");let{pre:r,body:o,post:s}=n,i=r.split(",");i[i.length-1]+="{"+o+"}";let a=R$(s);return s.length&&(i[i.length-1]+=a.shift(),i.push.apply(i,a)),e.push.apply(e,i),e}function XTe(t,e={}){if(!t)return[];let{max:n=Au.EXPANSION_MAX}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),nd(KTe(t),n,!0).map(QTe)}function JTe(t){return"{"+t+"}"}function ZTe(t){return/^-?0\d/.test(t)}function eEe(t,e){return t<=e}function tEe(t,e){return t>=e}function nd(t,e,n){let r=[],o=(0,T$.balanced)("{","}",t);if(!o)return[t];let s=o.pre,i=o.post.length?nd(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let a=0;a<i.length&&a<e;a++){let c=s+"{"+o.body+"}"+i[a];r.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),l=a||c,p=o.body.indexOf(",")>=0;if(!l&&!p)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+_N+o.post,nd(t,e,!0)):[t];let d;if(l)d=o.body.split(/\.\./);else if(d=R$(o.body),d.length===1&&d[0]!==void 0&&(d=nd(d[0],e,!1).map(JTe),d.length===1))return i.map(f=>o.pre+d[0]+f);let _;if(l&&d[0]!==void 0&&d[1]!==void 0){let f=dN(d[0]),m=dN(d[1]),h=Math.max(d[0].length,d[1].length),T=d.length===3&&d[2]!==void 0?Math.abs(dN(d[2])):1,S=eEe;m<f&&(T*=-1,S=tEe);let I=d.some(ZTe);_=[];for(let x=f;S(x,m);x+=T){let F;if(c)F=String.fromCharCode(x),F==="\\"&&(F="");else if(F=String(x),I){let B=h-F.length;if(B>0){let se=new Array(B+1).join("0");x<0?F="-"+se+F.slice(1):F=se+F}}_.push(F)}}else{_=[];for(let f=0;f<d.length;f++)_.push.apply(_,nd(d[f],e,!1))}for(let f=0;f<_.length;f++)for(let m=0;m<i.length&&r.length<e;m++){let h=s+_[f]+i[m];(!n||l||h)&&r.push(h)}}return r}});var I$=E(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});ST.assertValidPattern=void 0;var nEe=1024*64,rEe=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>nEe)throw new TypeError("pattern is too long")};ST.assertValidPattern=rEe});var N$=E(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});gT.parseClass=void 0;var oEe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},rd=t=>t.replace(/[[\]\\-]/g,"\\$&"),sEe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),O$=t=>t.join(""),iEe=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],s=n+1,i=!1,a=!1,c=!1,l=!1,p=n,d="";e:for(;s<t.length;){let h=t.charAt(s);if((h==="!"||h==="^")&&s===n+1){l=!0,s++;continue}if(h==="]"&&i&&!c){p=s+1;break}if(i=!0,h==="\\"&&!c){c=!0,s++;continue}if(h==="["&&!c){for(let[T,[S,R,I]]of Object.entries(oEe))if(t.startsWith(T,s)){if(d)return["$.",!1,t.length-n,!0];s+=T.length,I?o.push(S):r.push(S),a=a||R;continue e}}if(c=!1,d){h>d?r.push(rd(d)+"-"+rd(h)):h===d&&r.push(rd(h)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(rd(h+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=h,s+=2;continue}r.push(rd(h)),s++}if(p<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,t.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let h=r[0].length===2?r[0].slice(-1):r[0];return[sEe(h),!1,p-n,!1]}let _="["+(l?"^":"")+O$(r)+"]",f="["+(l?"":"^")+O$(o)+"]";return[r.length&&o.length?"("+_+"|"+f+")":r.length?_:f,a,p-n,!0]};gT.parseClass=iEe});var RT=E(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});AT.unescape=void 0;var aEe=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!0}={})=>n?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");AT.unescape=aEe});var hN=E(NT=>{"use strict";var bn;Object.defineProperty(NT,"__esModule",{value:!0});NT.AST=void 0;var cEe=N$(),yT=RT(),uEe=new Set(["!","?","+","*","@"]),fN=t=>uEe.has(t),b$=t=>fN(t.type),lEe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),pEe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),dEe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),C$=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),_Ee="(?!(?:^|/)\\.\\.?(?:$|/))",IT="(?!\\.)",fEe=new Set(["[","."]),mEe=new Set(["..","."]),hEe=new Set("().*{}+?[]^$\\!"),TEe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mN="[^/]",P$=mN+"*?",M$=mN+"+?",EEe=0,OT=class{type;#n;#r;#o=!1;#e=[];#t;#a;#u;#c=!1;#s;#i;#l=!1;id=++EEe;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#n.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,n,r={}){this.type=e,e&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#u=this.#n===this?[]:this.#n.#u,e==="!"&&!this.#n.#c&&this.#u.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#i!==void 0?this.#i:this.type?this.#i=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#i=this.#e.map(e=>String(e)).join("")}#T(){if(this!==this.#n)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let n=e,r=n.#t;for(;r;){for(let o=n.#a+1;!r.type&&o<r.#e.length;o++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof bn&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let e=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#c&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let e=this.#t;for(let n=0;n<this.#a;n++){let r=e.#e[n];if(!(r instanceof bn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let e=this.#t?this.#t.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new bn(this.type,e);for(let r of this.#e)n.copyIn(r);return n}static#p(e,n,r,o,s){let i=o.maxExtglobRecursion??2,a=!1,c=!1,l=-1,p=!1;if(n.type===null){let h=r,T="";for(;h<e.length;){let S=e.charAt(h++);if(a||S==="\\"){a=!a,T+=S;continue}if(c){h===l+1?(S==="^"||S==="!")&&(p=!0):S==="]"&&!(h===l+2&&p)&&(c=!1),T+=S;continue}else if(S==="["){c=!0,l=h,p=!1,T+=S;continue}if(!o.noext&&fN(S)&&e.charAt(h)==="("&&s<=i){n.push(T),T="";let I=new bn(S,n);h=bn.#p(e,I,h,o,s+1),n.push(I);continue}T+=S}return n.push(T),h}let d=r+1,_=new bn(null,n),f=[],m="";for(;d<e.length;){let h=e.charAt(d++);if(a||h==="\\"){a=!a,m+=h;continue}if(c){d===l+1?(h==="^"||h==="!")&&(p=!0):h==="]"&&!(d===l+2&&p)&&(c=!1),m+=h;continue}else if(h==="["){c=!0,l=d,p=!1,m+=h;continue}if(!o.noext&&fN(h)&&e.charAt(d)==="("&&(s<=i||n&&n.#d(h))){let S=n&&n.#d(h)?0:1;_.push(m),m="";let R=new bn(h,_);_.push(R),d=bn.#p(e,R,d,o,s+S);continue}if(h==="|"){_.push(m),m="",f.push(_),_=new bn(null,n);continue}if(h===")")return m===""&&n.#e.length===0&&(n.#l=!0),_.push(m),m="",n.push(...f,_),d;m+=h}return n.type=null,n.#r=void 0,n.#e=[e.substring(r-1)],d}#E(e){return this.#f(e,pEe)}#f(e,n=lEe){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let r=e.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#d(r.type,n)}#d(e,n=dEe){return!!n.get(this.type)?.includes(e)}#S(e,n){let r=e.#e[0],o=new bn(null,r,this.options);o.#e.push(""),r.push(o),this.#m(e,n)}#m(e,n){let r=e.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#i=void 0}#g(e){return!!C$.get(this.type)?.has(e)}#A(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#g(n.type)}#R(e){let n=C$.get(this.type),r=e.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let s of this.#e)typeof s=="object"&&(s.#t=this);this.type=o,this.#i=void 0,this.#l=!1}static fromGlob(e,n={}){let r=new bn(null,void 0,n);return bn.#p(e,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let e=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#s}toRegExpSource(e){let n=e??!!this.#s.dot;if(this.#n===this&&(this.#_(),this.#T()),!b$(this)){let c=this.isStart()&&this.isEnd()&&!this.#e.some(f=>typeof f!="string"),l=this.#e.map(f=>{let[m,h,T,S]=typeof f=="string"?bn.#y(f,this.#r,c):f.toRegExpSource(e);return this.#r=this.#r||T,this.#o=this.#o||S,m}).join(""),p="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&mEe.has(this.#e[0]))){let m=fEe,h=n&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),T=!n&&!e&&m.has(l.charAt(0));p=h?_Ee:T?IT:""}let d="";return this.isEnd()&&this.#n.#c&&this.#t?.type==="!"&&(d="(?:$|\\/)"),[p+l+d,(0,yT.unescape)(l),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),l=this;return l.#e=[c],l.type=null,l.#r=void 0,[c,(0,yT.unescape)(this.toString()),!1,!1]}let i=!r||e||n||!IT?"":this.#h(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!n?IT:"")+M$;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?IT:"")+P$+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`;a=o+s+c}return[a,(0,yT.unescape)(s),this.#r=!!this.#r,this.#o]}#_(){if(b$(this)){let e=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#_(),this.#f(o)?(n=!1,this.#m(o,r)):this.#E(o)?(n=!1,this.#S(o,r)):this.#A(o)&&(n=!1,this.#R(o)))}}while(!n&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#_();this.#i=void 0}#h(e){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,s,i]=n.toRegExpSource(e);return this.#o=this.#o||i,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#y(e,n,r=!1){let o=!1,s="",i=!1,a=!1;for(let c=0;c<e.length;c++){let l=e.charAt(c);if(o){o=!1,s+=(hEe.has(l)?"\\":"")+l;continue}if(l==="*"){if(a)continue;a=!0,s+=r&&/^[*]+$/.test(e)?M$:P$,n=!0;continue}else a=!1;if(l==="\\"){c===e.length-1?s+="\\\\":o=!0;continue}if(l==="["){let[p,d,_,f]=(0,cEe.parseClass)(e,c);if(_){s+=p,i=i||d,c+=_-1,n=n||f;continue}}if(l==="?"){s+=mN,n=!0;continue}s+=TEe(l)}return[s,(0,yT.unescape)(e),!!n,i]}};NT.AST=OT;bn=OT});var TN=E(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});bT.escape=void 0;var SEe=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!1}={})=>n?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");bT.escape=SEe});var k$=E(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.unescape=k.escape=k.AST=k.Minimatch=k.match=k.makeRe=k.braceExpand=k.defaults=k.filter=k.GLOBSTAR=k.sep=k.minimatch=void 0;var gEe=y$(),CT=I$(),L$=hN(),AEe=TN(),REe=RT(),yEe=(t,e,n={})=>((0,CT.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new da(e,n).match(t));k.minimatch=yEe;var IEe=/^\*+([^+@!?\*\[\(]*)$/,OEe=t=>e=>!e.startsWith(".")&&e.endsWith(t),NEe=t=>e=>e.endsWith(t),bEe=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),CEe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),PEe=/^\*+\.\*+$/,MEe=t=>!t.startsWith(".")&&t.includes("."),xEe=t=>t!=="."&&t!==".."&&t.includes("."),vEe=/^\.\*+$/,LEe=t=>t!=="."&&t!==".."&&t.startsWith("."),DEe=/^\*+$/,UEe=t=>t.length!==0&&!t.startsWith("."),wEe=t=>t.length!==0&&t!=="."&&t!=="..",kEe=/^\?+([^+@!?\*\[\(]*)?$/,GEe=([t,e=""])=>{let n=D$([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},BEe=([t,e=""])=>{let n=U$([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},jEe=([t,e=""])=>{let n=U$([t]);return e?r=>n(r)&&r.endsWith(e):n},HEe=([t,e=""])=>{let n=D$([t]);return e?r=>n(r)&&r.endsWith(e):n},D$=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},U$=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},w$=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",x$={win32:{sep:"\\"},posix:{sep:"/"}};k.sep=w$==="win32"?x$.win32.sep:x$.posix.sep;k.minimatch.sep=k.sep;k.GLOBSTAR=Symbol("globstar **");k.minimatch.GLOBSTAR=k.GLOBSTAR;var FEe="[^/]",VEe=FEe+"*?",qEe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",$Ee="(?:(?!(?:\\/|^)\\.).)*?",YEe=(t,e={})=>n=>(0,k.minimatch)(n,t,e);k.filter=YEe;k.minimatch.filter=k.filter;var cr=(t,e={})=>Object.assign({},t,e),WEe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return k.minimatch;let e=k.minimatch;return Object.assign((r,o,s={})=>e(r,o,cr(t,s)),{Minimatch:class extends e.Minimatch{constructor(o,s={}){super(o,cr(t,s))}static defaults(o){return e.defaults(cr(t,o)).Minimatch}},AST:class extends e.AST{constructor(o,s,i={}){super(o,s,cr(t,i))}static fromGlob(o,s={}){return e.AST.fromGlob(o,cr(t,s))}},unescape:(r,o={})=>e.unescape(r,cr(t,o)),escape:(r,o={})=>e.escape(r,cr(t,o)),filter:(r,o={})=>e.filter(r,cr(t,o)),defaults:r=>e.defaults(cr(t,r)),makeRe:(r,o={})=>e.makeRe(r,cr(t,o)),braceExpand:(r,o={})=>e.braceExpand(r,cr(t,o)),match:(r,o,s={})=>e.match(r,o,cr(t,s)),sep:e.sep,GLOBSTAR:k.GLOBSTAR})};k.defaults=WEe;k.minimatch.defaults=k.defaults;var zEe=(t,e={})=>((0,CT.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,gEe.expand)(t,{max:e.braceExpandMax}));k.braceExpand=zEe;k.minimatch.braceExpand=k.braceExpand;var KEe=(t,e={})=>new da(t,e).makeRe();k.makeRe=KEe;k.minimatch.makeRe=k.makeRe;var QEe=(t,e,n={})=>{let r=new da(e,n);return t=t.filter(o=>r.match(o)),r.options.nonull&&!t.length&&t.push(e),t};k.match=QEe;k.minimatch.match=k.match;var v$=/[?*]|[+@!]\(.*?\)|\[|\]/,XEe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),da=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,n={}){(0,CT.assertValidPattern)(e),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=e,this.platform=n.platform||w$,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,i,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!v$.test(s[2]))&&!v$.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(p=>this.parse(p))];if(l)return[s[0],...s.slice(1).map(p=>this.parse(p))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let o=0;o<e[r].length;o++)e[r][o]==="**"&&(e[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,o)=>{let s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let s=e[o];o===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let o=e[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let a=r[o+1],c=r[o+2],l=r[o+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(o,1);let p=r.slice(0);p[o]="**",e.push(p),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){let a=r[i];i===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(i,1),i--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let o=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(o){e[n]=[],e[r]=o;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let o=0,s=0,i=[],a="";for(;o<e.length&&s<n.length;)if(e[o]===n[s])i.push(a==="b"?n[s]:e[o]),o++,s++;else if(r&&e[o]==="**"&&n[s]===e[o+1])i.push(e[o]),o++;else if(r&&n[s]==="**"&&e[o]===n[s+1])i.push(n[s]),s++;else if(e[o]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",i.push(e[o]),o++,s++}else if(n[s]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(a==="a")return!1;a="b",i.push(n[s]),o++,s++}else return!1;return e.length===n.length&&i}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let o=0;o<e.length&&e.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let o=0,s=0;if(this.isWindows){let a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),c=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),l=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),p=!l&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),d=c?3:a?0:void 0,_=p?3:l?0:void 0;if(typeof d=="number"&&typeof _=="number"){let[f,m]=[e[d],n[_]];f.toLowerCase()===m.toLowerCase()&&(n[_]=f,s=_,o=d)}}let{optimizationLevel:i=1}=this.options;return i>=2&&(e=this.levelTwoFileOptimize(e)),n.includes(k.GLOBSTAR)?this.#n(e,n,r,o,s):this.#o(e,n,r,o,s)}#n(e,n,r,o,s){let i=n.indexOf(k.GLOBSTAR,s),a=n.lastIndexOf(k.GLOBSTAR),[c,l,p]=r?[n.slice(s,i),n.slice(i+1),[]]:[n.slice(s,i),n.slice(i+1,a),n.slice(a+1)];if(c.length){let R=e.slice(o,o+c.length);if(!this.#o(R,c,r,0,0))return!1;o+=c.length,s+=c.length}let d=0;if(p.length){if(p.length+o>e.length)return!1;let R=e.length-p.length;if(this.#o(e,p,r,R,0))d=p.length;else{if(e[e.length-1]!==""||o+p.length===e.length||(R--,!this.#o(e,p,r,R,0)))return!1;d=p.length+1}}if(!l.length){let R=!!d;for(let I=o;I<e.length-d;I++){let x=String(e[I]);if(R=!0,x==="."||x===".."||!this.options.dot&&x.startsWith("."))return!1}return r||R}let _=[[[],0]],f=_[0],m=0,h=[0];for(let R of l)R===k.GLOBSTAR?(h.push(m),f=[[],0],_.push(f)):(f[0].push(R),m++);let T=_.length-1,S=e.length-d;for(let R of _)R[1]=S-(h[T--]+R[0].length);return!!this.#r(e,_,o,0,r,0,!!d)}#r(e,n,r,o,s,i,a){let c=n[o];if(!c){for(let d=r;d<e.length;d++){a=!0;let _=e[d];if(_==="."||_===".."||!this.options.dot&&_.startsWith("."))return!1}return a}let[l,p]=c;for(;r<=p;){if(this.#o(e.slice(0,r+l.length),l,s,r,0)&&i<this.maxGlobstarRecursion){let f=this.#r(e,n,r+l.length,o+1,s,i+1,a);if(f!==!1)return f}let _=e[r];if(_==="."||_===".."||!this.options.dot&&_.startsWith("."))return!1;r++}return s||null}#o(e,n,r,o,s){let i,a,c,l;for(i=o,a=s,l=e.length,c=n.length;i<l&&a<c;i++,a++){this.debug("matchOne loop");let p=n[a],d=e[i];if(this.debug(n,p,d),p===!1||p===k.GLOBSTAR)return!1;let _;if(typeof p=="string"?(_=d===p,this.debug("string match",p,d,_)):(_=p.test(d),this.debug("pattern match",p,d,_)),!_)return!1}if(i===l&&a===c)return!0;if(i===l)return r;if(a===c)return i===l-1&&e[i]==="";throw new Error("wtf?")}braceExpand(){return(0,k.braceExpand)(this.pattern,this.options)}parse(e){(0,CT.assertValidPattern)(e);let n=this.options;if(e==="**")return k.GLOBSTAR;if(e==="")return"";let r,o=null;(r=e.match(DEe))?o=n.dot?wEe:UEe:(r=e.match(IEe))?o=(n.nocase?n.dot?CEe:bEe:n.dot?NEe:OEe)(r[1]):(r=e.match(kEe))?o=(n.nocase?n.dot?BEe:GEe:n.dot?jEe:HEe)(r):(r=e.match(PEe))?o=n.dot?xEe:MEe:(r=e.match(vEe))&&(o=LEe);let s=L$.AST.fromGlob(e,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?VEe:n.dot?qEe:$Ee,o=new Set(n.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(d=>{if(d instanceof RegExp)for(let _ of d.flags.split(""))o.add(_);return typeof d=="string"?XEe(d):d===k.GLOBSTAR?k.GLOBSTAR:d._src});l.forEach((d,_)=>{let f=l[_+1],m=l[_-1];d!==k.GLOBSTAR||m===k.GLOBSTAR||(m===void 0?f!==void 0&&f!==k.GLOBSTAR?l[_+1]="(?:\\/|"+r+"\\/)?"+f:l[_]=r:f===void 0?l[_-1]=m+"(?:\\/|\\/"+r+")?":f!==k.GLOBSTAR&&(l[_-1]=m+"(?:\\/|\\/"+r+"\\/)"+f,l[_+1]=k.GLOBSTAR))});let p=l.filter(d=>d!==k.GLOBSTAR);if(this.partial&&p.length>=1){let d=[];for(let _=1;_<=p.length;_++)d.push(p.slice(0,_).join("/"));return"(?:"+d.join("|")+")"}return p.join("/")}).join("|"),[i,a]=e.length>1?["(?:",")"]:["",""];s="^"+i+s+a+"$",this.partial&&(s="^(?:\\/|"+i+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let a=o.length-2;!i&&a>=0;a--)i=o[a];for(let a=0;a<s.length;a++){let c=s[a],l=o;if(r.matchBase&&c.length===1&&(l=[i]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return k.minimatch.defaults(e).Minimatch}};k.Minimatch=da;var JEe=hN();Object.defineProperty(k,"AST",{enumerable:!0,get:function(){return JEe.AST}});var ZEe=TN();Object.defineProperty(k,"escape",{enumerable:!0,get:function(){return ZEe.escape}});var eSe=RT();Object.defineProperty(k,"unescape",{enumerable:!0,get:function(){return eSe.unescape}});k.minimatch.AST=L$.AST;k.minimatch.Minimatch=da;k.minimatch.escape=AEe.escape;k.minimatch.unescape=REe.unescape});var q$=E((GKe,gN)=>{"use strict";var G$=U("node:diagnostics_channel"),{context:PT,trace:EN,SpanStatusCode:MT,propagation:SN,diag:tSe}=(b(),O(v)),{getRPCMetadata:nSe,RPCType:rSe}=Te(),{ATTR_HTTP_ROUTE:xT,ATTR_HTTP_RESPONSE_STATUS_CODE:B$,ATTR_HTTP_REQUEST_METHOD:oSe,ATTR_URL_PATH:sSe}=(le(),O(Ae)),{InstrumentationBase:iSe}=_$(),{version:aSe,name:j$}=f$(),cSe=">=4.0.0 <6",H$=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],Me={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},qs={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},qo="anonymous",$s=Symbol("fastify otel instance"),Ys=Symbol("fastify otel request spans"),od=Symbol("fastify otel request context"),F$=Symbol("fastify otel addhook original"),V$=Symbol("fastify otel setnotfound original"),sd=Symbol("fastify otel ignore path"),id=Symbol("fastify otel record exceptions"),vT=class extends iSe{logger=null;_requestHook=null;_lifecycleHook=null;constructor(e){if(super(j$,aSe,e),this.logger=tSe.createComponentLogger({namespace:j$}),this[sd]=null,this[id]=!0,e?.recordExceptions!=null){if(typeof e.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[id]=e.recordExceptions}if(typeof e?.requestHook=="function"&&(this._requestHook=e.requestHook),typeof e?.lifecycleHook=="function"&&(this._lifecycleHook=e.lifecycleHook),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=null;this[sd]=o=>typeof n=="function"?n(o):(r==null&&(r=k$().minimatch),r(o.url,n))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=e=>{this.plugin()(e.fastify,void 0,()=>{});let n=(r,o,s)=>{s()};n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",e.fastify.register(n)},G$.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(G$.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:cSe,name:"@fastify/otel"},n;function n(r,o,s){r.decorate($s,e),r.decorate(F$,r.addHook),r.decorate(V$,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let f=this[od],m=this[Ys];return{enabled:this.routeOptions.config?.otel!==!1,span:m,tracer:e.tracer,context:f,inject:(h,T)=>SN.inject(f,h,T),extract:(h,T)=>SN.extract(f,h,T)}}),r.decorateRequest(Ys,null),r.decorateRequest(od,null),r.addHook("onRoute",function(f){if(e[sd]?.(f)===!0){e.logger.debug(`Ignoring route instrumentation ${f.method} ${f.url} because it matches the ignore path`);return}if(f.config?.otel===!1){e.logger.debug(`Ignoring route instrumentation ${f.method} ${f.url} because it is disabled`);return}for(let m of H$)if(f[m]!=null){let h=f[m];if(typeof h=="function")f[m]=d(h,m,{[Me.HOOK_NAME]:`${this.pluginName} - route -> ${m}`,[Me.FASTIFY_TYPE]:qs.ROUTE,[xT]:f.url,[Me.HOOK_CALLBACK_NAME]:h.name?.length>0?h.name:qo});else if(Array.isArray(h)){let T=[];for(let S of h)T.push(d(S,m,{[Me.HOOK_NAME]:`${this.pluginName} - route -> ${m}`,[Me.FASTIFY_TYPE]:qs.ROUTE,[xT]:f.url,[Me.HOOK_CALLBACK_NAME]:S.name?.length>0?S.name:qo}));f[m]=T}}f.onSend!=null?f.onSend=Array.isArray(f.onSend)?[...f.onSend,i]:[f.onSend,i]:f.onSend=i,f.onError!=null?f.onError=Array.isArray(f.onError)?[...f.onError,a]:[f.onError,a]:f.onError=a,f.handler=d(f.handler,"handler",{[Me.HOOK_NAME]:`${this.pluginName} - route-handler`,[Me.FASTIFY_TYPE]:qs.HANDLER,[xT]:f.url,[Me.HOOK_CALLBACK_NAME]:f.handler.name.length>0?f.handler.name:qo})}),r.addHook("onRequest",function(f,m,h){if(this[$s].isEnabled()===!1||f.routeOptions.config?.otel===!1)return h();if(this[$s][sd]?.({url:f.url,method:f.method})===!0)return this[$s].logger.debug(`Ignoring request ${f.method} ${f.url} because it matches the ignore path`),h();let T=PT.active();EN.getSpan(T)==null&&(T=SN.extract(T,f.headers));let S=nSe(T);f.routeOptions.url!=null&&S?.type===rSe.HTTP&&(S.route=f.routeOptions.url);let R={[Me.ROOT]:"@fastify/otel",[oSe]:f.method,[sSe]:f.url};f.routeOptions.url!=null&&(R[xT]=f.routeOptions.url);let I=this[$s].tracer.startSpan("request",{attributes:R},T);try{this[$s]._requestHook?.(I,f)}catch(x){this[$s].logger.error({err:x},"requestHook threw")}f[od]=EN.setSpan(T,I),f[Ys]=I,PT.with(f[od],()=>{h()})}),r.addHook("onResponse",function(f,m,h){let T=f[Ys];T!=null&&(T.setAttributes({[B$]:m.statusCode}),T.end()),f[Ys]=null,h()}),r.addHook=c,r.setNotFoundHandler=l,s();function i(_,f,m,h){let T=_[Ys];T!=null&&(f.statusCode>=500&&T.setStatus({code:MT.ERROR}),T.setAttributes({[B$]:f.statusCode}),T.end()),_[Ys]=null,h(null,m)}function a(_,f,m,h){let T=_[Ys];T!=null&&(T.setStatus({code:MT.ERROR,message:m.message}),e[id]!==!1&&T.recordException(m)),h()}function c(_,f){let m=this[F$];return H$.includes(_)?m.call(this,_,d(f,_,{[Me.HOOK_NAME]:`${this.pluginName} - ${_}`,[Me.FASTIFY_TYPE]:qs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:f.name?.length>0?f.name:qo})):m.call(this,_,f)}function l(_,f){let m=this[V$];typeof _=="function"?(f=d(_,"notFoundHandler",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Me.FASTIFY_TYPE]:qs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:qo}),m.call(this,f)):(_.preValidation!=null&&(_.preValidation=d(_.preValidation,"notFoundHandler - preValidation",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[Me.FASTIFY_TYPE]:qs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:_.preValidation.name?.length>0?_.preValidation.name:qo})),_.preHandler!=null&&(_.preHandler=d(_.preHandler,"notFoundHandler - preHandler",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[Me.FASTIFY_TYPE]:qs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:_.preHandler.name?.length>0?_.preHandler.name:qo})),f=d(f,"notFoundHandler",{[Me.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Me.FASTIFY_TYPE]:qs.INSTANCE,[Me.HOOK_CALLBACK_NAME]:f.name?.length>0?f.name:qo}),m.call(this,_,f))}function p(_){for(let f of _)if(f?.routeOptions&&f.url&&f.method)return f;return null}function d(_,f,m={}){return function(...T){let S=this[$s],R=p(T);if(R===null)return S.logger.debug(`Ignoring route instrumentation because ${f} was called without a Fastify request argument`),_.call(this,...T);if(S.isEnabled()===!1||R.routeOptions.config?.otel===!1)return S.logger.debug(`Ignoring route instrumentation ${R.routeOptions.method} ${R.routeOptions.url} because it is disabled`),_.call(this,...T);if(S[sd]?.({url:R.url,method:R.method})===!0)return S.logger.debug(`Ignoring route instrumentation ${R.routeOptions.method} ${R.routeOptions.url} because it matches the ignore path`),_.call(this,...T);let I=R[od]??PT.active(),x=_.name?.length>0?_.name:this.pluginName??qo,F=S.tracer.startSpan(`${f} - ${x}`,{attributes:m},I);if(S._lifecycleHook!=null)try{S._lifecycleHook(F,{hookName:f,request:R,handler:x})}catch(B){S.logger.error({err:B},"Execution of lifecycleHook failed")}return PT.with(EN.setSpan(I,F),function(){try{let B=_.call(this,...T);return typeof B?.then=="function"?B.then(se=>(F.end(),se),se=>(F.setStatus({code:MT.ERROR,message:se.message}),S[id]!==!1&&F.recordException(se),F.end(),Promise.reject(se))):(F.end(),B)}catch(B){throw F.setStatus({code:MT.ERROR,message:B.message}),S[id]!==!1&&F.recordException(B),F.end(),B}},this)}}}}};gN.exports=vT;gN.exports.FastifyOtelInstrumentation=vT});var yN=E(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.SpanNames=Dr.TokenKind=Dr.AllowedOperationTypes=void 0;var TSe;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(TSe=Dr.AllowedOperationTypes||(Dr.AllowedOperationTypes={}));var ESe;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(ESe=Dr.TokenKind||(Dr.TokenKind={}));var SSe;(function(t){t.EXECUTE="graphql.execute",t.PARSE="graphql.parse",t.RESOLVE="graphql.resolve",t.VALIDATE="graphql.validate",t.SCHEMA_VALIDATE="graphql.validateSchema",t.SCHEMA_PARSE="graphql.parseSchema"})(SSe=Dr.SpanNames||(Dr.SpanNames={}))});var IN=E(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.AttributeNames=void 0;var gSe;(function(t){t.SOURCE="graphql.source",t.FIELD_NAME="graphql.field.name",t.FIELD_PATH="graphql.field.path",t.FIELD_TYPE="graphql.field.type",t.PARENT_NAME="graphql.parent.name",t.OPERATION_TYPE="graphql.operation.type",t.OPERATION_NAME="graphql.operation.name",t.VARIABLES="graphql.variables.",t.ERROR_VALIDATION_NAME="graphql.validation.error"})(gSe=ld.AttributeNames||(ld.AttributeNames={}))});var kT=E(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.OTEL_GRAPHQL_DATA_SYMBOL=Ru.OTEL_PATCHED_SYMBOL=void 0;Ru.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");Ru.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var nY=E(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0});GT.OPERATION_NOT_SUPPORTED=void 0;var o2e=kT();GT.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var hY=E(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.wrapFieldResolver=ht.wrapFields=ht.getSourceFromLocation=ht.getOperation=ht.endSpan=ht.addSpanSource=ht.addInputVariableAttributes=ht.isPromise=void 0;var yu=(b(),O(v)),Ws=yN(),fa=IN(),Yo=kT(),rY=Object.values(Ws.AllowedOperationTypes),ASe=t=>typeof t?.then=="function";ht.isPromise=ASe;var RSe=t=>typeof t=="object"&&t!==null;function ON(t,e,n){Array.isArray(n)?n.forEach((r,o)=>{ON(t,`${e}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{ON(t,`${e}.${r}`,o)}):t.setAttribute(`${fa.AttributeNames.VARIABLES}${String(e)}`,n)}function ySe(t,e){Object.entries(e).forEach(([n,r])=>{ON(t,n,r)})}ht.addInputVariableAttributes=ySe;function aY(t,e,n,r,o){let s=dY(e,n,r,o);t.setAttribute(fa.AttributeNames.SOURCE,s)}ht.addSpanSource=aY;function ISe(t,e,n,r,o){let s=cY(n,o);if(s)return{field:s,spanAdded:!1};let a=e().flatResolveSpans?lY(n):uY(n,o);return s={span:OSe(t,e,n,r,o,a)},CSe(n,o,s),{field:s,spanAdded:!0}}function OSe(t,e,n,r,o,s){let i={[fa.AttributeNames.FIELD_NAME]:r.fieldName,[fa.AttributeNames.FIELD_PATH]:o.join("."),[fa.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[fa.AttributeNames.PARENT_NAME]:r.parentType.name},a=t.startSpan(`${Ws.SpanNames.RESOLVE} ${i[fa.AttributeNames.FIELD_PATH]}`,{attributes:i},s?yu.trace.setSpan(yu.context.active(),s):void 0),c=n[Yo.OTEL_GRAPHQL_DATA_SYMBOL].source,l=r.fieldNodes.find(p=>p.kind==="Field");return l&&aY(a,c.loc,e().allowValues,l.loc?.start,l.loc?.end),a}function NSe(t,e){e&&t.recordException(e),t.end()}ht.endSpan=NSe;function bSe(t,e){if(!(!t||!Array.isArray(t.definitions)))return e?t.definitions.filter(n=>rY.indexOf(n?.operation)!==-1).find(n=>e===n?.name?.value):t.definitions.find(n=>rY.indexOf(n?.operation)!==-1)}ht.getOperation=bSe;function CSe(t,e,n){return t[Yo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]=n}function cY(t,e){return t[Yo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]}function uY(t,e){for(let n=e.length-1;n>0;n--){let r=cY(t,e.slice(0,n));if(r)return r.span}return lY(t)}function lY(t){return t[Yo.OTEL_GRAPHQL_DATA_SYMBOL].span}function PSe(t,e){let n=[],r=e;for(;r;){let o=r.key;t&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function MSe(t){return pY(`
11
+ `,t)}function oY(t){return pY(" ",t)}function pY(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}var xSe=[Ws.TokenKind.FLOAT,Ws.TokenKind.STRING,Ws.TokenKind.INT,Ws.TokenKind.BLOCK_STRING];function dY(t,e=!1,n,r){let o="";if(t?.startToken){let s=typeof n=="number"?n:t.start,i=typeof r=="number"?r:t.end,a=t.startToken.next,c=1;for(;a;){if(a.start<s){a=a.next,c=a?.line;continue}if(a.end>i){a=a.next,c=a?.line;continue}let l=a.value||a.kind,p="";!e&&xSe.indexOf(a.kind)>=0&&(l="*"),a.kind===Ws.TokenKind.STRING&&(l=`"${l}"`),a.kind===Ws.TokenKind.EOF&&(l=""),a.line>c?(o+=MSe(a.line-c),c=a.line,p=oY(a.column-1)):a.line===a.prev?.line&&(p=oY(a.start-(a.prev?.end||0))),o+=p+l,a&&(a=a.next)}}return o}ht.getSourceFromLocation=dY;function _Y(t,e,n){if(!t||t[Yo.OTEL_PATCHED_SYMBOL])return;let r=t.getFields();t[Yo.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let s=r[o];if(s&&(s.resolve&&(s.resolve=mY(e,n,s.resolve)),s.type)){let i=fY(s.type);for(let a of i)_Y(a,e,n)}})}ht.wrapFields=_Y;function fY(t){return"ofType"in t?fY(t.ofType):vSe(t)?t.getTypes():LSe(t)?[t]:[]}function vSe(t){return"getTypes"in t&&typeof t.getTypes=="function"}function LSe(t){return"getFields"in t&&typeof t.getFields=="function"}var sY=(t,e,n)=>{n&&(t.recordException(e),t.setStatus({code:yu.SpanStatusCode.ERROR,message:e.message}),t.end())},iY=(t,e)=>{e&&t.end()};function mY(t,e,n,r=!1){if(o[Yo.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(s,i,a,c){if(!n)return;let l=e();if(l.ignoreTrivialResolveSpans&&r&&(RSe(s)||typeof s=="function")&&typeof s[c.fieldName]!="function")return n.call(this,s,i,a,c);if(!a[Yo.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,s,i,a,c);let p=PSe(l.mergeItems,c&&c.path),d=p.filter(m=>typeof m=="string").length,_,f=!1;if(l.depth>=0&&l.depth<d)_=uY(a,p);else{let{field:m,spanAdded:h}=ISe(t,e,a,c,p);_=m.span,f=h}return yu.context.with(yu.trace.setSpan(yu.context.active(),_),()=>{try{let m=n.call(this,s,i,a,c);return(0,ht.isPromise)(m)?m.then(h=>(iY(_,f),h),h=>{throw sY(_,h,f),h}):(iY(_,f),m)}catch(m){throw sY(_,m,f),m}})}return o[Yo.OTEL_PATCHED_SYMBOL]=!0,o}ht.wrapFieldResolver=mY});var TY=E(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.PACKAGE_NAME=Iu.PACKAGE_VERSION=void 0;Iu.PACKAGE_VERSION="0.62.0";Iu.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var gY=E(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});HT.GraphQLInstrumentation=void 0;var Wo=(b(),O(v)),ur=ne(),pd=yN(),BT=IN(),NN=kT(),DSe=nY(),Qt=hY(),EY=TY(),SY={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},jT=[">=14.0.0 <17"],bN=class extends ur.InstrumentationBase{constructor(e={}){super(EY.PACKAGE_NAME,EY.PACKAGE_VERSION,{...SY,...e})}setConfig(e={}){super.setConfig({...SY,...e})}init(){let e=new ur.InstrumentationNodeModuleDefinition("graphql",jT);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new ur.InstrumentationNodeModuleFile("graphql/execution/execute.js",jT,e=>((0,ur.isWrapped)(e.execute)&&this._unwrap(e,"execute"),this._wrap(e,"execute",this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,"execute")})}_addPatchingParser(){return new ur.InstrumentationNodeModuleFile("graphql/language/parser.js",jT,e=>((0,ur.isWrapped)(e.parse)&&this._unwrap(e,"parse"),this._wrap(e,"parse",this._patchParse()),e),e=>{e&&this._unwrap(e,"parse")})}_addPatchingValidate(){return new ur.InstrumentationNodeModuleFile("graphql/validation/validate.js",jT,e=>((0,ur.isWrapped)(e.validate)&&this._unwrap(e,"validate"),this._wrap(e,"validate",this._patchValidate()),e),e=>{e&&this._unwrap(e,"validate")})}_patchExecute(e){let n=this;return function(o){return function(){let i;if(arguments.length>=2){let l=arguments;i=n._wrapExecuteArgs(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],e)}else{let l=arguments[0];i=n._wrapExecuteArgs(l.schema,l.document,l.rootValue,l.contextValue,l.variableValues,l.operationName,l.fieldResolver,l.typeResolver,e)}let a=(0,Qt.getOperation)(i.document,i.operationName),c=n._createExecuteSpan(a,i);return i.contextValue[NN.OTEL_GRAPHQL_DATA_SYMBOL]={source:i.document?i.document||i.document[NN.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:c,fields:{}},Wo.context.with(Wo.trace.setSpan(Wo.context.active(),c),()=>(0,ur.safeExecuteInTheMiddle)(()=>o.apply(this,[i]),(l,p)=>{n._handleExecutionResult(c,l,p)}))}}}_handleExecutionResult(e,n,r){let o=this.getConfig();if(r===void 0||n){(0,Qt.endSpan)(e,n);return}if((0,Qt.isPromise)(r))r.then(s=>{if(typeof o.responseHook!="function"){(0,Qt.endSpan)(e);return}this._executeResponseHook(e,s)},s=>{(0,Qt.endSpan)(e,s)});else{if(typeof o.responseHook!="function"){(0,Qt.endSpan)(e);return}this._executeResponseHook(e,r)}}_executeResponseHook(e,n){let{responseHook:r}=this.getConfig();r&&(0,ur.safeExecuteInTheMiddle)(()=>{r(e,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,Qt.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(r){return function(s,i){return e._parse(this,r,s,i)}}}_patchValidate(){let e=this;return function(r){return function(s,i,a,c,l){return e._validate(this,r,s,i,a,l,c)}}}_parse(e,n,r,o){let s=this.getConfig(),i=this.tracer.startSpan(pd.SpanNames.PARSE);return Wo.context.with(Wo.trace.setSpan(Wo.context.active(),i),()=>(0,ur.safeExecuteInTheMiddle)(()=>n.call(e,r,o),(a,c)=>{c&&((0,Qt.getOperation)(c)?c.loc&&(0,Qt.addSpanSource)(i,c.loc,s.allowValues):i.updateName(pd.SpanNames.SCHEMA_PARSE)),(0,Qt.endSpan)(i,a)}))}_validate(e,n,r,o,s,i,a){let c=this.tracer.startSpan(pd.SpanNames.VALIDATE,{});return Wo.context.with(Wo.trace.setSpan(Wo.context.active(),c),()=>(0,ur.safeExecuteInTheMiddle)(()=>n.call(e,r,o,s,a,i),(l,p)=>{o.loc||c.updateName(pd.SpanNames.SCHEMA_VALIDATE),p&&p.length&&c.recordException({name:BT.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(p)}),(0,Qt.endSpan)(c,l)}))}_createExecuteSpan(e,n){let r=this.getConfig(),o=this.tracer.startSpan(pd.SpanNames.EXECUTE,{});if(e){let{operation:s,name:i}=e;o.setAttribute(BT.AttributeNames.OPERATION_TYPE,s);let a=i?.value;a?(o.setAttribute(BT.AttributeNames.OPERATION_NAME,a),o.updateName(`${s} ${a}`)):o.updateName(s)}else{let s=" ";n.operationName&&(s=` "${n.operationName}" `),s=DSe.OPERATION_NOT_SUPPORTED.replace("$operationName$",s),o.setAttribute(BT.AttributeNames.OPERATION_NAME,s)}return n.document?.loc&&(0,Qt.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,Qt.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(e,n,r,o,s,i,a,c,l){if(o||(o={}),o[NN.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c};let p=a==null,d=a??l;return a=(0,Qt.wrapFieldResolver)(this.tracer,()=>this.getConfig(),d,p),e&&((0,Qt.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,Qt.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c}}};HT.GraphQLInstrumentation=bN});var AY=E(FT=>{"use strict";Object.defineProperty(FT,"__esModule",{value:!0});FT.GraphQLInstrumentation=void 0;var USe=gY();Object.defineProperty(FT,"GraphQLInstrumentation",{enumerable:!0,get:function(){return USe.GraphQLInstrumentation}})});var bY=E(VT=>{"use strict";Object.defineProperty(VT,"__esModule",{value:!0});VT.EVENT_LISTENERS_SET=void 0;VT.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var CY=E(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});qT.bufferTextMapGetter=void 0;qT.bufferTextMapGetter={get(t,e){if(!t)return;let n=Object.keys(t);for(let r of n)if(r===e||r.toLowerCase()===e)return t[r]?.toString()},keys(t){return t?Object.keys(t):[]}}});var PY=E(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.METRIC_MESSAGING_PROCESS_DURATION=_e.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=_e.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=_e.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=_e.MESSAGING_SYSTEM_VALUE_KAFKA=_e.MESSAGING_OPERATION_TYPE_VALUE_SEND=_e.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=_e.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=_e.ATTR_MESSAGING_SYSTEM=_e.ATTR_MESSAGING_OPERATION_TYPE=_e.ATTR_MESSAGING_OPERATION_NAME=_e.ATTR_MESSAGING_KAFKA_OFFSET=_e.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=_e.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=_e.ATTR_MESSAGING_DESTINATION_PARTITION_ID=_e.ATTR_MESSAGING_DESTINATION_NAME=_e.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;_e.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";_e.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";_e.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";_e.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";_e.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";_e.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";_e.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";_e.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";_e.ATTR_MESSAGING_SYSTEM="messaging.system";_e.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";_e.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";_e.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";_e.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";_e.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";_e.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";_e.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";_e.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var MY=E(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.PACKAGE_NAME=Ou.PACKAGE_VERSION=void 0;Ou.PACKAGE_VERSION="0.23.0";Ou.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var wY=E(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});YT.KafkaJsInstrumentation=void 0;var ye=(b(),O(v)),lr=ne(),Nu=(le(),O(Ae)),xY=bY(),vY=CY(),G=PY(),LY=MY();function $T(t,e,n){return r=>{t.add(e,{...n,...r?{[Nu.ATTR_ERROR_TYPE]:r}:{}})}}function DY(t,e,n){return r=>{t.record((Date.now()-e)/1e3,{...n,...r?{[Nu.ATTR_ERROR_TYPE]:r}:{}})}}var UY=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],CN=class extends lr.InstrumentationBase{constructor(e={}){super(LY.PACKAGE_NAME,LY.PACKAGE_VERSION,e)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(G.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:UY}}),this._sentMessages=this.meter.createCounter(G.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(G.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(G.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:UY}})}init(){let e=r=>{(0,lr.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,lr.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new lr.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(e(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),e)}_getConsumerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,lr.isWrapped)(s.run)&&e._unwrap(s,"run"),e._wrap(s,"run",e._getConsumerRunPatch()),e._setKafkaEventListeners(s),s}}_setKafkaEventListeners(e){e[xY.EVENT_LISTENERS_SET]||(e.events?.REQUEST&&e.on(e.events.REQUEST,this._recordClientDurationMetric.bind(this)),e[xY.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(e){let[n,r]=e.payload.broker.split(":");this._clientDuration.record(e.payload.duration/1e3,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:`${e.payload.apiName}`,[Nu.ATTR_SERVER_ADDRESS]:n,[Nu.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,lr.isWrapped)(s.sendBatch)&&e._unwrap(s,"sendBatch"),e._wrap(s,"sendBatch",e._getSendBatchPatch()),(0,lr.isWrapped)(s.send)&&e._unwrap(s,"send"),e._wrap(s,"send",e._getSendPatch()),(0,lr.isWrapped)(s.transaction)&&e._unwrap(s,"transaction"),e._wrap(s,"transaction",e._getProducerTransactionPatch()),e._setKafkaEventListeners(s),s}}_getConsumerRunPatch(){let e=this;return n=>function(...o){let s=o[0];return s?.eachMessage&&((0,lr.isWrapped)(s.eachMessage)&&e._unwrap(s,"eachMessage"),e._wrap(s,"eachMessage",e._getConsumerEachMessagePatch())),s?.eachBatch&&((0,lr.isWrapped)(s.eachBatch)&&e._unwrap(s,"eachBatch"),e._wrap(s,"eachBatch",e._getConsumerEachBatchPatch())),n.call(this,s)}}_getConsumerEachMessagePatch(){let e=this;return n=>function(...o){let s=o[0],i=ye.propagation.extract(ye.ROOT_CONTEXT,s.message.headers,vY.bufferTextMapGetter),a=e._startConsumerSpan({topic:s.topic,message:s.message,operationType:G.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:i,attributes:{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}}),c=[DY(e._processDuration,Date.now(),{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}),$T(e._consumedMessages,1,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)})],l=ye.context.with(ye.trace.setSpan(i,a),()=>n.apply(this,o));return e._endSpansOnPromise([a],c,l)}}_getConsumerEachBatchPatch(){return e=>{let n=this;return function(...o){let s=o[0],i=n._startConsumerSpan({topic:s.batch.topic,message:void 0,operationType:G.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:ye.ROOT_CONTEXT,attributes:{[G.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:s.batch.messages.length,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}});return ye.context.with(ye.trace.setSpan(ye.context.active(),i),()=>{let a=Date.now(),c=[],l=[$T(n._consumedMessages,s.batch.messages.length,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)})];s.batch.messages.forEach(d=>{let _=ye.propagation.extract(ye.ROOT_CONTEXT,d.headers,vY.bufferTextMapGetter),f=ye.trace.getSpan(_)?.spanContext(),m;f&&(m={context:f}),c.push(n._startConsumerSpan({topic:s.batch.topic,message:d,operationType:G.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:m,attributes:{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}})),l.push(DY(n._processDuration,a,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"process",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}))});let p=e.apply(this,o);return c.unshift(i),n._endSpansOnPromise(c,l,p)})}}}_getProducerTransactionPatch(){let e=this;return n=>function(...o){let s=e.tracer.startSpan("transaction"),i=n.apply(this,o);return i.then(a=>{let c=a.send;a.send=function(...f){return ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>e._getSendPatch()(c).apply(this,f).catch(h=>{throw s.setStatus({code:ye.SpanStatusCode.ERROR,message:h?.message}),s.recordException(h),h}))};let l=a.sendBatch;a.sendBatch=function(...f){return ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>e._getSendBatchPatch()(l).apply(this,f).catch(h=>{throw s.setStatus({code:ye.SpanStatusCode.ERROR,message:h?.message}),s.recordException(h),h}))};let p=a.commit;a.commit=function(...f){let m=p.apply(this,f).then(()=>{s.setStatus({code:ye.SpanStatusCode.OK})});return e._endSpansOnPromise([s],[],m)};let d=a.abort;a.abort=function(...f){let m=d.apply(this,f);return e._endSpansOnPromise([s],[],m)}}).catch(a=>{s.setStatus({code:ye.SpanStatusCode.ERROR,message:a?.message}),s.recordException(a),s.end()}),i}}_getSendBatchPatch(){let e=this;return n=>function(...o){let i=o[0].topicMessages||[],a=[],c=[];i.forEach(p=>{p.messages.forEach(d=>{a.push(e._startProducerSpan(p.topic,d)),c.push($T(e._sentMessages,1,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"send",[G.ATTR_MESSAGING_DESTINATION_NAME]:p.topic,...d.partition!==void 0?{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(d.partition)}:{}}))})});let l=n.apply(this,o);return e._endSpansOnPromise(a,c,l)}}_getSendPatch(){let e=this;return n=>function(...o){let s=o[0],i=s.messages.map(l=>e._startProducerSpan(s.topic,l)),a=s.messages.map(l=>$T(e._sentMessages,1,{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_OPERATION_NAME]:"send",[G.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,...l.partition!==void 0?{[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(l.partition)}:{}})),c=n.apply(this,o);return e._endSpansOnPromise(i,a,c)}}_endSpansOnPromise(e,n,r){return Promise.resolve(r).then(o=>(n.forEach(s=>s()),o)).catch(o=>{let s,i=Nu.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?s=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(s=o.message,i=o.constructor.name),n.forEach(a=>a(i)),e.forEach(a=>{a.setAttribute(Nu.ATTR_ERROR_TYPE,i),a.setStatus({code:ye.SpanStatusCode.ERROR,message:s})}),o}).finally(()=>{e.forEach(o=>o.end())})}_startConsumerSpan({topic:e,message:n,operationType:r,ctx:o,link:s,attributes:i}){let a=r===G.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,c=this.tracer.startSpan(`${a} ${e}`,{kind:r===G.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?ye.SpanKind.CLIENT:ye.SpanKind.CONSUMER,attributes:{...i,[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_DESTINATION_NAME]:e,[G.ATTR_MESSAGING_OPERATION_TYPE]:r,[G.ATTR_MESSAGING_OPERATION_NAME]:a,[G.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[G.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[G.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:s?[s]:[]},o),{consumerHook:l}=this.getConfig();return l&&n&&(0,lr.safeExecuteInTheMiddle)(()=>l(c,{topic:e,message:n}),p=>{p&&this._diag.error("consumerHook error",p)},!0),c}_startProducerSpan(e,n){let r=this.tracer.startSpan(`send ${e}`,{kind:ye.SpanKind.PRODUCER,attributes:{[G.ATTR_MESSAGING_SYSTEM]:G.MESSAGING_SYSTEM_VALUE_KAFKA,[G.ATTR_MESSAGING_DESTINATION_NAME]:e,[G.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[G.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[G.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[G.ATTR_MESSAGING_OPERATION_NAME]:"send",[G.ATTR_MESSAGING_OPERATION_TYPE]:G.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},ye.propagation.inject(ye.trace.setSpan(ye.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,lr.safeExecuteInTheMiddle)(()=>o(r,{topic:e,message:n}),s=>{s&&this._diag.error("producerHook error",s)},!0),r}};YT.KafkaJsInstrumentation=CN});var kY=E(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});WT.KafkaJsInstrumentation=void 0;var GSe=wY();Object.defineProperty(WT,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return GSe.KafkaJsInstrumentation}})});var FY=E(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.PACKAGE_NAME=bu.PACKAGE_VERSION=void 0;bu.PACKAGE_VERSION="0.58.0";bu.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var YY=E(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});zT.LruMemoizerInstrumentation=void 0;var VY=(b(),O(v)),qY=ne(),$Y=FY(),PN=class extends qY.InstrumentationBase{constructor(e={}){super($Y.PACKAGE_NAME,$Y.PACKAGE_VERSION,e)}init(){return[new qY.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],e=>{let n=function(){let r=e.apply(this,arguments);return function(){let o=[...arguments],s=o.pop(),i=typeof s=="function"?VY.context.bind(VY.context.active(),s):s;return o.push(i),r.apply(this,o)}};return n.sync=e.sync,n},void 0)]}};zT.LruMemoizerInstrumentation=PN});var WY=E(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});KT.LruMemoizerInstrumentation=void 0;var jSe=YY();Object.defineProperty(KT,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return jSe.LruMemoizerInstrumentation}})});var JY=E(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.METRIC_DB_CLIENT_CONNECTIONS_USAGE=De.DB_SYSTEM_VALUE_MONGODB=De.DB_SYSTEM_NAME_VALUE_MONGODB=De.ATTR_NET_PEER_PORT=De.ATTR_NET_PEER_NAME=De.ATTR_DB_SYSTEM=De.ATTR_DB_STATEMENT=De.ATTR_DB_OPERATION=De.ATTR_DB_NAME=De.ATTR_DB_MONGODB_COLLECTION=De.ATTR_DB_CONNECTION_STRING=void 0;De.ATTR_DB_CONNECTION_STRING="db.connection_string";De.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";De.ATTR_DB_NAME="db.name";De.ATTR_DB_OPERATION="db.operation";De.ATTR_DB_STATEMENT="db.statement";De.ATTR_DB_SYSTEM="db.system";De.ATTR_NET_PEER_NAME="net.peer.name";De.ATTR_NET_PEER_PORT="net.peer.port";De.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";De.DB_SYSTEM_VALUE_MONGODB="mongodb";De.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var ZY=E(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.MongodbCommandType=void 0;var FSe;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.AGGREGATE="aggregate",t.UNKNOWN="unknown"})(FSe=dd.MongodbCommandType||(dd.MongodbCommandType={}))});var eW=E(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.PACKAGE_NAME=Cu.PACKAGE_VERSION=void 0;Cu.PACKAGE_VERSION="0.67.0";Cu.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var rW=E(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});QT.MongoDBInstrumentation=void 0;var we=(b(),O(v)),fe=ne(),zo=(le(),O(Ae)),$n=JY(),ma=ZY(),tW=eW(),nW={requireParentSpan:!0},MN=class t extends fe.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(tW.PACKAGE_NAME,tW.PACKAGE_VERSION,{...nW,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,fe.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,fe.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...nW,...e})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter($n.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsage?.add(e,{"pool.name":n,state:r})}init(){let{v3PatchConnection:e,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:s,v4PatchConnectionPromise:i,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:l}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:p,v4UnpatchSessions:d}=this._getV4SessionsPatches();return[new fe.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new fe.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],e,n)]),new fe.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],s,a),new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],i,a),new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],c,l),new fe.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new fe.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],p,d)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,fe.isWrapped)(e.insert)&&this._unwrap(e,"insert"),this._wrap(e,"insert",this._getV3PatchOperation("insert")),(0,fe.isWrapped)(e.remove)&&this._unwrap(e,"remove"),this._wrap(e,"remove",this._getV3PatchOperation("remove")),(0,fe.isWrapped)(e.update)&&this._unwrap(e,"update"),this._wrap(e,"update",this._getV3PatchOperation("update")),(0,fe.isWrapped)(e.command)&&this._unwrap(e,"command"),this._wrap(e,"command",this._getV3PatchCommand()),(0,fe.isWrapped)(e.query)&&this._unwrap(e,"query"),this._wrap(e,"query",this._getV3PatchFind()),(0,fe.isWrapped)(e.getMore)&&this._unwrap(e,"getMore"),this._wrap(e,"getMore",this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,"insert"),this._unwrap(e,"remove"),this._unwrap(e,"update"),this._unwrap(e,"command"),this._unwrap(e,"query"),this._unwrap(e,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,fe.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),this._wrap(e.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,fe.isWrapped)(e.release)&&this._unwrap(e,"release"),this._wrap(e.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,fe.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),(0,fe.isWrapped)(e.release)&&this._unwrap(e,"release"))}}}_getV4AcquireCommand(){let e=this;return n=>function(){let o=this.sessions.length,s=n.call(this),i=this.sessions.length;return o===i?e._connCountAdd(1,e._poolName,"used"):o-1===i&&(e._connCountAdd(-1,e._poolName,"idle"),e._connCountAdd(1,e._poolName,"used")),s}}_getV4ReleaseCommand(){let e=this;return n=>function(o){let s=n.call(this,o);return e._connCountAdd(-1,e._poolName,"used"),e._connCountAdd(1,e._poolName,"idle"),s}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let n=e.ConnectionPool.prototype;return(0,fe.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,fe.isWrapped)(e.connect)&&this._unwrap(e,"connect"),this._wrap(e,"connect",this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,"connect")}}}_getV4ConnectionPoolCheckOut(){return e=>function(r){let o=we.context.bind(we.context.active(),r);return e.call(this,o)}}_getV4ConnectCommand(){let e=this;return n=>function(o,s){if(n.length===1){let a=n.call(this,o);return a&&typeof a.then=="function"&&a.then(()=>e.setPoolName(o),()=>{}),a}let i=function(a,c){if(a||!c){s(a,c);return}e.setPoolName(o),s(a,c)};return n.call(this,o,i)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,fe.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,fe.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,"command")}}}_getV3PatchOperation(e){let n=this;return r=>function(s,i,a,c,l){let p=we.trace.getSpan(we.context.active()),d=n._checkSkipInstrumentation(p),_=typeof c=="function"?c:l;if(d||typeof _!="function"||typeof a!="object")return typeof c=="function"?r.call(this,s,i,a,c):r.call(this,s,i,a,c,l);let f=n._getV3SpanAttributes(i,s,a[0],e),m=n._spanNameFromAttrs(f),h=n.tracer.startSpan(m,{kind:we.SpanKind.CLIENT,attributes:f}),T=n._patchEnd(h,_);return typeof c=="function"?r.call(this,s,i,a,T):r.call(this,s,i,a,c,T)}}_getV3PatchCommand(){let e=this;return n=>function(o,s,i,a,c){let l=we.trace.getSpan(we.context.active()),p=e._checkSkipInstrumentation(l),d=typeof a=="function"?a:c;if(p||typeof d!="function"||typeof i!="object")return typeof a=="function"?n.call(this,o,s,i,a):n.call(this,o,s,i,a,c);let _=t._getCommandType(i),f=_===ma.MongodbCommandType.UNKNOWN?void 0:_,m=e._getV3SpanAttributes(s,o,i,f),h=e._spanNameFromAttrs(m),T=e.tracer.startSpan(h,{kind:we.SpanKind.CLIENT,attributes:m}),S=e._patchEnd(T,d);return typeof a=="function"?n.call(this,o,s,i,S):n.call(this,o,s,i,a,S)}}_getV4PatchCommandCallback(){let e=this;return n=>function(o,s,i,a){let c=we.trace.getSpan(we.context.active()),l=e._checkSkipInstrumentation(c),p=a,d=Object.keys(s)[0];if(typeof s!="object"||s.ismaster||s.hello)return n.call(this,o,s,i,a);let _;if(!l){let m=e._getV4SpanAttributes(this,o,s,d),h=e._spanNameFromAttrs(m);_=e.tracer.startSpan(h,{kind:we.SpanKind.CLIENT,attributes:m})}let f=e._patchEnd(_,p,this.id,d);return n.call(this,o,s,i,f)}}_getV4PatchCommandPromise(){let e=this;return n=>function(...o){let[s,i]=o,a=we.trace.getSpan(we.context.active()),c=e._checkSkipInstrumentation(a),l=Object.keys(i)[0],p=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return n.apply(this,o);let d;if(!c){let m=e._getV4SpanAttributes(this,s,i,l),h=e._spanNameFromAttrs(m);d=e.tracer.startSpan(h,{kind:we.SpanKind.CLIENT,attributes:m})}let _=e._patchEnd(d,p,this.id,l),f=n.apply(this,o);return f.then(m=>_(null,m),m=>_(m)),f}}_getV3PatchFind(){let e=this;return n=>function(o,s,i,a,c,l){let p=we.trace.getSpan(we.context.active()),d=e._checkSkipInstrumentation(p),_=typeof c=="function"?c:l;if(d||typeof _!="function"||typeof i!="object")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,l);let f=e._getV3SpanAttributes(s,o,i,"find"),m=e._spanNameFromAttrs(f),h=e.tracer.startSpan(m,{kind:we.SpanKind.CLIENT,attributes:f}),T=e._patchEnd(h,_);return typeof c=="function"?n.call(this,o,s,i,a,T):n.call(this,o,s,i,a,c,T)}}_getV3PatchCursor(){let e=this;return n=>function(o,s,i,a,c,l){let p=we.trace.getSpan(we.context.active()),d=e._checkSkipInstrumentation(p),_=typeof c=="function"?c:l;if(d||typeof _!="function")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,l);let f=e._getV3SpanAttributes(s,o,i.cmd,"getMore"),m=e._spanNameFromAttrs(f),h=e.tracer.startSpan(m,{kind:we.SpanKind.CLIENT,attributes:f}),T=e._patchEnd(h,_);return typeof c=="function"?n.call(this,o,s,i,a,T):n.call(this,o,s,i,a,c,T)}}static _getCommandType(e){return e.createIndexes!==void 0?ma.MongodbCommandType.CREATE_INDEXES:e.findandmodify!==void 0?ma.MongodbCommandType.FIND_AND_MODIFY:e.ismaster!==void 0?ma.MongodbCommandType.IS_MASTER:e.count!==void 0?ma.MongodbCommandType.COUNT:e.aggregate!==void 0?ma.MongodbCommandType.AGGREGATE:ma.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(e,n,r,o){let s,i;if(e){let c=typeof e.address=="string"?e.address.split(":"):"";c.length===2&&(s=c[0],i=c[1])}let a;return r?.documents&&r.documents[0]?a=r.documents[0]:r?.cursors?a=r.cursors:a=r,this._getSpanAttributes(n.db,n.collection,s,i,a,o)}_getV3SpanAttributes(e,n,r,o){let s,i;if(n&&n.s&&(s=n.s.options?.host??n.s.host,i=(n.s.options?.port??n.s.port)?.toString(),s==null||i==null)){let p=n.description?.address;if(p){let d=p.split(":");s=d[0],i=d[1]}}let[a,c]=e.toString().split("."),l=r?.query??r?.q??r;return this._getSpanAttributes(a,c,s,i,l,o)}_getSpanAttributes(e,n,r,o,s,i){let a={};if(this._dbSemconvStability&fe.SemconvStability.OLD&&(a[$n.ATTR_DB_SYSTEM]=$n.DB_SYSTEM_VALUE_MONGODB,a[$n.ATTR_DB_NAME]=e,a[$n.ATTR_DB_MONGODB_COLLECTION]=n,a[$n.ATTR_DB_OPERATION]=i,a[$n.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${e}`),this._dbSemconvStability&fe.SemconvStability.STABLE&&(a[zo.ATTR_DB_SYSTEM_NAME]=$n.DB_SYSTEM_NAME_VALUE_MONGODB,a[zo.ATTR_DB_NAMESPACE]=e,a[zo.ATTR_DB_OPERATION_NAME]=i,a[zo.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&fe.SemconvStability.OLD&&(a[$n.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&fe.SemconvStability.STABLE&&(a[zo.ATTR_SERVER_ADDRESS]=r);let c=parseInt(o,10);isNaN(c)||(this._netSemconvStability&fe.SemconvStability.OLD&&(a[$n.ATTR_NET_PEER_PORT]=c),this._netSemconvStability&fe.SemconvStability.STABLE&&(a[zo.ATTR_SERVER_PORT]=c))}if(s){let{dbStatementSerializer:c}=this.getConfig(),l=typeof c=="function"?c:this._defaultDbStatementSerializer.bind(this);(0,fe.safeExecuteInTheMiddle)(()=>{let p=l(s);this._dbSemconvStability&fe.SemconvStability.OLD&&(a[$n.ATTR_DB_STATEMENT]=p),this._dbSemconvStability&fe.SemconvStability.STABLE&&(a[zo.ATTR_DB_QUERY_TEXT]=p)},p=>{p&&this._diag.error("Error running dbStatementSerializer hook",p)},!0)}return a}_spanNameFromAttrs(e){let n;return this._dbSemconvStability&fe.SemconvStability.STABLE?n=[e[zo.ATTR_DB_OPERATION_NAME],e[zo.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||$n.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${e[$n.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let e=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":e.has(r)?"[Circular]":(e.add(r),r)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(e):JSON.stringify(e,this._getDefaultDbStatementReplacer())}_handleExecutionResult(e,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,fe.safeExecuteInTheMiddle)(()=>{r(e,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(e,n,r,o){let s=we.context.active(),i=this,a=!1;return function(...l){if(!a){a=!0;let p=l[0];if(e){if(p instanceof Error)e.setStatus({code:we.SpanStatusCode.ERROR,message:p.message});else{let d=l[1];i._handleExecutionResult(e,d)}e.end()}o==="endSessions"&&i._connCountAdd(-1,i._poolName,"idle")}return we.context.with(s,()=>n.apply(this,l))}}setPoolName(e){let n=e.hostAddress?.host,r=e.hostAddress?.port,o=e.dbName,s=`mongodb://${n}:${r}/${o}`;this._poolName=s}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}};QT.MongoDBInstrumentation=MN});var oW=E(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.MongodbCommandType=void 0;var VSe;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.UNKNOWN="unknown"})(VSe=_d.MongodbCommandType||(_d.MongodbCommandType={}))});var sW=E(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.MongodbCommandType=Pu.MongoDBInstrumentation=void 0;var qSe=rW();Object.defineProperty(Pu,"MongoDBInstrumentation",{enumerable:!0,get:function(){return qSe.MongoDBInstrumentation}});var $Se=oW();Object.defineProperty(Pu,"MongodbCommandType",{enumerable:!0,get:function(){return $Se.MongodbCommandType}})});var vN=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.DB_SYSTEM_NAME_VALUE_MONGODB=at.ATTR_NET_PEER_PORT=at.ATTR_NET_PEER_NAME=at.ATTR_DB_USER=at.ATTR_DB_SYSTEM=at.ATTR_DB_STATEMENT=at.ATTR_DB_OPERATION=at.ATTR_DB_NAME=at.ATTR_DB_MONGODB_COLLECTION=void 0;at.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";at.ATTR_DB_NAME="db.name";at.ATTR_DB_OPERATION="db.operation";at.ATTR_DB_STATEMENT="db.statement";at.ATTR_DB_SYSTEM="db.system";at.ATTR_DB_USER="db.user";at.ATTR_NET_PEER_NAME="net.peer.name";at.ATTR_NET_PEER_PORT="net.peer.port";at.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var dW=E(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.handleCallbackResponse=zs.handlePromiseResponse=zs.getAttributesFromCollection=void 0;var lW=(b(),O(v)),md=ne(),fd=vN(),XT=(le(),O(Ae));function XSe(t,e,n){let r={};return e&md.SemconvStability.OLD&&(r[fd.ATTR_DB_MONGODB_COLLECTION]=t.name,r[fd.ATTR_DB_NAME]=t.conn.name,r[fd.ATTR_DB_USER]=t.conn.user),e&md.SemconvStability.STABLE&&(r[XT.ATTR_DB_COLLECTION_NAME]=t.name,r[XT.ATTR_DB_NAMESPACE]=t.conn.name),n&md.SemconvStability.OLD&&(r[fd.ATTR_NET_PEER_NAME]=t.conn.host,r[fd.ATTR_NET_PEER_PORT]=t.conn.port),n&md.SemconvStability.STABLE&&(r[XT.ATTR_SERVER_ADDRESS]=t.conn.host,r[XT.ATTR_SERVER_PORT]=t.conn.port),r}zs.getAttributesFromCollection=XSe;function pW(t,e={}){t.recordException(e),t.setStatus({code:lW.SpanStatusCode.ERROR,message:`${e.message} ${e.code?`
12
+ Mongoose Error Code: ${e.code}`:""}`})}function LN(t,e,n,r=void 0){n&&(0,md.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&lW.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function JSe(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(LN(e,o,n,r),o)).catch(o=>{throw pW(e,o),o}).finally(()=>e.end()):(LN(e,t,n,r),e.end(),t)}zs.handlePromiseResponse=JSe;function ZSe(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(c,l)=>(c?pW(r,c):LN(r,l,s,i),r.end(),t(c,l)),e.apply(n,o)}zs.handleCallbackResponse=ZSe});var _W=E(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.PACKAGE_NAME=Mu.PACKAGE_VERSION=void 0;Mu.PACKAGE_VERSION="0.60.0";Mu.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var EW=E(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.MongooseInstrumentation=Cn._ALREADY_INSTRUMENTED=Cn._STORED_PARENT_SPAN=void 0;var Tt=(b(),O(v)),ege=Te(),DN=dW(),jt=ne(),fW=_W(),Ks=vN(),ha=(le(),O(Ae)),JT=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],tge=["remove","count","findOneAndRemove",...JT],nge=["count","findOneAndRemove",...JT],rge=[...JT];function mW(t){return t?t.startsWith("6.")||t.startsWith("5.")?tge:t.startsWith("7.")?nge:rge:JT}function hW(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function TW(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}Cn._STORED_PARENT_SPAN=Symbol("stored-parent-span");Cn._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var UN=class extends jt.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(fW.PACKAGE_NAME,fW.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,jt.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,jt.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new jt.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,hW(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),TW(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),mW(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=mW(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,hW(n)&&this._unwrap(r.Model.prototype,"remove"),TW(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return r.apply(this,arguments);let i=this[Cn._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let p=c("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&jt.SemconvStability.OLD&&(a[Ks.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&jt.SemconvStability.STABLE&&(a[ha.ATTR_DB_QUERY_TEXT]=p)}let l=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(l,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[Cn._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return r.apply(this,arguments);let i=this[Cn._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let p=c(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&jt.SemconvStability.OLD&&(a[Ks.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&jt.SemconvStability.STABLE&&(a[ha.ATTR_DB_QUERY_TEXT]=p)}let l=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(l,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let l={},{dbStatementSerializer:p}=r.getConfig();if(p){let _=p(e,c);r._dbSemconvStability&jt.SemconvStability.OLD&&(l[Ks.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&jt.SemconvStability.STABLE&&(l[ha.ATTR_DB_QUERY_TEXT]=_)}let d=r._startSpan(this.constructor.collection,this.constructor.modelName,e,l);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(d,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return o.apply(this,arguments);let l=c,p=i,d=a;typeof i=="function"?(l=i,p=void 0,d=void 0):typeof a=="function"&&(l=a,d=void 0);let _={},f=r.getConfig().dbStatementSerializer;if(f){let T=f(e,{condition:{_id:this._id},updates:p,options:d});r._dbSemconvStability&jt.SemconvStability.OLD&&(_[Ks.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&jt.SemconvStability.STABLE&&(_[ha.ATTR_DB_QUERY_TEXT]=T)}let m=r._startSpan(this.constructor.collection,this.constructor.modelName,e,_),h=r._handleResponse(m,o,this,arguments,l,n);return h&&typeof h=="object"&&(h[Cn._ALREADY_INSTRUMENTED]=!0),h}}patchModelStatic(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&Tt.trace.getSpan(Tt.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(c=a,a=void 0);let l={};switch(e){case"insertMany":l.documents=i;break;case"bulkWrite":l.operations=i;break;default:l.document=i;break}a!==void 0&&(l.options=a);let p={},{dbStatementSerializer:d}=r.getConfig();if(d){let f=d(e,l);r._dbSemconvStability&jt.SemconvStability.OLD&&(p[Ks.ATTR_DB_STATEMENT]=f),r._dbSemconvStability&jt.SemconvStability.STABLE&&(p[ha.ATTR_DB_QUERY_TEXT]=f)}let _=r._startSpan(this.collection,this.modelName,e,p);return r._handleResponse(_,o,this,arguments,c,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=Tt.trace.getSpan(Tt.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[Cn._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[Cn._STORED_PARENT_SPAN]=Tt.trace.getSpan(Tt.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,DN.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&jt.SemconvStability.OLD&&(i[Ks.ATTR_DB_OPERATION]=r,i[Ks.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&jt.SemconvStability.STABLE&&(i[ha.ATTR_DB_OPERATION_NAME]=r,i[ha.ATTR_DB_SYSTEM_NAME]=Ks.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&jt.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:Tt.SpanKind.CLIENT,attributes:i},s?Tt.trace.setSpan(Tt.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,DN.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,DN.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?Tt.context.with((0,ege.suppressTracing)(Tt.context.active()),e):e()}};Cn.MongooseInstrumentation=UN});var SW=E(ZT=>{"use strict";Object.defineProperty(ZT,"__esModule",{value:!0});ZT.MongooseInstrumentation=void 0;var oge=EW();Object.defineProperty(ZT,"MongooseInstrumentation",{enumerable:!0,get:function(){return oge.MongooseInstrumentation}})});var IW=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ct.DB_SYSTEM_VALUE_MYSQL=ct.ATTR_NET_PEER_PORT=ct.ATTR_NET_PEER_NAME=ct.ATTR_DB_USER=ct.ATTR_DB_SYSTEM=ct.ATTR_DB_STATEMENT=ct.ATTR_DB_NAME=ct.ATTR_DB_CONNECTION_STRING=void 0;ct.ATTR_DB_CONNECTION_STRING="db.connection_string";ct.ATTR_DB_NAME="db.name";ct.ATTR_DB_STATEMENT="db.statement";ct.ATTR_DB_SYSTEM="db.system";ct.ATTR_DB_USER="db.user";ct.ATTR_NET_PEER_NAME="net.peer.name";ct.ATTR_NET_PEER_PORT="net.peer.port";ct.DB_SYSTEM_VALUE_MYSQL="mysql";ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var OW=E(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.AttributeNames=void 0;var ige;(function(t){t.MYSQL_VALUES="db.mysql.values"})(ige=hd.AttributeNames||(hd.AttributeNames={}))});var NW=E(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.getPoolNameOld=Xt.arrayStringifyHelper=Xt.getSpanName=Xt.getDbValues=Xt.getDbQueryText=Xt.getJDBCString=Xt.getConfig=void 0;function age(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}Xt.getConfig=age;function cge(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}Xt.getJDBCString=cge;function uge(t){return typeof t=="string"?t:t.sql}Xt.getDbQueryText=uge;function lge(t,e){return wN(typeof t=="string"?e:e||t.values)}Xt.getDbValues=lge;function pge(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Xt.getSpanName=pge;function wN(t){return t?`[${t.toString()}]`:""}Xt.arrayStringifyHelper=wN;function dge(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}Xt.getPoolNameOld=dge});var bW=E(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.PACKAGE_NAME=xu.PACKAGE_VERSION=void 0;xu.PACKAGE_VERSION="0.60.0";xu.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var PW=E(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});eE.MySQLInstrumentation=void 0;var Pn=(b(),O(v)),pr=ne(),vu=(le(),O(Ae)),Ko=IW(),_ge=OW(),Ta=NW(),CW=bW(),kN=class extends pr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(CW.PACKAGE_NAME,CW.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,pr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,pr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Ko.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new pr.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,pr.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,pr.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,pr.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,l=(0,Ta.getPoolNameOld)(e);r._connCountAdd(-c,l,"used"),r._connCountAdd(-a,l,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),l=a[c].pool;r._setPoolCallbacks(l,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=Pn.context.active();return function(o,s){s&&((0,pr.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&Pn.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:c,port:l,database:p,user:d}=(0,Ta.getConfig)(e.config),_=parseInt(l,10),f=(0,Ta.getDbQueryText)(o);r._dbSemconvStability&pr.SemconvStability.OLD&&(a[Ko.ATTR_DB_SYSTEM]=Ko.DB_SYSTEM_VALUE_MYSQL,a[Ko.ATTR_DB_CONNECTION_STRING]=(0,Ta.getJDBCString)(c,l,p),a[Ko.ATTR_DB_NAME]=p,a[Ko.ATTR_DB_USER]=d,a[Ko.ATTR_DB_STATEMENT]=f),r._dbSemconvStability&pr.SemconvStability.STABLE&&(a[vu.ATTR_DB_SYSTEM_NAME]=vu.DB_SYSTEM_NAME_VALUE_MYSQL,a[vu.ATTR_DB_NAMESPACE]=p,a[vu.ATTR_DB_QUERY_TEXT]=f),r._netSemconvStability&pr.SemconvStability.OLD&&(a[Ko.ATTR_NET_PEER_NAME]=c,isNaN(_)||(a[Ko.ATTR_NET_PEER_PORT]=_)),r._netSemconvStability&pr.SemconvStability.STABLE&&(a[vu.ATTR_SERVER_ADDRESS]=c,isNaN(_)||(a[vu.ATTR_SERVER_PORT]=_));let m=r.tracer.startSpan((0,Ta.getSpanName)(o),{kind:Pn.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let S;Array.isArray(s)?S=s:arguments[2]&&(S=[s]),m.setAttribute(_ge.AttributeNames.MYSQL_VALUES,(0,Ta.getDbValues)(o,S))}let h=Array.from(arguments).findIndex(S=>typeof S=="function"),T=Pn.context.active();if(h===-1){let S=Pn.context.with(Pn.trace.setSpan(Pn.context.active(),m),()=>n.apply(e,arguments));return Pn.context.bind(T,S),S.on("error",R=>m.setStatus({code:Pn.SpanStatusCode.ERROR,message:R.message})).on("end",()=>{m.end()})}else return r._wrap(arguments,h,r._patchCallbackQuery(m,T)),Pn.context.with(Pn.trace.setSpan(Pn.context.active(),m),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:Pn.SpanStatusCode.ERROR,message:o.message}),e.end(),Pn.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,Ta.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};eE.MySQLInstrumentation=kN});var MW=E(tE=>{"use strict";Object.defineProperty(tE,"__esModule",{value:!0});tE.MySQLInstrumentation=void 0;var fge=PW();Object.defineProperty(tE,"MySQLInstrumentation",{enumerable:!0,get:function(){return fge.MySQLInstrumentation}})});var GN=E(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.DB_SYSTEM_VALUE_MYSQL=Ct.ATTR_NET_PEER_PORT=Ct.ATTR_NET_PEER_NAME=Ct.ATTR_DB_USER=Ct.ATTR_DB_SYSTEM=Ct.ATTR_DB_STATEMENT=Ct.ATTR_DB_NAME=Ct.ATTR_DB_CONNECTION_STRING=void 0;Ct.ATTR_DB_CONNECTION_STRING="db.connection_string";Ct.ATTR_DB_NAME="db.name";Ct.ATTR_DB_STATEMENT="db.statement";Ct.ATTR_DB_SYSTEM="db.system";Ct.ATTR_DB_USER="db.user";Ct.ATTR_NET_PEER_NAME="net.peer.name";Ct.ATTR_NET_PEER_PORT="net.peer.port";Ct.DB_SYSTEM_VALUE_MYSQL="mysql"});var jN=E(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.addSqlCommenterComment=void 0;var BN=(b(),O(v)),hge=Te();function Tge(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function Ege(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function Sge(t,e){if(typeof e!="string"||e.length===0||Tge(e))return e;let n=new hge.W3CTraceContextPropagator,r={};n.inject(BN.trace.setSpan(BN.ROOT_CONTEXT,t),r,BN.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=Ege(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}nE.addSqlCommenterComment=Sge});var UW=E(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.getConnectionPrototypeToInstrument=dr.once=dr.getSpanName=dr.getQueryText=dr.getConnectionAttributes=void 0;var Td=GN(),rE=ne(),HN=(le(),O(Ae));function gge(t,e,n){let{host:r,port:o,database:s,user:i}=Age(t),a={};e&rE.SemconvStability.OLD&&(a[Td.ATTR_DB_CONNECTION_STRING]=Rge(r,o,s),a[Td.ATTR_DB_NAME]=s,a[Td.ATTR_DB_USER]=i),e&rE.SemconvStability.STABLE&&(a[HN.ATTR_DB_NAMESPACE]=s);let c=parseInt(o,10);return n&rE.SemconvStability.OLD&&(a[Td.ATTR_NET_PEER_NAME]=r,isNaN(c)||(a[Td.ATTR_NET_PEER_PORT]=c)),n&rE.SemconvStability.STABLE&&(a[HN.ATTR_SERVER_ADDRESS]=r,isNaN(c)||(a[HN.ATTR_SERVER_PORT]=c)),a}dr.getConnectionAttributes=gge;function Age(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function Rge(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function yge(t,e,n,r=!1,o=Ige){let[s,i]=typeof t=="string"?[t,n]:[t.sql,Oge(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}dr.getQueryText=yge;function Ige(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function Oge(t){return"values"in t}function Nge(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}dr.getSpanName=Nge;var bge=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};dr.once=bge;function Cge(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}dr.getConnectionPrototypeToInstrument=Cge});var wW=E(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.PACKAGE_NAME=Lu.PACKAGE_VERSION=void 0;Lu.PACKAGE_VERSION="0.60.0";Lu.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var jW=E(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.MySQL2Instrumentation=void 0;var kW=(b(),O(v)),Ur=ne(),FN=GN(),GW=jN(),Du=UW(),BW=wW(),VN=(le(),O(Ae)),qN=[">=1.4.2 <4"],$N=class extends Ur.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(BW.PACKAGE_NAME,BW.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ur.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ur.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,Ur.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,Ur.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new Ur.InstrumentationNodeModuleDefinition("mysql2",qN,s=>(n(s),s),()=>{},[new Ur.InstrumentationNodeModuleFile("mysql2/promise.js",qN,s=>(n(s),s),()=>{}),new Ur.InstrumentationNodeModuleFile("mysql2/lib/connection.js",qN,s=>{let i=(0,Du.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,Du.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let{maskStatement:l,maskStatementHook:p,responseHook:d}=o.getConfig(),_=(0,Du.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),f=(0,Du.getQueryText)(s,e,c,l,p);o._dbSemconvStability&Ur.SemconvStability.OLD&&(_[FN.ATTR_DB_SYSTEM]=FN.DB_SYSTEM_VALUE_MYSQL,_[FN.ATTR_DB_STATEMENT]=f),o._dbSemconvStability&Ur.SemconvStability.STABLE&&(_[VN.ATTR_DB_SYSTEM_NAME]=VN.DB_SYSTEM_NAME_VALUE_MYSQL,_[VN.ATTR_DB_QUERY_TEXT]=f);let m=o.tracer.startSpan((0,Du.getSpanName)(s),{kind:kW.SpanKind.CLIENT,attributes:_});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,GW.addSqlCommenterComment)(m,s):Object.assign(s,{sql:(0,GW.addSqlCommenterComment)(m,s.sql)}));let h=(0,Du.once)((T,S)=>{T?m.setStatus({code:kW.SpanStatusCode.ERROR,message:T.message}):typeof d=="function"&&(0,Ur.safeExecuteInTheMiddle)(()=>{d(m,{queryResults:S})},R=>{R&&o._diag.warn("Failed executing responseHook",R)},!0),m.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(h));let T=r.apply(this,arguments);return T.once("error",S=>{h(S)}).once("result",S=>{h(void 0,S)}),T}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(h)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(h)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};oE.MySQL2Instrumentation=$N});var HW=E(sE=>{"use strict";Object.defineProperty(sE,"__esModule",{value:!0});sE.MySQL2Instrumentation=void 0;var Pge=jW();Object.defineProperty(sE,"MySQL2Instrumentation",{enumerable:!0,get:function(){return Pge.MySQL2Instrumentation}})});var YW=E(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.DB_SYSTEM_VALUE_REDIS=Jt.DB_SYSTEM_NAME_VALUE_REDIS=Jt.ATTR_NET_PEER_PORT=Jt.ATTR_NET_PEER_NAME=Jt.ATTR_DB_SYSTEM=Jt.ATTR_DB_STATEMENT=Jt.ATTR_DB_CONNECTION_STRING=void 0;Jt.ATTR_DB_CONNECTION_STRING="db.connection_string";Jt.ATTR_DB_STATEMENT="db.statement";Jt.ATTR_DB_SYSTEM="db.system";Jt.ATTR_NET_PEER_NAME="net.peer.name";Jt.ATTR_NET_PEER_PORT="net.peer.port";Jt.DB_SYSTEM_NAME_VALUE_REDIS="redis";Jt.DB_SYSTEM_VALUE_REDIS="redis"});var WW=E(iE=>{"use strict";Object.defineProperty(iE,"__esModule",{value:!0});iE.endSpan=void 0;var xge=(b(),O(v)),vge=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:xge.SpanStatusCode.ERROR,message:e.message})),t.end()};iE.endSpan=vge});var cE=E(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});aE.defaultDbStatementSerializer=void 0;var Lge=[{regex:/^ECHO/i,args:0},{regex:/^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i,args:1},{regex:/^(HSET|HMSET|LSET|LINSERT)/i,args:2},{regex:/^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i,args:-1}],Dge=(t,e)=>{if(Array.isArray(e)&&e.length){let n=Lge.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};aE.defaultDbStatementSerializer=Dge});var zW=E(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.PACKAGE_NAME=Uu.PACKAGE_VERSION=void 0;Uu.PACKAGE_VERSION="0.62.0";Uu.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var JW=E(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});uE.IORedisInstrumentation=void 0;var Qs=(b(),O(v)),Mn=ne(),Xs=(le(),O(Ae)),xn=YW(),KW=ne(),Ed=WW(),Uge=cE(),QW=zW(),XW={requireParentSpan:!0},YN=class extends Mn.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(QW.PACKAGE_NAME,QW.PACKAGE_VERSION,{...XW,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Mn.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Mn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...XW,...e})}init(){return[new Mn.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Mn.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Mn.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||Uge.defaultDbStatementSerializer,a=Qs.trace.getSpan(Qs.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c={},{host:l,port:p}=this.options,d=i(o.name,o.args);r._dbSemconvStability&Mn.SemconvStability.OLD&&(c[xn.ATTR_DB_SYSTEM]=xn.DB_SYSTEM_VALUE_REDIS,c[xn.ATTR_DB_STATEMENT]=d,c[xn.ATTR_DB_CONNECTION_STRING]=`redis://${l}:${p}`),r._dbSemconvStability&Mn.SemconvStability.STABLE&&(c[Xs.ATTR_DB_SYSTEM_NAME]=xn.DB_SYSTEM_NAME_VALUE_REDIS,c[Xs.ATTR_DB_QUERY_TEXT]=d),r._netSemconvStability&Mn.SemconvStability.OLD&&(c[xn.ATTR_NET_PEER_NAME]=l,c[xn.ATTR_NET_PEER_PORT]=p),r._netSemconvStability&Mn.SemconvStability.STABLE&&(c[Xs.ATTR_SERVER_ADDRESS]=l,c[Xs.ATTR_SERVER_PORT]=p);let _=r.tracer.startSpan(o.name,{kind:Qs.SpanKind.CLIENT,attributes:c}),{requestHook:f}=s;f&&(0,KW.safeExecuteInTheMiddle)(()=>f(_,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),m=>{m&&Qs.diag.error("ioredis instrumentation: request hook failed",m)},!0);try{let m=e.apply(this,arguments),h=o.resolve;o.resolve=function(S){(0,KW.safeExecuteInTheMiddle)(()=>s.responseHook?.(_,o.name,o.args,S),R=>{R&&Qs.diag.error("ioredis instrumentation: response hook failed",R)},!0),(0,Ed.endSpan)(_,null),h(S)};let T=o.reject;return o.reject=function(S){(0,Ed.endSpan)(_,S),T(S)},m}catch(m){throw(0,Ed.endSpan)(_,m),m}}}_traceConnection(e){let n=this;return function(){let r=Qs.trace.getSpan(Qs.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&Mn.SemconvStability.OLD&&(o[xn.ATTR_DB_SYSTEM]=xn.DB_SYSTEM_VALUE_REDIS,o[xn.ATTR_DB_STATEMENT]="connect",o[xn.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&Mn.SemconvStability.STABLE&&(o[Xs.ATTR_DB_SYSTEM_NAME]=xn.DB_SYSTEM_NAME_VALUE_REDIS,o[Xs.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Mn.SemconvStability.OLD&&(o[xn.ATTR_NET_PEER_NAME]=s,o[xn.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&Mn.SemconvStability.STABLE&&(o[Xs.ATTR_SERVER_ADDRESS]=s,o[Xs.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:Qs.SpanKind.CLIENT,attributes:o});try{let c=e.apply(this,arguments);return(0,Ed.endSpan)(a,null),c}catch(c){throw(0,Ed.endSpan)(a,c),c}}}};uE.IORedisInstrumentation=YN});var ZW=E(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});lE.IORedisInstrumentation=void 0;var wge=JW();Object.defineProperty(lE,"IORedisInstrumentation",{enumerable:!0,get:function(){return wge.IORedisInstrumentation}})});var pE=E(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.PACKAGE_NAME=wu.PACKAGE_VERSION=void 0;wu.PACKAGE_VERSION="0.62.0";wu.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var ez=E(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.getTracedCreateStreamTrace=Js.getTracedCreateClient=Js.endSpan=void 0;var Sd=(b(),O(v)),kge=(t,e)=>{e&&t.setStatus({code:Sd.SpanStatusCode.ERROR,message:e.message}),t.end()};Js.endSpan=kge;var Gge=t=>function(){let n=t.apply(this,arguments);return Sd.context.bind(Sd.context.active(),n)};Js.getTracedCreateClient=Gge;var Bge=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){Sd.context.bind(Sd.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};Js.getTracedCreateStreamTrace=Bge});var dE=E(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.DB_SYSTEM_VALUE_REDIS=Zt.DB_SYSTEM_NAME_VALUE_REDIS=Zt.ATTR_NET_PEER_PORT=Zt.ATTR_NET_PEER_NAME=Zt.ATTR_DB_SYSTEM=Zt.ATTR_DB_STATEMENT=Zt.ATTR_DB_CONNECTION_STRING=void 0;Zt.ATTR_DB_CONNECTION_STRING="db.connection_string";Zt.ATTR_DB_STATEMENT="db.statement";Zt.ATTR_DB_SYSTEM="db.system";Zt.ATTR_NET_PEER_NAME="net.peer.name";Zt.ATTR_NET_PEER_PORT="net.peer.port";Zt.DB_SYSTEM_NAME_VALUE_REDIS="redis";Zt.DB_SYSTEM_VALUE_REDIS="redis"});var nz=E(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.RedisInstrumentationV2_V3=void 0;var Yn=ne(),_E=ez(),tz=pE(),gd=(b(),O(v)),Ad=(le(),O(Ae)),Ea=dE(),jge=cE(),WN=class t extends Yn.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(tz.PACKAGE_NAME,tz.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,Yn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,Yn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Yn.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,Yn.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,Yn.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Yn.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=gd.trace.getSpan(gd.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let c=i?.dbStatementSerializer||jge.defaultDbStatementSerializer,l={};e._semconvStability&Yn.SemconvStability.OLD&&Object.assign(l,{[Ea.ATTR_DB_SYSTEM]:Ea.DB_SYSTEM_VALUE_REDIS,[Ea.ATTR_DB_STATEMENT]:c(s.command,s.args)}),e._semconvStability&Yn.SemconvStability.STABLE&&Object.assign(l,{[Ad.ATTR_DB_SYSTEM_NAME]:Ea.DB_SYSTEM_NAME_VALUE_REDIS,[Ad.ATTR_DB_OPERATION_NAME]:s.command,[Ad.ATTR_DB_QUERY_TEXT]:c(s.command,s.args)});let p=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:gd.SpanKind.CLIENT,attributes:l});if(this.connection_options){let _={};e._semconvStability&Yn.SemconvStability.OLD&&Object.assign(_,{[Ea.ATTR_NET_PEER_NAME]:this.connection_options.host,[Ea.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&Yn.SemconvStability.STABLE&&Object.assign(_,{[Ad.ATTR_SERVER_ADDRESS]:this.connection_options.host,[Ad.ATTR_SERVER_PORT]:this.connection_options.port}),p.setAttributes(_)}this.address&&e._semconvStability&Yn.SemconvStability.OLD&&p.setAttribute(Ea.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let d=arguments[0].callback;if(d){let _=gd.context.active();arguments[0].callback=function(m,h){if(i?.responseHook){let T=i.responseHook;(0,Yn.safeExecuteInTheMiddle)(()=>{T(p,s.command,s.args,h)},S=>{S&&e._diag.error("Error executing responseHook",S)},!0)}return(0,_E.endSpan)(p,m),gd.context.with(_,d,this,...arguments)}}try{return r.apply(this,arguments)}catch(_){throw(0,_E.endSpan)(p,_),_}}}}_getPatchCreateClient(){return function(n){return(0,_E.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,_E.getTracedCreateStreamTrace)(n)}}};fE.RedisInstrumentationV2_V3=WN});var oz=E(mE=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});mE.getClientAttributes=void 0;var zN=(le(),O(Ae)),ku=dE(),rz=ne();function Hge(t,e,n){let r={};return n&rz.SemconvStability.OLD&&Object.assign(r,{[ku.ATTR_DB_SYSTEM]:ku.DB_SYSTEM_VALUE_REDIS,[ku.ATTR_NET_PEER_NAME]:e?.socket?.host,[ku.ATTR_NET_PEER_PORT]:e?.socket?.port,[ku.ATTR_DB_CONNECTION_STRING]:Fge(t,e?.url)}),n&rz.SemconvStability.STABLE&&Object.assign(r,{[zN.ATTR_DB_SYSTEM_NAME]:ku.DB_SYSTEM_NAME_VALUE_REDIS,[zN.ATTR_SERVER_ADDRESS]:e?.socket?.host,[zN.ATTR_SERVER_PORT]:e?.socket?.port}),r}mE.getClientAttributes=Hge;function Fge(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var cz=E(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.RedisInstrumentationV4_V5=void 0;var _r=(b(),O(v)),xe=ne(),sz=oz(),Vge=cE(),iz=pE(),KN=(le(),O(Ae)),qge=dE(),Rd=Symbol("opentelemetry.instrumentation.redis.open_spans"),az=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),QN=class t extends xe.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(iz.PACKAGE_NAME,iz.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,xe.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,xe.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new xe.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,xe.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,xe.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,xe.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new xe.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,xe.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,xe.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,xe.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,xe.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,xe.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new xe.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,xe.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,xe.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,xe.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,xe.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,xe.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,xe.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new xe.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(c,l){let p=e(c,l).args;return n._traceClientCommand(a,this,arguments,p)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let c=this[Rd];return n._endSpansWithRedisReplies(c,a,e),a}).catch(a=>{let c=this[Rd];if(!c)n._diag.error("cannot find open spans to end for multi/pipeline");else{let l=a.constructor.name==="MultiErrorReply"?a.replies:new Array(c.length).fill(a);n._endSpansWithRedisReplies(c,l,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[az]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,sz.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:_r.SpanKind.CLIENT,attributes:i});return _r.context.with(_r.trace.setSpan(_r.context.active(),a),()=>r.apply(this)).then(l=>(a.end(),l)).catch(l=>(a.recordException(l),a.setStatus({code:_r.SpanStatusCode.ERROR,message:l.message}),a.end(),Promise.reject(l)))}}}_traceClientCommand(e,n,r,o){if(_r.trace.getSpan(_r.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[az],a=o[0],c=o.slice(1),l=this.getConfig().dbStatementSerializer||Vge.defaultDbStatementSerializer,p=(0,sz.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&xe.SemconvStability.STABLE&&(p[KN.ATTR_DB_OPERATION_NAME]=a);try{let f=l(a,c);f!=null&&(this._semconvStability&xe.SemconvStability.OLD&&(p[qge.ATTR_DB_STATEMENT]=f),this._semconvStability&xe.SemconvStability.STABLE&&(p[KN.ATTR_DB_QUERY_TEXT]=f))}catch(f){this._diag.error("dbStatementSerializer throw an exception",f,{commandName:a})}let d=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:_r.SpanKind.CLIENT,attributes:p}),_=_r.context.with(_r.trace.setSpan(_r.context.active(),d),()=>e.apply(n,r));if(typeof _?.then=="function")_.then(f=>{this._endSpanWithResponse(d,a,c,f,void 0)},f=>{this._endSpanWithResponse(d,a,c,null,f)});else{let f=_;f[Rd]=f[Rd]||[],f[Rd].push({span:d,commandName:a,commandArgs:c})}return _}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:c,commandArgs:l}=e[a],p=n[a],[d,_]=p instanceof Error?[null,p]:[p,void 0];this._semconvStability&xe.SemconvStability.STABLE&&c.setAttribute(KN.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(c,o[a],l,d,_)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:_r.SpanStatusCode.ERROR,message:s?.message})),e.end()}};hE.RedisInstrumentationV4_V5=QN});var pz=E(TE=>{"use strict";Object.defineProperty(TE,"__esModule",{value:!0});TE.RedisInstrumentation=void 0;var $ge=ne(),uz=pE(),Yge=nz(),Wge=cz(),lz={requireParentSpan:!1},XN=class extends $ge.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...lz,...e};super(uz.PACKAGE_NAME,uz.PACKAGE_VERSION,n),this.instrumentationV2_V3=new Yge.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new Wge.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...lz,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};TE.RedisInstrumentation=XN});var dz=E(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});EE.RedisInstrumentation=void 0;var zge=pz();Object.defineProperty(EE,"RedisInstrumentation",{enumerable:!0,get:function(){return zge.RedisInstrumentation}})});var Rz=E(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0});gE.EVENT_LISTENERS_SET=void 0;gE.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var eb=E(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.AttributeNames=void 0;var tAe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(tAe=Od.AttributeNames||(Od.AttributeNames={}))});var tb=E(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Se.METRIC_DB_CLIENT_CONNECTION_COUNT=Se.DB_SYSTEM_VALUE_POSTGRESQL=Se.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Se.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Se.ATTR_NET_PEER_PORT=Se.ATTR_NET_PEER_NAME=Se.ATTR_DB_USER=Se.ATTR_DB_SYSTEM=Se.ATTR_DB_STATEMENT=Se.ATTR_DB_NAME=Se.ATTR_DB_CONNECTION_STRING=Se.ATTR_DB_CLIENT_CONNECTION_STATE=Se.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Se.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Se.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Se.ATTR_DB_CONNECTION_STRING="db.connection_string";Se.ATTR_DB_NAME="db.name";Se.ATTR_DB_STATEMENT="db.statement";Se.ATTR_DB_SYSTEM="db.system";Se.ATTR_DB_USER="db.user";Se.ATTR_NET_PEER_NAME="net.peer.name";Se.ATTR_NET_PEER_PORT="net.peer.port";Se.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Se.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Se.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Se.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Se.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var nb=E(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.SpanNames=void 0;var nAe;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(nAe=Nd.SpanNames||(Nd.SpanNames={}))});var Pz=E(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.sanitizedErrorMessage=me.isObjectWithTextString=me.getErrorMessage=me.patchClientConnectCallback=me.patchCallbackPGPool=me.updateCounter=me.getPoolName=me.patchCallback=me.handleExecutionResult=me.handleConfigQuery=me.shouldSkipInstrumentation=me.getSemanticAttributesFromPoolConnection=me.getSemanticAttributesFromConnection=me.getConnectionString=me.parseAndMaskConnectionString=me.parseNormalizedOperationName=me.getQuerySpanName=void 0;var Zs=(b(),O(v)),AE=eb(),fr=(le(),O(Ae)),Ve=tb(),Sa=ne(),yz=nb();function Iz(t,e){if(!e)return yz.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:Oz(e.text);return`${yz.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}me.getQuerySpanName=Iz;function Oz(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}me.parseNormalizedOperationName=Oz;function Nz(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}me.parseAndMaskConnectionString=Nz;function rb(t){if("connectionString"in t&&t.connectionString)return Nz(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}me.getConnectionString=rb;function RE(t){if(Number.isInteger(t))return t}function bz(t,e){let n={};return e&Sa.SemconvStability.OLD&&(n={...n,[Ve.ATTR_DB_SYSTEM]:Ve.DB_SYSTEM_VALUE_POSTGRESQL,[Ve.ATTR_DB_NAME]:t.database,[Ve.ATTR_DB_CONNECTION_STRING]:rb(t),[Ve.ATTR_DB_USER]:t.user,[Ve.ATTR_NET_PEER_NAME]:t.host,[Ve.ATTR_NET_PEER_PORT]:RE(t.port)}),e&Sa.SemconvStability.STABLE&&(n={...n,[fr.ATTR_DB_SYSTEM_NAME]:fr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[fr.ATTR_DB_NAMESPACE]:t.namespace,[fr.ATTR_SERVER_ADDRESS]:t.host,[fr.ATTR_SERVER_PORT]:RE(t.port)}),n}me.getSemanticAttributesFromConnection=bz;function rAe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[AE.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[AE.AttributeNames.MAX_CLIENT]:t.maxClient};return e&Sa.SemconvStability.OLD&&(r={...r,[Ve.ATTR_DB_SYSTEM]:Ve.DB_SYSTEM_VALUE_POSTGRESQL,[Ve.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Ve.ATTR_DB_CONNECTION_STRING]:rb(t),[Ve.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Ve.ATTR_NET_PEER_PORT]:Number(n?.port)||RE(t.port),[Ve.ATTR_DB_USER]:n?.username??t.user}),e&Sa.SemconvStability.STABLE&&(r={...r,[fr.ATTR_DB_SYSTEM_NAME]:fr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[fr.ATTR_DB_NAMESPACE]:t.namespace,[fr.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[fr.ATTR_SERVER_PORT]:Number(n?.port)||RE(t.port)}),r}me.getSemanticAttributesFromPoolConnection=rAe;function oAe(t){return t.requireParentSpan===!0&&Zs.trace.getSpan(Zs.context.active())===void 0}me.shouldSkipInstrumentation=oAe;function sAe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=Iz(s,r),a=t.startSpan(i,{kind:Zs.SpanKind.CLIENT,attributes:bz(o,n)});if(!r)return a;if(r.text&&(n&Sa.SemconvStability.OLD&&a.setAttribute(Ve.ATTR_DB_STATEMENT,r.text),n&Sa.SemconvStability.STABLE&&a.setAttribute(fr.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let c=r.values.map(l=>l==null?"null":l instanceof Buffer?l.toString():typeof l=="object"?typeof l.toPostgres=="function"?l.toPostgres():JSON.stringify(l):l.toString());a.setAttribute(AE.AttributeNames.PG_VALUES,c)}catch(c){Zs.diag.error("failed to stringify ",r.values,c)}return typeof r.name=="string"&&a.setAttribute(AE.AttributeNames.PG_PLAN,r.name),a}me.handleConfigQuery=sAe;function Cz(t,e,n){typeof t.responseHook=="function"&&(0,Sa.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&Zs.diag.error("Error running response hook",r)},!0)}me.handleExecutionResult=Cz;function iAe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[fr.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(yE(i)),e.setStatus({code:Zs.SpanStatusCode.ERROR,message:i.message})):Cz(t,e,a),o(),e.end(),n.call(this,i,a)}}me.patchCallback=iAe;function aAe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}me.getPoolName=aAe;function cAe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[Ve.ATTR_DB_CLIENT_CONNECTION_STATE]:Ve.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ve.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Ve.ATTR_DB_CLIENT_CONNECTION_STATE]:Ve.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ve.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Ve.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}me.updateCounter=cAe;function uAe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(yE(r)),t.setStatus({code:Zs.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}me.patchCallbackPGPool=uAe;function lAe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(yE(r)),t.setStatus({code:Zs.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}me.patchClientConnectCallback=lAe;function pAe(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}me.getErrorMessage=pAe;function dAe(t){return typeof t=="object"&&typeof t?.text=="string"}me.isObjectWithTextString=dAe;function yE(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}me.sanitizedErrorMessage=yE});var Mz=E(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.PACKAGE_NAME=Gu.PACKAGE_VERSION=void 0;Gu.PACKAGE_VERSION="0.66.0";Gu.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var wz=E(OE=>{"use strict";Object.defineProperty(OE,"__esModule",{value:!0});OE.PgInstrumentation=void 0;var mn=ne(),Ie=(b(),O(v)),xz=Rz(),ke=Pz(),vz=jN(),Lz=Mz(),Dz=nb(),IE=Te(),wr=(le(),O(Ae)),bd=tb();function Bu(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var ob=class extends mn.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(Lz.PACKAGE_NAME,Lz.PACKAGE_VERSION,e),this._semconvStability=(0,mn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(wr.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Ie.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(bd.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(bd.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new mn.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new mn.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new mn.InstrumentationNodeModuleDefinition("pg",e,a=>{let c=Bu(a);return this._patchPgClient(c.Client),a},a=>{let c=Bu(a);return this._unpatchPgClient(c.Client),a},[o,r]),i=new mn.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let c=Bu(a);return(0,mn.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect"),this._wrap(c.prototype,"connect",this._getPoolConnectPatch()),c},a=>{let c=Bu(a);(0,mn.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=Bu(e);return(0,mn.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,mn.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=Bu(e);return(0,mn.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,mn.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ke.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(Dz.SpanNames.CONNECT,{kind:Ie.SpanKind.CLIENT,attributes:ke.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let c=Ie.trace.getSpan(Ie.context.active());o=ke.patchClientConnectCallback(i,o),c&&(o=Ie.context.bind(Ie.context.active(),o))}let a=Ie.context.with(Ie.trace.setSpan(Ie.context.active(),i),()=>n.call(this,o));return Uz(i,a)}}recordOperationDuration(e,n){let r={},o=[wr.ATTR_DB_NAMESPACE,wr.ATTR_ERROR_TYPE,wr.ATTR_SERVER_PORT,wr.ATTR_SERVER_ADDRESS,wr.ATTR_DB_OPERATION_NAME];this._semconvStability&mn.SemconvStability.OLD&&o.push(bd.ATTR_DB_SYSTEM),this._semconvStability&mn.SemconvStability.STABLE&&o.push(wr.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,IE.hrTimeToMilliseconds)((0,IE.hrTimeDuration)(n,(0,IE.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ke.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,IE.hrTime)(),i=o[0],a=typeof i=="string",c=ke.isObjectWithTextString(i),l=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,p={[bd.ATTR_DB_SYSTEM]:bd.DB_SYSTEM_VALUE_POSTGRESQL,[wr.ATTR_DB_NAMESPACE]:this.database,[wr.ATTR_SERVER_PORT]:this.connectionParameters.port,[wr.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};l?.text&&(p[wr.ATTR_DB_OPERATION_NAME]=ke.parseNormalizedOperationName(l?.text));let d=()=>{e.recordOperationDuration(p,s)},_=e.getConfig(),f=ke.handleConfigQuery.call(this,e.tracer,_,e._semconvStability,l);if(_.addSqlCommenterCommentToQueries&&(a?o[0]=(0,vz.addSqlCommenterComment)(f,i):c&&!("name"in i)&&(o[0]={...i,text:(0,vz.addSqlCommenterComment)(f,i.text)})),o.length>0){let T=Ie.trace.getSpan(Ie.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ke.patchCallback(_,f,o[o.length-1],p,d),T&&(o[o.length-1]=Ie.context.bind(Ie.context.active(),o[o.length-1]));else if(typeof l?.callback=="function"){let S=ke.patchCallback(e.getConfig(),f,l.callback,p,d);T&&(S=Ie.context.bind(Ie.context.active(),S)),o[0].callback=S}}let{requestHook:m}=_;typeof m=="function"&&l&&(0,mn.safeExecuteInTheMiddle)(()=>{let{database:T,host:S,port:R,user:I}=this.connectionParameters;m(f,{connection:{database:T,host:S,port:R,user:I},query:{text:l.text,values:l.values,name:l.name}})},T=>{T&&e._diag.error("Error running query hook",T)},!0);let h;try{h=n.apply(this,o)}catch(T){throw T instanceof Error&&f.recordException(ke.sanitizedErrorMessage(T)),f.setStatus({code:Ie.SpanStatusCode.ERROR,message:ke.getErrorMessage(T)}),f.end(),T}return h instanceof Promise?h.then(T=>new Promise(S=>{ke.handleExecutionResult(e.getConfig(),f,T),d(),f.end(),S(T)})).catch(T=>new Promise((S,R)=>{T instanceof Error&&f.recordException(ke.sanitizedErrorMessage(T)),f.setStatus({code:Ie.SpanStatusCode.ERROR,message:T.message}),d(),f.end(),R(T)})):h})}_setPoolConnectEventListeners(e){if(e[xz.EVENT_LISTENERS_SET])return;let n=ke.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=ke.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[xz.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ke.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(Dz.SpanNames.POOL_CONNECT,{kind:Ie.SpanKind.CLIENT,attributes:ke.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let c=Ie.trace.getSpan(Ie.context.active());o=ke.patchCallbackPGPool(i,o),c&&(o=Ie.context.bind(Ie.context.active(),o))}let a=Ie.context.with(Ie.trace.setSpan(Ie.context.active(),i),()=>n.call(this,o));return Uz(i,a)}}};OE.PgInstrumentation=ob;function Uz(t,e){if(!(e instanceof Promise))return e;let n=e;return Ie.context.bind(Ie.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(ke.sanitizedErrorMessage(r)),t.setStatus({code:Ie.SpanStatusCode.ERROR,message:ke.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var kz=E(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.AttributeNames=ju.PgInstrumentation=void 0;var _Ae=wz();Object.defineProperty(ju,"PgInstrumentation",{enumerable:!0,get:function(){return _Ae.PgInstrumentation}});var fAe=eb();Object.defineProperty(ju,"AttributeNames",{enumerable:!0,get:function(){return fAe.AttributeNames}})});var $z=E(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.SeverityNumber=void 0;var SAe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(SAe=Cd.SeverityNumber||(Cd.SeverityNumber={}))});var bE=E(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.NOOP_LOGGER=Hu.NoopLogger=void 0;var NE=class{emit(e){}};Hu.NoopLogger=NE;Hu.NOOP_LOGGER=new NE});var PE=E(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.NOOP_LOGGER_PROVIDER=Fu.NoopLoggerProvider=void 0;var gAe=bE(),CE=class{getLogger(e,n,r){return new gAe.NoopLogger}};Fu.NoopLoggerProvider=CE;Fu.NOOP_LOGGER_PROVIDER=new CE});var cb=E(ME=>{"use strict";Object.defineProperty(ME,"__esModule",{value:!0});ME.ProxyLogger=void 0;var AAe=bE(),ab=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):AAe.NOOP_LOGGER}};ME.ProxyLogger=ab});var lb=E(xE=>{"use strict";Object.defineProperty(xE,"__esModule",{value:!0});xE.ProxyLoggerProvider=void 0;var RAe=PE(),yAe=cb(),ub=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new yAe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:RAe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};xE.ProxyLoggerProvider=ub});var Yz=E(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});vE._globalThis=void 0;vE._globalThis=typeof globalThis=="object"?globalThis:global});var Wz=E(LE=>{"use strict";Object.defineProperty(LE,"__esModule",{value:!0});LE._globalThis=void 0;var IAe=Yz();Object.defineProperty(LE,"_globalThis",{enumerable:!0,get:function(){return IAe._globalThis}})});var zz=E(DE=>{"use strict";Object.defineProperty(DE,"__esModule",{value:!0});DE._globalThis=void 0;var OAe=Wz();Object.defineProperty(DE,"_globalThis",{enumerable:!0,get:function(){return OAe._globalThis}})});var Kz=E(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.API_BACKWARDS_COMPATIBILITY_VERSION=_o.makeGetter=_o._global=_o.GLOBAL_LOGS_API_KEY=void 0;var NAe=zz();_o.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");_o._global=NAe._globalThis;function bAe(t,e,n){return r=>r===t?e:n}_o.makeGetter=bAe;_o.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Xz=E(UE=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0});UE.LogsAPI=void 0;var mr=Kz(),CAe=PE(),Qz=lb(),pb=class t{constructor(){this._proxyLoggerProvider=new Qz.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return mr._global[mr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(mr._global[mr.GLOBAL_LOGS_API_KEY]=(0,mr.makeGetter)(mr.API_BACKWARDS_COMPATIBILITY_VERSION,e,CAe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=mr._global[mr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(mr._global,mr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete mr._global[mr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Qz.ProxyLoggerProvider}};UE.LogsAPI=pb});var db=E(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.logs=Pt.ProxyLoggerProvider=Pt.ProxyLogger=Pt.NoopLoggerProvider=Pt.NOOP_LOGGER_PROVIDER=Pt.NoopLogger=Pt.NOOP_LOGGER=Pt.SeverityNumber=void 0;var PAe=$z();Object.defineProperty(Pt,"SeverityNumber",{enumerable:!0,get:function(){return PAe.SeverityNumber}});var Jz=bE();Object.defineProperty(Pt,"NOOP_LOGGER",{enumerable:!0,get:function(){return Jz.NOOP_LOGGER}});Object.defineProperty(Pt,"NoopLogger",{enumerable:!0,get:function(){return Jz.NoopLogger}});var Zz=PE();Object.defineProperty(Pt,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return Zz.NOOP_LOGGER_PROVIDER}});Object.defineProperty(Pt,"NoopLoggerProvider",{enumerable:!0,get:function(){return Zz.NoopLoggerProvider}});var MAe=cb();Object.defineProperty(Pt,"ProxyLogger",{enumerable:!0,get:function(){return MAe.ProxyLogger}});var xAe=lb();Object.defineProperty(Pt,"ProxyLoggerProvider",{enumerable:!0,get:function(){return xAe.ProxyLoggerProvider}});var vAe=Xz();Pt.logs=vAe.LogsAPI.getInstance()});var eK=E(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.disableInstrumentations=Vu.enableInstrumentations=void 0;function LAe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Vu.enableInstrumentations=LAe;function DAe(t){t.forEach(e=>e.disable())}Vu.disableInstrumentations=DAe});var rK=E(wE=>{"use strict";Object.defineProperty(wE,"__esModule",{value:!0});wE.registerInstrumentations=void 0;var tK=(b(),O(v)),UAe=db(),nK=eK();function wAe(t){let e=t.tracerProvider||tK.trace.getTracerProvider(),n=t.meterProvider||tK.metrics.getMeterProvider(),r=t.loggerProvider||UAe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,nK.enableInstrumentations)(o,e,n,r),()=>{(0,nK.disableInstrumentations)(o)}}wE.registerInstrumentations=wAe});var dK=E(kE=>{"use strict";Object.defineProperty(kE,"__esModule",{value:!0});kE.satisfies=void 0;var hb=(b(),O(v)),cK=/^(?: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-]+)*))?$/,kAe=/^(?<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-]+)*))?$/,GAe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function BAe(t,e,n){if(!jAe(t))return hb.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=qAe(t);if(!r)return!1;let o=[],s=uK(r,e,o,n);return s&&!n?.includePrerelease?FAe(r,o):s}kE.satisfies=BAe;function jAe(t){return typeof t=="string"&&cK.test(t)}function uK(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(_b(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=pRe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!_b(t,s,n,r))return!1;return!0}return _b(t,e,n,r)}function _b(t,e,n,r){if(e=VAe(e,r),e.includes(" "))return uK(t,e,n,r);{let o=$Ae(e);return n.push(o),HAe(t,o)}}function HAe(t,e){if(e.invalid)return!1;if(!e.version||mb(e.version))return!0;let n=sK(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=sK(r,o)}return GAe[e.op]?.includes(n)}function FAe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function VAe(t,e){return t=t.trim(),t=uRe(t,e),t=cRe(t),t=lRe(t,e),t=t.trim(),t}function hn(t){return!t||t.toLowerCase()==="x"||t==="*"}function qAe(t){let e=t.match(cK);if(!e){hb.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function $Ae(t){if(!t)return{};let e=t.match(kAe);if(!e)return hb.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function mb(t){return t==="*"||t==="x"||t==="X"}function oK(t){let e=parseInt(t,10);return isNaN(e)?t:e}function YAe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function WAe(t,e){if(mb(t)||mb(e))return 0;let[n,r]=YAe(oK(t),oK(e));return n>r?1:n<r?-1:0}function sK(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=WAe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var lK="[a-zA-Z0-9-]",pK="0|[1-9]\\d*",zAe=`\\d*[a-zA-Z-]${lK}*`,KAe="((?:<|>)?=?)",iK=`(?:${pK}|${zAe})`,QAe=`(?:-(${iK}(?:\\.${iK})*))`,aK=`${lK}+`,XAe=`(?:\\+(${aK}(?:\\.${aK})*))`,fb=`${pK}|x|X|\\*`,Pd=`[v=\\s]*(${fb})(?:\\.(${fb})(?:\\.(${fb})(?:${QAe})?${XAe}?)?)?`,JAe=`^${KAe}\\s*${Pd}$`,ZAe=new RegExp(JAe),eRe=`^\\s*(${Pd})\\s+-\\s+(${Pd})\\s*$`,tRe=new RegExp(eRe),nRe="(?:~>?)",rRe=`^${nRe}${Pd}$`,oRe=new RegExp(rRe),sRe="(?:\\^)",iRe=`^${sRe}${Pd}$`,aRe=new RegExp(iRe);function cRe(t){let e=oRe;return t.replace(e,(n,r,o,s,i)=>{let a;return hn(r)?a="":hn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:hn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function uRe(t,e){let n=aRe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let l;return hn(s)?l="":hn(i)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:hn(a)?s==="0"?l=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?l=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,l})}function lRe(t,e){let n=ZAe;return t.replace(n,(r,o,s,i,a,c)=>{let l=hn(s),p=l||hn(i),d=p||hn(a),_=d;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",l?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function pRe(t,e){let n=tRe;return t.replace(n,(r,o,s,i,a,c,l,p,d,_,f,m)=>(hn(s)?o="":hn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:hn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,hn(d)?p="":hn(_)?p=`<${+d+1}.0.0-0`:hn(f)?p=`<${d}.${+_+1}.0-0`:m?p=`<=${d}.${_}.${f}-${m}`:e?.includePrerelease?p=`<${d}.${_}.${+f+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var Tb=E(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.massUnwrap=Ht.unwrap=Ht.massWrap=Ht.wrap=void 0;var Tn=console.error.bind(console);function Md(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var dRe=(t,e,n)=>{if(!t||!t[e]){Tn("no original function "+String(e)+" to wrap");return}if(!n){Tn("no wrapper function"),Tn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Tn("original object and wrapper must be functions");return}let o=n(r,e);return Md(o,"__original",r),Md(o,"__unwrap",()=>{t[e]===o&&Md(t,e,r)}),Md(o,"__wrapped",!0),Md(t,e,o),o};Ht.wrap=dRe;var _Re=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Tn("must provide one or more modules to patch"),Tn(new Error().stack);return}if(!(e&&Array.isArray(e))){Tn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Ht.wrap)(r,o,n)})})};Ht.massWrap=_Re;var fRe=(t,e)=>{if(!t||!t[e]){Tn("no function to unwrap."),Tn(new Error().stack);return}let n=t[e];if(!n.__unwrap)Tn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Ht.unwrap=fRe;var mRe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Tn("must provide one or more modules to patch"),Tn(new Error().stack);return}if(!(e&&Array.isArray(e))){Tn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Ht.unwrap)(n,r)})})};Ht.massUnwrap=mRe;function xd(t){t&&t.logger&&(typeof t.logger!="function"?Tn("new logger isn't a function, not replacing"):Tn=t.logger)}Ht.default=xd;xd.wrap=Ht.wrap;xd.massWrap=Ht.massWrap;xd.unwrap=Ht.unwrap;xd.massUnwrap=Ht.massUnwrap});var _K=E(BE=>{"use strict";Object.defineProperty(BE,"__esModule",{value:!0});BE.InstrumentationAbstract=void 0;var Eb=(b(),O(v)),hRe=db(),GE=Tb(),Sb=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=Eb.diag.createComponentLogger({namespace:e}),this._tracer=Eb.trace.getTracer(e,n),this._meter=Eb.metrics.getMeter(e,n),this._logger=hRe.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=GE.wrap;_unwrap=GE.unwrap;_massWrap=GE.massWrap;_massUnwrap=GE.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};BE.InstrumentationAbstract=Sb});var fK=E(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.ModuleNameTrie=ti.ModuleNameSeparator=void 0;ti.ModuleNameSeparator="/";var jE=class{hooks=[];children=new Map},gb=class{_trie=new jE;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(ti.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new jE,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(ti.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};ti.ModuleNameTrie=gb});var hK=E(HE=>{"use strict";Object.defineProperty(HE,"__esModule",{value:!0});HE.RequireInTheMiddleSingleton=void 0;var TRe=wi(),mK=U("path"),Ab=fK(),ERe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Rb=class t{_moduleNameTrie=new Ab.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new TRe.Hook(null,{internals:!0},(e,n,r)=>{let o=SRe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return ERe?new t:this._instance=this._instance??new t}};HE.RequireInTheMiddleSingleton=Rb;function SRe(t){return mK.sep!==Ab.ModuleNameSeparator?t.split(mK.sep).join(Ab.ModuleNameSeparator):t}});var yb=E(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.isWrapped=ni.safeExecuteInTheMiddleAsync=ni.safeExecuteInTheMiddle=void 0;function gRe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}ni.safeExecuteInTheMiddle=gRe;async function ARe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}ni.safeExecuteInTheMiddleAsync=ARe;function RRe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}ni.isWrapped=RRe});var SK=E(FE=>{"use strict";Object.defineProperty(FE,"__esModule",{value:!0});FE.InstrumentationBase=void 0;var vd=U("path"),TK=U("util"),yRe=dK(),Ib=Tb(),IRe=_K(),ORe=hK(),NRe=oN(),Ld=(b(),O(v)),bRe=wi(),CRe=U("fs"),PRe=yb(),Ob=class extends IRe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=ORe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,PRe.isWrapped)(e[n])&&this._unwrap(e,n),TK.types.isProxy(e)){let o=(0,Ib.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,Ib.wrap)(e,n,r)};_unwrap=(e,n)=>TK.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,Ib.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Ld.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Ld.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Ld.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Ld.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=U.resolve(n);U.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,CRe.readFileSync)(vd.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Ld.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return EK(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=vd.normalize(r);return i.filter(l=>l.name===a).filter(l=>EK(l.supportedVersions,s,e.includePrerelease)).reduce((l,p)=>(p.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&vd.isAbsolute(a)){let l=vd.parse(a);a=l.name,c=l.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=vd.isAbsolute(e.name)?new bRe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new NRe.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};FE.InstrumentationBase=Ob;function EK(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,yRe.satisfies)(e,r,{includePrerelease:n}))}});var gK=E(VE=>{"use strict";Object.defineProperty(VE,"__esModule",{value:!0});VE.normalize=void 0;var MRe=U("path");Object.defineProperty(VE,"normalize",{enumerable:!0,get:function(){return MRe.normalize}})});var AK=E(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.normalize=qu.InstrumentationBase=void 0;var xRe=SK();Object.defineProperty(qu,"InstrumentationBase",{enumerable:!0,get:function(){return xRe.InstrumentationBase}});var vRe=gK();Object.defineProperty(qu,"normalize",{enumerable:!0,get:function(){return vRe.normalize}})});var Nb=E($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.normalize=$u.InstrumentationBase=void 0;var RK=AK();Object.defineProperty($u,"InstrumentationBase",{enumerable:!0,get:function(){return RK.InstrumentationBase}});Object.defineProperty($u,"normalize",{enumerable:!0,get:function(){return RK.normalize}})});var yK=E(qE=>{"use strict";Object.defineProperty(qE,"__esModule",{value:!0});qE.InstrumentationNodeModuleDefinition=void 0;var bb=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};qE.InstrumentationNodeModuleDefinition=bb});var IK=E($E=>{"use strict";Object.defineProperty($E,"__esModule",{value:!0});$E.InstrumentationNodeModuleFile=void 0;var LRe=Nb(),Cb=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,LRe.normalize)(e)}};$E.InstrumentationNodeModuleFile=Cb});var OK=E(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.semconvStabilityFromStr=ga.SemconvStability=void 0;var YE;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(YE=ga.SemconvStability||(ga.SemconvStability={}));function DRe(t,e){let n=YE.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=YE.DUPLICATE;break}else o.toLowerCase()===t&&(n=YE.STABLE);return n}ga.semconvStabilityFromStr=DRe});var bK=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.semconvStabilityFromStr=ut.SemconvStability=ut.safeExecuteInTheMiddleAsync=ut.safeExecuteInTheMiddle=ut.isWrapped=ut.InstrumentationNodeModuleFile=ut.InstrumentationNodeModuleDefinition=ut.InstrumentationBase=ut.registerInstrumentations=void 0;var URe=rK();Object.defineProperty(ut,"registerInstrumentations",{enumerable:!0,get:function(){return URe.registerInstrumentations}});var wRe=Nb();Object.defineProperty(ut,"InstrumentationBase",{enumerable:!0,get:function(){return wRe.InstrumentationBase}});var kRe=yK();Object.defineProperty(ut,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return kRe.InstrumentationNodeModuleDefinition}});var GRe=IK();Object.defineProperty(ut,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return GRe.InstrumentationNodeModuleFile}});var Pb=yb();Object.defineProperty(ut,"isWrapped",{enumerable:!0,get:function(){return Pb.isWrapped}});Object.defineProperty(ut,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return Pb.safeExecuteInTheMiddle}});Object.defineProperty(ut,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return Pb.safeExecuteInTheMiddleAsync}});var NK=OK();Object.defineProperty(ut,"SemconvStability",{enumerable:!0,get:function(){return NK.SemconvStability}});Object.defineProperty(ut,"semconvStabilityFromStr",{enumerable:!0,get:function(){return NK.semconvStabilityFromStr}})});var kK=E(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.PACKAGE_NAME=Wu.PACKAGE_VERSION=void 0;Wu.PACKAGE_VERSION="0.60.0";Wu.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var Lb=E(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.HapiLifecycleMethodNames=fo.HapiLayerType=fo.handlerPatched=fo.HapiComponentName=void 0;fo.HapiComponentName="@hapi/hapi";fo.handlerPatched=Symbol("hapi-handler-patched");fo.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};fo.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var GK=E(zE=>{"use strict";Object.defineProperty(zE,"__esModule",{value:!0});zE.ATTR_HTTP_METHOD=void 0;zE.ATTR_HTTP_METHOD="http.method"});var Db=E(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AttributeNames=void 0;var eye;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(eye=Dd.AttributeNames||(Dd.AttributeNames={}))});var HK=E(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.getPluginFromInput=lt.getExtMetadata=lt.getRouteMetadata=lt.isPatchableExtMethod=lt.isDirectExtInput=lt.isLifecycleExtEventObj=lt.isLifecycleExtType=lt.getPluginName=void 0;var BK=(le(),O(Ae)),tye=GK(),Ud=Lb(),ri=Db(),jK=ne();function nye(t){return t.name?t.name:t.pkg.name}lt.getPluginName=nye;var rye=t=>typeof t=="string"&&Ud.HapiLifecycleMethodNames.has(t);lt.isLifecycleExtType=rye;var oye=t=>{let e=t?.type;return e!==void 0&&(0,lt.isLifecycleExtType)(e)};lt.isLifecycleExtEventObj=oye;var sye=t=>Array.isArray(t)&&t.length<=3&&(0,lt.isLifecycleExtType)(t[0])&&typeof t[1]=="function";lt.isDirectExtInput=sye;var iye=t=>!Array.isArray(t);lt.isPatchableExtMethod=iye;var aye=(t,e,n)=>{let r={[BK.ATTR_HTTP_ROUTE]:t.path};e&jK.SemconvStability.OLD&&(r[tye.ATTR_HTTP_METHOD]=t.method),e&jK.SemconvStability.STABLE&&(r[BK.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[ri.AttributeNames.HAPI_TYPE]=Ud.HapiLayerType.PLUGIN,r[ri.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[ri.AttributeNames.HAPI_TYPE]=Ud.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};lt.getRouteMetadata=aye;var cye=(t,e,n)=>{let r=`ext - ${t}`;return n&&n!=="method"&&(r=`ext - ${t} - ${n}`),e?{attributes:{[ri.AttributeNames.EXT_TYPE]:t,[ri.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.EXT,[ri.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ${r}`}:{attributes:{[ri.AttributeNames.EXT_TYPE]:t,[ri.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.EXT},name:r}};lt.getExtMetadata=cye;var uye=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;lt.getPluginFromInput=uye});var qK=E(KE=>{"use strict";Object.defineProperty(KE,"__esModule",{value:!0});KE.HapiInstrumentation=void 0;var Wn=(b(),O(v)),FK=Te(),wd=ne(),VK=kK(),kd=Lb(),Qo=HK(),Ub=class extends wd.InstrumentationBase{_semconvStability;constructor(e={}){super(VK.PACKAGE_NAME,VK.PACKAGE_VERSION,e),this._semconvStability=(0,wd.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new wd.InstrumentationNodeModuleDefinition(kd.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,wd.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,wd.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Qo.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Qo.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,Qo.isLifecycleExtType)(c.type)){let l=c,p=r._wrapExtMethods(l.method,c.type,n);l.method=p,i[a]=l}}return e.apply(this,s)}else if((0,Qo.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,Qo.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Qo.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",l=>n._getServerRoutePatch.bind(n)(l,r)),s._wrap(a,"ext",l=>n._getServerExtPatch.bind(n)(l,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Qo.isPatchableExtMethod)(e))return e[kd.handlerPatched]===!0?e:(e[kd.handlerPatched]=!0,async function(...i){if(Wn.trace.getSpan(Wn.context.active())===void 0)return await e.apply(this,i);let a=(0,Qo.getExtMetadata)(n,r,e.name),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await Wn.context.with(Wn.trace.setSpan(Wn.context.active(),c),e,void 0,...i)}catch(l){throw c.recordException(l),c.setStatus({code:Wn.SpanStatusCode.ERROR,message:l.message}),l}finally{c.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[kd.handlerPatched]===!0)return e;e[kd.handlerPatched]=!0;let o=s=>async function(...i){if(Wn.trace.getSpan(Wn.context.active())===void 0)return await s.call(this,...i);let a=(0,FK.getRPCMetadata)(Wn.context.active());a?.type===FK.RPCType.HTTP&&(a.route=e.path);let c=(0,Qo.getRouteMetadata)(e,r._semconvStability,n),l=r.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Wn.context.with(Wn.trace.setSpan(Wn.context.active(),l),()=>s.call(this,...i))}catch(p){throw l.recordException(p),l.setStatus({code:Wn.SpanStatusCode.ERROR,message:p.message}),p}finally{l.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};KE.HapiInstrumentation=Ub});var $K=E(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.AttributeNames=zu.HapiInstrumentation=void 0;var lye=qK();Object.defineProperty(zu,"HapiInstrumentation",{enumerable:!0,get:function(){return lye.HapiInstrumentation}});var pye=Db();Object.defineProperty(zu,"AttributeNames",{enumerable:!0,get:function(){return pye.AttributeNames}})});var JE=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.KoaLayerType=void 0;var Tye;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(Tye=Bd.KoaLayerType||(Bd.KoaLayerType={}))});var ZK=E(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.PACKAGE_NAME=Ku.PACKAGE_VERSION=void 0;Ku.PACKAGE_VERSION="0.62.0";Ku.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var wb=E(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.AttributeNames=void 0;var Eye;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(Eye=jd.AttributeNames||(jd.AttributeNames={}))});var t2=E(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.isLayerIgnored=Qu.getMiddlewareMetadata=void 0;var e2=JE(),ZE=wb(),Sye=(le(),O(Ae)),gye=(t,e,n,r)=>n?{attributes:{[ZE.AttributeNames.KOA_NAME]:r?.toString(),[ZE.AttributeNames.KOA_TYPE]:e2.KoaLayerType.ROUTER,[Sye.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[ZE.AttributeNames.KOA_NAME]:e.name??"middleware",[ZE.AttributeNames.KOA_TYPE]:e2.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};Qu.getMiddlewareMetadata=gye;var Aye=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));Qu.isLayerIgnored=Aye});var n2=E(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});eS.kLayerPatched=void 0;eS.kLayerPatched=Symbol("koa-layer-patched")});var c2=E(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});tS.KoaInstrumentation=void 0;var mo=(b(),O(v)),Hd=ne(),r2=JE(),o2=ZK(),s2=t2(),i2=Te(),a2=n2(),kb=class extends Hd.InstrumentationBase{constructor(e={}){super(o2.PACKAGE_NAME,o2.PACKAGE_VERSION,e)}init(){return new Hd.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Hd.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Hd.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){mo.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let c=i[a];i[a]=this._patchLayer(c,!0,s)}}return e}_patchLayer(e,n,r){let o=n?r2.KoaLayerType.ROUTER:r2.KoaLayerType.MIDDLEWARE;return e[a2.kLayerPatched]===!0||(0,s2.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(mo.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[a2.kLayerPatched]=!0,mo.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(mo.trace.getSpan(mo.context.active())===void 0)return e(s,i);let c=(0,s2.getMiddlewareMetadata)(s,e,n,r),l=this.tracer.startSpan(c.name,{attributes:c.attributes}),p=(0,i2.getRPCMetadata)(mo.context.active());p?.type===i2.RPCType.HTTP&&s._matchedRoute&&(p.route=s._matchedRoute.toString());let{requestHook:d}=this.getConfig();d&&(0,Hd.safeExecuteInTheMiddle)(()=>d(l,{context:s,middlewareLayer:e,layerType:o}),f=>{f&&mo.diag.error("koa instrumentation: request hook failed",f)},!0);let _=mo.trace.setSpan(mo.context.active(),l);return mo.context.with(_,async()=>{try{return await e(s,i)}catch(f){throw l.recordException(f),f}finally{l.end()}})})}};tS.KoaInstrumentation=kb});var u2=E(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.KoaLayerType=si.AttributeNames=si.KoaInstrumentation=void 0;var Rye=c2();Object.defineProperty(si,"KoaInstrumentation",{enumerable:!0,get:function(){return Rye.KoaInstrumentation}});var yye=wb();Object.defineProperty(si,"AttributeNames",{enumerable:!0,get:function(){return yye.AttributeNames}});var Iye=JE();Object.defineProperty(si,"KoaLayerType",{enumerable:!0,get:function(){return Iye.KoaLayerType}})});var Gb=E(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.ConnectNames=kr.ConnectTypes=kr.AttributeNames=void 0;var Nye;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(Nye=kr.AttributeNames||(kr.AttributeNames={}));var bye;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(bye=kr.ConnectTypes||(kr.ConnectTypes={}));var Cye;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(Cye=kr.ConnectNames||(kr.ConnectNames={}))});var f2=E(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.PACKAGE_NAME=Xu.PACKAGE_VERSION=void 0;Xu.PACKAGE_VERSION="0.57.0";Xu.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var m2=E(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});nS._LAYERS_STORE_PROPERTY=void 0;nS._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var h2=E(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.generateRoute=ai.replaceCurrentStackRoute=ai.addNewStackLayer=void 0;var Pye=(b(),O(v)),ii=m2(),Mye=t=>{Array.isArray(t[ii._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,ii._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[ii._LAYERS_STORE_PROPERTY].push("/");let e=t[ii._LAYERS_STORE_PROPERTY].length;return()=>{e===t[ii._LAYERS_STORE_PROPERTY].length?t[ii._LAYERS_STORE_PROPERTY].pop():Pye.diag.warn("Connect: Trying to pop the stack multiple time")}};ai.addNewStackLayer=Mye;var xye=(t,e)=>{e&&t[ii._LAYERS_STORE_PROPERTY].splice(-1,1,e)};ai.replaceCurrentStackRoute=xye;var vye=t=>t[ii._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);ai.generateRoute=vye});var S2=E(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.ConnectInstrumentation=ci.ANONYMOUS_NAME=void 0;var Lye=(b(),O(v)),T2=Te(),Ju=Gb(),E2=f2(),rS=ne(),Dye=(le(),O(Ae)),Bb=h2();ci.ANONYMOUS_NAME="anonymous";var jb=class extends rS.InstrumentationBase{constructor(e={}){super(E2.PACKAGE_NAME,E2.PACKAGE_VERSION,e)}init(){return[new rS.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,rS.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,rS.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=Ju.ConnectTypes.REQUEST_HANDLER,s=Ju.ConnectNames.REQUEST_HANDLER,o=e):(r=Ju.ConnectTypes.MIDDLEWARE,s=Ju.ConnectNames.MIDDLEWARE,o=n.name||ci.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[Dye.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[Ju.AttributeNames.CONNECT_TYPE]:r,[Ju.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],l=arguments[i],p=arguments[a],d=arguments[c];(0,Bb.replaceCurrentStackRoute)(l,e);let _=(0,T2.getRPCMetadata)(Lye.context.active());e&&_?.type===T2.RPCType.HTTP&&(_.route=(0,Bb.generateRoute)(l));let f="";e?f=`request handler - ${e}`:f=`middleware - ${n.name||ci.ANONYMOUS_NAME}`;let m=r._startSpan(e,n);r._diag.debug("start span",f);let h=!1;function T(){h?r._diag.debug(`span ${m.name} - already finished`):(h=!0,r._diag.debug(`finishing span ${m.name}`),m.end()),p.removeListener("close",T)}return p.addListener("close",T),arguments[c]=r._patchNext(d,T),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,Bb.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};ci.ConnectInstrumentation=jb});var A2=E(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.ConnectTypes=hr.ConnectNames=hr.AttributeNames=hr.ANONYMOUS_NAME=hr.ConnectInstrumentation=void 0;var g2=S2();Object.defineProperty(hr,"ConnectInstrumentation",{enumerable:!0,get:function(){return g2.ConnectInstrumentation}});Object.defineProperty(hr,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return g2.ANONYMOUS_NAME}});var Hb=Gb();Object.defineProperty(hr,"AttributeNames",{enumerable:!0,get:function(){return Hb.AttributeNames}});Object.defineProperty(hr,"ConnectNames",{enumerable:!0,get:function(){return Hb.ConnectNames}});Object.defineProperty(hr,"ConnectTypes",{enumerable:!0,get:function(){return Hb.ConnectTypes}})});var N2=E(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.DB_SYSTEM_VALUE_MSSQL=Mt.ATTR_NET_PEER_PORT=Mt.ATTR_NET_PEER_NAME=Mt.ATTR_DB_USER=Mt.ATTR_DB_SYSTEM=Mt.ATTR_DB_STATEMENT=Mt.ATTR_DB_SQL_TABLE=Mt.ATTR_DB_NAME=void 0;Mt.ATTR_DB_NAME="db.name";Mt.ATTR_DB_SQL_TABLE="db.sql.table";Mt.ATTR_DB_STATEMENT="db.statement";Mt.ATTR_DB_SYSTEM="db.system";Mt.ATTR_DB_USER="db.user";Mt.ATTR_NET_PEER_NAME="net.peer.name";Mt.ATTR_NET_PEER_PORT="net.peer.port";Mt.DB_SYSTEM_VALUE_MSSQL="mssql"});var b2=E(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.once=Zu.getSpanName=void 0;function wye(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}Zu.getSpanName=wye;var kye=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Zu.once=kye});var C2=E(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.PACKAGE_NAME=el.PACKAGE_VERSION=void 0;el.PACKAGE_VERSION="0.33.0";el.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var L2=E(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.TediousInstrumentation=li.INJECTED_CTX=void 0;var tl=(b(),O(v)),Gye=U("events"),ho=ne(),Aa=(le(),O(Ae)),ui=N2(),P2=b2(),M2=C2(),v2=Symbol("opentelemetry.instrumentation-tedious.current-database");li.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var x2=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function oS(t){Object.defineProperty(this,v2,{value:t,writable:!0})}var Fb=class t extends ho.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(M2.PACKAGE_NAME,M2.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ho.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ho.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new ho.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of x2)(0,ho.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,ho.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of x2)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return oS.call(this,this.config?.options?.database),this.removeListener("databaseChange",oS),this.on("databaseChange",oS),this.once("end",()=>{this.removeListener("databaseChange",oS)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||tl.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,c=>{o()});Object.defineProperty(i,li.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[li.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof Gye.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,c=0,l=()=>c++,p=()=>a++,d=this[v2],_=(x=>x.sqlTextOrProcedure==="sp_prepare"&&x.parametersByName?.stmt?.value?x.parametersByName.stmt.value:x.sqlTextOrProcedure)(i),f={};o._dbSemconvStability&ho.SemconvStability.OLD&&(f[ui.ATTR_DB_SYSTEM]=ui.DB_SYSTEM_VALUE_MSSQL,f[ui.ATTR_DB_NAME]=d,f[ui.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,f[ui.ATTR_DB_STATEMENT]=_,f[ui.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&ho.SemconvStability.STABLE&&(f[Aa.ATTR_DB_NAMESPACE]=d,f[Aa.ATTR_DB_SYSTEM_NAME]=Aa.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,f[Aa.ATTR_DB_QUERY_TEXT]=_,f[Aa.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&ho.SemconvStability.OLD&&(f[ui.ATTR_NET_PEER_NAME]=this.config?.server,f[ui.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&ho.SemconvStability.STABLE&&(f[Aa.ATTR_SERVER_ADDRESS]=this.config?.server,f[Aa.ATTR_SERVER_PORT]=this.config?.options?.port);let m=o.tracer.startSpan((0,P2.getSpanName)(e,d,_,i.table),{kind:tl.SpanKind.CLIENT,attributes:f}),h=(0,P2.once)(x=>{i.removeListener("done",l),i.removeListener("doneInProc",l),i.removeListener("doneProc",p),i.removeListener("error",h),this.removeListener("end",h),m.setAttribute("tedious.procedure_count",a),m.setAttribute("tedious.statement_count",c),x&&m.setStatus({code:tl.SpanStatusCode.ERROR,message:x.message}),m.end()});i.on("done",l),i.on("doneInProc",l),i.on("doneProc",p),i.once("error",h),this.on("end",h),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(h)):o._diag.error("Expected request.callback to be a function");let T=()=>tl.context.with(tl.trace.setSpan(tl.context.active(),m),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return T();let I=o._buildTraceparent(m);o._injectContextInfo(this,n,I).finally(T)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};li.TediousInstrumentation=Fb});var D2=E(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});sS.TediousInstrumentation=void 0;var Bye=L2();Object.defineProperty(sS,"TediousInstrumentation",{enumerable:!0,get:function(){return Bye.TediousInstrumentation}})});var B2=E(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.PACKAGE_NAME=nl.PACKAGE_VERSION=void 0;nl.PACKAGE_VERSION="0.57.0";nl.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var H2=E(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});iS.GenericPoolInstrumentation=void 0;var rl=(b(),O(v)),Ra=ne(),j2=B2(),Vb="generic-pool",qb=class extends Ra.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(j2.PACKAGE_NAME,j2.PACKAGE_VERSION,e)}init(){return[new Ra.InstrumentationNodeModuleDefinition(Vb,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,Ra.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new Ra.InstrumentationNodeModuleDefinition(Vb,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,Ra.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new Ra.InstrumentationNodeModuleDefinition(Vb,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,Ra.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=rl.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return rl.context.with(rl.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=rl.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return rl.context.with(rl.trace.setSpan(i,a),()=>{e.call(this,(c,l)=>{if(a.end(),o)return o(c,l)},s)})}}};iS.GenericPoolInstrumentation=qb});var F2=E(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.GenericPoolInstrumentation=void 0;var Fye=H2();Object.defineProperty(aS,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return Fye.GenericPoolInstrumentation}})});var $b=E(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.ATTR_NET_PEER_PORT=To.ATTR_NET_PEER_NAME=To.ATTR_MESSAGING_SYSTEM=To.ATTR_MESSAGING_OPERATION=void 0;To.ATTR_MESSAGING_OPERATION="messaging.operation";To.ATTR_MESSAGING_SYSTEM="messaging.system";To.ATTR_NET_PEER_NAME="net.peer.name";To.ATTR_NET_PEER_PORT="net.peer.port"});var Yb=E(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.ATTR_MESSAGING_CONVERSATION_ID=qe.OLD_ATTR_MESSAGING_MESSAGE_ID=qe.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=qe.ATTR_MESSAGING_URL=qe.ATTR_MESSAGING_PROTOCOL_VERSION=qe.ATTR_MESSAGING_PROTOCOL=qe.MESSAGING_OPERATION_VALUE_PROCESS=qe.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=qe.ATTR_MESSAGING_DESTINATION_KIND=qe.ATTR_MESSAGING_DESTINATION=void 0;qe.ATTR_MESSAGING_DESTINATION="messaging.destination";qe.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";qe.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";qe.MESSAGING_OPERATION_VALUE_PROCESS="process";qe.ATTR_MESSAGING_PROTOCOL="messaging.protocol";qe.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";qe.ATTR_MESSAGING_URL="messaging.url";qe.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";qe.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";qe.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var Wb=E(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.DEFAULT_CONFIG=ya.EndOperation=void 0;var qye;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(qye=ya.EndOperation||(ya.EndOperation={}));ya.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var Q2=E($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.isConfirmChannelTracing=$e.unmarkConfirmChannelTracing=$e.markConfirmChannelTracing=$e.getConnectionAttributesFromUrl=$e.getConnectionAttributesFromServer=$e.normalizeExchange=$e.CONNECTION_ATTRIBUTES=$e.CHANNEL_CONSUME_TIMEOUT_TIMER=$e.CHANNEL_SPANS_NOT_ENDED=$e.MESSAGE_STORED_SPAN=void 0;var zb=(b(),O(v)),pi=ne(),cS=(le(),O(Ae)),Fd=$b(),uS=Yb();$e.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");$e.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");$e.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");$e.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var Kb=(0,zb.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),$ye=t=>t!==""?t:"<default>";$e.normalizeExchange=$ye;var Yye=t=>t.replace(/:[^:@/]*@/,":***@"),W2=(t,e)=>t||(e==="AMQP"?5672:5671),z2=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},K2=t=>t||"localhost",Eo=(t,e,n,r)=>n?{[e]:n}:(zb.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),Wye=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[Fd.ATTR_MESSAGING_SYSTEM]:e}:{}};$e.getConnectionAttributesFromServer=Wye;var zye=(t,e)=>{let n={[uS.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=z2(r?.protocol);Object.assign(n,{...Eo(t,uS.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=K2(r?.hostname);e&pi.SemconvStability.OLD&&Object.assign(n,{...Eo(t,Fd.ATTR_NET_PEER_NAME,s,"hostname")}),e&pi.SemconvStability.STABLE&&Object.assign(n,{...Eo(t,cS.ATTR_SERVER_ADDRESS,s,"hostname")});let i=W2(r.port,o);e&pi.SemconvStability.OLD&&Object.assign(n,Eo(t,Fd.ATTR_NET_PEER_PORT,i,"port")),e&pi.SemconvStability.STABLE&&Object.assign(n,Eo(t,cS.ATTR_SERVER_PORT,i,"port"))}else{let r=Yye(t);n[uS.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=z2(o.protocol);Object.assign(n,{...Eo(r,uS.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=K2(o.hostname);e&pi.SemconvStability.OLD&&Object.assign(n,{...Eo(r,Fd.ATTR_NET_PEER_NAME,i,"hostname")}),e&pi.SemconvStability.STABLE&&Object.assign(n,{...Eo(r,cS.ATTR_SERVER_ADDRESS,i,"hostname")});let a=W2(o.port?parseInt(o.port):void 0,s);e&pi.SemconvStability.OLD&&Object.assign(n,Eo(r,Fd.ATTR_NET_PEER_PORT,a,"port")),e&pi.SemconvStability.STABLE&&Object.assign(n,Eo(r,cS.ATTR_SERVER_PORT,a,"port"))}catch(o){zb.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};$e.getConnectionAttributesFromUrl=zye;var Kye=t=>t.setValue(Kb,!0);$e.markConfirmChannelTracing=Kye;var Qye=t=>t.deleteValue(Kb);$e.unmarkConfirmChannelTracing=Qye;var Xye=t=>t.getValue(Kb)===!0;$e.isConfirmChannelTracing=Xye});var X2=E(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.PACKAGE_NAME=ol.PACKAGE_VERSION=void 0;ol.PACKAGE_VERSION="0.61.0";ol.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Z2=E(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});dS.AmqplibInstrumentation=void 0;var Ge=(b(),O(v)),lS=Te(),Ee=ne(),Jye=$b(),zn=Yb(),En=Wb(),Ye=Q2(),J2=X2(),pS=[">=0.5.5 <1"],Qb=class extends Ee.InstrumentationBase{_netSemconvStability;constructor(e={}){super(J2.PACKAGE_NAME,J2.PACKAGE_VERSION,{...En.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ee.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...En.DEFAULT_CONFIG,...e})}init(){let e=new Ee.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",pS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Ee.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",pS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Ee.InstrumentationNodeModuleFile("amqplib/lib/connect.js",pS,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Ee.InstrumentationNodeModuleDefinition("amqplib",pS,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,Ee.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,Ee.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,Ee.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Ee.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Ee.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,En.EndOperation.Ack)),(0,Ee.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,En.EndOperation.Nack)),(0,Ee.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,En.EndOperation.Reject)),(0,Ee.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,En.EndOperation.AckAll)),(0,Ee.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,En.EndOperation.NackAll)),(0,Ee.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Ee.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,Ee.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,Ee.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,Ee.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,Ee.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,Ee.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,Ee.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,Ee.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,Ee.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,Ee.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,c){if(a==null){let l=(0,Ye.getConnectionAttributesFromUrl)(o,n._netSemconvStability),p=(0,Ye.getConnectionAttributesFromServer)(c);c[Ye.CONNECTION_ATTRIBUTES]={...l,...p}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,En.EndOperation.ChannelClosed,void 0);let s=this[Ye.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[Ye.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,En.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){let l=this,p=n===En.EndOperation.Reject?a:c,d=l[Ye.CHANNEL_SPANS_NOT_ENDED]??[],_=d.findIndex(f=>f.msg===i);if(_<0)o.endConsumerSpan(i,e,n,p);else if(n!==En.EndOperation.Reject&&a){for(let f=0;f<=_;f++)o.endConsumerSpan(d[f].msg,e,n,p);d.splice(0,_+1)}else o.endConsumerSpan(i,e,n,p),d.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,Ye.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:p}=r.getConfig();if(p){let d=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},p);d.unref(),c[Ye.CHANNEL_CONSUME_TIMEOUT_TIMER]=d}c[Ye.CHANNEL_SPANS_NOT_ENDED]=[]}let l=function(p){if(!p)return i.call(this,p);let d=p.properties.headers??{},_=Ge.propagation.extract(Ge.ROOT_CONTEXT,d),f=p.fields?.exchange,m;if(r._config.useLinksForConsume){let R=_?Ge.trace.getSpan(_)?.spanContext():void 0;_=void 0,R&&(m=[{context:R}])}let h=r.tracer.startSpan(`${s} process`,{kind:Ge.SpanKind.CONSUMER,attributes:{...c?.connection?.[Ye.CONNECTION_ATTRIBUTES],[zn.ATTR_MESSAGING_DESTINATION]:f,[zn.ATTR_MESSAGING_DESTINATION_KIND]:zn.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[zn.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:p.fields?.routingKey,[Jye.ATTR_MESSAGING_OPERATION]:zn.MESSAGING_OPERATION_VALUE_PROCESS,[zn.OLD_ATTR_MESSAGING_MESSAGE_ID]:p?.properties.messageId,[zn.ATTR_MESSAGING_CONVERSATION_ID]:p?.properties.correlationId},links:m},_),{consumeHook:T}=r.getConfig();T&&(0,Ee.safeExecuteInTheMiddle)(()=>T(h,{moduleVersion:e,msg:p}),R=>{R&&Ge.diag.error("amqplib instrumentation: consumerHook error",R)},!0),a?.noAck||(c[Ye.CHANNEL_SPANS_NOT_ENDED].push({msg:p,timeOfConsume:(0,lS.hrTime)()}),p[Ye.MESSAGE_STORED_SPAN]=h);let S=_||Ge.ROOT_CONTEXT;Ge.context.with(Ge.trace.setSpan(S,h),()=>{i.call(this,p)}),a?.noAck&&(r.callConsumeEndHook(h,p,!1,En.EndOperation.AutoAck),h.end())};return arguments[1]=l,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,l){let p=this,{span:d,modifiedOptions:_}=r.createPublishSpan(r,s,i,p,c),{publishHook:f}=r.getConfig();f&&(0,Ee.safeExecuteInTheMiddle)(()=>f(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:_,isConfirmChannel:!0}),S=>{S&&Ge.diag.error("amqplib instrumentation: publishHook error",S)},!0);let m=function(S,R){try{l?.call(this,S,R)}finally{let{publishConfirmHook:I}=r.getConfig();I&&(0,Ee.safeExecuteInTheMiddle)(()=>I(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:S}),x=>{x&&Ge.diag.error("amqplib instrumentation: publishConfirmHook error",x)},!0),S&&d.setStatus({code:Ge.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),d.end()}},h=(0,Ye.markConfirmChannelTracing)(Ge.context.active()),T=[...arguments];return T[3]=_,T[4]=Ge.context.bind((0,Ye.unmarkConfirmChannelTracing)(Ge.trace.setSpan(h,d)),m),Ge.context.with(h,n.bind(this,...T))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,Ye.isConfirmChannelTracing)(Ge.context.active()))return n.apply(this,arguments);{let l=this,{span:p,modifiedOptions:d}=r.createPublishSpan(r,s,i,l,c),{publishHook:_}=r.getConfig();_&&(0,Ee.safeExecuteInTheMiddle)(()=>_(p,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:d,isConfirmChannel:!1}),h=>{h&&Ge.diag.error("amqplib instrumentation: publishHook error",h)},!0);let f=[...arguments];f[3]=d;let m=n.apply(this,f);return p.end(),m}}}createPublishSpan(e,n,r,o,s){let i=(0,Ye.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:Ge.SpanKind.PRODUCER,attributes:{...o.connection[Ye.CONNECTION_ATTRIBUTES],[zn.ATTR_MESSAGING_DESTINATION]:n,[zn.ATTR_MESSAGING_DESTINATION_KIND]:zn.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[zn.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[zn.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[zn.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),c=s??{};return c.headers=c.headers??{},Ge.propagation.inject(Ge.trace.setSpan(Ge.context.active(),a),c.headers),{span:a,modifiedOptions:c}}endConsumerSpan(e,n,r,o){let s=e[Ye.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:Ge.SpanStatusCode.ERROR,message:r!==En.EndOperation.ChannelClosed&&r!==En.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[Ye.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[Ye.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[Ye.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,Ee.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&Ge.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,lS.hrTime)(),r=e[Ye.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,lS.hrTimeDuration)(i.timeOfConsume,n);if((0,lS.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,En.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};dS.AmqplibInstrumentation=Qb});var t4=E(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.EndOperation=di.DEFAULT_CONFIG=di.AmqplibInstrumentation=void 0;var Zye=Z2();Object.defineProperty(di,"AmqplibInstrumentation",{enumerable:!0,get:function(){return Zye.AmqplibInstrumentation}});var e4=Wb();Object.defineProperty(di,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return e4.DEFAULT_CONFIG}});Object.defineProperty(di,"EndOperation",{enumerable:!0,get:function(){return e4.EndOperation}})});b();var tq=K(OG(),1);var C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var J=globalThis;var pe="10.47.0";function cn(){return fs(J),J}function fs(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||pe,e[pe]=e[pe]||{}}function Ir(t,e,n=J){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[pe]=r[pe]||{};return o[t]||(o[t]=e())}var Vl=["debug","info","warn","error","log","assert","trace"],Zie="Sentry Logger ",hc={};function Qe(t){if(!("console"in J))return t();let e=J.console,n={},r=Object.keys(hc);r.forEach(o=>{let s=hc[o];n[o]=e[o],e[o]=s});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function eae(){AR().enabled=!0}function tae(){AR().enabled=!1}function NG(){return AR().enabled}function nae(...t){gR("log",...t)}function rae(...t){gR("warn",...t)}function oae(...t){gR("error",...t)}function gR(t,...e){C&&NG()&&Qe(()=>{J.console[t](`${Zie}[${t}]:`,...e)})}function AR(){return C?Ir("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var g={enable:eae,disable:tae,isEnabled:NG,log:nae,warn:rae,error:oae};var Mf="?",bG=/\(error: (.*)\)/,CG=/captureMessage|captureException/;function xf(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
13
+ `);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let l=bG.test(c)?c.replace(bG,"$1"):c;if(!l.match(/\S*Error: /)){for(let p of e){let d=p(l);if(d){s.push(d);break}}if(s.length>=50+o)break}}return PG(s.slice(o))}}function yR(t){return Array.isArray(t)?xf(...t):t}function PG(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Pf(e).function||"")&&e.pop(),e.reverse(),CG.test(Pf(e).function||"")&&(e.pop(),CG.test(Pf(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||Pf(e).filename,function:n.function||Mf}))}function Pf(t){return t[t.length-1]||{}}var RR="<anonymous>";function ql(t){try{return!t||typeof t!="function"?RR:t.name||RR}catch{return RR}}function vf(t){return"__v_isVNode"in t&&t.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function MG(t){let e=t?.startsWith("file://")?t.slice(7):t;return e?.match(/\/[A-Z]:/)&&(e=e.slice(1)),e}var Lf={},xG={};function Tc(t,e){Lf[t]=Lf[t]||[],Lf[t].push(e)}function Ec(t,e){if(!xG[t]){xG[t]=!0;try{e()}catch(n){C&&g.error(`Error while instrumenting ${t}`,n)}}}function Sc(t,e){let n=t&&Lf[t];if(n)for(let r of n)try{r(e)}catch(o){C&&g.error(`Error while triggering instrumentation handler.
13
14
  Type: ${t}
14
- Name: ${wl(r)}
15
- Error:`,o)}}var eR=null;function Kk(t){let e="error";uc(e,t),lc(e,zse)}function zse(){eR=J.onerror,J.onerror=function(t,e,n,r,o){return pc("error",{column:r,error:o,line:n,msg:t,url:e}),eR?eR.apply(this,arguments):!1},J.onerror.__SENTRY_INSTRUMENTED__=!0}var tR=null;function Qk(t){let e="unhandledrejection";uc(e,t),lc(e,Kse)}function Kse(){tR=J.onunhandledrejection,J.onunhandledrejection=function(t){return pc("unhandledrejection",t),tR?tR.apply(this,arguments):!0},J.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Xk=Object.prototype.toString;function Yr(t){switch(Xk.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Wr(t,Error)}}function gf(t,e){return Xk.call(t)===`[object ${e}]`}function nR(t){return gf(t,"ErrorEvent")}function ls(t){return gf(t,"String")}function dc(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function kl(t){return t===null||dc(t)||typeof t!="object"&&typeof t!="function"}function bo(t){return gf(t,"Object")}function rR(t){return typeof Event<"u"&&Wr(t,Event)}function oR(t){return typeof Element<"u"&&Wr(t,Element)}function sR(t){return gf(t,"RegExp")}function xt(t){return!!(t?.then&&typeof t.then=="function")}function iR(t){return bo(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Wr(t,e){try{return t instanceof e}catch{return!1}}function Gl(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue||t.__v_isVNode))}var Qse=J,Xse=80;function Jk(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,o=[],s=0,i=0,a=" > ",c=a.length,l,p=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||Xse;for(;n&&s++<r&&(l=Jse(n,p),!(l==="html"||s>1&&i+o.length*c+l.length>=d));)o.push(l),i+=l.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function Jse(t,e){let n=t,r=[];if(!n?.tagName)return"";if(Qse.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=e?.length?e.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&ls(s)){let i=s.split(/\s+/);for(let a of i)r.push(`.${a}`)}}for(let s of["aria-label","type","name","title","alt"]){let i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function aR(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&tG(o,r);try{t[e]=o}catch{C&&g.log(`Failed to replace method "${e}" in object`,t)}}function nt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{C&&g.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function tG(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,nt(t,"__sentry_original__",e)}catch{}}function cR(t){return t.__sentry_original__}function Af(t){if(Yr(t))return{message:t.message,name:t.name,stack:t.stack,...eG(t)};if(rR(t)){let e={type:t.type,target:Zk(t.target),currentTarget:Zk(t.currentTarget),...eG(t)};return typeof CustomEvent<"u"&&Wr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Zk(t){try{return oR(t)?Jk(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function eG(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function uR(t){let e=Object.keys(Af(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}var _c;function xi(t){if(_c!==void 0)return _c?_c(t):t();let e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=J;return e in n&&typeof n[e]=="function"?(_c=n[e],_c(t)):(_c=null,t())}function Rt(){return xi(()=>Math.random())}function Xn(){return xi(()=>Date.now())}function ps(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function lR(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let o=Math.max(e-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function pR(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];try{Gl(o)?n.push(Ef(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Co(t,e,n=!1){return ls(t)?sR(e)?e.test(t):ls(e)?n?t===e:t.includes(e):!1:!1}function ds(t,e=[],n=!1){return e.some(r=>Co(t,r,n))}function Zse(){let t=J;return t.crypto||t.msCrypto}var dR;function eie(){return Rt()*16}function dt(t=Zse()){try{if(t?.randomUUID)return xi(()=>t.randomUUID()).replace(/-/g,"")}catch{}return dR||(dR="10000000100040008000"+1e11),dR.replace(/[018]/g,e=>(e^(eie()&15)>>e/4).toString(16))}function nG(t){return t.exception?.values?.[0]}function _s(t){let{message:e,event_id:n}=t;if(e)return e;let r=nG(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function fR(t,e,n){let r=t.exception=t.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function fc(t,e){let n=nG(t);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...e},e&&"data"in e){let s={...o?.data,...e.data};n.mechanism.data=s}}var tie=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function _R(t){return parseInt(t||"",10)}function mR(t){let e=t.match(tie)||[],n=_R(e[1]),r=_R(e[2]),o=_R(e[3]);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:e[4]}}function Rf(t){if(rG(t))return!0;try{nt(t,"__sentry_captured__",!0)}catch{}return!1}function rG(t){try{return t.__sentry_captured__}catch{}}var sG=1e3;function Po(){return Xn()/sG}function nie(){let{performance:t}=J;if(!t?.now||!t.timeOrigin)return Po;let e=t.timeOrigin;return()=>(e+xi(()=>t.now()))/sG}var oG;function fs(){return(oG??(oG=nie()))()}function iG(t){let e=fs(),n={sid:dt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>rie(n)};return t&&Mo(n,t),n}function Mo(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||fs(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:dt()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function aG(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Mo(t,n)}function rie(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function ms(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r={...t};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=ms(r[o],e[o],n-1));return r}function Wt(){return dt()}function zt(){return dt().substring(16)}var TR="_sentrySpan";function vi(t,e){e?nt(t,TR,e):delete t[TR]}function Li(t){return t[TR]}var oie=100,Sn=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Wt(),sampleRand:Rt()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,vi(e,Li(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Mo(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():bo(n)?e:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:l,fingerprint:p=[],propagationContext:d,conversationId:_}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),l&&(this._level=l),p.length&&(this._fingerprint=p),d&&(this._propagationContext=d),_&&(this._conversationId=_),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,vi(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Wt(),sampleRand:Rt()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:oie;if(r<=0)return this;let o={timestamp:Po(),...e,message:e.message?ps(e.message,2048):e.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Li(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ms(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||dt();if(!this._client)return C&&g.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureMessage(e,n,r){let o=r?.event_id||dt();if(!this._client)return C&&g.warn("No client configured on scope - will not capture message!"),o;let s=r?.syntheticException??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:o},this),o}captureEvent(e,n){let r=e.event_id||n?.event_id||dt();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(C&&g.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function mc(){return Ar("defaultCurrentScope",()=>new Sn)}function Jn(){return Ar("defaultIsolationScope",()=>new Sn)}var cG=t=>t instanceof Promise&&!t[uG],uG=Symbol("chained PromiseLike"),yf=(t,e,n)=>{let r=t.then(o=>(e(o),o),o=>{throw n(o),o});return cG(r)&&cG(t)?r:sie(t,r)},sie=(t,e)=>{let n=!1;for(let r in t){if(r in e)continue;n=!0;let o=t[r];typeof o=="function"?Object.defineProperty(e,r,{value:(...s)=>o.apply(t,s),enumerable:!0,configurable:!0,writable:!0}):e[r]=o}return n&&Object.assign(e,{[uG]:!0}),e};var hR=class{constructor(e,n){let r;e?r=e:r=new Sn;let o;n?o=n:o=new Sn,this._stack=[{scope:r}],this._isolationScope=o}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(o){throw this._popScope(),o}return xt(r)?yf(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Tc(){let t=sn(),e=us(t);return e.stack=e.stack||new hR(mc(),Jn())}function iie(t){return Tc().withScope(t)}function aie(t,e){let n=Tc();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function lG(t){return Tc().withScope(()=>t(Tc().getIsolationScope()))}function pG(){return{withIsolationScope:lG,withScope:iie,withSetScope:aie,withSetIsolationScope:(t,e)=>lG(e),getCurrentScope:()=>Tc().getScope(),getIsolationScope:()=>Tc().getIsolationScope()}}function ER(t){let e=sn(),n=us(e);n.acs=t}function Rr(t){let e=us(t);return e.acs?e.acs:pG()}var dG;function _G(){return dG?.()}function SR(){return dG!==void 0}function Te(){let t=sn();return Rr(t).getCurrentScope()}function ue(){let t=sn();return Rr(t).getIsolationScope()}function If(){return Ar("globalScope",()=>new Sn)}function wn(...t){let e=sn(),n=Rr(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function Bl(...t){let e=sn(),n=Rr(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function H(){return Te().getClient()}function Di(t){let e=_G();if(e)return{trace_id:e.traceId,span_id:e.spanId};let n=t.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:s}=n,i={trace_id:r,span_id:s||zt()};return o&&(i.parent_span_id=o),i}var Ue="sentry.source",yr="sentry.sample_rate",gR="sentry.previous_trace_sample_rate",ee="sentry.op",W="sentry.origin";var AR="sentry.measurement_unit",RR="sentry.measurement_value",Zn="sentry.custom_span_name",hc="sentry.profile_id",Ec="sentry.exclusive_time",yR="cache.hit",IR="cache.key",NR="cache.item_size",OR="http.request.method",Ts="url.full";var bR="gen_ai.conversation.id";function xo(t){if(t<400&&t>=100)return{code:1};if(t>=400&&t<500)switch(t){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}var fG="_sentryScope",mG="_sentryIsolationScope";function cie(t){try{let e=J.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function uie(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}function jl(t,e,n){t&&(nt(t,mG,cie(n)),nt(t,fG,e))}function Ir(t){let e=t;return{scope:e[fG],isolationScope:uie(e[mG])}}var zr="sentry-";var hG=8192;function vo(t){let e=wi(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,s])=>{if(o.startsWith(zr)){let i=o.slice(zr.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Ui(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${zr}${r}`]=o),n),{});return Nf(e)}function wi(t){if(!(!t||!ls(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=TG(n);return Object.entries(r).forEach(([o,s])=>{e[o]=s}),e},{}):TG(t)}function TG(t){return t.split(",").map(e=>{let n=e.indexOf("=");if(n===-1)return[];let r=e.slice(0,n),o=e.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function Nf(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],o)=>{let s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${e},${s}`;return i.length>hG?(C&&g.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):i},"")}var lie=/^o(\d+)\./,pie=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function die(t){return t==="http"||t==="https"}function kn(t,e=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function _ie(t){let e=pie.exec(t);if(!e){Qe(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,o="",s="",i="",a=""]=e.slice(1),c="",l=a,p=l.split("/");if(p.length>1&&(c=p.slice(0,-1).join("/"),l=p.pop()),l){let d=l.match(/^\d+/);d&&(l=d[0])}return EG({host:s,pass:o,path:c,projectId:l,port:i,protocol:n,publicKey:r})}function EG(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function fie(t){if(!C)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(g.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?die(r)?e&&isNaN(parseInt(e,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function mie(t){return t.match(lie)?.[1]}function Of(t){let e=t.getOptions(),{host:n}=t.getDsn()||{},r;return e.orgId?r=String(e.orgId):n&&(r=mie(n)),r}function SG(t){let e=typeof t=="string"?_ie(t):EG(t);if(!(!e||!fie(e)))return e}function Gn(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var bf=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function gG(t){if(!t)return;let e=t.match(bf);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function Hl(t,e){let n=gG(t),r=vo(e);if(!n?.traceId)return{traceId:Wt(),sampleRand:Rt()};let o=Tie(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function hs(t=Wt(),e=zt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function Es(t=Wt(),e=zt(),n){return`00-${t}-${e}-${n?"01":"00"}`}function Tie(t,e){let n=Gn(e?.sample_rand);if(n!==void 0)return n;let r=Gn(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?Rt()*r:r+Rt()*(1-r):Rt()}function CR(t,e){let n=Of(t);return e&&n&&e!==n?(g.log(`Won't continue trace because org IDs don't match (incoming baggage: ${e}, SDK options: ${n})`),!1):(t.getOptions().strictTraceContinuation||!1)&&(e&&!n||!e&&n)?(g.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${e}, Sentry client: ${n})`),!1):!0}var Pf=0,Mf=1,AG=!1;function yG(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=Y(t);return{parent_span_id:s,span_id:e,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function Ss(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:Y(t).parent_span_id,s=Ir(t).scope,i=r?s?.getPropagationContext().propagationSpanId||zt():e;return{parent_span_id:o,span_id:i,trace_id:n}}function xf(t){let{traceId:e,spanId:n}=t.spanContext(),r=Nr(t);return hs(e,n,r)}function IG(t){let{traceId:e,spanId:n}=t.spanContext(),r=Nr(t);return Es(e,n,r)}function ki(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:e,trace_id:n,sampled:r===Mf,attributes:s,...o}))}function gn(t){return typeof t=="number"?RG(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?RG(t.getTime()):fs()}function RG(t){return t>9999999999?t/1e3:t}function Y(t){if(Sie(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(Eie(t)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=t,l="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:n,data:r,description:s,parent_span_id:l,start_timestamp:gn(o),timestamp:gn(i)||void 0,status:Gi(a),op:r[ee],origin:r[W],links:ki(c)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Eie(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function Sie(t){return typeof t.getSpanJSON=="function"}function Nr(t){let{traceFlags:e}=t.spanContext();return e===Mf}function Gi(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"internal_error"}var Vl="_sentryChildSpans",PR="_sentryRootSpan";function Sc(t,e){let n=t[PR]||t;nt(e,PR,n),t[Vl]?t[Vl].add(e):nt(t,Vl,new Set([e]))}function vf(t){let e=new Set;function n(r){if(!e.has(r)&&Nr(r)){e.add(r);let o=r[Vl]?Array.from(r[Vl]):[];for(let s of o)n(s)}}return n(t),Array.from(e)}function je(t){return t[PR]||t}function er(){let t=sn(),e=Rr(t);return e.getActiveSpan?e.getActiveSpan():Li(Te())}function Fl(){AG||(Qe(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),AG=!0)}var NG=!1;function OG(){if(NG)return;function t(){let e=er(),n=e&&je(e);if(n){let r="internal_error";C&&g.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}t.tag="sentry_tracingErrorCallback",NG=!0,Kk(t),Qk(t)}function Xe(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||H()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function bG(t){g.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function ql(t,e){if(!e?.length||!t.description)return!1;for(let n of e){if(gie(n)){if(Co(t.description,n))return C&&bG(t),!0;continue}if(!n.name&&!n.op)continue;let r=n.name?Co(t.description,n.name):!0,o=n.op?t.op&&Co(t.op,n.op):!0;if(r&&o)return C&&bG(t),!0}return!1}function CG(t,e){let n=e.parent_span_id,r=e.span_id;if(n)for(let o of t)o.parent_span_id===r&&(o.parent_span_id=n)}function gie(t){return typeof t=="string"||t instanceof RegExp}var gc="production";var PG="_frozenDsc";function Lf(t,e){nt(t,PG,e)}function MR(t,e){let n=e.getOptions(),{publicKey:r}=e.getDsn()||{},o={environment:n.environment||gc,release:n.release,public_key:r,trace_id:t,org_id:Of(e)};return e.emit("createDsc",o),o}function Kr(t,e){let n=e.getPropagationContext();return n.dsc||MR(n.traceId,t)}function Je(t){let e=H();if(!e)return{};let n=je(t),r=Y(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[yr]??o[gR];function a(m){return(typeof i=="number"||typeof i=="string")&&(m.sample_rate=`${i}`),m}let c=n[PG];if(c)return a(c);let l=s?.get("sentry.dsc"),p=l&&vo(l);if(p)return a(p);let d=MR(t.spanContext().traceId,e),_=o[Ue],f=r.description;return _!=="url"&&f&&(d.transaction=f),Xe()&&(d.sampled=String(Nr(n)),d.sample_rand=s?.get("sentry.sample_rand")??Ir(n).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,n),d}var gs=class{constructor(e={}){this._traceId=e.traceId||Wt(),this._spanId=e.spanId||zt()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Pf}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}};function Or(t,e=100,n=1/0){try{return xR("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function vR(t,e=3,n=100*1024){let r=Or(t,e);return Iie(r)>n?vR(t,e-1,n):r}function xR(t,e,n=1/0,r=1/0,o=Nie()){let[s,i]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let a=Aie(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(e))return"[Circular ~]";let l=e;if(l&&typeof l.toJSON=="function")try{let f=l.toJSON();return xR("",f,c-1,r,o)}catch{}let p=Array.isArray(e)?[]:{},d=0,_=Af(e);for(let f in _){if(!Object.prototype.hasOwnProperty.call(_,f))continue;if(d>=r){p[f]="[MaxProperties ~]";break}let m=_[f];p[f]=xR(f,m,c-1,r,o),d++}return i(e),p}function Aie(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Gl(e))return Ef(e);if(iR(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${wl(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=Rie(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Rie(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function yie(t){return~-encodeURI(t).split(/%..|./).length}function Iie(t){return yie(JSON.stringify(t))}function Nie(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function an(t,e=[]){return[t,e]}function DR(t,e){let[n,r]=t;return[n,[...r,e]]}function $l(t,e){let n=t[1];for(let r of n){let o=r[0].type;if(e(r,o))return!0}return!1}function UR(t,e){return $l(t,(n,r)=>e.includes(r))}function LR(t){let e=us(J);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function Yl(t){let[e,n]=t,r=JSON.stringify(e);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[LR(r),s]:r.push(typeof s=="string"?LR(s):s)}for(let s of n){let[i,a]=s;if(o(`
15
+ Name: ${ql(r)}
16
+ Error:`,o)}}var IR=null;function vG(t){let e="error";Tc(e,t),Ec(e,sae)}function sae(){IR=J.onerror,J.onerror=function(t,e,n,r,o){return Sc("error",{column:r,error:o,line:n,msg:t,url:e}),IR?IR.apply(this,arguments):!1},J.onerror.__SENTRY_INSTRUMENTED__=!0}var OR=null;function LG(t){let e="unhandledrejection";Tc(e,t),Ec(e,iae)}function iae(){OR=J.onunhandledrejection,J.onunhandledrejection=function(t){return Sc("unhandledrejection",t),OR?OR.apply(this,arguments):!0},J.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var DG=Object.prototype.toString;function Kr(t){switch(DG.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qr(t,Error)}}function Df(t,e){return DG.call(t)===`[object ${e}]`}function NR(t){return Df(t,"ErrorEvent")}function ms(t){return Df(t,"String")}function gc(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function $l(t){return t===null||gc(t)||typeof t!="object"&&typeof t!="function"}function Mo(t){return Df(t,"Object")}function bR(t){return typeof Event<"u"&&Qr(t,Event)}function CR(t){return typeof Element<"u"&&Qr(t,Element)}function PR(t){return Df(t,"RegExp")}function Lt(t){return!!(t?.then&&typeof t.then=="function")}function MR(t){return Mo(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Qr(t,e){try{return t instanceof e}catch{return!1}}function Yl(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue||t.__v_isVNode))}var aae=J,cae=80;function UG(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,o=[],s=0,i=0,a=" > ",c=a.length,l,p=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||cae;for(;n&&s++<r&&(l=uae(n,p),!(l==="html"||s>1&&i+o.length*c+l.length>=d));)o.push(l),i+=l.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function uae(t,e){let n=t,r=[];if(!n?.tagName)return"";if(aae.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=e?.length?e.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&ms(s)){let i=s.split(/\s+/);for(let a of i)r.push(`.${a}`)}}for(let s of["aria-label","type","name","title","alt"]){let i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function xR(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&GG(o,r);try{t[e]=o}catch{C&&g.log(`Failed to replace method "${e}" in object`,t)}}function nt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{C&&g.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function GG(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,nt(t,"__sentry_original__",e)}catch{}}function vR(t){return t.__sentry_original__}function Uf(t){if(Kr(t))return{message:t.message,name:t.name,stack:t.stack,...kG(t)};if(bR(t)){let e={type:t.type,target:wG(t.target),currentTarget:wG(t.currentTarget),...kG(t)};return typeof CustomEvent<"u"&&Qr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function wG(t){try{return CR(t)?UG(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function kG(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function LR(t){let e=Object.keys(Uf(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}var Ac;function Gi(t){if(Ac!==void 0)return Ac?Ac(t):t();let e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=J;return e in n&&typeof n[e]=="function"?(Ac=n[e],Ac(t)):(Ac=null,t())}function yt(){return Gi(()=>Math.random())}function Zn(){return Gi(()=>Date.now())}function hs(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function DR(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let o=Math.max(e-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function UR(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];try{Yl(o)?n.push(vf(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function xo(t,e,n=!1){return ms(t)?PR(e)?e.test(t):ms(e)?n?t===e:t.includes(e):!1:!1}function Ts(t,e=[],n=!1){return e.some(r=>xo(t,r,n))}function lae(){let t=J;return t.crypto||t.msCrypto}var wR;function pae(){return yt()*16}function _t(t=lae()){try{if(t?.randomUUID)return Gi(()=>t.randomUUID()).replace(/-/g,"")}catch{}return wR||(wR="10000000100040008000"+1e11),wR.replace(/[018]/g,e=>(e^(pae()&15)>>e/4).toString(16))}function BG(t){return t.exception?.values?.[0]}function Es(t){let{message:e,event_id:n}=t;if(e)return e;let r=BG(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function GR(t,e,n){let r=t.exception=t.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function Rc(t,e){let n=BG(t);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...e},e&&"data"in e){let s={...o?.data,...e.data};n.mechanism.data=s}}var dae=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function kR(t){return parseInt(t||"",10)}function BR(t){let e=t.match(dae)||[],n=kR(e[1]),r=kR(e[2]),o=kR(e[3]);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:e[4]}}function wf(t){if(jG(t))return!0;try{nt(t,"__sentry_captured__",!0)}catch{}return!1}function jG(t){try{return t.__sentry_captured__}catch{}}var FG=1e3;function vo(){return Zn()/FG}function _ae(){let{performance:t}=J;if(!t?.now||!t.timeOrigin)return vo;let e=t.timeOrigin;return()=>(e+Gi(()=>t.now()))/FG}var HG;function Ss(){return(HG??(HG=_ae()))()}function VG(t){let e=Ss(),n={sid:_t(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>fae(n)};return t&&Lo(n,t),n}function Lo(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Ss(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:_t()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function qG(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Lo(t,n)}function fae(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function gs(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r={...t};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=gs(r[o],e[o],n-1));return r}function zt(){return _t()}function Kt(){return _t().substring(16)}var jR="_sentrySpan";function Bi(t,e){e?nt(t,jR,e):delete t[jR]}function ji(t){return t[jR]}var mae=100,An=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:zt(),sampleRand:yt()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Bi(e,ji(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Lo(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():Mo(n)?e:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:l,fingerprint:p=[],propagationContext:d,conversationId:_}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),l&&(this._level=l),p.length&&(this._fingerprint=p),d&&(this._propagationContext=d),_&&(this._conversationId=_),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Bi(this,void 0),this._attachments=[],this.setPropagationContext({traceId:zt(),sampleRand:yt()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:mae;if(r<=0)return this;let o={timestamp:vo(),...e,message:e.message?hs(e.message,2048):e.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ji(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=gs(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||_t();if(!this._client)return C&&g.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureMessage(e,n,r){let o=r?.event_id||_t();if(!this._client)return C&&g.warn("No client configured on scope - will not capture message!"),o;let s=r?.syntheticException??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:o},this),o}captureEvent(e,n){let r=e.event_id||n?.event_id||_t();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(C&&g.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function yc(){return Ir("defaultCurrentScope",()=>new An)}function er(){return Ir("defaultIsolationScope",()=>new An)}var $G=t=>t instanceof Promise&&!t[YG],YG=Symbol("chained PromiseLike"),kf=(t,e,n)=>{let r=t.then(o=>(e(o),o),o=>{throw n(o),o});return $G(r)&&$G(t)?r:hae(t,r)},hae=(t,e)=>{let n=!1;for(let r in t){if(r in e)continue;n=!0;let o=t[r];typeof o=="function"?Object.defineProperty(e,r,{value:(...s)=>o.apply(t,s),enumerable:!0,configurable:!0,writable:!0}):e[r]=o}return n&&Object.assign(e,{[YG]:!0}),e};var HR=class{constructor(e,n){let r;e?r=e:r=new An;let o;n?o=n:o=new An,this._stack=[{scope:r}],this._isolationScope=o}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(o){throw this._popScope(),o}return Lt(r)?kf(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Ic(){let t=cn(),e=fs(t);return e.stack=e.stack||new HR(yc(),er())}function Tae(t){return Ic().withScope(t)}function Eae(t,e){let n=Ic();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function WG(t){return Ic().withScope(()=>t(Ic().getIsolationScope()))}function zG(){return{withIsolationScope:WG,withScope:Tae,withSetScope:Eae,withSetIsolationScope:(t,e)=>WG(e),getCurrentScope:()=>Ic().getScope(),getIsolationScope:()=>Ic().getIsolationScope()}}function FR(t){let e=cn(),n=fs(e);n.acs=t}function Or(t){let e=fs(t);return e.acs?e.acs:zG()}var KG;function QG(){return KG?.()}function VR(){return KG!==void 0}function he(){let t=cn();return Or(t).getCurrentScope()}function ue(){let t=cn();return Or(t).getIsolationScope()}function Gf(){return Ir("globalScope",()=>new An)}function Gn(...t){let e=cn(),n=Or(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function Wl(...t){let e=cn(),n=Or(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function H(){return he().getClient()}function Hi(t){let e=QG();if(e)return{trace_id:e.traceId,span_id:e.spanId};let n=t.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:s}=n,i={trace_id:r,span_id:s||Kt()};return o&&(i.parent_span_id=o),i}var Ue="sentry.source",Nr="sentry.sample_rate",qR="sentry.previous_trace_sample_rate",ee="sentry.op",W="sentry.origin";var $R="sentry.measurement_unit",YR="sentry.measurement_value",tr="sentry.custom_span_name",Oc="sentry.profile_id",Nc="sentry.exclusive_time",WR="cache.hit",zR="cache.key",KR="cache.item_size",QR="http.request.method",As="url.full";var XR="gen_ai.conversation.id";function Do(t){if(t<400&&t>=100)return{code:1};if(t>=400&&t<500)switch(t){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}var XG="_sentryScope",JG="_sentryIsolationScope";function Sae(t){try{let e=J.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function gae(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}function zl(t,e,n){t&&(nt(t,JG,Sae(n)),nt(t,XG,e))}function br(t){let e=t;return{scope:e[XG],isolationScope:gae(e[JG])}}var Xr="sentry-";var eB=8192;function Uo(t){let e=Vi(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,s])=>{if(o.startsWith(Xr)){let i=o.slice(Xr.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Fi(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${Xr}${r}`]=o),n),{});return Bf(e)}function Vi(t){if(!(!t||!ms(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=ZG(n);return Object.entries(r).forEach(([o,s])=>{e[o]=s}),e},{}):ZG(t)}function ZG(t){return t.split(",").map(e=>{let n=e.indexOf("=");if(n===-1)return[];let r=e.slice(0,n),o=e.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function Bf(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],o)=>{let s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${e},${s}`;return i.length>eB?(C&&g.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):i},"")}var Aae=/^o(\d+)\./,Rae=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function yae(t){return t==="http"||t==="https"}function Bn(t,e=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function Iae(t){let e=Rae.exec(t);if(!e){Qe(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,o="",s="",i="",a=""]=e.slice(1),c="",l=a,p=l.split("/");if(p.length>1&&(c=p.slice(0,-1).join("/"),l=p.pop()),l){let d=l.match(/^\d+/);d&&(l=d[0])}return tB({host:s,pass:o,path:c,projectId:l,port:i,protocol:n,publicKey:r})}function tB(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Oae(t){if(!C)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(g.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?yae(r)?e&&isNaN(parseInt(e,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Nae(t){return t.match(Aae)?.[1]}function jf(t){let e=t.getOptions(),{host:n}=t.getDsn()||{},r;return e.orgId?r=String(e.orgId):n&&(r=Nae(n)),r}function nB(t){let e=typeof t=="string"?Iae(t):tB(t);if(!(!e||!Oae(e)))return e}function jn(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var Hf=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function rB(t){if(!t)return;let e=t.match(Hf);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function Kl(t,e){let n=rB(t),r=Uo(e);if(!n?.traceId)return{traceId:zt(),sampleRand:yt()};let o=bae(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function Rs(t=zt(),e=Kt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function ys(t=zt(),e=Kt(),n){return`00-${t}-${e}-${n?"01":"00"}`}function bae(t,e){let n=jn(e?.sample_rand);if(n!==void 0)return n;let r=jn(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?yt()*r:r+yt()*(1-r):yt()}function JR(t,e){let n=jf(t);return e&&n&&e!==n?(g.log(`Won't continue trace because org IDs don't match (incoming baggage: ${e}, SDK options: ${n})`),!1):(t.getOptions().strictTraceContinuation||!1)&&(e&&!n||!e&&n)?(g.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${e}, Sentry client: ${n})`),!1):!0}var Vf=0,qf=1,oB=!1;function iB(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=Y(t);return{parent_span_id:s,span_id:e,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function Is(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:Y(t).parent_span_id,s=br(t).scope,i=r?s?.getPropagationContext().propagationSpanId||Kt():e;return{parent_span_id:o,span_id:i,trace_id:n}}function $f(t){let{traceId:e,spanId:n}=t.spanContext(),r=Cr(t);return Rs(e,n,r)}function aB(t){let{traceId:e,spanId:n}=t.spanContext(),r=Cr(t);return ys(e,n,r)}function qi(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:e,trace_id:n,sampled:r===qf,attributes:s,...o}))}function Rn(t){return typeof t=="number"?sB(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?sB(t.getTime()):Ss()}function sB(t){return t>9999999999?t/1e3:t}function Y(t){if(Mae(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(Pae(t)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=t,l="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:n,data:r,description:s,parent_span_id:l,start_timestamp:Rn(o),timestamp:Rn(i)||void 0,status:$i(a),op:r[ee],origin:r[W],links:qi(c)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Pae(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function Mae(t){return typeof t.getSpanJSON=="function"}function Cr(t){let{traceFlags:e}=t.spanContext();return e===qf}function $i(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"internal_error"}var Ql="_sentryChildSpans",ZR="_sentryRootSpan";function bc(t,e){let n=t[ZR]||t;nt(e,ZR,n),t[Ql]?t[Ql].add(e):nt(t,Ql,new Set([e]))}function Yf(t){let e=new Set;function n(r){if(!e.has(r)&&Cr(r)){e.add(r);let o=r[Ql]?Array.from(r[Ql]):[];for(let s of o)n(s)}}return n(t),Array.from(e)}function je(t){return t[ZR]||t}function nr(){let t=cn(),e=Or(t);return e.getActiveSpan?e.getActiveSpan():ji(he())}function Xl(){oB||(Qe(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),oB=!0)}var cB=!1;function uB(){if(cB)return;function t(){let e=nr(),n=e&&je(e);if(n){let r="internal_error";C&&g.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}t.tag="sentry_tracingErrorCallback",cB=!0,vG(t),LG(t)}function Xe(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||H()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function lB(t){g.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function Jl(t,e){if(!e?.length||!t.description)return!1;for(let n of e){if(xae(n)){if(xo(t.description,n))return C&&lB(t),!0;continue}if(!n.name&&!n.op)continue;let r=n.name?xo(t.description,n.name):!0,o=n.op?t.op&&xo(t.op,n.op):!0;if(r&&o)return C&&lB(t),!0}return!1}function pB(t,e){let n=e.parent_span_id,r=e.span_id;if(n)for(let o of t)o.parent_span_id===r&&(o.parent_span_id=n)}function xae(t){return typeof t=="string"||t instanceof RegExp}var Cc="production";var dB="_frozenDsc";function Wf(t,e){nt(t,dB,e)}function ey(t,e){let n=e.getOptions(),{publicKey:r}=e.getDsn()||{},o={environment:n.environment||Cc,release:n.release,public_key:r,trace_id:t,org_id:jf(e)};return e.emit("createDsc",o),o}function Jr(t,e){let n=e.getPropagationContext();return n.dsc||ey(n.traceId,t)}function Je(t){let e=H();if(!e)return{};let n=je(t),r=Y(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[Nr]??o[qR];function a(m){return(typeof i=="number"||typeof i=="string")&&(m.sample_rate=`${i}`),m}let c=n[dB];if(c)return a(c);let l=s?.get("sentry.dsc"),p=l&&Uo(l);if(p)return a(p);let d=ey(t.spanContext().traceId,e),_=o[Ue],f=r.description;return _!=="url"&&f&&(d.transaction=f),Xe()&&(d.sampled=String(Cr(n)),d.sample_rand=s?.get("sentry.sample_rand")??br(n).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,n),d}var Os=class{constructor(e={}){this._traceId=e.traceId||zt(),this._spanId=e.spanId||Kt()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Vf}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}};function Pr(t,e=100,n=1/0){try{return ty("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ny(t,e=3,n=100*1024){let r=Pr(t,e);return Uae(r)>n?ny(t,e-1,n):r}function ty(t,e,n=1/0,r=1/0,o=wae()){let[s,i]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let a=vae(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(e))return"[Circular ~]";let l=e;if(l&&typeof l.toJSON=="function")try{let f=l.toJSON();return ty("",f,c-1,r,o)}catch{}let p=Array.isArray(e)?[]:{},d=0,_=Uf(e);for(let f in _){if(!Object.prototype.hasOwnProperty.call(_,f))continue;if(d>=r){p[f]="[MaxProperties ~]";break}let m=_[f];p[f]=ty(f,m,c-1,r,o),d++}return i(e),p}function vae(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Yl(e))return vf(e);if(MR(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${ql(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=Lae(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Lae(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function Dae(t){return~-encodeURI(t).split(/%..|./).length}function Uae(t){return Dae(JSON.stringify(t))}function wae(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function un(t,e=[]){return[t,e]}function oy(t,e){let[n,r]=t;return[n,[...r,e]]}function Zl(t,e){let n=t[1];for(let r of n){let o=r[0].type;if(e(r,o))return!0}return!1}function sy(t,e){return Zl(t,(n,r)=>e.includes(r))}function ry(t){let e=fs(J);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function ep(t){let[e,n]=t,r=JSON.stringify(e);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[ry(r),s]:r.push(typeof s=="string"?ry(s):s)}for(let s of n){let[i,a]=s;if(o(`
16
17
  ${JSON.stringify(i)}
17
- `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(Or(a))}o(c)}}return typeof r=="string"?r:Oie(r)}function Oie(t){let e=t.reduce((o,s)=>o+s.length,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.length;return n}function wR(t){return[{type:"span"},t]}function kR(t){let e=typeof t.data=="string"?LR(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var MG={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function bie(t){return t in MG}function Df(t){return bie(t)?MG[t]:t}function Uf(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function GR(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:kn(r)},...o&&{trace:o}}}function Cie(t,e){if(!e)return t;let n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...t.sdk?.integrations||[],...e.integrations||[]],packages:[...t.sdk?.packages||[],...e.packages||[]],settings:t.sdk?.settings||e.settings?{...t.sdk?.settings,...e.settings}:void 0},t}function xG(t,e,n,r){let o=Uf(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:kn(e)}},i="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return an(s,[i])}function vG(t,e,n,r){let o=Uf(n),s=t.type&&t.type!=="replay_event"?t.type:"event";Cie(t,n?.sdk);let i=GR(t,o,r,e);return delete t.sdkProcessingMetadata,an(i,[[{type:s},t]])}function LG(t,e){function n(f){return!!f.trace_id&&!!f.public_key}let r=Je(t[0]),o=e?.getDsn(),s=e?.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:kn(o)}},{beforeSendSpan:a,ignoreSpans:c}=e?.getOptions()||{},l=c?.length?t.filter(f=>!ql(Y(f),c)):t,p=t.length-l.length;p&&e?.recordDroppedEvent("before_send","span",p);let d=a?f=>{let m=Y(f),T=a(m);return T||(Fl(),m)}:Y,_=[];for(let f of l){let m=d(f);m&&_.push(wR(m))}return an(i,_)}function Wl(t){if(!C)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=Y(t),{spanId:o}=t.spanContext(),s=Nr(t),i=je(t),a=i===t,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,l=[`op: ${n}`,`name: ${e}`,`ID: ${o}`];if(r&&l.push(`parent ID: ${r}`),!a){let{op:p,description:d}=Y(i);l.push(`root ID: ${i.spanContext().spanId}`),p&&l.push(`root op: ${p}`),d&&l.push(`root description: ${d}`)}g.log(`${c}
18
+ `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(Pr(a))}o(c)}}return typeof r=="string"?r:kae(r)}function kae(t){let e=t.reduce((o,s)=>o+s.length,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.length;return n}function iy(t){return[{type:"span"},t]}function ay(t){let e=typeof t.data=="string"?ry(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var _B={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Gae(t){return t in _B}function zf(t){return Gae(t)?_B[t]:t}function Kf(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function cy(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:Bn(r)},...o&&{trace:o}}}function Bae(t,e){if(!e)return t;let n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...t.sdk?.integrations||[],...e.integrations||[]],packages:[...t.sdk?.packages||[],...e.packages||[]],settings:t.sdk?.settings||e.settings?{...t.sdk?.settings,...e.settings}:void 0},t}function fB(t,e,n,r){let o=Kf(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:Bn(e)}},i="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return un(s,[i])}function mB(t,e,n,r){let o=Kf(n),s=t.type&&t.type!=="replay_event"?t.type:"event";Bae(t,n?.sdk);let i=cy(t,o,r,e);return delete t.sdkProcessingMetadata,un(i,[[{type:s},t]])}function hB(t,e){function n(f){return!!f.trace_id&&!!f.public_key}let r=Je(t[0]),o=e?.getDsn(),s=e?.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:Bn(o)}},{beforeSendSpan:a,ignoreSpans:c}=e?.getOptions()||{},l=c?.length?t.filter(f=>!Jl(Y(f),c)):t,p=t.length-l.length;p&&e?.recordDroppedEvent("before_send","span",p);let d=a?f=>{let m=Y(f),h=a(m);return h||(Xl(),m)}:Y,_=[];for(let f of l){let m=d(f);m&&_.push(iy(m))}return un(i,_)}function tp(t){if(!C)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=Y(t),{spanId:o}=t.spanContext(),s=Cr(t),i=je(t),a=i===t,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,l=[`op: ${n}`,`name: ${e}`,`ID: ${o}`];if(r&&l.push(`parent ID: ${r}`),!a){let{op:p,description:d}=Y(i);l.push(`root ID: ${i.spanContext().spanId}`),p&&l.push(`root op: ${p}`),d&&l.push(`root description: ${d}`)}g.log(`${c}
18
19
  ${l.join(`
19
- `)}`)}function zl(t){if(!C)return;let{description:e="< unknown name >",op:n="< unknown op >"}=Y(t),{spanId:r}=t.spanContext(),s=je(t)===t,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${e}" with ID ${r}`;g.log(i)}function Bi(t){if(!t||t.length===0)return;let e={};return t.forEach(n=>{let r=n.attributes||{},o=r[AR],s=r[RR];typeof o=="string"&&typeof s=="number"&&(e[n.name]={value:s,unit:o})}),e}var DG=1e3,Ac=class{constructor(e={}){this._traceId=e.traceId||Wt(),this._spanId=e.spanId||zt(),this._startTime=e.startTimestamp||fs(),this._links=e.links,this._attributes={},this.setAttributes({[W]:"manual",[ee]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?Mf:Pf}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=gn(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Ue,"custom"),this}end(e){this._endTime||(this._endTime=gn(e),zl(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ee],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Gi(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[W],profile_id:this._attributes[hc],exclusive_time:this._attributes[Ec],measurements:Bi(this._events),is_segment:this._isStandaloneSpan&&je(this)===this||void 0,segment_id:this._isStandaloneSpan?je(this).spanContext().spanId:void 0,links:ki(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){C&&g.log("[Tracing] Adding an event to span:",e);let o=UG(n)?n:r||fs(),s=UG(n)?{}:n||{},i={name:e,time:gn(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=H();if(e&&e.emit("spanEnd",this),!(this._isStandaloneSpan||this===je(this)))return;if(this._isStandaloneSpan){this._sampled?Mie(LG([this],e)):(C&&g.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}let r=this._convertSpanToTransaction();r&&(Ir(this).scope||Te()).captureEvent(r)}_convertSpanToTransaction(){if(!wG(Y(this)))return;this._name||(C&&g.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:n}=Ir(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let s=vf(this).filter(p=>p!==this&&!Pie(p)).map(p=>Y(p)).filter(wG),i=this._attributes[Ue];delete this._attributes[Zn],s.forEach(p=>{delete p.data[Zn]});let a={contexts:{trace:yG(this)},spans:s.length>DG?s.sort((p,d)=>p.start_timestamp-d.start_timestamp).slice(0,DG):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:Je(this)},request:r,...i&&{transaction_info:{source:i}}},c=Bi(this._events);return c&&Object.keys(c).length&&(C&&g.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}};function UG(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function wG(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function Pie(t){return t instanceof Ac&&t.isStandaloneSpan()}function Mie(t){let e=H();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function br(t,e,n=()=>{},r=()=>{}){let o;try{o=t()}catch(s){throw e(s),n(),s}return xie(o,e,n,r)}function xie(t,e,n,r){return xt(t)?yf(t,o=>{n(),r(o)},o=>{e(o),n()}):(n(),r(t),t)}function Kl(t,e,n){if(!Xe(t))return[!1];let r,o;typeof t.tracesSampler=="function"?(o=t.tracesSampler({...e,inheritOrSampleWith:a=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):a}),r=!0):e.parentSampled!==void 0?o=e.parentSampled:typeof t.tracesSampleRate<"u"&&(o=t.tracesSampleRate,r=!0);let s=Gn(o);if(s===void 0)return C&&g.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return C&&g.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];let i=n<s;return i||C&&g.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}var wf="__SENTRY_SUPPRESS_TRACING__";function Cr(t,e){let n=Ql();if(n.startSpan)return n.startSpan(t,e);let r=jR(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return wn(a,()=>GG(s)(()=>{let l=Te(),p=HR(l,s),_=t.onlyIfParent&&!p?new gs:BR({parentSpan:p,spanArguments:r,forceTransaction:o,scope:l});return vi(l,_),br(()=>e(_),()=>{let{status:f}=Y(_);_.isRecording()&&(!f||f==="ok")&&_.setStatus({code:2,message:"internal_error"})},()=>{_.end()})}))}function yt(t,e){let n=Ql();if(n.startSpanManual)return n.startSpanManual(t,e);let r=jR(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return wn(a,()=>GG(s)(()=>{let l=Te(),p=HR(l,s),_=t.onlyIfParent&&!p?new gs:BR({parentSpan:p,spanArguments:r,forceTransaction:o,scope:l});return vi(l,_),br(()=>e(_,()=>_.end()),()=>{let{status:f}=Y(_);_.isRecording()&&(!f||f==="ok")&&_.setStatus({code:2,message:"internal_error"})})}))}function kf(t){let e=Ql();if(e.startInactiveSpan)return e.startInactiveSpan(t);let n=jR(t),{forceTransaction:r,parentSpan:o}=t;return(t.scope?i=>wn(t.scope,i):o!==void 0?i=>Rc(o,i):i=>i())(()=>{let i=Te(),a=HR(i,o);return t.onlyIfParent&&!a?new gs:BR({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}function Rc(t,e){let n=Ql();return n.withActiveSpan?n.withActiveSpan(t,e):wn(r=>(vi(r,t||void 0),e(r)))}function yc(t){let e=Ql();return e.suppressTracing?e.suppressTracing(t):wn(n=>{n.setSDKProcessingMetadata({[wf]:!0});let r=t();return n.setSDKProcessingMetadata({[wf]:void 0}),r})}function BR({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!Xe()){let i=new gs;if(n||!t){let a={sampled:"false",sample_rate:"0",transaction:e.name,...Je(i)};Lf(i,a)}return i}let o=ue(),s;if(t&&!n)s=vie(t,r,e),Sc(t,s);else if(t){let i=Je(t),{traceId:a,spanId:c}=t.spanContext(),l=Nr(t);s=kG({traceId:a,parentSpanId:c,...e},r,l),Lf(s,i)}else{let{traceId:i,dsc:a,parentSpanId:c,sampled:l}={...o.getPropagationContext(),...r.getPropagationContext()};s=kG({traceId:i,parentSpanId:c,...e},r,l),a&&Lf(s,a)}return Wl(s),jl(s,r,o),s}function jR(t){let n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){let r={...n};return r.startTimestamp=gn(t.startTime),delete r.startTime,r}return n}function Ql(){let t=sn();return Rr(t)}function kG(t,e,n){let r=H(),o=r?.getOptions()||{},{name:s=""}=t,i={spanAttributes:{...t.attributes},spanName:s,parentSampled:n};r?.emit("beforeSampling",i,{decision:!1});let a=i.parentSampled??n,c=i.spanAttributes,l=e.getPropagationContext(),[p,d,_]=e.getScopeData().sdkProcessingMetadata[wf]?[!1]:Kl(o,{name:s,parentSampled:a,attributes:c,parentSampleRate:Gn(l.dsc?.sample_rate)},l.sampleRand),f=new Ac({...t,attributes:{[Ue]:"custom",[yr]:d!==void 0&&_?d:void 0,...c},sampled:p});return!p&&r&&(C&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",f),f}function vie(t,e,n){let{spanId:r,traceId:o}=t.spanContext(),s=e.getScopeData().sdkProcessingMetadata[wf]?!1:Nr(t),i=s?new Ac({...n,parentSpanId:r,traceId:o,sampled:s}):new gs({traceId:o});Sc(t,i);let a=H();return a&&(a.emit("spanStart",i),n.endTimestamp&&a.emit("spanEnd",i)),i}function HR(t,e){if(e)return e;if(e===null)return;let n=Li(t);if(!n)return;let r=H();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?je(n):n}function GG(t){return t!==void 0?e=>Rc(t,e):e=>e()}var VR=0,BG=1,jG=2;function Lo(t){return new Gf(e=>{e(t)})}function Ic(t){return new Gf((e,n)=>{n(t)})}var Gf=class t{constructor(e){this._state=VR,this._handlers=[],this._runExecutor(e)}then(e,n){return new t((r,o)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,e&&e()},i=>{s=!0,o=i,e&&e()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===VR)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===BG&&n[1](this._value),this._state===jG&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(s,i)=>{if(this._state===VR){if(xt(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(BG,s)},o=s=>{n(jG,s)};try{e(r,o)}catch(s){o(s)}}};function HG(t,e,n,r=0){try{let o=FR(e,n,t,r);return xt(o)?o:Lo(o)}catch(o){return Ic(o)}}function FR(t,e,n,r){let o=n[r];if(!t||!o)return t;let s=o({...t},e);return C&&s===null&&g.log(`Event processor "${o.id||"?"}" dropped event`),xt(s)?s.then(i=>FR(i,e,n,r+1)):FR(s,e,n,r+1)}var ji,VG,FG,As;function qG(t){let e=J._sentryDebugIds,n=J._debugIds;if(!e&&!n)return{};let r=e?Object.keys(e):[],o=n?Object.keys(n):[];if(As&&r.length===VG&&o.length===FG)return As;VG=r.length,FG=o.length,As={},ji||(ji={});let s=(i,a)=>{for(let c of i){let l=a[c],p=ji?.[c];if(p&&As&&l)As[p[0]]=l,ji&&(ji[c]=[p[0],l]);else if(l){let d=t(c);for(let _=d.length-1;_>=0;_--){let m=d[_]?.filename;if(m&&As&&ji){As[m]=l,ji[c]=[m,l];break}}}}};return e&&s(r,e),n&&s(o,n),As}function YG(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=e;Lie(t,e),r&&wie(t,r),kie(t,n),Die(t,o),Uie(t,s)}function $G(t,e){let{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:p,eventProcessors:d,attachments:_,propagationContext:f,transactionName:m,span:T}=e;Xl(t,"extra",n),Xl(t,"tags",r),Xl(t,"attributes",o),Xl(t,"user",s),Xl(t,"contexts",i),t.sdkProcessingMetadata=ms(t.sdkProcessingMetadata,c,2),a&&(t.level=a),m&&(t.transactionName=m),T&&(t.span=T),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),p.length&&(t.fingerprint=[...t.fingerprint,...p]),d.length&&(t.eventProcessors=[...t.eventProcessors,...d]),_.length&&(t.attachments=[...t.attachments,..._]),t.propagationContext={...t.propagationContext,...f}}function Xl(t,e,n){t[e]=ms(t[e],n,1)}function Bf(t,e){let n=If().getScopeData();return t&&$G(n,t.getScopeData()),e&&$G(n,e.getScopeData()),n}function Lie(t,e){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(o).length&&(t.user={...o,...t.user}),Object.keys(s).length&&(t.contexts={...s,...t.contexts}),i&&(t.level=i),a&&t.type!=="transaction"&&(t.transaction=a)}function Die(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Uie(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function wie(t,e){t.contexts={trace:Ss(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Je(e),...t.sdkProcessingMetadata};let n=je(e),r=Y(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function kie(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function WG(t,e,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||dt(),timestamp:e.timestamp||Po()},l=n.integrations||t.integrations.map(S=>S.name);Gie(c,t),Hie(c,l),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&Bie(c,t.stackParser);let p=Fie(r,n.captureContext);n.mechanism&&fc(c,n.mechanism);let d=o?o.getEventProcessors():[],_=Bf(s,p),f=[...n.attachments||[],..._.attachments];f.length&&(n.attachments=f),YG(c,_);let m=[...d,..._.eventProcessors];return(n.data&&n.data.__sentry__===!0?Lo(c):HG(m,c,n)).then(S=>(S&&jie(S),typeof i=="number"&&i>0?Vie(S,i,a):S))}function Gie(t,e){let{environment:n,release:r,dist:o,maxValueLength:s}=e;t.environment=t.environment||n||gc,!t.release&&r&&(t.release=r),!t.dist&&o&&(t.dist=o);let i=t.request;i?.url&&s&&(i.url=ps(i.url,s)),s&&t.exception?.values?.forEach(a=>{a.value&&(a.value=ps(a.value,s))})}function Bie(t,e){let n=qG(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function jie(t){let e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Hie(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function Vie(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:Or(o.data,e,n)}}))},...t.user&&{user:Or(t.user,e,n)},...t.contexts&&{contexts:Or(t.contexts,e,n)},...t.extra&&{extra:Or(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=Or(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:Or(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=Or(t.contexts.flags,3,n)),r}function Fie(t,e){if(!e)return t;let n=t?t.clone():new Sn;return n.update(e),n}function zG(t){if(t)return qie(t)?{captureContext:t}:Yie(t)?{captureContext:t}:t}function qie(t){return t instanceof Sn||typeof t=="function"}var $ie=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Yie(t){return Object.keys(t).some(e=>$ie.includes(e))}function te(t,e){return Te().captureException(t,zG(e))}function jf(t,e){return Te().captureEvent(t,e)}function Hf(t,e){ue().setTag(t,e)}async function Vf(t){let e=H();return e?e.flush(t):(C&&g.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Ff(t){let e=H();return e?e.close(t):(C&&g.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function qf(){let t=H();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function $f(t){let e=ue(),{user:n}=Bf(e,Te()),{userAgent:r}=J.navigator||{},o=iG({user:n,...r&&{userAgent:r},...t}),s=e.getSession();return s?.status==="ok"&&Mo(s,{status:"exited"}),Jl(),e.setSession(o),o}function Jl(){let t=ue(),n=Te().getSession()||t.getSession();n&&aG(n),Wie(),t.setSession()}function Wie(){let t=ue(),e=H(),n=t.getSession();n&&e&&e.captureSession(n)}var zie="7";function Kie(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Qie(t){return`${Kie(t)}${t.projectId}/envelope/`}function Xie(t,e){let n={sentry_version:zie};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function KG(t,e,n){return e||`${Qie(t)}?${Xie(t,n)}`}var qR=[];function Jie(t){let e={};return t.forEach(n=>{let{name:r}=n,o=e[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function $R(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){let o=n(e);r=Array.isArray(o)?o:[o]}else r=e;return Jie(r)}function QG(t,e){let n={};return e.forEach(r=>{r&&WR(t,r,n)}),n}function YR(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function WR(t,e,n){if(n[e.name]){C&&g.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!qR.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),qR.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,s)=>r(o,s,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),o=Object.assign((s,i)=>r(s,i,t),{id:e.name});t.addEventProcessor(o)}C&&g.log(`Integration installed: ${e.name}`)}function XG(t,e){return e?wn(e,()=>{let n=er(),r=n?Ss(n):Di(e);return[n?Je(n):Kr(t,e),r]}):[void 0,void 0]}function Zie(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function JG(t,e,n,r){let o={};return e?.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=kn(r)),an(o,[Zie(t)])}function Nc(t,e){let n=e??eae(t)??[];if(n.length===0)return;let r=t.getOptions(),o=JG(n,r._metadata,r.tunnel,t.getDsn());ZG().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function eae(t){return ZG().get(t)}function ZG(){return Ar("clientToLogBufferMap",()=>new WeakMap)}function tae(t){return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:t}]}function eB(t,e,n,r){let o={};return e?.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=kn(r)),an(o,[tae(t)])}function tB(t,e){let n=e??nae(t)??[];if(n.length===0)return;let r=t.getOptions(),o=eB(n,r._metadata,r.tunnel,t.getDsn());nB().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(o)}function nae(t){return nB().get(t)}function nB(){return Ar("clientToMetricBufferMap",()=>new WeakMap)}function Yf(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}var Zl=Symbol.for("SentryBufferFullError");function Oc(t=100){let e=new Set;function n(){return e.size<t}function r(i){e.delete(i)}function o(i){if(!n())return Ic(Zl);let a=i();return e.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!e.size)return Lo(!0);let a=Promise.allSettled(Array.from(e)).then(()=>!0);if(!i)return a;let c=[a,new Promise(l=>Yf(setTimeout(()=>l(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(e)},add:o,drain:s}}var rae=60*1e3;function oae(t,e=Xn()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?rae:r-e}function sae(t,e){return t[e]||t.all||0}function rB(t,e,n=Xn()){return sae(t,e)>n}function oB(t,{statusCode:e,headers:n},r=Xn()){let o={...t},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,l,,,p]=a.split(":",5),d=parseInt(c,10),_=(isNaN(d)?60:d)*1e3;if(!l)o.all=r+_;else for(let f of l.split(";"))f==="metric_bucket"?(!p||p.split(";").includes("custom"))&&(o[f]=r+_):o[f]=r+_}else i?o.all=r+oae(i,r):e===429&&(o.all=r+60*1e3);return o}var ep=64;function tp(t,e,n=Oc(t.bufferSize||ep)){let r={},o=i=>n.drain(i);function s(i){let a=[];if($l(i,(d,_)=>{let f=Df(_);rB(r,f)?t.recordDroppedEvent("ratelimit_backoff",f):a.push(d)}),a.length===0)return Promise.resolve({});let c=an(i[0],a),l=d=>{if(UR(c,["client_report"])){C&&g.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}$l(c,(_,f)=>{t.recordDroppedEvent(d,Df(f))})},p=()=>e({body:Yl(c)}).then(d=>d.statusCode===413?(C&&g.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),l("send_error"),d):(C&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&g.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=oB(r,d),d),d=>{throw l("network_error"),C&&g.error("Encountered error running transport request:",d),d});return n.add(p).then(d=>d,d=>{if(d===Zl)return C&&g.error("Skipped sending event because buffer is full."),l("queue_overflow"),Promise.resolve({});throw d})}return{send:s,flush:o}}function sB(t,e,n){let r=[{type:"client_report"},{timestamp:n||Po(),discarded_events:t}];return an(e?{dsn:e}:{},[r])}function Wf(t){let e=[];t.message&&e.push(t.message);try{let n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function iB(t){let{trace_id:e,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=t.contexts?.trace??{};return{data:i??{},description:t.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:s,profile_id:i?.[hc],exclusive_time:i?.[Ec],measurements:t.measurements,is_segment:!0}}function aB(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[hc]:t.profile_id},...t.exclusive_time&&{[Ec]:t.exclusive_time}}}},measurements:t.measurements}}var cB="Not capturing exception because it's already been captured.",uB="Discarded session because of missing or non-string release",mB=Symbol.for("SentryInternalError"),TB=Symbol.for("SentryDoNotSendEventError"),iae=5e3;function zf(t){return{message:t,[mB]:!0}}function zR(t){return{message:t,[TB]:!0}}function lB(t){return!!t&&typeof t=="object"&&mB in t}function pB(t){return!!t&&typeof t=="object"&&TB in t}function dB(t,e,n,r,o){let s=0,i,a=!1;t.on(n,()=>{s=0,clearTimeout(i),a=!1}),t.on(e,c=>{s+=r(c),s>=8e5?o(t):a||(a=!0,i=Yf(setTimeout(()=>{o(t)},iae)))}),t.on("flush",()=>{o(t)})}var Kf=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Oc(e.transportOptions?.bufferSize??ep),e.dsn?this._dsn=SG(e.dsn):C&&g.warn("No DSN provided, client will not send events."),this._dsn){let r=KG(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&dB(this,"afterCaptureLog","flushLogs",lae,Nc),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&dB(this,"afterCaptureMetric","flushMetrics",uae,tB)}captureException(e,n,r){let o=dt();if(Rf(e))return C&&g.log(cB),o;let s={event_id:o,...n};return this._process(()=>this.eventFromException(e,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(e,n,r,o){let s={event_id:dt(),...r},i=dc(e)?e:String(e),a=kl(e),c=a?this.eventFromMessage(i,n,s):this.eventFromException(e,s);return this._process(()=>c.then(l=>this._captureEvent(l,s,o)),a?"unknown":"error"),s.event_id}captureEvent(e,n,r){let o=dt();if(n?.originalException&&Rf(n.originalException))return C&&g.log(cB),o;let s={event_id:o,...n},i=e.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,l=_B(e.type);return this._process(()=>this._captureEvent(e,s,a||r,c),l),s.event_id}captureSession(e){this.sendSession(e),Mo(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let n=this._transport;if(!n)return!0;this.emit("flush");let r=await this._isClientDoneProcessing(e),o=await n.flush(e);return r&&o}async close(e){Nc(this);let n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let n=this._integrations[e.name];WR(this,e,this._integrations),n||YR(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=vG(e,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=DR(r,kR(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",e,o))}sendSession(e){let{release:n,environment:r=gc}=this._options;if("aggregates"in e){let s=e.attrs||{};if(!s.release&&!n){C&&g.warn(uB);return}s.release=s.release||n,s.environment=s.environment||r,e.attrs=s}else{if(!e.release&&!n){C&&g.warn(uB);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=xG(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){let o=`${e}:${n}`;C&&g.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(e,n){let r=this._hooks[e]=this._hooks[e]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(o=>o(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(n){return C&&g.error("Error while sending envelope:",n),{}}return C&&g.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=QG(this,e),YR(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0,r=!1;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=e.status==="ok";(i&&e.errors===0||i&&r)&&(Mo(e,{...r&&{status:"crashed"},errors:e.errors||Number(o||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",e,n),e.type||o.setLastEventId(e.event_id||n.event_id),WG(s,e,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Di(r)},...a.contexts};let c=Kr(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(e,n={},r=Te(),o=ue()){return C&&KR(e)&&g.log(`Captured error event \`${Wf(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(s=>s.event_id,s=>{C&&(pB(s)?g.log(s.message):lB(s)?g.warn(s.message):g.warn(s))})}_processEvent(e,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=hB(e),c=KR(e),p=`before send for type \`${e.type||"error"}\``,d=typeof i>"u"?void 0:Gn(i);if(c&&typeof d=="number"&&Rt()>d)return this.recordDroppedEvent("sample_rate","error"),Ic(zR(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let _=_B(e.type);return this._prepareEvent(e,n,r,o).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",_),zR("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return f;let T=cae(this,s,f,n);return aae(T,p)}).then(f=>{if(f===null){if(this.recordDroppedEvent("before_send",_),a){let S=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",S)}throw zR(`${p} returned \`null\`, will not send event.`)}let m=r.getSession()||o.getSession();if(c&&m&&this._updateSessionFromEvent(m,f),a){let h=f.sdkProcessingMetadata?.spanCountBeforeProcessing||0,S=f.spans?f.spans.length:0,R=h-S;R>0&&this.recordDroppedEvent("before_send","span",R)}let T=f.transaction_info;if(a&&T&&f.transaction!==e.transaction){let h="custom";f.transaction_info={...T,source:h}}return this.sendEvent(f,n),f}).then(null,f=>{throw pB(f)||lB(f)?f:(this.captureException(f,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:f}),zf(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
20
- Reason: ${f}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Zl&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){C&&g.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){C&&g.log("No outcomes to send");return}if(!this._dsn){C&&g.log("No dsn provided, will not send outcomes");return}C&&g.log("Sending outcomes:",e);let n=sB(e,this._options.tunnel&&kn(this._dsn));this.sendEnvelope(n)}};function _B(t){return t==="replay_event"?"replay":t||"error"}function aae(t,e){let n=`${e} must return \`null\` or a valid event.`;if(xt(t))return t.then(r=>{if(!bo(r)&&r!==null)throw zf(n);return r},r=>{throw zf(`${e} rejected with ${r}`)});if(!bo(t)&&t!==null)throw zf(n);return t}function cae(t,e,n,r){let{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:i,ignoreSpans:a}=e,c=n;if(KR(c)&&o)return o(c,r);if(hB(c)){if(i||a){let l=iB(c);if(a?.length&&ql(l,a))return null;if(i){let p=i(l);p?c=ms(n,aB(p)):Fl()}if(c.spans){let p=[],d=c.spans;for(let f of d){if(a?.length&&ql(f,a)){CG(d,f);continue}if(i){let m=i(f);m?p.push(m):(Fl(),p.push(f))}else p.push(f)}let _=c.spans.length-p.length;_&&t.recordDroppedEvent("before_send","span",_),c.spans=p}}if(s){if(c.spans){let l=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:l}}return s(c,r)}}return c}function KR(t){return t.type===void 0}function hB(t){return t.type==="transaction"}function uae(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+EB(t.attributes)}function lae(t){let e=0;return t.message&&(e+=t.message.length*2),e+EB(t.attributes)}function EB(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*fB(n[0]):kl(n)?e+=fB(n):e+=100}),e}function fB(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function SB(t,e,n,r,o){let s={sent_at:new Date().toISOString()};n?.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&o&&(s.dsn=kn(o)),e&&(s.trace=e);let i=pae(t);return an(s,[i])}function pae(t){return[{type:"check_in"},t]}function gB(t){let e=t._metadata?.sdk,n=e?.name&&e?.version?`${e?.name}/${e?.version}`:void 0;t.transportOptions={...t.transportOptions,headers:{...n&&{"user-agent":n},...t.transportOptions?.headers}}}function AB(t,e){return t(e.stack||"",1)}function dae(t){return Yr(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function _ae(t){return dae(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}function QR(t,e){let n={type:e.name||e.constructor.name,value:_ae(e)},r=AB(t,e);return r.length&&(n.stacktrace={frames:r}),n}function fae(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}function mae(t){if("name"in t&&typeof t.name=="string"){let r=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(r+=` with message '${t.message}'`),r}else if("message"in t&&typeof t.message=="string")return t.message;let e=uR(t);if(nR(t))return`Event \`ErrorEvent\` captured as exception with message \`${t.message}\``;let n=Tae(t);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${e}`}function Tae(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function hae(t,e,n,r){if(Yr(n))return[n,void 0];if(e.synthetic=!0,bo(n)){let s=t?.getOptions().normalizeDepth,i={__serialized__:vR(n,s)},a=fae(n);if(a)return[a,i];let c=mae(n),l=r?.syntheticException||new Error(c);return l.message=c,[l,i]}let o=r?.syntheticException||new Error(n);return o.message=`${n}`,[o,void 0]}function RB(t,e,n,r){let s=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[i,a]=hae(t,s,n,r),c={exception:{values:[QR(e,i)]}};return a&&(c.extra=a),fR(c,void 0,void 0),fc(c,s),{...c,event_id:r?.event_id}}function yB(t,e,n="info",r,o){let s={event_id:r?.event_id,level:n};if(o&&r?.syntheticException){let i=AB(t,r.syntheticException);i.length&&(s.exception={values:[{value:e,stacktrace:{frames:i}}]},fc(s,{synthetic:!0}))}if(dc(e)){let{__sentry_template_string__:i,__sentry_template_values__:a}=e;return s.logentry={message:i,params:a},s}return s.message=e,s}var np=class extends Kf{constructor(e){OG(),gB(e),super(e),this._setUpMetricsProcessing()}eventFromException(e,n){let r=RB(this,this._options.stackParser,e,n);return r.level="error",Lo(r)}eventFromMessage(e,n="info",r){return Lo(yB(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){return IB(n),super.captureException(e,n,r)}captureEvent(e,n,r){return!e.type&&e.exception?.values&&e.exception.values.length>0&&IB(n),super.captureEvent(e,n,r)}captureCheckIn(e,n,r){let o="checkInId"in e&&e.checkInId?e.checkInId:dt();if(!this._isEnabled())return C&&g.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,l={check_in_id:o,monitor_slug:e.monitorSlug,status:e.status,release:i,environment:a};"duration"in e&&(l.duration=e.duration),n&&(l.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[p,d]=XG(this,r);d&&(l.contexts={trace:d});let _=SB(l,p,this.getSdkMetadata(),c,this.getDsn());return C&&g.log("Sending checkin:",e.monitorSlug,e.status),this.sendEnvelope(_),o}dispose(){C&&g.log("Disposing client...");for(let e of Object.keys(this._hooks))this._hooks[e]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=Oc(ep)}_prepareEvent(e,n,r,o){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:e.contexts?.runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,n,r,o)}_setUpMetricsProcessing(){this.on("processMetric",e=>{this._options.serverName&&(e.attributes={"server.address":this._options.serverName,...e.attributes})})}};function IB(t){let e=ue().getScopeData().sdkProcessingMetadata.requestSession;if(e){let n=t?.mechanism?.handled??!0;n&&e.status!=="crashed"?e.status="errored":n||(e.status="crashed")}}var XR=new Set;function JR(t){t.forEach(e=>{XR.add(e),C&&g.log(`AI provider "${e}" wrapping will be skipped`)})}function Hi(t){return XR.has(t)}function ZR(){XR.clear(),C&&g.log("Cleared AI provider skip registrations")}var Eae=new Set(["false","f","n","no","off","0"]),Sae=new Set(["true","t","y","yes","on","1"]);function bc(t,e){let n=String(t).toLowerCase();return Eae.has(n)?!1:Sae.has(n)?!0:e?.strict?null:!!t}var gae="thismessage:/";function ey(t){return"isRelative"in t}function rp(t,e){let n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=e??(n?gae:void 0);try{if("canParse"in URL&&!URL.canParse(t,r))return;let o=new URL(t,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function NB(t){if(ey(t))return t.pathname;let e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function Aae(t,e,n,r){let o=n?.method?.toUpperCase()??"GET",s=r||(t?e==="client"?NB(t):t.pathname:"/");return`${o} ${s}`}function ty(t,e,n,r,o){let s={[W]:n,[Ue]:"url"};return o&&(s[e==="server"?"http.route":"url.template"]=o,s[Ue]="route"),r?.method&&(s[OR]=r.method.toUpperCase()),t&&(t.search&&(s["url.query"]=t.search),t.hash&&(s["url.fragment"]=t.hash),t.pathname&&(s["url.path"]=t.pathname,t.pathname==="/"&&(s[Ue]="route")),ey(t)||(s[Ts]=t.href,t.port&&(s["url.port"]=t.port),t.protocol&&(s["url.scheme"]=t.protocol),t.hostname&&(s[e==="server"?"server.address":"url.domain"]=t.hostname))),[Aae(t,e,r,o),s]}function Rs(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Do(t){return t.split(/[?#]/,1)[0]}function ys(t){let{protocol:e,host:n,path:r}=t,o=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${e?`${e}://`:""}${o}${r}`}function Cc(t,e=!0){if(t.startsWith("data:")){let n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=t.includes(";base64,"),s=t.indexOf(","),i="";if(e&&s!==-1){let a=t.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return t}function Vi(t,e,n=[e],r="npm"){let o=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${e}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:pe})),o.version=pe)}function Pc(t={}){let e=t.client||H();if(!qf()||!e)return{};let n=sn(),r=Rr(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||Te(),s=t.span||er();if(!s&&SR())return{};let i=s?xf(s):Rae(o),a=s?Je(s):Kr(e,o),c=Ui(a);if(!bf.test(i))return g.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let p={"sentry-trace":i,baggage:c};return t.propagateTraceparent&&(p.traceparent=s?IG(s):yae(o)),p}function Rae(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return hs(e,r,n)}function yae(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return Es(e,r,n)}var OB="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";function Fi(t,e,n){if(typeof t!="string"||!e)return!0;let r=n?.get(t);if(r!==void 0)return C&&!r&&g.log(OB,t),r;let o=ds(t,e);return n?.set(t,o),C&&!o&&g.log(OB,t),o}function ny(t,e,n){let r,o,s,i=n?.maxWait?Math.max(n.maxWait,e):0,a=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=t(),r}function l(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function p(){return o!==void 0||s!==void 0?c():r}function d(){return o&&clearTimeout(o),o=a(c,e),i&&s===void 0&&(s=a(c,i)),r}return d.cancel=l,d.flush=p,d}function MB(t){let e=Object.create(null);try{Object.entries(t).forEach(([n,r])=>{typeof r=="string"&&(e[n]=r)})}catch{}return e}function op(t){let e=t.headers||{},r=(typeof e["x-forwarded-host"]=="string"?e["x-forwarded-host"]:void 0)||(typeof e.host=="string"?e.host:void 0),s=(typeof e["x-forwarded-proto"]=="string"?e["x-forwarded-proto"]:void 0)||t.protocol||(t.socket?.encrypted?"https":"http"),i=t.url||"",a=Iae({url:i,host:r,protocol:s}),c=t.body||void 0,l=t.cookies;return{url:a,method:t.method,query_string:xB(i),headers:MB(e),cookies:l,data:c}}function Iae({url:t,protocol:e,host:n}){if(t?.startsWith("http"))return t;if(t&&n)return`${e}://${n}${t}`}var bB=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","set-cookie","cookie"],Nae=["x-forwarded-","-user"];function Qf(t,e=!1,n="request"){let r={};try{Object.entries(t).forEach(([o,s])=>{if(s==null)return;let i=o.toLowerCase();if((i==="cookie"||i==="set-cookie")&&typeof s=="string"&&s!==""){let c=i==="set-cookie",l=s.indexOf(";"),p=c&&l!==-1?s.substring(0,l):s,d=c?[p]:p.split("; ");for(let _ of d){let f=_.indexOf("="),m=f!==-1?_.substring(0,f):_,T=f!==-1?_.substring(f+1):"",h=m.toLowerCase();PB(r,i,h,T,e,n)}}else PB(r,i,"",s,e,n)})}catch{}return r}function CB(t){return t.replace(/-/g,"_")}function PB(t,e,n,r,o,s){let i=Oae(n||e,r,o);if(i==null)return;let a=`http.${s}.header.${CB(e)}${n?`.${CB(n)}`:""}`;t[a]=i}function Oae(t,e,n){if(n?bB.some(o=>t.includes(o)):[...Nae,...bB].some(o=>t.includes(o)))return"[Filtered]";if(Array.isArray(e))return e.map(o=>o!=null?String(o):o).join(";");if(typeof e=="string")return e}function xB(t){if(t)try{let e=new URL(t,"http://s.io").search.slice(1);return e.length?e:void 0}catch{return}}var bae=100;function tr(t,e){let n=H(),r=ue();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=bae}=n.getOptions();if(s<=0)return;let a={timestamp:Po(),...t},c=o?Qe(()=>o(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,s))}var vB,Cae="FunctionToString",LB=new WeakMap,Pae=()=>({name:Cae,setupOnce(){vB=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=cR(this),n=LB.has(H())&&e!==void 0?e:this;return vB.apply(n,t)}}catch{}},setup(t){LB.set(t,!0)}}),Xf=Pae;var Mae=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],xae="EventFilters",ry=(t={})=>{let e;return{name:xae,setup(n){let r=n.getOptions();e=DB(t,r)},processEvent(n,r,o){if(!e){let s=o.getOptions();e=DB(t,s)}return vae(n,e)?null:n}}},Zf=(t={})=>({...ry(t),name:"InboundFilters"});function DB(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:Mae],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function vae(t,e){if(t.type){if(t.type==="transaction"&&Dae(t,e.ignoreTransactions))return C&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
21
- Event: ${_s(t)}`),!0}else{if(Lae(t,e.ignoreErrors))return C&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
22
- Event: ${_s(t)}`),!0;if(Gae(t))return C&&g.warn(`Event dropped due to not having an error message, error type or stacktrace.
23
- Event: ${_s(t)}`),!0;if(Uae(t,e.denyUrls))return C&&g.warn(`Event dropped due to being matched by \`denyUrls\` option.
24
- Event: ${_s(t)}.
25
- Url: ${Jf(t)}`),!0;if(!wae(t,e.allowUrls))return C&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option.
26
- Event: ${_s(t)}.
27
- Url: ${Jf(t)}`),!0}return!1}function Lae(t,e){return e?.length?Wf(t).some(n=>ds(n,e)):!1}function Dae(t,e){if(!e?.length)return!1;let n=t.transaction;return n?ds(n,e):!1}function Uae(t,e){if(!e?.length)return!1;let n=Jf(t);return n?ds(n,e):!1}function wae(t,e){if(!e?.length)return!0;let n=Jf(t);return n?ds(n,e):!0}function kae(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Jf(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?kae(n):null}catch{return C&&g.error(`Cannot extract url for event ${_s(t)}`),null}}function Gae(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function kB(t,e,n,r,o,s){if(!o.exception?.values||!s||!Wr(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=oy(t,e,r,s.originalException,n,o.exception.values,i,0))}function oy(t,e,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Wr(r[o],Error)){UB(i,a,r);let l=t(e,r[o]),p=c.length;wB(l,o,p,a),c=oy(t,e,n,r[o],o,[l,...c],l,p)}return GB(r)&&r.errors.forEach((l,p)=>{if(Wr(l,Error)){UB(i,a,r);let d=t(e,l),_=c.length;wB(d,`errors[${p}]`,_,a),c=oy(t,e,n,l,o,[d,...c],d,_)}}),c}function GB(t){return Array.isArray(t.errors)}function UB(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...GB(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function wB(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}var Bae="cause",jae=5,Hae="LinkedErrors",Vae=(t={})=>{let e=t.limit||jae,n=t.key||Bae;return{name:Hae,preprocessEvent(r,o,s){let i=s.getOptions();kB(QR,i.stackParser,n,e,r,o)}}},em=Vae;function BB(t){let e={},n=0;for(;n<t.length;){let r=t.indexOf("=",n);if(r===-1)break;let o=t.indexOf(";",n);if(o===-1)o=t.length;else if(o<r){n=t.lastIndexOf(";",r-1)+1;continue}let s=t.slice(n,r).trim();if(e[s]===void 0){let i=t.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{e[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{e[s]=i}}n=o+1}return e}var sy=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function jB(t){let e={};for(let s of Object.keys(t))e[s.toLowerCase()]=t[s];return sy.map(s=>{let i=e[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?Fae(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&qae(s))||null}function Fae(t){if(!t)return null;for(let e of t.split(";"))if(e.startsWith("for="))return e.slice(4);return null}function qae(t){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(t)}var $ae={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Yae="RequestData",Wae=(t={})=>{let e={...$ae,...t.include};return{name:Yae,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...e,ip:e.ip??o.getOptions().sendDefaultPii};return i&&zae(n,i,{ipAddress:a},c),n}}},tm=Wae;function zae(t,e,n,r){if(t.request={...t.request,...Kae(e,r)},r.ip){let o=e.headers&&jB(e.headers)||n.ipAddress;o&&(t.user={...t.user,ip_address:o})}}function Kae(t,e){let n={},r={...t.headers};if(e.headers&&(n.headers=r,e.cookies||delete r.cookie,e.ip||sy.forEach(o=>{delete r[o]})),n.method=t.method,e.url&&(n.url=t.url),e.cookies){let o=t.cookies||(r?.cookie?BB(r.cookie):void 0);n.cookies=o||{}}return e.query_string&&(n.query_string=t.query_string),e.data&&(n.data=t.data),n}function HB(t){let e="console";uc(e,t),lc(e,Qae)}function Qae(){"console"in J&&Ul.forEach(function(t){t in J.console&&aR(J.console,t,function(e){return cc[t]=e,function(...n){pc("console",{args:n,level:t}),cc[t]?.apply(J.console,n)}})})}function VB(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var Xae=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Jae(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=Xae.exec(e);return n?n.slice(1):[]}function iy(t){let e=Jae(t),n=e[0]||"",r=e[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var Zae=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,nm=Symbol("sentryPostgresConnectionContext"),ay=Symbol.for("sentry.instrumented.postgresjs"),ece=Symbol.for("sentry.query.from.instrumented.sql");function uy(t,e){return!t||typeof t!="function"?(C&&g.warn("instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance"),t):cy(t,{requireParentSpan:!0,...e})}function cy(t,e,n){if(t[ay])return t;let r=new Proxy(t,{apply(o,s,i){let a=Reflect.apply(o,s,i);return a&&typeof a=="object"&&"handle"in a&&qB(a,r,e),a},get(o,s){let i=o[s];return typeof s!="string"||typeof i!="function"?i:s==="unsafe"||s==="file"?tce(i,o,r,e):s==="begin"||s==="reserve"?nce(i,o,r,e):i}});return n?r[nm]=n:ace(t,r),t[ay]=!0,r[ay]=!0,r}function tce(t,e,n,r){return function(...o){let s=Reflect.apply(t,e,o);return s&&typeof s=="object"&&"handle"in s&&qB(s,n,r),s}}function nce(t,e,n,r){return function(...o){let s=n[nm];if(!(typeof o[o.length-1]=="function")){let p=Reflect.apply(t,e,o);return p&&typeof p.then=="function"?p.then(d=>cy(d,r,s)):p}let a=o.length===1?o[0]:o[1],c=function(p){let d=cy(p,r,s);return a(d)},l=o.length===1?[c]:[o[0],c];return Reflect.apply(t,e,l)}}function qB(t,e,n){if(t.handle?.__sentryWrapped)return;t[ece]=!0;let r=t.handle,o=async function(...s){if(!rce(n))return r.apply(this,s);let i=oce(t.strings),a=sce(i);return yt({name:a||"postgresjs.query",op:"db"},c=>{c.setAttribute(W,"auto.db.postgresjs"),c.setAttributes({"db.system.name":"postgres","db.query.text":a});let l=e?e[nm]:void 0;if(ice(c,l),n.requestHook)try{n.requestHook(c,a,l)}catch(d){c.setAttribute("sentry.hook.error","requestHook failed"),C&&g.error("Error in requestHook for PostgresJs instrumentation:",d)}let p=this;p.resolve=new Proxy(p.resolve,{apply:(d,_,f)=>{try{FB(c,a,f?.[0]?.command),c.end()}catch(m){C&&g.error("Error ending span in resolve callback:",m)}return Reflect.apply(d,_,f)}}),p.reject=new Proxy(p.reject,{apply:(d,_,f)=>{try{c.setStatus({code:2,message:f?.[0]?.message||"unknown_error"}),c.setAttribute("db.response.status_code",f?.[0]?.code||"unknown"),c.setAttribute("error.type",f?.[0]?.name||"unknown"),FB(c,a),c.end()}catch(m){C&&g.error("Error ending span in reject callback:",m)}return Reflect.apply(d,_,f)}});try{return r.apply(this,s)}catch(d){throw c.setStatus({code:2,message:d instanceof Error?d.message:"unknown_error"}),c.end(),d}})};o.__sentryWrapped=!0,t.handle=o}function rce(t){return er()!==void 0||!t.requireParentSpan}function oce(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((e,n,r)=>r===0?n:`${e}$${r}${n}`,"")}function sce(t){return t?t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}function ice(t,e){if(e&&(e.ATTR_DB_NAMESPACE&&t.setAttribute("db.namespace",e.ATTR_DB_NAMESPACE),e.ATTR_SERVER_ADDRESS&&t.setAttribute("server.address",e.ATTR_SERVER_ADDRESS),e.ATTR_SERVER_PORT!==void 0)){let n=parseInt(e.ATTR_SERVER_PORT,10);isNaN(n)||t.setAttribute("server.port",n)}}function FB(t,e,n){if(n){t.setAttribute("db.operation.name",n);return}let r=e?.match(Zae);r?.[1]&&t.setAttribute("db.operation.name",r[1].toUpperCase())}function ace(t,e){let n=t;if(!n.options||typeof n.options!="object")return;let r=n.options,o=r.host?.[0]||"localhost",s=r.port?.[0]||5432,i={ATTR_DB_NAMESPACE:typeof r.database=="string"&&r.database!==""?r.database:void 0,ATTR_SERVER_ADDRESS:o,ATTR_SERVER_PORT:String(s)};e[nm]=i}var cce="Console",rm=(t={})=>{let e=new Set(t.levels||Ul);return{name:cce,setup(n){HB(({args:r,level:o})=>{H()!==n||!e.has(o)||uce(o,r)})}}};function uce(t,e){let n={category:"console",data:{arguments:e,logger:"console"},level:VB(t),message:$B(e)};if(t==="assert")if(e[0]===!1){let r=e.slice(1);n.message=r.length>0?`Assertion failed: ${$B(r)}`:"Assertion failed",n.data.arguments=r}else return;tr(n,{input:e,level:t})}function $B(t){return"util"in J&&typeof J.util.format=="function"?J.util.format(...t):pR(t," ")}var lce="ConversationId",pce=()=>({name:lce,setup(t){t.on("spanStart",e=>{let n=Te().getScopeData(),r=ue().getScopeData(),o=n.conversationId||r.conversationId;o&&e.setAttribute(bR,o)})}}),ly=pce;var YB="gen_ai.prompt",Is="gen_ai.system",He="gen_ai.request.model",Mc="gen_ai.request.stream",Ns="gen_ai.request.temperature",xc="gen_ai.request.max_tokens",Os="gen_ai.request.frequency_penalty",vc="gen_ai.request.presence_penalty",bs="gen_ai.request.top_p",om="gen_ai.request.top_k",WB="gen_ai.request.encoding_format",zB="gen_ai.request.dimensions",An="gen_ai.response.finish_reasons",_t="gen_ai.response.model",nr="gen_ai.response.id",KB="gen_ai.response.stop_reason",Pe="gen_ai.usage.input_tokens",Ze="gen_ai.usage.output_tokens",cn="gen_ai.usage.total_tokens",vt="gen_ai.operation.name",un="sentry.sdk_meta.gen_ai.input.messages.original_length",Lt="gen_ai.input.messages",QB="gen_ai.output.messages",Bn="gen_ai.system_instructions",rt="gen_ai.response.text",Qr="gen_ai.request.available_tools",qi="gen_ai.response.streaming",It="gen_ai.response.tool_calls",py="gen_ai.agent.name",XB="gen_ai.pipeline.name",sp="gen_ai.conversation.id",JB="gen_ai.usage.cache_creation_input_tokens",ZB="gen_ai.usage.cache_read_input_tokens",dy="gen_ai.usage.input_tokens.cache_write",Cs="gen_ai.usage.input_tokens.cached",sm="gen_ai.invoke_agent",e1="gen_ai.generate_text",t1="gen_ai.stream_text",n1="gen_ai.generate_object",r1="gen_ai.stream_object",Lc="gen_ai.embeddings.input",o1="gen_ai.embeddings",s1="gen_ai.embeddings",i1="gen_ai.rerank",a1="gen_ai.execute_tool",$i="gen_ai.tool.name",_y="gen_ai.tool.call.id",fy="gen_ai.tool.type",im="gen_ai.tool.input",am="gen_ai.tool.output",c1="gen_ai.tool.description",my="openai.response.id",Ty="openai.response.model",hy="openai.response.timestamp",u1="openai.usage.completion_tokens",l1="openai.usage.prompt_tokens",Ey="anthropic.response.timestamp";var ip=new Map,Sy=new Set(["ai.generateText","ai.streamText","ai.generateObject","ai.streamObject"]),gy=new Set(["ai.generateText.doGenerate","ai.streamText.doStream","ai.generateObject.doGenerate","ai.streamObject.doStream"]),p1=new Set(["ai.embed.doEmbed","ai.embedMany.doEmbed"]),d1=new Set(["ai.rerank.doRerank"]),_1={"ai.embed.doEmbed":"embeddings","ai.embedMany.doEmbed":"embeddings","ai.rerank.doRerank":"rerank"};function Ps(t){return!t||typeof t!="object"?!1:_ce(t)||m1(t)||dce(t)||T1(t)||h1(t)||fce(t)||mce(t)||Tce(t)||hce(t)||Ece(t)||Sce(t)||gce(t)}function dce(t){return"image_url"in t?typeof t.image_url=="string"?t.image_url.startsWith("data:"):f1(t):!1}function f1(t){return"image_url"in t&&!!t.image_url&&typeof t.image_url=="object"&&"url"in t.image_url&&typeof t.image_url.url=="string"&&t.image_url.url.startsWith("data:")}function _ce(t){return"type"in t&&typeof t.type=="string"&&"source"in t&&Ps(t.source)}function m1(t){return"inlineData"in t&&!!t.inlineData&&typeof t.inlineData=="object"&&"data"in t.inlineData&&typeof t.inlineData.data=="string"}function T1(t){return"type"in t&&t.type==="input_audio"&&"input_audio"in t&&!!t.input_audio&&typeof t.input_audio=="object"&&"data"in t.input_audio&&typeof t.input_audio.data=="string"}function h1(t){return"type"in t&&t.type==="file"&&"file"in t&&!!t.file&&typeof t.file=="object"&&"file_data"in t.file&&typeof t.file.file_data=="string"}function fce(t){return"media_type"in t&&typeof t.media_type=="string"&&"data"in t}function mce(t){return"type"in t&&t.type==="file"&&"mediaType"in t&&typeof t.mediaType=="string"&&"data"in t&&typeof t.data=="string"&&!t.data.startsWith("http://")&&!t.data.startsWith("https://")}function Tce(t){return"type"in t&&t.type==="image"&&"image"in t&&typeof t.image=="string"&&!t.image.startsWith("http://")&&!t.image.startsWith("https://")}function hce(t){return"type"in t&&(t.type==="blob"||t.type==="base64")}function Ece(t){return"b64_json"in t}function Sce(t){return"type"in t&&"result"in t&&t.type==="image_generation"}function gce(t){return"uri"in t&&typeof t.uri=="string"&&t.uri.startsWith("data:")}var ap="[Blob substitute]",Ace=["image_url","data","content","b64_json","result","uri","image"];function Yi(t){let e={...t};Ps(e.source)&&(e.source=Yi(e.source)),m1(t)&&(e.inlineData={...t.inlineData,data:ap}),f1(t)&&(e.image_url={...t.image_url,url:ap}),T1(t)&&(e.input_audio={...t.input_audio,data:ap}),h1(t)&&(e.file={...t.file,file_data:ap});for(let n of Ace)typeof e[n]=="string"&&(e[n]=ap);return e}var S1=2e4,cm=t=>new TextEncoder().encode(t).length,Ry=t=>cm(JSON.stringify(t));function um(t,e){if(cm(t)<=e)return t;let n=0,r=t.length,o="";for(;n<=r;){let s=Math.floor((n+r)/2),i=t.slice(0,s);cm(i)<=e?(o=i,n=s+1):r=s-1}return o}function Rce(t){return typeof t=="string"?t:"text"in t&&typeof t.text=="string"?t.text:""}function E1(t,e){return typeof t=="string"?e:{...t,text:e}}function yce(t){return t!==null&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function g1(t){return t!==null&&typeof t=="object"&&"content"in t&&Array.isArray(t.content)}function A1(t){return t!==null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)&&t.parts.length>0}function Ice(t,e){let n={...t,content:""},r=Ry(n),o=e-r;if(o<=0)return[];let s=um(t.content,o);return[{...t,content:s}]}function Nce(t){return"parts"in t&&Array.isArray(t.parts)?{key:"parts",items:t.parts}:"content"in t&&Array.isArray(t.content)?{key:"content",items:t.content}:{key:null,items:[]}}function Oce(t,e){let{key:n,items:r}=Nce(t);if(n===null||r.length===0)return[];let o=r.map(c=>E1(c,"")),s=Ry({...t,[n]:o}),i=e-s;if(i<=0)return[];let a=[];for(let c of r){let l=Rce(c),p=cm(l);if(p<=i)a.push(c),i-=p;else if(a.length===0){let d=um(l,i);d&&a.push(E1(c,d));break}else break}return a.length<=0?[]:[{...t,[n]:a}]}function bce(t,e){if(!t)return[];if(typeof t=="string"){let n=um(t,e);return n?[n]:[]}return typeof t!="object"?[]:yce(t)?Ice(t,e):g1(t)||A1(t)?Oce(t,e):[]}function Ay(t){return t.map(n=>{let r;return n&&typeof n=="object"&&(g1(n)?r={...n,content:Ay(n.content)}:"content"in n&&Ps(n.content)&&(r={...n,content:Yi(n.content)}),A1(n)&&(r={...r??n,parts:Ay(n.parts)}),Ps(r)?r=Yi(r):Ps(n)&&(r=Yi(n))),r??n})}function Cce(t,e){if(!Array.isArray(t)||t.length===0)return t;let n=e-2,r=t[t.length-1],o=Ay([r]),s=o[0];return Ry(s)<=n?o:bce(s,n)}function Ms(t){return Cce(t,S1)}function R1(t){return um(t,S1)}function Xr(t){let e=!!H()?.getOptions().sendDefaultPii;return{...t,recordInputs:t?.recordInputs??e,recordOutputs:t?.recordOutputs??e}}function Dc(t,e){return t?`${t}.${e}`:e}function cp(t,e,n,r,o){if(e!==void 0&&t.setAttributes({[Pe]:e}),n!==void 0&&t.setAttributes({[Ze]:n}),e!==void 0||n!==void 0||r!==void 0||o!==void 0){let s=(e??0)+(n??0)+(r??0)+(o??0);t.setAttributes({[cn]:s})}}function Wi(t){if(typeof t=="string")return R1(t);if(Array.isArray(t)){let e=Ms(t);return JSON.stringify(e)}return JSON.stringify(t)}function jn(t){if(!Array.isArray(t))return{systemInstructions:void 0,filteredMessages:t};let e=t.findIndex(i=>i&&typeof i=="object"&&"role"in i&&i.role==="system");if(e===-1)return{systemInstructions:void 0,filteredMessages:t};let n=t[e],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:t};let o=JSON.stringify([{type:"text",content:r}]),s=[...t.slice(0,e),...t.slice(e+1)];return{systemInstructions:o,filteredMessages:s}}async function Pce(t,e,n){let r=t.catch(i=>{throw te(i,{mechanism:{handled:!1,type:n}}),i}),o=await e,s=await r;return s&&typeof s=="object"&&"data"in s?{...s,data:o}:o}function Uc(t,e,n){return xt(t)?new Proxy(t,{get(r,o){let i=o in Promise.prototype||o===Symbol.toStringTag?e:r,a=Reflect.get(i,o);return o==="withResponse"&&typeof a=="function"?function(){let l=a.call(r);return Pce(l,e,n)}:typeof a=="function"?a.bind(i):a}}):e}var lm="operation.name",y1="ai.operationId",pm="ai.prompt",I1="ai.schema",N1="ai.response.object",yy="ai.values",Iy="ai.response.text",Ny="ai.response.toolCalls",O1="ai.response.finishReason",zi="ai.prompt.messages",wc="ai.prompt.tools",up="ai.model.id",b1="ai.response.providerMetadata",C1="ai.usage.cachedInputTokens",P1="ai.telemetry.functionId",M1="ai.usage.completionTokens",x1="ai.usage.promptTokens",v1="ai.usage.tokens",Oy="ai.toolCall.name",by="ai.toolCall.id",L1="ai.toolCall.args",D1="ai.toolCall.result";function w1(t,e){let n=t.parent_span_id;if(!n)return;let r=t.data[Pe],o=t.data[Ze];if(typeof r=="number"||typeof o=="number"){let s=e.get(n)||{inputTokens:0,outputTokens:0};typeof r=="number"&&(s.inputTokens+=r),typeof o=="number"&&(s.outputTokens+=o),e.set(n,s)}}function Cy(t,e){let n=e.get(t.span_id);!n||!t.data||(n.inputTokens>0&&(t.data[Pe]=n.inputTokens),n.outputTokens>0&&(t.data[Ze]=n.outputTokens),(n.inputTokens>0||n.outputTokens>0)&&(t.data["gen_ai.usage.total_tokens"]=n.inputTokens+n.outputTokens))}function Mce(t){let e=new Map;for(let n of t){let r=n.data[Qr];if(typeof r=="string")try{let o=JSON.parse(r);for(let s of o)s.name&&s.description&&!e.has(s.name)&&e.set(s.name,s.description)}catch{}}return e}function k1(t,e){let n=Mce(t);for(let r of t){if(r.op==="gen_ai.execute_tool"){let o=r.data[$i];if(typeof o=="string"){let s=n.get(o);s&&(r.data[c1]=s)}}r.op==="gen_ai.invoke_agent"&&Cy(r,e)}}function Py(t){return ip.get(t)}function My(t){ip.delete(t)}function G1(t){let e=t.map(n=>{if(typeof n=="string")try{return JSON.parse(n)}catch{return n}return n});return JSON.stringify(e)}function U1(t){return t.filter(e=>!!e&&typeof e=="object"&&"role"in e&&"content"in e)}function xce(t){try{let e=JSON.parse(t);if(e&&typeof e=="object"){let{messages:n}=e,{prompt:r,system:o}=e,s=[];if(typeof o=="string"&&s.push({role:"system",content:o}),typeof n=="string")try{n=JSON.parse(n)}catch{}if(Array.isArray(n))return s.push(...U1(n)),s;if(Array.isArray(r))return s.push(...U1(r)),s;if(typeof r=="string"&&s.push({role:"user",content:r}),s.length>0)return s}}catch{}return[]}function B1(t,e){if(typeof e[pm]=="string"&&!e[Lt]&&!e[zi]){let n=e[pm],r=xce(n);if(r.length){let{systemInstructions:o,filteredMessages:s}=jn(r);o&&t.setAttribute(Bn,o);let i=Array.isArray(s)?s.length:0,a=Wi(s);t.setAttributes({[pm]:a,[Lt]:a,[un]:i})}}else if(typeof e[zi]=="string")try{let n=JSON.parse(e[zi]);if(Array.isArray(n)){let{systemInstructions:r,filteredMessages:o}=jn(n);r&&t.setAttribute(Bn,r);let s=Array.isArray(o)?o.length:0,i=Wi(o);t.setAttributes({[zi]:i,[Lt]:i,[un]:s})}}catch{}}function j1(t){switch(t){case"ai.generateText":case"ai.streamText":case"ai.generateObject":case"ai.streamObject":return sm;case"ai.generateText.doGenerate":return e1;case"ai.streamText.doStream":return t1;case"ai.generateObject.doGenerate":return n1;case"ai.streamObject.doStream":return r1;case"ai.embed.doEmbed":return o1;case"ai.embedMany.doEmbed":return s1;case"ai.rerank.doRerank":return i1;case"ai.toolCall":return a1;default:return t.startsWith("ai.stream")?"ai.run":void 0}}function vce(t){return Sy.has(t)?"invoke_agent":gy.has(t)?"generate_content":p1.has(t)?"embeddings":d1.has(t)?"rerank":t==="ai.toolCall"?"execute_tool":t}function Lce(t){let{data:e,description:n}=Y(t);if(n){if(e[Oy]&&e[by]&&n==="ai.toolCall"){Gce(t,e);return}!e[y1]&&!n.startsWith("ai.")||Bce(t,n,e)}}function Dce(t){if(t.type==="transaction"&&t.spans){let e=new Map;for(let r of t.spans)kce(r),w1(r,e);k1(t.spans,e);let n=t.contexts?.trace;n?.op==="gen_ai.invoke_agent"&&Cy(n,e)}return t}function Uce(t){if(typeof t!="string")return"stop";switch(t){case"tool-calls":return"tool_call";case"stop":case"length":case"content_filter":case"error":return t;default:return t}}function wce(t){let e=t[Iy],n=t[Ny],r=t[O1];if(e==null&&n==null)return;let o=[];if(typeof e=="string"&&e.length>0&&o.push({type:"text",content:e}),n!=null)try{let s=typeof n=="string"?JSON.parse(n):n;if(Array.isArray(s)){for(let i of s){let a=i.input??i.args;o.push({type:"tool_call",id:i.toolCallId,name:i.toolName,arguments:typeof a=="string"?a:JSON.stringify(a??{})})}delete t[Ny]}}catch{}if(o.length>0){let s={role:"assistant",parts:o,finish_reason:Uce(r)};t[QB]=JSON.stringify([s]),delete t[Iy]}}function kce(t){let{data:e,origin:n}=t;if(n==="auto.vercelai.otel"){if(t.status&&t.status!=="ok"&&(t.status="internal_error"),Dt(e,M1,Ze),Dt(e,x1,Pe),Dt(e,C1,Cs),Dt(e,"ai.usage.inputTokens",Pe),Dt(e,"ai.usage.outputTokens",Ze),Dt(e,v1,Pe),Dt(e,"ai.response.avgOutputTokensPerSecond","ai.response.avgCompletionTokensPerSecond"),typeof e[Pe]=="number"&&typeof e[Cs]=="number"&&(e[Pe]=e[Pe]+e[Cs]),typeof e[Pe]=="number"){let r=typeof e[Ze]=="number"?e[Ze]:0;e[cn]=r+e[Pe]}if(e[wc]&&Array.isArray(e[wc])&&(e[wc]=G1(e[wc])),e[lm]){let r=vce(e[lm]);e[vt]=r,delete e[lm]}if(Dt(e,zi,Lt),wce(e),Dt(e,N1,"gen_ai.response.object"),Dt(e,wc,"gen_ai.request.available_tools"),Dt(e,L1,im),Dt(e,D1,am),Dt(e,I1,"gen_ai.request.schema"),Dt(e,up,He),Array.isArray(e[yy])){let r=e[yy].map(o=>{try{return JSON.parse(o)}catch{return o}});e[Lc]=r.length===1?r[0]:JSON.stringify(r)}jce(e);for(let r of Object.keys(e))r.startsWith("ai.")&&Dt(e,r,`vercel.${r}`)}}function Dt(t,e,n){t[e]!=null&&(t[n]=t[e],delete t[e])}function Gce(t,e){t.setAttribute(W,"auto.vercelai.otel"),t.setAttribute(ee,"gen_ai.execute_tool"),t.setAttribute(vt,"execute_tool"),Dt(e,Oy,$i),Dt(e,by,_y);let n=e[_y];typeof n=="string"&&ip.set(n,t.spanContext()),e[fy]||t.setAttribute(fy,"function");let r=e[$i];r&&t.updateName(`execute_tool ${r}`)}function Bce(t,e,n){t.setAttribute(W,"auto.vercelai.otel");let r=e.replace("ai.","");t.setAttribute("ai.pipeline.name",r),t.updateName(r);let o=n[P1];o&&typeof o=="string"&&t.setAttribute("gen_ai.function_id",o),B1(t,n),n[up]&&!n[_t]&&t.setAttribute(_t,n[up]),t.setAttribute("ai.streaming",e.includes("stream"));let s=j1(e);if(s&&t.setAttribute(ee,s),Sy.has(e)){o&&typeof o=="string"?t.updateName(`invoke_agent ${o}`):t.updateName("invoke_agent");return}let i=n[up];if(i){let a=gy.has(e)?"generate_content":_1[e];a&&t.updateName(`${a} ${i}`)}}function dm(t){t.on("spanStart",Lce),t.addEventProcessor(Object.assign(Dce,{id:"VercelAiEventProcessor"}))}function jce(t){let e=t[b1];if(e)try{let n=JSON.parse(e),r=n.openai??n.azure;if(r&&(Pr(t,Cs,r.cachedPromptTokens),Pr(t,"gen_ai.usage.output_tokens.reasoning",r.reasoningTokens),Pr(t,"gen_ai.usage.output_tokens.prediction_accepted",r.acceptedPredictionTokens),Pr(t,"gen_ai.usage.output_tokens.prediction_rejected",r.rejectedPredictionTokens),t["gen_ai.conversation.id"]||Pr(t,"gen_ai.conversation.id",r.responseId)),n.anthropic){let o=n.anthropic.usage?.cache_read_input_tokens??n.anthropic.cacheReadInputTokens;Pr(t,Cs,o);let s=n.anthropic.usage?.cache_creation_input_tokens??n.anthropic.cacheCreationInputTokens;Pr(t,dy,s)}n.bedrock?.usage&&(Pr(t,Cs,n.bedrock.usage.cacheReadInputTokens),Pr(t,dy,n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(Pr(t,Cs,n.deepseek.promptCacheHitTokens),Pr(t,"gen_ai.usage.input_tokens.cache_miss",n.deepseek.promptCacheMissTokens))}catch{}}function Pr(t,e,n){n!=null&&(t[e]=n)}var xs="OpenAI",H1={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},Hce=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],V1=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...Hce];function F1(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion"}function q1(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="response"}function $1(t){if(t===null||typeof t!="object"||!("object"in t))return!1;let e=t;return e.object==="list"&&typeof e.model=="string"&&e.model.toLowerCase().includes("embedding")}function Y1(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="conversation"}function W1(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.startsWith("response.")}function z1(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion.chunk"}function K1(t,e,n){if(_m(t,e.id,e.model,e.created),e.usage&&lp(t,e.usage.prompt_tokens,e.usage.completion_tokens,e.usage.total_tokens),Array.isArray(e.choices)){let r=e.choices.map(o=>o.finish_reason).filter(o=>o!==null);if(r.length>0&&t.setAttributes({[An]:JSON.stringify(r)}),n){let o=e.choices.map(s=>s.message?.tool_calls).filter(s=>Array.isArray(s)&&s.length>0).flat();o.length>0&&t.setAttributes({[It]:JSON.stringify(o)})}}}function Q1(t,e,n){if(_m(t,e.id,e.model,e.created_at),e.status&&t.setAttributes({[An]:JSON.stringify([e.status])}),e.usage&&lp(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.total_tokens),n){let r=e;if(Array.isArray(r.output)&&r.output.length>0){let o=r.output.filter(s=>typeof s=="object"&&s!==null&&s.type==="function_call");o.length>0&&t.setAttributes({[It]:JSON.stringify(o)})}}}function X1(t,e){t.setAttributes({[Ty]:e.model,[_t]:e.model}),e.usage&&lp(t,e.usage.prompt_tokens,void 0,e.usage.total_tokens)}function J1(t,e){let{id:n,created_at:r}=e;t.setAttributes({[my]:n,[nr]:n,[sp]:n}),r&&t.setAttributes({[hy]:new Date(r*1e3).toISOString()})}function lp(t,e,n,r){e!==void 0&&t.setAttributes({[l1]:e,[Pe]:e}),n!==void 0&&t.setAttributes({[u1]:n,[Ze]:n}),r!==void 0&&t.setAttributes({[cn]:r})}function _m(t,e,n,r){t.setAttributes({[my]:e,[nr]:e}),t.setAttributes({[Ty]:n,[_t]:n}),t.setAttributes({[hy]:new Date(r*1e3).toISOString()})}function Vce(t){if("conversation"in t&&typeof t.conversation=="string")return t.conversation;if("previous_response_id"in t&&typeof t.previous_response_id=="string")return t.previous_response_id}function Z1(t){let e={[He]:t.model??"unknown"};"temperature"in t&&(e[Ns]=t.temperature),"top_p"in t&&(e[bs]=t.top_p),"frequency_penalty"in t&&(e[Os]=t.frequency_penalty),"presence_penalty"in t&&(e[vc]=t.presence_penalty),"stream"in t&&(e[Mc]=t.stream),"encoding_format"in t&&(e[WB]=t.encoding_format),"dimensions"in t&&(e[zB]=t.dimensions);let n=Vce(t);return n&&(e[sp]=n),e}function Fce(t,e){for(let n of t){let r=n.index;if(!(r===void 0||!n.function))if(!(r in e.chatCompletionToolCalls))e.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{let o=e.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function qce(t,e,n){e.responseId=t.id??e.responseId,e.responseModel=t.model??e.responseModel,e.responseTimestamp=t.created??e.responseTimestamp,t.usage&&(e.promptTokens=t.usage.prompt_tokens,e.completionTokens=t.usage.completion_tokens,e.totalTokens=t.usage.total_tokens);for(let r of t.choices??[])n&&(r.delta?.content&&e.responseTexts.push(r.delta.content),r.delta?.tool_calls&&Fce(r.delta.tool_calls,e)),r.finish_reason&&e.finishReasons.push(r.finish_reason)}function $ce(t,e,n,r){if(!(t&&typeof t=="object")){e.eventTypes.push("unknown:non-object");return}if(t instanceof Error){r.setStatus({code:2,message:"internal_error"}),te(t,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in t))return;let o=t;if(!V1.includes(o.type)){e.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&e.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){e.responseTexts.push(o.delta);return}if("response"in o){let{response:s}=o;e.responseId=s.id??e.responseId,e.responseModel=s.model??e.responseModel,e.responseTimestamp=s.created_at??e.responseTimestamp,s.usage&&(e.promptTokens=s.usage.input_tokens,e.completionTokens=s.usage.output_tokens,e.totalTokens=s.usage.total_tokens),s.status&&e.finishReasons.push(s.status),n&&s.output_text&&e.responseTexts.push(s.output_text)}}async function*ej(t,e,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",responseTimestamp:0,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let o of t)z1(o)?qce(o,r,n):W1(o)&&$ce(o,r,n,e),yield o}finally{_m(e,r.responseId,r.responseModel,r.responseTimestamp),lp(e,r.promptTokens,r.completionTokens,r.totalTokens),e.setAttributes({[qi]:!0}),r.finishReasons.length&&e.setAttributes({[An]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length&&e.setAttributes({[rt]:r.responseTexts.join("")});let s=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];s.length>0&&e.setAttributes({[It]:JSON.stringify(s)}),e.end()}}function Yce(t){let e=Array.isArray(t.tools)?t.tools:[],r=t.web_search_options&&typeof t.web_search_options=="object"?[{type:"web_search_options",...t.web_search_options}]:[],o=[...e,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(s){C&&g.error("Failed to serialize OpenAI tools:",s);return}}function Wce(t,e){let n={[Is]:"openai",[vt]:e,[W]:"auto.ai.openai"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0],o=Yce(r);o&&(n[Qr]=o),Object.assign(n,Z1(r))}else n[He]="unknown";return n}function zce(t,e,n){if(!e||typeof e!="object")return;let r=e;if(F1(r)){if(K1(t,r,n),n&&r.choices?.length){let o=r.choices.map(s=>s.message?.content||"");t.setAttributes({[rt]:JSON.stringify(o)})}}else q1(r)?(Q1(t,r,n),n&&r.output_text&&t.setAttributes({[rt]:r.output_text})):$1(r)?X1(t,r):Y1(r)&&J1(t,r)}function tj(t,e,n){if(n==="embeddings"&&"input"in e){let a=e.input;if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;t.setAttribute(Lc,typeof a=="string"?a:JSON.stringify(a));return}let r="input"in e?e.input:"messages"in e?e.messages:void 0;if(!r||Array.isArray(r)&&r.length===0)return;let{systemInstructions:o,filteredMessages:s}=jn(r);o&&t.setAttribute(Bn,o);let i=Wi(s);t.setAttribute(Lt,i),Array.isArray(s)?t.setAttribute(un,s.length):t.setAttribute(un,1)}function Kce(t,e,n,r,o){return function(...i){let a=n.operation,c=Wce(i,a),l=c[He]||"unknown",p=i[0],d=p&&typeof p=="object"&&p.stream===!0,_={name:`${a} ${l}`,op:`gen_ai.${a}`,attributes:c};if(d){let T,h=yt(_,S=>(T=t.apply(r,i),o.recordInputs&&p&&tj(S,p,a),(async()=>{try{let R=await T;return ej(R,S,o.recordOutputs??!1)}catch(R){throw S.setStatus({code:2,message:"internal_error"}),te(R,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:e}}}),S.end(),R}})()));return Uc(T,h,"auto.ai.openai")}let f,m=Cr(_,T=>(f=t.apply(r,i),o.recordInputs&&p&&tj(T,p,a),f.then(h=>(zce(T,h,o.recordOutputs),h),h=>{throw te(h,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:e}}}),h})));return Uc(f,m,"auto.ai.openai")}}function nj(t,e="",n){return new Proxy(t,{get(r,o){let s=r[o],i=Dc(e,String(o)),a=H1[i];return typeof s=="function"&&a?Kce(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?nj(s,i,n):s}})}function fm(t,e){return nj(t,"",Xr(e))}var vs="Anthropic_AI",rj={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function oj(t,e){if(Array.isArray(e)&&e.length===0)return;let{systemInstructions:n,filteredMessages:r}=jn(e);n&&t.setAttributes({[Bn]:n});let o=Array.isArray(r)?r.length:1;t.setAttributes({[Lt]:Wi(r),[un]:o})}var Qce={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function xy(t){return t&&Qce[t]||"internal_error"}function sj(t,e){e.error&&(t.setStatus({code:2,message:xy(e.error.type)}),te(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function ij(t){let{system:e,messages:n,input:r}=t,o=typeof e=="string"?[{role:"system",content:t.system}]:[],s=Array.isArray(r)?r:r!=null?[r]:void 0,i=Array.isArray(n)?n:n!=null?[n]:[],a=s??i;return[...o,...a]}function Xce(t,e){return"type"in t&&typeof t.type=="string"&&t.type==="error"?(e.setStatus({code:2,message:xy(t.error?.type)}),te(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function Jce(t,e){if(t.type==="message_delta"&&t.usage&&"output_tokens"in t.usage&&typeof t.usage.output_tokens=="number"&&(e.completionTokens=t.usage.output_tokens),t.message){let n=t.message;n.id&&(e.responseId=n.id),n.model&&(e.responseModel=n.model),n.stop_reason&&e.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(e.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(e.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(e.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function Zce(t,e){t.type!=="content_block_start"||typeof t.index!="number"||!t.content_block||(t.content_block.type==="tool_use"||t.content_block.type==="server_tool_use")&&(e.activeToolBlocks[t.index]={id:t.content_block.id,name:t.content_block.name,inputJsonParts:[]})}function eue(t,e,n){if(!(t.type!=="content_block_delta"||!t.delta)){if(typeof t.index=="number"&&"partial_json"in t.delta&&typeof t.delta.partial_json=="string"){let r=e.activeToolBlocks[t.index];r&&r.inputJsonParts.push(t.delta.partial_json)}n&&typeof t.delta.text=="string"&&e.responseTexts.push(t.delta.text)}}function tue(t,e){if(t.type!=="content_block_stop"||typeof t.index!="number")return;let n=e.activeToolBlocks[t.index];if(!n)return;let r=n.inputJsonParts.join(""),o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}e.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete e.activeToolBlocks[t.index]}function aj(t,e,n,r){!(t&&typeof t=="object")||Xce(t,r)||(Jce(t,e),Zce(t,e),eue(t,e,n),tue(t,e))}function nue(t,e,n){e.isRecording()&&(t.responseId&&e.setAttributes({[nr]:t.responseId}),t.responseModel&&e.setAttributes({[_t]:t.responseModel}),cp(e,t.promptTokens,t.completionTokens,t.cacheCreationInputTokens,t.cacheReadInputTokens),e.setAttributes({[qi]:!0}),t.finishReasons.length>0&&e.setAttributes({[An]:JSON.stringify(t.finishReasons)}),n&&t.responseTexts.length>0&&e.setAttributes({[rt]:t.responseTexts.join("")}),n&&t.toolCalls.length>0&&e.setAttributes({[It]:JSON.stringify(t.toolCalls)}),e.end())}async function*cj(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let o of t)aj(o,r,n,e),yield o}finally{r.responseId&&e.setAttributes({[nr]:r.responseId}),r.responseModel&&e.setAttributes({[_t]:r.responseModel}),cp(e,r.promptTokens,r.completionTokens,r.cacheCreationInputTokens,r.cacheReadInputTokens),e.setAttributes({[qi]:!0}),r.finishReasons.length>0&&e.setAttributes({[An]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length>0&&e.setAttributes({[rt]:r.responseTexts.join("")}),n&&r.toolCalls.length>0&&e.setAttributes({[It]:JSON.stringify(r.toolCalls)}),e.end()}}function uj(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return t.on("streamEvent",o=>{aj(o,r,n,e)}),t.on("message",()=>{nue(r,e,n)}),t.on("error",o=>{te(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end())}),t}function rue(t,e,n){let r={[Is]:"anthropic",[vt]:n,[W]:"auto.ai.anthropic"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let o=t[0];o.tools&&Array.isArray(o.tools)&&(r[Qr]=JSON.stringify(o.tools)),r[He]=o.model??"unknown","temperature"in o&&(r[Ns]=o.temperature),"top_p"in o&&(r[bs]=o.top_p),"stream"in o&&(r[Mc]=o.stream),"top_k"in o&&(r[om]=o.top_k),"frequency_penalty"in o&&(r[Os]=o.frequency_penalty),"max_tokens"in o&&(r[xc]=o.max_tokens)}else e==="models.retrieve"||e==="models.get"?r[He]=t[0]:r[He]="unknown";return r}function vy(t,e){let n=ij(e);oj(t,n),"prompt"in e&&t.setAttributes({[YB]:JSON.stringify(e.prompt)})}function oue(t,e){if("content"in e&&Array.isArray(e.content)){t.setAttributes({[rt]:e.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of e.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&t.setAttributes({[It]:JSON.stringify(n)})}"completion"in e&&t.setAttributes({[rt]:e.completion}),"input_tokens"in e&&t.setAttributes({[rt]:JSON.stringify(e.input_tokens)})}function sue(t,e){"id"in e&&"model"in e&&(t.setAttributes({[nr]:e.id,[_t]:e.model}),"created"in e&&typeof e.created=="number"&&t.setAttributes({[Ey]:new Date(e.created*1e3).toISOString()}),"created_at"in e&&typeof e.created_at=="number"&&t.setAttributes({[Ey]:new Date(e.created_at*1e3).toISOString()}),"usage"in e&&e.usage&&cp(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.cache_creation_input_tokens,e.usage.cache_read_input_tokens))}function iue(t,e,n){if(!(!e||typeof e!="object")){if("type"in e&&e.type==="error"){sj(t,e);return}n&&oue(t,e),sue(t,e)}}function lj(t,e,n){throw te(t,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end()),t}function aue(t,e,n,r,o,s,i,a,c,l,p){let d=o[He]??"unknown",_={name:`${s} ${d}`,op:`gen_ai.${s}`,attributes:o};if(l&&!p){let f,m=yt(_,T=>(f=t.apply(n,r),c.recordInputs&&a&&vy(T,a),(async()=>{try{let h=await f;return cj(h,T,c.recordOutputs??!1)}catch(h){return lj(h,T,i)}})()));return Uc(f,m,"auto.ai.anthropic")}else return yt(_,f=>{try{c.recordInputs&&a&&vy(f,a);let m=e.apply(n,r);return uj(m,f,c.recordOutputs??!1)}catch(m){return lj(m,f,i)}})}function cue(t,e,n,r,o){return new Proxy(t,{apply(s,i,a){let c=n.operation,l=rue(a,e,c),p=l[He]??"unknown",d=typeof a[0]=="object"?a[0]:void 0,_=!!d?.stream,f=n.streaming===!0;if(_||f)return aue(t,s,r,a,l,c,e,d,o,_,f);let m,T=Cr({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:l},h=>(m=s.apply(r,a),o.recordInputs&&d&&vy(h,d),m.then(S=>(iue(h,S,o.recordOutputs),S),S=>{throw te(S,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:e}}}),S})));return Uc(m,T,"auto.ai.anthropic")}})}function pj(t,e="",n){return new Proxy(t,{get(r,o){let s=r[o],i=Dc(e,String(o)),a=rj[i];return typeof s=="function"&&a?cue(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?pj(s,i,n):s}})}function mm(t,e){return pj(t,"",Xr(e))}var Ls="Google_GenAI",dj={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{operation:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},_j="google_genai",Ly="chats.create",fj="chat";function uue(t,e){let n=t?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return e.setStatus({code:2,message:"internal_error"}),te(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function lue(t,e){typeof t.responseId=="string"&&(e.responseId=t.responseId),typeof t.modelVersion=="string"&&(e.responseModel=t.modelVersion);let n=t.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(e.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(e.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(e.totalTokens=n.totalTokenCount))}function pue(t,e,n){Array.isArray(t.functionCalls)&&e.toolCalls.push(...t.functionCalls);for(let r of t.candidates??[]){r?.finishReason&&!e.finishReasons.includes(r.finishReason)&&e.finishReasons.push(r.finishReason);for(let o of r?.content?.parts??[])n&&o.text&&e.responseTexts.push(o.text),o.functionCall&&e.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function due(t,e,n,r){!t||uue(t,r)||(lue(t,e),pue(t,e,n))}async function*mj(t,e,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of t)due(o,r,n,e),yield o}finally{let o={[qi]:!0};r.responseId&&(o[nr]=r.responseId),r.responseModel&&(o[_t]=r.responseModel),r.promptTokens!==void 0&&(o[Pe]=r.promptTokens),r.completionTokens!==void 0&&(o[Ze]=r.completionTokens),r.totalTokens!==void 0&&(o[cn]=r.totalTokens),r.finishReasons.length&&(o[An]=JSON.stringify(r.finishReasons)),n&&r.responseTexts.length&&(o[rt]=r.responseTexts.join("")),n&&r.toolCalls.length&&(o[It]=JSON.stringify(r.toolCalls)),e.setAttributes(o),e.end()}}function kc(t,e="user"){return typeof t=="string"?[{role:e,content:t}]:Array.isArray(t)?t.flatMap(n=>kc(n,e)):typeof t!="object"||!t?[]:"role"in t&&typeof t.role=="string"?[t]:"parts"in t?[{...t,role:e}]:[{role:e,content:t}]}function Tj(t,e){if("model"in t&&typeof t.model=="string")return t.model;if(e&&typeof e=="object"){let n=e;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function _ue(t){let e={};return"temperature"in t&&typeof t.temperature=="number"&&(e[Ns]=t.temperature),"topP"in t&&typeof t.topP=="number"&&(e[bs]=t.topP),"topK"in t&&typeof t.topK=="number"&&(e[om]=t.topK),"maxOutputTokens"in t&&typeof t.maxOutputTokens=="number"&&(e[xc]=t.maxOutputTokens),"frequencyPenalty"in t&&typeof t.frequencyPenalty=="number"&&(e[Os]=t.frequencyPenalty),"presencePenalty"in t&&typeof t.presencePenalty=="number"&&(e[vc]=t.presencePenalty),e}function fue(t,e,n){let r={[Is]:_j,[vt]:t,[W]:"auto.ai.google_genai"};if(e){if(r[He]=Tj(e,n),"config"in e&&typeof e.config=="object"&&e.config){let o=e.config;if(Object.assign(r,_ue(o)),"tools"in o&&Array.isArray(o.tools)){let s=o.tools.flatMap(i=>i.functionDeclarations);r[Qr]=JSON.stringify(s)}}}else r[He]=Tj({},n);return r}function hj(t,e,n){if(n){let o=e.contents;o!=null&&t.setAttribute(Lc,typeof o=="string"?o:JSON.stringify(o));return}let r=[];if("config"in e&&e.config&&typeof e.config=="object"&&"systemInstruction"in e.config&&e.config.systemInstruction&&r.push(...kc(e.config.systemInstruction,"system")),"history"in e&&r.push(...kc(e.history,"user")),"contents"in e&&r.push(...kc(e.contents,"user")),"message"in e&&r.push(...kc(e.message,"user")),Array.isArray(r)&&r.length){let{systemInstructions:o,filteredMessages:s}=jn(r);o&&t.setAttribute(Bn,o);let i=Array.isArray(s)?s.length:0;t.setAttributes({[un]:i,[Lt]:JSON.stringify(Ms(s))})}}function mue(t,e,n){if(!(!e||typeof e!="object")){if(e.modelVersion&&t.setAttribute(_t,e.modelVersion),e.usageMetadata&&typeof e.usageMetadata=="object"){let r=e.usageMetadata;typeof r.promptTokenCount=="number"&&t.setAttributes({[Pe]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&t.setAttributes({[Ze]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&t.setAttributes({[cn]:r.totalTokenCount})}if(n&&Array.isArray(e.candidates)&&e.candidates.length>0){let r=e.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(s=>typeof s.text=="string"?s.text:"").filter(s=>s.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&t.setAttributes({[rt]:r.join("")})}if(n&&e.functionCalls){let r=e.functionCalls;Array.isArray(r)&&r.length>0&&t.setAttributes({[It]:JSON.stringify(r)})}}}function Ej(t,e,n,r,o){let s=e===Ly,i=n.operation==="embeddings";return new Proxy(t,{apply(a,c,l){let p=n.operation,d=l[0],_=fue(p,d,r),f=_[He]??"unknown";return n.streaming?yt({name:`${p} ${f}`,op:`gen_ai.${p}`,attributes:_},async m=>{try{o.recordInputs&&d&&hj(m,d,i);let T=await a.apply(r,l);return mj(T,m,!!o.recordOutputs)}catch(T){throw m.setStatus({code:2,message:"internal_error"}),te(T,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}}),m.end(),T}}):Cr({name:s?`${p} ${f} create`:`${p} ${f}`,op:`gen_ai.${p}`,attributes:_},m=>(o.recordInputs&&d&&hj(m,d,i),br(()=>a.apply(r,l),T=>{te(T,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}})},()=>{},T=>{!s&&!i&&mue(m,T,o.recordOutputs)})))}})}function Dy(t,e="",n){return new Proxy(t,{get:(r,o,s)=>{let i=Reflect.get(r,o,s),a=Dc(e,String(o)),c=dj[a];if(typeof i=="function"&&c){if(a===Ly){let l=Ej(i,a,c,r,n);return function(...d){let _=l(...d);return _&&typeof _=="object"?Dy(_,fj,n):_}}return Ej(i,a,c,r,n)}return typeof i=="function"?i.bind(r):i&&typeof i=="object"?Dy(i,a,n):i}})}function Tm(t,e){return Dy(t,"",Xr(e))}var hm="LangChain",Ki="auto.ai.langchain",Sj={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var rr=(t,e,n)=>{n!=null&&(t[e]=n)},Hn=(t,e,n)=>{let r=Number(n);Number.isNaN(r)||(t[e]=r)};function Uo(t){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function Gc(t){if(Array.isArray(t))try{let e=t.map(n=>n&&typeof n=="object"&&Ps(n)?Yi(n):n);return JSON.stringify(e)}catch{return String(t)}return Uo(t)}function pp(t){let e=t.toLowerCase();return Sj[e]??e}function gj(t){return t.includes("System")?"system":t.includes("Human")?"user":t.includes("AI")||t.includes("Assistant")?"assistant":t.includes("Function")?"function":t.includes("Tool")?"tool":"user"}function Uy(t){if(!(!t||Array.isArray(t)))return t.invocation_params}function dp(t){return t.map(e=>{let n=e._getType;if(typeof n=="function"){let o=n.call(e);return{role:pp(o),content:Gc(e.content)}}if(e.lc===1&&e.kwargs){let o=e.id,s=Array.isArray(o)&&o.length>0?o[o.length-1]:"",i=typeof s=="string"?gj(s):"user";return{role:pp(i),content:Gc(e.kwargs?.content)}}if(e.type){let o=String(e.type).toLowerCase();return{role:pp(o),content:Gc(e.content)}}if(e.role)return{role:pp(String(e.role)),content:Gc(e.content)};let r=e.constructor?.name;return r&&r!=="Object"?{role:pp(gj(r)),content:Gc(e.content)}:{role:"user",content:Gc(e.content)}})}function Tue(t,e,n){let r={},o="kwargs"in t?t.kwargs:void 0,s=e?.temperature??n?.ls_temperature??o?.temperature;Hn(r,Ns,s);let i=e?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Hn(r,xc,i);let a=e?.top_p??o?.top_p;Hn(r,bs,a);let c=e?.frequency_penalty;Hn(r,Os,c);let l=e?.presence_penalty;return Hn(r,vc,l),e&&"stream"in e&&rr(r,Mc,!!e.stream),r}function Aj(t,e,n,r,o){return{[Is]:Uo(t??"langchain"),[vt]:"chat",[He]:Uo(e),[W]:Ki,...Tue(n,r,o)}}function Rj(t,e,n,r,o){let s=o?.ls_provider,i=r?.model??o?.ls_model_name??"unknown",a=Aj(s,i,t,r,o);if(n&&Array.isArray(e)&&e.length>0){rr(a,un,e.length);let c=e.map(l=>({role:"user",content:l}));rr(a,Lt,Uo(c))}return a}function yj(t,e,n,r,o){let s=o?.ls_provider??t.id?.[2],i=r?.model??o?.ls_model_name??"unknown",a=Aj(s,i,t,r,o);if(n&&Array.isArray(e)&&e.length>0){let c=dp(e.flat()),{systemInstructions:l,filteredMessages:p}=jn(c);l&&rr(a,Bn,l);let d=Array.isArray(p)?p.length:0;rr(a,un,d);let _=Ms(p);rr(a,Lt,Uo(_))}return a}function hue(t,e){let n=[],r=t.flat();for(let o of r){let s=o.message?.content;if(Array.isArray(s))for(let i of s){let a=i;a.type==="tool_use"&&n.push(a)}}n.length>0&&rr(e,It,Uo(n))}function Eue(t,e){if(!t)return;let n=t.tokenUsage,r=t.usage;if(n)Hn(e,Pe,n.promptTokens),Hn(e,Ze,n.completionTokens),Hn(e,cn,n.totalTokens);else if(r){Hn(e,Pe,r.input_tokens),Hn(e,Ze,r.output_tokens);let o=Number(r.input_tokens),s=Number(r.output_tokens),i=(Number.isNaN(o)?0:o)+(Number.isNaN(s)?0:s);i>0&&Hn(e,cn,i),r.cache_creation_input_tokens!==void 0&&Hn(e,JB,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Hn(e,ZB,r.cache_read_input_tokens)}}function Ij(t,e){if(!t)return;let n={};if(Array.isArray(t.generations)){let l=t.generations.flat().map(p=>p.generationInfo?.finish_reason?p.generationInfo.finish_reason:p.generation_info?.finish_reason?p.generation_info.finish_reason:null).filter(p=>typeof p=="string");if(l.length>0&&rr(n,An,Uo(l)),hue(t.generations,n),e){let p=t.generations.flat().map(d=>d.text??d.message?.content).filter(d=>typeof d=="string");p.length>0&&rr(n,rt,Uo(p))}}Eue(t.llmOutput,n);let r=t.llmOutput,s=t.generations?.[0]?.[0]?.message,i=r?.model_name??r?.model??s?.response_metadata?.model_name;i&&rr(n,_t,i);let a=r?.id??s?.id;a&&rr(n,nr,a);let c=r?.stop_reason??s?.response_metadata?.finish_reason;return c&&rr(n,KB,Uo(c)),n}function Em(t={}){let{recordInputs:e,recordOutputs:n}=Xr(t),r=new Map,o=i=>{let a=r.get(i);a?.isRecording()&&(a.end(),r.delete(i))},s={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(i,a,c,l,p,d,_,f){let m=Uy(d),T=Rj(i,a,e,m,_),h=T[He],S=T[vt];yt({name:`${S} ${h}`,op:"gen_ai.chat",attributes:{...T,[ee]:"gen_ai.chat"}},R=>(r.set(c,R),R))},handleChatModelStart(i,a,c,l,p,d,_,f){let m=Uy(d),T=yj(i,a,e,m,_),h=T[He],S=T[vt];yt({name:`${S} ${h}`,op:"gen_ai.chat",attributes:{...T,[ee]:"gen_ai.chat"}},R=>(r.set(c,R),R))},handleLLMEnd(i,a,c,l,p){let d=r.get(a);if(d?.isRecording()){let _=Ij(i,n);_&&d.setAttributes(_),o(a)}},handleLLMError(i,a){let c=r.get(a);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),o(a)),te(i,{mechanism:{handled:!1,type:`${Ki}.llm_error_handler`}})},handleChainStart(i,a,c,l,p,d,_,f){let m=f||i.name||"unknown_chain",T={[W]:"auto.ai.langchain","langchain.chain.name":m};e&&(T["langchain.chain.inputs"]=JSON.stringify(a)),yt({name:`chain ${m}`,op:"gen_ai.invoke_agent",attributes:{...T,[ee]:"gen_ai.invoke_agent"}},h=>(r.set(c,h),h))},handleChainEnd(i,a){let c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({"langchain.chain.outputs":JSON.stringify(i)}),o(a))},handleChainError(i,a){let c=r.get(a);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),o(a)),te(i,{mechanism:{handled:!1,type:`${Ki}.chain_error_handler`}})},handleToolStart(i,a,c,l){let p=i.name||"unknown_tool",d={[W]:Ki,[$i]:p};e&&(d[im]=a),yt({name:`execute_tool ${p}`,op:"gen_ai.execute_tool",attributes:{...d,[ee]:"gen_ai.execute_tool"}},_=>(r.set(c,_),_))},handleToolEnd(i,a){let c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({[am]:JSON.stringify(i)}),o(a))},handleToolError(i,a){let c=r.get(a);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),o(a)),te(i,{mechanism:{handled:!1,type:`${Ki}.tool_error_handler`}})},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}var Sm="LangGraph",wy="auto.ai.langgraph";function Sue(t){if(!t||t.length===0)return null;let e=[];for(let n of t)if(n&&typeof n=="object"){let r=n.tool_calls;r&&Array.isArray(r)&&e.push(...r)}return e.length>0?e:null}function gue(t){let e=t,n=0,r=0,o=0;if(e.usage_metadata&&typeof e.usage_metadata=="object"){let s=e.usage_metadata;return typeof s.input_tokens=="number"&&(n=s.input_tokens),typeof s.output_tokens=="number"&&(r=s.output_tokens),typeof s.total_tokens=="number"&&(o=s.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(e.response_metadata&&typeof e.response_metadata=="object"){let s=e.response_metadata;if(s.tokenUsage&&typeof s.tokenUsage=="object"){let i=s.tokenUsage;typeof i.promptTokens=="number"&&(n=i.promptTokens),typeof i.completionTokens=="number"&&(r=i.completionTokens),typeof i.totalTokens=="number"&&(o=i.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function Aue(t,e){let n=e;if(n.response_metadata&&typeof n.response_metadata=="object"){let r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&t.setAttribute(_t,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&t.setAttribute(An,[r.finish_reason])}}function Nj(t){if(!t.builder?.nodes?.tools?.runnable?.tools)return null;let e=t.builder?.nodes?.tools?.runnable?.tools;return!e||!Array.isArray(e)||e.length===0?null:e.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function Oj(t,e,n){let o=n?.messages;if(!o||!Array.isArray(o))return;let s=e?.length??0,i=o.length>s?o.slice(s):[];if(i.length===0)return;let a=Sue(i);a&&t.setAttribute(It,JSON.stringify(a));let c=dp(i);t.setAttribute(rt,JSON.stringify(c));let l=0,p=0,d=0;for(let _ of i){let f=gue(_);l+=f.inputTokens,p+=f.outputTokens,d+=f.totalTokens,Aue(t,_)}l>0&&t.setAttribute(Pe,l),p>0&&t.setAttribute(Ze,p),d>0&&t.setAttribute(cn,d)}function ky(t,e){return new Proxy(t,{apply(n,r,o){return Cr({op:"gen_ai.create_agent",name:"create_agent",attributes:{[W]:wy,[ee]:"gen_ai.create_agent",[vt]:"create_agent"}},s=>{try{let i=Reflect.apply(n,r,o),a=o.length>0?o[0]:{};a?.name&&typeof a.name=="string"&&(s.setAttribute(py,a.name),s.updateName(`create_agent ${a.name}`));let c=i.invoke;return c&&typeof c=="function"&&(i.invoke=Rue(c.bind(i),i,a,e)),i}catch(i){throw s.setStatus({code:2,message:"internal_error"}),te(i,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),i}})}})}function Rue(t,e,n,r){return new Proxy(t,{apply(o,s,i){return Cr({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[W]:wy,[ee]:sm,[vt]:"invoke_agent"}},async a=>{try{let c=n?.name;c&&typeof c=="string"&&(a.setAttribute(XB,c),a.setAttribute(py,c),a.updateName(`invoke_agent ${c}`));let d=(i.length>1?i[1]:void 0)?.configurable?.thread_id;d&&typeof d=="string"&&a.setAttribute(sp,d);let _=Nj(e);_&&a.setAttribute(Qr,JSON.stringify(_));let f=r.recordInputs,m=r.recordOutputs,T=i.length>0?i[0]?.messages??[]:[];if(T&&f){let S=dp(T),{systemInstructions:R,filteredMessages:I}=jn(S);R&&a.setAttribute(Bn,R);let x=Ms(I),V=Array.isArray(I)?I.length:0;a.setAttributes({[Lt]:JSON.stringify(x),[un]:V})}let h=await Reflect.apply(o,s,i);return m&&Oj(a,T??null,h),h}catch(c){throw a.setStatus({code:2,message:"internal_error"}),te(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}})}function gm(t,e){return t.compile=ky(t.compile,Xr(e)),t}function _p(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}function fp(t,e,n){let r=t[e];if(typeof r=="function"){try{t[e]=n}catch{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=n}catch{Object.defineProperty(t,"default",{value:n,writable:!0,configurable:!0,enumerable:!0})}}}function Cj(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function Pj(t){let e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(r);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(n);if(i){let a,c,l,p,d;if(i[1]){l=i[1];let T=l.lastIndexOf(".");if(l[T-1]==="."&&T--,T>0){a=l.slice(0,T),c=l.slice(T+1);let h=a.indexOf(".Module");h>0&&(l=l.slice(h+1),a=a.slice(0,h))}p=void 0}c&&(p=a,d=c),c==="<anonymous>"&&(d=void 0,l=void 0),l===void 0&&(d=d||Tf,l=p?`${p}.${d}`:d);let _=Wk(i[2]),f=i[5]==="native";!_&&i[5]&&!f&&(_=i[5]);let m=_?yue(_):void 0;return{filename:m??_,module:m&&t?.(m),function:l,lineno:bj(i[3]),colno:bj(i[4]),in_app:Cj(_||"",f)}}if(o.match(e))return{filename:o}}}function Gy(t){return[90,Pj(t)]}function bj(t){return parseInt(t||"",10)||void 0}function yue(t){try{return decodeURI(t)}catch{return}}var Rn=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let n=this._cache.get(e);if(n!==void 0)return this._cache.delete(e),this._cache.set(e,n),n}set(e,n){if(this._cache.size>=this._maxSize){let r=this._cache.keys().next().value;this._cache.delete(r)}this._cache.set(e,n)}remove(e){let n=this._cache.get(e);return n&&this._cache.delete(e),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(n=>e.push(n)),e}};var By=K(ne(),1),mp={};function w(t,e,n){return n?Yue(t,e,n):$ue(t,e)}function $ue(t,e){return Object.assign(n=>{let r=mp[t];if(r)return n&&r.setConfig(n),r;let o=e(n);return mp[t]=o,(0,By.registerInstrumentations)({instrumentations:[o]}),o},{id:t})}function Yue(t,e,n){return Object.assign(r=>{let o=n(r),s=mp[t];if(s)return s.setConfig(o),s;let i=new e(o);return mp[t]=i,(0,By.registerInstrumentations)({instrumentations:[i]}),i},{id:t})}function Tp(t){let e=!1,n=[];if(!Wue(t))e=!0;else{let o=t._wrap;t._wrap=(...s)=>(e=!0,n.forEach(i=>i()),n=[],o(...s))}return o=>{e?o():n.push(o)}}function Wue(t){return typeof t._wrap=="function"}b();import{subscribe as zue}from"node:diagnostics_channel";var re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Am="@sentry/instrumentation-http";function Mj(t,e,n,r){let o=0,s=[];re&&g.log(r,"Patching request.on");let i=new WeakMap,a=n==="small"?1e3:n==="medium"?1e4:1048576;try{t.on=new Proxy(t.on,{apply:(c,l,p)=>{let[d,_,...f]=p;if(d==="data"){re&&g.log(r,`Handling request.on("data") with maximum body size of ${a}b`);let m=new Proxy(_,{apply:(T,h,S)=>{try{let R=S[0],I=Buffer.from(R);o<a?(s.push(I),o+=I.byteLength):re&&g.log(r,`Dropping request body chunk because maximum body length of ${a}b is exceeded.`)}catch{re&&g.error(r,"Encountered error while storing body chunk.")}return Reflect.apply(T,h,S)}});return i.set(_,m),Reflect.apply(c,l,[d,m,...f])}return Reflect.apply(c,l,p)}}),t.off=new Proxy(t.off,{apply:(c,l,p)=>{let[,d]=p,_=i.get(d);if(_){i.delete(d);let f=p.slice();return f[1]=_,Reflect.apply(c,l,f)}return Reflect.apply(c,l,p)}}),t.on("end",()=>{try{let c=Buffer.concat(s).toString("utf-8");if(c){let p=Buffer.byteLength(c,"utf-8")>a?`${Buffer.from(c).subarray(0,a-3).toString("utf-8")}...`:c;e.setSDKProcessingMetadata({normalizedRequest:{data:p}})}}catch(c){re&&g.error(r,"Error building captured request body",c)}})}catch(c){re&&g.error(r,"Error patching request to capture body",c)}}var xj=Ln("sentry_http_server_instrumented"),Hy="Http.Server",jy=new Map,vj=new WeakSet;function Lj(t,e){nt(t,"_startSpanCallback",new WeakRef(e))}var Kue=(t={})=>{let e={sessions:t.sessions??!0,sessionFlushingDelayMS:t.sessionFlushingDelayMS??6e4,maxRequestBodySize:t.maxRequestBodySize??"medium",ignoreRequestBody:t.ignoreRequestBody};return{name:Hy,setupOnce(){zue("http.server.request.start",r=>{Que(r.server,e)})},afterAllSetup(n){re&&n.getIntegrationByName("Http")&&g.warn("It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.")}}},hp=Kue;function Que(t,{ignoreRequestBody:e,maxRequestBodySize:n,sessions:r,sessionFlushingDelayMS:o}){let s=t.emit;if(vj.has(s))return;let i=new Proxy(s,{apply(a,c,l){if(l[0]!=="request")return a.apply(c,l);let p=H();if(P.active().getValue(xj)||!p)return a.apply(c,l);re&&g.log(Hy,"Handling incoming request");let d=ue().clone(),_=l[1],f=l[2],m=op(_),T=_.ip||_.socket?.remoteAddress,h=_.url||"/";n!=="none"&&!e?.(h,_)&&Mj(_,d,n,Hy),d.setSDKProcessingMetadata({normalizedRequest:m,ipAddress:T});let S=(_.method||"GET").toUpperCase(),R=Do(h),I=`${S} ${R}`;return d.setTransactionName(I),r&&p&&Xue(p,{requestIsolationScope:d,response:f,sessionFlushingDelayMS:o??6e4}),Bl(d,()=>{let x={traceId:Wt(),sampleRand:Rt(),propagationSpanId:zt()};Te().setPropagationContext({...x}),d.setPropagationContext({...x});let V=Er.extract(P.active(),m.headers).setValue(xj,!0);return P.with(V,()=>{p.emit("httpServerRequest",_,f,m);let B=_._startSpanCallback?.deref();return B?B(()=>a.apply(c,l)):a.apply(c,l)})})}});vj.add(i),t.emit=i}function Xue(t,{requestIsolationScope:e,response:n,sessionFlushingDelayMS:r}){e.setSDKProcessingMetadata({requestSession:{status:"ok"}}),n.once("close",()=>{let o=e.getScopeData().sdkProcessingMetadata.requestSession;if(t&&o){re&&g.log(`Recorded request session with status: ${o.status}`);let s=new Date;s.setSeconds(0,0);let i=s.toISOString(),a=jy.get(t),c=a?.[i]||{exited:0,crashed:0,errored:0};if(c[{ok:"exited",crashed:"crashed",errored:"errored"}[o.status]]++,a)a[i]=c;else{re&&g.log("Opened new request session aggregate.");let l={[i]:c};jy.set(t,l);let p=()=>{clearTimeout(_),d(),jy.delete(t);let f=Object.entries(l).map(([m,T])=>({started:m,exited:T.exited,errored:T.errored,crashed:T.crashed}));t.sendSession({aggregates:f})},d=t.on("flush",()=>{re&&g.log("Sending request session aggregate due to client flush"),p()}),_=setTimeout(()=>{re&&g.log("Sending request session aggregate due to flushing schedule"),p()},r).unref()}}})}b();var wo=K(he(),1);le();import{errorMonitor as Jue}from"node:events";var Dj="Http.ServerSpans",Zue=(t={})=>{let e=t.ignoreStaticAssets??!0,n=t.ignoreIncomingRequests,r=t.ignoreStatusCodes??[[401,404],[301,303],[305,399]],{onSpanCreated:o}=t,{requestHook:s,responseHook:i,applyCustomAttributesOnSpan:a}=t.instrumentation??{};return{name:Dj,setup(c){typeof __SENTRY_TRACING__<"u"&&!__SENTRY_TRACING__||c.on("httpServerRequest",(l,p,d)=>{let _=l,f=p;Lj(_,T=>{if(nle(_,{ignoreStaticAssets:e,ignoreIncomingRequests:n}))return re&&g.log(Dj,"Skipping span creation for incoming request",_.url),T();let h=d.url||_.url||"/",S=rp(h),R=_.headers,I=R["user-agent"],x=R["x-forwarded-for"],V=_.httpVersion,B=R.host,se=B?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",ve=c.tracer,nn=h.startsWith("https")?"https":"http",Ao=d.method||_.method?.toUpperCase()||"GET",es=S?S.pathname:Do(h),Ti=`${Ao} ${es}`,ht=ve.startSpan(Ti,{kind:Oe.SERVER,attributes:{[ee]:"http.server",[W]:"auto.http.otel.http","sentry.http.prefetch":ele(_)||void 0,"http.url":h,"http.method":d.method,"http.target":S?`${S.pathname}${S.search}`:es,"http.host":B,"net.host.name":se,"http.client_ip":typeof x=="string"?x.split(",")[0]:void 0,"http.user_agent":I,"http.scheme":nn,"http.flavor":V,"net.transport":V?.toUpperCase()==="QUIC"?"ip_udp":"ip_tcp",...rle(_),...Qf(d.headers||{},c.getOptions().sendDefaultPii??!1)}});s?.(ht,_),i?.(ht,f),a?.(ht,_,f),o?.(ht,_,f);let ka={type:wo.RPCType.HTTP,span:ht};return P.with((0,wo.setRPCMetadata)(X.setSpan(P.active(),ht),ka),()=>{P.bind(P.active(),_),P.bind(P.active(),f);let Ga=!1;function Xb(Fd){if(Ga)return;Ga=!0;let Jb=ile(_,f);ht.setAttributes(Jb),ht.setStatus(Fd),ht.end();let Zb=Jb["http.route"];Zb&&ue().setTransactionName(`${_.method?.toUpperCase()||"GET"} ${Zb}`)}return f.on("close",()=>{Xb(xo(f.statusCode))}),f.on(Jue,()=>{let Fd=xo(f.statusCode);Xb(Fd.code===2?Fd:{code:2})}),T()})})})},processEvent(c){if(c.type==="transaction"){let l=c.contexts?.trace?.data?.["http.response.status_code"];if(typeof l=="number"&&ale(l,r))return re&&g.log("Dropping transaction due to status code",l),null}return c},afterAllSetup(c){re&&(c.getIntegrationByName("Http")&&g.warn("It seems that you have manually added `httpServerSpansIntergation` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`."),c.getIntegrationByName("Http.Server")||g.error("It seems that you have manually added `httpServerSpansIntergation` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration."))}}},Ep=Zue;function ele(t){return t.headers["next-router-prefetch"]==="1"}function tle(t){let e=Do(t);return!!(e.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||e.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function nle(t,{ignoreStaticAssets:e,ignoreIncomingRequests:n}){if((0,wo.isTracingSuppressed)(P.active()))return!0;let r=t.url,o=t.method?.toUpperCase();return!!(o==="OPTIONS"||o==="HEAD"||!r||e&&o==="GET"&&tle(r)||n?.(r,t))}function rle(t){let e=ole(t.headers);return e==null?{}:sle(t.headers)?{"http.request_content_length":e}:{"http.request_content_length_uncompressed":e}}function ole(t){let e=t["content-length"];if(e===void 0)return null;let n=parseInt(e,10);return isNaN(n)?null:n}function sle(t){let e=t["content-encoding"];return!!e&&e!=="identity"}function ile(t,e){let{socket:n}=t,{statusCode:r,statusMessage:o}=e,s={[Io]:r,[Ri]:r,"http.status_text":o?.toUpperCase()},i=(0,wo.getRPCMetadata)(P.active());if(n){let{localAddress:a,localPort:c,remoteAddress:l,remotePort:p}=n;s[Pg]=a,s[Mg]=c,s[Cg]=l,s["net.peer.port"]=p}if(s[Ri]=r,s["http.status_text"]=(o||"").toUpperCase(),i?.type===wo.RPCType.HTTP&&i.route!==void 0){let a=i.route;s[No]=a}return s}function ale(t,e){return e.some(n=>{if(typeof n=="number")return n===t;let[r,o]=n;return t>=r&&t<=o})}b();var Gj=K(he(),1),gp=K(ne(),1);le();import{subscribe as Vy,unsubscribe as Fy}from"node:diagnostics_channel";import{errorMonitor as kj}from"node:events";function Sp(t,e){if(!t)return e;let n=wi(t),r=wi(e);if(!r)return t;let o={},s={};for(let[c,l]of Object.entries(r))c.startsWith(zr)?o[c]=l:s[c]=l;let i=Object.keys(o).length>0,a={};if(n)for(let[c,l]of Object.entries(n))i&&c.startsWith(zr)||(a[c]=l);Object.assign(a,o);for(let[c,l]of Object.entries(s))a[c]||(a[c]=l);return Nf(a)}var Bc="@sentry/instrumentation-http";function Uj(t,e){let n=cle(t),r=e?.statusCode,o=_p(r);tr({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function Rm(t,e){let n=ym(t),{tracePropagationTargets:r,propagateTraceparent:o}=H()?.getOptions()||{},s=Fi(n,r,e)?Pc({propagateTraceparent:o}):void 0;if(!s)return;let{"sentry-trace":i,baggage:a,traceparent:c}=s;if(!t.getHeader("sentry-trace")){if(i)try{t.setHeader("sentry-trace",i),re&&g.log(Bc,"Added sentry-trace header to outgoing request")}catch(p){re&&g.error(Bc,"Failed to add sentry-trace header to outgoing request:",Yr(p)?p.message:"Unknown error")}if(c&&!t.getHeader("traceparent"))try{t.setHeader("traceparent",c),re&&g.log(Bc,"Added traceparent header to outgoing request")}catch(p){re&&g.error(Bc,"Failed to add traceparent header to outgoing request:",Yr(p)?p.message:"Unknown error")}if(a){let p=t.getHeader("baggage"),d=Sp(p,a);if(d)try{t.setHeader("baggage",d),re&&g.log(Bc,"Added baggage header to outgoing request")}catch(_){re&&g.error(Bc,"Failed to add baggage header to outgoing request:",Yr(_)?_.message:"Unknown error")}}}}function cle(t){try{let e=t.getHeader("host")||t.host,n=new URL(t.path,`${t.protocol}//${e}`),r=Rs(n.toString()),o={url:ys(r),"http.method":t.method||"GET"};return r.search&&(o["http.query"]=r.search),r.hash&&(o["http.fragment"]=r.hash),o}catch{return{}}}function wj(t){return{method:t.method,protocol:t.protocol,host:t.host,hostname:t.host,path:t.path,headers:t.getHeaders()}}function ym(t){let e=t.getHeader("host")||t.host,n=t.protocol,r=t.path;return`${n}//${e}${r}`}var Qi=class extends gp.InstrumentationBase{constructor(e={}){super(Am,pe,e),this._propagationDecisionMap=new Rn(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){let e=!1,n=a=>{let c=a;this._onOutgoingRequestFinish(c.request,c.response)},r=a=>{let c=a;this._onOutgoingRequestFinish(c.request,void 0)},o=a=>{let c=a;this._onOutgoingRequestCreated(c.request)},s=a=>(e||(e=!0,Vy("http.client.response.finish",n),Vy("http.client.request.error",r),(this.getConfig().propagateTraceInOutgoingRequests||this.getConfig().createSpansForOutgoingRequests)&&Vy("http.client.request.created",o)),a),i=()=>{Fy("http.client.response.finish",n),Fy("http.client.request.error",r),Fy("http.client.request.created",o)};return[new gp.InstrumentationNodeModuleDefinition("http",["*"],s,i),new gp.InstrumentationNodeModuleDefinition("https",["*"],s,i)]}_startSpanForOutgoingRequest(e){let n=e.once,[r,o]=ule(e),s=kf({name:r,attributes:o,onlyIfParent:!0});this.getConfig().outgoingRequestHook?.(s,e);let i=new Proxy(n,{apply(l,p,d){let[_]=d;if(_!=="response")return l.apply(p,d);let f=P.active(),m=X.setSpan(f,s);return P.with(m,()=>l.apply(p,d))}});e.once=i;let a=!1,c=l=>{a||(a=!0,s.setStatus(l),s.end())};return e.prependListener("response",l=>{e.listenerCount("response")<=1&&l.resume(),P.bind(P.active(),l);let p=lle(l);s.setAttributes(p),this.getConfig().outgoingResponseHook?.(s,l),this.getConfig().outgoingRequestApplyCustomAttributes?.(s,e,l);let d=(_=!1)=>{this._diag.debug("outgoingRequest on end()");let f=_||typeof l.statusCode!="number"||l.aborted&&!l.complete?{code:Be.ERROR}:xo(l.statusCode);c(f)};l.on("end",()=>{d()}),l.on(kj,_=>{this._diag.debug("outgoingRequest on response error()",_),d(!0)})}),e.on("close",()=>{c({code:Be.UNSET})}),e.on(kj,l=>{this._diag.debug("outgoingRequest on request error()",l),c({code:Be.ERROR})}),s}_onOutgoingRequestFinish(e,n){re&&g.log(Am,"Handling finished outgoing request");let r=this.getConfig().breadcrumbs,o=typeof r>"u"?!0:r,s=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,s),o&&!s&&Uj(e,n)}_onOutgoingRequestCreated(e){re&&g.log(Am,"Handling outgoing request created");let n=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);if(this._ignoreOutgoingRequestsMap.set(e,n),n)return;let r=this.getConfig().createSpansForOutgoingRequests&&(this.getConfig().spans??!0),o=this.getConfig().propagateTraceInOutgoingRequests;if(r){let s=this._startSpanForOutgoingRequest(e);if(o&&s.isRecording()){let i=X.setSpan(P.active(),s);P.with(i,()=>{Rm(e,this._propagationDecisionMap)})}else o&&Rm(e,this._propagationDecisionMap)}else o&&Rm(e,this._propagationDecisionMap)}_shouldIgnoreOutgoingRequest(e){if((0,Gj.isTracingSuppressed)(P.active()))return!0;let n=this.getConfig().ignoreOutgoingRequests;if(!n)return!1;let r=wj(e),o=ym(e);return n(o,r)}};function ule(t){let e=ym(t),[n,r]=ty(rp(e),"client","auto.http.otel.http",t),o=t.getHeader("user-agent");return[n,{[ee]:"http.client","otel.kind":"CLIENT",[Jg]:o,[rs]:e,"http.url":e,"http.method":t.method,"http.target":t.path||"/","net.peer.name":t.host,"http.host":t.getHeader("host"),...r}]}function lle(t){let{statusCode:e,statusMessage:n,httpVersion:r,socket:o}=t,s=r.toUpperCase()!=="QUIC"?"ip_tcp":"ip_udp",i={[Io]:e,[Yg]:r,"http.flavor":r,[Wg]:s,"net.transport":s,"http.status_text":n?.toUpperCase(),"http.status_code":e,...ple(t)};if(o){let{remoteAddress:a,remotePort:c}=o;i[qg]=a,i[$g]=c,i["net.peer.ip"]=a,i["net.peer.port"]=c}return i}function ple(t){let e=dle(t.headers);return e==null?{}:_le(t.headers)?{[vg]:e}:{[Lg]:e}}function dle(t){let e=t["content-length"];if(typeof e=="number")return e;if(typeof e!="string")return;let n=parseInt(e,10);if(!isNaN(n))return n}function _le(t){let e=t["content-encoding"];return!!e&&e!=="identity"}var Bj="Http",fle=w(`${Bj}.sentry`,t=>new Qi(t)),jj=(t={})=>{let e={sessions:t.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:t.sessionFlushingDelayMS,ignoreRequestBody:t.ignoreIncomingRequestBody,maxRequestBodySize:t.maxIncomingRequestBodySize},n={ignoreIncomingRequests:t.ignoreIncomingRequests,ignoreStaticAssets:t.ignoreStaticAssets,ignoreStatusCodes:t.dropSpansForIncomingRequestStatusCodes},r={breadcrumbs:t.breadcrumbs,propagateTraceInOutgoingRequests:t.tracePropagation??!0,ignoreOutgoingRequests:t.ignoreOutgoingRequests},o=hp(e),s=Ep(n),i=t.spans??!1,a=t.disableIncomingRequestSpans??!1,c=i&&!a;return{name:Bj,setup(l){c&&s.setup(l)},setupOnce(){o.setupOnce(),fle(r)},processEvent(l){return s.processEvent(l)}}};b();var Fj=K(he(),1),qj=K(ne(),1);import*as jc from"diagnostics_channel";var Mr=mR(process.versions.node),ko=Mr.major,Ap=Mr.minor;var qy="sentry-trace",Im="baggage",mle="traceparent";function Hj(t,e){let n=Nm(t.origin,t.path),{tracePropagationTargets:r,propagateTraceparent:o}=H()?.getOptions()||{},s=Fi(n,r,e)?Pc({propagateTraceparent:o}):void 0;if(!s)return;let{"sentry-trace":i,baggage:a,traceparent:c}=s,l=Array.isArray(t.headers)?t.headers:Tle(t.headers);if($y(l,qy),$y(l,Im),o&&$y(l,mle),!(Yy(l,qy)!==-1)){i&&l.push(qy,i),c&&Yy(l,"traceparent")===-1&&l.push("traceparent",c);let d=Yy(l,Im);if(a&&d===-1)l.push(Im,a);else if(a){let _=l[d+1],f=Sp(_,a);f&&(l[d+1]=f)}}Array.isArray(t.headers)||(t.headers=hle(l))}function Tle(t){let e=t.split(`\r
28
- `),n=[];for(let r of e)try{let o=r.indexOf(":");if(o===-1)continue;let s=r.slice(0,o).trim(),i=r.slice(o+1).trim();s&&n.push(s,i)}catch{g.warn(`Failed to convert string request header to array header: ${r}`)}return n}function hle(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],o=t[n+1];!r||o==null||e.push(`${r}: ${o}`)}return e.length?e.join(`\r
20
+ `)}`)}function np(t){if(!C)return;let{description:e="< unknown name >",op:n="< unknown op >"}=Y(t),{spanId:r}=t.spanContext(),s=je(t)===t,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${e}" with ID ${r}`;g.log(i)}function Yi(t){if(!t||t.length===0)return;let e={};return t.forEach(n=>{let r=n.attributes||{},o=r[$R],s=r[YR];typeof o=="string"&&typeof s=="number"&&(e[n.name]={value:s,unit:o})}),e}var TB=1e3,Pc=class{constructor(e={}){this._traceId=e.traceId||zt(),this._spanId=e.spanId||Kt(),this._startTime=e.startTimestamp||Ss(),this._links=e.links,this._attributes={},this.setAttributes({[W]:"manual",[ee]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?qf:Vf}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=Rn(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Ue,"custom"),this}end(e){this._endTime||(this._endTime=Rn(e),np(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ee],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:$i(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[W],profile_id:this._attributes[Oc],exclusive_time:this._attributes[Nc],measurements:Yi(this._events),is_segment:this._isStandaloneSpan&&je(this)===this||void 0,segment_id:this._isStandaloneSpan?je(this).spanContext().spanId:void 0,links:qi(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){C&&g.log("[Tracing] Adding an event to span:",e);let o=EB(n)?n:r||Ss(),s=EB(n)?{}:n||{},i={name:e,time:Rn(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=H();if(e&&e.emit("spanEnd",this),!(this._isStandaloneSpan||this===je(this)))return;if(this._isStandaloneSpan){this._sampled?Hae(hB([this],e)):(C&&g.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}let r=this._convertSpanToTransaction();r&&(br(this).scope||he()).captureEvent(r)}_convertSpanToTransaction(){if(!SB(Y(this)))return;this._name||(C&&g.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:n}=br(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let s=Yf(this).filter(p=>p!==this&&!jae(p)).map(p=>Y(p)).filter(SB),i=this._attributes[Ue];delete this._attributes[tr],s.forEach(p=>{delete p.data[tr]});let a={contexts:{trace:iB(this)},spans:s.length>TB?s.sort((p,d)=>p.start_timestamp-d.start_timestamp).slice(0,TB):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:Je(this)},request:r,...i&&{transaction_info:{source:i}}},c=Yi(this._events);return c&&Object.keys(c).length&&(C&&g.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}};function EB(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function SB(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function jae(t){return t instanceof Pc&&t.isStandaloneSpan()}function Hae(t){let e=H();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function Mr(t,e,n=()=>{},r=()=>{}){let o;try{o=t()}catch(s){throw e(s),n(),s}return Fae(o,e,n,r)}function Fae(t,e,n,r){return Lt(t)?kf(t,o=>{n(),r(o)},o=>{e(o),n()}):(n(),r(t),t)}function rp(t,e,n){if(!Xe(t))return[!1];let r,o;typeof t.tracesSampler=="function"?(o=t.tracesSampler({...e,inheritOrSampleWith:a=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):a}),r=!0):e.parentSampled!==void 0?o=e.parentSampled:typeof t.tracesSampleRate<"u"&&(o=t.tracesSampleRate,r=!0);let s=jn(o);if(s===void 0)return C&&g.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return C&&g.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];let i=n<s;return i||C&&g.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}var Qf="__SENTRY_SUPPRESS_TRACING__";function xr(t,e){let n=op();if(n.startSpan)return n.startSpan(t,e);let r=ly(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return Gn(a,()=>AB(s)(()=>{let l=he(),p=py(l,s),_=t.onlyIfParent&&!p?new Os:uy({parentSpan:p,spanArguments:r,forceTransaction:o,scope:l});return Bi(l,_),Mr(()=>e(_),()=>{let{status:f}=Y(_);_.isRecording()&&(!f||f==="ok")&&_.setStatus({code:2,message:"internal_error"})},()=>{_.end()})}))}function It(t,e){let n=op();if(n.startSpanManual)return n.startSpanManual(t,e);let r=ly(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return Gn(a,()=>AB(s)(()=>{let l=he(),p=py(l,s),_=t.onlyIfParent&&!p?new Os:uy({parentSpan:p,spanArguments:r,forceTransaction:o,scope:l});return Bi(l,_),Mr(()=>e(_,()=>_.end()),()=>{let{status:f}=Y(_);_.isRecording()&&(!f||f==="ok")&&_.setStatus({code:2,message:"internal_error"})})}))}function Xf(t){let e=op();if(e.startInactiveSpan)return e.startInactiveSpan(t);let n=ly(t),{forceTransaction:r,parentSpan:o}=t;return(t.scope?i=>Gn(t.scope,i):o!==void 0?i=>Mc(o,i):i=>i())(()=>{let i=he(),a=py(i,o);return t.onlyIfParent&&!a?new Os:uy({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}function Mc(t,e){let n=op();return n.withActiveSpan?n.withActiveSpan(t,e):Gn(r=>(Bi(r,t||void 0),e(r)))}function xc(t){let e=op();return e.suppressTracing?e.suppressTracing(t):Gn(n=>{n.setSDKProcessingMetadata({[Qf]:!0});let r=t();return n.setSDKProcessingMetadata({[Qf]:void 0}),r})}function uy({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!Xe()){let i=new Os;if(n||!t){let a={sampled:"false",sample_rate:"0",transaction:e.name,...Je(i)};Wf(i,a)}return i}let o=ue(),s;if(t&&!n)s=Vae(t,r,e),bc(t,s);else if(t){let i=Je(t),{traceId:a,spanId:c}=t.spanContext(),l=Cr(t);s=gB({traceId:a,parentSpanId:c,...e},r,l),Wf(s,i)}else{let{traceId:i,dsc:a,parentSpanId:c,sampled:l}={...o.getPropagationContext(),...r.getPropagationContext()};s=gB({traceId:i,parentSpanId:c,...e},r,l),a&&Wf(s,a)}return tp(s),zl(s,r,o),s}function ly(t){let n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){let r={...n};return r.startTimestamp=Rn(t.startTime),delete r.startTime,r}return n}function op(){let t=cn();return Or(t)}function gB(t,e,n){let r=H(),o=r?.getOptions()||{},{name:s=""}=t,i={spanAttributes:{...t.attributes},spanName:s,parentSampled:n};r?.emit("beforeSampling",i,{decision:!1});let a=i.parentSampled??n,c=i.spanAttributes,l=e.getPropagationContext(),[p,d,_]=e.getScopeData().sdkProcessingMetadata[Qf]?[!1]:rp(o,{name:s,parentSampled:a,attributes:c,parentSampleRate:jn(l.dsc?.sample_rate)},l.sampleRand),f=new Pc({...t,attributes:{[Ue]:"custom",[Nr]:d!==void 0&&_?d:void 0,...c},sampled:p});return!p&&r&&(C&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",f),f}function Vae(t,e,n){let{spanId:r,traceId:o}=t.spanContext(),s=e.getScopeData().sdkProcessingMetadata[Qf]?!1:Cr(t),i=s?new Pc({...n,parentSpanId:r,traceId:o,sampled:s}):new Os({traceId:o});bc(t,i);let a=H();return a&&(a.emit("spanStart",i),n.endTimestamp&&a.emit("spanEnd",i)),i}function py(t,e){if(e)return e;if(e===null)return;let n=ji(t);if(!n)return;let r=H();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?je(n):n}function AB(t){return t!==void 0?e=>Mc(t,e):e=>e()}var dy=0,RB=1,yB=2;function wo(t){return new Jf(e=>{e(t)})}function vc(t){return new Jf((e,n)=>{n(t)})}var Jf=class t{constructor(e){this._state=dy,this._handlers=[],this._runExecutor(e)}then(e,n){return new t((r,o)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,e&&e()},i=>{s=!0,o=i,e&&e()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===dy)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===RB&&n[1](this._value),this._state===yB&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(s,i)=>{if(this._state===dy){if(Lt(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(RB,s)},o=s=>{n(yB,s)};try{e(r,o)}catch(s){o(s)}}};function IB(t,e,n,r=0){try{let o=_y(e,n,t,r);return Lt(o)?o:wo(o)}catch(o){return vc(o)}}function _y(t,e,n,r){let o=n[r];if(!t||!o)return t;let s=o({...t},e);return C&&s===null&&g.log(`Event processor "${o.id||"?"}" dropped event`),Lt(s)?s.then(i=>_y(i,e,n,r+1)):_y(s,e,n,r+1)}var Wi,OB,NB,Ns;function bB(t){let e=J._sentryDebugIds,n=J._debugIds;if(!e&&!n)return{};let r=e?Object.keys(e):[],o=n?Object.keys(n):[];if(Ns&&r.length===OB&&o.length===NB)return Ns;OB=r.length,NB=o.length,Ns={},Wi||(Wi={});let s=(i,a)=>{for(let c of i){let l=a[c],p=Wi?.[c];if(p&&Ns&&l)Ns[p[0]]=l,Wi&&(Wi[c]=[p[0],l]);else if(l){let d=t(c);for(let _=d.length-1;_>=0;_--){let m=d[_]?.filename;if(m&&Ns&&Wi){Ns[m]=l,Wi[c]=[m,l];break}}}}};return e&&s(r,e),n&&s(o,n),Ns}function PB(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=e;qae(t,e),r&&Wae(t,r),zae(t,n),$ae(t,o),Yae(t,s)}function CB(t,e){let{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:p,eventProcessors:d,attachments:_,propagationContext:f,transactionName:m,span:h}=e;sp(t,"extra",n),sp(t,"tags",r),sp(t,"attributes",o),sp(t,"user",s),sp(t,"contexts",i),t.sdkProcessingMetadata=gs(t.sdkProcessingMetadata,c,2),a&&(t.level=a),m&&(t.transactionName=m),h&&(t.span=h),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),p.length&&(t.fingerprint=[...t.fingerprint,...p]),d.length&&(t.eventProcessors=[...t.eventProcessors,...d]),_.length&&(t.attachments=[...t.attachments,..._]),t.propagationContext={...t.propagationContext,...f}}function sp(t,e,n){t[e]=gs(t[e],n,1)}function Zf(t,e){let n=Gf().getScopeData();return t&&CB(n,t.getScopeData()),e&&CB(n,e.getScopeData()),n}function qae(t,e){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(o).length&&(t.user={...o,...t.user}),Object.keys(s).length&&(t.contexts={...s,...t.contexts}),i&&(t.level=i),a&&t.type!=="transaction"&&(t.transaction=a)}function $ae(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Yae(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function Wae(t,e){t.contexts={trace:Is(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Je(e),...t.sdkProcessingMetadata};let n=je(e),r=Y(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function zae(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function MB(t,e,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||_t(),timestamp:e.timestamp||vo()},l=n.integrations||t.integrations.map(S=>S.name);Kae(c,t),Jae(c,l),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&Qae(c,t.stackParser);let p=ece(r,n.captureContext);n.mechanism&&Rc(c,n.mechanism);let d=o?o.getEventProcessors():[],_=Zf(s,p),f=[...n.attachments||[],..._.attachments];f.length&&(n.attachments=f),PB(c,_);let m=[...d,..._.eventProcessors];return(n.data&&n.data.__sentry__===!0?wo(c):IB(m,c,n)).then(S=>(S&&Xae(S),typeof i=="number"&&i>0?Zae(S,i,a):S))}function Kae(t,e){let{environment:n,release:r,dist:o,maxValueLength:s}=e;t.environment=t.environment||n||Cc,!t.release&&r&&(t.release=r),!t.dist&&o&&(t.dist=o);let i=t.request;i?.url&&s&&(i.url=hs(i.url,s)),s&&t.exception?.values?.forEach(a=>{a.value&&(a.value=hs(a.value,s))})}function Qae(t,e){let n=bB(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Xae(t){let e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Jae(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function Zae(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:Pr(o.data,e,n)}}))},...t.user&&{user:Pr(t.user,e,n)},...t.contexts&&{contexts:Pr(t.contexts,e,n)},...t.extra&&{extra:Pr(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=Pr(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:Pr(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=Pr(t.contexts.flags,3,n)),r}function ece(t,e){if(!e)return t;let n=t?t.clone():new An;return n.update(e),n}function xB(t){if(t)return tce(t)?{captureContext:t}:rce(t)?{captureContext:t}:t}function tce(t){return t instanceof An||typeof t=="function"}var nce=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function rce(t){return Object.keys(t).some(e=>nce.includes(e))}function te(t,e){return he().captureException(t,xB(e))}function em(t,e){return he().captureEvent(t,e)}function tm(t,e){ue().setTag(t,e)}async function nm(t){let e=H();return e?e.flush(t):(C&&g.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function rm(t){let e=H();return e?e.close(t):(C&&g.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function om(){let t=H();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function sm(t){let e=ue(),{user:n}=Zf(e,he()),{userAgent:r}=J.navigator||{},o=VG({user:n,...r&&{userAgent:r},...t}),s=e.getSession();return s?.status==="ok"&&Lo(s,{status:"exited"}),ip(),e.setSession(o),o}function ip(){let t=ue(),n=he().getSession()||t.getSession();n&&qG(n),oce(),t.setSession()}function oce(){let t=ue(),e=H(),n=t.getSession();n&&e&&e.captureSession(n)}var sce="7";function ice(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function ace(t){return`${ice(t)}${t.projectId}/envelope/`}function cce(t,e){let n={sentry_version:sce};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function vB(t,e,n){return e||`${ace(t)}?${cce(t,n)}`}var fy=[];function uce(t){let e={};return t.forEach(n=>{let{name:r}=n,o=e[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function my(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){let o=n(e);r=Array.isArray(o)?o:[o]}else r=e;return uce(r)}function LB(t,e){let n={};return e.forEach(r=>{r&&Ty(t,r,n)}),n}function hy(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function Ty(t,e,n){if(n[e.name]){C&&g.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!fy.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),fy.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,s)=>r(o,s,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),o=Object.assign((s,i)=>r(s,i,t),{id:e.name});t.addEventProcessor(o)}C&&g.log(`Integration installed: ${e.name}`)}function DB(t,e){return e?Gn(e,()=>{let n=nr(),r=n?Is(n):Hi(e);return[n?Je(n):Jr(t,e),r]}):[void 0,void 0]}function lce(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function UB(t,e,n,r){let o={};return e?.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=Bn(r)),un(o,[lce(t)])}function Lc(t,e){let n=e??pce(t)??[];if(n.length===0)return;let r=t.getOptions(),o=UB(n,r._metadata,r.tunnel,t.getDsn());wB().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function pce(t){return wB().get(t)}function wB(){return Ir("clientToLogBufferMap",()=>new WeakMap)}function dce(t){return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:t}]}function kB(t,e,n,r){let o={};return e?.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=Bn(r)),un(o,[dce(t)])}function GB(t,e){let n=e??_ce(t)??[];if(n.length===0)return;let r=t.getOptions(),o=kB(n,r._metadata,r.tunnel,t.getDsn());BB().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(o)}function _ce(t){return BB().get(t)}function BB(){return Ir("clientToMetricBufferMap",()=>new WeakMap)}function im(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}var ap=Symbol.for("SentryBufferFullError");function Dc(t=100){let e=new Set;function n(){return e.size<t}function r(i){e.delete(i)}function o(i){if(!n())return vc(ap);let a=i();return e.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!e.size)return wo(!0);let a=Promise.allSettled(Array.from(e)).then(()=>!0);if(!i)return a;let c=[a,new Promise(l=>im(setTimeout(()=>l(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(e)},add:o,drain:s}}var fce=60*1e3;function mce(t,e=Zn()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?fce:r-e}function hce(t,e){return t[e]||t.all||0}function jB(t,e,n=Zn()){return hce(t,e)>n}function HB(t,{statusCode:e,headers:n},r=Zn()){let o={...t},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,l,,,p]=a.split(":",5),d=parseInt(c,10),_=(isNaN(d)?60:d)*1e3;if(!l)o.all=r+_;else for(let f of l.split(";"))f==="metric_bucket"?(!p||p.split(";").includes("custom"))&&(o[f]=r+_):o[f]=r+_}else i?o.all=r+mce(i,r):e===429&&(o.all=r+60*1e3);return o}var cp=64;function up(t,e,n=Dc(t.bufferSize||cp)){let r={},o=i=>n.drain(i);function s(i){let a=[];if(Zl(i,(d,_)=>{let f=zf(_);jB(r,f)?t.recordDroppedEvent("ratelimit_backoff",f):a.push(d)}),a.length===0)return Promise.resolve({});let c=un(i[0],a),l=d=>{if(sy(c,["client_report"])){C&&g.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}Zl(c,(_,f)=>{t.recordDroppedEvent(d,zf(f))})},p=()=>e({body:ep(c)}).then(d=>d.statusCode===413?(C&&g.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),l("send_error"),d):(C&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&g.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=HB(r,d),d),d=>{throw l("network_error"),C&&g.error("Encountered error running transport request:",d),d});return n.add(p).then(d=>d,d=>{if(d===ap)return C&&g.error("Skipped sending event because buffer is full."),l("queue_overflow"),Promise.resolve({});throw d})}return{send:s,flush:o}}function FB(t,e,n){let r=[{type:"client_report"},{timestamp:n||vo(),discarded_events:t}];return un(e?{dsn:e}:{},[r])}function am(t){let e=[];t.message&&e.push(t.message);try{let n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function VB(t){let{trace_id:e,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=t.contexts?.trace??{};return{data:i??{},description:t.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:s,profile_id:i?.[Oc],exclusive_time:i?.[Nc],measurements:t.measurements,is_segment:!0}}function qB(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[Oc]:t.profile_id},...t.exclusive_time&&{[Nc]:t.exclusive_time}}}},measurements:t.measurements}}var $B="Not capturing exception because it's already been captured.",YB="Discarded session because of missing or non-string release",JB=Symbol.for("SentryInternalError"),ZB=Symbol.for("SentryDoNotSendEventError"),Tce=5e3;function cm(t){return{message:t,[JB]:!0}}function Ey(t){return{message:t,[ZB]:!0}}function WB(t){return!!t&&typeof t=="object"&&JB in t}function zB(t){return!!t&&typeof t=="object"&&ZB in t}function KB(t,e,n,r,o){let s=0,i,a=!1;t.on(n,()=>{s=0,clearTimeout(i),a=!1}),t.on(e,c=>{s+=r(c),s>=8e5?o(t):a||(a=!0,i=im(setTimeout(()=>{o(t)},Tce)))}),t.on("flush",()=>{o(t)})}var um=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Dc(e.transportOptions?.bufferSize??cp),e.dsn?this._dsn=nB(e.dsn):C&&g.warn("No DSN provided, client will not send events."),this._dsn){let r=vB(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&KB(this,"afterCaptureLog","flushLogs",Ace,Lc),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&KB(this,"afterCaptureMetric","flushMetrics",gce,GB)}captureException(e,n,r){let o=_t();if(wf(e))return C&&g.log($B),o;let s={event_id:o,...n};return this._process(()=>this.eventFromException(e,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(e,n,r,o){let s={event_id:_t(),...r},i=gc(e)?e:String(e),a=$l(e),c=a?this.eventFromMessage(i,n,s):this.eventFromException(e,s);return this._process(()=>c.then(l=>this._captureEvent(l,s,o)),a?"unknown":"error"),s.event_id}captureEvent(e,n,r){let o=_t();if(n?.originalException&&wf(n.originalException))return C&&g.log($B),o;let s={event_id:o,...n},i=e.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,l=QB(e.type);return this._process(()=>this._captureEvent(e,s,a||r,c),l),s.event_id}captureSession(e){this.sendSession(e),Lo(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let n=this._transport;if(!n)return!0;this.emit("flush");let r=await this._isClientDoneProcessing(e),o=await n.flush(e);return r&&o}async close(e){Lc(this);let n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let n=this._integrations[e.name];Ty(this,e,this._integrations),n||hy(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=mB(e,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=oy(r,ay(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",e,o))}sendSession(e){let{release:n,environment:r=Cc}=this._options;if("aggregates"in e){let s=e.attrs||{};if(!s.release&&!n){C&&g.warn(YB);return}s.release=s.release||n,s.environment=s.environment||r,e.attrs=s}else{if(!e.release&&!n){C&&g.warn(YB);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=fB(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){let o=`${e}:${n}`;C&&g.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(e,n){let r=this._hooks[e]=this._hooks[e]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(o=>o(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(n){return C&&g.error("Error while sending envelope:",n),{}}return C&&g.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=LB(this,e),hy(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0,r=!1;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=e.status==="ok";(i&&e.errors===0||i&&r)&&(Lo(e,{...r&&{status:"crashed"},errors:e.errors||Number(o||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",e,n),e.type||o.setLastEventId(e.event_id||n.event_id),MB(s,e,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Hi(r)},...a.contexts};let c=Jr(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(e,n={},r=he(),o=ue()){return C&&Sy(e)&&g.log(`Captured error event \`${am(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(s=>s.event_id,s=>{C&&(zB(s)?g.log(s.message):WB(s)?g.warn(s.message):g.warn(s))})}_processEvent(e,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=e1(e),c=Sy(e),p=`before send for type \`${e.type||"error"}\``,d=typeof i>"u"?void 0:jn(i);if(c&&typeof d=="number"&&yt()>d)return this.recordDroppedEvent("sample_rate","error"),vc(Ey(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let _=QB(e.type);return this._prepareEvent(e,n,r,o).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",_),Ey("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return f;let h=Sce(this,s,f,n);return Ece(h,p)}).then(f=>{if(f===null){if(this.recordDroppedEvent("before_send",_),a){let S=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",S)}throw Ey(`${p} returned \`null\`, will not send event.`)}let m=r.getSession()||o.getSession();if(c&&m&&this._updateSessionFromEvent(m,f),a){let T=f.sdkProcessingMetadata?.spanCountBeforeProcessing||0,S=f.spans?f.spans.length:0,R=T-S;R>0&&this.recordDroppedEvent("before_send","span",R)}let h=f.transaction_info;if(a&&h&&f.transaction!==e.transaction){let T="custom";f.transaction_info={...h,source:T}}return this.sendEvent(f,n),f}).then(null,f=>{throw zB(f)||WB(f)?f:(this.captureException(f,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:f}),cm(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
21
+ Reason: ${f}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===ap&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){C&&g.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){C&&g.log("No outcomes to send");return}if(!this._dsn){C&&g.log("No dsn provided, will not send outcomes");return}C&&g.log("Sending outcomes:",e);let n=FB(e,this._options.tunnel&&Bn(this._dsn));this.sendEnvelope(n)}};function QB(t){return t==="replay_event"?"replay":t||"error"}function Ece(t,e){let n=`${e} must return \`null\` or a valid event.`;if(Lt(t))return t.then(r=>{if(!Mo(r)&&r!==null)throw cm(n);return r},r=>{throw cm(`${e} rejected with ${r}`)});if(!Mo(t)&&t!==null)throw cm(n);return t}function Sce(t,e,n,r){let{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:i,ignoreSpans:a}=e,c=n;if(Sy(c)&&o)return o(c,r);if(e1(c)){if(i||a){let l=VB(c);if(a?.length&&Jl(l,a))return null;if(i){let p=i(l);p?c=gs(n,qB(p)):Xl()}if(c.spans){let p=[],d=c.spans;for(let f of d){if(a?.length&&Jl(f,a)){pB(d,f);continue}if(i){let m=i(f);m?p.push(m):(Xl(),p.push(f))}else p.push(f)}let _=c.spans.length-p.length;_&&t.recordDroppedEvent("before_send","span",_),c.spans=p}}if(s){if(c.spans){let l=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:l}}return s(c,r)}}return c}function Sy(t){return t.type===void 0}function e1(t){return t.type==="transaction"}function gce(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+t1(t.attributes)}function Ace(t){let e=0;return t.message&&(e+=t.message.length*2),e+t1(t.attributes)}function t1(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*XB(n[0]):$l(n)?e+=XB(n):e+=100}),e}function XB(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function n1(t,e,n,r,o){let s={sent_at:new Date().toISOString()};n?.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&o&&(s.dsn=Bn(o)),e&&(s.trace=e);let i=Rce(t);return un(s,[i])}function Rce(t){return[{type:"check_in"},t]}function r1(t){let e=t._metadata?.sdk,n=e?.name&&e?.version?`${e?.name}/${e?.version}`:void 0;t.transportOptions={...t.transportOptions,headers:{...n&&{"user-agent":n},...t.transportOptions?.headers}}}function o1(t,e){return t(e.stack||"",1)}function yce(t){return Kr(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function Ice(t){return yce(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}function gy(t,e){let n={type:e.name||e.constructor.name,value:Ice(e)},r=o1(t,e);return r.length&&(n.stacktrace={frames:r}),n}function Oce(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}function Nce(t){if("name"in t&&typeof t.name=="string"){let r=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(r+=` with message '${t.message}'`),r}else if("message"in t&&typeof t.message=="string")return t.message;let e=LR(t);if(NR(t))return`Event \`ErrorEvent\` captured as exception with message \`${t.message}\``;let n=bce(t);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${e}`}function bce(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Cce(t,e,n,r){if(Kr(n))return[n,void 0];if(e.synthetic=!0,Mo(n)){let s=t?.getOptions().normalizeDepth,i={__serialized__:ny(n,s)},a=Oce(n);if(a)return[a,i];let c=Nce(n),l=r?.syntheticException||new Error(c);return l.message=c,[l,i]}let o=r?.syntheticException||new Error(n);return o.message=`${n}`,[o,void 0]}function s1(t,e,n,r){let s=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[i,a]=Cce(t,s,n,r),c={exception:{values:[gy(e,i)]}};return a&&(c.extra=a),GR(c,void 0,void 0),Rc(c,s),{...c,event_id:r?.event_id}}function i1(t,e,n="info",r,o){let s={event_id:r?.event_id,level:n};if(o&&r?.syntheticException){let i=o1(t,r.syntheticException);i.length&&(s.exception={values:[{value:e,stacktrace:{frames:i}}]},Rc(s,{synthetic:!0}))}if(gc(e)){let{__sentry_template_string__:i,__sentry_template_values__:a}=e;return s.logentry={message:i,params:a},s}return s.message=e,s}var lp=class extends um{constructor(e){uB(),r1(e),super(e),this._setUpMetricsProcessing()}eventFromException(e,n){let r=s1(this,this._options.stackParser,e,n);return r.level="error",wo(r)}eventFromMessage(e,n="info",r){return wo(i1(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){return a1(n),super.captureException(e,n,r)}captureEvent(e,n,r){return!e.type&&e.exception?.values&&e.exception.values.length>0&&a1(n),super.captureEvent(e,n,r)}captureCheckIn(e,n,r){let o="checkInId"in e&&e.checkInId?e.checkInId:_t();if(!this._isEnabled())return C&&g.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,l={check_in_id:o,monitor_slug:e.monitorSlug,status:e.status,release:i,environment:a};"duration"in e&&(l.duration=e.duration),n&&(l.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[p,d]=DB(this,r);d&&(l.contexts={trace:d});let _=n1(l,p,this.getSdkMetadata(),c,this.getDsn());return C&&g.log("Sending checkin:",e.monitorSlug,e.status),this.sendEnvelope(_),o}dispose(){C&&g.log("Disposing client...");for(let e of Object.keys(this._hooks))this._hooks[e]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=Dc(cp)}_prepareEvent(e,n,r,o){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:e.contexts?.runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,n,r,o)}_setUpMetricsProcessing(){this.on("processMetric",e=>{this._options.serverName&&(e.attributes={"server.address":this._options.serverName,...e.attributes})})}};function a1(t){let e=ue().getScopeData().sdkProcessingMetadata.requestSession;if(e){let n=t?.mechanism?.handled??!0;n&&e.status!=="crashed"?e.status="errored":n||(e.status="crashed")}}var Ay=new Set;function Ry(t){t.forEach(e=>{Ay.add(e),C&&g.log(`AI provider "${e}" wrapping will be skipped`)})}function zi(t){return Ay.has(t)}function yy(){Ay.clear(),C&&g.log("Cleared AI provider skip registrations")}var Pce=new Set(["false","f","n","no","off","0"]),Mce=new Set(["true","t","y","yes","on","1"]);function Uc(t,e){let n=String(t).toLowerCase();return Pce.has(n)?!1:Mce.has(n)?!0:e?.strict?null:!!t}var xce="thismessage:/";function Iy(t){return"isRelative"in t}function pp(t,e){let n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=e??(n?xce:void 0);try{if("canParse"in URL&&!URL.canParse(t,r))return;let o=new URL(t,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function c1(t){if(Iy(t))return t.pathname;let e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function vce(t,e,n,r){let o=n?.method?.toUpperCase()??"GET",s=r||(t?e==="client"?c1(t):t.pathname:"/");return`${o} ${s}`}function Oy(t,e,n,r,o){let s={[W]:n,[Ue]:"url"};return o&&(s[e==="server"?"http.route":"url.template"]=o,s[Ue]="route"),r?.method&&(s[QR]=r.method.toUpperCase()),t&&(t.search&&(s["url.query"]=t.search),t.hash&&(s["url.fragment"]=t.hash),t.pathname&&(s["url.path"]=t.pathname,t.pathname==="/"&&(s[Ue]="route")),Iy(t)||(s[As]=t.href,t.port&&(s["url.port"]=t.port),t.protocol&&(s["url.scheme"]=t.protocol),t.hostname&&(s[e==="server"?"server.address":"url.domain"]=t.hostname))),[vce(t,e,r,o),s]}function bs(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function ko(t){return t.split(/[?#]/,1)[0]}function Cs(t){let{protocol:e,host:n,path:r}=t,o=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${e?`${e}://`:""}${o}${r}`}function wc(t,e=!0){if(t.startsWith("data:")){let n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=t.includes(";base64,"),s=t.indexOf(","),i="";if(e&&s!==-1){let a=t.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return t}function Ki(t,e,n=[e],r="npm"){let o=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${e}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:pe})),o.version=pe)}function kc(t={}){let e=t.client||H();if(!om()||!e)return{};let n=cn(),r=Or(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||he(),s=t.span||nr();if(!s&&VR())return{};let i=s?$f(s):Lce(o),a=s?Je(s):Jr(e,o),c=Fi(a);if(!Hf.test(i))return g.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let p={"sentry-trace":i,baggage:c};return t.propagateTraceparent&&(p.traceparent=s?aB(s):Dce(o)),p}function Lce(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return Rs(e,r,n)}function Dce(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return ys(e,r,n)}var u1="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";function Qi(t,e,n){if(typeof t!="string"||!e)return!0;let r=n?.get(t);if(r!==void 0)return C&&!r&&g.log(u1,t),r;let o=Ts(t,e);return n?.set(t,o),C&&!o&&g.log(u1,t),o}function Ny(t,e,n){let r,o,s,i=n?.maxWait?Math.max(n.maxWait,e):0,a=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=t(),r}function l(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function p(){return o!==void 0||s!==void 0?c():r}function d(){return o&&clearTimeout(o),o=a(c,e),i&&s===void 0&&(s=a(c,i)),r}return d.cancel=l,d.flush=p,d}function _1(t){let e=Object.create(null);try{Object.entries(t).forEach(([n,r])=>{typeof r=="string"&&(e[n]=r)})}catch{}return e}function dp(t){let e=t.headers||{},r=(typeof e["x-forwarded-host"]=="string"?e["x-forwarded-host"]:void 0)||(typeof e.host=="string"?e.host:void 0),s=(typeof e["x-forwarded-proto"]=="string"?e["x-forwarded-proto"]:void 0)||t.protocol||(t.socket?.encrypted?"https":"http"),i=t.url||"",a=Uce({url:i,host:r,protocol:s}),c=t.body||void 0,l=t.cookies;return{url:a,method:t.method,query_string:f1(i),headers:_1(e),cookies:l,data:c}}function Uce({url:t,protocol:e,host:n}){if(t?.startsWith("http"))return t;if(t&&n)return`${e}://${n}${t}`}var l1=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","set-cookie","cookie"],wce=["x-forwarded-","-user"];function lm(t,e=!1,n="request"){let r={};try{Object.entries(t).forEach(([o,s])=>{if(s==null)return;let i=o.toLowerCase();if((i==="cookie"||i==="set-cookie")&&typeof s=="string"&&s!==""){let c=i==="set-cookie",l=s.indexOf(";"),p=c&&l!==-1?s.substring(0,l):s,d=c?[p]:p.split("; ");for(let _ of d){let f=_.indexOf("="),m=f!==-1?_.substring(0,f):_,h=f!==-1?_.substring(f+1):"",T=m.toLowerCase();d1(r,i,T,h,e,n)}}else d1(r,i,"",s,e,n)})}catch{}return r}function p1(t){return t.replace(/-/g,"_")}function d1(t,e,n,r,o,s){let i=kce(n||e,r,o);if(i==null)return;let a=`http.${s}.header.${p1(e)}${n?`.${p1(n)}`:""}`;t[a]=i}function kce(t,e,n){if(n?l1.some(o=>t.includes(o)):[...wce,...l1].some(o=>t.includes(o)))return"[Filtered]";if(Array.isArray(e))return e.map(o=>o!=null?String(o):o).join(";");if(typeof e=="string")return e}function f1(t){if(t)try{let e=new URL(t,"http://s.io").search.slice(1);return e.length?e:void 0}catch{return}}var Gce=100;function rr(t,e){let n=H(),r=ue();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Gce}=n.getOptions();if(s<=0)return;let a={timestamp:vo(),...t},c=o?Qe(()=>o(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,s))}var m1,Bce="FunctionToString",h1=new WeakMap,jce=()=>({name:Bce,setupOnce(){m1=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=vR(this),n=h1.has(H())&&e!==void 0?e:this;return m1.apply(n,t)}}catch{}},setup(t){h1.set(t,!0)}}),pm=jce;var Hce=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Fce="EventFilters",by=(t={})=>{let e;return{name:Fce,setup(n){let r=n.getOptions();e=T1(t,r)},processEvent(n,r,o){if(!e){let s=o.getOptions();e=T1(t,s)}return Vce(n,e)?null:n}}},_m=(t={})=>({...by(t),name:"InboundFilters"});function T1(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:Hce],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function Vce(t,e){if(t.type){if(t.type==="transaction"&&$ce(t,e.ignoreTransactions))return C&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
22
+ Event: ${Es(t)}`),!0}else{if(qce(t,e.ignoreErrors))return C&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
23
+ Event: ${Es(t)}`),!0;if(Kce(t))return C&&g.warn(`Event dropped due to not having an error message, error type or stacktrace.
24
+ Event: ${Es(t)}`),!0;if(Yce(t,e.denyUrls))return C&&g.warn(`Event dropped due to being matched by \`denyUrls\` option.
25
+ Event: ${Es(t)}.
26
+ Url: ${dm(t)}`),!0;if(!Wce(t,e.allowUrls))return C&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option.
27
+ Event: ${Es(t)}.
28
+ Url: ${dm(t)}`),!0}return!1}function qce(t,e){return e?.length?am(t).some(n=>Ts(n,e)):!1}function $ce(t,e){if(!e?.length)return!1;let n=t.transaction;return n?Ts(n,e):!1}function Yce(t,e){if(!e?.length)return!1;let n=dm(t);return n?Ts(n,e):!1}function Wce(t,e){if(!e?.length)return!0;let n=dm(t);return n?Ts(n,e):!0}function zce(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function dm(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?zce(n):null}catch{return C&&g.error(`Cannot extract url for event ${Es(t)}`),null}}function Kce(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function g1(t,e,n,r,o,s){if(!o.exception?.values||!s||!Qr(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=Cy(t,e,r,s.originalException,n,o.exception.values,i,0))}function Cy(t,e,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Qr(r[o],Error)){E1(i,a,r);let l=t(e,r[o]),p=c.length;S1(l,o,p,a),c=Cy(t,e,n,r[o],o,[l,...c],l,p)}return A1(r)&&r.errors.forEach((l,p)=>{if(Qr(l,Error)){E1(i,a,r);let d=t(e,l),_=c.length;S1(d,`errors[${p}]`,_,a),c=Cy(t,e,n,l,o,[d,...c],d,_)}}),c}function A1(t){return Array.isArray(t.errors)}function E1(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...A1(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function S1(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}var Qce="cause",Xce=5,Jce="LinkedErrors",Zce=(t={})=>{let e=t.limit||Xce,n=t.key||Qce;return{name:Jce,preprocessEvent(r,o,s){let i=s.getOptions();g1(gy,i.stackParser,n,e,r,o)}}},fm=Zce;function R1(t){let e={},n=0;for(;n<t.length;){let r=t.indexOf("=",n);if(r===-1)break;let o=t.indexOf(";",n);if(o===-1)o=t.length;else if(o<r){n=t.lastIndexOf(";",r-1)+1;continue}let s=t.slice(n,r).trim();if(e[s]===void 0){let i=t.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{e[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{e[s]=i}}n=o+1}return e}var Py=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function y1(t){let e={};for(let s of Object.keys(t))e[s.toLowerCase()]=t[s];return Py.map(s=>{let i=e[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?eue(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&tue(s))||null}function eue(t){if(!t)return null;for(let e of t.split(";"))if(e.startsWith("for="))return e.slice(4);return null}function tue(t){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(t)}var nue={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},rue="RequestData",oue=(t={})=>{let e={...nue,...t.include};return{name:rue,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...e,ip:e.ip??o.getOptions().sendDefaultPii};return i&&sue(n,i,{ipAddress:a},c),n}}},mm=oue;function sue(t,e,n,r){if(t.request={...t.request,...iue(e,r)},r.ip){let o=e.headers&&y1(e.headers)||n.ipAddress;o&&(t.user={...t.user,ip_address:o})}}function iue(t,e){let n={},r={...t.headers};if(e.headers&&(n.headers=r,e.cookies||delete r.cookie,e.ip||Py.forEach(o=>{delete r[o]})),n.method=t.method,e.url&&(n.url=t.url),e.cookies){let o=t.cookies||(r?.cookie?R1(r.cookie):void 0);n.cookies=o||{}}return e.query_string&&(n.query_string=t.query_string),e.data&&(n.data=t.data),n}function I1(t){let e="console";Tc(e,t),Ec(e,aue)}function aue(){"console"in J&&Vl.forEach(function(t){t in J.console&&xR(J.console,t,function(e){return hc[t]=e,function(...n){Sc("console",{args:n,level:t}),hc[t]?.apply(J.console,n)}})})}function O1(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var cue=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function uue(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=cue.exec(e);return n?n.slice(1):[]}function My(t){let e=uue(t),n=e[0]||"",r=e[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var lue=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,hm=Symbol("sentryPostgresConnectionContext"),xy=Symbol.for("sentry.instrumented.postgresjs"),pue=Symbol.for("sentry.query.from.instrumented.sql");function Ly(t,e){return!t||typeof t!="function"?(C&&g.warn("instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance"),t):vy(t,{requireParentSpan:!0,...e})}function vy(t,e,n){if(t[xy])return t;let r=new Proxy(t,{apply(o,s,i){let a=Reflect.apply(o,s,i);return a&&typeof a=="object"&&"handle"in a&&b1(a,r,e),a},get(o,s){let i=o[s];return typeof s!="string"||typeof i!="function"?i:s==="unsafe"||s==="file"?due(i,o,r,e):s==="begin"||s==="reserve"?_ue(i,o,r,e):i}});return n?r[hm]=n:Eue(t,r),t[xy]=!0,r[xy]=!0,r}function due(t,e,n,r){return function(...o){let s=Reflect.apply(t,e,o);return s&&typeof s=="object"&&"handle"in s&&b1(s,n,r),s}}function _ue(t,e,n,r){return function(...o){let s=n[hm];if(!(typeof o[o.length-1]=="function")){let p=Reflect.apply(t,e,o);return p&&typeof p.then=="function"?p.then(d=>vy(d,r,s)):p}let a=o.length===1?o[0]:o[1],c=function(p){let d=vy(p,r,s);return a(d)},l=o.length===1?[c]:[o[0],c];return Reflect.apply(t,e,l)}}function b1(t,e,n){if(t.handle?.__sentryWrapped)return;t[pue]=!0;let r=t.handle,o=async function(...s){if(!fue(n))return r.apply(this,s);let i=mue(t.strings),a=hue(i);return It({name:a||"postgresjs.query",op:"db"},c=>{c.setAttribute(W,"auto.db.postgresjs"),c.setAttributes({"db.system.name":"postgres","db.query.text":a});let l=e?e[hm]:void 0;if(Tue(c,l),n.requestHook)try{n.requestHook(c,a,l)}catch(d){c.setAttribute("sentry.hook.error","requestHook failed"),C&&g.error("Error in requestHook for PostgresJs instrumentation:",d)}let p=this;p.resolve=new Proxy(p.resolve,{apply:(d,_,f)=>{try{N1(c,a,f?.[0]?.command),c.end()}catch(m){C&&g.error("Error ending span in resolve callback:",m)}return Reflect.apply(d,_,f)}}),p.reject=new Proxy(p.reject,{apply:(d,_,f)=>{try{c.setStatus({code:2,message:f?.[0]?.message||"unknown_error"}),c.setAttribute("db.response.status_code",f?.[0]?.code||"unknown"),c.setAttribute("error.type",f?.[0]?.name||"unknown"),N1(c,a),c.end()}catch(m){C&&g.error("Error ending span in reject callback:",m)}return Reflect.apply(d,_,f)}});try{return r.apply(this,s)}catch(d){throw c.setStatus({code:2,message:d instanceof Error?d.message:"unknown_error"}),c.end(),d}})};o.__sentryWrapped=!0,t.handle=o}function fue(t){return nr()!==void 0||!t.requireParentSpan}function mue(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((e,n,r)=>r===0?n:`${e}$${r}${n}`,"")}function hue(t){return t?t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}function Tue(t,e){if(e&&(e.ATTR_DB_NAMESPACE&&t.setAttribute("db.namespace",e.ATTR_DB_NAMESPACE),e.ATTR_SERVER_ADDRESS&&t.setAttribute("server.address",e.ATTR_SERVER_ADDRESS),e.ATTR_SERVER_PORT!==void 0)){let n=parseInt(e.ATTR_SERVER_PORT,10);isNaN(n)||t.setAttribute("server.port",n)}}function N1(t,e,n){if(n){t.setAttribute("db.operation.name",n);return}let r=e?.match(lue);r?.[1]&&t.setAttribute("db.operation.name",r[1].toUpperCase())}function Eue(t,e){let n=t;if(!n.options||typeof n.options!="object")return;let r=n.options,o=r.host?.[0]||"localhost",s=r.port?.[0]||5432,i={ATTR_DB_NAMESPACE:typeof r.database=="string"&&r.database!==""?r.database:void 0,ATTR_SERVER_ADDRESS:o,ATTR_SERVER_PORT:String(s)};e[hm]=i}var Sue="Console",Tm=(t={})=>{let e=new Set(t.levels||Vl);return{name:Sue,setup(n){I1(({args:r,level:o})=>{H()!==n||!e.has(o)||gue(o,r)})}}};function gue(t,e){let n={category:"console",data:{arguments:e,logger:"console"},level:O1(t),message:C1(e)};if(t==="assert")if(e[0]===!1){let r=e.slice(1);n.message=r.length>0?`Assertion failed: ${C1(r)}`:"Assertion failed",n.data.arguments=r}else return;rr(n,{input:e,level:t})}function C1(t){return"util"in J&&typeof J.util.format=="function"?J.util.format(...t):UR(t," ")}var Aue="ConversationId",Rue=()=>({name:Aue,setup(t){t.on("spanStart",e=>{let n=he().getScopeData(),r=ue().getScopeData(),o=n.conversationId||r.conversationId;o&&e.setAttribute(XR,o)})}}),Dy=Rue;var P1="gen_ai.prompt",Ps="gen_ai.system",He="gen_ai.request.model",Gc="gen_ai.request.stream",Ms="gen_ai.request.temperature",Bc="gen_ai.request.max_tokens",xs="gen_ai.request.frequency_penalty",jc="gen_ai.request.presence_penalty",vs="gen_ai.request.top_p",Em="gen_ai.request.top_k",M1="gen_ai.request.encoding_format",x1="gen_ai.request.dimensions",yn="gen_ai.response.finish_reasons",ft="gen_ai.response.model",or="gen_ai.response.id",v1="gen_ai.response.stop_reason",Pe="gen_ai.usage.input_tokens",Ze="gen_ai.usage.output_tokens",ln="gen_ai.usage.total_tokens",Dt="gen_ai.operation.name",pn="sentry.sdk_meta.gen_ai.input.messages.original_length",Ut="gen_ai.input.messages",L1="gen_ai.output.messages",Hn="gen_ai.system_instructions",rt="gen_ai.response.text",Zr="gen_ai.request.available_tools",Xi="gen_ai.response.streaming",Ot="gen_ai.response.tool_calls",Uy="gen_ai.agent.name",D1="gen_ai.pipeline.name",_p="gen_ai.conversation.id",U1="gen_ai.usage.cache_creation_input_tokens",w1="gen_ai.usage.cache_read_input_tokens",wy="gen_ai.usage.input_tokens.cache_write",Ls="gen_ai.usage.input_tokens.cached",Sm="gen_ai.invoke_agent",k1="gen_ai.generate_text",G1="gen_ai.stream_text",B1="gen_ai.generate_object",j1="gen_ai.stream_object",Hc="gen_ai.embeddings.input",H1="gen_ai.embeddings",F1="gen_ai.embeddings",V1="gen_ai.rerank",q1="gen_ai.execute_tool",Ji="gen_ai.tool.name",ky="gen_ai.tool.call.id",Gy="gen_ai.tool.type",gm="gen_ai.tool.input",Am="gen_ai.tool.output",$1="gen_ai.tool.description",By="openai.response.id",jy="openai.response.model",Hy="openai.response.timestamp",Y1="openai.usage.completion_tokens",W1="openai.usage.prompt_tokens",Fy="anthropic.response.timestamp";var fp=new Map,Vy=new Set(["ai.generateText","ai.streamText","ai.generateObject","ai.streamObject"]),qy=new Set(["ai.generateText.doGenerate","ai.streamText.doStream","ai.generateObject.doGenerate","ai.streamObject.doStream"]),z1=new Set(["ai.embed.doEmbed","ai.embedMany.doEmbed"]),K1=new Set(["ai.rerank.doRerank"]),Q1={"ai.embed.doEmbed":"embeddings","ai.embedMany.doEmbed":"embeddings","ai.rerank.doRerank":"rerank"};function Ds(t){return!t||typeof t!="object"?!1:Iue(t)||J1(t)||yue(t)||Z1(t)||ej(t)||Oue(t)||Nue(t)||bue(t)||Cue(t)||Pue(t)||Mue(t)||xue(t)}function yue(t){return"image_url"in t?typeof t.image_url=="string"?t.image_url.startsWith("data:"):X1(t):!1}function X1(t){return"image_url"in t&&!!t.image_url&&typeof t.image_url=="object"&&"url"in t.image_url&&typeof t.image_url.url=="string"&&t.image_url.url.startsWith("data:")}function Iue(t){return"type"in t&&typeof t.type=="string"&&"source"in t&&Ds(t.source)}function J1(t){return"inlineData"in t&&!!t.inlineData&&typeof t.inlineData=="object"&&"data"in t.inlineData&&typeof t.inlineData.data=="string"}function Z1(t){return"type"in t&&t.type==="input_audio"&&"input_audio"in t&&!!t.input_audio&&typeof t.input_audio=="object"&&"data"in t.input_audio&&typeof t.input_audio.data=="string"}function ej(t){return"type"in t&&t.type==="file"&&"file"in t&&!!t.file&&typeof t.file=="object"&&"file_data"in t.file&&typeof t.file.file_data=="string"}function Oue(t){return"media_type"in t&&typeof t.media_type=="string"&&"data"in t}function Nue(t){return"type"in t&&t.type==="file"&&"mediaType"in t&&typeof t.mediaType=="string"&&"data"in t&&typeof t.data=="string"&&!t.data.startsWith("http://")&&!t.data.startsWith("https://")}function bue(t){return"type"in t&&t.type==="image"&&"image"in t&&typeof t.image=="string"&&!t.image.startsWith("http://")&&!t.image.startsWith("https://")}function Cue(t){return"type"in t&&(t.type==="blob"||t.type==="base64")}function Pue(t){return"b64_json"in t}function Mue(t){return"type"in t&&"result"in t&&t.type==="image_generation"}function xue(t){return"uri"in t&&typeof t.uri=="string"&&t.uri.startsWith("data:")}var mp="[Blob substitute]",vue=["image_url","data","content","b64_json","result","uri","image"];function Zi(t){let e={...t};Ds(e.source)&&(e.source=Zi(e.source)),J1(t)&&(e.inlineData={...t.inlineData,data:mp}),X1(t)&&(e.image_url={...t.image_url,url:mp}),Z1(t)&&(e.input_audio={...t.input_audio,data:mp}),ej(t)&&(e.file={...t.file,file_data:mp});for(let n of vue)typeof e[n]=="string"&&(e[n]=mp);return e}var nj=2e4,Rm=t=>new TextEncoder().encode(t).length,Yy=t=>Rm(JSON.stringify(t));function ym(t,e){if(Rm(t)<=e)return t;let n=0,r=t.length,o="";for(;n<=r;){let s=Math.floor((n+r)/2),i=t.slice(0,s);Rm(i)<=e?(o=i,n=s+1):r=s-1}return o}function Lue(t){return typeof t=="string"?t:"text"in t&&typeof t.text=="string"?t.text:""}function tj(t,e){return typeof t=="string"?e:{...t,text:e}}function Due(t){return t!==null&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function rj(t){return t!==null&&typeof t=="object"&&"content"in t&&Array.isArray(t.content)}function oj(t){return t!==null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)&&t.parts.length>0}function Uue(t,e){let n={...t,content:""},r=Yy(n),o=e-r;if(o<=0)return[];let s=ym(t.content,o);return[{...t,content:s}]}function wue(t){return"parts"in t&&Array.isArray(t.parts)?{key:"parts",items:t.parts}:"content"in t&&Array.isArray(t.content)?{key:"content",items:t.content}:{key:null,items:[]}}function kue(t,e){let{key:n,items:r}=wue(t);if(n===null||r.length===0)return[];let o=r.map(c=>tj(c,"")),s=Yy({...t,[n]:o}),i=e-s;if(i<=0)return[];let a=[];for(let c of r){let l=Lue(c),p=Rm(l);if(p<=i)a.push(c),i-=p;else if(a.length===0){let d=ym(l,i);d&&a.push(tj(c,d));break}else break}return a.length<=0?[]:[{...t,[n]:a}]}function Gue(t,e){if(!t)return[];if(typeof t=="string"){let n=ym(t,e);return n?[n]:[]}return typeof t!="object"?[]:Due(t)?Uue(t,e):rj(t)||oj(t)?kue(t,e):[]}function $y(t){return t.map(n=>{let r;return n&&typeof n=="object"&&(rj(n)?r={...n,content:$y(n.content)}:"content"in n&&Ds(n.content)&&(r={...n,content:Zi(n.content)}),oj(n)&&(r={...r??n,parts:$y(n.parts)}),Ds(r)?r=Zi(r):Ds(n)&&(r=Zi(n))),r??n})}function Bue(t,e){if(!Array.isArray(t)||t.length===0)return t;let n=e-2,r=t[t.length-1],o=$y([r]),s=o[0];return Yy(s)<=n?o:Gue(s,n)}function Us(t){return Bue(t,nj)}function sj(t){return ym(t,nj)}function eo(t){let e=!!H()?.getOptions().sendDefaultPii;return{...t,recordInputs:t?.recordInputs??e,recordOutputs:t?.recordOutputs??e}}function Fc(t,e){return t?`${t}.${e}`:e}function hp(t,e,n,r,o){if(e!==void 0&&t.setAttributes({[Pe]:e}),n!==void 0&&t.setAttributes({[Ze]:n}),e!==void 0||n!==void 0||r!==void 0||o!==void 0){let s=(e??0)+(n??0)+(r??0)+(o??0);t.setAttributes({[ln]:s})}}function ea(t){if(typeof t=="string")return sj(t);if(Array.isArray(t)){let e=Us(t);return JSON.stringify(e)}return JSON.stringify(t)}function Fn(t){if(!Array.isArray(t))return{systemInstructions:void 0,filteredMessages:t};let e=t.findIndex(i=>i&&typeof i=="object"&&"role"in i&&i.role==="system");if(e===-1)return{systemInstructions:void 0,filteredMessages:t};let n=t[e],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:t};let o=JSON.stringify([{type:"text",content:r}]),s=[...t.slice(0,e),...t.slice(e+1)];return{systemInstructions:o,filteredMessages:s}}async function jue(t,e,n){let r=t.catch(i=>{throw te(i,{mechanism:{handled:!1,type:n}}),i}),o=await e,s=await r;return s&&typeof s=="object"&&"data"in s?{...s,data:o}:o}function Vc(t,e,n){return Lt(t)?new Proxy(t,{get(r,o){let i=o in Promise.prototype||o===Symbol.toStringTag?e:r,a=Reflect.get(i,o);return o==="withResponse"&&typeof a=="function"?function(){let l=a.call(r);return jue(l,e,n)}:typeof a=="function"?a.bind(i):a}}):e}var Im="operation.name",ij="ai.operationId",Om="ai.prompt",aj="ai.schema",cj="ai.response.object",Wy="ai.values",zy="ai.response.text",Ky="ai.response.toolCalls",uj="ai.response.finishReason",ta="ai.prompt.messages",qc="ai.prompt.tools",Tp="ai.model.id",lj="ai.response.providerMetadata",pj="ai.usage.cachedInputTokens",dj="ai.telemetry.functionId",_j="ai.usage.completionTokens",fj="ai.usage.promptTokens",mj="ai.usage.tokens",Qy="ai.toolCall.name",Xy="ai.toolCall.id",hj="ai.toolCall.args",Tj="ai.toolCall.result";function Sj(t,e){let n=t.parent_span_id;if(!n)return;let r=t.data[Pe],o=t.data[Ze];if(typeof r=="number"||typeof o=="number"){let s=e.get(n)||{inputTokens:0,outputTokens:0};typeof r=="number"&&(s.inputTokens+=r),typeof o=="number"&&(s.outputTokens+=o),e.set(n,s)}}function Jy(t,e){let n=e.get(t.span_id);!n||!t.data||(n.inputTokens>0&&(t.data[Pe]=n.inputTokens),n.outputTokens>0&&(t.data[Ze]=n.outputTokens),(n.inputTokens>0||n.outputTokens>0)&&(t.data["gen_ai.usage.total_tokens"]=n.inputTokens+n.outputTokens))}function Hue(t){let e=new Map;for(let n of t){let r=n.data[Zr];if(typeof r=="string")try{let o=JSON.parse(r);for(let s of o)s.name&&s.description&&!e.has(s.name)&&e.set(s.name,s.description)}catch{}}return e}function gj(t,e){let n=Hue(t);for(let r of t){if(r.op==="gen_ai.execute_tool"){let o=r.data[Ji];if(typeof o=="string"){let s=n.get(o);s&&(r.data[$1]=s)}}r.op==="gen_ai.invoke_agent"&&Jy(r,e)}}function Zy(t){return fp.get(t)}function eI(t){fp.delete(t)}function Aj(t){let e=t.map(n=>{if(typeof n=="string")try{return JSON.parse(n)}catch{return n}return n});return JSON.stringify(e)}function Ej(t){return t.filter(e=>!!e&&typeof e=="object"&&"role"in e&&"content"in e)}function Fue(t){try{let e=JSON.parse(t);if(e&&typeof e=="object"){let{messages:n}=e,{prompt:r,system:o}=e,s=[];if(typeof o=="string"&&s.push({role:"system",content:o}),typeof n=="string")try{n=JSON.parse(n)}catch{}if(Array.isArray(n))return s.push(...Ej(n)),s;if(Array.isArray(r))return s.push(...Ej(r)),s;if(typeof r=="string"&&s.push({role:"user",content:r}),s.length>0)return s}}catch{}return[]}function Rj(t,e){if(typeof e[Om]=="string"&&!e[Ut]&&!e[ta]){let n=e[Om],r=Fue(n);if(r.length){let{systemInstructions:o,filteredMessages:s}=Fn(r);o&&t.setAttribute(Hn,o);let i=Array.isArray(s)?s.length:0,a=ea(s);t.setAttributes({[Om]:a,[Ut]:a,[pn]:i})}}else if(typeof e[ta]=="string")try{let n=JSON.parse(e[ta]);if(Array.isArray(n)){let{systemInstructions:r,filteredMessages:o}=Fn(n);r&&t.setAttribute(Hn,r);let s=Array.isArray(o)?o.length:0,i=ea(o);t.setAttributes({[ta]:i,[Ut]:i,[pn]:s})}}catch{}}function yj(t){switch(t){case"ai.generateText":case"ai.streamText":case"ai.generateObject":case"ai.streamObject":return Sm;case"ai.generateText.doGenerate":return k1;case"ai.streamText.doStream":return G1;case"ai.generateObject.doGenerate":return B1;case"ai.streamObject.doStream":return j1;case"ai.embed.doEmbed":return H1;case"ai.embedMany.doEmbed":return F1;case"ai.rerank.doRerank":return V1;case"ai.toolCall":return q1;default:return t.startsWith("ai.stream")?"ai.run":void 0}}function Vue(t){return Vy.has(t)?"invoke_agent":qy.has(t)?"generate_content":z1.has(t)?"embeddings":K1.has(t)?"rerank":t==="ai.toolCall"?"execute_tool":t}function que(t){let{data:e,description:n}=Y(t);if(n){if(e[Qy]&&e[Xy]&&n==="ai.toolCall"){Kue(t,e);return}!e[ij]&&!n.startsWith("ai.")||Que(t,n,e)}}function $ue(t){if(t.type==="transaction"&&t.spans){let e=new Map;for(let r of t.spans)zue(r),Sj(r,e);gj(t.spans,e);let n=t.contexts?.trace;n?.op==="gen_ai.invoke_agent"&&Jy(n,e)}return t}function Yue(t){if(typeof t!="string")return"stop";switch(t){case"tool-calls":return"tool_call";case"stop":case"length":case"content_filter":case"error":return t;default:return t}}function Wue(t){let e=t[zy],n=t[Ky],r=t[uj];if(e==null&&n==null)return;let o=[];if(typeof e=="string"&&e.length>0&&o.push({type:"text",content:e}),n!=null)try{let s=typeof n=="string"?JSON.parse(n):n;if(Array.isArray(s)){for(let i of s){let a=i.input??i.args;o.push({type:"tool_call",id:i.toolCallId,name:i.toolName,arguments:typeof a=="string"?a:JSON.stringify(a??{})})}delete t[Ky]}}catch{}if(o.length>0){let s={role:"assistant",parts:o,finish_reason:Yue(r)};t[L1]=JSON.stringify([s]),delete t[zy]}}function zue(t){let{data:e,origin:n}=t;if(n==="auto.vercelai.otel"){if(t.status&&t.status!=="ok"&&(t.status="internal_error"),wt(e,_j,Ze),wt(e,fj,Pe),wt(e,pj,Ls),wt(e,"ai.usage.inputTokens",Pe),wt(e,"ai.usage.outputTokens",Ze),wt(e,mj,Pe),wt(e,"ai.response.avgOutputTokensPerSecond","ai.response.avgCompletionTokensPerSecond"),typeof e[Pe]=="number"&&typeof e[Ls]=="number"&&(e[Pe]=e[Pe]+e[Ls]),typeof e[Pe]=="number"){let r=typeof e[Ze]=="number"?e[Ze]:0;e[ln]=r+e[Pe]}if(e[qc]&&Array.isArray(e[qc])&&(e[qc]=Aj(e[qc])),e[Im]){let r=Vue(e[Im]);e[Dt]=r,delete e[Im]}if(wt(e,ta,Ut),Wue(e),wt(e,cj,"gen_ai.response.object"),wt(e,qc,"gen_ai.request.available_tools"),wt(e,hj,gm),wt(e,Tj,Am),wt(e,aj,"gen_ai.request.schema"),wt(e,Tp,He),Array.isArray(e[Wy])){let r=e[Wy].map(o=>{try{return JSON.parse(o)}catch{return o}});e[Hc]=r.length===1?r[0]:JSON.stringify(r)}Xue(e);for(let r of Object.keys(e))r.startsWith("ai.")&&wt(e,r,`vercel.${r}`)}}function wt(t,e,n){t[e]!=null&&(t[n]=t[e],delete t[e])}function Kue(t,e){t.setAttribute(W,"auto.vercelai.otel"),t.setAttribute(ee,"gen_ai.execute_tool"),t.setAttribute(Dt,"execute_tool"),wt(e,Qy,Ji),wt(e,Xy,ky);let n=e[ky];typeof n=="string"&&fp.set(n,t.spanContext()),e[Gy]||t.setAttribute(Gy,"function");let r=e[Ji];r&&t.updateName(`execute_tool ${r}`)}function Que(t,e,n){t.setAttribute(W,"auto.vercelai.otel");let r=e.replace("ai.","");t.setAttribute("ai.pipeline.name",r),t.updateName(r);let o=n[dj];o&&typeof o=="string"&&t.setAttribute("gen_ai.function_id",o),Rj(t,n),n[Tp]&&!n[ft]&&t.setAttribute(ft,n[Tp]),t.setAttribute("ai.streaming",e.includes("stream"));let s=yj(e);if(s&&t.setAttribute(ee,s),Vy.has(e)){o&&typeof o=="string"?t.updateName(`invoke_agent ${o}`):t.updateName("invoke_agent");return}let i=n[Tp];if(i){let a=qy.has(e)?"generate_content":Q1[e];a&&t.updateName(`${a} ${i}`)}}function Nm(t){t.on("spanStart",que),t.addEventProcessor(Object.assign($ue,{id:"VercelAiEventProcessor"}))}function Xue(t){let e=t[lj];if(e)try{let n=JSON.parse(e),r=n.openai??n.azure;if(r&&(vr(t,Ls,r.cachedPromptTokens),vr(t,"gen_ai.usage.output_tokens.reasoning",r.reasoningTokens),vr(t,"gen_ai.usage.output_tokens.prediction_accepted",r.acceptedPredictionTokens),vr(t,"gen_ai.usage.output_tokens.prediction_rejected",r.rejectedPredictionTokens),t["gen_ai.conversation.id"]||vr(t,"gen_ai.conversation.id",r.responseId)),n.anthropic){let o=n.anthropic.usage?.cache_read_input_tokens??n.anthropic.cacheReadInputTokens;vr(t,Ls,o);let s=n.anthropic.usage?.cache_creation_input_tokens??n.anthropic.cacheCreationInputTokens;vr(t,wy,s)}n.bedrock?.usage&&(vr(t,Ls,n.bedrock.usage.cacheReadInputTokens),vr(t,wy,n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(vr(t,Ls,n.deepseek.promptCacheHitTokens),vr(t,"gen_ai.usage.input_tokens.cache_miss",n.deepseek.promptCacheMissTokens))}catch{}}function vr(t,e,n){n!=null&&(t[e]=n)}var ws="OpenAI",Ij={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},Jue=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],Oj=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...Jue];function Nj(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion"}function bj(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="response"}function Cj(t){if(t===null||typeof t!="object"||!("object"in t))return!1;let e=t;return e.object==="list"&&typeof e.model=="string"&&e.model.toLowerCase().includes("embedding")}function Pj(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="conversation"}function Mj(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.startsWith("response.")}function xj(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion.chunk"}function vj(t,e,n){if(bm(t,e.id,e.model,e.created),e.usage&&Ep(t,e.usage.prompt_tokens,e.usage.completion_tokens,e.usage.total_tokens),Array.isArray(e.choices)){let r=e.choices.map(o=>o.finish_reason).filter(o=>o!==null);if(r.length>0&&t.setAttributes({[yn]:JSON.stringify(r)}),n){let o=e.choices.map(s=>s.message?.tool_calls).filter(s=>Array.isArray(s)&&s.length>0).flat();o.length>0&&t.setAttributes({[Ot]:JSON.stringify(o)})}}}function Lj(t,e,n){if(bm(t,e.id,e.model,e.created_at),e.status&&t.setAttributes({[yn]:JSON.stringify([e.status])}),e.usage&&Ep(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.total_tokens),n){let r=e;if(Array.isArray(r.output)&&r.output.length>0){let o=r.output.filter(s=>typeof s=="object"&&s!==null&&s.type==="function_call");o.length>0&&t.setAttributes({[Ot]:JSON.stringify(o)})}}}function Dj(t,e){t.setAttributes({[jy]:e.model,[ft]:e.model}),e.usage&&Ep(t,e.usage.prompt_tokens,void 0,e.usage.total_tokens)}function Uj(t,e){let{id:n,created_at:r}=e;t.setAttributes({[By]:n,[or]:n,[_p]:n}),r&&t.setAttributes({[Hy]:new Date(r*1e3).toISOString()})}function Ep(t,e,n,r){e!==void 0&&t.setAttributes({[W1]:e,[Pe]:e}),n!==void 0&&t.setAttributes({[Y1]:n,[Ze]:n}),r!==void 0&&t.setAttributes({[ln]:r})}function bm(t,e,n,r){t.setAttributes({[By]:e,[or]:e}),t.setAttributes({[jy]:n,[ft]:n}),t.setAttributes({[Hy]:new Date(r*1e3).toISOString()})}function Zue(t){if("conversation"in t&&typeof t.conversation=="string")return t.conversation;if("previous_response_id"in t&&typeof t.previous_response_id=="string")return t.previous_response_id}function wj(t){let e={[He]:t.model??"unknown"};"temperature"in t&&(e[Ms]=t.temperature),"top_p"in t&&(e[vs]=t.top_p),"frequency_penalty"in t&&(e[xs]=t.frequency_penalty),"presence_penalty"in t&&(e[jc]=t.presence_penalty),"stream"in t&&(e[Gc]=t.stream),"encoding_format"in t&&(e[M1]=t.encoding_format),"dimensions"in t&&(e[x1]=t.dimensions);let n=Zue(t);return n&&(e[_p]=n),e}function ele(t,e){for(let n of t){let r=n.index;if(!(r===void 0||!n.function))if(!(r in e.chatCompletionToolCalls))e.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{let o=e.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function tle(t,e,n){e.responseId=t.id??e.responseId,e.responseModel=t.model??e.responseModel,e.responseTimestamp=t.created??e.responseTimestamp,t.usage&&(e.promptTokens=t.usage.prompt_tokens,e.completionTokens=t.usage.completion_tokens,e.totalTokens=t.usage.total_tokens);for(let r of t.choices??[])n&&(r.delta?.content&&e.responseTexts.push(r.delta.content),r.delta?.tool_calls&&ele(r.delta.tool_calls,e)),r.finish_reason&&e.finishReasons.push(r.finish_reason)}function nle(t,e,n,r){if(!(t&&typeof t=="object")){e.eventTypes.push("unknown:non-object");return}if(t instanceof Error){r.setStatus({code:2,message:"internal_error"}),te(t,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in t))return;let o=t;if(!Oj.includes(o.type)){e.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&e.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){e.responseTexts.push(o.delta);return}if("response"in o){let{response:s}=o;e.responseId=s.id??e.responseId,e.responseModel=s.model??e.responseModel,e.responseTimestamp=s.created_at??e.responseTimestamp,s.usage&&(e.promptTokens=s.usage.input_tokens,e.completionTokens=s.usage.output_tokens,e.totalTokens=s.usage.total_tokens),s.status&&e.finishReasons.push(s.status),n&&s.output_text&&e.responseTexts.push(s.output_text)}}async function*kj(t,e,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",responseTimestamp:0,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let o of t)xj(o)?tle(o,r,n):Mj(o)&&nle(o,r,n,e),yield o}finally{bm(e,r.responseId,r.responseModel,r.responseTimestamp),Ep(e,r.promptTokens,r.completionTokens,r.totalTokens),e.setAttributes({[Xi]:!0}),r.finishReasons.length&&e.setAttributes({[yn]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length&&e.setAttributes({[rt]:r.responseTexts.join("")});let s=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];s.length>0&&e.setAttributes({[Ot]:JSON.stringify(s)}),e.end()}}function rle(t){let e=Array.isArray(t.tools)?t.tools:[],r=t.web_search_options&&typeof t.web_search_options=="object"?[{type:"web_search_options",...t.web_search_options}]:[],o=[...e,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(s){C&&g.error("Failed to serialize OpenAI tools:",s);return}}function ole(t,e){let n={[Ps]:"openai",[Dt]:e,[W]:"auto.ai.openai"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0],o=rle(r);o&&(n[Zr]=o),Object.assign(n,wj(r))}else n[He]="unknown";return n}function sle(t,e,n){if(!e||typeof e!="object")return;let r=e;if(Nj(r)){if(vj(t,r,n),n&&r.choices?.length){let o=r.choices.map(s=>s.message?.content||"");t.setAttributes({[rt]:JSON.stringify(o)})}}else bj(r)?(Lj(t,r,n),n&&r.output_text&&t.setAttributes({[rt]:r.output_text})):Cj(r)?Dj(t,r):Pj(r)&&Uj(t,r)}function Gj(t,e,n){if(n==="embeddings"&&"input"in e){let a=e.input;if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;t.setAttribute(Hc,typeof a=="string"?a:JSON.stringify(a));return}let r="input"in e?e.input:"messages"in e?e.messages:void 0;if(!r||Array.isArray(r)&&r.length===0)return;let{systemInstructions:o,filteredMessages:s}=Fn(r);o&&t.setAttribute(Hn,o);let i=ea(s);t.setAttribute(Ut,i),Array.isArray(s)?t.setAttribute(pn,s.length):t.setAttribute(pn,1)}function ile(t,e,n,r,o){return function(...i){let a=n.operation,c=ole(i,a),l=c[He]||"unknown",p=i[0],d=p&&typeof p=="object"&&p.stream===!0,_={name:`${a} ${l}`,op:`gen_ai.${a}`,attributes:c};if(d){let h,T=It(_,S=>(h=t.apply(r,i),o.recordInputs&&p&&Gj(S,p,a),(async()=>{try{let R=await h;return kj(R,S,o.recordOutputs??!1)}catch(R){throw S.setStatus({code:2,message:"internal_error"}),te(R,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:e}}}),S.end(),R}})()));return Vc(h,T,"auto.ai.openai")}let f,m=xr(_,h=>(f=t.apply(r,i),o.recordInputs&&p&&Gj(h,p,a),f.then(T=>(sle(h,T,o.recordOutputs),T),T=>{throw te(T,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:e}}}),T})));return Vc(f,m,"auto.ai.openai")}}function Bj(t,e="",n){return new Proxy(t,{get(r,o){let s=r[o],i=Fc(e,String(o)),a=Ij[i];return typeof s=="function"&&a?ile(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?Bj(s,i,n):s}})}function Cm(t,e){return Bj(t,"",eo(e))}var ks="Anthropic_AI",jj={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function Hj(t,e){if(Array.isArray(e)&&e.length===0)return;let{systemInstructions:n,filteredMessages:r}=Fn(e);n&&t.setAttributes({[Hn]:n});let o=Array.isArray(r)?r.length:1;t.setAttributes({[Ut]:ea(r),[pn]:o})}var ale={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function tI(t){return t&&ale[t]||"internal_error"}function Fj(t,e){e.error&&(t.setStatus({code:2,message:tI(e.error.type)}),te(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function Vj(t){let{system:e,messages:n,input:r}=t,o=typeof e=="string"?[{role:"system",content:t.system}]:[],s=Array.isArray(r)?r:r!=null?[r]:void 0,i=Array.isArray(n)?n:n!=null?[n]:[],a=s??i;return[...o,...a]}function cle(t,e){return"type"in t&&typeof t.type=="string"&&t.type==="error"?(e.setStatus({code:2,message:tI(t.error?.type)}),te(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function ule(t,e){if(t.type==="message_delta"&&t.usage&&"output_tokens"in t.usage&&typeof t.usage.output_tokens=="number"&&(e.completionTokens=t.usage.output_tokens),t.message){let n=t.message;n.id&&(e.responseId=n.id),n.model&&(e.responseModel=n.model),n.stop_reason&&e.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(e.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(e.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(e.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function lle(t,e){t.type!=="content_block_start"||typeof t.index!="number"||!t.content_block||(t.content_block.type==="tool_use"||t.content_block.type==="server_tool_use")&&(e.activeToolBlocks[t.index]={id:t.content_block.id,name:t.content_block.name,inputJsonParts:[]})}function ple(t,e,n){if(!(t.type!=="content_block_delta"||!t.delta)){if(typeof t.index=="number"&&"partial_json"in t.delta&&typeof t.delta.partial_json=="string"){let r=e.activeToolBlocks[t.index];r&&r.inputJsonParts.push(t.delta.partial_json)}n&&typeof t.delta.text=="string"&&e.responseTexts.push(t.delta.text)}}function dle(t,e){if(t.type!=="content_block_stop"||typeof t.index!="number")return;let n=e.activeToolBlocks[t.index];if(!n)return;let r=n.inputJsonParts.join(""),o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}e.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete e.activeToolBlocks[t.index]}function qj(t,e,n,r){!(t&&typeof t=="object")||cle(t,r)||(ule(t,e),lle(t,e),ple(t,e,n),dle(t,e))}function _le(t,e,n){e.isRecording()&&(t.responseId&&e.setAttributes({[or]:t.responseId}),t.responseModel&&e.setAttributes({[ft]:t.responseModel}),hp(e,t.promptTokens,t.completionTokens,t.cacheCreationInputTokens,t.cacheReadInputTokens),e.setAttributes({[Xi]:!0}),t.finishReasons.length>0&&e.setAttributes({[yn]:JSON.stringify(t.finishReasons)}),n&&t.responseTexts.length>0&&e.setAttributes({[rt]:t.responseTexts.join("")}),n&&t.toolCalls.length>0&&e.setAttributes({[Ot]:JSON.stringify(t.toolCalls)}),e.end())}async function*$j(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let o of t)qj(o,r,n,e),yield o}finally{r.responseId&&e.setAttributes({[or]:r.responseId}),r.responseModel&&e.setAttributes({[ft]:r.responseModel}),hp(e,r.promptTokens,r.completionTokens,r.cacheCreationInputTokens,r.cacheReadInputTokens),e.setAttributes({[Xi]:!0}),r.finishReasons.length>0&&e.setAttributes({[yn]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length>0&&e.setAttributes({[rt]:r.responseTexts.join("")}),n&&r.toolCalls.length>0&&e.setAttributes({[Ot]:JSON.stringify(r.toolCalls)}),e.end()}}function Yj(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return t.on("streamEvent",o=>{qj(o,r,n,e)}),t.on("message",()=>{_le(r,e,n)}),t.on("error",o=>{te(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end())}),t}function fle(t,e,n){let r={[Ps]:"anthropic",[Dt]:n,[W]:"auto.ai.anthropic"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let o=t[0];o.tools&&Array.isArray(o.tools)&&(r[Zr]=JSON.stringify(o.tools)),r[He]=o.model??"unknown","temperature"in o&&(r[Ms]=o.temperature),"top_p"in o&&(r[vs]=o.top_p),"stream"in o&&(r[Gc]=o.stream),"top_k"in o&&(r[Em]=o.top_k),"frequency_penalty"in o&&(r[xs]=o.frequency_penalty),"max_tokens"in o&&(r[Bc]=o.max_tokens)}else e==="models.retrieve"||e==="models.get"?r[He]=t[0]:r[He]="unknown";return r}function nI(t,e){let n=Vj(e);Hj(t,n),"prompt"in e&&t.setAttributes({[P1]:JSON.stringify(e.prompt)})}function mle(t,e){if("content"in e&&Array.isArray(e.content)){t.setAttributes({[rt]:e.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of e.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&t.setAttributes({[Ot]:JSON.stringify(n)})}"completion"in e&&t.setAttributes({[rt]:e.completion}),"input_tokens"in e&&t.setAttributes({[rt]:JSON.stringify(e.input_tokens)})}function hle(t,e){"id"in e&&"model"in e&&(t.setAttributes({[or]:e.id,[ft]:e.model}),"created"in e&&typeof e.created=="number"&&t.setAttributes({[Fy]:new Date(e.created*1e3).toISOString()}),"created_at"in e&&typeof e.created_at=="number"&&t.setAttributes({[Fy]:new Date(e.created_at*1e3).toISOString()}),"usage"in e&&e.usage&&hp(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.cache_creation_input_tokens,e.usage.cache_read_input_tokens))}function Tle(t,e,n){if(!(!e||typeof e!="object")){if("type"in e&&e.type==="error"){Fj(t,e);return}n&&mle(t,e),hle(t,e)}}function Wj(t,e,n){throw te(t,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end()),t}function Ele(t,e,n,r,o,s,i,a,c,l,p){let d=o[He]??"unknown",_={name:`${s} ${d}`,op:`gen_ai.${s}`,attributes:o};if(l&&!p){let f,m=It(_,h=>(f=t.apply(n,r),c.recordInputs&&a&&nI(h,a),(async()=>{try{let T=await f;return $j(T,h,c.recordOutputs??!1)}catch(T){return Wj(T,h,i)}})()));return Vc(f,m,"auto.ai.anthropic")}else return It(_,f=>{try{c.recordInputs&&a&&nI(f,a);let m=e.apply(n,r);return Yj(m,f,c.recordOutputs??!1)}catch(m){return Wj(m,f,i)}})}function Sle(t,e,n,r,o){return new Proxy(t,{apply(s,i,a){let c=n.operation,l=fle(a,e,c),p=l[He]??"unknown",d=typeof a[0]=="object"?a[0]:void 0,_=!!d?.stream,f=n.streaming===!0;if(_||f)return Ele(t,s,r,a,l,c,e,d,o,_,f);let m,h=xr({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:l},T=>(m=s.apply(r,a),o.recordInputs&&d&&nI(T,d),m.then(S=>(Tle(T,S,o.recordOutputs),S),S=>{throw te(S,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:e}}}),S})));return Vc(m,h,"auto.ai.anthropic")}})}function zj(t,e="",n){return new Proxy(t,{get(r,o){let s=r[o],i=Fc(e,String(o)),a=jj[i];return typeof s=="function"&&a?Sle(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?zj(s,i,n):s}})}function Pm(t,e){return zj(t,"",eo(e))}var Gs="Google_GenAI",Kj={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{operation:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},Qj="google_genai",rI="chats.create",Xj="chat";function gle(t,e){let n=t?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return e.setStatus({code:2,message:"internal_error"}),te(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function Ale(t,e){typeof t.responseId=="string"&&(e.responseId=t.responseId),typeof t.modelVersion=="string"&&(e.responseModel=t.modelVersion);let n=t.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(e.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(e.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(e.totalTokens=n.totalTokenCount))}function Rle(t,e,n){Array.isArray(t.functionCalls)&&e.toolCalls.push(...t.functionCalls);for(let r of t.candidates??[]){r?.finishReason&&!e.finishReasons.includes(r.finishReason)&&e.finishReasons.push(r.finishReason);for(let o of r?.content?.parts??[])n&&o.text&&e.responseTexts.push(o.text),o.functionCall&&e.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function yle(t,e,n,r){!t||gle(t,r)||(Ale(t,e),Rle(t,e,n))}async function*Jj(t,e,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of t)yle(o,r,n,e),yield o}finally{let o={[Xi]:!0};r.responseId&&(o[or]=r.responseId),r.responseModel&&(o[ft]=r.responseModel),r.promptTokens!==void 0&&(o[Pe]=r.promptTokens),r.completionTokens!==void 0&&(o[Ze]=r.completionTokens),r.totalTokens!==void 0&&(o[ln]=r.totalTokens),r.finishReasons.length&&(o[yn]=JSON.stringify(r.finishReasons)),n&&r.responseTexts.length&&(o[rt]=r.responseTexts.join("")),n&&r.toolCalls.length&&(o[Ot]=JSON.stringify(r.toolCalls)),e.setAttributes(o),e.end()}}function $c(t,e="user"){return typeof t=="string"?[{role:e,content:t}]:Array.isArray(t)?t.flatMap(n=>$c(n,e)):typeof t!="object"||!t?[]:"role"in t&&typeof t.role=="string"?[t]:"parts"in t?[{...t,role:e}]:[{role:e,content:t}]}function Zj(t,e){if("model"in t&&typeof t.model=="string")return t.model;if(e&&typeof e=="object"){let n=e;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function Ile(t){let e={};return"temperature"in t&&typeof t.temperature=="number"&&(e[Ms]=t.temperature),"topP"in t&&typeof t.topP=="number"&&(e[vs]=t.topP),"topK"in t&&typeof t.topK=="number"&&(e[Em]=t.topK),"maxOutputTokens"in t&&typeof t.maxOutputTokens=="number"&&(e[Bc]=t.maxOutputTokens),"frequencyPenalty"in t&&typeof t.frequencyPenalty=="number"&&(e[xs]=t.frequencyPenalty),"presencePenalty"in t&&typeof t.presencePenalty=="number"&&(e[jc]=t.presencePenalty),e}function Ole(t,e,n){let r={[Ps]:Qj,[Dt]:t,[W]:"auto.ai.google_genai"};if(e){if(r[He]=Zj(e,n),"config"in e&&typeof e.config=="object"&&e.config){let o=e.config;if(Object.assign(r,Ile(o)),"tools"in o&&Array.isArray(o.tools)){let s=o.tools.flatMap(i=>i.functionDeclarations);r[Zr]=JSON.stringify(s)}}}else r[He]=Zj({},n);return r}function eH(t,e,n){if(n){let o=e.contents;o!=null&&t.setAttribute(Hc,typeof o=="string"?o:JSON.stringify(o));return}let r=[];if("config"in e&&e.config&&typeof e.config=="object"&&"systemInstruction"in e.config&&e.config.systemInstruction&&r.push(...$c(e.config.systemInstruction,"system")),"history"in e&&r.push(...$c(e.history,"user")),"contents"in e&&r.push(...$c(e.contents,"user")),"message"in e&&r.push(...$c(e.message,"user")),Array.isArray(r)&&r.length){let{systemInstructions:o,filteredMessages:s}=Fn(r);o&&t.setAttribute(Hn,o);let i=Array.isArray(s)?s.length:0;t.setAttributes({[pn]:i,[Ut]:JSON.stringify(Us(s))})}}function Nle(t,e,n){if(!(!e||typeof e!="object")){if(e.modelVersion&&t.setAttribute(ft,e.modelVersion),e.usageMetadata&&typeof e.usageMetadata=="object"){let r=e.usageMetadata;typeof r.promptTokenCount=="number"&&t.setAttributes({[Pe]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&t.setAttributes({[Ze]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&t.setAttributes({[ln]:r.totalTokenCount})}if(n&&Array.isArray(e.candidates)&&e.candidates.length>0){let r=e.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(s=>typeof s.text=="string"?s.text:"").filter(s=>s.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&t.setAttributes({[rt]:r.join("")})}if(n&&e.functionCalls){let r=e.functionCalls;Array.isArray(r)&&r.length>0&&t.setAttributes({[Ot]:JSON.stringify(r)})}}}function tH(t,e,n,r,o){let s=e===rI,i=n.operation==="embeddings";return new Proxy(t,{apply(a,c,l){let p=n.operation,d=l[0],_=Ole(p,d,r),f=_[He]??"unknown";return n.streaming?It({name:`${p} ${f}`,op:`gen_ai.${p}`,attributes:_},async m=>{try{o.recordInputs&&d&&eH(m,d,i);let h=await a.apply(r,l);return Jj(h,m,!!o.recordOutputs)}catch(h){throw m.setStatus({code:2,message:"internal_error"}),te(h,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}}),m.end(),h}}):xr({name:s?`${p} ${f} create`:`${p} ${f}`,op:`gen_ai.${p}`,attributes:_},m=>(o.recordInputs&&d&&eH(m,d,i),Mr(()=>a.apply(r,l),h=>{te(h,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}})},()=>{},h=>{!s&&!i&&Nle(m,h,o.recordOutputs)})))}})}function oI(t,e="",n){return new Proxy(t,{get:(r,o,s)=>{let i=Reflect.get(r,o,s),a=Fc(e,String(o)),c=Kj[a];if(typeof i=="function"&&c){if(a===rI){let l=tH(i,a,c,r,n);return function(...d){let _=l(...d);return _&&typeof _=="object"?oI(_,Xj,n):_}}return tH(i,a,c,r,n)}return typeof i=="function"?i.bind(r):i&&typeof i=="object"?oI(i,a,n):i}})}function Mm(t,e){return oI(t,"",eo(e))}var xm="LangChain",na="auto.ai.langchain",nH={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var sr=(t,e,n)=>{n!=null&&(t[e]=n)},Vn=(t,e,n)=>{let r=Number(n);Number.isNaN(r)||(t[e]=r)};function Go(t){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function Yc(t){if(Array.isArray(t))try{let e=t.map(n=>n&&typeof n=="object"&&Ds(n)?Zi(n):n);return JSON.stringify(e)}catch{return String(t)}return Go(t)}function Sp(t){let e=t.toLowerCase();return nH[e]??e}function rH(t){return t.includes("System")?"system":t.includes("Human")?"user":t.includes("AI")||t.includes("Assistant")?"assistant":t.includes("Function")?"function":t.includes("Tool")?"tool":"user"}function sI(t){if(!(!t||Array.isArray(t)))return t.invocation_params}function gp(t){return t.map(e=>{let n=e._getType;if(typeof n=="function"){let o=n.call(e);return{role:Sp(o),content:Yc(e.content)}}if(e.lc===1&&e.kwargs){let o=e.id,s=Array.isArray(o)&&o.length>0?o[o.length-1]:"",i=typeof s=="string"?rH(s):"user";return{role:Sp(i),content:Yc(e.kwargs?.content)}}if(e.type){let o=String(e.type).toLowerCase();return{role:Sp(o),content:Yc(e.content)}}if(e.role)return{role:Sp(String(e.role)),content:Yc(e.content)};let r=e.constructor?.name;return r&&r!=="Object"?{role:Sp(rH(r)),content:Yc(e.content)}:{role:"user",content:Yc(e.content)}})}function ble(t,e,n){let r={},o="kwargs"in t?t.kwargs:void 0,s=e?.temperature??n?.ls_temperature??o?.temperature;Vn(r,Ms,s);let i=e?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Vn(r,Bc,i);let a=e?.top_p??o?.top_p;Vn(r,vs,a);let c=e?.frequency_penalty;Vn(r,xs,c);let l=e?.presence_penalty;return Vn(r,jc,l),e&&"stream"in e&&sr(r,Gc,!!e.stream),r}function oH(t,e,n,r,o){return{[Ps]:Go(t??"langchain"),[Dt]:"chat",[He]:Go(e),[W]:na,...ble(n,r,o)}}function sH(t,e,n,r,o){let s=o?.ls_provider,i=r?.model??o?.ls_model_name??"unknown",a=oH(s,i,t,r,o);if(n&&Array.isArray(e)&&e.length>0){sr(a,pn,e.length);let c=e.map(l=>({role:"user",content:l}));sr(a,Ut,Go(c))}return a}function iH(t,e,n,r,o){let s=o?.ls_provider??t.id?.[2],i=r?.model??o?.ls_model_name??"unknown",a=oH(s,i,t,r,o);if(n&&Array.isArray(e)&&e.length>0){let c=gp(e.flat()),{systemInstructions:l,filteredMessages:p}=Fn(c);l&&sr(a,Hn,l);let d=Array.isArray(p)?p.length:0;sr(a,pn,d);let _=Us(p);sr(a,Ut,Go(_))}return a}function Cle(t,e){let n=[],r=t.flat();for(let o of r){let s=o.message?.content;if(Array.isArray(s))for(let i of s){let a=i;a.type==="tool_use"&&n.push(a)}}n.length>0&&sr(e,Ot,Go(n))}function Ple(t,e){if(!t)return;let n=t.tokenUsage,r=t.usage;if(n)Vn(e,Pe,n.promptTokens),Vn(e,Ze,n.completionTokens),Vn(e,ln,n.totalTokens);else if(r){Vn(e,Pe,r.input_tokens),Vn(e,Ze,r.output_tokens);let o=Number(r.input_tokens),s=Number(r.output_tokens),i=(Number.isNaN(o)?0:o)+(Number.isNaN(s)?0:s);i>0&&Vn(e,ln,i),r.cache_creation_input_tokens!==void 0&&Vn(e,U1,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Vn(e,w1,r.cache_read_input_tokens)}}function aH(t,e){if(!t)return;let n={};if(Array.isArray(t.generations)){let l=t.generations.flat().map(p=>p.generationInfo?.finish_reason?p.generationInfo.finish_reason:p.generation_info?.finish_reason?p.generation_info.finish_reason:null).filter(p=>typeof p=="string");if(l.length>0&&sr(n,yn,Go(l)),Cle(t.generations,n),e){let p=t.generations.flat().map(d=>d.text??d.message?.content).filter(d=>typeof d=="string");p.length>0&&sr(n,rt,Go(p))}}Ple(t.llmOutput,n);let r=t.llmOutput,s=t.generations?.[0]?.[0]?.message,i=r?.model_name??r?.model??s?.response_metadata?.model_name;i&&sr(n,ft,i);let a=r?.id??s?.id;a&&sr(n,or,a);let c=r?.stop_reason??s?.response_metadata?.finish_reason;return c&&sr(n,v1,Go(c)),n}function vm(t={}){let{recordInputs:e,recordOutputs:n}=eo(t),r=new Map,o=i=>{let a=r.get(i);a?.isRecording()&&(a.end(),r.delete(i))},s={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(i,a,c,l,p,d,_,f){let m=sI(d),h=sH(i,a,e,m,_),T=h[He],S=h[Dt];It({name:`${S} ${T}`,op:"gen_ai.chat",attributes:{...h,[ee]:"gen_ai.chat"}},R=>(r.set(c,R),R))},handleChatModelStart(i,a,c,l,p,d,_,f){let m=sI(d),h=iH(i,a,e,m,_),T=h[He],S=h[Dt];It({name:`${S} ${T}`,op:"gen_ai.chat",attributes:{...h,[ee]:"gen_ai.chat"}},R=>(r.set(c,R),R))},handleLLMEnd(i,a,c,l,p){let d=r.get(a);if(d?.isRecording()){let _=aH(i,n);_&&d.setAttributes(_),o(a)}},handleLLMError(i,a){let c=r.get(a);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),o(a)),te(i,{mechanism:{handled:!1,type:`${na}.llm_error_handler`}})},handleChainStart(i,a,c,l,p,d,_,f){let m=f||i.name||"unknown_chain",h={[W]:"auto.ai.langchain","langchain.chain.name":m};e&&(h["langchain.chain.inputs"]=JSON.stringify(a)),It({name:`chain ${m}`,op:"gen_ai.invoke_agent",attributes:{...h,[ee]:"gen_ai.invoke_agent"}},T=>(r.set(c,T),T))},handleChainEnd(i,a){let c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({"langchain.chain.outputs":JSON.stringify(i)}),o(a))},handleChainError(i,a){let c=r.get(a);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),o(a)),te(i,{mechanism:{handled:!1,type:`${na}.chain_error_handler`}})},handleToolStart(i,a,c,l){let p=i.name||"unknown_tool",d={[W]:na,[Ji]:p};e&&(d[gm]=a),It({name:`execute_tool ${p}`,op:"gen_ai.execute_tool",attributes:{...d,[ee]:"gen_ai.execute_tool"}},_=>(r.set(c,_),_))},handleToolEnd(i,a){let c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({[Am]:JSON.stringify(i)}),o(a))},handleToolError(i,a){let c=r.get(a);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),o(a)),te(i,{mechanism:{handled:!1,type:`${na}.tool_error_handler`}})},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}var Lm="LangGraph",iI="auto.ai.langgraph";function Mle(t){if(!t||t.length===0)return null;let e=[];for(let n of t)if(n&&typeof n=="object"){let r=n.tool_calls;r&&Array.isArray(r)&&e.push(...r)}return e.length>0?e:null}function xle(t){let e=t,n=0,r=0,o=0;if(e.usage_metadata&&typeof e.usage_metadata=="object"){let s=e.usage_metadata;return typeof s.input_tokens=="number"&&(n=s.input_tokens),typeof s.output_tokens=="number"&&(r=s.output_tokens),typeof s.total_tokens=="number"&&(o=s.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(e.response_metadata&&typeof e.response_metadata=="object"){let s=e.response_metadata;if(s.tokenUsage&&typeof s.tokenUsage=="object"){let i=s.tokenUsage;typeof i.promptTokens=="number"&&(n=i.promptTokens),typeof i.completionTokens=="number"&&(r=i.completionTokens),typeof i.totalTokens=="number"&&(o=i.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function vle(t,e){let n=e;if(n.response_metadata&&typeof n.response_metadata=="object"){let r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&t.setAttribute(ft,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&t.setAttribute(yn,[r.finish_reason])}}function cH(t){if(!t.builder?.nodes?.tools?.runnable?.tools)return null;let e=t.builder?.nodes?.tools?.runnable?.tools;return!e||!Array.isArray(e)||e.length===0?null:e.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function uH(t,e,n){let o=n?.messages;if(!o||!Array.isArray(o))return;let s=e?.length??0,i=o.length>s?o.slice(s):[];if(i.length===0)return;let a=Mle(i);a&&t.setAttribute(Ot,JSON.stringify(a));let c=gp(i);t.setAttribute(rt,JSON.stringify(c));let l=0,p=0,d=0;for(let _ of i){let f=xle(_);l+=f.inputTokens,p+=f.outputTokens,d+=f.totalTokens,vle(t,_)}l>0&&t.setAttribute(Pe,l),p>0&&t.setAttribute(Ze,p),d>0&&t.setAttribute(ln,d)}function aI(t,e){return new Proxy(t,{apply(n,r,o){return xr({op:"gen_ai.create_agent",name:"create_agent",attributes:{[W]:iI,[ee]:"gen_ai.create_agent",[Dt]:"create_agent"}},s=>{try{let i=Reflect.apply(n,r,o),a=o.length>0?o[0]:{};a?.name&&typeof a.name=="string"&&(s.setAttribute(Uy,a.name),s.updateName(`create_agent ${a.name}`));let c=i.invoke;return c&&typeof c=="function"&&(i.invoke=Lle(c.bind(i),i,a,e)),i}catch(i){throw s.setStatus({code:2,message:"internal_error"}),te(i,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),i}})}})}function Lle(t,e,n,r){return new Proxy(t,{apply(o,s,i){return xr({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[W]:iI,[ee]:Sm,[Dt]:"invoke_agent"}},async a=>{try{let c=n?.name;c&&typeof c=="string"&&(a.setAttribute(D1,c),a.setAttribute(Uy,c),a.updateName(`invoke_agent ${c}`));let d=(i.length>1?i[1]:void 0)?.configurable?.thread_id;d&&typeof d=="string"&&a.setAttribute(_p,d);let _=cH(e);_&&a.setAttribute(Zr,JSON.stringify(_));let f=r.recordInputs,m=r.recordOutputs,h=i.length>0?i[0]?.messages??[]:[];if(h&&f){let S=gp(h),{systemInstructions:R,filteredMessages:I}=Fn(S);R&&a.setAttribute(Hn,R);let x=Us(I),F=Array.isArray(I)?I.length:0;a.setAttributes({[Ut]:JSON.stringify(x),[pn]:F})}let T=await Reflect.apply(o,s,i);return m&&uH(a,h??null,T),T}catch(c){throw a.setStatus({code:2,message:"internal_error"}),te(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}})}function Dm(t,e){return t.compile=aI(t.compile,eo(e)),t}function Ap(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}function Rp(t,e,n){let r=t[e];if(typeof r=="function"){try{t[e]=n}catch{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=n}catch{Object.defineProperty(t,"default",{value:n,writable:!0,configurable:!0,enumerable:!0})}}}function pH(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function dH(t){let e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(r);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(n);if(i){let a,c,l,p,d;if(i[1]){l=i[1];let h=l.lastIndexOf(".");if(l[h-1]==="."&&h--,h>0){a=l.slice(0,h),c=l.slice(h+1);let T=a.indexOf(".Module");T>0&&(l=l.slice(T+1),a=a.slice(0,T))}p=void 0}c&&(p=a,d=c),c==="<anonymous>"&&(d=void 0,l=void 0),l===void 0&&(d=d||Mf,l=p?`${p}.${d}`:d);let _=MG(i[2]),f=i[5]==="native";!_&&i[5]&&!f&&(_=i[5]);let m=_?Dle(_):void 0;return{filename:m??_,module:m&&t?.(m),function:l,lineno:lH(i[3]),colno:lH(i[4]),in_app:pH(_||"",f)}}if(o.match(e))return{filename:o}}}function cI(t){return[90,dH(t)]}function lH(t){return parseInt(t||"",10)||void 0}function Dle(t){try{return decodeURI(t)}catch{return}}var In=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let n=this._cache.get(e);if(n!==void 0)return this._cache.delete(e),this._cache.set(e,n),n}set(e,n){if(this._cache.size>=this._maxSize){let r=this._cache.keys().next().value;this._cache.delete(r)}this._cache.set(e,n)}remove(e){let n=this._cache.get(e);return n&&this._cache.delete(e),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(n=>e.push(n)),e}};var uI=K(ne(),1),yp={};function w(t,e,n){return n?rpe(t,e,n):npe(t,e)}function npe(t,e){return Object.assign(n=>{let r=yp[t];if(r)return n&&r.setConfig(n),r;let o=e(n);return yp[t]=o,(0,uI.registerInstrumentations)({instrumentations:[o]}),o},{id:t})}function rpe(t,e,n){return Object.assign(r=>{let o=n(r),s=yp[t];if(s)return s.setConfig(o),s;let i=new e(o);return yp[t]=i,(0,uI.registerInstrumentations)({instrumentations:[i]}),i},{id:t})}function Ip(t){let e=!1,n=[];if(!ope(t))e=!0;else{let o=t._wrap;t._wrap=(...s)=>(e=!0,n.forEach(i=>i()),n=[],o(...s))}return o=>{e?o():n.push(o)}}function ope(t){return typeof t._wrap=="function"}b();import{subscribe as spe}from"node:diagnostics_channel";var re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Um="@sentry/instrumentation-http";function _H(t,e,n,r){let o=0,s=[];re&&g.log(r,"Patching request.on");let i=new WeakMap,a=n==="small"?1e3:n==="medium"?1e4:1048576;try{t.on=new Proxy(t.on,{apply:(c,l,p)=>{let[d,_,...f]=p;if(d==="data"){re&&g.log(r,`Handling request.on("data") with maximum body size of ${a}b`);let m=new Proxy(_,{apply:(h,T,S)=>{try{let R=S[0],I=Buffer.from(R);o<a?(s.push(I),o+=I.byteLength):re&&g.log(r,`Dropping request body chunk because maximum body length of ${a}b is exceeded.`)}catch{re&&g.error(r,"Encountered error while storing body chunk.")}return Reflect.apply(h,T,S)}});return i.set(_,m),Reflect.apply(c,l,[d,m,...f])}return Reflect.apply(c,l,p)}}),t.off=new Proxy(t.off,{apply:(c,l,p)=>{let[,d]=p,_=i.get(d);if(_){i.delete(d);let f=p.slice();return f[1]=_,Reflect.apply(c,l,f)}return Reflect.apply(c,l,p)}}),t.on("end",()=>{try{let c=Buffer.concat(s).toString("utf-8");if(c){let p=Buffer.byteLength(c,"utf-8")>a?`${Buffer.from(c).subarray(0,a-3).toString("utf-8")}...`:c;e.setSDKProcessingMetadata({normalizedRequest:{data:p}})}}catch(c){re&&g.error(r,"Error building captured request body",c)}})}catch(c){re&&g.error(r,"Error patching request to capture body",c)}}var fH=Un("sentry_http_server_instrumented"),pI="Http.Server",lI=new Map,mH=new WeakSet;function hH(t,e){nt(t,"_startSpanCallback",new WeakRef(e))}var ipe=(t={})=>{let e={sessions:t.sessions??!0,sessionFlushingDelayMS:t.sessionFlushingDelayMS??6e4,maxRequestBodySize:t.maxRequestBodySize??"medium",ignoreRequestBody:t.ignoreRequestBody};return{name:pI,setupOnce(){spe("http.server.request.start",r=>{ape(r.server,e)})},afterAllSetup(n){re&&n.getIntegrationByName("Http")&&g.warn("It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.")}}},Op=ipe;function ape(t,{ignoreRequestBody:e,maxRequestBodySize:n,sessions:r,sessionFlushingDelayMS:o}){let s=t.emit;if(mH.has(s))return;let i=new Proxy(s,{apply(a,c,l){if(l[0]!=="request")return a.apply(c,l);let p=H();if(P.active().getValue(fH)||!p)return a.apply(c,l);re&&g.log(pI,"Handling incoming request");let d=ue().clone(),_=l[1],f=l[2],m=dp(_),h=_.ip||_.socket?.remoteAddress,T=_.url||"/";n!=="none"&&!e?.(T,_)&&_H(_,d,n,pI),d.setSDKProcessingMetadata({normalizedRequest:m,ipAddress:h});let S=(_.method||"GET").toUpperCase(),R=ko(T),I=`${S} ${R}`;return d.setTransactionName(I),r&&p&&cpe(p,{requestIsolationScope:d,response:f,sessionFlushingDelayMS:o??6e4}),Wl(d,()=>{let x={traceId:zt(),sampleRand:yt(),propagationSpanId:Kt()};he().setPropagationContext({...x}),d.setPropagationContext({...x});let F=Ar.extract(P.active(),m.headers).setValue(fH,!0);return P.with(F,()=>{p.emit("httpServerRequest",_,f,m);let B=_._startSpanCallback?.deref();return B?B(()=>a.apply(c,l)):a.apply(c,l)})})}});mH.add(i),t.emit=i}function cpe(t,{requestIsolationScope:e,response:n,sessionFlushingDelayMS:r}){e.setSDKProcessingMetadata({requestSession:{status:"ok"}}),n.once("close",()=>{let o=e.getScopeData().sdkProcessingMetadata.requestSession;if(t&&o){re&&g.log(`Recorded request session with status: ${o.status}`);let s=new Date;s.setSeconds(0,0);let i=s.toISOString(),a=lI.get(t),c=a?.[i]||{exited:0,crashed:0,errored:0};if(c[{ok:"exited",crashed:"crashed",errored:"errored"}[o.status]]++,a)a[i]=c;else{re&&g.log("Opened new request session aggregate.");let l={[i]:c};lI.set(t,l);let p=()=>{clearTimeout(_),d(),lI.delete(t);let f=Object.entries(l).map(([m,h])=>({started:m,exited:h.exited,errored:h.errored,crashed:h.crashed}));t.sendSession({aggregates:f})},d=t.on("flush",()=>{re&&g.log("Sending request session aggregate due to client flush"),p()}),_=setTimeout(()=>{re&&g.log("Sending request session aggregate due to flushing schedule"),p()},r).unref()}}})}b();var Bo=K(Te(),1);le();import{errorMonitor as upe}from"node:events";var TH="Http.ServerSpans",lpe=(t={})=>{let e=t.ignoreStaticAssets??!0,n=t.ignoreIncomingRequests,r=t.ignoreStatusCodes??[[401,404],[301,303],[305,399]],{onSpanCreated:o}=t,{requestHook:s,responseHook:i,applyCustomAttributesOnSpan:a}=t.instrumentation??{};return{name:TH,setup(c){typeof __SENTRY_TRACING__<"u"&&!__SENTRY_TRACING__||c.on("httpServerRequest",(l,p,d)=>{let _=l,f=p;hH(_,h=>{if(_pe(_,{ignoreStaticAssets:e,ignoreIncomingRequests:n}))return re&&g.log(TH,"Skipping span creation for incoming request",_.url),h();let T=d.url||_.url||"/",S=pp(T),R=_.headers,I=R["user-agent"],x=R["x-forwarded-for"],F=_.httpVersion,B=R.host,se=B?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",ve=c.tracer,on=T.startsWith("https")?"https":"http",Io=d.method||_.method?.toUpperCase()||"GET",ss=S?S.pathname:ko(T),yi=`${Io} ${ss}`,Et=ve.startSpan(yi,{kind:Ne.SERVER,attributes:{[ee]:"http.server",[W]:"auto.http.otel.http","sentry.http.prefetch":ppe(_)||void 0,"http.url":T,"http.method":d.method,"http.target":S?`${S.pathname}${S.search}`:ss,"http.host":B,"net.host.name":se,"http.client_ip":typeof x=="string"?x.split(",")[0]:void 0,"http.user_agent":I,"http.scheme":on,"http.flavor":F,"net.transport":F?.toUpperCase()==="QUIC"?"ip_udp":"ip_tcp",...fpe(_),...lm(d.headers||{},c.getOptions().sendDefaultPii??!1)}});s?.(Et,_),i?.(Et,f),a?.(Et,_,f),o?.(Et,_,f);let $a={type:Bo.RPCType.HTTP,span:Et};return P.with((0,Bo.setRPCMetadata)(X.setSpan(P.active(),Et),$a),()=>{P.bind(P.active(),_),P.bind(P.active(),f);let Ya=!1;function DC(r_){if(Ya)return;Ya=!0;let UC=Tpe(_,f);Et.setAttributes(UC),Et.setStatus(r_),Et.end();let wC=UC["http.route"];wC&&ue().setTransactionName(`${_.method?.toUpperCase()||"GET"} ${wC}`)}return f.on("close",()=>{DC(Do(f.statusCode))}),f.on(upe,()=>{let r_=Do(f.statusCode);DC(r_.code===2?r_:{code:2})}),h()})})})},processEvent(c){if(c.type==="transaction"){let l=c.contexts?.trace?.data?.["http.response.status_code"];if(typeof l=="number"&&Epe(l,r))return re&&g.log("Dropping transaction due to status code",l),null}return c},afterAllSetup(c){re&&(c.getIntegrationByName("Http")&&g.warn("It seems that you have manually added `httpServerSpansIntergation` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`."),c.getIntegrationByName("Http.Server")||g.error("It seems that you have manually added `httpServerSpansIntergation` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration."))}}},Np=lpe;function ppe(t){return t.headers["next-router-prefetch"]==="1"}function dpe(t){let e=ko(t);return!!(e.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||e.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function _pe(t,{ignoreStaticAssets:e,ignoreIncomingRequests:n}){if((0,Bo.isTracingSuppressed)(P.active()))return!0;let r=t.url,o=t.method?.toUpperCase();return!!(o==="OPTIONS"||o==="HEAD"||!r||e&&o==="GET"&&dpe(r)||n?.(r,t))}function fpe(t){let e=mpe(t.headers);return e==null?{}:hpe(t.headers)?{"http.request_content_length":e}:{"http.request_content_length_uncompressed":e}}function mpe(t){let e=t["content-length"];if(e===void 0)return null;let n=parseInt(e,10);return isNaN(n)?null:n}function hpe(t){let e=t["content-encoding"];return!!e&&e!=="identity"}function Tpe(t,e){let{socket:n}=t,{statusCode:r,statusMessage:o}=e,s={[bo]:r,[Pi]:r,"http.status_text":o?.toUpperCase()},i=(0,Bo.getRPCMetadata)(P.active());if(n){let{localAddress:a,localPort:c,remoteAddress:l,remotePort:p}=n;s[Zg]=a,s[eA]=c,s[Jg]=l,s["net.peer.port"]=p}if(s[Pi]=r,s["http.status_text"]=(o||"").toUpperCase(),i?.type===Bo.RPCType.HTTP&&i.route!==void 0){let a=i.route;s[Co]=a}return s}function Epe(t,e){return e.some(n=>{if(typeof n=="number")return n===t;let[r,o]=n;return t>=r&&t<=o})}b();var AH=K(Te(),1),Cp=K(ne(),1);le();import{subscribe as dI,unsubscribe as _I}from"node:diagnostics_channel";import{errorMonitor as gH}from"node:events";function bp(t,e){if(!t)return e;let n=Vi(t),r=Vi(e);if(!r)return t;let o={},s={};for(let[c,l]of Object.entries(r))c.startsWith(Xr)?o[c]=l:s[c]=l;let i=Object.keys(o).length>0,a={};if(n)for(let[c,l]of Object.entries(n))i&&c.startsWith(Xr)||(a[c]=l);Object.assign(a,o);for(let[c,l]of Object.entries(s))a[c]||(a[c]=l);return Bf(a)}var Wc="@sentry/instrumentation-http";function EH(t,e){let n=Spe(t),r=e?.statusCode,o=Ap(r);rr({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function wm(t,e){let n=km(t),{tracePropagationTargets:r,propagateTraceparent:o}=H()?.getOptions()||{},s=Qi(n,r,e)?kc({propagateTraceparent:o}):void 0;if(!s)return;let{"sentry-trace":i,baggage:a,traceparent:c}=s;if(!t.getHeader("sentry-trace")){if(i)try{t.setHeader("sentry-trace",i),re&&g.log(Wc,"Added sentry-trace header to outgoing request")}catch(p){re&&g.error(Wc,"Failed to add sentry-trace header to outgoing request:",Kr(p)?p.message:"Unknown error")}if(c&&!t.getHeader("traceparent"))try{t.setHeader("traceparent",c),re&&g.log(Wc,"Added traceparent header to outgoing request")}catch(p){re&&g.error(Wc,"Failed to add traceparent header to outgoing request:",Kr(p)?p.message:"Unknown error")}if(a){let p=t.getHeader("baggage"),d=bp(p,a);if(d)try{t.setHeader("baggage",d),re&&g.log(Wc,"Added baggage header to outgoing request")}catch(_){re&&g.error(Wc,"Failed to add baggage header to outgoing request:",Kr(_)?_.message:"Unknown error")}}}}function Spe(t){try{let e=t.getHeader("host")||t.host,n=new URL(t.path,`${t.protocol}//${e}`),r=bs(n.toString()),o={url:Cs(r),"http.method":t.method||"GET"};return r.search&&(o["http.query"]=r.search),r.hash&&(o["http.fragment"]=r.hash),o}catch{return{}}}function SH(t){return{method:t.method,protocol:t.protocol,host:t.host,hostname:t.host,path:t.path,headers:t.getHeaders()}}function km(t){let e=t.getHeader("host")||t.host,n=t.protocol,r=t.path;return`${n}//${e}${r}`}var ra=class extends Cp.InstrumentationBase{constructor(e={}){super(Um,pe,e),this._propagationDecisionMap=new In(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){let e=!1,n=a=>{let c=a;this._onOutgoingRequestFinish(c.request,c.response)},r=a=>{let c=a;this._onOutgoingRequestFinish(c.request,void 0)},o=a=>{let c=a;this._onOutgoingRequestCreated(c.request)},s=a=>(e||(e=!0,dI("http.client.response.finish",n),dI("http.client.request.error",r),(this.getConfig().propagateTraceInOutgoingRequests||this.getConfig().createSpansForOutgoingRequests)&&dI("http.client.request.created",o)),a),i=()=>{_I("http.client.response.finish",n),_I("http.client.request.error",r),_I("http.client.request.created",o)};return[new Cp.InstrumentationNodeModuleDefinition("http",["*"],s,i),new Cp.InstrumentationNodeModuleDefinition("https",["*"],s,i)]}_startSpanForOutgoingRequest(e){let n=e.once,[r,o]=gpe(e),s=Xf({name:r,attributes:o,onlyIfParent:!0});this.getConfig().outgoingRequestHook?.(s,e);let i=new Proxy(n,{apply(l,p,d){let[_]=d;if(_!=="response")return l.apply(p,d);let f=P.active(),m=X.setSpan(f,s);return P.with(m,()=>l.apply(p,d))}});e.once=i;let a=!1,c=l=>{a||(a=!0,s.setStatus(l),s.end())};return e.prependListener("response",l=>{e.listenerCount("response")<=1&&l.resume(),P.bind(P.active(),l);let p=Ape(l);s.setAttributes(p),this.getConfig().outgoingResponseHook?.(s,l),this.getConfig().outgoingRequestApplyCustomAttributes?.(s,e,l);let d=(_=!1)=>{this._diag.debug("outgoingRequest on end()");let f=_||typeof l.statusCode!="number"||l.aborted&&!l.complete?{code:Be.ERROR}:Do(l.statusCode);c(f)};l.on("end",()=>{d()}),l.on(gH,_=>{this._diag.debug("outgoingRequest on response error()",_),d(!0)})}),e.on("close",()=>{c({code:Be.UNSET})}),e.on(gH,l=>{this._diag.debug("outgoingRequest on request error()",l),c({code:Be.ERROR})}),s}_onOutgoingRequestFinish(e,n){re&&g.log(Um,"Handling finished outgoing request");let r=this.getConfig().breadcrumbs,o=typeof r>"u"?!0:r,s=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,s),o&&!s&&EH(e,n)}_onOutgoingRequestCreated(e){re&&g.log(Um,"Handling outgoing request created");let n=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);if(this._ignoreOutgoingRequestsMap.set(e,n),n)return;let r=this.getConfig().createSpansForOutgoingRequests&&(this.getConfig().spans??!0),o=this.getConfig().propagateTraceInOutgoingRequests;if(r){let s=this._startSpanForOutgoingRequest(e);if(o&&s.isRecording()){let i=X.setSpan(P.active(),s);P.with(i,()=>{wm(e,this._propagationDecisionMap)})}else o&&wm(e,this._propagationDecisionMap)}else o&&wm(e,this._propagationDecisionMap)}_shouldIgnoreOutgoingRequest(e){if((0,AH.isTracingSuppressed)(P.active()))return!0;let n=this.getConfig().ignoreOutgoingRequests;if(!n)return!1;let r=SH(e),o=km(e);return n(o,r)}};function gpe(t){let e=km(t),[n,r]=Oy(pp(e),"client","auto.http.otel.http",t),o=t.getHeader("user-agent");return[n,{[ee]:"http.client","otel.kind":"CLIENT",[RA]:o,[cs]:e,"http.url":e,"http.method":t.method,"http.target":t.path||"/","net.peer.name":t.host,"http.host":t.getHeader("host"),...r}]}function Ape(t){let{statusCode:e,statusMessage:n,httpVersion:r,socket:o}=t,s=r.toUpperCase()!=="QUIC"?"ip_tcp":"ip_udp",i={[bo]:e,[hA]:r,"http.flavor":r,[TA]:s,"net.transport":s,"http.status_text":n?.toUpperCase(),"http.status_code":e,...Rpe(t)};if(o){let{remoteAddress:a,remotePort:c}=o;i[fA]=a,i[mA]=c,i["net.peer.ip"]=a,i["net.peer.port"]=c}return i}function Rpe(t){let e=ype(t.headers);return e==null?{}:Ipe(t.headers)?{[nA]:e}:{[rA]:e}}function ype(t){let e=t["content-length"];if(typeof e=="number")return e;if(typeof e!="string")return;let n=parseInt(e,10);if(!isNaN(n))return n}function Ipe(t){let e=t["content-encoding"];return!!e&&e!=="identity"}var RH="Http",Ope=w(`${RH}.sentry`,t=>new ra(t)),yH=(t={})=>{let e={sessions:t.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:t.sessionFlushingDelayMS,ignoreRequestBody:t.ignoreIncomingRequestBody,maxRequestBodySize:t.maxIncomingRequestBodySize},n={ignoreIncomingRequests:t.ignoreIncomingRequests,ignoreStaticAssets:t.ignoreStaticAssets,ignoreStatusCodes:t.dropSpansForIncomingRequestStatusCodes},r={breadcrumbs:t.breadcrumbs,propagateTraceInOutgoingRequests:t.tracePropagation??!0,ignoreOutgoingRequests:t.ignoreOutgoingRequests},o=Op(e),s=Np(n),i=t.spans??!1,a=t.disableIncomingRequestSpans??!1,c=i&&!a;return{name:RH,setup(l){c&&s.setup(l)},setupOnce(){o.setupOnce(),Ope(r)},processEvent(l){return s.processEvent(l)}}};b();var NH=K(Te(),1),bH=K(ne(),1);import*as zc from"diagnostics_channel";var Lr=BR(process.versions.node),jo=Lr.major,Pp=Lr.minor;var fI="sentry-trace",Gm="baggage",Npe="traceparent";function IH(t,e){let n=Bm(t.origin,t.path),{tracePropagationTargets:r,propagateTraceparent:o}=H()?.getOptions()||{},s=Qi(n,r,e)?kc({propagateTraceparent:o}):void 0;if(!s)return;let{"sentry-trace":i,baggage:a,traceparent:c}=s,l=Array.isArray(t.headers)?t.headers:bpe(t.headers);if(mI(l,fI),mI(l,Gm),o&&mI(l,Npe),!(hI(l,fI)!==-1)){i&&l.push(fI,i),c&&hI(l,"traceparent")===-1&&l.push("traceparent",c);let d=hI(l,Gm);if(a&&d===-1)l.push(Gm,a);else if(a){let _=l[d+1],f=bp(_,a);f&&(l[d+1]=f)}}Array.isArray(t.headers)||(t.headers=Cpe(l))}function bpe(t){let e=t.split(`\r
29
+ `),n=[];for(let r of e)try{let o=r.indexOf(":");if(o===-1)continue;let s=r.slice(0,o).trim(),i=r.slice(o+1).trim();s&&n.push(s,i)}catch{g.warn(`Failed to convert string request header to array header: ${r}`)}return n}function Cpe(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],o=t[n+1];!r||o==null||e.push(`${r}: ${o}`)}return e.length?e.join(`\r
29
30
  `).concat(`\r
30
- `):""}function $y(t,e){let n=-1;for(let r=0;r<t.length;r+=2){if(t[r]!==e)continue;if(n===-1){n=r;continue}let o=t[n+1];if(e===Im&&o){let s=Sp(t[r+1],o);s&&(t[n+1]=s)}t.splice(r,2),r-=2}}function Yy(t,e){return t.findIndex((n,r)=>r%2===0&&n===e)}function Vj(t,e){let n=Ele(t),r=e.statusCode,o=_p(r);tr({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function Ele(t){try{let e=Nm(t.origin,t.path),n=Rs(e),r={url:ys(n),"http.method":t.method||"GET"};return n.search&&(r["http.query"]=n.search),n.hash&&(r["http.fragment"]=n.hash),r}catch{return{}}}function Nm(t,e="/"){try{return new URL(e,t).toString()}catch{let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e}`:`${n}${e}`}}var Xi=class extends qj.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-node-fetch",pe,e),this._channelSubs=[],this._propagationDecisionMap=new Rn(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs=[]}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this._subscribeToChannel("undici:request:create",this._onRequestCreated.bind(this)),this._subscribeToChannel("undici:request:headers",this._onResponseHeaders.bind(this)))}_onRequestCreated({request:e}){let n=this.getConfig();if(!(n.enabled!==!1))return;let o=this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,o),!o&&n.tracePropagation!==!1&&Hj(e,this._propagationDecisionMap)}_onResponseHeaders({request:e,response:n}){let r=this.getConfig();if(!(r.enabled!==!1))return;let s=r.breadcrumbs,i=typeof s>"u"?!0:s,a=this._ignoreOutgoingRequestsMap.get(e);i&&!a&&Vj(e,n)}_subscribeToChannel(e,n){let r=ko>18||ko===18&&Ap>=19,o;if(r)jc.subscribe?.(e,n),o=()=>jc.unsubscribe?.(e,n);else{let s=jc.channel(e);s.subscribe(n),o=()=>s.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:o})}_shouldIgnoreOutgoingRequest(e){if((0,Fj.isTracingSuppressed)(P.active()))return!0;let n=Nm(e.origin,e.path),r=this.getConfig().ignoreOutgoingRequests;return typeof r!="function"||!n?!1:r(n)}};var Sle="NodeFetch",gle=w(`${Sle}.sentry`,Xi,t=>t),Ale=(t={})=>({name:"NodeFetch",setupOnce(){gle(t)}}),$j=Ale;var bV=K(zj(),1);le();b();b();var ln=K(he(),1),Ds=K(wI(),1),$I="sentry.parentIsRemote",Zc="sentry.graphql.operation";function YI(t){if("parentSpanId"in t)return t.parentSpanId;if("parentSpanContext"in t)return t.parentSpanContext?.spanId}function WI(t){let e=t;return!!e.attributes&&typeof e.attributes=="object"}function ude(t){return typeof t.kind=="number"}function lde(t){return!!t.status}function XH(t){return!!t.name}function pde(t){if(!WI(t))return{};let e=t.attributes[rs]||t.attributes[$a],n={url:e,"http.method":t.attributes[Ii]||t.attributes[Sl]};!n["http.method"]&&n.url&&(n["http.method"]="GET");try{if(typeof e=="string"){let r=Rs(e);n.url=ys(r),r.search&&(n["http.query"]=r.search),r.hash&&(n["http.fragment"]=r.hash)}}catch{}return n}function dde(t){return ude(t)?t.kind:Oe.INTERNAL}var AT="sentry-trace",kI="baggage",zI="sentry.dsc",KI="sentry.sampled_not_recording",JH="sentry.url",_de="sentry.sample_rand",fde="sentry.sample_rate",QI=Ln("sentry_scopes"),GI=Ln("sentry_fork_isolation_scope"),BI=Ln("sentry_fork_set_scope"),jI=Ln("sentry_fork_set_isolation_scope"),ZH="_scopeContext";function eu(t){return t.getValue(QI)}function eV(t,e){return t.setValue(QI,e)}function mde(t,e){nt(t,ZH,e)}function Mp(t){return t[ZH]}function Jc(t){let{traceFlags:e,traceState:n}=t,r=n?n.get(KI)==="1":!1;if(e===Vt.SAMPLED)return!0;if(r)return!1;let o=n?n.get(zI):void 0,s=o?vo(o):void 0;if(s?.sampled==="true")return!0;if(s?.sampled==="false")return!1}function tV(t,e,n){let r=e[Ii]||e[Sl];if(r)return hde({attributes:e,name:t,kind:n},r);let o=e[yi]||e[Ng],s=typeof e[ee]=="string"&&e[ee].startsWith("cache.");if(o&&!s)return Tde({attributes:e,name:t});let i=e[Ue]==="custom"?"custom":"route";if(e[wg])return{...Pp(t,e,"route"),op:"rpc"};if(e[Ug])return{...Pp(t,e,i),op:"message"};let l=e[bg];return l?{...Pp(t,e,i),op:l.toString()}:{op:void 0,description:t,source:"custom"}}function nV(t){let e=WI(t)?t.attributes:{},n=XH(t)?t.name:"<unknown>",r=dde(t);return tV(n,e,r)}function Tde({attributes:t,name:e}){let n=t[Zn];if(typeof n=="string")return{op:"db",description:n,source:t[Ue]||"custom"};if(t[Ue]==="custom")return{op:"db",description:e,source:"custom"};let r=t[Og];return{op:"db",description:r?r.toString():e,source:"task"}}function hde({name:t,kind:e,attributes:n},r){let o=["http"];switch(e){case Oe.CLIENT:o.push("client");break;case Oe.SERVER:o.push("server");break}n["sentry.http.prefetch"]&&o.push("prefetch");let{urlPath:s,url:i,query:a,fragment:c,hasRoute:l}=Sde(n,e);if(!s)return{...Pp(t,n),op:o.join(".")};let p=n[Zc],d=`${r} ${s}`,_=p?`${d} (${Ede(p)})`:d,f=l||s==="/"?"route":"url",m={};i&&(m.url=i),a&&(m["http.query"]=a),c&&(m["http.fragment"]=c);let T=e===Oe.CLIENT||e===Oe.SERVER,S=!`${n[W]||"manual"}`.startsWith("auto"),R=n[Ue]==="custom",I=n[Zn],x=!R&&I==null&&(T||!S),{description:V,source:B}=x?{description:_,source:f}:Pp(t,n);return{op:o.join("."),description:V,source:B,data:m}}function Ede(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}function Sde(t,e){let n=t[xg],r=t[$a]||t[rs],o=t[No],s=typeof r=="string"?Rs(r):void 0,i=s?ys(s):void 0,a=s?.search||void 0,c=s?.hash||void 0;return typeof o=="string"?{urlPath:o,url:i,query:a,fragment:c,hasRoute:!0}:e===Oe.SERVER&&typeof n=="string"?{urlPath:Do(n),url:i,query:a,fragment:c,hasRoute:!1}:s?{urlPath:i,url:i,query:a,fragment:c,hasRoute:!1}:typeof n=="string"?{urlPath:Do(n),url:i,query:a,fragment:c,hasRoute:!1}:{urlPath:void 0,url:i,query:a,fragment:c,hasRoute:!1}}function Pp(t,e,n="custom"){let r=e[Ue]||n,o=e[Zn];return o&&typeof o=="string"?{description:o,source:r}:{description:t,source:r}}function rV(t){t.on("createDsc",(e,n)=>{if(!n)return;let s=Y(n).data[Ue],{description:i}=XH(n)?nV(n):{description:void 0};if(s!=="url"&&i&&(e.transaction=i),Xe()){let a=Jc(n.spanContext());e.sampled=a==null?void 0:String(a)}})}function oV(){return X.getActiveSpan()}var Us=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function sV({dsc:t,sampled:e}){let n=t?Ui(t):void 0,r=new ln.TraceState,o=n?r.set(zI,n):r;return e===!1?o.set(KI,"1"):o}var iV=new Set;function aV(){return Array.from(iV)}function NT(t){iV.add(t)}var RT=class extends ln.W3CBaggagePropagator{constructor(){super(),NT("SentryPropagator"),this._urlMatchesTargetsMap=new Rn(100)}inject(e,n,r){if((0,ln.isTracingSuppressed)(e)){Us&&g.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");return}let o=X.getSpan(e),s=o&&yde(o),{tracePropagationTargets:i,propagateTraceparent:a}=H()?.getOptions()||{};if(!Fi(s,i,this._urlMatchesTargetsMap)){Us&&g.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:",s);return}let c=Ade(n),l=Rde(n),p=Er.getBaggage(e)||Er.createBaggage({}),{dynamicSamplingContext:d,traceId:_,spanId:f,sampled:m}=cV(e);if(c){let T=wi(c);T&&Object.entries(T).forEach(([h,S])=>{!l&&h.startsWith(zr)||(p=p.setEntry(h,{value:S}))})}!l&&d&&(p=Object.entries(d).reduce((T,[h,S])=>S?T.setEntry(`${zr}${h}`,{value:S}):T,p)),!l&&_&&_!==Si&&(r.set(n,AT,hs(_,f,m)),a&&r.set(n,"traceparent",Es(_,f,m))),super.inject(Er.setBaggage(e,p),n,r)}extract(e,n,r){let o=r.get(n,AT),s=r.get(n,kI),i=o?Array.isArray(o)?o[0]:o:void 0;return lV(uV(e,{sentryTrace:i,baggage:s}))}fields(){return[AT,kI,"traceparent"]}};function cV(t,e={}){let n=X.getSpan(t);if(n?.spanContext().isRemote){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:void 0,sampled:Jc(a)}}if(n){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:a.spanId,sampled:Jc(a)}}let r=e.scope||eu(t)?.scope||Te(),o=e.client||H(),s=r.getPropagationContext();return{dynamicSamplingContext:o?Kr(o,r):void 0,traceId:s.traceId,spanId:s.propagationSpanId,sampled:s.sampled}}function uV(t,{sentryTrace:e,baggage:n}){let r=Hl(e,n),{traceId:o,parentSpanId:s,sampled:i,dsc:a}=r,c=H(),l=vo(n);if(!s||c&&!CR(c,l?.org_id))return t;let p=Ide({traceId:o,spanId:s,sampled:i,dsc:a});return X.setSpanContext(t,p)}function gde(t,e,n){let r=lV(uV(t,e));return P.with(r,n)}function lV(t){let e=eu(t),n={scope:e?e.scope:Te().clone(),isolationScope:e?e.isolationScope:ue()};return eV(t,n)}function Ade(t){try{let e=t[kI];return Array.isArray(e)?e.join(","):e}catch{return}}function Rde(t){try{return t[AT]}catch{return}}function yde(t){let e=Y(t).data,n=e[$a]||e[rs];if(typeof n=="string")return n;let r=t.spanContext().traceState?.get(JH);if(r)return r}function Ide({spanId:t,traceId:e,sampled:n,dsc:r}){let o=sV({dsc:r,sampled:n});return{traceId:e,spanId:t,isRemote:!0,traceFlags:n?Vt.SAMPLED:Vt.NONE,traceState:o}}function pV(t,e,n){let r=_V(),{name:o,parentSpan:s}=t;return EV(s)(()=>{let a=TV(t.scope,t.forceTransaction),l=t.onlyIfParent&&!X.getSpan(a)?(0,ln.suppressTracing)(a):a,p=fV(t);if(!Xe()){let d=(0,ln.isTracingSuppressed)(l)?l:(0,ln.suppressTracing)(l);return P.with(d,()=>r.startActiveSpan(o,p,d,_=>(HI(_),P.with(a,()=>br(()=>e(_),()=>{Y(_).status===void 0&&_.setStatus({code:Be.ERROR})},n?()=>_.end():void 0)))))}return r.startActiveSpan(o,p,l,d=>(HI(d),br(()=>e(d),()=>{Y(d).status===void 0&&d.setStatus({code:Be.ERROR})},n?()=>d.end():void 0)))})}function Nde(t,e){return pV(t,e,!0)}function Ode(t,e){return pV(t,n=>e(n,()=>n.end()),!1)}function bde(t){let e=_V(),{name:n,parentSpan:r}=t;return EV(r)(()=>{let s=TV(t.scope,t.forceTransaction),a=t.onlyIfParent&&!X.getSpan(s)?(0,ln.suppressTracing)(s):s,c=fV(t);Xe()||(a=(0,ln.isTracingSuppressed)(a)?a:(0,ln.suppressTracing)(a));let l=e.startSpan(n,c,a);return HI(l),l})}function dV(t,e){let n=t?X.setSpan(P.active(),t):X.deleteSpan(P.active());return P.with(n,()=>e(Te()))}function _V(){return H()?.tracer||X.getTracer("@sentry/opentelemetry",pe)}function fV(t){let{startTime:e,attributes:n,kind:r,op:o,links:s}=t,i=typeof e=="number"?mV(e):e;return{attributes:o?{[ee]:o,...n}:n,kind:r,links:s,startTime:i}}function mV(t){return t<9999999999?t*1e3:t}function HI(t){let e=t.end.bind(t);t.end=n=>e(typeof n=="number"?mV(n):n)}function TV(t,e){let n=Cde(t),r=X.getSpan(n);if(!r||!e)return n;let o=X.deleteSpan(n),{spanId:s,traceId:i}=r.spanContext(),a=Jc(r.spanContext()),c=je(r),l=Je(c),p=sV({dsc:l,sampled:a}),d={traceId:i,spanId:s,isRemote:!0,traceFlags:a?Vt.SAMPLED:Vt.NONE,traceState:p};return X.setSpanContext(o,d)}function Cde(t){if(t){let e=Mp(t);if(e)return e}return P.active()}function Pde(t,e){return gde(P.active(),t,e)}function Mde(t){let e=Wt(),n=zt(),r={traceId:e,spanId:n,isRemote:!0,traceFlags:Vt.NONE},o=X.setSpanContext(P.active(),r);return P.with(o,()=>(Te().setPropagationContext({traceId:e,sampleRand:Rt()}),t()))}function hV(t,e){let n=Mp(e),r=n&&X.getSpan(n),o=r?Ss(r):Di(e);return[r?Je(r):Kr(t,e),o]}function EV(t){return t!==void 0?e=>dV(t,e):e=>e()}function xde(t){let e=(0,ln.suppressTracing)(P.active());return P.with(e,t)}function SV(t){t.on("preprocessEvent",e=>{let n=oV();if(!n||e.type==="transaction")return;e.contexts={trace:Ss(n),...e.contexts};let r=je(n);return e.sdkProcessingMetadata={dynamicSamplingContext:Je(r),...e.sdkProcessingMetadata},e})}function vde({span:t,scope:e,client:n,propagateTraceparent:r}={}){let o=(e&&Mp(e))??P.active();if(t){let{scope:p}=Ir(t);o=p&&Mp(p)||X.setSpan(P.active(),t)}let{traceId:s,spanId:i,sampled:a,dynamicSamplingContext:c}=cV(o,{scope:e,client:n}),l={"sentry-trace":hs(s,i,a),baggage:Ui(c)};return r&&(l.traceparent=Es(s,i,a)),l}function gV(){function t(){let a=P.active(),c=eu(a);return c||{scope:mc(),isolationScope:Jn()}}function e(a){let c=P.active();return P.with(c,()=>a(s()))}function n(a,c){let l=Mp(a)||P.active();return P.with(l.setValue(BI,a),()=>c(a))}function r(a){let c=P.active();return P.with(c.setValue(GI,!0),()=>a(i()))}function o(a,c){let l=P.active();return P.with(l.setValue(jI,a),()=>c(i()))}function s(){return t().scope}function i(){return t().isolationScope}ER({withScope:e,withSetScope:n,withSetIsolationScope:o,withIsolationScope:r,getCurrentScope:s,getIsolationScope:i,startSpan:Nde,startSpanManual:Ode,startInactiveSpan:bde,getActiveSpan:oV,suppressTracing:xde,getTraceData:vde,continueTrace:Pde,startNewTrace:Mde,withActiveSpan:dV})}function AV(t){class e extends t{constructor(...r){super(...r),NT("SentryContextManager")}with(r,o,s,...i){let a=eu(r),c=a?.scope||Te(),l=a?.isolationScope||ue(),p=r.getValue(GI)===!0,d=r.getValue(BI),_=r.getValue(jI),f=d||c.clone(),m=_||(p?l.clone():l),S=eV(r,{scope:f,isolationScope:m}).deleteValue(GI).deleteValue(BI).deleteValue(jI);return mde(f,S),super.with(S,o,s,...i)}getAsyncLocalStorageLookup(){return{asyncLocalStorage:this._asyncLocalStorage,contextSymbol:QI}}}return e}function Lde(t){let e=new Map;for(let n of t)Dde(e,n);return Array.from(e,function([n,r]){return r})}function RV(t){return t.attributes[$I]===!0?void 0:YI(t)}function Dde(t,e){let n=e.spanContext().spanId,r=RV(e);if(!r){VI(t,{id:n,span:e,children:[]});return}let o=Ude(t,r),s=VI(t,{id:n,span:e,parentNode:o,children:[]});o.children.push(s)}function Ude(t,e){let n=t.get(e);return n||VI(t,{id:e,children:[]})}function VI(t,e){let n=t.get(e.id);return n?.span?n:n&&!n.span?(n.span=e.span,n.parentNode=e.parentNode,n):(t.set(e.id,e),e)}var yV={1:"cancelled",2:"unknown_error",3:"invalid_argument",4:"deadline_exceeded",5:"not_found",6:"already_exists",7:"permission_denied",8:"resource_exhausted",9:"failed_precondition",10:"aborted",11:"out_of_range",12:"unimplemented",13:"internal_error",14:"unavailable",15:"data_loss",16:"unauthenticated"},wde=t=>Object.values(yV).includes(t);function IV(t){let e=WI(t)?t.attributes:{},n=lde(t)?t.status:void 0;if(n){if(n.code===Be.OK)return{code:1};if(n.code===Be.ERROR){if(typeof n.message>"u"){let o=zH(e);if(o)return o}return n.message&&wde(n.message)?{code:2,message:n.message}:{code:2,message:"internal_error"}}}let r=zH(e);return r||(n?.code===Be.UNSET?{code:1}:{code:2,message:"unknown_error"})}function zH(t){let e=t[Io]||t[Ri],n=t[kg],r=typeof e=="number"?e:typeof e=="string"?parseInt(e):void 0;if(typeof r=="number")return xo(r);if(typeof n=="string")return{code:2,message:yV[n]||"unknown_error"}}var KH=1e3,QH=300,FI=class{constructor(e){this._finishedSpanBucketSize=e?.timeout||QH,this._finishedSpanBuckets=new Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(Xn()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new Map,this._debouncedFlush=ny(this.flush.bind(this),1,{maxWait:100})}export(e){let n=Math.floor(Xn()/1e3);if(this._lastCleanupTimestampInS!==n){let i=0;this._finishedSpanBuckets.forEach((a,c)=>{a&&a.timestampInS<=n-this._finishedSpanBucketSize&&(i+=a.spans.size,this._finishedSpanBuckets[c]=void 0)}),i>0&&Us&&g.log(`SpanExporter dropped ${i} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=n}let r=n%this._finishedSpanBucketSize,o=this._finishedSpanBuckets[r]||{timestampInS:n,spans:new Set};this._finishedSpanBuckets[r]=o,o.spans.add(e),this._spansToBucketEntry.set(e,o);let s=RV(e);(!s||this._sentSpans.has(s))&&this._debouncedFlush()}flush(){let e=this._finishedSpanBuckets.flatMap(i=>i?Array.from(i.spans):[]);this._flushSentSpanCache();let n=this._maybeSend(e),r=n.size,o=e.length-r;Us&&g.log(`SpanExporter exported ${r} spans, ${o} spans are waiting for their parent spans to finish`);let s=Xn()+QH*1e3;for(let i of n){this._sentSpans.set(i.spanContext().spanId,s);let a=this._spansToBucketEntry.get(i);a&&a.spans.delete(i)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(e){let n=Lde(e),r=new Set,o=this._getCompletedRootNodes(n);for(let s of o){let i=s.span;r.add(i);let a=Gde(i);if(s.parentNode&&this._sentSpans.has(s.parentNode.id)){let p=a.contexts?.trace?.data;p&&(p["sentry.parent_span_already_sent"]=!0)}let c=a.spans||[];for(let p of s.children)qI(p,c,r);a.spans=c.length>KH?c.sort((p,d)=>p.start_timestamp-d.start_timestamp).slice(0,KH):c;let l=Bi(i.events);l&&(a.measurements=l),jf(a)}return r}_flushSentSpanCache(){let e=Xn();for(let[n,r]of this._sentSpans.entries())r<=e&&this._sentSpans.delete(n)}_nodeIsCompletedRootNodeOrHasSentParent(e){return!!e.span&&(!e.parentNode||this._sentSpans.has(e.parentNode.id))}_getCompletedRootNodes(e){return e.filter(n=>this._nodeIsCompletedRootNodeOrHasSentParent(n))}};function kde(t){let e=t.attributes,n=e[W],r=e[ee],o=e[Ue];return{origin:n,op:r,source:o}}function Gde(t){let{op:e,description:n,data:r,origin:o="manual",source:s}=NV(t),i=Ir(t),a=t.attributes[yr],c={[Ue]:s,[yr]:a,[ee]:e,[W]:o,...r,...OV(t.attributes)},{links:l}=t,{traceId:p,spanId:d}=t.spanContext(),_=YI(t),f=IV(t),m={parent_span_id:_,span_id:d,trace_id:p,data:c,origin:o,op:e,status:Gi(f),links:ki(l)},T=c[Io],h=typeof T=="number"?{response:{status_code:T}}:void 0;return{contexts:{trace:m,otel:{resource:t.resource.attributes},...h},spans:[],start_timestamp:gn(t.startTime),timestamp:gn(t.endTime),transaction:n,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:i.scope,capturedSpanIsolationScope:i.isolationScope,sampleRate:a,dynamicSamplingContext:Je(t)},...s&&{transaction_info:{source:s}}}}function qI(t,e,n){let r=t.span;if(r&&n.add(r),!r){t.children.forEach(I=>{qI(I,e,n)});return}let s=r.spanContext().spanId,i=r.spanContext().traceId,a=YI(r),{attributes:c,startTime:l,endTime:p,links:d}=r,{op:_,description:f,data:m,origin:T="manual"}=NV(r),h={[W]:T,[ee]:_,...OV(c),...m},S=IV(r),R={span_id:s,trace_id:i,data:h,description:f,parent_span_id:a,start_timestamp:gn(l),timestamp:gn(p)||void 0,status:Gi(S),op:_,origin:T,measurements:Bi(r.events),links:ki(d)};e.push(R),t.children.forEach(I=>{qI(I,e,n)})}function NV(t){let{op:e,source:n,origin:r}=kde(t),{op:o,description:s,source:i,data:a}=nV(t),c=e||o,l=n||i,p={...a,...Bde(t)};return{op:c,description:s,source:l,origin:r,data:p}}function OV(t){let e={...t};return delete e[yr],delete e[$I],delete e[Zn],e}function Bde(t){let e=t.attributes,n={};t.kind!==Oe.INTERNAL&&(n["otel.kind"]=Oe[t.kind]);let r=e[Ri];r&&(n[Io]=r);let o=pde(t);return o.url&&(n.url=o.url),o["http.query"]&&(n["http.query"]=o["http.query"].slice(1)),o["http.fragment"]&&(n["http.fragment"]=o["http.fragment"].slice(1)),n}function jde(t,e){let n=X.getSpan(e),r=eu(e);n&&!n.spanContext().isRemote&&Sc(n,t),n?.spanContext().isRemote&&t.setAttribute($I,!0),e===Ba&&(r={scope:mc(),isolationScope:Jn()}),r&&jl(t,r.scope,r.isolationScope),Wl(t),H()?.emit("spanStart",t)}function Hde(t){zl(t),H()?.emit("spanEnd",t)}var yT=class{constructor(e){NT("SentrySpanProcessor"),this._exporter=new FI(e)}async forceFlush(){this._exporter.flush()}async shutdown(){this._exporter.clear()}onStart(e,n){jde(e,n)}onEnd(e){Hde(e),this._exporter.export(e)}},IT=class{constructor(e){this._client=e,NT("SentrySampler")}shouldSample(e,n,r,o,s,i){let a=this._client.getOptions(),c=qde(e),l=c?.spanContext();if(!Xe(a))return Xc({decision:void 0,context:e,spanAttributes:s});let p=s[Sl]||s[Ii];if(o===Oe.CLIENT&&p&&(!c||l?.isRemote))return Xc({decision:void 0,context:e,spanAttributes:s});let d=c?Vde(c,n,r):void 0;if(!(!c||l?.isRemote))return Xc({decision:d?Ds.SamplingDecision.RECORD_AND_SAMPLED:Ds.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s});let{description:f,data:m,op:T}=tV(r,s,o),h={...m,...s};T&&(h[ee]=T);let S={decision:!0};if(this._client.emit("beforeSampling",{spanAttributes:h,spanName:f,parentSampled:d,parentContext:l},S),!S.decision)return Xc({decision:void 0,context:e,spanAttributes:s});let{isolationScope:R}=eu(e)??{},I=l?.traceState?l.traceState.get(zI):void 0,x=I?vo(I):void 0,V=Gn(x?.sample_rand)??Rt(),[B,se,ve]=Kl(a,{name:f,attributes:h,normalizedRequest:R?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:d,parentSampleRate:Gn(x?.sample_rate)},V),nn=`${p}`.toUpperCase();return nn==="OPTIONS"||nn==="HEAD"?(Us&&g.log(`[Tracing] Not sampling span because HTTP method is '${nn}' for ${r}`),Xc({decision:Ds.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:V,downstreamTraceSampleRate:0})):(!B&&d===void 0&&(Us&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),this._client.recordDroppedEvent("sample_rate","transaction")),{...Xc({decision:B?Ds.SamplingDecision.RECORD_AND_SAMPLED:Ds.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:V,downstreamTraceSampleRate:ve?se:void 0}),attributes:{[yr]:ve?se:void 0}})}toString(){return"SentrySampler"}};function Vde(t,e,n){let r=t.spanContext();if(yo(r)&&r.traceId===e){if(r.isRemote){let s=Jc(t.spanContext());return Us&&g.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${s}`),s}let o=Jc(r);return Us&&g.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${o}`),o}}function Xc({decision:t,context:e,spanAttributes:n,sampleRand:r,downstreamTraceSampleRate:o}){let s=Fde(e,n);return o!==void 0&&(s=s.set(fde,`${o}`)),r!==void 0&&(s=s.set(_de,`${r}`)),t==null?{decision:Ds.SamplingDecision.NOT_RECORD,traceState:s}:t===Ds.SamplingDecision.NOT_RECORD?{decision:t,traceState:s.set(KI,"1")}:{decision:t,traceState:s}}function Fde(t,e){let o=X.getSpan(t)?.spanContext()?.traceState||new ln.TraceState,s=e[$a]||e[rs];return s&&typeof s=="string"&&(o=o.set(JH,s)),o}function qde(t){let e=X.getSpan(t);return e&&yo(e.spanContext())?e:void 0}var XI=AV(bV.AsyncLocalStorageContextManager);b();function JI(){Dn.disable(),Dn.setLogger({error:g.error,warn:g.warn,info:g.log,debug:g.log,verbose:g.log},pt.DEBUG)}import*as ZI from"node:diagnostics_channel";var $de="ChildProcess",CV=(t={})=>({name:$de,setup(){ZI.channel("child_process").subscribe(e=>{e&&typeof e=="object"&&"process"in e&&Yde(e.process,t)}),ZI.channel("worker_threads").subscribe(e=>{e&&typeof e=="object"&&"worker"in e&&Wde(e.worker,t)})}});function Yde(t,e){let n=!1,r;t.on("spawn",()=>{if(t.spawnfile==="/usr/bin/sw_vers"){n=!0;return}r={spawnfile:t.spawnfile},e.includeChildProcessArgs&&(r.spawnargs=t.spawnargs)}).on("exit",o=>{n||(n=!0,o!==null&&o!==0&&tr({category:"child_process",message:`Child process exited with code '${o}'`,level:o===0?"info":"warning",data:r}))}).on("error",o=>{n||(n=!0,tr({category:"child_process",message:`Child process errored with '${o.message}'`,level:"error",data:r}))})}function Wde(t,e){let n;t.on("online",()=>{n=t.threadId}).on("error",r=>{e.captureWorkerErrors!==!1?te(r,{mechanism:{type:"auto.child_process.worker_thread",handled:!1,data:{threadId:String(n)}}}):tr({category:"worker_thread",message:`Worker thread errored with '${r.message}'`,level:"error",data:{threadId:n}})})}import{execFile as zde}from"node:child_process";import{readFile as Kde,readdir as Qde}from"node:fs";import*as Ot from"node:os";import{join as Xde}from"node:path";import{promisify as MV}from"node:util";var Jde=MV(Kde),Zde=MV(Qde),e_e="Context",t_e=(t={})=>{let e,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...t};async function r(s){e===void 0&&(e=o());let i=n_e(await e);return s.contexts={...s.contexts,app:{...i.app,...s.contexts?.app},os:{...i.os,...s.contexts?.os},device:{...i.device,...s.contexts?.device},culture:{...i.culture,...s.contexts?.culture},cloud_resource:{...i.cloud_resource,...s.contexts?.cloud_resource}},s}async function o(){let s={};if(n.os&&(s.os=await r_e()),n.app&&(s.app=s_e()),n.device&&(s.device=i_e(n.device)),n.culture){let i=o_e();i&&(s.culture=i)}return n.cloudResource&&(s.cloud_resource=d_e()),s}return{name:e_e,processEvent(s){return r(s)}}},xV=t_e;function n_e(t){if(t.app?.app_memory&&(t.app.app_memory=process.memoryUsage().rss),t.app?.free_memory&&typeof process.availableMemory=="function"){let e=process.availableMemory?.();e!=null&&(t.app.free_memory=e)}return t.device?.free_memory&&(t.device.free_memory=Ot.freemem()),t}async function r_e(){let t=Ot.platform();switch(t){case"darwin":return l_e();case"linux":return p_e();default:return{name:a_e[t]||t,version:Ot.release()}}}function o_e(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function s_e(){let t=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function i_e(t){let e={},n;try{n=Ot.uptime()}catch{}if(typeof n=="number"&&(e.boot_time=new Date(Date.now()-n*1e3).toISOString()),e.arch=Ot.arch(),(t===!0||t.memory)&&(e.memory_size=Ot.totalmem(),e.free_memory=Ot.freemem()),t===!0||t.cpu){let r=Ot.cpus(),o=r?.[0];o&&(e.processor_count=r.length,e.cpu_description=o.model,e.processor_frequency=o.speed)}return e}var a_e={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},c_e=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],u_e={alpine:t=>t,arch:t=>oo(/distrib_release=(.*)/,t),centos:t=>oo(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>oo(/release (..)/,t),mint:t=>oo(/distrib_release=(.*)/,t),red:t=>oo(/release ([^ ]+)/,t),suse:t=>oo(/VERSION = (.*)\n/,t),ubuntu:t=>oo(/distrib_release=(.*)/,t)};function oo(t,e){let n=t.exec(e);return n?n[1]:void 0}async function l_e(){let t={kernel_version:Ot.release(),name:"Mac OS X",version:`10.${Number(Ot.release().split(".")[0])-4}`};try{let e=await new Promise((n,r)=>{zde("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});t.name=oo(/^ProductName:\s+(.*)$/m,e),t.version=oo(/^ProductVersion:\s+(.*)$/m,e),t.build=oo(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function PV(t){return t.split(" ")[0].toLowerCase()}async function p_e(){let t={kernel_version:Ot.release(),name:"Linux"};try{let e=await Zde("/etc"),n=c_e.find(a=>e.includes(a.name));if(!n)return t;let r=Xde("/etc",n.name),o=(await Jde(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;t.name=s.find(a=>o.indexOf(PV(a))>=0)||s[0];let i=PV(t.name);t.version=u_e[i]?.(o)}catch{}return t}function d_e(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as __e}from"node:fs";import{createInterface as f_e}from"node:readline";var eN=new Rn(10),DV=new Rn(20),m_e=7,T_e="ContextLines",h_e=1e3,E_e=1e4;function S_e(t,e,n){let r=t.get(e);return r===void 0?(t.set(e,n),n):r}function g_e(t){return!!(t.startsWith("node:")||t.endsWith(".min.js")||t.endsWith(".min.cjs")||t.endsWith(".min.mjs")||t.startsWith("data:"))}function A_e(t){return t.lineno!==void 0&&t.lineno>E_e||t.colno!==void 0&&t.colno>h_e}function R_e(t,e){let n=eN.get(t);if(n===void 0)return!1;for(let r=e[0];r<=e[1];r++)if(n[r]===void 0)return!1;return!0}function y_e(t,e){if(!t.length)return[];let n=0,r=t[0];if(typeof r!="number")return[];let o=LV(r,e),s=[];for(;;){if(n===t.length-1){s.push(o);break}let i=t[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+e:(s.push(o),o=LV(i,e)),n++}return s}function I_e(t,e,n){return new Promise((r,o)=>{let s=__e(t),i=f_e({input:s});function a(){s.destroy(),r()}let c=0,l=0,p=e[l];if(p===void 0){a();return}let d=p[0],_=p[1];function f(m){DV.set(t,1),re&&g.error(`Failed to read file: ${t}. Error: ${m}`),i.close(),i.removeAllListeners(),a()}s.on("error",f),i.on("error",f),i.on("close",a),i.on("line",m=>{if(c++,!(c<d)&&(n[c]=lR(m,0),c>=_)){if(l===e.length-1){i.close(),i.removeAllListeners();return}l++;let T=e[l];if(T===void 0){i.close(),i.removeAllListeners();return}d=T[0],_=T[1]}})})}async function N_e(t,e){let n={};if(e>0&&t.exception?.values){for(let s of t.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||g_e(c)||A_e(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return t;let o=[];for(let s of r){if(DV.get(s))continue;let i=n[s];if(!i)continue;i.sort((l,p)=>l-p);let a=y_e(i,e);if(a.every(l=>R_e(s,l)))continue;let c=S_e(eN,s,{});o.push(I_e(s,a,c))}if(await Promise.all(o).catch(()=>{re&&g.log("Failed to read one or more source files and resolve context lines")}),e>0&&t.exception?.values)for(let s of t.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&O_e(s.stacktrace.frames,e,eN);return t}function O_e(t,e,n){for(let r of t)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;b_e(r.lineno,r,e,o)}}function vV(t){delete t.pre_context,delete t.context_line,delete t.post_context}function b_e(t,e,n,r){if(e.lineno===void 0||r===void 0){re&&g.error("Cannot resolve context for frame with no lineno or file contents");return}e.pre_context=[];for(let s=UV(t,n);s<t;s++){let i=r[s];if(i===void 0){vV(e),re&&g.error(`Could not find line ${s} in file ${e.filename}`);return}e.pre_context.push(i)}if(r[t]===void 0){vV(e),re&&g.error(`Could not find line ${t} in file ${e.filename}`);return}e.context_line=r[t];let o=wV(t,n);e.post_context=[];for(let s=t+1;s<=o;s++){let i=r[s];if(i===void 0)break;e.post_context.push(i)}}function UV(t,e){return Math.max(1,t-e)}function wV(t,e){return t+e}function LV(t,e){return[UV(t,e),wV(t,e)]}var C_e=(t={})=>{let e=t.frameContextLines!==void 0?t.frameContextLines:m_e;return{name:T_e,processEvent(n){return N_e(n,e)}}},kV=C_e;import{Worker as P_e}from"node:worker_threads";var OT;async function bT(){if(OT===void 0)try{OT=!!(await import("node:inspector")).url()}catch{OT=!1}return OT}var xp="__SENTRY_ERROR_LOCAL_VARIABLES__";function BV(t,e,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>t&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&e()),r=0},1e3).unref(),()=>{r+=1}}function GV(t){return t!==void 0&&(t.length===0||t==="?"||t==="<anonymous>")}function CT(t,e){return t===e||`Object.${t}`===e||t===`Object.${e}`||GV(t)&&GV(e)}var M_e="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjQ3LjAgKGE1YTRlNzMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function jV(...t){g.log("[LocalVariables]",...t)}var HV=(t={})=>{function e(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let l=a.length-c-1,p=i[c],d=a[l];if(!d||!p)break;p.vars===void 0||d.in_app===!1&&t.includeOutOfAppFrames!==!0||!CT(d.function,p.function)||(d.vars=p.vars)}}function n(s,i){if(i.originalException&&typeof i.originalException=="object"&&xp in i.originalException&&Array.isArray(i.originalException[xp])){for(let a of s.exception?.values||[])e(a,i.originalException[xp]);i.originalException[xp]=void 0}return s}async function r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new P_e(new URL(`data:application/javascript;base64,${M_e}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{jV("Worker error",a)}),i.once("exit",a=>{jV("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await bT()){g.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...t,debug:g.isEnabled()};r().then(()=>{try{o(a)}catch(c){g.error("Failed to start worker",c)}},c=>{g.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}};function VV(t){if(t!==void 0)return t.slice(-10).reduce((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`,"")}function x_e(t,e){if(e!==void 0)return VV(t(e,1))}function FV(t){let e=[],n=!1;function r(i){e=[],!n&&(n=!0,t(i))}e.push(r);function o(i){e.push(i)}function s(i){let a=e.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var tN=class t{constructor(e){this._session=e}static async create(e){if(e)return e;let n=await import("node:inspector");return new t(new n.Session)}configureAndConnect(e,n){this._session.connect(),this._session.on("Debugger.paused",r=>{e(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,n){this._getProperties(e,r=>{let{add:o,next:s}=FV(n);for(let i of r)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(e,n){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(e,n,r,o){this._getProperties(e,s=>{r[n]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(r)})}_unrollObject(e,n,r,o){this._getProperties(e,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(e,n,r){e.value&&("value"in e.value?e.value.value===void 0||e.value.value===null?n[e.name]=`<${e.value.value}>`:n[e.name]=e.value.value:"description"in e.value&&e.value.type!=="function"?n[e.name]=`<${e.value.description}>`:e.value.type==="undefined"&&(n[e.name]="<undefined>")),r(n)}},v_e="LocalVariables",L_e=(t={},e)=>{let n=new Rn(20),r,o=!1;function s(l){let p=VV(l.stacktrace?.frames);if(p===void 0)return;let d=n.remove(p);if(d===void 0)return;let _=(l.stacktrace?.frames||[]).filter(f=>f.function!=="new Promise");for(let f=0;f<_.length;f++){let m=_.length-f-1,T=d[f],h=_[m];if(!h||!T)break;T.vars===void 0||h.in_app===!1&&t.includeOutOfAppFrames!==!0||!CT(h.function,T.function)||(h.vars=T.vars)}}function i(l){for(let p of l.exception?.values||[])s(p);return l}let a;async function c(){let p=H()?.getOptions();if(!p?.includeLocalVariables)return;if(ko<18){g.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await bT()){g.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let _=await tN.create(e),f=(T,{params:{reason:h,data:S,callFrames:R}},I)=>{if(h!=="exception"&&h!=="promiseRejection"){I();return}r?.();let x=x_e(T,S.description);if(x==null){I();return}let{add:V,next:B}=FV(se=>{n.set(x,se),I()});for(let se=0;se<Math.min(R.length,5);se++){let{scopeChain:ve,functionName:nn,this:Ao}=R[se],es=ve.find(ht=>ht.type==="local"),Ti=Ao.className==="global"||!Ao.className?nn:`${Ao.className}.${nn}`;if(es?.object.objectId===void 0)V(ht=>{ht[se]={function:Ti},B(ht)});else{let ht=es.object.objectId;V(ka=>_.getLocalVariables(ht,Ga=>{ka[se]={function:Ti,vars:Ga},B(ka)}))}}B([])},m=t.captureAllExceptions!==!1;if(_.configureAndConnect((T,h)=>f(p.stackParser,T,h),m),m){let T=t.maxExceptionsPerSecond||50;r=BV(T,()=>{g.log("Local variables rate-limit lifted."),_.setPauseOnExceptions(!0)},h=>{g.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${h} seconds.`),_.setPauseOnExceptions(!1)})}o=!0}catch(_){g.log("The `LocalVariables` integration failed to start.",_)}}return{name:v_e,setupOnce(){a=c()},async processEvent(l){return await a,o?i(l):l},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}},qV=L_e;var $V=(t={})=>Mr.major<19?qV(t):HV(t);import{existsSync as D_e,readFileSync as KV}from"node:fs";import{dirname as U_e,join as QV}from"node:path";function vp(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}var YV;function WV(){return vp()?!1:ko>=21||ko===20&&Ap>=6||ko===18&&Ap>=19?!0:(YV||(YV=!0,Qe(()=>{console.warn(`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`)})),!1)}var nN,w_e="Modules",k_e=typeof __SENTRY_SERVER_MODULES__>"u"?{}:__SENTRY_SERVER_MODULES__,G_e=()=>({name:w_e,processEvent(t){return t.modules={...t.modules,...zV()},t},getModules:zV}),XV=G_e;function B_e(){try{return U.cache?Object.keys(U.cache):[]}catch{return[]}}function j_e(){return{...k_e,...F_e(),...vp()?H_e():{}}}function H_e(){let t=U.main?.paths||[],e=B_e(),n={},r=new Set;return e.forEach(o=>{let s=o,i=()=>{let a=s;if(s=U_e(a),!s||a===s||r.has(a))return;if(t.indexOf(s)<0)return i();let c=QV(a,"package.json");if(r.add(a),!D_e(c))return i();try{let l=JSON.parse(KV(c,"utf8"));n[l.name]=l.version}catch{}};i()}),n}function zV(){return nN||(nN=j_e()),nN}function V_e(){try{let t=QV(process.cwd(),"package.json");return JSON.parse(KV(t,"utf8"))}catch{return{}}}function F_e(){let t=V_e();return{...t.dependencies,...t.devDependencies}}import{isMainThread as $_e}from"worker_threads";var q_e=2e3;function Lp(t){Qe(()=>{console.error(t)});let e=H();if(e===void 0){re&&g.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=e.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:q_e;e.close(r).then(o=>{o||re&&g.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{re&&g.error(o)})}var Y_e="OnUncaughtException",JV=(t={})=>{let e={exitEvenIfOtherHandlersAreRegistered:!1,...t};return{name:Y_e,setup(n){$_e&&global.process.on("uncaughtException",W_e(n,e))}}};function W_e(t,e){let r=!1,o=!1,s=!1,i,a=t.getOptions();return Object.assign(c=>{let l=Lp;e.onFatalError?l=e.onFatalError:a.onFatalError&&(l=a.onFatalError);let d=global.process.listeners("uncaughtException").filter(f=>f.name!=="domainUncaughtExceptionClear"&&f.tag!=="sentry_tracingErrorCallback"&&f._errorHandler!==!0).length===0,_=e.exitEvenIfOtherHandlersAreRegistered||d;r?_&&(s?(re&&g.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),Lp(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,l(i,c))},2e3))):(i=c,r=!0,H()===t&&te(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&_&&(s=!0,l(c)))},{_errorHandler:!0})}var z_e="OnUnhandledRejection",K_e=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],Q_e=(t={})=>{let e={mode:t.mode??"warn",ignore:[...K_e,...t.ignore??[]]};return{name:z_e,setup(n){global.process.on("unhandledRejection",efe(n,e))}}},ZV=Q_e;function X_e(t){if(typeof t!="object"||t===null)return{name:"",message:String(t??"")};let e=t,n=typeof e.name=="string"?e.name:"",r=typeof e.message=="string"?e.message:String(t);return{name:n,message:r}}function J_e(t,e){let n=t.name===void 0||Co(e.name,t.name,!0),r=t.message===void 0||Co(e.message,t.message);return n&&r}function Z_e(t,e){let n=X_e(e);return t.some(r=>J_e(r,n))}function efe(t,e){return function(r,o){if(H()!==t||Z_e(e.ignore??[],r))return;let s=e.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>Rc(i,c):c=>c())(()=>{te(r,{originalException:o,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),tfe(r,e.mode)}}function tfe(t,e){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";e==="warn"?Qe(()=>{console.warn(n),console.error(t&&typeof t=="object"&&"stack"in t?t.stack:t)}):e==="strict"&&(Qe(()=>{console.warn(n)}),Lp(t))}var nfe="ProcessSession",eF=()=>({name:nfe,setupOnce(){$f(),process.on("beforeExit",()=>{ue().getSession()?.status!=="ok"&&Jl()})}});import*as tF from"node:http";var rN="Spotlight",rfe=(t={})=>{let e={sidecarUrl:t.sidecarUrl||"http://localhost:8969/stream"};return{name:rN,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&g.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}ofe(n,e)}}},nF=rfe;function ofe(t,e){let n=sfe(e.sidecarUrl);if(!n)return;let r=0;t.on("beforeEnvelope",o=>{if(r>3){g.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=Yl(o);yc(()=>{let i=tF.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,g.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function sfe(t){try{return new URL(`${t}`)}catch{g.warn(`[Spotlight] Invalid sidecar URL: ${t}`);return}}import*as rF from"node:util";var ife="NodeSystemError";function afe(t){return!(t instanceof Error)||!("errno"in t)||typeof t.errno!="number"?!1:rF.getSystemErrorMap().has(t.errno)}var oF=(t={})=>({name:ife,processEvent:(e,n,r)=>{if(!afe(n.originalException))return e;let o=n.originalException,s={...o};!r.getOptions().sendDefaultPii&&t.includePaths!==!0&&(delete s.path,delete s.dest),e.contexts={...e.contexts,node_system_error:s};for(let i of e.exception?.values||[])i.value&&(o.path&&i.value.includes(o.path)&&(i.value=i.value.replace(`'${o.path}'`,"").trim()),o.dest&&i.value.includes(o.dest)&&(i.value=i.value.replace(`'${o.dest}'`,"").trim()));return e}});import*as ufe from"node:http";import*as lfe from"node:https";import{Readable as pfe}from"node:stream";import{createGzip as dfe}from"node:zlib";import*as jo from"node:net";import*as sN from"node:tls";import*as oN from"node:http";var so=Symbol("AgentBaseInternalState"),PT=class extends oN.Agent{constructor(e){super(e),this[so]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
31
- `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(e,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(e,o)).then(s=>{if(s instanceof oN.Agent)return s.addRequest(e,o);this[so].currentSocket=s,super.createSocket(e,n,r)},r)}createConnection(){let e=this[so].currentSocket;if(this[so].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[so].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[so]&&(this[so].defaultPort=e)}get protocol(){return this[so].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[so]&&(this[so].protocol=e)}};function MT(...t){g.log("[https-proxy-agent:parse-proxy-response]",...t)}function sF(t){return new Promise((e,n)=>{let r=0,o=[];function s(){let p=t.read();p?l(p):t.once("readable",s)}function i(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",s)}function a(){i(),MT("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){i(),MT("onerror %o",p),n(p)}function l(p){o.push(p),r+=p.length;let d=Buffer.concat(o,r),_=d.indexOf(`\r
31
+ `):""}function mI(t,e){let n=-1;for(let r=0;r<t.length;r+=2){if(t[r]!==e)continue;if(n===-1){n=r;continue}let o=t[n+1];if(e===Gm&&o){let s=bp(t[r+1],o);s&&(t[n+1]=s)}t.splice(r,2),r-=2}}function hI(t,e){return t.findIndex((n,r)=>r%2===0&&n===e)}function OH(t,e){let n=Ppe(t),r=e.statusCode,o=Ap(r);rr({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function Ppe(t){try{let e=Bm(t.origin,t.path),n=bs(e),r={url:Cs(n),"http.method":t.method||"GET"};return n.search&&(r["http.query"]=n.search),n.hash&&(r["http.fragment"]=n.hash),r}catch{return{}}}function Bm(t,e="/"){try{return new URL(e,t).toString()}catch{let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e}`:`${n}${e}`}}var oa=class extends bH.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-node-fetch",pe,e),this._channelSubs=[],this._propagationDecisionMap=new In(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs=[]}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this._subscribeToChannel("undici:request:create",this._onRequestCreated.bind(this)),this._subscribeToChannel("undici:request:headers",this._onResponseHeaders.bind(this)))}_onRequestCreated({request:e}){let n=this.getConfig();if(!(n.enabled!==!1))return;let o=this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,o),!o&&n.tracePropagation!==!1&&IH(e,this._propagationDecisionMap)}_onResponseHeaders({request:e,response:n}){let r=this.getConfig();if(!(r.enabled!==!1))return;let s=r.breadcrumbs,i=typeof s>"u"?!0:s,a=this._ignoreOutgoingRequestsMap.get(e);i&&!a&&OH(e,n)}_subscribeToChannel(e,n){let r=jo>18||jo===18&&Pp>=19,o;if(r)zc.subscribe?.(e,n),o=()=>zc.unsubscribe?.(e,n);else{let s=zc.channel(e);s.subscribe(n),o=()=>s.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:o})}_shouldIgnoreOutgoingRequest(e){if((0,NH.isTracingSuppressed)(P.active()))return!0;let n=Bm(e.origin,e.path),r=this.getConfig().ignoreOutgoingRequests;return typeof r!="function"||!n?!1:r(n)}};var Mpe="NodeFetch",xpe=w(`${Mpe}.sentry`,oa,t=>t),vpe=(t={})=>({name:"NodeFetch",setupOnce(){xpe(t)}}),CH=vpe;var lV=K(xH(),1);le();b();b();var dn=K(Te(),1),Bs=K(iO(),1),mO="sentry.parentIsRemote",au="sentry.graphql.operation";function hO(t){if("parentSpanId"in t)return t.parentSpanId;if("parentSpanContext"in t)return t.parentSpanContext?.spanId}function TO(t){let e=t;return!!e.attributes&&typeof e.attributes=="object"}function g_e(t){return typeof t.kind=="number"}function A_e(t){return!!t.status}function DF(t){return!!t.name}function R_e(t){if(!TO(t))return{};let e=t.attributes[cs]||t.attributes[Za],n={url:e,"http.method":t.attributes[xi]||t.attributes[bl]};!n["http.method"]&&n.url&&(n["http.method"]="GET");try{if(typeof e=="string"){let r=bs(e);n.url=Cs(r),r.search&&(n["http.query"]=r.search),r.hash&&(n["http.fragment"]=r.hash)}}catch{}return n}function y_e(t){return g_e(t)?t.kind:Ne.INTERNAL}var Uh="sentry-trace",aO="baggage",EO="sentry.dsc",SO="sentry.sampled_not_recording",UF="sentry.url",I_e="sentry.sample_rand",O_e="sentry.sample_rate",gO=Un("sentry_scopes"),cO=Un("sentry_fork_isolation_scope"),uO=Un("sentry_fork_set_scope"),lO=Un("sentry_fork_set_isolation_scope"),wF="_scopeContext";function cu(t){return t.getValue(gO)}function kF(t,e){return t.setValue(gO,e)}function N_e(t,e){nt(t,wF,e)}function Gp(t){return t[wF]}function iu(t){let{traceFlags:e,traceState:n}=t,r=n?n.get(SO)==="1":!1;if(e===Vt.SAMPLED)return!0;if(r)return!1;let o=n?n.get(EO):void 0,s=o?Uo(o):void 0;if(s?.sampled==="true")return!0;if(s?.sampled==="false")return!1}function GF(t,e,n){let r=e[xi]||e[bl];if(r)return C_e({attributes:e,name:t,kind:n},r);let o=e[Mi]||e[Kg],s=typeof e[ee]=="string"&&e[ee].startsWith("cache.");if(o&&!s)return b_e({attributes:e,name:t});let i=e[Ue]==="custom"?"custom":"route";if(e[iA])return{...kp(t,e,"route"),op:"rpc"};if(e[sA])return{...kp(t,e,i),op:"message"};let l=e[Xg];return l?{...kp(t,e,i),op:l.toString()}:{op:void 0,description:t,source:"custom"}}function BF(t){let e=TO(t)?t.attributes:{},n=DF(t)?t.name:"<unknown>",r=y_e(t);return GF(n,e,r)}function b_e({attributes:t,name:e}){let n=t[tr];if(typeof n=="string")return{op:"db",description:n,source:t[Ue]||"custom"};if(t[Ue]==="custom")return{op:"db",description:e,source:"custom"};let r=t[Qg];return{op:"db",description:r?r.toString():e,source:"task"}}function C_e({name:t,kind:e,attributes:n},r){let o=["http"];switch(e){case Ne.CLIENT:o.push("client");break;case Ne.SERVER:o.push("server");break}n["sentry.http.prefetch"]&&o.push("prefetch");let{urlPath:s,url:i,query:a,fragment:c,hasRoute:l}=M_e(n,e);if(!s)return{...kp(t,n),op:o.join(".")};let p=n[au],d=`${r} ${s}`,_=p?`${d} (${P_e(p)})`:d,f=l||s==="/"?"route":"url",m={};i&&(m.url=i),a&&(m["http.query"]=a),c&&(m["http.fragment"]=c);let h=e===Ne.CLIENT||e===Ne.SERVER,S=!`${n[W]||"manual"}`.startsWith("auto"),R=n[Ue]==="custom",I=n[tr],x=!R&&I==null&&(h||!S),{description:F,source:B}=x?{description:_,source:f}:kp(t,n);return{op:o.join("."),description:F,source:B,data:m}}function P_e(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}function M_e(t,e){let n=t[tA],r=t[Za]||t[cs],o=t[Co],s=typeof r=="string"?bs(r):void 0,i=s?Cs(s):void 0,a=s?.search||void 0,c=s?.hash||void 0;return typeof o=="string"?{urlPath:o,url:i,query:a,fragment:c,hasRoute:!0}:e===Ne.SERVER&&typeof n=="string"?{urlPath:ko(n),url:i,query:a,fragment:c,hasRoute:!1}:s?{urlPath:i,url:i,query:a,fragment:c,hasRoute:!1}:typeof n=="string"?{urlPath:ko(n),url:i,query:a,fragment:c,hasRoute:!1}:{urlPath:void 0,url:i,query:a,fragment:c,hasRoute:!1}}function kp(t,e,n="custom"){let r=e[Ue]||n,o=e[tr];return o&&typeof o=="string"?{description:o,source:r}:{description:t,source:r}}function jF(t){t.on("createDsc",(e,n)=>{if(!n)return;let s=Y(n).data[Ue],{description:i}=DF(n)?BF(n):{description:void 0};if(s!=="url"&&i&&(e.transaction=i),Xe()){let a=iu(n.spanContext());e.sampled=a==null?void 0:String(a)}})}function HF(){return X.getActiveSpan()}var js=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function FF({dsc:t,sampled:e}){let n=t?Fi(t):void 0,r=new dn.TraceState,o=n?r.set(EO,n):r;return e===!1?o.set(SO,"1"):o}var VF=new Set;function qF(){return Array.from(VF)}function Bh(t){VF.add(t)}var wh=class extends dn.W3CBaggagePropagator{constructor(){super(),Bh("SentryPropagator"),this._urlMatchesTargetsMap=new In(100)}inject(e,n,r){if((0,dn.isTracingSuppressed)(e)){js&&g.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");return}let o=X.getSpan(e),s=o&&D_e(o),{tracePropagationTargets:i,propagateTraceparent:a}=H()?.getOptions()||{};if(!Qi(s,i,this._urlMatchesTargetsMap)){js&&g.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:",s);return}let c=v_e(n),l=L_e(n),p=Ar.getBaggage(e)||Ar.createBaggage({}),{dynamicSamplingContext:d,traceId:_,spanId:f,sampled:m}=$F(e);if(c){let h=Vi(c);h&&Object.entries(h).forEach(([T,S])=>{!l&&T.startsWith(Xr)||(p=p.setEntry(T,{value:S}))})}!l&&d&&(p=Object.entries(d).reduce((h,[T,S])=>S?h.setEntry(`${Xr}${T}`,{value:S}):h,p)),!l&&_&&_!==Ni&&(r.set(n,Uh,Rs(_,f,m)),a&&r.set(n,"traceparent",ys(_,f,m))),super.inject(Ar.setBaggage(e,p),n,r)}extract(e,n,r){let o=r.get(n,Uh),s=r.get(n,aO),i=o?Array.isArray(o)?o[0]:o:void 0;return WF(YF(e,{sentryTrace:i,baggage:s}))}fields(){return[Uh,aO,"traceparent"]}};function $F(t,e={}){let n=X.getSpan(t);if(n?.spanContext().isRemote){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:void 0,sampled:iu(a)}}if(n){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:a.spanId,sampled:iu(a)}}let r=e.scope||cu(t)?.scope||he(),o=e.client||H(),s=r.getPropagationContext();return{dynamicSamplingContext:o?Jr(o,r):void 0,traceId:s.traceId,spanId:s.propagationSpanId,sampled:s.sampled}}function YF(t,{sentryTrace:e,baggage:n}){let r=Kl(e,n),{traceId:o,parentSpanId:s,sampled:i,dsc:a}=r,c=H(),l=Uo(n);if(!s||c&&!JR(c,l?.org_id))return t;let p=U_e({traceId:o,spanId:s,sampled:i,dsc:a});return X.setSpanContext(t,p)}function x_e(t,e,n){let r=WF(YF(t,e));return P.with(r,n)}function WF(t){let e=cu(t),n={scope:e?e.scope:he().clone(),isolationScope:e?e.isolationScope:ue()};return kF(t,n)}function v_e(t){try{let e=t[aO];return Array.isArray(e)?e.join(","):e}catch{return}}function L_e(t){try{return t[Uh]}catch{return}}function D_e(t){let e=Y(t).data,n=e[Za]||e[cs];if(typeof n=="string")return n;let r=t.spanContext().traceState?.get(UF);if(r)return r}function U_e({spanId:t,traceId:e,sampled:n,dsc:r}){let o=FF({dsc:r,sampled:n});return{traceId:e,spanId:t,isRemote:!0,traceFlags:n?Vt.SAMPLED:Vt.NONE,traceState:o}}function zF(t,e,n){let r=QF(),{name:o,parentSpan:s}=t;return tV(s)(()=>{let a=ZF(t.scope,t.forceTransaction),l=t.onlyIfParent&&!X.getSpan(a)?(0,dn.suppressTracing)(a):a,p=XF(t);if(!Xe()){let d=(0,dn.isTracingSuppressed)(l)?l:(0,dn.suppressTracing)(l);return P.with(d,()=>r.startActiveSpan(o,p,d,_=>(pO(_),P.with(a,()=>Mr(()=>e(_),()=>{Y(_).status===void 0&&_.setStatus({code:Be.ERROR})},n?()=>_.end():void 0)))))}return r.startActiveSpan(o,p,l,d=>(pO(d),Mr(()=>e(d),()=>{Y(d).status===void 0&&d.setStatus({code:Be.ERROR})},n?()=>d.end():void 0)))})}function w_e(t,e){return zF(t,e,!0)}function k_e(t,e){return zF(t,n=>e(n,()=>n.end()),!1)}function G_e(t){let e=QF(),{name:n,parentSpan:r}=t;return tV(r)(()=>{let s=ZF(t.scope,t.forceTransaction),a=t.onlyIfParent&&!X.getSpan(s)?(0,dn.suppressTracing)(s):s,c=XF(t);Xe()||(a=(0,dn.isTracingSuppressed)(a)?a:(0,dn.suppressTracing)(a));let l=e.startSpan(n,c,a);return pO(l),l})}function KF(t,e){let n=t?X.setSpan(P.active(),t):X.deleteSpan(P.active());return P.with(n,()=>e(he()))}function QF(){return H()?.tracer||X.getTracer("@sentry/opentelemetry",pe)}function XF(t){let{startTime:e,attributes:n,kind:r,op:o,links:s}=t,i=typeof e=="number"?JF(e):e;return{attributes:o?{[ee]:o,...n}:n,kind:r,links:s,startTime:i}}function JF(t){return t<9999999999?t*1e3:t}function pO(t){let e=t.end.bind(t);t.end=n=>e(typeof n=="number"?JF(n):n)}function ZF(t,e){let n=B_e(t),r=X.getSpan(n);if(!r||!e)return n;let o=X.deleteSpan(n),{spanId:s,traceId:i}=r.spanContext(),a=iu(r.spanContext()),c=je(r),l=Je(c),p=FF({dsc:l,sampled:a}),d={traceId:i,spanId:s,isRemote:!0,traceFlags:a?Vt.SAMPLED:Vt.NONE,traceState:p};return X.setSpanContext(o,d)}function B_e(t){if(t){let e=Gp(t);if(e)return e}return P.active()}function j_e(t,e){return x_e(P.active(),t,e)}function H_e(t){let e=zt(),n=Kt(),r={traceId:e,spanId:n,isRemote:!0,traceFlags:Vt.NONE},o=X.setSpanContext(P.active(),r);return P.with(o,()=>(he().setPropagationContext({traceId:e,sampleRand:yt()}),t()))}function eV(t,e){let n=Gp(e),r=n&&X.getSpan(n),o=r?Is(r):Hi(e);return[r?Je(r):Jr(t,e),o]}function tV(t){return t!==void 0?e=>KF(t,e):e=>e()}function F_e(t){let e=(0,dn.suppressTracing)(P.active());return P.with(e,t)}function nV(t){t.on("preprocessEvent",e=>{let n=HF();if(!n||e.type==="transaction")return;e.contexts={trace:Is(n),...e.contexts};let r=je(n);return e.sdkProcessingMetadata={dynamicSamplingContext:Je(r),...e.sdkProcessingMetadata},e})}function V_e({span:t,scope:e,client:n,propagateTraceparent:r}={}){let o=(e&&Gp(e))??P.active();if(t){let{scope:p}=br(t);o=p&&Gp(p)||X.setSpan(P.active(),t)}let{traceId:s,spanId:i,sampled:a,dynamicSamplingContext:c}=$F(o,{scope:e,client:n}),l={"sentry-trace":Rs(s,i,a),baggage:Fi(c)};return r&&(l.traceparent=ys(s,i,a)),l}function rV(){function t(){let a=P.active(),c=cu(a);return c||{scope:yc(),isolationScope:er()}}function e(a){let c=P.active();return P.with(c,()=>a(s()))}function n(a,c){let l=Gp(a)||P.active();return P.with(l.setValue(uO,a),()=>c(a))}function r(a){let c=P.active();return P.with(c.setValue(cO,!0),()=>a(i()))}function o(a,c){let l=P.active();return P.with(l.setValue(lO,a),()=>c(i()))}function s(){return t().scope}function i(){return t().isolationScope}FR({withScope:e,withSetScope:n,withSetIsolationScope:o,withIsolationScope:r,getCurrentScope:s,getIsolationScope:i,startSpan:w_e,startSpanManual:k_e,startInactiveSpan:G_e,getActiveSpan:HF,suppressTracing:F_e,getTraceData:V_e,continueTrace:j_e,startNewTrace:H_e,withActiveSpan:KF})}function oV(t){class e extends t{constructor(...r){super(...r),Bh("SentryContextManager")}with(r,o,s,...i){let a=cu(r),c=a?.scope||he(),l=a?.isolationScope||ue(),p=r.getValue(cO)===!0,d=r.getValue(uO),_=r.getValue(lO),f=d||c.clone(),m=_||(p?l.clone():l),S=kF(r,{scope:f,isolationScope:m}).deleteValue(cO).deleteValue(uO).deleteValue(lO);return N_e(f,S),super.with(S,o,s,...i)}getAsyncLocalStorageLookup(){return{asyncLocalStorage:this._asyncLocalStorage,contextSymbol:gO}}}return e}function q_e(t){let e=new Map;for(let n of t)$_e(e,n);return Array.from(e,function([n,r]){return r})}function sV(t){return t.attributes[mO]===!0?void 0:hO(t)}function $_e(t,e){let n=e.spanContext().spanId,r=sV(e);if(!r){dO(t,{id:n,span:e,children:[]});return}let o=Y_e(t,r),s=dO(t,{id:n,span:e,parentNode:o,children:[]});o.children.push(s)}function Y_e(t,e){let n=t.get(e);return n||dO(t,{id:e,children:[]})}function dO(t,e){let n=t.get(e.id);return n?.span?n:n&&!n.span?(n.span=e.span,n.parentNode=e.parentNode,n):(t.set(e.id,e),e)}var iV={1:"cancelled",2:"unknown_error",3:"invalid_argument",4:"deadline_exceeded",5:"not_found",6:"already_exists",7:"permission_denied",8:"resource_exhausted",9:"failed_precondition",10:"aborted",11:"out_of_range",12:"unimplemented",13:"internal_error",14:"unavailable",15:"data_loss",16:"unauthenticated"},W_e=t=>Object.values(iV).includes(t);function aV(t){let e=TO(t)?t.attributes:{},n=A_e(t)?t.status:void 0;if(n){if(n.code===Be.OK)return{code:1};if(n.code===Be.ERROR){if(typeof n.message>"u"){let o=xF(e);if(o)return o}return n.message&&W_e(n.message)?{code:2,message:n.message}:{code:2,message:"internal_error"}}}let r=xF(e);return r||(n?.code===Be.UNSET?{code:1}:{code:2,message:"unknown_error"})}function xF(t){let e=t[bo]||t[Pi],n=t[aA],r=typeof e=="number"?e:typeof e=="string"?parseInt(e):void 0;if(typeof r=="number")return Do(r);if(typeof n=="string")return{code:2,message:iV[n]||"unknown_error"}}var vF=1e3,LF=300,_O=class{constructor(e){this._finishedSpanBucketSize=e?.timeout||LF,this._finishedSpanBuckets=new Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(Zn()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new Map,this._debouncedFlush=Ny(this.flush.bind(this),1,{maxWait:100})}export(e){let n=Math.floor(Zn()/1e3);if(this._lastCleanupTimestampInS!==n){let i=0;this._finishedSpanBuckets.forEach((a,c)=>{a&&a.timestampInS<=n-this._finishedSpanBucketSize&&(i+=a.spans.size,this._finishedSpanBuckets[c]=void 0)}),i>0&&js&&g.log(`SpanExporter dropped ${i} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=n}let r=n%this._finishedSpanBucketSize,o=this._finishedSpanBuckets[r]||{timestampInS:n,spans:new Set};this._finishedSpanBuckets[r]=o,o.spans.add(e),this._spansToBucketEntry.set(e,o);let s=sV(e);(!s||this._sentSpans.has(s))&&this._debouncedFlush()}flush(){let e=this._finishedSpanBuckets.flatMap(i=>i?Array.from(i.spans):[]);this._flushSentSpanCache();let n=this._maybeSend(e),r=n.size,o=e.length-r;js&&g.log(`SpanExporter exported ${r} spans, ${o} spans are waiting for their parent spans to finish`);let s=Zn()+LF*1e3;for(let i of n){this._sentSpans.set(i.spanContext().spanId,s);let a=this._spansToBucketEntry.get(i);a&&a.spans.delete(i)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(e){let n=q_e(e),r=new Set,o=this._getCompletedRootNodes(n);for(let s of o){let i=s.span;r.add(i);let a=K_e(i);if(s.parentNode&&this._sentSpans.has(s.parentNode.id)){let p=a.contexts?.trace?.data;p&&(p["sentry.parent_span_already_sent"]=!0)}let c=a.spans||[];for(let p of s.children)fO(p,c,r);a.spans=c.length>vF?c.sort((p,d)=>p.start_timestamp-d.start_timestamp).slice(0,vF):c;let l=Yi(i.events);l&&(a.measurements=l),em(a)}return r}_flushSentSpanCache(){let e=Zn();for(let[n,r]of this._sentSpans.entries())r<=e&&this._sentSpans.delete(n)}_nodeIsCompletedRootNodeOrHasSentParent(e){return!!e.span&&(!e.parentNode||this._sentSpans.has(e.parentNode.id))}_getCompletedRootNodes(e){return e.filter(n=>this._nodeIsCompletedRootNodeOrHasSentParent(n))}};function z_e(t){let e=t.attributes,n=e[W],r=e[ee],o=e[Ue];return{origin:n,op:r,source:o}}function K_e(t){let{op:e,description:n,data:r,origin:o="manual",source:s}=cV(t),i=br(t),a=t.attributes[Nr],c={[Ue]:s,[Nr]:a,[ee]:e,[W]:o,...r,...uV(t.attributes)},{links:l}=t,{traceId:p,spanId:d}=t.spanContext(),_=hO(t),f=aV(t),m={parent_span_id:_,span_id:d,trace_id:p,data:c,origin:o,op:e,status:$i(f),links:qi(l)},h=c[bo],T=typeof h=="number"?{response:{status_code:h}}:void 0;return{contexts:{trace:m,otel:{resource:t.resource.attributes},...T},spans:[],start_timestamp:Rn(t.startTime),timestamp:Rn(t.endTime),transaction:n,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:i.scope,capturedSpanIsolationScope:i.isolationScope,sampleRate:a,dynamicSamplingContext:Je(t)},...s&&{transaction_info:{source:s}}}}function fO(t,e,n){let r=t.span;if(r&&n.add(r),!r){t.children.forEach(I=>{fO(I,e,n)});return}let s=r.spanContext().spanId,i=r.spanContext().traceId,a=hO(r),{attributes:c,startTime:l,endTime:p,links:d}=r,{op:_,description:f,data:m,origin:h="manual"}=cV(r),T={[W]:h,[ee]:_,...uV(c),...m},S=aV(r),R={span_id:s,trace_id:i,data:T,description:f,parent_span_id:a,start_timestamp:Rn(l),timestamp:Rn(p)||void 0,status:$i(S),op:_,origin:h,measurements:Yi(r.events),links:qi(d)};e.push(R),t.children.forEach(I=>{fO(I,e,n)})}function cV(t){let{op:e,source:n,origin:r}=z_e(t),{op:o,description:s,source:i,data:a}=BF(t),c=e||o,l=n||i,p={...a,...Q_e(t)};return{op:c,description:s,source:l,origin:r,data:p}}function uV(t){let e={...t};return delete e[Nr],delete e[mO],delete e[tr],e}function Q_e(t){let e=t.attributes,n={};t.kind!==Ne.INTERNAL&&(n["otel.kind"]=Ne[t.kind]);let r=e[Pi];r&&(n[bo]=r);let o=R_e(t);return o.url&&(n.url=o.url),o["http.query"]&&(n["http.query"]=o["http.query"].slice(1)),o["http.fragment"]&&(n["http.fragment"]=o["http.fragment"].slice(1)),n}function X_e(t,e){let n=X.getSpan(e),r=cu(e);n&&!n.spanContext().isRemote&&bc(n,t),n?.spanContext().isRemote&&t.setAttribute(mO,!0),e===Wa&&(r={scope:yc(),isolationScope:er()}),r&&zl(t,r.scope,r.isolationScope),tp(t),H()?.emit("spanStart",t)}function J_e(t){np(t),H()?.emit("spanEnd",t)}var kh=class{constructor(e){Bh("SentrySpanProcessor"),this._exporter=new _O(e)}async forceFlush(){this._exporter.flush()}async shutdown(){this._exporter.clear()}onStart(e,n){X_e(e,n)}onEnd(e){J_e(e),this._exporter.export(e)}},Gh=class{constructor(e){this._client=e,Bh("SentrySampler")}shouldSample(e,n,r,o,s,i){let a=this._client.getOptions(),c=tfe(e),l=c?.spanContext();if(!Xe(a))return su({decision:void 0,context:e,spanAttributes:s});let p=s[bl]||s[xi];if(o===Ne.CLIENT&&p&&(!c||l?.isRemote))return su({decision:void 0,context:e,spanAttributes:s});let d=c?Z_e(c,n,r):void 0;if(!(!c||l?.isRemote))return su({decision:d?Bs.SamplingDecision.RECORD_AND_SAMPLED:Bs.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s});let{description:f,data:m,op:h}=GF(r,s,o),T={...m,...s};h&&(T[ee]=h);let S={decision:!0};if(this._client.emit("beforeSampling",{spanAttributes:T,spanName:f,parentSampled:d,parentContext:l},S),!S.decision)return su({decision:void 0,context:e,spanAttributes:s});let{isolationScope:R}=cu(e)??{},I=l?.traceState?l.traceState.get(EO):void 0,x=I?Uo(I):void 0,F=jn(x?.sample_rand)??yt(),[B,se,ve]=rp(a,{name:f,attributes:T,normalizedRequest:R?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:d,parentSampleRate:jn(x?.sample_rate)},F),on=`${p}`.toUpperCase();return on==="OPTIONS"||on==="HEAD"?(js&&g.log(`[Tracing] Not sampling span because HTTP method is '${on}' for ${r}`),su({decision:Bs.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:F,downstreamTraceSampleRate:0})):(!B&&d===void 0&&(js&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),this._client.recordDroppedEvent("sample_rate","transaction")),{...su({decision:B?Bs.SamplingDecision.RECORD_AND_SAMPLED:Bs.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:F,downstreamTraceSampleRate:ve?se:void 0}),attributes:{[Nr]:ve?se:void 0}})}toString(){return"SentrySampler"}};function Z_e(t,e,n){let r=t.spanContext();if(No(r)&&r.traceId===e){if(r.isRemote){let s=iu(t.spanContext());return js&&g.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${s}`),s}let o=iu(r);return js&&g.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${o}`),o}}function su({decision:t,context:e,spanAttributes:n,sampleRand:r,downstreamTraceSampleRate:o}){let s=efe(e,n);return o!==void 0&&(s=s.set(O_e,`${o}`)),r!==void 0&&(s=s.set(I_e,`${r}`)),t==null?{decision:Bs.SamplingDecision.NOT_RECORD,traceState:s}:t===Bs.SamplingDecision.NOT_RECORD?{decision:t,traceState:s.set(SO,"1")}:{decision:t,traceState:s}}function efe(t,e){let o=X.getSpan(t)?.spanContext()?.traceState||new dn.TraceState,s=e[Za]||e[cs];return s&&typeof s=="string"&&(o=o.set(UF,s)),o}function tfe(t){let e=X.getSpan(t);return e&&No(e.spanContext())?e:void 0}var AO=oV(lV.AsyncLocalStorageContextManager);b();function RO(){wn.disable(),wn.setLogger({error:g.error,warn:g.warn,info:g.log,debug:g.log,verbose:g.log},dt.DEBUG)}import*as yO from"node:diagnostics_channel";var nfe="ChildProcess",pV=(t={})=>({name:nfe,setup(){yO.channel("child_process").subscribe(e=>{e&&typeof e=="object"&&"process"in e&&rfe(e.process,t)}),yO.channel("worker_threads").subscribe(e=>{e&&typeof e=="object"&&"worker"in e&&ofe(e.worker,t)})}});function rfe(t,e){let n=!1,r;t.on("spawn",()=>{if(t.spawnfile==="/usr/bin/sw_vers"){n=!0;return}r={spawnfile:t.spawnfile},e.includeChildProcessArgs&&(r.spawnargs=t.spawnargs)}).on("exit",o=>{n||(n=!0,o!==null&&o!==0&&rr({category:"child_process",message:`Child process exited with code '${o}'`,level:o===0?"info":"warning",data:r}))}).on("error",o=>{n||(n=!0,rr({category:"child_process",message:`Child process errored with '${o.message}'`,level:"error",data:r}))})}function ofe(t,e){let n;t.on("online",()=>{n=t.threadId}).on("error",r=>{e.captureWorkerErrors!==!1?te(r,{mechanism:{type:"auto.child_process.worker_thread",handled:!1,data:{threadId:String(n)}}}):rr({category:"worker_thread",message:`Worker thread errored with '${r.message}'`,level:"error",data:{threadId:n}})})}import{execFile as sfe}from"node:child_process";import{readFile as ife,readdir as afe}from"node:fs";import*as bt from"node:os";import{join as cfe}from"node:path";import{promisify as _V}from"node:util";var ufe=_V(ife),lfe=_V(afe),pfe="Context",dfe=(t={})=>{let e,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...t};async function r(s){e===void 0&&(e=o());let i=_fe(await e);return s.contexts={...s.contexts,app:{...i.app,...s.contexts?.app},os:{...i.os,...s.contexts?.os},device:{...i.device,...s.contexts?.device},culture:{...i.culture,...s.contexts?.culture},cloud_resource:{...i.cloud_resource,...s.contexts?.cloud_resource}},s}async function o(){let s={};if(n.os&&(s.os=await ffe()),n.app&&(s.app=hfe()),n.device&&(s.device=Tfe(n.device)),n.culture){let i=mfe();i&&(s.culture=i)}return n.cloudResource&&(s.cloud_resource=yfe()),s}return{name:pfe,processEvent(s){return r(s)}}},fV=dfe;function _fe(t){if(t.app?.app_memory&&(t.app.app_memory=process.memoryUsage().rss),t.app?.free_memory&&typeof process.availableMemory=="function"){let e=process.availableMemory?.();e!=null&&(t.app.free_memory=e)}return t.device?.free_memory&&(t.device.free_memory=bt.freemem()),t}async function ffe(){let t=bt.platform();switch(t){case"darwin":return Afe();case"linux":return Rfe();default:return{name:Efe[t]||t,version:bt.release()}}}function mfe(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function hfe(){let t=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function Tfe(t){let e={},n;try{n=bt.uptime()}catch{}if(typeof n=="number"&&(e.boot_time=new Date(Date.now()-n*1e3).toISOString()),e.arch=bt.arch(),(t===!0||t.memory)&&(e.memory_size=bt.totalmem(),e.free_memory=bt.freemem()),t===!0||t.cpu){let r=bt.cpus(),o=r?.[0];o&&(e.processor_count=r.length,e.cpu_description=o.model,e.processor_frequency=o.speed)}return e}var Efe={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},Sfe=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],gfe={alpine:t=>t,arch:t=>ao(/distrib_release=(.*)/,t),centos:t=>ao(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>ao(/release (..)/,t),mint:t=>ao(/distrib_release=(.*)/,t),red:t=>ao(/release ([^ ]+)/,t),suse:t=>ao(/VERSION = (.*)\n/,t),ubuntu:t=>ao(/distrib_release=(.*)/,t)};function ao(t,e){let n=t.exec(e);return n?n[1]:void 0}async function Afe(){let t={kernel_version:bt.release(),name:"Mac OS X",version:`10.${Number(bt.release().split(".")[0])-4}`};try{let e=await new Promise((n,r)=>{sfe("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});t.name=ao(/^ProductName:\s+(.*)$/m,e),t.version=ao(/^ProductVersion:\s+(.*)$/m,e),t.build=ao(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function dV(t){return t.split(" ")[0].toLowerCase()}async function Rfe(){let t={kernel_version:bt.release(),name:"Linux"};try{let e=await lfe("/etc"),n=Sfe.find(a=>e.includes(a.name));if(!n)return t;let r=cfe("/etc",n.name),o=(await ufe(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;t.name=s.find(a=>o.indexOf(dV(a))>=0)||s[0];let i=dV(t.name);t.version=gfe[i]?.(o)}catch{}return t}function yfe(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as Ife}from"node:fs";import{createInterface as Ofe}from"node:readline";var IO=new In(10),TV=new In(20),Nfe=7,bfe="ContextLines",Cfe=1e3,Pfe=1e4;function Mfe(t,e,n){let r=t.get(e);return r===void 0?(t.set(e,n),n):r}function xfe(t){return!!(t.startsWith("node:")||t.endsWith(".min.js")||t.endsWith(".min.cjs")||t.endsWith(".min.mjs")||t.startsWith("data:"))}function vfe(t){return t.lineno!==void 0&&t.lineno>Pfe||t.colno!==void 0&&t.colno>Cfe}function Lfe(t,e){let n=IO.get(t);if(n===void 0)return!1;for(let r=e[0];r<=e[1];r++)if(n[r]===void 0)return!1;return!0}function Dfe(t,e){if(!t.length)return[];let n=0,r=t[0];if(typeof r!="number")return[];let o=hV(r,e),s=[];for(;;){if(n===t.length-1){s.push(o);break}let i=t[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+e:(s.push(o),o=hV(i,e)),n++}return s}function Ufe(t,e,n){return new Promise((r,o)=>{let s=Ife(t),i=Ofe({input:s});function a(){s.destroy(),r()}let c=0,l=0,p=e[l];if(p===void 0){a();return}let d=p[0],_=p[1];function f(m){TV.set(t,1),re&&g.error(`Failed to read file: ${t}. Error: ${m}`),i.close(),i.removeAllListeners(),a()}s.on("error",f),i.on("error",f),i.on("close",a),i.on("line",m=>{if(c++,!(c<d)&&(n[c]=DR(m,0),c>=_)){if(l===e.length-1){i.close(),i.removeAllListeners();return}l++;let h=e[l];if(h===void 0){i.close(),i.removeAllListeners();return}d=h[0],_=h[1]}})})}async function wfe(t,e){let n={};if(e>0&&t.exception?.values){for(let s of t.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||xfe(c)||vfe(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return t;let o=[];for(let s of r){if(TV.get(s))continue;let i=n[s];if(!i)continue;i.sort((l,p)=>l-p);let a=Dfe(i,e);if(a.every(l=>Lfe(s,l)))continue;let c=Mfe(IO,s,{});o.push(Ufe(s,a,c))}if(await Promise.all(o).catch(()=>{re&&g.log("Failed to read one or more source files and resolve context lines")}),e>0&&t.exception?.values)for(let s of t.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&kfe(s.stacktrace.frames,e,IO);return t}function kfe(t,e,n){for(let r of t)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;Gfe(r.lineno,r,e,o)}}function mV(t){delete t.pre_context,delete t.context_line,delete t.post_context}function Gfe(t,e,n,r){if(e.lineno===void 0||r===void 0){re&&g.error("Cannot resolve context for frame with no lineno or file contents");return}e.pre_context=[];for(let s=EV(t,n);s<t;s++){let i=r[s];if(i===void 0){mV(e),re&&g.error(`Could not find line ${s} in file ${e.filename}`);return}e.pre_context.push(i)}if(r[t]===void 0){mV(e),re&&g.error(`Could not find line ${t} in file ${e.filename}`);return}e.context_line=r[t];let o=SV(t,n);e.post_context=[];for(let s=t+1;s<=o;s++){let i=r[s];if(i===void 0)break;e.post_context.push(i)}}function EV(t,e){return Math.max(1,t-e)}function SV(t,e){return t+e}function hV(t,e){return[EV(t,e),SV(t,e)]}var Bfe=(t={})=>{let e=t.frameContextLines!==void 0?t.frameContextLines:Nfe;return{name:bfe,processEvent(n){return wfe(n,e)}}},gV=Bfe;import{Worker as jfe}from"node:worker_threads";var jh;async function Hh(){if(jh===void 0)try{jh=!!(await import("node:inspector")).url()}catch{jh=!1}return jh}var Bp="__SENTRY_ERROR_LOCAL_VARIABLES__";function RV(t,e,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>t&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&e()),r=0},1e3).unref(),()=>{r+=1}}function AV(t){return t!==void 0&&(t.length===0||t==="?"||t==="<anonymous>")}function Fh(t,e){return t===e||`Object.${t}`===e||t===`Object.${e}`||AV(t)&&AV(e)}var Hfe="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjQ3LjAgKGE1YTRlNzMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function yV(...t){g.log("[LocalVariables]",...t)}var IV=(t={})=>{function e(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let l=a.length-c-1,p=i[c],d=a[l];if(!d||!p)break;p.vars===void 0||d.in_app===!1&&t.includeOutOfAppFrames!==!0||!Fh(d.function,p.function)||(d.vars=p.vars)}}function n(s,i){if(i.originalException&&typeof i.originalException=="object"&&Bp in i.originalException&&Array.isArray(i.originalException[Bp])){for(let a of s.exception?.values||[])e(a,i.originalException[Bp]);i.originalException[Bp]=void 0}return s}async function r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new jfe(new URL(`data:application/javascript;base64,${Hfe}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{yV("Worker error",a)}),i.once("exit",a=>{yV("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await Hh()){g.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...t,debug:g.isEnabled()};r().then(()=>{try{o(a)}catch(c){g.error("Failed to start worker",c)}},c=>{g.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}};function OV(t){if(t!==void 0)return t.slice(-10).reduce((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`,"")}function Ffe(t,e){if(e!==void 0)return OV(t(e,1))}function NV(t){let e=[],n=!1;function r(i){e=[],!n&&(n=!0,t(i))}e.push(r);function o(i){e.push(i)}function s(i){let a=e.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var OO=class t{constructor(e){this._session=e}static async create(e){if(e)return e;let n=await import("node:inspector");return new t(new n.Session)}configureAndConnect(e,n){this._session.connect(),this._session.on("Debugger.paused",r=>{e(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,n){this._getProperties(e,r=>{let{add:o,next:s}=NV(n);for(let i of r)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(e,n){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(e,n,r,o){this._getProperties(e,s=>{r[n]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(r)})}_unrollObject(e,n,r,o){this._getProperties(e,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(e,n,r){e.value&&("value"in e.value?e.value.value===void 0||e.value.value===null?n[e.name]=`<${e.value.value}>`:n[e.name]=e.value.value:"description"in e.value&&e.value.type!=="function"?n[e.name]=`<${e.value.description}>`:e.value.type==="undefined"&&(n[e.name]="<undefined>")),r(n)}},Vfe="LocalVariables",qfe=(t={},e)=>{let n=new In(20),r,o=!1;function s(l){let p=OV(l.stacktrace?.frames);if(p===void 0)return;let d=n.remove(p);if(d===void 0)return;let _=(l.stacktrace?.frames||[]).filter(f=>f.function!=="new Promise");for(let f=0;f<_.length;f++){let m=_.length-f-1,h=d[f],T=_[m];if(!T||!h)break;h.vars===void 0||T.in_app===!1&&t.includeOutOfAppFrames!==!0||!Fh(T.function,h.function)||(T.vars=h.vars)}}function i(l){for(let p of l.exception?.values||[])s(p);return l}let a;async function c(){let p=H()?.getOptions();if(!p?.includeLocalVariables)return;if(jo<18){g.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await Hh()){g.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let _=await OO.create(e),f=(h,{params:{reason:T,data:S,callFrames:R}},I)=>{if(T!=="exception"&&T!=="promiseRejection"){I();return}r?.();let x=Ffe(h,S.description);if(x==null){I();return}let{add:F,next:B}=NV(se=>{n.set(x,se),I()});for(let se=0;se<Math.min(R.length,5);se++){let{scopeChain:ve,functionName:on,this:Io}=R[se],ss=ve.find(Et=>Et.type==="local"),yi=Io.className==="global"||!Io.className?on:`${Io.className}.${on}`;if(ss?.object.objectId===void 0)F(Et=>{Et[se]={function:yi},B(Et)});else{let Et=ss.object.objectId;F($a=>_.getLocalVariables(Et,Ya=>{$a[se]={function:yi,vars:Ya},B($a)}))}}B([])},m=t.captureAllExceptions!==!1;if(_.configureAndConnect((h,T)=>f(p.stackParser,h,T),m),m){let h=t.maxExceptionsPerSecond||50;r=RV(h,()=>{g.log("Local variables rate-limit lifted."),_.setPauseOnExceptions(!0)},T=>{g.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${T} seconds.`),_.setPauseOnExceptions(!1)})}o=!0}catch(_){g.log("The `LocalVariables` integration failed to start.",_)}}return{name:Vfe,setupOnce(){a=c()},async processEvent(l){return await a,o?i(l):l},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}},bV=qfe;var CV=(t={})=>Lr.major<19?bV(t):IV(t);import{existsSync as $fe,readFileSync as vV}from"node:fs";import{dirname as Yfe,join as LV}from"node:path";function jp(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}var PV;function MV(){return jp()?!1:jo>=21||jo===20&&Pp>=6||jo===18&&Pp>=19?!0:(PV||(PV=!0,Qe(()=>{console.warn(`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`)})),!1)}var NO,Wfe="Modules",zfe=typeof __SENTRY_SERVER_MODULES__>"u"?{}:__SENTRY_SERVER_MODULES__,Kfe=()=>({name:Wfe,processEvent(t){return t.modules={...t.modules,...xV()},t},getModules:xV}),DV=Kfe;function Qfe(){try{return U.cache?Object.keys(U.cache):[]}catch{return[]}}function Xfe(){return{...zfe,...eme(),...jp()?Jfe():{}}}function Jfe(){let t=U.main?.paths||[],e=Qfe(),n={},r=new Set;return e.forEach(o=>{let s=o,i=()=>{let a=s;if(s=Yfe(a),!s||a===s||r.has(a))return;if(t.indexOf(s)<0)return i();let c=LV(a,"package.json");if(r.add(a),!$fe(c))return i();try{let l=JSON.parse(vV(c,"utf8"));n[l.name]=l.version}catch{}};i()}),n}function xV(){return NO||(NO=Xfe()),NO}function Zfe(){try{let t=LV(process.cwd(),"package.json");return JSON.parse(vV(t,"utf8"))}catch{return{}}}function eme(){let t=Zfe();return{...t.dependencies,...t.devDependencies}}import{isMainThread as nme}from"worker_threads";var tme=2e3;function Hp(t){Qe(()=>{console.error(t)});let e=H();if(e===void 0){re&&g.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=e.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:tme;e.close(r).then(o=>{o||re&&g.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{re&&g.error(o)})}var rme="OnUncaughtException",UV=(t={})=>{let e={exitEvenIfOtherHandlersAreRegistered:!1,...t};return{name:rme,setup(n){nme&&global.process.on("uncaughtException",ome(n,e))}}};function ome(t,e){let r=!1,o=!1,s=!1,i,a=t.getOptions();return Object.assign(c=>{let l=Hp;e.onFatalError?l=e.onFatalError:a.onFatalError&&(l=a.onFatalError);let d=global.process.listeners("uncaughtException").filter(f=>f.name!=="domainUncaughtExceptionClear"&&f.tag!=="sentry_tracingErrorCallback"&&f._errorHandler!==!0).length===0,_=e.exitEvenIfOtherHandlersAreRegistered||d;r?_&&(s?(re&&g.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),Hp(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,l(i,c))},2e3))):(i=c,r=!0,H()===t&&te(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&_&&(s=!0,l(c)))},{_errorHandler:!0})}var sme="OnUnhandledRejection",ime=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],ame=(t={})=>{let e={mode:t.mode??"warn",ignore:[...ime,...t.ignore??[]]};return{name:sme,setup(n){global.process.on("unhandledRejection",pme(n,e))}}},wV=ame;function cme(t){if(typeof t!="object"||t===null)return{name:"",message:String(t??"")};let e=t,n=typeof e.name=="string"?e.name:"",r=typeof e.message=="string"?e.message:String(t);return{name:n,message:r}}function ume(t,e){let n=t.name===void 0||xo(e.name,t.name,!0),r=t.message===void 0||xo(e.message,t.message);return n&&r}function lme(t,e){let n=cme(e);return t.some(r=>ume(r,n))}function pme(t,e){return function(r,o){if(H()!==t||lme(e.ignore??[],r))return;let s=e.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>Mc(i,c):c=>c())(()=>{te(r,{originalException:o,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),dme(r,e.mode)}}function dme(t,e){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";e==="warn"?Qe(()=>{console.warn(n),console.error(t&&typeof t=="object"&&"stack"in t?t.stack:t)}):e==="strict"&&(Qe(()=>{console.warn(n)}),Hp(t))}var _me="ProcessSession",kV=()=>({name:_me,setupOnce(){sm(),process.on("beforeExit",()=>{ue().getSession()?.status!=="ok"&&ip()})}});import*as GV from"node:http";var bO="Spotlight",fme=(t={})=>{let e={sidecarUrl:t.sidecarUrl||"http://localhost:8969/stream"};return{name:bO,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&g.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}mme(n,e)}}},BV=fme;function mme(t,e){let n=hme(e.sidecarUrl);if(!n)return;let r=0;t.on("beforeEnvelope",o=>{if(r>3){g.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=ep(o);xc(()=>{let i=GV.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,g.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function hme(t){try{return new URL(`${t}`)}catch{g.warn(`[Spotlight] Invalid sidecar URL: ${t}`);return}}import*as jV from"node:util";var Tme="NodeSystemError";function Eme(t){return!(t instanceof Error)||!("errno"in t)||typeof t.errno!="number"?!1:jV.getSystemErrorMap().has(t.errno)}var HV=(t={})=>({name:Tme,processEvent:(e,n,r)=>{if(!Eme(n.originalException))return e;let o=n.originalException,s={...o};!r.getOptions().sendDefaultPii&&t.includePaths!==!0&&(delete s.path,delete s.dest),e.contexts={...e.contexts,node_system_error:s};for(let i of e.exception?.values||[])i.value&&(o.path&&i.value.includes(o.path)&&(i.value=i.value.replace(`'${o.path}'`,"").trim()),o.dest&&i.value.includes(o.dest)&&(i.value=i.value.replace(`'${o.dest}'`,"").trim()));return e}});import*as gme from"node:http";import*as Ame from"node:https";import{Readable as Rme}from"node:stream";import{createGzip as yme}from"node:zlib";import*as Vo from"node:net";import*as PO from"node:tls";import*as CO from"node:http";var co=Symbol("AgentBaseInternalState"),Vh=class extends CO.Agent{constructor(e){super(e),this[co]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
32
+ `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(e,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(e,o)).then(s=>{if(s instanceof CO.Agent)return s.addRequest(e,o);this[co].currentSocket=s,super.createSocket(e,n,r)},r)}createConnection(){let e=this[co].currentSocket;if(this[co].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[co].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[co]&&(this[co].defaultPort=e)}get protocol(){return this[co].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[co]&&(this[co].protocol=e)}};function qh(...t){g.log("[https-proxy-agent:parse-proxy-response]",...t)}function FV(t){return new Promise((e,n)=>{let r=0,o=[];function s(){let p=t.read();p?l(p):t.once("readable",s)}function i(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",s)}function a(){i(),qh("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){i(),qh("onerror %o",p),n(p)}function l(p){o.push(p),r+=p.length;let d=Buffer.concat(o,r),_=d.indexOf(`\r
32
33
  \r
33
- `);if(_===-1){MT("have not received end of HTTP headers yet..."),s();return}let f=d.subarray(0,_).toString("ascii").split(`\r
34
- `),m=f.shift();if(!m)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let T=m.split(" "),h=+(T[1]||0),S=T.slice(2).join(" "),R={};for(let I of f){if(!I)continue;let x=I.indexOf(":");if(x===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let V=I.slice(0,x).toLowerCase(),B=I.slice(x+1).trimStart(),se=R[V];typeof se=="string"?R[V]=[se,B]:Array.isArray(se)?se.push(B):R[V]=B}MT("got proxy server response: %o %o",m,R),i(),e({connect:{statusCode:h,statusText:S,headers:R},buffered:d})}t.on("error",c),t.on("end",a),s()})}function Dp(...t){g.log("[https-proxy-agent]",...t)}var Up=class extends PT{static __initStatic(){this.protocols=["http","https"]}constructor(e,n){super(n),this.options={},this.proxy=typeof e=="string"?new URL(e):e,this.proxyHeaders=n?.headers??{},Dp("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?iF(n,"headers"):null,host:r,port:o}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let o;if(r.protocol==="https:"){Dp("Creating `tls.Socket`: %o",this.connectOpts);let _=this.connectOpts.servername||this.connectOpts.host;o=sN.connect({...this.connectOpts,servername:_&&jo.isIP(_)?void 0:_})}else Dp("Creating `net.Socket`: %o",this.connectOpts),o=jo.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=jo.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${i}:${n.port} HTTP/1.1\r
34
+ `);if(_===-1){qh("have not received end of HTTP headers yet..."),s();return}let f=d.subarray(0,_).toString("ascii").split(`\r
35
+ `),m=f.shift();if(!m)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let h=m.split(" "),T=+(h[1]||0),S=h.slice(2).join(" "),R={};for(let I of f){if(!I)continue;let x=I.indexOf(":");if(x===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let F=I.slice(0,x).toLowerCase(),B=I.slice(x+1).trimStart(),se=R[F];typeof se=="string"?R[F]=[se,B]:Array.isArray(se)?se.push(B):R[F]=B}qh("got proxy server response: %o %o",m,R),i(),e({connect:{statusCode:T,statusText:S,headers:R},buffered:d})}t.on("error",c),t.on("end",a),s()})}function Fp(...t){g.log("[https-proxy-agent]",...t)}var Vp=class extends Vh{static __initStatic(){this.protocols=["http","https"]}constructor(e,n){super(n),this.options={},this.proxy=typeof e=="string"?new URL(e):e,this.proxyHeaders=n?.headers??{},Fp("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?VV(n,"headers"):null,host:r,port:o}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let o;if(r.protocol==="https:"){Fp("Creating `tls.Socket`: %o",this.connectOpts);let _=this.connectOpts.servername||this.connectOpts.host;o=PO.connect({...this.connectOpts,servername:_&&Vo.isIP(_)?void 0:_})}else Fp("Creating `net.Socket`: %o",this.connectOpts),o=Vo.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=Vo.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${i}:${n.port} HTTP/1.1\r
35
36
  `;if(r.username||r.password){let _=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(_).toString("base64")}`}s.Host=`${i}:${n.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let _ of Object.keys(s))a+=`${_}: ${s[_]}\r
36
- `;let c=sF(o);o.write(`${a}\r
37
- `);let{connect:l,buffered:p}=await c;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200){if(e.once("socket",cfe),n.secureEndpoint){Dp("Upgrading socket connection to TLS");let _=n.servername||n.host;return sN.connect({...iF(n,"host","path","port"),socket:o,servername:jo.isIP(_)?void 0:_})}return o}o.destroy();let d=new jo.Socket({writable:!1});return d.readable=!0,e.once("socket",_=>{Dp("Replaying proxy buffer for failed request"),_.push(p),_.push(null)}),d}};Up.__initStatic();function cfe(t){t.resume()}function iF(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}var _fe=1024*32;function ffe(t){return new pfe({read(){this.push(t),this.push(null)}})}function aF(t){let e;try{e=new URL(t.url)}catch{return Qe(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),tp(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=mfe(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?lfe:ufe,s=t.keepAlive===void 0?!1:t.keepAlive,i=r?new Up(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=Tfe(t,t.httpModule??o,i);return tp(t,a)}function mfe(t,e){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>t.host.endsWith(o)||t.hostname.endsWith(o)))return e}function Tfe(t,e,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(l){return new Promise((p,d)=>{yc(()=>{let _=ffe(l.body),f={...t.headers};l.body.length>_fe&&(f["content-encoding"]="gzip",_=_.pipe(dfe()));let m=r.startsWith("["),T=e.request({method:"POST",agent:n,headers:f,hostname:m?r.slice(1,-1):r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},h=>{h.on("data",()=>{}),h.on("end",()=>{}),h.setEncoding("utf8");let S=h.headers["retry-after"]??null,R=h.headers["x-sentry-rate-limits"]??null;p({statusCode:h.statusCode,headers:{"retry-after":S,"x-sentry-rate-limits":Array.isArray(R)?R[0]||null:R}})});T.on("error",d),_.pipe(T)})})}}function cF(t){if(t===!1)return!1;if(typeof t=="string")return t;let e=bc(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=e===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return t===!0?n??!0:e??n}import{posix as hfe,sep as Efe}from"node:path";function uF(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function lF(t=process.argv[1]?iy(process.argv[1]):process.cwd(),e=Efe==="\\"){let n=e?uF(t):t;return r=>{if(!r)return;let o=e?uF(r):r,{dir:s,base:i,ext:a}=hfe.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let l=s.lastIndexOf("/node_modules");if(l>-1)return`${s.slice(l+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let p=s.slice(n.length+1).replace(/\//g,".");return p?`${p}:${c}`:c}return c}}function pF(t){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(J.SENTRY_RELEASE?.id)return J.SENTRY_RELEASE.id;let e=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return e||n||r||t}var dF=hf(Gy(lF()));b();var fF=K(ne(),1);import*as _F from"node:os";import{threadId as Sfe,isMainThread as gfe}from"worker_threads";var Afe=6e4,xT=class extends np{constructor(e){let n=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||_F.hostname(),r={...e,platform:"node",runtime:e.runtime||{name:"node",version:global.process.version},serverName:n};e.openTelemetryInstrumentations&&(0,fF.registerInstrumentations)({instrumentations:e.openTelemetryInstrumentations}),Vi(r,"node"),g.log(`Initializing Sentry: process: ${process.pid}, thread: ${gfe?"main":`worker-${Sfe}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Nc(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let e="@sentry/node",n=pe,r=X.getTracer(e,n);return this._tracer=r,r}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}async close(e){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener);let n=await super.close(e);return this.traceProvider&&await this.traceProvider.shutdown(),n}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{re&&g.log("Flushing client reports based on interval."),this._flushOutcomes()},e.clientReportFlushInterval??Afe).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_setupIntegrations(){ZR(),super._setupIntegrations()}_getTraceInfoFromScope(e){return e?hV(this,e):[void 0,void 0]}};var mF=K(GA(),1);import*as TF from"module";function iN(){if(WV()&&!J._sentryEsmLoaderHookRegistered){J._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:t}=(0,mF.createAddHookMessageChannel)();TF.register("import-in-the-middle/hook.mjs",import.meta.url,{data:{addHookMessagePort:t,include:[]},transferList:[t]})}catch(t){g.warn("Failed to register 'import-in-the-middle' hook",t)}}}function vT(){return[Zf(),Xf(),em(),tm(),oF(),ly(),rm(),jj(),$j(),JV(),ZV(),kV(),$V(),xV(),CV(),eF(),XV()]}function aN(t={}){return Rfe(t,vT)}function Rfe(t={},e){let n=yfe(t,e);n.debug===!0&&(re?g.enable():Qe(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&iN(),gV(),Te().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===rN)&&n.integrations.push(nF({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),Vi(n,"node-core");let o=new xT(n);return Te().setClient(o),o.init(),g.log(`SDK initialized from ${vp()?"CommonJS":"ESM"}`),o.startClientReportTracking(),Ofe(),rV(o),SV(o),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function cN(){if(!re)return;let t=aV(),e=["SentryContextManager","SentryPropagator"];Xe()&&e.push("SentrySpanProcessor");for(let n of e)t.includes(n)||g.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);t.includes("SentrySampler")||g.warn("You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.")}function yfe(t,e){let n=Ife(t.release),r=cF(t.spotlight),o=Nfe(t.tracesSampleRate),s={...t,dsn:t.dsn??process.env.SENTRY_DSN,environment:t.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:t.sendClientReports??!0,transport:t.transport??aF,stackParser:ZA(t.stackParser||dF),release:n,tracesSampleRate:o,spotlight:r,debug:bc(t.debug??process.env.SENTRY_DEBUG)},i=t.integrations,a=t.defaultIntegrations??e(s);return{...s,integrations:$R({defaultIntegrations:a,integrations:i})}}function Ife(t){if(t!==void 0)return t;let e=pF();if(e!==void 0)return e}function Nfe(t){if(t!==void 0)return t;let e=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!e)return;let n=parseFloat(e);return isFinite(n)?n:void 0}function Ofe(){if(bc(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let t=process.env.SENTRY_TRACE,e=process.env.SENTRY_BAGGAGE,n=Hl(t,e);Te().setPropagationContext(n)}}function Re(t,e){t.setAttribute(W,e)}function wp(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`,o=t.path?t.path:"/";return`${e}//${n}${r}${o}`}var uN="Http",hF="@opentelemetry_sentry-patched/instrumentation-http",LT=Mr.major===22&&Mr.minor>=12||Mr.major===23&&Mr.minor>=2||Mr.major>=24,bfe=w(`${uN}.sentry`,t=>new Qi(t)),Cfe=w(uN,t=>{let e=new EF.HttpInstrumentation({...t,disableIncomingRequestInstrumentation:!0});try{e._diag=Dn.createComponentLogger({namespace:hF}),e.instrumentationName=hF}catch{}try{let n={get:()=>!1,set:()=>{}};Object.defineProperty(e,"_httpPatched",n),Object.defineProperty(e,"_httpsPatched",n)}catch{}return e});function Pfe(t,e={}){return typeof t.spans=="boolean"?t.spans:!(e.skipOpenTelemetrySetup||!Xe(e)&&LT)}var SF=(t={})=>{let e=t.spans??!0,n=t.disableIncomingRequestSpans,r={sessions:t.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:t.sessionFlushingDelayMS,ignoreRequestBody:t.ignoreIncomingRequestBody,maxRequestBodySize:t.maxIncomingRequestBodySize},o={ignoreIncomingRequests:t.ignoreIncomingRequests,ignoreStaticAssets:t.ignoreStaticAssets,ignoreStatusCodes:t.dropSpansForIncomingRequestStatusCodes,instrumentation:t.instrumentation,onSpanCreated:t.incomingRequestSpanHook},s=hp(r),i=Ep(o),a=e&&!n;return{name:uN,setup(c){let l=c.getOptions();a&&Xe(l)&&i.setup(c)},setupOnce(){let c=H()?.getOptions()||{},l=Pfe(t,c);s.setupOnce();let p={breadcrumbs:t.breadcrumbs,propagateTraceInOutgoingRequests:typeof t.tracePropagation=="boolean"?t.tracePropagation:LT||!l,createSpansForOutgoingRequests:LT,spans:t.spans,ignoreOutgoingRequests:t.ignoreOutgoingRequests,outgoingRequestHook:(d,_)=>{let f=wp(_);if(f.startsWith("data:")){let m=Cc(f);d.setAttribute("http.url",m),d.setAttribute(Ts,m),d.updateName(`${_.method||"GET"} ${m}`)}t.instrumentation?.requestHook?.(d,_)},outgoingResponseHook:t.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:t.instrumentation?.applyCustomAttributesOnSpan};if(bfe(p),l){let d=Mfe(t);Cfe(d)}},processEvent(c){return i.processEvent(c)}}};function Mfe(t={}){return{disableOutgoingRequestInstrumentation:LT,ignoreOutgoingRequestHook:n=>{let r=wp(n);if(!r)return!1;let o=t.ignoreOutgoingRequests;return!!o?.(r,n)},requireParentforOutgoingSpans:!1,requestHook:(n,r)=>{Re(n,"auto.http.otel.http");let o=wp(r);if(o.startsWith("data:")){let s=Cc(o);n.setAttribute("http.url",s),n.setAttribute(Ts,s),n.updateName(`${r.method||"GET"} ${s}`)}t.instrumentation?.requestHook?.(n,r)},responseHook:(n,r)=>{t.instrumentation?.responseHook?.(n,r)},applyCustomAttributesOnSpan:(n,r,o)=>{t.instrumentation?.applyCustomAttributesOnSpan?.(n,r,o)}}}var NF=K(yF(),1);var OF="NodeFetch",Lfe=w(OF,NF.UndiciInstrumentation,t=>kfe(t)),Dfe=w(`${OF}.sentry`,Xi,t=>t),Ufe=(t={})=>({name:"NodeFetch",setupOnce(){wfe(t,H()?.getOptions())&&Lfe(t),Dfe(t)}}),bF=Ufe;function IF(t,e="/"){let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e}`:`${n}${e}`}function wfe(t,e={}){return typeof t.spans=="boolean"?t.spans:!e.skipOpenTelemetrySetup&&Xe(e)}function kfe(t={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=IF(n.origin,n.path),o=t.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=IF(n.origin,n.path);if(r.startsWith("data:")){let o=Cc(r);return{[W]:"auto.http.otel.node_fetch","http.url":o,[Ts]:o,[Zn]:`${n.method||"GET"} ${o}`}}return{[W]:"auto.http.otel.node_fetch"}},requestHook:t.requestHook,responseHook:t.responseHook,headersToSpanAttributes:t.headersToSpanAttributes}}var GF=K(kF(),1);var ft=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var BF="Express";function Zfe(t){Re(t,"auto.http.otel.express");let e=Y(t).data,n=e["express.type"];n&&t.setAttribute(ee,`${n}.express`);let r=e["express.name"];typeof r=="string"&&t.updateName(r)}function eme(t,e){if(ue()===Jn())return ft&&g.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let n=t.request,r=n.method?n.method.toUpperCase():"GET";ue().setTransactionName(`${r} ${t.route}`)}return e}var jF=w(BF,()=>new GF.ExpressInstrumentation({requestHook:t=>Zfe(t),spanNameHook:(t,e)=>eme(t,e)})),tme=()=>({name:BF,setupOnce(){jF()}}),HF=tme;var _$=K(a$(),1);import*as JN from"node:diagnostics_channel";b();var Ah=K(he(),1),ia=K(ne(),1);le();var Vo;(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})(Vo||(Vo={}));var Zp;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(Zp||(Zp={}));var ed;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(ed||(ed={}));b();var td=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function XN(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[td]||[];return s.push(o),Object.defineProperty(t,td,{enumerable:!1,configurable:!0,value:s}),o}function Sh(t,e){let n=t[td]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:Be.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[td])}function u$(t,e,n){let r,o;try{o=t(),c$(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!c$(o)&&(e(r,o),r))throw r;return o}}function c$(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var Jhe="0.1.0",Zhe="@sentry/instrumentation-fastify-v3",l$="anonymous",eEe=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),gh=class extends ia.InstrumentationBase{constructor(e={}){super(Zhe,Jhe,e)}init(){return[new ia.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,Ah.getRPCMetadata)(P.active()),c=i.routeOptions?i.routeOptions.url:r.routerPath;c&&a?.type===Ah.RPCType.HTTP&&(a.route=c);let l=r.method||"GET";ue().setTransactionName(`${l} ${c}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||l$,c=`${ed.MIDDLEWARE} - ${a}`,l=i[1],p=XN(l,s.tracer,c,{[Vo.FASTIFY_TYPE]:Zp.MIDDLEWARE,[Vo.PLUGIN_NAME]:e,[Vo.HOOK_NAME]:n}),d=o&&i[i.length-1];return d&&(i[i.length-1]=function(..._){Sh(l),d.apply(this,_)}),P.with(X.setSpan(P.active(),p),()=>u$(()=>r.apply(this,i),_=>{_ instanceof Error&&(p.setStatus({code:Be.ERROR,message:_.message}),p.recordException(_)),o||Sh(l)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!eEe.has(s))return n.apply(this,o);let c=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,c)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),tEe(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,ia.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),Sh(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,c=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,l=`${ed.REQUEST_HANDLER} - ${c||this.pluginName||l$}`,p={[Vo.PLUGIN_NAME]:this.pluginName,[Vo.FASTIFY_TYPE]:Zp.REQUEST_HANDLER,[Dg]:i.routeOptions?i.routeOptions.url:r.routerPath};c&&(p[Vo.FASTIFY_NAME]=c);let d=XN(o,e.tracer,l,p);p$(d);let{requestHook:_}=e.getConfig();return _&&(0,ia.safeExecuteInTheMiddle)(()=>_(d,{request:r}),f=>{f&&e._diag.error("request hook failed",f)},!0),P.with(X.setSpan(P.active(),d),()=>{s()})}}};function tEe(){let t=H();t&&t.on("spanStart",e=>{p$(e)})}function p$(t){let e=Y(t).data,n=e["fastify.type"];if(e[ee]||!n)return;t.setAttributes({[W]:"auto.http.otel.fastify",[ee]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var Rh="Fastify",f$=w(`${Rh}.v3`,()=>new gh);function nEe(){let t=H();if(t)return t.getIntegrationByName(Rh)}function d$(t,e,n,r){let o=nEe()?.getShouldHandleError()||h$;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){ft&&g.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&te(t,{mechanism:{handled:!1,type:"auto.function.fastify"}})}var m$=w(`${Rh}.v5`,()=>{let t=new _$.FastifyOtelInstrumentation,e=t.plugin();return JN.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?ft&&g.error("Failed to setup Fastify instrumentation",o):(oEe(),r&&sEe(r))})}),JN.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;d$.call(d$,r,o,s,"diagnostics-channel")}),t}),rEe=({shouldHandleError:t})=>{let e;return{name:Rh,setupOnce(){e=t||h$,f$(),m$()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}},T$=(t={})=>rEe(t);function h$(t,e,n){let r=n.statusCode;return r>=500||r<=299}function E$(t){let e=Y(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[ee]||!i&&!a&&!s)return;let c=s?"hook":i?"middleware":a?"request_handler":"<unknown>";t.setAttributes({[W]:"auto.http.otel.fastify",[ee]:`${c}.fastify`});let l=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof l=="string"){let p=l.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(p)}}function oEe(){let t=H();t&&t.on("spanStart",e=>{E$(e)})}function sEe(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&E$(s)}let r=e.routeOptions?.url,o=e.method||"GET";ue().setTransactionName(`${o} ${r}`)})}b();var B$=K(G$(),1);var j$="Graphql",H$=w(j$,B$.GraphQLInstrumentation,t=>{let e=F$(t);return{...e,responseHook(n,r){Re(n,"auto.graphql.otel.graphql"),r.errors?.length&&!Y(n).status&&n.setStatus({code:Be.ERROR});let s=Y(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let c=je(n),p=Y(c).data[Zc]||[],d=a?`${i} ${a}`:`${i}`;Array.isArray(p)?(p.push(d),c.setAttribute(Zc,p)):typeof p=="string"?c.setAttribute(Zc,[p,d]):c.setAttribute(Zc,d),Y(c).data["original-description"]||c.setAttribute("original-description",Y(c).description),c.updateName(`${Y(c).data["original-description"]} (${OEe(p)})`)}}}}),NEe=(t={})=>({name:j$,setupOnce(){H$(F$(t))}}),V$=NEe;function F$(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function OEe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}var tY=K(eY(),1);var nY="Kafka",rY=w(nY,()=>new tY.KafkaJsInstrumentation({consumerHook(t){Re(t,"auto.kafkajs.otel.consumer")},producerHook(t){Re(t,"auto.kafkajs.otel.producer")}})),CEe=()=>({name:nY,setupOnce(){rY()}}),oY=CEe;var pY=K(lY(),1);var dY="LruMemoizer",_Y=w(dY,()=>new pY.LruMemoizerInstrumentation),MEe=()=>({name:dY,setupOnce(){_Y()}}),fY=MEe;var yY=K(RY(),1);var IY="Mongo",NY=w(IY,()=>new yY.MongoDBInstrumentation({dbStatementSerializer:UEe,responseHook(t){Re(t,"auto.db.otel.mongo")}}));function UEe(t){let e=aO(t);return JSON.stringify(e)}function aO(t){if(Array.isArray(t))return t.map(e=>aO(e));if(wEe(t)){let e={};return Object.entries(t).map(([n,r])=>[n,aO(r)]).reduce((n,r)=>(GEe(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function wEe(t){return typeof t=="object"&&t!==null&&!kEe(t)}function kEe(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function GEe(t){return Array.isArray(t)}var BEe=()=>({name:IY,setupOnce(){NY()}}),OY=BEe;var kY=K(wY(),1);var GY="Mongoose",BY=w(GY,()=>new kY.MongooseInstrumentation({responseHook(t){Re(t,"auto.db.otel.mongoose")}})),zEe=()=>({name:GY,setupOnce(){BY()}}),jY=zEe;var zY=K(WY(),1);var KY="Mysql",QY=w(KY,()=>new zY.MySQLInstrumentation({})),oSe=()=>({name:KY,setupOnce(){QY()}}),XY=oSe;var sW=K(oW(),1);var iW="Mysql2",aW=w(iW,()=>new sW.MySQL2Instrumentation({responseHook(t){Re(t,"auto.db.otel.mysql2")}})),SSe=()=>({name:iW,setupOnce(){aW()}}),cW=SSe;var DW=K(TW(),1),UW=K(PW(),1);var GSe=["get","set","setex"],CO=["get","mget"],BSe=["set","setex"];function md(t,e){return t.includes(e.toLowerCase())}function PO(t){return md(CO,t)?"cache.get":md(BSe,t)?"cache.put":void 0}function jSe(t,e){return e.some(n=>t.startsWith(n))}function xW(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?MW(o.map(s=>n(s))):["<unknown>"],r=e[0];return md(GSe,t)&&r!=null?n(r):MW(e.map(o=>n(o)))}catch{return}}function vW(t,e,n){if(!PO(t))return!1;for(let r of e)if(jSe(r,n))return!0;return!1}function LW(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function MW(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var sE="Redis",Td={},wW=(t,e,n,r)=>{t.setAttribute(W,"auto.db.otel.redis");let o=xW(e,n),s=PO(e);if(!o||!s||!Td.cachePrefixes||!vW(e,o,Td.cachePrefixes))return;let i=Y(t).data["net.peer.name"],a=Y(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=LW(r);c&&t.setAttribute(NR,c),md(CO,e)&&c!==void 0&&t.setAttribute(yR,c>0),t.setAttributes({[ee]:s,[IR]:o});let l=o.join(", ");t.updateName(Td.maxCacheKeyLength?ps(l,Td.maxCacheKeyLength):l)},HSe=w(`${sE}.IORedis`,()=>new DW.IORedisInstrumentation({responseHook:wW})),VSe=w(`${sE}.Redis`,()=>new UW.RedisInstrumentation({responseHook:wW})),kW=Object.assign(()=>{HSe(),VSe()},{id:sE}),FSe=(t={})=>({name:sE,setupOnce(){Td=t,kW()}}),GW=FSe;var tz=K(ez(),1);var nz="Postgres",rz=w(nz,tz.PgInstrumentation,t=>({requireParentSpan:!0,requestHook(e){Re(e,"auto.db.otel.postgres")},ignoreConnectSpans:t?.ignoreConnectSpans??!1})),oge=t=>({name:nz,setupOnce(){rz(t)}}),oz=oge;b();var Ks=K(ne(),1);le();var wO="PostgresJs",sz=[">=3.0.0 <4"],sge=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,ige=Symbol.for("sentry.query.from.instrumented.sql"),iz=w(wO,t=>new UO({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),UO=class extends Ks.InstrumentationBase{constructor(e){super("sentry-postgres-js",pe,e)}init(){let e=new Ks.InstrumentationNodeModuleDefinition("postgres",sz,n=>{try{return this._patchPostgres(n)}catch(r){return ft&&g.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new Ks.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,sz,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return ft&&g.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);if(!a||typeof a!="function")return ft&&g.warn("postgres() did not return a valid instance"),a;let c=o.getConfig();return uy(a,{requireParentSpan:c.requireParentSpan,requestHook:c.requestHook})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(fp(e,"default",s),e)}_shouldCreateSpans(){let e=this.getConfig();return X.getSpan(P.active())!==void 0||!e.requireParentSpan}_setOperationName(e,n,r){if(r){e.setAttribute(Ya,r);return}let o=n?.match(sge);o?.[1]&&e.setAttribute(Ya,o[1].toUpperCase())}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[ige])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return yt({name:i||"postgresjs.query",op:"db"},a=>{Re(a,"auto.db.postgresjs"),a.setAttributes({[yi]:"postgres",[Hg]:i});let c=n.getConfig(),{requestHook:l}=c;l&&(0,Ks.safeExecuteInTheMiddle)(()=>l(a,i,void 0),_=>{_&&(a.setAttribute("sentry.hook.error","requestHook failed"),ft&&g.error(`Error in requestHook for ${wO} integration:`,_))},!0);let p=this.resolve;this.resolve=new Proxy(p,{apply:(_,f,m)=>{try{n._setOperationName(a,i,m?.[0]?.command),a.end()}catch(T){ft&&g.error("Error ending span in resolve callback:",T)}return Reflect.apply(_,f,m)}});let d=this.reject;this.reject=new Proxy(d,{apply:(_,f,m)=>{try{a.setStatus({code:2,message:m?.[0]?.message||"unknown_error"}),a.setAttribute(Vg,m?.[0]?.code||"unknown"),a.setAttribute(Fg,m?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(T){ft&&g.error("Error ending span in reject callback:",T)}return Reflect.apply(_,f,m)}});try{return r.apply(this,o)}catch(_){throw a.setStatus({code:2,message:_ instanceof Error?_.message:"unknown_error"}),a.end(),_}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},age=t=>({name:wO,setupOnce(){iz(t)}}),az=age;b();b();var LE=K(qz(),1);b();var CAe={name:"@prisma/instrumentation-contract",version:"7.6.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},PAe=CAe.version.split(".")[0],ib="PRISMA_INSTRUMENTATION",ab=`V${PAe}_PRISMA_INSTRUMENTATION`,Gu=globalThis;function MAe(){let t=Gu[ab];return t?.helper?t.helper:Gu[ib]?.helper}function xAe(t){let e={helper:t};Gu[ab]=e,Gu[ib]=e}function vAe(){delete Gu[ab],delete Gu[ib]}var LAe=process.env.PRISMA_SHOW_ALL_TRACES==="true",DAe="00-10-10-00";function UAe(t){switch(t){case"client":return Oe.CLIENT;case"internal":default:return Oe.INTERNAL}}var wAe=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=X.getSpanContext(t??P.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:DAe}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)Wz(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return P.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!LAe)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(zz(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return $z(s,e(s,r))}return n.startActiveSpan(o,t,s=>$z(s,e(s,r)))}};function Wz(t,e,n,r,o){if(zz(e.name,o))return;let s={attributes:e.attributes,kind:UAe(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let l=r.get(c);return l?{context:{spanId:l,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)Wz(t,c,n,r,o);i.end(e.endTime)})}function $z(t,e){return kAe(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function kAe(t){return t!=null&&typeof t.then=="function"}function zz(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var Kz={name:"@prisma/instrumentation",version:"7.6.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},Yz=Kz.version,GAe=Kz.name,BAe="@prisma/client",Qz=class extends LE.InstrumentationBase{tracerProvider;constructor(t={}){super(GAe,Yz,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new LE.InstrumentationNodeModuleDefinition(BAe,[Yz])]}enable(){let t=this._config;xAe(new wAe({tracerProvider:this.tracerProvider??X.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){vAe()}isEnabled(){return MAe()!==void 0}};var Xz="Prisma";function jAe(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function Jz(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}var cb=class extends Qz{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=Jz();jAe(e)&&(e.createEngineSpan=n=>{let r=X.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Qe(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=HAe(s.kind),a=s.parent_span_id,c=s.span_id,l=s.trace_id,p=s.links?.map(_=>({context:{traceId:_.trace_id,spanId:_.span_id,traceFlags:Vt.SAMPLED}})),d=X.setSpanContext(P.active(),{traceId:l,spanId:a,traceFlags:Vt.SAMPLED});P.with(d,()=>{let _={generateTraceId:()=>l,generateSpanId:()=>c};r._idGenerator=_,r.startSpan(s.name,{kind:i,links:p,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};function HAe(t){switch(t){case"client":return Oe.CLIENT;case"internal":default:return Oe.INTERNAL}}var VAe=w(Xz,t=>new cb(t)),Zz=t=>({name:Xz,setupOnce(){VAe(t)},setup(e){Jz()&&e.on("spanStart",n=>{let r=Y(n);r.description?.startsWith("prisma:")&&n.setAttribute(W,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}});var uK=K(cK(),1);var lK="Hapi",pK=w(lK,()=>new uK.HapiInstrumentation),tRe=()=>({name:lK,setupOnce(){pK()}}),dK=tRe;le();var Zs={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Md={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"};b();var kE=K(ne(),1);var nRe="@sentry/instrumentation-hono",rRe="0.0.1",wE=class extends kE.InstrumentationBase{constructor(e={}){super(nRe,rRe,e)}init(){return[new kE.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return P.with(X.setSpan(P.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(xt(a))return a.then(c=>{let l=n._determineHandlerType(c);return i.setAttributes({[Zs.HONO_TYPE]:l,[Zs.HONO_NAME]:l===Md.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),c});{let c=n._determineHandlerType(a);return i.setAttributes({[Zs.HONO_TYPE]:c,[Zs.HONO_NAME]:c===Md.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return xt(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Md.MIDDLEWARE:Md.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:Be.ERROR,message:n.message}),e.recordException(n))}};var _K="Hono";function oRe(t){let e=Y(t).data,n=e[Zs.HONO_TYPE];if(e[ee]||!n)return;t.setAttributes({[W]:"auto.http.otel.hono",[ee]:`${n}.hono`});let r=e[Zs.HONO_NAME];if(typeof r=="string"&&t.updateName(r),ue()===Jn()){ft&&g.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[No],s=e[Ii];typeof o=="string"&&typeof s=="string"&&ue().setTransactionName(`${s} ${o}`)}var fK=w(_K,()=>new wE({responseHook:t=>{oRe(t)}})),sRe=()=>({name:_K,setupOnce(){fK()}}),mK=sRe;var bK=K(OK(),1);le();var CK="Koa",PK=w(CK,bK.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Re(e,"auto.http.otel.koa");let r=Y(e).data,o=r["koa.type"];o&&e.setAttribute(ee,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),ue()===Jn()){ft&&g.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[No],a=n.context?.request?.method?.toUpperCase()||"GET";i&&ue().setTransactionName(`${a} ${i}`)}})),fRe=(t={})=>({name:CK,setupOnce(){PK(t)}}),MK=fRe;var BK=K(GK(),1);var jK="Connect",HK=w(jK,()=>new BK.ConnectInstrumentation),IRe=()=>({name:jK,setupOnce(){HK()}}),VK=IRe;var JK=K(XK(),1);var PRe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),ZK="Tedious",e2=w(ZK,()=>new JK.TediousInstrumentation({})),MRe=()=>{let t;return{name:ZK,setupOnce(){let e=e2();t=Tp(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=Y(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";PRe.has(s)&&n.setAttribute(W,"auto.db.otel.tedious")}))}}},t2=MRe;var i2=K(s2(),1);var a2="GenericPool",c2=w(a2,()=>new i2.GenericPoolInstrumentation({})),vRe=()=>{let t;return{name:a2,setupOnce(){let e=c2();t=Tp(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=Y(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(W,"auto.db.otel.generic_pool")}))}}},u2=vRe;var S2=K(E2(),1);var g2="Amqplib",FRe={consumeEndHook:t=>{Re(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Re(t,"auto.amqplib.otel.publisher")}},A2=w(g2,()=>new S2.AmqplibInstrumentation(FRe)),qRe=()=>({name:g2,setupOnce(){A2()}}),R2=qRe;var Ud="VercelAI";var eS=K(ne(),1);var $Re=[">=3.0.0 <7"],y2=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];function YRe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function WRe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;Array.isArray(e.content)&&(zRe(e.content),KRe(e.content))}function zRe(t){for(let e of t){if(!YRe(e))continue;let n=Py(e.toolCallId);n?wn(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),te(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):wn(r=>{r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),te(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function KRe(t){for(let e of t)typeof e=="object"&&e!==null&&"toolCallId"in e&&typeof e.toolCallId=="string"&&My(e.toolCallId)}function QRe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var ZE=class t extends eS.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",pe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new eS.InstrumentationNodeModuleDefinition("ai",$Re,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},c=a.isEnabled,l=H(),p=l?.getIntegrationByName(Ud),d=p?.options,_=p?!!l?.getOptions().sendDefaultPii:!1,{recordInputs:f,recordOutputs:m}=QRe(d,a,c,_);return i[0].experimental_telemetry={...a,isEnabled:c!==void 0?c:!0,recordInputs:f,recordOutputs:m},br(()=>Reflect.apply(o,s,i),T=>{T&&typeof T=="object"&&nt(T,"_sentry_active_span",er())},()=>{},T=>{WRe(T)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of y2)e[r]!=null&&(e[r]=n(e[r]));return e}else{let r=y2.reduce((o,s)=>(e[s]!=null&&(o[s]=n(e[s])),o),{});return{...e,...r}}}};var I2=w(Ud,()=>new ZE({}));function XRe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var JRe=(t={})=>{let e;return{name:Ud,options:t,setupOnce(){e=I2()},afterAllSetup(n){t.force??XRe(n)?dm(n):e?.callWhenPatched(()=>dm(n))}}},N2=JRe;var nS=K(ne(),1);var ZRe=[">=4.0.0 <7"],tS=class extends nS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",pe,e)}init(){return new nS.InstrumentationNodeModuleDefinition("openai",ZRe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(Hi(xs))return Reflect.construct(r,i);let a=Reflect.construct(r,i);return fm(a,o)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}};var O2=w(xs,t=>new tS(t)),eye=(t={})=>({name:xs,setupOnce(){O2(t)}}),b2=eye;var oS=K(ne(),1);var tye=[">=0.19.2 <1.0.0"],rS=class extends oS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",pe,e)}init(){return new oS.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",tye,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(Hi(vs))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return mm(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}};var C2=w(vs,t=>new rS(t)),nye=(t={})=>({name:vs,options:t,setupOnce(){C2(t)}}),P2=nye;var Xu=K(ne(),1);var M2=[">=0.10.0 <2"],sS=class extends Xu.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",pe,e)}init(){return new Xu.InstrumentationNodeModuleDefinition("@google/genai",M2,n=>this._patch(n),n=>n,[new Xu.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",M2,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(Hi(Ls))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return Tm(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return fp(e,"GoogleGenAI",o),e}};var x2=w(Ls,t=>new sS(t)),rye=(t={})=>({name:Ls,setupOnce(){x2(t)}}),v2=rye;var ci=K(ne(),1);var iS=[">=0.1.0 <2.0.0"];function oye(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function sye(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let c=a.callbacks,l=oye(c,e);return a.callbacks=l,Reflect.apply(r,o,s)}})}var aS=class extends ci.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",pe,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new ci.InstrumentationNodeModuleDefinition(r,iS,this._patch.bind(this),o=>o,[new ci.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,iS,this._patch.bind(this),o=>o)]));return e.push(new ci.InstrumentationNodeModuleDefinition("langchain",iS,this._patch.bind(this),r=>r,[new ci.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",iS,this._patch.bind(this),r=>r)])),e}_patch(e){JR([xs,vs,Ls]);let n=Em(this.getConfig());return this._patchRunnableMethods(e,n),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(c=>typeof c=="function"&&r.includes(c.name));if(!s)return;let i=s.prototype;if(i.__sentry_patched__)return;i.__sentry_patched__=!0;let a=["invoke","stream","batch"];for(let c of a){let l=i[c];typeof l=="function"&&(i[c]=sye(l,n))}}};var L2=w(hm,t=>new aS(t)),iye=(t={})=>({name:hm,setupOnce(){L2(t)}}),D2=iye;var Ju=K(ne(),1);var U2=[">=0.0.0 <2.0.0"],cS=class extends Ju.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",pe,e)}init(){return new Ju.InstrumentationNodeModuleDefinition("@langchain/langgraph",U2,this._patch.bind(this),n=>n,[new Ju.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",U2,this._patch.bind(this),n=>n)])}_patch(e){return e.StateGraph&&typeof e.StateGraph=="function"&&gm(e.StateGraph.prototype,this.getConfig()),e}};var w2=w(Sm,t=>new cS(t)),aye=(t={})=>({name:Sm,setupOnce(){w2(t)}}),k2=aye;var $2=K(ne(),1);b();var zo=K(ne(),1);le();import*as B2 from"node:net";function j2(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=p=>{(0,zo.safeExecuteInTheMiddle)(()=>a(p),d=>{d&&Dn.error(d?.message)},!0)});let c=new zo.InstrumentationNodeModuleDefinition("@firebase/firestore",e,p=>G2(p,n,r,t,i)),l=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let p of l)c.files.push(new zo.InstrumentationNodeModuleFile(p,e,d=>G2(d,n,r,t,i),d=>H2(d,r)));return c}function G2(t,e,n,r,o){return H2(t,n),e(t,"addDoc",cye(r,o)),e(t,"getDocs",lye(r,o)),e(t,"setDoc",pye(r,o)),e(t,"deleteDoc",uye(r,o)),t}function H2(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,zo.isWrapped)(t[n])&&e(t,n);return t}function cye(t,e){return function(r){return function(o,s){let i=lS(t,"addDoc",o);return e(i),uS(i,()=>r(o,s))}}}function uye(t,e){return function(r){return function(o){let s=lS(t,"deleteDoc",o.parent||o);return e(s),uS(s,()=>r(o))}}}function lye(t,e){return function(r){return function(o){let s=lS(t,"getDocs",o);return e(s),uS(s,()=>r(o))}}}function pye(t,e){return function(r){return function(o,s,i){let a=lS(t,"setDoc",o.parent||o);return e(a),uS(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function uS(t,e){return P.with(X.setSpan(P.active(),t),()=>(0,zo.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function lS(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Oe.CLIENT});return _ye(r,n),r.setAttribute(Ya,e),r}function dye(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(B2.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function _ye(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[Bg]:e.path,[jg]:n.name,[yi]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:c}=dye(s);a&&(i[zg]=a),c&&(i[Kg]=c),t.setAttributes(i)}b();var Ko=K(ne(),1);function V2(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,c=o.functions?.requestHook,l=o.functions?.responseHook;typeof l=="function"&&(i=(_,f)=>{(0,Ko.safeExecuteInTheMiddle)(()=>l(_,f),m=>{m&&Dn.error(m?.message)},!0)}),typeof c=="function"&&(s=_=>{(0,Ko.safeExecuteInTheMiddle)(()=>c(_),f=>{f&&Dn.error(f?.message)},!0)});let p=new Ko.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:_,triggerType:f})=>{p.files.push(new Ko.InstrumentationNodeModuleFile(_,e,m=>fye(m,n,r,t,{requestHook:s,responseHook:i,errorHook:a},f),m=>F2(m,r)))}),p}function hn(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let c=async function(...l){let p=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",d=t.startSpan(`firebase.function.${n}`,{kind:Oe.SERVER}),_={"faas.name":p,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(_["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(_["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),d.setAttributes(_),e?.requestHook?.(d),P.with(X.setSpan(P.active(),d),async()=>{let f,m;try{m=await i.apply(this,l)}catch(T){f=T}if(e?.responseHook?.(d,f),f&&d.recordException(f),d.end(),f)throw await e?.errorHook?.(d,f),f;return m})};return a?o.call(this,a,c):o.call(this,c)}}}function fye(t,e,n,r,o,s){switch(F2(t,n),s){case"function":e(t,"onRequest",hn(r,o,"http.request")),e(t,"onCall",hn(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",hn(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",hn(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",hn(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",hn(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",hn(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",hn(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",hn(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",hn(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",hn(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",hn(r,o,"storage.object.finalized")),e(t,"onObjectArchived",hn(r,o,"storage.object.archived")),e(t,"onObjectDeleted",hn(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",hn(r,o,"storage.object.metadataUpdated"));break}return t}function F2(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Ko.isWrapped)(t[r])&&e(t,r);return t}var q2={},mye=[">=3.0.0 <5"],Tye=[">=6.0.0 <7"],pS=class extends $2.InstrumentationBase{constructor(e=q2){super("@sentry/instrumentation-firebase",pe,e)}setConfig(e={}){super.setConfig({...q2,...e})}init(){let e=[];return e.push(j2(this.tracer,mye,this._wrap,this._unwrap,this.getConfig())),e.push(V2(this.tracer,Tye,this._wrap,this._unwrap,this.getConfig())),e}};var Y2="Firebase",hye={firestoreSpanCreationHook:t=>{Re(t,"auto.firebase.otel.firestore"),t.setAttribute(ee,"db.query")},functions:{requestHook:t=>{Re(t,"auto.firebase.otel.functions"),t.setAttribute(ee,"http.request")},errorHook:async(t,e)=>{e&&(te(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Vf(2e3))}}},W2=w(Y2,()=>new pS(hye)),Eye=()=>({name:Y2,setupOnce(){W2()}}),z2=Eye;function K2(){return[HF(),T$(),V$(),mK(),OY(),jY(),XY(),cW(),GW(),oz(),Zz(),dK(),MK(),VK(),t2(),u2(),oY(),R2(),fY(),D2(),k2(),N2(),b2(),P2(),v2(),az(),z2()]}b();var dS=K(lI(),1),Q2=K(wI(),1);le();var bb=1e6;function X2(t,e={}){t.getOptions().debug&&JI();let[n,r]=Sye(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function Sye(t,e={}){let n=new Q2.BasicTracerProvider({sampler:new IT(t),resource:(0,dS.defaultResource)().merge((0,dS.resourceFromAttributes)({[Qg]:"node",[Gg]:"sentry",[Xg]:pe})),forceFlushTimeoutMillis:500,spanProcessors:[new yT({timeout:gye(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});X.setGlobalTracerProvider(n),Er.setGlobalPropagator(new RT);let r=new XI;return P.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function gye(t){if(t!=null){if(t>bb)return ft&&g.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${bb}`),bb;if(t<=0||Number.isNaN(t)){ft&&g.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}function J2(){return vT().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(SF(),bF())}function Z2(t){return[...J2(),...Xe(t)?K2():[]]}function Cb(t={}){return Aye(t,Z2)}function Aye(t={},e){Vi(t,"node");let n=aN({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(X2(n,{spanProcessors:t.openTelemetrySpanProcessors}),cN()),n}var Rye="prod",t4="0.1.8",yye=`@tanagram/lore/${t4}`;function jt(){return Rye}function _S(){return t4}function n4(){return yye}Cb({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:jt(),release:_S(),sendDefaultPii:!0});Hf("service_name","lore-cli");import{pathToFileURL as $Ce}from"node:url";var Iye=/\d/,Nye=["-","_","/","."];function Oye(t=""){if(!Iye.test(t))return t!==t.toLowerCase()}function r4(t,e){let n=e??Nye,r=[];if(!t||typeof t!="string")return r;let o="",s,i;for(let a of t){let c=n.includes(a);if(c===!0){r.push(o),o="",s=void 0;continue}let l=Oye(a);if(i===!1){if(s===!1&&l===!0){r.push(o),o=a,s=l;continue}if(s===!0&&l===!1&&o.length>1){let p=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=p+a,s=l;continue}}o+=a,s=l,i=c}return r.push(o),r}function bye(t){return t?t[0].toUpperCase()+t.slice(1):""}function Cye(t){return t?t[0].toLowerCase()+t.slice(1):""}function Pye(t,e){return t?(Array.isArray(t)?t:r4(t)).map(n=>bye(e?.normalize?n.toLowerCase():n)).join(""):""}function wd(t,e){return Cye(Pye(t||"",e))}function fS(t,e){return t?(Array.isArray(t)?t:r4(t)).map(n=>n.toLowerCase()).join(e??"-"):""}function o4(t){return fS(t||"","_")}import{parseArgs as Mye}from"node:util";function SS(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function Pb(t,e=""){let n=[];for(let r of t)for(let[o,s]of r.entries())n[o]=Math.max(n[o]||0,s.length);return t.map(r=>r.map((o,s)=>e+o[s===0?"padStart":"padEnd"](n[s])).join(" ")).join(`
38
- `)}function Wn(t){return typeof t=="function"?t():t}var ha=class extends Error{code;constructor(t,e){super(t),this.name="CLIError",this.code=e}};function xye(t=[],e={}){let n=new Set(e.boolean||[]),r=new Set(e.string||[]),o=e.alias||{},s=e.default||{},i=new Map,a=new Map;for(let[h,S]of Object.entries(o)){let R=S;for(let I of R)i.set(h,I),a.has(I)||a.set(I,[]),a.get(I).push(h),i.set(I,h),a.has(h)||a.set(h,[]),a.get(h).push(I)}let c={};function l(h){if(n.has(h))return"boolean";let S=a.get(h)||[];for(let R of S)if(n.has(R))return"boolean";return"string"}function p(h){if(r.has(h))return!0;let S=a.get(h)||[];for(let R of S)if(r.has(R))return!0;return!1}let d=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(s)]);for(let h of d)c[h]||(c[h]={type:l(h),default:s[h]});for(let[h,S]of i.entries())h.length===1&&c[S]&&!c[S].short&&(c[S].short=h);let _=[],f={};for(let h=0;h<t.length;h++){let S=t[h];if(S==="--"){_.push(...t.slice(h));break}if(S.startsWith("--no-")){let R=S.slice(5);f[R]=!0;continue}_.push(S)}let m;try{m=Mye({args:_,options:Object.keys(c).length>0?c:void 0,allowPositionals:!0,strict:!1})}catch{m={values:{},positionals:_}}let T={_:[]};T._=m.positionals;for(let[h,S]of Object.entries(m.values)){let R=S;l(h)==="boolean"&&typeof S=="string"?R=S!=="false":p(h)&&typeof S=="boolean"&&(R=""),T[h]=R}for(let[h]of Object.entries(f)){T[h]=!1;let S=i.get(h);S&&(T[S]=!1);let R=a.get(h);if(R)for(let I of R)T[I]=!1}for(let[h,S]of i.entries())T[h]!==void 0&&T[S]===void 0&&(T[S]=T[h]),T[S]!==void 0&&T[h]===void 0&&(T[h]=T[S]),T[h]!==T[S]&&s[S]===T[S]&&(T[S]=T[h]);return T}var vye=(()=>{let t=globalThis.process?.env??{};return t.NO_COLOR==="1"||t.TERM==="dumb"||t.TEST||t.CI})(),gS=(t,e=39)=>n=>vye?n:`\x1B[${t}m${n}\x1B[${e}m`,mS=gS(1,22),Ur=gS(36),hS=gS(90),TS=gS(4,24);function Lye(t,e){let n={boolean:[],string:[],alias:{},default:{}},r=a4(e);for(let a of r){if(a.type==="positional")continue;a.type==="string"||a.type==="enum"?n.string.push(a.name):a.type==="boolean"&&n.boolean.push(a.name),a.default!==void 0&&(n.default[a.name]=a.default),a.alias&&(n.alias[a.name]=a.alias);let c=wd(a.name),l=fS(a.name);if(c!==a.name||l!==a.name){let p=SS(n.alias[a.name]||[]);c!==a.name&&!p.includes(c)&&p.push(c),l!==a.name&&!p.includes(l)&&p.push(l),p.length>0&&(n.alias[a.name]=p)}}let o=xye(t,n),[...s]=o._,i=new Proxy(o,{get(a,c){return a[c]??a[wd(c)]??a[fS(c)]}});for(let[,a]of r.entries())if(a.type==="positional"){let c=s.shift();if(c!==void 0)i[a.name]=c;else{if(a.default===void 0&&a.required!==!1)throw new ha(`Missing required positional argument: ${a.name.toUpperCase()}`,"EARG");i[a.name]=a.default}}else if(a.type==="enum"){let c=i[a.name],l=a.options||[];if(c!==void 0&&l.length>0&&!l.includes(c))throw new ha(`Invalid value for argument: ${Ur(`--${a.name}`)} (${Ur(c)}). Expected one of: ${l.map(p=>Ur(p)).join(", ")}.`,"EARG")}else if(a.required&&i[a.name]===void 0)throw new ha(`Missing required argument: --${a.name}`,"EARG");return i}function a4(t){let e=[];for(let[n,r]of Object.entries(t||{}))e.push({...r,name:n,alias:SS(r.alias)});return e}async function Dye(t){return Promise.all(t.map(e=>Wn(e)))}async function ES(t,e){let n=await Wn(t.args||{}),r=Lye(e.rawArgs,n),o={rawArgs:e.rawArgs,args:r,data:e.data,cmd:t},s=await Dye(t.plugins??[]),i,a;try{for(let p of s)await p.setup?.(o);typeof t.setup=="function"&&await t.setup(o);let l=await Wn(t.subCommands);if(l&&Object.keys(l).length>0){let p=Uye(e.rawArgs,n),d=e.rawArgs[p];if(d){let _=await s4(l,d);if(!_)throw new ha(`Unknown command ${Ur(d)}`,"E_UNKNOWN_COMMAND");await ES(_,{rawArgs:e.rawArgs.slice(p+1)})}else{let _=await Wn(t.default);if(_){if(t.run)throw new ha("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let f=await s4(l,_);if(!f)throw new ha(`Default sub command ${Ur(_)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await ES(f,{rawArgs:e.rawArgs})}else if(!t.run)throw new ha("No command specified.","E_NO_COMMAND")}}typeof t.run=="function"&&(i=await t.run(o))}catch(l){a=l}let c=[];if(typeof t.cleanup=="function")try{await t.cleanup(o)}catch(l){c.push(l)}for(let l of[...s].reverse())try{await l.cleanup?.(o)}catch(p){c.push(p)}if(a)throw a;if(c.length===1)throw c[0];if(c.length>1)throw new Error("Multiple cleanup errors",{cause:c});return{result:i}}async function s4(t,e){if(e in t)return Wn(t[e]);for(let n of Object.values(t)){let r=await Wn(n),o=await Wn(r?.meta);if(o?.alias&&SS(o.alias).includes(e))return r}}function Uye(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&wye(r,e)&&n++;continue}return n}return-1}function wye(t,e){let n=t.replace(/^-{1,2}/,""),r=wd(n);for(let[o,s]of Object.entries(e))if(!(s.type!=="string"&&s.type!=="enum")&&(r===wd(o)||(Array.isArray(s.alias)?s.alias:s.alias?[s.alias]:[]).includes(n)))return!0;return!1}var kye=/^no[-A-Z]/;async function c4(t,e){let n=await Wn(t.meta||{}),r=a4(await Wn(t.args||{})),o=await Wn(e?.meta||{}),s=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),i=[],a=[],c=[],l=[];for(let f of r)if(f.type==="positional"){let m=f.name.toUpperCase(),T=f.required!==!1&&f.default===void 0;a.push([Ur(m+Mb(f)),i4(f,T)]),l.push(T?`<${m}>`:`[${m}]`)}else{let m=f.required===!0&&f.default===void 0,T=[...(f.alias||[]).map(h=>`-${h}`),`--${f.name}`].join(", ")+Mb(f);if(i.push([Ur(T),i4(f,m)]),f.type==="boolean"&&(f.default===!0||f.negativeDescription)&&!kye.test(f.name)){let h=[...(f.alias||[]).map(S=>`--no-${S}`),`--no-${f.name}`].join(", ");i.push([Ur(h),[f.negativeDescription,m?hS("(Required)"):""].filter(Boolean).join(" ")])}m&&l.push(`--${f.name}`+Mb(f))}if(t.subCommands){let f=[],m=await Wn(t.subCommands);for(let[T,h]of Object.entries(m)){let S=await Wn((await Wn(h))?.meta);if(S?.hidden)continue;let R=SS(S?.alias),I=[T,...R].join(", ");c.push([Ur(I),S?.description||""]),f.push(T,...R)}l.push(f.join("|"))}let p=[],d=n.version||o.version;p.push(hS(`${n.description} (${s+(d?` v${d}`:"")})`),"");let _=i.length>0||a.length>0;return p.push(`${TS(mS("USAGE"))} ${Ur(`${s}${_?" [OPTIONS]":""} ${l.join(" ")}`)}`,""),a.length>0&&(p.push(TS(mS("ARGUMENTS")),""),p.push(Pb(a," ")),p.push("")),i.length>0&&(p.push(TS(mS("OPTIONS")),""),p.push(Pb(i," ")),p.push("")),c.length>0&&(p.push(TS(mS("COMMANDS")),""),p.push(Pb(c," ")),p.push("",`Use ${Ur(`${s} <command> --help`)} for more information about a command.`)),p.filter(f=>typeof f=="string").join(`
39
- `)}function Mb(t){let e=t.valueHint?`=<${t.valueHint}>`:"",n=e||`=<${o4(t.name)}>`;return!t.type||t.type==="positional"||t.type==="boolean"?e:t.type==="enum"&&t.options?.length?`=<${t.options.join("|")}>`:n}function i4(t,e){let n=e?hS("(Required)"):"",r=t.default===void 0?"":hS(`(Default: ${t.default})`);return[t.description,n,r].filter(Boolean).join(" ")}var u={};US(u,{BRAND:()=>uIe,DIRTY:()=>Ea,EMPTY_PATH:()=>Hye,INVALID:()=>Q,NEVER:()=>WIe,OK:()=>Zt,ParseStatus:()=>Ht,Schema:()=>ce,ZodAny:()=>pi,ZodArray:()=>Zo,ZodBigInt:()=>ga,ZodBoolean:()=>Aa,ZodBranded:()=>Gd,ZodCatch:()=>va,ZodDate:()=>Ra,ZodDefault:()=>xa,ZodDiscriminatedUnion:()=>yS,ZodEffects:()=>hr,ZodEnum:()=>Pa,ZodError:()=>Mn,ZodFirstPartyTypeKind:()=>Z,ZodFunction:()=>NS,ZodIntersection:()=>Oa,ZodIssueCode:()=>O,ZodLazy:()=>ba,ZodLiteral:()=>Ca,ZodMap:()=>ol,ZodNaN:()=>il,ZodNativeEnum:()=>Ma,ZodNever:()=>wr,ZodNull:()=>Ia,ZodNullable:()=>Eo,ZodNumber:()=>Sa,ZodObject:()=>xn,ZodOptional:()=>mr,ZodParsedType:()=>D,ZodPipeline:()=>Bd,ZodPromise:()=>di,ZodReadonly:()=>La,ZodRecord:()=>IS,ZodSchema:()=>ce,ZodSet:()=>sl,ZodString:()=>li,ZodSymbol:()=>nl,ZodTransformer:()=>hr,ZodTuple:()=>ho,ZodType:()=>ce,ZodUndefined:()=>ya,ZodUnion:()=>Na,ZodUnknown:()=>Jo,ZodVoid:()=>rl,addIssueToContext:()=>M,any:()=>EIe,array:()=>RIe,bigint:()=>_Ie,boolean:()=>S4,coerce:()=>YIe,custom:()=>T4,date:()=>fIe,datetimeRegex:()=>f4,defaultErrorMap:()=>Qo,discriminatedUnion:()=>OIe,effect:()=>GIe,enum:()=>UIe,function:()=>vIe,getErrorMap:()=>Zu,getParsedType:()=>To,instanceof:()=>pIe,intersection:()=>bIe,isAborted:()=>AS,isAsync:()=>el,isDirty:()=>RS,isValid:()=>ui,late:()=>lIe,lazy:()=>LIe,literal:()=>DIe,makeIssue:()=>kd,map:()=>MIe,nan:()=>dIe,nativeEnum:()=>wIe,never:()=>gIe,null:()=>hIe,nullable:()=>jIe,number:()=>E4,object:()=>yIe,objectUtil:()=>xb,oboolean:()=>$Ie,onumber:()=>qIe,optional:()=>BIe,ostring:()=>FIe,pipeline:()=>VIe,preprocess:()=>HIe,promise:()=>kIe,quotelessJson:()=>Gye,record:()=>PIe,set:()=>xIe,setErrorMap:()=>jye,strictObject:()=>IIe,string:()=>h4,symbol:()=>mIe,transformer:()=>GIe,tuple:()=>CIe,undefined:()=>TIe,union:()=>NIe,unknown:()=>SIe,util:()=>de,void:()=>AIe});var de;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(de||(de={}));var xb;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(xb||(xb={}));var D=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),To=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}};var O=de.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Gye=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Mn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let l=i.path[c];c===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(i))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,de.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Mn.create=t=>new Mn(t);var Bye=(t,e)=>{let n;switch(t.code){case O.invalid_type:t.received===D.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:n=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case O.invalid_union:n="Invalid input";break;case O.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case O.invalid_enum_value:n=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:n="Invalid function arguments";break;case O.invalid_return_type:n="Invalid function return type";break;case O.invalid_date:n="Invalid date";break;case O.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case O.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case O.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case O.custom:n="Invalid input";break;case O.invalid_intersection_types:n="Intersection results could not be merged";break;case O.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:n="Number must be finite";break;default:n=e.defaultError,de.assertNever(t)}return{message:n}},Qo=Bye;var u4=Qo;function jye(t){u4=t}function Zu(){return u4}var kd=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)a=l(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},Hye=[];function M(t,e){let n=Zu(),r=kd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Qo?void 0:Qo].filter(o=>!!o)});t.common.issues.push(r)}var Ht=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Q;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},Q=Object.freeze({status:"aborted"}),Ea=t=>({status:"dirty",value:t}),Zt=t=>({status:"valid",value:t}),AS=t=>t.status==="aborted",RS=t=>t.status==="dirty",ui=t=>t.status==="valid",el=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(j||(j={}));var Tr=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},l4=(t,e)=>{if(ui(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Mn(t.common.issues);return this._error=n,this._error}}};function ie(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}var ce=class{get description(){return this._def.description}_getType(e){return To(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:To(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ht,ctx:{common:e.parent.common,data:e.data,parsedType:To(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(el(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:To(e)},o=this._parseSync({data:e,path:r.path,parent:r});return l4(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:To(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ui(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ui(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:To(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(el(o)?o:Promise.resolve(o));return l4(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:O.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new hr({schema:this,typeName:Z.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return mr.create(this,this._def)}nullable(){return Eo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zo.create(this)}promise(){return di.create(this,this._def)}or(e){return Na.create([this,e],this._def)}and(e){return Oa.create(this,e,this._def)}transform(e){return new hr({...ie(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new xa({...ie(this._def),innerType:this,defaultValue:n,typeName:Z.ZodDefault})}brand(){return new Gd({typeName:Z.ZodBranded,type:this,...ie(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new va({...ie(this._def),innerType:this,catchValue:n,typeName:Z.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Bd.create(this,e)}readonly(){return La.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vye=/^c[^\s-]{8,}$/i,Fye=/^[0-9a-z]+$/,qye=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$ye=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Yye=/^[a-z0-9_-]{21}$/i,Wye=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zye=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Kye=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qye="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vb,Xye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Zye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eIe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tIe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nIe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,d4="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",rIe=new RegExp(`^${d4}$`);function _4(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function oIe(t){return new RegExp(`^${_4(t)}$`)}function f4(t){let e=`${d4}T${_4(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function sIe(t,e){return!!((e==="v4"||!e)&&Xye.test(t)||(e==="v6"||!e)&&Zye.test(t))}function iIe(t,e){if(!Wye.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function aIe(t,e){return!!((e==="v4"||!e)&&Jye.test(t)||(e==="v6"||!e)&&eIe.test(t))}var li=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_type,expected:D.string,received:s.parsedType}),Q}let r=new Ht,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:O.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:O.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?M(o,{code:O.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&M(o,{code:O.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Kye.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"email",code:O.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")vb||(vb=new RegExp(Qye,"u")),vb.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"emoji",code:O.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")$ye.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"uuid",code:O.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Yye.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"nanoid",code:O.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Vye.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cuid",code:O.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Fye.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cuid2",code:O.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")qye.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"ulid",code:O.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),M(o,{validation:"url",code:O.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"regex",code:O.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),M(o,{code:O.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),M(o,{code:O.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),M(o,{code:O.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?f4(s).test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:O.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?rIe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:O.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?oIe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:O.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?zye.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"duration",code:O.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?sIe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"ip",code:O.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?iIe(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"jwt",code:O.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?aIe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cidr",code:O.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?tIe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"base64",code:O.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?nIe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"base64url",code:O.invalid_string,message:s.message}),r.dirty()):de.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:O.invalid_string,...j.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...j.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...j.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...j.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...j.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...j.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...j.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...j.errToObj(n)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};li.create=t=>new li({checks:[],typeName:Z.ZodString,coerce:t?.coerce??!1,...ie(t)});function cIe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}var Sa=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_type,expected:D.number,received:s.parsedType}),Q}let r,o=new Ht;for(let s of this._def.checks)s.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?cIe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:O.not_finite,message:s.message}),o.dirty()):de.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,j.toString(n))}gt(e,n){return this.setLimit("min",e,!1,j.toString(n))}lte(e,n){return this.setLimit("max",e,!0,j.toString(n))}lt(e,n){return this.setLimit("max",e,!1,j.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:j.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Sa.create=t=>new Sa({checks:[],typeName:Z.ZodNumber,coerce:t?.coerce||!1,...ie(t)});var ga=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let r,o=new Ht;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),M(r,{code:O.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):de.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return M(n,{code:O.invalid_type,expected:D.bigint,received:n.parsedType}),Q}gte(e,n){return this.setLimit("min",e,!0,j.toString(n))}gt(e,n){return this.setLimit("min",e,!1,j.toString(n))}lte(e,n){return this.setLimit("max",e,!0,j.toString(n))}lt(e,n){return this.setLimit("max",e,!1,j.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:j.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ga.create=t=>new ga({checks:[],typeName:Z.ZodBigInt,coerce:t?.coerce??!1,...ie(t)});var Aa=class extends ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let r=this._getOrReturnCtx(e);return M(r,{code:O.invalid_type,expected:D.boolean,received:r.parsedType}),Q}return Zt(e.data)}};Aa.create=t=>new Aa({typeName:Z.ZodBoolean,coerce:t?.coerce||!1,...ie(t)});var Ra=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_type,expected:D.date,received:s.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return M(s,{code:O.invalid_date}),Q}let r=new Ht,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:O.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:O.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):de.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ra.create=t=>new Ra({checks:[],coerce:t?.coerce||!1,typeName:Z.ZodDate,...ie(t)});var nl=class extends ce{_parse(e){if(this._getType(e)!==D.symbol){let r=this._getOrReturnCtx(e);return M(r,{code:O.invalid_type,expected:D.symbol,received:r.parsedType}),Q}return Zt(e.data)}};nl.create=t=>new nl({typeName:Z.ZodSymbol,...ie(t)});var ya=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return M(r,{code:O.invalid_type,expected:D.undefined,received:r.parsedType}),Q}return Zt(e.data)}};ya.create=t=>new ya({typeName:Z.ZodUndefined,...ie(t)});var Ia=class extends ce{_parse(e){if(this._getType(e)!==D.null){let r=this._getOrReturnCtx(e);return M(r,{code:O.invalid_type,expected:D.null,received:r.parsedType}),Q}return Zt(e.data)}};Ia.create=t=>new Ia({typeName:Z.ZodNull,...ie(t)});var pi=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return Zt(e.data)}};pi.create=t=>new pi({typeName:Z.ZodAny,...ie(t)});var Jo=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Zt(e.data)}};Jo.create=t=>new Jo({typeName:Z.ZodUnknown,...ie(t)});var wr=class extends ce{_parse(e){let n=this._getOrReturnCtx(e);return M(n,{code:O.invalid_type,expected:D.never,received:n.parsedType}),Q}};wr.create=t=>new wr({typeName:Z.ZodNever,...ie(t)});var rl=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return M(r,{code:O.invalid_type,expected:D.void,received:r.parsedType}),Q}return Zt(e.data)}};rl.create=t=>new rl({typeName:Z.ZodVoid,...ie(t)});var Zo=class t extends ce{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==D.array)return M(n,{code:O.invalid_type,expected:D.array,received:n.parsedType}),Q;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(M(n,{code:i?O.too_big:O.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(M(n,{code:O.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(M(n,{code:O.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Tr(n,i,n.path,a)))).then(i=>Ht.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Tr(n,i,n.path,a)));return Ht.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:j.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:j.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:j.toString(n)}})}nonempty(e){return this.min(1,e)}};Zo.create=(t,e)=>new Zo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...ie(e)});function tl(t){if(t instanceof xn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=mr.create(tl(r))}return new xn({...t._def,shape:()=>e})}else return t instanceof Zo?new Zo({...t._def,type:tl(t.element)}):t instanceof mr?mr.create(tl(t.unwrap())):t instanceof Eo?Eo.create(tl(t.unwrap())):t instanceof ho?ho.create(t.items.map(e=>tl(e))):t}var xn=class t extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=de.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==D.object){let l=this._getOrReturnCtx(e);return M(l,{code:O.invalid_type,expected:D.object,received:l.parsedType}),Q}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof wr&&this._def.unknownKeys==="strip"))for(let l in o.data)i.includes(l)||a.push(l);let c=[];for(let l of i){let p=s[l],d=o.data[l];c.push({key:{status:"valid",value:l},value:p._parse(new Tr(o,d,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof wr){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(l==="strict")a.length>0&&(M(o,{code:O.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of a){let d=o.data[p];c.push({key:{status:"valid",value:p},value:l._parse(new Tr(o,d,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of c){let d=await p.key,_=await p.value;l.push({key:d,value:_,alwaysSet:p.alwaysSet})}return l}).then(l=>Ht.mergeObjectSync(r,l)):Ht.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:j.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Z.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of de.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of de.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return tl(this)}partial(e){let n={};for(let r of de.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of de.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof mr;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return m4(de.objectKeys(this.shape))}};xn.create=(t,e)=>new xn({shape:()=>t,unknownKeys:"strip",catchall:wr.create(),typeName:Z.ZodObject,...ie(e)});xn.strictCreate=(t,e)=>new xn({shape:()=>t,unknownKeys:"strict",catchall:wr.create(),typeName:Z.ZodObject,...ie(e)});xn.lazycreate=(t,e)=>new xn({shape:t,unknownKeys:"strip",catchall:wr.create(),typeName:Z.ZodObject,...ie(e)});var Na=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Mn(a.ctx.common.issues));return M(n,{code:O.invalid_union,unionErrors:i}),Q}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Mn(c));return M(n,{code:O.invalid_union,unionErrors:a}),Q}}get options(){return this._def.options}};Na.create=(t,e)=>new Na({options:t,typeName:Z.ZodUnion,...ie(e)});var Xo=t=>t instanceof ba?Xo(t.schema):t instanceof hr?Xo(t.innerType()):t instanceof Ca?[t.value]:t instanceof Pa?t.options:t instanceof Ma?de.objectValues(t.enum):t instanceof xa?Xo(t._def.innerType):t instanceof ya?[void 0]:t instanceof Ia?[null]:t instanceof mr?[void 0,...Xo(t.unwrap())]:t instanceof Eo?[null,...Xo(t.unwrap())]:t instanceof Gd||t instanceof La?Xo(t.unwrap()):t instanceof va?Xo(t._def.innerType):[],yS=class t extends ce{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.object)return M(n,{code:O.invalid_type,expected:D.object,received:n.parsedType}),Q;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(M(n,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=Xo(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:Z.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...ie(r)})}};function Lb(t,e){let n=To(t),r=To(e);if(t===e)return{valid:!0,data:t};if(n===D.object&&r===D.object){let o=de.objectKeys(e),s=de.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=Lb(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===D.array&&r===D.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=Lb(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===D.date&&r===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Oa=class extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(AS(s)||AS(i))return Q;let a=Lb(s.value,i.value);return a.valid?((RS(s)||RS(i))&&n.dirty(),{status:n.value,value:a.data}):(M(r,{code:O.invalid_intersection_types}),Q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Oa.create=(t,e,n)=>new Oa({left:t,right:e,typeName:Z.ZodIntersection,...ie(n)});var ho=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.array)return M(r,{code:O.invalid_type,expected:D.array,received:r.parsedType}),Q;if(r.data.length<this._def.items.length)return M(r,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&r.data.length>this._def.items.length&&(M(r,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Tr(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Ht.mergeArray(n,i)):Ht.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ho.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ho({items:t,typeName:Z.ZodTuple,rest:null,...ie(e)})};var IS=class t extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.object)return M(r,{code:O.invalid_type,expected:D.object,received:r.parsedType}),Q;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Tr(r,a,r.path,a)),value:i._parse(new Tr(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Ht.mergeObjectAsync(n,o):Ht.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ce?new t({keyType:e,valueType:n,typeName:Z.ZodRecord,...ie(r)}):new t({keyType:li.create(),valueType:e,typeName:Z.ZodRecord,...ie(n)})}},ol=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.map)return M(r,{code:O.invalid_type,expected:D.map,received:r.parsedType}),Q;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],l)=>({key:o._parse(new Tr(r,a,r.path,[l,"key"])),value:s._parse(new Tr(r,c,r.path,[l,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let l=await c.key,p=await c.value;if(l.status==="aborted"||p.status==="aborted")return Q;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(l.value,p.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let l=c.key,p=c.value;if(l.status==="aborted"||p.status==="aborted")return Q;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(l.value,p.value)}return{status:n.value,value:a}}}};ol.create=(t,e,n)=>new ol({valueType:e,keyType:t,typeName:Z.ZodMap,...ie(n)});var sl=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.set)return M(r,{code:O.invalid_type,expected:D.set,received:r.parsedType}),Q;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(M(r,{code:O.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(M(r,{code:O.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let l=new Set;for(let p of c){if(p.status==="aborted")return Q;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}let a=[...r.data.values()].map((c,l)=>s._parse(new Tr(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:j.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:j.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};sl.create=(t,e)=>new sl({valueType:t,minSize:null,maxSize:null,typeName:Z.ZodSet,...ie(e)});var NS=class t extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.function)return M(n,{code:O.invalid_type,expected:D.function,received:n.parsedType}),Q;function r(a,c){return kd({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zu(),Qo].filter(l=>!!l),issueData:{code:O.invalid_arguments,argumentsError:c}})}function o(a,c){return kd({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zu(),Qo].filter(l=>!!l),issueData:{code:O.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof di){let a=this;return Zt(async function(...c){let l=new Mn([]),p=await a._def.args.parseAsync(c,s).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(i,this,p);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw l.addIssue(o(d,f)),l})})}else{let a=this;return Zt(function(...c){let l=a._def.args.safeParse(c,s);if(!l.success)throw new Mn([r(c,l.error)]);let p=Reflect.apply(i,this,l.data),d=a._def.returns.safeParse(p,s);if(!d.success)throw new Mn([o(p,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ho.create(e).rest(Jo.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||ho.create([]).rest(Jo.create()),returns:n||Jo.create(),typeName:Z.ZodFunction,...ie(r)})}},ba=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ba.create=(t,e)=>new ba({getter:t,typeName:Z.ZodLazy,...ie(e)});var Ca=class extends ce{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return M(n,{received:n.data,code:O.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ca.create=(t,e)=>new Ca({value:t,typeName:Z.ZodLiteral,...ie(e)});function m4(t,e){return new Pa({values:t,typeName:Z.ZodEnum,...ie(e)})}var Pa=class t extends ce{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return M(n,{expected:de.joinValues(r),received:n.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return M(n,{received:n.data,code:O.invalid_enum_value,options:r}),Q}return Zt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Pa.create=m4;var Ma=class extends ce{_parse(e){let n=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==D.string&&r.parsedType!==D.number){let o=de.objectValues(n);return M(r,{expected:de.joinValues(o),received:r.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=de.objectValues(n);return M(r,{received:r.data,code:O.invalid_enum_value,options:o}),Q}return Zt(e.data)}get enum(){return this._def.values}};Ma.create=(t,e)=>new Ma({values:t,typeName:Z.ZodNativeEnum,...ie(e)});var di=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.promise&&n.common.async===!1)return M(n,{code:O.invalid_type,expected:D.promise,received:n.parsedType}),Q;let r=n.parsedType===D.promise?n.data:Promise.resolve(n.data);return Zt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};di.create=(t,e)=>new di({type:t,typeName:Z.ZodPromise,...ie(e)});var hr=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{M(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return Q;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Q:c.status==="dirty"?Ea(c.value):n.value==="dirty"?Ea(c.value):c});{if(n.value==="aborted")return Q;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Q:a.status==="dirty"?Ea(a.value):n.value==="dirty"?Ea(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ui(i))return Q;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ui(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):Q);de.assertNever(o)}};hr.create=(t,e,n)=>new hr({schema:t,typeName:Z.ZodEffects,effect:e,...ie(n)});hr.createWithPreprocess=(t,e,n)=>new hr({schema:e,effect:{type:"preprocess",transform:t},typeName:Z.ZodEffects,...ie(n)});var mr=class extends ce{_parse(e){return this._getType(e)===D.undefined?Zt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mr.create=(t,e)=>new mr({innerType:t,typeName:Z.ZodOptional,...ie(e)});var Eo=class extends ce{_parse(e){return this._getType(e)===D.null?Zt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Eo.create=(t,e)=>new Eo({innerType:t,typeName:Z.ZodNullable,...ie(e)});var xa=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===D.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};xa.create=(t,e)=>new xa({innerType:t,typeName:Z.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ie(e)});var va=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return el(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Mn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Mn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};va.create=(t,e)=>new va({innerType:t,typeName:Z.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ie(e)});var il=class extends ce{_parse(e){if(this._getType(e)!==D.nan){let r=this._getOrReturnCtx(e);return M(r,{code:O.invalid_type,expected:D.nan,received:r.parsedType}),Q}return{status:"valid",value:e.data}}};il.create=t=>new il({typeName:Z.ZodNaN,...ie(t)});var uIe=Symbol("zod_brand"),Gd=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Bd=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Q:s.status==="dirty"?(n.dirty(),Ea(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Q:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:Z.ZodPipeline})}},La=class extends ce{_parse(e){let n=this._def.innerType._parse(e),r=o=>(ui(o)&&(o.value=Object.freeze(o.value)),o);return el(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};La.create=(t,e)=>new La({innerType:t,typeName:Z.ZodReadonly,...ie(e)});function p4(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function T4(t,e={},n){return t?pi.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=p4(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=p4(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):pi.create()}var lIe={object:xn.lazycreate},Z;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Z||(Z={}));var pIe=(t,e={message:`Input not instance of ${t.name}`})=>T4(n=>n instanceof t,e),h4=li.create,E4=Sa.create,dIe=il.create,_Ie=ga.create,S4=Aa.create,fIe=Ra.create,mIe=nl.create,TIe=ya.create,hIe=Ia.create,EIe=pi.create,SIe=Jo.create,gIe=wr.create,AIe=rl.create,RIe=Zo.create,yIe=xn.create,IIe=xn.strictCreate,NIe=Na.create,OIe=yS.create,bIe=Oa.create,CIe=ho.create,PIe=IS.create,MIe=ol.create,xIe=sl.create,vIe=NS.create,LIe=ba.create,DIe=Ca.create,UIe=Pa.create,wIe=Ma.create,kIe=di.create,GIe=hr.create,BIe=mr.create,jIe=Eo.create,HIe=hr.createWithPreprocess,VIe=Bd.create,FIe=()=>h4().optional(),qIe=()=>E4().optional(),$Ie=()=>S4().optional(),YIe={string:t=>li.create({...t,coerce:!0}),number:t=>Sa.create({...t,coerce:!0}),boolean:t=>Aa.create({...t,coerce:!0}),bigint:t=>ga.create({...t,coerce:!0}),date:t=>Ra.create({...t,coerce:!0})};var WIe=Q;var zIe=t=>typeof t?.safeParse=="function";var Db=t=>typeof t?.passthrough=="function";var KIe=(t,e)=>Db(t)?Db(e)?t.merge(e):t:Db(e)?e:Object.assign({},t,e);var X9e=u.object({name:u.literal("ZodError"),issues:u.array(u.object({path:u.array(u.union([u.string(),u.number()])),message:u.string().optional(),code:u.nativeEnum(u.ZodIssueCode)}).catchall(u.any()))}),QIe=Symbol("ContractNoBody"),A4=t=>"method"in t&&"path"in t;var R4=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>{var o,s,i;return A4(r)?[n,{...r,path:e?.pathPrefix?e.pathPrefix+r.path:r.path,headers:KIe(e?.baseHeaders,r.headers),strictStatusCodes:(o=r.strictStatusCodes)!==null&&o!==void 0?o:e?.strictStatusCodes,validateResponseOnClient:(s=r.validateResponseOnClient)!==null&&s!==void 0?s:e?.validateResponseOnClient,responses:{...e?.commonResponses,...r.responses},metadata:e?.metadata?{...e?.metadata,...(i=r.metadata)!==null&&i!==void 0?i:{}}:r.metadata}]:[n,R4(r,e)]})),Ub=Symbol("ContractPlainType"),So=()=>({router:(t,e)=>R4(t,e),query:t=>t,mutation:t=>t,responses:t=>t,response:()=>Ub,body:()=>Ub,type:()=>Ub,otherResponse:({contentType:t,body:e})=>({contentType:t,body:e}),noBody:()=>QIe}),XIe=({path:t,params:e})=>{let n=e;return t.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},JIe=(t,e=!1)=>{let n=e?ZIe(t):eNe(t);return n?.length>0?"?"+n:""},ZIe=t=>t?Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>{let r;return typeof n=="string"&&!["true","false","null"].includes(n.trim())&&isNaN(Number(n))?r=n:r=JSON.stringify(n),`${encodeURIComponent(e)}=${encodeURIComponent(r)}`}).join("&"):"",eNe=t=>t?Object.keys(t).flatMap(e=>wb(e,t[e])).map(([e,n])=>`${encodeURIComponent(e)}=${encodeURIComponent(n)}`).join("&"):"",wb=(t,e)=>Array.isArray(e)?e.flatMap((n,r)=>wb(`${t}[${r}]`,n)):e instanceof Date?[[`${t}`,e.toISOString()]]:e===null?[[`${t}`,""]]:e===void 0?[]:typeof e=="object"?Object.keys(e).flatMap(n=>wb(`${t}[${n}]`,e[n])):[[`${t}`,`${e}`]];var kb=class extends Error{constructor(e,n){let r=n.join(",");super(`Server returned unexpected response. Expected one of: ${r} got: ${e.status}`),this.response=e}};var tNe=async({route:t,path:e,method:n,headers:r,body:o,validateResponse:s,fetchOptions:i})=>{let a=await fetch(e,{...i,method:n,headers:r,body:o}),c=a.headers.get("content-type");if(c?.includes("application/")&&c?.includes("json")){let l={status:a.status,body:await a.json(),headers:a.headers},p=t.responses[l.status];return(s??t.validateResponseOnClient)&&zIe(p)?{...l,body:p.parse(l.body)}:l}return c?.includes("text/")?{status:a.status,body:await a.text(),headers:a.headers}:{status:a.status,body:await a.blob(),headers:a.headers}},nNe=t=>{let e=new FormData,n=(r,o)=>{o instanceof File?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t).forEach(([r,o])=>{if(Array.isArray(o))for(let s of o)n(r,s);else n(r,o)}),e},g4=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLowerCase(),n])),rNe=t=>{let{path:e,clientArgs:n,route:r,body:o,query:s,extraInputArgs:i,headers:a,fetchOptions:c}=t,l=n.api||tNe,p=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([f,m])=>typeof m=="function"?[f,m(t)]:[f,m])),d={...p&&g4(p),...g4(a)};Object.keys(d).forEach(f=>{d[f]===void 0&&delete d[f]});let _={route:r,path:e,method:r.method,headers:d,body:void 0,rawBody:o,rawQuery:s,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...c},...c?.signal&&{signal:c.signal},...c?.cache&&{cache:c.cache},...c&&"next"in c&&!!c?.next&&{next:c.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?_={..._,contentType:"multipart/form-data",body:o instanceof FormData?o:nNe(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?_={..._,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",..._.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(_={..._,contentType:"application/json",headers:{"content-type":"application/json",..._.headers},body:JSON.stringify(o)})),l({..._,...i})},oNe=(t,e,n)=>{let{query:r,params:o,body:s,headers:i,extraHeaders:a,overrideClientOptions:c,fetchOptions:l,cache:p,next:d,..._}=n||{},f={...e,...c};return{path:sNe(r,f.baseUrl,o,t,!!f.jsonQuery),clientArgs:f,route:t,body:s,query:r,extraInputArgs:_,fetchOptions:{...p&&{cache:p},...d&&{next:d},...l},headers:{...a,...i}}},sNe=(t,e,n,r,o)=>{let s=XIe({path:r.path,params:n}),i=JIe(t,o);return`${e}${s}${i}`},iNe=(t,e)=>{let n=Object.keys(t.responses);return async r=>{let o=oNe(t,e,r),s=await rNe(o);if(!e.throwOnUnknownStatus||n.includes(s.status.toString()))return s;throw new kb(s,n)}},Gb=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>A4(r)?[n,iNe(r,e)]:[n,Gb(r,e)]));var Bb=["free","creator","team"],y4=typeof process<"u"&&process.env?.NODE_ENV!=="production",aNe={stripe:{plans:[{tier:"free",subjectType:"user",name:"Free",description:"Upload threads, share read-only links, and collaborate with your workspace. Shared links expire after 3 days.",price:0,priceId:null,features:[{name:"Thread uploads + public links"},{name:"Workspace membership"},{name:"Shared links live 3 days"}],entitlements:{skills:!1,workspaceScope:!1,review:!1,sharedThreadTtlDays:3}},{tier:"creator",subjectType:"user",name:"Creator",description:"For builders who share a lot. Permanent links and the Skills tab.",price:29,isFeatured:!0,priceId:y4?"price_1TP9BSKwvRM43sh64waIrvjj":"price_1TPA2gKwvRM43sh6Kp4ZCpJZ",features:[{name:"Everything in Free"},{name:"Shared threads live forever"},{name:"Skills tab \u2014 tool usage across every thread"}],entitlements:{skills:!0,workspaceScope:!1,review:!1,sharedThreadTtlDays:null}},{tier:"team",subjectType:"organization",name:"Team",description:"GitHub for Prompts. Org-wide thread sharing plus the review surface.",price:19,minSeats:2,priceId:y4?"price_1TP9MpKwvRM43sh6TBIFxVCd":"price_1TPA3CKwvRM43sh6k0bgPTsQ",features:[{name:"Everything in Creator"},{name:"Workspace-wide thread sharing"},{name:"Minimum 2 seats"},{name:"Review feature (beta)"}],entitlements:{skills:!0,workspaceScope:!0,review:!0,sharedThreadTtlDays:null}}]}};var I4=aNe.stripe.plans,Z9e=Object.freeze(Object.fromEntries(I4.map(t=>[t.tier,t])));var cNe=So(),en=u.object({message:u.string()}),jb=u.record(u.unknown()),Da=u.string().regex(/^doc_[0-9A-Za-z]{22}$/),OS=u.string().regex(/^proj_[0-9A-Za-z]{22}$/),uNe=["active","archived"],bS=u.enum(uNe),N4=u.object({id:u.string().min(1),display_name:u.string().min(1)}),O4=u.object({id:OS,name:u.string().min(1)}),Hb=u.object({id:Da,title:u.string().min(1),status:bS,author:N4,project:O4.nullable(),created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable()}),lNe=u.object({type:u.literal("list"),list_type:u.literal("doc"),objects:u.array(Hb)}),pNe=u.object({project_id:OS.optional(),status:bS.optional()}),dNe=u.object({title:u.string().trim().min(1).max(300).optional(),prosemirror_json:jb.optional(),project_id:OS.nullable().optional()}),_Ne=u.object({id:Da,created_at:u.string().datetime()}),fNe=u.object({title:u.string().trim().min(1).max(300).optional(),prosemirror_json:jb.optional(),project_id:OS.nullable().optional(),status:bS.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),mNe=u.object({id:Da,updated_at:u.string().datetime()}),TNe=u.object({id:Da,title:u.string().min(1),prosemirror_json:jb,status:bS,author:N4,project:O4.nullable(),created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable()}),b4=cNe.router({listDocs:{method:"GET",path:"/docs",headers:u.object({authorization:u.string().min(1).optional()}),query:pNe,responses:{200:lNe,401:en,403:en},summary:"List docs in the authenticated user\u2019s organization. Optional project_id filter scopes to a single project."},createDoc:{method:"POST",path:"/docs",headers:u.object({authorization:u.string().min(1).optional()}),body:dNe,responses:{201:_Ne,401:en,403:en,404:en,422:en},summary:"Create a doc. If project_id is provided, the doc is scoped to that project; otherwise it lives at the workspace level."},getDoc:{method:"GET",path:"/docs/:docId",pathParams:u.object({docId:Da}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:TNe,401:en,403:en,404:en},summary:"Get a doc by id with its rich-text body and parent project (if any)"},updateDoc:{method:"PATCH",path:"/docs/:docId",pathParams:u.object({docId:Da}),headers:u.object({authorization:u.string().min(1).optional()}),body:fNe,responses:{200:mNe,401:en,403:en,404:en,422:en},summary:"Update a doc. If prosemirror_json changes, the server re-syncs lore.mention_references from mention nodes."},deleteDoc:{method:"DELETE",path:"/docs/:docId",pathParams:u.object({docId:Da}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.object({}),401:en,403:en,404:en},summary:"Hard-delete a doc and any mention references it owns"}});var hNe=So(),et=u.object({message:u.string()}),Vb=u.record(u.unknown()),go=u.string().regex(/^proj_[0-9A-Za-z]{22}$/),ENe=["active","archived"],CS=u.enum(ENe),Fb=u.object({id:u.string().min(1),display_name:u.string().min(1)}),C4=u.object({thread_id:u.string().min(1),title:u.string().min(1),added_at:u.string().datetime(),added_by:Fb}),SNe=u.object({id:go,name:u.string().min(1),status:CS,author:Fb,thread_count:u.number().int().nonnegative(),doc_count:u.number().int().nonnegative(),created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable()}),gNe=u.object({type:u.literal("list"),list_type:u.literal("project"),objects:u.array(SNe)}),ANe=u.object({status:CS.optional()}),RNe=u.object({name:u.string().trim().min(1).max(200),prosemirror_json:Vb.optional()}),yNe=u.object({id:go,created_at:u.string().datetime()}),INe=u.object({name:u.string().trim().min(1).max(200).optional(),prosemirror_json:Vb.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),NNe=u.object({id:go,updated_at:u.string().datetime()}),ONe=u.object({archived:u.boolean()}),bNe=u.object({id:go,status:CS,archived_at:u.string().datetime().nullable()}),CNe=u.object({id:go,name:u.string().min(1),prosemirror_json:Vb,status:CS,author:Fb,created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable(),threads:u.array(C4),docs:u.array(Hb)}),PNe=u.object({thread_id:u.string().min(1).max(64)}),MNe=C4,P4=hNe.router({listProjects:{method:"GET",path:"/projects",headers:u.object({authorization:u.string().min(1).optional()}),query:ANe,responses:{200:gNe,401:et},summary:"List projects in the authenticated user\u2019s organization"},createProject:{method:"POST",path:"/projects",headers:u.object({authorization:u.string().min(1).optional()}),body:RNe,responses:{201:yNe,401:et,422:et},summary:"Create a new project in the authenticated user\u2019s organization"},getProject:{method:"GET",path:"/projects/:projectId",pathParams:u.object({projectId:go}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:CNe,401:et,403:et,404:et},summary:"Get a project with its attached threads and child docs. The project description is the canonical mention source for project-scoped @-mentions."},updateProject:{method:"PATCH",path:"/projects/:projectId",pathParams:u.object({projectId:go}),headers:u.object({authorization:u.string().min(1).optional()}),body:INe,responses:{200:NNe,401:et,403:et,404:et,422:et},summary:"Update a project\u2019s name or rich-text body. Body changes re-sync mention_references for source_kind=project."},archiveProject:{method:"POST",path:"/projects/:projectId/archive",pathParams:u.object({projectId:go}),headers:u.object({authorization:u.string().min(1).optional()}),body:ONe,responses:{200:bNe,401:et,403:et,404:et},summary:"Archive (soft-delete) or unarchive a project"},addProjectThread:{method:"POST",path:"/projects/:projectId/threads",pathParams:u.object({projectId:go}),headers:u.object({authorization:u.string().min(1).optional()}),body:PNe,responses:{201:MNe,401:et,403:et,404:et,409:et,422:et},summary:"Pin an existing visible thread to this project. Idempotent \u2014 re-adding returns the existing membership."},removeProjectThread:{method:"DELETE",path:"/projects/:projectId/threads/:threadId",pathParams:u.object({projectId:go,threadId:u.string().min(1).max(64)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.object({}),401:et,403:et,404:et},summary:"Remove a thread membership from a project"}});var xNe=So(),PS=u.object({message:u.string()}),vNe=["thread","plan","doc","user"],MS=u.enum(vNe),LNe=["doc","project"],DNe=u.enum(LNe),UNe=u.object({kind:MS,id:u.string().min(1),title:u.string().min(1),href:u.string().min(1)}),wNe=u.object({type:u.literal("list"),list_type:u.literal("mention"),objects:u.array(UNe)}),kNe=u.object({q:u.string().trim().min(1).max(50),kinds:u.string().optional().transform(t=>{if(!t)return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}).pipe(u.array(MS).optional())}),GNe=u.object({source_kind:DNe,source_id:u.string().min(1),source_title:u.string().min(1),source_href:u.string().min(1),target_kind:MS,target_id:u.string().min(1),created_at:u.string().datetime()}),BNe=u.object({type:u.literal("list"),list_type:u.literal("backlink"),objects:u.array(GNe)}),jNe=u.object({target_kind:MS,target_id:u.string().min(1).max(64)}),M4=xNe.router({searchMentions:{method:"GET",path:"/mentions/search",headers:u.object({authorization:u.string().min(1).optional()}),query:kNe,responses:{200:wNe,401:PS,422:PS},summary:"Search threads, plans, files, and users by title/name for @-mention typeahead. Org-scoped, max 10 results across all kinds."},listBacklinks:{method:"GET",path:"/mentions/backlinks",headers:u.object({authorization:u.string().min(1).optional()}),query:jNe,responses:{200:BNe,401:PS,403:PS},summary:"List every doc/project body in the caller\u2019s organization that mentions the given target. Newest-first."}});var HNe=So(),VNe=u.object({type:u.literal("list"),list_type:u.literal("thread"),has_more:u.boolean(),objects:u.array(u.unknown())}),_i=u.object({message:u.string()}),x4=u.object({thread_id:u.string().min(1),is_favorited:u.boolean(),favorited_at:u.string().datetime().nullable()}),FNe=u.object({before:u.string().min(1).max(64).optional()}),v4=HNe.router({addThreadFavorite:{method:"POST",path:"/threads/:id/favorite",pathParams:u.object({id:u.string().min(1).max(64)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{201:x4,401:_i,403:_i,404:_i},summary:"Bookmark a thread for the authenticated user. Idempotent \u2014 re-favoriting returns the existing membership."},removeThreadFavorite:{method:"DELETE",path:"/threads/:id/favorite",pathParams:u.object({id:u.string().min(1).max(64)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:x4,401:_i,403:_i,404:_i},summary:"Remove a thread bookmark for the authenticated user (no-op if absent)."},listFavoriteThreads:{method:"GET",path:"/favorites/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:FNe,responses:{200:VNe,401:_i,403:_i},summary:"List threads the authenticated user has favorited, newest favorited first. Visibility filtering still applies \u2014 a thread the viewer can no longer see (e.g. visibility downgraded) is omitted from the list."}});var qNe=So(),$Ne=u.object({id:u.string().uuid(),role:u.enum(["user","assistant"]),content:u.string().min(1),timestamp:u.string().datetime()}),YNe=u.object({id:u.string().uuid(),title:u.string().min(1),author:u.string().min(1),authorAvatar:u.string().min(1).max(4),model:u.string().min(1),turnCount:u.number().int().nonnegative(),createdAt:u.string().datetime(),preview:u.string()}),vQe=YNe.extend({messages:u.array($Ne)}),A=u.object({message:u.string()}),WNe=/^[a-zA-Z0-9_-]{2,32}$/,j4=u.string().regex(WNe,"Handle must be 2\u201332 characters: letters, numbers, dashes, or underscores."),qb=u.object({id:u.string(),first_name:u.string().min(1),last_name:u.string().min(1),display_name:u.string().min(1),stytch_id:u.string().nullable(),handle:u.string().nullable(),bio:u.string().max(280).nullable(),avatar_url:u.string().nullable(),banner_url:u.string().nullable(),share_new_threads_to_workspace:u.boolean(),experimental_features_enabled:u.boolean(),onboarded_at:u.string().nullable()}),zNe=u.object({stytchMemberId:u.string().min(1).optional(),emailAddress:u.string().email(),name:u.string().nullable(),user:qb,is_admin:u.boolean()}),KNe=u.object({share_new_threads_to_workspace:u.boolean().optional(),experimental_features_enabled:u.boolean().optional(),onboarded_at:u.union([u.literal("now"),u.null()]).optional(),display_name:u.string().min(1).max(120).optional(),handle:j4.optional(),bio:u.string().max(280).nullable().optional(),avatar_storage_url:u.string().min(1).nullable().optional(),banner_storage_url:u.string().min(1).nullable().optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),QNe=u.object({id:u.string(),display_name:u.string(),handle:u.string().nullable(),avatar_url:u.string().nullable(),visible_thread_count:u.number().int().nonnegative(),last_active_at:u.string().datetime().nullable()}),H4=u.object({id:u.string().min(1),display_name:u.string().min(1),handle:u.string().nullable(),bio:u.string().max(280).nullable(),avatar_url:u.string().nullable(),banner_url:u.string().nullable(),organization_name:u.string().min(1).nullable(),created_at:u.string().min(1),visible_thread_count:u.number().int().nonnegative(),follower_count:u.number().int().nonnegative(),following_count:u.number().int().nonnegative(),published_project_count:u.number().int().nonnegative(),is_following:u.boolean(),is_self:u.boolean()}),XNe=u.object({type:u.literal("list"),list_type:u.literal("organization_member"),objects:u.array(QNe)}),JNe=u.object({email_address:u.string().email()}),ZNe=u.object({email_address:u.string().email(),member_id:u.string().min(1)}),eOe=u.object({location:u.string().trim().min(1),contact:u.string().trim().email()}),tOe=u.object({location:u.string().min(1),contact:u.string().email(),created_at:u.string().datetime()}),nOe=u.object({first_name:u.string().min(1),last_name:u.string().min(1),display_name:u.string().min(1),stytch_id:u.string().min(1).optional()}),rOe=u.object({name:u.string().min(1),email_domains:u.array(u.string().min(1)).nonempty(),stytch_org_id:u.string().min(1)}),oOe=u.object({user:nOe,organization:rOe}),sOe=u.object({path_glob:u.string().min(1),name:u.string().min(1),description:u.string().min(1)}),iOe=u.object({repo_origin_path:u.string().min(1),building_blocks:u.array(sOe)}),V4=u.string().regex(/^th_[0-9A-Za-z]{22}$/),vS=u.string().regex(/^tb_[0-9A-Za-z]{22}$/),aOe=u.object({id:V4,author:u.object({id:u.string().min(1),display_name:u.string().min(1)}),body:u.string(),created_at:u.string().datetime(),repo_origin_path:u.string().min(1),latest_revision_id:vS,revision_count:u.number().int().positive()}),cOe=u.object({id:u.string().min(1),display_name:u.string().min(1)}),uOe=u.object({id:u.string().min(1),author_id:u.string().min(1).nullable(),author:cOe.nullable(),created_at:u.string().datetime(),deleted_at:u.string().datetime().nullable(),content:u.string().min(1)}),lOe=u.object({id:u.string().min(1),thread_block_id:u.string().min(1),created_at:u.string().datetime(),resolved_at:u.string().datetime().nullable(),comments:u.array(uOe)}),pOe=u.object({thread_block_id:vS,from_position:u.number().int().positive(),to_position:u.number().int().positive(),selected_text:u.string().min(1),content:u.string().trim().min(1)}),dOe=u.object({id:u.string().min(1)}),_Oe=u.object({content:u.string().trim().min(1)}),fOe=u.object({id:u.string().min(1)}),mOe=u.object({content:u.string().trim().min(1)}),TOe=u.object({id:u.string().min(1)}),hOe=u.object({content:u.string().trim().min(1)}),EOe=u.object({id:u.string().min(1)}),SOe=u.object({resolved:u.boolean()}),gOe=u.object({id:u.string().min(1),resolved_at:u.string().datetime().nullable()}),AOe=u.object({resolved:u.boolean()}),ROe=u.object({id:u.string().min(1),resolved_at:u.string().datetime().nullable()}),F4=u.record(u.unknown()),yOe=u.object({id:vS,body:u.string(),created_at:u.string().datetime(),prosemirror_json:F4,comment_threads:u.array(lOe)}),IOe=u.object({id:V4,created_at:u.string().datetime(),repo_origin_path:u.string().min(1),author:u.object({id:u.string().min(1),display_name:u.string().min(1)}),latest_revision_id:vS,revision_count:u.number().int().positive(),revisions:u.array(yOe)}),NOe=u.object({type:u.literal("list"),list_type:u.literal("plan"),has_more:u.boolean(),objects:u.array(aOe)}),OOe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional(),author_id:u.string().min(1).optional(),repo_origin_path:u.string().min(1).optional()}),q4=u.object({id:u.string().min(1),organization_id:u.string().min(1),created_at:u.string().min(1),repo_origin_path:u.string().min(1),path_glob:u.string().min(1),name:u.string().min(1),description:u.string().min(1)}),bOe=u.array(q4),COe=u.object({type:u.literal("list"),list_type:u.literal("building_block"),has_more:u.boolean(),objects:u.array(q4)}),POe=u.object({repo_origin_path:u.string().min(1),before:u.string().min(1).optional(),after:u.string().min(1).optional()}),MOe=u.enum(["thread","building_block"]),xOe=u.object({repo_origin_path:u.string().min(1),sources:u.array(MOe).nonempty()}),vOe=u.object({type:u.literal("list"),list_type:u.literal("repository"),has_more:u.boolean(),objects:u.array(xOe)}),fi=u.enum(["claudeCode","codex","amp","cursor","unspecified"]),LOe=["transcript","plan"],DOe=u.enum(LOe),UOe=u.object({md5:u.string().min(1),harness:fi,filename:u.string().min(1).optional(),repo_origin_path:u.string().min(1).optional(),harness_internal_id:u.string().min(1).optional(),file_type:DOe.optional()}).refine(t=>(t.filename?.trim().length??0)>0||(t.harness_internal_id?.trim().length??0)>0,{path:["harness_internal_id"],message:"filename or harness_internal_id is required"}),Yb=u.object({id:u.string().min(1),display_name:u.string().min(1)}),wOe=u.object({id:u.string().min(1),display_name:u.string().min(1)}),$4=u.object({id:u.string().min(1),author_id:u.string().min(1).nullable(),author:wOe.nullable(),created_at:u.string().datetime(),deleted_at:u.string().datetime().nullable(),content:u.string().min(1)}),Y4=u.object({id:u.string().min(1),thread_block_id:u.string().min(1),created_at:u.string().datetime(),resolved_at:u.string().datetime().nullable()}),kOe=Y4.extend({comments:u.array($4)}),jd=u.object({id:u.string().min(1),type:u.string().min(1),index_in_thread:u.number().int().nonnegative(),isCritiqued:u.boolean(),comment_threads:u.array(kOe).optional()}).passthrough(),W4=u.object({type:u.literal("list"),list_type:u.literal("thread_block"),has_more:u.boolean(),objects:u.array(jd)}),L4=jd.extend({type:u.literal("plan"),prosemirror_json:F4,thread_file_id:u.string().min(1)}),GOe=u.union([u.literal(-1),u.literal(1)]),z4=u.union([u.literal(-1),u.literal(0),u.literal(1)]),D4=u.object({score:u.number().int(),up_count:u.number().int().nonnegative(),down_count:u.number().int().nonnegative(),viewer_vote:z4}),BOe=u.object({value:GOe}),jOe=u.object({id:u.string().min(1),display_name:u.string().min(1),avatar_url:u.string().nullable()}),Ua=u.object({id:u.string().min(1),thread_id:u.string().min(1),author_id:u.string().min(1).nullable(),author:jOe.nullable(),parent_comment_id:u.string().min(1).nullable(),content:u.string(),created_at:u.string().datetime(),updated_at:u.string().datetime(),deleted_at:u.string().datetime().nullable()}),HOe=u.object({type:u.literal("list"),list_type:u.literal("thread_comment"),objects:u.array(Ua)}),VOe=u.object({content:u.string().trim().min(1).max(4e3),parent_comment_id:u.string().min(1).optional()}),FOe=Ua,qOe=u.object({content:u.string().trim().min(1).max(4e3)}),$Oe=Ua,YOe=Ua,LQe=u.discriminatedUnion("kind",[u.object({kind:u.literal("created"),thread_id:u.string().min(1),actor_user_id:u.string().min(1),version:u.number(),comment:Ua}),u.object({kind:u.literal("updated"),thread_id:u.string().min(1),actor_user_id:u.string().min(1),version:u.number(),comment:Ua}),u.object({kind:u.literal("deleted"),thread_id:u.string().min(1),actor_user_id:u.string().min(1),version:u.number(),comment:Ua})]),WOe=u.enum(["pending","generating","ready","failed"]),zOe=u.enum(["pending","generating","ready","failed"]),KOe=u.enum(["pending","placeholder","ai","user"]),K4=u.enum(["pending","generating","ready","failed"]),QOe=u.enum(["asked","requested","decided","corrected","shared"]),XOe=u.object({id:u.string().min(1),kind:QOe,summary:u.string().min(1),block_id:u.string().min(1)}),JOe=u.object({type:u.literal("list"),list_type:u.literal("thread_decision"),status:K4,generated_at:u.string().nullable(),objects:u.array(XOe)}),al=u.object({id:u.string().min(1),thread_file_id:u.string().min(1),organization_id:u.string().min(1),author:Yb,repo:u.string().min(1),title:u.string().min(1),started_at:u.string().min(1),blocks:W4,user_message_count:u.number().int().nonnegative(),files_touched:u.array(u.string()),skills_invoked:u.array(u.string()),harness:fi,transcript_parsing_state:u.enum(["pending","parsed","too_large_to_parse"]),visibility:u.enum(["private","workspace","public"]),has_plan:u.boolean().optional(),summary:u.string().nullable(),summary_status:WOe,summary_generated_at:u.string().nullable(),title_status:zOe,title_generated_at:u.string().nullable(),title_source:KOe,decisions_status:K4,decisions_generated_at:u.string().nullable(),score:u.number().int(),up_count:u.number().int().nonnegative(),down_count:u.number().int().nonnegative(),viewer_vote:z4,comment_count:u.number().int().nonnegative(),is_favorited:u.boolean()}),ZOe=u.object({storage_url:u.string().min(1)}),ebe=u.object({storage_url:u.string(),harness:fi,thread:al.nullable()}),tbe=u.object({status:u.literal("complete"),thread_files:u.array(ebe)}),nbe=u.object({id:u.string(),presigned_url:u.string().nullable(),presigned_url_expires_at:u.string().nullable(),storage_url:u.string(),harness:fi,expected_md5:u.string(),error:u.string().nullable(),thread:al.nullable()}),rbe=u.object({id:u.string(),substrate:u.enum(["s3","filesystem"]),status:u.enum(["incomplete","locked_for_parsing","complete","error"]),thread_files:u.array(nbe)}),obe=u.object({visibility:u.enum(["private","workspace","public"]).optional(),title:u.string().trim().min(1).max(200).optional()}).refine(t=>t.visibility!==void 0||t.title!==void 0,{message:"At least one of visibility or title must be provided"}),sbe=u.discriminatedUnion("visibility",[u.object({visibility:u.literal("private")}),u.object({visibility:u.literal("workspace")}),u.object({visibility:u.literal("public"),title:u.string().min(1),author_display_name:u.string().min(1),first_user_message:u.string().nullable(),summary:u.string().nullable(),started_at:u.string().min(1),harness:fi})]),ibe=al,U4=u.object({type:u.literal("list"),list_type:u.literal("thread"),has_more:u.boolean(),objects:u.array(ibe)}),abe=u.enum(["recent","popular"]),cbe=al,ube=u.object({type:u.literal("list"),list_type:u.literal("discover_thread"),has_more:u.boolean(),objects:u.array(cbe)}),lbe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional(),sort:abe.optional(),harness:fi.optional(),search:u.string().max(200).optional()}),pbe=u.object({thread_count:u.number().int().nonnegative(),author_count:u.number().int().nonnegative(),organization_count:u.number().int().nonnegative(),harness_breakdown:u.record(fi,u.number().int().nonnegative())}),dbe=u.object({id:u.string(),status:u.enum(["incomplete","locked_for_parsing","complete","error"]),created_at:u.string(),thread_count:u.number().int().nonnegative()}),_be=u.object({type:u.literal("list"),list_type:u.literal("upload_session"),objects:u.array(dbe)}),fbe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional()}),mbe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional(),author_ids:u.string().min(1).optional(),created_at:u.string().min(1).optional(),filepath_prefixes:u.string().min(1).optional()}),Tbe=u.object({path:u.string().min(1),start_offset:u.number().int().nonnegative(),end_offset:u.number().int().positive()}),hbe=u.object({name:u.string(),usage_count:u.number().int().nonnegative(),author_count:u.number().int().nonnegative(),first_used_at:u.string().nullable(),last_used_at:u.string().nullable(),usage_count_last_24h:u.number().int().nonnegative(),usage_count_last_7d:u.number().int().nonnegative()}),Ebe=u.object({type:u.literal("list"),list_type:u.literal("skill"),objects:u.array(hbe)}),Sbe=u.object({id:u.string(),title:u.string(),visibility:u.enum(["private","workspace","public"]),started_at:u.string(),author:Yb,skills_invoked:u.array(u.string())}),gbe=u.object({name:u.string(),usage_count:u.number().int().nonnegative(),author_count:u.number().int().nonnegative(),first_used_at:u.string().nullable(),last_used_at:u.string().nullable(),threads:u.array(Sbe)}),Abe=u.object({path:u.string().min(1),text:u.string().max(64e3)}),Rbe=u.enum(["text_edit","redact","delete_block"]),ybe=u.object({id:u.string(),thread_block_id:u.string(),editor:u.object({id:u.string(),display_name:u.string()}),kind:Rbe,path:u.string().nullable(),previous_text:u.string().nullable(),new_text:u.string().nullable(),created_at:u.string()}),Ibe=u.object({type:u.literal("list"),list_type:u.literal("thread_block_edit"),objects:u.array(ybe)}),Nbe=u.object({organization_count:u.number().int().nonnegative(),user_count:u.number().int().nonnegative(),thread_count:u.number().int().nonnegative(),thread_count_last_24h:u.number().int().nonnegative(),user_count_last_24h:u.number().int().nonnegative()}),Obe=u.object({id:u.string(),name:u.string(),email_domains:u.array(u.string()),stytch_org_id:u.string(),member_count:u.number().int().nonnegative(),thread_count:u.number().int().nonnegative(),default_thread_visibility:u.enum(["private","workspace","public"]),created_at:u.string()}),bbe=u.object({type:u.literal("list"),list_type:u.literal("admin_organization"),objects:u.array(Obe)}),Q4=u.object({id:u.string(),name:u.string()}),Cbe=u.object({id:u.string(),display_name:u.string(),stytch_id:u.string().nullable(),thread_count:u.number().int().nonnegative(),onboarded_at:u.string().nullable(),created_at:u.string(),organizations:u.array(Q4)}),Pbe=u.object({type:u.literal("list"),list_type:u.literal("admin_user"),objects:u.array(Cbe)}),Mbe=u.object({id:u.string(),title:u.string(),started_at:u.string(),created_at:u.string(),deleted_at:u.string().nullable(),visibility:u.enum(["private","workspace","public"]),harness:fi,author:Yb,organization:Q4}),xbe=u.object({type:u.literal("list"),list_type:u.literal("admin_thread"),has_more:u.boolean(),objects:u.array(Mbe)}),vbe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional()}),w4=u.object({token:u.string().min(1),thread_id:u.string().min(1)}),Lbe=u.object({visitor:u.string().min(1).max(64).optional()}),Dbe=u.object({user_id:u.string(),display_name:u.string(),shares_sent:u.number().int().nonnegative(),unique_viewers:u.number().int().nonnegative(),attributed_signups:u.number().int().nonnegative()}),Ube=u.object({window_days:u.number().int().positive(),shares_sent:u.number().int().nonnegative(),unique_viewers:u.number().int().nonnegative(),attributed_signups:u.number().int().nonnegative(),active_sharers:u.number().int().nonnegative(),k_factor:u.number().nullable(),shares_sent_sparkline:u.array(u.number().int().nonnegative()),top_sharers:u.array(Dbe)}),wbe=u.object({windows:u.array(Ube)}),kbe=u.object({quoted_text:u.string().min(1),comment:u.string().nullable(),type:u.enum(["comment","highlight:trapdoor"])}),Gbe=Y4,Bbe=$4.extend({comment_thread_id:u.string().min(1)}),jbe=u.object({markdown:u.string().min(1)}),Hbe=u.object({storage_url:u.string().min(1),thread_file_id:u.string().min(1),parsed_plan_block:L4,critiqued_plan_block:L4,annotations:u.array(kbe),comment_threads:u.array(Gbe),comments:u.array(Bbe)}),cl=u.enum(Bb),X4=u.object({skills:u.boolean(),workspace_scope:u.boolean(),review:u.boolean(),shared_thread_ttl_days:u.number().int().positive().nullable()}),$b=u.object({subject_type:u.enum(["user","organization"]),subject_id:u.string().min(1),effective_plan:cl,admin_override:cl.nullable(),stripe_subscription_status:u.string().nullable(),cancel_at_period_end:u.boolean(),current_period_end:u.string().nullable(),seat_quantity:u.number().int().positive(),member_count:u.number().int().nonnegative().nullable(),features:X4}),Vbe=u.object({effective_plan:cl,features:X4,user:$b,organization:$b.nullable()}),Fbe=u.object({plan:u.enum(["creator","team"]),seat_quantity:u.number().int().positive().optional()}),qbe=u.object({checkout_url:u.string().min(1)}),$be=u.object({portal_url:u.string().min(1)}),Ybe=u.object({seat_quantity:u.number().int().positive()}),k4=u.object({plan:cl.nullable()}),xS=u.object({subject_type:u.enum(["user","organization"]),subject_id:u.string().min(1),label:u.string().min(1),effective_plan:cl,admin_override:cl.nullable(),stripe_subscription_status:u.string().nullable(),seat_quantity:u.number().int().positive()}),Wbe=u.object({users:u.array(xS),organizations:u.array(xS)}),zbe=u.object({id:u.string().min(1),display_name:u.string().min(1),handle:u.string().nullable(),avatar_url:u.string().nullable()}),Kbe=u.object({thread_id:u.string().min(1),title:u.string().min(1),author:zbe,last_active_at:u.string().datetime(),last_block_excerpt:u.string().nullable(),last_block_kind:u.string().min(1).nullable(),is_streaming:u.boolean()}),Qbe=u.object({type:u.literal("list"),list_type:u.literal("live_thread"),objects:u.array(Kbe)}),Xbe=u.object({thread_id:u.string().min(1)}),Jbe=u.object({thread_id:u.string().min(1),last_seen_at:u.string().datetime(),started_at:u.string().datetime()}),Zbe=u.object({follower_id:u.string().min(1),followee_id:u.string().min(1),is_following:u.literal(!0),follower_count:u.number().int().nonnegative()}),eCe=u.object({follower_id:u.string().min(1),followee_id:u.string().min(1),is_following:u.literal(!1),follower_count:u.number().int().nonnegative()}),J4=u.object({id:u.string().min(1),display_name:u.string().min(1),handle:u.string().nullable(),avatar_url:u.string().nullable(),bio:u.string().max(280).nullable(),is_following:u.boolean(),is_self:u.boolean()}),G4=u.object({type:u.literal("list"),list_type:u.literal("user_follow"),objects:u.array(J4)}),tCe=u.object({date:u.string().regex(/^\d{4}-\d{2}-\d{2}$/),count:u.number().int().nonnegative()}),nCe=u.object({window_start:u.string().datetime(),window_end:u.string().datetime(),total_contributions:u.number().int().nonnegative(),days_active:u.number().int().nonnegative(),daily_average:u.number().nonnegative(),current_streak_days:u.number().int().nonnegative(),days:u.array(tCe)}),rCe=u.object({type:u.literal("thread_created"),occurred_at:u.string().datetime(),id:u.string().min(1),thread:u.object({id:u.string().min(1),title:u.string(),visibility:u.enum(["private","workspace","public"])})}),oCe=u.object({type:u.literal("comment_posted"),occurred_at:u.string().datetime(),id:u.string().min(1),comment_excerpt:u.string(),thread:u.object({id:u.string().min(1),title:u.string(),visibility:u.enum(["private","workspace","public"])})}),sCe=u.object({type:u.literal("project_published"),occurred_at:u.string().datetime(),id:u.string().min(1),project:u.object({id:u.string().min(1),name:u.string().min(1)})}),iCe=u.object({type:u.literal("user_followed"),occurred_at:u.string().datetime(),id:u.string().min(1),followee:J4}),aCe=u.discriminatedUnion("type",[rCe,oCe,sCe,iCe]),cCe=u.object({type:u.literal("list"),list_type:u.literal("user_activity"),objects:u.array(aCe)}),uCe=u.object({id:u.string().min(1),name:u.string().min(1),excerpt:u.string(),published_at:u.string().datetime(),updated_at:u.string().datetime()}),lCe=u.object({type:u.literal("list"),list_type:u.literal("profile_published_project"),objects:u.array(uCe)}),B4=u.object({id:u.string().min(1),published_at:u.string().datetime().nullable()}),pCe=u.enum(["avatar","banner"]),dCe=u.enum(["image/png","image/jpeg","image/webp","image/gif"]),_Ce=u.object({kind:pCe,content_type:dCe,base64_data:u.string().min(1)}),fCe=u.object({substrate:u.enum(["s3","filesystem"]),storage_url:u.string().min(1)}),mCe=H4,Z4=qNe.router({health:{method:"GET",path:"/health",responses:{200:u.object({status:u.literal("ok")})},summary:"Health check"},whoAmI:{method:"GET",path:"/whoami",headers:u.object({authorization:u.string().min(1).optional(),"x-lore-referral-token":u.string().min(1).max(16).optional()}),responses:{200:zNe,401:A},summary:"Validate a Stytch B2B Bearer token and return member plus user fields"},recordHeartbeat:{method:"POST",path:"/heartbeat",headers:u.object({authorization:u.string().min(1).optional()}),body:Xbe,responses:{200:Jbe,401:A,403:A,404:A,422:A},summary:"Record (or refresh) a presence heartbeat for the authenticated user against one of their own threads. Idempotent; the daemon should call this every ~30s while a session is open."},listLiveThreads:{method:"GET",path:"/threads/live",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Qbe,401:A,403:A},summary:"List teammates with activity in the last 5 minutes. Excludes the requester. Org-scoped, deduped per author, max 10."},listThreads:{method:"GET",path:"/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:mbe,responses:{200:U4,401:A},summary:"List threads visible to the authenticated user"},getThread:{method:"GET",path:"/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:al,404:A},summary:"Load a visible thread by id"},getSimilarThreads:{method:"GET",path:"/threads/:id/similar",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:U4,404:A,409:A},summary:"List the top 20 visible threads with the closest summary embedding"},listThreadBlocks:{method:"GET",path:"/threads/:id/blocks",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),query:fbe,responses:{200:W4,401:A},summary:"List blocks for a visible thread"},createThreadBlockCommentThread:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:_Oe,responses:{201:fOe,401:A,404:A},summary:"Create a new block-level comment thread on a visible thread block"},createThreadBlockComment:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId/comments",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1),commentThreadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:hOe,responses:{201:EOe,401:A,404:A,409:A},summary:"Reply to a block-level comment thread on a visible thread block"},updateThreadBlockCommentThread:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1),commentThreadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:AOe,responses:{200:ROe,401:A,404:A},summary:"Resolve or reopen a block-level comment thread on a visible thread block"},listSkills:{method:"GET",path:"/skills",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Ebe,401:A},summary:"Aggregate skill usage across threads the viewer can see"},getSkillDetail:{method:"GET",path:"/skills/:name",pathParams:u.object({name:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:gbe,401:A,404:A},summary:"Per-skill detail: usage stats + visible threads that invoked it"},redactThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/redactions",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:Tbe,responses:{200:jd,401:A,403:A,404:A,422:A},summary:"Permanently redact a character range within a text field of a thread block (author only)"},updateThreadBlockText:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/text",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:Abe,responses:{200:jd,401:A,403:A,404:A,422:A},summary:"Replace a single text leaf in a thread block with new content (author only)"},critiqueThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/critique",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:jd,401:A,403:A,404:A,409:A,422:A},summary:"Critique a plan block once and persist its annotations as nested comment threads (author only)"},deleteThreadBlock:{method:"DELETE",path:"/threads/:threadId/blocks/:blockId",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.null(),401:A,403:A,404:A},summary:"Soft-delete a thread block (author only)"},listThreadBlockEdits:{method:"GET",path:"/threads/:threadId/blocks/:blockId/edits",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Ibe,401:A,404:A},summary:"List edits made to a thread block (visible to anyone who can see the thread)"},listThreadDecisions:{method:"GET",path:"/threads/:id/decisions",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:JOe,401:A,404:A},summary:"List AI-extracted user decisions for a thread, in chronological order"},updateThread:{method:"PATCH",path:"/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:obe,responses:{200:al,401:A,403:A,404:A},summary:"Update thread visibility (author only)"},deleteThread:{method:"DELETE",path:"/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.null(),401:A,403:A,404:A},summary:"Soft-delete a thread (author only)"},castThreadVote:{method:"PUT",path:"/threads/:id/vote",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:BOe,responses:{200:D4,401:A,403:A,404:A,422:A},summary:"Cast or change the caller's up/down vote on a public thread. Idempotent \u2014 re-casting the same value is a no-op."},clearThreadVote:{method:"DELETE",path:"/threads/:id/vote",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:D4,401:A,404:A},summary:"Clear the caller's vote on a thread. No-op when the caller hasn't voted."},listThreadComments:{method:"GET",path:"/threads/:threadId/comments",pathParams:u.object({threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:HOe,403:A,404:A},summary:"List all (live + soft-deleted as tombstones) comments on a public thread, flat with parent_comment_id pointers."},createThreadComment:{method:"POST",path:"/threads/:threadId/comments",pathParams:u.object({threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:VOe,responses:{201:FOe,401:A,403:A,404:A,422:A},summary:"Post a top-level or reply comment on a public thread."},updateThreadComment:{method:"PATCH",path:"/threads/:threadId/comments/:commentId",pathParams:u.object({threadId:u.string().min(1),commentId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:qOe,responses:{200:$Oe,401:A,403:A,404:A,422:A},summary:"Edit your own thread comment (author only; rejects edits to soft-deleted rows)."},deleteThreadComment:{method:"DELETE",path:"/threads/:threadId/comments/:commentId",pathParams:u.object({threadId:u.string().min(1),commentId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:YOe,401:A,403:A,404:A},summary:"Soft-delete your own thread comment (author only). Idempotent."},getThreadPreview:{method:"GET",path:"/threads/:id/preview",pathParams:u.object({id:u.string().min(1)}),responses:{200:sbe,404:A},summary:"Unauthenticated, visibility-redacted metadata for OG / social preview consumers"},createUser:{method:"POST",path:"/users",headers:u.object({authorization:u.string().min(1).optional()}),body:oOe,responses:{201:qb,401:A},summary:"Create a user record with ApiKey authentication"},getUser:{method:"GET",path:"/users/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:H4,404:A},summary:"Public profile for a user. Optional auth \u2014 unauthenticated viewers see only public thread metadata; signed-in viewers see counts scoped to the threads they'd normally be able to access."},updateCurrentUser:{method:"PATCH",path:"/users/me",headers:u.object({authorization:u.string().min(1).optional()}),body:KNe,responses:{200:qb,401:A,409:A,422:A},summary:"Update the authenticated user profile"},getUserByHandle:{method:"GET",path:"/users/by-handle/:handle",pathParams:u.object({handle:j4}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:mCe,404:A},summary:"Resolve a public profile by handle \u2014 same shape as GET /users/:id but keyed on the user's chosen handle."},listUserActivity:{method:"GET",path:"/users/:id/activity",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),query:u.object({limit:u.coerce.number().int().positive().max(100).optional()}),responses:{200:cCe,404:A},summary:"Reverse-chronological activity feed for a user, scoped to what the viewer can see (same visibility rules as listThreads)."},getUserContributions:{method:"GET",path:"/users/:id/contributions",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:nCe,404:A},summary:"Daily contribution counts for the trailing 365 days \u2014 counts thread blocks the user authored on threads visible to the viewer."},listUserFollowers:{method:"GET",path:"/users/:id/followers",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:G4,404:A},summary:"List the users following a given user."},listUserFollowing:{method:"GET",path:"/users/:id/following",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:G4,404:A},summary:"List the users a given user is following."},followUser:{method:"POST",path:"/users/:id/follow",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:Zbe,401:A,404:A,409:A,422:A},summary:"Follow another user. Idempotent \u2014 repeating the call is a no-op."},unfollowUser:{method:"DELETE",path:"/users/:id/follow",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:eCe,401:A,404:A},summary:"Unfollow a user. Idempotent \u2014 repeating the call is a no-op."},listProfilePublishedProjects:{method:"GET",path:"/users/:id/projects",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:lCe,404:A},summary:"Projects the user has published to their public profile."},publishProject:{method:"POST",path:"/projects/:id/publish",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:B4,401:A,403:A,404:A},summary:"Publish a project to the author's public profile. Stamps published_at with `now()`. Author-only."},unpublishProject:{method:"DELETE",path:"/projects/:id/publish",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:B4,401:A,403:A,404:A},summary:"Remove a project from the author's public profile."},uploadProfileImage:{method:"POST",path:"/users/me/profile-image",headers:u.object({authorization:u.string().min(1).optional()}),body:_Ce,responses:{200:fCe,401:A,413:A,422:A},summary:"Upload an avatar or banner image (base64-encoded JSON body). The API streams the bytes to its configured storage substrate using its own credentials and returns the canonical storage URL the client passes to PATCH /users/me."},listOrganizationMembers:{method:"GET",path:"/organization/members",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:XNe,401:A},summary:"List members of the authenticated user\u2019s organization"},createOrganizationInvite:{method:"POST",path:"/organization/invites",headers:u.object({authorization:u.string().min(1).optional()}),body:JNe,responses:{201:ZNe,401:A,403:A,409:A,422:A},summary:"Invite a teammate to the authenticated user\u2019s workspace via Stytch B2B"},listRepositories:{method:"GET",path:"/repositories",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:vOe,401:A,403:A},summary:"List repositories known to the authenticated user\u2019s organization across threads and building blocks"},createBuildingBlockSnapshots:{method:"POST",path:"/building_blocks",headers:u.object({authorization:u.string().min(1).optional()}),body:iOe,responses:{201:bOe,401:A,403:A},summary:"Create building block snapshots for the authenticated user\u2019s organization"},getPlan:{method:"GET",path:"/plans/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:IOe,401:A,403:A,404:A},summary:"Load a thread-backed plan container visible to the authenticated user, including all visible plan revisions in that thread"},createPlanCommentThread:{method:"POST",path:"/plans/:id/comment-threads",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:pOe,responses:{201:dOe,401:A,403:A,404:A,422:A},summary:"Create a new inline comment thread on a specific revision inside a thread-backed plan container"},createPlanComment:{method:"POST",path:"/plans/:id/comment-threads/:threadId/comments",pathParams:u.object({id:u.string().min(1),threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:mOe,responses:{201:TOe,401:A,403:A,404:A,409:A},summary:"Reply to an inline comment thread on a thread-backed plan container"},updatePlanCommentThread:{method:"PATCH",path:"/plans/:id/comment-threads/:threadId",pathParams:u.object({id:u.string().min(1),threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:SOe,responses:{200:gOe,401:A,403:A,404:A},summary:"Resolve or reopen an inline comment thread on a thread-backed plan container"},listPlans:{method:"GET",path:"/plans",headers:u.object({authorization:u.string().min(1).optional()}),query:OOe,responses:{200:NOe,401:A,403:A},summary:"List thread-backed plan containers visible to the authenticated user in their organization, ordered by latest visible revision and optionally filtered by author or repository"},listBuildingBlockSnapshots:{method:"GET",path:"/building_blocks",headers:u.object({authorization:u.string().min(1).optional()}),query:POe,responses:{200:COe,401:A,403:A},summary:"List building block snapshots for the authenticated user\u2019s organization and repo origin path"},listUploadSessions:{method:"GET",path:"/upload_sessions",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:_be,401:A},summary:"List recent upload sessions for the authenticated user"},createUploadSession:{method:"POST",path:"/upload_sessions",headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({thread_files:u.array(UOe).nonempty()}),responses:{201:rbe,400:A,401:A},summary:"Create an upload session with presigned URLs for file uploads"},completeUploadSession:{method:"POST",path:"/upload_sessions/:id/complete",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({thread_files:u.array(ZOe).nonempty()}),responses:{200:tbe,400:A,401:A,404:A,409:A,422:A},summary:"Complete an upload session after files have been uploaded to storage"},adminStats:{method:"GET",path:"/admin/stats",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Nbe,401:A,403:A},summary:"Cross-org operational counts. Tanagram admins only."},adminListOrganizations:{method:"GET",path:"/admin/organizations",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:bbe,401:A,403:A},summary:"List every organization with member and thread counts. Tanagram admins only."},adminListUsers:{method:"GET",path:"/admin/users",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Pbe,401:A,403:A},summary:"List every user with their org memberships and thread count. Tanagram admins only."},adminListThreads:{method:"GET",path:"/admin/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:vbe,responses:{200:xbe,401:A,403:A},summary:"List live threads across every organization. Tanagram admins only."},adminHardDeleteThread:{method:"DELETE",path:"/admin/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.null(),401:A,403:A,404:A},summary:"Permanently remove a thread. Tanagram admins only."},listDiscoverThreads:{method:"GET",path:"/discover/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:lbe,responses:{200:ube},summary:"Feed of public threads with sort, harness filter, search, and cursor pagination. Auth is optional and populates viewer_vote."},discoverStats:{method:"GET",path:"/discover/stats",responses:{200:pbe},summary:"Unauthenticated rollup of public-thread counts for the Discover header."},createWaitlistEntry:{method:"POST",path:"/waitlist_entries",body:eOe,responses:{201:tOe,409:A},summary:"Create an unauthenticated waitlist entry keyed by (location, contact)."},createShareToken:{method:"POST",path:"/threads/:id/share-token",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{201:w4,401:A,403:A,404:A,409:A},summary:"Mint a short share-link token for a public thread. Author only. The token powers `/s/:token` short URLs and enables k-factor attribution."},resolveShareToken:{method:"GET",path:"/referrals/resolve/:token",pathParams:u.object({token:u.string().min(1).max(16)}),query:Lbe,responses:{200:w4,404:A},summary:"Resolve a share-link token to its thread and record the view. Unauthenticated by design."},adminGrowth:{method:"GET",path:"/admin/growth",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:wbe,401:A,403:A},summary:"Share-link k-factor, funnel, sparkline, and top sharers by window. Tanagram admins only."},adminRunCritiquePlayground:{method:"POST",path:"/admin/critique-playground/run",headers:u.object({authorization:u.string().min(1).optional()}),body:jbe,responses:{200:Hbe,401:A,403:A,409:A},summary:"Admin-only critique playground that saves markdown to a file:// plan artifact and returns parsed + critiqued plan blocks."},getBillingState:{method:"GET",path:"/billing/state",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Vbe,401:A},summary:"Resolve the caller's plan, features, seat count, and any admin override."},createBillingCheckout:{method:"POST",path:"/billing/checkout",headers:u.object({authorization:u.string().min(1).optional()}),body:Fbe,responses:{200:qbe,400:A,401:A,403:A,503:A},summary:"Start a Stripe Checkout session for Creator ($29/mo) or Team ($19/seat/mo, min 2)."},createBillingPortal:{method:"POST",path:"/billing/portal",headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({subject_type:u.enum(["user","organization"]).default("user")}).optional(),responses:{200:$be,401:A,404:A,503:A},summary:"Open the Stripe customer portal so the subject can manage their subscription."},updateTeamSeats:{method:"PATCH",path:"/billing/team-seats",headers:u.object({authorization:u.string().min(1).optional()}),body:Ybe,responses:{200:$b,400:A,401:A,403:A,404:A,503:A},summary:"Adjust the caller-organization's Team seat quantity (admin of that org only)."},adminListBilling:{method:"GET",path:"/admin/billing",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Wbe,401:A,403:A},summary:"List every user and org with current plan + override for the admin panel."},adminSetUserPlanOverride:{method:"PUT",path:"/admin/billing/users/:id/override",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:k4,responses:{200:xS,401:A,403:A,404:A},summary:"Admin override for a user's plan tier. Null clears the override."},adminSetOrganizationPlanOverride:{method:"PUT",path:"/admin/billing/organizations/:id/override",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:k4,responses:{200:xS,401:A,403:A,404:A},summary:"Admin override for an organization's plan tier. Null clears the override."},projects:P4,docs:b4,mentions:M4,favorites:v4},{pathPrefix:"/api"});import Vd from"node:fs";import t3 from"node:path";import TCe from"node:os";import e3 from"node:path";function Hd(){let t=jt()==="dev"?".lore-dev":".lore";return e3.join(TCe.homedir(),t)}function LS(){return e3.join(Hd(),"log.txt")}function DS(){return t3.join(Hd(),"token")}function Wb(){let t;try{t=Vd.readFileSync(DS(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return{token:"",source:"none"};throw n}let e=t.trim();return!e||ECe(e,new Date)?{token:"",source:"none"}:{token:e,source:"file"}}function n3(){return Wb().token}function r3(){return Vd.existsSync(DS())}function o3(t){let e=DS();Vd.mkdirSync(t3.dirname(e),{recursive:!0,mode:448}),Vd.writeFileSync(e,t,{mode:384})}function s3(){try{Vd.rmSync(DS())}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return;throw t}}function hCe(t){let e=t.split(".");if(e.length<2)throw new Error("invalid JWT format");return JSON.parse(Buffer.from(e[1],"base64url").toString("utf8"))}function ECe(t,e){let n;try{n=hCe(t)}catch{return!1}let r=n["https://stytch.com/session"]?.expires_at;if(typeof r!="string")return!1;let o=Date.parse(r.trim());return Number.isNaN(o)?!1:e.getTime()>=o}var SCe={dev:"http://localhost:4000",prod:"https://lore.tanagram.ai"};function ul(t={}){let e=t.token??n3();return Gb(Z4,{baseUrl:SCe[jt()],baseHeaders:{"User-Agent":n4(),...e?{authorization:`Bearer ${e}`}:{}}})}import a3 from"node:fs";var i3=!1;function gCe(){i3||(a3.mkdirSync(Hd(),{recursive:!0}),i3=!0)}function ACe(t){let e=typeof t=="string"?t:JSON.stringify(t);return/[\s"=]/.test(e)?JSON.stringify(e):e}function RCe(t,e,n){let r=`${new Date().toISOString()} ${t} ${e}`;if(!n)return`${r}
40
- `;let o=Object.entries(n).map(([s,i])=>`${s}=${ACe(i)}`).join(" ");return o?`${r} ${o}
37
+ `;let c=FV(o);o.write(`${a}\r
38
+ `);let{connect:l,buffered:p}=await c;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200){if(e.once("socket",Sme),n.secureEndpoint){Fp("Upgrading socket connection to TLS");let _=n.servername||n.host;return PO.connect({...VV(n,"host","path","port"),socket:o,servername:Vo.isIP(_)?void 0:_})}return o}o.destroy();let d=new Vo.Socket({writable:!1});return d.readable=!0,e.once("socket",_=>{Fp("Replaying proxy buffer for failed request"),_.push(p),_.push(null)}),d}};Vp.__initStatic();function Sme(t){t.resume()}function VV(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}var Ime=1024*32;function Ome(t){return new Rme({read(){this.push(t),this.push(null)}})}function qV(t){let e;try{e=new URL(t.url)}catch{return Qe(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),up(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=Nme(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?Ame:gme,s=t.keepAlive===void 0?!1:t.keepAlive,i=r?new Vp(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=bme(t,t.httpModule??o,i);return up(t,a)}function Nme(t,e){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>t.host.endsWith(o)||t.hostname.endsWith(o)))return e}function bme(t,e,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(l){return new Promise((p,d)=>{xc(()=>{let _=Ome(l.body),f={...t.headers};l.body.length>Ime&&(f["content-encoding"]="gzip",_=_.pipe(yme()));let m=r.startsWith("["),h=e.request({method:"POST",agent:n,headers:f,hostname:m?r.slice(1,-1):r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},T=>{T.on("data",()=>{}),T.on("end",()=>{}),T.setEncoding("utf8");let S=T.headers["retry-after"]??null,R=T.headers["x-sentry-rate-limits"]??null;p({statusCode:T.statusCode,headers:{"retry-after":S,"x-sentry-rate-limits":Array.isArray(R)?R[0]||null:R}})});h.on("error",d),_.pipe(h)})})}}function $V(t){if(t===!1)return!1;if(typeof t=="string")return t;let e=Uc(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=e===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return t===!0?n??!0:e??n}import{posix as Cme,sep as Pme}from"node:path";function YV(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function WV(t=process.argv[1]?My(process.argv[1]):process.cwd(),e=Pme==="\\"){let n=e?YV(t):t;return r=>{if(!r)return;let o=e?YV(r):r,{dir:s,base:i,ext:a}=Cme.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let l=s.lastIndexOf("/node_modules");if(l>-1)return`${s.slice(l+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let p=s.slice(n.length+1).replace(/\//g,".");return p?`${p}:${c}`:c}return c}}function zV(t){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(J.SENTRY_RELEASE?.id)return J.SENTRY_RELEASE.id;let e=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return e||n||r||t}var KV=xf(cI(WV()));b();var XV=K(ne(),1);import*as QV from"node:os";import{threadId as Mme,isMainThread as xme}from"worker_threads";var vme=6e4,$h=class extends lp{constructor(e){let n=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||QV.hostname(),r={...e,platform:"node",runtime:e.runtime||{name:"node",version:global.process.version},serverName:n};e.openTelemetryInstrumentations&&(0,XV.registerInstrumentations)({instrumentations:e.openTelemetryInstrumentations}),Ki(r,"node"),g.log(`Initializing Sentry: process: ${process.pid}, thread: ${xme?"main":`worker-${Mme}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Lc(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let e="@sentry/node",n=pe,r=X.getTracer(e,n);return this._tracer=r,r}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}async close(e){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener);let n=await super.close(e);return this.traceProvider&&await this.traceProvider.shutdown(),n}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{re&&g.log("Flushing client reports based on interval."),this._flushOutcomes()},e.clientReportFlushInterval??vme).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_setupIntegrations(){yy(),super._setupIntegrations()}_getTraceInfoFromScope(e){return e?eV(this,e):[void 0,void 0]}};var JV=K(cR(),1);import*as ZV from"module";function MO(){if(MV()&&!J._sentryEsmLoaderHookRegistered){J._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:t}=(0,JV.createAddHookMessageChannel)();ZV.register("import-in-the-middle/hook.mjs",import.meta.url,{data:{addHookMessagePort:t,include:[]},transferList:[t]})}catch(t){g.warn("Failed to register 'import-in-the-middle' hook",t)}}}function Yh(){return[_m(),pm(),fm(),mm(),HV(),Dy(),Tm(),yH(),CH(),UV(),wV(),gV(),CV(),fV(),pV(),kV(),DV()]}function xO(t={}){return Lme(t,Yh)}function Lme(t={},e){let n=Dme(t,e);n.debug===!0&&(re?g.enable():Qe(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&MO(),rV(),he().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===bO)&&n.integrations.push(BV({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),Ki(n,"node-core");let o=new $h(n);return he().setClient(o),o.init(),g.log(`SDK initialized from ${jp()?"CommonJS":"ESM"}`),o.startClientReportTracking(),kme(),jF(o),nV(o),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function vO(){if(!re)return;let t=qF(),e=["SentryContextManager","SentryPropagator"];Xe()&&e.push("SentrySpanProcessor");for(let n of e)t.includes(n)||g.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);t.includes("SentrySampler")||g.warn("You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.")}function Dme(t,e){let n=Ume(t.release),r=$V(t.spotlight),o=wme(t.tracesSampleRate),s={...t,dsn:t.dsn??process.env.SENTRY_DSN,environment:t.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:t.sendClientReports??!0,transport:t.transport??qV,stackParser:yR(t.stackParser||KV),release:n,tracesSampleRate:o,spotlight:r,debug:Uc(t.debug??process.env.SENTRY_DEBUG)},i=t.integrations,a=t.defaultIntegrations??e(s);return{...s,integrations:my({defaultIntegrations:a,integrations:i})}}function Ume(t){if(t!==void 0)return t;let e=zV();if(e!==void 0)return e}function wme(t){if(t!==void 0)return t;let e=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!e)return;let n=parseFloat(e);return isFinite(n)?n:void 0}function kme(){if(Uc(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let t=process.env.SENTRY_TRACE,e=process.env.SENTRY_BAGGAGE,n=Kl(t,e);he().setPropagationContext(n)}}function Re(t,e){t.setAttribute(W,e)}function qp(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`,o=t.path?t.path:"/";return`${e}//${n}${r}${o}`}var LO="Http",eq="@opentelemetry_sentry-patched/instrumentation-http",Wh=Lr.major===22&&Lr.minor>=12||Lr.major===23&&Lr.minor>=2||Lr.major>=24,Gme=w(`${LO}.sentry`,t=>new ra(t)),Bme=w(LO,t=>{let e=new tq.HttpInstrumentation({...t,disableIncomingRequestInstrumentation:!0});try{e._diag=wn.createComponentLogger({namespace:eq}),e.instrumentationName=eq}catch{}try{let n={get:()=>!1,set:()=>{}};Object.defineProperty(e,"_httpPatched",n),Object.defineProperty(e,"_httpsPatched",n)}catch{}return e});function jme(t,e={}){return typeof t.spans=="boolean"?t.spans:!(e.skipOpenTelemetrySetup||!Xe(e)&&Wh)}var nq=(t={})=>{let e=t.spans??!0,n=t.disableIncomingRequestSpans,r={sessions:t.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:t.sessionFlushingDelayMS,ignoreRequestBody:t.ignoreIncomingRequestBody,maxRequestBodySize:t.maxIncomingRequestBodySize},o={ignoreIncomingRequests:t.ignoreIncomingRequests,ignoreStaticAssets:t.ignoreStaticAssets,ignoreStatusCodes:t.dropSpansForIncomingRequestStatusCodes,instrumentation:t.instrumentation,onSpanCreated:t.incomingRequestSpanHook},s=Op(r),i=Np(o),a=e&&!n;return{name:LO,setup(c){let l=c.getOptions();a&&Xe(l)&&i.setup(c)},setupOnce(){let c=H()?.getOptions()||{},l=jme(t,c);s.setupOnce();let p={breadcrumbs:t.breadcrumbs,propagateTraceInOutgoingRequests:typeof t.tracePropagation=="boolean"?t.tracePropagation:Wh||!l,createSpansForOutgoingRequests:Wh,spans:t.spans,ignoreOutgoingRequests:t.ignoreOutgoingRequests,outgoingRequestHook:(d,_)=>{let f=qp(_);if(f.startsWith("data:")){let m=wc(f);d.setAttribute("http.url",m),d.setAttribute(As,m),d.updateName(`${_.method||"GET"} ${m}`)}t.instrumentation?.requestHook?.(d,_)},outgoingResponseHook:t.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:t.instrumentation?.applyCustomAttributesOnSpan};if(Gme(p),l){let d=Hme(t);Bme(d)}},processEvent(c){return i.processEvent(c)}}};function Hme(t={}){return{disableOutgoingRequestInstrumentation:Wh,ignoreOutgoingRequestHook:n=>{let r=qp(n);if(!r)return!1;let o=t.ignoreOutgoingRequests;return!!o?.(r,n)},requireParentforOutgoingSpans:!1,requestHook:(n,r)=>{Re(n,"auto.http.otel.http");let o=qp(r);if(o.startsWith("data:")){let s=wc(o);n.setAttribute("http.url",s),n.setAttribute(As,s),n.updateName(`${r.method||"GET"} ${s}`)}t.instrumentation?.requestHook?.(n,r)},responseHook:(n,r)=>{t.instrumentation?.responseHook?.(n,r)},applyCustomAttributesOnSpan:(n,r,o)=>{t.instrumentation?.applyCustomAttributesOnSpan?.(n,r,o)}}}var cq=K(iq(),1);var uq="NodeFetch",qme=w(uq,cq.UndiciInstrumentation,t=>zme(t)),$me=w(`${uq}.sentry`,oa,t=>t),Yme=(t={})=>({name:"NodeFetch",setupOnce(){Wme(t,H()?.getOptions())&&qme(t),$me(t)}}),lq=Yme;function aq(t,e="/"){let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e}`:`${n}${e}`}function Wme(t,e={}){return typeof t.spans=="boolean"?t.spans:!e.skipOpenTelemetrySetup&&Xe(e)}function zme(t={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=aq(n.origin,n.path),o=t.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=aq(n.origin,n.path);if(r.startsWith("data:")){let o=wc(r);return{[W]:"auto.http.otel.node_fetch","http.url":o,[As]:o,[tr]:`${n.method||"GET"} ${o}`}}return{[W]:"auto.http.otel.node_fetch"}},requestHook:t.requestHook,responseHook:t.responseHook,headersToSpanAttributes:t.headersToSpanAttributes}}var Aq=K(gq(),1);var mt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Rq="Express";function lhe(t){Re(t,"auto.http.otel.express");let e=Y(t).data,n=e["express.type"];n&&t.setAttribute(ee,`${n}.express`);let r=e["express.name"];typeof r=="string"&&t.updateName(r)}function phe(t,e){if(ue()===er())return mt&&g.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let n=t.request,r=n.method?n.method.toUpperCase():"GET";ue().setTransactionName(`${r} ${t.route}`)}return e}var yq=w(Rq,()=>new Aq.ExpressInstrumentation({requestHook:t=>lhe(t),spanNameHook:(t,e)=>phe(t,e)})),dhe=()=>({name:Rq,setupOnce(){yq()}}),Iq=dhe;var Q$=K(q$(),1);import*as RN from"node:diagnostics_channel";b();var UT=K(Te(),1),_a=K(ne(),1);le();var $o;(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})($o||($o={}));var ad;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(ad||(ad={}));var cd;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(cd||(cd={}));b();var ud=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function AN(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[ud]||[];return s.push(o),Object.defineProperty(t,ud,{enumerable:!1,configurable:!0,value:s}),o}function LT(t,e){let n=t[ud]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:Be.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[ud])}function Y$(t,e,n){let r,o;try{o=t(),$$(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!$$(o)&&(e(r,o),r))throw r;return o}}function $$(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var uSe="0.1.0",lSe="@sentry/instrumentation-fastify-v3",W$="anonymous",pSe=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),DT=class extends _a.InstrumentationBase{constructor(e={}){super(lSe,uSe,e)}init(){return[new _a.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,UT.getRPCMetadata)(P.active()),c=i.routeOptions?i.routeOptions.url:r.routerPath;c&&a?.type===UT.RPCType.HTTP&&(a.route=c);let l=r.method||"GET";ue().setTransactionName(`${l} ${c}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||W$,c=`${cd.MIDDLEWARE} - ${a}`,l=i[1],p=AN(l,s.tracer,c,{[$o.FASTIFY_TYPE]:ad.MIDDLEWARE,[$o.PLUGIN_NAME]:e,[$o.HOOK_NAME]:n}),d=o&&i[i.length-1];return d&&(i[i.length-1]=function(..._){LT(l),d.apply(this,_)}),P.with(X.setSpan(P.active(),p),()=>Y$(()=>r.apply(this,i),_=>{_ instanceof Error&&(p.setStatus({code:Be.ERROR,message:_.message}),p.recordException(_)),o||LT(l)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!pSe.has(s))return n.apply(this,o);let c=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,c)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),dSe(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,_a.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),LT(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,c=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,l=`${cd.REQUEST_HANDLER} - ${c||this.pluginName||W$}`,p={[$o.PLUGIN_NAME]:this.pluginName,[$o.FASTIFY_TYPE]:ad.REQUEST_HANDLER,[oA]:i.routeOptions?i.routeOptions.url:r.routerPath};c&&(p[$o.FASTIFY_NAME]=c);let d=AN(o,e.tracer,l,p);z$(d);let{requestHook:_}=e.getConfig();return _&&(0,_a.safeExecuteInTheMiddle)(()=>_(d,{request:r}),f=>{f&&e._diag.error("request hook failed",f)},!0),P.with(X.setSpan(P.active(),d),()=>{s()})}}};function dSe(){let t=H();t&&t.on("spanStart",e=>{z$(e)})}function z$(t){let e=Y(t).data,n=e["fastify.type"];if(e[ee]||!n)return;t.setAttributes({[W]:"auto.http.otel.fastify",[ee]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var wT="Fastify",X$=w(`${wT}.v3`,()=>new DT);function _Se(){let t=H();if(t)return t.getIntegrationByName(wT)}function K$(t,e,n,r){let o=_Se()?.getShouldHandleError()||eY;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){mt&&g.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&te(t,{mechanism:{handled:!1,type:"auto.function.fastify"}})}var J$=w(`${wT}.v5`,()=>{let t=new Q$.FastifyOtelInstrumentation,e=t.plugin();return RN.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?mt&&g.error("Failed to setup Fastify instrumentation",o):(mSe(),r&&hSe(r))})}),RN.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;K$.call(K$,r,o,s,"diagnostics-channel")}),t}),fSe=({shouldHandleError:t})=>{let e;return{name:wT,setupOnce(){e=t||eY,X$(),J$()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}},Z$=(t={})=>fSe(t);function eY(t,e,n){let r=n.statusCode;return r>=500||r<=299}function tY(t){let e=Y(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[ee]||!i&&!a&&!s)return;let c=s?"hook":i?"middleware":a?"request_handler":"<unknown>";t.setAttributes({[W]:"auto.http.otel.fastify",[ee]:`${c}.fastify`});let l=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof l=="string"){let p=l.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(p)}}function mSe(){let t=H();t&&t.on("spanStart",e=>{tY(e)})}function hSe(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&tY(s)}let r=e.routeOptions?.url,o=e.method||"GET";ue().setTransactionName(`${o} ${r}`)})}b();var RY=K(AY(),1);var yY="Graphql",IY=w(yY,RY.GraphQLInstrumentation,t=>{let e=NY(t);return{...e,responseHook(n,r){Re(n,"auto.graphql.otel.graphql"),r.errors?.length&&!Y(n).status&&n.setStatus({code:Be.ERROR});let s=Y(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let c=je(n),p=Y(c).data[au]||[],d=a?`${i} ${a}`:`${i}`;Array.isArray(p)?(p.push(d),c.setAttribute(au,p)):typeof p=="string"?c.setAttribute(au,[p,d]):c.setAttribute(au,d),Y(c).data["original-description"]||c.setAttribute("original-description",Y(c).description),c.updateName(`${Y(c).data["original-description"]} (${kSe(p)})`)}}}}),wSe=(t={})=>({name:yY,setupOnce(){IY(NY(t))}}),OY=wSe;function NY(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function kSe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}var GY=K(kY(),1);var BY="Kafka",jY=w(BY,()=>new GY.KafkaJsInstrumentation({consumerHook(t){Re(t,"auto.kafkajs.otel.consumer")},producerHook(t){Re(t,"auto.kafkajs.otel.producer")}})),BSe=()=>({name:BY,setupOnce(){jY()}}),HY=BSe;var zY=K(WY(),1);var KY="LruMemoizer",QY=w(KY,()=>new zY.LruMemoizerInstrumentation),HSe=()=>({name:KY,setupOnce(){QY()}}),XY=HSe;var iW=K(sW(),1);var aW="Mongo",cW=w(aW,()=>new iW.MongoDBInstrumentation({dbStatementSerializer:YSe,responseHook(t){Re(t,"auto.db.otel.mongo")}}));function YSe(t){let e=xN(t);return JSON.stringify(e)}function xN(t){if(Array.isArray(t))return t.map(e=>xN(e));if(WSe(t)){let e={};return Object.entries(t).map(([n,r])=>[n,xN(r)]).reduce((n,r)=>(KSe(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function WSe(t){return typeof t=="object"&&t!==null&&!zSe(t)}function zSe(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function KSe(t){return Array.isArray(t)}var QSe=()=>({name:aW,setupOnce(){cW()}}),uW=QSe;var gW=K(SW(),1);var AW="Mongoose",RW=w(AW,()=>new gW.MongooseInstrumentation({responseHook(t){Re(t,"auto.db.otel.mongoose")}})),sge=()=>({name:AW,setupOnce(){RW()}}),yW=sge;var xW=K(MW(),1);var vW="Mysql",LW=w(vW,()=>new xW.MySQLInstrumentation({})),mge=()=>({name:vW,setupOnce(){LW()}}),DW=mge;var FW=K(HW(),1);var VW="Mysql2",qW=w(VW,()=>new FW.MySQL2Instrumentation({responseHook(t){Re(t,"auto.db.otel.mysql2")}})),Mge=()=>({name:VW,setupOnce(){qW()}}),$W=Mge;var Tz=K(ZW(),1),Ez=K(dz(),1);var Kge=["get","set","setex"],JN=["get","mget"],Qge=["set","setex"];function yd(t,e){return t.includes(e.toLowerCase())}function ZN(t){return yd(JN,t)?"cache.get":yd(Qge,t)?"cache.put":void 0}function Xge(t,e){return e.some(n=>t.startsWith(n))}function fz(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?_z(o.map(s=>n(s))):["<unknown>"],r=e[0];return yd(Kge,t)&&r!=null?n(r):_z(e.map(o=>n(o)))}catch{return}}function mz(t,e,n){if(!ZN(t))return!1;for(let r of e)if(Xge(r,n))return!0;return!1}function hz(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function _z(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var SE="Redis",Id={},Sz=(t,e,n,r)=>{t.setAttribute(W,"auto.db.otel.redis");let o=fz(e,n),s=ZN(e);if(!o||!s||!Id.cachePrefixes||!mz(e,o,Id.cachePrefixes))return;let i=Y(t).data["net.peer.name"],a=Y(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=hz(r);c&&t.setAttribute(KR,c),yd(JN,e)&&c!==void 0&&t.setAttribute(WR,c>0),t.setAttributes({[ee]:s,[zR]:o});let l=o.join(", ");t.updateName(Id.maxCacheKeyLength?hs(l,Id.maxCacheKeyLength):l)},Jge=w(`${SE}.IORedis`,()=>new Tz.IORedisInstrumentation({responseHook:Sz})),Zge=w(`${SE}.Redis`,()=>new Ez.RedisInstrumentation({responseHook:Sz})),gz=Object.assign(()=>{Jge(),Zge()},{id:SE}),eAe=(t={})=>({name:SE,setupOnce(){Id=t,gz()}}),Az=eAe;var Gz=K(kz(),1);var Bz="Postgres",jz=w(Bz,Gz.PgInstrumentation,t=>({requireParentSpan:!0,requestHook(e){Re(e,"auto.db.otel.postgres")},ignoreConnectSpans:t?.ignoreConnectSpans??!1})),mAe=t=>({name:Bz,setupOnce(){jz(t)}}),Hz=mAe;b();var ei=K(ne(),1);le();var ib="PostgresJs",Fz=[">=3.0.0 <4"],hAe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,TAe=Symbol.for("sentry.query.from.instrumented.sql"),Vz=w(ib,t=>new sb({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),sb=class extends ei.InstrumentationBase{constructor(e){super("sentry-postgres-js",pe,e)}init(){let e=new ei.InstrumentationNodeModuleDefinition("postgres",Fz,n=>{try{return this._patchPostgres(n)}catch(r){return mt&&g.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new ei.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,Fz,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return mt&&g.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);if(!a||typeof a!="function")return mt&&g.warn("postgres() did not return a valid instance"),a;let c=o.getConfig();return Ly(a,{requireParentSpan:c.requireParentSpan,requestHook:c.requestHook})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(Rp(e,"default",s),e)}_shouldCreateSpans(){let e=this.getConfig();return X.getSpan(P.active())!==void 0||!e.requireParentSpan}_setOperationName(e,n,r){if(r){e.setAttribute(ec,r);return}let o=n?.match(hAe);o?.[1]&&e.setAttribute(ec,o[1].toUpperCase())}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[TAe])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return It({name:i||"postgresjs.query",op:"db"},a=>{Re(a,"auto.db.postgresjs"),a.setAttributes({[Mi]:"postgres",[pA]:i});let c=n.getConfig(),{requestHook:l}=c;l&&(0,ei.safeExecuteInTheMiddle)(()=>l(a,i,void 0),_=>{_&&(a.setAttribute("sentry.hook.error","requestHook failed"),mt&&g.error(`Error in requestHook for ${ib} integration:`,_))},!0);let p=this.resolve;this.resolve=new Proxy(p,{apply:(_,f,m)=>{try{n._setOperationName(a,i,m?.[0]?.command),a.end()}catch(h){mt&&g.error("Error ending span in resolve callback:",h)}return Reflect.apply(_,f,m)}});let d=this.reject;this.reject=new Proxy(d,{apply:(_,f,m)=>{try{a.setStatus({code:2,message:m?.[0]?.message||"unknown_error"}),a.setAttribute(dA,m?.[0]?.code||"unknown"),a.setAttribute(_A,m?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(h){mt&&g.error("Error ending span in reject callback:",h)}return Reflect.apply(_,f,m)}});try{return r.apply(this,o)}catch(_){throw a.setStatus({code:2,message:_ instanceof Error?_.message:"unknown_error"}),a.end(),_}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},EAe=t=>({name:ib,setupOnce(){Vz(t)}}),qz=EAe;b();b();var WE=K(bK(),1);b();var BRe={name:"@prisma/instrumentation-contract",version:"7.6.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},jRe=BRe.version.split(".")[0],Mb="PRISMA_INSTRUMENTATION",xb=`V${jRe}_PRISMA_INSTRUMENTATION`,Yu=globalThis;function HRe(){let t=Yu[xb];return t?.helper?t.helper:Yu[Mb]?.helper}function FRe(t){let e={helper:t};Yu[xb]=e,Yu[Mb]=e}function VRe(){delete Yu[xb],delete Yu[Mb]}var qRe=process.env.PRISMA_SHOW_ALL_TRACES==="true",$Re="00-10-10-00";function YRe(t){switch(t){case"client":return Ne.CLIENT;case"internal":default:return Ne.INTERNAL}}var WRe=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=X.getSpanContext(t??P.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:$Re}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)MK(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return P.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!qRe)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(xK(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return CK(s,e(s,r))}return n.startActiveSpan(o,t,s=>CK(s,e(s,r)))}};function MK(t,e,n,r,o){if(xK(e.name,o))return;let s={attributes:e.attributes,kind:YRe(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let l=r.get(c);return l?{context:{spanId:l,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)MK(t,c,n,r,o);i.end(e.endTime)})}function CK(t,e){return zRe(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function zRe(t){return t!=null&&typeof t.then=="function"}function xK(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var vK={name:"@prisma/instrumentation",version:"7.6.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},PK=vK.version,KRe=vK.name,QRe="@prisma/client",LK=class extends WE.InstrumentationBase{tracerProvider;constructor(t={}){super(KRe,PK,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new WE.InstrumentationNodeModuleDefinition(QRe,[PK])]}enable(){let t=this._config;FRe(new WRe({tracerProvider:this.tracerProvider??X.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){VRe()}isEnabled(){return HRe()!==void 0}};var DK="Prisma";function XRe(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function UK(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}var vb=class extends LK{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=UK();XRe(e)&&(e.createEngineSpan=n=>{let r=X.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Qe(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=JRe(s.kind),a=s.parent_span_id,c=s.span_id,l=s.trace_id,p=s.links?.map(_=>({context:{traceId:_.trace_id,spanId:_.span_id,traceFlags:Vt.SAMPLED}})),d=X.setSpanContext(P.active(),{traceId:l,spanId:a,traceFlags:Vt.SAMPLED});P.with(d,()=>{let _={generateTraceId:()=>l,generateSpanId:()=>c};r._idGenerator=_,r.startSpan(s.name,{kind:i,links:p,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};function JRe(t){switch(t){case"client":return Ne.CLIENT;case"internal":default:return Ne.INTERNAL}}var ZRe=w(DK,t=>new vb(t)),wK=t=>({name:DK,setupOnce(){ZRe(t)},setup(e){UK()&&e.on("spanStart",n=>{let r=Y(n);r.description?.startsWith("prisma:")&&n.setAttribute(W,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}});var YK=K($K(),1);var WK="Hapi",zK=w(WK,()=>new YK.HapiInstrumentation),dye=()=>({name:WK,setupOnce(){zK()}}),KK=dye;le();var oi={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Gd={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"};b();var XE=K(ne(),1);var _ye="@sentry/instrumentation-hono",fye="0.0.1",QE=class extends XE.InstrumentationBase{constructor(e={}){super(_ye,fye,e)}init(){return[new XE.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return P.with(X.setSpan(P.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(Lt(a))return a.then(c=>{let l=n._determineHandlerType(c);return i.setAttributes({[oi.HONO_TYPE]:l,[oi.HONO_NAME]:l===Gd.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),c});{let c=n._determineHandlerType(a);return i.setAttributes({[oi.HONO_TYPE]:c,[oi.HONO_NAME]:c===Gd.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return Lt(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Gd.MIDDLEWARE:Gd.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:Be.ERROR,message:n.message}),e.recordException(n))}};var QK="Hono";function mye(t){let e=Y(t).data,n=e[oi.HONO_TYPE];if(e[ee]||!n)return;t.setAttributes({[W]:"auto.http.otel.hono",[ee]:`${n}.hono`});let r=e[oi.HONO_NAME];if(typeof r=="string"&&t.updateName(r),ue()===er()){mt&&g.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[Co],s=e[xi];typeof o=="string"&&typeof s=="string"&&ue().setTransactionName(`${s} ${o}`)}var XK=w(QK,()=>new QE({responseHook:t=>{mye(t)}})),hye=()=>({name:QK,setupOnce(){XK()}}),JK=hye;var l2=K(u2(),1);le();var p2="Koa",d2=w(p2,l2.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Re(e,"auto.http.otel.koa");let r=Y(e).data,o=r["koa.type"];o&&e.setAttribute(ee,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),ue()===er()){mt&&g.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[Co],a=n.context?.request?.method?.toUpperCase()||"GET";i&&ue().setTransactionName(`${a} ${i}`)}})),Oye=(t={})=>({name:p2,setupOnce(){d2(t)}}),_2=Oye;var R2=K(A2(),1);var y2="Connect",I2=w(y2,()=>new R2.ConnectInstrumentation),Uye=()=>({name:y2,setupOnce(){I2()}}),O2=Uye;var U2=K(D2(),1);var jye=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),w2="Tedious",k2=w(w2,()=>new U2.TediousInstrumentation({})),Hye=()=>{let t;return{name:w2,setupOnce(){let e=k2();t=Ip(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=Y(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";jye.has(s)&&n.setAttribute(W,"auto.db.otel.tedious")}))}}},G2=Hye;var V2=K(F2(),1);var q2="GenericPool",$2=w(q2,()=>new V2.GenericPoolInstrumentation({})),Vye=()=>{let t;return{name:q2,setupOnce(){let e=$2();t=Ip(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=Y(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(W,"auto.db.otel.generic_pool")}))}}},Y2=Vye;var n4=K(t4(),1);var r4="Amqplib",eIe={consumeEndHook:t=>{Re(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Re(t,"auto.amqplib.otel.publisher")}},o4=w(r4,()=>new n4.AmqplibInstrumentation(eIe)),tIe=()=>({name:r4,setupOnce(){o4()}}),s4=tIe;var Vd="VercelAI";var fS=K(ne(),1);var nIe=[">=3.0.0 <7"],i4=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];function rIe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function oIe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;Array.isArray(e.content)&&(sIe(e.content),iIe(e.content))}function sIe(t){for(let e of t){if(!rIe(e))continue;let n=Zy(e.toolCallId);n?Gn(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),te(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):Gn(r=>{r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),te(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function iIe(t){for(let e of t)typeof e=="object"&&e!==null&&"toolCallId"in e&&typeof e.toolCallId=="string"&&eI(e.toolCallId)}function aIe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var _S=class t extends fS.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",pe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new fS.InstrumentationNodeModuleDefinition("ai",nIe,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},c=a.isEnabled,l=H(),p=l?.getIntegrationByName(Vd),d=p?.options,_=p?!!l?.getOptions().sendDefaultPii:!1,{recordInputs:f,recordOutputs:m}=aIe(d,a,c,_);return i[0].experimental_telemetry={...a,isEnabled:c!==void 0?c:!0,recordInputs:f,recordOutputs:m},Mr(()=>Reflect.apply(o,s,i),h=>{h&&typeof h=="object"&&nt(h,"_sentry_active_span",nr())},()=>{},h=>{oIe(h)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of i4)e[r]!=null&&(e[r]=n(e[r]));return e}else{let r=i4.reduce((o,s)=>(e[s]!=null&&(o[s]=n(e[s])),o),{});return{...e,...r}}}};var a4=w(Vd,()=>new _S({}));function cIe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var uIe=(t={})=>{let e;return{name:Vd,options:t,setupOnce(){e=a4()},afterAllSetup(n){t.force??cIe(n)?Nm(n):e?.callWhenPatched(()=>Nm(n))}}},c4=uIe;var hS=K(ne(),1);var lIe=[">=4.0.0 <7"],mS=class extends hS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",pe,e)}init(){return new hS.InstrumentationNodeModuleDefinition("openai",lIe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(zi(ws))return Reflect.construct(r,i);let a=Reflect.construct(r,i);return Cm(a,o)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}};var u4=w(ws,t=>new mS(t)),pIe=(t={})=>({name:ws,setupOnce(){u4(t)}}),l4=pIe;var ES=K(ne(),1);var dIe=[">=0.19.2 <1.0.0"],TS=class extends ES.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",pe,e)}init(){return new ES.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",dIe,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(zi(ks))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return Pm(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}};var p4=w(ks,t=>new TS(t)),_Ie=(t={})=>({name:ks,options:t,setupOnce(){p4(t)}}),d4=_Ie;var sl=K(ne(),1);var _4=[">=0.10.0 <2"],SS=class extends sl.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",pe,e)}init(){return new sl.InstrumentationNodeModuleDefinition("@google/genai",_4,n=>this._patch(n),n=>n,[new sl.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",_4,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(zi(Gs))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return Mm(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return Rp(e,"GoogleGenAI",o),e}};var f4=w(Gs,t=>new SS(t)),fIe=(t={})=>({name:Gs,setupOnce(){f4(t)}}),m4=fIe;var _i=K(ne(),1);var gS=[">=0.1.0 <2.0.0"];function mIe(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function hIe(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let c=a.callbacks,l=mIe(c,e);return a.callbacks=l,Reflect.apply(r,o,s)}})}var AS=class extends _i.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",pe,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new _i.InstrumentationNodeModuleDefinition(r,gS,this._patch.bind(this),o=>o,[new _i.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,gS,this._patch.bind(this),o=>o)]));return e.push(new _i.InstrumentationNodeModuleDefinition("langchain",gS,this._patch.bind(this),r=>r,[new _i.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",gS,this._patch.bind(this),r=>r)])),e}_patch(e){Ry([ws,ks,Gs]);let n=vm(this.getConfig());return this._patchRunnableMethods(e,n),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(c=>typeof c=="function"&&r.includes(c.name));if(!s)return;let i=s.prototype;if(i.__sentry_patched__)return;i.__sentry_patched__=!0;let a=["invoke","stream","batch"];for(let c of a){let l=i[c];typeof l=="function"&&(i[c]=hIe(l,n))}}};var h4=w(xm,t=>new AS(t)),TIe=(t={})=>({name:xm,setupOnce(){h4(t)}}),T4=TIe;var il=K(ne(),1);var E4=[">=0.0.0 <2.0.0"],RS=class extends il.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",pe,e)}init(){return new il.InstrumentationNodeModuleDefinition("@langchain/langgraph",E4,this._patch.bind(this),n=>n,[new il.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",E4,this._patch.bind(this),n=>n)])}_patch(e){return e.StateGraph&&typeof e.StateGraph=="function"&&Dm(e.StateGraph.prototype,this.getConfig()),e}};var S4=w(Lm,t=>new RS(t)),EIe=(t={})=>({name:Lm,setupOnce(){S4(t)}}),g4=EIe;var C4=K(ne(),1);b();var Xo=K(ne(),1);le();import*as R4 from"node:net";function y4(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=p=>{(0,Xo.safeExecuteInTheMiddle)(()=>a(p),d=>{d&&wn.error(d?.message)},!0)});let c=new Xo.InstrumentationNodeModuleDefinition("@firebase/firestore",e,p=>A4(p,n,r,t,i)),l=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let p of l)c.files.push(new Xo.InstrumentationNodeModuleFile(p,e,d=>A4(d,n,r,t,i),d=>I4(d,r)));return c}function A4(t,e,n,r,o){return I4(t,n),e(t,"addDoc",SIe(r,o)),e(t,"getDocs",AIe(r,o)),e(t,"setDoc",RIe(r,o)),e(t,"deleteDoc",gIe(r,o)),t}function I4(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Xo.isWrapped)(t[n])&&e(t,n);return t}function SIe(t,e){return function(r){return function(o,s){let i=IS(t,"addDoc",o);return e(i),yS(i,()=>r(o,s))}}}function gIe(t,e){return function(r){return function(o){let s=IS(t,"deleteDoc",o.parent||o);return e(s),yS(s,()=>r(o))}}}function AIe(t,e){return function(r){return function(o){let s=IS(t,"getDocs",o);return e(s),yS(s,()=>r(o))}}}function RIe(t,e){return function(r){return function(o,s,i){let a=IS(t,"setDoc",o.parent||o);return e(a),yS(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function yS(t,e){return P.with(X.setSpan(P.active(),t),()=>(0,Xo.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function IS(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Ne.CLIENT});return IIe(r,n),r.setAttribute(ec,e),r}function yIe(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(R4.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function IIe(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[uA]:e.path,[lA]:n.name,[Mi]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:c}=yIe(s);a&&(i[EA]=a),c&&(i[SA]=c),t.setAttributes(i)}b();var Jo=K(ne(),1);function O4(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,c=o.functions?.requestHook,l=o.functions?.responseHook;typeof l=="function"&&(i=(_,f)=>{(0,Jo.safeExecuteInTheMiddle)(()=>l(_,f),m=>{m&&wn.error(m?.message)},!0)}),typeof c=="function"&&(s=_=>{(0,Jo.safeExecuteInTheMiddle)(()=>c(_),f=>{f&&wn.error(f?.message)},!0)});let p=new Jo.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:_,triggerType:f})=>{p.files.push(new Jo.InstrumentationNodeModuleFile(_,e,m=>OIe(m,n,r,t,{requestHook:s,responseHook:i,errorHook:a},f),m=>N4(m,r)))}),p}function Sn(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let c=async function(...l){let p=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",d=t.startSpan(`firebase.function.${n}`,{kind:Ne.SERVER}),_={"faas.name":p,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(_["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(_["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),d.setAttributes(_),e?.requestHook?.(d),P.with(X.setSpan(P.active(),d),async()=>{let f,m;try{m=await i.apply(this,l)}catch(h){f=h}if(e?.responseHook?.(d,f),f&&d.recordException(f),d.end(),f)throw await e?.errorHook?.(d,f),f;return m})};return a?o.call(this,a,c):o.call(this,c)}}}function OIe(t,e,n,r,o,s){switch(N4(t,n),s){case"function":e(t,"onRequest",Sn(r,o,"http.request")),e(t,"onCall",Sn(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",Sn(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",Sn(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",Sn(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",Sn(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",Sn(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",Sn(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",Sn(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",Sn(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",Sn(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",Sn(r,o,"storage.object.finalized")),e(t,"onObjectArchived",Sn(r,o,"storage.object.archived")),e(t,"onObjectDeleted",Sn(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",Sn(r,o,"storage.object.metadataUpdated"));break}return t}function N4(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Jo.isWrapped)(t[r])&&e(t,r);return t}var b4={},NIe=[">=3.0.0 <5"],bIe=[">=6.0.0 <7"],OS=class extends C4.InstrumentationBase{constructor(e=b4){super("@sentry/instrumentation-firebase",pe,e)}setConfig(e={}){super.setConfig({...b4,...e})}init(){let e=[];return e.push(y4(this.tracer,NIe,this._wrap,this._unwrap,this.getConfig())),e.push(O4(this.tracer,bIe,this._wrap,this._unwrap,this.getConfig())),e}};var P4="Firebase",CIe={firestoreSpanCreationHook:t=>{Re(t,"auto.firebase.otel.firestore"),t.setAttribute(ee,"db.query")},functions:{requestHook:t=>{Re(t,"auto.firebase.otel.functions"),t.setAttribute(ee,"http.request")},errorHook:async(t,e)=>{e&&(te(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await nm(2e3))}}},M4=w(P4,()=>new OS(CIe)),PIe=()=>({name:P4,setupOnce(){M4()}}),x4=PIe;function v4(){return[Iq(),Z$(),OY(),JK(),uW(),yW(),DW(),$W(),Az(),Hz(),wK(),KK(),_2(),O2(),G2(),Y2(),HY(),s4(),XY(),T4(),g4(),c4(),l4(),d4(),m4(),qz(),x4()]}b();var NS=K(DI(),1),L4=K(iO(),1);le();var Xb=1e6;function D4(t,e={}){t.getOptions().debug&&RO();let[n,r]=MIe(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function MIe(t,e={}){let n=new L4.BasicTracerProvider({sampler:new Gh(t),resource:(0,NS.defaultResource)().merge((0,NS.resourceFromAttributes)({[gA]:"node",[cA]:"sentry",[AA]:pe})),forceFlushTimeoutMillis:500,spanProcessors:[new kh({timeout:xIe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});X.setGlobalTracerProvider(n),Ar.setGlobalPropagator(new wh);let r=new AO;return P.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function xIe(t){if(t!=null){if(t>Xb)return mt&&g.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${Xb}`),Xb;if(t<=0||Number.isNaN(t)){mt&&g.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}function U4(){return Yh().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(nq(),lq())}function w4(t){return[...U4(),...Xe(t)?v4():[]]}function Jb(t={}){return vIe(t,w4)}function vIe(t={},e){Ki(t,"node");let n=xO({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(D4(n,{spanProcessors:t.openTelemetrySpanProcessors}),vO()),n}var LIe="prod",G4="0.1.10",DIe=`@tanagram/lore/${G4}`;function xt(){return LIe}function bS(){return G4}function B4(){return DIe}Jb({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:xt(),release:bS(),sendDefaultPii:!0});tm("service_name","lore-cli");import{pathToFileURL as fxe}from"node:url";var UIe=/\d/,wIe=["-","_","/","."];function kIe(t=""){if(!UIe.test(t))return t!==t.toLowerCase()}function j4(t,e){let n=e??wIe,r=[];if(!t||typeof t!="string")return r;let o="",s,i;for(let a of t){let c=n.includes(a);if(c===!0){r.push(o),o="",s=void 0;continue}let l=kIe(a);if(i===!1){if(s===!1&&l===!0){r.push(o),o=a,s=l;continue}if(s===!0&&l===!1&&o.length>1){let p=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=p+a,s=l;continue}}o+=a,s=l,i=c}return r.push(o),r}function GIe(t){return t?t[0].toUpperCase()+t.slice(1):""}function BIe(t){return t?t[0].toLowerCase()+t.slice(1):""}function jIe(t,e){return t?(Array.isArray(t)?t:j4(t)).map(n=>GIe(e?.normalize?n.toLowerCase():n)).join(""):""}function qd(t,e){return BIe(jIe(t||"",e))}function CS(t,e){return t?(Array.isArray(t)?t:j4(t)).map(n=>n.toLowerCase()).join(e??"-"):""}function H4(t){return CS(t||"","_")}import{parseArgs as HIe}from"node:util";function LS(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function Zb(t,e=""){let n=[];for(let r of t)for(let[o,s]of r.entries())n[o]=Math.max(n[o]||0,s.length);return t.map(r=>r.map((o,s)=>e+o[s===0?"padStart":"padEnd"](n[s])).join(" ")).join(`
39
+ `)}function Kn(t){return typeof t=="function"?t():t}var Ia=class extends Error{code;constructor(t,e){super(t),this.name="CLIError",this.code=e}};function FIe(t=[],e={}){let n=new Set(e.boolean||[]),r=new Set(e.string||[]),o=e.alias||{},s=e.default||{},i=new Map,a=new Map;for(let[T,S]of Object.entries(o)){let R=S;for(let I of R)i.set(T,I),a.has(I)||a.set(I,[]),a.get(I).push(T),i.set(I,T),a.has(T)||a.set(T,[]),a.get(T).push(I)}let c={};function l(T){if(n.has(T))return"boolean";let S=a.get(T)||[];for(let R of S)if(n.has(R))return"boolean";return"string"}function p(T){if(r.has(T))return!0;let S=a.get(T)||[];for(let R of S)if(r.has(R))return!0;return!1}let d=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(s)]);for(let T of d)c[T]||(c[T]={type:l(T),default:s[T]});for(let[T,S]of i.entries())T.length===1&&c[S]&&!c[S].short&&(c[S].short=T);let _=[],f={};for(let T=0;T<t.length;T++){let S=t[T];if(S==="--"){_.push(...t.slice(T));break}if(S.startsWith("--no-")){let R=S.slice(5);f[R]=!0;continue}_.push(S)}let m;try{m=HIe({args:_,options:Object.keys(c).length>0?c:void 0,allowPositionals:!0,strict:!1})}catch{m={values:{},positionals:_}}let h={_:[]};h._=m.positionals;for(let[T,S]of Object.entries(m.values)){let R=S;l(T)==="boolean"&&typeof S=="string"?R=S!=="false":p(T)&&typeof S=="boolean"&&(R=""),h[T]=R}for(let[T]of Object.entries(f)){h[T]=!1;let S=i.get(T);S&&(h[S]=!1);let R=a.get(T);if(R)for(let I of R)h[I]=!1}for(let[T,S]of i.entries())h[T]!==void 0&&h[S]===void 0&&(h[S]=h[T]),h[S]!==void 0&&h[T]===void 0&&(h[T]=h[S]),h[T]!==h[S]&&s[S]===h[S]&&(h[S]=h[T]);return h}var VIe=(()=>{let t=globalThis.process?.env??{};return t.NO_COLOR==="1"||t.TERM==="dumb"||t.TEST||t.CI})(),DS=(t,e=39)=>n=>VIe?n:`\x1B[${t}m${n}\x1B[${e}m`,PS=DS(1,22),Gr=DS(36),xS=DS(90),MS=DS(4,24);function qIe(t,e){let n={boolean:[],string:[],alias:{},default:{}},r=q4(e);for(let a of r){if(a.type==="positional")continue;a.type==="string"||a.type==="enum"?n.string.push(a.name):a.type==="boolean"&&n.boolean.push(a.name),a.default!==void 0&&(n.default[a.name]=a.default),a.alias&&(n.alias[a.name]=a.alias);let c=qd(a.name),l=CS(a.name);if(c!==a.name||l!==a.name){let p=LS(n.alias[a.name]||[]);c!==a.name&&!p.includes(c)&&p.push(c),l!==a.name&&!p.includes(l)&&p.push(l),p.length>0&&(n.alias[a.name]=p)}}let o=FIe(t,n),[...s]=o._,i=new Proxy(o,{get(a,c){return a[c]??a[qd(c)]??a[CS(c)]}});for(let[,a]of r.entries())if(a.type==="positional"){let c=s.shift();if(c!==void 0)i[a.name]=c;else{if(a.default===void 0&&a.required!==!1)throw new Ia(`Missing required positional argument: ${a.name.toUpperCase()}`,"EARG");i[a.name]=a.default}}else if(a.type==="enum"){let c=i[a.name],l=a.options||[];if(c!==void 0&&l.length>0&&!l.includes(c))throw new Ia(`Invalid value for argument: ${Gr(`--${a.name}`)} (${Gr(c)}). Expected one of: ${l.map(p=>Gr(p)).join(", ")}.`,"EARG")}else if(a.required&&i[a.name]===void 0)throw new Ia(`Missing required argument: --${a.name}`,"EARG");return i}function q4(t){let e=[];for(let[n,r]of Object.entries(t||{}))e.push({...r,name:n,alias:LS(r.alias)});return e}async function $Ie(t){return Promise.all(t.map(e=>Kn(e)))}async function vS(t,e){let n=await Kn(t.args||{}),r=qIe(e.rawArgs,n),o={rawArgs:e.rawArgs,args:r,data:e.data,cmd:t},s=await $Ie(t.plugins??[]),i,a;try{for(let p of s)await p.setup?.(o);typeof t.setup=="function"&&await t.setup(o);let l=await Kn(t.subCommands);if(l&&Object.keys(l).length>0){let p=YIe(e.rawArgs,n),d=e.rawArgs[p];if(d){let _=await F4(l,d);if(!_)throw new Ia(`Unknown command ${Gr(d)}`,"E_UNKNOWN_COMMAND");await vS(_,{rawArgs:e.rawArgs.slice(p+1)})}else{let _=await Kn(t.default);if(_){if(t.run)throw new Ia("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let f=await F4(l,_);if(!f)throw new Ia(`Default sub command ${Gr(_)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await vS(f,{rawArgs:e.rawArgs})}else if(!t.run)throw new Ia("No command specified.","E_NO_COMMAND")}}typeof t.run=="function"&&(i=await t.run(o))}catch(l){a=l}let c=[];if(typeof t.cleanup=="function")try{await t.cleanup(o)}catch(l){c.push(l)}for(let l of[...s].reverse())try{await l.cleanup?.(o)}catch(p){c.push(p)}if(a)throw a;if(c.length===1)throw c[0];if(c.length>1)throw new Error("Multiple cleanup errors",{cause:c});return{result:i}}async function F4(t,e){if(e in t)return Kn(t[e]);for(let n of Object.values(t)){let r=await Kn(n),o=await Kn(r?.meta);if(o?.alias&&LS(o.alias).includes(e))return r}}function YIe(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&WIe(r,e)&&n++;continue}return n}return-1}function WIe(t,e){let n=t.replace(/^-{1,2}/,""),r=qd(n);for(let[o,s]of Object.entries(e))if(!(s.type!=="string"&&s.type!=="enum")&&(r===qd(o)||(Array.isArray(s.alias)?s.alias:s.alias?[s.alias]:[]).includes(n)))return!0;return!1}var zIe=/^no[-A-Z]/;async function $4(t,e){let n=await Kn(t.meta||{}),r=q4(await Kn(t.args||{})),o=await Kn(e?.meta||{}),s=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),i=[],a=[],c=[],l=[];for(let f of r)if(f.type==="positional"){let m=f.name.toUpperCase(),h=f.required!==!1&&f.default===void 0;a.push([Gr(m+eC(f)),V4(f,h)]),l.push(h?`<${m}>`:`[${m}]`)}else{let m=f.required===!0&&f.default===void 0,h=[...(f.alias||[]).map(T=>`-${T}`),`--${f.name}`].join(", ")+eC(f);if(i.push([Gr(h),V4(f,m)]),f.type==="boolean"&&(f.default===!0||f.negativeDescription)&&!zIe.test(f.name)){let T=[...(f.alias||[]).map(S=>`--no-${S}`),`--no-${f.name}`].join(", ");i.push([Gr(T),[f.negativeDescription,m?xS("(Required)"):""].filter(Boolean).join(" ")])}m&&l.push(`--${f.name}`+eC(f))}if(t.subCommands){let f=[],m=await Kn(t.subCommands);for(let[h,T]of Object.entries(m)){let S=await Kn((await Kn(T))?.meta);if(S?.hidden)continue;let R=LS(S?.alias),I=[h,...R].join(", ");c.push([Gr(I),S?.description||""]),f.push(h,...R)}l.push(f.join("|"))}let p=[],d=n.version||o.version;p.push(xS(`${n.description} (${s+(d?` v${d}`:"")})`),"");let _=i.length>0||a.length>0;return p.push(`${MS(PS("USAGE"))} ${Gr(`${s}${_?" [OPTIONS]":""} ${l.join(" ")}`)}`,""),a.length>0&&(p.push(MS(PS("ARGUMENTS")),""),p.push(Zb(a," ")),p.push("")),i.length>0&&(p.push(MS(PS("OPTIONS")),""),p.push(Zb(i," ")),p.push("")),c.length>0&&(p.push(MS(PS("COMMANDS")),""),p.push(Zb(c," ")),p.push("",`Use ${Gr(`${s} <command> --help`)} for more information about a command.`)),p.filter(f=>typeof f=="string").join(`
40
+ `)}function eC(t){let e=t.valueHint?`=<${t.valueHint}>`:"",n=e||`=<${H4(t.name)}>`;return!t.type||t.type==="positional"||t.type==="boolean"?e:t.type==="enum"&&t.options?.length?`=<${t.options.join("|")}>`:n}function V4(t,e){let n=e?xS("(Required)"):"",r=t.default===void 0?"":xS(`(Default: ${t.default})`);return[t.description,n,r].filter(Boolean).join(" ")}import{execFile as mOe}from"node:child_process";import tn from"node:fs/promises";import hOe from"node:os";import So from"node:path";import{promisify as TOe}from"node:util";import Y4 from"node:os";import Oa from"node:path";function Zo(){let t=xt()==="dev"?".lore-dev":".lore";return Oa.join(Y4.homedir(),t)}function US(){return Oa.join(Zo(),"log.txt")}function tC(){return Oa.join(Zo(),"sync_state.json")}function wS(){return Oa.join(Zo(),"status.json")}function $d(){return Oa.join(Zo(),"install_source.json")}function Yd(){return Oa.join(Zo(),"bin","lore")}function Wd(){let t=xt();return t==="prod"?"ai.tanagram.lore":`ai.tanagram.lore.${t}`}function zd(){return Oa.join(Y4.homedir(),"Library","LaunchAgents",`${Wd()}.plist`)}import al from"node:fs/promises";import GS from"node:os";import en from"node:path";function fi(t,e){return t!==null&&typeof t=="object"&&"code"in t&&t.code===e}import z4 from"node:fs";var W4=null;function KIe(){let t=Zo();W4!==t&&(z4.mkdirSync(t,{recursive:!0}),W4=t)}function QIe(t){let e=typeof t=="string"?t:JSON.stringify(t);return/[\s"=]/.test(e)?JSON.stringify(e):e}function XIe(t,e,n){let r=`${new Date().toISOString()} ${t} ${e}`;if(!n)return`${r}
41
+ `;let o=Object.entries(n).map(([s,i])=>`${s}=${QIe(i)}`).join(" ");return o?`${r} ${o}
41
42
  `:`${r}
42
- `}function zb(t,e,n){let r=RCe(t,e,n);gCe(),a3.appendFileSync(LS(),r),jt()==="dev"&&process.stderr.write(r)}var tn={info(t,e){zb("info",t,e)},warn(t,e){zb("warn",t,e)},error(t,e){zb("error",t,e)}};var c3={meta:{name:"health",description:"Check API health"},async run({data:t}){tn.info("command_start",{command:"health"});let n=await(t?.client??ul()).health();if(n.status===200){console.log(n.body.status);return}throw tn.error("health_failed",{status:n.status}),console.error(`health check failed: HTTP ${n.status}`),new Error(`health check failed: HTTP ${n.status}`)}};var u3={meta:{name:"hello",description:"Print a friendly greeting"},run(){tn.info("command_start",{command:"hello"}),console.log("hello world")}};import{spawn as ICe}from"node:child_process";import d3 from"node:crypto";import NCe from"node:http";var yCe={dev:"http://localhost:8080",prod:"https://lore.tanagram.ai"};function l3(){return yCe[jt()]}var OCe=5*60*1e3;function bCe(){return d3.randomBytes(32).toString("base64url")}function CCe(t){return d3.createHash("sha256").update(t).digest("base64url")}function PCe(t){let e;try{e=JSON.parse(Buffer.from(t.trim(),"base64url").toString("utf8"))}catch(n){throw new Error(`decoding: ${n instanceof Error?n.message:String(n)}`)}if(typeof e.session_jwt!="string"||!e.session_jwt)throw new Error("missing session token");if(typeof e.code_challenge!="string"||!e.code_challenge)throw new Error("missing code challenge");return{sessionJwt:e.session_jwt,codeChallenge:e.code_challenge}}function MCe(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function p3(t,e,n){let r=e==="success";t.writeHead(200,{"Content-Type":"text/html"}),t.end(`<!DOCTYPE html>
43
+ `}function nC(t,e,n){let r=XIe(t,e,n);KIe(),z4.appendFileSync(US(),r),xt()==="dev"&&process.stderr.write(r)}var pt={info(t,e){nC("info",t,e)},warn(t,e){nC("warn",t,e)},error(t,e){nC("error",t,e)}};import JIe from"node:crypto";import Kd from"node:fs/promises";import ZIe from"node:os";import kS from"node:path";async function es(t){try{let e=await Kd.stat(t);return{exists:!0,size:e.size,modTimeUnixMs:e.mtime.getTime()}}catch(e){if(fi(e,"ENOENT"))return{exists:!1,size:0,modTimeUnixMs:0};throw e}}function rC(t,e){return t.exists!==e.exists?!0:t.exists?t.size!==e.size||t.modTimeUnixMs!==e.modTimeUnixMs:!1}async function oC(t){let e=await Kd.mkdtemp(kS.join(ZIe.tmpdir(),"lore-upload-")),n=kS.join(e,kS.basename(t));await Kd.copyFile(t,n);let r=await Kd.readFile(n);return{tempPath:n,md5:JIe.createHash("md5").update(r).digest("hex")}}async function K4(t){await Kd.rm(kS.dirname(t),{recursive:!0,force:!0})}import Q4 from"node:fs/promises";import Qd from"node:path";async function X4(t){let e=t.trim();if(!e)return null;for(;;){let n=Qd.join(e,".git","config");try{return await Q4.stat(n),n}catch{let r=Qd.dirname(e);if(r===e)return null;e=r}}}async function J4(t){let e=await X4(t);return e?Qd.dirname(Qd.dirname(e)):null}async function Z4(t){let e=await X4(Qd.resolve(t.trim()));if(!e)return"";let n;try{n=await Q4.readFile(e,"utf8")}catch{return""}let r=eOe(n),o=tOe(r);return o?`${o.owner}/${o.name}`:""}function eOe(t){let e=!1;for(let n of t.split(`
44
+ `)){let r=n.trim();if(!r||r.startsWith("#")||r.startsWith(";"))continue;if(r.startsWith("[")&&r.endsWith("]")){e=r==='[remote "origin"]';continue}if(!e)continue;let o=r.indexOf("=");if(!(o<0)&&r.slice(0,o).trim()==="url")return r.slice(o+1).trim()}return""}function tOe(t){let e=t.trim();if(!e)return null;let n="",r=/^(?:ssh:\/\/)?git@[^/:]+[:/](.+)$/.exec(e);if(r)n=r[1]??"";else try{n=new URL(e).pathname.replace(/^\/+/,"")}catch{n=e}n=n.replace(/\.git$/,"").replace(/^\/+|\/+$/g,"");let o=n.split("/").filter(Boolean);if(o.length<2)return null;let[s,i]=o.slice(-2);return!s||!i?null:{owner:s,name:i}}var nOe=60*60*1e3,iC=Symbol("missingSessionID"),n3={name:"claudeCode",historyFilePath:Xd,readUnuploadedEntries:r3,collectLocalFiles:oOe,buildPendingTranscriptWatches:sOe};function Xd(){return en.join(GS.homedir(),".claude","history.jsonl")}async function r3(t){let e=Xd(),n;try{n=await al.readFile(e,"utf8")}catch(r){if(fi(r,"ENOENT"))return[];throw r}return rOe(n,t)}function rOe(t,e,n=Xd()){let r=[],o=t.split(`
45
+ `);for(let i=0;i<o.length;i+=1){let a=o[i]?.trim();if(!a)continue;let c;try{c=JSON.parse(a)}catch(l){e3({historyPath:n,lineNumber:i+1,line:a,reason:"unparseable_json",error:l});continue}if(!dOe(c)){e3({historyPath:n,lineNumber:i+1,line:a,reason:"invalid_history_entry"});continue}r.push(c)}let s=r.findIndex(i=>i.timestamp>=e);return s>=0?r.slice(s):[]}function e3({historyPath:t,lineNumber:e,line:n,reason:r,error:o}){pt.warn("claude_history_entry_skipped",{history_path:t,line_number:e,history_line:n,reason:r,...o?{error:o instanceof Error?o.message:String(o)}:{}})}async function oOe(t){let e=[],n=new Array(t.length),r=new Set,o=new Set,s=[];try{for(let i=0;i<t.length;i+=1){let a=t[i],c=await o3(a);if(c===iC){let m=`__missing_session__:${a.project}:${a.timestamp}:${i}`;n[i]=m,r.add(m),o.add(m);continue}if(n[i]=c.key,o.has(c.key))continue;let l=await es(c.fullPath),p;try{p=await oC(c.fullPath)}catch(m){if(fi(m,"ENOENT")){r.add(c.key),o.add(c.key);continue}throw new Error(`read session transcript ${c.fullPath}: ${String(m)}`)}s.push(p.tempPath);let d=await Z4(a.project);e.push({key:c.key,filename:c.relativeFilename,sourcePath:c.fullPath,repoOriginPath:d,tempPath:p.tempPath,md5:p.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:a.sessionId?.trim()??"",watchedState:l}),o.add(c.key);let _=await al.readFile(p.tempPath,"utf8"),f=lOe(_);for(let m of f){let h;try{h=await pOe(m)}catch{continue}let T=`${c.key}::plan:${h}`;if(o.has(T))continue;let S=await es(h),R;try{R=await oC(h)}catch(I){if(fi(I,"ENOENT"))continue;throw new Error(`read plan file ${h}: ${String(I)}`)}s.push(R.tempPath),e.push({key:T,filename:h,sourcePath:h,repoOriginPath:d,tempPath:R.tempPath,md5:R.md5,fileType:"plan",harness:"claudeCode",harnessInternalId:h,watchedState:S}),o.add(T)}}}catch(i){throw await Promise.all(s.map(a=>al.rm(en.dirname(a),{recursive:!0,force:!0}))),i}return{entries:t,localFiles:e,entryFileKeys:n,skippedFileKeys:r}}async function sOe(t,e){let n=await r3(t),r=Date.now(),o=[],s=new Set;for(let i of n){let a=await o3(i);if(a===iC||s.has(a.fullPath))continue;let c=await es(a.fullPath);c.exists&&(o.push({sessionId:i.sessionId?.trim()??"",project:i.project,transcriptPath:a.fullPath,expiresAt:new Date(r+nOe),baseline:e.get(a.fullPath)??c}),s.add(a.fullPath))}return o.sort((i,a)=>i.transcriptPath.localeCompare(a.transcriptPath))}async function o3(t){let e=t.sessionId?.trim();if(!e)return iC;let n=cOe(),r=await iOe(t.project),o=null;for(let s of r){let i=aOe(s),a=en.posix.join(i,`${e}.jsonl`),c=en.join(n,...a.split("/")),l={fullPath:c,relativeFilename:a,key:a};o??=l;try{return await al.stat(c),l}catch(p){if(!fi(p,"ENOENT"))throw new Error(`stat session transcript ${c}: ${String(p)}`)}}if(!o)throw new Error("history entry is missing project path");return o}async function iOe(t){let e=en.normalize(t.trim());if(!e||e===".")throw new Error("history entry is missing project path");let n=[e],r=await J4(e);if(!r||r===e)return n;for(let o=en.dirname(e);o!==e&&(n.push(o),o!==r);)e=o,o=en.dirname(o);return n}function aOe(t){let e=en.normalize(t.trim());if(!e||e===".")throw new Error("history entry is missing project path");return e.split(en.sep).join("-")}function cOe(){return en.join(GS.homedir(),".claude","projects")}function uOe(){return en.join(GS.homedir(),".claude","plans")}function lOe(t){let e=[],n=new Set;for(let r of t.split(`
46
+ `)){let o=r.trim();if(!o)continue;let s;try{s=JSON.parse(o)}catch{break}if(s.type!=="assistant")continue;let i=s.message?.content;if(Array.isArray(i))for(let a of i){if(!sC(a)||a.type!=="tool_use"||a.name!=="ExitPlanMode"||!sC(a.input))continue;let c=a.input.planFilePath;if(typeof c!="string")continue;let l=c.trim();!l||n.has(l)||(e.push(l),n.add(l))}}return e}async function pOe(t){let e=t.trim();if(!e)throw new Error("plan file path is empty");let n=uOe(),r=n;try{r=await al.realpath(n)}catch{}if(e.startsWith("~/")&&(e=en.join(GS.homedir(),e.slice(2))),!en.isAbsolute(e))throw new Error(`plan file path must stay under ${n}`);if(e=en.normalize(e),!t3(e,n))throw new Error(`plan file path must stay under ${n}`);try{let o=await al.realpath(e);if(!t3(o,r))throw new Error(`plan file path must resolve under ${n}`)}catch(o){if(!fi(o,"ENOENT"))throw o}return e}function t3(t,e){let n=en.relative(e,t);return n===""||n!==".."&&!n.startsWith(`..${en.sep}`)}function dOe(t){return sC(t)&&typeof t.timestamp=="number"&&typeof t.project=="string"}function sC(t){return t!==null&&typeof t=="object"}import BS from"node:fs/promises";import _Oe from"node:path";var jS=class{status={};async markRunning(){let e=new Date().toISOString();this.status={pid:process.pid,state:"running",started_at:e,last_heartbeat_at:e},await this.persist()}async heartbeat(){this.status.pid=process.pid,this.status.last_heartbeat_at=new Date().toISOString(),await this.persist()}async markAuthenticated(){this.status.auth="logged_in",await this.heartbeat()}async markSyncSuccess(e){let n=new Date().toISOString();this.status.pid=process.pid,this.status.auth="logged_in",this.status.last_heartbeat_at=n,this.status.last_completed_at=n,this.status.last_success_at=n,this.status.last_error=void 0,this.status.last_thread_ids=[...e],await this.persist()}async setPendingWatchers(e){this.status.pid=process.pid,this.status.state="running",this.status.pending_watchers=e.map(n=>({session_id:n.sessionId||void 0,project:n.project||void 0,transcript_path:n.transcriptPath||void 0,expires_at:n.expiresAt.toISOString()})),await this.heartbeat()}async markLoggedOut(){let e=new Date().toISOString();this.status.pid=process.pid,this.status.state="logged_out",this.status.auth="logged_out",this.status.last_heartbeat_at=e,this.status.last_completed_at=e,this.status.last_error=void 0,this.status.last_thread_ids=void 0,this.status.pending_watchers=void 0,await this.persist()}async markSuccess(e){let n=new Date().toISOString();this.status.pid=process.pid,this.status.state="idle",this.status.auth="logged_in",this.status.last_heartbeat_at=n,this.status.last_completed_at=n,this.status.last_success_at=n,this.status.last_error=void 0,this.status.last_thread_ids=[...e],this.status.pending_watchers=void 0,await this.persist()}async markError(e){let n=new Date().toISOString();this.status.pid=process.pid,this.status.state="error",this.status.last_heartbeat_at=n,this.status.last_completed_at=n,this.status.last_error=e instanceof Error?e.message:String(e),this.status.pending_watchers=void 0,await this.persist()}async persist(){let e=wS();await BS.mkdir(_Oe.dirname(e),{recursive:!0,mode:448}),await BS.writeFile(e,`${JSON.stringify(fOe(this.status),null,2)}
47
+ `,{mode:384})}};async function s3(){try{return JSON.parse(await BS.readFile(wS(),"utf8"))}catch{return{}}}async function i3(){await BS.rm(wS(),{force:!0})}function fOe(t){return JSON.parse(JSON.stringify(t))}var EOe=TOe(mOe),SOe=2*60*1e3;async function cC(){lC();let t=await ROe(),e=await yOe(t);await bOe(t);let n=await AOe();return await u3(),await COe(n),await POe(),{plistPath:n,binaryPath:e}}async function a3(){lC(),await u3(),await tn.rm(zd(),{force:!0}),await tn.rm(Yd(),{force:!0}),await tn.rm($d(),{force:!0}),await i3()}async function c3(){lC();let t=zd(),e=Yd(),n=So.join(So.dirname($d()),"status.json"),r=$d(),o=await s3(),s=await l3(),i=await DOe(t),a=vOe(o,new Date),{health:c,healthy:l}=xOe(i,s,o,a);return{label:Wd(),enabled:i,loaded:s.loaded,running:s.running,healthy:l,health:c,heartbeat_fresh:a,plist_path:t,binary_path:e,status_path:n,install_source_path:r,...Object.keys(o).length>0?{status:o}:{}}}async function gOe(){let t=Yd(),e=Xd();return`<?xml version="1.0" encoding="UTF-8"?>
48
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
49
+ <plist version="1.0">
50
+ <dict>
51
+ <key>Label</key>
52
+ <string>${HS(Wd())}</string>
53
+ <key>ProgramArguments</key>
54
+ <array>
55
+ <string>${HS(t)}</string>
56
+ <string>_run_upload</string>
57
+ </array>
58
+ <key>RunAtLoad</key>
59
+ <true/>
60
+ <key>WatchPaths</key>
61
+ <array>
62
+ <string>${HS(e)}</string>
63
+ </array>
64
+ <key>ProcessType</key>
65
+ <string>Background</string>
66
+ <key>ThrottleInterval</key>
67
+ <integer>30</integer>
68
+ <key>EnvironmentVariables</key>
69
+ <dict>
70
+ <key>PATH</key>
71
+ <string>${HS(LOe())}</string>
72
+ </dict>
73
+ </dict>
74
+ </plist>
75
+ `}async function AOe(){let t=zd();return await tn.mkdir(So.dirname(t),{recursive:!0,mode:493}),await tn.writeFile(t,await gOe(),{mode:420}),t}async function ROe(){let t=process.argv[1];if(!t)throw new Error("resolve current executable: missing process argv[1]");return tn.realpath(t)}async function yOe(t){let e=Yd();await tn.mkdir(So.dirname(e),{recursive:!0,mode:448});let n=IOe(t);if(n.type==="write")return await tn.writeFile(e,n.contents,{mode:493}),await tn.chmod(e,493),e;if(await tn.realpath(e).catch(()=>"")!==t){let o=`${e}.tmp`;await tn.copyFile(t,o),await tn.chmod(o,493),await tn.rename(o,e)}return e}function IOe(t){return OOe(t)?{type:"write",contents:NOe(t)}:{type:"copy"}}function OOe(t){return t.endsWith(".ts")||t.endsWith(".tsx")}function NOe(t){let e=So.dirname(So.dirname(t)),n=So.join(e,"node_modules",".bin","tsx");return`#!/bin/sh
76
+ set -eu
77
+ cd ${aC(e)}
78
+ exec ${aC(n)} ${aC(t)} "$@"
79
+ `}function aC(t){return`'${t.replaceAll("'","'\\''")}'`}async function bOe(t){let e=$d();await tn.mkdir(So.dirname(e),{recursive:!0,mode:448}),await tn.writeFile(e,`${JSON.stringify({binary_path:t,updated_at:new Date().toISOString()},null,2)}
80
+ `,{mode:384})}async function u3(){try{await FS("bootout",uC(),zd())}catch(t){if(d3(t)||!(await l3().catch(()=>({loaded:!0}))).loaded)return;throw t}}async function COe(t){await FS("bootstrap",uC(),t)}async function POe(){await FS("kickstart","-k",p3())}async function l3(){try{let t=await FS("print",p3());return MOe(t)}catch(t){if(d3(t))return{loaded:!1,running:!1,pid:0,raw:""};throw t}}function MOe(t){let e={loaded:t.trim().length>0,running:!1,pid:0,raw:t},n;for(let r of t.split(`
81
+ `)){let o=r.trim();if(o.startsWith("state =")&&(n=o.slice(7).trim()==="running"),o.startsWith("pid =")){let s=Number.parseInt(o.slice(5).trim(),10);Number.isNaN(s)||(e.pid=s)}}return e.running=n??e.pid>0,e}async function FS(...t){try{let e=await EOe("launchctl",t);return`${e.stdout}${e.stderr}`.trim()}catch(e){if(UOe(e)){let n=`${e.stdout??""}${e.stderr??""}`.trim();throw new Error(n?`launchctl ${t.join(" ")}: ${e.message}: ${n}`:`launchctl ${t.join(" ")}: ${e.message}`)}throw e}}function xOe(t,e,n,r){return t?e.loaded?n.state==="logged_out"?{health:"logged_out",healthy:!1}:n.state==="error"?{health:"error",healthy:!1}:e.running?r?{health:"running",healthy:!0}:{health:"stale",healthy:!1}:n.last_heartbeat_at?{health:"healthy",healthy:!0}:{health:"waiting_for_first_run",healthy:!1}:{health:"not_loaded",healthy:!1}:{health:"disabled",healthy:!1}}function vOe(t,e){if(!t.last_heartbeat_at)return!1;let n=Date.parse(t.last_heartbeat_at);return Number.isNaN(n)?!1:n+SOe>=e.getTime()}function uC(){return`gui/${process.getuid?.()??hOe.userInfo().uid}`}function p3(){return`${uC()}/${Wd()}`}function LOe(){let t=["/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin"];return Array.from(new Set([...process.env.PATH?.split(So.delimiter)??[],...t].filter(Boolean))).join(So.delimiter)}async function DOe(t){try{return await tn.stat(t),!0}catch{return!1}}function HS(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function lC(){if(process.platform!=="darwin")throw new Error("Lore background uploads are currently supported only on macOS")}function d3(t){let e=t instanceof Error?t.message.toLowerCase():String(t).toLowerCase();return e.includes("could not find service")||e.includes("service could not be found")||e.includes("no such process")||e.includes("bad request")}function UOe(t){return t instanceof Error}var _3={meta:{name:"enable",description:"Install and start background uploads"},async run(){let{plistPath:t,binaryPath:e}=await cC();console.log("Lore background uploads enabled."),console.log(`LaunchAgent: ${t}`),console.log(`Stable binary: ${e}`)}},f3={meta:{name:"disable",description:"Stop and remove background uploads"},async run(){await a3(),console.log("Lore background uploads disabled.")}},m3={meta:{name:"restart",description:"Restart background uploads"},async run(){await cC(),console.log("Lore background uploads restarted.")}},h3={meta:{name:"status",description:"Show background upload status"},args:{json:{type:"boolean",description:"Output status as JSON"}},async run({args:t}){let e=await c3();if(t.json){console.log(JSON.stringify(e,null,2));return}console.log(`Lore: ${e.health}`),console.log(`Enabled: ${e.enabled}`),console.log(`Loaded: ${e.loaded}`),console.log(`Running: ${e.running}`),console.log(`Healthy: ${e.healthy}`),e.status?.last_heartbeat_at&&console.log(`Last heartbeat: ${e.status.last_heartbeat_at}`),e.status?.last_success_at&&console.log(`Last success: ${e.status.last_success_at}`),e.status?.last_error&&console.log(`Last error: ${e.status.last_error}`),console.log(`LaunchAgent: ${e.plist_path}`),console.log(`Stable binary: ${e.binary_path}`),console.log(`Status file: ${e.status_path}`)}};var u={};sg(u,{BRAND:()=>aNe,DIRTY:()=>Na,EMPTY_PATH:()=>BOe,INVALID:()=>Q,NEVER:()=>$Ne,OK:()=>nn,ParseStatus:()=>Ft,Schema:()=>ce,ZodAny:()=>Ti,ZodArray:()=>os,ZodBigInt:()=>Ca,ZodBoolean:()=>Pa,ZodBranded:()=>Zd,ZodCatch:()=>ja,ZodDate:()=>Ma,ZodDefault:()=>Ba,ZodDiscriminatedUnion:()=>$S,ZodEffects:()=>Sr,ZodEnum:()=>ka,ZodError:()=>vn,ZodFirstPartyTypeKind:()=>Z,ZodFunction:()=>WS,ZodIntersection:()=>Da,ZodIssueCode:()=>N,ZodLazy:()=>Ua,ZodLiteral:()=>wa,ZodMap:()=>_l,ZodNaN:()=>ml,ZodNativeEnum:()=>Ga,ZodNever:()=>Br,ZodNull:()=>va,ZodNullable:()=>Ro,ZodNumber:()=>ba,ZodObject:()=>Ln,ZodOptional:()=>Tr,ZodParsedType:()=>D,ZodPipeline:()=>e_,ZodPromise:()=>Ei,ZodReadonly:()=>Ha,ZodRecord:()=>YS,ZodSchema:()=>ce,ZodSet:()=>fl,ZodString:()=>hi,ZodSymbol:()=>pl,ZodTransformer:()=>Sr,ZodTuple:()=>Ao,ZodType:()=>ce,ZodUndefined:()=>xa,ZodUnion:()=>La,ZodUnknown:()=>rs,ZodVoid:()=>dl,addIssueToContext:()=>M,any:()=>hNe,array:()=>gNe,bigint:()=>pNe,boolean:()=>b3,coerce:()=>qNe,custom:()=>I3,date:()=>dNe,datetimeRegex:()=>R3,defaultErrorMap:()=>ts,discriminatedUnion:()=>INe,effect:()=>wNe,enum:()=>LNe,function:()=>MNe,getErrorMap:()=>cl,getParsedType:()=>go,instanceof:()=>uNe,intersection:()=>ONe,isAborted:()=>VS,isAsync:()=>ul,isDirty:()=>qS,isValid:()=>mi,late:()=>cNe,lazy:()=>xNe,literal:()=>vNe,makeIssue:()=>Jd,map:()=>CNe,nan:()=>lNe,nativeEnum:()=>DNe,never:()=>ENe,null:()=>mNe,nullable:()=>GNe,number:()=>N3,object:()=>ANe,objectUtil:()=>pC,oboolean:()=>VNe,onumber:()=>FNe,optional:()=>kNe,ostring:()=>HNe,pipeline:()=>jNe,preprocess:()=>BNe,promise:()=>UNe,quotelessJson:()=>wOe,record:()=>bNe,set:()=>PNe,setErrorMap:()=>GOe,strictObject:()=>RNe,string:()=>O3,symbol:()=>_Ne,transformer:()=>wNe,tuple:()=>NNe,undefined:()=>fNe,union:()=>yNe,unknown:()=>TNe,util:()=>de,void:()=>SNe});var de;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(de||(de={}));var pC;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(pC||(pC={}));var D=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),go=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}};var N=de.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),wOe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),vn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let l=i.path[c];c===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(i))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,de.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};vn.create=t=>new vn(t);var kOe=(t,e)=>{let n;switch(t.code){case N.invalid_type:t.received===D.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:n=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case N.invalid_union:n="Invalid input";break;case N.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case N.invalid_enum_value:n=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:n="Invalid function arguments";break;case N.invalid_return_type:n="Invalid function return type";break;case N.invalid_date:n="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case N.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case N.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case N.custom:n="Invalid input";break;case N.invalid_intersection_types:n="Intersection results could not be merged";break;case N.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:n="Number must be finite";break;default:n=e.defaultError,de.assertNever(t)}return{message:n}},ts=kOe;var T3=ts;function GOe(t){T3=t}function cl(){return T3}var Jd=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)a=l(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},BOe=[];function M(t,e){let n=cl(),r=Jd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ts?void 0:ts].filter(o=>!!o)});t.common.issues.push(r)}var Ft=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Q;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},Q=Object.freeze({status:"aborted"}),Na=t=>({status:"dirty",value:t}),nn=t=>({status:"valid",value:t}),VS=t=>t.status==="aborted",qS=t=>t.status==="dirty",mi=t=>t.status==="valid",ul=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(j||(j={}));var Er=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},E3=(t,e)=>{if(mi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new vn(t.common.issues);return this._error=n,this._error}}};function ie(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}var ce=class{get description(){return this._def.description}_getType(e){return go(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:go(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ft,ctx:{common:e.parent.common,data:e.data,parsedType:go(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ul(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:go(e)},o=this._parseSync({data:e,path:r.path,parent:r});return E3(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:go(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return mi(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>mi(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:go(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(ul(o)?o:Promise.resolve(o));return E3(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:N.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new Sr({schema:this,typeName:Z.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Tr.create(this,this._def)}nullable(){return Ro.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return os.create(this)}promise(){return Ei.create(this,this._def)}or(e){return La.create([this,e],this._def)}and(e){return Da.create(this,e,this._def)}transform(e){return new Sr({...ie(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ba({...ie(this._def),innerType:this,defaultValue:n,typeName:Z.ZodDefault})}brand(){return new Zd({typeName:Z.ZodBranded,type:this,...ie(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new ja({...ie(this._def),innerType:this,catchValue:n,typeName:Z.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return e_.create(this,e)}readonly(){return Ha.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},jOe=/^c[^\s-]{8,}$/i,HOe=/^[0-9a-z]+$/,FOe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,VOe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qOe=/^[a-z0-9_-]{21}$/i,$Oe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,YOe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,WOe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zOe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dC,KOe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,QOe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,XOe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,JOe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ZOe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eNe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,g3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",tNe=new RegExp(`^${g3}$`);function A3(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function nNe(t){return new RegExp(`^${A3(t)}$`)}function R3(t){let e=`${g3}T${A3(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function rNe(t,e){return!!((e==="v4"||!e)&&KOe.test(t)||(e==="v6"||!e)&&XOe.test(t))}function oNe(t,e){if(!$Oe.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function sNe(t,e){return!!((e==="v4"||!e)&&QOe.test(t)||(e==="v6"||!e)&&JOe.test(t))}var hi=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_type,expected:D.string,received:s.parsedType}),Q}let r=new Ft,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?M(o,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&M(o,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")WOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"email",code:N.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")dC||(dC=new RegExp(zOe,"u")),dC.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"emoji",code:N.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")VOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"uuid",code:N.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")qOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"nanoid",code:N.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")jOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cuid",code:N.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")HOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cuid2",code:N.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")FOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"ulid",code:N.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),M(o,{validation:"url",code:N.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"regex",code:N.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?R3(s).test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?tNe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?nNe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?YOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"duration",code:N.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?rNe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"ip",code:N.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?oNe(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"jwt",code:N.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?sNe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cidr",code:N.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?ZOe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"base64",code:N.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?eNe.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"base64url",code:N.invalid_string,message:s.message}),r.dirty()):de.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:N.invalid_string,...j.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...j.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...j.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...j.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...j.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...j.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...j.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...j.errToObj(n)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};hi.create=t=>new hi({checks:[],typeName:Z.ZodString,coerce:t?.coerce??!1,...ie(t)});function iNe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}var ba=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_type,expected:D.number,received:s.parsedType}),Q}let r,o=new Ft;for(let s of this._def.checks)s.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?iNe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),M(r,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:N.not_finite,message:s.message}),o.dirty()):de.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,j.toString(n))}gt(e,n){return this.setLimit("min",e,!1,j.toString(n))}lte(e,n){return this.setLimit("max",e,!0,j.toString(n))}lt(e,n){return this.setLimit("max",e,!1,j.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:j.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};ba.create=t=>new ba({checks:[],typeName:Z.ZodNumber,coerce:t?.coerce||!1,...ie(t)});var Ca=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let r,o=new Ft;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),M(r,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):de.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:D.bigint,received:n.parsedType}),Q}gte(e,n){return this.setLimit("min",e,!0,j.toString(n))}gt(e,n){return this.setLimit("min",e,!1,j.toString(n))}lte(e,n){return this.setLimit("max",e,!0,j.toString(n))}lt(e,n){return this.setLimit("max",e,!1,j.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:j.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ca.create=t=>new Ca({checks:[],typeName:Z.ZodBigInt,coerce:t?.coerce??!1,...ie(t)});var Pa=class extends ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:D.boolean,received:r.parsedType}),Q}return nn(e.data)}};Pa.create=t=>new Pa({typeName:Z.ZodBoolean,coerce:t?.coerce||!1,...ie(t)});var Ma=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_type,expected:D.date,received:s.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_date}),Q}let r=new Ft,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):de.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ma.create=t=>new Ma({checks:[],coerce:t?.coerce||!1,typeName:Z.ZodDate,...ie(t)});var pl=class extends ce{_parse(e){if(this._getType(e)!==D.symbol){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:D.symbol,received:r.parsedType}),Q}return nn(e.data)}};pl.create=t=>new pl({typeName:Z.ZodSymbol,...ie(t)});var xa=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:D.undefined,received:r.parsedType}),Q}return nn(e.data)}};xa.create=t=>new xa({typeName:Z.ZodUndefined,...ie(t)});var va=class extends ce{_parse(e){if(this._getType(e)!==D.null){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:D.null,received:r.parsedType}),Q}return nn(e.data)}};va.create=t=>new va({typeName:Z.ZodNull,...ie(t)});var Ti=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return nn(e.data)}};Ti.create=t=>new Ti({typeName:Z.ZodAny,...ie(t)});var rs=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nn(e.data)}};rs.create=t=>new rs({typeName:Z.ZodUnknown,...ie(t)});var Br=class extends ce{_parse(e){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:D.never,received:n.parsedType}),Q}};Br.create=t=>new Br({typeName:Z.ZodNever,...ie(t)});var dl=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:D.void,received:r.parsedType}),Q}return nn(e.data)}};dl.create=t=>new dl({typeName:Z.ZodVoid,...ie(t)});var os=class t extends ce{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==D.array)return M(n,{code:N.invalid_type,expected:D.array,received:n.parsedType}),Q;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(M(n,{code:i?N.too_big:N.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(M(n,{code:N.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(M(n,{code:N.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Er(n,i,n.path,a)))).then(i=>Ft.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Er(n,i,n.path,a)));return Ft.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:j.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:j.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:j.toString(n)}})}nonempty(e){return this.min(1,e)}};os.create=(t,e)=>new os({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...ie(e)});function ll(t){if(t instanceof Ln){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Tr.create(ll(r))}return new Ln({...t._def,shape:()=>e})}else return t instanceof os?new os({...t._def,type:ll(t.element)}):t instanceof Tr?Tr.create(ll(t.unwrap())):t instanceof Ro?Ro.create(ll(t.unwrap())):t instanceof Ao?Ao.create(t.items.map(e=>ll(e))):t}var Ln=class t extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=de.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==D.object){let l=this._getOrReturnCtx(e);return M(l,{code:N.invalid_type,expected:D.object,received:l.parsedType}),Q}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Br&&this._def.unknownKeys==="strip"))for(let l in o.data)i.includes(l)||a.push(l);let c=[];for(let l of i){let p=s[l],d=o.data[l];c.push({key:{status:"valid",value:l},value:p._parse(new Er(o,d,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof Br){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(l==="strict")a.length>0&&(M(o,{code:N.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of a){let d=o.data[p];c.push({key:{status:"valid",value:p},value:l._parse(new Er(o,d,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of c){let d=await p.key,_=await p.value;l.push({key:d,value:_,alwaysSet:p.alwaysSet})}return l}).then(l=>Ft.mergeObjectSync(r,l)):Ft.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:j.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Z.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of de.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of de.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return ll(this)}partial(e){let n={};for(let r of de.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of de.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Tr;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return y3(de.objectKeys(this.shape))}};Ln.create=(t,e)=>new Ln({shape:()=>t,unknownKeys:"strip",catchall:Br.create(),typeName:Z.ZodObject,...ie(e)});Ln.strictCreate=(t,e)=>new Ln({shape:()=>t,unknownKeys:"strict",catchall:Br.create(),typeName:Z.ZodObject,...ie(e)});Ln.lazycreate=(t,e)=>new Ln({shape:t,unknownKeys:"strip",catchall:Br.create(),typeName:Z.ZodObject,...ie(e)});var La=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new vn(a.ctx.common.issues));return M(n,{code:N.invalid_union,unionErrors:i}),Q}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new vn(c));return M(n,{code:N.invalid_union,unionErrors:a}),Q}}get options(){return this._def.options}};La.create=(t,e)=>new La({options:t,typeName:Z.ZodUnion,...ie(e)});var ns=t=>t instanceof Ua?ns(t.schema):t instanceof Sr?ns(t.innerType()):t instanceof wa?[t.value]:t instanceof ka?t.options:t instanceof Ga?de.objectValues(t.enum):t instanceof Ba?ns(t._def.innerType):t instanceof xa?[void 0]:t instanceof va?[null]:t instanceof Tr?[void 0,...ns(t.unwrap())]:t instanceof Ro?[null,...ns(t.unwrap())]:t instanceof Zd||t instanceof Ha?ns(t.unwrap()):t instanceof ja?ns(t._def.innerType):[],$S=class t extends ce{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.object)return M(n,{code:N.invalid_type,expected:D.object,received:n.parsedType}),Q;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(M(n,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=ns(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:Z.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...ie(r)})}};function _C(t,e){let n=go(t),r=go(e);if(t===e)return{valid:!0,data:t};if(n===D.object&&r===D.object){let o=de.objectKeys(e),s=de.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=_C(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===D.array&&r===D.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=_C(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===D.date&&r===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Da=class extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(VS(s)||VS(i))return Q;let a=_C(s.value,i.value);return a.valid?((qS(s)||qS(i))&&n.dirty(),{status:n.value,value:a.data}):(M(r,{code:N.invalid_intersection_types}),Q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Da.create=(t,e,n)=>new Da({left:t,right:e,typeName:Z.ZodIntersection,...ie(n)});var Ao=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.array)return M(r,{code:N.invalid_type,expected:D.array,received:r.parsedType}),Q;if(r.data.length<this._def.items.length)return M(r,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&r.data.length>this._def.items.length&&(M(r,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Er(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Ft.mergeArray(n,i)):Ft.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ao.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ao({items:t,typeName:Z.ZodTuple,rest:null,...ie(e)})};var YS=class t extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.object)return M(r,{code:N.invalid_type,expected:D.object,received:r.parsedType}),Q;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Er(r,a,r.path,a)),value:i._parse(new Er(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Ft.mergeObjectAsync(n,o):Ft.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ce?new t({keyType:e,valueType:n,typeName:Z.ZodRecord,...ie(r)}):new t({keyType:hi.create(),valueType:e,typeName:Z.ZodRecord,...ie(n)})}},_l=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.map)return M(r,{code:N.invalid_type,expected:D.map,received:r.parsedType}),Q;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],l)=>({key:o._parse(new Er(r,a,r.path,[l,"key"])),value:s._parse(new Er(r,c,r.path,[l,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let l=await c.key,p=await c.value;if(l.status==="aborted"||p.status==="aborted")return Q;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(l.value,p.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let l=c.key,p=c.value;if(l.status==="aborted"||p.status==="aborted")return Q;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(l.value,p.value)}return{status:n.value,value:a}}}};_l.create=(t,e,n)=>new _l({valueType:e,keyType:t,typeName:Z.ZodMap,...ie(n)});var fl=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.set)return M(r,{code:N.invalid_type,expected:D.set,received:r.parsedType}),Q;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(M(r,{code:N.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(M(r,{code:N.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let l=new Set;for(let p of c){if(p.status==="aborted")return Q;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}let a=[...r.data.values()].map((c,l)=>s._parse(new Er(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:j.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:j.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};fl.create=(t,e)=>new fl({valueType:t,minSize:null,maxSize:null,typeName:Z.ZodSet,...ie(e)});var WS=class t extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.function)return M(n,{code:N.invalid_type,expected:D.function,received:n.parsedType}),Q;function r(a,c){return Jd({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,cl(),ts].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:c}})}function o(a,c){return Jd({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,cl(),ts].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Ei){let a=this;return nn(async function(...c){let l=new vn([]),p=await a._def.args.parseAsync(c,s).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(i,this,p);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw l.addIssue(o(d,f)),l})})}else{let a=this;return nn(function(...c){let l=a._def.args.safeParse(c,s);if(!l.success)throw new vn([r(c,l.error)]);let p=Reflect.apply(i,this,l.data),d=a._def.returns.safeParse(p,s);if(!d.success)throw new vn([o(p,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ao.create(e).rest(rs.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Ao.create([]).rest(rs.create()),returns:n||rs.create(),typeName:Z.ZodFunction,...ie(r)})}},Ua=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ua.create=(t,e)=>new Ua({getter:t,typeName:Z.ZodLazy,...ie(e)});var wa=class extends ce{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return M(n,{received:n.data,code:N.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};wa.create=(t,e)=>new wa({value:t,typeName:Z.ZodLiteral,...ie(e)});function y3(t,e){return new ka({values:t,typeName:Z.ZodEnum,...ie(e)})}var ka=class t extends ce{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return M(n,{expected:de.joinValues(r),received:n.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return M(n,{received:n.data,code:N.invalid_enum_value,options:r}),Q}return nn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};ka.create=y3;var Ga=class extends ce{_parse(e){let n=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==D.string&&r.parsedType!==D.number){let o=de.objectValues(n);return M(r,{expected:de.joinValues(o),received:r.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=de.objectValues(n);return M(r,{received:r.data,code:N.invalid_enum_value,options:o}),Q}return nn(e.data)}get enum(){return this._def.values}};Ga.create=(t,e)=>new Ga({values:t,typeName:Z.ZodNativeEnum,...ie(e)});var Ei=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.promise&&n.common.async===!1)return M(n,{code:N.invalid_type,expected:D.promise,received:n.parsedType}),Q;let r=n.parsedType===D.promise?n.data:Promise.resolve(n.data);return nn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Ei.create=(t,e)=>new Ei({type:t,typeName:Z.ZodPromise,...ie(e)});var Sr=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{M(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return Q;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Q:c.status==="dirty"?Na(c.value):n.value==="dirty"?Na(c.value):c});{if(n.value==="aborted")return Q;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Q:a.status==="dirty"?Na(a.value):n.value==="dirty"?Na(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Q:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!mi(i))return Q;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>mi(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):Q);de.assertNever(o)}};Sr.create=(t,e,n)=>new Sr({schema:t,typeName:Z.ZodEffects,effect:e,...ie(n)});Sr.createWithPreprocess=(t,e,n)=>new Sr({schema:e,effect:{type:"preprocess",transform:t},typeName:Z.ZodEffects,...ie(n)});var Tr=class extends ce{_parse(e){return this._getType(e)===D.undefined?nn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Tr.create=(t,e)=>new Tr({innerType:t,typeName:Z.ZodOptional,...ie(e)});var Ro=class extends ce{_parse(e){return this._getType(e)===D.null?nn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ro.create=(t,e)=>new Ro({innerType:t,typeName:Z.ZodNullable,...ie(e)});var Ba=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===D.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ba.create=(t,e)=>new Ba({innerType:t,typeName:Z.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ie(e)});var ja=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ul(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new vn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new vn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ja.create=(t,e)=>new ja({innerType:t,typeName:Z.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ie(e)});var ml=class extends ce{_parse(e){if(this._getType(e)!==D.nan){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:D.nan,received:r.parsedType}),Q}return{status:"valid",value:e.data}}};ml.create=t=>new ml({typeName:Z.ZodNaN,...ie(t)});var aNe=Symbol("zod_brand"),Zd=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},e_=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Q:s.status==="dirty"?(n.dirty(),Na(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Q:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:Z.ZodPipeline})}},Ha=class extends ce{_parse(e){let n=this._def.innerType._parse(e),r=o=>(mi(o)&&(o.value=Object.freeze(o.value)),o);return ul(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};Ha.create=(t,e)=>new Ha({innerType:t,typeName:Z.ZodReadonly,...ie(e)});function S3(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function I3(t,e={},n){return t?Ti.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=S3(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=S3(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Ti.create()}var cNe={object:Ln.lazycreate},Z;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Z||(Z={}));var uNe=(t,e={message:`Input not instance of ${t.name}`})=>I3(n=>n instanceof t,e),O3=hi.create,N3=ba.create,lNe=ml.create,pNe=Ca.create,b3=Pa.create,dNe=Ma.create,_Ne=pl.create,fNe=xa.create,mNe=va.create,hNe=Ti.create,TNe=rs.create,ENe=Br.create,SNe=dl.create,gNe=os.create,ANe=Ln.create,RNe=Ln.strictCreate,yNe=La.create,INe=$S.create,ONe=Da.create,NNe=Ao.create,bNe=YS.create,CNe=_l.create,PNe=fl.create,MNe=WS.create,xNe=Ua.create,vNe=wa.create,LNe=ka.create,DNe=Ga.create,UNe=Ei.create,wNe=Sr.create,kNe=Tr.create,GNe=Ro.create,BNe=Sr.createWithPreprocess,jNe=e_.create,HNe=()=>O3().optional(),FNe=()=>N3().optional(),VNe=()=>b3().optional(),qNe={string:t=>hi.create({...t,coerce:!0}),number:t=>ba.create({...t,coerce:!0}),boolean:t=>Pa.create({...t,coerce:!0}),bigint:t=>Ca.create({...t,coerce:!0}),date:t=>Ma.create({...t,coerce:!0})};var $Ne=Q;var YNe=t=>typeof t?.safeParse=="function";var fC=t=>typeof t?.passthrough=="function";var WNe=(t,e)=>fC(t)?fC(e)?t.merge(e):t:fC(e)?e:Object.assign({},t,e);var a5e=u.object({name:u.literal("ZodError"),issues:u.array(u.object({path:u.array(u.union([u.string(),u.number()])),message:u.string().optional(),code:u.nativeEnum(u.ZodIssueCode)}).catchall(u.any()))}),zNe=Symbol("ContractNoBody"),P3=t=>"method"in t&&"path"in t;var M3=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>{var o,s,i;return P3(r)?[n,{...r,path:e?.pathPrefix?e.pathPrefix+r.path:r.path,headers:WNe(e?.baseHeaders,r.headers),strictStatusCodes:(o=r.strictStatusCodes)!==null&&o!==void 0?o:e?.strictStatusCodes,validateResponseOnClient:(s=r.validateResponseOnClient)!==null&&s!==void 0?s:e?.validateResponseOnClient,responses:{...e?.commonResponses,...r.responses},metadata:e?.metadata?{...e?.metadata,...(i=r.metadata)!==null&&i!==void 0?i:{}}:r.metadata}]:[n,M3(r,e)]})),mC=Symbol("ContractPlainType"),gr=()=>({router:(t,e)=>M3(t,e),query:t=>t,mutation:t=>t,responses:t=>t,response:()=>mC,body:()=>mC,type:()=>mC,otherResponse:({contentType:t,body:e})=>({contentType:t,body:e}),noBody:()=>zNe}),KNe=({path:t,params:e})=>{let n=e;return t.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},QNe=(t,e=!1)=>{let n=e?XNe(t):JNe(t);return n?.length>0?"?"+n:""},XNe=t=>t?Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>{let r;return typeof n=="string"&&!["true","false","null"].includes(n.trim())&&isNaN(Number(n))?r=n:r=JSON.stringify(n),`${encodeURIComponent(e)}=${encodeURIComponent(r)}`}).join("&"):"",JNe=t=>t?Object.keys(t).flatMap(e=>hC(e,t[e])).map(([e,n])=>`${encodeURIComponent(e)}=${encodeURIComponent(n)}`).join("&"):"",hC=(t,e)=>Array.isArray(e)?e.flatMap((n,r)=>hC(`${t}[${r}]`,n)):e instanceof Date?[[`${t}`,e.toISOString()]]:e===null?[[`${t}`,""]]:e===void 0?[]:typeof e=="object"?Object.keys(e).flatMap(n=>hC(`${t}[${n}]`,e[n])):[[`${t}`,`${e}`]];var TC=class extends Error{constructor(e,n){let r=n.join(",");super(`Server returned unexpected response. Expected one of: ${r} got: ${e.status}`),this.response=e}};var ZNe=async({route:t,path:e,method:n,headers:r,body:o,validateResponse:s,fetchOptions:i})=>{let a=await fetch(e,{...i,method:n,headers:r,body:o}),c=a.headers.get("content-type");if(c?.includes("application/")&&c?.includes("json")){let l={status:a.status,body:await a.json(),headers:a.headers},p=t.responses[l.status];return(s??t.validateResponseOnClient)&&YNe(p)?{...l,body:p.parse(l.body)}:l}return c?.includes("text/")?{status:a.status,body:await a.text(),headers:a.headers}:{status:a.status,body:await a.blob(),headers:a.headers}},ebe=t=>{let e=new FormData,n=(r,o)=>{o instanceof File?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t).forEach(([r,o])=>{if(Array.isArray(o))for(let s of o)n(r,s);else n(r,o)}),e},C3=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLowerCase(),n])),tbe=t=>{let{path:e,clientArgs:n,route:r,body:o,query:s,extraInputArgs:i,headers:a,fetchOptions:c}=t,l=n.api||ZNe,p=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([f,m])=>typeof m=="function"?[f,m(t)]:[f,m])),d={...p&&C3(p),...C3(a)};Object.keys(d).forEach(f=>{d[f]===void 0&&delete d[f]});let _={route:r,path:e,method:r.method,headers:d,body:void 0,rawBody:o,rawQuery:s,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...c},...c?.signal&&{signal:c.signal},...c?.cache&&{cache:c.cache},...c&&"next"in c&&!!c?.next&&{next:c.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?_={..._,contentType:"multipart/form-data",body:o instanceof FormData?o:ebe(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?_={..._,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",..._.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(_={..._,contentType:"application/json",headers:{"content-type":"application/json",..._.headers},body:JSON.stringify(o)})),l({..._,...i})},nbe=(t,e,n)=>{let{query:r,params:o,body:s,headers:i,extraHeaders:a,overrideClientOptions:c,fetchOptions:l,cache:p,next:d,..._}=n||{},f={...e,...c};return{path:rbe(r,f.baseUrl,o,t,!!f.jsonQuery),clientArgs:f,route:t,body:s,query:r,extraInputArgs:_,fetchOptions:{...p&&{cache:p},...d&&{next:d},...l},headers:{...a,...i}}},rbe=(t,e,n,r,o)=>{let s=KNe({path:r.path,params:n}),i=QNe(t,o);return`${e}${s}${i}`},obe=(t,e)=>{let n=Object.keys(t.responses);return async r=>{let o=nbe(t,e,r),s=await tbe(o);if(!e.throwOnUnknownStatus||n.includes(s.status.toString()))return s;throw new TC(s,n)}},EC=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>P3(r)?[n,obe(r,e)]:[n,EC(r,e)]));var SC=["free","creator","team"],x3=typeof process<"u"&&process.env?.NODE_ENV!=="production",sbe={stripe:{plans:[{tier:"free",subjectType:"user",name:"Free",description:"Upload threads, share read-only links, and collaborate with your workspace. Shared links expire after 3 days.",price:0,priceId:null,features:[{name:"Thread uploads + public links"},{name:"Workspace membership"},{name:"Shared links live 3 days"}],entitlements:{skills:!1,workspaceScope:!1,review:!1,sharedThreadTtlDays:3}},{tier:"creator",subjectType:"user",name:"Creator",description:"For builders who share a lot. Permanent links and the Skills tab.",price:29,isFeatured:!0,priceId:x3?"price_1TP9BSKwvRM43sh64waIrvjj":"price_1TPA2gKwvRM43sh6Kp4ZCpJZ",features:[{name:"Everything in Free"},{name:"Shared threads live forever"},{name:"Skills tab \u2014 tool usage across every thread"}],entitlements:{skills:!0,workspaceScope:!1,review:!1,sharedThreadTtlDays:null}},{tier:"team",subjectType:"organization",name:"Team",description:"GitHub for Prompts. Org-wide thread sharing plus the review surface.",price:19,minSeats:2,priceId:x3?"price_1TP9MpKwvRM43sh6TBIFxVCd":"price_1TPA3CKwvRM43sh6k0bgPTsQ",features:[{name:"Everything in Creator"},{name:"Workspace-wide thread sharing"},{name:"Minimum 2 seats"},{name:"Review feature (beta)"}],entitlements:{skills:!0,workspaceScope:!0,review:!0,sharedThreadTtlDays:null}}]}};var v3=sbe.stripe.plans,u5e=Object.freeze(Object.fromEntries(v3.map(t=>[t.tier,t])));var ibe=gr(),rn=u.object({message:u.string()}),gC=u.record(u.unknown()),Fa=u.string().regex(/^doc_[0-9A-Za-z]{22}$/),zS=u.string().regex(/^proj_[0-9A-Za-z]{22}$/),abe=["active","archived"],KS=u.enum(abe),L3=u.object({id:u.string().min(1),display_name:u.string().min(1)}),D3=u.object({id:zS,name:u.string().min(1)}),AC=u.object({id:Fa,title:u.string().min(1),status:KS,author:L3,project:D3.nullable(),created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable()}),cbe=u.object({type:u.literal("list"),list_type:u.literal("doc"),objects:u.array(AC)}),ube=u.object({project_id:zS.optional(),status:KS.optional()}),lbe=u.object({title:u.string().trim().min(1).max(300).optional(),prosemirror_json:gC.optional(),project_id:zS.nullable().optional()}),pbe=u.object({id:Fa,created_at:u.string().datetime()}),dbe=u.object({title:u.string().trim().min(1).max(300).optional(),prosemirror_json:gC.optional(),project_id:zS.nullable().optional(),status:KS.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),_be=u.object({id:Fa,updated_at:u.string().datetime()}),fbe=u.object({id:Fa,title:u.string().min(1),prosemirror_json:gC,status:KS,author:L3,project:D3.nullable(),created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable()}),U3=ibe.router({listDocs:{method:"GET",path:"/docs",headers:u.object({authorization:u.string().min(1).optional()}),query:ube,responses:{200:cbe,401:rn,403:rn},summary:"List docs in the authenticated user\u2019s organization. Optional project_id filter scopes to a single project."},createDoc:{method:"POST",path:"/docs",headers:u.object({authorization:u.string().min(1).optional()}),body:lbe,responses:{201:pbe,401:rn,403:rn,404:rn,422:rn},summary:"Create a doc. If project_id is provided, the doc is scoped to that project; otherwise it lives at the workspace level."},getDoc:{method:"GET",path:"/docs/:docId",pathParams:u.object({docId:Fa}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:fbe,401:rn,403:rn,404:rn},summary:"Get a doc by id with its rich-text body and parent project (if any)"},updateDoc:{method:"PATCH",path:"/docs/:docId",pathParams:u.object({docId:Fa}),headers:u.object({authorization:u.string().min(1).optional()}),body:dbe,responses:{200:_be,401:rn,403:rn,404:rn,422:rn},summary:"Update a doc. If prosemirror_json changes, the server re-syncs lore.mention_references from mention nodes."},deleteDoc:{method:"DELETE",path:"/docs/:docId",pathParams:u.object({docId:Fa}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.object({}),401:rn,403:rn,404:rn},summary:"Hard-delete a doc and any mention references it owns"}});var mbe=gr(),et=u.object({message:u.string()}),RC=u.record(u.unknown()),yo=u.string().regex(/^proj_[0-9A-Za-z]{22}$/),hbe=["active","archived"],QS=u.enum(hbe),yC=u.object({id:u.string().min(1),display_name:u.string().min(1)}),w3=u.object({thread_id:u.string().min(1),title:u.string().min(1),added_at:u.string().datetime(),added_by:yC}),Tbe=u.object({id:yo,name:u.string().min(1),status:QS,author:yC,thread_count:u.number().int().nonnegative(),doc_count:u.number().int().nonnegative(),created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable()}),Ebe=u.object({type:u.literal("list"),list_type:u.literal("project"),objects:u.array(Tbe)}),Sbe=u.object({status:QS.optional()}),gbe=u.object({name:u.string().trim().min(1).max(200),prosemirror_json:RC.optional()}),Abe=u.object({id:yo,created_at:u.string().datetime()}),Rbe=u.object({name:u.string().trim().min(1).max(200).optional(),prosemirror_json:RC.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),ybe=u.object({id:yo,updated_at:u.string().datetime()}),Ibe=u.object({archived:u.boolean()}),Obe=u.object({id:yo,status:QS,archived_at:u.string().datetime().nullable()}),Nbe=u.object({id:yo,name:u.string().min(1),prosemirror_json:RC,status:QS,author:yC,created_at:u.string().datetime(),updated_at:u.string().datetime(),archived_at:u.string().datetime().nullable(),threads:u.array(w3),docs:u.array(AC)}),bbe=u.object({thread_id:u.string().min(1).max(64)}),Cbe=w3,k3=mbe.router({listProjects:{method:"GET",path:"/projects",headers:u.object({authorization:u.string().min(1).optional()}),query:Sbe,responses:{200:Ebe,401:et},summary:"List projects in the authenticated user\u2019s organization"},createProject:{method:"POST",path:"/projects",headers:u.object({authorization:u.string().min(1).optional()}),body:gbe,responses:{201:Abe,401:et,422:et},summary:"Create a new project in the authenticated user\u2019s organization"},getProject:{method:"GET",path:"/projects/:projectId",pathParams:u.object({projectId:yo}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Nbe,401:et,403:et,404:et},summary:"Get a project with its attached threads and child docs. The project description is the canonical mention source for project-scoped @-mentions."},updateProject:{method:"PATCH",path:"/projects/:projectId",pathParams:u.object({projectId:yo}),headers:u.object({authorization:u.string().min(1).optional()}),body:Rbe,responses:{200:ybe,401:et,403:et,404:et,422:et},summary:"Update a project\u2019s name or rich-text body. Body changes re-sync mention_references for source_kind=project."},archiveProject:{method:"POST",path:"/projects/:projectId/archive",pathParams:u.object({projectId:yo}),headers:u.object({authorization:u.string().min(1).optional()}),body:Ibe,responses:{200:Obe,401:et,403:et,404:et},summary:"Archive (soft-delete) or unarchive a project"},addProjectThread:{method:"POST",path:"/projects/:projectId/threads",pathParams:u.object({projectId:yo}),headers:u.object({authorization:u.string().min(1).optional()}),body:bbe,responses:{201:Cbe,401:et,403:et,404:et,409:et,422:et},summary:"Pin an existing visible thread to this project. Idempotent \u2014 re-adding returns the existing membership."},removeProjectThread:{method:"DELETE",path:"/projects/:projectId/threads/:threadId",pathParams:u.object({projectId:yo,threadId:u.string().min(1).max(64)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.object({}),401:et,403:et,404:et},summary:"Remove a thread membership from a project"}});var Pbe=gr(),XS=u.object({message:u.string()}),Mbe=["thread","plan","doc","user"],JS=u.enum(Mbe),xbe=["doc","project"],vbe=u.enum(xbe),Lbe=u.object({kind:JS,id:u.string().min(1),title:u.string().min(1),href:u.string().min(1)}),Dbe=u.object({type:u.literal("list"),list_type:u.literal("mention"),objects:u.array(Lbe)}),Ube=u.object({q:u.string().trim().min(1).max(50),kinds:u.string().optional().transform(t=>{if(!t)return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}).pipe(u.array(JS).optional())}),wbe=u.object({source_kind:vbe,source_id:u.string().min(1),source_title:u.string().min(1),source_href:u.string().min(1),target_kind:JS,target_id:u.string().min(1),created_at:u.string().datetime()}),kbe=u.object({type:u.literal("list"),list_type:u.literal("backlink"),objects:u.array(wbe)}),Gbe=u.object({target_kind:JS,target_id:u.string().min(1).max(64)}),G3=Pbe.router({searchMentions:{method:"GET",path:"/mentions/search",headers:u.object({authorization:u.string().min(1).optional()}),query:Ube,responses:{200:Dbe,401:XS,422:XS},summary:"Search threads, plans, files, and users by title/name for @-mention typeahead. Org-scoped, max 10 results across all kinds."},listBacklinks:{method:"GET",path:"/mentions/backlinks",headers:u.object({authorization:u.string().min(1).optional()}),query:Gbe,responses:{200:kbe,401:XS,403:XS},summary:"List every doc/project body in the caller\u2019s organization that mentions the given target. Newest-first."}});var Bbe=gr(),jbe=u.object({type:u.literal("list"),list_type:u.literal("thread"),has_more:u.boolean(),objects:u.array(u.unknown())}),Si=u.object({message:u.string()}),B3=u.object({thread_id:u.string().min(1),is_favorited:u.boolean(),favorited_at:u.string().datetime().nullable()}),Hbe=u.object({before:u.string().min(1).max(64).optional()}),j3=Bbe.router({addThreadFavorite:{method:"POST",path:"/threads/:id/favorite",pathParams:u.object({id:u.string().min(1).max(64)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{201:B3,401:Si,403:Si,404:Si},summary:"Bookmark a thread for the authenticated user. Idempotent \u2014 re-favoriting returns the existing membership."},removeThreadFavorite:{method:"DELETE",path:"/threads/:id/favorite",pathParams:u.object({id:u.string().min(1).max(64)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:B3,401:Si,403:Si,404:Si},summary:"Remove a thread bookmark for the authenticated user (no-op if absent)."},listFavoriteThreads:{method:"GET",path:"/favorites/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:Hbe,responses:{200:jbe,401:Si,403:Si},summary:"List threads the authenticated user has favorited, newest favorited first. Visibility filtering still applies \u2014 a thread the viewer can no longer see (e.g. visibility downgraded) is omitted from the list."}});var Fbe=gr(),IC=u.object({message:u.string()}),Vbe=u.object({id:u.string().min(1),title:u.string(),href:u.string().min(1),author_display_name:u.string().nullable(),author_handle:u.string().nullable()}),qbe=u.object({name:u.string().min(1),usage_count:u.number().int().nonnegative(),href:u.string().min(1)}),$be=u.object({id:u.string().min(1),display_name:u.string(),handle:u.string().nullable(),avatar_url:u.string().nullable(),href:u.string().min(1)}),Ybe=u.object({type:u.literal("global_search"),threads:u.array(Vbe),skills:u.array(qbe),people:u.array($be)}),Wbe=u.object({q:u.string().trim().min(1).max(80)}),H3=Fbe.router({globalSearch:{method:"GET",path:"/search",headers:u.object({authorization:u.string().min(1).optional()}),query:Wbe,responses:{200:Ybe,401:IC,403:IC,422:IC},summary:"Global navbar search across threads, skills, and people. Org-scoped, max 5 results per kind."}});var zbe=gr(),Kbe=u.object({id:u.string().uuid(),role:u.enum(["user","assistant"]),content:u.string().min(1),timestamp:u.string().datetime()}),Qbe=u.object({id:u.string().uuid(),title:u.string().min(1),author:u.string().min(1),authorAvatar:u.string().min(1).max(4),model:u.string().min(1),turnCount:u.number().int().nonnegative(),createdAt:u.string().datetime(),preview:u.string()}),Y5e=Qbe.extend({messages:u.array(Kbe)}),A=u.object({message:u.string()}),Xbe=/^[a-zA-Z0-9_-]{2,32}$/,K3=u.string().regex(Xbe,"Handle must be 2\u201332 characters: letters, numbers, dashes, or underscores."),OC=u.object({id:u.string(),first_name:u.string().min(1),last_name:u.string().min(1),display_name:u.string().min(1),stytch_id:u.string().nullable(),handle:u.string().nullable(),bio:u.string().max(280).nullable(),avatar_url:u.string().nullable(),banner_url:u.string().nullable(),share_new_threads_to_workspace:u.boolean(),experimental_features_enabled:u.boolean(),onboarded_at:u.string().nullable()}),Jbe=u.object({stytchMemberId:u.string().min(1).optional(),emailAddress:u.string().email(),name:u.string().nullable(),user:OC,is_admin:u.boolean()}),Zbe=u.object({share_new_threads_to_workspace:u.boolean().optional(),experimental_features_enabled:u.boolean().optional(),onboarded_at:u.union([u.literal("now"),u.null()]).optional(),display_name:u.string().min(1).max(120).optional(),handle:K3.optional(),bio:u.string().max(280).nullable().optional(),avatar_storage_url:u.string().min(1).nullable().optional(),banner_storage_url:u.string().min(1).nullable().optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),eCe=u.object({id:u.string(),display_name:u.string(),handle:u.string().nullable(),avatar_url:u.string().nullable(),visible_thread_count:u.number().int().nonnegative(),last_active_at:u.string().datetime().nullable()}),Q3=u.object({id:u.string().min(1),display_name:u.string().min(1),handle:u.string().nullable(),bio:u.string().max(280).nullable(),avatar_url:u.string().nullable(),banner_url:u.string().nullable(),organization_name:u.string().min(1).nullable(),created_at:u.string().min(1),visible_thread_count:u.number().int().nonnegative(),follower_count:u.number().int().nonnegative(),following_count:u.number().int().nonnegative(),published_project_count:u.number().int().nonnegative(),is_following:u.boolean(),is_self:u.boolean()}),tCe=u.object({type:u.literal("list"),list_type:u.literal("organization_member"),objects:u.array(eCe)}),nCe=u.object({email_address:u.string().email()}),rCe=u.object({email_address:u.string().email(),member_id:u.string().min(1)}),oCe=u.object({location:u.string().trim().min(1),contact:u.string().trim().email()}),sCe=u.object({location:u.string().min(1),contact:u.string().email(),created_at:u.string().datetime()}),iCe=u.object({first_name:u.string().min(1),last_name:u.string().min(1),display_name:u.string().min(1),stytch_id:u.string().min(1).optional()}),aCe=u.object({name:u.string().min(1),email_domains:u.array(u.string().min(1)).nonempty(),stytch_org_id:u.string().min(1)}),cCe=u.object({user:iCe,organization:aCe}),uCe=u.object({path_glob:u.string().min(1),name:u.string().min(1),description:u.string().min(1)}),lCe=u.object({repo_origin_path:u.string().min(1),building_blocks:u.array(uCe)}),X3=u.string().regex(/^th_[0-9A-Za-z]{22}$/),eg=u.string().regex(/^tb_[0-9A-Za-z]{22}$/),pCe=u.object({id:X3,author:u.object({id:u.string().min(1),display_name:u.string().min(1)}),body:u.string(),created_at:u.string().datetime(),repo_origin_path:u.string().min(1),latest_revision_id:eg,revision_count:u.number().int().positive()}),dCe=u.object({id:u.string().min(1),display_name:u.string().min(1)}),_Ce=u.object({id:u.string().min(1),author_id:u.string().min(1).nullable(),author:dCe.nullable(),created_at:u.string().datetime(),deleted_at:u.string().datetime().nullable(),content:u.string().min(1)}),fCe=u.object({id:u.string().min(1),thread_block_id:u.string().min(1),created_at:u.string().datetime(),resolved_at:u.string().datetime().nullable(),comments:u.array(_Ce)}),mCe=u.object({thread_block_id:eg,from_position:u.number().int().positive(),to_position:u.number().int().positive(),selected_text:u.string().min(1),content:u.string().trim().min(1)}),hCe=u.object({id:u.string().min(1)}),TCe=u.object({content:u.string().trim().min(1)}),ECe=u.object({id:u.string().min(1)}),SCe=u.object({content:u.string().trim().min(1)}),gCe=u.object({id:u.string().min(1)}),ACe=u.object({content:u.string().trim().min(1)}),RCe=u.object({id:u.string().min(1)}),yCe=u.object({resolved:u.boolean()}),ICe=u.object({id:u.string().min(1),resolved_at:u.string().datetime().nullable()}),OCe=u.object({resolved:u.boolean()}),NCe=u.object({id:u.string().min(1),resolved_at:u.string().datetime().nullable()}),J3=u.record(u.unknown()),bCe=u.object({id:eg,body:u.string(),created_at:u.string().datetime(),prosemirror_json:J3,comment_threads:u.array(fCe)}),CCe=u.object({id:X3,created_at:u.string().datetime(),repo_origin_path:u.string().min(1),author:u.object({id:u.string().min(1),display_name:u.string().min(1)}),latest_revision_id:eg,revision_count:u.number().int().positive(),revisions:u.array(bCe)}),PCe=u.object({type:u.literal("list"),list_type:u.literal("plan"),has_more:u.boolean(),objects:u.array(pCe)}),MCe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional(),author_id:u.string().min(1).optional(),repo_origin_path:u.string().min(1).optional()}),Z3=u.object({id:u.string().min(1),organization_id:u.string().min(1),created_at:u.string().min(1),repo_origin_path:u.string().min(1),path_glob:u.string().min(1),name:u.string().min(1),description:u.string().min(1)}),xCe=u.array(Z3),vCe=u.object({type:u.literal("list"),list_type:u.literal("building_block"),has_more:u.boolean(),objects:u.array(Z3)}),LCe=u.object({repo_origin_path:u.string().min(1),before:u.string().min(1).optional(),after:u.string().min(1).optional()}),DCe=u.enum(["thread","building_block"]),UCe=u.object({repo_origin_path:u.string().min(1),sources:u.array(DCe).nonempty()}),wCe=u.object({type:u.literal("list"),list_type:u.literal("repository"),has_more:u.boolean(),objects:u.array(UCe)}),gi=u.enum(["claudeCode","codex","amp","cursor","unspecified"]),kCe=["transcript","plan"],GCe=u.enum(kCe),BCe=u.object({md5:u.string().min(1),harness:gi,filename:u.string().min(1).optional(),repo_origin_path:u.string().min(1).optional(),harness_internal_id:u.string().min(1).optional(),file_type:GCe.optional()}).refine(t=>(t.filename?.trim().length??0)>0||(t.harness_internal_id?.trim().length??0)>0,{path:["harness_internal_id"],message:"filename or harness_internal_id is required"}),bC=u.object({id:u.string().min(1),display_name:u.string().min(1)}),jCe=u.object({id:u.string().min(1),display_name:u.string().min(1)}),e9=u.object({id:u.string().min(1),author_id:u.string().min(1).nullable(),author:jCe.nullable(),created_at:u.string().datetime(),deleted_at:u.string().datetime().nullable(),content:u.string().min(1)}),t9=u.object({id:u.string().min(1),thread_block_id:u.string().min(1),created_at:u.string().datetime(),resolved_at:u.string().datetime().nullable()}),HCe=t9.extend({comments:u.array(e9)}),t_=u.object({id:u.string().min(1),type:u.string().min(1),index_in_thread:u.number().int().nonnegative(),isCritiqued:u.boolean(),comment_threads:u.array(HCe).optional()}).passthrough(),n9=u.object({type:u.literal("list"),list_type:u.literal("thread_block"),has_more:u.boolean(),objects:u.array(t_)}),F3=t_.extend({type:u.literal("plan"),prosemirror_json:J3,thread_file_id:u.string().min(1)}),FCe=u.union([u.literal(-1),u.literal(1)]),r9=u.union([u.literal(-1),u.literal(0),u.literal(1)]),V3=u.object({score:u.number().int(),up_count:u.number().int().nonnegative(),down_count:u.number().int().nonnegative(),viewer_vote:r9}),VCe=u.object({value:FCe}),qCe=u.object({id:u.string().min(1),display_name:u.string().min(1),avatar_url:u.string().nullable()}),Va=u.object({id:u.string().min(1),thread_id:u.string().min(1),author_id:u.string().min(1).nullable(),author:qCe.nullable(),parent_comment_id:u.string().min(1).nullable(),content:u.string(),created_at:u.string().datetime(),updated_at:u.string().datetime(),deleted_at:u.string().datetime().nullable()}),$Ce=u.object({type:u.literal("list"),list_type:u.literal("thread_comment"),objects:u.array(Va)}),YCe=u.object({content:u.string().trim().min(1).max(4e3),parent_comment_id:u.string().min(1).optional()}),WCe=Va,zCe=u.object({content:u.string().trim().min(1).max(4e3)}),KCe=Va,QCe=Va,W5e=u.discriminatedUnion("kind",[u.object({kind:u.literal("created"),thread_id:u.string().min(1),actor_user_id:u.string().min(1),version:u.number(),comment:Va}),u.object({kind:u.literal("updated"),thread_id:u.string().min(1),actor_user_id:u.string().min(1),version:u.number(),comment:Va}),u.object({kind:u.literal("deleted"),thread_id:u.string().min(1),actor_user_id:u.string().min(1),version:u.number(),comment:Va})]),XCe=u.enum(["pending","generating","ready","failed"]),JCe=u.enum(["pending","generating","ready","failed"]),ZCe=u.enum(["pending","placeholder","ai","user"]),o9=u.enum(["pending","generating","ready","failed"]),s9=u.enum(["pending","generating","ready","failed","disabled"]),i9=u.enum(["pending","generating","ready","failed"]),ePe=u.object({title:u.string().min(1),body:u.string().min(1),files:u.array(u.string()).optional()}),tPe=u.object({status:s9,url:u.string().nullable(),url_expires_at:u.string().nullable(),generated_at:u.string().nullable(),model:u.string().nullable()}),nPe=u.object({status:i9,steps:u.array(ePe),generated_at:u.string().nullable()}),rPe=u.object({remix_of_thread_id:u.string().nullable(),remix_count:u.number().int().nonnegative()}),oPe=u.object({cover:tPe,how_to:nPe,lineage:rPe}),sPe=u.enum(["asked","requested","decided","corrected","shared"]),iPe=u.object({id:u.string().min(1),kind:sPe,summary:u.string().min(1),block_id:u.string().min(1)}),aPe=u.object({type:u.literal("list"),list_type:u.literal("thread_decision"),status:o9,generated_at:u.string().nullable(),objects:u.array(iPe)}),hl=u.object({id:u.string().min(1),thread_file_id:u.string().min(1),organization_id:u.string().min(1),author:bC,repo:u.string().min(1),title:u.string().min(1),started_at:u.string().min(1),blocks:n9,user_message_count:u.number().int().nonnegative(),files_touched:u.array(u.string()),skills_invoked:u.array(u.string()),harness:gi,transcript_parsing_state:u.enum(["pending","parsed","too_large_to_parse"]),visibility:u.enum(["private","workspace","public"]),has_plan:u.boolean().optional(),summary:u.string().nullable(),summary_status:XCe,summary_generated_at:u.string().nullable(),title_status:JCe,title_generated_at:u.string().nullable(),title_source:ZCe,decisions_status:o9,decisions_generated_at:u.string().nullable(),score:u.number().int(),up_count:u.number().int().nonnegative(),down_count:u.number().int().nonnegative(),viewer_vote:r9,comment_count:u.number().int().nonnegative(),is_favorited:u.boolean(),card:oPe}),cPe=u.object({storage_url:u.string().min(1)}),uPe=u.object({storage_url:u.string(),harness:gi,thread:hl.nullable()}),lPe=u.object({status:u.literal("complete"),thread_files:u.array(uPe)}),pPe=u.object({id:u.string(),presigned_url:u.string().nullable(),presigned_url_expires_at:u.string().nullable(),storage_url:u.string(),harness:gi,expected_md5:u.string(),error:u.string().nullable(),thread:hl.nullable()}),dPe=u.object({id:u.string(),substrate:u.enum(["s3","filesystem"]),status:u.enum(["incomplete","locked_for_parsing","complete","error"]),thread_files:u.array(pPe)}),_Pe=u.object({visibility:u.enum(["private","workspace","public"]).optional(),title:u.string().trim().min(1).max(200).optional()}).refine(t=>t.visibility!==void 0||t.title!==void 0,{message:"At least one of visibility or title must be provided"}),fPe=u.discriminatedUnion("visibility",[u.object({visibility:u.literal("private")}),u.object({visibility:u.literal("workspace")}),u.object({visibility:u.literal("public"),title:u.string().min(1),author_display_name:u.string().min(1),first_user_message:u.string().nullable(),summary:u.string().nullable(),started_at:u.string().min(1),harness:gi})]),mPe=hl,q3=u.object({type:u.literal("list"),list_type:u.literal("thread"),has_more:u.boolean(),objects:u.array(mPe)}),hPe=u.enum(["recent","popular"]),TPe=hl,EPe=u.object({type:u.literal("list"),list_type:u.literal("discover_thread"),has_more:u.boolean(),objects:u.array(TPe)}),SPe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional(),sort:hPe.optional(),harness:gi.optional(),search:u.string().max(200).optional()}),gPe=u.object({thread_count:u.number().int().nonnegative(),author_count:u.number().int().nonnegative(),organization_count:u.number().int().nonnegative(),harness_breakdown:u.record(gi,u.number().int().nonnegative())}),APe=u.object({id:u.string(),status:u.enum(["incomplete","locked_for_parsing","complete","error"]),created_at:u.string(),thread_count:u.number().int().nonnegative()}),RPe=u.object({type:u.literal("list"),list_type:u.literal("upload_session"),objects:u.array(APe)}),yPe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional()}),IPe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional(),author_ids:u.string().min(1).optional(),created_at:u.string().min(1).optional(),filepath_prefixes:u.string().min(1).optional()}),OPe=u.object({path:u.string().min(1),start_offset:u.number().int().nonnegative(),end_offset:u.number().int().positive()}),NPe=u.object({name:u.string(),usage_count:u.number().int().nonnegative(),author_count:u.number().int().nonnegative(),first_used_at:u.string().nullable(),last_used_at:u.string().nullable(),usage_count_last_24h:u.number().int().nonnegative(),usage_count_last_7d:u.number().int().nonnegative()}),bPe=u.object({type:u.literal("list"),list_type:u.literal("skill"),objects:u.array(NPe)}),CPe=u.object({id:u.string(),title:u.string(),visibility:u.enum(["private","workspace","public"]),started_at:u.string(),author:bC,skills_invoked:u.array(u.string())}),PPe=u.object({name:u.string(),usage_count:u.number().int().nonnegative(),author_count:u.number().int().nonnegative(),first_used_at:u.string().nullable(),last_used_at:u.string().nullable(),threads:u.array(CPe)}),MPe=u.object({path:u.string().min(1),text:u.string().max(64e3)}),xPe=u.enum(["text_edit","redact","delete_block"]),vPe=u.object({id:u.string(),thread_block_id:u.string(),editor:u.object({id:u.string(),display_name:u.string()}),kind:xPe,path:u.string().nullable(),previous_text:u.string().nullable(),new_text:u.string().nullable(),created_at:u.string()}),LPe=u.object({type:u.literal("list"),list_type:u.literal("thread_block_edit"),objects:u.array(vPe)}),DPe=u.object({organization_count:u.number().int().nonnegative(),user_count:u.number().int().nonnegative(),thread_count:u.number().int().nonnegative(),thread_count_last_24h:u.number().int().nonnegative(),user_count_last_24h:u.number().int().nonnegative()}),UPe=u.object({id:u.string(),name:u.string(),email_domains:u.array(u.string()),stytch_org_id:u.string(),member_count:u.number().int().nonnegative(),thread_count:u.number().int().nonnegative(),default_thread_visibility:u.enum(["private","workspace","public"]),created_at:u.string()}),wPe=u.object({type:u.literal("list"),list_type:u.literal("admin_organization"),objects:u.array(UPe)}),a9=u.object({id:u.string(),name:u.string()}),kPe=u.object({id:u.string(),display_name:u.string(),stytch_id:u.string().nullable(),thread_count:u.number().int().nonnegative(),onboarded_at:u.string().nullable(),created_at:u.string(),organizations:u.array(a9)}),GPe=u.object({type:u.literal("list"),list_type:u.literal("admin_user"),objects:u.array(kPe)}),BPe=u.object({id:u.string(),title:u.string(),started_at:u.string(),created_at:u.string(),deleted_at:u.string().nullable(),visibility:u.enum(["private","workspace","public"]),harness:gi,author:bC,organization:a9}),jPe=u.object({type:u.literal("list"),list_type:u.literal("admin_thread"),has_more:u.boolean(),objects:u.array(BPe)}),HPe=u.object({before:u.string().min(1).optional(),after:u.string().min(1).optional()}),$3=u.object({token:u.string().min(1),thread_id:u.string().min(1)}),FPe=u.object({visitor:u.string().min(1).max(64).optional()}),VPe=u.object({user_id:u.string(),display_name:u.string(),shares_sent:u.number().int().nonnegative(),unique_viewers:u.number().int().nonnegative(),attributed_signups:u.number().int().nonnegative()}),qPe=u.object({window_days:u.number().int().positive(),shares_sent:u.number().int().nonnegative(),unique_viewers:u.number().int().nonnegative(),attributed_signups:u.number().int().nonnegative(),active_sharers:u.number().int().nonnegative(),k_factor:u.number().nullable(),shares_sent_sparkline:u.array(u.number().int().nonnegative()),top_sharers:u.array(VPe)}),$Pe=u.object({windows:u.array(qPe)}),YPe=u.object({quoted_text:u.string().min(1),comment:u.string().nullable(),type:u.enum(["comment","highlight:trapdoor"])}),WPe=t9,zPe=e9.extend({comment_thread_id:u.string().min(1)}),KPe=u.object({markdown:u.string().min(1)}),QPe=u.object({storage_url:u.string().min(1),thread_file_id:u.string().min(1),parsed_plan_block:F3,critiqued_plan_block:F3,annotations:u.array(YPe),comment_threads:u.array(WPe),comments:u.array(zPe)}),Tl=u.enum(SC),c9=u.object({skills:u.boolean(),workspace_scope:u.boolean(),review:u.boolean(),shared_thread_ttl_days:u.number().int().positive().nullable()}),NC=u.object({subject_type:u.enum(["user","organization"]),subject_id:u.string().min(1),effective_plan:Tl,admin_override:Tl.nullable(),stripe_subscription_status:u.string().nullable(),cancel_at_period_end:u.boolean(),current_period_end:u.string().nullable(),seat_quantity:u.number().int().positive(),member_count:u.number().int().nonnegative().nullable(),features:c9}),XPe=u.object({effective_plan:Tl,features:c9,user:NC,organization:NC.nullable()}),JPe=u.object({plan:u.enum(["creator","team"]),seat_quantity:u.number().int().positive().optional()}),ZPe=u.object({checkout_url:u.string().min(1)}),eMe=u.object({portal_url:u.string().min(1)}),tMe=u.object({seat_quantity:u.number().int().positive()}),Y3=u.object({plan:Tl.nullable()}),ZS=u.object({subject_type:u.enum(["user","organization"]),subject_id:u.string().min(1),label:u.string().min(1),effective_plan:Tl,admin_override:Tl.nullable(),stripe_subscription_status:u.string().nullable(),seat_quantity:u.number().int().positive()}),nMe=u.object({users:u.array(ZS),organizations:u.array(ZS)}),rMe=u.object({id:u.string().min(1),display_name:u.string().min(1),handle:u.string().nullable(),avatar_url:u.string().nullable()}),oMe=u.object({thread_id:u.string().min(1),title:u.string().min(1),author:rMe,last_active_at:u.string().datetime(),last_block_excerpt:u.string().nullable(),last_block_kind:u.string().min(1).nullable(),is_streaming:u.boolean()}),sMe=u.object({type:u.literal("list"),list_type:u.literal("live_thread"),objects:u.array(oMe)}),iMe=u.object({thread_id:u.string().min(1)}),aMe=u.object({thread_id:u.string().min(1),last_seen_at:u.string().datetime(),started_at:u.string().datetime()}),cMe=u.object({follower_id:u.string().min(1),followee_id:u.string().min(1),is_following:u.literal(!0),follower_count:u.number().int().nonnegative()}),uMe=u.object({follower_id:u.string().min(1),followee_id:u.string().min(1),is_following:u.literal(!1),follower_count:u.number().int().nonnegative()}),u9=u.object({id:u.string().min(1),display_name:u.string().min(1),handle:u.string().nullable(),avatar_url:u.string().nullable(),bio:u.string().max(280).nullable(),is_following:u.boolean(),is_self:u.boolean()}),W3=u.object({type:u.literal("list"),list_type:u.literal("user_follow"),objects:u.array(u9)}),lMe=u.object({date:u.string().regex(/^\d{4}-\d{2}-\d{2}$/),count:u.number().int().nonnegative()}),pMe=u.object({window_start:u.string().datetime(),window_end:u.string().datetime(),total_contributions:u.number().int().nonnegative(),days_active:u.number().int().nonnegative(),daily_average:u.number().nonnegative(),current_streak_days:u.number().int().nonnegative(),days:u.array(lMe)}),dMe=u.object({type:u.literal("thread_created"),occurred_at:u.string().datetime(),id:u.string().min(1),thread:u.object({id:u.string().min(1),title:u.string(),visibility:u.enum(["private","workspace","public"])})}),_Me=u.object({type:u.literal("comment_posted"),occurred_at:u.string().datetime(),id:u.string().min(1),comment_excerpt:u.string(),thread:u.object({id:u.string().min(1),title:u.string(),visibility:u.enum(["private","workspace","public"])})}),fMe=u.object({type:u.literal("project_published"),occurred_at:u.string().datetime(),id:u.string().min(1),project:u.object({id:u.string().min(1),name:u.string().min(1)})}),mMe=u.object({type:u.literal("user_followed"),occurred_at:u.string().datetime(),id:u.string().min(1),followee:u9}),hMe=u.discriminatedUnion("type",[dMe,_Me,fMe,mMe]),TMe=u.object({type:u.literal("list"),list_type:u.literal("user_activity"),objects:u.array(hMe)}),EMe=u.object({id:u.string().min(1),name:u.string().min(1),excerpt:u.string(),published_at:u.string().datetime(),updated_at:u.string().datetime()}),SMe=u.object({type:u.literal("list"),list_type:u.literal("profile_published_project"),objects:u.array(EMe)}),z3=u.object({id:u.string().min(1),published_at:u.string().datetime().nullable()}),gMe=u.enum(["avatar","banner"]),AMe=u.enum(["image/png","image/jpeg","image/webp","image/gif"]),RMe=u.object({kind:gMe,content_type:AMe,base64_data:u.string().min(1)}),yMe=u.object({substrate:u.enum(["s3","filesystem"]),storage_url:u.string().min(1)}),IMe=Q3,l9=zbe.router({health:{method:"GET",path:"/health",responses:{200:u.object({status:u.literal("ok")})},summary:"Health check"},whoAmI:{method:"GET",path:"/whoami",headers:u.object({authorization:u.string().min(1).optional(),"x-lore-referral-token":u.string().min(1).max(16).optional()}),responses:{200:Jbe,401:A},summary:"Validate a Stytch B2B Bearer token and return member plus user fields"},recordHeartbeat:{method:"POST",path:"/heartbeat",headers:u.object({authorization:u.string().min(1).optional()}),body:iMe,responses:{200:aMe,401:A,403:A,404:A,422:A},summary:"Record (or refresh) a presence heartbeat for the authenticated user against one of their own threads. Idempotent; the daemon should call this every ~30s while a session is open."},listLiveThreads:{method:"GET",path:"/threads/live",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:sMe,401:A,403:A},summary:"List teammates with activity in the last 5 minutes. Excludes the requester. Org-scoped, deduped per author, max 10."},listThreads:{method:"GET",path:"/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:IPe,responses:{200:q3,401:A},summary:"List threads visible to the authenticated user"},getThread:{method:"GET",path:"/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:hl,404:A},summary:"Load a visible thread by id"},getSimilarThreads:{method:"GET",path:"/threads/:id/similar",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:q3,404:A,409:A},summary:"List the top 20 visible threads with the closest summary embedding"},listThreadBlocks:{method:"GET",path:"/threads/:id/blocks",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),query:yPe,responses:{200:n9,401:A},summary:"List blocks for a visible thread"},createThreadBlockCommentThread:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:TCe,responses:{201:ECe,401:A,404:A},summary:"Create a new block-level comment thread on a visible thread block"},createThreadBlockComment:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId/comments",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1),commentThreadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:ACe,responses:{201:RCe,401:A,404:A,409:A},summary:"Reply to a block-level comment thread on a visible thread block"},updateThreadBlockCommentThread:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1),commentThreadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:OCe,responses:{200:NCe,401:A,404:A},summary:"Resolve or reopen a block-level comment thread on a visible thread block"},listSkills:{method:"GET",path:"/skills",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:bPe,401:A},summary:"Aggregate skill usage across threads the viewer can see"},getSkillDetail:{method:"GET",path:"/skills/:name",pathParams:u.object({name:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:PPe,401:A,404:A},summary:"Per-skill detail: usage stats + visible threads that invoked it"},redactThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/redactions",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:OPe,responses:{200:t_,401:A,403:A,404:A,422:A},summary:"Permanently redact a character range within a text field of a thread block (author only)"},updateThreadBlockText:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/text",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:MPe,responses:{200:t_,401:A,403:A,404:A,422:A},summary:"Replace a single text leaf in a thread block with new content (author only)"},critiqueThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/critique",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:t_,401:A,403:A,404:A,409:A,422:A},summary:"Critique a plan block once and persist its annotations as nested comment threads (author only)"},deleteThreadBlock:{method:"DELETE",path:"/threads/:threadId/blocks/:blockId",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.null(),401:A,403:A,404:A},summary:"Soft-delete a thread block (author only)"},listThreadBlockEdits:{method:"GET",path:"/threads/:threadId/blocks/:blockId/edits",pathParams:u.object({threadId:u.string().min(1),blockId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:LPe,401:A,404:A},summary:"List edits made to a thread block (visible to anyone who can see the thread)"},listThreadDecisions:{method:"GET",path:"/threads/:id/decisions",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:aPe,401:A,404:A},summary:"List AI-extracted user decisions for a thread, in chronological order"},updateThread:{method:"PATCH",path:"/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:_Pe,responses:{200:hl,401:A,403:A,404:A},summary:"Update thread visibility (author only)"},deleteThread:{method:"DELETE",path:"/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.null(),401:A,403:A,404:A},summary:"Soft-delete a thread (author only)"},generateThreadCard:{method:"POST",path:"/threads/:id/card/generate",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:u.object({cover_status:s9,how_to_status:i9}),401:A,403:A,404:A,429:A.extend({retry_after_seconds:u.number().int().nonnegative()})},summary:"Enqueue cover image + how-to recipe generation for the thread. Author-only. Idempotent \u2014 recently-fired statuses are not double-enqueued. Rate-limited: at most one cover generation per minute per thread (cooldown begins when the previous cover finishes). Used to populate cards on legacy threads (created before Lore Cards) and to retry after a 'failed' status or opt back in from 'disabled'."},castThreadVote:{method:"PUT",path:"/threads/:id/vote",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:VCe,responses:{200:V3,401:A,403:A,404:A,422:A},summary:"Cast or change the caller's up/down vote on a public thread. Idempotent \u2014 re-casting the same value is a no-op."},clearThreadVote:{method:"DELETE",path:"/threads/:id/vote",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:V3,401:A,404:A},summary:"Clear the caller's vote on a thread. No-op when the caller hasn't voted."},listThreadComments:{method:"GET",path:"/threads/:threadId/comments",pathParams:u.object({threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:$Ce,403:A,404:A},summary:"List all (live + soft-deleted as tombstones) comments on a public thread, flat with parent_comment_id pointers."},createThreadComment:{method:"POST",path:"/threads/:threadId/comments",pathParams:u.object({threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:YCe,responses:{201:WCe,401:A,403:A,404:A,422:A},summary:"Post a top-level or reply comment on a public thread."},updateThreadComment:{method:"PATCH",path:"/threads/:threadId/comments/:commentId",pathParams:u.object({threadId:u.string().min(1),commentId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:zCe,responses:{200:KCe,401:A,403:A,404:A,422:A},summary:"Edit your own thread comment (author only; rejects edits to soft-deleted rows)."},deleteThreadComment:{method:"DELETE",path:"/threads/:threadId/comments/:commentId",pathParams:u.object({threadId:u.string().min(1),commentId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:QCe,401:A,403:A,404:A},summary:"Soft-delete your own thread comment (author only). Idempotent."},getThreadPreview:{method:"GET",path:"/threads/:id/preview",pathParams:u.object({id:u.string().min(1)}),responses:{200:fPe,404:A},summary:"Unauthenticated, visibility-redacted metadata for OG / social preview consumers"},createUser:{method:"POST",path:"/users",headers:u.object({authorization:u.string().min(1).optional()}),body:cCe,responses:{201:OC,401:A},summary:"Create a user record with ApiKey authentication"},getUser:{method:"GET",path:"/users/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:Q3,404:A},summary:"Public profile for a user. Optional auth \u2014 unauthenticated viewers see only public thread metadata; signed-in viewers see counts scoped to the threads they'd normally be able to access."},updateCurrentUser:{method:"PATCH",path:"/users/me",headers:u.object({authorization:u.string().min(1).optional()}),body:Zbe,responses:{200:OC,401:A,409:A,422:A},summary:"Update the authenticated user profile"},getUserByHandle:{method:"GET",path:"/users/by-handle/:handle",pathParams:u.object({handle:K3}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:IMe,404:A},summary:"Resolve a public profile by handle \u2014 same shape as GET /users/:id but keyed on the user's chosen handle."},listUserActivity:{method:"GET",path:"/users/:id/activity",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),query:u.object({limit:u.coerce.number().int().positive().max(100).optional()}),responses:{200:TMe,404:A},summary:"Reverse-chronological activity feed for a user, scoped to what the viewer can see (same visibility rules as listThreads)."},getUserContributions:{method:"GET",path:"/users/:id/contributions",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:pMe,404:A},summary:"Daily contribution counts for the trailing 365 days \u2014 counts thread blocks the user authored on threads visible to the viewer."},listUserFollowers:{method:"GET",path:"/users/:id/followers",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:W3,404:A},summary:"List the users following a given user."},listUserFollowing:{method:"GET",path:"/users/:id/following",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:W3,404:A},summary:"List the users a given user is following."},followUser:{method:"POST",path:"/users/:id/follow",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:cMe,401:A,404:A,409:A,422:A},summary:"Follow another user. Idempotent \u2014 repeating the call is a no-op."},unfollowUser:{method:"DELETE",path:"/users/:id/follow",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:uMe,401:A,404:A},summary:"Unfollow a user. Idempotent \u2014 repeating the call is a no-op."},listProfilePublishedProjects:{method:"GET",path:"/users/:id/projects",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:SMe,404:A},summary:"Projects the user has published to their public profile."},publishProject:{method:"POST",path:"/projects/:id/publish",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:z3,401:A,403:A,404:A},summary:"Publish a project to the author's public profile. Stamps published_at with `now()`. Author-only."},unpublishProject:{method:"DELETE",path:"/projects/:id/publish",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{200:z3,401:A,403:A,404:A},summary:"Remove a project from the author's public profile."},uploadProfileImage:{method:"POST",path:"/users/me/profile-image",headers:u.object({authorization:u.string().min(1).optional()}),body:RMe,responses:{200:yMe,401:A,413:A,422:A},summary:"Upload an avatar or banner image (base64-encoded JSON body). The API streams the bytes to its configured storage substrate using its own credentials and returns the canonical storage URL the client passes to PATCH /users/me."},listOrganizationMembers:{method:"GET",path:"/organization/members",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:tCe,401:A},summary:"List members of the authenticated user\u2019s organization"},createOrganizationInvite:{method:"POST",path:"/organization/invites",headers:u.object({authorization:u.string().min(1).optional()}),body:nCe,responses:{201:rCe,401:A,403:A,409:A,422:A},summary:"Invite a teammate to the authenticated user\u2019s workspace via Stytch B2B"},listRepositories:{method:"GET",path:"/repositories",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:wCe,401:A,403:A},summary:"List repositories known to the authenticated user\u2019s organization across threads and building blocks"},createBuildingBlockSnapshots:{method:"POST",path:"/building_blocks",headers:u.object({authorization:u.string().min(1).optional()}),body:lCe,responses:{201:xCe,401:A,403:A},summary:"Create building block snapshots for the authenticated user\u2019s organization"},getPlan:{method:"GET",path:"/plans/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:CCe,401:A,403:A,404:A},summary:"Load a thread-backed plan container visible to the authenticated user, including all visible plan revisions in that thread"},createPlanCommentThread:{method:"POST",path:"/plans/:id/comment-threads",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:mCe,responses:{201:hCe,401:A,403:A,404:A,422:A},summary:"Create a new inline comment thread on a specific revision inside a thread-backed plan container"},createPlanComment:{method:"POST",path:"/plans/:id/comment-threads/:threadId/comments",pathParams:u.object({id:u.string().min(1),threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:SCe,responses:{201:gCe,401:A,403:A,404:A,409:A},summary:"Reply to an inline comment thread on a thread-backed plan container"},updatePlanCommentThread:{method:"PATCH",path:"/plans/:id/comment-threads/:threadId",pathParams:u.object({id:u.string().min(1),threadId:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:yCe,responses:{200:ICe,401:A,403:A,404:A},summary:"Resolve or reopen an inline comment thread on a thread-backed plan container"},listPlans:{method:"GET",path:"/plans",headers:u.object({authorization:u.string().min(1).optional()}),query:MCe,responses:{200:PCe,401:A,403:A},summary:"List thread-backed plan containers visible to the authenticated user in their organization, ordered by latest visible revision and optionally filtered by author or repository"},listBuildingBlockSnapshots:{method:"GET",path:"/building_blocks",headers:u.object({authorization:u.string().min(1).optional()}),query:LCe,responses:{200:vCe,401:A,403:A},summary:"List building block snapshots for the authenticated user\u2019s organization and repo origin path"},listUploadSessions:{method:"GET",path:"/upload_sessions",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:RPe,401:A},summary:"List recent upload sessions for the authenticated user"},createUploadSession:{method:"POST",path:"/upload_sessions",headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({thread_files:u.array(BCe).nonempty()}),responses:{201:dPe,400:A,401:A},summary:"Create an upload session with presigned URLs for file uploads"},completeUploadSession:{method:"POST",path:"/upload_sessions/:id/complete",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({thread_files:u.array(cPe).nonempty()}),responses:{200:lPe,400:A,401:A,404:A,409:A,422:A},summary:"Complete an upload session after files have been uploaded to storage"},adminStats:{method:"GET",path:"/admin/stats",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:DPe,401:A,403:A},summary:"Cross-org operational counts. Tanagram admins only."},adminListOrganizations:{method:"GET",path:"/admin/organizations",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:wPe,401:A,403:A},summary:"List every organization with member and thread counts. Tanagram admins only."},adminListUsers:{method:"GET",path:"/admin/users",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:GPe,401:A,403:A},summary:"List every user with their org memberships and thread count. Tanagram admins only."},adminListThreads:{method:"GET",path:"/admin/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:HPe,responses:{200:jPe,401:A,403:A},summary:"List live threads across every organization. Tanagram admins only."},adminHardDeleteThread:{method:"DELETE",path:"/admin/threads/:id",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{204:u.null(),401:A,403:A,404:A},summary:"Permanently remove a thread. Tanagram admins only."},listDiscoverThreads:{method:"GET",path:"/discover/threads",headers:u.object({authorization:u.string().min(1).optional()}),query:SPe,responses:{200:EPe},summary:"Feed of public threads with sort, harness filter, search, and cursor pagination. Auth is optional and populates viewer_vote."},discoverStats:{method:"GET",path:"/discover/stats",responses:{200:gPe},summary:"Unauthenticated rollup of public-thread counts for the Discover header."},createWaitlistEntry:{method:"POST",path:"/waitlist_entries",body:oCe,responses:{201:sCe,409:A},summary:"Create an unauthenticated waitlist entry keyed by (location, contact)."},createShareToken:{method:"POST",path:"/threads/:id/share-token",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({}).optional(),responses:{201:$3,401:A,403:A,404:A,409:A},summary:"Mint a short share-link token for a public thread. Author only. The token powers `/s/:token` short URLs and enables k-factor attribution."},resolveShareToken:{method:"GET",path:"/referrals/resolve/:token",pathParams:u.object({token:u.string().min(1).max(16)}),query:FPe,responses:{200:$3,404:A},summary:"Resolve a share-link token to its thread and record the view. Unauthenticated by design."},adminGrowth:{method:"GET",path:"/admin/growth",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:$Pe,401:A,403:A},summary:"Share-link k-factor, funnel, sparkline, and top sharers by window. Tanagram admins only."},adminRunCritiquePlayground:{method:"POST",path:"/admin/critique-playground/run",headers:u.object({authorization:u.string().min(1).optional()}),body:KPe,responses:{200:QPe,401:A,403:A,409:A},summary:"Admin-only critique playground that saves markdown to a file:// plan artifact and returns parsed + critiqued plan blocks."},getBillingState:{method:"GET",path:"/billing/state",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:XPe,401:A},summary:"Resolve the caller's plan, features, seat count, and any admin override."},createBillingCheckout:{method:"POST",path:"/billing/checkout",headers:u.object({authorization:u.string().min(1).optional()}),body:JPe,responses:{200:ZPe,400:A,401:A,403:A,503:A},summary:"Start a Stripe Checkout session for Creator ($29/mo) or Team ($19/seat/mo, min 2)."},createBillingPortal:{method:"POST",path:"/billing/portal",headers:u.object({authorization:u.string().min(1).optional()}),body:u.object({subject_type:u.enum(["user","organization"]).default("user")}).optional(),responses:{200:eMe,401:A,404:A,503:A},summary:"Open the Stripe customer portal so the subject can manage their subscription."},updateTeamSeats:{method:"PATCH",path:"/billing/team-seats",headers:u.object({authorization:u.string().min(1).optional()}),body:tMe,responses:{200:NC,400:A,401:A,403:A,404:A,503:A},summary:"Adjust the caller-organization's Team seat quantity (admin of that org only)."},adminListBilling:{method:"GET",path:"/admin/billing",headers:u.object({authorization:u.string().min(1).optional()}),responses:{200:nMe,401:A,403:A},summary:"List every user and org with current plan + override for the admin panel."},adminSetUserPlanOverride:{method:"PUT",path:"/admin/billing/users/:id/override",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:Y3,responses:{200:ZS,401:A,403:A,404:A},summary:"Admin override for a user's plan tier. Null clears the override."},adminSetOrganizationPlanOverride:{method:"PUT",path:"/admin/billing/organizations/:id/override",pathParams:u.object({id:u.string().min(1)}),headers:u.object({authorization:u.string().min(1).optional()}),body:Y3,responses:{200:ZS,401:A,403:A,404:A},summary:"Admin override for an organization's plan tier. Null clears the override."},projects:k3,docs:U3,mentions:G3,favorites:j3,search:H3},{pathPrefix:"/api"});import n_ from"node:fs";import p9 from"node:path";function tg(){return p9.join(Zo(),"token")}function CC(){let t;try{t=n_.readFileSync(tg(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return{token:"",source:"none"};throw n}let e=t.trim();return!e||NMe(e,new Date)?{token:"",source:"none"}:{token:e,source:"file"}}function ng(){return CC().token}function d9(){return n_.existsSync(tg())}function _9(t){let e=tg();n_.mkdirSync(p9.dirname(e),{recursive:!0,mode:448}),n_.writeFileSync(e,t,{mode:384})}function f9(){try{n_.rmSync(tg())}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return;throw t}}function OMe(t){let e=t.split(".");if(e.length<2)throw new Error("invalid JWT format");return JSON.parse(Buffer.from(e[1],"base64url").toString("utf8"))}function NMe(t,e){let n;try{n=OMe(t)}catch{return!1}let r=n["https://stytch.com/session"]?.expires_at;if(typeof r!="string")return!1;let o=Date.parse(r.trim());return Number.isNaN(o)?!1:e.getTime()>=o}var bMe={dev:"http://localhost:4000",prod:"https://lore.tanagram.ai"};function Ai(t={}){let e=t.token??ng();return EC(l9,{baseUrl:bMe[xt()],baseHeaders:{"User-Agent":B4(),...e?{authorization:`Bearer ${e}`}:{}}})}var m9={meta:{name:"health",description:"Check API health"},async run({data:t}){pt.info("command_start",{command:"health"});let n=await(t?.client??Ai()).health();if(n.status===200){console.log(n.body.status);return}throw pt.error("health_failed",{status:n.status}),console.error(`health check failed: HTTP ${n.status}`),new Error(`health check failed: HTTP ${n.status}`)}};var h9={meta:{name:"hello",description:"Print a friendly greeting"},run(){pt.info("command_start",{command:"hello"}),console.log("hello world")}};import{spawn as PMe}from"node:child_process";import S9 from"node:crypto";import MMe from"node:http";var CMe={dev:"http://localhost:8080",prod:"https://lore.tanagram.ai"};function T9(){return CMe[xt()]}var xMe=5*60*1e3;function vMe(){return S9.randomBytes(32).toString("base64url")}function LMe(t){return S9.createHash("sha256").update(t).digest("base64url")}function DMe(t){let e;try{e=JSON.parse(Buffer.from(t.trim(),"base64url").toString("utf8"))}catch(n){throw new Error(`decoding: ${n instanceof Error?n.message:String(n)}`)}if(typeof e.session_jwt!="string"||!e.session_jwt)throw new Error("missing session token");if(typeof e.code_challenge!="string"||!e.code_challenge)throw new Error("missing code challenge");return{sessionJwt:e.session_jwt,codeChallenge:e.code_challenge}}function UMe(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function E9(t,e,n){let r=e==="success";t.writeHead(200,{"Content-Type":"text/html"}),t.end(`<!DOCTYPE html>
43
82
  <html><head><meta charset="utf-8"><title>Lore CLI</title></head>
44
83
  <body style="font-family:system-ui;display:flex;justify-content:center;align-items:center;min-height:100vh;margin:0;background:#fafafa">
45
84
  <div style="text-align:center;max-width:400px;padding:40px;border:1px solid #e0e0e0;border-radius:10px;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,0.1)">
46
85
  <div style="font-size:48px;margin-bottom:20px">${r?"\u2713":"\u2717"}</div>
47
86
  <h1 style="margin:0 0 10px">${r?"Authorization Complete":"Authorization Cancelled"}</h1>
48
- <p style="color:#666">${r?"You can close this window now.":MCe(n??"Authorization was cancelled.")}</p>
87
+ <p style="color:#666">${r?"You can close this window now.":UMe(n??"Authorization was cancelled.")}</p>
49
88
  <p style="color:#999;font-size:14px">You can close this tab and return to your terminal.</p>
50
- </div></body></html>`)}async function xCe(){let t,e=new Promise(s=>{t=s}),n=NCe.createServer((s,i)=>{let a=new URL(s.url??"/","http://127.0.0.1");if(a.pathname!=="/callback"){i.writeHead(404),i.end();return}let c=a.searchParams.get("error");if(c){let p=a.searchParams.get("error_description")||c;p3(i,"error",p),t?.({type:"error",description:p});return}let l=a.searchParams.get("code");if(l){p3(i,"success"),t?.({type:"code",code:l});return}i.writeHead(400),i.end()});return await new Promise((s,i)=>{n.once("error",i),n.listen(0,"127.0.0.1",()=>{n.off("error",i),s()})}),{redirectURI:`http://127.0.0.1:${n.address().port}/callback`,waitForCallback(s){return new Promise((i,a)=>{let c=setTimeout(()=>{a(new Error("authorization timed out"))},s);e.then(l=>{clearTimeout(c),i(l)})})},close(){return new Promise((s,i)=>{n.close(a=>{if(a){i(a);return}s()})})}}}async function vCe(t){let{command:e,args:n}=LCe(process.platform,t);await new Promise((r,o)=>{let s=ICe(e,n,{detached:!0,stdio:"ignore"});s.once("error",o),s.once("spawn",()=>{s.unref(),r()})})}function LCe(t,e){return t==="win32"?{command:"rundll32",args:["url.dll,FileProtocolHandler",e]}:t==="darwin"?{command:"open",args:[e]}:{command:"xdg-open",args:[e]}}async function DCe(t){if(Wb().source==="none")return!1;try{return(await t.whoAmI({headers:{}})).status===200}catch{return!1}}async function UCe({client:t=ul(),openBrowser:e=vCe,setAccessToken:n=o3,webBaseURL:r=l3(),timeoutMs:o=OCe}={}){if(await DCe(t)){console.log(`
89
+ </div></body></html>`)}async function wMe(){let t,e=new Promise(s=>{t=s}),n=MMe.createServer((s,i)=>{let a=new URL(s.url??"/","http://127.0.0.1");if(a.pathname!=="/callback"){i.writeHead(404),i.end();return}let c=a.searchParams.get("error");if(c){let p=a.searchParams.get("error_description")||c;E9(i,"error",p),t?.({type:"error",description:p});return}let l=a.searchParams.get("code");if(l){E9(i,"success"),t?.({type:"code",code:l});return}i.writeHead(400),i.end()});return await new Promise((s,i)=>{n.once("error",i),n.listen(0,"127.0.0.1",()=>{n.off("error",i),s()})}),{redirectURI:`http://127.0.0.1:${n.address().port}/callback`,waitForCallback(s){return new Promise((i,a)=>{let c=setTimeout(()=>{a(new Error("authorization timed out"))},s);e.then(l=>{clearTimeout(c),i(l)})})},close(){return new Promise((s,i)=>{n.close(a=>{if(a){i(a);return}s()})})}}}async function kMe(t){let{command:e,args:n}=GMe(process.platform,t);await new Promise((r,o)=>{let s=PMe(e,n,{detached:!0,stdio:"ignore"});s.once("error",o),s.once("spawn",()=>{s.unref(),r()})})}function GMe(t,e){return t==="win32"?{command:"rundll32",args:["url.dll,FileProtocolHandler",e]}:t==="darwin"?{command:"open",args:[e]}:{command:"xdg-open",args:[e]}}async function BMe(t){if(CC().source==="none")return!1;try{return(await t.whoAmI({headers:{}})).status===200}catch{return!1}}async function jMe({client:t=Ai(),openBrowser:e=kMe,setAccessToken:n=_9,webBaseURL:r=T9(),timeoutMs:o=xMe}={}){if(await BMe(t)){console.log(`
51
90
  Already logged in. Use 'lore logout' if you want to sign out.
52
- `);return}let s=bCe(),i=CCe(s),a=await xCe();try{let c=new URL("/cli-authorize",r);c.searchParams.set("redirect_uri",a.redirectURI),c.searchParams.set("code_challenge",i),c.searchParams.set("code_challenge_method","S256");try{await e(c.toString()),console.log(`
91
+ `);return}let s=vMe(),i=LMe(s),a=await wMe();try{let c=new URL("/cli-authorize",r);c.searchParams.set("redirect_uri",a.redirectURI),c.searchParams.set("code_challenge",i),c.searchParams.set("code_challenge_method","S256");try{await e(c.toString()),console.log(`
53
92
  Opening browser to log in...`),console.log(`
54
- If your browser didn't open, visit:`)}catch(d){tn.warn("open_browser_failed",{error:d instanceof Error?d.message:String(d)}),console.log(`
93
+ If your browser didn't open, visit:`)}catch(d){pt.warn("open_browser_failed",{error:d instanceof Error?d.message:String(d)}),console.log(`
55
94
  Visit this URL to log in:`)}console.log(` ${c.toString()}
56
95
  `),console.log(" Waiting for authorization. Click Authorize in your browser...");let l=await a.waitForCallback(o);if(l.type==="error")throw console.log(`
57
96
  Authorization denied: ${l.description}
58
- `),new Error(l.description);let p=PCe(l.code);if(p.codeChallenge!==i)throw console.log(`
97
+ `),new Error(l.description);let p=DMe(l.code);if(p.codeChallenge!==i)throw console.log(`
59
98
  Authorization code verification failed.
60
99
  `),new Error("PKCE challenge mismatch");n(p.sessionJwt),console.log(`
61
100
  Logged in successfully.
62
101
  `)}catch(c){throw c instanceof Error&&c.message==="authorization timed out"&&console.log(`
63
102
  Authorization timed out. Please try again.
64
- `),c}finally{await a.close()}}var _3={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:t}){tn.info("command_start",{command:"login"}),await UCe({client:t?.client,openBrowser:t?.openBrowser,setAccessToken:t?.setAccessToken,webBaseURL:t?.webBaseURL,timeoutMs:t?.timeoutMs})}};var f3={meta:{name:"logout",description:"Log out of your Lore workspace"},run(){tn.info("command_start",{command:"logout"});let t=r3();if(s3(),!t){console.log(`
103
+ `),c}finally{await a.close()}}var g9={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:t}){pt.info("command_start",{command:"login"}),await jMe({client:t?.client,openBrowser:t?.openBrowser,setAccessToken:t?.setAccessToken,webBaseURL:t?.webBaseURL,timeoutMs:t?.timeoutMs})}};var A9={meta:{name:"logout",description:"Log out of your Lore workspace"},run(){pt.info("command_start",{command:"logout"});let t=d9();if(f9(),!t){console.log(`
65
104
  Not currently logged in.
66
105
  `);return}console.log(`
67
106
  Logged out successfully.
68
- `)}};var m3={meta:{name:"logs",description:"Print the path to the log file"},run(){tn.info("command_start",{command:"logs"}),console.log(LS())}};import{promises as mi}from"node:fs";import wCe from"node:os";import wa from"node:path";import{fileURLToPath as T3}from"node:url";function Kb(){return wa.join(wCe.homedir(),".claude","skills")}function h3(t){return t.map(e=>e.name).sort().join(", ")}function E3(t){return t[0]?wa.dirname(t[0].destination):Kb()}async function kCe(t){try{return(await mi.stat(t)).isDirectory()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function S3(){let t=[T3(new URL("../skills",import.meta.url)),T3(new URL("../../skills",import.meta.url))];for(let e of t)if(await kCe(e))return e;throw new Error("bundled skills directory not found")}function GCe(t,e){let n=t.match(/^(---\r?\n)([\s\S]*?)(\r?\n---(?:\r?\n|$))/);if(!n)throw new Error("skill file is missing frontmatter");let[,r,o,s]=n,i=o.replace(/^name: .*$/m,`name: ${e}`);if(i===o)throw new Error("skill file frontmatter is missing a name");return`${r}${i}${s}${t.slice(n[0].length)}`}async function BCe({destination:t=Kb(),environment:e=jt(),sourceDir:n}={}){let r=n??await S3(),o=(await mi.readdir(r,{withFileTypes:!0})).filter(a=>a.isDirectory()),s=e==="prod"?"":`-${e}`,i=[];await mi.mkdir(t,{recursive:!0});for(let a of o){let c=`${a.name}${s}`,l=wa.join(r,a.name),p=wa.join(t,c);if(await mi.cp(l,p,{recursive:!0,force:!0}),s){let d=wa.join(p,"SKILL.md"),_=await mi.readFile(d,"utf8");await mi.writeFile(d,GCe(_,c))}i.push({name:c,source:l,destination:p})}return i}async function jCe({destination:t=Kb(),environment:e=jt(),sourceDir:n}={}){let r=n??await S3(),o=(await mi.readdir(r,{withFileTypes:!0})).filter(a=>a.isDirectory()),s=e==="prod"?"":`-${e}`,i=[];for(let a of o){let c=`${a.name}${s}`,l=wa.join(r,a.name),p=wa.join(t,c);await mi.rm(p,{recursive:!0,force:!0}),i.push({name:c,source:l,destination:p})}return i}var g3={meta:{name:"postinstall:install-skills",hidden:!0},args:{destination:{type:"positional",required:!1,description:"Install destination"}},async run({args:t}){let e=await BCe({destination:t.destination});console.log(`installed skills ${h3(e)} to ${E3(e)}`)}},A3={meta:{name:"postinstall:uninstall-skills",hidden:!0},args:{destination:{type:"positional",required:!1,description:"Install destination"}},async run({args:t}){let e=await jCe({destination:t.destination});console.log(`uninstalled skills ${h3(e)} from ${E3(e)}`)}};var R3={meta:{name:"whoami",description:"Print the authenticated Lore user",hidden:!0},async run({data:t}){tn.info("command_start",{command:"whoami"});let n=await(t?.client??ul()).whoAmI({headers:{}});if(n.status===200){console.log(n.body.emailAddress);return}throw console.error("Not authenticated. Run 'lore login' first."),new Error(`whoami failed: HTTP ${n.status}`)}};var HCe="phc_sMsUvf0nK50rZdztSlX9rDJqIreLcXj4dyGS0tORQpQ",VCe="https://phe.tanagram.ai/capture/",FCe=2e3;function y3(t){return process.env[t]??""}function qCe(t,e){let n=[t,e].filter(Boolean);return n.length>0?n.join("@"):"unknown-cli-user"}async function I3({commandName:t,durationMs:e}){let n=y3("USER"),r=y3("HOST"),o=new AbortController,s=setTimeout(()=>o.abort(),FCe);try{await fetch(VCe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:HCe,event:"lore.cli.command_run",properties:{distinct_id:qCe(n,r),command_name:t,cli_version:_S(),duration_ms:Math.round(e),environment:jt(),user:n,host:r}}),signal:o.signal})}catch(i){tn.warn("posthog_capture_failed",{command:t,error:i instanceof Error?i.message:String(i)})}finally{clearTimeout(s)}}var O3={hello:u3,health:c3,login:_3,logout:f3,whoami:R3,logs:m3,"postinstall:install-skills":g3,"postinstall:uninstall-skills":A3};function YCe(t){let e=t.find(n=>!n.startsWith("-"));return e||"hello"}var WCe={name:"cli-metrics",setup(t){t.data={...t.data,commandStartedAtMs:performance.now()}},async cleanup(t){let e=t.data?.commandStartedAtMs;if(typeof e!="number")return;let n=performance.now()-e;await(t.data?.captureCliCommandMetric??I3)({commandName:YCe(t.rawArgs),durationMs:n})}},Qb={meta:{name:"lore",description:"Lore CLI"},plugins:[WCe],subCommands:O3,default:"hello"};function N3(t){return t instanceof Error&&t.name==="CLIError"}function zCe(t){let e=t.find(r=>!r.startsWith("-")),n=e?O3[e]:void 0;return n?[n,Qb]:[Qb,void 0]}async function KCe(t){try{if(t.includes("--help")||t.includes("-h")){console.log(await c4(...zCe(t)));return}await ES(Qb,{rawArgs:t})}catch(e){if(N3(e)||jt()==="prod"&&e instanceof Error?console.error(e.message):console.error(e,`
69
- `),!N3(e)){te(e),Ff(2e3).catch(()=>{}).finally(()=>{process.exit(1)});return}process.exit(1)}}process.argv[1]&&import.meta.url===$Ce(process.argv[1]).href&&await KCe(process.argv.slice(2));export{Qb as mainCommand};
107
+ `)}};var R9={meta:{name:"logs",description:"Print the path to the log file"},run(){pt.info("command_start",{command:"logs"}),console.log(US())}};import{promises as Ri}from"node:fs";import HMe from"node:os";import qa from"node:path";import{fileURLToPath as y9}from"node:url";function PC(){return qa.join(HMe.homedir(),".claude","skills")}function I9(t){return t.map(e=>e.name).sort().join(", ")}function O9(t){return t[0]?qa.dirname(t[0].destination):PC()}async function FMe(t){try{return(await Ri.stat(t)).isDirectory()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function N9(){let t=[y9(new URL("../skills",import.meta.url)),y9(new URL("../../skills",import.meta.url))];for(let e of t)if(await FMe(e))return e;throw new Error("bundled skills directory not found")}function VMe(t,e){let n=t.match(/^(---\r?\n)([\s\S]*?)(\r?\n---(?:\r?\n|$))/);if(!n)throw new Error("skill file is missing frontmatter");let[,r,o,s]=n,i=o.replace(/^name: .*$/m,`name: ${e}`);if(i===o)throw new Error("skill file frontmatter is missing a name");return`${r}${i}${s}${t.slice(n[0].length)}`}async function qMe({destination:t=PC(),environment:e=xt(),sourceDir:n}={}){let r=n??await N9(),o=(await Ri.readdir(r,{withFileTypes:!0})).filter(a=>a.isDirectory()),s=e==="prod"?"":`-${e}`,i=[];await Ri.mkdir(t,{recursive:!0});for(let a of o){let c=`${a.name}${s}`,l=qa.join(r,a.name),p=qa.join(t,c);if(await Ri.cp(l,p,{recursive:!0,force:!0}),s){let d=qa.join(p,"SKILL.md"),_=await Ri.readFile(d,"utf8");await Ri.writeFile(d,VMe(_,c))}i.push({name:c,source:l,destination:p})}return i}async function $Me({destination:t=PC(),environment:e=xt(),sourceDir:n}={}){let r=n??await N9(),o=(await Ri.readdir(r,{withFileTypes:!0})).filter(a=>a.isDirectory()),s=e==="prod"?"":`-${e}`,i=[];for(let a of o){let c=`${a.name}${s}`,l=qa.join(r,a.name),p=qa.join(t,c);await Ri.rm(p,{recursive:!0,force:!0}),i.push({name:c,source:l,destination:p})}return i}var b9={meta:{name:"postinstall:install-skills",hidden:!0},args:{destination:{type:"positional",required:!1,description:"Install destination"}},async run({args:t}){let e=await qMe({destination:t.destination});console.log(`installed skills ${I9(e)} to ${O9(e)}`)}},C9={meta:{name:"postinstall:uninstall-skills",hidden:!0},args:{destination:{type:"positional",required:!1,description:"Install destination"}},async run({args:t}){let e=await $Me({destination:t.destination});console.log(`uninstalled skills ${I9(e)} from ${O9(e)}`)}};import rg from"node:fs/promises";import YMe from"node:path";import{setTimeout as xC}from"node:timers/promises";var WMe=1e3,zMe=2*60*1e3,KMe=1e3,QMe=250,og=class extends Error{constructor(){super("lore is logged out")}};async function M9(t={}){let e=await cxe(),n=t.recorder??new jS,r=t.adapter??n3,o=t.client??Ai();await n.markRunning();let s=[],i=e,a=new Map,c=!1;try{let l=await x9({lastUploadedTimestamp:e.latestUploadedTimestamp,adapter:r,client:o,recorder:n});if(s=l.threadIDs,i=l.syncState,a=l.watchBaselineOverrides,c=l.loggedOut,c||await n.markSyncSuccess(s),!c&&s.length>0){let p=await XMe({syncState:i,baselineOverrides:a,adapter:r,client:o,recorder:n});s=[...s,...p.threadIDs],i=p.syncState,c=p.loggedOut}return c?await n.markLoggedOut():await n.markSuccess(s),s}catch(l){throw await n.markError(l),l}}async function x9(t){let e=[],n={latestUploadedTimestamp:t.lastUploadedTimestamp},r=new Map,o=!1;try{let s=await JMe(t);e=s.threadIDs,n=s.syncState,r=s.watchBaselineOverrides}catch(s){if(s instanceof og)o=!0,e=[],r=new Map;else throw await P9(n),s}return await P9(n),{threadIDs:e,syncState:n,watchBaselineOverrides:r,loggedOut:o}}async function XMe(t){let e=t.adapter.historyFilePath(),n=await es(e),r=await t.adapter.buildPendingTranscriptWatches(t.syncState.latestUploadedTimestamp,t.baselineOverrides);if(await t.recorder.setPendingWatchers(r),r.length===0)return await t.recorder.setPendingWatchers([]),{threadIDs:[],syncState:t.syncState,loggedOut:!1};let o=[],s=t.syncState;try{for(;;){await xC(KMe),await t.recorder.heartbeat();let i=new Date,a=await es(e),c=rC(n,a);if(n=a,c||(c=await ixe(r)),!c){let p=axe(r,i);if(r=p.watchers,p.changed&&await t.recorder.setPendingWatchers(r),r.length===0)return{threadIDs:o,syncState:s,loggedOut:!1};continue}await xC(QMe);let l=await x9({lastUploadedTimestamp:s.latestUploadedTimestamp,adapter:t.adapter,client:t.client,recorder:t.recorder});if(s=l.syncState,l.loggedOut)return{threadIDs:o,syncState:s,loggedOut:!0};if(o.push(...l.threadIDs),await t.recorder.markSyncSuccess(l.threadIDs),l.threadIDs.length===0)return{threadIDs:o,syncState:s,loggedOut:!1};if(n=await es(e),r=await t.adapter.buildPendingTranscriptWatches(s.latestUploadedTimestamp,l.watchBaselineOverrides),await t.recorder.setPendingWatchers(r),r.length===0)return{threadIDs:o,syncState:s,loggedOut:!1}}}finally{await t.recorder.setPendingWatchers([])}}async function JMe(t){let e={latestUploadedTimestamp:t.lastUploadedTimestamp},n=await t.adapter.readUnuploadedEntries(t.lastUploadedTimestamp);if(n.length===0)return{threadIDs:[],syncState:e,watchBaselineOverrides:new Map};if(!ng())throw new og;await t.recorder.markAuthenticated();let o=await t.adapter.collectLocalFiles(n);try{if(o.localFiles.length===0)return e.latestUploadedTimestamp=MC(t.lastUploadedTimestamp,o.entries,o.entryFileKeys,o.skippedFileKeys),{threadIDs:[],syncState:e,watchBaselineOverrides:new Map};let s=await ZMe(t.client,o.localFiles);if(s.thread_files.length!==o.localFiles.length)throw new Error(`upload session returned ${s.thread_files.length} files for ${o.localFiles.length} local files`);let i=rxe(o.localFiles,s.thread_files),a=[],c=[],l=new Set;for(let m=0;m<s.thread_files.length;m+=1){let h=s.thread_files[m],T=i[m];if(!(!h||!T)){if(!h.presigned_url?.trim()){let S=h.error?.trim()||`upload session response missing presigned_url for ${T.filename}`;pt.info("run_upload_skip",{filename:T.filename,reason:S}),l.add(T.key);continue}a.push(h),c.push(T)}}for(let m=0;m<a.length;m+=1){let h=a[m],T=c[m];!h||!T||await exe(h.presigned_url??"",T.tempPath)}let p=[],d=new Map,_=new Set([...o.skippedFileKeys,...l]);if(a.length===0)return e.latestUploadedTimestamp=MC(t.lastUploadedTimestamp,o.entries,o.entryFileKeys,_),{threadIDs:p,syncState:e,watchBaselineOverrides:d};let f=await txe(t.client,s.id,a);if(f.thread_files.length!==c.length)throw new Error(`completed upload session returned ${f.thread_files.length} files for ${c.length} local files`);for(let m=0;m<f.thread_files.length;m+=1){await t.recorder.heartbeat();let h=f.thread_files[m],T=c[m];if(!h||!T)continue;let S=h.thread?.id?.trim()??"";if(!S){if(T.fileType==="plan"){_.add(T.key);continue}throw new Error(`complete upload session response missing thread for ${T.filename}`)}p.push(S),await nxe(t.client,S,t.recorder),_.add(T.key),T.sourcePath&&d.set(T.sourcePath,T.watchedState)}return e.latestUploadedTimestamp=MC(t.lastUploadedTimestamp,o.entries,o.entryFileKeys,_),{threadIDs:p,syncState:e,watchBaselineOverrides:d}}finally{await Promise.all(o.localFiles.map(s=>K4(s.tempPath)))}}async function ZMe(t,e){let n=e.map(o=>({md5:o.md5,harness:o.harness,filename:o.filename,repo_origin_path:o.repoOriginPath||void 0,file_type:o.fileType,harness_internal_id:o.harnessInternalId})),r=await t.createUploadSession({body:{thread_files:n}});if(r.status!==201)throw new Error(vC("create upload session",r.status,r.body));return r.body}async function exe(t,e){let n=await rg.readFile(e),r=await fetch(t,{method:"PUT",body:n,headers:{"content-length":String(n.length)}});if(!r.ok)throw new Error(`upload transcript: unexpected status ${r.status}: ${await r.text()}`)}async function txe(t,e,n){let r=n.map(s=>({storage_url:oxe(s)})),o=await t.completeUploadSession({params:{id:e},body:{thread_files:r}});if(o.status!==200)throw new Error(vC("complete upload session",o.status,o.body));return o.body}async function nxe(t,e,n,r={}){let o=r.timeoutMs??zMe,s=r.pollIntervalMs??WMe,i=Date.now();for(;;){await n.heartbeat();let a=await t.getThread({params:{id:e}});if(a.status!==200)throw new Error(vC(`get thread ${e}`,a.status,a.body));let c=a.body.transcript_parsing_state;if(c==="parsed"||c==="too_large_to_parse")return;if(c!=="pending"&&c!=="parsing")throw new Error(`unexpected transcript parsing state for thread ${e}: ${JSON.stringify(c)}`);let l=Date.now()-i;if(l>=o)throw new Error(`timed out waiting for thread ${e} parsing after ${o}ms`);await xC(Math.min(s,o-l))}}function rxe(t,e){let n=new Map;for(let r of t){let o=r.md5.trim().toLowerCase();n.set(o,[...n.get(o)??[],r])}return e.map((r,o)=>{let s=r.expected_md5?.trim();if(!s)throw new Error(`upload session response missing expected_md5 for thread_files[${o}]`);let i=s.toLowerCase(),a=n.get(i);if(!a||a.length===0)throw new Error(`upload session response returned unexpected expected_md5 ${s}`);let[c,...l]=a;if(!c)throw new Error(`upload session response returned unexpected expected_md5 ${s}`);return l.length===0?n.delete(i):n.set(i,l),c})}function MC(t,e,n,r){let o=t;for(let s=0;s<e.length;s+=1){let i=n[s];if(!i||!r.has(i))break;o=e[s]?.timestamp??o}return o}function oxe(t){if(!t.storage_url.trim())throw new Error("upload session response missing storage_url");return`s3://${sxe(t.presigned_url??"")}/${t.storage_url.replace(/^\/+/,"")}`}function sxe(t){let e;try{e=new URL(t)}catch(s){throw new Error(`parse presigned URL ${JSON.stringify(t)}: ${String(s)}`)}let n=e.hostname,r=n.indexOf(".s3");if(r>0)return n.slice(0,r);let o=e.pathname.replace(/^\/+|\/+$/g,"").split("/");if(o.length>=2&&o[0])return o[0];throw new Error(`could not determine S3 bucket from presigned URL ${JSON.stringify(t)}`)}async function ixe(t){for(let e of t){let n=await es(e.transcriptPath);if(rC(e.baseline,n))return!0}return!1}function axe(t,e){let n=t.filter(r=>e<r.expiresAt);return{watchers:n,changed:n.length!==t.length}}async function cxe(){try{return{latestUploadedTimestamp:JSON.parse(await rg.readFile(tC(),"utf8")).latestUploadedTimestamp??0}}catch{return{latestUploadedTimestamp:0}}}async function P9(t){let e=tC();await rg.mkdir(YMe.dirname(e),{recursive:!0,mode:448}),await rg.writeFile(e,`${JSON.stringify(t,null,2)}
108
+ `,{mode:384})}function vC(t,e,n){return uxe(n)&&typeof n.message=="string"?`${t} failed: HTTP ${e}: ${n.message}`:`${t} failed: HTTP ${e}`}function uxe(t){return t!==null&&typeof t=="object"}var v9={meta:{name:"_run_upload",hidden:!0},async run({data:t}){let e=await M9({client:t?.client,adapter:t?.adapter,recorder:t?.recorder});console.log(JSON.stringify(e))}};var L9={meta:{name:"whoami",description:"Print the authenticated Lore user",hidden:!0},async run({data:t}){pt.info("command_start",{command:"whoami"});let n=await(t?.client??Ai()).whoAmI({headers:{}});if(n.status===200){console.log(n.body.emailAddress);return}throw console.error("Not authenticated. Run 'lore login' first."),new Error(`whoami failed: HTTP ${n.status}`)}};var lxe="phc_sMsUvf0nK50rZdztSlX9rDJqIreLcXj4dyGS0tORQpQ",pxe="https://phe.tanagram.ai/capture/",dxe=2e3;function D9(t){return process.env[t]??""}function _xe(t,e){let n=[t,e].filter(Boolean);return n.length>0?n.join("@"):"unknown-cli-user"}async function U9({commandName:t,durationMs:e}){let n=D9("USER"),r=D9("HOST"),o=new AbortController,s=setTimeout(()=>o.abort(),dxe);try{await fetch(pxe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:lxe,event:"lore.cli.command_run",properties:{distinct_id:_xe(n,r),command_name:t,cli_version:bS(),duration_ms:Math.round(e),environment:xt(),user:n,host:r}}),signal:o.signal})}catch(i){pt.warn("posthog_capture_failed",{command:t,error:i instanceof Error?i.message:String(i)})}finally{clearTimeout(s)}}var k9={hello:h9,health:m9,enable:_3,disable:f3,restart:m3,status:h3,login:g9,logout:A9,whoami:L9,logs:R9,_run_upload:v9,"postinstall:install-skills":b9,"postinstall:uninstall-skills":C9};function mxe(t){let e=t.find(n=>!n.startsWith("-"));return e||"hello"}var hxe={name:"cli-metrics",setup(t){t.data={...t.data,commandStartedAtMs:performance.now()}},async cleanup(t){let e=t.data?.commandStartedAtMs;if(typeof e!="number")return;let n=performance.now()-e;await(t.data?.captureCliCommandMetric??U9)({commandName:mxe(t.rawArgs),durationMs:n})}},LC={meta:{name:"lore",description:"Lore CLI"},plugins:[hxe],subCommands:k9,default:"hello"};function w9(t){return t instanceof Error&&t.name==="CLIError"}function Txe(t){let e=t.find(r=>!r.startsWith("-")),n=e?k9[e]:void 0;return n?[n,LC]:[LC,void 0]}async function Exe(t){try{if(t.includes("--help")||t.includes("-h")){console.log(await $4(...Txe(t)));return}await vS(LC,{rawArgs:t})}catch(e){if(w9(e)||xt()==="prod"&&e instanceof Error?console.error(e.message):console.error(e,`
109
+ `),!w9(e)){te(e),rm(2e3).catch(()=>{}).finally(()=>{process.exit(1)});return}process.exit(1)}}process.argv[1]&&import.meta.url===fxe(process.argv[1]).href&&await Exe(process.argv.slice(2));export{LC as mainCommand};