@tanagram/lore 0.1.198 → 0.1.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
3
|
-
var ktt=Object.create;var ML=Object.defineProperty;var Ptt=Object.getOwnPropertyDescriptor;var Mtt=Object.getOwnPropertyNames;var Ltt=Object.getPrototypeOf,Utt=Object.prototype.hasOwnProperty;var Ue=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var M=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Zs=(e,t)=>{for(var n in t)ML(e,n,{get:t[n],enumerable:!0})},aAe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Mtt(t))!Utt.call(e,o)&&o!==n&&ML(e,o,{get:()=>t[o],enumerable:!(r=Ptt(t,o))||r.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?ktt(Ltt(e)):{},aAe(t||!e||!e.__esModule?ML(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>aAe(ML({},"__esModule",{value:!0}),e);var m=w(()=>{(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0.1.198"}}catch{}})()});var Ig,g5=w(()=>{m();Ig="1.9.1"});function Qtt(e){let t=new Set([e]),n=new Set,r=e.match(lAe);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(l){return l===e};function i(u){return n.add(u),!1}function s(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(lAe);if(!f)return i(l);let h={major:+f[1],minor:+f[2],patch:+f[3],prerelease:f[4]};return h.prerelease!=null||o.major!==h.major?i(l):o.major===0?o.minor===h.minor&&o.patch<=h.patch?s(l):i(l):o.minor<=h.minor?s(l):i(l)}}var lAe,dAe,pAe=w(()=>{m();g5();lAe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;dAe=Qtt(Ig)});function vm(e,t,n,r=!1){var o;let i=sB[iB]=(o=sB[iB])!==null&&o!==void 0?o:{version:Ig};if(!r&&i[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(i.version!==Ig){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Ig}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Ig}.`),!0}function Ul(e){var t,n;let r=(t=sB[iB])===null||t===void 0?void 0:t.version;if(!(!r||!dAe(r)))return(n=sB[iB])===null||n===void 0?void 0:n[e]}function Rm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Ig}.`);let n=sB[iB];n&&delete n[e]}var Ftt,iB,sB,uS=w(()=>{m();g5();pAe();Ftt=Ig.split(".")[0],iB=Symbol.for(`opentelemetry.js.api.${Ftt}`),sB=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function aB(e,t,n){let r=Ul("diag");if(r)return r[e](t,...n)}var LL,fAe=w(()=>{m();uS();LL=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return aB("debug",this._namespace,t)}error(...t){return aB("error",this._namespace,t)}info(...t){return aB("info",this._namespace,t)}warn(...t){return aB("warn",this._namespace,t)}verbose(...t){return aB("verbose",this._namespace,t)}}});var Cs,UL=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Cs||(Cs={}))});function mAe(e,t){e<Cs.NONE?e=Cs.NONE:e>Cs.ALL&&(e=Cs.ALL),t=t||{};function n(r,o){let i=t[r];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return{error:n("error",Cs.ERROR),warn:n("warn",Cs.WARN),info:n("info",Cs.INFO),debug:n("debug",Cs.DEBUG),verbose:n("verbose",Cs.VERBOSE)}}var AAe=w(()=>{m();UL()});var Gtt,Ws,cS=w(()=>{m();fAe();AAe();UL();uS();Gtt="diag",Ws=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=Ul("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:Cs.INFO})=>{var s,u,l;if(o===n){let _=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=_.stack)!==null&&s!==void 0?s:_.message),!1}typeof i=="number"&&(i={logLevel:i});let f=Ul("diag"),h=mAe((u=i.logLevel)!==null&&u!==void 0?u:Cs.INFO,o);if(f&&!i.suppressOverrideMessage){let _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${_}`),h.warn(`Current logger will overwrite one already registered from ${_}`)}return vm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Rm(Gtt,n)},n.createComponentLogger=o=>new LL(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var QL,gAe=w(()=>{m();QL=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let r of t)n._entries.delete(r);return n}clear(){return new e}}});var hAe,_Ae=w(()=>{m();hAe=Symbol("BaggageEntryMetadata")});function EAe(e={}){return new QL(new Map(Object.entries(e)))}function yAe(e){return typeof e!="string"&&(jtt.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:hAe,toString(){return e}}}var jtt,h5=w(()=>{m();cS();gAe();_Ae();jtt=Ws.instance()});function Ql(e){return Symbol.for(e)}var _5,BC,uB=w(()=>{m();_5=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let i=new e(n._currentContext);return i._currentContext.set(r,o),i},n.deleteValue=r=>{let o=new e(n._currentContext);return o._currentContext.delete(r),o}}},BC=new _5});var E5,y5,FL,SAe=w(()=>{m();E5=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],y5={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(y5[t]=console[t])}FL=class{constructor(){function t(n){return function(...r){let o=y5[n];if(typeof o!="function"&&(o=y5.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<E5.length;n++)this[E5[n].n]=t(E5[n].c)}}});function TAe(){return D5}var S5,wC,T5,b5,I5,C5,cB,v5,R5,x5,D5,ztt,Htt,$tt,qtt,Vtt,Ytt,Ktt,N5=w(()=>{m();S5=class{constructor(){}createGauge(t,n){return Htt}createHistogram(t,n){return $tt}createCounter(t,n){return ztt}createUpDownCounter(t,n){return qtt}createObservableGauge(t,n){return Ytt}createObservableCounter(t,n){return Vtt}createObservableUpDownCounter(t,n){return Ktt}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},wC=class{},T5=class extends wC{add(t,n){}},b5=class extends wC{add(t,n){}},I5=class extends wC{record(t,n){}},C5=class extends wC{record(t,n){}},cB=class{addCallback(t){}removeCallback(t){}},v5=class extends cB{},R5=class extends cB{},x5=class extends cB{},D5=new S5,ztt=new T5,Htt=new I5,$tt=new C5,qtt=new b5,Vtt=new v5,Ytt=new R5,Ktt=new x5});var GL,bAe=w(()=>{m();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(GL||(GL={}))});var jL,zL,B5=w(()=>{m();jL={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},zL={set(e,t,n){e!=null&&(e[t]=n)}}});var HL,IAe=w(()=>{m();uB();HL=class{active(){return BC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var w5,Jtt,xm,lB=w(()=>{m();IAe();uS();cS();w5="context",Jtt=new HL,xm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return vm(w5,t,Ws.instance())}active(){return this._getContextManager().active()}with(t,n,r,...o){return this._getContextManager().with(t,n,r,...o)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return Ul(w5)||Jtt}disable(){this._getContextManager().disable(),Rm(w5,Ws.instance())}}});var iu,O5=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(iu||(iu={}))});var dB,lS,$L,qL=w(()=>{m();O5();dB="0000000000000000",lS="00000000000000000000000000000000",$L={traceId:lS,spanId:dB,traceFlags:iu.NONE}});var Dm,VL=w(()=>{m();qL();Dm=class{constructor(t=$L){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}}});function YL(e){return e.getValue(k5)||void 0}function CAe(){return YL(xm.getInstance().active())}function pB(e,t){return e.setValue(k5,t)}function vAe(e){return e.deleteValue(k5)}function RAe(e,t){return pB(e,new Dm(t))}function KL(e){var t;return(t=YL(e))===null||t===void 0?void 0:t.spanContext()}var k5,P5=w(()=>{m();uB();VL();lB();k5=Ql("OpenTelemetry Context Key SPAN")});function xAe(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(JL[e.charCodeAt(r)]|0)+(JL[e.charCodeAt(r+1)]|0)+(JL[e.charCodeAt(r+2)]|0)+(JL[e.charCodeAt(r+3)]|0);return n===t}function M5(e){return xAe(e,32)&&e!==lS}function L5(e){return xAe(e,16)&&e!==dB}function Cg(e){return M5(e.traceId)&&L5(e.spanId)}function DAe(e){return new Dm(e)}var JL,ZL=w(()=>{m();qL();VL();JL=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 Ztt(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}var U5,OC,Q5=w(()=>{m();lB();P5();VL();ZL();U5=xm.getInstance(),OC=class{startSpan(t,n,r=U5.active()){if(!!n?.root)return new Dm;let i=r&&KL(r);return Ztt(i)&&Cg(i)?new Dm(i):new Dm}startActiveSpan(t,n,r,o){let i,s,u;if(arguments.length<2)return;arguments.length===2?u=n:arguments.length===3?(i=n,u=r):(i=n,s=r,u=o);let l=s??U5.active(),f=this.startSpan(t,i,l),h=pB(l,f);return U5.with(h,u,void 0,f)}}});var Wtt,kC,F5=w(()=>{m();Q5();Wtt=new OC,kC=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}startSpan(t,n,r){return this._getTracer().startSpan(t,n,r)}startActiveSpan(t,n,r,o){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Wtt}}});var WL,NAe=w(()=>{m();Q5();WL=class{getTracer(t,n,r){return new OC}}});var Xtt,dS,G5=w(()=>{m();F5();NAe();Xtt=new WL,dS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new kC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Xtt}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(t,n,r)}}});var XL,BAe=w(()=>{m();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(XL||(XL={}))});var fo,wAe=w(()=>{m();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(fo||(fo={}))});var Ai,OAe=w(()=>{m();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Ai||(Ai={}))});function kAe(e){return nnt.test(e)}function PAe(e){return rnt.test(e)&&!ont.test(e)}var j5,ent,tnt,nnt,rnt,ont,MAe=w(()=>{m();j5="[_0-9a-z-*/]",ent=`[a-z]${j5}{0,255}`,tnt=`[a-z0-9]${j5}{0,240}@[a-z]${j5}{0,13}`,nnt=new RegExp(`^(?:${ent}|${tnt})$`),rnt=/^[ -~]{0,255}[!-~]$/,ont=/,|=/});var LAe,int,UAe,QAe,eU,FAe=w(()=>{m();MAe();LAe=32,int=512,UAe=",",QAe="=",eU=class e{constructor(t){this._internalState=new Map,t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reduceRight((t,n)=>(t.push(n+QAe+this.get(n)),t),[]).join(UAe)}_parse(t){t.length>int||(this._internalState=t.split(UAe).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(QAe);if(i!==-1){let s=o.slice(0,i),u=o.slice(i+1,r.length);kAe(s)&&PAe(u)&&n.set(s,u)}return n},new Map),this._internalState.size>LAe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,LAe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function GAe(e){return new eU(e)}var jAe=w(()=>{m();FAe()});var We,zAe=w(()=>{m();lB();We=xm.getInstance()});var Fl,HAe=w(()=>{m();cS();Fl=Ws.instance()});var z5,$Ae,qAe=w(()=>{m();N5();z5=class{getMeter(t,n,r){return D5}},$Ae=new z5});var H5,tU,VAe=w(()=>{m();qAe();uS();cS();H5="metrics",tU=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return vm(H5,t,Ws.instance())}getMeterProvider(){return Ul(H5)||$Ae}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Rm(H5,Ws.instance())}}});var $5,YAe=w(()=>{m();VAe();$5=tU.getInstance()});var nU,KAe=w(()=>{m();nU=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function V5(e){return e.getValue(q5)||void 0}function JAe(){return V5(xm.getInstance().active())}function ZAe(e,t){return e.setValue(q5,t)}function WAe(e){return e.deleteValue(q5)}var q5,XAe=w(()=>{m();lB();uB();q5=Ql("OpenTelemetry Baggage Key")});var Y5,snt,rU,ege=w(()=>{m();uS();KAe();B5();XAe();h5();cS();Y5="propagation",snt=new nU,rU=class e{constructor(){this.createBaggage=EAe,this.getBaggage=V5,this.getActiveBaggage=JAe,this.setBaggage=ZAe,this.deleteBaggage=WAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return vm(Y5,t,Ws.instance())}inject(t,n,r=zL){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=jL){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Rm(Y5,Ws.instance())}_getGlobalPropagator(){return Ul(Y5)||snt}}});var mf,tge=w(()=>{m();ege();mf=rU.getInstance()});var K5,oU,nge=w(()=>{m();uS();G5();ZL();P5();cS();K5="trace",oU=class e{constructor(){this._proxyTracerProvider=new dS,this.wrapSpanContext=DAe,this.isSpanContextValid=Cg,this.deleteSpan=vAe,this.getSpan=YL,this.getActiveSpan=CAe,this.getSpanContext=KL,this.setSpan=pB,this.setSpanContext=RAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=vm(K5,this._proxyTracerProvider,Ws.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return Ul(K5)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Rm(K5,Ws.instance()),this._proxyTracerProvider=new dS}}});var Vt,rge=w(()=>{m();nge();Vt=oU.getInstance()});var tt={};Zs(tt,{DiagConsoleLogger:()=>FL,DiagLogLevel:()=>Cs,INVALID_SPANID:()=>dB,INVALID_SPAN_CONTEXT:()=>$L,INVALID_TRACEID:()=>lS,ProxyTracer:()=>kC,ProxyTracerProvider:()=>dS,ROOT_CONTEXT:()=>BC,SamplingDecision:()=>XL,SpanKind:()=>fo,SpanStatusCode:()=>Ai,TraceFlags:()=>iu,ValueType:()=>GL,baggageEntryMetadataFromString:()=>yAe,context:()=>We,createContextKey:()=>Ql,createNoopMeter:()=>TAe,createTraceState:()=>GAe,default:()=>ant,defaultTextMapGetter:()=>jL,defaultTextMapSetter:()=>zL,diag:()=>Fl,isSpanContextValid:()=>Cg,isValidSpanId:()=>L5,isValidTraceId:()=>M5,metrics:()=>$5,propagation:()=>mf,trace:()=>Vt});var ant,He=w(()=>{m();h5();uB();SAe();UL();N5();bAe();B5();F5();G5();BAe();wAe();OAe();O5();jAe();ZL();qL();zAe();HAe();YAe();tge();rge();ant={context:We,diag:Fl,metrics:$5,propagation:mf,trace:Vt}});var fB=M(R_=>{"use strict";m();Object.defineProperty(R_,"__esModule",{value:!0});R_.isTracingSuppressed=R_.unsuppressTracing=R_.suppressTracing=void 0;var unt=(He(),Me(tt)),J5=(0,unt.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function cnt(e){return e.setValue(J5,!0)}R_.suppressTracing=cnt;function lnt(e){return e.deleteValue(J5)}R_.unsuppressTracing=lnt;function dnt(e){return e.getValue(J5)===!0}R_.isTracingSuppressed=dnt});var Z5=M(su=>{"use strict";m();Object.defineProperty(su,"__esModule",{value:!0});su.BAGGAGE_MAX_TOTAL_LENGTH=su.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=su.BAGGAGE_MAX_NAME_VALUE_PAIRS=su.BAGGAGE_HEADER=su.BAGGAGE_ITEMS_SEPARATOR=su.BAGGAGE_PROPERTIES_SEPARATOR=su.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;su.BAGGAGE_KEY_PAIR_SEPARATOR="=";su.BAGGAGE_PROPERTIES_SEPARATOR=";";su.BAGGAGE_ITEMS_SEPARATOR=",";su.BAGGAGE_HEADER="baggage";su.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;su.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;su.BAGGAGE_MAX_TOTAL_LENGTH=8192});var X5=M(qd=>{"use strict";m();Object.defineProperty(qd,"__esModule",{value:!0});qd.parseKeyPairsIntoRecord=qd.parseBaggageHeaderString=qd.parsePairKeyValue=qd.getKeyPairs=qd.serializeKeyPairs=void 0;var pnt=(He(),Me(tt)),Nm=Z5();function fnt(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?Nm.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Nm.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}qd.serializeKeyPairs=fnt;function mnt(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Nm.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}qd.getKeyPairs=mnt;function W5(e){if(!e)return;let t=e.indexOf(Nm.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(Nm.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let s,u;try{s=decodeURIComponent(o),u=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,pnt.baggageEntryMetadataFromString)(f)}return{key:s,value:u,metadata:l}}qd.parsePairKeyValue=W5;function Ant(e,t,n,r){let o=0;for(;o<e.length&&n<Nm.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(Nm.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,u=s-o;if(u<=Nm.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=W5(e.substring(o,s));if(l){let f=(n===0?0:1)+u;if(r+f>Nm.BAGGAGE_MAX_TOTAL_LENGTH)break;t[l.key]=l.metadata?{value:l.value,metadata:l.metadata}:{value:l.value},n++,r+=f}}if(i===-1)break;o=i+1}return[n,r]}qd.parseBaggageHeaderString=Ant;function gnt(e){let t={};return typeof e=="string"&&e.length>0&&e.split(Nm.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=W5(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}qd.parseKeyPairsIntoRecord=gnt});var oge=M(sU=>{"use strict";m();Object.defineProperty(sU,"__esModule",{value:!0});sU.W3CBaggagePropagator=void 0;var eV=(He(),Me(tt)),hnt=fB(),mB=Z5(),iU=X5(),tV=class{inject(t,n,r){let o=eV.propagation.getBaggage(t);if(!o||(0,hnt.isTracingSuppressed)(t))return;let i=(0,iU.getKeyPairs)(o).filter(u=>u.length<=mB.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,mB.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,iU.serializeKeyPairs)(i);s.length>0&&r.set(n,mB.BAGGAGE_HEADER,s)}extract(t,n,r){let o=r.get(n,mB.BAGGAGE_HEADER);if(!o)return t;let i={},s=0,u=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,u]=(0,iU.parseBaggageHeaderString)(o[l],i,s,u);else[s]=(0,iU.parseBaggageHeaderString)(o,i,s,u);return s===0?t:eV.propagation.setBaggage(t,eV.propagation.createBaggage(i))}fields(){return[mB.BAGGAGE_HEADER]}};sU.W3CBaggagePropagator=tV});var ige=M(aU=>{"use strict";m();Object.defineProperty(aU,"__esModule",{value:!0});aU.AnchoredClock=void 0;var nV=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,n){this._monotonicClock=n,this._epochMillis=t.now(),this._performanceMillis=n.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}};aU.AnchoredClock=nV});var lge=M(x_=>{"use strict";m();Object.defineProperty(x_,"__esModule",{value:!0});x_.isAttributeValue=x_.isAttributeKey=x_.sanitizeAttributes=void 0;var sge=(He(),Me(tt));function _nt(e){let t={};if(typeof e!="object"||e==null)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!age(n)){sge.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!uge(r)){sge.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}x_.sanitizeAttributes=_nt;function age(e){return typeof e=="string"&&e!==""}x_.isAttributeKey=age;function uge(e){return e==null?!0:Array.isArray(e)?Ent(e):cge(typeof e)}x_.isAttributeValue=uge;function Ent(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(cge(r)){t=r;continue}return!1}return!1}}return!0}function cge(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var rV=M(uU=>{"use strict";m();Object.defineProperty(uU,"__esModule",{value:!0});uU.loggingErrorHandler=void 0;var ynt=(He(),Me(tt));function Snt(){return e=>{ynt.diag.error(Tnt(e))}}uU.loggingErrorHandler=Snt;function Tnt(e){return typeof e=="string"?e:JSON.stringify(bnt(e))}function bnt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(t[r])return;let o=n[r];o&&(t[r]=String(o))}),n=Object.getPrototypeOf(n);return t}});var pge=M(PC=>{"use strict";m();Object.defineProperty(PC,"__esModule",{value:!0});PC.globalErrorHandler=PC.setGlobalErrorHandler=void 0;var Int=rV(),dge=(0,Int.loggingErrorHandler)();function Cnt(e){dge=e}PC.setGlobalErrorHandler=Cnt;function vnt(e){try{dge(e)}catch{}}PC.globalErrorHandler=vnt});var gge=M(Bm=>{"use strict";m();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.getStringListFromEnv=Bm.getBooleanFromEnv=Bm.getStringFromEnv=Bm.getNumberFromEnv=void 0;var fge=(He(),Me(tt)),mge=Ue("util");function Rnt(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){fge.diag.warn(`Unknown value ${(0,mge.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}Bm.getNumberFromEnv=Rnt;function Age(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}Bm.getStringFromEnv=Age;function xnt(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||fge.diag.warn(`Unknown value ${(0,mge.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Bm.getBooleanFromEnv=xnt;function Dnt(e){return Age(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}Bm.getStringListFromEnv=Dnt});var hge=M(cU=>{"use strict";m();Object.defineProperty(cU,"__esModule",{value:!0});cU._globalThis=void 0;cU._globalThis=globalThis});var _ge=M(lU=>{"use strict";m();Object.defineProperty(lU,"__esModule",{value:!0});lU.VERSION=void 0;lU.VERSION="2.8.0"});function Oi(e){let t={},n=e.length;for(let r=0;r<n;r++){let o=e[r];o&&(t[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return t}var oV=w(()=>{m()});var Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e,U_e,Nnt,iV,Bnt,wnt,Ont,knt,sV,Pnt,Mnt,Lnt,Unt,Qnt,Fnt,Gnt,jnt,znt,Hnt,$nt,qnt,Vnt,Ynt,Knt,Jnt,Znt,Wnt,aV,Xnt,ert,trt,nrt,rrt,ort,irt,srt,art,urt,crt,lrt,uV,drt,prt,cV,lV,frt,mrt,Art,grt,hrt,_rt,Ert,yrt,Srt,Trt,brt,Irt,Crt,vrt,Rrt,xrt,Drt,AB,MC,dV,Nrt,Brt,pS,wrt,Ort,krt,Prt,pV,fV,Mrt,mV,Lrt,Urt,Qrt,Frt,Grt,jrt,zrt,Hrt,$rt,qrt,Vrt,Yrt,Krt,Jrt,Zrt,Wrt,Xrt,eot,tot,not,rot,oot,iot,AV,sot,aot,uot,cot,lot,dot,pot,fot,mot,Aot,got,hot,_ot,Eot,yot,Sot,Tot,bot,Iot,gV,Cot,hV,vot,Rot,xot,Dot,Not,Bot,wot,Oot,kot,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,BEe,Pot,Mot,Lot,Uot,Qot,Fot,Got,jot,zot,Hot,$ot,qot,Vot,Yot,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,rit,oit,iit,sit,ait,uit,cit,lit,dit,pit,fit,mit,Ait,git,hit,_it,Eit,yit,Sit,Tit,bit,Iit,Cit,vit,Rit,xit,wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe,Dit,Nit,Bit,wit,Oit,kit,Pit,Mit,Lit,Uit,Qit,Fit,zEe,HEe,$Ee,qEe,VEe,Git,jit,zit,Hit,$it,qit,YEe,KEe,JEe,Vit,Yit,Kit,Jit,ZEe,WEe,XEe,e0e,Zit,Wit,Xit,est,tst,t0e,n0e,r0e,o0e,i0e,s0e,a0e,nst,rst,ost,ist,sst,ast,ust,cst,u0e,c0e,l0e,d0e,p0e,lst,dst,pst,fst,mst,Ast,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e,O0e,gst,hst,_st,Est,yst,Sst,Tst,bst,Ist,Cst,vst,Rst,xst,Dst,Nst,Bst,wst,Ost,kst,Pst,Mst,Lst,k0e,P0e,M0e,L0e,U0e,Ust,Qst,Fst,Gst,jst,zst,Q0e,F0e,Hst,$st,qst,G0e,j0e,Vst,Yst,Kst,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eye,tye,nye,rye,oye,iye,Jst,Zst,Wst,Xst,eat,tat,nat,rat,oat,iat,sat,aat,uat,cat,lat,dat,pat,fat,sye,aye,mat,Aat,gat,uye=w(()=>{m();oV();Ege="aws.lambda.invoked_arn",yge="db.system",Sge="db.connection_string",Tge="db.user",bge="db.jdbc.driver_classname",Ige="db.name",Cge="db.statement",vge="db.operation",Rge="db.mssql.instance_name",xge="db.cassandra.keyspace",Dge="db.cassandra.page_size",Nge="db.cassandra.consistency_level",Bge="db.cassandra.table",wge="db.cassandra.idempotence",Oge="db.cassandra.speculative_execution_count",kge="db.cassandra.coordinator.id",Pge="db.cassandra.coordinator.dc",Mge="db.hbase.namespace",Lge="db.redis.database_index",Uge="db.mongodb.collection",Qge="db.sql.table",Fge="exception.type",Gge="exception.message",jge="exception.stacktrace",zge="exception.escaped",Hge="faas.trigger",$ge="faas.execution",qge="faas.document.collection",Vge="faas.document.operation",Yge="faas.document.time",Kge="faas.document.name",Jge="faas.time",Zge="faas.cron",Wge="faas.coldstart",Xge="faas.invoked_name",ehe="faas.invoked_provider",the="faas.invoked_region",nhe="net.transport",rhe="net.peer.ip",ohe="net.peer.port",ihe="net.peer.name",she="net.host.ip",ahe="net.host.port",uhe="net.host.name",che="net.host.connection.type",lhe="net.host.connection.subtype",dhe="net.host.carrier.name",phe="net.host.carrier.mcc",fhe="net.host.carrier.mnc",mhe="net.host.carrier.icc",Ahe="peer.service",ghe="enduser.id",hhe="enduser.role",_he="enduser.scope",Ehe="thread.id",yhe="thread.name",She="code.function",The="code.namespace",bhe="code.filepath",Ihe="code.lineno",Che="http.method",vhe="http.url",Rhe="http.target",xhe="http.host",Dhe="http.scheme",Nhe="http.status_code",Bhe="http.flavor",whe="http.user_agent",Ohe="http.request_content_length",khe="http.request_content_length_uncompressed",Phe="http.response_content_length",Mhe="http.response_content_length_uncompressed",Lhe="http.server_name",Uhe="http.route",Qhe="http.client_ip",Fhe="aws.dynamodb.table_names",Ghe="aws.dynamodb.consumed_capacity",jhe="aws.dynamodb.item_collection_metrics",zhe="aws.dynamodb.provisioned_read_capacity",Hhe="aws.dynamodb.provisioned_write_capacity",$he="aws.dynamodb.consistent_read",qhe="aws.dynamodb.projection",Vhe="aws.dynamodb.limit",Yhe="aws.dynamodb.attributes_to_get",Khe="aws.dynamodb.index_name",Jhe="aws.dynamodb.select",Zhe="aws.dynamodb.global_secondary_indexes",Whe="aws.dynamodb.local_secondary_indexes",Xhe="aws.dynamodb.exclusive_start_table",e_e="aws.dynamodb.table_count",t_e="aws.dynamodb.scan_forward",n_e="aws.dynamodb.segment",r_e="aws.dynamodb.total_segments",o_e="aws.dynamodb.count",i_e="aws.dynamodb.scanned_count",s_e="aws.dynamodb.attribute_definitions",a_e="aws.dynamodb.global_secondary_index_updates",u_e="messaging.system",c_e="messaging.destination",l_e="messaging.destination_kind",d_e="messaging.temp_destination",p_e="messaging.protocol",f_e="messaging.protocol_version",m_e="messaging.url",A_e="messaging.message_id",g_e="messaging.conversation_id",h_e="messaging.message_payload_size_bytes",__e="messaging.message_payload_compressed_size_bytes",E_e="messaging.operation",y_e="messaging.consumer_id",S_e="messaging.rabbitmq.routing_key",T_e="messaging.kafka.message_key",b_e="messaging.kafka.consumer_group",I_e="messaging.kafka.client_id",C_e="messaging.kafka.partition",v_e="messaging.kafka.tombstone",R_e="rpc.system",x_e="rpc.service",D_e="rpc.method",N_e="rpc.grpc.status_code",B_e="rpc.jsonrpc.version",w_e="rpc.jsonrpc.request_id",O_e="rpc.jsonrpc.error_code",k_e="rpc.jsonrpc.error_message",P_e="message.type",M_e="message.id",L_e="message.compressed_size",U_e="message.uncompressed_size",Nnt=Ege,iV=yge,Bnt=Sge,wnt=Tge,Ont=bge,knt=Ige,sV=Cge,Pnt=vge,Mnt=Rge,Lnt=xge,Unt=Dge,Qnt=Nge,Fnt=Bge,Gnt=wge,jnt=Oge,znt=kge,Hnt=Pge,$nt=Mge,qnt=Lge,Vnt=Uge,Ynt=Qge,Knt=Fge,Jnt=Gge,Znt=jge,Wnt=zge,aV=Hge,Xnt=$ge,ert=qge,trt=Vge,nrt=Yge,rrt=Kge,ort=Jge,irt=Zge,srt=Wge,art=Xge,urt=ehe,crt=the,lrt=nhe,uV=rhe,drt=ohe,prt=ihe,cV=she,lV=ahe,frt=uhe,mrt=che,Art=lhe,grt=dhe,hrt=phe,_rt=fhe,Ert=mhe,yrt=Ahe,Srt=ghe,Trt=hhe,brt=_he,Irt=Ehe,Crt=yhe,vrt=She,Rrt=The,xrt=bhe,Drt=Ihe,AB=Che,MC=vhe,dV=Rhe,Nrt=xhe,Brt=Dhe,pS=Nhe,wrt=Bhe,Ort=whe,krt=Ohe,Prt=khe,pV=Phe,fV=Mhe,Mrt=Lhe,mV=Uhe,Lrt=Qhe,Urt=Fhe,Qrt=Ghe,Frt=jhe,Grt=zhe,jrt=Hhe,zrt=$he,Hrt=qhe,$rt=Vhe,qrt=Yhe,Vrt=Khe,Yrt=Jhe,Krt=Zhe,Jrt=Whe,Zrt=Xhe,Wrt=e_e,Xrt=t_e,eot=n_e,tot=r_e,not=o_e,rot=i_e,oot=s_e,iot=a_e,AV=u_e,sot=c_e,aot=l_e,uot=d_e,cot=p_e,lot=f_e,dot=m_e,pot=A_e,fot=g_e,mot=h_e,Aot=__e,got=E_e,hot=y_e,_ot=S_e,Eot=T_e,yot=b_e,Sot=I_e,Tot=C_e,bot=v_e,Iot=R_e,gV=x_e,Cot=D_e,hV=N_e,vot=B_e,Rot=w_e,xot=O_e,Dot=k_e,Not=P_e,Bot=M_e,wot=L_e,Oot=U_e,kot=Oi([Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e,U_e]),Q_e="other_sql",F_e="mssql",G_e="mysql",j_e="oracle",z_e="db2",H_e="postgresql",$_e="redshift",q_e="hive",V_e="cloudscape",Y_e="hsqldb",K_e="progress",J_e="maxdb",Z_e="hanadb",W_e="ingres",X_e="firstsql",eEe="edb",tEe="cache",nEe="adabas",rEe="firebird",oEe="derby",iEe="filemaker",sEe="informix",aEe="instantdb",uEe="interbase",cEe="mariadb",lEe="netezza",dEe="pervasive",pEe="pointbase",fEe="sqlite",mEe="sybase",AEe="teradata",gEe="vertica",hEe="h2",_Ee="coldfusion",EEe="cassandra",yEe="hbase",SEe="mongodb",TEe="redis",bEe="couchbase",IEe="couchdb",CEe="cosmosdb",vEe="dynamodb",REe="neo4j",xEe="geode",DEe="elasticsearch",NEe="memcached",BEe="cockroachdb",Pot=Q_e,Mot=F_e,Lot=G_e,Uot=j_e,Qot=z_e,Fot=H_e,Got=$_e,jot=q_e,zot=V_e,Hot=Y_e,$ot=K_e,qot=J_e,Vot=Z_e,Yot=W_e,Kot=X_e,Jot=eEe,Zot=tEe,Wot=nEe,Xot=rEe,eit=oEe,tit=iEe,nit=sEe,rit=aEe,oit=uEe,iit=cEe,sit=lEe,ait=dEe,uit=pEe,cit=fEe,lit=mEe,dit=AEe,pit=gEe,fit=hEe,mit=_Ee,Ait=EEe,git=yEe,hit=SEe,_it=TEe,Eit=bEe,yit=IEe,Sit=CEe,Tit=vEe,bit=REe,Iit=xEe,Cit=DEe,vit=NEe,Rit=BEe,xit=Oi([Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,BEe]),wEe="all",OEe="each_quorum",kEe="quorum",PEe="local_quorum",MEe="one",LEe="two",UEe="three",QEe="local_one",FEe="any",GEe="serial",jEe="local_serial",Dit=wEe,Nit=OEe,Bit=kEe,wit=PEe,Oit=MEe,kit=LEe,Pit=UEe,Mit=QEe,Lit=FEe,Uit=GEe,Qit=jEe,Fit=Oi([wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe]),zEe="datasource",HEe="http",$Ee="pubsub",qEe="timer",VEe="other",Git=zEe,jit=HEe,zit=$Ee,Hit=qEe,$it=VEe,qit=Oi([zEe,HEe,$Ee,qEe,VEe]),YEe="insert",KEe="edit",JEe="delete",Vit=YEe,Yit=KEe,Kit=JEe,Jit=Oi([YEe,KEe,JEe]),ZEe="alibaba_cloud",WEe="aws",XEe="azure",e0e="gcp",Zit=ZEe,Wit=WEe,Xit=XEe,est=e0e,tst=Oi([ZEe,WEe,XEe,e0e]),t0e="ip_tcp",n0e="ip_udp",r0e="ip",o0e="unix",i0e="pipe",s0e="inproc",a0e="other",nst=t0e,rst=n0e,ost=r0e,ist=o0e,sst=i0e,ast=s0e,ust=a0e,cst=Oi([t0e,n0e,r0e,o0e,i0e,s0e,a0e]),u0e="wifi",c0e="wired",l0e="cell",d0e="unavailable",p0e="unknown",lst=u0e,dst=c0e,pst=l0e,fst=d0e,mst=p0e,Ast=Oi([u0e,c0e,l0e,d0e,p0e]),f0e="gprs",m0e="edge",A0e="umts",g0e="cdma",h0e="evdo_0",_0e="evdo_a",E0e="cdma2000_1xrtt",y0e="hsdpa",S0e="hsupa",T0e="hspa",b0e="iden",I0e="evdo_b",C0e="lte",v0e="ehrpd",R0e="hspap",x0e="gsm",D0e="td_scdma",N0e="iwlan",B0e="nr",w0e="nrnsa",O0e="lte_ca",gst=f0e,hst=m0e,_st=A0e,Est=g0e,yst=h0e,Sst=_0e,Tst=E0e,bst=y0e,Ist=S0e,Cst=T0e,vst=b0e,Rst=I0e,xst=C0e,Dst=v0e,Nst=R0e,Bst=x0e,wst=D0e,Ost=N0e,kst=B0e,Pst=w0e,Mst=O0e,Lst=Oi([f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e,O0e]),k0e="1.0",P0e="1.1",M0e="2.0",L0e="SPDY",U0e="QUIC",Ust=k0e,Qst=P0e,Fst=M0e,Gst=L0e,jst=U0e,zst={HTTP_1_0:k0e,HTTP_1_1:P0e,HTTP_2_0:M0e,SPDY:L0e,QUIC:U0e},Q0e="queue",F0e="topic",Hst=Q0e,$st=F0e,qst=Oi([Q0e,F0e]),G0e="receive",j0e="process",Vst=G0e,Yst=j0e,Kst=Oi([G0e,j0e]),z0e=0,H0e=1,$0e=2,q0e=3,V0e=4,Y0e=5,K0e=6,J0e=7,Z0e=8,W0e=9,X0e=10,eye=11,tye=12,nye=13,rye=14,oye=15,iye=16,Jst=z0e,Zst=H0e,Wst=$0e,Xst=q0e,eat=V0e,tat=Y0e,nat=K0e,rat=J0e,oat=Z0e,iat=W0e,sat=X0e,aat=eye,uat=tye,cat=nye,lat=rye,dat=oye,pat=iye,fat={OK:z0e,CANCELLED:H0e,UNKNOWN:$0e,INVALID_ARGUMENT:q0e,DEADLINE_EXCEEDED:V0e,NOT_FOUND:Y0e,ALREADY_EXISTS:K0e,PERMISSION_DENIED:J0e,RESOURCE_EXHAUSTED:Z0e,FAILED_PRECONDITION:W0e,ABORTED:X0e,OUT_OF_RANGE:eye,UNIMPLEMENTED:tye,INTERNAL:nye,UNAVAILABLE:rye,DATA_LOSS:oye,UNAUTHENTICATED:iye},sye="SENT",aye="RECEIVED",mat=sye,Aat=aye,gat=Oi([sye,aye])});var cye=w(()=>{m();uye()});var lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe,MSe,hat,_at,Eat,yat,Sat,Tat,bat,Iat,Cat,vat,Rat,xat,Dat,Nat,Bat,wat,Oat,kat,Pat,Mat,Lat,Uat,Qat,Fat,Gat,jat,zat,Hat,$at,qat,Vat,Yat,Kat,Jat,Zat,Wat,Xat,eut,tut,nut,rut,out,iut,sut,aut,uut,cut,lut,dut,put,fut,mut,Aut,gut,hut,_ut,Eut,yut,Sut,Tut,but,Iut,Cut,vut,Rut,xut,Dut,Nut,But,wut,Out,_V,kut,Put,Mut,Lut,Uut,Qut,Fut,Gut,jut,zut,LSe,USe,QSe,FSe,Hut,$ut,qut,Vut,Yut,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe,Kut,Jut,Zut,Wut,Xut,ect,tct,nct,rct,oct,ict,sct,act,uct,cct,lct,dct,pct,oTe,iTe,fct,mct,Act,sTe,aTe,uTe,cTe,lTe,dTe,pTe,gct,hct,_ct,Ect,yct,Sct,Tct,bct,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe,Ict,Cct,vct,Rct,xct,Dct,Nct,Bct,wct,Oct,kct,Pct,ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe,OTe,Mct,Lct,Uct,Qct,Fct,Gct,jct,zct,Hct,$ct,qct,kTe=w(()=>{m();oV();lye="cloud.provider",dye="cloud.account.id",pye="cloud.region",fye="cloud.availability_zone",mye="cloud.platform",Aye="aws.ecs.container.arn",gye="aws.ecs.cluster.arn",hye="aws.ecs.launchtype",_ye="aws.ecs.task.arn",Eye="aws.ecs.task.family",yye="aws.ecs.task.revision",Sye="aws.eks.cluster.arn",Tye="aws.log.group.names",bye="aws.log.group.arns",Iye="aws.log.stream.names",Cye="aws.log.stream.arns",vye="container.name",Rye="container.id",xye="container.runtime",Dye="container.image.name",Nye="container.image.tag",Bye="deployment.environment",wye="device.id",Oye="device.model.identifier",kye="device.model.name",Pye="faas.name",Mye="faas.id",Lye="faas.version",Uye="faas.instance",Qye="faas.max_memory",Fye="host.id",Gye="host.name",jye="host.type",zye="host.arch",Hye="host.image.name",$ye="host.image.id",qye="host.image.version",Vye="k8s.cluster.name",Yye="k8s.node.name",Kye="k8s.node.uid",Jye="k8s.namespace.name",Zye="k8s.pod.uid",Wye="k8s.pod.name",Xye="k8s.container.name",eSe="k8s.replicaset.uid",tSe="k8s.replicaset.name",nSe="k8s.deployment.uid",rSe="k8s.deployment.name",oSe="k8s.statefulset.uid",iSe="k8s.statefulset.name",sSe="k8s.daemonset.uid",aSe="k8s.daemonset.name",uSe="k8s.job.uid",cSe="k8s.job.name",lSe="k8s.cronjob.uid",dSe="k8s.cronjob.name",pSe="os.type",fSe="os.description",mSe="os.name",ASe="os.version",gSe="process.pid",hSe="process.executable.name",_Se="process.executable.path",ESe="process.command",ySe="process.command_line",SSe="process.command_args",TSe="process.owner",bSe="process.runtime.name",ISe="process.runtime.version",CSe="process.runtime.description",vSe="service.name",RSe="service.namespace",xSe="service.instance.id",DSe="service.version",NSe="telemetry.sdk.name",BSe="telemetry.sdk.language",wSe="telemetry.sdk.version",OSe="telemetry.auto.version",kSe="webengine.name",PSe="webengine.version",MSe="webengine.description",hat=lye,_at=dye,Eat=pye,yat=fye,Sat=mye,Tat=Aye,bat=gye,Iat=hye,Cat=_ye,vat=Eye,Rat=yye,xat=Sye,Dat=Tye,Nat=bye,Bat=Iye,wat=Cye,Oat=vye,kat=Rye,Pat=xye,Mat=Dye,Lat=Nye,Uat=Bye,Qat=wye,Fat=Oye,Gat=kye,jat=Pye,zat=Mye,Hat=Lye,$at=Uye,qat=Qye,Vat=Fye,Yat=Gye,Kat=jye,Jat=zye,Zat=Hye,Wat=$ye,Xat=qye,eut=Vye,tut=Yye,nut=Kye,rut=Jye,out=Zye,iut=Wye,sut=Xye,aut=eSe,uut=tSe,cut=nSe,lut=rSe,dut=oSe,put=iSe,fut=sSe,mut=aSe,Aut=uSe,gut=cSe,hut=lSe,_ut=dSe,Eut=pSe,yut=fSe,Sut=mSe,Tut=ASe,but=gSe,Iut=hSe,Cut=_Se,vut=ESe,Rut=ySe,xut=SSe,Dut=TSe,Nut=bSe,But=ISe,wut=CSe,Out=vSe,_V=RSe,kut=xSe,Put=DSe,Mut=NSe,Lut=BSe,Uut=wSe,Qut=OSe,Fut=kSe,Gut=PSe,jut=MSe,zut=Oi([lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe,MSe]),LSe="alibaba_cloud",USe="aws",QSe="azure",FSe="gcp",Hut=LSe,$ut=USe,qut=QSe,Vut=FSe,Yut=Oi([LSe,USe,QSe,FSe]),GSe="alibaba_cloud_ecs",jSe="alibaba_cloud_fc",zSe="aws_ec2",HSe="aws_ecs",$Se="aws_eks",qSe="aws_lambda",VSe="aws_elastic_beanstalk",YSe="azure_vm",KSe="azure_container_instances",JSe="azure_aks",ZSe="azure_functions",WSe="azure_app_service",XSe="gcp_compute_engine",eTe="gcp_cloud_run",tTe="gcp_kubernetes_engine",nTe="gcp_cloud_functions",rTe="gcp_app_engine",Kut=GSe,Jut=jSe,Zut=zSe,Wut=HSe,Xut=$Se,ect=qSe,tct=VSe,nct=YSe,rct=KSe,oct=JSe,ict=ZSe,sct=WSe,act=XSe,uct=eTe,cct=tTe,lct=nTe,dct=rTe,pct=Oi([GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe]),oTe="ec2",iTe="fargate",fct=oTe,mct=iTe,Act=Oi([oTe,iTe]),sTe="amd64",aTe="arm32",uTe="arm64",cTe="ia64",lTe="ppc32",dTe="ppc64",pTe="x86",gct=sTe,hct=aTe,_ct=uTe,Ect=cTe,yct=lTe,Sct=dTe,Tct=pTe,bct=Oi([sTe,aTe,uTe,cTe,lTe,dTe,pTe]),fTe="windows",mTe="linux",ATe="darwin",gTe="freebsd",hTe="netbsd",_Te="openbsd",ETe="dragonflybsd",yTe="hpux",STe="aix",TTe="solaris",bTe="z_os",Ict=fTe,Cct=mTe,vct=ATe,Rct=gTe,xct=hTe,Dct=_Te,Nct=ETe,Bct=yTe,wct=STe,Oct=TTe,kct=bTe,Pct=Oi([fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe]),ITe="cpp",CTe="dotnet",vTe="erlang",RTe="go",xTe="java",DTe="nodejs",NTe="php",BTe="python",wTe="ruby",OTe="webjs",Mct=ITe,Lct=CTe,Uct=vTe,Qct=RTe,Fct=xTe,Gct=DTe,jct=NTe,zct=BTe,Hct=wTe,$ct=OTe,qct=Oi([ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe,OTe])});var PTe=w(()=>{m();kTe()});var Vct,Yct,Kct,Jct,Zct,Wct,Xct,elt,tlt,nlt,rlt,olt,ilt,slt,alt,ult,clt,llt,dlt,plt,flt,mlt,Alt,glt,hlt,EV,yV,_lt,LC,Elt,SV,TV,ylt,fS,Slt,Tlt,blt,Ilt,Clt,vlt,Rlt,xlt,Tsn,bsn,bV,Dlt,Nlt,Blt,wlt,Olt,klt,mS,Plt,Mlt,Llt,Isn,Ult,Qlt,Flt,Glt,Csn,jlt,zlt,Hlt,$lt,vg,Rg,qlt,Vlt,Ylt,Klt,Jlt,Zlt,Wlt,Xlt,edt,vsn,tdt,ndt,rdt,odt,idt,sdt,IV,CV,adt,vV,RV,udt,cdt,Rsn,xsn,ldt,ddt,pdt,fdt,mdt,Adt,gdt,hdt,Dsn,_dt,xV,DV,Edt,NV,ydt,BV,Sdt,Tdt,bdt,Idt,Cdt,vdt,Rdt,xdt,Ddt,Nsn,Ndt,Bdt,Bsn,wdt,Odt,wsn,kdt,Pdt,Mdt,Ldt,Udt,Qdt,Fdt,Gdt,D_,jdt,zdt,Hdt,wV,MTe=w(()=>{m();Vct="aspnetcore.diagnostics.exception.result",Yct="aborted",Kct="handled",Jct="skipped",Zct="unhandled",Wct="aspnetcore.diagnostics.handler.type",Xct="aspnetcore.rate_limiting.policy",elt="aspnetcore.rate_limiting.result",tlt="acquired",nlt="endpoint_limiter",rlt="global_limiter",olt="request_canceled",ilt="aspnetcore.request.is_unhandled",slt="aspnetcore.routing.is_fallback",alt="aspnetcore.routing.match_status",ult="failure",clt="success",llt="aspnetcore.user.is_authenticated",dlt="client.address",plt="client.port",flt="code.column.number",mlt="code.file.path",Alt="code.function.name",glt="code.line.number",hlt="code.stacktrace",EV="db.collection.name",yV="db.namespace",_lt="db.operation.batch.size",LC="db.operation.name",Elt="db.query.summary",SV="db.query.text",TV="db.response.status_code",ylt="db.stored_procedure.name",fS="db.system.name",Slt="mariadb",Tlt="microsoft.sql_server",blt="mysql",Ilt="postgresql",Clt="dotnet.gc.heap.generation",vlt="gen0",Rlt="gen1",xlt="gen2",Tsn="loh",bsn="poh",bV="error.type",Dlt="_OTHER",Nlt="exception.escaped",Blt="exception.message",wlt="exception.stacktrace",Olt="exception.type",klt=e=>`http.request.header.${e}`,mS="http.request.method",Plt="_OTHER",Mlt="CONNECT",Llt="DELETE",Isn="GET",Ult="HEAD",Qlt="OPTIONS",Flt="PATCH",Glt="POST",Csn="PUT",jlt="TRACE",zlt="http.request.method_original",Hlt="http.request.resend_count",$lt=e=>`http.response.header.${e}`,vg="http.response.status_code",Rg="http.route",qlt="jvm.gc.action",Vlt="jvm.gc.name",Ylt="jvm.memory.pool.name",Klt="jvm.memory.type",Jlt="heap",Zlt="non_heap",Wlt="jvm.thread.daemon",Xlt="jvm.thread.state",edt="blocked",vsn="new",tdt="runnable",ndt="terminated",rdt="timed_waiting",odt="waiting",idt="network.local.address",sdt="network.local.port",IV="network.peer.address",CV="network.peer.port",adt="network.protocol.name",vV="network.protocol.version",RV="network.transport",udt="pipe",cdt="quic",Rsn="tcp",xsn="udp",ldt="unix",ddt="network.type",pdt="ipv4",fdt="ipv6",mdt="otel.scope.name",Adt="otel.scope.version",gdt="otel.status_code",hdt="ERROR",Dsn="OK",_dt="otel.status_description",xV="server.address",DV="server.port",Edt="service.instance.id",NV="service.name",ydt="service.namespace",BV="service.version",Sdt="signalr.connection.status",Tdt="app_shutdown",bdt="normal_closure",Idt="timeout",Cdt="signalr.transport",vdt="long_polling",Rdt="server_sent_events",xdt="web_sockets",Ddt="telemetry.sdk.language",Nsn="cpp",Ndt="dotnet",Bdt="erlang",Bsn="go",wdt="java",Odt="nodejs",wsn="php",kdt="python",Pdt="ruby",Mdt="rust",Ldt="swift",Udt="webjs",Qdt="telemetry.sdk.name",Fdt="telemetry.sdk.version",Gdt="url.fragment",D_="url.full",jdt="url.path",zdt="url.query",Hdt="url.scheme",wV="user_agent.original"});var $dt,qdt,Vdt,Ydt,Kdt,Jdt,Zdt,Wdt,Xdt,ept,tpt,npt,rpt,opt,ipt,spt,apt,upt,cpt,lpt,dpt,ppt,fpt,mpt,Apt,gpt,hpt,_pt,Ept,ypt,Spt,Tpt,bpt,Ipt,Cpt,vpt,Rpt,xpt,Dpt,Npt,Bpt,wpt,Opt,kpt,Ppt,Mpt,Lpt,Upt,Qpt,Fpt,Gpt,LTe=w(()=>{m();$dt="aspnetcore.diagnostics.exceptions",qdt="aspnetcore.rate_limiting.active_request_leases",Vdt="aspnetcore.rate_limiting.queued_requests",Ydt="aspnetcore.rate_limiting.request.time_in_queue",Kdt="aspnetcore.rate_limiting.request_lease.duration",Jdt="aspnetcore.rate_limiting.requests",Zdt="aspnetcore.routing.match_attempts",Wdt="db.client.operation.duration",Xdt="dotnet.assembly.count",ept="dotnet.exceptions",tpt="dotnet.gc.collections",npt="dotnet.gc.heap.total_allocated",rpt="dotnet.gc.last_collection.heap.fragmentation.size",opt="dotnet.gc.last_collection.heap.size",ipt="dotnet.gc.last_collection.memory.committed_size",spt="dotnet.gc.pause.time",apt="dotnet.jit.compilation.time",upt="dotnet.jit.compiled_il.size",cpt="dotnet.jit.compiled_methods",lpt="dotnet.monitor.lock_contentions",dpt="dotnet.process.cpu.count",ppt="dotnet.process.cpu.time",fpt="dotnet.process.memory.working_set",mpt="dotnet.thread_pool.queue.length",Apt="dotnet.thread_pool.thread.count",gpt="dotnet.thread_pool.work_item.count",hpt="dotnet.timer.count",_pt="http.client.request.duration",Ept="http.server.request.duration",ypt="jvm.class.count",Spt="jvm.class.loaded",Tpt="jvm.class.unloaded",bpt="jvm.cpu.count",Ipt="jvm.cpu.recent_utilization",Cpt="jvm.cpu.time",vpt="jvm.gc.duration",Rpt="jvm.memory.committed",xpt="jvm.memory.limit",Dpt="jvm.memory.used",Npt="jvm.memory.used_after_last_gc",Bpt="jvm.thread.count",wpt="kestrel.active_connections",Opt="kestrel.active_tls_handshakes",kpt="kestrel.connection.duration",Ppt="kestrel.queued_connections",Mpt="kestrel.queued_requests",Lpt="kestrel.rejected_connections",Upt="kestrel.tls_handshake.duration",Qpt="kestrel.upgraded_connections",Fpt="signalr.server.active_connections",Gpt="signalr.server.connection.duration"});var jpt,UTe=w(()=>{m();jpt="exception"});var Hr={};Zs(Hr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Yct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Kct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Jct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Zct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>tlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>nlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>rlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>olt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>ult,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>clt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Vct,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Wct,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Xct,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>elt,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>ilt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>slt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>alt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>llt,ATTR_CLIENT_ADDRESS:()=>dlt,ATTR_CLIENT_PORT:()=>plt,ATTR_CODE_COLUMN_NUMBER:()=>flt,ATTR_CODE_FILE_PATH:()=>mlt,ATTR_CODE_FUNCTION_NAME:()=>Alt,ATTR_CODE_LINE_NUMBER:()=>glt,ATTR_CODE_STACKTRACE:()=>hlt,ATTR_DB_COLLECTION_NAME:()=>EV,ATTR_DB_NAMESPACE:()=>yV,ATTR_DB_OPERATION_BATCH_SIZE:()=>_lt,ATTR_DB_OPERATION_NAME:()=>LC,ATTR_DB_QUERY_SUMMARY:()=>Elt,ATTR_DB_QUERY_TEXT:()=>SV,ATTR_DB_RESPONSE_STATUS_CODE:()=>TV,ATTR_DB_STORED_PROCEDURE_NAME:()=>ylt,ATTR_DB_SYSTEM_NAME:()=>fS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Clt,ATTR_ERROR_TYPE:()=>bV,ATTR_EXCEPTION_ESCAPED:()=>Nlt,ATTR_EXCEPTION_MESSAGE:()=>Blt,ATTR_EXCEPTION_STACKTRACE:()=>wlt,ATTR_EXCEPTION_TYPE:()=>Olt,ATTR_HTTP_REQUEST_HEADER:()=>klt,ATTR_HTTP_REQUEST_METHOD:()=>mS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>zlt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Hlt,ATTR_HTTP_RESPONSE_HEADER:()=>$lt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>vg,ATTR_HTTP_ROUTE:()=>Rg,ATTR_JVM_GC_ACTION:()=>qlt,ATTR_JVM_GC_NAME:()=>Vlt,ATTR_JVM_MEMORY_POOL_NAME:()=>Ylt,ATTR_JVM_MEMORY_TYPE:()=>Klt,ATTR_JVM_THREAD_DAEMON:()=>Wlt,ATTR_JVM_THREAD_STATE:()=>Xlt,ATTR_NETWORK_LOCAL_ADDRESS:()=>idt,ATTR_NETWORK_LOCAL_PORT:()=>sdt,ATTR_NETWORK_PEER_ADDRESS:()=>IV,ATTR_NETWORK_PEER_PORT:()=>CV,ATTR_NETWORK_PROTOCOL_NAME:()=>adt,ATTR_NETWORK_PROTOCOL_VERSION:()=>vV,ATTR_NETWORK_TRANSPORT:()=>RV,ATTR_NETWORK_TYPE:()=>ddt,ATTR_OTEL_SCOPE_NAME:()=>mdt,ATTR_OTEL_SCOPE_VERSION:()=>Adt,ATTR_OTEL_STATUS_CODE:()=>gdt,ATTR_OTEL_STATUS_DESCRIPTION:()=>_dt,ATTR_SERVER_ADDRESS:()=>xV,ATTR_SERVER_PORT:()=>DV,ATTR_SERVICE_INSTANCE_ID:()=>Edt,ATTR_SERVICE_NAME:()=>NV,ATTR_SERVICE_NAMESPACE:()=>ydt,ATTR_SERVICE_VERSION:()=>BV,ATTR_SIGNALR_CONNECTION_STATUS:()=>Sdt,ATTR_SIGNALR_TRANSPORT:()=>Cdt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Ddt,ATTR_TELEMETRY_SDK_NAME:()=>Qdt,ATTR_TELEMETRY_SDK_VERSION:()=>Fdt,ATTR_URL_FRAGMENT:()=>Gdt,ATTR_URL_FULL:()=>D_,ATTR_URL_PATH:()=>jdt,ATTR_URL_QUERY:()=>zdt,ATTR_URL_SCHEME:()=>Hdt,ATTR_USER_AGENT_ORIGINAL:()=>wV,AWSECSLAUNCHTYPEVALUES_EC2:()=>fct,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>mct,AwsEcsLaunchtypeValues:()=>Act,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Kut,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Jut,CLOUDPLATFORMVALUES_AWS_EC2:()=>Zut,CLOUDPLATFORMVALUES_AWS_ECS:()=>Wut,CLOUDPLATFORMVALUES_AWS_EKS:()=>Xut,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>tct,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>ect,CLOUDPLATFORMVALUES_AZURE_AKS:()=>oct,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>sct,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>rct,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>ict,CLOUDPLATFORMVALUES_AZURE_VM:()=>nct,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>dct,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>lct,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>uct,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>act,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>cct,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Hut,CLOUDPROVIDERVALUES_AWS:()=>$ut,CLOUDPROVIDERVALUES_AZURE:()=>qut,CLOUDPROVIDERVALUES_GCP:()=>Vut,CloudPlatformValues:()=>pct,CloudProviderValues:()=>Yut,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Dit,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Lit,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Nit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Mit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>wit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Qit,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Oit,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Bit,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Uit,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Pit,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>kit,DBSYSTEMVALUES_ADABAS:()=>Wot,DBSYSTEMVALUES_CACHE:()=>Zot,DBSYSTEMVALUES_CASSANDRA:()=>Ait,DBSYSTEMVALUES_CLOUDSCAPE:()=>zot,DBSYSTEMVALUES_COCKROACHDB:()=>Rit,DBSYSTEMVALUES_COLDFUSION:()=>mit,DBSYSTEMVALUES_COSMOSDB:()=>Sit,DBSYSTEMVALUES_COUCHBASE:()=>Eit,DBSYSTEMVALUES_COUCHDB:()=>yit,DBSYSTEMVALUES_DB2:()=>Qot,DBSYSTEMVALUES_DERBY:()=>eit,DBSYSTEMVALUES_DYNAMODB:()=>Tit,DBSYSTEMVALUES_EDB:()=>Jot,DBSYSTEMVALUES_ELASTICSEARCH:()=>Cit,DBSYSTEMVALUES_FILEMAKER:()=>tit,DBSYSTEMVALUES_FIREBIRD:()=>Xot,DBSYSTEMVALUES_FIRSTSQL:()=>Kot,DBSYSTEMVALUES_GEODE:()=>Iit,DBSYSTEMVALUES_H2:()=>fit,DBSYSTEMVALUES_HANADB:()=>Vot,DBSYSTEMVALUES_HBASE:()=>git,DBSYSTEMVALUES_HIVE:()=>jot,DBSYSTEMVALUES_HSQLDB:()=>Hot,DBSYSTEMVALUES_INFORMIX:()=>nit,DBSYSTEMVALUES_INGRES:()=>Yot,DBSYSTEMVALUES_INSTANTDB:()=>rit,DBSYSTEMVALUES_INTERBASE:()=>oit,DBSYSTEMVALUES_MARIADB:()=>iit,DBSYSTEMVALUES_MAXDB:()=>qot,DBSYSTEMVALUES_MEMCACHED:()=>vit,DBSYSTEMVALUES_MONGODB:()=>hit,DBSYSTEMVALUES_MSSQL:()=>Mot,DBSYSTEMVALUES_MYSQL:()=>Lot,DBSYSTEMVALUES_NEO4J:()=>bit,DBSYSTEMVALUES_NETEZZA:()=>sit,DBSYSTEMVALUES_ORACLE:()=>Uot,DBSYSTEMVALUES_OTHER_SQL:()=>Pot,DBSYSTEMVALUES_PERVASIVE:()=>ait,DBSYSTEMVALUES_POINTBASE:()=>uit,DBSYSTEMVALUES_POSTGRESQL:()=>Fot,DBSYSTEMVALUES_PROGRESS:()=>$ot,DBSYSTEMVALUES_REDIS:()=>_it,DBSYSTEMVALUES_REDSHIFT:()=>Got,DBSYSTEMVALUES_SQLITE:()=>cit,DBSYSTEMVALUES_SYBASE:()=>lit,DBSYSTEMVALUES_TERADATA:()=>dit,DBSYSTEMVALUES_VERTICA:()=>pit,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Slt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Tlt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>blt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Ilt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>vlt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Rlt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>xlt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Tsn,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>bsn,DbCassandraConsistencyLevelValues:()=>Fit,DbSystemValues:()=>xit,ERROR_TYPE_VALUE_OTHER:()=>Dlt,EVENT_EXCEPTION:()=>jpt,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Kit,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Yit,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Vit,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Zit,FAASINVOKEDPROVIDERVALUES_AWS:()=>Wit,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Xit,FAASINVOKEDPROVIDERVALUES_GCP:()=>est,FAASTRIGGERVALUES_DATASOURCE:()=>Git,FAASTRIGGERVALUES_HTTP:()=>jit,FAASTRIGGERVALUES_OTHER:()=>$it,FAASTRIGGERVALUES_PUBSUB:()=>zit,FAASTRIGGERVALUES_TIMER:()=>Hit,FaasDocumentOperationValues:()=>Jit,FaasInvokedProviderValues:()=>tst,FaasTriggerValues:()=>qit,HOSTARCHVALUES_AMD64:()=>gct,HOSTARCHVALUES_ARM32:()=>hct,HOSTARCHVALUES_ARM64:()=>_ct,HOSTARCHVALUES_IA64:()=>Ect,HOSTARCHVALUES_PPC32:()=>yct,HOSTARCHVALUES_PPC64:()=>Sct,HOSTARCHVALUES_X86:()=>Tct,HTTPFLAVORVALUES_HTTP_1_0:()=>Ust,HTTPFLAVORVALUES_HTTP_1_1:()=>Qst,HTTPFLAVORVALUES_HTTP_2_0:()=>Fst,HTTPFLAVORVALUES_QUIC:()=>jst,HTTPFLAVORVALUES_SPDY:()=>Gst,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Mlt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Llt,HTTP_REQUEST_METHOD_VALUE_GET:()=>Isn,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Ult,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Qlt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Plt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Flt,HTTP_REQUEST_METHOD_VALUE_POST:()=>Glt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Csn,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>jlt,HostArchValues:()=>bct,HttpFlavorValues:()=>zst,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Jlt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Zlt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>edt,JVM_THREAD_STATE_VALUE_NEW:()=>vsn,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>tdt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>ndt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>rdt,JVM_THREAD_STATE_VALUE_WAITING:()=>odt,MESSAGETYPEVALUES_RECEIVED:()=>Aat,MESSAGETYPEVALUES_SENT:()=>mat,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Hst,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>$st,MESSAGINGOPERATIONVALUES_PROCESS:()=>Yst,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Vst,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>$dt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>qdt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Vdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Jdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Kdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Ydt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Zdt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Wdt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Xdt,METRIC_DOTNET_EXCEPTIONS:()=>ept,METRIC_DOTNET_GC_COLLECTIONS:()=>tpt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>npt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>rpt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>opt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>ipt,METRIC_DOTNET_GC_PAUSE_TIME:()=>spt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>apt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>upt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>cpt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>lpt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>dpt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>ppt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>fpt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>mpt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Apt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>gpt,METRIC_DOTNET_TIMER_COUNT:()=>hpt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>_pt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Ept,METRIC_JVM_CLASS_COUNT:()=>ypt,METRIC_JVM_CLASS_LOADED:()=>Spt,METRIC_JVM_CLASS_UNLOADED:()=>Tpt,METRIC_JVM_CPU_COUNT:()=>bpt,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Ipt,METRIC_JVM_CPU_TIME:()=>Cpt,METRIC_JVM_GC_DURATION:()=>vpt,METRIC_JVM_MEMORY_COMMITTED:()=>Rpt,METRIC_JVM_MEMORY_LIMIT:()=>xpt,METRIC_JVM_MEMORY_USED:()=>Dpt,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Npt,METRIC_JVM_THREAD_COUNT:()=>Bpt,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>wpt,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Opt,METRIC_KESTREL_CONNECTION_DURATION:()=>kpt,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Ppt,METRIC_KESTREL_QUEUED_REQUESTS:()=>Mpt,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Lpt,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Upt,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Qpt,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Fpt,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Gpt,MessageTypeValues:()=>gat,MessagingDestinationKindValues:()=>qst,MessagingOperationValues:()=>Kst,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Est,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Tst,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>hst,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Dst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>yst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Sst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Rst,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>gst,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Bst,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>bst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Cst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Nst,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Ist,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>vst,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Ost,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>xst,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Mst,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>kst,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Pst,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>wst,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>_st,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>pst,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>fst,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>mst,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>lst,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>dst,NETTRANSPORTVALUES_INPROC:()=>ast,NETTRANSPORTVALUES_IP:()=>ost,NETTRANSPORTVALUES_IP_TCP:()=>nst,NETTRANSPORTVALUES_IP_UDP:()=>rst,NETTRANSPORTVALUES_OTHER:()=>ust,NETTRANSPORTVALUES_PIPE:()=>sst,NETTRANSPORTVALUES_UNIX:()=>ist,NETWORK_TRANSPORT_VALUE_PIPE:()=>udt,NETWORK_TRANSPORT_VALUE_QUIC:()=>cdt,NETWORK_TRANSPORT_VALUE_TCP:()=>Rsn,NETWORK_TRANSPORT_VALUE_UDP:()=>xsn,NETWORK_TRANSPORT_VALUE_UNIX:()=>ldt,NETWORK_TYPE_VALUE_IPV4:()=>pdt,NETWORK_TYPE_VALUE_IPV6:()=>fdt,NetHostConnectionSubtypeValues:()=>Lst,NetHostConnectionTypeValues:()=>Ast,NetTransportValues:()=>cst,OSTYPEVALUES_AIX:()=>wct,OSTYPEVALUES_DARWIN:()=>vct,OSTYPEVALUES_DRAGONFLYBSD:()=>Nct,OSTYPEVALUES_FREEBSD:()=>Rct,OSTYPEVALUES_HPUX:()=>Bct,OSTYPEVALUES_LINUX:()=>Cct,OSTYPEVALUES_NETBSD:()=>xct,OSTYPEVALUES_OPENBSD:()=>Dct,OSTYPEVALUES_SOLARIS:()=>Oct,OSTYPEVALUES_WINDOWS:()=>Ict,OSTYPEVALUES_Z_OS:()=>kct,OTEL_STATUS_CODE_VALUE_ERROR:()=>hdt,OTEL_STATUS_CODE_VALUE_OK:()=>Dsn,OsTypeValues:()=>Pct,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>sat,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>nat,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Zst,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>dat,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>eat,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>iat,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>cat,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Xst,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>tat,RPCGRPCSTATUSCODEVALUES_OK:()=>Jst,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>aat,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>rat,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>oat,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>pat,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>lat,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>uat,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Wst,RpcGrpcStatusCodeValues:()=>fat,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>qrt,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>oot,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>zrt,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Qrt,SEMATTRS_AWS_DYNAMODB_COUNT:()=>not,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Zrt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Krt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>iot,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Vrt,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Frt,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>$rt,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Jrt,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Hrt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Grt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>jrt,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>rot,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Xrt,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>eot,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Yrt,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Wrt,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Urt,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>tot,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Nnt,SEMATTRS_CODE_FILEPATH:()=>xrt,SEMATTRS_CODE_FUNCTION:()=>vrt,SEMATTRS_CODE_LINENO:()=>Drt,SEMATTRS_CODE_NAMESPACE:()=>Rrt,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Qnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Hnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>znt,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Gnt,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Lnt,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Unt,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>jnt,SEMATTRS_DB_CASSANDRA_TABLE:()=>Fnt,SEMATTRS_DB_CONNECTION_STRING:()=>Bnt,SEMATTRS_DB_HBASE_NAMESPACE:()=>$nt,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Ont,SEMATTRS_DB_MONGODB_COLLECTION:()=>Vnt,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Mnt,SEMATTRS_DB_NAME:()=>knt,SEMATTRS_DB_OPERATION:()=>Pnt,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>qnt,SEMATTRS_DB_SQL_TABLE:()=>Ynt,SEMATTRS_DB_STATEMENT:()=>sV,SEMATTRS_DB_SYSTEM:()=>iV,SEMATTRS_DB_USER:()=>wnt,SEMATTRS_ENDUSER_ID:()=>Srt,SEMATTRS_ENDUSER_ROLE:()=>Trt,SEMATTRS_ENDUSER_SCOPE:()=>brt,SEMATTRS_EXCEPTION_ESCAPED:()=>Wnt,SEMATTRS_EXCEPTION_MESSAGE:()=>Jnt,SEMATTRS_EXCEPTION_STACKTRACE:()=>Znt,SEMATTRS_EXCEPTION_TYPE:()=>Knt,SEMATTRS_FAAS_COLDSTART:()=>srt,SEMATTRS_FAAS_CRON:()=>irt,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>ert,SEMATTRS_FAAS_DOCUMENT_NAME:()=>rrt,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>trt,SEMATTRS_FAAS_DOCUMENT_TIME:()=>nrt,SEMATTRS_FAAS_EXECUTION:()=>Xnt,SEMATTRS_FAAS_INVOKED_NAME:()=>art,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>urt,SEMATTRS_FAAS_INVOKED_REGION:()=>crt,SEMATTRS_FAAS_TIME:()=>ort,SEMATTRS_FAAS_TRIGGER:()=>aV,SEMATTRS_HTTP_CLIENT_IP:()=>Lrt,SEMATTRS_HTTP_FLAVOR:()=>wrt,SEMATTRS_HTTP_HOST:()=>Nrt,SEMATTRS_HTTP_METHOD:()=>AB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>krt,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Prt,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>pV,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>fV,SEMATTRS_HTTP_ROUTE:()=>mV,SEMATTRS_HTTP_SCHEME:()=>Brt,SEMATTRS_HTTP_SERVER_NAME:()=>Mrt,SEMATTRS_HTTP_STATUS_CODE:()=>pS,SEMATTRS_HTTP_TARGET:()=>dV,SEMATTRS_HTTP_URL:()=>MC,SEMATTRS_HTTP_USER_AGENT:()=>Ort,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>wot,SEMATTRS_MESSAGE_ID:()=>Bot,SEMATTRS_MESSAGE_TYPE:()=>Not,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Oot,SEMATTRS_MESSAGING_CONSUMER_ID:()=>hot,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>fot,SEMATTRS_MESSAGING_DESTINATION:()=>sot,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>aot,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Sot,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>yot,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Eot,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Tot,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>bot,SEMATTRS_MESSAGING_MESSAGE_ID:()=>pot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Aot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>mot,SEMATTRS_MESSAGING_OPERATION:()=>got,SEMATTRS_MESSAGING_PROTOCOL:()=>cot,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>lot,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>_ot,SEMATTRS_MESSAGING_SYSTEM:()=>AV,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>uot,SEMATTRS_MESSAGING_URL:()=>dot,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Ert,SEMATTRS_NET_HOST_CARRIER_MCC:()=>hrt,SEMATTRS_NET_HOST_CARRIER_MNC:()=>_rt,SEMATTRS_NET_HOST_CARRIER_NAME:()=>grt,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Art,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>mrt,SEMATTRS_NET_HOST_IP:()=>cV,SEMATTRS_NET_HOST_NAME:()=>frt,SEMATTRS_NET_HOST_PORT:()=>lV,SEMATTRS_NET_PEER_IP:()=>uV,SEMATTRS_NET_PEER_NAME:()=>prt,SEMATTRS_NET_PEER_PORT:()=>drt,SEMATTRS_NET_TRANSPORT:()=>lrt,SEMATTRS_PEER_SERVICE:()=>yrt,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>hV,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>xot,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Dot,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Rot,SEMATTRS_RPC_JSONRPC_VERSION:()=>vot,SEMATTRS_RPC_METHOD:()=>Cot,SEMATTRS_RPC_SERVICE:()=>gV,SEMATTRS_RPC_SYSTEM:()=>Iot,SEMATTRS_THREAD_ID:()=>Irt,SEMATTRS_THREAD_NAME:()=>Crt,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>bat,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Tat,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Iat,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Cat,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>vat,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Rat,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>xat,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Nat,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Dat,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>wat,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Bat,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>_at,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>yat,SEMRESATTRS_CLOUD_PLATFORM:()=>Sat,SEMRESATTRS_CLOUD_PROVIDER:()=>hat,SEMRESATTRS_CLOUD_REGION:()=>Eat,SEMRESATTRS_CONTAINER_ID:()=>kat,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Mat,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Lat,SEMRESATTRS_CONTAINER_NAME:()=>Oat,SEMRESATTRS_CONTAINER_RUNTIME:()=>Pat,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Uat,SEMRESATTRS_DEVICE_ID:()=>Qat,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Fat,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Gat,SEMRESATTRS_FAAS_ID:()=>zat,SEMRESATTRS_FAAS_INSTANCE:()=>$at,SEMRESATTRS_FAAS_MAX_MEMORY:()=>qat,SEMRESATTRS_FAAS_NAME:()=>jat,SEMRESATTRS_FAAS_VERSION:()=>Hat,SEMRESATTRS_HOST_ARCH:()=>Jat,SEMRESATTRS_HOST_ID:()=>Vat,SEMRESATTRS_HOST_IMAGE_ID:()=>Wat,SEMRESATTRS_HOST_IMAGE_NAME:()=>Zat,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Xat,SEMRESATTRS_HOST_NAME:()=>Yat,SEMRESATTRS_HOST_TYPE:()=>Kat,SEMRESATTRS_K8S_CLUSTER_NAME:()=>eut,SEMRESATTRS_K8S_CONTAINER_NAME:()=>sut,SEMRESATTRS_K8S_CRONJOB_NAME:()=>_ut,SEMRESATTRS_K8S_CRONJOB_UID:()=>hut,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>mut,SEMRESATTRS_K8S_DAEMONSET_UID:()=>fut,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>lut,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>cut,SEMRESATTRS_K8S_JOB_NAME:()=>gut,SEMRESATTRS_K8S_JOB_UID:()=>Aut,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>rut,SEMRESATTRS_K8S_NODE_NAME:()=>tut,SEMRESATTRS_K8S_NODE_UID:()=>nut,SEMRESATTRS_K8S_POD_NAME:()=>iut,SEMRESATTRS_K8S_POD_UID:()=>out,SEMRESATTRS_K8S_REPLICASET_NAME:()=>uut,SEMRESATTRS_K8S_REPLICASET_UID:()=>aut,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>put,SEMRESATTRS_K8S_STATEFULSET_UID:()=>dut,SEMRESATTRS_OS_DESCRIPTION:()=>yut,SEMRESATTRS_OS_NAME:()=>Sut,SEMRESATTRS_OS_TYPE:()=>Eut,SEMRESATTRS_OS_VERSION:()=>Tut,SEMRESATTRS_PROCESS_COMMAND:()=>vut,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>xut,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Rut,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Iut,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Cut,SEMRESATTRS_PROCESS_OWNER:()=>Dut,SEMRESATTRS_PROCESS_PID:()=>but,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>wut,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Nut,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>But,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>kut,SEMRESATTRS_SERVICE_NAME:()=>Out,SEMRESATTRS_SERVICE_NAMESPACE:()=>_V,SEMRESATTRS_SERVICE_VERSION:()=>Put,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Qut,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Lut,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Mut,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Uut,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>jut,SEMRESATTRS_WEBENGINE_NAME:()=>Fut,SEMRESATTRS_WEBENGINE_VERSION:()=>Gut,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Tdt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>bdt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Idt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>vdt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Rdt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>xdt,SemanticAttributes:()=>kot,SemanticResourceAttributes:()=>zut,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Mct,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Lct,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Uct,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Qct,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Fct,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Gct,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>jct,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>zct,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Hct,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>$ct,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Nsn,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Ndt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Bdt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>Bsn,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>wdt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Odt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>wsn,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>kdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Pdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Mdt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Ldt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Udt,TelemetrySdkLanguageValues:()=>qct});var Xn=w(()=>{m();cye();PTe();MTe();LTe();UTe()});var QTe=M(dU=>{"use strict";m();Object.defineProperty(dU,"__esModule",{value:!0});dU.ATTR_PROCESS_RUNTIME_NAME=void 0;dU.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var FTe=M(fU=>{"use strict";m();Object.defineProperty(fU,"__esModule",{value:!0});fU.SDK_INFO=void 0;var zpt=_ge(),pU=(Xn(),Me(Hr)),Hpt=QTe();fU.SDK_INFO={[pU.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[Hpt.ATTR_PROCESS_RUNTIME_NAME]:"node",[pU.ATTR_TELEMETRY_SDK_LANGUAGE]:pU.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[pU.ATTR_TELEMETRY_SDK_VERSION]:zpt.VERSION}});var GTe=M(au=>{"use strict";m();Object.defineProperty(au,"__esModule",{value:!0});au.otperformance=au.SDK_INFO=au._globalThis=au.getStringListFromEnv=au.getNumberFromEnv=au.getBooleanFromEnv=au.getStringFromEnv=void 0;var mU=gge();Object.defineProperty(au,"getStringFromEnv",{enumerable:!0,get:function(){return mU.getStringFromEnv}});Object.defineProperty(au,"getBooleanFromEnv",{enumerable:!0,get:function(){return mU.getBooleanFromEnv}});Object.defineProperty(au,"getNumberFromEnv",{enumerable:!0,get:function(){return mU.getNumberFromEnv}});Object.defineProperty(au,"getStringListFromEnv",{enumerable:!0,get:function(){return mU.getStringListFromEnv}});var $pt=hge();Object.defineProperty(au,"_globalThis",{enumerable:!0,get:function(){return $pt._globalThis}});var qpt=FTe();Object.defineProperty(au,"SDK_INFO",{enumerable:!0,get:function(){return qpt.SDK_INFO}});au.otperformance=performance});var OV=M(uu=>{"use strict";m();Object.defineProperty(uu,"__esModule",{value:!0});uu.getStringListFromEnv=uu.getNumberFromEnv=uu.getStringFromEnv=uu.getBooleanFromEnv=uu.otperformance=uu._globalThis=uu.SDK_INFO=void 0;var AS=GTe();Object.defineProperty(uu,"SDK_INFO",{enumerable:!0,get:function(){return AS.SDK_INFO}});Object.defineProperty(uu,"_globalThis",{enumerable:!0,get:function(){return AS._globalThis}});Object.defineProperty(uu,"otperformance",{enumerable:!0,get:function(){return AS.otperformance}});Object.defineProperty(uu,"getBooleanFromEnv",{enumerable:!0,get:function(){return AS.getBooleanFromEnv}});Object.defineProperty(uu,"getStringFromEnv",{enumerable:!0,get:function(){return AS.getStringFromEnv}});Object.defineProperty(uu,"getNumberFromEnv",{enumerable:!0,get:function(){return AS.getNumberFromEnv}});Object.defineProperty(uu,"getStringListFromEnv",{enumerable:!0,get:function(){return AS.getStringListFromEnv}})});var $Te=M($r=>{"use strict";m();Object.defineProperty($r,"__esModule",{value:!0});$r.addHrTimes=$r.isTimeInput=$r.isTimeInputHrTime=$r.hrTimeToSeconds=$r.hrTimeToMilliseconds=$r.hrTimeToMicroseconds=$r.hrTimeToNanoseconds=$r.hrTimeToTimeStamp=$r.hrTimeDuration=$r.timeInputToHrTime=$r.hrTime=$r.getTimeOrigin=$r.millisToHrTime=void 0;var AU=OV(),jTe=9,Vpt=6,Ypt=Math.pow(10,Vpt),gB=Math.pow(10,jTe);function hB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*Ypt);return[n,r]}$r.millisToHrTime=hB;function Kpt(){return AU.otperformance.timeOrigin}$r.getTimeOrigin=Kpt;function zTe(e){let t=hB(AU.otperformance.timeOrigin),n=hB(typeof e=="number"?e:AU.otperformance.now());return HTe(t,n)}$r.hrTime=zTe;function Jpt(e){if(kV(e))return e;if(typeof e=="number")return e<AU.otperformance.timeOrigin?zTe(e):hB(e);if(e instanceof Date)return hB(e.getTime());throw TypeError("Invalid input type")}$r.timeInputToHrTime=Jpt;function Zpt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=gB),[n,r]}$r.hrTimeDuration=Zpt;function Wpt(e){let t=jTe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}$r.hrTimeToTimeStamp=Wpt;function Xpt(e){return e[0]*gB+e[1]}$r.hrTimeToNanoseconds=Xpt;function eft(e){return e[0]*1e6+e[1]/1e3}$r.hrTimeToMicroseconds=eft;function tft(e){return e[0]*1e3+e[1]/1e6}$r.hrTimeToMilliseconds=tft;function nft(e){return e[0]+e[1]/gB}$r.hrTimeToSeconds=nft;function kV(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}$r.isTimeInputHrTime=kV;function rft(e){return kV(e)||typeof e=="number"||e instanceof Date}$r.isTimeInput=rft;function HTe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=gB&&(n[1]-=gB,n[0]+=1),n}$r.addHrTimes=HTe});var qTe=M(gU=>{"use strict";m();Object.defineProperty(gU,"__esModule",{value:!0});gU.unrefTimer=void 0;function oft(e){typeof e!="number"&&e.unref()}gU.unrefTimer=oft});var VTe=M(_B=>{"use strict";m();Object.defineProperty(_B,"__esModule",{value:!0});_B.ExportResultCode=void 0;var ift;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(ift=_B.ExportResultCode||(_B.ExportResultCode={}))});var KTe=M(hU=>{"use strict";m();Object.defineProperty(hU,"__esModule",{value:!0});hU.CompositePropagator=void 0;var YTe=(He(),Me(tt)),PV=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let n=new Set;for(let r of this._propagators){let o=typeof r.fields=="function"?r.fields():[];for(let i of o)n.add(i)}this._fields=Array.from(n)}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){YTe.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${i.message}`)}}extract(t,n,r){return this._propagators.reduce((o,i)=>{try{return i.extract(o,n,r)}catch(s){YTe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};hU.CompositePropagator=PV});var JTe=M(UC=>{"use strict";m();Object.defineProperty(UC,"__esModule",{value:!0});UC.validateValue=UC.validateKey=void 0;var MV="[_0-9a-z-*/]",sft=`[a-z]${MV}{0,255}`,aft=`[a-z0-9]${MV}{0,240}@[a-z]${MV}{0,13}`,uft=new RegExp(`^(?:${sft}|${aft})$`),cft=/^[ -~]{0,255}[!-~]$/,lft=/,|=/;function dft(e){return uft.test(e)}UC.validateKey=dft;function pft(e){return cft.test(e)&&!lft.test(e)}UC.validateValue=pft});var UV=M(EU=>{"use strict";m();Object.defineProperty(EU,"__esModule",{value:!0});EU.TraceState=void 0;var _U=JTe(),fft=32,ZTe=512,WTe=",",XTe="=",LV=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,_U.validateKey)(t)||!(0,_U.validateValue)(n))return this;let r=this._getState(),o=r.get(t),i=this._length;if(typeof o=="string"?i+=n.length-o.length:i+=t.length+n.length+(r.size>0?2:1),i>ZTe)return this;let s=new Map(r);return s.delete(t),s.set(t,n),this._fromState(s,i)}unset(t){let n=this._getState(),r=n.get(t);if(typeof r!="string")return this;let o=this._length-(t.length+r.length+1);n.size>1&&(o=o-1);let i=new Map(n);return i.delete(t),this._fromState(i,o)}get(t){return this._getState().get(t)}serialize(){let t="",n=0;for(let r of this._getState())n>0&&(t=WTe+t),t=`${r[0]}${XTe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(WTe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(XTe);if(s===-1)continue;let u=i.slice(0,s),l=i.slice(s+1);if(!(0,_U.validateKey)(u)||!(0,_U.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>ZTe)&&(n.set(u,l),r=f,n.size>=fft))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};EU.TraceState=LV});var tbe=M(cu=>{"use strict";m();Object.defineProperty(cu,"__esModule",{value:!0});cu.W3CTraceContextPropagator=cu.parseTraceParent=cu.TRACE_STATE_HEADER=cu.TRACE_PARENT_HEADER=void 0;var yU=(He(),Me(tt)),mft=fB(),Aft=UV();cu.TRACE_PARENT_HEADER="traceparent";cu.TRACE_STATE_HEADER="tracestate";var gft="00",hft="(?!ff)[\\da-f]{2}",_ft="(?![0]{32})[\\da-f]{32}",Eft="(?![0]{16})[\\da-f]{16}",yft="[\\da-f]{2}",Sft=new RegExp(`^\\s?(${hft})-(${_ft})-(${Eft})-(${yft})(-.*)?\\s?$`);function ebe(e){let t=Sft.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}cu.parseTraceParent=ebe;var QV=class{inject(t,n,r){let o=yU.trace.getSpanContext(t);if(!o||(0,mft.isTracingSuppressed)(t)||!(0,yU.isSpanContextValid)(o))return;let i=`${gft}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||yU.TraceFlags.NONE).toString(16)}`;r.set(n,cu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,cu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,cu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=ebe(i);if(!s)return t;s.isRemote=!0;let u=r.get(n,cu.TRACE_STATE_HEADER);if(u){let l=Array.isArray(u)?u.join(","):u;s.traceState=new Aft.TraceState(typeof l=="string"?l:void 0)}return yU.trace.setSpanContext(t,s)}fields(){return[cu.TRACE_PARENT_HEADER,cu.TRACE_STATE_HEADER]}};cu.W3CTraceContextPropagator=QV});var nbe=M(Af=>{"use strict";m();Object.defineProperty(Af,"__esModule",{value:!0});Af.getRPCMetadata=Af.deleteRPCMetadata=Af.setRPCMetadata=Af.RPCType=void 0;var Tft=(He(),Me(tt)),FV=(0,Tft.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),bft;(function(e){e.HTTP="http"})(bft=Af.RPCType||(Af.RPCType={}));function Ift(e,t){return e.setValue(FV,t)}Af.setRPCMetadata=Ift;function Cft(e){return e.deleteValue(FV)}Af.deleteRPCMetadata=Cft;function vft(e){return e.getValue(FV)}Af.getRPCMetadata=vft});var abe=M(SU=>{"use strict";m();Object.defineProperty(SU,"__esModule",{value:!0});SU.isPlainObject=void 0;var Rft="[object Object]",xft="[object Null]",Dft="[object Undefined]",Nft=Function.prototype,rbe=Nft.toString,Bft=rbe.call(Object),wft=Object.getPrototypeOf,obe=Object.prototype,ibe=obe.hasOwnProperty,gS=Symbol?Symbol.toStringTag:void 0,sbe=obe.toString;function Oft(e){if(!kft(e)||Pft(e)!==Rft)return!1;let t=wft(e);if(t===null)return!0;let n=ibe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&rbe.call(n)===Bft}SU.isPlainObject=Oft;function kft(e){return e!=null&&typeof e=="object"}function Pft(e){return e==null?e===void 0?Dft:xft:gS&&gS in Object(e)?Mft(e):Lft(e)}function Mft(e){let t=ibe.call(e,gS),n=e[gS],r=!1;try{e[gS]=void 0,r=!0}catch{}let o=sbe.call(e);return r&&(t?e[gS]=n:delete e[gS]),o}function Lft(e){return sbe.call(e)}});var pbe=M(IU=>{"use strict";m();Object.defineProperty(IU,"__esModule",{value:!0});IU.merge=void 0;var ube=abe(),Uft=20;function Qft(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=lbe(t,e.shift(),0,n);return t}IU.merge=Qft;function GV(e){return bU(e)?e.slice():e}function lbe(e,t,n=0,r){let o;if(!(n>Uft)){if(n++,TU(e)||TU(t)||dbe(t))o=GV(t);else if(bU(e)){if(o=e.slice(),bU(t))for(let i=0,s=t.length;i<s;i++)o.push(GV(t[i]));else if(EB(t)){let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=GV(t[l]))}}}else if(EB(e))if(EB(t)){if(!Fft(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(TU(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],_=f;if(cbe(e,l,r)||cbe(t,l,r))delete o[l];else{if(EB(h)&&EB(_)){let y=r.get(h)||[],T=r.get(_)||[];y.push({obj:e,key:l}),T.push({obj:t,key:l}),r.set(h,y),r.set(_,T)}o[l]=lbe(o[l],f,n,r)}}}}else o=t;return o}}function cbe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let s=r[o];if(s.key===t&&s.obj===e)return!0}return!1}function bU(e){return Array.isArray(e)}function dbe(e){return typeof e=="function"}function EB(e){return!TU(e)&&!bU(e)&&!dbe(e)&&typeof e=="object"}function TU(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Fft(e,t){return!(!(0,ube.isPlainObject)(e)||!(0,ube.isPlainObject)(t))}});var fbe=M(QC=>{"use strict";m();Object.defineProperty(QC,"__esModule",{value:!0});QC.callWithTimeout=QC.TimeoutError=void 0;var CU=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};QC.TimeoutError=CU;function Gft(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new CU("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}QC.callWithTimeout=Gft});var Abe=M(FC=>{"use strict";m();Object.defineProperty(FC,"__esModule",{value:!0});FC.isUrlIgnored=FC.urlMatches=void 0;function mbe(e,t){return typeof t=="string"?e===t:!!e.match(t)}FC.urlMatches=mbe;function jft(e,t){if(!t)return!1;for(let n of t)if(mbe(e,n))return!0;return!1}FC.isUrlIgnored=jft});var gbe=M(vU=>{"use strict";m();Object.defineProperty(vU,"__esModule",{value:!0});vU.Deferred=void 0;var jV=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};vU.Deferred=jV});var hbe=M(RU=>{"use strict";m();Object.defineProperty(RU,"__esModule",{value:!0});RU.BindOnceFuture=void 0;var zft=gbe(),zV=class{_isCalled=!1;_deferred=new zft.Deferred;_callback;_that;constructor(t,n){this._callback=t,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};RU.BindOnceFuture=zV});var Ebe=M(xU=>{"use strict";m();Object.defineProperty(xU,"__esModule",{value:!0});xU.diagLogLevelFromString=void 0;var xg=(He(),Me(tt)),_be={ALL:xg.DiagLogLevel.ALL,VERBOSE:xg.DiagLogLevel.VERBOSE,DEBUG:xg.DiagLogLevel.DEBUG,INFO:xg.DiagLogLevel.INFO,WARN:xg.DiagLogLevel.WARN,ERROR:xg.DiagLogLevel.ERROR,NONE:xg.DiagLogLevel.NONE};function Hft(e){if(e==null)return;let t=_be[e.toUpperCase()];return t??(xg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(_be)}, using default`),xg.DiagLogLevel.INFO)}xU.diagLogLevelFromString=Hft});var Sbe=M(DU=>{"use strict";m();Object.defineProperty(DU,"__esModule",{value:!0});DU._export=void 0;var ybe=(He(),Me(tt)),$ft=fB();function qft(e,t){return new Promise(n=>{ybe.context.with((0,$ft.suppressTracing)(ybe.context.active()),()=>{e.export(t,n)})})}DU._export=qft});var vr=M(Be=>{"use strict";m();Object.defineProperty(Be,"__esModule",{value:!0});Be.diagLogLevelFromString=Be.BindOnceFuture=Be.urlMatches=Be.isUrlIgnored=Be.callWithTimeout=Be.TimeoutError=Be.merge=Be.TraceState=Be.unsuppressTracing=Be.suppressTracing=Be.isTracingSuppressed=Be.setRPCMetadata=Be.getRPCMetadata=Be.deleteRPCMetadata=Be.RPCType=Be.parseTraceParent=Be.W3CTraceContextPropagator=Be.TRACE_STATE_HEADER=Be.TRACE_PARENT_HEADER=Be.CompositePropagator=Be.otperformance=Be.getStringListFromEnv=Be.getNumberFromEnv=Be.getBooleanFromEnv=Be.getStringFromEnv=Be._globalThis=Be.SDK_INFO=Be.parseKeyPairsIntoRecord=Be.ExportResultCode=Be.unrefTimer=Be.timeInputToHrTime=Be.millisToHrTime=Be.isTimeInputHrTime=Be.isTimeInput=Be.hrTimeToTimeStamp=Be.hrTimeToSeconds=Be.hrTimeToNanoseconds=Be.hrTimeToMilliseconds=Be.hrTimeToMicroseconds=Be.hrTimeDuration=Be.hrTime=Be.getTimeOrigin=Be.addHrTimes=Be.loggingErrorHandler=Be.setGlobalErrorHandler=Be.globalErrorHandler=Be.sanitizeAttributes=Be.isAttributeValue=Be.AnchoredClock=Be.W3CBaggagePropagator=void 0;Be.internal=void 0;var Vft=oge();Object.defineProperty(Be,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Vft.W3CBaggagePropagator}});var Yft=ige();Object.defineProperty(Be,"AnchoredClock",{enumerable:!0,get:function(){return Yft.AnchoredClock}});var Tbe=lge();Object.defineProperty(Be,"isAttributeValue",{enumerable:!0,get:function(){return Tbe.isAttributeValue}});Object.defineProperty(Be,"sanitizeAttributes",{enumerable:!0,get:function(){return Tbe.sanitizeAttributes}});var bbe=pge();Object.defineProperty(Be,"globalErrorHandler",{enumerable:!0,get:function(){return bbe.globalErrorHandler}});Object.defineProperty(Be,"setGlobalErrorHandler",{enumerable:!0,get:function(){return bbe.setGlobalErrorHandler}});var Kft=rV();Object.defineProperty(Be,"loggingErrorHandler",{enumerable:!0,get:function(){return Kft.loggingErrorHandler}});var Gl=$Te();Object.defineProperty(Be,"addHrTimes",{enumerable:!0,get:function(){return Gl.addHrTimes}});Object.defineProperty(Be,"getTimeOrigin",{enumerable:!0,get:function(){return Gl.getTimeOrigin}});Object.defineProperty(Be,"hrTime",{enumerable:!0,get:function(){return Gl.hrTime}});Object.defineProperty(Be,"hrTimeDuration",{enumerable:!0,get:function(){return Gl.hrTimeDuration}});Object.defineProperty(Be,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMicroseconds}});Object.defineProperty(Be,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMilliseconds}});Object.defineProperty(Be,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Gl.hrTimeToNanoseconds}});Object.defineProperty(Be,"hrTimeToSeconds",{enumerable:!0,get:function(){return Gl.hrTimeToSeconds}});Object.defineProperty(Be,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Gl.hrTimeToTimeStamp}});Object.defineProperty(Be,"isTimeInput",{enumerable:!0,get:function(){return Gl.isTimeInput}});Object.defineProperty(Be,"isTimeInputHrTime",{enumerable:!0,get:function(){return Gl.isTimeInputHrTime}});Object.defineProperty(Be,"millisToHrTime",{enumerable:!0,get:function(){return Gl.millisToHrTime}});Object.defineProperty(Be,"timeInputToHrTime",{enumerable:!0,get:function(){return Gl.timeInputToHrTime}});var Jft=qTe();Object.defineProperty(Be,"unrefTimer",{enumerable:!0,get:function(){return Jft.unrefTimer}});var Zft=VTe();Object.defineProperty(Be,"ExportResultCode",{enumerable:!0,get:function(){return Zft.ExportResultCode}});var Wft=X5();Object.defineProperty(Be,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Wft.parseKeyPairsIntoRecord}});var hS=OV();Object.defineProperty(Be,"SDK_INFO",{enumerable:!0,get:function(){return hS.SDK_INFO}});Object.defineProperty(Be,"_globalThis",{enumerable:!0,get:function(){return hS._globalThis}});Object.defineProperty(Be,"getStringFromEnv",{enumerable:!0,get:function(){return hS.getStringFromEnv}});Object.defineProperty(Be,"getBooleanFromEnv",{enumerable:!0,get:function(){return hS.getBooleanFromEnv}});Object.defineProperty(Be,"getNumberFromEnv",{enumerable:!0,get:function(){return hS.getNumberFromEnv}});Object.defineProperty(Be,"getStringListFromEnv",{enumerable:!0,get:function(){return hS.getStringListFromEnv}});Object.defineProperty(Be,"otperformance",{enumerable:!0,get:function(){return hS.otperformance}});var Xft=KTe();Object.defineProperty(Be,"CompositePropagator",{enumerable:!0,get:function(){return Xft.CompositePropagator}});var NU=tbe();Object.defineProperty(Be,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return NU.TRACE_PARENT_HEADER}});Object.defineProperty(Be,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return NU.TRACE_STATE_HEADER}});Object.defineProperty(Be,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return NU.W3CTraceContextPropagator}});Object.defineProperty(Be,"parseTraceParent",{enumerable:!0,get:function(){return NU.parseTraceParent}});var BU=nbe();Object.defineProperty(Be,"RPCType",{enumerable:!0,get:function(){return BU.RPCType}});Object.defineProperty(Be,"deleteRPCMetadata",{enumerable:!0,get:function(){return BU.deleteRPCMetadata}});Object.defineProperty(Be,"getRPCMetadata",{enumerable:!0,get:function(){return BU.getRPCMetadata}});Object.defineProperty(Be,"setRPCMetadata",{enumerable:!0,get:function(){return BU.setRPCMetadata}});var HV=fB();Object.defineProperty(Be,"isTracingSuppressed",{enumerable:!0,get:function(){return HV.isTracingSuppressed}});Object.defineProperty(Be,"suppressTracing",{enumerable:!0,get:function(){return HV.suppressTracing}});Object.defineProperty(Be,"unsuppressTracing",{enumerable:!0,get:function(){return HV.unsuppressTracing}});var emt=UV();Object.defineProperty(Be,"TraceState",{enumerable:!0,get:function(){return emt.TraceState}});var tmt=pbe();Object.defineProperty(Be,"merge",{enumerable:!0,get:function(){return tmt.merge}});var Ibe=fbe();Object.defineProperty(Be,"TimeoutError",{enumerable:!0,get:function(){return Ibe.TimeoutError}});Object.defineProperty(Be,"callWithTimeout",{enumerable:!0,get:function(){return Ibe.callWithTimeout}});var Cbe=Abe();Object.defineProperty(Be,"isUrlIgnored",{enumerable:!0,get:function(){return Cbe.isUrlIgnored}});Object.defineProperty(Be,"urlMatches",{enumerable:!0,get:function(){return Cbe.urlMatches}});var nmt=hbe();Object.defineProperty(Be,"BindOnceFuture",{enumerable:!0,get:function(){return nmt.BindOnceFuture}});var rmt=Ebe();Object.defineProperty(Be,"diagLogLevelFromString",{enumerable:!0,get:function(){return rmt.diagLogLevelFromString}});var omt=Sbe();Be.internal={_export:omt._export}});var vbe=M(wU=>{"use strict";m();Object.defineProperty(wU,"__esModule",{value:!0});wU.VERSION=void 0;wU.VERSION="0.214.0"});var Rbe=M(yB=>{"use strict";m();Object.defineProperty(yB,"__esModule",{value:!0});yB.SeverityNumber=void 0;var imt;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(imt=yB.SeverityNumber||(yB.SeverityNumber={}))});var kU=M(GC=>{"use strict";m();Object.defineProperty(GC,"__esModule",{value:!0});GC.NOOP_LOGGER=GC.NoopLogger=void 0;var OU=class{emit(t){}};GC.NoopLogger=OU;GC.NOOP_LOGGER=new OU});var xbe=M(wm=>{"use strict";m();Object.defineProperty(wm,"__esModule",{value:!0});wm.API_BACKWARDS_COMPATIBILITY_VERSION=wm.makeGetter=wm._global=wm.GLOBAL_LOGS_API_KEY=void 0;wm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");wm._global=globalThis;function smt(e,t,n){return r=>r===e?t:n}wm.makeGetter=smt;wm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var $V=M(jC=>{"use strict";m();Object.defineProperty(jC,"__esModule",{value:!0});jC.NOOP_LOGGER_PROVIDER=jC.NoopLoggerProvider=void 0;var amt=kU(),PU=class{getLogger(t,n,r){return new amt.NoopLogger}};jC.NoopLoggerProvider=PU;jC.NOOP_LOGGER_PROVIDER=new PU});var Dbe=M(MU=>{"use strict";m();Object.defineProperty(MU,"__esModule",{value:!0});MU.ProxyLogger=void 0;var umt=kU(),qV=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):umt.NOOP_LOGGER}};MU.ProxyLogger=qV});var Nbe=M(LU=>{"use strict";m();Object.defineProperty(LU,"__esModule",{value:!0});LU.ProxyLoggerProvider=void 0;var cmt=$V(),lmt=Dbe(),VV=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new lmt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:cmt.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};LU.ProxyLoggerProvider=VV});var wbe=M(UU=>{"use strict";m();Object.defineProperty(UU,"__esModule",{value:!0});UU.LogsAPI=void 0;var Vd=xbe(),dmt=$V(),Bbe=Nbe(),YV=class e{constructor(){this._proxyLoggerProvider=new Bbe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Vd._global[Vd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Vd._global[Vd.GLOBAL_LOGS_API_KEY]=(0,Vd.makeGetter)(Vd.API_BACKWARDS_COMPATIBILITY_VERSION,t,dmt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Vd._global[Vd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Vd._global,Vd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Vd._global[Vd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Bbe.ProxyLoggerProvider}};UU.LogsAPI=YV});var KV=M(Om=>{"use strict";m();Object.defineProperty(Om,"__esModule",{value:!0});Om.logs=Om.NoopLogger=Om.NOOP_LOGGER=Om.SeverityNumber=void 0;var pmt=Rbe();Object.defineProperty(Om,"SeverityNumber",{enumerable:!0,get:function(){return pmt.SeverityNumber}});var Obe=kU();Object.defineProperty(Om,"NOOP_LOGGER",{enumerable:!0,get:function(){return Obe.NOOP_LOGGER}});Object.defineProperty(Om,"NoopLogger",{enumerable:!0,get:function(){return Obe.NoopLogger}});var fmt=wbe();Om.logs=fmt.LogsAPI.getInstance()});var kbe=M(zC=>{"use strict";m();Object.defineProperty(zC,"__esModule",{value:!0});zC.disableInstrumentations=zC.enableInstrumentations=void 0;function mmt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}zC.enableInstrumentations=mmt;function Amt(e){e.forEach(t=>t.disable())}zC.disableInstrumentations=Amt});var Lbe=M(QU=>{"use strict";m();Object.defineProperty(QU,"__esModule",{value:!0});QU.registerInstrumentations=void 0;var Pbe=(He(),Me(tt)),gmt=KV(),Mbe=kbe();function hmt(e){let t=e.tracerProvider||Pbe.trace.getTracerProvider(),n=e.meterProvider||Pbe.metrics.getMeterProvider(),r=e.loggerProvider||gmt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Mbe.enableInstrumentations)(o,t,n,r),()=>{(0,Mbe.disableInstrumentations)(o)}}QU.registerInstrumentations=hmt});var qbe=M(FU=>{"use strict";m();Object.defineProperty(FU,"__esModule",{value:!0});FU.satisfies=void 0;var XV=(He(),Me(tt)),jbe=/^(?: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-]+)*))?$/,_mt=/^(?<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-]+)*))?$/,Emt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function ymt(e,t,n){if(!Smt(e))return XV.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Cmt(e);if(!r)return!1;let o=[],i=zbe(r,t,o,n);return i&&!n?.includePrerelease?bmt(r,o):i}FU.satisfies=ymt;function Smt(e){return typeof e=="string"&&jbe.test(e)}function zbe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(JV(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=qmt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!JV(e,i,n,r))return!1;return!0}return JV(e,t,n,r)}function JV(e,t,n,r){if(t=Imt(t,r),t.includes(" "))return zbe(e,t,n,r);{let o=vmt(t);return n.push(o),Tmt(e,o)}}function Tmt(e,t){if(t.invalid)return!1;if(!t.version||WV(t.version))return!0;let n=Qbe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=Qbe(r,o)}return Emt[t.op]?.includes(n)}function bmt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Imt(e,t){return e=e.trim(),e=Hmt(e,t),e=zmt(e),e=$mt(e,t),e=e.trim(),e}function $u(e){return!e||e.toLowerCase()==="x"||e==="*"}function Cmt(e){let t=e.match(jbe);if(!t){XV.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function vmt(e){if(!e)return{};let t=e.match(_mt);if(!t)return XV.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function WV(e){return e==="*"||e==="x"||e==="X"}function Ube(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Rmt(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function xmt(e,t){if(WV(e)||WV(t))return 0;let[n,r]=Rmt(Ube(e),Ube(t));return n>r?1:n<r?-1:0}function Qbe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=xmt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var Hbe="[a-zA-Z0-9-]",$be="0|[1-9]\\d*",Dmt=`\\d*[a-zA-Z-]${Hbe}*`,Nmt="((?:<|>)?=?)",Fbe=`(?:${$be}|${Dmt})`,Bmt=`(?:-(${Fbe}(?:\\.${Fbe})*))`,Gbe=`${Hbe}+`,wmt=`(?:\\+(${Gbe}(?:\\.${Gbe})*))`,ZV=`${$be}|x|X|\\*`,SB=`[v=\\s]*(${ZV})(?:\\.(${ZV})(?:\\.(${ZV})(?:${Bmt})?${wmt}?)?)?`,Omt=`^${Nmt}\\s*${SB}$`,kmt=new RegExp(Omt),Pmt=`^\\s*(${SB})\\s+-\\s+(${SB})\\s*$`,Mmt=new RegExp(Pmt),Lmt="(?:~>?)",Umt=`^${Lmt}${SB}$`,Qmt=new RegExp(Umt),Fmt="(?:\\^)",Gmt=`^${Fmt}${SB}$`,jmt=new RegExp(Gmt);function zmt(e){let t=Qmt;return e.replace(t,(n,r,o,i,s)=>{let u;return $u(r)?u="":$u(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:$u(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function Hmt(e,t){let n=jmt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return $u(i)?f="":$u(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:$u(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function $mt(e,t){let n=kmt;return e.replace(n,(r,o,i,s,u,l)=>{let f=$u(i),h=f||$u(s),_=h||$u(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function qmt(e,t){let n=Mmt;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>($u(i)?o="":$u(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:$u(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,$u(_)?h="":$u(y)?h=`<${+_+1}.0.0-0`:$u(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var e7=M(xa=>{"use strict";m();Object.defineProperty(xa,"__esModule",{value:!0});xa.massUnwrap=xa.unwrap=xa.massWrap=xa.wrap=void 0;var qu=console.error.bind(console);function TB(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var Vmt=(e,t,n)=>{if(!e||!e[t]){qu("no original function "+String(t)+" to wrap");return}if(!n){qu("no wrapper function"),qu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){qu("original object and wrapper must be functions");return}let o=n(r,t);return TB(o,"__original",r),TB(o,"__unwrap",()=>{e[t]===o&&TB(e,t,r)}),TB(o,"__wrapped",!0),TB(e,t,o),o};xa.wrap=Vmt;var Ymt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,xa.wrap)(r,o,n)})})};xa.massWrap=Ymt;var Kmt=(e,t)=>{if(!e||!e[t]){qu("no function to unwrap."),qu(new Error().stack);return}let n=e[t];if(!n.__unwrap)qu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};xa.unwrap=Kmt;var Jmt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,xa.unwrap)(n,r)})})};xa.massUnwrap=Jmt;function bB(e){e&&e.logger&&(typeof e.logger!="function"?qu("new logger isn't a function, not replacing"):qu=e.logger)}xa.default=bB;bB.wrap=xa.wrap;bB.massWrap=xa.massWrap;bB.unwrap=xa.unwrap;bB.massUnwrap=xa.massUnwrap});var Vbe=M(jU=>{"use strict";m();Object.defineProperty(jU,"__esModule",{value:!0});jU.InstrumentationAbstract=void 0;var t7=(He(),Me(tt)),Zmt=KV(),GU=e7(),n7=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=t7.diag.createComponentLogger({namespace:t}),this._tracer=t7.trace.getTracer(t,n),this._meter=t7.metrics.getMeter(t,n),this._logger=Zmt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=GU.wrap;_unwrap=GU.unwrap;_massWrap=GU.massWrap;_massUnwrap=GU.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};jU.InstrumentationAbstract=n7});var Kbe=M((aun,Ybe)=>{m();var HC=1e3,$C=HC*60,qC=$C*60,_S=qC*24,Wmt=_S*7,Xmt=_S*365.25;Ybe.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return eAt(e);if(n==="number"&&isFinite(e))return t.long?nAt(e):tAt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function eAt(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Xmt;case"weeks":case"week":case"w":return n*Wmt;case"days":case"day":case"d":return n*_S;case"hours":case"hour":case"hrs":case"hr":case"h":return n*qC;case"minutes":case"minute":case"mins":case"min":case"m":return n*$C;case"seconds":case"second":case"secs":case"sec":case"s":return n*HC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function tAt(e){var t=Math.abs(e);return t>=_S?Math.round(e/_S)+"d":t>=qC?Math.round(e/qC)+"h":t>=$C?Math.round(e/$C)+"m":t>=HC?Math.round(e/HC)+"s":e+"ms"}function nAt(e){var t=Math.abs(e);return t>=_S?zU(e,t,_S,"day"):t>=qC?zU(e,t,qC,"hour"):t>=$C?zU(e,t,$C,"minute"):t>=HC?zU(e,t,HC,"second"):e+" ms"}function zU(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var r7=M((cun,Jbe)=>{m();function rAt(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=u,n.humanize=Kbe(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let _=0;for(let y=0;y<h.length;y++)_=(_<<5)-_+h.charCodeAt(y),_|=0;return n.colors[Math.abs(_)%n.colors.length]}n.selectColor=t;function n(h){let _,y=null,T,v;function R(...x){if(!R.enabled)return;let O=R,P=Number(new Date),j=P-(_||P);O.diff=j,O.prev=_,O.curr=P,_=P,x[0]=n.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let G=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(V,ae)=>{if(V==="%%")return"%";G++;let re=n.formatters[ae];if(typeof re=="function"){let _e=x[G];V=re.call(O,_e),x.splice(G,1),G--}return V}),n.formatArgs.call(O,x),(O.log||n.log).apply(O,x)}return R.namespace=h,R.useColors=n.useColors(),R.color=n.selectColor(h),R.extend=r,R.destroy=n.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,v=n.enabled(h)),v),set:x=>{y=x}}),typeof n.init=="function"&&n.init(R),R}function r(h,_){let y=n(this.namespace+(typeof _>"u"?":":_)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let _=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of _)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,_){let y=0,T=0,v=-1,R=0;for(;y<h.length;)if(T<_.length&&(_[T]===h[y]||_[T]==="*"))_[T]==="*"?(v=T,R=y,T++):(y++,T++);else if(v!==-1)T=v+1,R++,y=R;else return!1;for(;T<_.length&&_[T]==="*";)T++;return T===_.length}function s(){let h=[...n.names,...n.skips.map(_=>"-"+_)].join(",");return n.enable(""),h}function u(h){for(let _ of n.skips)if(i(h,_))return!1;for(let _ of n.names)if(i(h,_))return!0;return!1}function l(h){return h instanceof Error?h.stack||h.message:h}function f(){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}Jbe.exports=rAt});var Zbe=M((Gc,HU)=>{m();Gc.formatArgs=iAt;Gc.save=sAt;Gc.load=aAt;Gc.useColors=oAt;Gc.storage=uAt();Gc.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();Gc.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 oAt(){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 e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function iAt(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+HU.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),e.splice(r,0,t)}Gc.log=console.debug||console.log||(()=>{});function sAt(e){try{e?Gc.storage.setItem("debug",e):Gc.storage.removeItem("debug")}catch{}}function aAt(){let e;try{e=Gc.storage.getItem("debug")||Gc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function uAt(){try{return localStorage}catch{}}HU.exports=r7()(Gc);var{formatters:cAt}=HU.exports;cAt.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Xbe=M((pun,Wbe)=>{"use strict";m();Wbe.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var nIe=M((mun,tIe)=>{"use strict";m();var lAt=Ue("os"),eIe=Ue("tty"),Yd=Xbe(),{env:Xs}=process,N_;Yd("no-color")||Yd("no-colors")||Yd("color=false")||Yd("color=never")?N_=0:(Yd("color")||Yd("colors")||Yd("color=true")||Yd("color=always"))&&(N_=1);"FORCE_COLOR"in Xs&&(Xs.FORCE_COLOR==="true"?N_=1:Xs.FORCE_COLOR==="false"?N_=0:N_=Xs.FORCE_COLOR.length===0?1:Math.min(parseInt(Xs.FORCE_COLOR,10),3));function o7(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i7(e,t){if(N_===0)return 0;if(Yd("color=16m")||Yd("color=full")||Yd("color=truecolor"))return 3;if(Yd("color=256"))return 2;if(e&&!t&&N_===void 0)return 0;let n=N_||0;if(Xs.TERM==="dumb")return n;if(process.platform==="win32"){let r=lAt.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Xs)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Xs)||Xs.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Xs)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Xs.TEAMCITY_VERSION)?1:0;if(Xs.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Xs){let r=parseInt((Xs.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Xs.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Xs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Xs.TERM)||"COLORTERM"in Xs?1:n}function dAt(e){let t=i7(e,e&&e.isTTY);return o7(t)}tIe.exports={supportsColor:dAt,stdout:o7(i7(!0,eIe.isatty(1))),stderr:o7(i7(!0,eIe.isatty(2)))}});var oIe=M((ea,qU)=>{m();var pAt=Ue("tty"),$U=Ue("util");ea.init=EAt;ea.log=gAt;ea.formatArgs=mAt;ea.save=hAt;ea.load=_At;ea.useColors=fAt;ea.destroy=$U.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ea.colors=[6,2,3,4,5,1];try{let e=nIe();e&&(e.stderr||e).level>=2&&(ea.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{}ea.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),r=process.env[t];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),e[n]=r,e},{});function fAt(){return"colors"in ea.inspectOpts?!!ea.inspectOpts.colors:pAt.isatty(process.stderr.fd)}function mAt(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
|
|
3
|
+
var ktt=Object.create;var ML=Object.defineProperty;var Ptt=Object.getOwnPropertyDescriptor;var Mtt=Object.getOwnPropertyNames;var Ltt=Object.getPrototypeOf,Utt=Object.prototype.hasOwnProperty;var Ue=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var M=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Zs=(e,t)=>{for(var n in t)ML(e,n,{get:t[n],enumerable:!0})},aAe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Mtt(t))!Utt.call(e,o)&&o!==n&&ML(e,o,{get:()=>t[o],enumerable:!(r=Ptt(t,o))||r.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?ktt(Ltt(e)):{},aAe(t||!e||!e.__esModule?ML(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>aAe(ML({},"__esModule",{value:!0}),e);var m=w(()=>{(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0.1.200"}}catch{}})()});var Ig,g5=w(()=>{m();Ig="1.9.1"});function Qtt(e){let t=new Set([e]),n=new Set,r=e.match(lAe);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(l){return l===e};function i(u){return n.add(u),!1}function s(u){return t.add(u),!0}return function(l){if(t.has(l))return!0;if(n.has(l))return!1;let f=l.match(lAe);if(!f)return i(l);let h={major:+f[1],minor:+f[2],patch:+f[3],prerelease:f[4]};return h.prerelease!=null||o.major!==h.major?i(l):o.major===0?o.minor===h.minor&&o.patch<=h.patch?s(l):i(l):o.minor<=h.minor?s(l):i(l)}}var lAe,dAe,pAe=w(()=>{m();g5();lAe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;dAe=Qtt(Ig)});function vm(e,t,n,r=!1){var o;let i=sB[iB]=(o=sB[iB])!==null&&o!==void 0?o:{version:Ig};if(!r&&i[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(i.version!==Ig){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Ig}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Ig}.`),!0}function Ul(e){var t,n;let r=(t=sB[iB])===null||t===void 0?void 0:t.version;if(!(!r||!dAe(r)))return(n=sB[iB])===null||n===void 0?void 0:n[e]}function Rm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Ig}.`);let n=sB[iB];n&&delete n[e]}var Ftt,iB,sB,uS=w(()=>{m();g5();pAe();Ftt=Ig.split(".")[0],iB=Symbol.for(`opentelemetry.js.api.${Ftt}`),sB=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function aB(e,t,n){let r=Ul("diag");if(r)return r[e](t,...n)}var LL,fAe=w(()=>{m();uS();LL=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return aB("debug",this._namespace,t)}error(...t){return aB("error",this._namespace,t)}info(...t){return aB("info",this._namespace,t)}warn(...t){return aB("warn",this._namespace,t)}verbose(...t){return aB("verbose",this._namespace,t)}}});var Cs,UL=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Cs||(Cs={}))});function mAe(e,t){e<Cs.NONE?e=Cs.NONE:e>Cs.ALL&&(e=Cs.ALL),t=t||{};function n(r,o){let i=t[r];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return{error:n("error",Cs.ERROR),warn:n("warn",Cs.WARN),info:n("info",Cs.INFO),debug:n("debug",Cs.DEBUG),verbose:n("verbose",Cs.VERBOSE)}}var AAe=w(()=>{m();UL()});var Gtt,Ws,cS=w(()=>{m();fAe();AAe();UL();uS();Gtt="diag",Ws=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let s=Ul("diag");if(s)return s[o](...i)}}let n=this,r=(o,i={logLevel:Cs.INFO})=>{var s,u,l;if(o===n){let _=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=_.stack)!==null&&s!==void 0?s:_.message),!1}typeof i=="number"&&(i={logLevel:i});let f=Ul("diag"),h=mAe((u=i.logLevel)!==null&&u!==void 0?u:Cs.INFO,o);if(f&&!i.suppressOverrideMessage){let _=(l=new Error().stack)!==null&&l!==void 0?l:"<failed to generate stacktrace>";f.warn(`Current logger will be overwritten from ${_}`),h.warn(`Current logger will overwrite one already registered from ${_}`)}return vm("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{Rm(Gtt,n)},n.createComponentLogger=o=>new LL(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var QL,gAe=w(()=>{m();QL=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let r of t)n._entries.delete(r);return n}clear(){return new e}}});var hAe,_Ae=w(()=>{m();hAe=Symbol("BaggageEntryMetadata")});function EAe(e={}){return new QL(new Map(Object.entries(e)))}function yAe(e){return typeof e!="string"&&(jtt.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:hAe,toString(){return e}}}var jtt,h5=w(()=>{m();cS();gAe();_Ae();jtt=Ws.instance()});function Ql(e){return Symbol.for(e)}var _5,BC,uB=w(()=>{m();_5=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let i=new e(n._currentContext);return i._currentContext.set(r,o),i},n.deleteValue=r=>{let o=new e(n._currentContext);return o._currentContext.delete(r),o}}},BC=new _5});var E5,y5,FL,SAe=w(()=>{m();E5=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],y5={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(y5[t]=console[t])}FL=class{constructor(){function t(n){return function(...r){let o=y5[n];if(typeof o!="function"&&(o=y5.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<E5.length;n++)this[E5[n].n]=t(E5[n].c)}}});function TAe(){return D5}var S5,wC,T5,b5,I5,C5,cB,v5,R5,x5,D5,ztt,Htt,$tt,qtt,Vtt,Ytt,Ktt,N5=w(()=>{m();S5=class{constructor(){}createGauge(t,n){return Htt}createHistogram(t,n){return $tt}createCounter(t,n){return ztt}createUpDownCounter(t,n){return qtt}createObservableGauge(t,n){return Ytt}createObservableCounter(t,n){return Vtt}createObservableUpDownCounter(t,n){return Ktt}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},wC=class{},T5=class extends wC{add(t,n){}},b5=class extends wC{add(t,n){}},I5=class extends wC{record(t,n){}},C5=class extends wC{record(t,n){}},cB=class{addCallback(t){}removeCallback(t){}},v5=class extends cB{},R5=class extends cB{},x5=class extends cB{},D5=new S5,ztt=new T5,Htt=new I5,$tt=new C5,qtt=new b5,Vtt=new v5,Ytt=new R5,Ktt=new x5});var GL,bAe=w(()=>{m();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(GL||(GL={}))});var jL,zL,B5=w(()=>{m();jL={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},zL={set(e,t,n){e!=null&&(e[t]=n)}}});var HL,IAe=w(()=>{m();uB();HL=class{active(){return BC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var w5,Jtt,xm,lB=w(()=>{m();IAe();uS();cS();w5="context",Jtt=new HL,xm=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return vm(w5,t,Ws.instance())}active(){return this._getContextManager().active()}with(t,n,r,...o){return this._getContextManager().with(t,n,r,...o)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return Ul(w5)||Jtt}disable(){this._getContextManager().disable(),Rm(w5,Ws.instance())}}});var iu,O5=w(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(iu||(iu={}))});var dB,lS,$L,qL=w(()=>{m();O5();dB="0000000000000000",lS="00000000000000000000000000000000",$L={traceId:lS,spanId:dB,traceFlags:iu.NONE}});var Dm,VL=w(()=>{m();qL();Dm=class{constructor(t=$L){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}}});function YL(e){return e.getValue(k5)||void 0}function CAe(){return YL(xm.getInstance().active())}function pB(e,t){return e.setValue(k5,t)}function vAe(e){return e.deleteValue(k5)}function RAe(e,t){return pB(e,new Dm(t))}function KL(e){var t;return(t=YL(e))===null||t===void 0?void 0:t.spanContext()}var k5,P5=w(()=>{m();uB();VL();lB();k5=Ql("OpenTelemetry Context Key SPAN")});function xAe(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(JL[e.charCodeAt(r)]|0)+(JL[e.charCodeAt(r+1)]|0)+(JL[e.charCodeAt(r+2)]|0)+(JL[e.charCodeAt(r+3)]|0);return n===t}function M5(e){return xAe(e,32)&&e!==lS}function L5(e){return xAe(e,16)&&e!==dB}function Cg(e){return M5(e.traceId)&&L5(e.spanId)}function DAe(e){return new Dm(e)}var JL,ZL=w(()=>{m();qL();VL();JL=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 Ztt(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}var U5,OC,Q5=w(()=>{m();lB();P5();VL();ZL();U5=xm.getInstance(),OC=class{startSpan(t,n,r=U5.active()){if(!!n?.root)return new Dm;let i=r&&KL(r);return Ztt(i)&&Cg(i)?new Dm(i):new Dm}startActiveSpan(t,n,r,o){let i,s,u;if(arguments.length<2)return;arguments.length===2?u=n:arguments.length===3?(i=n,u=r):(i=n,s=r,u=o);let l=s??U5.active(),f=this.startSpan(t,i,l),h=pB(l,f);return U5.with(h,u,void 0,f)}}});var Wtt,kC,F5=w(()=>{m();Q5();Wtt=new OC,kC=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}startSpan(t,n,r){return this._getTracer().startSpan(t,n,r)}startActiveSpan(t,n,r,o){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Wtt}}});var WL,NAe=w(()=>{m();Q5();WL=class{getTracer(t,n,r){return new OC}}});var Xtt,dS,G5=w(()=>{m();F5();NAe();Xtt=new WL,dS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new kC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Xtt}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(t,n,r)}}});var XL,BAe=w(()=>{m();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(XL||(XL={}))});var fo,wAe=w(()=>{m();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(fo||(fo={}))});var Ai,OAe=w(()=>{m();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Ai||(Ai={}))});function kAe(e){return nnt.test(e)}function PAe(e){return rnt.test(e)&&!ont.test(e)}var j5,ent,tnt,nnt,rnt,ont,MAe=w(()=>{m();j5="[_0-9a-z-*/]",ent=`[a-z]${j5}{0,255}`,tnt=`[a-z0-9]${j5}{0,240}@[a-z]${j5}{0,13}`,nnt=new RegExp(`^(?:${ent}|${tnt})$`),rnt=/^[ -~]{0,255}[!-~]$/,ont=/,|=/});var LAe,int,UAe,QAe,eU,FAe=w(()=>{m();MAe();LAe=32,int=512,UAe=",",QAe="=",eU=class e{constructor(t){this._internalState=new Map,t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reduceRight((t,n)=>(t.push(n+QAe+this.get(n)),t),[]).join(UAe)}_parse(t){t.length>int||(this._internalState=t.split(UAe).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(QAe);if(i!==-1){let s=o.slice(0,i),u=o.slice(i+1,r.length);kAe(s)&&PAe(u)&&n.set(s,u)}return n},new Map),this._internalState.size>LAe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,LAe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function GAe(e){return new eU(e)}var jAe=w(()=>{m();FAe()});var We,zAe=w(()=>{m();lB();We=xm.getInstance()});var Fl,HAe=w(()=>{m();cS();Fl=Ws.instance()});var z5,$Ae,qAe=w(()=>{m();N5();z5=class{getMeter(t,n,r){return D5}},$Ae=new z5});var H5,tU,VAe=w(()=>{m();qAe();uS();cS();H5="metrics",tU=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return vm(H5,t,Ws.instance())}getMeterProvider(){return Ul(H5)||$Ae}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){Rm(H5,Ws.instance())}}});var $5,YAe=w(()=>{m();VAe();$5=tU.getInstance()});var nU,KAe=w(()=>{m();nU=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function V5(e){return e.getValue(q5)||void 0}function JAe(){return V5(xm.getInstance().active())}function ZAe(e,t){return e.setValue(q5,t)}function WAe(e){return e.deleteValue(q5)}var q5,XAe=w(()=>{m();lB();uB();q5=Ql("OpenTelemetry Baggage Key")});var Y5,snt,rU,ege=w(()=>{m();uS();KAe();B5();XAe();h5();cS();Y5="propagation",snt=new nU,rU=class e{constructor(){this.createBaggage=EAe,this.getBaggage=V5,this.getActiveBaggage=JAe,this.setBaggage=ZAe,this.deleteBaggage=WAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return vm(Y5,t,Ws.instance())}inject(t,n,r=zL){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=jL){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){Rm(Y5,Ws.instance())}_getGlobalPropagator(){return Ul(Y5)||snt}}});var mf,tge=w(()=>{m();ege();mf=rU.getInstance()});var K5,oU,nge=w(()=>{m();uS();G5();ZL();P5();cS();K5="trace",oU=class e{constructor(){this._proxyTracerProvider=new dS,this.wrapSpanContext=DAe,this.isSpanContextValid=Cg,this.deleteSpan=vAe,this.getSpan=YL,this.getActiveSpan=CAe,this.getSpanContext=KL,this.setSpan=pB,this.setSpanContext=RAe}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=vm(K5,this._proxyTracerProvider,Ws.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return Ul(K5)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){Rm(K5,Ws.instance()),this._proxyTracerProvider=new dS}}});var Vt,rge=w(()=>{m();nge();Vt=oU.getInstance()});var tt={};Zs(tt,{DiagConsoleLogger:()=>FL,DiagLogLevel:()=>Cs,INVALID_SPANID:()=>dB,INVALID_SPAN_CONTEXT:()=>$L,INVALID_TRACEID:()=>lS,ProxyTracer:()=>kC,ProxyTracerProvider:()=>dS,ROOT_CONTEXT:()=>BC,SamplingDecision:()=>XL,SpanKind:()=>fo,SpanStatusCode:()=>Ai,TraceFlags:()=>iu,ValueType:()=>GL,baggageEntryMetadataFromString:()=>yAe,context:()=>We,createContextKey:()=>Ql,createNoopMeter:()=>TAe,createTraceState:()=>GAe,default:()=>ant,defaultTextMapGetter:()=>jL,defaultTextMapSetter:()=>zL,diag:()=>Fl,isSpanContextValid:()=>Cg,isValidSpanId:()=>L5,isValidTraceId:()=>M5,metrics:()=>$5,propagation:()=>mf,trace:()=>Vt});var ant,He=w(()=>{m();h5();uB();SAe();UL();N5();bAe();B5();F5();G5();BAe();wAe();OAe();O5();jAe();ZL();qL();zAe();HAe();YAe();tge();rge();ant={context:We,diag:Fl,metrics:$5,propagation:mf,trace:Vt}});var fB=M(R_=>{"use strict";m();Object.defineProperty(R_,"__esModule",{value:!0});R_.isTracingSuppressed=R_.unsuppressTracing=R_.suppressTracing=void 0;var unt=(He(),Me(tt)),J5=(0,unt.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function cnt(e){return e.setValue(J5,!0)}R_.suppressTracing=cnt;function lnt(e){return e.deleteValue(J5)}R_.unsuppressTracing=lnt;function dnt(e){return e.getValue(J5)===!0}R_.isTracingSuppressed=dnt});var Z5=M(su=>{"use strict";m();Object.defineProperty(su,"__esModule",{value:!0});su.BAGGAGE_MAX_TOTAL_LENGTH=su.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=su.BAGGAGE_MAX_NAME_VALUE_PAIRS=su.BAGGAGE_HEADER=su.BAGGAGE_ITEMS_SEPARATOR=su.BAGGAGE_PROPERTIES_SEPARATOR=su.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;su.BAGGAGE_KEY_PAIR_SEPARATOR="=";su.BAGGAGE_PROPERTIES_SEPARATOR=";";su.BAGGAGE_ITEMS_SEPARATOR=",";su.BAGGAGE_HEADER="baggage";su.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;su.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;su.BAGGAGE_MAX_TOTAL_LENGTH=8192});var X5=M(qd=>{"use strict";m();Object.defineProperty(qd,"__esModule",{value:!0});qd.parseKeyPairsIntoRecord=qd.parseBaggageHeaderString=qd.parsePairKeyValue=qd.getKeyPairs=qd.serializeKeyPairs=void 0;var pnt=(He(),Me(tt)),Nm=Z5();function fnt(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?Nm.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Nm.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}qd.serializeKeyPairs=fnt;function mnt(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Nm.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}qd.getKeyPairs=mnt;function W5(e){if(!e)return;let t=e.indexOf(Nm.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(Nm.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let s,u;try{s=decodeURIComponent(o),u=decodeURIComponent(i)}catch{return}let l;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);l=(0,pnt.baggageEntryMetadataFromString)(f)}return{key:s,value:u,metadata:l}}qd.parsePairKeyValue=W5;function Ant(e,t,n,r){let o=0;for(;o<e.length&&n<Nm.BAGGAGE_MAX_NAME_VALUE_PAIRS;){let i=e.indexOf(Nm.BAGGAGE_ITEMS_SEPARATOR,o),s=i===-1?e.length:i,u=s-o;if(u<=Nm.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS){let l=W5(e.substring(o,s));if(l){let f=(n===0?0:1)+u;if(r+f>Nm.BAGGAGE_MAX_TOTAL_LENGTH)break;t[l.key]=l.metadata?{value:l.value,metadata:l.metadata}:{value:l.value},n++,r+=f}}if(i===-1)break;o=i+1}return[n,r]}qd.parseBaggageHeaderString=Ant;function gnt(e){let t={};return typeof e=="string"&&e.length>0&&e.split(Nm.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=W5(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}qd.parseKeyPairsIntoRecord=gnt});var oge=M(sU=>{"use strict";m();Object.defineProperty(sU,"__esModule",{value:!0});sU.W3CBaggagePropagator=void 0;var eV=(He(),Me(tt)),hnt=fB(),mB=Z5(),iU=X5(),tV=class{inject(t,n,r){let o=eV.propagation.getBaggage(t);if(!o||(0,hnt.isTracingSuppressed)(t))return;let i=(0,iU.getKeyPairs)(o).filter(u=>u.length<=mB.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,mB.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,iU.serializeKeyPairs)(i);s.length>0&&r.set(n,mB.BAGGAGE_HEADER,s)}extract(t,n,r){let o=r.get(n,mB.BAGGAGE_HEADER);if(!o)return t;let i={},s=0,u=0;if(Array.isArray(o))for(let l=0;l<o.length;l++)[s,u]=(0,iU.parseBaggageHeaderString)(o[l],i,s,u);else[s]=(0,iU.parseBaggageHeaderString)(o,i,s,u);return s===0?t:eV.propagation.setBaggage(t,eV.propagation.createBaggage(i))}fields(){return[mB.BAGGAGE_HEADER]}};sU.W3CBaggagePropagator=tV});var ige=M(aU=>{"use strict";m();Object.defineProperty(aU,"__esModule",{value:!0});aU.AnchoredClock=void 0;var nV=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,n){this._monotonicClock=n,this._epochMillis=t.now(),this._performanceMillis=n.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}};aU.AnchoredClock=nV});var lge=M(x_=>{"use strict";m();Object.defineProperty(x_,"__esModule",{value:!0});x_.isAttributeValue=x_.isAttributeKey=x_.sanitizeAttributes=void 0;var sge=(He(),Me(tt));function _nt(e){let t={};if(typeof e!="object"||e==null)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!age(n)){sge.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!uge(r)){sge.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}x_.sanitizeAttributes=_nt;function age(e){return typeof e=="string"&&e!==""}x_.isAttributeKey=age;function uge(e){return e==null?!0:Array.isArray(e)?Ent(e):cge(typeof e)}x_.isAttributeValue=uge;function Ent(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(cge(r)){t=r;continue}return!1}return!1}}return!0}function cge(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var rV=M(uU=>{"use strict";m();Object.defineProperty(uU,"__esModule",{value:!0});uU.loggingErrorHandler=void 0;var ynt=(He(),Me(tt));function Snt(){return e=>{ynt.diag.error(Tnt(e))}}uU.loggingErrorHandler=Snt;function Tnt(e){return typeof e=="string"?e:JSON.stringify(bnt(e))}function bnt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(t[r])return;let o=n[r];o&&(t[r]=String(o))}),n=Object.getPrototypeOf(n);return t}});var pge=M(PC=>{"use strict";m();Object.defineProperty(PC,"__esModule",{value:!0});PC.globalErrorHandler=PC.setGlobalErrorHandler=void 0;var Int=rV(),dge=(0,Int.loggingErrorHandler)();function Cnt(e){dge=e}PC.setGlobalErrorHandler=Cnt;function vnt(e){try{dge(e)}catch{}}PC.globalErrorHandler=vnt});var gge=M(Bm=>{"use strict";m();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.getStringListFromEnv=Bm.getBooleanFromEnv=Bm.getStringFromEnv=Bm.getNumberFromEnv=void 0;var fge=(He(),Me(tt)),mge=Ue("util");function Rnt(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){fge.diag.warn(`Unknown value ${(0,mge.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}Bm.getNumberFromEnv=Rnt;function Age(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}Bm.getStringFromEnv=Age;function xnt(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||fge.diag.warn(`Unknown value ${(0,mge.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Bm.getBooleanFromEnv=xnt;function Dnt(e){return Age(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}Bm.getStringListFromEnv=Dnt});var hge=M(cU=>{"use strict";m();Object.defineProperty(cU,"__esModule",{value:!0});cU._globalThis=void 0;cU._globalThis=globalThis});var _ge=M(lU=>{"use strict";m();Object.defineProperty(lU,"__esModule",{value:!0});lU.VERSION=void 0;lU.VERSION="2.8.0"});function Oi(e){let t={},n=e.length;for(let r=0;r<n;r++){let o=e[r];o&&(t[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return t}var oV=w(()=>{m()});var Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e,U_e,Nnt,iV,Bnt,wnt,Ont,knt,sV,Pnt,Mnt,Lnt,Unt,Qnt,Fnt,Gnt,jnt,znt,Hnt,$nt,qnt,Vnt,Ynt,Knt,Jnt,Znt,Wnt,aV,Xnt,ert,trt,nrt,rrt,ort,irt,srt,art,urt,crt,lrt,uV,drt,prt,cV,lV,frt,mrt,Art,grt,hrt,_rt,Ert,yrt,Srt,Trt,brt,Irt,Crt,vrt,Rrt,xrt,Drt,AB,MC,dV,Nrt,Brt,pS,wrt,Ort,krt,Prt,pV,fV,Mrt,mV,Lrt,Urt,Qrt,Frt,Grt,jrt,zrt,Hrt,$rt,qrt,Vrt,Yrt,Krt,Jrt,Zrt,Wrt,Xrt,eot,tot,not,rot,oot,iot,AV,sot,aot,uot,cot,lot,dot,pot,fot,mot,Aot,got,hot,_ot,Eot,yot,Sot,Tot,bot,Iot,gV,Cot,hV,vot,Rot,xot,Dot,Not,Bot,wot,Oot,kot,Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,BEe,Pot,Mot,Lot,Uot,Qot,Fot,Got,jot,zot,Hot,$ot,qot,Vot,Yot,Kot,Jot,Zot,Wot,Xot,eit,tit,nit,rit,oit,iit,sit,ait,uit,cit,lit,dit,pit,fit,mit,Ait,git,hit,_it,Eit,yit,Sit,Tit,bit,Iit,Cit,vit,Rit,xit,wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe,Dit,Nit,Bit,wit,Oit,kit,Pit,Mit,Lit,Uit,Qit,Fit,zEe,HEe,$Ee,qEe,VEe,Git,jit,zit,Hit,$it,qit,YEe,KEe,JEe,Vit,Yit,Kit,Jit,ZEe,WEe,XEe,e0e,Zit,Wit,Xit,est,tst,t0e,n0e,r0e,o0e,i0e,s0e,a0e,nst,rst,ost,ist,sst,ast,ust,cst,u0e,c0e,l0e,d0e,p0e,lst,dst,pst,fst,mst,Ast,f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e,O0e,gst,hst,_st,Est,yst,Sst,Tst,bst,Ist,Cst,vst,Rst,xst,Dst,Nst,Bst,wst,Ost,kst,Pst,Mst,Lst,k0e,P0e,M0e,L0e,U0e,Ust,Qst,Fst,Gst,jst,zst,Q0e,F0e,Hst,$st,qst,G0e,j0e,Vst,Yst,Kst,z0e,H0e,$0e,q0e,V0e,Y0e,K0e,J0e,Z0e,W0e,X0e,eye,tye,nye,rye,oye,iye,Jst,Zst,Wst,Xst,eat,tat,nat,rat,oat,iat,sat,aat,uat,cat,lat,dat,pat,fat,sye,aye,mat,Aat,gat,uye=w(()=>{m();oV();Ege="aws.lambda.invoked_arn",yge="db.system",Sge="db.connection_string",Tge="db.user",bge="db.jdbc.driver_classname",Ige="db.name",Cge="db.statement",vge="db.operation",Rge="db.mssql.instance_name",xge="db.cassandra.keyspace",Dge="db.cassandra.page_size",Nge="db.cassandra.consistency_level",Bge="db.cassandra.table",wge="db.cassandra.idempotence",Oge="db.cassandra.speculative_execution_count",kge="db.cassandra.coordinator.id",Pge="db.cassandra.coordinator.dc",Mge="db.hbase.namespace",Lge="db.redis.database_index",Uge="db.mongodb.collection",Qge="db.sql.table",Fge="exception.type",Gge="exception.message",jge="exception.stacktrace",zge="exception.escaped",Hge="faas.trigger",$ge="faas.execution",qge="faas.document.collection",Vge="faas.document.operation",Yge="faas.document.time",Kge="faas.document.name",Jge="faas.time",Zge="faas.cron",Wge="faas.coldstart",Xge="faas.invoked_name",ehe="faas.invoked_provider",the="faas.invoked_region",nhe="net.transport",rhe="net.peer.ip",ohe="net.peer.port",ihe="net.peer.name",she="net.host.ip",ahe="net.host.port",uhe="net.host.name",che="net.host.connection.type",lhe="net.host.connection.subtype",dhe="net.host.carrier.name",phe="net.host.carrier.mcc",fhe="net.host.carrier.mnc",mhe="net.host.carrier.icc",Ahe="peer.service",ghe="enduser.id",hhe="enduser.role",_he="enduser.scope",Ehe="thread.id",yhe="thread.name",She="code.function",The="code.namespace",bhe="code.filepath",Ihe="code.lineno",Che="http.method",vhe="http.url",Rhe="http.target",xhe="http.host",Dhe="http.scheme",Nhe="http.status_code",Bhe="http.flavor",whe="http.user_agent",Ohe="http.request_content_length",khe="http.request_content_length_uncompressed",Phe="http.response_content_length",Mhe="http.response_content_length_uncompressed",Lhe="http.server_name",Uhe="http.route",Qhe="http.client_ip",Fhe="aws.dynamodb.table_names",Ghe="aws.dynamodb.consumed_capacity",jhe="aws.dynamodb.item_collection_metrics",zhe="aws.dynamodb.provisioned_read_capacity",Hhe="aws.dynamodb.provisioned_write_capacity",$he="aws.dynamodb.consistent_read",qhe="aws.dynamodb.projection",Vhe="aws.dynamodb.limit",Yhe="aws.dynamodb.attributes_to_get",Khe="aws.dynamodb.index_name",Jhe="aws.dynamodb.select",Zhe="aws.dynamodb.global_secondary_indexes",Whe="aws.dynamodb.local_secondary_indexes",Xhe="aws.dynamodb.exclusive_start_table",e_e="aws.dynamodb.table_count",t_e="aws.dynamodb.scan_forward",n_e="aws.dynamodb.segment",r_e="aws.dynamodb.total_segments",o_e="aws.dynamodb.count",i_e="aws.dynamodb.scanned_count",s_e="aws.dynamodb.attribute_definitions",a_e="aws.dynamodb.global_secondary_index_updates",u_e="messaging.system",c_e="messaging.destination",l_e="messaging.destination_kind",d_e="messaging.temp_destination",p_e="messaging.protocol",f_e="messaging.protocol_version",m_e="messaging.url",A_e="messaging.message_id",g_e="messaging.conversation_id",h_e="messaging.message_payload_size_bytes",__e="messaging.message_payload_compressed_size_bytes",E_e="messaging.operation",y_e="messaging.consumer_id",S_e="messaging.rabbitmq.routing_key",T_e="messaging.kafka.message_key",b_e="messaging.kafka.consumer_group",I_e="messaging.kafka.client_id",C_e="messaging.kafka.partition",v_e="messaging.kafka.tombstone",R_e="rpc.system",x_e="rpc.service",D_e="rpc.method",N_e="rpc.grpc.status_code",B_e="rpc.jsonrpc.version",w_e="rpc.jsonrpc.request_id",O_e="rpc.jsonrpc.error_code",k_e="rpc.jsonrpc.error_message",P_e="message.type",M_e="message.id",L_e="message.compressed_size",U_e="message.uncompressed_size",Nnt=Ege,iV=yge,Bnt=Sge,wnt=Tge,Ont=bge,knt=Ige,sV=Cge,Pnt=vge,Mnt=Rge,Lnt=xge,Unt=Dge,Qnt=Nge,Fnt=Bge,Gnt=wge,jnt=Oge,znt=kge,Hnt=Pge,$nt=Mge,qnt=Lge,Vnt=Uge,Ynt=Qge,Knt=Fge,Jnt=Gge,Znt=jge,Wnt=zge,aV=Hge,Xnt=$ge,ert=qge,trt=Vge,nrt=Yge,rrt=Kge,ort=Jge,irt=Zge,srt=Wge,art=Xge,urt=ehe,crt=the,lrt=nhe,uV=rhe,drt=ohe,prt=ihe,cV=she,lV=ahe,frt=uhe,mrt=che,Art=lhe,grt=dhe,hrt=phe,_rt=fhe,Ert=mhe,yrt=Ahe,Srt=ghe,Trt=hhe,brt=_he,Irt=Ehe,Crt=yhe,vrt=She,Rrt=The,xrt=bhe,Drt=Ihe,AB=Che,MC=vhe,dV=Rhe,Nrt=xhe,Brt=Dhe,pS=Nhe,wrt=Bhe,Ort=whe,krt=Ohe,Prt=khe,pV=Phe,fV=Mhe,Mrt=Lhe,mV=Uhe,Lrt=Qhe,Urt=Fhe,Qrt=Ghe,Frt=jhe,Grt=zhe,jrt=Hhe,zrt=$he,Hrt=qhe,$rt=Vhe,qrt=Yhe,Vrt=Khe,Yrt=Jhe,Krt=Zhe,Jrt=Whe,Zrt=Xhe,Wrt=e_e,Xrt=t_e,eot=n_e,tot=r_e,not=o_e,rot=i_e,oot=s_e,iot=a_e,AV=u_e,sot=c_e,aot=l_e,uot=d_e,cot=p_e,lot=f_e,dot=m_e,pot=A_e,fot=g_e,mot=h_e,Aot=__e,got=E_e,hot=y_e,_ot=S_e,Eot=T_e,yot=b_e,Sot=I_e,Tot=C_e,bot=v_e,Iot=R_e,gV=x_e,Cot=D_e,hV=N_e,vot=B_e,Rot=w_e,xot=O_e,Dot=k_e,Not=P_e,Bot=M_e,wot=L_e,Oot=U_e,kot=Oi([Ege,yge,Sge,Tge,bge,Ige,Cge,vge,Rge,xge,Dge,Nge,Bge,wge,Oge,kge,Pge,Mge,Lge,Uge,Qge,Fge,Gge,jge,zge,Hge,$ge,qge,Vge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,she,ahe,uhe,che,lhe,dhe,phe,fhe,mhe,Ahe,ghe,hhe,_he,Ehe,yhe,She,The,bhe,Ihe,Che,vhe,Rhe,xhe,Dhe,Nhe,Bhe,whe,Ohe,khe,Phe,Mhe,Lhe,Uhe,Qhe,Fhe,Ghe,jhe,zhe,Hhe,$he,qhe,Vhe,Yhe,Khe,Jhe,Zhe,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,s_e,a_e,u_e,c_e,l_e,d_e,p_e,f_e,m_e,A_e,g_e,h_e,__e,E_e,y_e,S_e,T_e,b_e,I_e,C_e,v_e,R_e,x_e,D_e,N_e,B_e,w_e,O_e,k_e,P_e,M_e,L_e,U_e]),Q_e="other_sql",F_e="mssql",G_e="mysql",j_e="oracle",z_e="db2",H_e="postgresql",$_e="redshift",q_e="hive",V_e="cloudscape",Y_e="hsqldb",K_e="progress",J_e="maxdb",Z_e="hanadb",W_e="ingres",X_e="firstsql",eEe="edb",tEe="cache",nEe="adabas",rEe="firebird",oEe="derby",iEe="filemaker",sEe="informix",aEe="instantdb",uEe="interbase",cEe="mariadb",lEe="netezza",dEe="pervasive",pEe="pointbase",fEe="sqlite",mEe="sybase",AEe="teradata",gEe="vertica",hEe="h2",_Ee="coldfusion",EEe="cassandra",yEe="hbase",SEe="mongodb",TEe="redis",bEe="couchbase",IEe="couchdb",CEe="cosmosdb",vEe="dynamodb",REe="neo4j",xEe="geode",DEe="elasticsearch",NEe="memcached",BEe="cockroachdb",Pot=Q_e,Mot=F_e,Lot=G_e,Uot=j_e,Qot=z_e,Fot=H_e,Got=$_e,jot=q_e,zot=V_e,Hot=Y_e,$ot=K_e,qot=J_e,Vot=Z_e,Yot=W_e,Kot=X_e,Jot=eEe,Zot=tEe,Wot=nEe,Xot=rEe,eit=oEe,tit=iEe,nit=sEe,rit=aEe,oit=uEe,iit=cEe,sit=lEe,ait=dEe,uit=pEe,cit=fEe,lit=mEe,dit=AEe,pit=gEe,fit=hEe,mit=_Ee,Ait=EEe,git=yEe,hit=SEe,_it=TEe,Eit=bEe,yit=IEe,Sit=CEe,Tit=vEe,bit=REe,Iit=xEe,Cit=DEe,vit=NEe,Rit=BEe,xit=Oi([Q_e,F_e,G_e,j_e,z_e,H_e,$_e,q_e,V_e,Y_e,K_e,J_e,Z_e,W_e,X_e,eEe,tEe,nEe,rEe,oEe,iEe,sEe,aEe,uEe,cEe,lEe,dEe,pEe,fEe,mEe,AEe,gEe,hEe,_Ee,EEe,yEe,SEe,TEe,bEe,IEe,CEe,vEe,REe,xEe,DEe,NEe,BEe]),wEe="all",OEe="each_quorum",kEe="quorum",PEe="local_quorum",MEe="one",LEe="two",UEe="three",QEe="local_one",FEe="any",GEe="serial",jEe="local_serial",Dit=wEe,Nit=OEe,Bit=kEe,wit=PEe,Oit=MEe,kit=LEe,Pit=UEe,Mit=QEe,Lit=FEe,Uit=GEe,Qit=jEe,Fit=Oi([wEe,OEe,kEe,PEe,MEe,LEe,UEe,QEe,FEe,GEe,jEe]),zEe="datasource",HEe="http",$Ee="pubsub",qEe="timer",VEe="other",Git=zEe,jit=HEe,zit=$Ee,Hit=qEe,$it=VEe,qit=Oi([zEe,HEe,$Ee,qEe,VEe]),YEe="insert",KEe="edit",JEe="delete",Vit=YEe,Yit=KEe,Kit=JEe,Jit=Oi([YEe,KEe,JEe]),ZEe="alibaba_cloud",WEe="aws",XEe="azure",e0e="gcp",Zit=ZEe,Wit=WEe,Xit=XEe,est=e0e,tst=Oi([ZEe,WEe,XEe,e0e]),t0e="ip_tcp",n0e="ip_udp",r0e="ip",o0e="unix",i0e="pipe",s0e="inproc",a0e="other",nst=t0e,rst=n0e,ost=r0e,ist=o0e,sst=i0e,ast=s0e,ust=a0e,cst=Oi([t0e,n0e,r0e,o0e,i0e,s0e,a0e]),u0e="wifi",c0e="wired",l0e="cell",d0e="unavailable",p0e="unknown",lst=u0e,dst=c0e,pst=l0e,fst=d0e,mst=p0e,Ast=Oi([u0e,c0e,l0e,d0e,p0e]),f0e="gprs",m0e="edge",A0e="umts",g0e="cdma",h0e="evdo_0",_0e="evdo_a",E0e="cdma2000_1xrtt",y0e="hsdpa",S0e="hsupa",T0e="hspa",b0e="iden",I0e="evdo_b",C0e="lte",v0e="ehrpd",R0e="hspap",x0e="gsm",D0e="td_scdma",N0e="iwlan",B0e="nr",w0e="nrnsa",O0e="lte_ca",gst=f0e,hst=m0e,_st=A0e,Est=g0e,yst=h0e,Sst=_0e,Tst=E0e,bst=y0e,Ist=S0e,Cst=T0e,vst=b0e,Rst=I0e,xst=C0e,Dst=v0e,Nst=R0e,Bst=x0e,wst=D0e,Ost=N0e,kst=B0e,Pst=w0e,Mst=O0e,Lst=Oi([f0e,m0e,A0e,g0e,h0e,_0e,E0e,y0e,S0e,T0e,b0e,I0e,C0e,v0e,R0e,x0e,D0e,N0e,B0e,w0e,O0e]),k0e="1.0",P0e="1.1",M0e="2.0",L0e="SPDY",U0e="QUIC",Ust=k0e,Qst=P0e,Fst=M0e,Gst=L0e,jst=U0e,zst={HTTP_1_0:k0e,HTTP_1_1:P0e,HTTP_2_0:M0e,SPDY:L0e,QUIC:U0e},Q0e="queue",F0e="topic",Hst=Q0e,$st=F0e,qst=Oi([Q0e,F0e]),G0e="receive",j0e="process",Vst=G0e,Yst=j0e,Kst=Oi([G0e,j0e]),z0e=0,H0e=1,$0e=2,q0e=3,V0e=4,Y0e=5,K0e=6,J0e=7,Z0e=8,W0e=9,X0e=10,eye=11,tye=12,nye=13,rye=14,oye=15,iye=16,Jst=z0e,Zst=H0e,Wst=$0e,Xst=q0e,eat=V0e,tat=Y0e,nat=K0e,rat=J0e,oat=Z0e,iat=W0e,sat=X0e,aat=eye,uat=tye,cat=nye,lat=rye,dat=oye,pat=iye,fat={OK:z0e,CANCELLED:H0e,UNKNOWN:$0e,INVALID_ARGUMENT:q0e,DEADLINE_EXCEEDED:V0e,NOT_FOUND:Y0e,ALREADY_EXISTS:K0e,PERMISSION_DENIED:J0e,RESOURCE_EXHAUSTED:Z0e,FAILED_PRECONDITION:W0e,ABORTED:X0e,OUT_OF_RANGE:eye,UNIMPLEMENTED:tye,INTERNAL:nye,UNAVAILABLE:rye,DATA_LOSS:oye,UNAUTHENTICATED:iye},sye="SENT",aye="RECEIVED",mat=sye,Aat=aye,gat=Oi([sye,aye])});var cye=w(()=>{m();uye()});var lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe,MSe,hat,_at,Eat,yat,Sat,Tat,bat,Iat,Cat,vat,Rat,xat,Dat,Nat,Bat,wat,Oat,kat,Pat,Mat,Lat,Uat,Qat,Fat,Gat,jat,zat,Hat,$at,qat,Vat,Yat,Kat,Jat,Zat,Wat,Xat,eut,tut,nut,rut,out,iut,sut,aut,uut,cut,lut,dut,put,fut,mut,Aut,gut,hut,_ut,Eut,yut,Sut,Tut,but,Iut,Cut,vut,Rut,xut,Dut,Nut,But,wut,Out,_V,kut,Put,Mut,Lut,Uut,Qut,Fut,Gut,jut,zut,LSe,USe,QSe,FSe,Hut,$ut,qut,Vut,Yut,GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe,Kut,Jut,Zut,Wut,Xut,ect,tct,nct,rct,oct,ict,sct,act,uct,cct,lct,dct,pct,oTe,iTe,fct,mct,Act,sTe,aTe,uTe,cTe,lTe,dTe,pTe,gct,hct,_ct,Ect,yct,Sct,Tct,bct,fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe,Ict,Cct,vct,Rct,xct,Dct,Nct,Bct,wct,Oct,kct,Pct,ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe,OTe,Mct,Lct,Uct,Qct,Fct,Gct,jct,zct,Hct,$ct,qct,kTe=w(()=>{m();oV();lye="cloud.provider",dye="cloud.account.id",pye="cloud.region",fye="cloud.availability_zone",mye="cloud.platform",Aye="aws.ecs.container.arn",gye="aws.ecs.cluster.arn",hye="aws.ecs.launchtype",_ye="aws.ecs.task.arn",Eye="aws.ecs.task.family",yye="aws.ecs.task.revision",Sye="aws.eks.cluster.arn",Tye="aws.log.group.names",bye="aws.log.group.arns",Iye="aws.log.stream.names",Cye="aws.log.stream.arns",vye="container.name",Rye="container.id",xye="container.runtime",Dye="container.image.name",Nye="container.image.tag",Bye="deployment.environment",wye="device.id",Oye="device.model.identifier",kye="device.model.name",Pye="faas.name",Mye="faas.id",Lye="faas.version",Uye="faas.instance",Qye="faas.max_memory",Fye="host.id",Gye="host.name",jye="host.type",zye="host.arch",Hye="host.image.name",$ye="host.image.id",qye="host.image.version",Vye="k8s.cluster.name",Yye="k8s.node.name",Kye="k8s.node.uid",Jye="k8s.namespace.name",Zye="k8s.pod.uid",Wye="k8s.pod.name",Xye="k8s.container.name",eSe="k8s.replicaset.uid",tSe="k8s.replicaset.name",nSe="k8s.deployment.uid",rSe="k8s.deployment.name",oSe="k8s.statefulset.uid",iSe="k8s.statefulset.name",sSe="k8s.daemonset.uid",aSe="k8s.daemonset.name",uSe="k8s.job.uid",cSe="k8s.job.name",lSe="k8s.cronjob.uid",dSe="k8s.cronjob.name",pSe="os.type",fSe="os.description",mSe="os.name",ASe="os.version",gSe="process.pid",hSe="process.executable.name",_Se="process.executable.path",ESe="process.command",ySe="process.command_line",SSe="process.command_args",TSe="process.owner",bSe="process.runtime.name",ISe="process.runtime.version",CSe="process.runtime.description",vSe="service.name",RSe="service.namespace",xSe="service.instance.id",DSe="service.version",NSe="telemetry.sdk.name",BSe="telemetry.sdk.language",wSe="telemetry.sdk.version",OSe="telemetry.auto.version",kSe="webengine.name",PSe="webengine.version",MSe="webengine.description",hat=lye,_at=dye,Eat=pye,yat=fye,Sat=mye,Tat=Aye,bat=gye,Iat=hye,Cat=_ye,vat=Eye,Rat=yye,xat=Sye,Dat=Tye,Nat=bye,Bat=Iye,wat=Cye,Oat=vye,kat=Rye,Pat=xye,Mat=Dye,Lat=Nye,Uat=Bye,Qat=wye,Fat=Oye,Gat=kye,jat=Pye,zat=Mye,Hat=Lye,$at=Uye,qat=Qye,Vat=Fye,Yat=Gye,Kat=jye,Jat=zye,Zat=Hye,Wat=$ye,Xat=qye,eut=Vye,tut=Yye,nut=Kye,rut=Jye,out=Zye,iut=Wye,sut=Xye,aut=eSe,uut=tSe,cut=nSe,lut=rSe,dut=oSe,put=iSe,fut=sSe,mut=aSe,Aut=uSe,gut=cSe,hut=lSe,_ut=dSe,Eut=pSe,yut=fSe,Sut=mSe,Tut=ASe,but=gSe,Iut=hSe,Cut=_Se,vut=ESe,Rut=ySe,xut=SSe,Dut=TSe,Nut=bSe,But=ISe,wut=CSe,Out=vSe,_V=RSe,kut=xSe,Put=DSe,Mut=NSe,Lut=BSe,Uut=wSe,Qut=OSe,Fut=kSe,Gut=PSe,jut=MSe,zut=Oi([lye,dye,pye,fye,mye,Aye,gye,hye,_ye,Eye,yye,Sye,Tye,bye,Iye,Cye,vye,Rye,xye,Dye,Nye,Bye,wye,Oye,kye,Pye,Mye,Lye,Uye,Qye,Fye,Gye,jye,zye,Hye,$ye,qye,Vye,Yye,Kye,Jye,Zye,Wye,Xye,eSe,tSe,nSe,rSe,oSe,iSe,sSe,aSe,uSe,cSe,lSe,dSe,pSe,fSe,mSe,ASe,gSe,hSe,_Se,ESe,ySe,SSe,TSe,bSe,ISe,CSe,vSe,RSe,xSe,DSe,NSe,BSe,wSe,OSe,kSe,PSe,MSe]),LSe="alibaba_cloud",USe="aws",QSe="azure",FSe="gcp",Hut=LSe,$ut=USe,qut=QSe,Vut=FSe,Yut=Oi([LSe,USe,QSe,FSe]),GSe="alibaba_cloud_ecs",jSe="alibaba_cloud_fc",zSe="aws_ec2",HSe="aws_ecs",$Se="aws_eks",qSe="aws_lambda",VSe="aws_elastic_beanstalk",YSe="azure_vm",KSe="azure_container_instances",JSe="azure_aks",ZSe="azure_functions",WSe="azure_app_service",XSe="gcp_compute_engine",eTe="gcp_cloud_run",tTe="gcp_kubernetes_engine",nTe="gcp_cloud_functions",rTe="gcp_app_engine",Kut=GSe,Jut=jSe,Zut=zSe,Wut=HSe,Xut=$Se,ect=qSe,tct=VSe,nct=YSe,rct=KSe,oct=JSe,ict=ZSe,sct=WSe,act=XSe,uct=eTe,cct=tTe,lct=nTe,dct=rTe,pct=Oi([GSe,jSe,zSe,HSe,$Se,qSe,VSe,YSe,KSe,JSe,ZSe,WSe,XSe,eTe,tTe,nTe,rTe]),oTe="ec2",iTe="fargate",fct=oTe,mct=iTe,Act=Oi([oTe,iTe]),sTe="amd64",aTe="arm32",uTe="arm64",cTe="ia64",lTe="ppc32",dTe="ppc64",pTe="x86",gct=sTe,hct=aTe,_ct=uTe,Ect=cTe,yct=lTe,Sct=dTe,Tct=pTe,bct=Oi([sTe,aTe,uTe,cTe,lTe,dTe,pTe]),fTe="windows",mTe="linux",ATe="darwin",gTe="freebsd",hTe="netbsd",_Te="openbsd",ETe="dragonflybsd",yTe="hpux",STe="aix",TTe="solaris",bTe="z_os",Ict=fTe,Cct=mTe,vct=ATe,Rct=gTe,xct=hTe,Dct=_Te,Nct=ETe,Bct=yTe,wct=STe,Oct=TTe,kct=bTe,Pct=Oi([fTe,mTe,ATe,gTe,hTe,_Te,ETe,yTe,STe,TTe,bTe]),ITe="cpp",CTe="dotnet",vTe="erlang",RTe="go",xTe="java",DTe="nodejs",NTe="php",BTe="python",wTe="ruby",OTe="webjs",Mct=ITe,Lct=CTe,Uct=vTe,Qct=RTe,Fct=xTe,Gct=DTe,jct=NTe,zct=BTe,Hct=wTe,$ct=OTe,qct=Oi([ITe,CTe,vTe,RTe,xTe,DTe,NTe,BTe,wTe,OTe])});var PTe=w(()=>{m();kTe()});var Vct,Yct,Kct,Jct,Zct,Wct,Xct,elt,tlt,nlt,rlt,olt,ilt,slt,alt,ult,clt,llt,dlt,plt,flt,mlt,Alt,glt,hlt,EV,yV,_lt,LC,Elt,SV,TV,ylt,fS,Slt,Tlt,blt,Ilt,Clt,vlt,Rlt,xlt,Tsn,bsn,bV,Dlt,Nlt,Blt,wlt,Olt,klt,mS,Plt,Mlt,Llt,Isn,Ult,Qlt,Flt,Glt,Csn,jlt,zlt,Hlt,$lt,vg,Rg,qlt,Vlt,Ylt,Klt,Jlt,Zlt,Wlt,Xlt,edt,vsn,tdt,ndt,rdt,odt,idt,sdt,IV,CV,adt,vV,RV,udt,cdt,Rsn,xsn,ldt,ddt,pdt,fdt,mdt,Adt,gdt,hdt,Dsn,_dt,xV,DV,Edt,NV,ydt,BV,Sdt,Tdt,bdt,Idt,Cdt,vdt,Rdt,xdt,Ddt,Nsn,Ndt,Bdt,Bsn,wdt,Odt,wsn,kdt,Pdt,Mdt,Ldt,Udt,Qdt,Fdt,Gdt,D_,jdt,zdt,Hdt,wV,MTe=w(()=>{m();Vct="aspnetcore.diagnostics.exception.result",Yct="aborted",Kct="handled",Jct="skipped",Zct="unhandled",Wct="aspnetcore.diagnostics.handler.type",Xct="aspnetcore.rate_limiting.policy",elt="aspnetcore.rate_limiting.result",tlt="acquired",nlt="endpoint_limiter",rlt="global_limiter",olt="request_canceled",ilt="aspnetcore.request.is_unhandled",slt="aspnetcore.routing.is_fallback",alt="aspnetcore.routing.match_status",ult="failure",clt="success",llt="aspnetcore.user.is_authenticated",dlt="client.address",plt="client.port",flt="code.column.number",mlt="code.file.path",Alt="code.function.name",glt="code.line.number",hlt="code.stacktrace",EV="db.collection.name",yV="db.namespace",_lt="db.operation.batch.size",LC="db.operation.name",Elt="db.query.summary",SV="db.query.text",TV="db.response.status_code",ylt="db.stored_procedure.name",fS="db.system.name",Slt="mariadb",Tlt="microsoft.sql_server",blt="mysql",Ilt="postgresql",Clt="dotnet.gc.heap.generation",vlt="gen0",Rlt="gen1",xlt="gen2",Tsn="loh",bsn="poh",bV="error.type",Dlt="_OTHER",Nlt="exception.escaped",Blt="exception.message",wlt="exception.stacktrace",Olt="exception.type",klt=e=>`http.request.header.${e}`,mS="http.request.method",Plt="_OTHER",Mlt="CONNECT",Llt="DELETE",Isn="GET",Ult="HEAD",Qlt="OPTIONS",Flt="PATCH",Glt="POST",Csn="PUT",jlt="TRACE",zlt="http.request.method_original",Hlt="http.request.resend_count",$lt=e=>`http.response.header.${e}`,vg="http.response.status_code",Rg="http.route",qlt="jvm.gc.action",Vlt="jvm.gc.name",Ylt="jvm.memory.pool.name",Klt="jvm.memory.type",Jlt="heap",Zlt="non_heap",Wlt="jvm.thread.daemon",Xlt="jvm.thread.state",edt="blocked",vsn="new",tdt="runnable",ndt="terminated",rdt="timed_waiting",odt="waiting",idt="network.local.address",sdt="network.local.port",IV="network.peer.address",CV="network.peer.port",adt="network.protocol.name",vV="network.protocol.version",RV="network.transport",udt="pipe",cdt="quic",Rsn="tcp",xsn="udp",ldt="unix",ddt="network.type",pdt="ipv4",fdt="ipv6",mdt="otel.scope.name",Adt="otel.scope.version",gdt="otel.status_code",hdt="ERROR",Dsn="OK",_dt="otel.status_description",xV="server.address",DV="server.port",Edt="service.instance.id",NV="service.name",ydt="service.namespace",BV="service.version",Sdt="signalr.connection.status",Tdt="app_shutdown",bdt="normal_closure",Idt="timeout",Cdt="signalr.transport",vdt="long_polling",Rdt="server_sent_events",xdt="web_sockets",Ddt="telemetry.sdk.language",Nsn="cpp",Ndt="dotnet",Bdt="erlang",Bsn="go",wdt="java",Odt="nodejs",wsn="php",kdt="python",Pdt="ruby",Mdt="rust",Ldt="swift",Udt="webjs",Qdt="telemetry.sdk.name",Fdt="telemetry.sdk.version",Gdt="url.fragment",D_="url.full",jdt="url.path",zdt="url.query",Hdt="url.scheme",wV="user_agent.original"});var $dt,qdt,Vdt,Ydt,Kdt,Jdt,Zdt,Wdt,Xdt,ept,tpt,npt,rpt,opt,ipt,spt,apt,upt,cpt,lpt,dpt,ppt,fpt,mpt,Apt,gpt,hpt,_pt,Ept,ypt,Spt,Tpt,bpt,Ipt,Cpt,vpt,Rpt,xpt,Dpt,Npt,Bpt,wpt,Opt,kpt,Ppt,Mpt,Lpt,Upt,Qpt,Fpt,Gpt,LTe=w(()=>{m();$dt="aspnetcore.diagnostics.exceptions",qdt="aspnetcore.rate_limiting.active_request_leases",Vdt="aspnetcore.rate_limiting.queued_requests",Ydt="aspnetcore.rate_limiting.request.time_in_queue",Kdt="aspnetcore.rate_limiting.request_lease.duration",Jdt="aspnetcore.rate_limiting.requests",Zdt="aspnetcore.routing.match_attempts",Wdt="db.client.operation.duration",Xdt="dotnet.assembly.count",ept="dotnet.exceptions",tpt="dotnet.gc.collections",npt="dotnet.gc.heap.total_allocated",rpt="dotnet.gc.last_collection.heap.fragmentation.size",opt="dotnet.gc.last_collection.heap.size",ipt="dotnet.gc.last_collection.memory.committed_size",spt="dotnet.gc.pause.time",apt="dotnet.jit.compilation.time",upt="dotnet.jit.compiled_il.size",cpt="dotnet.jit.compiled_methods",lpt="dotnet.monitor.lock_contentions",dpt="dotnet.process.cpu.count",ppt="dotnet.process.cpu.time",fpt="dotnet.process.memory.working_set",mpt="dotnet.thread_pool.queue.length",Apt="dotnet.thread_pool.thread.count",gpt="dotnet.thread_pool.work_item.count",hpt="dotnet.timer.count",_pt="http.client.request.duration",Ept="http.server.request.duration",ypt="jvm.class.count",Spt="jvm.class.loaded",Tpt="jvm.class.unloaded",bpt="jvm.cpu.count",Ipt="jvm.cpu.recent_utilization",Cpt="jvm.cpu.time",vpt="jvm.gc.duration",Rpt="jvm.memory.committed",xpt="jvm.memory.limit",Dpt="jvm.memory.used",Npt="jvm.memory.used_after_last_gc",Bpt="jvm.thread.count",wpt="kestrel.active_connections",Opt="kestrel.active_tls_handshakes",kpt="kestrel.connection.duration",Ppt="kestrel.queued_connections",Mpt="kestrel.queued_requests",Lpt="kestrel.rejected_connections",Upt="kestrel.tls_handshake.duration",Qpt="kestrel.upgraded_connections",Fpt="signalr.server.active_connections",Gpt="signalr.server.connection.duration"});var jpt,UTe=w(()=>{m();jpt="exception"});var Hr={};Zs(Hr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Yct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Kct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Jct,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Zct,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>tlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>nlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>rlt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>olt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>ult,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>clt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Vct,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Wct,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Xct,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>elt,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>ilt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>slt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>alt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>llt,ATTR_CLIENT_ADDRESS:()=>dlt,ATTR_CLIENT_PORT:()=>plt,ATTR_CODE_COLUMN_NUMBER:()=>flt,ATTR_CODE_FILE_PATH:()=>mlt,ATTR_CODE_FUNCTION_NAME:()=>Alt,ATTR_CODE_LINE_NUMBER:()=>glt,ATTR_CODE_STACKTRACE:()=>hlt,ATTR_DB_COLLECTION_NAME:()=>EV,ATTR_DB_NAMESPACE:()=>yV,ATTR_DB_OPERATION_BATCH_SIZE:()=>_lt,ATTR_DB_OPERATION_NAME:()=>LC,ATTR_DB_QUERY_SUMMARY:()=>Elt,ATTR_DB_QUERY_TEXT:()=>SV,ATTR_DB_RESPONSE_STATUS_CODE:()=>TV,ATTR_DB_STORED_PROCEDURE_NAME:()=>ylt,ATTR_DB_SYSTEM_NAME:()=>fS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Clt,ATTR_ERROR_TYPE:()=>bV,ATTR_EXCEPTION_ESCAPED:()=>Nlt,ATTR_EXCEPTION_MESSAGE:()=>Blt,ATTR_EXCEPTION_STACKTRACE:()=>wlt,ATTR_EXCEPTION_TYPE:()=>Olt,ATTR_HTTP_REQUEST_HEADER:()=>klt,ATTR_HTTP_REQUEST_METHOD:()=>mS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>zlt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Hlt,ATTR_HTTP_RESPONSE_HEADER:()=>$lt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>vg,ATTR_HTTP_ROUTE:()=>Rg,ATTR_JVM_GC_ACTION:()=>qlt,ATTR_JVM_GC_NAME:()=>Vlt,ATTR_JVM_MEMORY_POOL_NAME:()=>Ylt,ATTR_JVM_MEMORY_TYPE:()=>Klt,ATTR_JVM_THREAD_DAEMON:()=>Wlt,ATTR_JVM_THREAD_STATE:()=>Xlt,ATTR_NETWORK_LOCAL_ADDRESS:()=>idt,ATTR_NETWORK_LOCAL_PORT:()=>sdt,ATTR_NETWORK_PEER_ADDRESS:()=>IV,ATTR_NETWORK_PEER_PORT:()=>CV,ATTR_NETWORK_PROTOCOL_NAME:()=>adt,ATTR_NETWORK_PROTOCOL_VERSION:()=>vV,ATTR_NETWORK_TRANSPORT:()=>RV,ATTR_NETWORK_TYPE:()=>ddt,ATTR_OTEL_SCOPE_NAME:()=>mdt,ATTR_OTEL_SCOPE_VERSION:()=>Adt,ATTR_OTEL_STATUS_CODE:()=>gdt,ATTR_OTEL_STATUS_DESCRIPTION:()=>_dt,ATTR_SERVER_ADDRESS:()=>xV,ATTR_SERVER_PORT:()=>DV,ATTR_SERVICE_INSTANCE_ID:()=>Edt,ATTR_SERVICE_NAME:()=>NV,ATTR_SERVICE_NAMESPACE:()=>ydt,ATTR_SERVICE_VERSION:()=>BV,ATTR_SIGNALR_CONNECTION_STATUS:()=>Sdt,ATTR_SIGNALR_TRANSPORT:()=>Cdt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Ddt,ATTR_TELEMETRY_SDK_NAME:()=>Qdt,ATTR_TELEMETRY_SDK_VERSION:()=>Fdt,ATTR_URL_FRAGMENT:()=>Gdt,ATTR_URL_FULL:()=>D_,ATTR_URL_PATH:()=>jdt,ATTR_URL_QUERY:()=>zdt,ATTR_URL_SCHEME:()=>Hdt,ATTR_USER_AGENT_ORIGINAL:()=>wV,AWSECSLAUNCHTYPEVALUES_EC2:()=>fct,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>mct,AwsEcsLaunchtypeValues:()=>Act,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Kut,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Jut,CLOUDPLATFORMVALUES_AWS_EC2:()=>Zut,CLOUDPLATFORMVALUES_AWS_ECS:()=>Wut,CLOUDPLATFORMVALUES_AWS_EKS:()=>Xut,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>tct,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>ect,CLOUDPLATFORMVALUES_AZURE_AKS:()=>oct,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>sct,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>rct,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>ict,CLOUDPLATFORMVALUES_AZURE_VM:()=>nct,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>dct,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>lct,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>uct,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>act,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>cct,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Hut,CLOUDPROVIDERVALUES_AWS:()=>$ut,CLOUDPROVIDERVALUES_AZURE:()=>qut,CLOUDPROVIDERVALUES_GCP:()=>Vut,CloudPlatformValues:()=>pct,CloudProviderValues:()=>Yut,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Dit,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Lit,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Nit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Mit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>wit,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Qit,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Oit,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Bit,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Uit,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Pit,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>kit,DBSYSTEMVALUES_ADABAS:()=>Wot,DBSYSTEMVALUES_CACHE:()=>Zot,DBSYSTEMVALUES_CASSANDRA:()=>Ait,DBSYSTEMVALUES_CLOUDSCAPE:()=>zot,DBSYSTEMVALUES_COCKROACHDB:()=>Rit,DBSYSTEMVALUES_COLDFUSION:()=>mit,DBSYSTEMVALUES_COSMOSDB:()=>Sit,DBSYSTEMVALUES_COUCHBASE:()=>Eit,DBSYSTEMVALUES_COUCHDB:()=>yit,DBSYSTEMVALUES_DB2:()=>Qot,DBSYSTEMVALUES_DERBY:()=>eit,DBSYSTEMVALUES_DYNAMODB:()=>Tit,DBSYSTEMVALUES_EDB:()=>Jot,DBSYSTEMVALUES_ELASTICSEARCH:()=>Cit,DBSYSTEMVALUES_FILEMAKER:()=>tit,DBSYSTEMVALUES_FIREBIRD:()=>Xot,DBSYSTEMVALUES_FIRSTSQL:()=>Kot,DBSYSTEMVALUES_GEODE:()=>Iit,DBSYSTEMVALUES_H2:()=>fit,DBSYSTEMVALUES_HANADB:()=>Vot,DBSYSTEMVALUES_HBASE:()=>git,DBSYSTEMVALUES_HIVE:()=>jot,DBSYSTEMVALUES_HSQLDB:()=>Hot,DBSYSTEMVALUES_INFORMIX:()=>nit,DBSYSTEMVALUES_INGRES:()=>Yot,DBSYSTEMVALUES_INSTANTDB:()=>rit,DBSYSTEMVALUES_INTERBASE:()=>oit,DBSYSTEMVALUES_MARIADB:()=>iit,DBSYSTEMVALUES_MAXDB:()=>qot,DBSYSTEMVALUES_MEMCACHED:()=>vit,DBSYSTEMVALUES_MONGODB:()=>hit,DBSYSTEMVALUES_MSSQL:()=>Mot,DBSYSTEMVALUES_MYSQL:()=>Lot,DBSYSTEMVALUES_NEO4J:()=>bit,DBSYSTEMVALUES_NETEZZA:()=>sit,DBSYSTEMVALUES_ORACLE:()=>Uot,DBSYSTEMVALUES_OTHER_SQL:()=>Pot,DBSYSTEMVALUES_PERVASIVE:()=>ait,DBSYSTEMVALUES_POINTBASE:()=>uit,DBSYSTEMVALUES_POSTGRESQL:()=>Fot,DBSYSTEMVALUES_PROGRESS:()=>$ot,DBSYSTEMVALUES_REDIS:()=>_it,DBSYSTEMVALUES_REDSHIFT:()=>Got,DBSYSTEMVALUES_SQLITE:()=>cit,DBSYSTEMVALUES_SYBASE:()=>lit,DBSYSTEMVALUES_TERADATA:()=>dit,DBSYSTEMVALUES_VERTICA:()=>pit,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Slt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Tlt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>blt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Ilt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>vlt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Rlt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>xlt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Tsn,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>bsn,DbCassandraConsistencyLevelValues:()=>Fit,DbSystemValues:()=>xit,ERROR_TYPE_VALUE_OTHER:()=>Dlt,EVENT_EXCEPTION:()=>jpt,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Kit,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Yit,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Vit,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Zit,FAASINVOKEDPROVIDERVALUES_AWS:()=>Wit,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Xit,FAASINVOKEDPROVIDERVALUES_GCP:()=>est,FAASTRIGGERVALUES_DATASOURCE:()=>Git,FAASTRIGGERVALUES_HTTP:()=>jit,FAASTRIGGERVALUES_OTHER:()=>$it,FAASTRIGGERVALUES_PUBSUB:()=>zit,FAASTRIGGERVALUES_TIMER:()=>Hit,FaasDocumentOperationValues:()=>Jit,FaasInvokedProviderValues:()=>tst,FaasTriggerValues:()=>qit,HOSTARCHVALUES_AMD64:()=>gct,HOSTARCHVALUES_ARM32:()=>hct,HOSTARCHVALUES_ARM64:()=>_ct,HOSTARCHVALUES_IA64:()=>Ect,HOSTARCHVALUES_PPC32:()=>yct,HOSTARCHVALUES_PPC64:()=>Sct,HOSTARCHVALUES_X86:()=>Tct,HTTPFLAVORVALUES_HTTP_1_0:()=>Ust,HTTPFLAVORVALUES_HTTP_1_1:()=>Qst,HTTPFLAVORVALUES_HTTP_2_0:()=>Fst,HTTPFLAVORVALUES_QUIC:()=>jst,HTTPFLAVORVALUES_SPDY:()=>Gst,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Mlt,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Llt,HTTP_REQUEST_METHOD_VALUE_GET:()=>Isn,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Ult,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Qlt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Plt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Flt,HTTP_REQUEST_METHOD_VALUE_POST:()=>Glt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Csn,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>jlt,HostArchValues:()=>bct,HttpFlavorValues:()=>zst,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Jlt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Zlt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>edt,JVM_THREAD_STATE_VALUE_NEW:()=>vsn,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>tdt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>ndt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>rdt,JVM_THREAD_STATE_VALUE_WAITING:()=>odt,MESSAGETYPEVALUES_RECEIVED:()=>Aat,MESSAGETYPEVALUES_SENT:()=>mat,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Hst,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>$st,MESSAGINGOPERATIONVALUES_PROCESS:()=>Yst,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Vst,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>$dt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>qdt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Vdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Jdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Kdt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Ydt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Zdt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Wdt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Xdt,METRIC_DOTNET_EXCEPTIONS:()=>ept,METRIC_DOTNET_GC_COLLECTIONS:()=>tpt,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>npt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>rpt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>opt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>ipt,METRIC_DOTNET_GC_PAUSE_TIME:()=>spt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>apt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>upt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>cpt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>lpt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>dpt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>ppt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>fpt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>mpt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Apt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>gpt,METRIC_DOTNET_TIMER_COUNT:()=>hpt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>_pt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Ept,METRIC_JVM_CLASS_COUNT:()=>ypt,METRIC_JVM_CLASS_LOADED:()=>Spt,METRIC_JVM_CLASS_UNLOADED:()=>Tpt,METRIC_JVM_CPU_COUNT:()=>bpt,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Ipt,METRIC_JVM_CPU_TIME:()=>Cpt,METRIC_JVM_GC_DURATION:()=>vpt,METRIC_JVM_MEMORY_COMMITTED:()=>Rpt,METRIC_JVM_MEMORY_LIMIT:()=>xpt,METRIC_JVM_MEMORY_USED:()=>Dpt,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Npt,METRIC_JVM_THREAD_COUNT:()=>Bpt,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>wpt,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Opt,METRIC_KESTREL_CONNECTION_DURATION:()=>kpt,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Ppt,METRIC_KESTREL_QUEUED_REQUESTS:()=>Mpt,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Lpt,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Upt,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Qpt,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Fpt,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Gpt,MessageTypeValues:()=>gat,MessagingDestinationKindValues:()=>qst,MessagingOperationValues:()=>Kst,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Est,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Tst,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>hst,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Dst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>yst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Sst,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Rst,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>gst,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Bst,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>bst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Cst,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Nst,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Ist,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>vst,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Ost,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>xst,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Mst,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>kst,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Pst,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>wst,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>_st,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>pst,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>fst,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>mst,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>lst,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>dst,NETTRANSPORTVALUES_INPROC:()=>ast,NETTRANSPORTVALUES_IP:()=>ost,NETTRANSPORTVALUES_IP_TCP:()=>nst,NETTRANSPORTVALUES_IP_UDP:()=>rst,NETTRANSPORTVALUES_OTHER:()=>ust,NETTRANSPORTVALUES_PIPE:()=>sst,NETTRANSPORTVALUES_UNIX:()=>ist,NETWORK_TRANSPORT_VALUE_PIPE:()=>udt,NETWORK_TRANSPORT_VALUE_QUIC:()=>cdt,NETWORK_TRANSPORT_VALUE_TCP:()=>Rsn,NETWORK_TRANSPORT_VALUE_UDP:()=>xsn,NETWORK_TRANSPORT_VALUE_UNIX:()=>ldt,NETWORK_TYPE_VALUE_IPV4:()=>pdt,NETWORK_TYPE_VALUE_IPV6:()=>fdt,NetHostConnectionSubtypeValues:()=>Lst,NetHostConnectionTypeValues:()=>Ast,NetTransportValues:()=>cst,OSTYPEVALUES_AIX:()=>wct,OSTYPEVALUES_DARWIN:()=>vct,OSTYPEVALUES_DRAGONFLYBSD:()=>Nct,OSTYPEVALUES_FREEBSD:()=>Rct,OSTYPEVALUES_HPUX:()=>Bct,OSTYPEVALUES_LINUX:()=>Cct,OSTYPEVALUES_NETBSD:()=>xct,OSTYPEVALUES_OPENBSD:()=>Dct,OSTYPEVALUES_SOLARIS:()=>Oct,OSTYPEVALUES_WINDOWS:()=>Ict,OSTYPEVALUES_Z_OS:()=>kct,OTEL_STATUS_CODE_VALUE_ERROR:()=>hdt,OTEL_STATUS_CODE_VALUE_OK:()=>Dsn,OsTypeValues:()=>Pct,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>sat,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>nat,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Zst,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>dat,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>eat,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>iat,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>cat,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Xst,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>tat,RPCGRPCSTATUSCODEVALUES_OK:()=>Jst,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>aat,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>rat,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>oat,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>pat,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>lat,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>uat,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Wst,RpcGrpcStatusCodeValues:()=>fat,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>qrt,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>oot,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>zrt,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Qrt,SEMATTRS_AWS_DYNAMODB_COUNT:()=>not,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Zrt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Krt,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>iot,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Vrt,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Frt,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>$rt,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Jrt,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Hrt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Grt,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>jrt,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>rot,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Xrt,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>eot,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Yrt,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Wrt,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Urt,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>tot,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Nnt,SEMATTRS_CODE_FILEPATH:()=>xrt,SEMATTRS_CODE_FUNCTION:()=>vrt,SEMATTRS_CODE_LINENO:()=>Drt,SEMATTRS_CODE_NAMESPACE:()=>Rrt,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Qnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Hnt,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>znt,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Gnt,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Lnt,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Unt,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>jnt,SEMATTRS_DB_CASSANDRA_TABLE:()=>Fnt,SEMATTRS_DB_CONNECTION_STRING:()=>Bnt,SEMATTRS_DB_HBASE_NAMESPACE:()=>$nt,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Ont,SEMATTRS_DB_MONGODB_COLLECTION:()=>Vnt,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Mnt,SEMATTRS_DB_NAME:()=>knt,SEMATTRS_DB_OPERATION:()=>Pnt,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>qnt,SEMATTRS_DB_SQL_TABLE:()=>Ynt,SEMATTRS_DB_STATEMENT:()=>sV,SEMATTRS_DB_SYSTEM:()=>iV,SEMATTRS_DB_USER:()=>wnt,SEMATTRS_ENDUSER_ID:()=>Srt,SEMATTRS_ENDUSER_ROLE:()=>Trt,SEMATTRS_ENDUSER_SCOPE:()=>brt,SEMATTRS_EXCEPTION_ESCAPED:()=>Wnt,SEMATTRS_EXCEPTION_MESSAGE:()=>Jnt,SEMATTRS_EXCEPTION_STACKTRACE:()=>Znt,SEMATTRS_EXCEPTION_TYPE:()=>Knt,SEMATTRS_FAAS_COLDSTART:()=>srt,SEMATTRS_FAAS_CRON:()=>irt,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>ert,SEMATTRS_FAAS_DOCUMENT_NAME:()=>rrt,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>trt,SEMATTRS_FAAS_DOCUMENT_TIME:()=>nrt,SEMATTRS_FAAS_EXECUTION:()=>Xnt,SEMATTRS_FAAS_INVOKED_NAME:()=>art,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>urt,SEMATTRS_FAAS_INVOKED_REGION:()=>crt,SEMATTRS_FAAS_TIME:()=>ort,SEMATTRS_FAAS_TRIGGER:()=>aV,SEMATTRS_HTTP_CLIENT_IP:()=>Lrt,SEMATTRS_HTTP_FLAVOR:()=>wrt,SEMATTRS_HTTP_HOST:()=>Nrt,SEMATTRS_HTTP_METHOD:()=>AB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>krt,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Prt,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>pV,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>fV,SEMATTRS_HTTP_ROUTE:()=>mV,SEMATTRS_HTTP_SCHEME:()=>Brt,SEMATTRS_HTTP_SERVER_NAME:()=>Mrt,SEMATTRS_HTTP_STATUS_CODE:()=>pS,SEMATTRS_HTTP_TARGET:()=>dV,SEMATTRS_HTTP_URL:()=>MC,SEMATTRS_HTTP_USER_AGENT:()=>Ort,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>wot,SEMATTRS_MESSAGE_ID:()=>Bot,SEMATTRS_MESSAGE_TYPE:()=>Not,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Oot,SEMATTRS_MESSAGING_CONSUMER_ID:()=>hot,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>fot,SEMATTRS_MESSAGING_DESTINATION:()=>sot,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>aot,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Sot,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>yot,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Eot,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Tot,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>bot,SEMATTRS_MESSAGING_MESSAGE_ID:()=>pot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Aot,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>mot,SEMATTRS_MESSAGING_OPERATION:()=>got,SEMATTRS_MESSAGING_PROTOCOL:()=>cot,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>lot,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>_ot,SEMATTRS_MESSAGING_SYSTEM:()=>AV,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>uot,SEMATTRS_MESSAGING_URL:()=>dot,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Ert,SEMATTRS_NET_HOST_CARRIER_MCC:()=>hrt,SEMATTRS_NET_HOST_CARRIER_MNC:()=>_rt,SEMATTRS_NET_HOST_CARRIER_NAME:()=>grt,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Art,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>mrt,SEMATTRS_NET_HOST_IP:()=>cV,SEMATTRS_NET_HOST_NAME:()=>frt,SEMATTRS_NET_HOST_PORT:()=>lV,SEMATTRS_NET_PEER_IP:()=>uV,SEMATTRS_NET_PEER_NAME:()=>prt,SEMATTRS_NET_PEER_PORT:()=>drt,SEMATTRS_NET_TRANSPORT:()=>lrt,SEMATTRS_PEER_SERVICE:()=>yrt,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>hV,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>xot,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Dot,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Rot,SEMATTRS_RPC_JSONRPC_VERSION:()=>vot,SEMATTRS_RPC_METHOD:()=>Cot,SEMATTRS_RPC_SERVICE:()=>gV,SEMATTRS_RPC_SYSTEM:()=>Iot,SEMATTRS_THREAD_ID:()=>Irt,SEMATTRS_THREAD_NAME:()=>Crt,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>bat,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Tat,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Iat,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Cat,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>vat,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Rat,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>xat,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Nat,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Dat,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>wat,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Bat,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>_at,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>yat,SEMRESATTRS_CLOUD_PLATFORM:()=>Sat,SEMRESATTRS_CLOUD_PROVIDER:()=>hat,SEMRESATTRS_CLOUD_REGION:()=>Eat,SEMRESATTRS_CONTAINER_ID:()=>kat,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Mat,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Lat,SEMRESATTRS_CONTAINER_NAME:()=>Oat,SEMRESATTRS_CONTAINER_RUNTIME:()=>Pat,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Uat,SEMRESATTRS_DEVICE_ID:()=>Qat,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Fat,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Gat,SEMRESATTRS_FAAS_ID:()=>zat,SEMRESATTRS_FAAS_INSTANCE:()=>$at,SEMRESATTRS_FAAS_MAX_MEMORY:()=>qat,SEMRESATTRS_FAAS_NAME:()=>jat,SEMRESATTRS_FAAS_VERSION:()=>Hat,SEMRESATTRS_HOST_ARCH:()=>Jat,SEMRESATTRS_HOST_ID:()=>Vat,SEMRESATTRS_HOST_IMAGE_ID:()=>Wat,SEMRESATTRS_HOST_IMAGE_NAME:()=>Zat,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Xat,SEMRESATTRS_HOST_NAME:()=>Yat,SEMRESATTRS_HOST_TYPE:()=>Kat,SEMRESATTRS_K8S_CLUSTER_NAME:()=>eut,SEMRESATTRS_K8S_CONTAINER_NAME:()=>sut,SEMRESATTRS_K8S_CRONJOB_NAME:()=>_ut,SEMRESATTRS_K8S_CRONJOB_UID:()=>hut,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>mut,SEMRESATTRS_K8S_DAEMONSET_UID:()=>fut,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>lut,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>cut,SEMRESATTRS_K8S_JOB_NAME:()=>gut,SEMRESATTRS_K8S_JOB_UID:()=>Aut,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>rut,SEMRESATTRS_K8S_NODE_NAME:()=>tut,SEMRESATTRS_K8S_NODE_UID:()=>nut,SEMRESATTRS_K8S_POD_NAME:()=>iut,SEMRESATTRS_K8S_POD_UID:()=>out,SEMRESATTRS_K8S_REPLICASET_NAME:()=>uut,SEMRESATTRS_K8S_REPLICASET_UID:()=>aut,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>put,SEMRESATTRS_K8S_STATEFULSET_UID:()=>dut,SEMRESATTRS_OS_DESCRIPTION:()=>yut,SEMRESATTRS_OS_NAME:()=>Sut,SEMRESATTRS_OS_TYPE:()=>Eut,SEMRESATTRS_OS_VERSION:()=>Tut,SEMRESATTRS_PROCESS_COMMAND:()=>vut,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>xut,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Rut,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Iut,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Cut,SEMRESATTRS_PROCESS_OWNER:()=>Dut,SEMRESATTRS_PROCESS_PID:()=>but,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>wut,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Nut,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>But,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>kut,SEMRESATTRS_SERVICE_NAME:()=>Out,SEMRESATTRS_SERVICE_NAMESPACE:()=>_V,SEMRESATTRS_SERVICE_VERSION:()=>Put,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Qut,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Lut,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Mut,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Uut,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>jut,SEMRESATTRS_WEBENGINE_NAME:()=>Fut,SEMRESATTRS_WEBENGINE_VERSION:()=>Gut,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Tdt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>bdt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Idt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>vdt,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Rdt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>xdt,SemanticAttributes:()=>kot,SemanticResourceAttributes:()=>zut,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Mct,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Lct,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Uct,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Qct,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Fct,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Gct,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>jct,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>zct,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Hct,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>$ct,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Nsn,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Ndt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Bdt,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>Bsn,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>wdt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Odt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>wsn,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>kdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Pdt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Mdt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Ldt,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Udt,TelemetrySdkLanguageValues:()=>qct});var Xn=w(()=>{m();cye();PTe();MTe();LTe();UTe()});var QTe=M(dU=>{"use strict";m();Object.defineProperty(dU,"__esModule",{value:!0});dU.ATTR_PROCESS_RUNTIME_NAME=void 0;dU.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var FTe=M(fU=>{"use strict";m();Object.defineProperty(fU,"__esModule",{value:!0});fU.SDK_INFO=void 0;var zpt=_ge(),pU=(Xn(),Me(Hr)),Hpt=QTe();fU.SDK_INFO={[pU.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[Hpt.ATTR_PROCESS_RUNTIME_NAME]:"node",[pU.ATTR_TELEMETRY_SDK_LANGUAGE]:pU.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[pU.ATTR_TELEMETRY_SDK_VERSION]:zpt.VERSION}});var GTe=M(au=>{"use strict";m();Object.defineProperty(au,"__esModule",{value:!0});au.otperformance=au.SDK_INFO=au._globalThis=au.getStringListFromEnv=au.getNumberFromEnv=au.getBooleanFromEnv=au.getStringFromEnv=void 0;var mU=gge();Object.defineProperty(au,"getStringFromEnv",{enumerable:!0,get:function(){return mU.getStringFromEnv}});Object.defineProperty(au,"getBooleanFromEnv",{enumerable:!0,get:function(){return mU.getBooleanFromEnv}});Object.defineProperty(au,"getNumberFromEnv",{enumerable:!0,get:function(){return mU.getNumberFromEnv}});Object.defineProperty(au,"getStringListFromEnv",{enumerable:!0,get:function(){return mU.getStringListFromEnv}});var $pt=hge();Object.defineProperty(au,"_globalThis",{enumerable:!0,get:function(){return $pt._globalThis}});var qpt=FTe();Object.defineProperty(au,"SDK_INFO",{enumerable:!0,get:function(){return qpt.SDK_INFO}});au.otperformance=performance});var OV=M(uu=>{"use strict";m();Object.defineProperty(uu,"__esModule",{value:!0});uu.getStringListFromEnv=uu.getNumberFromEnv=uu.getStringFromEnv=uu.getBooleanFromEnv=uu.otperformance=uu._globalThis=uu.SDK_INFO=void 0;var AS=GTe();Object.defineProperty(uu,"SDK_INFO",{enumerable:!0,get:function(){return AS.SDK_INFO}});Object.defineProperty(uu,"_globalThis",{enumerable:!0,get:function(){return AS._globalThis}});Object.defineProperty(uu,"otperformance",{enumerable:!0,get:function(){return AS.otperformance}});Object.defineProperty(uu,"getBooleanFromEnv",{enumerable:!0,get:function(){return AS.getBooleanFromEnv}});Object.defineProperty(uu,"getStringFromEnv",{enumerable:!0,get:function(){return AS.getStringFromEnv}});Object.defineProperty(uu,"getNumberFromEnv",{enumerable:!0,get:function(){return AS.getNumberFromEnv}});Object.defineProperty(uu,"getStringListFromEnv",{enumerable:!0,get:function(){return AS.getStringListFromEnv}})});var $Te=M($r=>{"use strict";m();Object.defineProperty($r,"__esModule",{value:!0});$r.addHrTimes=$r.isTimeInput=$r.isTimeInputHrTime=$r.hrTimeToSeconds=$r.hrTimeToMilliseconds=$r.hrTimeToMicroseconds=$r.hrTimeToNanoseconds=$r.hrTimeToTimeStamp=$r.hrTimeDuration=$r.timeInputToHrTime=$r.hrTime=$r.getTimeOrigin=$r.millisToHrTime=void 0;var AU=OV(),jTe=9,Vpt=6,Ypt=Math.pow(10,Vpt),gB=Math.pow(10,jTe);function hB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*Ypt);return[n,r]}$r.millisToHrTime=hB;function Kpt(){return AU.otperformance.timeOrigin}$r.getTimeOrigin=Kpt;function zTe(e){let t=hB(AU.otperformance.timeOrigin),n=hB(typeof e=="number"?e:AU.otperformance.now());return HTe(t,n)}$r.hrTime=zTe;function Jpt(e){if(kV(e))return e;if(typeof e=="number")return e<AU.otperformance.timeOrigin?zTe(e):hB(e);if(e instanceof Date)return hB(e.getTime());throw TypeError("Invalid input type")}$r.timeInputToHrTime=Jpt;function Zpt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=gB),[n,r]}$r.hrTimeDuration=Zpt;function Wpt(e){let t=jTe,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}$r.hrTimeToTimeStamp=Wpt;function Xpt(e){return e[0]*gB+e[1]}$r.hrTimeToNanoseconds=Xpt;function eft(e){return e[0]*1e6+e[1]/1e3}$r.hrTimeToMicroseconds=eft;function tft(e){return e[0]*1e3+e[1]/1e6}$r.hrTimeToMilliseconds=tft;function nft(e){return e[0]+e[1]/gB}$r.hrTimeToSeconds=nft;function kV(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}$r.isTimeInputHrTime=kV;function rft(e){return kV(e)||typeof e=="number"||e instanceof Date}$r.isTimeInput=rft;function HTe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=gB&&(n[1]-=gB,n[0]+=1),n}$r.addHrTimes=HTe});var qTe=M(gU=>{"use strict";m();Object.defineProperty(gU,"__esModule",{value:!0});gU.unrefTimer=void 0;function oft(e){typeof e!="number"&&e.unref()}gU.unrefTimer=oft});var VTe=M(_B=>{"use strict";m();Object.defineProperty(_B,"__esModule",{value:!0});_B.ExportResultCode=void 0;var ift;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(ift=_B.ExportResultCode||(_B.ExportResultCode={}))});var KTe=M(hU=>{"use strict";m();Object.defineProperty(hU,"__esModule",{value:!0});hU.CompositePropagator=void 0;var YTe=(He(),Me(tt)),PV=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let n=new Set;for(let r of this._propagators){let o=typeof r.fields=="function"?r.fields():[];for(let i of o)n.add(i)}this._fields=Array.from(n)}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){YTe.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${i.message}`)}}extract(t,n,r){return this._propagators.reduce((o,i)=>{try{return i.extract(o,n,r)}catch(s){YTe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};hU.CompositePropagator=PV});var JTe=M(UC=>{"use strict";m();Object.defineProperty(UC,"__esModule",{value:!0});UC.validateValue=UC.validateKey=void 0;var MV="[_0-9a-z-*/]",sft=`[a-z]${MV}{0,255}`,aft=`[a-z0-9]${MV}{0,240}@[a-z]${MV}{0,13}`,uft=new RegExp(`^(?:${sft}|${aft})$`),cft=/^[ -~]{0,255}[!-~]$/,lft=/,|=/;function dft(e){return uft.test(e)}UC.validateKey=dft;function pft(e){return cft.test(e)&&!lft.test(e)}UC.validateValue=pft});var UV=M(EU=>{"use strict";m();Object.defineProperty(EU,"__esModule",{value:!0});EU.TraceState=void 0;var _U=JTe(),fft=32,ZTe=512,WTe=",",XTe="=",LV=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,_U.validateKey)(t)||!(0,_U.validateValue)(n))return this;let r=this._getState(),o=r.get(t),i=this._length;if(typeof o=="string"?i+=n.length-o.length:i+=t.length+n.length+(r.size>0?2:1),i>ZTe)return this;let s=new Map(r);return s.delete(t),s.set(t,n),this._fromState(s,i)}unset(t){let n=this._getState(),r=n.get(t);if(typeof r!="string")return this;let o=this._length-(t.length+r.length+1);n.size>1&&(o=o-1);let i=new Map(n);return i.delete(t),this._fromState(i,o)}get(t){return this._getState().get(t)}serialize(){let t="",n=0;for(let r of this._getState())n>0&&(t=WTe+t),t=`${r[0]}${XTe}${r[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(WTe),n=new Map,r=0;for(let o of t){let i=o.trim(),s=i.indexOf(XTe);if(s===-1)continue;let u=i.slice(0,s),l=i.slice(s+1);if(!(0,_U.validateKey)(u)||!(0,_U.validateValue)(l))continue;let f=r+i.length+(n.size>0?1:0);if(!(f>ZTe)&&(n.set(u,l),r=f,n.size>=fft))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};EU.TraceState=LV});var tbe=M(cu=>{"use strict";m();Object.defineProperty(cu,"__esModule",{value:!0});cu.W3CTraceContextPropagator=cu.parseTraceParent=cu.TRACE_STATE_HEADER=cu.TRACE_PARENT_HEADER=void 0;var yU=(He(),Me(tt)),mft=fB(),Aft=UV();cu.TRACE_PARENT_HEADER="traceparent";cu.TRACE_STATE_HEADER="tracestate";var gft="00",hft="(?!ff)[\\da-f]{2}",_ft="(?![0]{32})[\\da-f]{32}",Eft="(?![0]{16})[\\da-f]{16}",yft="[\\da-f]{2}",Sft=new RegExp(`^\\s?(${hft})-(${_ft})-(${Eft})-(${yft})(-.*)?\\s?$`);function ebe(e){let t=Sft.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}cu.parseTraceParent=ebe;var QV=class{inject(t,n,r){let o=yU.trace.getSpanContext(t);if(!o||(0,mft.isTracingSuppressed)(t)||!(0,yU.isSpanContextValid)(o))return;let i=`${gft}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||yU.TraceFlags.NONE).toString(16)}`;r.set(n,cu.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,cu.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,cu.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=ebe(i);if(!s)return t;s.isRemote=!0;let u=r.get(n,cu.TRACE_STATE_HEADER);if(u){let l=Array.isArray(u)?u.join(","):u;s.traceState=new Aft.TraceState(typeof l=="string"?l:void 0)}return yU.trace.setSpanContext(t,s)}fields(){return[cu.TRACE_PARENT_HEADER,cu.TRACE_STATE_HEADER]}};cu.W3CTraceContextPropagator=QV});var nbe=M(Af=>{"use strict";m();Object.defineProperty(Af,"__esModule",{value:!0});Af.getRPCMetadata=Af.deleteRPCMetadata=Af.setRPCMetadata=Af.RPCType=void 0;var Tft=(He(),Me(tt)),FV=(0,Tft.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),bft;(function(e){e.HTTP="http"})(bft=Af.RPCType||(Af.RPCType={}));function Ift(e,t){return e.setValue(FV,t)}Af.setRPCMetadata=Ift;function Cft(e){return e.deleteValue(FV)}Af.deleteRPCMetadata=Cft;function vft(e){return e.getValue(FV)}Af.getRPCMetadata=vft});var abe=M(SU=>{"use strict";m();Object.defineProperty(SU,"__esModule",{value:!0});SU.isPlainObject=void 0;var Rft="[object Object]",xft="[object Null]",Dft="[object Undefined]",Nft=Function.prototype,rbe=Nft.toString,Bft=rbe.call(Object),wft=Object.getPrototypeOf,obe=Object.prototype,ibe=obe.hasOwnProperty,gS=Symbol?Symbol.toStringTag:void 0,sbe=obe.toString;function Oft(e){if(!kft(e)||Pft(e)!==Rft)return!1;let t=wft(e);if(t===null)return!0;let n=ibe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&rbe.call(n)===Bft}SU.isPlainObject=Oft;function kft(e){return e!=null&&typeof e=="object"}function Pft(e){return e==null?e===void 0?Dft:xft:gS&&gS in Object(e)?Mft(e):Lft(e)}function Mft(e){let t=ibe.call(e,gS),n=e[gS],r=!1;try{e[gS]=void 0,r=!0}catch{}let o=sbe.call(e);return r&&(t?e[gS]=n:delete e[gS]),o}function Lft(e){return sbe.call(e)}});var pbe=M(IU=>{"use strict";m();Object.defineProperty(IU,"__esModule",{value:!0});IU.merge=void 0;var ube=abe(),Uft=20;function Qft(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=lbe(t,e.shift(),0,n);return t}IU.merge=Qft;function GV(e){return bU(e)?e.slice():e}function lbe(e,t,n=0,r){let o;if(!(n>Uft)){if(n++,TU(e)||TU(t)||dbe(t))o=GV(t);else if(bU(e)){if(o=e.slice(),bU(t))for(let i=0,s=t.length;i<s;i++)o.push(GV(t[i]));else if(EB(t)){let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];l==="__proto__"||l==="constructor"||l==="prototype"||(o[l]=GV(t[l]))}}}else if(EB(e))if(EB(t)){if(!Fft(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let s=0,u=i.length;s<u;s++){let l=i[s];if(l==="__proto__"||l==="constructor"||l==="prototype")continue;let f=t[l];if(TU(f))typeof f>"u"?delete o[l]:o[l]=f;else{let h=o[l],_=f;if(cbe(e,l,r)||cbe(t,l,r))delete o[l];else{if(EB(h)&&EB(_)){let y=r.get(h)||[],T=r.get(_)||[];y.push({obj:e,key:l}),T.push({obj:t,key:l}),r.set(h,y),r.set(_,T)}o[l]=lbe(o[l],f,n,r)}}}}else o=t;return o}}function cbe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let s=r[o];if(s.key===t&&s.obj===e)return!0}return!1}function bU(e){return Array.isArray(e)}function dbe(e){return typeof e=="function"}function EB(e){return!TU(e)&&!bU(e)&&!dbe(e)&&typeof e=="object"}function TU(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function Fft(e,t){return!(!(0,ube.isPlainObject)(e)||!(0,ube.isPlainObject)(t))}});var fbe=M(QC=>{"use strict";m();Object.defineProperty(QC,"__esModule",{value:!0});QC.callWithTimeout=QC.TimeoutError=void 0;var CU=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};QC.TimeoutError=CU;function Gft(e,t){let n,r=new Promise(function(i,s){n=setTimeout(function(){s(new CU("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}QC.callWithTimeout=Gft});var Abe=M(FC=>{"use strict";m();Object.defineProperty(FC,"__esModule",{value:!0});FC.isUrlIgnored=FC.urlMatches=void 0;function mbe(e,t){return typeof t=="string"?e===t:!!e.match(t)}FC.urlMatches=mbe;function jft(e,t){if(!t)return!1;for(let n of t)if(mbe(e,n))return!0;return!1}FC.isUrlIgnored=jft});var gbe=M(vU=>{"use strict";m();Object.defineProperty(vU,"__esModule",{value:!0});vU.Deferred=void 0;var jV=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};vU.Deferred=jV});var hbe=M(RU=>{"use strict";m();Object.defineProperty(RU,"__esModule",{value:!0});RU.BindOnceFuture=void 0;var zft=gbe(),zV=class{_isCalled=!1;_deferred=new zft.Deferred;_callback;_that;constructor(t,n){this._callback=t,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};RU.BindOnceFuture=zV});var Ebe=M(xU=>{"use strict";m();Object.defineProperty(xU,"__esModule",{value:!0});xU.diagLogLevelFromString=void 0;var xg=(He(),Me(tt)),_be={ALL:xg.DiagLogLevel.ALL,VERBOSE:xg.DiagLogLevel.VERBOSE,DEBUG:xg.DiagLogLevel.DEBUG,INFO:xg.DiagLogLevel.INFO,WARN:xg.DiagLogLevel.WARN,ERROR:xg.DiagLogLevel.ERROR,NONE:xg.DiagLogLevel.NONE};function Hft(e){if(e==null)return;let t=_be[e.toUpperCase()];return t??(xg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(_be)}, using default`),xg.DiagLogLevel.INFO)}xU.diagLogLevelFromString=Hft});var Sbe=M(DU=>{"use strict";m();Object.defineProperty(DU,"__esModule",{value:!0});DU._export=void 0;var ybe=(He(),Me(tt)),$ft=fB();function qft(e,t){return new Promise(n=>{ybe.context.with((0,$ft.suppressTracing)(ybe.context.active()),()=>{e.export(t,n)})})}DU._export=qft});var vr=M(Be=>{"use strict";m();Object.defineProperty(Be,"__esModule",{value:!0});Be.diagLogLevelFromString=Be.BindOnceFuture=Be.urlMatches=Be.isUrlIgnored=Be.callWithTimeout=Be.TimeoutError=Be.merge=Be.TraceState=Be.unsuppressTracing=Be.suppressTracing=Be.isTracingSuppressed=Be.setRPCMetadata=Be.getRPCMetadata=Be.deleteRPCMetadata=Be.RPCType=Be.parseTraceParent=Be.W3CTraceContextPropagator=Be.TRACE_STATE_HEADER=Be.TRACE_PARENT_HEADER=Be.CompositePropagator=Be.otperformance=Be.getStringListFromEnv=Be.getNumberFromEnv=Be.getBooleanFromEnv=Be.getStringFromEnv=Be._globalThis=Be.SDK_INFO=Be.parseKeyPairsIntoRecord=Be.ExportResultCode=Be.unrefTimer=Be.timeInputToHrTime=Be.millisToHrTime=Be.isTimeInputHrTime=Be.isTimeInput=Be.hrTimeToTimeStamp=Be.hrTimeToSeconds=Be.hrTimeToNanoseconds=Be.hrTimeToMilliseconds=Be.hrTimeToMicroseconds=Be.hrTimeDuration=Be.hrTime=Be.getTimeOrigin=Be.addHrTimes=Be.loggingErrorHandler=Be.setGlobalErrorHandler=Be.globalErrorHandler=Be.sanitizeAttributes=Be.isAttributeValue=Be.AnchoredClock=Be.W3CBaggagePropagator=void 0;Be.internal=void 0;var Vft=oge();Object.defineProperty(Be,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Vft.W3CBaggagePropagator}});var Yft=ige();Object.defineProperty(Be,"AnchoredClock",{enumerable:!0,get:function(){return Yft.AnchoredClock}});var Tbe=lge();Object.defineProperty(Be,"isAttributeValue",{enumerable:!0,get:function(){return Tbe.isAttributeValue}});Object.defineProperty(Be,"sanitizeAttributes",{enumerable:!0,get:function(){return Tbe.sanitizeAttributes}});var bbe=pge();Object.defineProperty(Be,"globalErrorHandler",{enumerable:!0,get:function(){return bbe.globalErrorHandler}});Object.defineProperty(Be,"setGlobalErrorHandler",{enumerable:!0,get:function(){return bbe.setGlobalErrorHandler}});var Kft=rV();Object.defineProperty(Be,"loggingErrorHandler",{enumerable:!0,get:function(){return Kft.loggingErrorHandler}});var Gl=$Te();Object.defineProperty(Be,"addHrTimes",{enumerable:!0,get:function(){return Gl.addHrTimes}});Object.defineProperty(Be,"getTimeOrigin",{enumerable:!0,get:function(){return Gl.getTimeOrigin}});Object.defineProperty(Be,"hrTime",{enumerable:!0,get:function(){return Gl.hrTime}});Object.defineProperty(Be,"hrTimeDuration",{enumerable:!0,get:function(){return Gl.hrTimeDuration}});Object.defineProperty(Be,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMicroseconds}});Object.defineProperty(Be,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Gl.hrTimeToMilliseconds}});Object.defineProperty(Be,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Gl.hrTimeToNanoseconds}});Object.defineProperty(Be,"hrTimeToSeconds",{enumerable:!0,get:function(){return Gl.hrTimeToSeconds}});Object.defineProperty(Be,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Gl.hrTimeToTimeStamp}});Object.defineProperty(Be,"isTimeInput",{enumerable:!0,get:function(){return Gl.isTimeInput}});Object.defineProperty(Be,"isTimeInputHrTime",{enumerable:!0,get:function(){return Gl.isTimeInputHrTime}});Object.defineProperty(Be,"millisToHrTime",{enumerable:!0,get:function(){return Gl.millisToHrTime}});Object.defineProperty(Be,"timeInputToHrTime",{enumerable:!0,get:function(){return Gl.timeInputToHrTime}});var Jft=qTe();Object.defineProperty(Be,"unrefTimer",{enumerable:!0,get:function(){return Jft.unrefTimer}});var Zft=VTe();Object.defineProperty(Be,"ExportResultCode",{enumerable:!0,get:function(){return Zft.ExportResultCode}});var Wft=X5();Object.defineProperty(Be,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Wft.parseKeyPairsIntoRecord}});var hS=OV();Object.defineProperty(Be,"SDK_INFO",{enumerable:!0,get:function(){return hS.SDK_INFO}});Object.defineProperty(Be,"_globalThis",{enumerable:!0,get:function(){return hS._globalThis}});Object.defineProperty(Be,"getStringFromEnv",{enumerable:!0,get:function(){return hS.getStringFromEnv}});Object.defineProperty(Be,"getBooleanFromEnv",{enumerable:!0,get:function(){return hS.getBooleanFromEnv}});Object.defineProperty(Be,"getNumberFromEnv",{enumerable:!0,get:function(){return hS.getNumberFromEnv}});Object.defineProperty(Be,"getStringListFromEnv",{enumerable:!0,get:function(){return hS.getStringListFromEnv}});Object.defineProperty(Be,"otperformance",{enumerable:!0,get:function(){return hS.otperformance}});var Xft=KTe();Object.defineProperty(Be,"CompositePropagator",{enumerable:!0,get:function(){return Xft.CompositePropagator}});var NU=tbe();Object.defineProperty(Be,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return NU.TRACE_PARENT_HEADER}});Object.defineProperty(Be,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return NU.TRACE_STATE_HEADER}});Object.defineProperty(Be,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return NU.W3CTraceContextPropagator}});Object.defineProperty(Be,"parseTraceParent",{enumerable:!0,get:function(){return NU.parseTraceParent}});var BU=nbe();Object.defineProperty(Be,"RPCType",{enumerable:!0,get:function(){return BU.RPCType}});Object.defineProperty(Be,"deleteRPCMetadata",{enumerable:!0,get:function(){return BU.deleteRPCMetadata}});Object.defineProperty(Be,"getRPCMetadata",{enumerable:!0,get:function(){return BU.getRPCMetadata}});Object.defineProperty(Be,"setRPCMetadata",{enumerable:!0,get:function(){return BU.setRPCMetadata}});var HV=fB();Object.defineProperty(Be,"isTracingSuppressed",{enumerable:!0,get:function(){return HV.isTracingSuppressed}});Object.defineProperty(Be,"suppressTracing",{enumerable:!0,get:function(){return HV.suppressTracing}});Object.defineProperty(Be,"unsuppressTracing",{enumerable:!0,get:function(){return HV.unsuppressTracing}});var emt=UV();Object.defineProperty(Be,"TraceState",{enumerable:!0,get:function(){return emt.TraceState}});var tmt=pbe();Object.defineProperty(Be,"merge",{enumerable:!0,get:function(){return tmt.merge}});var Ibe=fbe();Object.defineProperty(Be,"TimeoutError",{enumerable:!0,get:function(){return Ibe.TimeoutError}});Object.defineProperty(Be,"callWithTimeout",{enumerable:!0,get:function(){return Ibe.callWithTimeout}});var Cbe=Abe();Object.defineProperty(Be,"isUrlIgnored",{enumerable:!0,get:function(){return Cbe.isUrlIgnored}});Object.defineProperty(Be,"urlMatches",{enumerable:!0,get:function(){return Cbe.urlMatches}});var nmt=hbe();Object.defineProperty(Be,"BindOnceFuture",{enumerable:!0,get:function(){return nmt.BindOnceFuture}});var rmt=Ebe();Object.defineProperty(Be,"diagLogLevelFromString",{enumerable:!0,get:function(){return rmt.diagLogLevelFromString}});var omt=Sbe();Be.internal={_export:omt._export}});var vbe=M(wU=>{"use strict";m();Object.defineProperty(wU,"__esModule",{value:!0});wU.VERSION=void 0;wU.VERSION="0.214.0"});var Rbe=M(yB=>{"use strict";m();Object.defineProperty(yB,"__esModule",{value:!0});yB.SeverityNumber=void 0;var imt;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(imt=yB.SeverityNumber||(yB.SeverityNumber={}))});var kU=M(GC=>{"use strict";m();Object.defineProperty(GC,"__esModule",{value:!0});GC.NOOP_LOGGER=GC.NoopLogger=void 0;var OU=class{emit(t){}};GC.NoopLogger=OU;GC.NOOP_LOGGER=new OU});var xbe=M(wm=>{"use strict";m();Object.defineProperty(wm,"__esModule",{value:!0});wm.API_BACKWARDS_COMPATIBILITY_VERSION=wm.makeGetter=wm._global=wm.GLOBAL_LOGS_API_KEY=void 0;wm.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");wm._global=globalThis;function smt(e,t,n){return r=>r===e?t:n}wm.makeGetter=smt;wm.API_BACKWARDS_COMPATIBILITY_VERSION=1});var $V=M(jC=>{"use strict";m();Object.defineProperty(jC,"__esModule",{value:!0});jC.NOOP_LOGGER_PROVIDER=jC.NoopLoggerProvider=void 0;var amt=kU(),PU=class{getLogger(t,n,r){return new amt.NoopLogger}};jC.NoopLoggerProvider=PU;jC.NOOP_LOGGER_PROVIDER=new PU});var Dbe=M(MU=>{"use strict";m();Object.defineProperty(MU,"__esModule",{value:!0});MU.ProxyLogger=void 0;var umt=kU(),qV=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):umt.NOOP_LOGGER}};MU.ProxyLogger=qV});var Nbe=M(LU=>{"use strict";m();Object.defineProperty(LU,"__esModule",{value:!0});LU.ProxyLoggerProvider=void 0;var cmt=$V(),lmt=Dbe(),VV=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new lmt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:cmt.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};LU.ProxyLoggerProvider=VV});var wbe=M(UU=>{"use strict";m();Object.defineProperty(UU,"__esModule",{value:!0});UU.LogsAPI=void 0;var Vd=xbe(),dmt=$V(),Bbe=Nbe(),YV=class e{constructor(){this._proxyLoggerProvider=new Bbe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Vd._global[Vd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Vd._global[Vd.GLOBAL_LOGS_API_KEY]=(0,Vd.makeGetter)(Vd.API_BACKWARDS_COMPATIBILITY_VERSION,t,dmt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Vd._global[Vd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Vd._global,Vd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Vd._global[Vd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Bbe.ProxyLoggerProvider}};UU.LogsAPI=YV});var KV=M(Om=>{"use strict";m();Object.defineProperty(Om,"__esModule",{value:!0});Om.logs=Om.NoopLogger=Om.NOOP_LOGGER=Om.SeverityNumber=void 0;var pmt=Rbe();Object.defineProperty(Om,"SeverityNumber",{enumerable:!0,get:function(){return pmt.SeverityNumber}});var Obe=kU();Object.defineProperty(Om,"NOOP_LOGGER",{enumerable:!0,get:function(){return Obe.NOOP_LOGGER}});Object.defineProperty(Om,"NoopLogger",{enumerable:!0,get:function(){return Obe.NoopLogger}});var fmt=wbe();Om.logs=fmt.LogsAPI.getInstance()});var kbe=M(zC=>{"use strict";m();Object.defineProperty(zC,"__esModule",{value:!0});zC.disableInstrumentations=zC.enableInstrumentations=void 0;function mmt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}zC.enableInstrumentations=mmt;function Amt(e){e.forEach(t=>t.disable())}zC.disableInstrumentations=Amt});var Lbe=M(QU=>{"use strict";m();Object.defineProperty(QU,"__esModule",{value:!0});QU.registerInstrumentations=void 0;var Pbe=(He(),Me(tt)),gmt=KV(),Mbe=kbe();function hmt(e){let t=e.tracerProvider||Pbe.trace.getTracerProvider(),n=e.meterProvider||Pbe.metrics.getMeterProvider(),r=e.loggerProvider||gmt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Mbe.enableInstrumentations)(o,t,n,r),()=>{(0,Mbe.disableInstrumentations)(o)}}QU.registerInstrumentations=hmt});var qbe=M(FU=>{"use strict";m();Object.defineProperty(FU,"__esModule",{value:!0});FU.satisfies=void 0;var XV=(He(),Me(tt)),jbe=/^(?: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-]+)*))?$/,_mt=/^(?<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-]+)*))?$/,Emt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function ymt(e,t,n){if(!Smt(e))return XV.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=Cmt(e);if(!r)return!1;let o=[],i=zbe(r,t,o,n);return i&&!n?.includePrerelease?bmt(r,o):i}FU.satisfies=ymt;function Smt(e){return typeof e=="string"&&jbe.test(e)}function zbe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(JV(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=qmt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!JV(e,i,n,r))return!1;return!0}return JV(e,t,n,r)}function JV(e,t,n,r){if(t=Imt(t,r),t.includes(" "))return zbe(e,t,n,r);{let o=vmt(t);return n.push(o),Tmt(e,o)}}function Tmt(e,t){if(t.invalid)return!1;if(!t.version||WV(t.version))return!0;let n=Qbe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=Qbe(r,o)}return Emt[t.op]?.includes(n)}function bmt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Imt(e,t){return e=e.trim(),e=Hmt(e,t),e=zmt(e),e=$mt(e,t),e=e.trim(),e}function $u(e){return!e||e.toLowerCase()==="x"||e==="*"}function Cmt(e){let t=e.match(jbe);if(!t){XV.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function vmt(e){if(!e)return{};let t=e.match(_mt);if(!t)return XV.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function WV(e){return e==="*"||e==="x"||e==="X"}function Ube(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Rmt(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function xmt(e,t){if(WV(e)||WV(t))return 0;let[n,r]=Rmt(Ube(e),Ube(t));return n>r?1:n<r?-1:0}function Qbe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=xmt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var Hbe="[a-zA-Z0-9-]",$be="0|[1-9]\\d*",Dmt=`\\d*[a-zA-Z-]${Hbe}*`,Nmt="((?:<|>)?=?)",Fbe=`(?:${$be}|${Dmt})`,Bmt=`(?:-(${Fbe}(?:\\.${Fbe})*))`,Gbe=`${Hbe}+`,wmt=`(?:\\+(${Gbe}(?:\\.${Gbe})*))`,ZV=`${$be}|x|X|\\*`,SB=`[v=\\s]*(${ZV})(?:\\.(${ZV})(?:\\.(${ZV})(?:${Bmt})?${wmt}?)?)?`,Omt=`^${Nmt}\\s*${SB}$`,kmt=new RegExp(Omt),Pmt=`^\\s*(${SB})\\s+-\\s+(${SB})\\s*$`,Mmt=new RegExp(Pmt),Lmt="(?:~>?)",Umt=`^${Lmt}${SB}$`,Qmt=new RegExp(Umt),Fmt="(?:\\^)",Gmt=`^${Fmt}${SB}$`,jmt=new RegExp(Gmt);function zmt(e){let t=Qmt;return e.replace(t,(n,r,o,i,s)=>{let u;return $u(r)?u="":$u(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:$u(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function Hmt(e,t){let n=jmt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return $u(i)?f="":$u(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:$u(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function $mt(e,t){let n=kmt;return e.replace(n,(r,o,i,s,u,l)=>{let f=$u(i),h=f||$u(s),_=h||$u(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function qmt(e,t){let n=Mmt;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>($u(i)?o="":$u(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:$u(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,$u(_)?h="":$u(y)?h=`<${+_+1}.0.0-0`:$u(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var e7=M(xa=>{"use strict";m();Object.defineProperty(xa,"__esModule",{value:!0});xa.massUnwrap=xa.unwrap=xa.massWrap=xa.wrap=void 0;var qu=console.error.bind(console);function TB(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var Vmt=(e,t,n)=>{if(!e||!e[t]){qu("no original function "+String(t)+" to wrap");return}if(!n){qu("no wrapper function"),qu(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){qu("original object and wrapper must be functions");return}let o=n(r,t);return TB(o,"__original",r),TB(o,"__unwrap",()=>{e[t]===o&&TB(e,t,r)}),TB(o,"__wrapped",!0),TB(e,t,o),o};xa.wrap=Vmt;var Ymt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,xa.wrap)(r,o,n)})})};xa.massWrap=Ymt;var Kmt=(e,t)=>{if(!e||!e[t]){qu("no function to unwrap."),qu(new Error().stack);return}let n=e[t];if(!n.__unwrap)qu("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};xa.unwrap=Kmt;var Jmt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{qu("must provide one or more modules to patch"),qu(new Error().stack);return}if(!(t&&Array.isArray(t))){qu("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,xa.unwrap)(n,r)})})};xa.massUnwrap=Jmt;function bB(e){e&&e.logger&&(typeof e.logger!="function"?qu("new logger isn't a function, not replacing"):qu=e.logger)}xa.default=bB;bB.wrap=xa.wrap;bB.massWrap=xa.massWrap;bB.unwrap=xa.unwrap;bB.massUnwrap=xa.massUnwrap});var Vbe=M(jU=>{"use strict";m();Object.defineProperty(jU,"__esModule",{value:!0});jU.InstrumentationAbstract=void 0;var t7=(He(),Me(tt)),Zmt=KV(),GU=e7(),n7=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=t7.diag.createComponentLogger({namespace:t}),this._tracer=t7.trace.getTracer(t,n),this._meter=t7.metrics.getMeter(t,n),this._logger=Zmt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=GU.wrap;_unwrap=GU.unwrap;_massWrap=GU.massWrap;_massUnwrap=GU.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};jU.InstrumentationAbstract=n7});var Kbe=M((aun,Ybe)=>{m();var HC=1e3,$C=HC*60,qC=$C*60,_S=qC*24,Wmt=_S*7,Xmt=_S*365.25;Ybe.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return eAt(e);if(n==="number"&&isFinite(e))return t.long?nAt(e):tAt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function eAt(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Xmt;case"weeks":case"week":case"w":return n*Wmt;case"days":case"day":case"d":return n*_S;case"hours":case"hour":case"hrs":case"hr":case"h":return n*qC;case"minutes":case"minute":case"mins":case"min":case"m":return n*$C;case"seconds":case"second":case"secs":case"sec":case"s":return n*HC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function tAt(e){var t=Math.abs(e);return t>=_S?Math.round(e/_S)+"d":t>=qC?Math.round(e/qC)+"h":t>=$C?Math.round(e/$C)+"m":t>=HC?Math.round(e/HC)+"s":e+"ms"}function nAt(e){var t=Math.abs(e);return t>=_S?zU(e,t,_S,"day"):t>=qC?zU(e,t,qC,"hour"):t>=$C?zU(e,t,$C,"minute"):t>=HC?zU(e,t,HC,"second"):e+" ms"}function zU(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var r7=M((cun,Jbe)=>{m();function rAt(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=o,n.enabled=u,n.humanize=Kbe(),n.destroy=f,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let _=0;for(let y=0;y<h.length;y++)_=(_<<5)-_+h.charCodeAt(y),_|=0;return n.colors[Math.abs(_)%n.colors.length]}n.selectColor=t;function n(h){let _,y=null,T,v;function R(...x){if(!R.enabled)return;let O=R,P=Number(new Date),j=P-(_||P);O.diff=j,O.prev=_,O.curr=P,_=P,x[0]=n.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let G=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(V,ae)=>{if(V==="%%")return"%";G++;let re=n.formatters[ae];if(typeof re=="function"){let _e=x[G];V=re.call(O,_e),x.splice(G,1),G--}return V}),n.formatArgs.call(O,x),(O.log||n.log).apply(O,x)}return R.namespace=h,R.useColors=n.useColors(),R.color=n.selectColor(h),R.extend=r,R.destroy=n.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,v=n.enabled(h)),v),set:x=>{y=x}}),typeof n.init=="function"&&n.init(R),R}function r(h,_){let y=n(this.namespace+(typeof _>"u"?":":_)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let _=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of _)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,_){let y=0,T=0,v=-1,R=0;for(;y<h.length;)if(T<_.length&&(_[T]===h[y]||_[T]==="*"))_[T]==="*"?(v=T,R=y,T++):(y++,T++);else if(v!==-1)T=v+1,R++,y=R;else return!1;for(;T<_.length&&_[T]==="*";)T++;return T===_.length}function s(){let h=[...n.names,...n.skips.map(_=>"-"+_)].join(",");return n.enable(""),h}function u(h){for(let _ of n.skips)if(i(h,_))return!1;for(let _ of n.names)if(i(h,_))return!0;return!1}function l(h){return h instanceof Error?h.stack||h.message:h}function f(){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}Jbe.exports=rAt});var Zbe=M((Gc,HU)=>{m();Gc.formatArgs=iAt;Gc.save=sAt;Gc.load=aAt;Gc.useColors=oAt;Gc.storage=uAt();Gc.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();Gc.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 oAt(){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 e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function iAt(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+HU.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),e.splice(r,0,t)}Gc.log=console.debug||console.log||(()=>{});function sAt(e){try{e?Gc.storage.setItem("debug",e):Gc.storage.removeItem("debug")}catch{}}function aAt(){let e;try{e=Gc.storage.getItem("debug")||Gc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function uAt(){try{return localStorage}catch{}}HU.exports=r7()(Gc);var{formatters:cAt}=HU.exports;cAt.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Xbe=M((pun,Wbe)=>{"use strict";m();Wbe.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var nIe=M((mun,tIe)=>{"use strict";m();var lAt=Ue("os"),eIe=Ue("tty"),Yd=Xbe(),{env:Xs}=process,N_;Yd("no-color")||Yd("no-colors")||Yd("color=false")||Yd("color=never")?N_=0:(Yd("color")||Yd("colors")||Yd("color=true")||Yd("color=always"))&&(N_=1);"FORCE_COLOR"in Xs&&(Xs.FORCE_COLOR==="true"?N_=1:Xs.FORCE_COLOR==="false"?N_=0:N_=Xs.FORCE_COLOR.length===0?1:Math.min(parseInt(Xs.FORCE_COLOR,10),3));function o7(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i7(e,t){if(N_===0)return 0;if(Yd("color=16m")||Yd("color=full")||Yd("color=truecolor"))return 3;if(Yd("color=256"))return 2;if(e&&!t&&N_===void 0)return 0;let n=N_||0;if(Xs.TERM==="dumb")return n;if(process.platform==="win32"){let r=lAt.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Xs)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Xs)||Xs.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Xs)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Xs.TEAMCITY_VERSION)?1:0;if(Xs.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Xs){let r=parseInt((Xs.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Xs.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Xs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Xs.TERM)||"COLORTERM"in Xs?1:n}function dAt(e){let t=i7(e,e&&e.isTTY);return o7(t)}tIe.exports={supportsColor:dAt,stdout:o7(i7(!0,eIe.isatty(1))),stderr:o7(i7(!0,eIe.isatty(2)))}});var oIe=M((ea,qU)=>{m();var pAt=Ue("tty"),$U=Ue("util");ea.init=EAt;ea.log=gAt;ea.formatArgs=mAt;ea.save=hAt;ea.load=_At;ea.useColors=fAt;ea.destroy=$U.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ea.colors=[6,2,3,4,5,1];try{let e=nIe();e&&(e.stderr||e).level>=2&&(ea.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{}ea.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),r=process.env[t];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),e[n]=r,e},{});function fAt(){return"colors"in ea.inspectOpts?!!ea.inspectOpts.colors:pAt.isatty(process.stderr.fd)}function mAt(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
|
|
4
4
|
`).join(`
|
|
5
5
|
`+i),e.push(o+"m+"+qU.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=AAt()+t+" "+e[0]}function AAt(){return ea.inspectOpts.hideDate?"":new Date().toISOString()+" "}function gAt(...e){return process.stderr.write($U.formatWithOptions(ea.inspectOpts,...e)+`
|
|
6
6
|
`)}function hAt(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function _At(){return process.env.DEBUG}function EAt(e){e.inspectOpts={};let t=Object.keys(ea.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=ea.inspectOpts[t[n]]}qU.exports=r7()(ea);var{formatters:rIe}=qU.exports;rIe.o=function(e){return this.inspectOpts.colors=this.useColors,$U.inspect(e,this.inspectOpts).split(`
|
|
@@ -35,7 +35,7 @@ Url: ${nF(e)}`),!0}return!1}function P_t(e,t){return t?.length?ZQ(e).some(n=>F_(
|
|
|
35
35
|
`);for(let o of r){if(!o)continue;let i=o.indexOf(":");if(i===-1)continue;let s=o.substring(0,i).toLowerCase(),u=o.substring(i+1).trim(),l=n.get(s);l&&Array.isArray(l)?l.push(u):l?n.set(s,[l,u]):n.set(s,u)}}return n}onRequestCreated({request:t}){let n=this.getConfig(),r=n.enabled!==!1;if((0,Qw.safeExecuteInTheMiddle)(()=>!r||t.method==="CONNECT"||n.ignoreRequestHook?.(t),V=>V&&this._diag.error("caught ignoreRequestHook error: ",V),!0))return;let i=(0,$4.hrTime)(),s;try{s=new QIt.URL(t.path,t.origin)}catch(V){this._diag.warn("could not determine url.full:",V);return}let u=s.protocol.replace(":",""),l=this.getRequestMethod(t.method),f={[os.ATTR_HTTP_REQUEST_METHOD]:l,[os.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:t.method,[os.ATTR_URL_FULL]:s.toString(),[os.ATTR_URL_PATH]:s.pathname,[os.ATTR_URL_QUERY]:s.search,[os.ATTR_URL_SCHEME]:u},h={https:"443",http:"80"},_=s.hostname,y=s.port||h[u];f[os.ATTR_SERVER_ADDRESS]=_,y&&!isNaN(Number(y))&&(f[os.ATTR_SERVER_PORT]=Number(y));let v=this.parseRequestHeaders(t).get("user-agent");if(v){let V=Array.isArray(v)?v[v.length-1]:v;f[os.ATTR_USER_AGENT_ORIGINAL]=V}let R=(0,Qw.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(t),V=>V&&this._diag.error("caught startSpanHook error: ",V),!0);R&&Object.entries(R).forEach(([V,ae])=>{f[V]=ae});let x=Zl.context.active(),O=Zl.trace.getSpan(x),P;n.requireParentforSpans&&(!O||!Zl.trace.isSpanContextValid(O.spanContext()))?P=Zl.trace.wrapSpanContext(Zl.INVALID_SPAN_CONTEXT):P=this.tracer.startSpan(l==="_OTHER"?"HTTP":l,{kind:Zl.SpanKind.CLIENT,attributes:f},x),(0,Qw.safeExecuteInTheMiddle)(()=>n.requestHook?.(P,t),V=>V&&this._diag.error("caught requestHook error: ",V),!0);let j=Zl.trace.setSpan(Zl.context.active(),P),G={};Zl.propagation.inject(j,G);let H=Object.entries(G);for(let V=0;V<H.length;V++){let[ae,re]=H[V];typeof t.addHeader=="function"?t.addHeader(ae,re):typeof t.headers=="string"?t.headers+=`${ae}: ${re}\r
|
|
36
36
|
`:Array.isArray(t.headers)&&t.headers.push(ae,re)}this._recordFromReq.set(t,{span:P,attributes:f,startTime:i})}onRequestHeaders({request:t,socket:n}){let r=this._recordFromReq.get(t);if(!r)return;let o=this.getConfig(),{span:i}=r,{remoteAddress:s,remotePort:u}=n,l={[os.ATTR_NETWORK_PEER_ADDRESS]:s,[os.ATTR_NETWORK_PEER_PORT]:u};if(o.headersToSpanAttributes?.requestHeaders){let f=new Set(o.headersToSpanAttributes.requestHeaders.map(_=>_.toLowerCase())),h=this.parseRequestHeaders(t);for(let[_,y]of h.entries())if(f.has(_)){let T=Array.isArray(y)?y:[y];l[`http.request.header.${_}`]=T}}i.setAttributes(l)}onResponseHeaders({request:t,response:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i}=r,s={[os.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},u=this.getConfig();if((0,Qw.safeExecuteInTheMiddle)(()=>u.responseHook?.(o,{request:t,response:n}),l=>l&&this._diag.error("caught responseHook error: ",l),!0),u.headersToSpanAttributes?.responseHeaders){let l=new Set;u.headersToSpanAttributes?.responseHeaders.forEach(f=>l.add(f.toLowerCase()));for(let f=0;f<n.headers.length;f=f+2){let h=n.headers[f].toString().toLowerCase(),_=n.headers[f+1];if(l.has(h)){let y=`http.response.header.${h}`;Object.hasOwn(s,y)?s[y].push(_.toString()):s[y]=[_.toString()]}}}o.setAttributes(s),o.setStatus({code:n.statusCode>=400?Zl.SpanStatusCode.ERROR:Zl.SpanStatusCode.UNSET}),r.attributes=Object.assign(i,s)}onDone({request:t}){let n=this._recordFromReq.get(t);if(!n)return;let{span:r,attributes:o,startTime:i}=n;r.end(),this._recordFromReq.delete(t),this.recordRequestDuration(o,i)}onError({request:t,error:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i,startTime:s}=r;o.recordException(n),o.setStatus({code:Zl.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(t),i[os.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(i,s)}recordRequestDuration(t,n){let r={};[os.ATTR_HTTP_RESPONSE_STATUS_CODE,os.ATTR_HTTP_REQUEST_METHOD,os.ATTR_SERVER_ADDRESS,os.ATTR_SERVER_PORT,os.ATTR_URL_SCHEME,os.ATTR_ERROR_TYPE].forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,$4.hrTimeToMilliseconds)((0,$4.hrTimeDuration)(n,(0,$4.hrTime)()))/1e3;this._httpClientDurationHistogram.record(i,r)}getRequestMethod(t){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return t.toUpperCase()in n?t.toUpperCase():"_OTHER"}};q4.UndiciInstrumentation=QZ});var awe=M(V4=>{"use strict";m();Object.defineProperty(V4,"__esModule",{value:!0});V4.UndiciInstrumentation=void 0;var FIt=swe();Object.defineProperty(V4,"UndiciInstrumentation",{enumerable:!0,get:function(){return FIt.UndiciInstrumentation}})});function uwe(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}function HIt(e,t={}){return typeof e.spans=="boolean"?e.spans:!t.skipOpenTelemetrySetup&&Mi(t)}function $It(e={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=uwe(n.origin,n.path),o=e.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=uwe(n.origin,n.path);if(r.startsWith("data:")){let o=Iv(r);return{[Mt]:"auto.http.otel.node_fetch","http.url":o,[$_]:o,[Wd]:`${n.method||"GET"} ${o}`}}return{[Mt]:"auto.http.otel.node_fetch"}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}var cwe,lwe,GIt,jIt,zIt,dwe,pwe=w(()=>{m();cwe=ue(awe(),1);At();_r();lwe="NodeFetch",GIt=ct(lwe,cwe.UndiciInstrumentation,e=>$It(e)),jIt=ct(`${lwe}.sentry`,GS,e=>e),zIt=((e={})=>({name:"NodeFetch",setupOnce(){HIt(e,Et()?.getOptions())&&GIt(e),jIt(e)}})),dwe=zIt});var Y4=M(Fw=>{"use strict";m();Object.defineProperty(Fw,"__esModule",{value:!0});Fw.ExpressLayerType=void 0;var qIt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(qIt=Fw.ExpressLayerType||(Fw.ExpressLayerType={}))});var K4=M(Gw=>{"use strict";m();Object.defineProperty(Gw,"__esModule",{value:!0});Gw.AttributeNames=void 0;var VIt;(function(e){e.EXPRESS_TYPE="express.type",e.EXPRESS_NAME="express.name"})(VIt=Gw.AttributeNames||(Gw.AttributeNames={}))});var FZ=M(tR=>{"use strict";m();Object.defineProperty(tR,"__esModule",{value:!0});tR._LAYERS_STORE_PROPERTY=tR.kLayerPatched=void 0;tR.kLayerPatched=Symbol("express-layer-patched");tR._LAYERS_STORE_PROPERTY="__ot_middlewares"});var Awe=M(is=>{"use strict";m();Object.defineProperty(is,"__esModule",{value:!0});is.getActualMatchedRoute=is.getConstructedRoute=is.getLayerPath=is.asErrorAndMessage=is.isLayerIgnored=is.getLayerMetadata=is.getRouterPath=is.storeLayerPath=void 0;var GZ=Y4(),nR=K4(),VS=FZ(),YIt=(e,t)=>(Array.isArray(e[VS._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,VS._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t===void 0?{isLayerPathStored:!1}:(e[VS._LAYERS_STORE_PROPERTY].push(t),{isLayerPathStored:!0}));is.storeLayerPath=YIt;var KIt=(e,t)=>{let n=t.handle?.stack?.[0];return n?.route?.path?`${e}${n.route.path}`:n?.handle?.stack?(0,is.getRouterPath)(e,n):e};is.getRouterPath=KIt;var JIt=(e,t,n)=>{if(t.name==="router"){let r=(0,is.getRouterPath)("",t),o=r||n||e||"/";return{attributes:{[nR.AttributeNames.EXPRESS_NAME]:o,[nR.AttributeNames.EXPRESS_TYPE]:GZ.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[nR.AttributeNames.EXPRESS_NAME]:(e||n)??"request handler",[nR.AttributeNames.EXPRESS_TYPE]:GZ.ExpressLayerType.REQUEST_HANDLER},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[nR.AttributeNames.EXPRESS_NAME]:t.name,[nR.AttributeNames.EXPRESS_TYPE]:GZ.ExpressLayerType.MIDDLEWARE},name:`middleware - ${t.name}`}};is.getLayerMetadata=JIt;var ZIt=(e,t)=>{if(typeof t=="string")return t===e;if(t instanceof RegExp)return t.test(e);if(typeof t=="function")return t(e);throw new TypeError("Pattern is in unsupported datatype")},WIt=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(ZIt(e,r))return!0}catch{}return!1};is.isLayerIgnored=WIt;var XIt=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];is.asErrorAndMessage=XIt;var eCt=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>fwe(n)||"").join(","):fwe(t)};is.getLayerPath=eCt;var fwe=e=>{if(typeof e=="string")return e;if(e instanceof RegExp||typeof e=="number")return e.toString()};function mwe(e){let n=(Array.isArray(e[VS._LAYERS_STORE_PROPERTY])?e[VS._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}is.getConstructedRoute=mwe;function tCt(e){let t=Array.isArray(e[VS._LAYERS_STORE_PROPERTY])?e[VS._LAYERS_STORE_PROPERTY]:[];if(t.length===0)return;if(t.every(i=>i==="/"))return e.originalUrl==="/"?"/":void 0;let n=mwe(e);if(n==="*"||n.includes("/")&&(n.includes(",")||n.includes("\\")||n.includes("*")||n.includes("[")))return n;let r=n.startsWith("/")?n:`/${n}`;return r.length>0&&(e.originalUrl===r||e.originalUrl.startsWith(r)||nCt(r))?r:void 0}is.getActualMatchedRoute=tCt;function nCt(e){return e.includes(":")||e.includes("*")}});var gwe=M(rR=>{"use strict";m();Object.defineProperty(rR,"__esModule",{value:!0});rR.PACKAGE_NAME=rR.PACKAGE_VERSION=void 0;rR.PACKAGE_VERSION="0.62.0";rR.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var Swe=M(Z4=>{"use strict";m();Object.defineProperty(Z4,"__esModule",{value:!0});Z4.ExpressInstrumentation=void 0;var hwe=vr(),Yc=(He(),Me(tt)),_we=Y4(),Ewe=K4(),Xm=Awe(),ywe=gwe(),oR=un(),rCt=(Xn(),Me(Hr)),J4=FZ(),jZ=class extends oR.InstrumentationBase{constructor(t={}){super(ywe.PACKAGE_NAME,ywe.PACKAGE_VERSION,t)}init(){return[new oR.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],t=>{let n=typeof t?.Router?.prototype?.route=="function",r=n?t.Router.prototype:t.Router;return(0,oR.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,oR.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,oR.isWrapped)(t.application.use)&&this._unwrap(t.application,"use"),this._wrap(t.application,"use",this._getAppUsePatch(n)),t},t=>{if(t===void 0)return;let r=typeof t?.Router?.prototype?.route=="function"?t.Router.prototype:t.Router;this._unwrap(r,"route"),this._unwrap(r,"use"),this._unwrap(t.application,"use")})]}_getRoutePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),s=this.stack[this.stack.length-1];return t._applyPatch(s,(0,Xm.getLayerPath)(o)),i}}}_getRouterUsePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),s=this.stack[this.stack.length-1];return t._applyPatch(s,(0,Xm.getLayerPath)(o)),i}}}_getAppUsePatch(t){let n=this;return function(r){return function(...i){let s=t?this.router:this._router,u=r.apply(this,i);if(s){let l=s.stack[s.stack.length-1];n._applyPatch(l,(0,Xm.getLayerPath)(i))}return u}}}_applyPatch(t,n){let r=this;t[J4.kLayerPatched]!==!0&&(t[J4.kLayerPatched]=!0,this._wrap(t,"handle",o=>{if(o.length===4)return o;let i=function(s,u){let{isLayerPathStored:l}=(0,Xm.storeLayerPath)(s,n),f=(0,Xm.getConstructedRoute)(s),h=(0,Xm.getActualMatchedRoute)(s),_={[rCt.ATTR_HTTP_ROUTE]:h},y=(0,Xm.getLayerMetadata)(f,t,n),T=y.attributes[Ewe.AttributeNames.EXPRESS_TYPE],v=(0,hwe.getRPCMetadata)(Yc.context.active());if(v?.type===hwe.RPCType.HTTP&&(v.route=h),(0,Xm.isLayerIgnored)(y.name,T,r.getConfig()))return T===_we.ExpressLayerType.MIDDLEWARE&&s[J4._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Yc.trace.getSpan(Yc.context.active())===void 0)return o.apply(this,arguments);let R=r._getSpanName({request:s,layerType:T,route:f},y.name),x=r.tracer.startSpan(R,{attributes:Object.assign(_,y.attributes)}),O=Yc.context.active(),P=Yc.trace.setSpan(O,x),{requestHook:j}=r.getConfig();j&&(0,oR.safeExecuteInTheMiddle)(()=>j(x,{request:s,layerType:T,route:f}),re=>{re&&Yc.diag.error("express instrumentation: request hook failed",re)},!0);let G=!1;y.attributes[Ewe.AttributeNames.EXPRESS_TYPE]===_we.ExpressLayerType.ROUTER&&(x.end(),G=!0,P=O);let H=()=>{G===!1&&(G=!0,x.end())},V=Array.from(arguments),ae=V.findIndex(re=>typeof re=="function");ae>=0&&(arguments[ae]=function(){let re=arguments[0],_e=![void 0,null,"route","router"].includes(re);if(!G&&_e){let[Tt,ye]=(0,Xm.asErrorAndMessage)(re);x.recordException(Tt),x.setStatus({code:Yc.SpanStatusCode.ERROR,message:ye})}G===!1&&(G=!0,s.res?.removeListener("finish",H),x.end()),!(s.route&&_e)&&l&&s[J4._LAYERS_STORE_PROPERTY].pop();let Qe=V[ae],pt=Yc.context.active(),Ge=Yc.trace.getSpan(O),Pt=Ge?Yc.trace.setSpan(pt,Ge):pt;return Yc.context.bind(Pt,Qe).apply(this,arguments)});try{return Yc.context.bind(P,o).apply(this,arguments)}catch(re){let[_e,Qe]=(0,Xm.asErrorAndMessage)(re);throw x.recordException(_e),x.setStatus({code:Yc.SpanStatusCode.ERROR,message:Qe}),re}finally{G||u.once("finish",H)}};for(let s in o)Object.defineProperty(i,s,{get(){return o[s]},set(u){o[s]=u}});return i}))}_getSpanName(t,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(t,n)??n}catch(o){return Yc.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};Z4.ExpressInstrumentation=jZ});var Twe=M(fE=>{"use strict";m();Object.defineProperty(fE,"__esModule",{value:!0});fE.AttributeNames=fE.ExpressLayerType=fE.ExpressInstrumentation=void 0;var oCt=Swe();Object.defineProperty(fE,"ExpressInstrumentation",{enumerable:!0,get:function(){return oCt.ExpressInstrumentation}});var iCt=Y4();Object.defineProperty(fE,"ExpressLayerType",{enumerable:!0,get:function(){return iCt.ExpressLayerType}});var sCt=K4();Object.defineProperty(fE,"AttributeNames",{enumerable:!0,get:function(){return sCt.AttributeNames}})});var Ds,YS=w(()=>{m();Ds=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__});function aCt(e){qr(e,"auto.http.otel.express");let t=kt(e).data,n=t["express.type"];n&&e.setAttribute(Xt,`${n}.express`);let r=t["express.name"];typeof r=="string"&&e.updateName(r)}function uCt(e,t){if(Rn()===Zd())return Ds&&W.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),t;if(e.layerType==="request_handler"){let n=e.request,r=n.method?n.method.toUpperCase():"GET";Rn().setTransactionName(`${r} ${e.route}`)}return t}var bwe,Iwe,Cwe,cCt,vwe,Rwe=w(()=>{m();bwe=ue(Twe(),1);At();_r();YS();Iwe="Express";Cwe=ct(Iwe,()=>new bwe.ExpressInstrumentation({requestHook:e=>aCt(e),spanNameHook:(e,t)=>uCt(e,t)})),cCt=(()=>({name:Iwe,setupOnce(){Cwe()}})),vwe=cCt});var xwe=M(jw=>{"use strict";m();Object.defineProperty(jw,"__esModule",{value:!0});jw.SeverityNumber=void 0;var lCt;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(lCt=jw.SeverityNumber||(jw.SeverityNumber={}))});var e3=M(iR=>{"use strict";m();Object.defineProperty(iR,"__esModule",{value:!0});iR.NOOP_LOGGER=iR.NoopLogger=void 0;var X4=class{emit(t){}};iR.NoopLogger=X4;iR.NOOP_LOGGER=new X4});var Dwe=M(eA=>{"use strict";m();Object.defineProperty(eA,"__esModule",{value:!0});eA.API_BACKWARDS_COMPATIBILITY_VERSION=eA.makeGetter=eA._global=eA.GLOBAL_LOGS_API_KEY=void 0;eA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");eA._global=globalThis;function dCt(e,t,n){return r=>r===e?t:n}eA.makeGetter=dCt;eA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var zZ=M(sR=>{"use strict";m();Object.defineProperty(sR,"__esModule",{value:!0});sR.NOOP_LOGGER_PROVIDER=sR.NoopLoggerProvider=void 0;var pCt=e3(),t3=class{getLogger(t,n,r){return new pCt.NoopLogger}};sR.NoopLoggerProvider=t3;sR.NOOP_LOGGER_PROVIDER=new t3});var Nwe=M(n3=>{"use strict";m();Object.defineProperty(n3,"__esModule",{value:!0});n3.ProxyLogger=void 0;var fCt=e3(),HZ=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):fCt.NOOP_LOGGER}};n3.ProxyLogger=HZ});var Bwe=M(r3=>{"use strict";m();Object.defineProperty(r3,"__esModule",{value:!0});r3.ProxyLoggerProvider=void 0;var mCt=zZ(),ACt=Nwe(),$Z=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new ACt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:mCt.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};r3.ProxyLoggerProvider=$Z});var Owe=M(o3=>{"use strict";m();Object.defineProperty(o3,"__esModule",{value:!0});o3.LogsAPI=void 0;var op=Dwe(),gCt=zZ(),wwe=Bwe(),qZ=class e{constructor(){this._proxyLoggerProvider=new wwe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return op._global[op.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(op._global[op.GLOBAL_LOGS_API_KEY]=(0,op.makeGetter)(op.API_BACKWARDS_COMPATIBILITY_VERSION,t,gCt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=op._global[op.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(op._global,op.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete op._global[op.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new wwe.ProxyLoggerProvider}};o3.LogsAPI=qZ});var VZ=M(tA=>{"use strict";m();Object.defineProperty(tA,"__esModule",{value:!0});tA.logs=tA.NoopLogger=tA.NOOP_LOGGER=tA.SeverityNumber=void 0;var hCt=xwe();Object.defineProperty(tA,"SeverityNumber",{enumerable:!0,get:function(){return hCt.SeverityNumber}});var kwe=e3();Object.defineProperty(tA,"NOOP_LOGGER",{enumerable:!0,get:function(){return kwe.NOOP_LOGGER}});Object.defineProperty(tA,"NoopLogger",{enumerable:!0,get:function(){return kwe.NoopLogger}});var _Ct=Owe();tA.logs=_Ct.LogsAPI.getInstance()});var Pwe=M(aR=>{"use strict";m();Object.defineProperty(aR,"__esModule",{value:!0});aR.disableInstrumentations=aR.enableInstrumentations=void 0;function ECt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}aR.enableInstrumentations=ECt;function yCt(e){e.forEach(t=>t.disable())}aR.disableInstrumentations=yCt});var Uwe=M(i3=>{"use strict";m();Object.defineProperty(i3,"__esModule",{value:!0});i3.registerInstrumentations=void 0;var Mwe=(He(),Me(tt)),SCt=VZ(),Lwe=Pwe();function TCt(e){let t=e.tracerProvider||Mwe.trace.getTracerProvider(),n=e.meterProvider||Mwe.metrics.getMeterProvider(),r=e.loggerProvider||SCt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Lwe.enableInstrumentations)(o,t,n,r),()=>{(0,Lwe.disableInstrumentations)(o)}}i3.registerInstrumentations=TCt});var Vwe=M(s3=>{"use strict";m();Object.defineProperty(s3,"__esModule",{value:!0});s3.satisfies=void 0;var ZZ=(He(),Me(tt)),zwe=/^(?: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-]+)*))?$/,bCt=/^(?<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-]+)*))?$/,ICt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function CCt(e,t,n){if(!vCt(e))return ZZ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=NCt(e);if(!r)return!1;let o=[],i=Hwe(r,t,o,n);return i&&!n?.includePrerelease?xCt(r,o):i}s3.satisfies=CCt;function vCt(e){return typeof e=="string"&&zwe.test(e)}function Hwe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(YZ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=ZCt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!YZ(e,i,n,r))return!1;return!0}return YZ(e,t,n,r)}function YZ(e,t,n,r){if(t=DCt(t,r),t.includes(" "))return Hwe(e,t,n,r);{let o=BCt(t);return n.push(o),RCt(e,o)}}function RCt(e,t){if(t.invalid)return!1;if(!t.version||JZ(t.version))return!0;let n=Fwe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=Fwe(r,o)}return ICt[t.op]?.includes(n)}function xCt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function DCt(e,t){return e=e.trim(),e=KCt(e,t),e=YCt(e),e=JCt(e,t),e=e.trim(),e}function Xu(e){return!e||e.toLowerCase()==="x"||e==="*"}function NCt(e){let t=e.match(zwe);if(!t){ZZ.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function BCt(e){if(!e)return{};let t=e.match(bCt);if(!t)return ZZ.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function JZ(e){return e==="*"||e==="x"||e==="X"}function Qwe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function wCt(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function OCt(e,t){if(JZ(e)||JZ(t))return 0;let[n,r]=wCt(Qwe(e),Qwe(t));return n>r?1:n<r?-1:0}function Fwe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=OCt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var $we="[a-zA-Z0-9-]",qwe="0|[1-9]\\d*",kCt=`\\d*[a-zA-Z-]${$we}*`,PCt="((?:<|>)?=?)",Gwe=`(?:${qwe}|${kCt})`,MCt=`(?:-(${Gwe}(?:\\.${Gwe})*))`,jwe=`${$we}+`,LCt=`(?:\\+(${jwe}(?:\\.${jwe})*))`,KZ=`${qwe}|x|X|\\*`,zw=`[v=\\s]*(${KZ})(?:\\.(${KZ})(?:\\.(${KZ})(?:${MCt})?${LCt}?)?)?`,UCt=`^${PCt}\\s*${zw}$`,QCt=new RegExp(UCt),FCt=`^\\s*(${zw})\\s+-\\s+(${zw})\\s*$`,GCt=new RegExp(FCt),jCt="(?:~>?)",zCt=`^${jCt}${zw}$`,HCt=new RegExp(zCt),$Ct="(?:\\^)",qCt=`^${$Ct}${zw}$`,VCt=new RegExp(qCt);function YCt(e){let t=HCt;return e.replace(t,(n,r,o,i,s)=>{let u;return Xu(r)?u="":Xu(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:Xu(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function KCt(e,t){let n=VCt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return Xu(i)?f="":Xu(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Xu(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function JCt(e,t){let n=QCt;return e.replace(n,(r,o,i,s,u,l)=>{let f=Xu(i),h=f||Xu(s),_=h||Xu(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function ZCt(e,t){let n=GCt;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>(Xu(i)?o="":Xu(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Xu(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Xu(_)?h="":Xu(y)?h=`<${+_+1}.0.0-0`:Xu(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var WZ=M(Ma=>{"use strict";m();Object.defineProperty(Ma,"__esModule",{value:!0});Ma.massUnwrap=Ma.unwrap=Ma.massWrap=Ma.wrap=void 0;var ec=console.error.bind(console);function Hw(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var WCt=(e,t,n)=>{if(!e||!e[t]){ec("no original function "+String(t)+" to wrap");return}if(!n){ec("no wrapper function"),ec(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){ec("original object and wrapper must be functions");return}let o=n(r,t);return Hw(o,"__original",r),Hw(o,"__unwrap",()=>{e[t]===o&&Hw(e,t,r)}),Hw(o,"__wrapped",!0),Hw(e,t,o),o};Ma.wrap=WCt;var XCt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ec("must provide one or more modules to patch"),ec(new Error().stack);return}if(!(t&&Array.isArray(t))){ec("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ma.wrap)(r,o,n)})})};Ma.massWrap=XCt;var evt=(e,t)=>{if(!e||!e[t]){ec("no function to unwrap."),ec(new Error().stack);return}let n=e[t];if(!n.__unwrap)ec("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ma.unwrap=evt;var tvt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{ec("must provide one or more modules to patch"),ec(new Error().stack);return}if(!(t&&Array.isArray(t))){ec("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ma.unwrap)(n,r)})})};Ma.massUnwrap=tvt;function $w(e){e&&e.logger&&(typeof e.logger!="function"?ec("new logger isn't a function, not replacing"):ec=e.logger)}Ma.default=$w;$w.wrap=Ma.wrap;$w.massWrap=Ma.massWrap;$w.unwrap=Ma.unwrap;$w.massUnwrap=Ma.massUnwrap});var Ywe=M(u3=>{"use strict";m();Object.defineProperty(u3,"__esModule",{value:!0});u3.InstrumentationAbstract=void 0;var XZ=(He(),Me(tt)),nvt=VZ(),a3=WZ(),eW=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=XZ.diag.createComponentLogger({namespace:t}),this._tracer=XZ.trace.getTracer(t,n),this._meter=XZ.metrics.getMeter(t,n),this._logger=nvt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=a3.wrap;_unwrap=a3.unwrap;_massWrap=a3.massWrap;_massUnwrap=a3.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};u3.InstrumentationAbstract=eW});var Kwe=M(mE=>{"use strict";m();Object.defineProperty(mE,"__esModule",{value:!0});mE.ModuleNameTrie=mE.ModuleNameSeparator=void 0;mE.ModuleNameSeparator="/";var c3=class{hooks=[];children=new Map},tW=class{_trie=new c3;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(mE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new c3,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],s=!0;for(let u of t.split(mE.ModuleNameSeparator)){let l=o.children.get(u);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};mE.ModuleNameTrie=tW});var Zwe=M(l3=>{"use strict";m();Object.defineProperty(l3,"__esModule",{value:!0});l3.RequireInTheMiddleSingleton=void 0;var rvt=ES(),Jwe=Ue("path"),nW=Kwe(),ovt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),rW=class e{_moduleNameTrie=new nW.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new rvt.Hook(null,{internals:!0},(t,n,r)=>{let o=ivt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return ovt?new e:this._instance=this._instance??new e}};l3.RequireInTheMiddleSingleton=rW;function ivt(e){return Jwe.sep!==nW.ModuleNameSeparator?e.split(Jwe.sep).join(nW.ModuleNameSeparator):e}});var nOe=M(qw=>{m();var Wwe=[],oW=new WeakMap,Xwe=new WeakMap,eOe=new Map,tOe=[],svt={set(e,t,n){let r=oW.get(e),o=r&&r[t];return typeof o=="function"?o(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=Xwe.get(e)[t];if(typeof n=="function")return n()},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=oW.get(e),o=r&&r[t];return typeof o=="function"?o(n.value):!0}};function avt(e,t,n,r,o){eOe.set(e,o),oW.set(t,n),Xwe.set(t,r);let i=new Proxy(t,svt);Wwe.forEach(s=>s(e,i,o)),tOe.push([e,i,o])}qw.register=avt;qw.importHooks=Wwe;qw.specifiers=eOe;qw.toHook=tOe});var uW=M((IDn,cR)=>{m();var rOe=Ue("path"),uvt=VU(),{fileURLToPath:cvt}=Ue("url"),{MessageChannel:lvt}=Ue("worker_threads"),{isBuiltin:iW}=Ue("module");iW||(iW=()=>!0);var{importHooks:sW,specifiers:dvt,toHook:pvt}=nOe();function oOe(e){sW.push(e),pvt.forEach(([t,n,r])=>e(t,n,r))}function iOe(e){let t=sW.indexOf(e);t>-1&&sW.splice(t,1)}function uR(e,t,n,r){let o=e(t,n,r);o&&o!==t&&"default"in t&&(t.default=o)}var aW;function fvt(){let{port1:e,port2:t}=new lvt,n=0,r;aW=u=>{n++,e.postMessage(u)},e.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let u=setInterval(()=>{},1e3),l=new Promise(f=>{r=f}).then(()=>{clearInterval(u)});return n===0&&r(),l}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:o}}function Vw(e,t,n){if(!(this instanceof Vw))return new Vw(e,t,n);typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null);let r=t?t.internals===!0:!1;aW&&Array.isArray(e)&&aW(e),this._iitmHook=(o,i,s)=>{let u=o,l=u.startsWith("node:"),f,h;if(l){let _=o.slice(5);iW(_)&&(o=_)}else if(u.startsWith("file://")){let _=Error.stackTraceLimit;Error.stackTraceLimit=0;try{f=cvt(o),o=f}catch{}if(Error.stackTraceLimit=_,f){let y=uvt(f);y&&(o=y.name,h=y.basedir)}}if(e)for(let _ of e)if(f&&_===f)uR(n,i,f,void 0);else if(_===o){if(!h)uR(n,i,o,h);else if(h.endsWith(dvt.get(u)))uR(n,i,o,h);else if(r){let y=o+rOe.sep+rOe.relative(h,f);uR(n,i,y,h)}}else _===s&&uR(n,i,s,h);else uR(n,i,o,h)},oOe(this._iitmHook)}Vw.prototype.unhook=function(){iOe(this._iitmHook)};cR.exports=Vw;cR.exports.Hook=Vw;cR.exports.addHook=oOe;cR.exports.removeHook=iOe;cR.exports.createAddHookMessageChannel=fvt});var cW=M(AE=>{"use strict";m();Object.defineProperty(AE,"__esModule",{value:!0});AE.isWrapped=AE.safeExecuteInTheMiddleAsync=AE.safeExecuteInTheMiddle=void 0;function mvt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}AE.safeExecuteInTheMiddle=mvt;async function Avt(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(await t(r,o),r&&!n)throw r;return o}}AE.safeExecuteInTheMiddleAsync=Avt;function gvt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}AE.isWrapped=gvt});var uOe=M(d3=>{"use strict";m();Object.defineProperty(d3,"__esModule",{value:!0});d3.InstrumentationBase=void 0;var Yw=Ue("path"),sOe=Ue("util"),hvt=Vwe(),lW=WZ(),_vt=Ywe(),Evt=Zwe(),yvt=uW(),Kw=(He(),Me(tt)),Svt=ES(),Tvt=Ue("fs"),bvt=cW(),dW=class extends _vt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=Evt.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,bvt.isWrapped)(t[n])&&this._unwrap(t,n),sOe.types.isProxy(t)){let o=(0,lW.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,lW.wrap)(t,n,r)};_unwrap=(t,n)=>sOe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,lW.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{Kw.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Kw.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Kw.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Kw.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Ue.resolve(n);Ue.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(t){try{let n=(0,Tvt.readFileSync)(Yw.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{Kw.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return aOe(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let s=t.files??[],u=Yw.normalize(r);return s.filter(f=>f.name===u&&aOe(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(f,t.moduleVersion)):f),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,u,l)=>{if(!l&&Yw.isAbsolute(u)){let f=Yw.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=Yw.isAbsolute(t.name)?new Svt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new yvt.Hook([t.name],{internals:!0},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};d3.InstrumentationBase=dW;function aOe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,hvt.satisfies)(t,r,{includePrerelease:n}))}});var cOe=M(p3=>{"use strict";m();Object.defineProperty(p3,"__esModule",{value:!0});p3.normalize=void 0;var Ivt=Ue("path");Object.defineProperty(p3,"normalize",{enumerable:!0,get:function(){return Ivt.normalize}})});var lOe=M(lR=>{"use strict";m();Object.defineProperty(lR,"__esModule",{value:!0});lR.normalize=lR.InstrumentationBase=void 0;var Cvt=uOe();Object.defineProperty(lR,"InstrumentationBase",{enumerable:!0,get:function(){return Cvt.InstrumentationBase}});var vvt=cOe();Object.defineProperty(lR,"normalize",{enumerable:!0,get:function(){return vvt.normalize}})});var pW=M(dR=>{"use strict";m();Object.defineProperty(dR,"__esModule",{value:!0});dR.normalize=dR.InstrumentationBase=void 0;var dOe=lOe();Object.defineProperty(dR,"InstrumentationBase",{enumerable:!0,get:function(){return dOe.InstrumentationBase}});Object.defineProperty(dR,"normalize",{enumerable:!0,get:function(){return dOe.normalize}})});var pOe=M(f3=>{"use strict";m();Object.defineProperty(f3,"__esModule",{value:!0});f3.InstrumentationNodeModuleDefinition=void 0;var fW=class{files;name;supportedVersions;patch;unpatch;constructor(t,n,r,o,i){this.files=i||[],this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o}};f3.InstrumentationNodeModuleDefinition=fW});var fOe=M(m3=>{"use strict";m();Object.defineProperty(m3,"__esModule",{value:!0});m3.InstrumentationNodeModuleFile=void 0;var Rvt=pW(),mW=class{name;supportedVersions;patch;unpatch;constructor(t,n,r,o){this.name=(0,Rvt.normalize)(t),this.supportedVersions=n,this.patch=r,this.unpatch=o}};m3.InstrumentationNodeModuleFile=mW});var mOe=M(KS=>{"use strict";m();Object.defineProperty(KS,"__esModule",{value:!0});KS.semconvStabilityFromStr=KS.SemconvStability=void 0;var A3;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(A3=KS.SemconvStability||(KS.SemconvStability={}));function xvt(e,t){let n=A3.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=A3.DUPLICATE;break}else o.toLowerCase()===e&&(n=A3.STABLE);return n}KS.semconvStabilityFromStr=xvt});var gOe=M(ss=>{"use strict";m();Object.defineProperty(ss,"__esModule",{value:!0});ss.semconvStabilityFromStr=ss.SemconvStability=ss.safeExecuteInTheMiddleAsync=ss.safeExecuteInTheMiddle=ss.isWrapped=ss.InstrumentationNodeModuleFile=ss.InstrumentationNodeModuleDefinition=ss.InstrumentationBase=ss.registerInstrumentations=void 0;var Dvt=Uwe();Object.defineProperty(ss,"registerInstrumentations",{enumerable:!0,get:function(){return Dvt.registerInstrumentations}});var Nvt=pW();Object.defineProperty(ss,"InstrumentationBase",{enumerable:!0,get:function(){return Nvt.InstrumentationBase}});var Bvt=pOe();Object.defineProperty(ss,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return Bvt.InstrumentationNodeModuleDefinition}});var wvt=fOe();Object.defineProperty(ss,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return wvt.InstrumentationNodeModuleFile}});var AW=cW();Object.defineProperty(ss,"isWrapped",{enumerable:!0,get:function(){return AW.isWrapped}});Object.defineProperty(ss,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return AW.safeExecuteInTheMiddle}});Object.defineProperty(ss,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return AW.safeExecuteInTheMiddleAsync}});var AOe=mOe();Object.defineProperty(ss,"SemconvStability",{enumerable:!0,get:function(){return AOe.SemconvStability}});Object.defineProperty(ss,"semconvStabilityFromStr",{enumerable:!0,get:function(){return AOe.semconvStabilityFromStr}})});var hOe=M(($Dn,Ovt)=>{Ovt.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 EOe=M(JS=>{"use strict";m();Object.defineProperty(JS,"__esModule",{value:!0});JS.range=JS.balanced=void 0;var kvt=(e,t,n)=>{let r=e instanceof RegExp?_Oe(e,n):e,o=t instanceof RegExp?_Oe(t,n):t,i=r!==null&&o!=null&&(0,JS.range)(r,o,n);return i&&{start:i[0],end:i[1],pre:n.slice(0,i[0]),body:n.slice(i[0]+r.length,i[1]),post:n.slice(i[1]+o.length)}};JS.balanced=kvt;var _Oe=(e,t)=>{let n=t.match(e);return n?n[0]:null},Pvt=(e,t,n)=>{let r,o,i,s,u,l=n.indexOf(e),f=n.indexOf(t,l+1),h=l;if(l>=0&&f>0){if(e===t)return[l,f];for(r=[],i=n.length;h>=0&&!u;){if(h===l)r.push(h),l=n.indexOf(e,h+1);else if(r.length===1){let _=r.pop();_!==void 0&&(u=[_,f])}else o=r.pop(),o!==void 0&&o<i&&(i=o,s=f),f=n.indexOf(t,h+1);h=l<f&&l>=0?l:f}r.length&&s!==void 0&&(u=[i,s])}return u};JS.range=Pvt});var vOe=M(pR=>{"use strict";m();Object.defineProperty(pR,"__esModule",{value:!0});pR.EXPANSION_MAX=void 0;pR.expand=Yvt;var yOe=EOe(),SOe="\0SLASH"+Math.random()+"\0",TOe="\0OPEN"+Math.random()+"\0",hW="\0CLOSE"+Math.random()+"\0",bOe="\0COMMA"+Math.random()+"\0",IOe="\0PERIOD"+Math.random()+"\0",Mvt=new RegExp(SOe,"g"),Lvt=new RegExp(TOe,"g"),Uvt=new RegExp(hW,"g"),Qvt=new RegExp(bOe,"g"),Fvt=new RegExp(IOe,"g"),Gvt=/\\\\/g,jvt=/\\{/g,zvt=/\\}/g,Hvt=/\\,/g,$vt=/\\\./g;pR.EXPANSION_MAX=1e5;function gW(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function qvt(e){return e.replace(Gvt,SOe).replace(jvt,TOe).replace(zvt,hW).replace(Hvt,bOe).replace($vt,IOe)}function Vvt(e){return e.replace(Mvt,"\\").replace(Lvt,"{").replace(Uvt,"}").replace(Qvt,",").replace(Fvt,".")}function COe(e){if(!e)return[""];let t=[],n=(0,yOe.balanced)("{","}",e);if(!n)return e.split(",");let{pre:r,body:o,post:i}=n,s=r.split(",");s[s.length-1]+="{"+o+"}";let u=COe(i);return i.length&&(s[s.length-1]+=u.shift(),s.push.apply(s,u)),t.push.apply(t,s),t}function Yvt(e,t={}){if(!e)return[];let{max:n=pR.EXPANSION_MAX}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Jw(qvt(e),n,!0).map(Vvt)}function Kvt(e){return"{"+e+"}"}function Jvt(e){return/^-?0\d/.test(e)}function Zvt(e,t){return e<=t}function Wvt(e,t){return e>=t}function Jw(e,t,n){let r=[],o=(0,yOe.balanced)("{","}",e);if(!o)return[e];let i=o.pre,s=o.post.length?Jw(o.post,t,!1):[""];if(/\$$/.test(o.pre))for(let u=0;u<s.length&&u<t;u++){let l=i+"{"+o.body+"}"+s[u];r.push(l)}else{let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=u||l,h=o.body.indexOf(",")>=0;if(!f&&!h)return o.post.match(/,(?!,).*\}/)?(e=o.pre+"{"+o.body+hW+o.post,Jw(e,t,!0)):[e];let _;if(f)_=o.body.split(/\.\./);else if(_=COe(o.body),_.length===1&&_[0]!==void 0&&(_=Jw(_[0],t,!1).map(Kvt),_.length===1))return s.map(T=>o.pre+_[0]+T);let y;if(f&&_[0]!==void 0&&_[1]!==void 0){let T=gW(_[0]),v=gW(_[1]),R=Math.max(_[0].length,_[1].length),x=_.length===3&&_[2]!==void 0?Math.max(Math.abs(gW(_[2])),1):1,O=Zvt;v<T&&(x*=-1,O=Wvt);let j=_.some(Jvt);y=[];for(let G=T;O(G,v)&&y.length<t;G+=x){let H;if(l)H=String.fromCharCode(G),H==="\\"&&(H="");else if(H=String(G),j){let V=R-H.length;if(V>0){let ae=new Array(V+1).join("0");G<0?H="-"+ae+H.slice(1):H=ae+H}}y.push(H)}}else{y=[];for(let T=0;T<_.length;T++)y.push.apply(y,Jw(_[T],t,!1))}for(let T=0;T<y.length;T++)for(let v=0;v<s.length&&r.length<t;v++){let R=i+y[T]+s[v];(!n||f||R)&&r.push(R)}}return r}});var ROe=M(g3=>{"use strict";m();Object.defineProperty(g3,"__esModule",{value:!0});g3.assertValidPattern=void 0;var Xvt=1024*64,eRt=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Xvt)throw new TypeError("pattern is too long")};g3.assertValidPattern=eRt});var DOe=M(h3=>{"use strict";m();Object.defineProperty(h3,"__esModule",{value:!0});h3.parseClass=void 0;var tRt={"[: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]},Zw=e=>e.replace(/[[\]\\-]/g,"\\$&"),nRt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),xOe=e=>e.join(""),rRt=(e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],i=n+1,s=!1,u=!1,l=!1,f=!1,h=n,_="";e:for(;i<e.length;){let R=e.charAt(i);if((R==="!"||R==="^")&&i===n+1){f=!0,i++;continue}if(R==="]"&&s&&!l){h=i+1;break}if(s=!0,R==="\\"&&!l){l=!0,i++;continue}if(R==="["&&!l){for(let[x,[O,P,j]]of Object.entries(tRt))if(e.startsWith(x,i)){if(_)return["$.",!1,e.length-n,!0];i+=x.length,j?o.push(O):r.push(O),u=u||P;continue e}}if(l=!1,_){R>_?r.push(Zw(_)+"-"+Zw(R)):R===_&&r.push(Zw(R)),_="",i++;continue}if(e.startsWith("-]",i+1)){r.push(Zw(R+"-")),i+=2;continue}if(e.startsWith("-",i+1)){_=R,i+=2;continue}r.push(Zw(R)),i++}if(h<i)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,e.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!f){let R=r[0].length===2?r[0].slice(-1):r[0];return[nRt(R),!1,h-n,!1]}let y="["+(f?"^":"")+xOe(r)+"]",T="["+(f?"":"^")+xOe(o)+"]";return[r.length&&o.length?"("+y+"|"+T+")":r.length?y:T,u,h-n,!0]};h3.parseClass=rRt});var E3=M(_3=>{"use strict";m();Object.defineProperty(_3,"__esModule",{value:!0});_3.unescape=void 0;var oRt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");_3.unescape=oRt});var yW=M(b3=>{"use strict";m();var Kc;Object.defineProperty(b3,"__esModule",{value:!0});b3.AST=void 0;var iRt=DOe(),y3=E3(),sRt=new Set(["!","?","+","*","@"]),_W=e=>sRt.has(e),NOe=e=>_W(e.type),aRt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),uRt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cRt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),BOe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),lRt="(?!(?:^|/)\\.\\.?(?:$|/))",S3="(?!\\.)",dRt=new Set(["[","."]),pRt=new Set(["..","."]),fRt=new Set("().*{}+?[]^$\\!"),mRt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),EW="[^/]",wOe=EW+"*?",OOe=EW+"+?",ARt=0,T3=class{type;#n;#r;#o=!1;#e=[];#t;#a;#c;#u=!1;#i;#s;#l=!1;id=++ARt;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(t,n,r={}){this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#c=this.#n===this?[]:this.#n.#c,t==="!"&&!this.#n.#u&&this.#c.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#s!==void 0?this.#s:this.type?this.#s=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#s=this.#e.map(t=>String(t)).join("")}#h(){if(this!==this.#n)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#c.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let o=n.#a+1;!r.type&&o<r.#e.length;o++)for(let i of t.#e){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof Kc&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let t=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&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#u&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let t=this.#t;for(let n=0;n<this.#a;n++){let r=t.#e[n];if(!(r instanceof Kc&&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 t=this.#t?this.#t.#e.length:0;return this.#a===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new Kc(this.type,t);for(let r of this.#e)n.copyIn(r);return n}static#d(t,n,r,o,i){let s=o.maxExtglobRecursion??2,u=!1,l=!1,f=-1,h=!1;if(n.type===null){let R=r,x="";for(;R<t.length;){let O=t.charAt(R++);if(u||O==="\\"){u=!u,x+=O;continue}if(l){R===f+1?(O==="^"||O==="!")&&(h=!0):O==="]"&&!(R===f+2&&h)&&(l=!1),x+=O;continue}else if(O==="["){l=!0,f=R,h=!1,x+=O;continue}if(!o.noext&&_W(O)&&t.charAt(R)==="("&&i<=s){n.push(x),x="";let j=new Kc(O,n);R=Kc.#d(t,j,R,o,i+1),n.push(j);continue}x+=O}return n.push(x),R}let _=r+1,y=new Kc(null,n),T=[],v="";for(;_<t.length;){let R=t.charAt(_++);if(u||R==="\\"){u=!u,v+=R;continue}if(l){_===f+1?(R==="^"||R==="!")&&(h=!0):R==="]"&&!(_===f+2&&h)&&(l=!1),v+=R;continue}else if(R==="["){l=!0,f=_,h=!1,v+=R;continue}if(!o.noext&&_W(R)&&t.charAt(_)==="("&&(i<=s||n&&n.#p(R))){let O=n&&n.#p(R)?0:1;y.push(v),v="";let P=new Kc(R,y);y.push(P),_=Kc.#d(t,P,_,o,i+O);continue}if(R==="|"){y.push(v),v="",T.push(y),y=new Kc(null,n);continue}if(R===")")return v===""&&n.#e.length===0&&(n.#l=!0),y.push(v),v="",n.push(...T,y),_;v+=R}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],_}#_(t){return this.#m(t,uRt)}#m(t,n=aRt){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null)return!1;let r=t.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#p(r.type,n)}#p(t,n=cRt){return!!n.get(this.type)?.includes(t)}#E(t,n){let r=t.#e[0],o=new Kc(null,r,this.options);o.#e.push(""),r.push(o),this.#A(t,n)}#A(t,n){let r=t.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#s=void 0}#y(t){return!!BOe.get(this.type)?.has(t)}#S(t){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=t.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#y(n.type)}#T(t){let n=BOe.get(this.type),r=t.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let i of this.#e)typeof i=="object"&&(i.#t=this);this.type=o,this.#s=void 0,this.#l=!1}static fromGlob(t,n={}){let r=new Kc(null,void 0,n);return Kc.#d(t,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let u=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,u),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){let n=t??!!this.#i.dot;if(this.#n===this&&(this.#f(),this.#h()),!NOe(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(T=>typeof T!="string"),f=this.#e.map(T=>{let[v,R,x,O]=typeof T=="string"?Kc.#b(T,this.#r,l):T.toRegExpSource(t);return this.#r=this.#r||x,this.#o=this.#o||O,v}).join(""),h="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&pRt.has(this.#e[0]))){let v=dRt,R=n&&v.has(f.charAt(0))||f.startsWith("\\.")&&v.has(f.charAt(2))||f.startsWith("\\.\\.")&&v.has(f.charAt(4)),x=!n&&!t&&v.has(f.charAt(0));h=R?lRt:x?S3:""}let _="";return this.isEnd()&&this.#n.#u&&this.#t?.type==="!"&&(_="(?:$|\\/)"),[h+f+_,(0,y3.unescape)(f),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#g(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let l=this.toString(),f=this;return f.#e=[l],f.type=null,f.#r=void 0,[l,(0,y3.unescape)(this.toString()),!1,!1]}let s=!r||t||n||!S3?"":this.#g(!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let u="";if(this.type==="!"&&this.#l)u=(this.isStart()&&!n?S3:"")+OOe;else{let l=this.type==="!"?"))"+(this.isStart()&&!n&&!t?S3:"")+wOe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;u=o+i+l}return[u,(0,y3.unescape)(i),this.#r=!!this.#r,this.#o]}#f(){if(NOe(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#f(),this.#m(o)?(n=!1,this.#A(o,r)):this.#_(o)?(n=!1,this.#E(o,r)):this.#S(o)&&(n=!1,this.#T(o)))}}while(!n&&++t<10)}else for(let t of this.#e)typeof t=="object"&&t.#f();this.#s=void 0}#g(t){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,i,s]=n.toRegExpSource(t);return this.#o=this.#o||s,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#b(t,n,r=!1){let o=!1,i="",s=!1,u=!1;for(let l=0;l<t.length;l++){let f=t.charAt(l);if(o){o=!1,i+=(fRt.has(f)?"\\":"")+f;continue}if(f==="*"){if(u)continue;u=!0,i+=r&&/^[*]+$/.test(t)?OOe:wOe,n=!0;continue}else u=!1;if(f==="\\"){l===t.length-1?i+="\\\\":o=!0;continue}if(f==="["){let[h,_,y,T]=(0,iRt.parseClass)(t,l);if(y){i+=h,s=s||_,l+=y-1,n=n||T;continue}}if(f==="?"){i+=EW,n=!0;continue}i+=mRt(f)}return[i,(0,y3.unescape)(t),!!n,s]}};b3.AST=T3;Kc=T3});var SW=M(I3=>{"use strict";m();Object.defineProperty(I3,"__esModule",{value:!0});I3.escape=void 0;var gRt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");I3.escape=gRt});var FOe=M(gt=>{"use strict";m();Object.defineProperty(gt,"__esModule",{value:!0});gt.unescape=gt.escape=gt.AST=gt.Minimatch=gt.match=gt.makeRe=gt.braceExpand=gt.defaults=gt.filter=gt.GLOBSTAR=gt.sep=gt.minimatch=void 0;var hRt=vOe(),C3=ROe(),MOe=yW(),_Rt=SW(),ERt=E3(),yRt=(e,t,n={})=>((0,C3.assertValidPattern)(t),!n.nocomment&&t.charAt(0)==="#"?!1:new ZS(t,n).match(e));gt.minimatch=yRt;var SRt=/^\*+([^+@!?\*\[\(]*)$/,TRt=e=>t=>!t.startsWith(".")&&t.endsWith(e),bRt=e=>t=>t.endsWith(e),IRt=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),CRt=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),vRt=/^\*+\.\*+$/,RRt=e=>!e.startsWith(".")&&e.includes("."),xRt=e=>e!=="."&&e!==".."&&e.includes("."),DRt=/^\.\*+$/,NRt=e=>e!=="."&&e!==".."&&e.startsWith("."),BRt=/^\*+$/,wRt=e=>e.length!==0&&!e.startsWith("."),ORt=e=>e.length!==0&&e!=="."&&e!=="..",kRt=/^\?+([^+@!?\*\[\(]*)?$/,PRt=([e,t=""])=>{let n=LOe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},MRt=([e,t=""])=>{let n=UOe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},LRt=([e,t=""])=>{let n=UOe([e]);return t?r=>n(r)&&r.endsWith(t):n},URt=([e,t=""])=>{let n=LOe([e]);return t?r=>n(r)&&r.endsWith(t):n},LOe=([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},UOe=([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},QOe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",kOe={win32:{sep:"\\"},posix:{sep:"/"}};gt.sep=QOe==="win32"?kOe.win32.sep:kOe.posix.sep;gt.minimatch.sep=gt.sep;gt.GLOBSTAR=Symbol("globstar **");gt.minimatch.GLOBSTAR=gt.GLOBSTAR;var QRt="[^/]",FRt=QRt+"*?",GRt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",jRt="(?:(?!(?:\\/|^)\\.).)*?",zRt=(e,t={})=>n=>(0,gt.minimatch)(n,e,t);gt.filter=zRt;gt.minimatch.filter=gt.filter;var ip=(e,t={})=>Object.assign({},e,t),HRt=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return gt.minimatch;let t=gt.minimatch;return Object.assign((r,o,i={})=>t(r,o,ip(e,i)),{Minimatch:class extends t.Minimatch{constructor(o,i={}){super(o,ip(e,i))}static defaults(o){return t.defaults(ip(e,o)).Minimatch}},AST:class extends t.AST{constructor(o,i,s={}){super(o,i,ip(e,s))}static fromGlob(o,i={}){return t.AST.fromGlob(o,ip(e,i))}},unescape:(r,o={})=>t.unescape(r,ip(e,o)),escape:(r,o={})=>t.escape(r,ip(e,o)),filter:(r,o={})=>t.filter(r,ip(e,o)),defaults:r=>t.defaults(ip(e,r)),makeRe:(r,o={})=>t.makeRe(r,ip(e,o)),braceExpand:(r,o={})=>t.braceExpand(r,ip(e,o)),match:(r,o,i={})=>t.match(r,o,ip(e,i)),sep:t.sep,GLOBSTAR:gt.GLOBSTAR})};gt.defaults=HRt;gt.minimatch.defaults=gt.defaults;var $Rt=(e,t={})=>((0,C3.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,hRt.expand)(e,{max:t.braceExpandMax}));gt.braceExpand=$Rt;gt.minimatch.braceExpand=gt.braceExpand;var qRt=(e,t={})=>new ZS(e,t).makeRe();gt.makeRe=qRt;gt.minimatch.makeRe=gt.makeRe;var VRt=(e,t,n={})=>{let r=new ZS(t,n);return e=e.filter(o=>r.match(o)),r.options.nonull&&!e.length&&e.push(t),e};gt.match=VRt;gt.minimatch.match=gt.match;var POe=/[?*]|[+@!]\(.*?\)|\[|\]/,YRt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ZS=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){(0,C3.assertValidPattern)(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||QOe,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 t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,s,u)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=i[0]===""&&i[1]===""&&(i[2]==="?"||!POe.test(i[2]))&&!POe.test(i[3]),f=/^[a-z]:/i.test(i[0]);if(l)return[...i.slice(0,4),...i.slice(4).map(h=>this.parse(h))];if(f)return[i[0],...i.slice(1).map(h=>this.parse(h))]}return i.map(l=>this.parse(l))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let o=0;o<t[r].length;o++)t[r][o]==="**"&&(t[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.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(t){return t.map(n=>(n=n.reduce((r,o)=>{let i=r[r.length-1];return o==="**"&&i==="**"?r:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){let i=t[o];o===1&&i===""&&t[0]===""||(i==="."||i==="")&&(n=!0,t.splice(o,1),o--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let o=t[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let s=o;for(;r[s+1]==="**";)s++;s>o&&r.splice(o+1,s-o);let u=r[o+1],l=r[o+2],f=r[o+3];if(u!==".."||!l||l==="."||l===".."||!f||f==="."||f==="..")continue;n=!0,r.splice(o,1);let h=r.slice(0);h[o]="**",t.push(h),o--}if(!this.preserveMultipleSlashes){for(let s=1;s<r.length-1;s++){let u=r[s];s===1&&u===""&&r[0]===""||(u==="."||u==="")&&(n=!0,r.splice(s,1),s--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let s=r[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;let l=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...l),r.length===0&&r.push(""),i-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let o=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(o){t[n]=[],t[r]=o;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let o=0,i=0,s=[],u="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])s.push(u==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])s.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])s.push(n[i]),i++;else if(t[o]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(u==="b")return!1;u="a",s.push(t[o]),o++,i++}else if(n[i]==="*"&&t[o]&&(this.options.dot||!t[o].startsWith("."))&&t[o]!=="**"){if(u==="a")return!1;u="b",s.push(n[i]),o++,i++}else return!1;return t.length===n.length&&s}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let o=0,i=0;if(this.isWindows){let u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),f=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),h=!f&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),_=l?3:u?0:void 0,y=h?3:f?0:void 0;if(typeof _=="number"&&typeof y=="number"){let[T,v]=[t[_],n[y]];T.toLowerCase()===v.toLowerCase()&&(n[y]=T,i=y,o=_)}}let{optimizationLevel:s=1}=this.options;return s>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(gt.GLOBSTAR)?this.#n(t,n,r,o,i):this.#o(t,n,r,o,i)}#n(t,n,r,o,i){let s=n.indexOf(gt.GLOBSTAR,i),u=n.lastIndexOf(gt.GLOBSTAR),[l,f,h]=r?[n.slice(i,s),n.slice(s+1),[]]:[n.slice(i,s),n.slice(s+1,u),n.slice(u+1)];if(l.length){let P=t.slice(o,o+l.length);if(!this.#o(P,l,r,0,0))return!1;o+=l.length,i+=l.length}let _=0;if(h.length){if(h.length+o>t.length)return!1;let P=t.length-h.length;if(this.#o(t,h,r,P,0))_=h.length;else{if(t[t.length-1]!==""||o+h.length===t.length||(P--,!this.#o(t,h,r,P,0)))return!1;_=h.length+1}}if(!f.length){let P=!!_;for(let j=o;j<t.length-_;j++){let G=String(t[j]);if(P=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||P}let y=[[[],0]],T=y[0],v=0,R=[0];for(let P of f)P===gt.GLOBSTAR?(R.push(v),T=[[],0],y.push(T)):(T[0].push(P),v++);let x=y.length-1,O=t.length-_;for(let P of y)P[1]=O-(R[x--]+P[0].length);return!!this.#r(t,y,o,0,r,0,!!_)}#r(t,n,r,o,i,s,u){let l=n[o];if(!l){for(let _=r;_<t.length;_++){u=!0;let y=t[_];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1}return u}let[f,h]=l;for(;r<=h;){if(this.#o(t.slice(0,r+f.length),f,i,r,0)&&s<this.maxGlobstarRecursion){let T=this.#r(t,n,r+f.length,o+1,i,s+1,u);if(T!==!1)return T}let y=t[r];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1;r++}return i||null}#o(t,n,r,o,i){let s,u,l,f;for(s=o,u=i,f=t.length,l=n.length;s<f&&u<l;s++,u++){this.debug("matchOne loop");let h=n[u],_=t[s];if(this.debug(n,h,_),h===!1||h===gt.GLOBSTAR)return!1;let y;if(typeof h=="string"?(y=_===h,this.debug("string match",h,_,y)):(y=h.test(_),this.debug("pattern match",h,_,y)),!y)return!1}if(s===f&&u===l)return!0;if(s===f)return r;if(u===l)return s===f-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return(0,gt.braceExpand)(this.pattern,this.options)}parse(t){(0,C3.assertValidPattern)(t);let n=this.options;if(t==="**")return gt.GLOBSTAR;if(t==="")return"";let r,o=null;(r=t.match(BRt))?o=n.dot?ORt:wRt:(r=t.match(SRt))?o=(n.nocase?n.dot?CRt:IRt:n.dot?bRt:TRt)(r[1]):(r=t.match(kRt))?o=(n.nocase?n.dot?MRt:PRt:n.dot?LRt:URt)(r):(r=t.match(vRt))?o=n.dot?xRt:RRt:(r=t.match(DRt))&&(o=NRt);let i=MOe.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?FRt:n.dot?GRt:jRt,o=new Set(n.nocase?["i"]:[]),i=t.map(l=>{let f=l.map(_=>{if(_ instanceof RegExp)for(let y of _.flags.split(""))o.add(y);return typeof _=="string"?YRt(_):_===gt.GLOBSTAR?gt.GLOBSTAR:_._src});f.forEach((_,y)=>{let T=f[y+1],v=f[y-1];_!==gt.GLOBSTAR||v===gt.GLOBSTAR||(v===void 0?T!==void 0&&T!==gt.GLOBSTAR?f[y+1]="(?:\\/|"+r+"\\/)?"+T:f[y]=r:T===void 0?f[y-1]=v+"(?:\\/|\\/"+r+")?":T!==gt.GLOBSTAR&&(f[y-1]=v+"(?:\\/|\\/"+r+"\\/)"+T,f[y+1]=gt.GLOBSTAR))});let h=f.filter(_=>_!==gt.GLOBSTAR);if(this.partial&&h.length>=1){let _=[];for(let y=1;y<=h.length;y++)_.push(h.slice(0,y).join("/"));return"(?:"+_.join("|")+")"}return h.join("/")}).join("|"),[s,u]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+u+"$",this.partial&&(i="^(?:\\/|"+s+i.slice(1,-1)+u+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let o=this.slashSplit(t);this.debug(this.pattern,"split",o);let i=this.set;this.debug(this.pattern,"set",i);let s=o[o.length-1];if(!s)for(let u=o.length-2;!s&&u>=0;u--)s=o[u];for(let u=0;u<i.length;u++){let l=i[u],f=o;if(r.matchBase&&l.length===1&&(f=[s]),this.matchOne(f,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return gt.minimatch.defaults(t).Minimatch}};gt.Minimatch=ZS;var KRt=yW();Object.defineProperty(gt,"AST",{enumerable:!0,get:function(){return KRt.AST}});var JRt=SW();Object.defineProperty(gt,"escape",{enumerable:!0,get:function(){return JRt.escape}});var ZRt=E3();Object.defineProperty(gt,"unescape",{enumerable:!0,get:function(){return ZRt.unescape}});gt.minimatch.AST=MOe.AST;gt.minimatch.Minimatch=ZS;gt.minimatch.escape=_Rt.escape;gt.minimatch.unescape=ERt.unescape});var VOe=M((l1n,IW)=>{"use strict";m();var GOe=Ue("node:diagnostics_channel"),{context:v3,trace:TW,SpanStatusCode:R3,propagation:bW,diag:WRt}=(He(),Me(tt)),{getRPCMetadata:XRt,RPCType:ext}=vr(),{ATTR_HTTP_ROUTE:x3,ATTR_HTTP_RESPONSE_STATUS_CODE:jOe,ATTR_HTTP_REQUEST_METHOD:txt,ATTR_URL_PATH:nxt}=(Xn(),Me(Hr)),{InstrumentationBase:rxt}=gOe(),{version:oxt,name:zOe}=hOe(),ixt=">=4.0.0 <6",HOe=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],Io={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},gE={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Yg="anonymous",hE=Symbol("fastify otel instance"),_E=Symbol("fastify otel request spans"),Ww=Symbol("fastify otel request context"),$Oe=Symbol("fastify otel addhook original"),qOe=Symbol("fastify otel setnotfound original"),Xw=Symbol("fastify otel ignore path"),eO=Symbol("fastify otel record exceptions"),D3=class extends rxt{logger=null;_requestHook=null;_lifecycleHook=null;constructor(t){if(super(zOe,oxt,t),this.logger=WRt.createComponentLogger({namespace:zOe}),this[Xw]=null,this[eO]=!0,t?.recordExceptions!=null){if(typeof t.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[eO]=t.recordExceptions}if(typeof t?.requestHook=="function"&&(this._requestHook=t.requestHook),typeof t?.lifecycleHook=="function"&&(this._lifecycleHook=t.lifecycleHook),t?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=t?.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[Xw]=o=>typeof n=="function"?n(o):(r==null&&(r=FOe().minimatch),r(o.url,n))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=t=>{this.plugin()(t.fastify,void 0,()=>{});let n=(r,o,i)=>{i()};n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",t.fastify.register(n)},GOe.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(GOe.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let t=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:ixt,name:"@fastify/otel"},n;function n(r,o,i){r.decorate(hE,t),r.decorate($Oe,r.addHook),r.decorate(qOe,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let T=this[Ww],v=this[_E];return{enabled:this.routeOptions.config?.otel!==!1,span:v,tracer:t.tracer,context:T,inject:(R,x)=>bW.inject(T,R,x),extract:(R,x)=>bW.extract(T,R,x)}}),r.decorateRequest(_E,null),r.decorateRequest(Ww,null),r.addHook("onRoute",function(T){if(t[Xw]?.(T)===!0){t.logger.debug(`Ignoring route instrumentation ${T.method} ${T.url} because it matches the ignore path`);return}if(T.config?.otel===!1){t.logger.debug(`Ignoring route instrumentation ${T.method} ${T.url} because it is disabled`);return}for(let v of HOe)if(T[v]!=null){let R=T[v];if(typeof R=="function")T[v]=_(R,v,{[Io.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[Io.FASTIFY_TYPE]:gE.ROUTE,[x3]:T.url,[Io.HOOK_CALLBACK_NAME]:R.name?.length>0?R.name:Yg});else if(Array.isArray(R)){let x=[];for(let O of R)x.push(_(O,v,{[Io.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[Io.FASTIFY_TYPE]:gE.ROUTE,[x3]:T.url,[Io.HOOK_CALLBACK_NAME]:O.name?.length>0?O.name:Yg}));T[v]=x}}T.onSend!=null?T.onSend=Array.isArray(T.onSend)?[...T.onSend,s]:[T.onSend,s]:T.onSend=s,T.onError!=null?T.onError=Array.isArray(T.onError)?[...T.onError,u]:[T.onError,u]:T.onError=u,T.handler=_(T.handler,"handler",{[Io.HOOK_NAME]:`${this.pluginName} - route-handler`,[Io.FASTIFY_TYPE]:gE.HANDLER,[x3]:T.url,[Io.HOOK_CALLBACK_NAME]:T.handler.name.length>0?T.handler.name:Yg})}),r.addHook("onRequest",function(T,v,R){if(this[hE].isEnabled()===!1||T.routeOptions.config?.otel===!1)return R();if(this[hE][Xw]?.({url:T.url,method:T.method})===!0)return this[hE].logger.debug(`Ignoring request ${T.method} ${T.url} because it matches the ignore path`),R();let x=v3.active();TW.getSpan(x)==null&&(x=bW.extract(x,T.headers));let O=XRt(x);T.routeOptions.url!=null&&O?.type===ext.HTTP&&(O.route=T.routeOptions.url);let P={[Io.ROOT]:"@fastify/otel",[txt]:T.method,[nxt]:T.url};T.routeOptions.url!=null&&(P[x3]=T.routeOptions.url);let j=this[hE].tracer.startSpan("request",{attributes:P},x);try{this[hE]._requestHook?.(j,T)}catch(G){this[hE].logger.error({err:G},"requestHook threw")}T[Ww]=TW.setSpan(x,j),T[_E]=j,v3.with(T[Ww],()=>{R()})}),r.addHook("onResponse",function(T,v,R){let x=T[_E];x!=null&&(x.setAttributes({[jOe]:v.statusCode}),x.end()),T[_E]=null,R()}),r.addHook=l,r.setNotFoundHandler=f,i();function s(y,T,v,R){let x=y[_E];x!=null&&(T.statusCode>=500&&x.setStatus({code:R3.ERROR}),x.setAttributes({[jOe]:T.statusCode}),x.end()),y[_E]=null,R(null,v)}function u(y,T,v,R){let x=y[_E];x!=null&&(x.setStatus({code:R3.ERROR,message:v.message}),t[eO]!==!1&&x.recordException(v)),R()}function l(y,T){let v=this[$Oe];return HOe.includes(y)?v.call(this,y,_(T,y,{[Io.HOOK_NAME]:`${this.pluginName} - ${y}`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:Yg})):v.call(this,y,T)}function f(y,T){let v=this[qOe];typeof y=="function"?(T=_(y,"notFoundHandler",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:y.name?.length>0?y.name:Yg}),v.call(this,T)):(y.preValidation!=null&&(y.preValidation=_(y.preValidation,"notFoundHandler - preValidation",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:y.preValidation.name?.length>0?y.preValidation.name:Yg})),y.preHandler!=null&&(y.preHandler=_(y.preHandler,"notFoundHandler - preHandler",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:y.preHandler.name?.length>0?y.preHandler.name:Yg})),T=_(T,"notFoundHandler",{[Io.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Io.FASTIFY_TYPE]:gE.INSTANCE,[Io.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:Yg}),v.call(this,y,T))}function h(y){for(let T of y)if(T?.routeOptions&&T.url&&T.method)return T;return null}function _(y,T,v={}){return function(...x){let O=this[hE],P=h(x);if(P===null)return O.logger.debug(`Ignoring route instrumentation because ${T} was called without a Fastify request argument`),y.call(this,...x);if(O.isEnabled()===!1||P.routeOptions.config?.otel===!1)return O.logger.debug(`Ignoring route instrumentation ${P.routeOptions.method} ${P.routeOptions.url} because it is disabled`),y.call(this,...x);if(O[Xw]?.({url:P.url,method:P.method})===!0)return O.logger.debug(`Ignoring route instrumentation ${P.routeOptions.method} ${P.routeOptions.url} because it matches the ignore path`),y.call(this,...x);let j=P[Ww]??v3.active(),G=y.name?.length>0?y.name:this.pluginName??Yg,H=O.tracer.startSpan(`${T} - ${G}`,{attributes:v},j);if(O._lifecycleHook!=null)try{O._lifecycleHook(H,{hookName:T,request:P,handler:G})}catch(V){O.logger.error({err:V},"Execution of lifecycleHook failed")}return v3.with(TW.setSpan(j,H),function(){try{let V=y.call(this,...x);return typeof V?.then=="function"?V.then(ae=>(H.end(),ae),ae=>(H.setStatus({code:R3.ERROR,message:ae.message}),O[eO]!==!1&&H.recordException(ae),H.end(),Promise.reject(ae))):(H.end(),V)}catch(V){throw H.setStatus({code:R3.ERROR,message:V.message}),O[eO]!==!1&&H.recordException(V),H.end(),V}},this)}}}}};IW.exports=D3;IW.exports.FastifyOtelInstrumentation=D3});var Kg,tO,nO,YOe=w(()=>{m();(function(e){let t="fastify.name";e.FASTIFY_NAME=t;let n="fastify.type";e.FASTIFY_TYPE=n;let r="hook.name";e.HOOK_NAME=r;let o="plugin.name";e.PLUGIN_NAME=o})(Kg||(Kg={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request_handler";e.REQUEST_HANDLER=n})(tO||(tO={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request handler";e.REQUEST_HANDLER=n})(nO||(nO={}))});var rO,KOe=w(()=>{m();rO=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function CW(e,t,n,r={}){let o=t.startSpan(n,{attributes:r}),i=e[rO]||[];return i.push(o),Object.defineProperty(e,rO,{enumerable:!1,configurable:!0,value:i}),o}function N3(e,t){let n=e[rO]||[];n.length&&(n.forEach(r=>{t&&(r.setStatus({code:Ai.ERROR,message:t.message}),r.recordException(t)),r.end()}),delete e[rO])}function ZOe(e,t,n){let r,o;try{o=e(),JOe(o)&&o.then(i=>t(void 0,i),i=>t(i))}catch(i){r=i}finally{if(!JOe(o)&&(t(r,o),r))throw r;return o}}function JOe(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var WOe=w(()=>{m();He();KOe()});function cxt(){let e=Et();e&&e.on("spanStart",t=>{eke(t)})}function eke(e){let t=kt(e).data,n=t["fastify.type"];if(t[Xt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.fastify",[Xt]:`${n}.fastify`});let r=t["fastify.name"]||t["plugin.name"]||t["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(o)}}var w3,WS,sxt,axt,XOe,uxt,B3,tke=w(()=>{m();He();w3=ue(vr(),1),WS=ue(un(),1);Xn();At();YOe();WOe();sxt="0.1.0",axt="@sentry/instrumentation-fastify-v3",XOe="anonymous",uxt=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),B3=class extends WS.InstrumentationBase{constructor(t={}){super(axt,sxt,t)}init(){return[new WS.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_hookOnRequest(){let t=this;return function(r,o,i){if(!t.isEnabled())return i();t._wrap(o,"send",t._patchSend());let s=r,u=(0,w3.getRPCMetadata)(We.active()),l=s.routeOptions?s.routeOptions.url:r.routerPath;l&&u?.type===w3.RPCType.HTTP&&(u.route=l);let f=r.method||"GET";Rn().setTransactionName(`${f} ${l}`),i()}}_wrapHandler(t,n,r,o){let i=this;return this._diag.debug("Patching fastify route.handler function"),function(...s){if(!i.isEnabled())return r.apply(this,s);let u=r.name||t||XOe,l=`${nO.MIDDLEWARE} - ${u}`,f=s[1],h=CW(f,i.tracer,l,{[Kg.FASTIFY_TYPE]:tO.MIDDLEWARE,[Kg.PLUGIN_NAME]:t,[Kg.HOOK_NAME]:n}),_=o&&s[s.length-1];return _&&(s[s.length-1]=function(...y){N3(f),_.apply(this,y)}),We.with(Vt.setSpan(We.active(),h),()=>ZOe(()=>r.apply(this,s),y=>{y instanceof Error&&(h.setStatus({code:Ai.ERROR,message:y.message}),h.recordException(y)),o||N3(f)}))}}_wrapAddHook(){let t=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let i=o[0],s=o[1],u=this.pluginName;if(!uxt.has(i))return n.apply(this,o);let l=typeof o[o.length-1]=="function"&&s.constructor.name!=="AsyncFunction";return n.apply(this,[i,t._wrapHandler(u,i,s,l)])}}}_patchConstructor(t){let n=this;function r(...o){let i=t.fastify.apply(this,o);return i.addHook("onRequest",n._hookOnRequest()),i.addHook("preHandler",n._hookPreHandler()),cxt(),n._wrap(i,"addHook",n._wrapAddHook()),i}return t.errorCodes!==void 0&&(r.errorCodes=t.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let t=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...i){let s=i[0];return t.isEnabled()?(0,WS.safeExecuteInTheMiddle)(()=>r.apply(this,i),u=>{!u&&s instanceof Error&&(u=s),N3(this,u)}):r.apply(this,i)}}}_hookPreHandler(){let t=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,i){if(!t.isEnabled())return i();let s=r,u=s.routeOptions?.handler||s.context?.handler,l=u?.name.startsWith("bound ")?u.name.substring(6):u?.name,f=`${nO.REQUEST_HANDLER} - ${l||this.pluginName||XOe}`,h={[Kg.PLUGIN_NAME]:this.pluginName,[Kg.FASTIFY_TYPE]:tO.REQUEST_HANDLER,[mV]:s.routeOptions?s.routeOptions.url:r.routerPath};l&&(h[Kg.FASTIFY_NAME]=l);let _=CW(o,t.tracer,f,h);eke(_);let{requestHook:y}=t.getConfig();return y&&(0,WS.safeExecuteInTheMiddle)(()=>y(_,{request:r}),T=>{T&&t._diag.error("request hook failed",T)},!0),We.with(Vt.setSpan(We.active(),_),()=>{i()})}}}});import*as vW from"node:diagnostics_channel";function lxt(){let e=Et();if(e)return e.getIntegrationByName(O3)}function nke(e,t,n,r){let o=lxt()?.getShouldHandleError()||ake;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){Ds&&W.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(e,t,n)&&rn(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function ake(e,t,n){let r=n.statusCode;return r>=500||r<=299}function uke(e){let t=kt(e),n=t.description,r=t.data,o=r["fastify.type"],i=o==="hook",s=o===n?.startsWith("handler -"),u=n==="request"||o==="request-handler";if(r[Xt]||!s&&!u&&!i)return;let l=i?"hook":s?"middleware":u?"request_handler":"<unknown>";e.setAttributes({[Mt]:"auto.http.otel.fastify",[Xt]:`${l}.fastify`});let f=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof f=="string"){let h=f.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(h)}}function pxt(){let e=Et();e&&e.on("spanStart",t=>{uke(t)})}function fxt(e){e.addHook("onRequest",async(t,n)=>{if(t.opentelemetry){let{span:i}=t.opentelemetry();i&&uke(i)}let r=t.routeOptions?.url,o=t.method||"GET";Rn().setTransactionName(`${o} ${r}`)})}var rke,O3,oke,ike,dxt,ske,cke=w(()=>{m();rke=ue(VOe(),1);At();_r();YS();tke();O3="Fastify",oke=ct(`${O3}.v3`,()=>new B3);ike=ct(`${O3}.v5`,()=>{let e=new rke.FastifyOtelInstrumentation,t=e.plugin();return vW.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(t).after(o=>{o?Ds&&W.error("Failed to setup Fastify instrumentation",o):(pxt(),r&&fxt(r))})}),vW.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:i}=n;nke.call(nke,r,o,i,"diagnostics-channel")}),e}),dxt=(({shouldHandleError:e})=>{let t;return{name:O3,setupOnce(){t=e||ake,oke(),ike()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}}),ske=(e={})=>dxt(e)});var RW=M(Rf=>{"use strict";m();Object.defineProperty(Rf,"__esModule",{value:!0});Rf.SpanNames=Rf.TokenKind=Rf.AllowedOperationTypes=void 0;var mxt;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(mxt=Rf.AllowedOperationTypes||(Rf.AllowedOperationTypes={}));var Axt;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(Axt=Rf.TokenKind||(Rf.TokenKind={}));var gxt;(function(e){e.EXECUTE="graphql.execute",e.PARSE="graphql.parse",e.RESOLVE="graphql.resolve",e.VALIDATE="graphql.validate",e.SCHEMA_VALIDATE="graphql.validateSchema",e.SCHEMA_PARSE="graphql.parseSchema"})(gxt=Rf.SpanNames||(Rf.SpanNames={}))});var xW=M(oO=>{"use strict";m();Object.defineProperty(oO,"__esModule",{value:!0});oO.AttributeNames=void 0;var hxt;(function(e){e.SOURCE="graphql.source",e.FIELD_NAME="graphql.field.name",e.FIELD_PATH="graphql.field.path",e.FIELD_TYPE="graphql.field.type",e.PARENT_NAME="graphql.parent.name",e.OPERATION_TYPE="graphql.operation.type",e.OPERATION_NAME="graphql.operation.name",e.VARIABLES="graphql.variables.",e.ERROR_VALIDATION_NAME="graphql.validation.error"})(hxt=oO.AttributeNames||(oO.AttributeNames={}))});var k3=M(fR=>{"use strict";m();Object.defineProperty(fR,"__esModule",{value:!0});fR.OTEL_GRAPHQL_DATA_SYMBOL=fR.OTEL_PATCHED_SYMBOL=void 0;fR.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");fR.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var lke=M(P3=>{"use strict";m();Object.defineProperty(P3,"__esModule",{value:!0});P3.OPERATION_NOT_SUPPORTED=void 0;var Q1n=k3();P3.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var Ike=M(Ns=>{"use strict";m();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.wrapFieldResolver=Ns.wrapFields=Ns.getSourceFromLocation=Ns.getOperation=Ns.endSpan=Ns.addSpanSource=Ns.addInputVariableAttributes=Ns.isPromise=void 0;var mR=(He(),Me(tt)),EE=RW(),XS=xW(),Jg=k3(),dke=Object.values(EE.AllowedOperationTypes),_xt=e=>typeof e?.then=="function";Ns.isPromise=_xt;var Ext=e=>typeof e=="object"&&e!==null;function DW(e,t,n){Array.isArray(n)?n.forEach((r,o)=>{DW(e,`${t}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{DW(e,`${t}.${r}`,o)}):e.setAttribute(`${XS.AttributeNames.VARIABLES}${String(t)}`,n)}function yxt(e,t){Object.entries(t).forEach(([n,r])=>{DW(e,n,r)})}Ns.addInputVariableAttributes=yxt;function Ake(e,t,n,r,o){let i=yke(t,n,r,o);e.setAttribute(XS.AttributeNames.SOURCE,i)}Ns.addSpanSource=Ake;function Sxt(e,t,n,r,o){let i=gke(n,o);if(i)return{field:i,spanAdded:!1};let u=t().flatResolveSpans?_ke(n):hke(n,o);return i={span:Txt(e,t,n,r,o,u)},Cxt(n,o,i),{field:i,spanAdded:!0}}function Txt(e,t,n,r,o,i){let s={[XS.AttributeNames.FIELD_NAME]:r.fieldName,[XS.AttributeNames.FIELD_PATH]:o.join("."),[XS.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[XS.AttributeNames.PARENT_NAME]:r.parentType.name},u=e.startSpan(`${EE.SpanNames.RESOLVE} ${s[XS.AttributeNames.FIELD_PATH]}`,{attributes:s},i?mR.trace.setSpan(mR.context.active(),i):void 0),l=n[Jg.OTEL_GRAPHQL_DATA_SYMBOL].source,f=r.fieldNodes.find(h=>h.kind==="Field");return f&&Ake(u,l.loc,t().allowValues,f.loc?.start,f.loc?.end),u}function bxt(e,t){t&&e.recordException(t),e.end()}Ns.endSpan=bxt;function Ixt(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>dke.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>dke.indexOf(n?.operation)!==-1)}Ns.getOperation=Ixt;function Cxt(e,t,n){return e[Jg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]=n}function gke(e,t){return e[Jg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]}function hke(e,t){for(let n=t.length-1;n>0;n--){let r=gke(e,t.slice(0,n));if(r)return r.span}return _ke(e)}function _ke(e){return e[Jg.OTEL_GRAPHQL_DATA_SYMBOL].span}function vxt(e,t){let n=[],r=t;for(;r;){let o=r.key;e&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function Rxt(e){return Eke(`
|
|
37
37
|
`,e)}function pke(e){return Eke(" ",e)}function Eke(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}var xxt=[EE.TokenKind.FLOAT,EE.TokenKind.STRING,EE.TokenKind.INT,EE.TokenKind.BLOCK_STRING];function yke(e,t=!1,n,r){let o="";if(e?.startToken){let i=typeof n=="number"?n:e.start,s=typeof r=="number"?r:e.end,u=e.startToken.next,l=1;for(;u;){if(u.start<i){u=u.next,l=u?.line;continue}if(u.end>s){u=u.next,l=u?.line;continue}let f=u.value||u.kind,h="";!t&&xxt.indexOf(u.kind)>=0&&(f="*"),u.kind===EE.TokenKind.STRING&&(f=`"${f}"`),u.kind===EE.TokenKind.EOF&&(f=""),u.line>l?(o+=Rxt(u.line-l),l=u.line,h=pke(u.column-1)):u.line===u.prev?.line&&(h=pke(u.start-(u.prev?.end||0))),o+=h+f,u&&(u=u.next)}}return o}Ns.getSourceFromLocation=yke;function Ske(e,t,n){if(!e||e[Jg.OTEL_PATCHED_SYMBOL])return;let r=e.getFields();e[Jg.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let i=r[o];if(i&&(i.resolve&&(i.resolve=bke(t,n,i.resolve)),i.type)){let s=Tke(i.type);for(let u of s)Ske(u,t,n)}})}Ns.wrapFields=Ske;function Tke(e){return"ofType"in e?Tke(e.ofType):Dxt(e)?e.getTypes():Nxt(e)?[e]:[]}function Dxt(e){return"getTypes"in e&&typeof e.getTypes=="function"}function Nxt(e){return"getFields"in e&&typeof e.getFields=="function"}var fke=(e,t,n)=>{n&&(e.recordException(t),e.setStatus({code:mR.SpanStatusCode.ERROR,message:t.message}),e.end())},mke=(e,t)=>{t&&e.end()};function bke(e,t,n,r=!1){if(o[Jg.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(i,s,u,l){if(!n)return;let f=t();if(f.ignoreTrivialResolveSpans&&r&&(Ext(i)||typeof i=="function")&&typeof i[l.fieldName]!="function")return n.call(this,i,s,u,l);if(!u[Jg.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,i,s,u,l);let h=vxt(f.mergeItems,l&&l.path),_=h.filter(v=>typeof v=="string").length,y,T=!1;if(f.depth>=0&&f.depth<_)y=hke(u,h);else{let{field:v,spanAdded:R}=Sxt(e,t,u,l,h);y=v.span,T=R}return mR.context.with(mR.trace.setSpan(mR.context.active(),y),()=>{try{let v=n.call(this,i,s,u,l);return(0,Ns.isPromise)(v)?v.then(R=>(mke(y,T),R),R=>{throw fke(y,R,T),R}):(mke(y,T),v)}catch(v){throw fke(y,v,T),v}})}return o[Jg.OTEL_PATCHED_SYMBOL]=!0,o}Ns.wrapFieldResolver=bke});var Cke=M(AR=>{"use strict";m();Object.defineProperty(AR,"__esModule",{value:!0});AR.PACKAGE_NAME=AR.PACKAGE_VERSION=void 0;AR.PACKAGE_VERSION="0.62.0";AR.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var xke=M(U3=>{"use strict";m();Object.defineProperty(U3,"__esModule",{value:!0});U3.GraphQLInstrumentation=void 0;var Zg=(He(),Me(tt)),sp=un(),iO=RW(),M3=xW(),NW=k3(),Bxt=lke(),mu=Ike(),vke=Cke(),Rke={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},L3=[">=14.0.0 <17"],BW=class extends sp.InstrumentationBase{constructor(t={}){super(vke.PACKAGE_NAME,vke.PACKAGE_VERSION,{...Rke,...t})}setConfig(t={}){super.setConfig({...Rke,...t})}init(){let t=new sp.InstrumentationNodeModuleDefinition("graphql",L3);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new sp.InstrumentationNodeModuleFile("graphql/execution/execute.js",L3,t=>((0,sp.isWrapped)(t.execute)&&this._unwrap(t,"execute"),this._wrap(t,"execute",this._patchExecute(t.defaultFieldResolver)),t),t=>{t&&this._unwrap(t,"execute")})}_addPatchingParser(){return new sp.InstrumentationNodeModuleFile("graphql/language/parser.js",L3,t=>((0,sp.isWrapped)(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new sp.InstrumentationNodeModuleFile("graphql/validation/validate.js",L3,t=>((0,sp.isWrapped)(t.validate)&&this._unwrap(t,"validate"),this._wrap(t,"validate",this._patchValidate()),t),t=>{t&&this._unwrap(t,"validate")})}_patchExecute(t){let n=this;return function(o){return function(){let s;if(arguments.length>=2){let f=arguments;s=n._wrapExecuteArgs(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],t)}else{let f=arguments[0];s=n._wrapExecuteArgs(f.schema,f.document,f.rootValue,f.contextValue,f.variableValues,f.operationName,f.fieldResolver,f.typeResolver,t)}let u=(0,mu.getOperation)(s.document,s.operationName),l=n._createExecuteSpan(u,s);return s.contextValue[NW.OTEL_GRAPHQL_DATA_SYMBOL]={source:s.document?s.document||s.document[NW.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:l,fields:{}},Zg.context.with(Zg.trace.setSpan(Zg.context.active(),l),()=>(0,sp.safeExecuteInTheMiddle)(()=>o.apply(this,[s]),(f,h)=>{n._handleExecutionResult(l,f,h)}))}}}_handleExecutionResult(t,n,r){let o=this.getConfig();if(r===void 0||n){(0,mu.endSpan)(t,n);return}if((0,mu.isPromise)(r))r.then(i=>{if(typeof o.responseHook!="function"){(0,mu.endSpan)(t);return}this._executeResponseHook(t,i)},i=>{(0,mu.endSpan)(t,i)});else{if(typeof o.responseHook!="function"){(0,mu.endSpan)(t);return}this._executeResponseHook(t,r)}}_executeResponseHook(t,n){let{responseHook:r}=this.getConfig();r&&(0,sp.safeExecuteInTheMiddle)(()=>{r(t,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,mu.endSpan)(t,void 0)},!0)}_patchParse(){let t=this;return function(r){return function(i,s){return t._parse(this,r,i,s)}}}_patchValidate(){let t=this;return function(r){return function(i,s,u,l,f){return t._validate(this,r,i,s,u,f,l)}}}_parse(t,n,r,o){let i=this.getConfig(),s=this.tracer.startSpan(iO.SpanNames.PARSE);return Zg.context.with(Zg.trace.setSpan(Zg.context.active(),s),()=>(0,sp.safeExecuteInTheMiddle)(()=>n.call(t,r,o),(u,l)=>{l&&((0,mu.getOperation)(l)?l.loc&&(0,mu.addSpanSource)(s,l.loc,i.allowValues):s.updateName(iO.SpanNames.SCHEMA_PARSE)),(0,mu.endSpan)(s,u)}))}_validate(t,n,r,o,i,s,u){let l=this.tracer.startSpan(iO.SpanNames.VALIDATE,{});return Zg.context.with(Zg.trace.setSpan(Zg.context.active(),l),()=>(0,sp.safeExecuteInTheMiddle)(()=>n.call(t,r,o,i,u,s),(f,h)=>{o.loc||l.updateName(iO.SpanNames.SCHEMA_VALIDATE),h&&h.length&&l.recordException({name:M3.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(h)}),(0,mu.endSpan)(l,f)}))}_createExecuteSpan(t,n){let r=this.getConfig(),o=this.tracer.startSpan(iO.SpanNames.EXECUTE,{});if(t){let{operation:i,name:s}=t;o.setAttribute(M3.AttributeNames.OPERATION_TYPE,i);let u=s?.value;u?(o.setAttribute(M3.AttributeNames.OPERATION_NAME,u),o.updateName(`${i} ${u}`)):o.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=Bxt.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),o.setAttribute(M3.AttributeNames.OPERATION_NAME,i)}return n.document?.loc&&(0,mu.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,mu.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(t,n,r,o,i,s,u,l,f){if(o||(o={}),o[NW.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:u,typeResolver:l};let h=u==null,_=u??f;return u=(0,mu.wrapFieldResolver)(this.tracer,()=>this.getConfig(),_,h),t&&((0,mu.wrapFields)(t.getQueryType(),this.tracer,()=>this.getConfig()),(0,mu.wrapFields)(t.getMutationType(),this.tracer,()=>this.getConfig())),{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:s,fieldResolver:u,typeResolver:l}}};U3.GraphQLInstrumentation=BW});var Dke=M(Q3=>{"use strict";m();Object.defineProperty(Q3,"__esModule",{value:!0});Q3.GraphQLInstrumentation=void 0;var wxt=xke();Object.defineProperty(Q3,"GraphQLInstrumentation",{enumerable:!0,get:function(){return wxt.GraphQLInstrumentation}})});function kke(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function kxt(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")}, +${t.length-5}`}return`${e}`}var Nke,Bke,wke,Oxt,Oke,Pke=w(()=>{m();He();Nke=ue(Dke(),1);At();_r();Xv();Bke="Graphql",wke=ct(Bke,Nke.GraphQLInstrumentation,e=>{let t=kke(e);return{...t,responseHook(n,r){qr(n,"auto.graphql.otel.graphql"),r.errors?.length&&!kt(n).status&&n.setStatus({code:Ai.ERROR});let i=kt(n).data,s=i["graphql.operation.type"],u=i["graphql.operation.name"];if(t.useOperationNameForRootSpan&&s){let l=gi(n),h=kt(l).data[Zv]||[],_=u?`${s} ${u}`:`${s}`;Array.isArray(h)?(h.push(_),l.setAttribute(Zv,h)):typeof h=="string"?l.setAttribute(Zv,[h,_]):l.setAttribute(Zv,_),kt(l).data["original-description"]||l.setAttribute("original-description",kt(l).description),l.updateName(`${kt(l).data["original-description"]} (${kxt(h)})`)}}}}),Oxt=((e={})=>({name:Bke,setupOnce(){wke(kke(e))}})),Oke=Oxt});var Mke=M(F3=>{"use strict";m();Object.defineProperty(F3,"__esModule",{value:!0});F3.EVENT_LISTENERS_SET=void 0;F3.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var Lke=M(G3=>{"use strict";m();Object.defineProperty(G3,"__esModule",{value:!0});G3.bufferTextMapGetter=void 0;G3.bufferTextMapGetter={get(e,t){if(!e)return;let n=Object.keys(e);for(let r of n)if(r===t||r.toLowerCase()===t)return e[r]?.toString()},keys(e){return e?Object.keys(e):[]}}});var Uke=M(or=>{"use strict";m();Object.defineProperty(or,"__esModule",{value:!0});or.METRIC_MESSAGING_PROCESS_DURATION=or.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=or.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=or.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=or.MESSAGING_SYSTEM_VALUE_KAFKA=or.MESSAGING_OPERATION_TYPE_VALUE_SEND=or.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=or.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=or.ATTR_MESSAGING_SYSTEM=or.ATTR_MESSAGING_OPERATION_TYPE=or.ATTR_MESSAGING_OPERATION_NAME=or.ATTR_MESSAGING_KAFKA_OFFSET=or.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=or.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=or.ATTR_MESSAGING_DESTINATION_PARTITION_ID=or.ATTR_MESSAGING_DESTINATION_NAME=or.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;or.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";or.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";or.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";or.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";or.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";or.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";or.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";or.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";or.ATTR_MESSAGING_SYSTEM="messaging.system";or.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";or.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";or.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";or.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";or.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";or.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";or.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";or.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var Qke=M(gR=>{"use strict";m();Object.defineProperty(gR,"__esModule",{value:!0});gR.PACKAGE_NAME=gR.PACKAGE_VERSION=void 0;gR.PACKAGE_VERSION="0.23.0";gR.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var $ke=M(z3=>{"use strict";m();Object.defineProperty(z3,"__esModule",{value:!0});z3.KafkaJsInstrumentation=void 0;var Vr=(He(),Me(tt)),ap=un(),hR=(Xn(),Me(Hr)),Fke=Mke(),Gke=Lke(),ht=Uke(),jke=Qke();function j3(e,t,n){return r=>{e.add(t,{...n,...r?{[hR.ATTR_ERROR_TYPE]:r}:{}})}}function zke(e,t,n){return r=>{e.record((Date.now()-t)/1e3,{...n,...r?{[hR.ATTR_ERROR_TYPE]:r}:{}})}}var Hke=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],wW=class extends ap.InstrumentationBase{constructor(t={}){super(jke.PACKAGE_NAME,jke.PACKAGE_VERSION,t)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(ht.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:Hke}}),this._sentMessages=this.meter.createCounter(ht.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(ht.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(ht.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:Hke}})}init(){let t=r=>{(0,ap.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,ap.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new ap.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(t(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),t)}_getConsumerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,ap.isWrapped)(i.run)&&t._unwrap(i,"run"),t._wrap(i,"run",t._getConsumerRunPatch()),t._setKafkaEventListeners(i),i}}_setKafkaEventListeners(t){t[Fke.EVENT_LISTENERS_SET]||(t.events?.REQUEST&&t.on(t.events.REQUEST,this._recordClientDurationMetric.bind(this)),t[Fke.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(t){let[n,r]=t.payload.broker.split(":");this._clientDuration.record(t.payload.duration/1e3,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:`${t.payload.apiName}`,[hR.ATTR_SERVER_ADDRESS]:n,[hR.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,ap.isWrapped)(i.sendBatch)&&t._unwrap(i,"sendBatch"),t._wrap(i,"sendBatch",t._getSendBatchPatch()),(0,ap.isWrapped)(i.send)&&t._unwrap(i,"send"),t._wrap(i,"send",t._getSendPatch()),(0,ap.isWrapped)(i.transaction)&&t._unwrap(i,"transaction"),t._wrap(i,"transaction",t._getProducerTransactionPatch()),t._setKafkaEventListeners(i),i}}_getConsumerRunPatch(){let t=this;return n=>function(...o){let i=o[0];return i?.eachMessage&&((0,ap.isWrapped)(i.eachMessage)&&t._unwrap(i,"eachMessage"),t._wrap(i,"eachMessage",t._getConsumerEachMessagePatch())),i?.eachBatch&&((0,ap.isWrapped)(i.eachBatch)&&t._unwrap(i,"eachBatch"),t._wrap(i,"eachBatch",t._getConsumerEachBatchPatch())),n.call(this,i)}}_getConsumerEachMessagePatch(){let t=this;return n=>function(...o){let i=o[0],s=Vr.propagation.extract(Vr.ROOT_CONTEXT,i.message.headers,Gke.bufferTextMapGetter),u=t._startConsumerSpan({topic:i.topic,message:i.message,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:s,attributes:{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),l=[zke(t._processDuration,Date.now(),{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),j3(t._consumedMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],f=Vr.context.with(Vr.trace.setSpan(s,u),()=>n.apply(this,o));return t._endSpansOnPromise([u],l,f)}}_getConsumerEachBatchPatch(){return t=>{let n=this;return function(...o){let i=o[0],s=n._startConsumerSpan({topic:i.batch.topic,message:void 0,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:Vr.ROOT_CONTEXT,attributes:{[ht.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return Vr.context.with(Vr.trace.setSpan(Vr.context.active(),s),()=>{let u=Date.now(),l=[],f=[j3(n._consumedMessages,i.batch.messages.length,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(_=>{let y=Vr.propagation.extract(Vr.ROOT_CONTEXT,_.headers,Gke.bufferTextMapGetter),T=Vr.trace.getSpan(y)?.spanContext(),v;T&&(v={context:T}),l.push(n._startConsumerSpan({topic:i.batch.topic,message:_,operationType:ht.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:v,attributes:{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),f.push(zke(n._processDuration,u,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"process",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}))});let h=t.apply(this,o);return l.unshift(s),n._endSpansOnPromise(l,f,h)})}}}_getProducerTransactionPatch(){let t=this;return n=>function(...o){let i=t.tracer.startSpan("transaction"),s=n.apply(this,o);return s.then(u=>{let l=u.send;u.send=function(...T){return Vr.context.with(Vr.trace.setSpan(Vr.context.active(),i),()=>t._getSendPatch()(l).apply(this,T).catch(R=>{throw i.setStatus({code:Vr.SpanStatusCode.ERROR,message:R?.message}),i.recordException(R),R}))};let f=u.sendBatch;u.sendBatch=function(...T){return Vr.context.with(Vr.trace.setSpan(Vr.context.active(),i),()=>t._getSendBatchPatch()(f).apply(this,T).catch(R=>{throw i.setStatus({code:Vr.SpanStatusCode.ERROR,message:R?.message}),i.recordException(R),R}))};let h=u.commit;u.commit=function(...T){let v=h.apply(this,T).then(()=>{i.setStatus({code:Vr.SpanStatusCode.OK})});return t._endSpansOnPromise([i],[],v)};let _=u.abort;u.abort=function(...T){let v=_.apply(this,T);return t._endSpansOnPromise([i],[],v)}}).catch(u=>{i.setStatus({code:Vr.SpanStatusCode.ERROR,message:u?.message}),i.recordException(u),i.end()}),s}}_getSendBatchPatch(){let t=this;return n=>function(...o){let s=o[0].topicMessages||[],u=[],l=[];s.forEach(h=>{h.messages.forEach(_=>{u.push(t._startProducerSpan(h.topic,_)),l.push(j3(t._sentMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_DESTINATION_NAME]:h.topic,..._.partition!==void 0?{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(_.partition)}:{}}))})});let f=n.apply(this,o);return t._endSpansOnPromise(u,l,f)}}_getSendPatch(){let t=this;return n=>function(...o){let i=o[0],s=i.messages.map(f=>t._startProducerSpan(i.topic,f)),u=i.messages.map(f=>j3(t._sentMessages,1,{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,...f.partition!==void 0?{[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(f.partition)}:{}})),l=n.apply(this,o);return t._endSpansOnPromise(s,u,l)}}_endSpansOnPromise(t,n,r){return Promise.resolve(r).then(o=>(n.forEach(i=>i()),o)).catch(o=>{let i,s=hR.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?i=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(i=o.message,s=o.constructor.name),n.forEach(u=>u(s)),t.forEach(u=>{u.setAttribute(hR.ATTR_ERROR_TYPE,s),u.setStatus({code:Vr.SpanStatusCode.ERROR,message:i})}),o}).finally(()=>{t.forEach(o=>o.end())})}_startConsumerSpan({topic:t,message:n,operationType:r,ctx:o,link:i,attributes:s}){let u=r===ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,l=this.tracer.startSpan(`${u} ${t}`,{kind:r===ht.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?Vr.SpanKind.CLIENT:Vr.SpanKind.CONSUMER,attributes:{...s,[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_DESTINATION_NAME]:t,[ht.ATTR_MESSAGING_OPERATION_TYPE]:r,[ht.ATTR_MESSAGING_OPERATION_NAME]:u,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[ht.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:i?[i]:[]},o),{consumerHook:f}=this.getConfig();return f&&n&&(0,ap.safeExecuteInTheMiddle)(()=>f(l,{topic:t,message:n}),h=>{h&&this._diag.error("consumerHook error",h)},!0),l}_startProducerSpan(t,n){let r=this.tracer.startSpan(`send ${t}`,{kind:Vr.SpanKind.PRODUCER,attributes:{[ht.ATTR_MESSAGING_SYSTEM]:ht.MESSAGING_SYSTEM_VALUE_KAFKA,[ht.ATTR_MESSAGING_DESTINATION_NAME]:t,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[ht.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[ht.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[ht.ATTR_MESSAGING_OPERATION_NAME]:"send",[ht.ATTR_MESSAGING_OPERATION_TYPE]:ht.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},Vr.propagation.inject(Vr.trace.setSpan(Vr.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,ap.safeExecuteInTheMiddle)(()=>o(r,{topic:t,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),r}};z3.KafkaJsInstrumentation=wW});var qke=M(H3=>{"use strict";m();Object.defineProperty(H3,"__esModule",{value:!0});H3.KafkaJsInstrumentation=void 0;var Pxt=$ke();Object.defineProperty(H3,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return Pxt.KafkaJsInstrumentation}})});var Vke,Yke,Kke,Mxt,Jke,Zke=w(()=>{m();Vke=ue(qke(),1);_r();Yke="Kafka",Kke=ct(Yke,()=>new Vke.KafkaJsInstrumentation({consumerHook(e){qr(e,"auto.kafkajs.otel.consumer")},producerHook(e){qr(e,"auto.kafkajs.otel.producer")}})),Mxt=(()=>({name:Yke,setupOnce(){Kke()}})),Jke=Mxt});var Wke=M(_R=>{"use strict";m();Object.defineProperty(_R,"__esModule",{value:!0});_R.PACKAGE_NAME=_R.PACKAGE_VERSION=void 0;_R.PACKAGE_VERSION="0.58.0";_R.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var nPe=M($3=>{"use strict";m();Object.defineProperty($3,"__esModule",{value:!0});$3.LruMemoizerInstrumentation=void 0;var Xke=(He(),Me(tt)),ePe=un(),tPe=Wke(),OW=class extends ePe.InstrumentationBase{constructor(t={}){super(tPe.PACKAGE_NAME,tPe.PACKAGE_VERSION,t)}init(){return[new ePe.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],t=>{let n=function(){let r=t.apply(this,arguments);return function(){let o=[...arguments],i=o.pop(),s=typeof i=="function"?Xke.context.bind(Xke.context.active(),i):i;return o.push(s),r.apply(this,o)}};return n.sync=t.sync,n},void 0)]}};$3.LruMemoizerInstrumentation=OW});var rPe=M(q3=>{"use strict";m();Object.defineProperty(q3,"__esModule",{value:!0});q3.LruMemoizerInstrumentation=void 0;var Lxt=nPe();Object.defineProperty(q3,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return Lxt.LruMemoizerInstrumentation}})});var oPe,iPe,sPe,Uxt,aPe,uPe=w(()=>{m();oPe=ue(rPe(),1);_r();iPe="LruMemoizer",sPe=ct(iPe,()=>new oPe.LruMemoizerInstrumentation),Uxt=(()=>({name:iPe,setupOnce(){sPe()}})),aPe=Uxt});var cPe=M(Po=>{"use strict";m();Object.defineProperty(Po,"__esModule",{value:!0});Po.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Po.DB_SYSTEM_VALUE_MONGODB=Po.DB_SYSTEM_NAME_VALUE_MONGODB=Po.ATTR_NET_PEER_PORT=Po.ATTR_NET_PEER_NAME=Po.ATTR_DB_SYSTEM=Po.ATTR_DB_STATEMENT=Po.ATTR_DB_OPERATION=Po.ATTR_DB_NAME=Po.ATTR_DB_MONGODB_COLLECTION=Po.ATTR_DB_CONNECTION_STRING=void 0;Po.ATTR_DB_CONNECTION_STRING="db.connection_string";Po.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Po.ATTR_DB_NAME="db.name";Po.ATTR_DB_OPERATION="db.operation";Po.ATTR_DB_STATEMENT="db.statement";Po.ATTR_DB_SYSTEM="db.system";Po.ATTR_NET_PEER_NAME="net.peer.name";Po.ATTR_NET_PEER_PORT="net.peer.port";Po.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";Po.DB_SYSTEM_VALUE_MONGODB="mongodb";Po.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var lPe=M(sO=>{"use strict";m();Object.defineProperty(sO,"__esModule",{value:!0});sO.MongodbCommandType=void 0;var Qxt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.AGGREGATE="aggregate",e.UNKNOWN="unknown"})(Qxt=sO.MongodbCommandType||(sO.MongodbCommandType={}))});var dPe=M(ER=>{"use strict";m();Object.defineProperty(ER,"__esModule",{value:!0});ER.PACKAGE_NAME=ER.PACKAGE_VERSION=void 0;ER.PACKAGE_VERSION="0.67.0";ER.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var mPe=M(V3=>{"use strict";m();Object.defineProperty(V3,"__esModule",{value:!0});V3.MongoDBInstrumentation=void 0;var ti=(He(),Me(tt)),ir=un(),Wg=(Xn(),Me(Hr)),Wl=cPe(),eT=lPe(),pPe=dPe(),fPe={requireParentSpan:!0},kW=class e extends ir.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(pPe.PACKAGE_NAME,pPe.PACKAGE_VERSION,{...fPe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ir.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ir.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...fPe,...t})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(Wl.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsage?.add(t,{"pool.name":n,state:r})}init(){let{v3PatchConnection:t,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:i,v4PatchConnectionPromise:s,v4UnpatchConnection:u}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:l,v4UnpatchConnectionPool:f}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:h,v4UnpatchSessions:_}=this._getV4SessionsPatches();return[new ir.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new ir.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new ir.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],i,u),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],s,u),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],l,f),new ir.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new ir.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],h,_)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>((0,ir.isWrapped)(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",this._getV3PatchOperation("insert")),(0,ir.isWrapped)(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",this._getV3PatchOperation("remove")),(0,ir.isWrapped)(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",this._getV3PatchOperation("update")),(0,ir.isWrapped)(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",this._getV3PatchCommand()),(0,ir.isWrapped)(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",this._getV3PatchFind()),(0,ir.isWrapped)(t.getMore)&&this._unwrap(t,"getMore"),this._wrap(t,"getMore",this._getV3PatchCursor()),t),v3UnpatchConnection:t=>{t!==void 0&&(this._unwrap(t,"insert"),this._unwrap(t,"remove"),this._unwrap(t,"update"),this._unwrap(t,"command"),this._unwrap(t,"query"),this._unwrap(t,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:t=>((0,ir.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),this._wrap(t.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,ir.isWrapped)(t.release)&&this._unwrap(t,"release"),this._wrap(t.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),t),v4UnpatchSessions:t=>{t!==void 0&&((0,ir.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),(0,ir.isWrapped)(t.release)&&this._unwrap(t,"release"))}}}_getV4AcquireCommand(){let t=this;return n=>function(){let o=this.sessions.length,i=n.call(this),s=this.sessions.length;return o===s?t._connCountAdd(1,t._poolName,"used"):o-1===s&&(t._connCountAdd(-1,t._poolName,"idle"),t._connCountAdd(1,t._poolName,"used")),i}}_getV4ReleaseCommand(){let t=this;return n=>function(o){let i=n.call(this,o);return t._connCountAdd(-1,t._poolName,"used"),t._connCountAdd(1,t._poolName,"idle"),i}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:t=>{let n=t.ConnectionPool.prototype;return(0,ir.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),t},v4UnpatchConnectionPool:t=>{t!==void 0&&this._unwrap(t.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:t=>((0,ir.isWrapped)(t.connect)&&this._unwrap(t,"connect"),this._wrap(t,"connect",this._getV4ConnectCommand()),t),v4UnpatchConnect:t=>{t!==void 0&&this._unwrap(t,"connect")}}}_getV4ConnectionPoolCheckOut(){return t=>function(r){let o=ti.context.bind(ti.context.active(),r);return t.call(this,o)}}_getV4ConnectCommand(){let t=this;return n=>function(o,i){if(n.length===1){let u=n.call(this,o);return u&&typeof u.then=="function"&&u.then(()=>t.setPoolName(o),()=>{}),u}let s=function(u,l){if(u||!l){i(u,l);return}t.setPoolName(o),i(u,l)};return n.call(this,o,s)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>((0,ir.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandCallback()),t),v4PatchConnectionPromise:t=>((0,ir.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandPromise()),t),v4UnpatchConnection:t=>{t!==void 0&&this._unwrap(t.Connection.prototype,"command")}}}_getV3PatchOperation(t){let n=this;return r=>function(i,s,u,l,f){let h=ti.trace.getSpan(ti.context.active()),_=n._checkSkipInstrumentation(h),y=typeof l=="function"?l:f;if(_||typeof y!="function"||typeof u!="object")return typeof l=="function"?r.call(this,i,s,u,l):r.call(this,i,s,u,l,f);let T=n._getV3SpanAttributes(s,i,u[0],t),v=n._spanNameFromAttrs(T),R=n.tracer.startSpan(v,{kind:ti.SpanKind.CLIENT,attributes:T}),x=n._patchEnd(R,y);return typeof l=="function"?r.call(this,i,s,u,x):r.call(this,i,s,u,l,x)}}_getV3PatchCommand(){let t=this;return n=>function(o,i,s,u,l){let f=ti.trace.getSpan(ti.context.active()),h=t._checkSkipInstrumentation(f),_=typeof u=="function"?u:l;if(h||typeof _!="function"||typeof s!="object")return typeof u=="function"?n.call(this,o,i,s,u):n.call(this,o,i,s,u,l);let y=e._getCommandType(s),T=y===eT.MongodbCommandType.UNKNOWN?void 0:y,v=t._getV3SpanAttributes(i,o,s,T),R=t._spanNameFromAttrs(v),x=t.tracer.startSpan(R,{kind:ti.SpanKind.CLIENT,attributes:v}),O=t._patchEnd(x,_);return typeof u=="function"?n.call(this,o,i,s,O):n.call(this,o,i,s,u,O)}}_getV4PatchCommandCallback(){let t=this;return n=>function(o,i,s,u){let l=ti.trace.getSpan(ti.context.active()),f=t._checkSkipInstrumentation(l),h=u,_=Object.keys(i)[0];if(typeof i!="object"||i.ismaster||i.hello)return n.call(this,o,i,s,u);let y;if(!f){let v=t._getV4SpanAttributes(this,o,i,_),R=t._spanNameFromAttrs(v);y=t.tracer.startSpan(R,{kind:ti.SpanKind.CLIENT,attributes:v})}let T=t._patchEnd(y,h,this.id,_);return n.call(this,o,i,s,T)}}_getV4PatchCommandPromise(){let t=this;return n=>function(...o){let[i,s]=o,u=ti.trace.getSpan(ti.context.active()),l=t._checkSkipInstrumentation(u),f=Object.keys(s)[0],h=()=>{};if(typeof s!="object"||s.ismaster||s.hello)return n.apply(this,o);let _;if(!l){let v=t._getV4SpanAttributes(this,i,s,f),R=t._spanNameFromAttrs(v);_=t.tracer.startSpan(R,{kind:ti.SpanKind.CLIENT,attributes:v})}let y=t._patchEnd(_,h,this.id,f),T=n.apply(this,o);return T.then(v=>y(null,v),v=>y(v)),T}}_getV3PatchFind(){let t=this;return n=>function(o,i,s,u,l,f){let h=ti.trace.getSpan(ti.context.active()),_=t._checkSkipInstrumentation(h),y=typeof l=="function"?l:f;if(_||typeof y!="function"||typeof s!="object")return typeof l=="function"?n.call(this,o,i,s,u,l):n.call(this,o,i,s,u,l,f);let T=t._getV3SpanAttributes(i,o,s,"find"),v=t._spanNameFromAttrs(T),R=t.tracer.startSpan(v,{kind:ti.SpanKind.CLIENT,attributes:T}),x=t._patchEnd(R,y);return typeof l=="function"?n.call(this,o,i,s,u,x):n.call(this,o,i,s,u,l,x)}}_getV3PatchCursor(){let t=this;return n=>function(o,i,s,u,l,f){let h=ti.trace.getSpan(ti.context.active()),_=t._checkSkipInstrumentation(h),y=typeof l=="function"?l:f;if(_||typeof y!="function")return typeof l=="function"?n.call(this,o,i,s,u,l):n.call(this,o,i,s,u,l,f);let T=t._getV3SpanAttributes(i,o,s.cmd,"getMore"),v=t._spanNameFromAttrs(T),R=t.tracer.startSpan(v,{kind:ti.SpanKind.CLIENT,attributes:T}),x=t._patchEnd(R,y);return typeof l=="function"?n.call(this,o,i,s,u,x):n.call(this,o,i,s,u,l,x)}}static _getCommandType(t){return t.createIndexes!==void 0?eT.MongodbCommandType.CREATE_INDEXES:t.findandmodify!==void 0?eT.MongodbCommandType.FIND_AND_MODIFY:t.ismaster!==void 0?eT.MongodbCommandType.IS_MASTER:t.count!==void 0?eT.MongodbCommandType.COUNT:t.aggregate!==void 0?eT.MongodbCommandType.AGGREGATE:eT.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(t,n,r,o){let i,s;if(t){let l=typeof t.address=="string"?t.address.split(":"):"";l.length===2&&(i=l[0],s=l[1])}let u;return r?.documents&&r.documents[0]?u=r.documents[0]:r?.cursors?u=r.cursors:u=r,this._getSpanAttributes(n.db,n.collection,i,s,u,o)}_getV3SpanAttributes(t,n,r,o){let i,s;if(n&&n.s&&(i=n.s.options?.host??n.s.host,s=(n.s.options?.port??n.s.port)?.toString(),i==null||s==null)){let h=n.description?.address;if(h){let _=h.split(":");i=_[0],s=_[1]}}let[u,l]=t.toString().split("."),f=r?.query??r?.q??r;return this._getSpanAttributes(u,l,i,s,f,o)}_getSpanAttributes(t,n,r,o,i,s){let u={};if(this._dbSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_DB_SYSTEM]=Wl.DB_SYSTEM_VALUE_MONGODB,u[Wl.ATTR_DB_NAME]=t,u[Wl.ATTR_DB_MONGODB_COLLECTION]=n,u[Wl.ATTR_DB_OPERATION]=s,u[Wl.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${t}`),this._dbSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_DB_SYSTEM_NAME]=Wl.DB_SYSTEM_NAME_VALUE_MONGODB,u[Wg.ATTR_DB_NAMESPACE]=t,u[Wg.ATTR_DB_OPERATION_NAME]=s,u[Wg.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_SERVER_ADDRESS]=r);let l=parseInt(o,10);isNaN(l)||(this._netSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_NET_PEER_PORT]=l),this._netSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_SERVER_PORT]=l))}if(i){let{dbStatementSerializer:l}=this.getConfig(),f=typeof l=="function"?l:this._defaultDbStatementSerializer.bind(this);(0,ir.safeExecuteInTheMiddle)(()=>{let h=f(i);this._dbSemconvStability&ir.SemconvStability.OLD&&(u[Wl.ATTR_DB_STATEMENT]=h),this._dbSemconvStability&ir.SemconvStability.STABLE&&(u[Wg.ATTR_DB_QUERY_TEXT]=h)},h=>{h&&this._diag.error("Error running dbStatementSerializer hook",h)},!0)}return u}_spanNameFromAttrs(t){let n;return this._dbSemconvStability&ir.SemconvStability.STABLE?n=[t[Wg.ATTR_DB_OPERATION_NAME],t[Wg.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||Wl.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${t[Wl.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let t=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":t.has(r)?"[Circular]":(t.add(r),r)}_defaultDbStatementSerializer(t){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(t):JSON.stringify(t,this._getDefaultDbStatementReplacer())}_handleExecutionResult(t,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,ir.safeExecuteInTheMiddle)(()=>{r(t,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(t,n,r,o){let i=ti.context.active(),s=this,u=!1;return function(...f){if(!u){u=!0;let h=f[0];if(t){if(h instanceof Error)t.setStatus({code:ti.SpanStatusCode.ERROR,message:h.message});else{let _=f[1];s._handleExecutionResult(t,_)}t.end()}o==="endSessions"&&s._connCountAdd(-1,s._poolName,"idle")}return ti.context.with(i,()=>n.apply(this,f))}}setPoolName(t){let n=t.hostAddress?.host,r=t.hostAddress?.port,o=t.dbName,i=`mongodb://${n}:${r}/${o}`;this._poolName=i}_checkSkipInstrumentation(t){return this.getConfig().requireParentSpan===!0&&t===void 0}};V3.MongoDBInstrumentation=kW});var APe=M(aO=>{"use strict";m();Object.defineProperty(aO,"__esModule",{value:!0});aO.MongodbCommandType=void 0;var Fxt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.UNKNOWN="unknown"})(Fxt=aO.MongodbCommandType||(aO.MongodbCommandType={}))});var gPe=M(yR=>{"use strict";m();Object.defineProperty(yR,"__esModule",{value:!0});yR.MongodbCommandType=yR.MongoDBInstrumentation=void 0;var Gxt=mPe();Object.defineProperty(yR,"MongoDBInstrumentation",{enumerable:!0,get:function(){return Gxt.MongoDBInstrumentation}});var jxt=APe();Object.defineProperty(yR,"MongodbCommandType",{enumerable:!0,get:function(){return jxt.MongodbCommandType}})});function zxt(e){let t=PW(e);return JSON.stringify(t)}function PW(e){if(Array.isArray(e))return e.map(t=>PW(t));if(Hxt(e)){let t={};return Object.entries(e).map(([n,r])=>[n,PW(r)]).reduce((n,r)=>(qxt(r)&&(n[r[0]]=r[1]),n),t)}return"?"}function Hxt(e){return typeof e=="object"&&e!==null&&!$xt(e)}function $xt(e){let t=!1;return typeof Buffer<"u"&&(t=Buffer.isBuffer(e)),t}function qxt(e){return Array.isArray(e)}var hPe,_Pe,EPe,Vxt,yPe,SPe=w(()=>{m();hPe=ue(gPe(),1);_r();_Pe="Mongo",EPe=ct(_Pe,()=>new hPe.MongoDBInstrumentation({dbStatementSerializer:zxt,responseHook(e){qr(e,"auto.db.otel.mongo")}}));Vxt=(()=>({name:_Pe,setupOnce(){EPe()}})),yPe=Vxt});var MW=M(as=>{"use strict";m();Object.defineProperty(as,"__esModule",{value:!0});as.DB_SYSTEM_NAME_VALUE_MONGODB=as.ATTR_NET_PEER_PORT=as.ATTR_NET_PEER_NAME=as.ATTR_DB_USER=as.ATTR_DB_SYSTEM=as.ATTR_DB_STATEMENT=as.ATTR_DB_OPERATION=as.ATTR_DB_NAME=as.ATTR_DB_MONGODB_COLLECTION=void 0;as.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";as.ATTR_DB_NAME="db.name";as.ATTR_DB_OPERATION="db.operation";as.ATTR_DB_STATEMENT="db.statement";as.ATTR_DB_SYSTEM="db.system";as.ATTR_DB_USER="db.user";as.ATTR_NET_PEER_NAME="net.peer.name";as.ATTR_NET_PEER_PORT="net.peer.port";as.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var IPe=M(yE=>{"use strict";m();Object.defineProperty(yE,"__esModule",{value:!0});yE.handleCallbackResponse=yE.handlePromiseResponse=yE.getAttributesFromCollection=void 0;var TPe=(He(),Me(tt)),cO=un(),uO=MW(),Y3=(Xn(),Me(Hr));function Yxt(e,t,n){let r={};return t&cO.SemconvStability.OLD&&(r[uO.ATTR_DB_MONGODB_COLLECTION]=e.name,r[uO.ATTR_DB_NAME]=e.conn.name,r[uO.ATTR_DB_USER]=e.conn.user),t&cO.SemconvStability.STABLE&&(r[Y3.ATTR_DB_COLLECTION_NAME]=e.name,r[Y3.ATTR_DB_NAMESPACE]=e.conn.name),n&cO.SemconvStability.OLD&&(r[uO.ATTR_NET_PEER_NAME]=e.conn.host,r[uO.ATTR_NET_PEER_PORT]=e.conn.port),n&cO.SemconvStability.STABLE&&(r[Y3.ATTR_SERVER_ADDRESS]=e.conn.host,r[Y3.ATTR_SERVER_PORT]=e.conn.port),r}yE.getAttributesFromCollection=Yxt;function bPe(e,t={}){e.recordException(t),e.setStatus({code:TPe.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`
|
|
38
|
-
Mongoose Error Code: ${t.code}`:""}`})}function LW(e,t,n,r=void 0){n&&(0,cO.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&TPe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function Kxt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(LW(t,o,n,r),o)).catch(o=>{throw bPe(t,o),o}).finally(()=>t.end()):(LW(t,e,n,r),t.end(),e)}yE.handlePromiseResponse=Kxt;function Jxt(e,t,n,r,o,i,s=void 0){let u=0;return o.length===2?u=1:o.length===3&&(u=2),o[u]=(l,f)=>(l?bPe(r,l):LW(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}yE.handleCallbackResponse=Jxt});var CPe=M(SR=>{"use strict";m();Object.defineProperty(SR,"__esModule",{value:!0});SR.PACKAGE_NAME=SR.PACKAGE_VERSION=void 0;SR.PACKAGE_VERSION="0.60.0";SR.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var NPe=M(Jc=>{"use strict";m();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.MongooseInstrumentation=Jc._ALREADY_INSTRUMENTED=Jc._STORED_PARENT_SPAN=void 0;var Bs=(He(),Me(tt)),Zxt=vr(),UW=IPe(),La=un(),vPe=CPe(),SE=MW(),tT=(Xn(),Me(Hr)),K3=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],Wxt=["remove","count","findOneAndRemove",...K3],Xxt=["count","findOneAndRemove",...K3],eDt=[...K3];function RPe(e){return e?e.startsWith("6.")||e.startsWith("5.")?Wxt:e.startsWith("7.")?Xxt:eDt:K3}function xPe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function DPe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Jc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Jc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var QW=class extends La.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(vPe.PACKAGE_NAME,vPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,La.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,La.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new La.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,xPe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),DPe(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)),RPe(n).forEach(i=>{this._wrap(r.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),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(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t,o=RPe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,xPe(n)&&this._unwrap(r.Model.prototype,"remove"),DPe(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(i=>{this._unwrap(r.Query.prototype,i)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(t){let n=this;return r=>function(i){if(n.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&La.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&La.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Jc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&La.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&La.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,u){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);let l={document:this};s&&!(s instanceof Function)&&(l.options=s);let f={},{dbStatementSerializer:h}=r.getConfig();if(h){let y=h(t,l);r._dbSemconvStability&La.SemconvStability.OLD&&(f[SE.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&La.SemconvStability.STABLE&&(f[tT.ATTR_DB_QUERY_TEXT]=y)}let _=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(u=s,s=void 0),r._handleResponse(_,o,this,arguments,u,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,_=u;typeof s=="function"?(f=s,h=void 0,_=void 0):typeof u=="function"&&(f=u,_=void 0);let y={},T=r.getConfig().dbStatementSerializer;if(T){let x=T(t,{condition:{_id:this._id},updates:h,options:_});r._dbSemconvStability&La.SemconvStability.OLD&&(y[SE.ATTR_DB_STATEMENT]=x),r._dbSemconvStability&La.SemconvStability.STABLE&&(y[tT.ATTR_DB_QUERY_TEXT]=x)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),R=r._handleResponse(v,o,this,arguments,f,n);return R&&typeof R=="object"&&(R[Jc._ALREADY_INSTRUMENTED]=!0),R}}patchModelStatic(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);typeof u=="function"&&(l=u,u=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}u!==void 0&&(f.options=u);let h={},{dbStatementSerializer:_}=r.getConfig();if(_){let T=_(t,f);r._dbSemconvStability&La.SemconvStability.OLD&&(h[SE.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&La.SemconvStability.STABLE&&(h[tT.ATTR_DB_QUERY_TEXT]=T)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Bs.trace.getSpan(Bs.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Jc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Jc._STORED_PARENT_SPAN]=Bs.trace.getSpan(Bs.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,UW.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&La.SemconvStability.OLD&&(s[SE.ATTR_DB_OPERATION]=r,s[SE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&La.SemconvStability.STABLE&&(s[tT.ATTR_DB_OPERATION_NAME]=r,s[tT.ATTR_DB_SYSTEM_NAME]=SE.DB_SYSTEM_NAME_VALUE_MONGODB);let u=this._dbSemconvStability&La.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(u,{kind:Bs.SpanKind.CLIENT,attributes:s},i?Bs.trace.setSpan(Bs.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let u=this;if(i instanceof Function)return u._callOriginalFunction(()=>(0,UW.handleCallbackResponse)(i,n,r,t,o,u.getConfig().responseHook,s));{let l=u._callOriginalFunction(()=>n.apply(r,o));return(0,UW.handlePromiseResponse)(l,t,u.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Bs.context.with((0,Zxt.suppressTracing)(Bs.context.active()),t):t()}};Jc.MongooseInstrumentation=QW});var BPe=M(J3=>{"use strict";m();Object.defineProperty(J3,"__esModule",{value:!0});J3.MongooseInstrumentation=void 0;var tDt=NPe();Object.defineProperty(J3,"MongooseInstrumentation",{enumerable:!0,get:function(){return tDt.MongooseInstrumentation}})});var wPe,OPe,kPe,nDt,PPe,MPe=w(()=>{m();wPe=ue(BPe(),1);_r();OPe="Mongoose",kPe=ct(OPe,()=>new wPe.MongooseInstrumentation({responseHook(e){qr(e,"auto.db.otel.mongoose")}})),nDt=(()=>({name:OPe,setupOnce(){kPe()}})),PPe=nDt});var LPe=M(us=>{"use strict";m();Object.defineProperty(us,"__esModule",{value:!0});us.METRIC_DB_CLIENT_CONNECTIONS_USAGE=us.DB_SYSTEM_VALUE_MYSQL=us.ATTR_NET_PEER_PORT=us.ATTR_NET_PEER_NAME=us.ATTR_DB_USER=us.ATTR_DB_SYSTEM=us.ATTR_DB_STATEMENT=us.ATTR_DB_NAME=us.ATTR_DB_CONNECTION_STRING=void 0;us.ATTR_DB_CONNECTION_STRING="db.connection_string";us.ATTR_DB_NAME="db.name";us.ATTR_DB_STATEMENT="db.statement";us.ATTR_DB_SYSTEM="db.system";us.ATTR_DB_USER="db.user";us.ATTR_NET_PEER_NAME="net.peer.name";us.ATTR_NET_PEER_PORT="net.peer.port";us.DB_SYSTEM_VALUE_MYSQL="mysql";us.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var UPe=M(lO=>{"use strict";m();Object.defineProperty(lO,"__esModule",{value:!0});lO.AttributeNames=void 0;var rDt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(rDt=lO.AttributeNames||(lO.AttributeNames={}))});var QPe=M(Au=>{"use strict";m();Object.defineProperty(Au,"__esModule",{value:!0});Au.getPoolNameOld=Au.arrayStringifyHelper=Au.getSpanName=Au.getDbValues=Au.getDbQueryText=Au.getJDBCString=Au.getConfig=void 0;function oDt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}Au.getConfig=oDt;function iDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}Au.getJDBCString=iDt;function sDt(e){return typeof e=="string"?e:e.sql}Au.getDbQueryText=sDt;function aDt(e,t){return FW(typeof e=="string"?t:t||e.values)}Au.getDbValues=aDt;function uDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}Au.getSpanName=uDt;function FW(e){return e?`[${e.toString()}]`:""}Au.arrayStringifyHelper=FW;function cDt(e){let t=e.config.connectionConfig,n="";return n+=t.host?`host: '${t.host}', `:"",n+=t.port?`port: ${t.port}, `:"",n+=t.database?`database: '${t.database}', `:"",n+=t.user?`user: '${t.user}'`:"",t.user||(n=n.substring(0,n.length-2)),n.trim()}Au.getPoolNameOld=cDt});var FPe=M(TR=>{"use strict";m();Object.defineProperty(TR,"__esModule",{value:!0});TR.PACKAGE_NAME=TR.PACKAGE_VERSION=void 0;TR.PACKAGE_VERSION="0.60.0";TR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var jPe=M(Z3=>{"use strict";m();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.MySQLInstrumentation=void 0;var Zc=(He(),Me(tt)),up=un(),bR=(Xn(),Me(Hr)),Xg=LPe(),lDt=UPe(),nT=QPe(),GPe=FPe(),GW=class extends up.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(GPe.PACKAGE_NAME,GPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,up.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,up.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new up.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,up.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,up.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,up.isWrapped)(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),i}}}_patchCreatePool(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"end",n._patchPoolEnd(i)),n._setPoolCallbacks(i,""),i}}}_patchPoolEnd(t){return n=>{let r=this;return function(i){let s=t._allConnections.length,u=t._freeConnections.length,l=s-u,f=(0,nT.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-u,f,"idle"),n.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"add",n._patchAdd(i)),i}}}_patchAdd(t){return n=>{let r=this;return function(i,s){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let u=t._nodes;if(u){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=u[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,u){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let l=r._getConnectionCallbackPatchFn(i);return n.call(t,l)}if(arguments.length===2&&typeof s=="function"){let l=r._getConnectionCallbackPatchFn(s);return n.call(t,i,l)}if(arguments.length===3&&typeof u=="function"){let l=r._getConnectionCallbackPatchFn(u);return n.call(t,i,s,l)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Zc.context.active();return function(o,i){i&&((0,up.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Zc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,s){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let u={},{host:l,port:f,database:h,user:_}=(0,nT.getConfig)(t.config),y=parseInt(f,10),T=(0,nT.getDbQueryText)(o);r._dbSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_DB_SYSTEM]=Xg.DB_SYSTEM_VALUE_MYSQL,u[Xg.ATTR_DB_CONNECTION_STRING]=(0,nT.getJDBCString)(l,f,h),u[Xg.ATTR_DB_NAME]=h,u[Xg.ATTR_DB_USER]=_,u[Xg.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_DB_SYSTEM_NAME]=bR.DB_SYSTEM_NAME_VALUE_MYSQL,u[bR.ATTR_DB_NAMESPACE]=h,u[bR.ATTR_DB_QUERY_TEXT]=T),r._netSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_NET_PEER_NAME]=l,isNaN(y)||(u[Xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_SERVER_ADDRESS]=l,isNaN(y)||(u[bR.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,nT.getSpanName)(o),{kind:Zc.SpanKind.CLIENT,attributes:u});if(r.getConfig().enhancedDatabaseReporting){let O;Array.isArray(i)?O=i:arguments[2]&&(O=[i]),v.setAttribute(lDt.AttributeNames.MYSQL_VALUES,(0,nT.getDbValues)(o,O))}let R=Array.from(arguments).findIndex(O=>typeof O=="function"),x=Zc.context.active();if(R===-1){let O=Zc.context.with(Zc.trace.setSpan(Zc.context.active(),v),()=>n.apply(t,arguments));return Zc.context.bind(x,O),O.on("error",P=>v.setStatus({code:Zc.SpanStatusCode.ERROR,message:P.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,R,r._patchCallbackQuery(v,x)),Zc.context.with(Zc.trace.setSpan(Zc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,s){return o&&t.setStatus({code:Zc.SpanStatusCode.ERROR,message:o.message}),t.end(),Zc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,nT.getPoolNameOld)(t);t.on("connection",o=>{this._connCountAdd(1,r,"idle")}),t.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),t.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};Z3.MySQLInstrumentation=GW});var zPe=M(W3=>{"use strict";m();Object.defineProperty(W3,"__esModule",{value:!0});W3.MySQLInstrumentation=void 0;var dDt=jPe();Object.defineProperty(W3,"MySQLInstrumentation",{enumerable:!0,get:function(){return dDt.MySQLInstrumentation}})});var HPe,$Pe,qPe,pDt,VPe,YPe=w(()=>{m();HPe=ue(zPe(),1);_r();$Pe="Mysql",qPe=ct($Pe,()=>new HPe.MySQLInstrumentation({})),pDt=(()=>({name:$Pe,setupOnce(){qPe()}})),VPe=pDt});var jW=M(ua=>{"use strict";m();Object.defineProperty(ua,"__esModule",{value:!0});ua.DB_SYSTEM_VALUE_MYSQL=ua.ATTR_NET_PEER_PORT=ua.ATTR_NET_PEER_NAME=ua.ATTR_DB_USER=ua.ATTR_DB_SYSTEM=ua.ATTR_DB_STATEMENT=ua.ATTR_DB_NAME=ua.ATTR_DB_CONNECTION_STRING=void 0;ua.ATTR_DB_CONNECTION_STRING="db.connection_string";ua.ATTR_DB_NAME="db.name";ua.ATTR_DB_STATEMENT="db.statement";ua.ATTR_DB_SYSTEM="db.system";ua.ATTR_DB_USER="db.user";ua.ATTR_NET_PEER_NAME="net.peer.name";ua.ATTR_NET_PEER_PORT="net.peer.port";ua.DB_SYSTEM_VALUE_MYSQL="mysql"});var HW=M(X3=>{"use strict";m();Object.defineProperty(X3,"__esModule",{value:!0});X3.addSqlCommenterComment=void 0;var zW=(He(),Me(tt)),fDt=vr();function mDt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function ADt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function gDt(e,t){if(typeof t!="string"||t.length===0||mDt(t))return t;let n=new fDt.W3CTraceContextPropagator,r={};n.inject(zW.trace.setSpan(zW.ROOT_CONTEXT,e),r,zW.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let u=ADt(r[s]);return`${s}='${u}'`}).join(",");return`${t} /*${i}*/`}X3.addSqlCommenterComment=gDt});var KPe=M(cp=>{"use strict";m();Object.defineProperty(cp,"__esModule",{value:!0});cp.getConnectionPrototypeToInstrument=cp.once=cp.getSpanName=cp.getQueryText=cp.getConnectionAttributes=void 0;var dO=jW(),e6=un(),$W=(Xn(),Me(Hr));function hDt(e,t,n){let{host:r,port:o,database:i,user:s}=_Dt(e),u={};t&e6.SemconvStability.OLD&&(u[dO.ATTR_DB_CONNECTION_STRING]=EDt(r,o,i),u[dO.ATTR_DB_NAME]=i,u[dO.ATTR_DB_USER]=s),t&e6.SemconvStability.STABLE&&(u[$W.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&e6.SemconvStability.OLD&&(u[dO.ATTR_NET_PEER_NAME]=r,isNaN(l)||(u[dO.ATTR_NET_PEER_PORT]=l)),n&e6.SemconvStability.STABLE&&(u[$W.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(u[$W.ATTR_SERVER_PORT]=l)),u}cp.getConnectionAttributes=hDt;function _Dt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function EDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function yDt(e,t,n,r=!1,o=SDt){let[i,s]=typeof e=="string"?[e,n]:[e.sql,TDt(e)?n||e.values:n];try{return r?o(i):t&&s?t(i,s):i}catch{return"Could not determine the query due to an error in masking or formatting"}}cp.getQueryText=yDt;function SDt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function TDt(e){return"values"in e}function bDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}cp.getSpanName=bDt;var IDt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};cp.once=IDt;function CDt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}cp.getConnectionPrototypeToInstrument=CDt});var JPe=M(IR=>{"use strict";m();Object.defineProperty(IR,"__esModule",{value:!0});IR.PACKAGE_NAME=IR.PACKAGE_VERSION=void 0;IR.PACKAGE_VERSION="0.60.0";IR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var eMe=M(t6=>{"use strict";m();Object.defineProperty(t6,"__esModule",{value:!0});t6.MySQL2Instrumentation=void 0;var ZPe=(He(),Me(tt)),xf=un(),qW=jW(),WPe=HW(),CR=KPe(),XPe=JPe(),VW=(Xn(),Me(Hr)),YW=[">=1.4.2 <4"],KW=class extends xf.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(XPe.PACKAGE_NAME,XPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,xf.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let t;function n(i){!t&&i.format&&(t=i.format)}let r=i=>{(0,xf.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,xf.isWrapped)(i.execute)&&this._unwrap(i,"execute"),this._wrap(i,"execute",this._patchQuery(t,!0))},o=i=>{this._unwrap(i,"query"),this._unwrap(i,"execute")};return[new xf.InstrumentationNodeModuleDefinition("mysql2",YW,i=>(n(i),i),()=>{},[new xf.InstrumentationNodeModuleFile("mysql2/promise.js",YW,i=>(n(i),i),()=>{}),new xf.InstrumentationNodeModuleFile("mysql2/lib/connection.js",YW,i=>{let s=(0,CR.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,CR.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,u){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:_}=o.getConfig(),y=(0,CR.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),T=(0,CR.getQueryText)(i,t,l,f,h);o._dbSemconvStability&xf.SemconvStability.OLD&&(y[qW.ATTR_DB_SYSTEM]=qW.DB_SYSTEM_VALUE_MYSQL,y[qW.ATTR_DB_STATEMENT]=T),o._dbSemconvStability&xf.SemconvStability.STABLE&&(y[VW.ATTR_DB_SYSTEM_NAME]=VW.DB_SYSTEM_NAME_VALUE_MYSQL,y[VW.ATTR_DB_QUERY_TEXT]=T);let v=o.tracer.startSpan((0,CR.getSpanName)(i),{kind:ZPe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,WPe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,WPe.addSqlCommenterComment)(v,i.sql)}));let R=(0,CR.once)((x,O)=>{x?v.setStatus({code:ZPe.SpanStatusCode.ERROR,message:x.message}):typeof _=="function"&&(0,xf.safeExecuteInTheMiddle)(()=>{_(v,{queryResults:O})},P=>{P&&o._diag.warn("Failed executing responseHook",P)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(R));let x=r.apply(this,arguments);return x.once("error",O=>{R(O)}).once("result",O=>{R(void 0,O)}),x}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(R)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(R)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};t6.MySQL2Instrumentation=KW});var tMe=M(n6=>{"use strict";m();Object.defineProperty(n6,"__esModule",{value:!0});n6.MySQL2Instrumentation=void 0;var vDt=eMe();Object.defineProperty(n6,"MySQL2Instrumentation",{enumerable:!0,get:function(){return vDt.MySQL2Instrumentation}})});var nMe,rMe,oMe,RDt,iMe,sMe=w(()=>{m();nMe=ue(tMe(),1);_r();rMe="Mysql2",oMe=ct(rMe,()=>new nMe.MySQL2Instrumentation({responseHook(e){qr(e,"auto.db.otel.mysql2")}})),RDt=(()=>({name:rMe,setupOnce(){oMe()}})),iMe=RDt});var aMe=M(gu=>{"use strict";m();Object.defineProperty(gu,"__esModule",{value:!0});gu.DB_SYSTEM_VALUE_REDIS=gu.DB_SYSTEM_NAME_VALUE_REDIS=gu.ATTR_NET_PEER_PORT=gu.ATTR_NET_PEER_NAME=gu.ATTR_DB_SYSTEM=gu.ATTR_DB_STATEMENT=gu.ATTR_DB_CONNECTION_STRING=void 0;gu.ATTR_DB_CONNECTION_STRING="db.connection_string";gu.ATTR_DB_STATEMENT="db.statement";gu.ATTR_DB_SYSTEM="db.system";gu.ATTR_NET_PEER_NAME="net.peer.name";gu.ATTR_NET_PEER_PORT="net.peer.port";gu.DB_SYSTEM_NAME_VALUE_REDIS="redis";gu.DB_SYSTEM_VALUE_REDIS="redis"});var uMe=M(r6=>{"use strict";m();Object.defineProperty(r6,"__esModule",{value:!0});r6.endSpan=void 0;var xDt=(He(),Me(tt)),DDt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:xDt.SpanStatusCode.ERROR,message:t.message})),e.end()};r6.endSpan=DDt});var i6=M(o6=>{"use strict";m();Object.defineProperty(o6,"__esModule",{value:!0});o6.defaultDbStatementSerializer=void 0;var NDt=[{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}],BDt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=NDt.find(({regex:o})=>o.test(e))?.args??0,r=n>=0?t.slice(0,n):t;return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(" ")}`}return e};o6.defaultDbStatementSerializer=BDt});var cMe=M(vR=>{"use strict";m();Object.defineProperty(vR,"__esModule",{value:!0});vR.PACKAGE_NAME=vR.PACKAGE_VERSION=void 0;vR.PACKAGE_VERSION="0.62.0";vR.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var fMe=M(s6=>{"use strict";m();Object.defineProperty(s6,"__esModule",{value:!0});s6.IORedisInstrumentation=void 0;var TE=(He(),Me(tt)),Wc=un(),bE=(Xn(),Me(Hr)),Xc=aMe(),lMe=un(),pO=uMe(),wDt=i6(),dMe=cMe(),pMe={requireParentSpan:!0},JW=class extends Wc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(dMe.PACKAGE_NAME,dMe.PACKAGE_VERSION,{...pMe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Wc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Wc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...pMe,...t})}init(){return[new Wc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Wc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Wc.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(t){return n=>this._traceSendCommand(n,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return t.apply(this,arguments);let i=r.getConfig(),s=i.dbStatementSerializer||wDt.defaultDbStatementSerializer,u=TE.trace.getSpan(TE.context.active())===void 0;if(i.requireParentSpan===!0&&u)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,_=s(o.name,o.args);r._dbSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,l[Xc.ATTR_DB_STATEMENT]=_,l[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,l[bE.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_NET_PEER_NAME]=f,l[Xc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_SERVER_ADDRESS]=f,l[bE.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:TE.SpanKind.CLIENT,attributes:l}),{requestHook:T}=i;T&&(0,lMe.safeExecuteInTheMiddle)(()=>T(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&TE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),R=o.resolve;o.resolve=function(O){(0,lMe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,O),P=>{P&&TE.diag.error("ioredis instrumentation: response hook failed",P)},!0),(0,pO.endSpan)(y,null),R(O)};let x=o.reject;return o.reject=function(O){(0,pO.endSpan)(y,O),x(O)},v}catch(v){throw(0,pO.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=TE.trace.getSpan(TE.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:s}=this.options;n._dbSemconvStability&Wc.SemconvStability.OLD&&(o[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,o[Xc.ATTR_DB_STATEMENT]="connect",o[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,o[bE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Wc.SemconvStability.OLD&&(o[Xc.ATTR_NET_PEER_NAME]=i,o[Xc.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_SERVER_ADDRESS]=i,o[bE.ATTR_SERVER_PORT]=s);let u=n.tracer.startSpan("connect",{kind:TE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,pO.endSpan)(u,null),l}catch(l){throw(0,pO.endSpan)(u,l),l}}}};s6.IORedisInstrumentation=JW});var mMe=M(a6=>{"use strict";m();Object.defineProperty(a6,"__esModule",{value:!0});a6.IORedisInstrumentation=void 0;var ODt=fMe();Object.defineProperty(a6,"IORedisInstrumentation",{enumerable:!0,get:function(){return ODt.IORedisInstrumentation}})});var u6=M(RR=>{"use strict";m();Object.defineProperty(RR,"__esModule",{value:!0});RR.PACKAGE_NAME=RR.PACKAGE_VERSION=void 0;RR.PACKAGE_VERSION="0.62.0";RR.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var AMe=M(IE=>{"use strict";m();Object.defineProperty(IE,"__esModule",{value:!0});IE.getTracedCreateStreamTrace=IE.getTracedCreateClient=IE.endSpan=void 0;var fO=(He(),Me(tt)),kDt=(e,t)=>{t&&e.setStatus({code:fO.SpanStatusCode.ERROR,message:t.message}),e.end()};IE.endSpan=kDt;var PDt=e=>function(){let n=e.apply(this,arguments);return fO.context.bind(fO.context.active(),n)};IE.getTracedCreateClient=PDt;var MDt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){fO.context.bind(fO.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};IE.getTracedCreateStreamTrace=MDt});var c6=M(hu=>{"use strict";m();Object.defineProperty(hu,"__esModule",{value:!0});hu.DB_SYSTEM_VALUE_REDIS=hu.DB_SYSTEM_NAME_VALUE_REDIS=hu.ATTR_NET_PEER_PORT=hu.ATTR_NET_PEER_NAME=hu.ATTR_DB_SYSTEM=hu.ATTR_DB_STATEMENT=hu.ATTR_DB_CONNECTION_STRING=void 0;hu.ATTR_DB_CONNECTION_STRING="db.connection_string";hu.ATTR_DB_STATEMENT="db.statement";hu.ATTR_DB_SYSTEM="db.system";hu.ATTR_NET_PEER_NAME="net.peer.name";hu.ATTR_NET_PEER_PORT="net.peer.port";hu.DB_SYSTEM_NAME_VALUE_REDIS="redis";hu.DB_SYSTEM_VALUE_REDIS="redis"});var hMe=M(d6=>{"use strict";m();Object.defineProperty(d6,"__esModule",{value:!0});d6.RedisInstrumentationV2_V3=void 0;var Xl=un(),l6=AMe(),gMe=u6(),mO=(He(),Me(tt)),AO=(Xn(),Me(Hr)),rT=c6(),LDt=i6(),ZW=class e extends Xl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(gMe.PACKAGE_NAME,gMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Xl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,Xl.isWrapped)(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,Xl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Xl.isWrapped)(t.createClient)&&this._unwrap(t,"createClient"),this._wrap(t,"createClient",this._getPatchCreateClient()),t),t=>{t!==void 0&&(this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._unwrap(t.RedisClient.prototype,"create_stream"),this._unwrap(t,"createClient"))})]}_getPatchInternalSendCommand(){let t=this;return function(r){return function(i){if(arguments.length!==1||typeof i!="object")return r.apply(this,arguments);let s=t.getConfig(),u=mO.trace.getSpan(mO.context.active())===void 0;if(s.requireParentSpan===!0&&u)return r.apply(this,arguments);let l=s?.dbStatementSerializer||LDt.defaultDbStatementSerializer,f={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(f,{[rT.ATTR_DB_SYSTEM]:rT.DB_SYSTEM_VALUE_REDIS,[rT.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(f,{[AO.ATTR_DB_SYSTEM_NAME]:rT.DB_SYSTEM_NAME_VALUE_REDIS,[AO.ATTR_DB_OPERATION_NAME]:i.command,[AO.ATTR_DB_QUERY_TEXT]:l(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:mO.SpanKind.CLIENT,attributes:f});if(this.connection_options){let y={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(y,{[rT.ATTR_NET_PEER_NAME]:this.connection_options.host,[rT.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(y,{[AO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[AO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&Xl.SemconvStability.OLD&&h.setAttribute(rT.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let _=arguments[0].callback;if(_){let y=mO.context.active();arguments[0].callback=function(v,R){if(s?.responseHook){let x=s.responseHook;(0,Xl.safeExecuteInTheMiddle)(()=>{x(h,i.command,i.args,R)},O=>{O&&t._diag.error("Error executing responseHook",O)},!0)}return(0,l6.endSpan)(h,v),mO.context.with(y,_,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,l6.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,l6.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,l6.getTracedCreateStreamTrace)(n)}}};d6.RedisInstrumentationV2_V3=ZW});var EMe=M(p6=>{"use strict";m();Object.defineProperty(p6,"__esModule",{value:!0});p6.getClientAttributes=void 0;var WW=(Xn(),Me(Hr)),xR=c6(),_Me=un();function UDt(e,t,n){let r={};return n&_Me.SemconvStability.OLD&&Object.assign(r,{[xR.ATTR_DB_SYSTEM]:xR.DB_SYSTEM_VALUE_REDIS,[xR.ATTR_NET_PEER_NAME]:t?.socket?.host,[xR.ATTR_NET_PEER_PORT]:t?.socket?.port,[xR.ATTR_DB_CONNECTION_STRING]:QDt(e,t?.url)}),n&_Me.SemconvStability.STABLE&&Object.assign(r,{[WW.ATTR_DB_SYSTEM_NAME]:xR.DB_SYSTEM_NAME_VALUE_REDIS,[WW.ATTR_SERVER_ADDRESS]:t?.socket?.host,[WW.ATTR_SERVER_PORT]:t?.socket?.port}),r}p6.getClientAttributes=UDt;function QDt(e,t){if(!(typeof t!="string"||!t))try{let n=new URL(t);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){e.error("failed to sanitize redis connection url",n)}}});var bMe=M(f6=>{"use strict";m();Object.defineProperty(f6,"__esModule",{value:!0});f6.RedisInstrumentationV4_V5=void 0;var lp=(He(),Me(tt)),Co=un(),yMe=EMe(),FDt=i6(),SMe=u6(),XW=(Xn(),Me(Hr)),GDt=c6(),gO=Symbol("opentelemetry.instrumentation.redis.open_spans"),TMe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),eX=class e extends Co.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(SMe.PACKAGE_NAME,SMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let u=i.transformCommandArguments;if(!u)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Co.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(u)),i},i=>{(0,Co.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Co.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Co.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Co.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(s,"connect",this._getPatchedClientConnect()),i},i=>{let s=i?.default?.prototype;(0,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Co.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Co.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(s){if(s?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let u=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(u,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let s=o.apply(this,arguments);return typeof s?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),s):s.then(u=>{let l=this[gO];return n._endSpansWithRedisReplies(l,u,t),u}).catch(u=>{let l=this[gO];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=u.constructor.name==="MultiErrorReply"?u.replies:new Array(l.length).fill(u);n._endSpansWithRedisReplies(l,f,t)}return Promise.reject(u)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[TMe]=this.options,o}}}_getPatchRedisClientSendCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchedClientConnect(){let t=this;return function(r){return function(){let i=this.options,s=(0,yMe.getClientAttributes)(t._diag,i,t._semconvStability),u=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:lp.SpanKind.CLIENT,attributes:s});return lp.context.with(lp.trace.setSpan(lp.context.active(),u),()=>r.apply(this)).then(f=>(u.end(),f)).catch(f=>(u.recordException(f),u.setStatus({code:lp.SpanStatusCode.ERROR,message:f.message}),u.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(lp.trace.getSpan(lp.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[TMe],u=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||FDt.defaultDbStatementSerializer,h=(0,yMe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_OPERATION_NAME]=u);try{let T=f(u,l);T!=null&&(this._semconvStability&Co.SemconvStability.OLD&&(h[GDt.ATTR_DB_STATEMENT]=T),this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_QUERY_TEXT]=T))}catch(T){this._diag.error("dbStatementSerializer throw an exception",T,{commandName:u})}let _=this.tracer.startSpan(`${e.COMPONENT}-${u}`,{kind:lp.SpanKind.CLIENT,attributes:h}),y=lp.context.with(lp.trace.setSpan(lp.context.active(),_),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(T=>{this._endSpanWithResponse(_,u,l,T,void 0)},T=>{this._endSpanWithResponse(_,u,l,null,T)});else{let T=y;T[gO]=T[gO]||[],T[gO].push({span:_,commandName:u,commandArgs:l})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(u=>u.commandName),s=o.every(u=>u===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let u=0;u<t.length;u++){let{span:l,commandArgs:f}=t[u],h=n[u],[_,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Co.SemconvStability.STABLE&&l.setAttribute(XW.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[u],f,_,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(u){this._diag.error("responseHook throw an exception",u)}i&&(t.recordException(i),t.setStatus({code:lp.SpanStatusCode.ERROR,message:i?.message})),t.end()}};f6.RedisInstrumentationV4_V5=eX});var vMe=M(m6=>{"use strict";m();Object.defineProperty(m6,"__esModule",{value:!0});m6.RedisInstrumentation=void 0;var jDt=un(),IMe=u6(),zDt=hMe(),HDt=bMe(),CMe={requireParentSpan:!1},tX=class extends jDt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...CMe,...t};super(IMe.PACKAGE_NAME,IMe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new zDt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new HDt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...CMe,...t};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(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}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())}};m6.RedisInstrumentation=tX});var RMe=M(A6=>{"use strict";m();Object.defineProperty(A6,"__esModule",{value:!0});A6.RedisInstrumentation=void 0;var $Dt=vMe();Object.defineProperty(A6,"RedisInstrumentation",{enumerable:!0,get:function(){return $Dt.RedisInstrumentation}})});function hO(e,t){return e.includes(t.toLowerCase())}function rX(e){return hO(nX,e)?"cache.get":hO(VDt,e)?"cache.put":void 0}function YDt(e,t){return t.some(n=>e.startsWith(n))}function DMe(e,t){try{if(t.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?xMe(o.map(i=>n(i))):["<unknown>"],r=t[0];return hO(qDt,e)&&r!=null?n(r):xMe(t.map(o=>n(o)))}catch{return}}function NMe(e,t,n){if(!rX(e))return!1;for(let r of t)if(YDt(r,n))return!0;return!1}function BMe(e){let t=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(e)?e.reduce((n,r)=>{let o=t(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):t(e)}function xMe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var qDt,nX,VDt,wMe=w(()=>{m();qDt=["get","set","setex"],nX=["get","mget"],VDt=["set","setex"]});var OMe,kMe,g6,_O,PMe,KDt,JDt,MMe,ZDt,LMe,UMe=w(()=>{m();OMe=ue(mMe(),1),kMe=ue(RMe(),1);At();_r();wMe();g6="Redis",_O={},PMe=(e,t,n,r)=>{e.setAttribute(Mt,"auto.db.otel.redis");let o=DMe(t,n),i=rX(t);if(!o||!i||!_O.cachePrefixes||!NMe(t,o,_O.cachePrefixes))return;let s=kt(e).data["net.peer.name"],u=kt(e).data["net.peer.port"];u&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":u});let l=BMe(r);l&&e.setAttribute(aY,l),hO(nX,t)&&l!==void 0&&e.setAttribute(iY,l>0),e.setAttributes({[Xt]:i,[sY]:o});let f=o.join(", ");e.updateName(_O.maxCacheKeyLength?Q_(f,_O.maxCacheKeyLength):f)},KDt=ct(`${g6}.IORedis`,()=>new OMe.IORedisInstrumentation({responseHook:PMe})),JDt=ct(`${g6}.Redis`,()=>new kMe.RedisInstrumentation({responseHook:PMe})),MMe=Object.assign(()=>{KDt(),JDt()},{id:g6}),ZDt=((e={})=>({name:g6,setupOnce(){_O=e,MMe()}})),LMe=ZDt});var QMe=M(h6=>{"use strict";m();Object.defineProperty(h6,"__esModule",{value:!0});h6.EVENT_LISTENERS_SET=void 0;h6.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var oX=M(EO=>{"use strict";m();Object.defineProperty(EO,"__esModule",{value:!0});EO.AttributeNames=void 0;var WDt;(function(e){e.PG_VALUES="db.postgresql.values",e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client"})(WDt=EO.AttributeNames||(EO.AttributeNames={}))});var iX=M(wr=>{"use strict";m();Object.defineProperty(wr,"__esModule",{value:!0});wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=wr.METRIC_DB_CLIENT_CONNECTION_COUNT=wr.DB_SYSTEM_VALUE_POSTGRESQL=wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=wr.ATTR_NET_PEER_PORT=wr.ATTR_NET_PEER_NAME=wr.ATTR_DB_USER=wr.ATTR_DB_SYSTEM=wr.ATTR_DB_STATEMENT=wr.ATTR_DB_NAME=wr.ATTR_DB_CONNECTION_STRING=wr.ATTR_DB_CLIENT_CONNECTION_STATE=wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";wr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";wr.ATTR_DB_CONNECTION_STRING="db.connection_string";wr.ATTR_DB_NAME="db.name";wr.ATTR_DB_STATEMENT="db.statement";wr.ATTR_DB_SYSTEM="db.system";wr.ATTR_DB_USER="db.user";wr.ATTR_NET_PEER_NAME="net.peer.name";wr.ATTR_NET_PEER_PORT="net.peer.port";wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";wr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";wr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var sX=M(yO=>{"use strict";m();Object.defineProperty(yO,"__esModule",{value:!0});yO.SpanNames=void 0;var XDt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(XDt=yO.SpanNames||(yO.SpanNames={}))});var qMe=M(sr=>{"use strict";m();Object.defineProperty(sr,"__esModule",{value:!0});sr.sanitizedErrorMessage=sr.isObjectWithTextString=sr.getErrorMessage=sr.patchClientConnectCallback=sr.patchCallbackPGPool=sr.updateCounter=sr.getPoolName=sr.patchCallback=sr.handleExecutionResult=sr.handleConfigQuery=sr.shouldSkipInstrumentation=sr.getSemanticAttributesFromPoolConnection=sr.getSemanticAttributesFromConnection=sr.getConnectionString=sr.parseAndMaskConnectionString=sr.parseNormalizedOperationName=sr.getQuerySpanName=void 0;var CE=(He(),Me(tt)),_6=oX(),dp=(Xn(),Me(Hr)),Ei=iX(),oT=un(),FMe=sX();function GMe(e,t){if(!t)return FMe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:jMe(t.text);return`${FMe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}sr.getQuerySpanName=GMe;function jMe(e){let t=e.trim(),n=t.indexOf(" "),r=n===-1?t:t.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}sr.parseNormalizedOperationName=jMe;function zMe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}sr.parseAndMaskConnectionString=zMe;function aX(e){if("connectionString"in e&&e.connectionString)return zMe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}sr.getConnectionString=aX;function E6(e){if(Number.isInteger(e))return e}function HMe(e,t){let n={};return t&oT.SemconvStability.OLD&&(n={...n,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_DB_USER]:e.user,[Ei.ATTR_NET_PEER_NAME]:e.host,[Ei.ATTR_NET_PEER_PORT]:E6(e.port)}),t&oT.SemconvStability.STABLE&&(n={...n,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:e.host,[dp.ATTR_SERVER_PORT]:E6(e.port)}),n}sr.getSemanticAttributesFromConnection=HMe;function e1t(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[_6.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[_6.AttributeNames.MAX_CLIENT]:e.maxClient};return t&oT.SemconvStability.OLD&&(r={...r,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[Ei.ATTR_NET_PEER_PORT]:Number(n?.port)||E6(e.port),[Ei.ATTR_DB_USER]:n?.username??e.user}),t&oT.SemconvStability.STABLE&&(r={...r,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[dp.ATTR_SERVER_PORT]:Number(n?.port)||E6(e.port)}),r}sr.getSemanticAttributesFromPoolConnection=e1t;function t1t(e){return e.requireParentSpan===!0&&CE.trace.getSpan(CE.context.active())===void 0}sr.shouldSkipInstrumentation=t1t;function n1t(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=GMe(i,r),u=e.startSpan(s,{kind:CE.SpanKind.CLIENT,attributes:HMe(o,n)});if(!r)return u;if(r.text&&(n&oT.SemconvStability.OLD&&u.setAttribute(Ei.ATTR_DB_STATEMENT,r.text),n&oT.SemconvStability.STABLE&&u.setAttribute(dp.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let l=r.values.map(f=>f==null?"null":f instanceof Buffer?f.toString():typeof f=="object"?typeof f.toPostgres=="function"?f.toPostgres():JSON.stringify(f):f.toString());u.setAttribute(_6.AttributeNames.PG_VALUES,l)}catch(l){CE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&u.setAttribute(_6.AttributeNames.PG_PLAN,r.name),u}sr.handleConfigQuery=n1t;function $Me(e,t,n){typeof e.responseHook=="function"&&(0,oT.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&CE.diag.error("Error running response hook",r)},!0)}sr.handleExecutionResult=$Me;function r1t(e,t,n,r,o){return function(s,u){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[dp.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(y6(s)),t.setStatus({code:CE.SpanStatusCode.ERROR,message:s.message})):$Me(e,t,u),o(),t.end(),n.call(this,s,u)}}sr.patchCallback=r1t;function o1t(e){let t="";return t+=(e?.host?`${e.host}`:"unknown_host")+":",t+=(e?.port?`${e.port}`:"unknown_port")+"/",t+=e?.database?`${e.database}`:"unknown_database",t.trim()}sr.getPoolName=o1t;function i1t(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,u=t.idleCount,l=i-u;return n.add(l-o.used,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(u-o.idle,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:u,pending:s}}sr.updateCounter=i1t;function s1t(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(y6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}sr.patchCallbackPGPool=s1t;function a1t(e,t){return function(r){r&&(r instanceof Error&&e.recordException(y6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}sr.patchClientConnectCallback=a1t;function u1t(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}sr.getErrorMessage=u1t;function c1t(e){return typeof e=="object"&&typeof e?.text=="string"}sr.isObjectWithTextString=c1t;function y6(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}sr.sanitizedErrorMessage=y6});var VMe=M(DR=>{"use strict";m();Object.defineProperty(DR,"__esModule",{value:!0});DR.PACKAGE_NAME=DR.PACKAGE_VERSION=void 0;DR.PACKAGE_VERSION="0.66.0";DR.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var XMe=M(T6=>{"use strict";m();Object.defineProperty(T6,"__esModule",{value:!0});T6.PgInstrumentation=void 0;var tc=un(),Yr=(He(),Me(tt)),YMe=QMe(),ni=qMe(),KMe=HW(),JMe=VMe(),ZMe=sX(),S6=vr(),Df=(Xn(),Me(Hr)),SO=iX();function NR(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var uX=class extends tc.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(JMe.PACKAGE_NAME,JMe.PACKAGE_VERSION,t),this._semconvStability=(0,tc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Df.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Yr.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(SO.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(SO.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new tc.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new tc.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new tc.InstrumentationNodeModuleDefinition("pg",t,u=>{let l=NR(u);return this._patchPgClient(l.Client),u},u=>{let l=NR(u);return this._unpatchPgClient(l.Client),u},[o,r]),s=new tc.InstrumentationNodeModuleDefinition("pg-pool",n,u=>{let l=NR(u);return(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},u=>{let l=NR(u);(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(ZMe.SpanNames.CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchClientConnectCallback(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return WMe(s,u)}}recordOperationDuration(t,n){let r={},o=[Df.ATTR_DB_NAMESPACE,Df.ATTR_ERROR_TYPE,Df.ATTR_SERVER_PORT,Df.ATTR_SERVER_ADDRESS,Df.ATTR_DB_OPERATION_NAME];this._semconvStability&tc.SemconvStability.OLD&&o.push(SO.ATTR_DB_SYSTEM),this._semconvStability&tc.SemconvStability.STABLE&&o.push(Df.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,S6.hrTimeToMilliseconds)((0,S6.hrTimeDuration)(n,(0,S6.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ni.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,S6.hrTime)(),s=o[0],u=typeof s=="string",l=ni.isObjectWithTextString(s),f=u?{text:s,values:Array.isArray(o[1])?o[1]:void 0}:l?{...s,name:s.name,text:s.text,values:s.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[SO.ATTR_DB_SYSTEM]:SO.DB_SYSTEM_VALUE_POSTGRESQL,[Df.ATTR_DB_NAMESPACE]:this.database,[Df.ATTR_SERVER_PORT]:this.connectionParameters.port,[Df.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[Df.ATTR_DB_OPERATION_NAME]=ni.parseNormalizedOperationName(f?.text));let _=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),T=ni.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,f);if(y.addSqlCommenterCommentToQueries&&(u?o[0]=(0,KMe.addSqlCommenterComment)(T,s):l&&!("name"in s)&&(o[0]={...s,text:(0,KMe.addSqlCommenterComment)(T,s.text)})),o.length>0){let x=Yr.trace.getSpan(Yr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ni.patchCallback(y,T,o[o.length-1],h,_),x&&(o[o.length-1]=Yr.context.bind(Yr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let O=ni.patchCallback(t.getConfig(),T,f.callback,h,_);x&&(O=Yr.context.bind(Yr.context.active(),O)),o[0].callback=O}}let{requestHook:v}=y;typeof v=="function"&&f&&(0,tc.safeExecuteInTheMiddle)(()=>{let{database:x,host:O,port:P,user:j}=this.connectionParameters;v(T,{connection:{database:x,host:O,port:P,user:j},query:{text:f.text,values:f.values,name:f.name}})},x=>{x&&t._diag.error("Error running query hook",x)},!0);let R;try{R=n.apply(this,o)}catch(x){throw x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(x)}),T.end(),x}return R instanceof Promise?R.then(x=>new Promise(O=>{ni.handleExecutionResult(t.getConfig(),T,x),_(),T.end(),O(x)})).catch(x=>new Promise((O,P)=>{x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:x.message}),_(),T.end(),P(x)})):R})}_setPoolConnectEventListeners(t){if(t[YMe.EVENT_LISTENERS_SET])return;let n=ni.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[YMe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(ZMe.SpanNames.POOL_CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchCallbackPGPool(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return WMe(s,u)}}};T6.PgInstrumentation=uX;function WMe(e,t){if(!(t instanceof Promise))return t;let n=t;return Yr.context.bind(Yr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(ni.sanitizedErrorMessage(r)),e.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var e2e=M(BR=>{"use strict";m();Object.defineProperty(BR,"__esModule",{value:!0});BR.AttributeNames=BR.PgInstrumentation=void 0;var l1t=XMe();Object.defineProperty(BR,"PgInstrumentation",{enumerable:!0,get:function(){return l1t.PgInstrumentation}});var d1t=oX();Object.defineProperty(BR,"AttributeNames",{enumerable:!0,get:function(){return d1t.AttributeNames}})});var t2e,n2e,r2e,p1t,o2e,i2e=w(()=>{m();t2e=ue(e2e(),1);_r();n2e="Postgres",r2e=ct(n2e,t2e.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){qr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),p1t=(e=>({name:n2e,setupOnce(){r2e(e)}})),o2e=p1t});var vE,lX,s2e,f1t,m1t,a2e,cX,A1t,u2e,c2e=w(()=>{m();He();vE=ue(un(),1);Xn();At();_r();YS();lX="PostgresJs",s2e=[">=3.0.0 <4"],f1t=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,m1t=Symbol.for("sentry.query.from.instrumented.sql"),a2e=ct(lX,e=>new cX({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),cX=class extends vE.InstrumentationBase{constructor(t){super("sentry-postgres-js",er,t)}init(){let t=new vE.InstrumentationNodeModuleDefinition("postgres",s2e,n=>{try{return this._patchPostgres(n)}catch(r){return Ds&&W.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new vE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,s2e,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",r=n?t:t.default;if(typeof r!="function")return Ds&&W.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let u=Reflect.construct(r,s);if(!u||typeof u!="function")return Ds&&W.warn("postgres() did not return a valid instance"),u;let l=o.getConfig();return cK(u,{requireParentSpan:l.requireParentSpan,requestHook:l.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}return n?i:(gw(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Vt.getSpan(We.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(LC,r);return}let o=n?.match(f1t);o?.[1]&&t.setAttribute(LC,o[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(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"}_patchQueryPrototype(t){let n=this,r=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...o){if(this[m1t])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return oa({name:s||"postgresjs.query",op:"db"},u=>{qr(u,"auto.db.postgresjs"),u.setAttributes({[fS]:"postgres",[SV]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,vE.safeExecuteInTheMiddle)(()=>f(u,s,void 0),y=>{y&&(u.setAttribute("sentry.hook.error","requestHook failed"),Ds&&W.error(`Error in requestHook for ${lX} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,T,v)=>{try{n._setOperationName(u,s,v?.[0]?.command),u.end()}catch(R){Ds&&W.error("Error ending span in resolve callback:",R)}return Reflect.apply(y,T,v)}});let _=this.reject;this.reject=new Proxy(_,{apply:(y,T,v)=>{try{u.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),u.setAttribute(TV,v?.[0]?.code||"unknown"),u.setAttribute(bV,v?.[0]?.name||"unknown"),n._setOperationName(u,s),u.end()}catch(R){Ds&&W.error("Error ending span in reject callback:",R)}return Reflect.apply(y,T,v)}});try{return r.apply(this,o)}catch(y){throw u.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),u.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},A1t=(e=>({name:lX,setupOnce(){a2e(e)}})),u2e=A1t});var l2e=M(TO=>{"use strict";m();Object.defineProperty(TO,"__esModule",{value:!0});TO.SeverityNumber=void 0;var g1t;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(g1t=TO.SeverityNumber||(TO.SeverityNumber={}))});var I6=M(wR=>{"use strict";m();Object.defineProperty(wR,"__esModule",{value:!0});wR.NOOP_LOGGER=wR.NoopLogger=void 0;var b6=class{emit(t){}};wR.NoopLogger=b6;wR.NOOP_LOGGER=new b6});var v6=M(OR=>{"use strict";m();Object.defineProperty(OR,"__esModule",{value:!0});OR.NOOP_LOGGER_PROVIDER=OR.NoopLoggerProvider=void 0;var h1t=I6(),C6=class{getLogger(t,n,r){return new h1t.NoopLogger}};OR.NoopLoggerProvider=C6;OR.NOOP_LOGGER_PROVIDER=new C6});var pX=M(R6=>{"use strict";m();Object.defineProperty(R6,"__esModule",{value:!0});R6.ProxyLogger=void 0;var _1t=I6(),dX=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):_1t.NOOP_LOGGER}};R6.ProxyLogger=dX});var mX=M(x6=>{"use strict";m();Object.defineProperty(x6,"__esModule",{value:!0});x6.ProxyLoggerProvider=void 0;var E1t=v6(),y1t=pX(),fX=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new y1t.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:E1t.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};x6.ProxyLoggerProvider=fX});var d2e=M(D6=>{"use strict";m();Object.defineProperty(D6,"__esModule",{value:!0});D6._globalThis=void 0;D6._globalThis=typeof globalThis=="object"?globalThis:global});var p2e=M(N6=>{"use strict";m();Object.defineProperty(N6,"__esModule",{value:!0});N6._globalThis=void 0;var S1t=d2e();Object.defineProperty(N6,"_globalThis",{enumerable:!0,get:function(){return S1t._globalThis}})});var f2e=M(B6=>{"use strict";m();Object.defineProperty(B6,"__esModule",{value:!0});B6._globalThis=void 0;var T1t=p2e();Object.defineProperty(B6,"_globalThis",{enumerable:!0,get:function(){return T1t._globalThis}})});var m2e=M(nA=>{"use strict";m();Object.defineProperty(nA,"__esModule",{value:!0});nA.API_BACKWARDS_COMPATIBILITY_VERSION=nA.makeGetter=nA._global=nA.GLOBAL_LOGS_API_KEY=void 0;var b1t=f2e();nA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");nA._global=b1t._globalThis;function I1t(e,t,n){return r=>r===e?t:n}nA.makeGetter=I1t;nA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var g2e=M(w6=>{"use strict";m();Object.defineProperty(w6,"__esModule",{value:!0});w6.LogsAPI=void 0;var pp=m2e(),C1t=v6(),A2e=mX(),AX=class e{constructor(){this._proxyLoggerProvider=new A2e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return pp._global[pp.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(pp._global[pp.GLOBAL_LOGS_API_KEY]=(0,pp.makeGetter)(pp.API_BACKWARDS_COMPATIBILITY_VERSION,t,C1t.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=pp._global[pp.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(pp._global,pp.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete pp._global[pp.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new A2e.ProxyLoggerProvider}};w6.LogsAPI=AX});var gX=M(ca=>{"use strict";m();Object.defineProperty(ca,"__esModule",{value:!0});ca.logs=ca.ProxyLoggerProvider=ca.ProxyLogger=ca.NoopLoggerProvider=ca.NOOP_LOGGER_PROVIDER=ca.NoopLogger=ca.NOOP_LOGGER=ca.SeverityNumber=void 0;var v1t=l2e();Object.defineProperty(ca,"SeverityNumber",{enumerable:!0,get:function(){return v1t.SeverityNumber}});var h2e=I6();Object.defineProperty(ca,"NOOP_LOGGER",{enumerable:!0,get:function(){return h2e.NOOP_LOGGER}});Object.defineProperty(ca,"NoopLogger",{enumerable:!0,get:function(){return h2e.NoopLogger}});var _2e=v6();Object.defineProperty(ca,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return _2e.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ca,"NoopLoggerProvider",{enumerable:!0,get:function(){return _2e.NoopLoggerProvider}});var R1t=pX();Object.defineProperty(ca,"ProxyLogger",{enumerable:!0,get:function(){return R1t.ProxyLogger}});var x1t=mX();Object.defineProperty(ca,"ProxyLoggerProvider",{enumerable:!0,get:function(){return x1t.ProxyLoggerProvider}});var D1t=g2e();ca.logs=D1t.LogsAPI.getInstance()});var E2e=M(kR=>{"use strict";m();Object.defineProperty(kR,"__esModule",{value:!0});kR.disableInstrumentations=kR.enableInstrumentations=void 0;function N1t(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}kR.enableInstrumentations=N1t;function B1t(e){e.forEach(t=>t.disable())}kR.disableInstrumentations=B1t});var T2e=M(O6=>{"use strict";m();Object.defineProperty(O6,"__esModule",{value:!0});O6.registerInstrumentations=void 0;var y2e=(He(),Me(tt)),w1t=gX(),S2e=E2e();function O1t(e){let t=e.tracerProvider||y2e.trace.getTracerProvider(),n=e.meterProvider||y2e.metrics.getMeterProvider(),r=e.loggerProvider||w1t.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,S2e.enableInstrumentations)(o,t,n,r),()=>{(0,S2e.disableInstrumentations)(o)}}O6.registerInstrumentations=O1t});var B2e=M(k6=>{"use strict";m();Object.defineProperty(k6,"__esModule",{value:!0});k6.satisfies=void 0;var yX=(He(),Me(tt)),R2e=/^(?: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-]+)*))?$/,k1t=/^(?<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-]+)*))?$/,P1t={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function M1t(e,t,n){if(!L1t(e))return yX.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=G1t(e);if(!r)return!1;let o=[],i=x2e(r,t,o,n);return i&&!n?.includePrerelease?Q1t(r,o):i}k6.satisfies=M1t;function L1t(e){return typeof e=="string"&&R2e.test(e)}function x2e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(hX(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=uNt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!hX(e,i,n,r))return!1;return!0}return hX(e,t,n,r)}function hX(e,t,n,r){if(t=F1t(t,r),t.includes(" "))return x2e(e,t,n,r);{let o=j1t(t);return n.push(o),U1t(e,o)}}function U1t(e,t){if(t.invalid)return!1;if(!t.version||EX(t.version))return!0;let n=I2e(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=I2e(r,o)}return P1t[t.op]?.includes(n)}function Q1t(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function F1t(e,t){return e=e.trim(),e=sNt(e,t),e=iNt(e),e=aNt(e,t),e=e.trim(),e}function nc(e){return!e||e.toLowerCase()==="x"||e==="*"}function G1t(e){let t=e.match(R2e);if(!t){yX.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function j1t(e){if(!e)return{};let t=e.match(k1t);if(!t)return yX.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function EX(e){return e==="*"||e==="x"||e==="X"}function b2e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function z1t(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function H1t(e,t){if(EX(e)||EX(t))return 0;let[n,r]=z1t(b2e(e),b2e(t));return n>r?1:n<r?-1:0}function I2e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=H1t(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var D2e="[a-zA-Z0-9-]",N2e="0|[1-9]\\d*",$1t=`\\d*[a-zA-Z-]${D2e}*`,q1t="((?:<|>)?=?)",C2e=`(?:${N2e}|${$1t})`,V1t=`(?:-(${C2e}(?:\\.${C2e})*))`,v2e=`${D2e}+`,Y1t=`(?:\\+(${v2e}(?:\\.${v2e})*))`,_X=`${N2e}|x|X|\\*`,bO=`[v=\\s]*(${_X})(?:\\.(${_X})(?:\\.(${_X})(?:${V1t})?${Y1t}?)?)?`,K1t=`^${q1t}\\s*${bO}$`,J1t=new RegExp(K1t),Z1t=`^\\s*(${bO})\\s+-\\s+(${bO})\\s*$`,W1t=new RegExp(Z1t),X1t="(?:~>?)",eNt=`^${X1t}${bO}$`,tNt=new RegExp(eNt),nNt="(?:\\^)",rNt=`^${nNt}${bO}$`,oNt=new RegExp(rNt);function iNt(e){let t=tNt;return e.replace(t,(n,r,o,i,s)=>{let u;return nc(r)?u="":nc(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:nc(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function sNt(e,t){let n=oNt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return nc(i)?f="":nc(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:nc(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function aNt(e,t){let n=J1t;return e.replace(n,(r,o,i,s,u,l)=>{let f=nc(i),h=f||nc(s),_=h||nc(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function uNt(e,t){let n=W1t;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>(nc(i)?o="":nc(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:nc(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,nc(_)?h="":nc(y)?h=`<${+_+1}.0.0-0`:nc(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var SX=M(Ua=>{"use strict";m();Object.defineProperty(Ua,"__esModule",{value:!0});Ua.massUnwrap=Ua.unwrap=Ua.massWrap=Ua.wrap=void 0;var rc=console.error.bind(console);function IO(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var cNt=(e,t,n)=>{if(!e||!e[t]){rc("no original function "+String(t)+" to wrap");return}if(!n){rc("no wrapper function"),rc(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){rc("original object and wrapper must be functions");return}let o=n(r,t);return IO(o,"__original",r),IO(o,"__unwrap",()=>{e[t]===o&&IO(e,t,r)}),IO(o,"__wrapped",!0),IO(e,t,o),o};Ua.wrap=cNt;var lNt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ua.wrap)(r,o,n)})})};Ua.massWrap=lNt;var dNt=(e,t)=>{if(!e||!e[t]){rc("no function to unwrap."),rc(new Error().stack);return}let n=e[t];if(!n.__unwrap)rc("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ua.unwrap=dNt;var pNt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ua.unwrap)(n,r)})})};Ua.massUnwrap=pNt;function CO(e){e&&e.logger&&(typeof e.logger!="function"?rc("new logger isn't a function, not replacing"):rc=e.logger)}Ua.default=CO;CO.wrap=Ua.wrap;CO.massWrap=Ua.massWrap;CO.unwrap=Ua.unwrap;CO.massUnwrap=Ua.massUnwrap});var w2e=M(M6=>{"use strict";m();Object.defineProperty(M6,"__esModule",{value:!0});M6.InstrumentationAbstract=void 0;var TX=(He(),Me(tt)),fNt=gX(),P6=SX(),bX=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=TX.diag.createComponentLogger({namespace:t}),this._tracer=TX.trace.getTracer(t,n),this._meter=TX.metrics.getMeter(t,n),this._logger=fNt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=P6.wrap;_unwrap=P6.unwrap;_massWrap=P6.massWrap;_massUnwrap=P6.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};M6.InstrumentationAbstract=bX});var O2e=M(RE=>{"use strict";m();Object.defineProperty(RE,"__esModule",{value:!0});RE.ModuleNameTrie=RE.ModuleNameSeparator=void 0;RE.ModuleNameSeparator="/";var L6=class{hooks=[];children=new Map},IX=class{_trie=new L6;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(RE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new L6,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],s=!0;for(let u of t.split(RE.ModuleNameSeparator)){let l=o.children.get(u);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};RE.ModuleNameTrie=IX});var P2e=M(U6=>{"use strict";m();Object.defineProperty(U6,"__esModule",{value:!0});U6.RequireInTheMiddleSingleton=void 0;var mNt=ES(),k2e=Ue("path"),CX=O2e(),ANt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),vX=class e{_moduleNameTrie=new CX.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new mNt.Hook(null,{internals:!0},(t,n,r)=>{let o=gNt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return ANt?new e:this._instance=this._instance??new e}};U6.RequireInTheMiddleSingleton=vX;function gNt(e){return k2e.sep!==CX.ModuleNameSeparator?e.split(k2e.sep).join(CX.ModuleNameSeparator):e}});var RX=M(xE=>{"use strict";m();Object.defineProperty(xE,"__esModule",{value:!0});xE.isWrapped=xE.safeExecuteInTheMiddleAsync=xE.safeExecuteInTheMiddle=void 0;function hNt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddle=hNt;async function _Nt(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddleAsync=_Nt;function ENt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}xE.isWrapped=ENt});var U2e=M(Q6=>{"use strict";m();Object.defineProperty(Q6,"__esModule",{value:!0});Q6.InstrumentationBase=void 0;var vO=Ue("path"),M2e=Ue("util"),yNt=B2e(),xX=SX(),SNt=w2e(),TNt=P2e(),bNt=uW(),RO=(He(),Me(tt)),INt=ES(),CNt=Ue("fs"),vNt=RX(),DX=class extends SNt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=TNt.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,vNt.isWrapped)(t[n])&&this._unwrap(t,n),M2e.types.isProxy(t)){let o=(0,xX.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,xX.wrap)(t,n,r)};_unwrap=(t,n)=>M2e.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,xX.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Ue.resolve(n);Ue.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(t){try{let n=(0,CNt.readFileSync)(vO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{RO.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return L2e(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let s=t.files??[],u=vO.normalize(r);return s.filter(f=>f.name===u).filter(f=>L2e(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(f,t.moduleVersion)):f),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,u,l)=>{if(!l&&vO.isAbsolute(u)){let f=vO.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=vO.isAbsolute(t.name)?new INt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new bNt.Hook([t.name],{internals:!1},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};Q6.InstrumentationBase=DX;function L2e(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,yNt.satisfies)(t,r,{includePrerelease:n}))}});var Q2e=M(F6=>{"use strict";m();Object.defineProperty(F6,"__esModule",{value:!0});F6.normalize=void 0;var RNt=Ue("path");Object.defineProperty(F6,"normalize",{enumerable:!0,get:function(){return RNt.normalize}})});var F2e=M(PR=>{"use strict";m();Object.defineProperty(PR,"__esModule",{value:!0});PR.normalize=PR.InstrumentationBase=void 0;var xNt=U2e();Object.defineProperty(PR,"InstrumentationBase",{enumerable:!0,get:function(){return xNt.InstrumentationBase}});var DNt=Q2e();Object.defineProperty(PR,"normalize",{enumerable:!0,get:function(){return DNt.normalize}})});var NX=M(MR=>{"use strict";m();Object.defineProperty(MR,"__esModule",{value:!0});MR.normalize=MR.InstrumentationBase=void 0;var G2e=F2e();Object.defineProperty(MR,"InstrumentationBase",{enumerable:!0,get:function(){return G2e.InstrumentationBase}});Object.defineProperty(MR,"normalize",{enumerable:!0,get:function(){return G2e.normalize}})});var j2e=M(G6=>{"use strict";m();Object.defineProperty(G6,"__esModule",{value:!0});G6.InstrumentationNodeModuleDefinition=void 0;var BX=class{name;supportedVersions;patch;unpatch;files;constructor(t,n,r,o,i){this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=i||[]}};G6.InstrumentationNodeModuleDefinition=BX});var z2e=M(j6=>{"use strict";m();Object.defineProperty(j6,"__esModule",{value:!0});j6.InstrumentationNodeModuleFile=void 0;var NNt=NX(),wX=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,NNt.normalize)(t)}};j6.InstrumentationNodeModuleFile=wX});var H2e=M(iT=>{"use strict";m();Object.defineProperty(iT,"__esModule",{value:!0});iT.semconvStabilityFromStr=iT.SemconvStability=void 0;var z6;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(z6=iT.SemconvStability||(iT.SemconvStability={}));function BNt(e,t){let n=z6.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=z6.DUPLICATE;break}else o.toLowerCase()===e&&(n=z6.STABLE);return n}iT.semconvStabilityFromStr=BNt});var q2e=M(cs=>{"use strict";m();Object.defineProperty(cs,"__esModule",{value:!0});cs.semconvStabilityFromStr=cs.SemconvStability=cs.safeExecuteInTheMiddleAsync=cs.safeExecuteInTheMiddle=cs.isWrapped=cs.InstrumentationNodeModuleFile=cs.InstrumentationNodeModuleDefinition=cs.InstrumentationBase=cs.registerInstrumentations=void 0;var wNt=T2e();Object.defineProperty(cs,"registerInstrumentations",{enumerable:!0,get:function(){return wNt.registerInstrumentations}});var ONt=NX();Object.defineProperty(cs,"InstrumentationBase",{enumerable:!0,get:function(){return ONt.InstrumentationBase}});var kNt=j2e();Object.defineProperty(cs,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return kNt.InstrumentationNodeModuleDefinition}});var PNt=z2e();Object.defineProperty(cs,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return PNt.InstrumentationNodeModuleFile}});var OX=RX();Object.defineProperty(cs,"isWrapped",{enumerable:!0,get:function(){return OX.isWrapped}});Object.defineProperty(cs,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddle}});Object.defineProperty(cs,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddleAsync}});var $2e=H2e();Object.defineProperty(cs,"SemconvStability",{enumerable:!0,get:function(){return $2e.SemconvStability}});Object.defineProperty(cs,"semconvStabilityFromStr",{enumerable:!0,get:function(){return $2e.semconvStabilityFromStr}})});function UNt(){let e=LR[PX];return e?.helper?e.helper:LR[kX]?.helper}function QNt(e){let t={helper:e};LR[PX]=t,LR[kX]=t}function FNt(){delete LR[PX],delete LR[kX]}function zNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}function K2e(e,t,n,r,o){if(J2e(t.name,o))return;let i={attributes:t.attributes,kind:zNt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,s=>{r.set(t.id,s.spanContext().spanId),t.links&&s.addLinks(t.links.flatMap(l=>{let f=r.get(l);return f?{context:{spanId:f,traceId:s.spanContext().traceId,traceFlags:s.spanContext().traceFlags}}:[]}));let u=n.filter(l=>l.parentId===t.id);for(let l of u)K2e(e,l,n,r,o);s.end(t.endTime)})}function V2e(e,t){return $Nt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function $Nt(e){return e!=null&&typeof e.then=="function"}function J2e(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var H6,MNt,LNt,kX,PX,LR,GNt,jNt,HNt,Z2e,Y2e,qNt,VNt,W2e,X2e=w(()=>{m();He();H6=ue(q2e(),1);He();MNt={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"}},LNt=MNt.version.split(".")[0],kX="PRISMA_INSTRUMENTATION",PX=`V${LNt}_PRISMA_INSTRUMENTATION`,LR=globalThis;GNt=process.env.PRISMA_SHOW_ALL_TRACES==="true",jNt="00-10-10-00";HNt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Vt.getSpanContext(e??We.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:jNt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)K2e(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return We.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!GNt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(J2e(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return V2e(i,t(i,r))}return n.startActiveSpan(o,e,i=>V2e(i,t(i,r)))}};Z2e={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},Y2e=Z2e.version,qNt=Z2e.name,VNt="@prisma/client",W2e=class extends H6.InstrumentationBase{tracerProvider;constructor(e={}){super(qNt,Y2e,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new H6.InstrumentationNodeModuleDefinition(VNt,[Y2e])]}enable(){let e=this._config;QNt(new HNt({tracerProvider:this.tracerProvider??Vt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){FNt()}isEnabled(){return UNt()!==void 0}}});function YNt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function tLe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function KNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}var eLe,MX,JNt,nLe,rLe=w(()=>{m();He();X2e();At();_r();eLe="Prisma";MX=class extends W2e{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=tLe();YNt(t)&&(t.createEngineSpan=n=>{let r=Vt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Xo(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(i=>{let s=KNt(i.kind),u=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:iu.SAMPLED}})),_=Vt.setSpanContext(We.active(),{traceId:f,spanId:u,traceFlags:iu.SAMPLED});We.with(_,()=>{let y={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=y,r.startSpan(i.name,{kind:s,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};JNt=ct(eLe,e=>new MX(e)),nLe=e=>({name:eLe,setupOnce(){JNt(e)},setup(t){tLe()&&t.on("spanStart",n=>{let r=kt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Mt,"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 oLe=M(UR=>{"use strict";m();Object.defineProperty(UR,"__esModule",{value:!0});UR.PACKAGE_NAME=UR.PACKAGE_VERSION=void 0;UR.PACKAGE_VERSION="0.60.0";UR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var LX=M(rA=>{"use strict";m();Object.defineProperty(rA,"__esModule",{value:!0});rA.HapiLifecycleMethodNames=rA.HapiLayerType=rA.handlerPatched=rA.HapiComponentName=void 0;rA.HapiComponentName="@hapi/hapi";rA.handlerPatched=Symbol("hapi-handler-patched");rA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};rA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var iLe=M($6=>{"use strict";m();Object.defineProperty($6,"__esModule",{value:!0});$6.ATTR_HTTP_METHOD=void 0;$6.ATTR_HTTP_METHOD="http.method"});var UX=M(xO=>{"use strict";m();Object.defineProperty(xO,"__esModule",{value:!0});xO.AttributeNames=void 0;var ZNt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(ZNt=xO.AttributeNames||(xO.AttributeNames={}))});var uLe=M(ls=>{"use strict";m();Object.defineProperty(ls,"__esModule",{value:!0});ls.getPluginFromInput=ls.getExtMetadata=ls.getRouteMetadata=ls.isPatchableExtMethod=ls.isDirectExtInput=ls.isLifecycleExtEventObj=ls.isLifecycleExtType=ls.getPluginName=void 0;var sLe=(Xn(),Me(Hr)),WNt=iLe(),DO=LX(),DE=UX(),aLe=un();function XNt(e){return e.name?e.name:e.pkg.name}ls.getPluginName=XNt;var eBt=e=>typeof e=="string"&&DO.HapiLifecycleMethodNames.has(e);ls.isLifecycleExtType=eBt;var tBt=e=>{let t=e?.type;return t!==void 0&&(0,ls.isLifecycleExtType)(t)};ls.isLifecycleExtEventObj=tBt;var nBt=e=>Array.isArray(e)&&e.length<=3&&(0,ls.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ls.isDirectExtInput=nBt;var rBt=e=>!Array.isArray(e);ls.isPatchableExtMethod=rBt;var oBt=(e,t,n)=>{let r={[sLe.ATTR_HTTP_ROUTE]:e.path};t&aLe.SemconvStability.OLD&&(r[WNt.ATTR_HTTP_METHOD]=e.method),t&aLe.SemconvStability.STABLE&&(r[sLe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.PLUGIN,r[DE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ls.getRouteMetadata=oBt;var iBt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT,[DE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT},name:r}};ls.getExtMetadata=iBt;var sBt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ls.getPluginFromInput=sBt});var dLe=M(q6=>{"use strict";m();Object.defineProperty(q6,"__esModule",{value:!0});q6.HapiInstrumentation=void 0;var ed=(He(),Me(tt)),cLe=vr(),NO=un(),lLe=oLe(),BO=LX(),eh=uLe(),QX=class extends NO.InstrumentationBase{_semconvStability;constructor(t={}){super(lLe.PACKAGE_NAME,lLe.PACKAGE_VERSION,t),this._semconvStability=(0,NO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new NO.InstrumentationNodeModuleDefinition(BO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,NO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,NO.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,r=this;return function(i){let s=t.apply(this,[i]);return r._wrap(s,"route",u=>n._getServerRoutePatch.bind(n)(u)),r._wrap(s,"ext",u=>n._getServerExtPatch.bind(n)(u)),r._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let s of o){let u=(0,eh.getPluginFromInput)(s);n._wrapRegisterHandler(u)}else{let s=(0,eh.getPluginFromInput)(o);n._wrapRegisterHandler(s)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let s=i[0];for(let u=0;u<s.length;u++){let l=s[u];if((0,eh.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[u]=f}}return t.apply(this,i)}else if((0,eh.isDirectExtInput)(i)){let s=i,u=s[1],l=r._wrapExtMethods(u,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,eh.isLifecycleExtEventObj)(i[0])){let s=i[0],u=r._wrapExtMethods(s.method,s.type,n);return s.method=u,t.call(this,s)}return t.apply(this,i)}}_getServerRoutePatch(t,n){let r=this;return function(o){if(Array.isArray(o))for(let i=0;i<o.length;i++){let s=r._wrapRouteHandler.call(r,o[i],n);o[i]=s}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,eh.getPluginName)(t),o=t.register,i=this,s=function(u,l){return i._wrap(u,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(u,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,u,l)};t.register=s}_wrapExtMethods(t,n,r){let o=this;if(t instanceof Array){for(let i=0;i<t.length;i++)t[i]=o._wrapExtMethods(t[i],n);return t}else if((0,eh.isPatchableExtMethod)(t))return t[BO.handlerPatched]===!0?t:(t[BO.handlerPatched]=!0,async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await t.apply(this,s);let u=(0,eh.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:ed.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[BO.handlerPatched]===!0)return t;t[BO.handlerPatched]=!0;let o=i=>async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await i.call(this,...s);let u=(0,cLe.getRPCMetadata)(ed.context.active());u?.type===cLe.RPCType.HTTP&&(u.route=t.path);let l=(0,eh.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:ed.SpanStatusCode.ERROR,message:h.message}),h}finally{f.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(s){let u=i(s);return typeof u.handler=="function"&&(u.handler=o(u.handler)),u}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};q6.HapiInstrumentation=QX});var pLe=M(QR=>{"use strict";m();Object.defineProperty(QR,"__esModule",{value:!0});QR.AttributeNames=QR.HapiInstrumentation=void 0;var aBt=dLe();Object.defineProperty(QR,"HapiInstrumentation",{enumerable:!0,get:function(){return aBt.HapiInstrumentation}});var uBt=UX();Object.defineProperty(QR,"AttributeNames",{enumerable:!0,get:function(){return uBt.AttributeNames}})});var fLe,mLe,ALe,cBt,gLe,hLe=w(()=>{m();fLe=ue(pLe(),1);_r();mLe="Hapi",ALe=ct(mLe,()=>new fLe.HapiInstrumentation),cBt=(()=>({name:mLe,setupOnce(){ALe()}})),gLe=cBt});var NE,wO,FX=w(()=>{m();NE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},wO={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var Y6,lBt,dBt,V6,_Le=w(()=>{m();He();Y6=ue(un(),1);At();FX();lBt="@sentry/instrumentation-hono",dBt="0.0.1",V6=class extends Y6.InstrumentationBase{constructor(t={}){super(lBt,dBt,t)}init(){return[new Y6.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class r extends t.Hono{constructor(...i){super(...i),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{t.Hono=r}catch{return{...t,Hono:r}}return t}_patchHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_patchOnHandler(){let t=this;return function(n){return function(...o){let i=o.slice(2);return n.apply(this,[...o.slice(0,2),...i.map(s=>t._wrapHandler(s))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_wrapHandler(t){let n=this;return function(r,o){if(!n.isEnabled())return t.apply(this,[r,o]);let i=r.req.path,s=n.tracer.startSpan(i);return We.with(Vt.setSpan(We.active(),s),()=>n._safeExecute(()=>{let u=t.apply(this,[r,o]);if(Da(u))return u.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[NE.HONO_TYPE]:f,[NE.HONO_NAME]:f===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(u);return s.setAttributes({[NE.HONO_TYPE]:l,[NE.HONO_NAME]:l===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),u}},()=>s.end(),u=>{n._handleError(s,u),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return Da(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?wO.MIDDLEWARE:wO.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:Ai.ERROR,message:n.message}),t.recordException(n))}}});function pBt(e){let t=kt(e).data,n=t[NE.HONO_TYPE];if(t[Xt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.hono",[Xt]:`${n}.hono`});let r=t[NE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[Rg],i=t[mS];typeof o=="string"&&typeof i=="string"&&Rn().setTransactionName(`${i} ${o}`)}var ELe,yLe,fBt,SLe,TLe=w(()=>{m();Xn();At();_r();YS();FX();_Le();ELe="Hono";yLe=ct(ELe,()=>new V6({responseHook:e=>{pBt(e)}})),fBt=(()=>({name:ELe,setupOnce(){yLe()}})),SLe=fBt});var K6=M(OO=>{"use strict";m();Object.defineProperty(OO,"__esModule",{value:!0});OO.KoaLayerType=void 0;var mBt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(mBt=OO.KoaLayerType||(OO.KoaLayerType={}))});var bLe=M(FR=>{"use strict";m();Object.defineProperty(FR,"__esModule",{value:!0});FR.PACKAGE_NAME=FR.PACKAGE_VERSION=void 0;FR.PACKAGE_VERSION="0.62.0";FR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var GX=M(kO=>{"use strict";m();Object.defineProperty(kO,"__esModule",{value:!0});kO.AttributeNames=void 0;var ABt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(ABt=kO.AttributeNames||(kO.AttributeNames={}))});var CLe=M(GR=>{"use strict";m();Object.defineProperty(GR,"__esModule",{value:!0});GR.isLayerIgnored=GR.getMiddlewareMetadata=void 0;var ILe=K6(),J6=GX(),gBt=(Xn(),Me(Hr)),hBt=(e,t,n,r)=>n?{attributes:{[J6.AttributeNames.KOA_NAME]:r?.toString(),[J6.AttributeNames.KOA_TYPE]:ILe.KoaLayerType.ROUTER,[gBt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[J6.AttributeNames.KOA_NAME]:t.name??"middleware",[J6.AttributeNames.KOA_TYPE]:ILe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};GR.getMiddlewareMetadata=hBt;var _Bt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));GR.isLayerIgnored=_Bt});var vLe=M(Z6=>{"use strict";m();Object.defineProperty(Z6,"__esModule",{value:!0});Z6.kLayerPatched=void 0;Z6.kLayerPatched=Symbol("koa-layer-patched")});var wLe=M(W6=>{"use strict";m();Object.defineProperty(W6,"__esModule",{value:!0});W6.KoaInstrumentation=void 0;var oA=(He(),Me(tt)),PO=un(),RLe=K6(),xLe=bLe(),DLe=CLe(),NLe=vr(),BLe=vLe(),jX=class extends PO.InstrumentationBase{constructor(t={}){super(xLe.PACKAGE_NAME,xLe.PACKAGE_VERSION,t)}init(){return new PO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,PO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;(0,PO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this;return function(o){let i;return o.router?i=n._patchRouterDispatch(o):i=n._patchLayer(o,!1),t.apply(this,[i])}}_patchRouterDispatch(t){oA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,s=o.stack;for(let u=0;u<s.length;u++){let l=s[u];s[u]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?RLe.KoaLayerType.ROUTER:RLe.KoaLayerType.MIDDLEWARE;return t[BLe.kLayerPatched]===!0||(0,DLe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(oA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[BLe.kLayerPatched]=!0,oA.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(oA.trace.getSpan(oA.context.active())===void 0)return t(i,s);let l=(0,DLe.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,NLe.getRPCMetadata)(oA.context.active());h?.type===NLe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:_}=this.getConfig();_&&(0,PO.safeExecuteInTheMiddle)(()=>_(f,{context:i,middlewareLayer:t,layerType:o}),T=>{T&&oA.diag.error("koa instrumentation: request hook failed",T)},!0);let y=oA.trace.setSpan(oA.context.active(),f);return oA.context.with(y,async()=>{try{return await t(i,s)}catch(T){throw f.recordException(T),T}finally{f.end()}})})}};W6.KoaInstrumentation=jX});var OLe=M(BE=>{"use strict";m();Object.defineProperty(BE,"__esModule",{value:!0});BE.KoaLayerType=BE.AttributeNames=BE.KoaInstrumentation=void 0;var EBt=wLe();Object.defineProperty(BE,"KoaInstrumentation",{enumerable:!0,get:function(){return EBt.KoaInstrumentation}});var yBt=GX();Object.defineProperty(BE,"AttributeNames",{enumerable:!0,get:function(){return yBt.AttributeNames}});var SBt=K6();Object.defineProperty(BE,"KoaLayerType",{enumerable:!0,get:function(){return SBt.KoaLayerType}})});var kLe,PLe,MLe,TBt,LLe,ULe=w(()=>{m();kLe=ue(OLe(),1);Xn();At();_r();YS();PLe="Koa",MLe=ct(PLe,kLe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){qr(t,"auto.http.otel.koa");let r=kt(t).data,o=r["koa.type"];o&&t.setAttribute(Xt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[Rg],u=n.context?.request?.method?.toUpperCase()||"GET";s&&Rn().setTransactionName(`${u} ${s}`)}})),TBt=((e={})=>({name:PLe,setupOnce(){MLe(e)}})),LLe=TBt});var zX=M(Nf=>{"use strict";m();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.ConnectNames=Nf.ConnectTypes=Nf.AttributeNames=void 0;var bBt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(bBt=Nf.AttributeNames||(Nf.AttributeNames={}));var IBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(IBt=Nf.ConnectTypes||(Nf.ConnectTypes={}));var CBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(CBt=Nf.ConnectNames||(Nf.ConnectNames={}))});var QLe=M(jR=>{"use strict";m();Object.defineProperty(jR,"__esModule",{value:!0});jR.PACKAGE_NAME=jR.PACKAGE_VERSION=void 0;jR.PACKAGE_VERSION="0.57.0";jR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var FLe=M(X6=>{"use strict";m();Object.defineProperty(X6,"__esModule",{value:!0});X6._LAYERS_STORE_PROPERTY=void 0;X6._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var GLe=M(OE=>{"use strict";m();Object.defineProperty(OE,"__esModule",{value:!0});OE.generateRoute=OE.replaceCurrentStackRoute=OE.addNewStackLayer=void 0;var vBt=(He(),Me(tt)),wE=FLe(),RBt=e=>{Array.isArray(e[wE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,wE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[wE._LAYERS_STORE_PROPERTY].push("/");let t=e[wE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[wE._LAYERS_STORE_PROPERTY].length?e[wE._LAYERS_STORE_PROPERTY].pop():vBt.diag.warn("Connect: Trying to pop the stack multiple time")}};OE.addNewStackLayer=RBt;var xBt=(e,t)=>{t&&e[wE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};OE.replaceCurrentStackRoute=xBt;var DBt=e=>e[wE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);OE.generateRoute=DBt});var HLe=M(kE=>{"use strict";m();Object.defineProperty(kE,"__esModule",{value:!0});kE.ConnectInstrumentation=kE.ANONYMOUS_NAME=void 0;var NBt=(He(),Me(tt)),jLe=vr(),zR=zX(),zLe=QLe(),eG=un(),BBt=(Xn(),Me(Hr)),HX=GLe();kE.ANONYMOUS_NAME="anonymous";var $X=class extends eG.InstrumentationBase{constructor(t={}){super(zLe.PACKAGE_NAME,zLe.PACKAGE_VERSION,t)}init(){return[new eG.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,eG.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,eG.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this;return function(...r){let o=t.apply(this,r);return n._patchApp(o),o}}_patchNext(t,n){return function(o){let i=t.apply(this,[o]);return n(),i}}_startSpan(t,n){let r,o,i;t?(r=zR.ConnectTypes.REQUEST_HANDLER,i=zR.ConnectNames.REQUEST_HANDLER,o=t):(r=zR.ConnectTypes.MIDDLEWARE,i=zR.ConnectNames.MIDDLEWARE,o=n.name||kE.ANONYMOUS_NAME);let s=`${i} - ${o}`,u={attributes:{[BBt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[zR.AttributeNames.CONNECT_TYPE]:r,[zR.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,u)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,u,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[u],_=arguments[l];(0,HX.replaceCurrentStackRoute)(f,t);let y=(0,jLe.getRPCMetadata)(NBt.context.active());t&&y?.type===jLe.RPCType.HTTP&&(y.route=(0,HX.generateRoute)(f));let T="";t?T=`request handler - ${t}`:T=`middleware - ${n.name||kE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",T);let R=!1;function x(){R?r._diag.debug(`span ${v.name} - already finished`):(R=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",x)}return h.addListener("close",x),arguments[l]=r._patchNext(_,x),n.apply(this,arguments)}return Object.defineProperty(i,"length",{value:n.length,writable:!1,configurable:!0}),i}_patchUse(t){let n=this;return function(...r){let o=r[r.length-1],i=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(i,o),t.apply(this,r)}}_patchHandle(t){let n=this;return function(){let[r,o]=[0,2],i=arguments[r],s=arguments[o],u=(0,HX.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,u)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};kE.ConnectInstrumentation=$X});var qLe=M(fp=>{"use strict";m();Object.defineProperty(fp,"__esModule",{value:!0});fp.ConnectTypes=fp.ConnectNames=fp.AttributeNames=fp.ANONYMOUS_NAME=fp.ConnectInstrumentation=void 0;var $Le=HLe();Object.defineProperty(fp,"ConnectInstrumentation",{enumerable:!0,get:function(){return $Le.ConnectInstrumentation}});Object.defineProperty(fp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return $Le.ANONYMOUS_NAME}});var qX=zX();Object.defineProperty(fp,"AttributeNames",{enumerable:!0,get:function(){return qX.AttributeNames}});Object.defineProperty(fp,"ConnectNames",{enumerable:!0,get:function(){return qX.ConnectNames}});Object.defineProperty(fp,"ConnectTypes",{enumerable:!0,get:function(){return qX.ConnectTypes}})});var VLe,YLe,KLe,wBt,JLe,ZLe=w(()=>{m();VLe=ue(qLe(),1);_r();YLe="Connect",KLe=ct(YLe,()=>new VLe.ConnectInstrumentation),wBt=(()=>({name:YLe,setupOnce(){KLe()}})),JLe=wBt});var WLe=M(la=>{"use strict";m();Object.defineProperty(la,"__esModule",{value:!0});la.DB_SYSTEM_VALUE_MSSQL=la.ATTR_NET_PEER_PORT=la.ATTR_NET_PEER_NAME=la.ATTR_DB_USER=la.ATTR_DB_SYSTEM=la.ATTR_DB_STATEMENT=la.ATTR_DB_SQL_TABLE=la.ATTR_DB_NAME=void 0;la.ATTR_DB_NAME="db.name";la.ATTR_DB_SQL_TABLE="db.sql.table";la.ATTR_DB_STATEMENT="db.statement";la.ATTR_DB_SYSTEM="db.system";la.ATTR_DB_USER="db.user";la.ATTR_NET_PEER_NAME="net.peer.name";la.ATTR_NET_PEER_PORT="net.peer.port";la.DB_SYSTEM_VALUE_MSSQL="mssql"});var XLe=M(HR=>{"use strict";m();Object.defineProperty(HR,"__esModule",{value:!0});HR.once=HR.getSpanName=void 0;function OBt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}HR.getSpanName=OBt;var kBt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};HR.once=kBt});var eUe=M($R=>{"use strict";m();Object.defineProperty($R,"__esModule",{value:!0});$R.PACKAGE_NAME=$R.PACKAGE_VERSION=void 0;$R.PACKAGE_VERSION="0.33.0";$R.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var iUe=M(ME=>{"use strict";m();Object.defineProperty(ME,"__esModule",{value:!0});ME.TediousInstrumentation=ME.INJECTED_CTX=void 0;var qR=(He(),Me(tt)),PBt=Ue("events"),iA=un(),sT=(Xn(),Me(Hr)),PE=WLe(),tUe=XLe(),nUe=eUe(),oUe=Symbol("opentelemetry.instrumentation-tedious.current-database");ME.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var rUe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function tG(e){Object.defineProperty(this,oUe,{value:e,writable:!0})}var VX=class e extends iA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(nUe.PACKAGE_NAME,nUe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,iA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,iA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new iA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of rUe)(0,iA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,iA.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let r of rUe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return tG.call(this,this.config?.options?.database),this.removeListener("databaseChange",tG),this.on("databaseChange",tG),this.once("end",()=>{this.removeListener("databaseChange",tG)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||qR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",s=new n.Request(i,l=>{o()});Object.defineProperty(s,ME.INJECTED_CTX,{value:!0});let u=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,u,{length:u.length}),t.execSql(s)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(s){if(s?.[ME.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof PBt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let u=0,l=0,f=()=>l++,h=()=>u++,_=this[oUe],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),T={};o._dbSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_DB_SYSTEM]=PE.DB_SYSTEM_VALUE_MSSQL,T[PE.ATTR_DB_NAME]=_,T[PE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,T[PE.ATTR_DB_STATEMENT]=y,T[PE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_DB_NAMESPACE]=_,T[sT.ATTR_DB_SYSTEM_NAME]=sT.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,T[sT.ATTR_DB_QUERY_TEXT]=y,T[sT.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_NET_PEER_NAME]=this.config?.server,T[PE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_SERVER_ADDRESS]=this.config?.server,T[sT.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,tUe.getSpanName)(t,_,y,s.table),{kind:qR.SpanKind.CLIENT,attributes:T}),R=(0,tUe.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",R),this.removeListener("end",R),v.setAttribute("tedious.procedure_count",u),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:qR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",R),this.on("end",R),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(R)):o._diag.error("Expected request.callback to be a function");let x=()=>qR.context.with(qR.trace.setSpan(qR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return x();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(x)}return Object.defineProperty(i,"length",{value:r.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r),n.apply(this,arguments)}}};ME.TediousInstrumentation=VX});var sUe=M(nG=>{"use strict";m();Object.defineProperty(nG,"__esModule",{value:!0});nG.TediousInstrumentation=void 0;var MBt=iUe();Object.defineProperty(nG,"TediousInstrumentation",{enumerable:!0,get:function(){return MBt.TediousInstrumentation}})});var aUe,LBt,uUe,cUe,UBt,lUe,dUe=w(()=>{m();aUe=ue(sUe(),1);At();_r();LBt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),uUe="Tedious",cUe=ct(uUe,()=>new aUe.TediousInstrumentation({})),UBt=(()=>{let e;return{name:uUe,setupOnce(){let t=cUe();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=kt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";LBt.has(i)&&n.setAttribute(Mt,"auto.db.otel.tedious")}))}}}),lUe=UBt});var pUe=M(VR=>{"use strict";m();Object.defineProperty(VR,"__esModule",{value:!0});VR.PACKAGE_NAME=VR.PACKAGE_VERSION=void 0;VR.PACKAGE_VERSION="0.57.0";VR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var mUe=M(rG=>{"use strict";m();Object.defineProperty(rG,"__esModule",{value:!0});rG.GenericPoolInstrumentation=void 0;var YR=(He(),Me(tt)),aT=un(),fUe=pUe(),YX="generic-pool",KX=class extends aT.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(fUe.PACKAGE_NAME,fUe.PACKAGE_VERSION,t)}init(){return[new aT.InstrumentationNodeModuleDefinition(YX,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,aT.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new aT.InstrumentationNodeModuleDefinition(YX,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,aT.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new aT.InstrumentationNodeModuleDefinition(YX,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,aT.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let n=this;return function(...o){let i=YR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return YR.context.with(YR.trace.setSpan(i,s),()=>t.call(this,...o).then(u=>(s.end(),u),u=>{throw s.recordException(u),s.end(),u}))}}_poolWrapper(t){let n=this;return function(){let o=t.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(t){let n=this;return function(o,i){if(n._isDisabled)return t.call(this,o,i);let s=YR.context.active(),u=n.tracer.startSpan("generic-pool.acquire",{},s);return YR.context.with(YR.trace.setSpan(s,u),()=>{t.call(this,(l,f)=>{if(u.end(),o)return o(l,f)},i)})}}};rG.GenericPoolInstrumentation=KX});var AUe=M(oG=>{"use strict";m();Object.defineProperty(oG,"__esModule",{value:!0});oG.GenericPoolInstrumentation=void 0;var QBt=mUe();Object.defineProperty(oG,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return QBt.GenericPoolInstrumentation}})});var gUe,hUe,_Ue,FBt,EUe,yUe=w(()=>{m();gUe=ue(AUe(),1);At();_r();hUe="GenericPool",_Ue=ct(hUe,()=>new gUe.GenericPoolInstrumentation({})),FBt=(()=>{let e;return{name:hUe,setupOnce(){let t=_Ue();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=kt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Mt,"auto.db.otel.generic_pool")}))}}}),EUe=FBt});var JX=M(sA=>{"use strict";m();Object.defineProperty(sA,"__esModule",{value:!0});sA.ATTR_NET_PEER_PORT=sA.ATTR_NET_PEER_NAME=sA.ATTR_MESSAGING_SYSTEM=sA.ATTR_MESSAGING_OPERATION=void 0;sA.ATTR_MESSAGING_OPERATION="messaging.operation";sA.ATTR_MESSAGING_SYSTEM="messaging.system";sA.ATTR_NET_PEER_NAME="net.peer.name";sA.ATTR_NET_PEER_PORT="net.peer.port"});var ZX=M(yi=>{"use strict";m();Object.defineProperty(yi,"__esModule",{value:!0});yi.ATTR_MESSAGING_CONVERSATION_ID=yi.OLD_ATTR_MESSAGING_MESSAGE_ID=yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=yi.ATTR_MESSAGING_URL=yi.ATTR_MESSAGING_PROTOCOL_VERSION=yi.ATTR_MESSAGING_PROTOCOL=yi.MESSAGING_OPERATION_VALUE_PROCESS=yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=yi.ATTR_MESSAGING_DESTINATION_KIND=yi.ATTR_MESSAGING_DESTINATION=void 0;yi.ATTR_MESSAGING_DESTINATION="messaging.destination";yi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";yi.MESSAGING_OPERATION_VALUE_PROCESS="process";yi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";yi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";yi.ATTR_MESSAGING_URL="messaging.url";yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";yi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";yi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var WX=M(uT=>{"use strict";m();Object.defineProperty(uT,"__esModule",{value:!0});uT.DEFAULT_CONFIG=uT.EndOperation=void 0;var GBt;(function(e){e.AutoAck="auto ack",e.Ack="ack",e.AckAll="ackAll",e.Reject="reject",e.Nack="nack",e.NackAll="nackAll",e.ChannelClosed="channel closed",e.ChannelError="channel error",e.InstrumentationTimeout="instrumentation timeout"})(GBt=uT.EndOperation||(uT.EndOperation={}));uT.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var IUe=M(Si=>{"use strict";m();Object.defineProperty(Si,"__esModule",{value:!0});Si.isConfirmChannelTracing=Si.unmarkConfirmChannelTracing=Si.markConfirmChannelTracing=Si.getConnectionAttributesFromUrl=Si.getConnectionAttributesFromServer=Si.normalizeExchange=Si.CONNECTION_ATTRIBUTES=Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Si.CHANNEL_SPANS_NOT_ENDED=Si.MESSAGE_STORED_SPAN=void 0;var XX=(He(),Me(tt)),LE=un(),iG=(Xn(),Me(Hr)),MO=JX(),sG=ZX();Si.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Si.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Si.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var eee=(0,XX.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),jBt=e=>e!==""?e:"<default>";Si.normalizeExchange=jBt;var zBt=e=>e.replace(/:[^:@/]*@/,":***@"),SUe=(e,t)=>e||(t==="AMQP"?5672:5671),TUe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},bUe=e=>e||"localhost",aA=(e,t,n,r)=>n?{[t]:n}:(XX.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),HBt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[MO.ATTR_MESSAGING_SYSTEM]:t}:{}};Si.getConnectionAttributesFromServer=HBt;var $Bt=(e,t)=>{let n={[sG.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=TUe(r?.protocol);Object.assign(n,{...aA(e,sG.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=bUe(r?.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(e,MO.ATTR_NET_PEER_NAME,i,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(e,iG.ATTR_SERVER_ADDRESS,i,"hostname")});let s=SUe(r.port,o);t&LE.SemconvStability.OLD&&Object.assign(n,aA(e,MO.ATTR_NET_PEER_PORT,s,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(e,iG.ATTR_SERVER_PORT,s,"port"))}else{let r=zBt(e);n[sG.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=TUe(o.protocol);Object.assign(n,{...aA(r,sG.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=bUe(o.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(r,MO.ATTR_NET_PEER_NAME,s,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(r,iG.ATTR_SERVER_ADDRESS,s,"hostname")});let u=SUe(o.port?parseInt(o.port):void 0,i);t&LE.SemconvStability.OLD&&Object.assign(n,aA(r,MO.ATTR_NET_PEER_PORT,u,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(r,iG.ATTR_SERVER_PORT,u,"port"))}catch(o){XX.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Si.getConnectionAttributesFromUrl=$Bt;var qBt=e=>e.setValue(eee,!0);Si.markConfirmChannelTracing=qBt;var VBt=e=>e.deleteValue(eee);Si.unmarkConfirmChannelTracing=VBt;var YBt=e=>e.getValue(eee)===!0;Si.isConfirmChannelTracing=YBt});var CUe=M(KR=>{"use strict";m();Object.defineProperty(KR,"__esModule",{value:!0});KR.PACKAGE_NAME=KR.PACKAGE_VERSION=void 0;KR.PACKAGE_VERSION="0.61.0";KR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var RUe=M(cG=>{"use strict";m();Object.defineProperty(cG,"__esModule",{value:!0});cG.AmqplibInstrumentation=void 0;var ri=(He(),Me(tt)),aG=vr(),xr=un(),KBt=JX(),td=ZX(),oc=WX(),Ti=IUe(),vUe=CUe(),uG=[">=0.5.5 <1"],tee=class extends xr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(vUe.PACKAGE_NAME,vUe.PACKAGE_VERSION,{...oc.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...oc.DEFAULT_CONFIG,...t})}init(){let t=new xr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",uG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new xr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",uG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new xr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",uG,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new xr.InstrumentationNodeModuleDefinition("amqplib",uG,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,xr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,xr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,xr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,oc.EndOperation.Ack)),(0,xr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,oc.EndOperation.Nack)),(0,xr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,oc.EndOperation.Reject)),(0,xr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,oc.EndOperation.AckAll)),(0,xr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,oc.EndOperation.NackAll)),(0,xr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,xr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,xr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,xr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,xr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,xr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,xr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,xr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,xr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,xr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,xr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,s){return t.call(this,o,i,function(u,l){if(u==null){let f=(0,Ti.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,Ti.getConnectionAttributesFromServer)(l);l[Ti.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelClosed,void 0);let i=this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(s){return o.endAllSpansOnChannel(this,t,n,s),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(s,u,l){let f=this,h=n===oc.EndOperation.Reject?u:l,_=f[Ti.CHANNEL_SPANS_NOT_ENDED]??[],y=_.findIndex(T=>T.msg===s);if(y<0)o.endConsumerSpan(s,t,n,h);else if(n!==oc.EndOperation.Reject&&u){for(let T=0;T<=y;T++)o.endConsumerSpan(_[T].msg,t,n,h);_.splice(0,y+1)}else o.endConsumerSpan(s,t,n,h),_.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,u){let l=this;if(!Object.prototype.hasOwnProperty.call(l,Ti.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let _=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);_.unref(),l[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=_}l[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let _=h.properties.headers??{},y=ri.propagation.extract(ri.ROOT_CONTEXT,_),T=h.fields?.exchange,v;if(r._config.useLinksForConsume){let P=y?ri.trace.getSpan(y)?.spanContext():void 0;y=void 0,P&&(v=[{context:P}])}let R=r.tracer.startSpan(`${i} process`,{kind:ri.SpanKind.CONSUMER,attributes:{...l?.connection?.[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:T,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[KBt.ATTR_MESSAGING_OPERATION]:td.MESSAGING_OPERATION_VALUE_PROCESS,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:x}=r.getConfig();x&&(0,xr.safeExecuteInTheMiddle)(()=>x(R,{moduleVersion:t,msg:h}),P=>{P&&ri.diag.error("amqplib instrumentation: consumerHook error",P)},!0),u?.noAck||(l[Ti.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,aG.hrTime)()}),h[Ti.MESSAGE_STORED_SPAN]=R);let O=y||ri.ROOT_CONTEXT;ri.context.with(ri.trace.setSpan(O,R),()=>{s.call(this,h)}),u?.noAck&&(r.callConsumeEndHook(R,h,!1,oc.EndOperation.AutoAck),R.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,u,l,f){let h=this,{span:_,modifiedOptions:y}=r.createPublishSpan(r,i,s,h,l),{publishHook:T}=r.getConfig();T&&(0,xr.safeExecuteInTheMiddle)(()=>T(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:y,isConfirmChannel:!0}),O=>{O&&ri.diag.error("amqplib instrumentation: publishHook error",O)},!0);let v=function(O,P){try{f?.call(this,O,P)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,xr.safeExecuteInTheMiddle)(()=>j(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:l,isConfirmChannel:!0,confirmError:O}),G=>{G&&ri.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),O&&_.setStatus({code:ri.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),_.end()}},R=(0,Ti.markConfirmChannelTracing)(ri.context.active()),x=[...arguments];return x[3]=y,x[4]=ri.context.bind((0,Ti.unmarkConfirmChannelTracing)(ri.trace.setSpan(R,_)),v),ri.context.with(R,n.bind(this,...x))}}getPublishPatch(t,n){let r=this;return function(i,s,u,l){if((0,Ti.isConfirmChannelTracing)(ri.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:_}=r.createPublishSpan(r,i,s,f,l),{publishHook:y}=r.getConfig();y&&(0,xr.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:_,isConfirmChannel:!1}),R=>{R&&ri.diag.error("amqplib instrumentation: publishHook error",R)},!0);let T=[...arguments];T[3]=_;let v=n.apply(this,T);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,Ti.normalizeExchange)(n),u=t.tracer.startSpan(`publish ${s}`,{kind:ri.SpanKind.PRODUCER,attributes:{...o.connection[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:n,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},ri.propagation.inject(ri.trace.setSpan(ri.context.active(),u),l.headers),{span:u,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[Ti.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:ri.SpanStatusCode.ERROR,message:r!==oc.EndOperation.ChannelClosed&&r!==oc.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[Ti.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[Ti.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,xr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&ri.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,aG.hrTime)(),r=t[Ti.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],u=(0,aG.hrTimeDuration)(s.timeOfConsume,n);if((0,aG.hrTimeToMilliseconds)(u)<i)break;this.endConsumerSpan(s.msg,null,oc.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};cG.AmqplibInstrumentation=tee});var DUe=M(UE=>{"use strict";m();Object.defineProperty(UE,"__esModule",{value:!0});UE.EndOperation=UE.DEFAULT_CONFIG=UE.AmqplibInstrumentation=void 0;var JBt=RUe();Object.defineProperty(UE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return JBt.AmqplibInstrumentation}});var xUe=WX();Object.defineProperty(UE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return xUe.DEFAULT_CONFIG}});Object.defineProperty(UE,"EndOperation",{enumerable:!0,get:function(){return xUe.EndOperation}})});var NUe,BUe,ZBt,wUe,WBt,OUe,kUe=w(()=>{m();NUe=ue(DUe(),1);_r();BUe="Amqplib",ZBt={consumeEndHook:e=>{qr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{qr(e,"auto.amqplib.otel.publisher")}},wUe=ct(BUe,()=>new NUe.AmqplibInstrumentation(ZBt)),WBt=(()=>({name:BUe,setupOnce(){wUe()}})),OUe=WBt});var LO,nee=w(()=>{m();LO="VercelAI"});function ewt(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&"error"in t&&"toolName"in t&&"toolCallId"in t&&t.type==="tool-error"&&t.error instanceof Error}function twt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(nwt(t.content),rwt(t.content))}function nwt(e){for(let t of e){if(!ewt(t))continue;let n=wK(t.toolCallId);n?zl(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):zl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function rwt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&OK(t.toolCallId)}function owt(e,t,n,r){let o=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:r,i=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:i}}var dG,XBt,PUe,lG,MUe=w(()=>{m();dG=ue(un(),1);At();nee();XBt=[">=3.0.0 <7"],PUe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];lG=class e extends dG.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",er,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new dG.InstrumentationNodeModuleDefinition("ai",XBt,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,i,s)=>{let u=s[0].experimental_telemetry||{},l=u.isEnabled,f=Et(),h=f?.getIntegrationByName(LO),_=h?.options,y=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:T,recordOutputs:v}=owt(_,u,l,y);return s[0].experimental_telemetry={...u,isEnabled:l!==void 0?l:!0,recordInputs:T,recordOutputs:v},If(()=>Reflect.apply(o,i,s),R=>{R&&typeof R=="object"&&ns(R,"_sentry_active_span",Hc())},()=>{},R=>{twt(R)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of PUe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=PUe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function iwt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var LUe,swt,UUe,QUe=w(()=>{m();At();_r();nee();MUe();LUe=ct(LO,()=>new lG({}));swt=((e={})=>{let t;return{name:LO,options:e,setupOnce(){t=LUe()},afterAllSetup(n){e.force??iwt(n)?gF(n):t?.callWhenPatched(()=>gF(n))}}}),UUe=swt});var fG,awt,pG,FUe=w(()=>{m();fG=ue(un(),1);At();awt=[">=4.0.0 <7"],pG=class extends fG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",er,t)}init(){return new fG.InstrumentationNodeModuleDefinition("openai",awt,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let r=t[n];if(!r)return t;let o=this.getConfig(),i=function(...s){if(BS(uE))return Reflect.construct(r,s);let u=Reflect.construct(r,s);return EF(u,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}try{t[n]=i}catch{Object.defineProperty(t,n,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}}});var GUe,uwt,jUe,zUe=w(()=>{m();At();_r();FUe();GUe=ct(uE,e=>new pG(e)),uwt=((e={})=>({name:uE,setupOnce(){GUe(e)}})),jUe=uwt});var AG,cwt,mG,HUe=w(()=>{m();AG=ue(un(),1);At();cwt=[">=0.19.2 <1.0.0"],mG=class extends AG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",er,t)}init(){return new AG.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",cwt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(BS(cE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return yF(s,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}try{t.Anthropic=o}catch{Object.defineProperty(t,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=o}catch{Object.defineProperty(t,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return t}}});var $Ue,lwt,qUe,VUe=w(()=>{m();At();_r();HUe();$Ue=ct(cE,e=>new mG(e)),lwt=((e={})=>({name:cE,options:e,setupOnce(){$Ue(e)}})),qUe=lwt});var JR,YUe,gG,KUe=w(()=>{m();JR=ue(un(),1);At();YUe=[">=0.10.0 <2"],gG=class extends JR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",er,t)}init(){return new JR.InstrumentationNodeModuleDefinition("@google/genai",YUe,n=>this._patch(n),n=>n,[new JR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",YUe,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return t;let o=function(...i){if(BS(lE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return SF(s,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}return gw(t,"GoogleGenAI",o),t}}});var JUe,dwt,ZUe,WUe=w(()=>{m();At();_r();KUe();JUe=ct(lE,e=>new gG(e)),dwt=((e={})=>({name:lE,setupOnce(){JUe(e)}})),ZUe=dwt});function pwt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function fwt(e,t,n){return new Proxy(e,{apply(r,o,i){let u=i[1];(!u||typeof u!="object"||Array.isArray(u))&&(u={},i[1]=u);let l=u.callbacks,f=pwt(l,t);return u.callbacks=f,Reflect.apply(r,o,i)}})}var QE,hG,_G,XUe=w(()=>{m();QE=ue(un(),1);At();hG=[">=0.1.0 <2.0.0"];_G=class extends QE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",er,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)t.push(new QE.InstrumentationNodeModuleDefinition(r,hG,this._patch.bind(this),o=>o,[new QE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,hG,this._patch.bind(this),o=>o)]));return t.push(new QE.InstrumentationNodeModuleDefinition("langchain",hG,this._patch.bind(this),r=>r,[new QE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",hG,this._patch.bind(this),r=>r)])),t}_patch(t){KY([uE,cE,lE]);let n=CF(this.getConfig());return this._patchRunnableMethods(t,n),t}_patchRunnableMethods(t,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=t.universal_exports??t,i=Object.values(o).find(l=>typeof l=="function"&&r.includes(l.name));if(!i)return;let s=i.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let u=["invoke","stream","batch"];for(let l of u){let f=s[l];typeof f=="function"&&(s[l]=fwt(f,n))}}}});var eQe,mwt,tQe,nQe=w(()=>{m();At();_r();XUe();eQe=ct(TF,e=>new _G(e)),mwt=((e={})=>({name:TF,setupOnce(){eQe(e)}})),tQe=mwt});var ZR,rQe,EG,oQe=w(()=>{m();ZR=ue(un(),1);At();rQe=[">=0.0.0 <2.0.0"],EG=class extends ZR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",er,t)}init(){return new ZR.InstrumentationNodeModuleDefinition("@langchain/langgraph",rQe,this._patch.bind(this),n=>n,[new ZR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",rQe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&RF(t.StateGraph.prototype,this.getConfig()),t}}});var iQe,Awt,sQe,aQe=w(()=>{m();At();_r();oQe();iQe=ct(vF,e=>new EG(e)),Awt=((e={})=>({name:vF,setupOnce(){iQe(e)}})),sQe=Awt});import*as cQe from"node:net";function lQe(e,t,n,r,o){let s=()=>{},u=o.firestoreSpanCreationHook;typeof u=="function"&&(s=h=>{(0,th.safeExecuteInTheMiddle)(()=>u(h),_=>{_&&Fl.error(_?.message)},!0)});let l=new th.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>uQe(h,n,r,e,s)),f=["@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 h of f)l.files.push(new th.InstrumentationNodeModuleFile(h,t,_=>uQe(_,n,r,e,s),_=>dQe(_,r)));return l}function uQe(e,t,n,r,o){return dQe(e,n),t(e,"addDoc",gwt(r,o)),t(e,"getDocs",_wt(r,o)),t(e,"setDoc",Ewt(r,o)),t(e,"deleteDoc",hwt(r,o)),e}function dQe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,th.isWrapped)(e[n])&&t(e,n);return e}function gwt(e,t){return function(r){return function(o,i){let s=SG(e,"addDoc",o);return t(s),yG(s,()=>r(o,i))}}}function hwt(e,t){return function(r){return function(o){let i=SG(e,"deleteDoc",o.parent||o);return t(i),yG(i,()=>r(o))}}}function _wt(e,t){return function(r){return function(o){let i=SG(e,"getDocs",o);return t(i),yG(i,()=>r(o))}}}function Ewt(e,t){return function(r){return function(o,i,s){let u=SG(e,"setDoc",o.parent||o);return t(u),yG(u,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function yG(e,t){return We.with(Vt.setSpan(We.active(),e),()=>(0,th.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function SG(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:fo.CLIENT});return Swt(r,n),r.setAttribute(LC,t),r}function ywt(e){let t,n;if(typeof e.host=="string")if(e.host.startsWith("[")){if(e.host.endsWith("]"))t=e.host.replace(/^\[|\]$/g,"");else if(e.host.includes("]:")){let r=e.host.lastIndexOf(":");r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,""),n=e.host.slice(r+1))}}else if(cQe.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function Swt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[EV]:t.path,[yV]:n.name,[fS]:"firebase.firestore","firebase.firestore.type":t.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:u,port:l}=ywt(i);u&&(s[xV]=u),l&&(s[DV]=l),e.setAttributes(s)}var th,pQe=w(()=>{m();He();th=ue(un(),1);Xn()});function fQe(e,t,n,r,o){let i=()=>{},s=()=>{},u=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(y,T)=>{(0,nh.safeExecuteInTheMiddle)(()=>f(y,T),v=>{v&&Fl.error(v?.message)},!0)}),typeof l=="function"&&(i=y=>{(0,nh.safeExecuteInTheMiddle)(()=>l(y),T=>{T&&Fl.error(T?.message)},!0)});let h=new nh.InstrumentationNodeModuleDefinition("firebase-functions",t);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:y,triggerType:T})=>{h.files.push(new nh.InstrumentationNodeModuleFile(y,t,v=>Twt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:u},T),v=>mQe(v,r)))}),h}function ic(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],u=typeof i[0]=="function"?void 0:i[0];if(!s)return o.call(this,...i);let l=async function(...f){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",_=e.startSpan(`firebase.function.${n}`,{kind:fo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),_.setAttributes(y),t?.requestHook?.(_),We.with(Vt.setSpan(We.active(),_),async()=>{let T,v;try{v=await s.apply(this,f)}catch(R){T=R}if(t?.responseHook?.(_,T),T&&_.recordException(T),_.end(),T)throw await t?.errorHook?.(_,T),T;return v})};return u?o.call(this,u,l):o.call(this,l)}}}function Twt(e,t,n,r,o,i){switch(mQe(e,n),i){case"function":t(e,"onRequest",ic(r,o,"http.request")),t(e,"onCall",ic(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",ic(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",ic(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",ic(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",ic(r,o,"storage.object.finalized")),t(e,"onObjectArchived",ic(r,o,"storage.object.archived")),t(e,"onObjectDeleted",ic(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",ic(r,o,"storage.object.metadataUpdated"));break}return e}function mQe(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,nh.isWrapped)(e[r])&&t(e,r);return e}var nh,AQe=w(()=>{m();He();nh=ue(un(),1)});var hQe,gQe,bwt,Iwt,TG,_Qe=w(()=>{m();hQe=ue(un(),1);At();pQe();AQe();gQe={},bwt=[">=3.0.0 <5"],Iwt=[">=6.0.0 <7"],TG=class extends hQe.InstrumentationBase{constructor(t=gQe){super("@sentry/instrumentation-firebase",er,t)}setConfig(t={}){super.setConfig({...gQe,...t})}init(){let t=[];return t.push(lQe(this.tracer,bwt,this._wrap,this._unwrap,this.getConfig())),t.push(fQe(this.tracer,Iwt,this._wrap,this._unwrap,this.getConfig())),t}}});var EQe,Cwt,yQe,vwt,SQe,TQe=w(()=>{m();At();_r();_Qe();EQe="Firebase",Cwt={firestoreSpanCreationHook:e=>{qr(e,"auto.firebase.otel.firestore"),e.setAttribute(Xt,"db.query")},functions:{requestHook:e=>{qr(e,"auto.firebase.otel.functions"),e.setAttribute(Xt,"http.request")},errorHook:async(e,t)=>{t&&(rn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Sv(2e3))}}},yQe=ct(EQe,()=>new TG(Cwt)),vwt=(()=>({name:EQe,setupOnce(){yQe()}})),SQe=vwt});function bQe(){return[vwe(),ske(),Oke(),SLe(),yPe(),PPe(),VPe(),iMe(),LMe(),o2e(),nLe(),gLe(),LLe(),JLe(),lUe(),EUe(),Jke(),OUe(),aPe(),tQe(),sQe(),UUe(),jUe(),qUe(),ZUe(),u2e(),SQe()]}var IQe=w(()=>{m();kUe();VUe();ZLe();Rwe();cke();TQe();yUe();WUe();Pke();hLe();TLe();Zke();ULe();nQe();aQe();uPe();SPe();MPe();YPe();sMe();zUe();i2e();c2e();rLe();UMe();dUe();QUe()});function vQe(e,t={}){e.getOptions().debug&&lZ();let[n,r]=Rwt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function Rwt(e,t={}){let n=new CQe.BasicTracerProvider({sampler:new O4(e),resource:(0,bG.defaultResource)().merge((0,bG.resourceFromAttributes)({[NV]:"node",[_V]:"sentry",[BV]:er})),forceFlushTimeoutMillis:500,spanProcessors:[new w4({timeout:xwt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Vt.setGlobalTracerProvider(n),mf.setGlobalPropagator(new B4);let r=new P4;return We.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function xwt(e){if(e!=null){if(e>ree)return Ds&&W.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ree}`),ree;if(e<=0||Number.isNaN(e)){Ds&&W.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var bG,CQe,ree,RQe=w(()=>{m();He();bG=ue(bJ(),1),CQe=ue(KJ(),1);Xn();At();_r();Xv();YS();ree=1e6});function xQe(){return j4().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(nwe(),dwe())}function DQe(e){return[...xQe(),...Mi(e)?bQe():[]]}function oee(e={}){return Dwt(e,DQe)}function Dwt(e={},t){wS(e,"node");let n=MZ({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(vQe(n,{spanProcessors:e.openTelemetrySpanProcessors}),z4()),n}var NQe=w(()=>{m();At();_r();rwe();pwe();IQe();RQe()});var WR=w(()=>{m();NQe();At();_r()});function Kr(){return Nwt}function _u(){return BQe}function wQe(){return Bwt}var Nwt,BQe,Bwt,sc=w(()=>{"use strict";m();Nwt="prod",BQe="0.1.198",Bwt=`@loredotlink/cli/${BQe}`});function Mwt(e=""){if(!kwt.test(e))return e!==e.toLowerCase()}function kQe(e,t){let n=t??Pwt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let u of e){let l=n.includes(u);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Mwt(u);if(s===!1){if(i===!1&&f===!0){r.push(o),o=u,i=f;continue}if(i===!0&&f===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+u,i=f;continue}}o+=u,i=f,s=l}return r.push(o),r}function Lwt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Uwt(e){return e?e[0].toLowerCase()+e.slice(1):""}function Qwt(e,t){return e?(Array.isArray(e)?e:kQe(e)).map(n=>Lwt(t?.normalize?n.toLowerCase():n)).join(""):""}function QO(e,t){return Uwt(Qwt(e||"",t))}function IG(e,t){return e?(Array.isArray(e)?e:kQe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function PQe(e){return IG(e||"","_")}var kwt,Pwt,MQe=w(()=>{m();kwt=/\d/,Pwt=["-","_","/","."]});import{parseArgs as Fwt}from"node:util";function xG(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function see(e,t=""){let n=[];for(let r of e)for(let[o,i]of r.entries())n[o]=Math.max(n[o]||0,i.length);return e.map(r=>r.map((o,i)=>t+o[i===0?"padStart":"padEnd"](n[i])).join(" ")).join(`
|
|
38
|
+
Mongoose Error Code: ${t.code}`:""}`})}function LW(e,t,n,r=void 0){n&&(0,cO.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&TPe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function Kxt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(LW(t,o,n,r),o)).catch(o=>{throw bPe(t,o),o}).finally(()=>t.end()):(LW(t,e,n,r),t.end(),e)}yE.handlePromiseResponse=Kxt;function Jxt(e,t,n,r,o,i,s=void 0){let u=0;return o.length===2?u=1:o.length===3&&(u=2),o[u]=(l,f)=>(l?bPe(r,l):LW(r,f,i,s),r.end(),e(l,f)),t.apply(n,o)}yE.handleCallbackResponse=Jxt});var CPe=M(SR=>{"use strict";m();Object.defineProperty(SR,"__esModule",{value:!0});SR.PACKAGE_NAME=SR.PACKAGE_VERSION=void 0;SR.PACKAGE_VERSION="0.60.0";SR.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var NPe=M(Jc=>{"use strict";m();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.MongooseInstrumentation=Jc._ALREADY_INSTRUMENTED=Jc._STORED_PARENT_SPAN=void 0;var Bs=(He(),Me(tt)),Zxt=vr(),UW=IPe(),La=un(),vPe=CPe(),SE=MW(),tT=(Xn(),Me(Hr)),K3=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],Wxt=["remove","count","findOneAndRemove",...K3],Xxt=["count","findOneAndRemove",...K3],eDt=[...K3];function RPe(e){return e?e.startsWith("6.")||e.startsWith("5.")?Wxt:e.startsWith("7.")?Xxt:eDt:K3}function xPe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function DPe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Jc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Jc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var QW=class extends La.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(vPe.PACKAGE_NAME,vPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,La.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,La.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new La.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,xPe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),DPe(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)),RPe(n).forEach(i=>{this._wrap(r.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),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(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t,o=RPe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,xPe(n)&&this._unwrap(r.Model.prototype,"remove"),DPe(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(i=>{this._unwrap(r.Query.prototype,i)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(t){let n=this;return r=>function(i){if(n.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&La.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&La.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Jc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return r.apply(this,arguments);let s=this[Jc._STORED_PARENT_SPAN],u={},{dbStatementSerializer:l}=n.getConfig();if(l){let h=l(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&La.SemconvStability.OLD&&(u[SE.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&La.SemconvStability.STABLE&&(u[tT.ATTR_DB_QUERY_TEXT]=h)}let f=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,u,s);return n._handleResponse(f,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(s,u){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);let l={document:this};s&&!(s instanceof Function)&&(l.options=s);let f={},{dbStatementSerializer:h}=r.getConfig();if(h){let y=h(t,l);r._dbSemconvStability&La.SemconvStability.OLD&&(f[SE.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&La.SemconvStability.STABLE&&(f[tT.ATTR_DB_QUERY_TEXT]=y)}let _=r._startSpan(this.constructor.collection,this.constructor.modelName,t,f);return s instanceof Function&&(u=s,s=void 0),r._handleResponse(_,o,this,arguments,u,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);let f=l,h=s,_=u;typeof s=="function"?(f=s,h=void 0,_=void 0):typeof u=="function"&&(f=u,_=void 0);let y={},T=r.getConfig().dbStatementSerializer;if(T){let x=T(t,{condition:{_id:this._id},updates:h,options:_});r._dbSemconvStability&La.SemconvStability.OLD&&(y[SE.ATTR_DB_STATEMENT]=x),r._dbSemconvStability&La.SemconvStability.STABLE&&(y[tT.ATTR_DB_QUERY_TEXT]=x)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),R=r._handleResponse(v,o,this,arguments,f,n);return R&&typeof R=="object"&&(R[Jc._ALREADY_INSTRUMENTED]=!0),R}}patchModelStatic(t,n){let r=this;return o=>function(s,u,l){if(r.getConfig().requireParentSpan&&Bs.trace.getSpan(Bs.context.active())===void 0)return o.apply(this,arguments);typeof u=="function"&&(l=u,u=void 0);let f={};switch(t){case"insertMany":f.documents=s;break;case"bulkWrite":f.operations=s;break;default:f.document=s;break}u!==void 0&&(f.options=u);let h={},{dbStatementSerializer:_}=r.getConfig();if(_){let T=_(t,f);r._dbSemconvStability&La.SemconvStability.OLD&&(h[SE.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&La.SemconvStability.STABLE&&(h[tT.ATTR_DB_QUERY_TEXT]=T)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,l,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Bs.trace.getSpan(Bs.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Jc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Jc._STORED_PARENT_SPAN]=Bs.trace.getSpan(Bs.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let s={...o,...(0,UW.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&La.SemconvStability.OLD&&(s[SE.ATTR_DB_OPERATION]=r,s[SE.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&La.SemconvStability.STABLE&&(s[tT.ATTR_DB_OPERATION_NAME]=r,s[tT.ATTR_DB_SYSTEM_NAME]=SE.DB_SYSTEM_NAME_VALUE_MONGODB);let u=this._dbSemconvStability&La.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(u,{kind:Bs.SpanKind.CLIENT,attributes:s},i?Bs.trace.setSpan(Bs.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,s=void 0){let u=this;if(i instanceof Function)return u._callOriginalFunction(()=>(0,UW.handleCallbackResponse)(i,n,r,t,o,u.getConfig().responseHook,s));{let l=u._callOriginalFunction(()=>n.apply(r,o));return(0,UW.handlePromiseResponse)(l,t,u.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Bs.context.with((0,Zxt.suppressTracing)(Bs.context.active()),t):t()}};Jc.MongooseInstrumentation=QW});var BPe=M(J3=>{"use strict";m();Object.defineProperty(J3,"__esModule",{value:!0});J3.MongooseInstrumentation=void 0;var tDt=NPe();Object.defineProperty(J3,"MongooseInstrumentation",{enumerable:!0,get:function(){return tDt.MongooseInstrumentation}})});var wPe,OPe,kPe,nDt,PPe,MPe=w(()=>{m();wPe=ue(BPe(),1);_r();OPe="Mongoose",kPe=ct(OPe,()=>new wPe.MongooseInstrumentation({responseHook(e){qr(e,"auto.db.otel.mongoose")}})),nDt=(()=>({name:OPe,setupOnce(){kPe()}})),PPe=nDt});var LPe=M(us=>{"use strict";m();Object.defineProperty(us,"__esModule",{value:!0});us.METRIC_DB_CLIENT_CONNECTIONS_USAGE=us.DB_SYSTEM_VALUE_MYSQL=us.ATTR_NET_PEER_PORT=us.ATTR_NET_PEER_NAME=us.ATTR_DB_USER=us.ATTR_DB_SYSTEM=us.ATTR_DB_STATEMENT=us.ATTR_DB_NAME=us.ATTR_DB_CONNECTION_STRING=void 0;us.ATTR_DB_CONNECTION_STRING="db.connection_string";us.ATTR_DB_NAME="db.name";us.ATTR_DB_STATEMENT="db.statement";us.ATTR_DB_SYSTEM="db.system";us.ATTR_DB_USER="db.user";us.ATTR_NET_PEER_NAME="net.peer.name";us.ATTR_NET_PEER_PORT="net.peer.port";us.DB_SYSTEM_VALUE_MYSQL="mysql";us.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var UPe=M(lO=>{"use strict";m();Object.defineProperty(lO,"__esModule",{value:!0});lO.AttributeNames=void 0;var rDt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(rDt=lO.AttributeNames||(lO.AttributeNames={}))});var QPe=M(Au=>{"use strict";m();Object.defineProperty(Au,"__esModule",{value:!0});Au.getPoolNameOld=Au.arrayStringifyHelper=Au.getSpanName=Au.getDbValues=Au.getDbQueryText=Au.getJDBCString=Au.getConfig=void 0;function oDt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}Au.getConfig=oDt;function iDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}Au.getJDBCString=iDt;function sDt(e){return typeof e=="string"?e:e.sql}Au.getDbQueryText=sDt;function aDt(e,t){return FW(typeof e=="string"?t:t||e.values)}Au.getDbValues=aDt;function uDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}Au.getSpanName=uDt;function FW(e){return e?`[${e.toString()}]`:""}Au.arrayStringifyHelper=FW;function cDt(e){let t=e.config.connectionConfig,n="";return n+=t.host?`host: '${t.host}', `:"",n+=t.port?`port: ${t.port}, `:"",n+=t.database?`database: '${t.database}', `:"",n+=t.user?`user: '${t.user}'`:"",t.user||(n=n.substring(0,n.length-2)),n.trim()}Au.getPoolNameOld=cDt});var FPe=M(TR=>{"use strict";m();Object.defineProperty(TR,"__esModule",{value:!0});TR.PACKAGE_NAME=TR.PACKAGE_VERSION=void 0;TR.PACKAGE_VERSION="0.60.0";TR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var jPe=M(Z3=>{"use strict";m();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.MySQLInstrumentation=void 0;var Zc=(He(),Me(tt)),up=un(),bR=(Xn(),Me(Hr)),Xg=LPe(),lDt=UPe(),nT=QPe(),GPe=FPe(),GW=class extends up.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(GPe.PACKAGE_NAME,GPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,up.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,up.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new up.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,up.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,up.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,up.isWrapped)(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),i}}}_patchCreatePool(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"end",n._patchPoolEnd(i)),n._setPoolCallbacks(i,""),i}}}_patchPoolEnd(t){return n=>{let r=this;return function(i){let s=t._allConnections.length,u=t._freeConnections.length,l=s-u,f=(0,nT.getPoolNameOld)(t);r._connCountAdd(-l,f,"used"),r._connCountAdd(-u,f,"idle"),n.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"add",n._patchAdd(i)),i}}}_patchAdd(t){return n=>{let r=this;return function(i,s){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let u=t._nodes;if(u){let l=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),f=u[l].pool;r._setPoolCallbacks(f,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,s,u){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let l=r._getConnectionCallbackPatchFn(i);return n.call(t,l)}if(arguments.length===2&&typeof s=="function"){let l=r._getConnectionCallbackPatchFn(s);return n.call(t,i,l)}if(arguments.length===3&&typeof u=="function"){let l=r._getConnectionCallbackPatchFn(u);return n.call(t,i,s,l)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Zc.context.active();return function(o,i){i&&((0,up.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Zc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,s){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let u={},{host:l,port:f,database:h,user:_}=(0,nT.getConfig)(t.config),y=parseInt(f,10),T=(0,nT.getDbQueryText)(o);r._dbSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_DB_SYSTEM]=Xg.DB_SYSTEM_VALUE_MYSQL,u[Xg.ATTR_DB_CONNECTION_STRING]=(0,nT.getJDBCString)(l,f,h),u[Xg.ATTR_DB_NAME]=h,u[Xg.ATTR_DB_USER]=_,u[Xg.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_DB_SYSTEM_NAME]=bR.DB_SYSTEM_NAME_VALUE_MYSQL,u[bR.ATTR_DB_NAMESPACE]=h,u[bR.ATTR_DB_QUERY_TEXT]=T),r._netSemconvStability&up.SemconvStability.OLD&&(u[Xg.ATTR_NET_PEER_NAME]=l,isNaN(y)||(u[Xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&up.SemconvStability.STABLE&&(u[bR.ATTR_SERVER_ADDRESS]=l,isNaN(y)||(u[bR.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,nT.getSpanName)(o),{kind:Zc.SpanKind.CLIENT,attributes:u});if(r.getConfig().enhancedDatabaseReporting){let O;Array.isArray(i)?O=i:arguments[2]&&(O=[i]),v.setAttribute(lDt.AttributeNames.MYSQL_VALUES,(0,nT.getDbValues)(o,O))}let R=Array.from(arguments).findIndex(O=>typeof O=="function"),x=Zc.context.active();if(R===-1){let O=Zc.context.with(Zc.trace.setSpan(Zc.context.active(),v),()=>n.apply(t,arguments));return Zc.context.bind(x,O),O.on("error",P=>v.setStatus({code:Zc.SpanStatusCode.ERROR,message:P.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,R,r._patchCallbackQuery(v,x)),Zc.context.with(Zc.trace.setSpan(Zc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,s){return o&&t.setStatus({code:Zc.SpanStatusCode.ERROR,message:o.message}),t.end(),Zc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,nT.getPoolNameOld)(t);t.on("connection",o=>{this._connCountAdd(1,r,"idle")}),t.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),t.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};Z3.MySQLInstrumentation=GW});var zPe=M(W3=>{"use strict";m();Object.defineProperty(W3,"__esModule",{value:!0});W3.MySQLInstrumentation=void 0;var dDt=jPe();Object.defineProperty(W3,"MySQLInstrumentation",{enumerable:!0,get:function(){return dDt.MySQLInstrumentation}})});var HPe,$Pe,qPe,pDt,VPe,YPe=w(()=>{m();HPe=ue(zPe(),1);_r();$Pe="Mysql",qPe=ct($Pe,()=>new HPe.MySQLInstrumentation({})),pDt=(()=>({name:$Pe,setupOnce(){qPe()}})),VPe=pDt});var jW=M(ua=>{"use strict";m();Object.defineProperty(ua,"__esModule",{value:!0});ua.DB_SYSTEM_VALUE_MYSQL=ua.ATTR_NET_PEER_PORT=ua.ATTR_NET_PEER_NAME=ua.ATTR_DB_USER=ua.ATTR_DB_SYSTEM=ua.ATTR_DB_STATEMENT=ua.ATTR_DB_NAME=ua.ATTR_DB_CONNECTION_STRING=void 0;ua.ATTR_DB_CONNECTION_STRING="db.connection_string";ua.ATTR_DB_NAME="db.name";ua.ATTR_DB_STATEMENT="db.statement";ua.ATTR_DB_SYSTEM="db.system";ua.ATTR_DB_USER="db.user";ua.ATTR_NET_PEER_NAME="net.peer.name";ua.ATTR_NET_PEER_PORT="net.peer.port";ua.DB_SYSTEM_VALUE_MYSQL="mysql"});var HW=M(X3=>{"use strict";m();Object.defineProperty(X3,"__esModule",{value:!0});X3.addSqlCommenterComment=void 0;var zW=(He(),Me(tt)),fDt=vr();function mDt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function ADt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function gDt(e,t){if(typeof t!="string"||t.length===0||mDt(t))return t;let n=new fDt.W3CTraceContextPropagator,r={};n.inject(zW.trace.setSpan(zW.ROOT_CONTEXT,e),r,zW.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(s=>{let u=ADt(r[s]);return`${s}='${u}'`}).join(",");return`${t} /*${i}*/`}X3.addSqlCommenterComment=gDt});var KPe=M(cp=>{"use strict";m();Object.defineProperty(cp,"__esModule",{value:!0});cp.getConnectionPrototypeToInstrument=cp.once=cp.getSpanName=cp.getQueryText=cp.getConnectionAttributes=void 0;var dO=jW(),e6=un(),$W=(Xn(),Me(Hr));function hDt(e,t,n){let{host:r,port:o,database:i,user:s}=_Dt(e),u={};t&e6.SemconvStability.OLD&&(u[dO.ATTR_DB_CONNECTION_STRING]=EDt(r,o,i),u[dO.ATTR_DB_NAME]=i,u[dO.ATTR_DB_USER]=s),t&e6.SemconvStability.STABLE&&(u[$W.ATTR_DB_NAMESPACE]=i);let l=parseInt(o,10);return n&e6.SemconvStability.OLD&&(u[dO.ATTR_NET_PEER_NAME]=r,isNaN(l)||(u[dO.ATTR_NET_PEER_PORT]=l)),n&e6.SemconvStability.STABLE&&(u[$W.ATTR_SERVER_ADDRESS]=r,isNaN(l)||(u[$W.ATTR_SERVER_PORT]=l)),u}cp.getConnectionAttributes=hDt;function _Dt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function EDt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function yDt(e,t,n,r=!1,o=SDt){let[i,s]=typeof e=="string"?[e,n]:[e.sql,TDt(e)?n||e.values:n];try{return r?o(i):t&&s?t(i,s):i}catch{return"Could not determine the query due to an error in masking or formatting"}}cp.getQueryText=yDt;function SDt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function TDt(e){return"values"in e}function bDt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}cp.getSpanName=bDt;var IDt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};cp.once=IDt;function CDt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}cp.getConnectionPrototypeToInstrument=CDt});var JPe=M(IR=>{"use strict";m();Object.defineProperty(IR,"__esModule",{value:!0});IR.PACKAGE_NAME=IR.PACKAGE_VERSION=void 0;IR.PACKAGE_VERSION="0.60.0";IR.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var eMe=M(t6=>{"use strict";m();Object.defineProperty(t6,"__esModule",{value:!0});t6.MySQL2Instrumentation=void 0;var ZPe=(He(),Me(tt)),xf=un(),qW=jW(),WPe=HW(),CR=KPe(),XPe=JPe(),VW=(Xn(),Me(Hr)),YW=[">=1.4.2 <4"],KW=class extends xf.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(XPe.PACKAGE_NAME,XPe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,xf.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let t;function n(i){!t&&i.format&&(t=i.format)}let r=i=>{(0,xf.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,xf.isWrapped)(i.execute)&&this._unwrap(i,"execute"),this._wrap(i,"execute",this._patchQuery(t,!0))},o=i=>{this._unwrap(i,"query"),this._unwrap(i,"execute")};return[new xf.InstrumentationNodeModuleDefinition("mysql2",YW,i=>(n(i),i),()=>{},[new xf.InstrumentationNodeModuleFile("mysql2/promise.js",YW,i=>(n(i),i),()=>{}),new xf.InstrumentationNodeModuleFile("mysql2/lib/connection.js",YW,i=>{let s=(0,CR.getConnectionPrototypeToInstrument)(i);return r(s),i},i=>{if(i===void 0)return;let s=(0,CR.getConnectionPrototypeToInstrument)(i);o(s)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,s,u){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]);let{maskStatement:f,maskStatementHook:h,responseHook:_}=o.getConfig(),y=(0,CR.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),T=(0,CR.getQueryText)(i,t,l,f,h);o._dbSemconvStability&xf.SemconvStability.OLD&&(y[qW.ATTR_DB_SYSTEM]=qW.DB_SYSTEM_VALUE_MYSQL,y[qW.ATTR_DB_STATEMENT]=T),o._dbSemconvStability&xf.SemconvStability.STABLE&&(y[VW.ATTR_DB_SYSTEM_NAME]=VW.DB_SYSTEM_NAME_VALUE_MYSQL,y[VW.ATTR_DB_QUERY_TEXT]=T);let v=o.tracer.startSpan((0,CR.getSpanName)(i),{kind:ZPe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,WPe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,WPe.addSqlCommenterComment)(v,i.sql)}));let R=(0,CR.once)((x,O)=>{x?v.setStatus({code:ZPe.SpanStatusCode.ERROR,message:x.message}):typeof _=="function"&&(0,xf.safeExecuteInTheMiddle)(()=>{_(v,{queryResults:O})},P=>{P&&o._diag.warn("Failed executing responseHook",P)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(R));let x=r.apply(this,arguments);return x.once("error",O=>{R(O)}).once("result",O=>{R(void 0,O)}),x}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(R)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(R)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};t6.MySQL2Instrumentation=KW});var tMe=M(n6=>{"use strict";m();Object.defineProperty(n6,"__esModule",{value:!0});n6.MySQL2Instrumentation=void 0;var vDt=eMe();Object.defineProperty(n6,"MySQL2Instrumentation",{enumerable:!0,get:function(){return vDt.MySQL2Instrumentation}})});var nMe,rMe,oMe,RDt,iMe,sMe=w(()=>{m();nMe=ue(tMe(),1);_r();rMe="Mysql2",oMe=ct(rMe,()=>new nMe.MySQL2Instrumentation({responseHook(e){qr(e,"auto.db.otel.mysql2")}})),RDt=(()=>({name:rMe,setupOnce(){oMe()}})),iMe=RDt});var aMe=M(gu=>{"use strict";m();Object.defineProperty(gu,"__esModule",{value:!0});gu.DB_SYSTEM_VALUE_REDIS=gu.DB_SYSTEM_NAME_VALUE_REDIS=gu.ATTR_NET_PEER_PORT=gu.ATTR_NET_PEER_NAME=gu.ATTR_DB_SYSTEM=gu.ATTR_DB_STATEMENT=gu.ATTR_DB_CONNECTION_STRING=void 0;gu.ATTR_DB_CONNECTION_STRING="db.connection_string";gu.ATTR_DB_STATEMENT="db.statement";gu.ATTR_DB_SYSTEM="db.system";gu.ATTR_NET_PEER_NAME="net.peer.name";gu.ATTR_NET_PEER_PORT="net.peer.port";gu.DB_SYSTEM_NAME_VALUE_REDIS="redis";gu.DB_SYSTEM_VALUE_REDIS="redis"});var uMe=M(r6=>{"use strict";m();Object.defineProperty(r6,"__esModule",{value:!0});r6.endSpan=void 0;var xDt=(He(),Me(tt)),DDt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:xDt.SpanStatusCode.ERROR,message:t.message})),e.end()};r6.endSpan=DDt});var i6=M(o6=>{"use strict";m();Object.defineProperty(o6,"__esModule",{value:!0});o6.defaultDbStatementSerializer=void 0;var NDt=[{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}],BDt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=NDt.find(({regex:o})=>o.test(e))?.args??0,r=n>=0?t.slice(0,n):t;return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(" ")}`}return e};o6.defaultDbStatementSerializer=BDt});var cMe=M(vR=>{"use strict";m();Object.defineProperty(vR,"__esModule",{value:!0});vR.PACKAGE_NAME=vR.PACKAGE_VERSION=void 0;vR.PACKAGE_VERSION="0.62.0";vR.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var fMe=M(s6=>{"use strict";m();Object.defineProperty(s6,"__esModule",{value:!0});s6.IORedisInstrumentation=void 0;var TE=(He(),Me(tt)),Wc=un(),bE=(Xn(),Me(Hr)),Xc=aMe(),lMe=un(),pO=uMe(),wDt=i6(),dMe=cMe(),pMe={requireParentSpan:!0},JW=class extends Wc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(dMe.PACKAGE_NAME,dMe.PACKAGE_VERSION,{...pMe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Wc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Wc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...pMe,...t})}init(){return[new Wc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Wc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Wc.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(t){return n=>this._traceSendCommand(n,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return t.apply(this,arguments);let i=r.getConfig(),s=i.dbStatementSerializer||wDt.defaultDbStatementSerializer,u=TE.trace.getSpan(TE.context.active())===void 0;if(i.requireParentSpan===!0&&u)return t.apply(this,arguments);let l={},{host:f,port:h}=this.options,_=s(o.name,o.args);r._dbSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,l[Xc.ATTR_DB_STATEMENT]=_,l[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${f}:${h}`),r._dbSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,l[bE.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Wc.SemconvStability.OLD&&(l[Xc.ATTR_NET_PEER_NAME]=f,l[Xc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Wc.SemconvStability.STABLE&&(l[bE.ATTR_SERVER_ADDRESS]=f,l[bE.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:TE.SpanKind.CLIENT,attributes:l}),{requestHook:T}=i;T&&(0,lMe.safeExecuteInTheMiddle)(()=>T(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&TE.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),R=o.resolve;o.resolve=function(O){(0,lMe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,O),P=>{P&&TE.diag.error("ioredis instrumentation: response hook failed",P)},!0),(0,pO.endSpan)(y,null),R(O)};let x=o.reject;return o.reject=function(O){(0,pO.endSpan)(y,O),x(O)},v}catch(v){throw(0,pO.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=TE.trace.getSpan(TE.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:s}=this.options;n._dbSemconvStability&Wc.SemconvStability.OLD&&(o[Xc.ATTR_DB_SYSTEM]=Xc.DB_SYSTEM_VALUE_REDIS,o[Xc.ATTR_DB_STATEMENT]="connect",o[Xc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${s}`),n._dbSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_DB_SYSTEM_NAME]=Xc.DB_SYSTEM_NAME_VALUE_REDIS,o[bE.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Wc.SemconvStability.OLD&&(o[Xc.ATTR_NET_PEER_NAME]=i,o[Xc.ATTR_NET_PEER_PORT]=s),n._netSemconvStability&Wc.SemconvStability.STABLE&&(o[bE.ATTR_SERVER_ADDRESS]=i,o[bE.ATTR_SERVER_PORT]=s);let u=n.tracer.startSpan("connect",{kind:TE.SpanKind.CLIENT,attributes:o});try{let l=t.apply(this,arguments);return(0,pO.endSpan)(u,null),l}catch(l){throw(0,pO.endSpan)(u,l),l}}}};s6.IORedisInstrumentation=JW});var mMe=M(a6=>{"use strict";m();Object.defineProperty(a6,"__esModule",{value:!0});a6.IORedisInstrumentation=void 0;var ODt=fMe();Object.defineProperty(a6,"IORedisInstrumentation",{enumerable:!0,get:function(){return ODt.IORedisInstrumentation}})});var u6=M(RR=>{"use strict";m();Object.defineProperty(RR,"__esModule",{value:!0});RR.PACKAGE_NAME=RR.PACKAGE_VERSION=void 0;RR.PACKAGE_VERSION="0.62.0";RR.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var AMe=M(IE=>{"use strict";m();Object.defineProperty(IE,"__esModule",{value:!0});IE.getTracedCreateStreamTrace=IE.getTracedCreateClient=IE.endSpan=void 0;var fO=(He(),Me(tt)),kDt=(e,t)=>{t&&e.setStatus({code:fO.SpanStatusCode.ERROR,message:t.message}),e.end()};IE.endSpan=kDt;var PDt=e=>function(){let n=e.apply(this,arguments);return fO.context.bind(fO.context.active(),n)};IE.getTracedCreateClient=PDt;var MDt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){fO.context.bind(fO.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};IE.getTracedCreateStreamTrace=MDt});var c6=M(hu=>{"use strict";m();Object.defineProperty(hu,"__esModule",{value:!0});hu.DB_SYSTEM_VALUE_REDIS=hu.DB_SYSTEM_NAME_VALUE_REDIS=hu.ATTR_NET_PEER_PORT=hu.ATTR_NET_PEER_NAME=hu.ATTR_DB_SYSTEM=hu.ATTR_DB_STATEMENT=hu.ATTR_DB_CONNECTION_STRING=void 0;hu.ATTR_DB_CONNECTION_STRING="db.connection_string";hu.ATTR_DB_STATEMENT="db.statement";hu.ATTR_DB_SYSTEM="db.system";hu.ATTR_NET_PEER_NAME="net.peer.name";hu.ATTR_NET_PEER_PORT="net.peer.port";hu.DB_SYSTEM_NAME_VALUE_REDIS="redis";hu.DB_SYSTEM_VALUE_REDIS="redis"});var hMe=M(d6=>{"use strict";m();Object.defineProperty(d6,"__esModule",{value:!0});d6.RedisInstrumentationV2_V3=void 0;var Xl=un(),l6=AMe(),gMe=u6(),mO=(He(),Me(tt)),AO=(Xn(),Me(Hr)),rT=c6(),LDt=i6(),ZW=class e extends Xl.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(gMe.PACKAGE_NAME,gMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Xl.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Xl.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,Xl.isWrapped)(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,Xl.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Xl.isWrapped)(t.createClient)&&this._unwrap(t,"createClient"),this._wrap(t,"createClient",this._getPatchCreateClient()),t),t=>{t!==void 0&&(this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._unwrap(t.RedisClient.prototype,"create_stream"),this._unwrap(t,"createClient"))})]}_getPatchInternalSendCommand(){let t=this;return function(r){return function(i){if(arguments.length!==1||typeof i!="object")return r.apply(this,arguments);let s=t.getConfig(),u=mO.trace.getSpan(mO.context.active())===void 0;if(s.requireParentSpan===!0&&u)return r.apply(this,arguments);let l=s?.dbStatementSerializer||LDt.defaultDbStatementSerializer,f={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(f,{[rT.ATTR_DB_SYSTEM]:rT.DB_SYSTEM_VALUE_REDIS,[rT.ATTR_DB_STATEMENT]:l(i.command,i.args)}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(f,{[AO.ATTR_DB_SYSTEM_NAME]:rT.DB_SYSTEM_NAME_VALUE_REDIS,[AO.ATTR_DB_OPERATION_NAME]:i.command,[AO.ATTR_DB_QUERY_TEXT]:l(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:mO.SpanKind.CLIENT,attributes:f});if(this.connection_options){let y={};t._semconvStability&Xl.SemconvStability.OLD&&Object.assign(y,{[rT.ATTR_NET_PEER_NAME]:this.connection_options.host,[rT.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&Xl.SemconvStability.STABLE&&Object.assign(y,{[AO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[AO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&Xl.SemconvStability.OLD&&h.setAttribute(rT.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let _=arguments[0].callback;if(_){let y=mO.context.active();arguments[0].callback=function(v,R){if(s?.responseHook){let x=s.responseHook;(0,Xl.safeExecuteInTheMiddle)(()=>{x(h,i.command,i.args,R)},O=>{O&&t._diag.error("Error executing responseHook",O)},!0)}return(0,l6.endSpan)(h,v),mO.context.with(y,_,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,l6.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,l6.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,l6.getTracedCreateStreamTrace)(n)}}};d6.RedisInstrumentationV2_V3=ZW});var EMe=M(p6=>{"use strict";m();Object.defineProperty(p6,"__esModule",{value:!0});p6.getClientAttributes=void 0;var WW=(Xn(),Me(Hr)),xR=c6(),_Me=un();function UDt(e,t,n){let r={};return n&_Me.SemconvStability.OLD&&Object.assign(r,{[xR.ATTR_DB_SYSTEM]:xR.DB_SYSTEM_VALUE_REDIS,[xR.ATTR_NET_PEER_NAME]:t?.socket?.host,[xR.ATTR_NET_PEER_PORT]:t?.socket?.port,[xR.ATTR_DB_CONNECTION_STRING]:QDt(e,t?.url)}),n&_Me.SemconvStability.STABLE&&Object.assign(r,{[WW.ATTR_DB_SYSTEM_NAME]:xR.DB_SYSTEM_NAME_VALUE_REDIS,[WW.ATTR_SERVER_ADDRESS]:t?.socket?.host,[WW.ATTR_SERVER_PORT]:t?.socket?.port}),r}p6.getClientAttributes=UDt;function QDt(e,t){if(!(typeof t!="string"||!t))try{let n=new URL(t);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){e.error("failed to sanitize redis connection url",n)}}});var bMe=M(f6=>{"use strict";m();Object.defineProperty(f6,"__esModule",{value:!0});f6.RedisInstrumentationV4_V5=void 0;var lp=(He(),Me(tt)),Co=un(),yMe=EMe(),FDt=i6(),SMe=u6(),XW=(Xn(),Me(Hr)),GDt=c6(),gO=Symbol("opentelemetry.instrumentation.redis.open_spans"),TMe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),eX=class e extends Co.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(SMe.PACKAGE_NAME,SMe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Co.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let u=i.transformCommandArguments;if(!u)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let l=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Co.isWrapped)(i?.[l])&&this._unwrap(i,l),this._wrap(i,l,this._getPatchExtendWithCommands(u)),i},i=>{(0,Co.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Co.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Co.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Co.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Co.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),o=new Co.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Co.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(s,"connect",this._getPatchedClientConnect()),i},i=>{let s=i?.default?.prototype;(0,Co.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Co.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Co.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand")});return new Co.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(s){if(s?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let u=s.executor;return s.executor=function(l,f){let h=t(l,f).args;return n._traceClientCommand(u,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let s=o.apply(this,arguments);return typeof s?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),s):s.then(u=>{let l=this[gO];return n._endSpansWithRedisReplies(l,u,t),u}).catch(u=>{let l=this[gO];if(!l)n._diag.error("cannot find open spans to end for multi/pipeline");else{let f=u.constructor.name==="MultiErrorReply"?u.replies:new Array(l.length).fill(u);n._endSpansWithRedisReplies(l,f,t)}return Promise.reject(u)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[TMe]=this.options,o}}}_getPatchRedisClientSendCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchedClientConnect(){let t=this;return function(r){return function(){let i=this.options,s=(0,yMe.getClientAttributes)(t._diag,i,t._semconvStability),u=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:lp.SpanKind.CLIENT,attributes:s});return lp.context.with(lp.trace.setSpan(lp.context.active(),u),()=>r.apply(this)).then(f=>(u.end(),f)).catch(f=>(u.recordException(f),u.setStatus({code:lp.SpanStatusCode.ERROR,message:f.message}),u.end(),Promise.reject(f)))}}}_traceClientCommand(t,n,r,o){if(lp.trace.getSpan(lp.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let s=n.options||n[TMe],u=o[0],l=o.slice(1),f=this.getConfig().dbStatementSerializer||FDt.defaultDbStatementSerializer,h=(0,yMe.getClientAttributes)(this._diag,s,this._semconvStability);this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_OPERATION_NAME]=u);try{let T=f(u,l);T!=null&&(this._semconvStability&Co.SemconvStability.OLD&&(h[GDt.ATTR_DB_STATEMENT]=T),this._semconvStability&Co.SemconvStability.STABLE&&(h[XW.ATTR_DB_QUERY_TEXT]=T))}catch(T){this._diag.error("dbStatementSerializer throw an exception",T,{commandName:u})}let _=this.tracer.startSpan(`${e.COMPONENT}-${u}`,{kind:lp.SpanKind.CLIENT,attributes:h}),y=lp.context.with(lp.trace.setSpan(lp.context.active(),_),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(T=>{this._endSpanWithResponse(_,u,l,T,void 0)},T=>{this._endSpanWithResponse(_,u,l,null,T)});else{let T=y;T[gO]=T[gO]||[],T[gO].push({span:_,commandName:u,commandArgs:l})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(u=>u.commandName),s=o.every(u=>u===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let u=0;u<t.length;u++){let{span:l,commandArgs:f}=t[u],h=n[u],[_,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&Co.SemconvStability.STABLE&&l.setAttribute(XW.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(l,o[u],f,_,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,r,o)}catch(u){this._diag.error("responseHook throw an exception",u)}i&&(t.recordException(i),t.setStatus({code:lp.SpanStatusCode.ERROR,message:i?.message})),t.end()}};f6.RedisInstrumentationV4_V5=eX});var vMe=M(m6=>{"use strict";m();Object.defineProperty(m6,"__esModule",{value:!0});m6.RedisInstrumentation=void 0;var jDt=un(),IMe=u6(),zDt=hMe(),HDt=bMe(),CMe={requireParentSpan:!1},tX=class extends jDt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...CMe,...t};super(IMe.PACKAGE_NAME,IMe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new zDt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new HDt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...CMe,...t};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(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}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())}};m6.RedisInstrumentation=tX});var RMe=M(A6=>{"use strict";m();Object.defineProperty(A6,"__esModule",{value:!0});A6.RedisInstrumentation=void 0;var $Dt=vMe();Object.defineProperty(A6,"RedisInstrumentation",{enumerable:!0,get:function(){return $Dt.RedisInstrumentation}})});function hO(e,t){return e.includes(t.toLowerCase())}function rX(e){return hO(nX,e)?"cache.get":hO(VDt,e)?"cache.put":void 0}function YDt(e,t){return t.some(n=>e.startsWith(n))}function DMe(e,t){try{if(t.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?xMe(o.map(i=>n(i))):["<unknown>"],r=t[0];return hO(qDt,e)&&r!=null?n(r):xMe(t.map(o=>n(o)))}catch{return}}function NMe(e,t,n){if(!rX(e))return!1;for(let r of t)if(YDt(r,n))return!0;return!1}function BMe(e){let t=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(e)?e.reduce((n,r)=>{let o=t(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):t(e)}function xMe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var qDt,nX,VDt,wMe=w(()=>{m();qDt=["get","set","setex"],nX=["get","mget"],VDt=["set","setex"]});var OMe,kMe,g6,_O,PMe,KDt,JDt,MMe,ZDt,LMe,UMe=w(()=>{m();OMe=ue(mMe(),1),kMe=ue(RMe(),1);At();_r();wMe();g6="Redis",_O={},PMe=(e,t,n,r)=>{e.setAttribute(Mt,"auto.db.otel.redis");let o=DMe(t,n),i=rX(t);if(!o||!i||!_O.cachePrefixes||!NMe(t,o,_O.cachePrefixes))return;let s=kt(e).data["net.peer.name"],u=kt(e).data["net.peer.port"];u&&s&&e.setAttributes({"network.peer.address":s,"network.peer.port":u});let l=BMe(r);l&&e.setAttribute(aY,l),hO(nX,t)&&l!==void 0&&e.setAttribute(iY,l>0),e.setAttributes({[Xt]:i,[sY]:o});let f=o.join(", ");e.updateName(_O.maxCacheKeyLength?Q_(f,_O.maxCacheKeyLength):f)},KDt=ct(`${g6}.IORedis`,()=>new OMe.IORedisInstrumentation({responseHook:PMe})),JDt=ct(`${g6}.Redis`,()=>new kMe.RedisInstrumentation({responseHook:PMe})),MMe=Object.assign(()=>{KDt(),JDt()},{id:g6}),ZDt=((e={})=>({name:g6,setupOnce(){_O=e,MMe()}})),LMe=ZDt});var QMe=M(h6=>{"use strict";m();Object.defineProperty(h6,"__esModule",{value:!0});h6.EVENT_LISTENERS_SET=void 0;h6.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var oX=M(EO=>{"use strict";m();Object.defineProperty(EO,"__esModule",{value:!0});EO.AttributeNames=void 0;var WDt;(function(e){e.PG_VALUES="db.postgresql.values",e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client"})(WDt=EO.AttributeNames||(EO.AttributeNames={}))});var iX=M(wr=>{"use strict";m();Object.defineProperty(wr,"__esModule",{value:!0});wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=wr.METRIC_DB_CLIENT_CONNECTION_COUNT=wr.DB_SYSTEM_VALUE_POSTGRESQL=wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=wr.ATTR_NET_PEER_PORT=wr.ATTR_NET_PEER_NAME=wr.ATTR_DB_USER=wr.ATTR_DB_SYSTEM=wr.ATTR_DB_STATEMENT=wr.ATTR_DB_NAME=wr.ATTR_DB_CONNECTION_STRING=wr.ATTR_DB_CLIENT_CONNECTION_STATE=wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;wr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";wr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";wr.ATTR_DB_CONNECTION_STRING="db.connection_string";wr.ATTR_DB_NAME="db.name";wr.ATTR_DB_STATEMENT="db.statement";wr.ATTR_DB_SYSTEM="db.system";wr.ATTR_DB_USER="db.user";wr.ATTR_NET_PEER_NAME="net.peer.name";wr.ATTR_NET_PEER_PORT="net.peer.port";wr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";wr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";wr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";wr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";wr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var sX=M(yO=>{"use strict";m();Object.defineProperty(yO,"__esModule",{value:!0});yO.SpanNames=void 0;var XDt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(XDt=yO.SpanNames||(yO.SpanNames={}))});var qMe=M(sr=>{"use strict";m();Object.defineProperty(sr,"__esModule",{value:!0});sr.sanitizedErrorMessage=sr.isObjectWithTextString=sr.getErrorMessage=sr.patchClientConnectCallback=sr.patchCallbackPGPool=sr.updateCounter=sr.getPoolName=sr.patchCallback=sr.handleExecutionResult=sr.handleConfigQuery=sr.shouldSkipInstrumentation=sr.getSemanticAttributesFromPoolConnection=sr.getSemanticAttributesFromConnection=sr.getConnectionString=sr.parseAndMaskConnectionString=sr.parseNormalizedOperationName=sr.getQuerySpanName=void 0;var CE=(He(),Me(tt)),_6=oX(),dp=(Xn(),Me(Hr)),Ei=iX(),oT=un(),FMe=sX();function GMe(e,t){if(!t)return FMe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:jMe(t.text);return`${FMe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}sr.getQuerySpanName=GMe;function jMe(e){let t=e.trim(),n=t.indexOf(" "),r=n===-1?t:t.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}sr.parseNormalizedOperationName=jMe;function zMe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}sr.parseAndMaskConnectionString=zMe;function aX(e){if("connectionString"in e&&e.connectionString)return zMe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}sr.getConnectionString=aX;function E6(e){if(Number.isInteger(e))return e}function HMe(e,t){let n={};return t&oT.SemconvStability.OLD&&(n={...n,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_DB_USER]:e.user,[Ei.ATTR_NET_PEER_NAME]:e.host,[Ei.ATTR_NET_PEER_PORT]:E6(e.port)}),t&oT.SemconvStability.STABLE&&(n={...n,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:e.host,[dp.ATTR_SERVER_PORT]:E6(e.port)}),n}sr.getSemanticAttributesFromConnection=HMe;function e1t(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[_6.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[_6.AttributeNames.MAX_CLIENT]:e.maxClient};return t&oT.SemconvStability.OLD&&(r={...r,[Ei.ATTR_DB_SYSTEM]:Ei.DB_SYSTEM_VALUE_POSTGRESQL,[Ei.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[Ei.ATTR_DB_CONNECTION_STRING]:aX(e),[Ei.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[Ei.ATTR_NET_PEER_PORT]:Number(n?.port)||E6(e.port),[Ei.ATTR_DB_USER]:n?.username??e.user}),t&oT.SemconvStability.STABLE&&(r={...r,[dp.ATTR_DB_SYSTEM_NAME]:dp.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[dp.ATTR_DB_NAMESPACE]:e.namespace,[dp.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[dp.ATTR_SERVER_PORT]:Number(n?.port)||E6(e.port)}),r}sr.getSemanticAttributesFromPoolConnection=e1t;function t1t(e){return e.requireParentSpan===!0&&CE.trace.getSpan(CE.context.active())===void 0}sr.shouldSkipInstrumentation=t1t;function n1t(e,t,n,r){let{connectionParameters:o}=this,i=o.database,s=GMe(i,r),u=e.startSpan(s,{kind:CE.SpanKind.CLIENT,attributes:HMe(o,n)});if(!r)return u;if(r.text&&(n&oT.SemconvStability.OLD&&u.setAttribute(Ei.ATTR_DB_STATEMENT,r.text),n&oT.SemconvStability.STABLE&&u.setAttribute(dp.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let l=r.values.map(f=>f==null?"null":f instanceof Buffer?f.toString():typeof f=="object"?typeof f.toPostgres=="function"?f.toPostgres():JSON.stringify(f):f.toString());u.setAttribute(_6.AttributeNames.PG_VALUES,l)}catch(l){CE.diag.error("failed to stringify ",r.values,l)}return typeof r.name=="string"&&u.setAttribute(_6.AttributeNames.PG_PLAN,r.name),u}sr.handleConfigQuery=n1t;function $Me(e,t,n){typeof e.responseHook=="function"&&(0,oT.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&CE.diag.error("Error running response hook",r)},!0)}sr.handleExecutionResult=$Me;function r1t(e,t,n,r,o){return function(s,u){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(r[dp.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(y6(s)),t.setStatus({code:CE.SpanStatusCode.ERROR,message:s.message})):$Me(e,t,u),o(),t.end(),n.call(this,s,u)}}sr.patchCallback=r1t;function o1t(e){let t="";return t+=(e?.host?`${e.host}`:"unknown_host")+":",t+=(e?.port?`${e.port}`:"unknown_port")+"/",t+=e?.database?`${e.database}`:"unknown_database",t.trim()}sr.getPoolName=o1t;function i1t(e,t,n,r,o){let i=t.totalCount,s=t.waitingCount,u=t.idleCount,l=i-u;return n.add(l-o.used,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(u-o.idle,{[Ei.ATTR_DB_CLIENT_CONNECTION_STATE]:Ei.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-o.pending,{[Ei.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:u,pending:s}}sr.updateCounter=i1t;function s1t(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(y6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}sr.patchCallbackPGPool=s1t;function a1t(e,t){return function(r){r&&(r instanceof Error&&e.recordException(y6(r)),e.setStatus({code:CE.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}sr.patchClientConnectCallback=a1t;function u1t(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}sr.getErrorMessage=u1t;function c1t(e){return typeof e=="object"&&typeof e?.text=="string"}sr.isObjectWithTextString=c1t;function y6(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}sr.sanitizedErrorMessage=y6});var VMe=M(DR=>{"use strict";m();Object.defineProperty(DR,"__esModule",{value:!0});DR.PACKAGE_NAME=DR.PACKAGE_VERSION=void 0;DR.PACKAGE_VERSION="0.66.0";DR.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var XMe=M(T6=>{"use strict";m();Object.defineProperty(T6,"__esModule",{value:!0});T6.PgInstrumentation=void 0;var tc=un(),Yr=(He(),Me(tt)),YMe=QMe(),ni=qMe(),KMe=HW(),JMe=VMe(),ZMe=sX(),S6=vr(),Df=(Xn(),Me(Hr)),SO=iX();function NR(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var uX=class extends tc.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(JMe.PACKAGE_NAME,JMe.PACKAGE_VERSION,t),this._semconvStability=(0,tc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Df.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Yr.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(SO.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(SO.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new tc.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new tc.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new tc.InstrumentationNodeModuleDefinition("pg",t,u=>{let l=NR(u);return this._patchPgClient(l.Client),u},u=>{let l=NR(u);return this._unpatchPgClient(l.Client),u},[o,r]),s=new tc.InstrumentationNodeModuleDefinition("pg-pool",n,u=>{let l=NR(u);return(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect"),this._wrap(l.prototype,"connect",this._getPoolConnectPatch()),l},u=>{let l=NR(u);(0,tc.isWrapped)(l.prototype.connect)&&this._unwrap(l.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=NR(t);return(0,tc.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tc.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(ZMe.SpanNames.CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchClientConnectCallback(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return WMe(s,u)}}recordOperationDuration(t,n){let r={},o=[Df.ATTR_DB_NAMESPACE,Df.ATTR_ERROR_TYPE,Df.ATTR_SERVER_PORT,Df.ATTR_SERVER_ADDRESS,Df.ATTR_DB_OPERATION_NAME];this._semconvStability&tc.SemconvStability.OLD&&o.push(SO.ATTR_DB_SYSTEM),this._semconvStability&tc.SemconvStability.STABLE&&o.push(Df.ATTR_DB_SYSTEM_NAME),o.forEach(s=>{s in t&&(r[s]=t[s])});let i=(0,S6.hrTimeToMilliseconds)((0,S6.hrTimeDuration)(n,(0,S6.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ni.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,S6.hrTime)(),s=o[0],u=typeof s=="string",l=ni.isObjectWithTextString(s),f=u?{text:s,values:Array.isArray(o[1])?o[1]:void 0}:l?{...s,name:s.name,text:s.text,values:s.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[SO.ATTR_DB_SYSTEM]:SO.DB_SYSTEM_VALUE_POSTGRESQL,[Df.ATTR_DB_NAMESPACE]:this.database,[Df.ATTR_SERVER_PORT]:this.connectionParameters.port,[Df.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};f?.text&&(h[Df.ATTR_DB_OPERATION_NAME]=ni.parseNormalizedOperationName(f?.text));let _=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),T=ni.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,f);if(y.addSqlCommenterCommentToQueries&&(u?o[0]=(0,KMe.addSqlCommenterComment)(T,s):l&&!("name"in s)&&(o[0]={...s,text:(0,KMe.addSqlCommenterComment)(T,s.text)})),o.length>0){let x=Yr.trace.getSpan(Yr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ni.patchCallback(y,T,o[o.length-1],h,_),x&&(o[o.length-1]=Yr.context.bind(Yr.context.active(),o[o.length-1]));else if(typeof f?.callback=="function"){let O=ni.patchCallback(t.getConfig(),T,f.callback,h,_);x&&(O=Yr.context.bind(Yr.context.active(),O)),o[0].callback=O}}let{requestHook:v}=y;typeof v=="function"&&f&&(0,tc.safeExecuteInTheMiddle)(()=>{let{database:x,host:O,port:P,user:j}=this.connectionParameters;v(T,{connection:{database:x,host:O,port:P,user:j},query:{text:f.text,values:f.values,name:f.name}})},x=>{x&&t._diag.error("Error running query hook",x)},!0);let R;try{R=n.apply(this,o)}catch(x){throw x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(x)}),T.end(),x}return R instanceof Promise?R.then(x=>new Promise(O=>{ni.handleExecutionResult(t.getConfig(),T,x),_(),T.end(),O(x)})).catch(x=>new Promise((O,P)=>{x instanceof Error&&T.recordException(ni.sanitizedErrorMessage(x)),T.setStatus({code:Yr.SpanStatusCode.ERROR,message:x.message}),_(),T.end(),P(x)})):R})}_setPoolConnectEventListeners(t){if(t[YMe.EVENT_LISTENERS_SET])return;let n=ni.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=ni.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[YMe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(ni.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let s=t.tracer.startSpan(ZMe.SpanNames.POOL_CONNECT,{kind:Yr.SpanKind.CLIENT,attributes:ni.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let l=Yr.trace.getSpan(Yr.context.active());o=ni.patchCallbackPGPool(s,o),l&&(o=Yr.context.bind(Yr.context.active(),o))}let u=Yr.context.with(Yr.trace.setSpan(Yr.context.active(),s),()=>n.call(this,o));return WMe(s,u)}}};T6.PgInstrumentation=uX;function WMe(e,t){if(!(t instanceof Promise))return t;let n=t;return Yr.context.bind(Yr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(ni.sanitizedErrorMessage(r)),e.setStatus({code:Yr.SpanStatusCode.ERROR,message:ni.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var e2e=M(BR=>{"use strict";m();Object.defineProperty(BR,"__esModule",{value:!0});BR.AttributeNames=BR.PgInstrumentation=void 0;var l1t=XMe();Object.defineProperty(BR,"PgInstrumentation",{enumerable:!0,get:function(){return l1t.PgInstrumentation}});var d1t=oX();Object.defineProperty(BR,"AttributeNames",{enumerable:!0,get:function(){return d1t.AttributeNames}})});var t2e,n2e,r2e,p1t,o2e,i2e=w(()=>{m();t2e=ue(e2e(),1);_r();n2e="Postgres",r2e=ct(n2e,t2e.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){qr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),p1t=(e=>({name:n2e,setupOnce(){r2e(e)}})),o2e=p1t});var vE,lX,s2e,f1t,m1t,a2e,cX,A1t,u2e,c2e=w(()=>{m();He();vE=ue(un(),1);Xn();At();_r();YS();lX="PostgresJs",s2e=[">=3.0.0 <4"],f1t=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,m1t=Symbol.for("sentry.query.from.instrumented.sql"),a2e=ct(lX,e=>new cX({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),cX=class extends vE.InstrumentationBase{constructor(t){super("sentry-postgres-js",er,t)}init(){let t=new vE.InstrumentationNodeModuleDefinition("postgres",s2e,n=>{try{return this._patchPostgres(n)}catch(r){return Ds&&W.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new vE.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,s2e,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",r=n?t:t.default;if(typeof r!="function")return Ds&&W.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...s){let u=Reflect.construct(r,s);if(!u||typeof u!="function")return Ds&&W.warn("postgres() did not return a valid instance"),u;let l=o.getConfig();return cK(u,{requireParentSpan:l.requireParentSpan,requestHook:l.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}return n?i:(gw(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Vt.getSpan(We.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(LC,r);return}let o=n?.match(f1t);o?.[1]&&t.setAttribute(LC,o[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(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"}_patchQueryPrototype(t){let n=this,r=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...o){if(this[m1t])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return oa({name:s||"postgresjs.query",op:"db"},u=>{qr(u,"auto.db.postgresjs"),u.setAttributes({[fS]:"postgres",[SV]:s});let l=n.getConfig(),{requestHook:f}=l;f&&(0,vE.safeExecuteInTheMiddle)(()=>f(u,s,void 0),y=>{y&&(u.setAttribute("sentry.hook.error","requestHook failed"),Ds&&W.error(`Error in requestHook for ${lX} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,T,v)=>{try{n._setOperationName(u,s,v?.[0]?.command),u.end()}catch(R){Ds&&W.error("Error ending span in resolve callback:",R)}return Reflect.apply(y,T,v)}});let _=this.reject;this.reject=new Proxy(_,{apply:(y,T,v)=>{try{u.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),u.setAttribute(TV,v?.[0]?.code||"unknown"),u.setAttribute(bV,v?.[0]?.name||"unknown"),n._setOperationName(u,s),u.end()}catch(R){Ds&&W.error("Error ending span in reject callback:",R)}return Reflect.apply(y,T,v)}});try{return r.apply(this,o)}catch(y){throw u.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),u.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},A1t=(e=>({name:lX,setupOnce(){a2e(e)}})),u2e=A1t});var l2e=M(TO=>{"use strict";m();Object.defineProperty(TO,"__esModule",{value:!0});TO.SeverityNumber=void 0;var g1t;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(g1t=TO.SeverityNumber||(TO.SeverityNumber={}))});var I6=M(wR=>{"use strict";m();Object.defineProperty(wR,"__esModule",{value:!0});wR.NOOP_LOGGER=wR.NoopLogger=void 0;var b6=class{emit(t){}};wR.NoopLogger=b6;wR.NOOP_LOGGER=new b6});var v6=M(OR=>{"use strict";m();Object.defineProperty(OR,"__esModule",{value:!0});OR.NOOP_LOGGER_PROVIDER=OR.NoopLoggerProvider=void 0;var h1t=I6(),C6=class{getLogger(t,n,r){return new h1t.NoopLogger}};OR.NoopLoggerProvider=C6;OR.NOOP_LOGGER_PROVIDER=new C6});var pX=M(R6=>{"use strict";m();Object.defineProperty(R6,"__esModule",{value:!0});R6.ProxyLogger=void 0;var _1t=I6(),dX=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):_1t.NOOP_LOGGER}};R6.ProxyLogger=dX});var mX=M(x6=>{"use strict";m();Object.defineProperty(x6,"__esModule",{value:!0});x6.ProxyLoggerProvider=void 0;var E1t=v6(),y1t=pX(),fX=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new y1t.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:E1t.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};x6.ProxyLoggerProvider=fX});var d2e=M(D6=>{"use strict";m();Object.defineProperty(D6,"__esModule",{value:!0});D6._globalThis=void 0;D6._globalThis=typeof globalThis=="object"?globalThis:global});var p2e=M(N6=>{"use strict";m();Object.defineProperty(N6,"__esModule",{value:!0});N6._globalThis=void 0;var S1t=d2e();Object.defineProperty(N6,"_globalThis",{enumerable:!0,get:function(){return S1t._globalThis}})});var f2e=M(B6=>{"use strict";m();Object.defineProperty(B6,"__esModule",{value:!0});B6._globalThis=void 0;var T1t=p2e();Object.defineProperty(B6,"_globalThis",{enumerable:!0,get:function(){return T1t._globalThis}})});var m2e=M(nA=>{"use strict";m();Object.defineProperty(nA,"__esModule",{value:!0});nA.API_BACKWARDS_COMPATIBILITY_VERSION=nA.makeGetter=nA._global=nA.GLOBAL_LOGS_API_KEY=void 0;var b1t=f2e();nA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");nA._global=b1t._globalThis;function I1t(e,t,n){return r=>r===e?t:n}nA.makeGetter=I1t;nA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var g2e=M(w6=>{"use strict";m();Object.defineProperty(w6,"__esModule",{value:!0});w6.LogsAPI=void 0;var pp=m2e(),C1t=v6(),A2e=mX(),AX=class e{constructor(){this._proxyLoggerProvider=new A2e.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return pp._global[pp.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(pp._global[pp.GLOBAL_LOGS_API_KEY]=(0,pp.makeGetter)(pp.API_BACKWARDS_COMPATIBILITY_VERSION,t,C1t.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=pp._global[pp.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(pp._global,pp.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete pp._global[pp.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new A2e.ProxyLoggerProvider}};w6.LogsAPI=AX});var gX=M(ca=>{"use strict";m();Object.defineProperty(ca,"__esModule",{value:!0});ca.logs=ca.ProxyLoggerProvider=ca.ProxyLogger=ca.NoopLoggerProvider=ca.NOOP_LOGGER_PROVIDER=ca.NoopLogger=ca.NOOP_LOGGER=ca.SeverityNumber=void 0;var v1t=l2e();Object.defineProperty(ca,"SeverityNumber",{enumerable:!0,get:function(){return v1t.SeverityNumber}});var h2e=I6();Object.defineProperty(ca,"NOOP_LOGGER",{enumerable:!0,get:function(){return h2e.NOOP_LOGGER}});Object.defineProperty(ca,"NoopLogger",{enumerable:!0,get:function(){return h2e.NoopLogger}});var _2e=v6();Object.defineProperty(ca,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return _2e.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ca,"NoopLoggerProvider",{enumerable:!0,get:function(){return _2e.NoopLoggerProvider}});var R1t=pX();Object.defineProperty(ca,"ProxyLogger",{enumerable:!0,get:function(){return R1t.ProxyLogger}});var x1t=mX();Object.defineProperty(ca,"ProxyLoggerProvider",{enumerable:!0,get:function(){return x1t.ProxyLoggerProvider}});var D1t=g2e();ca.logs=D1t.LogsAPI.getInstance()});var E2e=M(kR=>{"use strict";m();Object.defineProperty(kR,"__esModule",{value:!0});kR.disableInstrumentations=kR.enableInstrumentations=void 0;function N1t(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}kR.enableInstrumentations=N1t;function B1t(e){e.forEach(t=>t.disable())}kR.disableInstrumentations=B1t});var T2e=M(O6=>{"use strict";m();Object.defineProperty(O6,"__esModule",{value:!0});O6.registerInstrumentations=void 0;var y2e=(He(),Me(tt)),w1t=gX(),S2e=E2e();function O1t(e){let t=e.tracerProvider||y2e.trace.getTracerProvider(),n=e.meterProvider||y2e.metrics.getMeterProvider(),r=e.loggerProvider||w1t.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,S2e.enableInstrumentations)(o,t,n,r),()=>{(0,S2e.disableInstrumentations)(o)}}O6.registerInstrumentations=O1t});var B2e=M(k6=>{"use strict";m();Object.defineProperty(k6,"__esModule",{value:!0});k6.satisfies=void 0;var yX=(He(),Me(tt)),R2e=/^(?: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-]+)*))?$/,k1t=/^(?<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-]+)*))?$/,P1t={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function M1t(e,t,n){if(!L1t(e))return yX.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=G1t(e);if(!r)return!1;let o=[],i=x2e(r,t,o,n);return i&&!n?.includePrerelease?Q1t(r,o):i}k6.satisfies=M1t;function L1t(e){return typeof e=="string"&&R2e.test(e)}function x2e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(hX(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=uNt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!hX(e,i,n,r))return!1;return!0}return hX(e,t,n,r)}function hX(e,t,n,r){if(t=F1t(t,r),t.includes(" "))return x2e(e,t,n,r);{let o=j1t(t);return n.push(o),U1t(e,o)}}function U1t(e,t){if(t.invalid)return!1;if(!t.version||EX(t.version))return!0;let n=I2e(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=I2e(r,o)}return P1t[t.op]?.includes(n)}function Q1t(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function F1t(e,t){return e=e.trim(),e=sNt(e,t),e=iNt(e),e=aNt(e,t),e=e.trim(),e}function nc(e){return!e||e.toLowerCase()==="x"||e==="*"}function G1t(e){let t=e.match(R2e);if(!t){yX.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:o}}function j1t(e){if(!e)return{};let t=e.match(k1t);if(!t)return yX.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,s=r.split("."),u=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:o,prereleaseSegments:u,prereleaseSegmentCount:u?u.length:0,build:i}}function EX(e){return e==="*"||e==="x"||e==="X"}function b2e(e){let t=parseInt(e,10);return isNaN(t)?e:t}function z1t(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function H1t(e,t){if(EX(e)||EX(t))return 0;let[n,r]=z1t(b2e(e),b2e(t));return n>r?1:n<r?-1:0}function I2e(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=H1t(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var D2e="[a-zA-Z0-9-]",N2e="0|[1-9]\\d*",$1t=`\\d*[a-zA-Z-]${D2e}*`,q1t="((?:<|>)?=?)",C2e=`(?:${N2e}|${$1t})`,V1t=`(?:-(${C2e}(?:\\.${C2e})*))`,v2e=`${D2e}+`,Y1t=`(?:\\+(${v2e}(?:\\.${v2e})*))`,_X=`${N2e}|x|X|\\*`,bO=`[v=\\s]*(${_X})(?:\\.(${_X})(?:\\.(${_X})(?:${V1t})?${Y1t}?)?)?`,K1t=`^${q1t}\\s*${bO}$`,J1t=new RegExp(K1t),Z1t=`^\\s*(${bO})\\s+-\\s+(${bO})\\s*$`,W1t=new RegExp(Z1t),X1t="(?:~>?)",eNt=`^${X1t}${bO}$`,tNt=new RegExp(eNt),nNt="(?:\\^)",rNt=`^${nNt}${bO}$`,oNt=new RegExp(rNt);function iNt(e){let t=tNt;return e.replace(t,(n,r,o,i,s)=>{let u;return nc(r)?u="":nc(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:nc(i)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:s?u=`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:u=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,u})}function sNt(e,t){let n=oNt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,s,u,l)=>{let f;return nc(i)?f="":nc(s)?f=`>=${i}.0.0${r} <${+i+1}.0.0-0`:nc(u)?i==="0"?f=`>=${i}.${s}.0${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.0${r} <${+i+1}.0.0-0`:l?i==="0"?s==="0"?f=`>=${i}.${s}.${u}-${l} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}-${l} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u}-${l} <${+i+1}.0.0-0`:i==="0"?s==="0"?f=`>=${i}.${s}.${u}${r} <${i}.${s}.${+u+1}-0`:f=`>=${i}.${s}.${u}${r} <${i}.${+s+1}.0-0`:f=`>=${i}.${s}.${u} <${+i+1}.0.0-0`,f})}function aNt(e,t){let n=J1t;return e.replace(n,(r,o,i,s,u,l)=>{let f=nc(i),h=f||nc(s),_=h||nc(u),y=_;return o==="="&&y&&(o=""),l=t?.includePrerelease?"-0":"",f?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(s=0),u=0,o===">"?(o=">=",h?(i=+i+1,s=0,u=0):(s=+s+1,u=0)):o==="<="&&(o="<",h?i=+i+1:s=+s+1),o==="<"&&(l="-0"),r=`${o+i}.${s}.${u}${l}`):h?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:_&&(r=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`),r})}function uNt(e,t){let n=W1t;return e.replace(n,(r,o,i,s,u,l,f,h,_,y,T,v)=>(nc(i)?o="":nc(s)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:nc(u)?o=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:l?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,nc(_)?h="":nc(y)?h=`<${+_+1}.0.0-0`:nc(T)?h=`<${_}.${+y+1}.0-0`:v?h=`<=${_}.${y}.${T}-${v}`:t?.includePrerelease?h=`<${_}.${y}.${+T+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var SX=M(Ua=>{"use strict";m();Object.defineProperty(Ua,"__esModule",{value:!0});Ua.massUnwrap=Ua.unwrap=Ua.massWrap=Ua.wrap=void 0;var rc=console.error.bind(console);function IO(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var cNt=(e,t,n)=>{if(!e||!e[t]){rc("no original function "+String(t)+" to wrap");return}if(!n){rc("no wrapper function"),rc(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){rc("original object and wrapper must be functions");return}let o=n(r,t);return IO(o,"__original",r),IO(o,"__unwrap",()=>{e[t]===o&&IO(e,t,r)}),IO(o,"__wrapped",!0),IO(e,t,o),o};Ua.wrap=cNt;var lNt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ua.wrap)(r,o,n)})})};Ua.massWrap=lNt;var dNt=(e,t)=>{if(!e||!e[t]){rc("no function to unwrap."),rc(new Error().stack);return}let n=e[t];if(!n.__unwrap)rc("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ua.unwrap=dNt;var pNt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{rc("must provide one or more modules to patch"),rc(new Error().stack);return}if(!(t&&Array.isArray(t))){rc("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ua.unwrap)(n,r)})})};Ua.massUnwrap=pNt;function CO(e){e&&e.logger&&(typeof e.logger!="function"?rc("new logger isn't a function, not replacing"):rc=e.logger)}Ua.default=CO;CO.wrap=Ua.wrap;CO.massWrap=Ua.massWrap;CO.unwrap=Ua.unwrap;CO.massUnwrap=Ua.massUnwrap});var w2e=M(M6=>{"use strict";m();Object.defineProperty(M6,"__esModule",{value:!0});M6.InstrumentationAbstract=void 0;var TX=(He(),Me(tt)),fNt=gX(),P6=SX(),bX=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=TX.diag.createComponentLogger({namespace:t}),this._tracer=TX.trace.getTracer(t,n),this._meter=TX.metrics.getMeter(t,n),this._logger=fNt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=P6.wrap;_unwrap=P6.unwrap;_massWrap=P6.massWrap;_massUnwrap=P6.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};M6.InstrumentationAbstract=bX});var O2e=M(RE=>{"use strict";m();Object.defineProperty(RE,"__esModule",{value:!0});RE.ModuleNameTrie=RE.ModuleNameSeparator=void 0;RE.ModuleNameSeparator="/";var L6=class{hooks=[];children=new Map},IX=class{_trie=new L6;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(RE.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new L6,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],s=!0;for(let u of t.split(RE.ModuleNameSeparator)){let l=o.children.get(u);if(!l){s=!1;break}r||i.push(...l.hooks),o=l}return r&&s&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((u,l)=>u.insertedId-l.insertedId),i.map(({hook:u})=>u))}};RE.ModuleNameTrie=IX});var P2e=M(U6=>{"use strict";m();Object.defineProperty(U6,"__esModule",{value:!0});U6.RequireInTheMiddleSingleton=void 0;var mNt=ES(),k2e=Ue("path"),CX=O2e(),ANt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),vX=class e{_moduleNameTrie=new CX.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new mNt.Hook(null,{internals:!0},(t,n,r)=>{let o=gNt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of i)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return ANt?new e:this._instance=this._instance??new e}};U6.RequireInTheMiddleSingleton=vX;function gNt(e){return k2e.sep!==CX.ModuleNameSeparator?e.split(k2e.sep).join(CX.ModuleNameSeparator):e}});var RX=M(xE=>{"use strict";m();Object.defineProperty(xE,"__esModule",{value:!0});xE.isWrapped=xE.safeExecuteInTheMiddleAsync=xE.safeExecuteInTheMiddle=void 0;function hNt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddle=hNt;async function _Nt(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}xE.safeExecuteInTheMiddleAsync=_Nt;function ENt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}xE.isWrapped=ENt});var U2e=M(Q6=>{"use strict";m();Object.defineProperty(Q6,"__esModule",{value:!0});Q6.InstrumentationBase=void 0;var vO=Ue("path"),M2e=Ue("util"),yNt=B2e(),xX=SX(),SNt=w2e(),TNt=P2e(),bNt=uW(),RO=(He(),Me(tt)),INt=ES(),CNt=Ue("fs"),vNt=RX(),DX=class extends SNt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=TNt.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,vNt.isWrapped)(t[n])&&this._unwrap(t,n),M2e.types.isProxy(t)){let o=(0,xX.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,xX.wrap)(t,n,r)};_unwrap=(t,n)=>M2e.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,xX.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{RO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){RO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Ue.resolve(n);Ue.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(t){try{let n=(0,CNt.readFileSync)(vO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{RO.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return L2e(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let s=t.files??[],u=vO.normalize(r);return s.filter(f=>f.name===u).filter(f=>L2e(f.supportedVersions,i,t.includePrerelease)).reduce((f,h)=>(h.moduleExports=f,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(f,t.moduleVersion)):f),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,u,l)=>{if(!l&&vO.isAbsolute(u)){let f=vO.parse(u);u=f.name,l=f.dir}return this._onRequire(t,s,u,l)},r=(s,u,l)=>this._onRequire(t,s,u,l),o=vO.isAbsolute(t.name)?new INt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new bNt.Hook([t.name],{internals:!1},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};Q6.InstrumentationBase=DX;function L2e(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,yNt.satisfies)(t,r,{includePrerelease:n}))}});var Q2e=M(F6=>{"use strict";m();Object.defineProperty(F6,"__esModule",{value:!0});F6.normalize=void 0;var RNt=Ue("path");Object.defineProperty(F6,"normalize",{enumerable:!0,get:function(){return RNt.normalize}})});var F2e=M(PR=>{"use strict";m();Object.defineProperty(PR,"__esModule",{value:!0});PR.normalize=PR.InstrumentationBase=void 0;var xNt=U2e();Object.defineProperty(PR,"InstrumentationBase",{enumerable:!0,get:function(){return xNt.InstrumentationBase}});var DNt=Q2e();Object.defineProperty(PR,"normalize",{enumerable:!0,get:function(){return DNt.normalize}})});var NX=M(MR=>{"use strict";m();Object.defineProperty(MR,"__esModule",{value:!0});MR.normalize=MR.InstrumentationBase=void 0;var G2e=F2e();Object.defineProperty(MR,"InstrumentationBase",{enumerable:!0,get:function(){return G2e.InstrumentationBase}});Object.defineProperty(MR,"normalize",{enumerable:!0,get:function(){return G2e.normalize}})});var j2e=M(G6=>{"use strict";m();Object.defineProperty(G6,"__esModule",{value:!0});G6.InstrumentationNodeModuleDefinition=void 0;var BX=class{name;supportedVersions;patch;unpatch;files;constructor(t,n,r,o,i){this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=i||[]}};G6.InstrumentationNodeModuleDefinition=BX});var z2e=M(j6=>{"use strict";m();Object.defineProperty(j6,"__esModule",{value:!0});j6.InstrumentationNodeModuleFile=void 0;var NNt=NX(),wX=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,NNt.normalize)(t)}};j6.InstrumentationNodeModuleFile=wX});var H2e=M(iT=>{"use strict";m();Object.defineProperty(iT,"__esModule",{value:!0});iT.semconvStabilityFromStr=iT.SemconvStability=void 0;var z6;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(z6=iT.SemconvStability||(iT.SemconvStability={}));function BNt(e,t){let n=z6.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=z6.DUPLICATE;break}else o.toLowerCase()===e&&(n=z6.STABLE);return n}iT.semconvStabilityFromStr=BNt});var q2e=M(cs=>{"use strict";m();Object.defineProperty(cs,"__esModule",{value:!0});cs.semconvStabilityFromStr=cs.SemconvStability=cs.safeExecuteInTheMiddleAsync=cs.safeExecuteInTheMiddle=cs.isWrapped=cs.InstrumentationNodeModuleFile=cs.InstrumentationNodeModuleDefinition=cs.InstrumentationBase=cs.registerInstrumentations=void 0;var wNt=T2e();Object.defineProperty(cs,"registerInstrumentations",{enumerable:!0,get:function(){return wNt.registerInstrumentations}});var ONt=NX();Object.defineProperty(cs,"InstrumentationBase",{enumerable:!0,get:function(){return ONt.InstrumentationBase}});var kNt=j2e();Object.defineProperty(cs,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return kNt.InstrumentationNodeModuleDefinition}});var PNt=z2e();Object.defineProperty(cs,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return PNt.InstrumentationNodeModuleFile}});var OX=RX();Object.defineProperty(cs,"isWrapped",{enumerable:!0,get:function(){return OX.isWrapped}});Object.defineProperty(cs,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddle}});Object.defineProperty(cs,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return OX.safeExecuteInTheMiddleAsync}});var $2e=H2e();Object.defineProperty(cs,"SemconvStability",{enumerable:!0,get:function(){return $2e.SemconvStability}});Object.defineProperty(cs,"semconvStabilityFromStr",{enumerable:!0,get:function(){return $2e.semconvStabilityFromStr}})});function UNt(){let e=LR[PX];return e?.helper?e.helper:LR[kX]?.helper}function QNt(e){let t={helper:e};LR[PX]=t,LR[kX]=t}function FNt(){delete LR[PX],delete LR[kX]}function zNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}function K2e(e,t,n,r,o){if(J2e(t.name,o))return;let i={attributes:t.attributes,kind:zNt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,s=>{r.set(t.id,s.spanContext().spanId),t.links&&s.addLinks(t.links.flatMap(l=>{let f=r.get(l);return f?{context:{spanId:f,traceId:s.spanContext().traceId,traceFlags:s.spanContext().traceFlags}}:[]}));let u=n.filter(l=>l.parentId===t.id);for(let l of u)K2e(e,l,n,r,o);s.end(t.endTime)})}function V2e(e,t){return $Nt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function $Nt(e){return e!=null&&typeof e.then=="function"}function J2e(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var H6,MNt,LNt,kX,PX,LR,GNt,jNt,HNt,Z2e,Y2e,qNt,VNt,W2e,X2e=w(()=>{m();He();H6=ue(q2e(),1);He();MNt={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"}},LNt=MNt.version.split(".")[0],kX="PRISMA_INSTRUMENTATION",PX=`V${LNt}_PRISMA_INSTRUMENTATION`,LR=globalThis;GNt=process.env.PRISMA_SHOW_ALL_TRACES==="true",jNt="00-10-10-00";HNt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Vt.getSpanContext(e??We.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:jNt}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)K2e(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return We.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!GNt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(J2e(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return V2e(i,t(i,r))}return n.startActiveSpan(o,e,i=>V2e(i,t(i,r)))}};Z2e={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},Y2e=Z2e.version,qNt=Z2e.name,VNt="@prisma/client",W2e=class extends H6.InstrumentationBase{tracerProvider;constructor(e={}){super(qNt,Y2e,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new H6.InstrumentationNodeModuleDefinition(VNt,[Y2e])]}enable(){let e=this._config;QNt(new HNt({tracerProvider:this.tracerProvider??Vt.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){FNt()}isEnabled(){return UNt()!==void 0}}});function YNt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function tLe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function KNt(e){return e==="client"?fo.CLIENT:fo.INTERNAL}var eLe,MX,JNt,nLe,rLe=w(()=>{m();He();X2e();At();_r();eLe="Prisma";MX=class extends W2e{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=tLe();YNt(t)&&(t.createEngineSpan=n=>{let r=Vt.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Xo(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(i=>{let s=KNt(i.kind),u=i.parent_span_id,l=i.span_id,f=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:iu.SAMPLED}})),_=Vt.setSpanContext(We.active(),{traceId:f,spanId:u,traceFlags:iu.SAMPLED});We.with(_,()=>{let y={generateTraceId:()=>f,generateSpanId:()=>l};r._idGenerator=y,r.startSpan(i.name,{kind:s,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};JNt=ct(eLe,e=>new MX(e)),nLe=e=>({name:eLe,setupOnce(){JNt(e)},setup(t){tLe()&&t.on("spanStart",n=>{let r=kt(n);r.description?.startsWith("prisma:")&&n.setAttribute(Mt,"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 oLe=M(UR=>{"use strict";m();Object.defineProperty(UR,"__esModule",{value:!0});UR.PACKAGE_NAME=UR.PACKAGE_VERSION=void 0;UR.PACKAGE_VERSION="0.60.0";UR.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var LX=M(rA=>{"use strict";m();Object.defineProperty(rA,"__esModule",{value:!0});rA.HapiLifecycleMethodNames=rA.HapiLayerType=rA.handlerPatched=rA.HapiComponentName=void 0;rA.HapiComponentName="@hapi/hapi";rA.handlerPatched=Symbol("hapi-handler-patched");rA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};rA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var iLe=M($6=>{"use strict";m();Object.defineProperty($6,"__esModule",{value:!0});$6.ATTR_HTTP_METHOD=void 0;$6.ATTR_HTTP_METHOD="http.method"});var UX=M(xO=>{"use strict";m();Object.defineProperty(xO,"__esModule",{value:!0});xO.AttributeNames=void 0;var ZNt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(ZNt=xO.AttributeNames||(xO.AttributeNames={}))});var uLe=M(ls=>{"use strict";m();Object.defineProperty(ls,"__esModule",{value:!0});ls.getPluginFromInput=ls.getExtMetadata=ls.getRouteMetadata=ls.isPatchableExtMethod=ls.isDirectExtInput=ls.isLifecycleExtEventObj=ls.isLifecycleExtType=ls.getPluginName=void 0;var sLe=(Xn(),Me(Hr)),WNt=iLe(),DO=LX(),DE=UX(),aLe=un();function XNt(e){return e.name?e.name:e.pkg.name}ls.getPluginName=XNt;var eBt=e=>typeof e=="string"&&DO.HapiLifecycleMethodNames.has(e);ls.isLifecycleExtType=eBt;var tBt=e=>{let t=e?.type;return t!==void 0&&(0,ls.isLifecycleExtType)(t)};ls.isLifecycleExtEventObj=tBt;var nBt=e=>Array.isArray(e)&&e.length<=3&&(0,ls.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ls.isDirectExtInput=nBt;var rBt=e=>!Array.isArray(e);ls.isPatchableExtMethod=rBt;var oBt=(e,t,n)=>{let r={[sLe.ATTR_HTTP_ROUTE]:e.path};t&aLe.SemconvStability.OLD&&(r[WNt.ATTR_HTTP_METHOD]=e.method),t&aLe.SemconvStability.STABLE&&(r[sLe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.PLUGIN,r[DE.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[DE.AttributeNames.HAPI_TYPE]=DO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ls.getRouteMetadata=oBt;var iBt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT,[DE.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[DE.AttributeNames.EXT_TYPE]:e,[DE.AttributeNames.HAPI_TYPE]:DO.HapiLayerType.EXT},name:r}};ls.getExtMetadata=iBt;var sBt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ls.getPluginFromInput=sBt});var dLe=M(q6=>{"use strict";m();Object.defineProperty(q6,"__esModule",{value:!0});q6.HapiInstrumentation=void 0;var ed=(He(),Me(tt)),cLe=vr(),NO=un(),lLe=oLe(),BO=LX(),eh=uLe(),QX=class extends NO.InstrumentationBase{_semconvStability;constructor(t={}){super(lLe.PACKAGE_NAME,lLe.PACKAGE_VERSION,t),this._semconvStability=(0,NO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new NO.InstrumentationNodeModuleDefinition(BO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,NO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,NO.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,r=this;return function(i){let s=t.apply(this,[i]);return r._wrap(s,"route",u=>n._getServerRoutePatch.bind(n)(u)),r._wrap(s,"ext",u=>n._getServerExtPatch.bind(n)(u)),r._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let s of o){let u=(0,eh.getPluginFromInput)(s);n._wrapRegisterHandler(u)}else{let s=(0,eh.getPluginFromInput)(o);n._wrapRegisterHandler(s)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let s=i[0];for(let u=0;u<s.length;u++){let l=s[u];if((0,eh.isLifecycleExtType)(l.type)){let f=l,h=r._wrapExtMethods(f.method,l.type,n);f.method=h,s[u]=f}}return t.apply(this,i)}else if((0,eh.isDirectExtInput)(i)){let s=i,u=s[1],l=r._wrapExtMethods(u,s[0],n);return t.apply(this,[s[0],l,s[2]])}else if((0,eh.isLifecycleExtEventObj)(i[0])){let s=i[0],u=r._wrapExtMethods(s.method,s.type,n);return s.method=u,t.call(this,s)}return t.apply(this,i)}}_getServerRoutePatch(t,n){let r=this;return function(o){if(Array.isArray(o))for(let i=0;i<o.length;i++){let s=r._wrapRouteHandler.call(r,o[i],n);o[i]=s}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,eh.getPluginName)(t),o=t.register,i=this,s=function(u,l){return i._wrap(u,"route",f=>n._getServerRoutePatch.bind(n)(f,r)),i._wrap(u,"ext",f=>n._getServerExtPatch.bind(n)(f,r)),o.call(this,u,l)};t.register=s}_wrapExtMethods(t,n,r){let o=this;if(t instanceof Array){for(let i=0;i<t.length;i++)t[i]=o._wrapExtMethods(t[i],n);return t}else if((0,eh.isPatchableExtMethod)(t))return t[BO.handlerPatched]===!0?t:(t[BO.handlerPatched]=!0,async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await t.apply(this,s);let u=(0,eh.getExtMetadata)(n,r,t.name),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),l),t,void 0,...s)}catch(f){throw l.recordException(f),l.setStatus({code:ed.SpanStatusCode.ERROR,message:f.message}),f}finally{l.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[BO.handlerPatched]===!0)return t;t[BO.handlerPatched]=!0;let o=i=>async function(...s){if(ed.trace.getSpan(ed.context.active())===void 0)return await i.call(this,...s);let u=(0,cLe.getRPCMetadata)(ed.context.active());u?.type===cLe.RPCType.HTTP&&(u.route=t.path);let l=(0,eh.getRouteMetadata)(t,r._semconvStability,n),f=r.tracer.startSpan(l.name,{attributes:l.attributes});try{return await ed.context.with(ed.trace.setSpan(ed.context.active(),f),()=>i.call(this,...s))}catch(h){throw f.recordException(h),f.setStatus({code:ed.SpanStatusCode.ERROR,message:h.message}),h}finally{f.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(s){let u=i(s);return typeof u.handler=="function"&&(u.handler=o(u.handler)),u}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};q6.HapiInstrumentation=QX});var pLe=M(QR=>{"use strict";m();Object.defineProperty(QR,"__esModule",{value:!0});QR.AttributeNames=QR.HapiInstrumentation=void 0;var aBt=dLe();Object.defineProperty(QR,"HapiInstrumentation",{enumerable:!0,get:function(){return aBt.HapiInstrumentation}});var uBt=UX();Object.defineProperty(QR,"AttributeNames",{enumerable:!0,get:function(){return uBt.AttributeNames}})});var fLe,mLe,ALe,cBt,gLe,hLe=w(()=>{m();fLe=ue(pLe(),1);_r();mLe="Hapi",ALe=ct(mLe,()=>new fLe.HapiInstrumentation),cBt=(()=>({name:mLe,setupOnce(){ALe()}})),gLe=cBt});var NE,wO,FX=w(()=>{m();NE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},wO={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var Y6,lBt,dBt,V6,_Le=w(()=>{m();He();Y6=ue(un(),1);At();FX();lBt="@sentry/instrumentation-hono",dBt="0.0.1",V6=class extends Y6.InstrumentationBase{constructor(t={}){super(lBt,dBt,t)}init(){return[new Y6.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class r extends t.Hono{constructor(...i){super(...i),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{t.Hono=r}catch{return{...t,Hono:r}}return t}_patchHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_patchOnHandler(){let t=this;return function(n){return function(...o){let i=o.slice(2);return n.apply(this,[...o.slice(0,2),...i.map(s=>t._wrapHandler(s))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let s=o.slice(1);return n.apply(this,[i,...s.map(u=>t._wrapHandler(u))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_wrapHandler(t){let n=this;return function(r,o){if(!n.isEnabled())return t.apply(this,[r,o]);let i=r.req.path,s=n.tracer.startSpan(i);return We.with(Vt.setSpan(We.active(),s),()=>n._safeExecute(()=>{let u=t.apply(this,[r,o]);if(Da(u))return u.then(l=>{let f=n._determineHandlerType(l);return s.setAttributes({[NE.HONO_TYPE]:f,[NE.HONO_NAME]:f===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),l});{let l=n._determineHandlerType(u);return s.setAttributes({[NE.HONO_TYPE]:l,[NE.HONO_NAME]:l===wO.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),u}},()=>s.end(),u=>{n._handleError(s,u),s.end()}))}}_safeExecute(t,n,r){try{let o=t();return Da(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?wO.MIDDLEWARE:wO.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:Ai.ERROR,message:n.message}),t.recordException(n))}}});function pBt(e){let t=kt(e).data,n=t[NE.HONO_TYPE];if(t[Xt]||!n)return;e.setAttributes({[Mt]:"auto.http.otel.hono",[Xt]:`${n}.hono`});let r=t[NE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[Rg],i=t[mS];typeof o=="string"&&typeof i=="string"&&Rn().setTransactionName(`${i} ${o}`)}var ELe,yLe,fBt,SLe,TLe=w(()=>{m();Xn();At();_r();YS();FX();_Le();ELe="Hono";yLe=ct(ELe,()=>new V6({responseHook:e=>{pBt(e)}})),fBt=(()=>({name:ELe,setupOnce(){yLe()}})),SLe=fBt});var K6=M(OO=>{"use strict";m();Object.defineProperty(OO,"__esModule",{value:!0});OO.KoaLayerType=void 0;var mBt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(mBt=OO.KoaLayerType||(OO.KoaLayerType={}))});var bLe=M(FR=>{"use strict";m();Object.defineProperty(FR,"__esModule",{value:!0});FR.PACKAGE_NAME=FR.PACKAGE_VERSION=void 0;FR.PACKAGE_VERSION="0.62.0";FR.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var GX=M(kO=>{"use strict";m();Object.defineProperty(kO,"__esModule",{value:!0});kO.AttributeNames=void 0;var ABt;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(ABt=kO.AttributeNames||(kO.AttributeNames={}))});var CLe=M(GR=>{"use strict";m();Object.defineProperty(GR,"__esModule",{value:!0});GR.isLayerIgnored=GR.getMiddlewareMetadata=void 0;var ILe=K6(),J6=GX(),gBt=(Xn(),Me(Hr)),hBt=(e,t,n,r)=>n?{attributes:{[J6.AttributeNames.KOA_NAME]:r?.toString(),[J6.AttributeNames.KOA_TYPE]:ILe.KoaLayerType.ROUTER,[gBt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[J6.AttributeNames.KOA_NAME]:t.name??"middleware",[J6.AttributeNames.KOA_TYPE]:ILe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};GR.getMiddlewareMetadata=hBt;var _Bt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));GR.isLayerIgnored=_Bt});var vLe=M(Z6=>{"use strict";m();Object.defineProperty(Z6,"__esModule",{value:!0});Z6.kLayerPatched=void 0;Z6.kLayerPatched=Symbol("koa-layer-patched")});var wLe=M(W6=>{"use strict";m();Object.defineProperty(W6,"__esModule",{value:!0});W6.KoaInstrumentation=void 0;var oA=(He(),Me(tt)),PO=un(),RLe=K6(),xLe=bLe(),DLe=CLe(),NLe=vr(),BLe=vLe(),jX=class extends PO.InstrumentationBase{constructor(t={}){super(xLe.PACKAGE_NAME,xLe.PACKAGE_VERSION,t)}init(){return new PO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,PO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;(0,PO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this;return function(o){let i;return o.router?i=n._patchRouterDispatch(o):i=n._patchLayer(o,!1),t.apply(this,[i])}}_patchRouterDispatch(t){oA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,s=o.stack;for(let u=0;u<s.length;u++){let l=s[u];s[u]=this._patchLayer(l,!0,i)}}return t}_patchLayer(t,n,r){let o=n?RLe.KoaLayerType.ROUTER:RLe.KoaLayerType.MIDDLEWARE;return t[BLe.kLayerPatched]===!0||(0,DLe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(oA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[BLe.kLayerPatched]=!0,oA.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(oA.trace.getSpan(oA.context.active())===void 0)return t(i,s);let l=(0,DLe.getMiddlewareMetadata)(i,t,n,r),f=this.tracer.startSpan(l.name,{attributes:l.attributes}),h=(0,NLe.getRPCMetadata)(oA.context.active());h?.type===NLe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:_}=this.getConfig();_&&(0,PO.safeExecuteInTheMiddle)(()=>_(f,{context:i,middlewareLayer:t,layerType:o}),T=>{T&&oA.diag.error("koa instrumentation: request hook failed",T)},!0);let y=oA.trace.setSpan(oA.context.active(),f);return oA.context.with(y,async()=>{try{return await t(i,s)}catch(T){throw f.recordException(T),T}finally{f.end()}})})}};W6.KoaInstrumentation=jX});var OLe=M(BE=>{"use strict";m();Object.defineProperty(BE,"__esModule",{value:!0});BE.KoaLayerType=BE.AttributeNames=BE.KoaInstrumentation=void 0;var EBt=wLe();Object.defineProperty(BE,"KoaInstrumentation",{enumerable:!0,get:function(){return EBt.KoaInstrumentation}});var yBt=GX();Object.defineProperty(BE,"AttributeNames",{enumerable:!0,get:function(){return yBt.AttributeNames}});var SBt=K6();Object.defineProperty(BE,"KoaLayerType",{enumerable:!0,get:function(){return SBt.KoaLayerType}})});var kLe,PLe,MLe,TBt,LLe,ULe=w(()=>{m();kLe=ue(OLe(),1);Xn();At();_r();YS();PLe="Koa",MLe=ct(PLe,kLe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){qr(t,"auto.http.otel.koa");let r=kt(t).data,o=r["koa.type"];o&&t.setAttribute(Xt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),Rn()===Zd()){Ds&&W.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=r[Rg],u=n.context?.request?.method?.toUpperCase()||"GET";s&&Rn().setTransactionName(`${u} ${s}`)}})),TBt=((e={})=>({name:PLe,setupOnce(){MLe(e)}})),LLe=TBt});var zX=M(Nf=>{"use strict";m();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.ConnectNames=Nf.ConnectTypes=Nf.AttributeNames=void 0;var bBt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(bBt=Nf.AttributeNames||(Nf.AttributeNames={}));var IBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(IBt=Nf.ConnectTypes||(Nf.ConnectTypes={}));var CBt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(CBt=Nf.ConnectNames||(Nf.ConnectNames={}))});var QLe=M(jR=>{"use strict";m();Object.defineProperty(jR,"__esModule",{value:!0});jR.PACKAGE_NAME=jR.PACKAGE_VERSION=void 0;jR.PACKAGE_VERSION="0.57.0";jR.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var FLe=M(X6=>{"use strict";m();Object.defineProperty(X6,"__esModule",{value:!0});X6._LAYERS_STORE_PROPERTY=void 0;X6._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var GLe=M(OE=>{"use strict";m();Object.defineProperty(OE,"__esModule",{value:!0});OE.generateRoute=OE.replaceCurrentStackRoute=OE.addNewStackLayer=void 0;var vBt=(He(),Me(tt)),wE=FLe(),RBt=e=>{Array.isArray(e[wE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,wE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[wE._LAYERS_STORE_PROPERTY].push("/");let t=e[wE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[wE._LAYERS_STORE_PROPERTY].length?e[wE._LAYERS_STORE_PROPERTY].pop():vBt.diag.warn("Connect: Trying to pop the stack multiple time")}};OE.addNewStackLayer=RBt;var xBt=(e,t)=>{t&&e[wE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};OE.replaceCurrentStackRoute=xBt;var DBt=e=>e[wE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);OE.generateRoute=DBt});var HLe=M(kE=>{"use strict";m();Object.defineProperty(kE,"__esModule",{value:!0});kE.ConnectInstrumentation=kE.ANONYMOUS_NAME=void 0;var NBt=(He(),Me(tt)),jLe=vr(),zR=zX(),zLe=QLe(),eG=un(),BBt=(Xn(),Me(Hr)),HX=GLe();kE.ANONYMOUS_NAME="anonymous";var $X=class extends eG.InstrumentationBase{constructor(t={}){super(zLe.PACKAGE_NAME,zLe.PACKAGE_VERSION,t)}init(){return[new eG.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,eG.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,eG.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this;return function(...r){let o=t.apply(this,r);return n._patchApp(o),o}}_patchNext(t,n){return function(o){let i=t.apply(this,[o]);return n(),i}}_startSpan(t,n){let r,o,i;t?(r=zR.ConnectTypes.REQUEST_HANDLER,i=zR.ConnectNames.REQUEST_HANDLER,o=t):(r=zR.ConnectTypes.MIDDLEWARE,i=zR.ConnectNames.MIDDLEWARE,o=n.name||kE.ANONYMOUS_NAME);let s=`${i} - ${o}`,u={attributes:{[BBt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[zR.AttributeNames.CONNECT_TYPE]:r,[zR.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(s,u)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[s,u,l]=o?[1,2,3]:[0,1,2],f=arguments[s],h=arguments[u],_=arguments[l];(0,HX.replaceCurrentStackRoute)(f,t);let y=(0,jLe.getRPCMetadata)(NBt.context.active());t&&y?.type===jLe.RPCType.HTTP&&(y.route=(0,HX.generateRoute)(f));let T="";t?T=`request handler - ${t}`:T=`middleware - ${n.name||kE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",T);let R=!1;function x(){R?r._diag.debug(`span ${v.name} - already finished`):(R=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",x)}return h.addListener("close",x),arguments[l]=r._patchNext(_,x),n.apply(this,arguments)}return Object.defineProperty(i,"length",{value:n.length,writable:!1,configurable:!0}),i}_patchUse(t){let n=this;return function(...r){let o=r[r.length-1],i=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(i,o),t.apply(this,r)}}_patchHandle(t){let n=this;return function(){let[r,o]=[0,2],i=arguments[r],s=arguments[o],u=(0,HX.addNewStackLayer)(i);return typeof s=="function"&&(arguments[o]=n._patchOut(s,u)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};kE.ConnectInstrumentation=$X});var qLe=M(fp=>{"use strict";m();Object.defineProperty(fp,"__esModule",{value:!0});fp.ConnectTypes=fp.ConnectNames=fp.AttributeNames=fp.ANONYMOUS_NAME=fp.ConnectInstrumentation=void 0;var $Le=HLe();Object.defineProperty(fp,"ConnectInstrumentation",{enumerable:!0,get:function(){return $Le.ConnectInstrumentation}});Object.defineProperty(fp,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return $Le.ANONYMOUS_NAME}});var qX=zX();Object.defineProperty(fp,"AttributeNames",{enumerable:!0,get:function(){return qX.AttributeNames}});Object.defineProperty(fp,"ConnectNames",{enumerable:!0,get:function(){return qX.ConnectNames}});Object.defineProperty(fp,"ConnectTypes",{enumerable:!0,get:function(){return qX.ConnectTypes}})});var VLe,YLe,KLe,wBt,JLe,ZLe=w(()=>{m();VLe=ue(qLe(),1);_r();YLe="Connect",KLe=ct(YLe,()=>new VLe.ConnectInstrumentation),wBt=(()=>({name:YLe,setupOnce(){KLe()}})),JLe=wBt});var WLe=M(la=>{"use strict";m();Object.defineProperty(la,"__esModule",{value:!0});la.DB_SYSTEM_VALUE_MSSQL=la.ATTR_NET_PEER_PORT=la.ATTR_NET_PEER_NAME=la.ATTR_DB_USER=la.ATTR_DB_SYSTEM=la.ATTR_DB_STATEMENT=la.ATTR_DB_SQL_TABLE=la.ATTR_DB_NAME=void 0;la.ATTR_DB_NAME="db.name";la.ATTR_DB_SQL_TABLE="db.sql.table";la.ATTR_DB_STATEMENT="db.statement";la.ATTR_DB_SYSTEM="db.system";la.ATTR_DB_USER="db.user";la.ATTR_NET_PEER_NAME="net.peer.name";la.ATTR_NET_PEER_PORT="net.peer.port";la.DB_SYSTEM_VALUE_MSSQL="mssql"});var XLe=M(HR=>{"use strict";m();Object.defineProperty(HR,"__esModule",{value:!0});HR.once=HR.getSpanName=void 0;function OBt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}HR.getSpanName=OBt;var kBt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};HR.once=kBt});var eUe=M($R=>{"use strict";m();Object.defineProperty($R,"__esModule",{value:!0});$R.PACKAGE_NAME=$R.PACKAGE_VERSION=void 0;$R.PACKAGE_VERSION="0.33.0";$R.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var iUe=M(ME=>{"use strict";m();Object.defineProperty(ME,"__esModule",{value:!0});ME.TediousInstrumentation=ME.INJECTED_CTX=void 0;var qR=(He(),Me(tt)),PBt=Ue("events"),iA=un(),sT=(Xn(),Me(Hr)),PE=WLe(),tUe=XLe(),nUe=eUe(),oUe=Symbol("opentelemetry.instrumentation-tedious.current-database");ME.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var rUe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function tG(e){Object.defineProperty(this,oUe,{value:e,writable:!0})}var VX=class e extends iA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(nUe.PACKAGE_NAME,nUe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,iA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,iA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new iA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of rUe)(0,iA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,iA.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let r of rUe)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return tG.call(this,this.config?.options?.database),this.removeListener("databaseChange",tG),this.on("databaseChange",tG),this.once("end",()=>{this.removeListener("databaseChange",tG)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||qR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",s=new n.Request(i,l=>{o()});Object.defineProperty(s,ME.INJECTED_CTX,{value:!0});let u=Buffer.from(r,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,u,{length:u.length}),t.execSql(s)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(s){if(s?.[ME.INJECTED_CTX])return r.apply(this,arguments);if(!(s instanceof PBt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let u=0,l=0,f=()=>l++,h=()=>u++,_=this[oUe],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(s),T={};o._dbSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_DB_SYSTEM]=PE.DB_SYSTEM_VALUE_MSSQL,T[PE.ATTR_DB_NAME]=_,T[PE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,T[PE.ATTR_DB_STATEMENT]=y,T[PE.ATTR_DB_SQL_TABLE]=s.table),o._dbSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_DB_NAMESPACE]=_,T[sT.ATTR_DB_SYSTEM_NAME]=sT.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,T[sT.ATTR_DB_QUERY_TEXT]=y,T[sT.ATTR_DB_COLLECTION_NAME]=s.table),o._netSemconvStability&iA.SemconvStability.OLD&&(T[PE.ATTR_NET_PEER_NAME]=this.config?.server,T[PE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&iA.SemconvStability.STABLE&&(T[sT.ATTR_SERVER_ADDRESS]=this.config?.server,T[sT.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,tUe.getSpanName)(t,_,y,s.table),{kind:qR.SpanKind.CLIENT,attributes:T}),R=(0,tUe.once)(G=>{s.removeListener("done",f),s.removeListener("doneInProc",f),s.removeListener("doneProc",h),s.removeListener("error",R),this.removeListener("end",R),v.setAttribute("tedious.procedure_count",u),v.setAttribute("tedious.statement_count",l),G&&v.setStatus({code:qR.SpanStatusCode.ERROR,message:G.message}),v.end()});s.on("done",f),s.on("doneInProc",f),s.on("doneProc",h),s.once("error",R),this.on("end",R),typeof s.callback=="function"?o._wrap(s,"callback",o._patchCallbackQuery(R)):o._diag.error("Expected request.callback to be a function");let x=()=>qR.context.with(qR.trace.setSpan(qR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return x();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(x)}return Object.defineProperty(i,"length",{value:r.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r),n.apply(this,arguments)}}};ME.TediousInstrumentation=VX});var sUe=M(nG=>{"use strict";m();Object.defineProperty(nG,"__esModule",{value:!0});nG.TediousInstrumentation=void 0;var MBt=iUe();Object.defineProperty(nG,"TediousInstrumentation",{enumerable:!0,get:function(){return MBt.TediousInstrumentation}})});var aUe,LBt,uUe,cUe,UBt,lUe,dUe=w(()=>{m();aUe=ue(sUe(),1);At();_r();LBt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),uUe="Tedious",cUe=ct(uUe,()=>new aUe.TediousInstrumentation({})),UBt=(()=>{let e;return{name:uUe,setupOnce(){let t=cUe();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=kt(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";LBt.has(i)&&n.setAttribute(Mt,"auto.db.otel.tedious")}))}}}),lUe=UBt});var pUe=M(VR=>{"use strict";m();Object.defineProperty(VR,"__esModule",{value:!0});VR.PACKAGE_NAME=VR.PACKAGE_VERSION=void 0;VR.PACKAGE_VERSION="0.57.0";VR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var mUe=M(rG=>{"use strict";m();Object.defineProperty(rG,"__esModule",{value:!0});rG.GenericPoolInstrumentation=void 0;var YR=(He(),Me(tt)),aT=un(),fUe=pUe(),YX="generic-pool",KX=class extends aT.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(fUe.PACKAGE_NAME,fUe.PACKAGE_VERSION,t)}init(){return[new aT.InstrumentationNodeModuleDefinition(YX,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,aT.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new aT.InstrumentationNodeModuleDefinition(YX,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,aT.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new aT.InstrumentationNodeModuleDefinition(YX,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,aT.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let n=this;return function(...o){let i=YR.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return YR.context.with(YR.trace.setSpan(i,s),()=>t.call(this,...o).then(u=>(s.end(),u),u=>{throw s.recordException(u),s.end(),u}))}}_poolWrapper(t){let n=this;return function(){let o=t.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(t){let n=this;return function(o,i){if(n._isDisabled)return t.call(this,o,i);let s=YR.context.active(),u=n.tracer.startSpan("generic-pool.acquire",{},s);return YR.context.with(YR.trace.setSpan(s,u),()=>{t.call(this,(l,f)=>{if(u.end(),o)return o(l,f)},i)})}}};rG.GenericPoolInstrumentation=KX});var AUe=M(oG=>{"use strict";m();Object.defineProperty(oG,"__esModule",{value:!0});oG.GenericPoolInstrumentation=void 0;var QBt=mUe();Object.defineProperty(oG,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return QBt.GenericPoolInstrumentation}})});var gUe,hUe,_Ue,FBt,EUe,yUe=w(()=>{m();gUe=ue(AUe(),1);At();_r();hUe="GenericPool",_Ue=ct(hUe,()=>new gUe.GenericPoolInstrumentation({})),FBt=(()=>{let e;return{name:hUe,setupOnce(){let t=_Ue();e=_w(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=kt(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Mt,"auto.db.otel.generic_pool")}))}}}),EUe=FBt});var JX=M(sA=>{"use strict";m();Object.defineProperty(sA,"__esModule",{value:!0});sA.ATTR_NET_PEER_PORT=sA.ATTR_NET_PEER_NAME=sA.ATTR_MESSAGING_SYSTEM=sA.ATTR_MESSAGING_OPERATION=void 0;sA.ATTR_MESSAGING_OPERATION="messaging.operation";sA.ATTR_MESSAGING_SYSTEM="messaging.system";sA.ATTR_NET_PEER_NAME="net.peer.name";sA.ATTR_NET_PEER_PORT="net.peer.port"});var ZX=M(yi=>{"use strict";m();Object.defineProperty(yi,"__esModule",{value:!0});yi.ATTR_MESSAGING_CONVERSATION_ID=yi.OLD_ATTR_MESSAGING_MESSAGE_ID=yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=yi.ATTR_MESSAGING_URL=yi.ATTR_MESSAGING_PROTOCOL_VERSION=yi.ATTR_MESSAGING_PROTOCOL=yi.MESSAGING_OPERATION_VALUE_PROCESS=yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=yi.ATTR_MESSAGING_DESTINATION_KIND=yi.ATTR_MESSAGING_DESTINATION=void 0;yi.ATTR_MESSAGING_DESTINATION="messaging.destination";yi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";yi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";yi.MESSAGING_OPERATION_VALUE_PROCESS="process";yi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";yi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";yi.ATTR_MESSAGING_URL="messaging.url";yi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";yi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";yi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var WX=M(uT=>{"use strict";m();Object.defineProperty(uT,"__esModule",{value:!0});uT.DEFAULT_CONFIG=uT.EndOperation=void 0;var GBt;(function(e){e.AutoAck="auto ack",e.Ack="ack",e.AckAll="ackAll",e.Reject="reject",e.Nack="nack",e.NackAll="nackAll",e.ChannelClosed="channel closed",e.ChannelError="channel error",e.InstrumentationTimeout="instrumentation timeout"})(GBt=uT.EndOperation||(uT.EndOperation={}));uT.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var IUe=M(Si=>{"use strict";m();Object.defineProperty(Si,"__esModule",{value:!0});Si.isConfirmChannelTracing=Si.unmarkConfirmChannelTracing=Si.markConfirmChannelTracing=Si.getConnectionAttributesFromUrl=Si.getConnectionAttributesFromServer=Si.normalizeExchange=Si.CONNECTION_ATTRIBUTES=Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Si.CHANNEL_SPANS_NOT_ENDED=Si.MESSAGE_STORED_SPAN=void 0;var XX=(He(),Me(tt)),LE=un(),iG=(Xn(),Me(Hr)),MO=JX(),sG=ZX();Si.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Si.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Si.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Si.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var eee=(0,XX.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),jBt=e=>e!==""?e:"<default>";Si.normalizeExchange=jBt;var zBt=e=>e.replace(/:[^:@/]*@/,":***@"),SUe=(e,t)=>e||(t==="AMQP"?5672:5671),TUe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},bUe=e=>e||"localhost",aA=(e,t,n,r)=>n?{[t]:n}:(XX.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),HBt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[MO.ATTR_MESSAGING_SYSTEM]:t}:{}};Si.getConnectionAttributesFromServer=HBt;var $Bt=(e,t)=>{let n={[sG.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=TUe(r?.protocol);Object.assign(n,{...aA(e,sG.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=bUe(r?.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(e,MO.ATTR_NET_PEER_NAME,i,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(e,iG.ATTR_SERVER_ADDRESS,i,"hostname")});let s=SUe(r.port,o);t&LE.SemconvStability.OLD&&Object.assign(n,aA(e,MO.ATTR_NET_PEER_PORT,s,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(e,iG.ATTR_SERVER_PORT,s,"port"))}else{let r=zBt(e);n[sG.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=TUe(o.protocol);Object.assign(n,{...aA(r,sG.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=bUe(o.hostname);t&LE.SemconvStability.OLD&&Object.assign(n,{...aA(r,MO.ATTR_NET_PEER_NAME,s,"hostname")}),t&LE.SemconvStability.STABLE&&Object.assign(n,{...aA(r,iG.ATTR_SERVER_ADDRESS,s,"hostname")});let u=SUe(o.port?parseInt(o.port):void 0,i);t&LE.SemconvStability.OLD&&Object.assign(n,aA(r,MO.ATTR_NET_PEER_PORT,u,"port")),t&LE.SemconvStability.STABLE&&Object.assign(n,aA(r,iG.ATTR_SERVER_PORT,u,"port"))}catch(o){XX.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Si.getConnectionAttributesFromUrl=$Bt;var qBt=e=>e.setValue(eee,!0);Si.markConfirmChannelTracing=qBt;var VBt=e=>e.deleteValue(eee);Si.unmarkConfirmChannelTracing=VBt;var YBt=e=>e.getValue(eee)===!0;Si.isConfirmChannelTracing=YBt});var CUe=M(KR=>{"use strict";m();Object.defineProperty(KR,"__esModule",{value:!0});KR.PACKAGE_NAME=KR.PACKAGE_VERSION=void 0;KR.PACKAGE_VERSION="0.61.0";KR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var RUe=M(cG=>{"use strict";m();Object.defineProperty(cG,"__esModule",{value:!0});cG.AmqplibInstrumentation=void 0;var ri=(He(),Me(tt)),aG=vr(),xr=un(),KBt=JX(),td=ZX(),oc=WX(),Ti=IUe(),vUe=CUe(),uG=[">=0.5.5 <1"],tee=class extends xr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(vUe.PACKAGE_NAME,vUe.PACKAGE_VERSION,{...oc.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,xr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...oc.DEFAULT_CONFIG,...t})}init(){let t=new xr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",uG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new xr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",uG,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new xr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",uG,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new xr.InstrumentationNodeModuleDefinition("amqplib",uG,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,xr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,xr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,xr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,xr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,oc.EndOperation.Ack)),(0,xr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,oc.EndOperation.Nack)),(0,xr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,oc.EndOperation.Reject)),(0,xr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,oc.EndOperation.AckAll)),(0,xr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,oc.EndOperation.NackAll)),(0,xr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,xr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,xr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,xr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,xr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,xr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,xr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,xr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,xr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,xr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,xr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,s){return t.call(this,o,i,function(u,l){if(u==null){let f=(0,Ti.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,Ti.getConnectionAttributesFromServer)(l);l[Ti.CONNECTION_ATTRIBUTES]={...f,...h}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelClosed,void 0);let i=this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,oc.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(s){return o.endAllSpansOnChannel(this,t,n,s),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(s,u,l){let f=this,h=n===oc.EndOperation.Reject?u:l,_=f[Ti.CHANNEL_SPANS_NOT_ENDED]??[],y=_.findIndex(T=>T.msg===s);if(y<0)o.endConsumerSpan(s,t,n,h);else if(n!==oc.EndOperation.Reject&&u){for(let T=0;T<=y;T++)o.endConsumerSpan(_[T].msg,t,n,h);_.splice(0,y+1)}else o.endConsumerSpan(s,t,n,h),_.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,s,u){let l=this;if(!Object.prototype.hasOwnProperty.call(l,Ti.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let _=setInterval(()=>{r.checkConsumeTimeoutOnChannel(l)},h);_.unref(),l[Ti.CHANNEL_CONSUME_TIMEOUT_TIMER]=_}l[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}let f=function(h){if(!h)return s.call(this,h);let _=h.properties.headers??{},y=ri.propagation.extract(ri.ROOT_CONTEXT,_),T=h.fields?.exchange,v;if(r._config.useLinksForConsume){let P=y?ri.trace.getSpan(y)?.spanContext():void 0;y=void 0,P&&(v=[{context:P}])}let R=r.tracer.startSpan(`${i} process`,{kind:ri.SpanKind.CONSUMER,attributes:{...l?.connection?.[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:T,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[KBt.ATTR_MESSAGING_OPERATION]:td.MESSAGING_OPERATION_VALUE_PROCESS,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:x}=r.getConfig();x&&(0,xr.safeExecuteInTheMiddle)(()=>x(R,{moduleVersion:t,msg:h}),P=>{P&&ri.diag.error("amqplib instrumentation: consumerHook error",P)},!0),u?.noAck||(l[Ti.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,aG.hrTime)()}),h[Ti.MESSAGE_STORED_SPAN]=R);let O=y||ri.ROOT_CONTEXT;ri.context.with(ri.trace.setSpan(O,R),()=>{s.call(this,h)}),u?.noAck&&(r.callConsumeEndHook(R,h,!1,oc.EndOperation.AutoAck),R.end())};return arguments[1]=f,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,s,u,l,f){let h=this,{span:_,modifiedOptions:y}=r.createPublishSpan(r,i,s,h,l),{publishHook:T}=r.getConfig();T&&(0,xr.safeExecuteInTheMiddle)(()=>T(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:y,isConfirmChannel:!0}),O=>{O&&ri.diag.error("amqplib instrumentation: publishHook error",O)},!0);let v=function(O,P){try{f?.call(this,O,P)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,xr.safeExecuteInTheMiddle)(()=>j(_,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:l,isConfirmChannel:!0,confirmError:O}),G=>{G&&ri.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),O&&_.setStatus({code:ri.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),_.end()}},R=(0,Ti.markConfirmChannelTracing)(ri.context.active()),x=[...arguments];return x[3]=y,x[4]=ri.context.bind((0,Ti.unmarkConfirmChannelTracing)(ri.trace.setSpan(R,_)),v),ri.context.with(R,n.bind(this,...x))}}getPublishPatch(t,n){let r=this;return function(i,s,u,l){if((0,Ti.isConfirmChannelTracing)(ri.context.active()))return n.apply(this,arguments);{let f=this,{span:h,modifiedOptions:_}=r.createPublishSpan(r,i,s,f,l),{publishHook:y}=r.getConfig();y&&(0,xr.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:s,content:u,options:_,isConfirmChannel:!1}),R=>{R&&ri.diag.error("amqplib instrumentation: publishHook error",R)},!0);let T=[...arguments];T[3]=_;let v=n.apply(this,T);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let s=(0,Ti.normalizeExchange)(n),u=t.tracer.startSpan(`publish ${s}`,{kind:ri.SpanKind.PRODUCER,attributes:{...o.connection[Ti.CONNECTION_ATTRIBUTES],[td.ATTR_MESSAGING_DESTINATION]:n,[td.ATTR_MESSAGING_DESTINATION_KIND]:td.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[td.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[td.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[td.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),l=i??{};return l.headers=l.headers??{},ri.propagation.inject(ri.trace.setSpan(ri.context.active(),u),l.headers),{span:u,modifiedOptions:l}}endConsumerSpan(t,n,r,o){let i=t[Ti.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:ri.SpanStatusCode.ERROR,message:r!==oc.EndOperation.ChannelClosed&&r!==oc.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[Ti.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[Ti.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,r,o)}),t[Ti.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,xr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),s=>{s&&ri.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,aG.hrTime)(),r=t[Ti.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let s=r[o],u=(0,aG.hrTimeDuration)(s.timeOfConsume,n);if((0,aG.hrTimeToMilliseconds)(u)<i)break;this.endConsumerSpan(s.msg,null,oc.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};cG.AmqplibInstrumentation=tee});var DUe=M(UE=>{"use strict";m();Object.defineProperty(UE,"__esModule",{value:!0});UE.EndOperation=UE.DEFAULT_CONFIG=UE.AmqplibInstrumentation=void 0;var JBt=RUe();Object.defineProperty(UE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return JBt.AmqplibInstrumentation}});var xUe=WX();Object.defineProperty(UE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return xUe.DEFAULT_CONFIG}});Object.defineProperty(UE,"EndOperation",{enumerable:!0,get:function(){return xUe.EndOperation}})});var NUe,BUe,ZBt,wUe,WBt,OUe,kUe=w(()=>{m();NUe=ue(DUe(),1);_r();BUe="Amqplib",ZBt={consumeEndHook:e=>{qr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{qr(e,"auto.amqplib.otel.publisher")}},wUe=ct(BUe,()=>new NUe.AmqplibInstrumentation(ZBt)),WBt=(()=>({name:BUe,setupOnce(){wUe()}})),OUe=WBt});var LO,nee=w(()=>{m();LO="VercelAI"});function ewt(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&"error"in t&&"toolName"in t&&"toolCallId"in t&&t.type==="tool-error"&&t.error instanceof Error}function twt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(nwt(t.content),rwt(t.content))}function nwt(e){for(let t of e){if(!ewt(t))continue;let n=wK(t.toolCallId);n?zl(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):zl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),rn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function rwt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&OK(t.toolCallId)}function owt(e,t,n,r){let o=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:r,i=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:i}}var dG,XBt,PUe,lG,MUe=w(()=>{m();dG=ue(un(),1);At();nee();XBt=[">=3.0.0 <7"],PUe=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];lG=class e extends dG.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",er,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new dG.InstrumentationNodeModuleDefinition("ai",XBt,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,i,s)=>{let u=s[0].experimental_telemetry||{},l=u.isEnabled,f=Et(),h=f?.getIntegrationByName(LO),_=h?.options,y=h?!!f?.getOptions().sendDefaultPii:!1,{recordInputs:T,recordOutputs:v}=owt(_,u,l,y);return s[0].experimental_telemetry={...u,isEnabled:l!==void 0?l:!0,recordInputs:T,recordOutputs:v},If(()=>Reflect.apply(o,i,s),R=>{R&&typeof R=="object"&&ns(R,"_sentry_active_span",Hc())},()=>{},R=>{twt(R)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of PUe)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=PUe.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function iwt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var LUe,swt,UUe,QUe=w(()=>{m();At();_r();nee();MUe();LUe=ct(LO,()=>new lG({}));swt=((e={})=>{let t;return{name:LO,options:e,setupOnce(){t=LUe()},afterAllSetup(n){e.force??iwt(n)?gF(n):t?.callWhenPatched(()=>gF(n))}}}),UUe=swt});var fG,awt,pG,FUe=w(()=>{m();fG=ue(un(),1);At();awt=[">=4.0.0 <7"],pG=class extends fG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",er,t)}init(){return new fG.InstrumentationNodeModuleDefinition("openai",awt,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let r=t[n];if(!r)return t;let o=this.getConfig(),i=function(...s){if(BS(uE))return Reflect.construct(r,s);let u=Reflect.construct(r,s);return EF(u,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let u=Object.getOwnPropertyDescriptor(r,s);u&&Object.defineProperty(i,s,u)}try{t[n]=i}catch{Object.defineProperty(t,n,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}}});var GUe,uwt,jUe,zUe=w(()=>{m();At();_r();FUe();GUe=ct(uE,e=>new pG(e)),uwt=((e={})=>({name:uE,setupOnce(){GUe(e)}})),jUe=uwt});var AG,cwt,mG,HUe=w(()=>{m();AG=ue(un(),1);At();cwt=[">=0.19.2 <1.0.0"],mG=class extends AG.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",er,t)}init(){return new AG.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",cwt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(BS(cE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return yF(s,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}try{t.Anthropic=o}catch{Object.defineProperty(t,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=o}catch{Object.defineProperty(t,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return t}}});var $Ue,lwt,qUe,VUe=w(()=>{m();At();_r();HUe();$Ue=ct(cE,e=>new mG(e)),lwt=((e={})=>({name:cE,options:e,setupOnce(){$Ue(e)}})),qUe=lwt});var JR,YUe,gG,KUe=w(()=>{m();JR=ue(un(),1);At();YUe=[">=0.10.0 <2"],gG=class extends JR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",er,t)}init(){return new JR.InstrumentationNodeModuleDefinition("@google/genai",YUe,n=>this._patch(n),n=>n,[new JR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",YUe,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return t;let o=function(...i){if(BS(lE))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return SF(s,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(o,i,s)}return gw(t,"GoogleGenAI",o),t}}});var JUe,dwt,ZUe,WUe=w(()=>{m();At();_r();KUe();JUe=ct(lE,e=>new gG(e)),dwt=((e={})=>({name:lE,setupOnce(){JUe(e)}})),ZUe=dwt});function pwt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function fwt(e,t,n){return new Proxy(e,{apply(r,o,i){let u=i[1];(!u||typeof u!="object"||Array.isArray(u))&&(u={},i[1]=u);let l=u.callbacks,f=pwt(l,t);return u.callbacks=f,Reflect.apply(r,o,i)}})}var QE,hG,_G,XUe=w(()=>{m();QE=ue(un(),1);At();hG=[">=0.1.0 <2.0.0"];_G=class extends QE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",er,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)t.push(new QE.InstrumentationNodeModuleDefinition(r,hG,this._patch.bind(this),o=>o,[new QE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,hG,this._patch.bind(this),o=>o)]));return t.push(new QE.InstrumentationNodeModuleDefinition("langchain",hG,this._patch.bind(this),r=>r,[new QE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",hG,this._patch.bind(this),r=>r)])),t}_patch(t){KY([uE,cE,lE]);let n=CF(this.getConfig());return this._patchRunnableMethods(t,n),t}_patchRunnableMethods(t,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=t.universal_exports??t,i=Object.values(o).find(l=>typeof l=="function"&&r.includes(l.name));if(!i)return;let s=i.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let u=["invoke","stream","batch"];for(let l of u){let f=s[l];typeof f=="function"&&(s[l]=fwt(f,n))}}}});var eQe,mwt,tQe,nQe=w(()=>{m();At();_r();XUe();eQe=ct(TF,e=>new _G(e)),mwt=((e={})=>({name:TF,setupOnce(){eQe(e)}})),tQe=mwt});var ZR,rQe,EG,oQe=w(()=>{m();ZR=ue(un(),1);At();rQe=[">=0.0.0 <2.0.0"],EG=class extends ZR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",er,t)}init(){return new ZR.InstrumentationNodeModuleDefinition("@langchain/langgraph",rQe,this._patch.bind(this),n=>n,[new ZR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",rQe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&RF(t.StateGraph.prototype,this.getConfig()),t}}});var iQe,Awt,sQe,aQe=w(()=>{m();At();_r();oQe();iQe=ct(vF,e=>new EG(e)),Awt=((e={})=>({name:vF,setupOnce(){iQe(e)}})),sQe=Awt});import*as cQe from"node:net";function lQe(e,t,n,r,o){let s=()=>{},u=o.firestoreSpanCreationHook;typeof u=="function"&&(s=h=>{(0,th.safeExecuteInTheMiddle)(()=>u(h),_=>{_&&Fl.error(_?.message)},!0)});let l=new th.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>uQe(h,n,r,e,s)),f=["@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 h of f)l.files.push(new th.InstrumentationNodeModuleFile(h,t,_=>uQe(_,n,r,e,s),_=>dQe(_,r)));return l}function uQe(e,t,n,r,o){return dQe(e,n),t(e,"addDoc",gwt(r,o)),t(e,"getDocs",_wt(r,o)),t(e,"setDoc",Ewt(r,o)),t(e,"deleteDoc",hwt(r,o)),e}function dQe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,th.isWrapped)(e[n])&&t(e,n);return e}function gwt(e,t){return function(r){return function(o,i){let s=SG(e,"addDoc",o);return t(s),yG(s,()=>r(o,i))}}}function hwt(e,t){return function(r){return function(o){let i=SG(e,"deleteDoc",o.parent||o);return t(i),yG(i,()=>r(o))}}}function _wt(e,t){return function(r){return function(o){let i=SG(e,"getDocs",o);return t(i),yG(i,()=>r(o))}}}function Ewt(e,t){return function(r){return function(o,i,s){let u=SG(e,"setDoc",o.parent||o);return t(u),yG(u,()=>typeof s<"u"?r(o,i,s):r(o,i))}}}function yG(e,t){return We.with(Vt.setSpan(We.active(),e),()=>(0,th.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function SG(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:fo.CLIENT});return Swt(r,n),r.setAttribute(LC,t),r}function ywt(e){let t,n;if(typeof e.host=="string")if(e.host.startsWith("[")){if(e.host.endsWith("]"))t=e.host.replace(/^\[|\]$/g,"");else if(e.host.includes("]:")){let r=e.host.lastIndexOf(":");r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,""),n=e.host.slice(r+1))}}else if(cQe.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function Swt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[EV]:t.path,[yV]:n.name,[fS]:"firebase.firestore","firebase.firestore.type":t.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:u,port:l}=ywt(i);u&&(s[xV]=u),l&&(s[DV]=l),e.setAttributes(s)}var th,pQe=w(()=>{m();He();th=ue(un(),1);Xn()});function fQe(e,t,n,r,o){let i=()=>{},s=()=>{},u=o.functions?.errorHook,l=o.functions?.requestHook,f=o.functions?.responseHook;typeof f=="function"&&(s=(y,T)=>{(0,nh.safeExecuteInTheMiddle)(()=>f(y,T),v=>{v&&Fl.error(v?.message)},!0)}),typeof l=="function"&&(i=y=>{(0,nh.safeExecuteInTheMiddle)(()=>l(y),T=>{T&&Fl.error(T?.message)},!0)});let h=new nh.InstrumentationNodeModuleDefinition("firebase-functions",t);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:y,triggerType:T})=>{h.files.push(new nh.InstrumentationNodeModuleFile(y,t,v=>Twt(v,n,r,e,{requestHook:i,responseHook:s,errorHook:u},T),v=>mQe(v,r)))}),h}function ic(e,t,n){return function(o){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],u=typeof i[0]=="function"?void 0:i[0];if(!s)return o.call(this,...i);let l=async function(...f){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",_=e.startSpan(`firebase.function.${n}`,{kind:fo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),_.setAttributes(y),t?.requestHook?.(_),We.with(Vt.setSpan(We.active(),_),async()=>{let T,v;try{v=await s.apply(this,f)}catch(R){T=R}if(t?.responseHook?.(_,T),T&&_.recordException(T),_.end(),T)throw await t?.errorHook?.(_,T),T;return v})};return u?o.call(this,u,l):o.call(this,l)}}}function Twt(e,t,n,r,o,i){switch(mQe(e,n),i){case"function":t(e,"onRequest",ic(r,o,"http.request")),t(e,"onCall",ic(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",ic(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",ic(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",ic(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",ic(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",ic(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",ic(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",ic(r,o,"storage.object.finalized")),t(e,"onObjectArchived",ic(r,o,"storage.object.archived")),t(e,"onObjectDeleted",ic(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",ic(r,o,"storage.object.metadataUpdated"));break}return e}function mQe(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,nh.isWrapped)(e[r])&&t(e,r);return e}var nh,AQe=w(()=>{m();He();nh=ue(un(),1)});var hQe,gQe,bwt,Iwt,TG,_Qe=w(()=>{m();hQe=ue(un(),1);At();pQe();AQe();gQe={},bwt=[">=3.0.0 <5"],Iwt=[">=6.0.0 <7"],TG=class extends hQe.InstrumentationBase{constructor(t=gQe){super("@sentry/instrumentation-firebase",er,t)}setConfig(t={}){super.setConfig({...gQe,...t})}init(){let t=[];return t.push(lQe(this.tracer,bwt,this._wrap,this._unwrap,this.getConfig())),t.push(fQe(this.tracer,Iwt,this._wrap,this._unwrap,this.getConfig())),t}}});var EQe,Cwt,yQe,vwt,SQe,TQe=w(()=>{m();At();_r();_Qe();EQe="Firebase",Cwt={firestoreSpanCreationHook:e=>{qr(e,"auto.firebase.otel.firestore"),e.setAttribute(Xt,"db.query")},functions:{requestHook:e=>{qr(e,"auto.firebase.otel.functions"),e.setAttribute(Xt,"http.request")},errorHook:async(e,t)=>{t&&(rn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Sv(2e3))}}},yQe=ct(EQe,()=>new TG(Cwt)),vwt=(()=>({name:EQe,setupOnce(){yQe()}})),SQe=vwt});function bQe(){return[vwe(),ske(),Oke(),SLe(),yPe(),PPe(),VPe(),iMe(),LMe(),o2e(),nLe(),gLe(),LLe(),JLe(),lUe(),EUe(),Jke(),OUe(),aPe(),tQe(),sQe(),UUe(),jUe(),qUe(),ZUe(),u2e(),SQe()]}var IQe=w(()=>{m();kUe();VUe();ZLe();Rwe();cke();TQe();yUe();WUe();Pke();hLe();TLe();Zke();ULe();nQe();aQe();uPe();SPe();MPe();YPe();sMe();zUe();i2e();c2e();rLe();UMe();dUe();QUe()});function vQe(e,t={}){e.getOptions().debug&&lZ();let[n,r]=Rwt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function Rwt(e,t={}){let n=new CQe.BasicTracerProvider({sampler:new O4(e),resource:(0,bG.defaultResource)().merge((0,bG.resourceFromAttributes)({[NV]:"node",[_V]:"sentry",[BV]:er})),forceFlushTimeoutMillis:500,spanProcessors:[new w4({timeout:xwt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Vt.setGlobalTracerProvider(n),mf.setGlobalPropagator(new B4);let r=new P4;return We.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function xwt(e){if(e!=null){if(e>ree)return Ds&&W.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ree}`),ree;if(e<=0||Number.isNaN(e)){Ds&&W.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var bG,CQe,ree,RQe=w(()=>{m();He();bG=ue(bJ(),1),CQe=ue(KJ(),1);Xn();At();_r();Xv();YS();ree=1e6});function xQe(){return j4().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(nwe(),dwe())}function DQe(e){return[...xQe(),...Mi(e)?bQe():[]]}function oee(e={}){return Dwt(e,DQe)}function Dwt(e={},t){wS(e,"node");let n=MZ({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(vQe(n,{spanProcessors:e.openTelemetrySpanProcessors}),z4()),n}var NQe=w(()=>{m();At();_r();rwe();pwe();IQe();RQe()});var WR=w(()=>{m();NQe();At();_r()});function Kr(){return Nwt}function _u(){return BQe}function wQe(){return Bwt}var Nwt,BQe,Bwt,sc=w(()=>{"use strict";m();Nwt="prod",BQe="0.1.200",Bwt=`@loredotlink/cli/${BQe}`});function Mwt(e=""){if(!kwt.test(e))return e!==e.toLowerCase()}function kQe(e,t){let n=t??Pwt,r=[];if(!e||typeof e!="string")return r;let o="",i,s;for(let u of e){let l=n.includes(u);if(l===!0){r.push(o),o="",i=void 0;continue}let f=Mwt(u);if(s===!1){if(i===!1&&f===!0){r.push(o),o=u,i=f;continue}if(i===!0&&f===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+u,i=f;continue}}o+=u,i=f,s=l}return r.push(o),r}function Lwt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Uwt(e){return e?e[0].toLowerCase()+e.slice(1):""}function Qwt(e,t){return e?(Array.isArray(e)?e:kQe(e)).map(n=>Lwt(t?.normalize?n.toLowerCase():n)).join(""):""}function QO(e,t){return Uwt(Qwt(e||"",t))}function IG(e,t){return e?(Array.isArray(e)?e:kQe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function PQe(e){return IG(e||"","_")}var kwt,Pwt,MQe=w(()=>{m();kwt=/\d/,Pwt=["-","_","/","."]});import{parseArgs as Fwt}from"node:util";function xG(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function see(e,t=""){let n=[];for(let r of e)for(let[o,i]of r.entries())n[o]=Math.max(n[o]||0,i.length);return e.map(r=>r.map((o,i)=>t+o[i===0?"padStart":"padEnd"](n[i])).join(" ")).join(`
|
|
39
39
|
`)}function nd(e){return typeof e=="function"?e():e}function Gwt(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),o=t.alias||{},i=t.default||{},s=new Map,u=new Map;for(let[x,O]of Object.entries(o)){let P=O;for(let j of P)s.set(x,j),u.has(j)||u.set(j,[]),u.get(j).push(x),s.set(j,x),u.has(x)||u.set(x,[]),u.get(x).push(j)}let l={};function f(x){if(n.has(x))return"boolean";let O=u.get(x)||[];for(let P of O)if(n.has(P))return"boolean";return"string"}function h(x){if(r.has(x))return!0;let O=u.get(x)||[];for(let P of O)if(r.has(P))return!0;return!1}let _=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(i)]);for(let x of _)l[x]||(l[x]={type:f(x),default:i[x]});for(let[x,O]of s.entries())x.length===1&&l[O]&&!l[O].short&&(l[O].short=x);let y=[],T={};for(let x=0;x<e.length;x++){let O=e[x];if(O==="--"){y.push(...e.slice(x));break}if(O.startsWith("--no-")){let P=O.slice(5);T[P]=!0;continue}y.push(O)}let v;try{v=Fwt({args:y,options:Object.keys(l).length>0?l:void 0,allowPositionals:!0,strict:!1})}catch{v={values:{},positionals:y}}let R={_:[]};R._=v.positionals;for(let[x,O]of Object.entries(v.values)){let P=O;f(x)==="boolean"&&typeof O=="string"?P=O!=="false":h(x)&&typeof O=="boolean"&&(P=""),R[x]=P}for(let[x]of Object.entries(T)){R[x]=!1;let O=s.get(x);O&&(R[O]=!1);let P=u.get(x);if(P)for(let j of P)R[j]=!1}for(let[x,O]of s.entries())R[x]!==void 0&&R[O]===void 0&&(R[O]=R[x]),R[O]!==void 0&&R[x]===void 0&&(R[x]=R[O]),R[x]!==R[O]&&i[O]===R[O]&&(R[O]=R[x]);return R}function zwt(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=QQe(t);for(let u of r){if(u.type==="positional")continue;u.type==="string"||u.type==="enum"?n.string.push(u.name):u.type==="boolean"&&n.boolean.push(u.name),u.default!==void 0&&(n.default[u.name]=u.default),u.alias&&(n.alias[u.name]=u.alias);let l=QO(u.name),f=IG(u.name);if(l!==u.name||f!==u.name){let h=xG(n.alias[u.name]||[]);l!==u.name&&!h.includes(l)&&h.push(l),f!==u.name&&!h.includes(f)&&h.push(f),h.length>0&&(n.alias[u.name]=h)}}let o=Gwt(e,n),[...i]=o._,s=new Proxy(o,{get(u,l){return u[l]??u[QO(l)]??u[IG(l)]}});for(let[,u]of r.entries())if(u.type==="positional"){let l=i.shift();if(l!==void 0)s[u.name]=l;else{if(u.default===void 0&&u.required!==!1)throw new cT(`Missing required positional argument: ${u.name.toUpperCase()}`,"EARG");s[u.name]=u.default}}else if(u.type==="enum"){let l=s[u.name],f=u.options||[];if(l!==void 0&&f.length>0&&!f.includes(l))throw new cT(`Invalid value for argument: ${Bf(`--${u.name}`)} (${Bf(l)}). Expected one of: ${f.map(h=>Bf(h)).join(", ")}.`,"EARG")}else if(u.required&&s[u.name]===void 0)throw new cT(`Missing required argument: --${u.name}`,"EARG");return s}function QQe(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:xG(r.alias)});return t}async function Hwt(e){return Promise.all(e.map(t=>nd(t)))}async function lT(e,t){let n=await nd(e.args||{}),r=zwt(t.rawArgs,n),o={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},i=await Hwt(e.plugins??[]),s,u;try{for(let h of i)await h.setup?.(o);typeof e.setup=="function"&&await e.setup(o);let f=await nd(e.subCommands);if(f&&Object.keys(f).length>0){let h=$wt(t.rawArgs,n),_=t.rawArgs[h];if(_){let y=await LQe(f,_);if(!y)throw new cT(`Unknown command ${Bf(_)}`,"E_UNKNOWN_COMMAND");await lT(y,{rawArgs:t.rawArgs.slice(h+1)})}else{let y=await nd(e.default);if(y){if(e.run)throw new cT("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let T=await LQe(f,y);if(!T)throw new cT(`Default sub command ${Bf(y)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await lT(T,{rawArgs:t.rawArgs})}else if(!e.run)throw new cT("No command specified.","E_NO_COMMAND")}}typeof e.run=="function"&&(s=await e.run(o))}catch(f){u=f}let l=[];if(typeof e.cleanup=="function")try{await e.cleanup(o)}catch(f){l.push(f)}for(let f of[...i].reverse())try{await f.cleanup?.(o)}catch(h){l.push(h)}if(u)throw u;if(l.length===1)throw l[0];if(l.length>1)throw new Error("Multiple cleanup errors",{cause:l});return{result:s}}async function LQe(e,t){if(t in e)return nd(e[t]);for(let n of Object.values(e)){let r=await nd(n),o=await nd(r?.meta);if(o?.alias&&xG(o.alias).includes(t))return r}}function $wt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&qwt(r,t)&&n++;continue}return n}return-1}function qwt(e,t){let n=e.replace(/^-{1,2}/,""),r=QO(n);for(let[o,i]of Object.entries(t))if(!(i.type!=="string"&&i.type!=="enum")&&(r===QO(o)||(Array.isArray(i.alias)?i.alias:i.alias?[i.alias]:[]).includes(n)))return!0;return!1}async function uee(e,t){let n=await nd(e.meta||{}),r=QQe(await nd(e.args||{})),o=await nd(t?.meta||{}),i=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),s=[],u=[],l=[],f=[];for(let T of r)if(T.type==="positional"){let v=T.name.toUpperCase(),R=T.required!==!1&&T.default===void 0;u.push([Bf(v+aee(T)),UQe(T,R)]),f.push(R?`<${v}>`:`[${v}]`)}else{let v=T.required===!0&&T.default===void 0,R=[...(T.alias||[]).map(x=>`-${x}`),`--${T.name}`].join(", ")+aee(T);if(s.push([Bf(R),UQe(T,v)]),T.type==="boolean"&&(T.default===!0||T.negativeDescription)&&!Vwt.test(T.name)){let x=[...(T.alias||[]).map(O=>`--no-${O}`),`--no-${T.name}`].join(", ");s.push([Bf(x),[T.negativeDescription,v?RG("(Required)"):""].filter(Boolean).join(" ")])}v&&f.push(`--${T.name}`+aee(T))}if(e.subCommands){let T=[],v=await nd(e.subCommands);for(let[R,x]of Object.entries(v)){let O=await nd((await nd(x))?.meta);if(O?.hidden)continue;let P=xG(O?.alias),j=[R,...P].join(", ");l.push([Bf(j),O?.description||""]),T.push(R,...P)}f.push(T.join("|"))}let h=[],_=n.version||o.version;h.push(RG(`${n.description} (${i+(_?` v${_}`:"")})`),"");let y=s.length>0||u.length>0;return h.push(`${vG(CG("USAGE"))} ${Bf(`${i}${y?" [OPTIONS]":""} ${f.join(" ")}`)}`,""),u.length>0&&(h.push(vG(CG("ARGUMENTS")),""),h.push(see(u," ")),h.push("")),s.length>0&&(h.push(vG(CG("OPTIONS")),""),h.push(see(s," ")),h.push("")),l.length>0&&(h.push(vG(CG("COMMANDS")),""),h.push(see(l," ")),h.push("",`Use ${Bf(`${i} <command> --help`)} for more information about a command.`)),h.filter(T=>typeof T=="string").join(`
|
|
40
40
|
`)}function aee(e){let t=e.valueHint?`=<${e.valueHint}>`:"",n=t||`=<${PQe(e.name)}>`;return!e.type||e.type==="positional"||e.type==="boolean"?t:e.type==="enum"&&e.options?.length?`=<${e.options.join("|")}>`:n}function UQe(e,t){let n=t?RG("(Required)"):"",r=e.default===void 0?"":RG(`(Default: ${e.default})`);return[e.description,n,r].filter(Boolean).join(" ")}var cT,jwt,DG,CG,Bf,RG,vG,Vwt,cee=w(()=>{m();MQe();cT=class extends Error{code;constructor(e,t){super(e),this.name="CLIError",this.code=t}};jwt=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||e.TEST||e.CI})(),DG=(e,t=39)=>n=>jwt?n:`\x1B[${e}m${n}\x1B[${t}m`,CG=DG(1,22),Bf=DG(36),RG=DG(90),vG=DG(4,24);Vwt=/^no[-A-Z]/});var lee,FQe,Ywt,GQe,GLn,dee=w(()=>{"use strict";m();lee=["free","creator","team"],FQe=typeof process<"u"&&process.env?.NODE_ENV!=="production",Ywt={stripe:{plans:[{tier:"free",subjectType:"user",name:"Free",description:"Share any thread from Claude Code, Codex, or Cowork. Share with friends or keep private. Share skills with your team instantly.",price:0,priceId:null,features:[{name:"Share threads from Claude Code, Codex, and Cowork"},{name:"Share with friends or keep private"},{name:"Skills tab \u2014 tool usage across every thread"},{name:"Share skills with your team instantly"}],entitlements:{workspaceScope:!1,review:!1,sharedThreadTtlDays:3}},{tier:"creator",subjectType:"user",name:"Creator",description:"For builders who share a lot. Permanent share links that never expire.",price:29,isFeatured:!0,priceId:FQe?"price_1TP9BSKwvRM43sh64waIrvjj":"price_1TPA2gKwvRM43sh6Kp4ZCpJZ",features:[{name:"Everything in Free"},{name:"Shared threads live forever"}],entitlements:{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:FQe?"price_1TP9MpKwvRM43sh6TBIFxVCd":"price_1TPA3CKwvRM43sh6k0bgPTsQ",features:[{name:"Everything in Creator"},{name:"Workspace-wide thread sharing"},{name:"Minimum 2 seats"},{name:"Review feature (beta)"}],entitlements:{workspaceScope:!0,review:!0,sharedThreadTtlDays:null}}]}},GQe=Ywt.stripe.plans,GLn=Object.freeze(Object.fromEntries(GQe.map(e=>[e.tier,e])))});var jQe=w(()=>{"use strict";m();dee();dee()});function Jwt(e){qQe=e}function BG(){return qQe}function lt(e,t){let n=wG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,BG(),FO].filter(r=>!!r)});e.common.issues.push(n)}function xn(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,u)=>s.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:o}}function aOt(e,t){return!!((t==="v4"||!t)&&oOt.test(e)||(t==="v6"||!t)&&iOt.test(e))}function uOt(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}function XR(e){if(e instanceof Su){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=wf.create(XR(r))}return new Su({...e._def,shape:()=>t})}else return e instanceof oh?new oh({...e._def,type:XR(e.element)}):e instanceof wf?wf.create(XR(e.unwrap())):e instanceof ih?ih.create(XR(e.unwrap())):e instanceof uA?uA.create(e.items.map(t=>XR(t))):e}function hee(e,t){let n=FE(e),r=FE(t);if(e===t)return{valid:!0,data:e};if(n===at.object&&r===at.object){let o=Tr.objectKeys(t),i=Tr.objectKeys(e).filter(u=>o.indexOf(u)!==-1),s={...e,...t};for(let u of i){let l=hee(e[u],t[u]);if(!l.valid)return{valid:!1};s[u]=l.data}return{valid:!0,data:s}}else if(n===at.array&&r===at.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],u=t[i],l=hee(s,u);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===at.date&&r===at.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function YQe(e,t){return new ST({values:e,typeName:Jt.ZodEnum,...xn(t)})}var Tr,mee,at,FE,Ye,Kwt,el,FO,qQe,wG,Zwt,yu,En,VQe,ac,Aee,gee,GO,OG,Qt,Ap,zQe,Dn,Wwt,Xwt,eOt,tOt,nOt,rOt,oOt,iOt,sOt,GE,dT,pT,fT,mT,ex,AT,gT,jE,rh,Of,tx,oh,Su,hT,NG,kG,_T,uA,PG,nx,rx,MG,ET,yT,ST,TT,zE,rd,wf,ih,bT,ox,ix,cOt,LG,jO,sx,KQe,lOt,Jt,dOt,JQe,ZQe,pOt,fOt,WQe,mOt,AOt,gOt,hOt,_Ot,EOt,yOt,SOt,TOt,bOt,IOt,COt,vOt,ROt,xOt,DOt,NOt,BOt,wOt,OOt,kOt,POt,MOt,LOt,HQe,UOt,QOt,FOt,GOt,jOt,zOt,HOt,$Ot,qOt,Eu,VOt,pee,YOt,mp,_ee,nUn,rUn,oUn,XQe,KOt,JOt,ZOt,WOt,eFe,tFe,nFe,fee,Tu,XOt,ekt,tkt,nkt,Eee,yee,See,rkt,$Qe,okt,ikt,skt,akt,Tee,cA=w(()=>{m();(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(u=>typeof o[o[u]]!="number"),s={};for(let u of i)s[u]=o[u];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Tr||(Tr={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(mee||(mee={}));at=Tr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),FE=e=>{switch(typeof e){case"undefined":return at.undefined;case"string":return at.string;case"number":return isNaN(e)?at.nan:at.number;case"boolean":return at.boolean;case"function":return at.function;case"bigint":return at.bigint;case"symbol":return at.symbol;case"object":return Array.isArray(e)?at.array:e===null?at.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?at.promise:typeof Map<"u"&&e instanceof Map?at.map:typeof Set<"u"&&e instanceof Set?at.set:typeof Date<"u"&&e instanceof Date?at.date:at.object;default:return at.unknown}},Ye=Tr.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"]),Kwt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),el=class extends Error{constructor(t){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=t}get errors(){return this.issues}format(t){let n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,l=0;for(;l<s.path.length;){let f=s.path[l];l===s.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(s))):u[f]=u[f]||{_errors:[]},u=u[f],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};el.create=e=>new el(e);FO=(e,t)=>{let n;switch(e.code){case Ye.invalid_type:e.received===at.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ye.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Tr.jsonStringifyReplacer)}`;break;case Ye.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tr.joinValues(e.keys,", ")}`;break;case Ye.invalid_union:n="Invalid input";break;case Ye.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tr.joinValues(e.options)}`;break;case Ye.invalid_enum_value:n=`Invalid enum value. Expected ${Tr.joinValues(e.options)}, received '${e.received}'`;break;case Ye.invalid_arguments:n="Invalid function arguments";break;case Ye.invalid_return_type:n="Invalid function return type";break;case Ye.invalid_date:n="Invalid date";break;case Ye.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Tr.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ye.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ye.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ye.custom:n="Invalid input";break;case Ye.invalid_intersection_types:n="Intersection results could not be merged";break;case Ye.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ye.not_finite:n="Number must be finite";break;default:n=t.defaultError,Tr.assertNever(e)}return{message:n}},qQe=FO;wG=e=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i},u="",l=r.filter(f=>!!f).slice().reverse();for(let f of l)u=f(s,{data:t,defaultError:u}).message;return{...o,path:i,message:o.message||u}},Zwt=[];yu=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let o of n){if(o.status==="aborted")return En;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let o of n)r.push({key:await o.key,value:await o.value});return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let o of n){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return En;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}},En=Object.freeze({status:"aborted"}),VQe=e=>({status:"dirty",value:e}),ac=e=>({status:"valid",value:e}),Aee=e=>e.status==="aborted",gee=e=>e.status==="dirty",GO=e=>e.status==="valid",OG=e=>typeof Promise<"u"&&e instanceof Promise;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Qt||(Qt={}));Ap=class{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},zQe=(e,t)=>{if(GO(t))return{success:!0,data:t.value};if(!e.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 el(e.common.issues);return this._error=n,this._error}}};Dn=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,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)}get description(){return this._def.description}_getType(t){return FE(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:FE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new yu,ctx:{common:t.parent.common,data:t.data,parsedType:FE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(OG(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let o={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:FE(t)},i=this._parseSync({data:t,path:o.path,parent:o});return zQe(o,i)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:FE(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(OG(o)?o:Promise.resolve(o));return zQe(r,i)}refine(t,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let s=t(o),u=()=>i.addIssue({code:Ye.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(u(),!1)):s?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new rd({schema:this,typeName:Jt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return wf.create(this,this._def)}nullable(){return ih.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return oh.create(this,this._def)}promise(){return zE.create(this,this._def)}or(t){return hT.create([this,t],this._def)}and(t){return _T.create(this,t,this._def)}transform(t){return new rd({...xn(this._def),schema:this,typeName:Jt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new bT({...xn(this._def),innerType:this,defaultValue:n,typeName:Jt.ZodDefault})}brand(){return new LG({typeName:Jt.ZodBranded,type:this,...xn(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new ox({...xn(this._def),innerType:this,catchValue:n,typeName:Jt.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return jO.create(this,t)}readonly(){return sx.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Wwt=/^c[^\s-]{8,}$/i,Xwt=/^[a-z][a-z0-9]*$/,eOt=/[0-9A-HJKMNP-TV-Z]{26}/,tOt=/^[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,nOt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rOt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),oOt=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,iOt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,sOt=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");GE=class e extends Dn{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:Ye.invalid_string,...Qt.errToObj(r)}),this.nonempty=t=>this.min(1,Qt.errToObj(t)),this.trim=()=>new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==at.string){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.string,received:i.parsedType}),En}let r=new yu,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,u=t.data.length<i.value;(s||u)&&(o=this._getOrReturnCtx(t,o),s?lt(o,{code:Ye.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&<(o,{code:Ye.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")nOt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"email",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")rOt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"emoji",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")tOt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"uuid",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Wwt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"cuid",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Xwt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"cuid2",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")eOt.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"ulid",code:Ye.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),lt(o,{validation:"url",code:Ye.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"regex",code:Ye.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?sOt(i).test(t.data)||(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?aOt(t.data,i.version)||(o=this._getOrReturnCtx(t,o),lt(o,{validation:"ip",code:Ye.invalid_string,message:i.message}),r.dirty()):Tr.assertNever(i);return{status:r.value,value:t.data}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Qt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Qt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Qt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Qt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Qt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Qt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Qt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Qt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,...Qt.errToObj(t?.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Qt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Qt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Qt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Qt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Qt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Qt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Qt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};GE.create=e=>{var t;return new GE({checks:[],typeName:Jt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...xn(e)})};dT=class e extends Dn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==at.number){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.number,received:i.parsedType}),En}let r,o=new yu;for(let i of this._def.checks)i.kind==="int"?Tr.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?uOt(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.not_finite,message:i.message}),o.dirty()):Tr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Qt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Qt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Qt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Qt.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Tr.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};dT.create=e=>new dT({checks:[],typeName:Jt.ZodNumber,coerce:e?.coerce||!1,...xn(e)});pT=class e extends Dn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==at.bigint){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.bigint,received:i.parsedType}),En}let r,o=new yu;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),lt(r,{code:Ye.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Tr.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Qt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qt.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};pT.create=e=>{var t;return new pT({checks:[],typeName:Jt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...xn(e)})};fT=class extends Dn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==at.boolean){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.boolean,received:r.parsedType}),En}return ac(t.data)}};fT.create=e=>new fT({typeName:Jt.ZodBoolean,coerce:e?.coerce||!1,...xn(e)});mT=class e extends Dn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==at.date){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_type,expected:at.date,received:i.parsedType}),En}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return lt(i,{code:Ye.invalid_date}),En}let r=new yu,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),lt(o,{code:Ye.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Tr.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Qt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Qt.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};mT.create=e=>new mT({checks:[],coerce:e?.coerce||!1,typeName:Jt.ZodDate,...xn(e)});ex=class extends Dn{_parse(t){if(this._getType(t)!==at.symbol){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.symbol,received:r.parsedType}),En}return ac(t.data)}};ex.create=e=>new ex({typeName:Jt.ZodSymbol,...xn(e)});AT=class extends Dn{_parse(t){if(this._getType(t)!==at.undefined){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.undefined,received:r.parsedType}),En}return ac(t.data)}};AT.create=e=>new AT({typeName:Jt.ZodUndefined,...xn(e)});gT=class extends Dn{_parse(t){if(this._getType(t)!==at.null){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.null,received:r.parsedType}),En}return ac(t.data)}};gT.create=e=>new gT({typeName:Jt.ZodNull,...xn(e)});jE=class extends Dn{constructor(){super(...arguments),this._any=!0}_parse(t){return ac(t.data)}};jE.create=e=>new jE({typeName:Jt.ZodAny,...xn(e)});rh=class extends Dn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ac(t.data)}};rh.create=e=>new rh({typeName:Jt.ZodUnknown,...xn(e)});Of=class extends Dn{_parse(t){let n=this._getOrReturnCtx(t);return lt(n,{code:Ye.invalid_type,expected:at.never,received:n.parsedType}),En}};Of.create=e=>new Of({typeName:Jt.ZodNever,...xn(e)});tx=class extends Dn{_parse(t){if(this._getType(t)!==at.undefined){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.void,received:r.parsedType}),En}return ac(t.data)}};tx.create=e=>new tx({typeName:Jt.ZodVoid,...xn(e)});oh=class e extends Dn{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==at.array)return lt(n,{code:Ye.invalid_type,expected:at.array,received:n.parsedType}),En;if(o.exactLength!==null){let s=n.data.length>o.exactLength.value,u=n.data.length<o.exactLength.value;(s||u)&&(lt(n,{code:s?Ye.too_big:Ye.too_small,minimum:u?o.exactLength.value:void 0,maximum:s?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&&(lt(n,{code:Ye.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&&(lt(n,{code:Ye.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((s,u)=>o.type._parseAsync(new Ap(n,s,n.path,u)))).then(s=>yu.mergeArray(r,s));let i=[...n.data].map((s,u)=>o.type._parseSync(new Ap(n,s,n.path,u)));return yu.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Qt.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Qt.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Qt.toString(n)}})}nonempty(t){return this.min(1,t)}};oh.create=(e,t)=>new oh({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Jt.ZodArray,...xn(t)});Su=class e extends Dn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Tr.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==at.object){let f=this._getOrReturnCtx(t);return lt(f,{code:Ye.invalid_type,expected:at.object,received:f.parsedType}),En}let{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),u=[];if(!(this._def.catchall instanceof Of&&this._def.unknownKeys==="strip"))for(let f in o.data)s.includes(f)||u.push(f);let l=[];for(let f of s){let h=i[f],_=o.data[f];l.push({key:{status:"valid",value:f},value:h._parse(new Ap(o,_,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Of){let f=this._def.unknownKeys;if(f==="passthrough")for(let h of u)l.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(f==="strict")u.length>0&&(lt(o,{code:Ye.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let h of u){let _=o.data[h];l.push({key:{status:"valid",value:h},value:f._parse(new Ap(o,_,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let f=[];for(let h of l){let _=await h.key;f.push({key:_,value:await h.value,alwaysSet:h.alwaysSet})}return f}).then(f=>yu.mergeObjectSync(r,f)):yu.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Qt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,u;let l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=Qt.errToObj(t).message)!==null&&u!==void 0?u:l}:{message:l}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Jt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return Tr.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return Tr.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return XR(this)}partial(t){let n={};return Tr.objectKeys(this.shape).forEach(r=>{let o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return Tr.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof wf;)i=i._def.innerType;n[r]=i}}),new e({...this._def,shape:()=>n})}keyof(){return YQe(Tr.objectKeys(this.shape))}};Su.create=(e,t)=>new Su({shape:()=>e,unknownKeys:"strip",catchall:Of.create(),typeName:Jt.ZodObject,...xn(t)});Su.strictCreate=(e,t)=>new Su({shape:()=>e,unknownKeys:"strict",catchall:Of.create(),typeName:Jt.ZodObject,...xn(t)});Su.lazycreate=(e,t)=>new Su({shape:e,unknownKeys:"strip",catchall:Of.create(),typeName:Jt.ZodObject,...xn(t)});hT=class extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(let u of i)if(u.result.status==="valid")return u.result;for(let u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let s=i.map(u=>new el(u.ctx.common.issues));return lt(n,{code:Ye.invalid_union,unionErrors:s}),En}if(n.common.async)return Promise.all(r.map(async i=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of r){let f={...n,common:{...n.common,issues:[]},parent:null},h=l._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:f}),f.common.issues.length&&s.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let u=s.map(l=>new el(l));return lt(n,{code:Ye.invalid_union,unionErrors:u}),En}}get options(){return this._def.options}};hT.create=(e,t)=>new hT({options:e,typeName:Jt.ZodUnion,...xn(t)});NG=e=>e instanceof ET?NG(e.schema):e instanceof rd?NG(e.innerType()):e instanceof yT?[e.value]:e instanceof ST?e.options:e instanceof TT?Object.keys(e.enum):e instanceof bT?NG(e._def.innerType):e instanceof AT?[void 0]:e instanceof gT?[null]:null,kG=class e extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.object)return lt(n,{code:Ye.invalid_type,expected:at.object,received:n.parsedType}),En;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(lt(n,{code:Ye.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),En)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let o=new Map;for(let i of n){let s=NG(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of s){if(o.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);o.set(u,i)}}return new e({typeName:Jt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...xn(r)})}};_T=class extends Dn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(Aee(i)||Aee(s))return En;let u=hee(i.value,s.value);return u.valid?((gee(i)||gee(s))&&n.dirty(),{status:n.value,value:u.data}):(lt(r,{code:Ye.invalid_intersection_types}),En)};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(([i,s])=>o(i,s)):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}))}};_T.create=(e,t,n)=>new _T({left:e,right:t,typeName:Jt.ZodIntersection,...xn(n)});uA=class e extends Dn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.array)return lt(r,{code:Ye.invalid_type,expected:at.array,received:r.parsedType}),En;if(r.data.length<this._def.items.length)return lt(r,{code:Ye.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),En;!this._def.rest&&r.data.length>this._def.items.length&&(lt(r,{code:Ye.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((s,u)=>{let l=this._def.items[u]||this._def.rest;return l?l._parse(new Ap(r,s,r.path,u)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>yu.mergeArray(n,s)):yu.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};uA.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new uA({items:e,typeName:Jt.ZodTuple,rest:null,...xn(t)})};PG=class e extends Dn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.object)return lt(r,{code:Ye.invalid_type,expected:at.object,received:r.parsedType}),En;let o=[],i=this._def.keyType,s=this._def.valueType;for(let u in r.data)o.push({key:i._parse(new Ap(r,u,r.path,u)),value:s._parse(new Ap(r,r.data[u],r.path,u))});return r.common.async?yu.mergeObjectAsync(n,o):yu.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Dn?new e({keyType:t,valueType:n,typeName:Jt.ZodRecord,...xn(r)}):new e({keyType:GE.create(),valueType:t,typeName:Jt.ZodRecord,...xn(n)})}},nx=class extends Dn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.map)return lt(r,{code:Ye.invalid_type,expected:at.map,received:r.parsedType}),En;let o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([u,l],f)=>({key:o._parse(new Ap(r,u,r.path,[f,"key"])),value:i._parse(new Ap(r,l,r.path,[f,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let l of s){let f=await l.key,h=await l.value;if(f.status==="aborted"||h.status==="aborted")return En;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let l of s){let f=l.key,h=l.value;if(f.status==="aborted"||h.status==="aborted")return En;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}}}};nx.create=(e,t,n)=>new nx({valueType:t,keyType:e,typeName:Jt.ZodMap,...xn(n)});rx=class e extends Dn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.set)return lt(r,{code:Ye.invalid_type,expected:at.set,received:r.parsedType}),En;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(lt(r,{code:Ye.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&&(lt(r,{code:Ye.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function s(l){let f=new Set;for(let h of l){if(h.status==="aborted")return En;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}let u=[...r.data.values()].map((l,f)=>i._parse(new Ap(r,l,r.path,f)));return r.common.async?Promise.all(u).then(l=>s(l)):s(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:Qt.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Qt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};rx.create=(e,t)=>new rx({valueType:e,minSize:null,maxSize:null,typeName:Jt.ZodSet,...xn(t)});MG=class e extends Dn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.function)return lt(n,{code:Ye.invalid_type,expected:at.function,received:n.parsedType}),En;function r(u,l){return wG({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,BG(),FO].filter(f=>!!f),issueData:{code:Ye.invalid_arguments,argumentsError:l}})}function o(u,l){return wG({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,BG(),FO].filter(f=>!!f),issueData:{code:Ye.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof zE){let u=this;return ac(async function(...l){let f=new el([]),h=await u._def.args.parseAsync(l,i).catch(T=>{throw f.addIssue(r(l,T)),f}),_=await Reflect.apply(s,this,h);return await u._def.returns._def.type.parseAsync(_,i).catch(T=>{throw f.addIssue(o(_,T)),f})})}else{let u=this;return ac(function(...l){let f=u._def.args.safeParse(l,i);if(!f.success)throw new el([r(l,f.error)]);let h=Reflect.apply(s,this,f.data),_=u._def.returns.safeParse(h,i);if(!_.success)throw new el([o(h,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:uA.create(t).rest(rh.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||uA.create([]).rest(rh.create()),returns:n||rh.create(),typeName:Jt.ZodFunction,...xn(r)})}},ET=class extends Dn{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ET.create=(e,t)=>new ET({getter:e,typeName:Jt.ZodLazy,...xn(t)});yT=class extends Dn{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return lt(n,{received:n.data,code:Ye.invalid_literal,expected:this._def.value}),En}return{status:"valid",value:t.data}}get value(){return this._def.value}};yT.create=(e,t)=>new yT({value:e,typeName:Jt.ZodLiteral,...xn(t)});ST=class e extends Dn{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return lt(n,{expected:Tr.joinValues(r),received:n.parsedType,code:Ye.invalid_type}),En}if(this._def.values.indexOf(t.data)===-1){let n=this._getOrReturnCtx(t),r=this._def.values;return lt(n,{received:n.data,code:Ye.invalid_enum_value,options:r}),En}return ac(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return e.create(t)}exclude(t){return e.create(this.options.filter(n=>!t.includes(n)))}};ST.create=YQe;TT=class extends Dn{_parse(t){let n=Tr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==at.string&&r.parsedType!==at.number){let o=Tr.objectValues(n);return lt(r,{expected:Tr.joinValues(o),received:r.parsedType,code:Ye.invalid_type}),En}if(n.indexOf(t.data)===-1){let o=Tr.objectValues(n);return lt(r,{received:r.data,code:Ye.invalid_enum_value,options:o}),En}return ac(t.data)}get enum(){return this._def.values}};TT.create=(e,t)=>new TT({values:e,typeName:Jt.ZodNativeEnum,...xn(t)});zE=class extends Dn{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.promise&&n.common.async===!1)return lt(n,{code:Ye.invalid_type,expected:at.promise,received:n.parsedType}),En;let r=n.parsedType===at.promise?n.data:Promise.resolve(n.data);return ac(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};zE.create=(e,t)=>new zE({type:e,typeName:Jt.ZodPromise,...xn(t)});rd=class extends Dn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Jt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{lt(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){let s=u=>{let l=o.refinement(u,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){let u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?En:(u.status==="dirty"&&n.dirty(),s(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?En:(u.status==="dirty"&&n.dirty(),s(u.value).then(()=>({status:n.value,value:u.value}))))}if(o.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!GO(s))return s;let u=o.transform(s.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>GO(s)?Promise.resolve(o.transform(s.value,i)).then(u=>({status:n.value,value:u})):s);Tr.assertNever(o)}};rd.create=(e,t,n)=>new rd({schema:e,typeName:Jt.ZodEffects,effect:t,...xn(n)});rd.createWithPreprocess=(e,t,n)=>new rd({schema:t,effect:{type:"preprocess",transform:e},typeName:Jt.ZodEffects,...xn(n)});wf=class extends Dn{_parse(t){return this._getType(t)===at.undefined?ac(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wf.create=(e,t)=>new wf({innerType:e,typeName:Jt.ZodOptional,...xn(t)});ih=class extends Dn{_parse(t){return this._getType(t)===at.null?ac(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ih.create=(e,t)=>new ih({innerType:e,typeName:Jt.ZodNullable,...xn(t)});bT=class extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===at.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};bT.create=(e,t)=>new bT({innerType:e,typeName:Jt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xn(t)});ox=class extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return OG(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new el(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new el(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ox.create=(e,t)=>new ox({innerType:e,typeName:Jt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xn(t)});ix=class extends Dn{_parse(t){if(this._getType(t)!==at.nan){let r=this._getOrReturnCtx(t);return lt(r,{code:Ye.invalid_type,expected:at.nan,received:r.parsedType}),En}return{status:"valid",value:t.data}}};ix.create=e=>new ix({typeName:Jt.ZodNaN,...xn(e)});cOt=Symbol("zod_brand"),LG=class extends Dn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},jO=class e extends Dn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?En:i.status==="dirty"?(n.dirty(),VQe(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?En:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:Jt.ZodPipeline})}},sx=class extends Dn{_parse(t){let n=this._def.innerType._parse(t);return GO(n)&&(n.value=Object.freeze(n.value)),n}};sx.create=(e,t)=>new sx({innerType:e,typeName:Jt.ZodReadonly,...xn(t)});KQe=(e,t={},n)=>e?jE.create().superRefine((r,o)=>{var i,s;if(!e(r)){let u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=u.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,f=typeof u=="string"?{message:u}:u;o.addIssue({code:"custom",...f,fatal:l})}}):jE.create(),lOt={object:Su.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Jt||(Jt={}));dOt=(e,t={message:`Input not instance of ${e.name}`})=>KQe(n=>n instanceof e,t),JQe=GE.create,ZQe=dT.create,pOt=ix.create,fOt=pT.create,WQe=fT.create,mOt=mT.create,AOt=ex.create,gOt=AT.create,hOt=gT.create,_Ot=jE.create,EOt=rh.create,yOt=Of.create,SOt=tx.create,TOt=oh.create,bOt=Su.create,IOt=Su.strictCreate,COt=hT.create,vOt=kG.create,ROt=_T.create,xOt=uA.create,DOt=PG.create,NOt=nx.create,BOt=rx.create,wOt=MG.create,OOt=ET.create,kOt=yT.create,POt=ST.create,MOt=TT.create,LOt=zE.create,HQe=rd.create,UOt=wf.create,QOt=ih.create,FOt=rd.createWithPreprocess,GOt=jO.create,jOt=()=>JQe().optional(),zOt=()=>ZQe().optional(),HOt=()=>WQe().optional(),$Ot={string:(e=>GE.create({...e,coerce:!0})),number:(e=>dT.create({...e,coerce:!0})),boolean:(e=>fT.create({...e,coerce:!0})),bigint:(e=>pT.create({...e,coerce:!0})),date:(e=>mT.create({...e,coerce:!0}))},qOt=En,Eu=Object.freeze({__proto__:null,defaultErrorMap:FO,setErrorMap:Jwt,getErrorMap:BG,makeIssue:wG,EMPTY_PATH:Zwt,addIssueToContext:lt,ParseStatus:yu,INVALID:En,DIRTY:VQe,OK:ac,isAborted:Aee,isDirty:gee,isValid:GO,isAsync:OG,get util(){return Tr},get objectUtil(){return mee},ZodParsedType:at,getParsedType:FE,ZodType:Dn,ZodString:GE,ZodNumber:dT,ZodBigInt:pT,ZodBoolean:fT,ZodDate:mT,ZodSymbol:ex,ZodUndefined:AT,ZodNull:gT,ZodAny:jE,ZodUnknown:rh,ZodNever:Of,ZodVoid:tx,ZodArray:oh,ZodObject:Su,ZodUnion:hT,ZodDiscriminatedUnion:kG,ZodIntersection:_T,ZodTuple:uA,ZodRecord:PG,ZodMap:nx,ZodSet:rx,ZodFunction:MG,ZodLazy:ET,ZodLiteral:yT,ZodEnum:ST,ZodNativeEnum:TT,ZodPromise:zE,ZodEffects:rd,ZodTransformer:rd,ZodOptional:wf,ZodNullable:ih,ZodDefault:bT,ZodCatch:ox,ZodNaN:ix,BRAND:cOt,ZodBranded:LG,ZodPipeline:jO,ZodReadonly:sx,custom:KQe,Schema:Dn,ZodSchema:Dn,late:lOt,get ZodFirstPartyTypeKind(){return Jt},coerce:$Ot,any:_Ot,array:TOt,bigint:fOt,boolean:WQe,date:mOt,discriminatedUnion:vOt,effect:HQe,enum:POt,function:wOt,instanceof:dOt,intersection:ROt,lazy:OOt,literal:kOt,map:NOt,nan:pOt,nativeEnum:MOt,never:yOt,null:hOt,nullable:QOt,number:ZQe,object:bOt,oboolean:HOt,onumber:zOt,optional:UOt,ostring:jOt,pipeline:GOt,preprocess:FOt,promise:LOt,record:DOt,set:BOt,strictObject:IOt,string:JQe,symbol:AOt,transformer:HQe,tuple:xOt,undefined:gOt,union:COt,unknown:EOt,void:SOt,NEVER:qOt,ZodIssueCode:Ye,quotelessJson:Kwt,ZodError:el}),VOt=e=>typeof e?.safeParse=="function",pee=e=>typeof e?.passthrough=="function",YOt=(e,t)=>pee(e)?pee(t)?e.merge(t):e:pee(t)?t:Object.assign({},e,t),mp=Eu.object({name:Eu.literal("ZodError"),issues:Eu.array(Eu.object({path:Eu.array(Eu.union([Eu.string(),Eu.number()])),message:Eu.string().optional(),code:Eu.nativeEnum(Eu.ZodIssueCode)}).catchall(Eu.any()))}),_ee=class extends Error{constructor(t){let n=JSON.stringify(t,(r,o)=>typeof o=="bigint"?o.toString():o,2);super(n),this.name="ValidationError",this.issues=t}toString(){return this.message}},nUn=Eu.object({message:Eu.literal("Request validation failed"),pathParameterErrors:mp.nullable(),headerErrors:mp.nullable(),queryParameterErrors:mp.nullable(),bodyErrors:mp.nullable()}),rUn=Eu.object({pathParameterErrors:mp.nullable(),headerErrors:mp.nullable(),queryParameterErrors:mp.nullable(),bodyErrors:mp.nullable()}),oUn=Eu.object({paramsResult:mp.nullable(),headersResult:mp.nullable(),queryResult:mp.nullable(),bodyResult:mp.nullable()}),XQe="zod-ts-rest-polyfill",KOt=e=>{if(!e)return!1;let t=e?.["~standard"];return t?t.version===1&&typeof t.validate=="function":!1},JOt=e=>KOt(e)?e:VOt(e)?(Object.assign(e,{"~standard":{vendor:XQe,version:1,validate:r=>{let o=e.safeParse(r);return o.success?{value:o.data}:{issues:o.error.issues}}}}),e):null,ZOt=(e,t)=>e?t?e instanceof Su&&t instanceof Su?YOt(e,t):{...e,...t}:e:t,WOt=(e,t,{passThroughExtraKeys:n=!1}={})=>{let r=t["~standard"].validate(e);if(r instanceof Promise)throw new Error("Schema validation must be synchronous");return r.issues?t["~standard"].vendor===XQe?{error:new el(r.issues)}:{error:new _ee(r.issues)}:n&&typeof e=="object"&&r.value?{value:{...e,...r.value}}:{value:r.value}},eFe=Symbol("ContractNoBody"),tFe=e=>"method"in e&&"path"in e,nFe=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>{var o,i,s;return tFe(r)?[n,{...r,path:t?.pathPrefix?t.pathPrefix+r.path:r.path,headers:ZOt(t?.baseHeaders,r.headers),strictStatusCodes:(o=r.strictStatusCodes)!==null&&o!==void 0?o:t?.strictStatusCodes,validateResponseOnClient:(i=r.validateResponseOnClient)!==null&&i!==void 0?i:t?.validateResponseOnClient,responses:{...t?.commonResponses,...r.responses},metadata:t?.metadata?{...t?.metadata,...(s=r.metadata)!==null&&s!==void 0?s:{}}:r.metadata}]:[n,nFe(r,t)]})),fee=Symbol("ContractPlainType"),Tu=()=>({router:(e,t)=>nFe(e,t),query:e=>e,mutation:e=>e,responses:e=>e,response:()=>fee,body:()=>fee,type:()=>fee,otherResponse:({contentType:e,body:t})=>({contentType:e,body:t}),noBody:()=>eFe}),XOt=({path:e,params:t})=>{let n=t;return e.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},ekt=(e,t=!1)=>{let n=t?tkt(e):nkt(e);return n?.length>0?"?"+n:""},tkt=e=>e?Object.entries(e).filter(([,t])=>t!==void 0).map(([t,n])=>{let r;return typeof n=="string"&&!["true","false","null"].includes(n.trim())&&isNaN(Number(n))?r=n:r=JSON.stringify(n),`${encodeURIComponent(t)}=${encodeURIComponent(r)}`}).join("&"):"",nkt=e=>e?Object.keys(e).flatMap(t=>Eee(t,e[t])).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(n)}`).join("&"):"",Eee=(e,t)=>Array.isArray(t)?t.flatMap((n,r)=>Eee(`${e}[${r}]`,n)):t instanceof Date?[[`${e}`,t.toISOString()]]:t===null?[[`${e}`,""]]:t===void 0?[]:typeof t=="object"?Object.keys(t).flatMap(n=>Eee(`${e}[${n}]`,t[n])):[[`${e}`,`${t}`]],yee=class extends Error{constructor(t,n){let r=n.join(",");super(`Server returned unexpected response. Expected one of: ${r} got: ${t.status}`),this.response=t}},See=async({route:e,path:t,method:n,headers:r,body:o,validateResponse:i,fetchOptions:s})=>{let u=await fetch(t,{...s,method:n,headers:r,body:o}),l=u.headers.get("content-type");if(l?.includes("application/")&&l?.includes("json")){let f=e.responses[u.status],h={status:u.status,body:f===eFe?void 0:await u.json(),headers:u.headers},_=JOt(f);if(_&&(i??e.validateResponseOnClient)){let y=WOt(h.body,_);if(y.error)throw y.error;return{...h,body:y.value}}return h}return l?.includes("text/")?{status:u.status,body:await u.text(),headers:u.headers}:{status:u.status,body:await u.blob(),headers:u.headers}},rkt=e=>{let t=new FormData,n=(r,o)=>{o instanceof File?t.append(r,o):t.append(r,JSON.stringify(o))};return Object.entries(e).forEach(([r,o])=>{if(Array.isArray(o))for(let i of o)n(r,i);else n(r,o)}),t},$Qe=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t.toLowerCase(),n])),okt=e=>{let{path:t,clientArgs:n,route:r,body:o,query:i,extraInputArgs:s,headers:u,fetchOptions:l}=e,f=n.api||See,h=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([T,v])=>typeof v=="function"?[T,v(e)]:[T,v])),_={...h&&$Qe(h),...$Qe(u)};Object.keys(_).forEach(T=>{_[T]===void 0&&delete _[T]});let y={route:r,path:t,method:r.method,headers:_,body:void 0,rawBody:o,rawQuery:i,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...l},...l?.signal&&{signal:l.signal},...l?.cache&&{cache:l.cache},...l&&"next"in l&&!!l?.next&&{next:l.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?y={...y,contentType:"multipart/form-data",body:o instanceof FormData?o:rkt(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?y={...y,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...y.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(y={...y,contentType:"application/json",headers:{"content-type":"application/json",...y.headers},body:JSON.stringify(o)})),f({...y,...s})},ikt=(e,t,n)=>{let{query:r,params:o,body:i,headers:s,extraHeaders:u,overrideClientOptions:l,fetchOptions:f,cache:h,next:_,...y}=n||{},T={...t,...l},v=typeof o=="object"?Object.fromEntries(Object.entries(o).map(([x,O])=>[x,String(O)])):{};return{path:skt(r,T.baseUrl,v,e,!!T.jsonQuery),clientArgs:T,route:e,body:i,query:r,extraInputArgs:y,fetchOptions:{...h&&{cache:h},..._&&{next:_},...f},headers:{...u,...s}}},skt=(e,t,n,r,o)=>{let i=XOt({path:r.path,params:n}),s=ekt(e,o);return t.endsWith("/")&&i.startsWith("/")?`${t}${i.substring(1)}${s}`:`${t}${i}${s}`},akt=(e,t)=>{let n=Object.keys(e.responses);return async r=>{let o=ikt(e,t,r),i=await okt(o);if(!t.throwOnUnknownStatus||n.includes(i.status.toString()))return i;throw new yee(i,n)}},Tee=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>tFe(r)?[n,akt(r,t)]:[n,Tee(r,t)]))});function ie(e,t,n){function r(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,l);let f=s.prototype,h=Object.keys(f);for(let _=0;_<h.length;_++){let y=h[_];y in u||(u[y]=f[y].bind(u))}}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(u){var l;let f=n?.Parent?new i:this;r(f,u),(l=f._zod).deferred??(l.deferred=[]);for(let h of f._zod.deferred)h();return f}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function bi(e){return e&&Object.assign(IT,e),IT}var rFe,bee,Iee,kf,HE,IT,CT=w(()=>{m();bee=Object.freeze({status:"aborted"});Iee=Symbol("zod_brand"),kf=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},HE=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(rFe=globalThis).__zod_globalConfig??(rFe.__zod_globalConfig={});IT=globalThis.__zod_globalConfig});var Le={};Zs(Le,{BIGINT_FORMAT_RANGES:()=>kee,Class:()=>vee,NUMBER_FORMAT_RANGES:()=>Oee,aborted:()=>YE,allowsEval:()=>Dee,assert:()=>pkt,assertEqual:()=>ukt,assertIs:()=>lkt,assertNever:()=>dkt,assertNotEqual:()=>ckt,assignProp:()=>qE,base64ToUint8Array:()=>iFe,base64urlToUint8Array:()=>Dkt,cached:()=>ux,captureStackTrace:()=>QG,cleanEnum:()=>xkt,cleanRegex:()=>$O,clone:()=>uc,cloneDef:()=>mkt,createTransparentProxy:()=>ykt,defineLazy:()=>Hn,esc:()=>UG,escapeRegex:()=>gp,explicitlyAborted:()=>Pee,extend:()=>bkt,finalizeIssue:()=>cc,floatSafeRemainder:()=>Ree,getElementAtPath:()=>Akt,getEnumValues:()=>HO,getLengthableOrigin:()=>YO,getParsedType:()=>Ekt,getSizableOrigin:()=>VO,hexToUint8Array:()=>Bkt,isObject:()=>vT,isPlainObject:()=>VE,issue:()=>cx,joinValues:()=>de,jsonStringifyReplacer:()=>ax,merge:()=>Ckt,mergeDefs:()=>sh,normalizeParams:()=>qe,nullish:()=>$E,numKeys:()=>_kt,objectClone:()=>fkt,omit:()=>Tkt,optionalKeys:()=>wee,parsedType:()=>ke,partial:()=>vkt,pick:()=>Skt,prefixIssues:()=>tl,primitiveTypes:()=>Bee,promiseAllObject:()=>gkt,propertyKeyTypes:()=>qO,randomString:()=>hkt,required:()=>Rkt,safeExtend:()=>Ikt,shallowClone:()=>Nee,slugify:()=>xee,stringifyPrimitive:()=>Oe,uint8ArrayToBase64:()=>sFe,uint8ArrayToBase64url:()=>Nkt,uint8ArrayToHex:()=>wkt,unwrapMessage:()=>zO});function ukt(e){return e}function ckt(e){return e}function lkt(e){}function dkt(e){throw new Error("Unexpected value in exhaustive check")}function pkt(e){}function HO(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function de(e,t="|"){return e.map(n=>Oe(n)).join(t)}function ax(e,t){return typeof t=="bigint"?t.toString():t}function ux(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function $E(e){return e==null}function $O(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ree(e,t){let n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Hn(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==oFe)return r===void 0&&(r=oFe,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function fkt(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function qE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sh(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function mkt(e){return sh(e._zod.def)}function Akt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function gkt(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}function hkt(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function UG(e){return JSON.stringify(e)}function xee(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function vT(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function VE(e){if(vT(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(vT(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Nee(e){return VE(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function _kt(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function gp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uc(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ykt(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function Oe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function wee(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Skt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=sh(e._zod.def,{get shape(){let s={};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=n.shape[u])}return qE(this,"shape",s),s},checks:[]});return uc(e,i)}function Tkt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=sh(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete s[u]}return qE(this,"shape",s),s},checks:[]});return uc(e,i)}function bkt(e,t){if(!VE(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=sh(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return qE(this,"shape",i),i}});return uc(e,o)}function Ikt(e,t){if(!VE(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=sh(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return qE(this,"shape",r),r}});return uc(e,n)}function Ckt(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=sh(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return qE(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return uc(e,n)}function vkt(e,t,n){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=sh(t._zod.def,{get shape(){let u=t._zod.def.shape,l={...u};if(n)for(let f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(l[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(let f in u)l[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return qE(this,"shape",l),l},checks:[]});return uc(t,s)}function Rkt(e,t,n){let r=sh(t._zod.def,{get shape(){let o=t._zod.def.shape,i={...o};if(n)for(let s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(let s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return qE(this,"shape",i),i}});return uc(t,r)}function YE(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Pee(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function tl(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function zO(e){return typeof e=="string"?e:e?.message}function cc(e,t,n){let r=e.message?e.message:zO(e.inst?._zod.def?.error?.(e))??zO(t?.error?.(e))??zO(n.customError?.(e))??zO(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...u}=e;return u.path??(u.path=[]),u.message=r,t?.reportInput&&(u.input=s),u}function VO(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function YO(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ke(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function cx(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function xkt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function iFe(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function sFe(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Dkt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return iFe(t+n)}function Nkt(e){return sFe(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Bkt(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function wkt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var oFe,QG,Dee,Ekt,qO,Bee,Oee,kee,vee,St=w(()=>{m();CT();oFe=Symbol("evaluating");QG="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Dee=ux(()=>{if(IT.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});Ekt=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},qO=new Set(["string","number","symbol"]),Bee=new Set(["string","number","bigint","boolean","symbol","undefined"]);Oee={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kee={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};vee=class{constructor(...t){}}});function JO(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function ZO(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>r({issues:u},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let u=[...i,...s.path];if(u.length===0)n._errors.push(t(s));else{let l=n,f=0;for(;f<u.length;){let h=u[f];f===u.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(s))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}}};return r(e),n}function Mee(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s,u;for(let l of o.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(f=>r({issues:f},[...i,...l.path]));else if(l.code==="invalid_key")r({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")r({issues:l.issues},[...i,...l.path]);else{let f=[...i,...l.path];if(f.length===0){n.errors.push(t(l));continue}let h=n,_=0;for(;_<f.length;){let y=f[_],T=_===f.length-1;typeof y=="string"?(h.properties??(h.properties={}),(s=h.properties)[y]??(s[y]={errors:[]}),h=h.properties[y]):(h.items??(h.items=[]),(u=h.items)[y]??(u[y]={errors:[]}),h=h.items[y]),T&&h.errors.push(t(l)),_++}}};return r(e),n}function uFe(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function Lee(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${uFe(r.path)}`);return t.join(`
|
|
41
41
|
`)}var aFe,KO,nl,Uee=w(()=>{m();CT();St();aFe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ax,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},KO=ie("$ZodError",aFe),nl=ie("$ZodError",aFe,{Parent:Error})});var lx,FG,dx,GG,px,Qee,fx,Fee,jG,kkt,zG,Pkt,HG,Mkt,$G,Lkt,qG,Ukt,VG,Qkt,YG,Fkt,KG,Gkt,Gee=w(()=>{m();CT();Uee();St();lx=e=>(t,n,r,o)=>{let i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new kf;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(l=>cc(l,i,bi())));throw QG(u,o?.callee),u}return s.value},FG=lx(nl),dx=e=>async(t,n,r,o)=>{let i=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(o?.Err??e)(s.issues.map(l=>cc(l,i,bi())));throw QG(u,o?.callee),u}return s.value},GG=dx(nl),px=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new kf;return i.issues.length?{success:!1,error:new(e??KO)(i.issues.map(s=>cc(s,o,bi())))}:{success:!0,data:i.value}},Qee=px(nl),fx=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>cc(s,o,bi())))}:{success:!0,data:i.value}},Fee=fx(nl),jG=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return lx(e)(t,n,o)},kkt=jG(nl),zG=e=>(t,n,r)=>lx(e)(t,n,r),Pkt=zG(nl),HG=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return dx(e)(t,n,o)},Mkt=HG(nl),$G=e=>async(t,n,r)=>dx(e)(t,n,r),Lkt=$G(nl),qG=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return px(e)(t,n,o)},Ukt=qG(nl),VG=e=>(t,n,r)=>px(e)(t,n,r),Qkt=VG(nl),YG=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return fx(e)(t,n,o)},Fkt=YG(nl),KG=e=>async(t,n,r)=>fx(e)(t,n,r),Gkt=KG(nl)});var od={};Zs(od,{base64:()=>rte,base64url:()=>JG,bigint:()=>lte,boolean:()=>pte,browserEmail:()=>Kkt,cidrv4:()=>tte,cidrv6:()=>nte,cuid:()=>jee,cuid2:()=>zee,date:()=>ste,datetime:()=>ute,domain:()=>Wkt,duration:()=>Yee,e164:()=>ite,email:()=>Jee,emoji:()=>Zee,extendedDuration:()=>jkt,guid:()=>Kee,hex:()=>Xkt,hostname:()=>Zkt,html5Email:()=>qkt,httpProtocol:()=>ote,idnEmail:()=>Ykt,integer:()=>dte,ipv4:()=>Wee,ipv6:()=>Xee,ksuid:()=>qee,lowercase:()=>Ate,mac:()=>ete,md5_base64:()=>tPt,md5_base64url:()=>nPt,md5_hex:()=>ePt,nanoid:()=>Vee,null:()=>fte,number:()=>ZG,rfc5322Email:()=>Vkt,sha1_base64:()=>oPt,sha1_base64url:()=>iPt,sha1_hex:()=>rPt,sha256_base64:()=>aPt,sha256_base64url:()=>uPt,sha256_hex:()=>sPt,sha384_base64:()=>lPt,sha384_base64url:()=>dPt,sha384_hex:()=>cPt,sha512_base64:()=>fPt,sha512_base64url:()=>mPt,sha512_hex:()=>pPt,string:()=>cte,time:()=>ate,ulid:()=>Hee,undefined:()=>mte,unicodeEmail:()=>cFe,uppercase:()=>gte,uuid:()=>RT,uuid4:()=>zkt,uuid6:()=>Hkt,uuid7:()=>$kt,xid:()=>$ee});function Zee(){return new RegExp(Jkt,"u")}function dFe(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ate(e){return new RegExp(`^${dFe(e)}$`)}function ute(e){let t=dFe({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${lFe}T(?:${r})$`)}function WO(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function XO(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var jee,zee,Hee,$ee,qee,Vee,Yee,jkt,Kee,RT,zkt,Hkt,$kt,Jee,qkt,Vkt,cFe,Ykt,Kkt,Jkt,Wee,Xee,ete,tte,nte,rte,JG,Zkt,Wkt,ote,ite,lFe,ste,cte,lte,dte,ZG,pte,fte,mte,Ate,gte,Xkt,ePt,tPt,nPt,rPt,oPt,iPt,sPt,aPt,uPt,cPt,lPt,dPt,pPt,fPt,mPt,WG=w(()=>{m();St();jee=/^[cC][0-9a-z]{6,}$/,zee=/^[0-9a-z]+$/,Hee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$ee=/^[0-9a-vA-V]{20}$/,qee=/^[A-Za-z0-9]{27}$/,Vee=/^[a-zA-Z0-9_-]{21}$/,Yee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jkt=/^[-+]?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)?)??$/,Kee=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,RT=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zkt=RT(4),Hkt=RT(6),$kt=RT(7),Jee=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qkt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Vkt=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,cFe=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ykt=cFe,Kkt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Jkt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Wee=/^(?:(?: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])$/,Xee=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,ete=e=>{let t=gp(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tte=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,nte=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rte=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JG=/^[A-Za-z0-9_-]*$/,Zkt=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Wkt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ote=/^https?$/,ite=/^\+[1-9]\d{6,14}$/,lFe="(?:(?:\\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])))",ste=new RegExp(`^${lFe}$`);cte=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},lte=/^-?\d+n?$/,dte=/^-?\d+$/,ZG=/^-?\d+(?:\.\d+)?$/,pte=/^(?:true|false)$/i,fte=/^null$/i,mte=/^undefined$/i,Ate=/^[^A-Z]*$/,gte=/^[^a-z]*$/,Xkt=/^[0-9a-fA-F]*$/;ePt=/^[0-9a-fA-F]{32}$/,tPt=WO(22,"=="),nPt=XO(22),rPt=/^[0-9a-fA-F]{40}$/,oPt=WO(27,"="),iPt=XO(27),sPt=/^[0-9a-fA-F]{64}$/,aPt=WO(43,"="),uPt=XO(43),cPt=/^[0-9a-fA-F]{96}$/,lPt=WO(64,""),dPt=XO(64),pPt=/^[0-9a-fA-F]{128}$/,fPt=WO(86,"=="),mPt=XO(86)});function pFe(e,t,n){e.issues.length&&t.issues.push(...tl(n,e.issues))}var no,fFe,XG,ej,hte,_te,Ete,yte,Ste,Tte,bte,Ite,Cte,mx,vte,Rte,xte,Dte,Nte,Bte,wte,Ote,kte,tj=w(()=>{m();CT();WG();St();no=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fFe={number:"number",bigint:"bigint",object:"date"},XG=ie("$ZodCheckLessThan",(e,t)=>{no.init(e,t);let n=fFe[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ej=ie("$ZodCheckGreaterThan",(e,t)=>{no.init(e,t);let n=fFe[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hte=ie("$ZodCheckMultipleOf",(e,t)=>{no.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Ree(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_te=ie("$ZodCheckNumberFormat",(e,t)=>{no.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Oee[t.format];e._zod.onattach.push(s=>{let u=s._zod.bag;u.format=t.format,u.minimum=o,u.maximum=i,n&&(u.pattern=dte)}),e._zod.check=s=>{let u=s.value;if(n){if(!Number.isInteger(u)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<o&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>i&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Ete=ie("$ZodCheckBigIntFormat",(e,t)=>{no.init(e,t);let[n,r]=kee[t.format];e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=o=>{let i=o.value;i<n&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),yte=ie("$ZodCheckMaxSize",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;o.size<=t.maximum||r.issues.push({origin:VO(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ste=ie("$ZodCheckMinSize",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;o.size>=t.minimum||r.issues.push({origin:VO(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Tte=ie("$ZodCheckSizeEquals",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.size,o.maximum=t.size,o.size=t.size}),e._zod.check=r=>{let o=r.value,i=o.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:VO(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bte=ie("$ZodCheckMaxLength",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;if(o.length<=t.maximum)return;let s=YO(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ite=ie("$ZodCheckMinLength",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;if(o.length>=t.minimum)return;let s=YO(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Cte=ie("$ZodCheckLengthEquals",(e,t)=>{var n;no.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!$E(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{let o=r.value,i=o.length;if(i===t.length)return;let s=YO(o),u=i>t.length;r.issues.push({origin:s,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),mx=ie("$ZodCheckStringFormat",(e,t)=>{var n,r;no.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),vte=ie("$ZodCheckRegex",(e,t)=>{mx.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Rte=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ate),mx.init(e,t)}),xte=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=gte),mx.init(e,t)}),Dte=ie("$ZodCheckIncludes",(e,t)=>{no.init(e,t);let n=gp(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Nte=ie("$ZodCheckStartsWith",(e,t)=>{no.init(e,t);let n=new RegExp(`^${gp(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Bte=ie("$ZodCheckEndsWith",(e,t)=>{no.init(e,t);let n=new RegExp(`.*${gp(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});wte=ie("$ZodCheckProperty",(e,t)=>{no.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(o=>pFe(o,n,t.property));pFe(r,n,t.property)}}),Ote=ie("$ZodCheckMimeType",(e,t)=>{no.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),kte=ie("$ZodCheckOverwrite",(e,t)=>{no.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var ek,Pte=w(()=>{m();ek=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
|
|
@@ -662,7 +662,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
662
662
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
663
663
|
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,o=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(o&&n.sep&&!n.value){let s=[];for(let u=0;u<n.sep.length;++u){let l=n.sep[u];switch(l.type){case"newline":s.push(u);break;case"space":break;case"comment":l.indent>t.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(k0(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(XZe(n.key)&&!k0(n.sep,"newline")){let s=o1(n.start),u=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:u,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(k0(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=o1(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:i,key:null,sep:[this.sourceToken]}):k0(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);o||n.value?(t.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!k0(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:i});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||k0(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:o,sep:[]}):n.sep?this.stack.push(o):Object.assign(n,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let o=E9(r),i=o1(o);WZe(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
664
664
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
665
|
-
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};eWe.Parser=Ppe});var iWe=M(CM=>{"use strict";m();var tWe=Tpe(),xZt=gM(),IM=EM(),DZt=yde(),NZt=gr(),BZt=kpe(),nWe=Mpe();function rWe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new BZt.LineCounter||null,prettyErrors:t}}function wZt(e,t={}){let{lineCounter:n,prettyErrors:r}=rWe(t),o=new nWe.Parser(n?.addNewLine),i=new tWe.Composer(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(let u of s)u.errors.forEach(IM.prettifyError(e,n)),u.warnings.forEach(IM.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function oWe(e,t={}){let{lineCounter:n,prettyErrors:r}=rWe(t),o=new nWe.Parser(n?.addNewLine),i=new tWe.Composer(t),s=null;for(let u of i.compose(o.parse(e),!0,e.length))if(!s)s=u;else if(s.options.logLevel!=="silent"){s.errors.push(new IM.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(IM.prettifyError(e,n)),s.warnings.forEach(IM.prettifyError(e,n))),s}function OZt(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let o=oWe(e,n);if(!o)return null;if(o.warnings.forEach(i=>DZt.warn(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function kZt(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=n??t??{};if(!o)return}return NZt.isDocument(e)&&!r?e.toString(n):new xZt.Document(e,r,n).toString(n)}CM.parse=OZt;CM.parseAllDocuments=wZt;CM.parseDocument=oWe;CM.stringify=kZt});var aWe=M(Mr=>{"use strict";m();var PZt=Tpe(),MZt=gM(),LZt=npe(),Lpe=EM(),UZt=XP(),P0=gr(),QZt=N0(),FZt=ps(),GZt=w0(),jZt=O0(),zZt=h9(),HZt=wpe(),$Zt=kpe(),qZt=Mpe(),y9=iWe(),sWe=KP();Mr.Composer=PZt.Composer;Mr.Document=MZt.Document;Mr.Schema=LZt.Schema;Mr.YAMLError=Lpe.YAMLError;Mr.YAMLParseError=Lpe.YAMLParseError;Mr.YAMLWarning=Lpe.YAMLWarning;Mr.Alias=UZt.Alias;Mr.isAlias=P0.isAlias;Mr.isCollection=P0.isCollection;Mr.isDocument=P0.isDocument;Mr.isMap=P0.isMap;Mr.isNode=P0.isNode;Mr.isPair=P0.isPair;Mr.isScalar=P0.isScalar;Mr.isSeq=P0.isSeq;Mr.Pair=QZt.Pair;Mr.Scalar=FZt.Scalar;Mr.YAMLMap=GZt.YAMLMap;Mr.YAMLSeq=jZt.YAMLSeq;Mr.CST=zZt;Mr.Lexer=HZt.Lexer;Mr.LineCounter=$Zt.LineCounter;Mr.Parser=qZt.Parser;Mr.parse=y9.parse;Mr.parseAllDocuments=y9.parseAllDocuments;Mr.parseDocument=y9.parseDocument;Mr.stringify=y9.stringify;Mr.visit=sWe.visit;Mr.visitAsync=sWe.visitAsync});m();m();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="
|
|
665
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=E9(t),r=o1(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};eWe.Parser=Ppe});var iWe=M(CM=>{"use strict";m();var tWe=Tpe(),xZt=gM(),IM=EM(),DZt=yde(),NZt=gr(),BZt=kpe(),nWe=Mpe();function rWe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new BZt.LineCounter||null,prettyErrors:t}}function wZt(e,t={}){let{lineCounter:n,prettyErrors:r}=rWe(t),o=new nWe.Parser(n?.addNewLine),i=new tWe.Composer(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(let u of s)u.errors.forEach(IM.prettifyError(e,n)),u.warnings.forEach(IM.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function oWe(e,t={}){let{lineCounter:n,prettyErrors:r}=rWe(t),o=new nWe.Parser(n?.addNewLine),i=new tWe.Composer(t),s=null;for(let u of i.compose(o.parse(e),!0,e.length))if(!s)s=u;else if(s.options.logLevel!=="silent"){s.errors.push(new IM.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(IM.prettifyError(e,n)),s.warnings.forEach(IM.prettifyError(e,n))),s}function OZt(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let o=oWe(e,n);if(!o)return null;if(o.warnings.forEach(i=>DZt.warn(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function kZt(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=n??t??{};if(!o)return}return NZt.isDocument(e)&&!r?e.toString(n):new xZt.Document(e,r,n).toString(n)}CM.parse=OZt;CM.parseAllDocuments=wZt;CM.parseDocument=oWe;CM.stringify=kZt});var aWe=M(Mr=>{"use strict";m();var PZt=Tpe(),MZt=gM(),LZt=npe(),Lpe=EM(),UZt=XP(),P0=gr(),QZt=N0(),FZt=ps(),GZt=w0(),jZt=O0(),zZt=h9(),HZt=wpe(),$Zt=kpe(),qZt=Mpe(),y9=iWe(),sWe=KP();Mr.Composer=PZt.Composer;Mr.Document=MZt.Document;Mr.Schema=LZt.Schema;Mr.YAMLError=Lpe.YAMLError;Mr.YAMLParseError=Lpe.YAMLParseError;Mr.YAMLWarning=Lpe.YAMLWarning;Mr.Alias=UZt.Alias;Mr.isAlias=P0.isAlias;Mr.isCollection=P0.isCollection;Mr.isDocument=P0.isDocument;Mr.isMap=P0.isMap;Mr.isNode=P0.isNode;Mr.isPair=P0.isPair;Mr.isScalar=P0.isScalar;Mr.isSeq=P0.isSeq;Mr.Pair=QZt.Pair;Mr.Scalar=FZt.Scalar;Mr.YAMLMap=GZt.YAMLMap;Mr.YAMLSeq=jZt.YAMLSeq;Mr.CST=zZt;Mr.Lexer=HZt.Lexer;Mr.LineCounter=$Zt.LineCounter;Mr.Parser=qZt.Parser;Mr.parse=y9.parse;Mr.parseAllDocuments=y9.parseAllDocuments;Mr.parseDocument=y9.parseDocument;Mr.stringify=y9.stringify;Mr.visit=sWe.visit;Mr.visitAsync=sWe.visitAsync});m();m();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="939de73f-2366-4bb5-8766-3ae8fea39ad0",e._sentryDebugIdIdentifier="sentry-dbid-939de73f-2366-4bb5-8766-3ae8fea39ad0")}catch{}})();m();m();m();function uAe(e=process.versions.node){let t=Number.parseInt(e.split(".")[0]??"",10);return!Number.isFinite(t)||t<=0?{ok:!0,currentVersion:e,message:null}:t<20?{ok:!1,currentVersion:e,message:`requires Node.js >= 20.0.0 (found ${e})`}:{ok:!0,currentVersion:e,message:null}}var cAe=uAe();cAe.ok||(process.stderr.write(`lore: ${cAe.message}.
|
|
666
666
|
Upgrade Node (e.g. \`nvm install 20\`) and re-run.
|
|
667
667
|
`),process.exit(1));m();WR();sc();function wwt(){let e=process.env.SENTRY_SPOTLIGHT?.trim();return!e||e==="0"||e==="false"?!1:e==="1"||e==="true"?!0:e}var Owt=wwt(),OQe=Kr(),iee=OQe!=="dev";oee({dsn:iee?"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088":void 0,environment:OQe,release:_u(),sendDefaultPii:!0,enableLogs:iee,spotlight:Owt,tracesSampleRate:iee?1:0});GQ("service_name","lore-cli");WR();cee();import{realpathSync as bnn}from"node:fs";import{fileURLToPath as Inn,pathToFileURL as ltt}from"node:url";m();m();Rk();Pr();on();Bn();m();function Fk(e){let t=e;return t._def??t.def??{}}function _3t(e){let t=Fk(e);return typeof t.typeName=="string"?t.typeName:typeof t.type=="string"?t.type:void 0}function il(e,t,n){let r=_3t(e);return r===t||r===n}function Uje(e){let t=Fk(e);if(t.element)return t.element;if(typeof t.type=="object"&&t.type!==null)return t.type}function E3t(e){let t=e.options;if(Array.isArray(t))return[...t];let n=Fk(e);return Array.isArray(n.values)?[...n.values]:n.entries&&typeof n.entries=="object"?Object.values(n.entries):[]}function Ese(e){if(!e||!il(e,"ZodObject","object"))return;let t=e.shape;if(typeof t=="function")return t();if(t&&typeof t=="object")return t;let n=Fk(e).shape;if(typeof n=="function")return n();if(n&&typeof n=="object")return n}function Qje(e){let t=e,n=!1,r,o=e.description;for(;;){o=t.description??o;let i=Fk(t);if(il(t,"ZodOptional","optional"))n=!0,t=i.innerType;else if(il(t,"ZodNullable","nullable"))n=!0,t=i.innerType;else if(il(t,"ZodDefault","default"))r=typeof i.defaultValue=="function"?i.defaultValue():i.defaultValue,t=i.innerType;else if(il(t,"ZodEffects","effects"))t=i.schema;else if(il(t,"ZodPipeline","pipe"))t=i.in;else break}return{inner:t,optional:n,defaultValue:r,description:o}}function y3t(e,t={}){let{inner:n,optional:r,defaultValue:o,description:i}=Qje(e),s=!1,u=n;il(u,"ZodArray","array")&&(s=!0,u=Uje(u)??u);let l=!r&&o===void 0;return t.positional?{arg:{type:"positional",description:i,required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:il(u,"ZodEnum","enum")?{arg:{type:"enum",description:i,options:E3t(u),required:l,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:s}:il(u,"ZodBoolean","boolean")?{arg:{type:"boolean",description:i,required:l,...typeof o=="boolean"?{default:o}:{}},optional:r,isArray:s}:{arg:{type:"string",description:s?`${i??""}${i?" ":""}(comma-separated)`.trim()||void 0:i,required:l,...o!==void 0?{default:String(o)}:{},...s?{valueHint:"a,b,c"}:{}},optional:r,isArray:s}}function yse(e,t={}){let n={},r={};for(let[o,i]of Object.entries(e)){let{arg:s,isArray:u}=y3t(i,t);n[o]=s,r[o]={isArray:u,leafKind:S3t(i)}}return{args:n,fields:r}}function Sse(e,t={}){let n=Ese(e);return n?yse(n,t):{args:{},fields:{}}}function S3t(e){let{inner:t}=Qje(e),n=t;return il(n,"ZodArray","array")&&(n=Uje(n)??n),il(n,"ZodNumber","number")?"number":il(n,"ZodBoolean","boolean")?"boolean":il(n,"ZodEnum","enum")?"enum":il(n,"ZodString","string")?"string":"other"}function T3t(e,t){let n=e;for(let r of t){if(n===null||typeof n!="object"||!(r in n))throw new Error(`cliRoutes path [${t.join(".")}] does not resolve in apiContract`);n=n[r]}if(n===null||typeof n!="object"||typeof n.method!="string")throw new Error(`cliRoutes path [${t.join(".")}] is not a leaf route (missing 'method')`);return n}function b3t(e,t){let n=e;for(let r of t)n=n[r];if(typeof n!="function")throw new Error(`client method for [${t.join(".")}] is not callable`);return n}function Tse(e,t){if(!(e==null||e==="")){if(t.isArray&&typeof e=="string"){let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);return n.length>0?n:void 0}if(t.leafKind==="number"&&typeof e=="string"){let n=Number(e);return Number.isFinite(n)?n:e}return e}}function I3t(e){if(typeof e!="string")return e;try{let n=new URL(e).pathname.split("/").filter(Boolean),r=n.findIndex(i=>i==="thread"||i==="threads"),o=r>=0?n[r+1]:void 0;return o&&o.length>0?o:e}catch{return e}}function C3t(e,t){let n=t.path.map(o=>String(o)).join(".");return` ${n?`${e}.${n}`:e}: ${t.message}`}function bse(e,t,n){if(!e)return[];let r=t??{},o=e.safeParse(r);return o.success?[]:(o.error.issues??[]).map(s=>C3t(n,s))}function v3t(e,t,n){return e.resource==="threads"&&t==="id"?I3t(n):n}function Fje(e){let t=T3t(Qz,e.path),n=Ese(t.pathParams),r=e.positional??(n?Object.keys(n):[]),o=new Set(r),i=yse(n?Object.fromEntries(r.map(h=>[h,n[h]])):{},{positional:!0}),s=Sse(t.query),u=t.method==="GET"||t.method==="DELETE"?{args:{},fields:{}}:Sse(t.body);for(let h of Object.keys(u.args))if(s.args[h]!==void 0||o.has(h))throw new Error(`route [${e.path.join(".")}] has overlapping field "${h}" across path/query/body`);let l={...i.args,...s.args,...u.args},f=e.description??t.summary??`${t.method} ${t.path}`;return{meta:{name:e.op,description:f},args:l,async run({args:h,data:_}){$.info("command_start",{command:`${e.resource} ${e.op}`,route:e.path.join(".")});let y=_;if(!await(y?.getAccessToken??sn)())throw new De("not logged in \u2014 run 'lore login' first");let v={};for(let ae of r){let re=h[ae],_e=Tse(re,i.fields[ae])??re;v[ae]=v3t(e,ae,_e)}let R={};for(let[ae,re]of Object.entries(s.fields)){let _e=Tse(h[ae],re);_e!==void 0&&(R[ae]=_e)}let x={};for(let[ae,re]of Object.entries(u.fields)){let _e=Tse(h[ae],re);_e!==void 0&&(x[ae]=_e)}let O=[...bse(t.pathParams,v,"path"),...bse(t.query,R,"query"),...t.method==="GET"||t.method==="DELETE"?[]:bse(t.body,x,"body")];if(O.length>0)throw new De(`Invalid request for \`lore ${e.resource} ${e.op}\`:
|
|
668
668
|
${O.join(`
|
|
@@ -694,7 +694,7 @@ The held transcript is never uploaded, and secret values are never shown.`)}},xW
|
|
|
694
694
|
`)}var UXe={meta:{name:"list",description:"List skills available in your workspace."},async run({data:e}){let t=e;if(!await(t?.getAccessToken??sn)())throw new De("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Gt()).listSkills({});if(o.status!==200){let i=o.body?.message??`listSkills returned ${o.status}`;throw new De(i)}console.log(VXt(o.body.objects))}};m();Pr();on();var QXe={meta:{name:"proposals",description:"List proposed versions awaiting owner review for a skill."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."}},async run({args:e}){if(!await sn())throw new De("skill proposals require login \u2014 run 'lore login' first");await YXt(Gt(),e.id)}};async function YXt(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status!==200){let o=n.body?.message??`getSkillDetail returned ${n.status}`;throw new De(o)}let r=n.body.versions.filter(o=>o.status==="proposed");if(r.length===0){console.log(`no proposed versions for ${t}`);return}for(let o of r){let i=o.created_by?`${o.created_by.display_name} (${o.created_by.id})`:"unknown";console.log(`${n.body.id} /${n.body.name} version=${o.version} proposer=${i} created_at=${o.created_at}`)}}m();import{readFile as FXe}from"node:fs/promises";Pr();on();Bn();var GXe={meta:{name:"publish",description:"Publish a local or captured skill to your workspace, or upload local edits for an already-published skill."},args:{target:{type:"positional",required:!0,description:"Local skill name/path, private captured sk_* ID, or workspace published sk_* ID"}},async run({args:e}){if(!await sn())throw new De("not logged in \u2014 run 'lore login' first");let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new De("pass a skill name, path, or sk_* ID to publish");let n=await KXt(Gt(),t);ren(n)}};async function KXt(e,t){let n=t.trim();if(!n)throw new De("pass a skill name, path, or sk_* ID to publish");let r=n.startsWith("sk_")?"skill_id":"local_name_or_path";$.info("skill_publish_started",{target_kind:r,target:n});try{if(n.startsWith("sk_"))return await jXe(e,n);let o=await mWe(n)??await AWe(n);if(!o)throw new De(`no SKILL.md found for ${n}`);return await JXt(e,o)}catch(o){throw $.warn("skill_publish_failed",{target_kind:r,target:n,phase:"publish",error:ln(o)}),o}}async function JXt(e,t){let n=Vf(t.bodyMd),r=await wWe(t);$.info("skill_publish_local_resolved",{name:t.name,file_path:t.filePath,root_kind:t.rootKind,captured_skill_id:r,captured_skill_id_present:!!r});let o=r;if(!o||await ZXt(o)!==n){let s=await s1(e,{...t,...o?{skillId:o}:{}},{syncAction:"capture"});o=s.skill_id,$.info("skill_publish_capture_uploaded",{name:t.name,file_path:t.filePath,skill_id:s.skill_id,version:s.version,root_kind:s.root_kind})}let i=await jXe(e,o);return i.kind!=="conflict"&&i.kind!=="remote_newer"&&await a1(t,{skillId:o,version:i.version}),i}async function ZXt(e){return(await $a()).captured[e]?.lastPushedHash??null}async function jXe(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status===200&&n.body.visibility==="workspace")return XXt(e,t,n.body);let r=await e.publishSkill({params:{id:t},body:{}});if(r.status!==200)throw nen("publish skill",r.status,r.body);return await WXt(t,r.body.latest_version??0),$.info("skill_publish_promoted",{skill_id:r.body.id,version:r.body.latest_version??0,name:r.body.name}),{kind:"promoted",skillId:r.body.id,version:r.body.latest_version??0}}async function WXt(e,t){let r=(await $a()).captured[e];if(!r)return;let o;try{o=await FXe(r.filePath,"utf8")}catch(i){$.warn("skill_publish_record_local_failed",{skill_id:e,file_path:r.filePath,error:ln(i)});return}await a1({name:r.name,bodyMd:o,filePath:r.filePath,rootKind:r.rootKind},{skillId:e,version:t})}async function XXt(e,t,n){let r=await $a(),o=r.installed[t]??null,i=r.captured[t]??null,s=r.published[t]??null,u=o?.installPath??i?.filePath,l=o?.rootKind??i?.rootKind??n.root_kind,f=o?.name??i?.name??n.name;if(!u)throw new De(`no managed local SKILL.md found for ${t}; install or capture it first`);let h=await FXe(u,"utf8"),_=Vf(h),y=n.latest_version??0,T=n.content_hash??"",v=een(o,s,i);if(_===T)return $.info("skill_publish_noop",{skill_id:t,version:y,reason:"local_matches_remote"}),{kind:"unchanged",skillId:t,version:y};if(v.version>0&&y>v.version)return _===v.hash?($.info("skill_publish_noop",{skill_id:t,version:y,reason:"remote_newer_local_unchanged",local_version:v.version}),{kind:"remote_newer",skillId:t,localVersion:v.version,remoteVersion:y}):(o&&await cl({...o,lastSyncStatus:"conflict"}),$.warn("skill_publish_conflict",{skill_id:t,local_version:v.version,remote_version:y,name:f,file_path:u}),{kind:"conflict",skillId:t,localVersion:v.version,remoteVersion:y});if(_===v.hash)return $.info("skill_publish_noop",{skill_id:t,version:y,reason:"local_matches_base"}),{kind:"unchanged",skillId:t,version:y};let R=await ten(e),x=n.owner?.id&&n.owner.id===R?"owner_update":"subscriber_update",O=await s1(e,{skillId:t,name:f,description:null,bodyMd:h,filePath:u,rootKind:l},{syncAction:x,...v.version>0?{baseVersion:v.version}:{}});return o&&await cl({...o,...O.version_status==="accepted"?{baseVersion:O.version,baseContentHash:O.content_hash,lastSyncStatus:"current"}:{lastSyncStatus:"proposed"},lastInstalledVersion:O.version,lastInstalledHash:O.content_hash}),await a1({name:f,bodyMd:h,filePath:u,rootKind:l},{skillId:O.skill_id,version:O.version}),$.info("skill_publish_update_uploaded",{skill_id:O.skill_id,name:f,file_path:u,sync_action:x,version:O.version,version_status:O.version_status}),{kind:"uploaded",skillId:O.skill_id,version:O.version,versionStatus:O.version_status==="proposed"?"proposed":"accepted"}}function een(e,t,n){return e?{hash:e.baseContentHash,version:e.baseVersion}:t?{hash:t.lastPublishedHash,version:t.lastPublishedVersion}:n?{hash:n.lastPushedHash,version:n.lastPushedVersion}:{hash:"",version:0}}async function ten(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}function nen(e,t,n){let r=n?.message??`${e} returned ${t}`;return new De(r)}function ren(e){switch(e.kind){case"promoted":console.log(`published ${e.skillId} (v${e.version})`);break;case"uploaded":console.log(`${e.versionStatus} ${e.skillId} (v${e.version})`);break;case"unchanged":console.log(`already up to date ${e.skillId} (v${e.version})`);break;case"remote_newer":console.log(`remote newer ${e.skillId}: local base is v${e.localVersion}, remote is v${e.remoteVersion}; run lore skills sync`);break;case"conflict":console.log(`conflict ${e.skillId}: remote advanced from v${e.localVersion} to v${e.remoteVersion}; run lore skills sync`);break}}m();Pr();on();var zXe={meta:{name:"reject",description:"Reject a proposed skill version without changing the latest accepted version."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."},version:{type:"string",required:!0,description:"Proposed version timestamp to reject"},reason:{type:"string",required:!1,description:"Optional rejection reason shown with the reviewed version"}},async run({args:e}){if(!await sn())throw new De("skill rejection requires login \u2014 run 'lore login' first");await oen(Gt(),{id:e.id,version:e.version,reason:e.reason})}};async function oen(e,t){let n=Number(t.version);if(!Number.isInteger(n)||n<=0)throw new De("--version must be a positive integer timestamp");let r=t.reason?.trim(),o=await e.rejectSkillVersion({params:{id:t.id,version:n},body:r?{reason:r}:{}});if(o.status!==200){let i=o.body?.message??`rejectSkillVersion returned ${o.status}`;throw new De(i)}console.log(`rejected /${o.body.name} v${o.body.version} (${o.body.id})`)}m();Rk();import ien from"node:os";import qa from"node:path";var HXe={meta:{name:"scan",description:"List local skills found by Lore's scanner."},async run(){await den()}};function sen(e){let t=qa.resolve(e),n=qa.resolve(ien.homedir()),r=qa.relative(n,t);return r===""?"~":!r.startsWith("..")&&!qa.isAbsolute(r)?qa.join("~",r):t}function aen(e){return sen(qa.dirname(qa.dirname(e)))}function uen(e){return qa.basename(qa.dirname(e))}function cen(e,t){let n=qa.resolve(e);for(let r of t){let o=qa.resolve(r),i=qa.relative(o,n);if(i!==""&&!i.startsWith("..")&&!qa.isAbsolute(i))return o}return null}function len(e,t,n){return e==="claude_project"?t.map(r=>qa.join(T9(r),n)):e==="agents_project"?t.map(r=>qa.join(b9(r),n)):[]}async function den(){let e=await OWe(),t=e.map(u=>u.root),n=new Map(e.map(u=>[qa.resolve(u.root),u])),r=await Qpe({projectCwds:t,includeCwdProject:!1}),o={},i=new Set;for(let u of r){let l=qa.resolve(u.filePath);if(i.has(l))continue;i.add(l);let f=aen(u.filePath),h=cen(u.filePath,t),_=h?n.get(h)?.alsoSeenAt??[]:[];o[f]??=[],o[f].push({name:u.name,description:u.description,root_kind:u.rootKind,file_path:u.filePath,also_seen_at:len(u.rootKind,_,uen(u.filePath))})}let s=GGe.parse({type:"local_skill_scanner_output",skills:o});console.log(JSON.stringify(s,null,2))}m();Pr();on();var $Xe={meta:{name:"status",description:"Show local Lore-managed skill sync state."},async run(){if(!await sn())throw new De("skill status requires login \u2014 run 'lore login' first");await pen()}};async function pen(){let e=await $a(),t=[];for(let n of Object.values(e.installed).sort((r,o)=>r.skillId.localeCompare(o.skillId)))t.push(["installed",n.skillId,`/${n.name}`,`status=${n.lastSyncStatus}`,`base=${n.baseVersion}`,`installed=${n.lastInstalledVersion}`,`root=${n.rootKind}`,`path=${n.installPath}`].join(" "));for(let n of Object.values(e.captured).sort((r,o)=>r.skillId.localeCompare(o.skillId))){let r=e.published[n.skillId];t.push(["captured",n.skillId,`/${n.name}`,`status=${r?"published":"private"}`,`version=${n.lastPushedVersion}`,`root=${n.rootKind}`,`path=${n.filePath}`].join(" "))}for(let[n,r]of Object.entries(e.published).sort(([o],[i])=>o.localeCompare(i)))e.captured[n]||t.push(["published",n,`version=${r.lastPublishedVersion}`,`hash=${r.lastPublishedHash}`].join(" "));if(t.length===0){console.log("no local skills tracked by Lore");return}console.log(t.join(`
|
|
695
695
|
`))}m();Pr();on();var qXe={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await sn())throw new De("workspace skill sync requires login \u2014 run 'lore login' first");let e=await ofe(Gt());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};m();import VXe from"node:fs/promises";import fen from"node:path";Pr();on();var YXe={meta:{name:"uninstall",description:"Remove a Lore-managed skill by stable skill ID."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new De("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await sn())throw new De("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Gt();await men(n,t)}};async function men(e,t){let n=await i1(t);n&&(await VXe.rm(n.installPath,{force:!0}),await VXe.rmdir(fen.dirname(n.installPath)).catch(()=>{}));let r=await e.uninstallSkill({params:{id:t},body:{}});if(r.status!==200){let o=r.body?.message??`uninstallSkill returned ${r.status}`;throw new De(o)}if(await CWe(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}var KXe={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:GXe,install:LXe,uninstall:YXe,sync:qXe,daemon:F9,approve:PXe,reject:zXe,proposals:QXe,status:$Xe,list:UXe,scan:HXe}};s0();m();await Ao();var Y9=ue(dn(),1);sc();await pb();m();await Ao();var $9=ue(dn(),1);await xA();m();await Ao();var c1=ue(dn(),1);ks();var md=ue(jt(),1);function l1({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[s,u]=(0,c1.useState)(JXe(e,n)),l=(0,c1.useRef)(s);return(0,c1.useEffect)(()=>{let f=JXe(e,n);l.current=f,u(f)},[e,n]),xu((f,h)=>{if(e.length!==0){if(h.upArrow||f==="k"){let _=Aen(e,l.current);l.current=_,u(_);return}if(h.downArrow||f==="j"){let _=ZXe(e,l.current);l.current=_,u(_);return}if(h.return||f===" "){let _=e[l.current];_&&!_.disabled&&t(_)}}},{isActive:!r}),e.length===0?(0,md.jsx)(he,{color:Re.muted,children:"no actions available"}):(0,md.jsxs)(Ee,{flexDirection:"column",children:[e.map((f,h)=>{let _=h===s,y=f.disabled?Re.muted:_?Re.primary:Re.highlight;return(0,md.jsxs)(Ee,{children:[(0,md.jsx)(Ee,{width:2,flexShrink:0,children:(0,md.jsx)(he,{color:_?Re.primary:Re.muted,children:_?"\u203A":" "})}),(0,md.jsx)(Ee,{width:i,flexShrink:0,children:(0,md.jsx)(he,{color:y,bold:_&&!f.disabled,children:f.label})}),f.description?(0,md.jsx)(Ee,{flexGrow:1,flexShrink:1,children:(0,md.jsx)(he,{color:Re.muted,children:f.description})}):null]},f.id)}),o?(0,md.jsx)(Ee,{marginTop:1,children:(0,md.jsx)(he,{color:Re.muted,children:o})}):null]})}function JXe(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?ZXe(e,n-1):n}function ZXe(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r]?.disabled)return r}return t}function Aen(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r]?.disabled)return r}return t}await DA();await Ab();await gb();ks();m();Pr();Ga();LD();HD();async function G9(e){if(!await(e.hasAccessToken??(async()=>!!await sn()))())return{state:"logged_out"};let n=e.client??Gt();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:WXe(r.body,`whoAmI returned ${r.status}`)}:{state:"ready",userId:r.body.user.id,email:r.body.emailAddress,displayName:r.body.user.display_name,organizations:r.body.organizations,activeOrganizationId:r.body.organizationId,activeOrganizationName:r.body.org_name}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function j9(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??u$;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function z9(e){if(!await(e.hasAccessToken??(async()=>!!await sn()))())return{state:"logged_out"};let n=e.client??Gt();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:WXe(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(s=>s.visibility==="workspace").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function H9(){try{await Ih();let e=await Ho();return gen(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function gen(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function WXe(e,t){if(e&&typeof e=="object"&&"message"in e){let n=e.message;if(typeof n=="string"&&n.length>0)return n}return t}var wt=ue(jt(),1);function U0({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=ws(),[i,s]=(0,$9.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,$9.useEffect)(()=>{if(t)return;let l=!1;return(async()=>{let[f,h,_,y]=await Promise.all([G9(n),j9(n),z9(n),H9()]);l||s({identity:f,daemon:h,skills:_,uploadDirs:y})})(),()=>{l=!0}},[]),xu((l,f)=>{(l==="q"||f.ctrl&&l==="c"||f.escape)&&(r("quit"),o())});let u=Ten(i);return(0,wt.jsxs)(Ee,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,wt.jsx)(Ps,{title:"lore",subtitle:_en(i.identity),right:`v${e}`}),(0,wt.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,wt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,wt.jsx)(Qn,{title:"Daemon",children:(0,wt.jsx)(Een,{daemon:i.daemon})})}),(0,wt.jsx)(Ee,{flexDirection:"column",width:"50%",children:(0,wt.jsx)(Qn,{title:"Workspace",children:(0,wt.jsx)(yen,{identity:i.identity,skills:i.skills})})})]}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsx)(Qn,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,wt.jsx)(hen,{uploadDirs:i.uploadDirs})})}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsx)(Qn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,wt.jsx)(l1,{items:u,onSelect:l=>{r(l.id),o()}})})})]})}function hen({uploadDirs:e}){return e.state==="loading"?(0,wt.jsx)(za,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,wt.jsx)(Ee,{marginTop:1,children:(0,wt.jsxs)(he,{color:Re.muted,children:["Run ",(0,wt.jsx)(he,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,wt.jsxs)(Ee,{flexDirection:"column",children:[e.cwd.map(t=>(0,wt.jsx)(an,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,wt.jsx)(an,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function _en(e){switch(e.state){case"ready":{let t=e.activeOrganizationName??"";return t?`${e.email} \xB7 ${t}`:e.email}case"logged_out":return"not signed in";case"loading":return"loading\u2026";case"error":return"identity error"}}function Een({daemon:e}){if(e.state==="loading")return(0,wt.jsx)(za,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(he,{color:Re.muted,children:"Background uploads are macOS-only today."}),(0,wt.jsxs)(he,{color:Re.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:t.health,kind:n}),(0,wt.jsx)(an,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,wt.jsx)(an,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,wt.jsx)(an,{label:"Heartbeat",value:XXe(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,wt.jsx)(an,{label:"Last upload",value:XXe(t.status?.last_success_at)}),t.status?.last_error?(0,wt.jsx)(an,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function yen({identity:e,skills:t}){return e.state==="loading"?(0,wt.jsx)(za,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"signed out",kind:"warning"}),(0,wt.jsx)(he,{color:Re.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"Status",value:"error",kind:"error"}),(0,wt.jsx)(he,{color:Re.danger,children:e.message})]}):(0,wt.jsxs)(Ee,{flexDirection:"column",children:[(0,wt.jsx)(an,{label:"User",value:e.email,kind:"success"}),(0,wt.jsx)(an,{label:"Display name",value:e.displayName}),(0,wt.jsx)(an,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,wt.jsx)(an,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,wt.jsx)(an,{label:"Skills",value:Sen(t)})]})}function Sen(e){return e.state==="loading"?"loading\u2026":e.state==="logged_out"?"\u2014":e.state==="error"?`error (${e.message})`:`${e.count} installed \xB7 ${e.published} published`}function Ten(e){let t=e.identity.state==="ready",n=e.daemon.state==="ready"&&e.daemon.report.enabled,r=e.daemon.state!=="unsupported",o=[];return t&&(o.push({id:"share-codex",label:"Share Codex",description:"lore share-codex --session-file <path>"}),o.push({id:"share-cowork",label:"Share Cowork",description:"lore share-cowork"}),o.push({id:"export",label:"Export Claude",description:"lore export"})),r&&(n?(o.push({id:"status",label:"Daemon status",description:"lore status"}),o.push({id:"restart",label:"Restart daemon",description:"lore restart"}),o.push({id:"disable",label:"Disable daemon",description:"lore disable"})):o.push({id:"enable",label:"Enable daemon",description:"lore enable"})),t?(o.push({id:"configure",label:"Configure uploads",description:"lore configure"}),o.push({id:"listen-list",label:"Manage upload dirs",description:"lore listen list"}),o.push({id:"skills-list",label:"Skills",description:"lore skills list"}),o.push({id:"workspaces-list",label:"Workspaces",description:"lore workspaces list"}),o.push({id:"logout",label:"Sign out",description:"lore logout"})):o.push({id:"login",label:"Sign in",description:"lore login"}),o.push({id:"quit",label:"Quit",description:"exit the dashboard"}),o}function XXe(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}m();await Ao();await xA();await DA();ks();var si=ue(jt(),1),ben=[{id:"login",label:"Sign in with WorkOS",description:"opens your browser for a device-code flow"},{id:"quit",label:"Quit",description:"exit without signing in"}];function q9({cliVersion:e,onSelect:t}){let{exit:n}=ws();return xu((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,si.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,si.jsx)(Ps,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,si.jsx)(Qn,{title:"What is Lore?",children:(0,si.jsxs)(Ee,{flexDirection:"column",children:[(0,si.jsx)(he,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,si.jsxs)(Ee,{marginTop:1,flexDirection:"column",children:[(0,si.jsx)(he,{color:Re.muted,children:"You'll get:"}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,si.jsxs)(he,{children:[(0,si.jsx)(he,{color:Re.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,si.jsx)(Ee,{marginTop:1,children:(0,si.jsx)(Qn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,si.jsx)(l1,{items:ben,onSelect:r=>{t(r.id),n()}})})}),(0,si.jsx)(Ee,{marginTop:1,children:(0,si.jsxs)(he,{color:Re.muted,children:["New to Lore? Run ",(0,si.jsx)(he,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var V9=ue(jt(),1),Ien={login:["login"],logout:["logout"],enable:["enable"],disable:["disable"],status:["status"],restart:["restart"],"share-codex":["share-codex"],"share-cowork":["share-cowork"],export:["export"],"workspaces-list":["workspaces","list"],"skills-list":["skills","list"],"listen-list":["listen","list"],configure:["configure"],quit:[]};function Cen({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,Y9.useState)(void 0),{exit:i}=ws();return(0,Y9.useEffect)(()=>{let s=!1;return(async()=>{let[u,l,f,h]=await Promise.all([G9(t),j9(t),z9(t),H9()]);s||o({identity:u,daemon:l,skills:f,uploadDirs:h})})(),()=>{s=!0}},[]),r?r.identity.state==="logged_out"?(0,V9.jsx)(q9,{cliVersion:e,onSelect:s=>{n(s),i()}}):(0,V9.jsx)(U0,{cliVersion:e,initialData:r,onSelect:n}):null}async function eet(){let e="quit";return await sl((0,V9.jsx)(Cen,{cliVersion:_u(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:Ien[e]}}m();await pb();m();await Ao();var FM=ue(dn(),1);await xA();await DA();ks();m();await Ao();await Lle();await xA();await mb();await DA();await Fle();m();await Ao();ks();var d1=ue(jt(),1),ven="\u2588",Ren="\u2591";function tet({value:e,width:t=24,label:n,color:r=Re.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),s=Math.max(0,t-i);return(0,d1.jsxs)(Ee,{children:[(0,d1.jsx)(he,{color:r,children:ven.repeat(i)}),(0,d1.jsx)(he,{color:Re.muted,children:Ren.repeat(s)}),n?(0,d1.jsxs)(he,{color:Re.muted,children:[" ",n]}):null]})}await Ab();await gb();await Ule();await qle();await Kle();m();await Ao();await xA();await mb();await DA();await Ab();ks();var go=ue(jt(),1),ret=[{key:"resolving_session",label:"Resolving session"},{key:"uploading",label:"Uploading transcript"},{key:"parsing",label:"Parsing on server"},{key:"updating_visibility",label:"Updating visibility"},{key:"resolving_highlight",label:"Resolving highlight"}];function PM(){return{steps:ret.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function K9(e,t){return t.kind==="completed"?{...e,result:{url:t.url,reused:t.reused,visibility:t.visibility,clipboardCopied:t.clipboardCopied,sessionId:t.sessionId}}:t.kind==="error"?{...e,errorMessage:t.message,steps:e.steps.map(n=>n.status==="active"?{...n,status:"pending"}:n)}:t.step==="done"||t.step==="errored"?{...e,steps:e.steps.map(n=>({...n,status:n.status==="active"?"done":n.status}))}:{...e,steps:e.steps.map(n=>n.key===t.step?{...n,status:"active",label:t.label?`${net(n.key)} (${t.label})`:net(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function net(e){return ret.find(t=>t.key===e)?.label??e}function Nh({title:e,subtitle:t,state:n}){return(0,go.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,go.jsx)(Ps,{title:e,subtitle:t}),(0,go.jsx)(Qn,{title:"Pipeline",children:(0,go.jsx)(Ee,{flexDirection:"column",children:n.steps.map(r=>(0,go.jsx)(xen,{step:r},r.key))})}),n.result?(0,go.jsx)(Ee,{marginTop:1,flexDirection:"column",children:(0,go.jsx)(Ms,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,go.jsxs)(Ee,{flexDirection:"column",children:[(0,go.jsx)(he,{children:n.result.url}),(0,go.jsx)(Ee,{marginTop:1,children:(0,go.jsxs)(he,{color:Re.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,go.jsx)(Ee,{marginTop:1,children:(0,go.jsx)(Ms,{kind:"error",title:"Failed",children:(0,go.jsx)(he,{children:n.errorMessage})})}):null]})}function xen({step:e}){return e.status==="active"?(0,go.jsxs)(Ee,{children:[(0,go.jsx)(za,{}),(0,go.jsx)(he,{children:" "}),(0,go.jsx)(he,{color:Re.primary,children:e.label})]}):e.status==="done"?(0,go.jsxs)(Ee,{children:[(0,go.jsx)(he,{color:Re.success,children:"\u2713 "}),(0,go.jsx)(he,{color:Re.muted,children:e.label})]}):(0,go.jsxs)(Ee,{children:[(0,go.jsx)(he,{color:Re.muted,children:"\u25CB "}),(0,go.jsx)(he,{color:Re.muted,children:e.label})]})}ks();m();var MM=Date.parse("2026-05-16T12:00:00.000Z");function LM(e){return new Date(MM-e*6e4).toISOString()}var Yf={plist:"/Users/alex/Library/LaunchAgents/ai.tanagram.lore.plist",binary:"/Users/alex/.lore/bin/lore-background",logFile:"/Users/alex/.lore/cli.log.txt",status:"/Users/alex/.lore/status.json",installSource:"/opt/homebrew/bin/lore"},oet=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:MM-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:MM-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:MM-180*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:MM-1560*6e4}],Den=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],p1={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:Yf.plist,binary_path:Yf.binary,status_path:Yf.status,install_source_path:Yf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:LM(60),last_heartbeat_at:LM(1),last_success_at:LM(5),last_completed_at:LM(5),last_thread_ids:["thr_01hx_story"]}},iet={...p1,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...p1.status,state:"error",last_heartbeat_at:LM(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},Nen={...p1,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},Ben={state:"ready",userId:"user_alex",email:"alex@tanagram.ai",displayName:"Alex Rivera",organizations:[{id:"org_tanagram",name:"Tanagram"},{id:"org_acme",name:"Acme"}],activeOrganizationId:"org_tanagram",activeOrganizationName:"Tanagram"},UM={identity:Ben,daemon:{state:"ready",report:p1},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:Den,repo:[]}},set={...UM,uploadDirs:{state:"ready",cwd:[],repo:[]}},aet={...UM,daemon:{state:"error",message:"launchctl print failed: service not found"}},uet={...UM,daemon:{state:"unsupported",platform:"linux"}},cet={identity:{state:"logged_out"},daemon:{state:"ready",report:Nen},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},det=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var yt=ue(jt(),1),ro=()=>{};function Q0(...e){return e.reduce(S$,VP())}function QM(...e){return e.reduce(K9,PM())}var LA=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,yt.jsx)(q9,{cliVersion:"0.1.0",onSelect:ro})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,yt.jsx)(Dp,{state:VP()})},{id:"onboarding/login/device-code",title:"Login / device code",path:["TUI","Screens","Onboarding","Login"],description:"User has a WorkOS code and browser URL.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"})})},{id:"onboarding/login/awaiting-authorization",title:"Login / awaiting authorization",path:["TUI","Screens","Onboarding","Login"],description:"Browser is open and polling is active.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"waiting_for_authorization"})})},{id:"onboarding/login/auto-enable",title:"Login / auto-enable in progress",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded and launchd install is running.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"})})},{id:"onboarding/login/success",title:"Login / success",path:["TUI","Screens","Onboarding","Login"],description:"Signed in and background uploads enabled.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_succeeded",plistPath:Yf.plist,binaryPath:Yf.binary,logFile:Yf.logFile})})},{id:"onboarding/login/auto-enable-failed",title:"Login / auto-enable failed",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded but the daemon install needs a retry.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_failed"})})},{id:"onboarding/login/denied",title:"Login / denied",path:["TUI","Screens","Onboarding","Login"],description:"Terminal authorization failure state.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"authorization_denied"})})},{id:"onboarding/login/api-unreachable",title:"Login / API unreachable",path:["TUI","Screens","Onboarding","Login"],description:"Early failure before WorkOS device-code negotiation.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"login_failed",message:"Could not reach the Lore API at http://localhost:4000. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared."})})},{id:"onboarding/login/already-signed-in",title:"Login / already signed in",path:["TUI","Screens","Onboarding","Login"],description:"Short-circuit copy for authenticated callers.",render:()=>(0,yt.jsx)(Dp,{state:Q0({kind:"already_logged_in"})})},{id:"onboarding/configure-upload-repos/loading",title:"Configure upload repos / loading",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Recent Claude Code cwd discovery is in flight.",render:()=>(0,yt.jsx)(wA,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/choose",title:"Configure upload repos / choose",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Suggested git remotes with defaults checked.",render:()=>(0,yt.jsx)(wA,{state:{phase:"choose",suggestions:oet,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/empty",title:"Configure upload repos / empty",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"No recent sessions, with add-custom affordance.",render:()=>(0,yt.jsx)(wA,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,yt.jsx)(wA,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/saved",title:"Configure upload repos / saved",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save for multiple repos.",render:()=>(0,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/skipped",title:"Configure upload repos / skipped",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save with zero selected repos.",render:()=>(0,yt.jsx)(wA,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:ro,onSkip:ro})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,yt.jsx)(wA,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:ro,onSkip:ro})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:UM,onSelect:ro})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:set,onSelect:ro})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:aet,onSelect:ro})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:uet,onSelect:ro})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,yt.jsx)(U0,{cliVersion:"0.1.0",initialData:cet,onSelect:ro})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:PM()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:QM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading",label:"42%"})})},{id:"sharing/parsing",title:"Share flow / parsing",path:["TUI","Screens","Sharing"],description:"Server-side parsing is active.",render:()=>(0,yt.jsx)(Nh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:QM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing",label:"queued"})})},{id:"sharing/shared",title:"Share flow / shared",path:["TUI","Screens","Sharing"],description:"New share completed and copied to clipboard.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-codex",state:QM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing"},{kind:"step",step:"updating_visibility"},{kind:"step",step:"done"},{kind:"completed",url:"https://lore.link/thread/thr_01hx_story",reused:!1,visibility:"workspace",clipboardCopied:!0,sessionId:"thr_01hx_story"})})},{id:"sharing/already-shared",title:"Share flow / already shared",path:["TUI","Screens","Sharing"],description:"Deduped upload converges to an existing Lore thread.",render:()=>(0,yt.jsx)(Nh,{title:"lore share-cowork",state:QM({kind:"completed",url:"https://lore.link/thread/thr_01hx_story",reused:!0,visibility:"private",clipboardCopied:!1})})},{id:"sharing/error",title:"Share flow / error",path:["TUI","Screens","Sharing"],description:"Pipeline error callout.",render:()=>(0,yt.jsx)(Nh,{title:"lore export",state:QM({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"error",message:"presigned upload failed: HTTP 403"})})},{id:"daemon/run/enable-progress",title:"Daemon run / enable progress",path:["TUI","Screens","Daemon","Run"],description:"Enable command while launchd work is active.",render:()=>(0,yt.jsx)(L0,{mode:"enable",state:{phase:"in_progress"}})},{id:"daemon/run/enable-success",title:"Daemon run / enable success",path:["TUI","Screens","Daemon","Run"],description:"Enable success includes resolved paths.",render:()=>(0,yt.jsx)(L0,{mode:"enable",state:{phase:"finished",result:{plistPath:Yf.plist,binaryPath:Yf.binary,logFile:Yf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,yt.jsx)(L0,{mode:"disable",state:{phase:"finished"}})},{id:"daemon/run/restart-success",title:"Daemon run / restart success",path:["TUI","Screens","Daemon","Run"],description:"Restart success copy.",render:()=>(0,yt.jsx)(L0,{mode:"restart",state:{phase:"finished"}})},{id:"daemon/run/error",title:"Daemon run / error",path:["TUI","Screens","Daemon","Run"],description:"Mode-independent daemon command error.",render:()=>(0,yt.jsx)(L0,{mode:"restart",state:{phase:"errored",errorMessage:"launchctl bootstrap failed"}})},{id:"daemon/status/healthy",title:"Daemon status / healthy",path:["TUI","Screens","Daemon","Status"],description:"Healthy daemon report.",render:()=>(0,yt.jsx)(NM,{report:p1})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,yt.jsx)(NM,{report:iet})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,yt.jsx)(Ps,{title:"lore",subtitle:"component primitive",right:"v0.1.0"})},{id:"components/primitives/panel",title:"Components / panel",path:["TUI","Components","Primitives"],description:"Bordered container with title, subtitle, and focus styling.",render:()=>(0,yt.jsx)(Qn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,yt.jsx)(he,{color:Re.muted,children:"Panels compose screen sections and callouts."})})},{id:"components/primitives/status-line",title:"Components / status line",path:["TUI","Components","Primitives"],description:"Key/value rows with severity dots.",render:()=>(0,yt.jsxs)(Qn,{title:"StatusLine",children:[(0,yt.jsx)(an,{label:"Healthy",value:"yes",kind:"success"}),(0,yt.jsx)(an,{label:"Warning",value:"needs attention",kind:"warning"}),(0,yt.jsx)(an,{label:"Error",value:"launchctl failed",kind:"error"})]})},{id:"components/primitives/progress-bar",title:"Components / progress bar",path:["TUI","Components","Primitives"],description:"Plain unicode progress bar for deterministic terminal rendering.",render:()=>(0,yt.jsx)(Qn,{title:"ProgressBar",children:(0,yt.jsx)(tet,{value:.62,label:"62%"})})},{id:"components/primitives/message-box",title:"Components / message box",path:["TUI","Components","Primitives"],description:"Severity callout for success, info, warning, and error copy.",render:()=>(0,yt.jsxs)(Ee,{flexDirection:"column",children:[(0,yt.jsx)(Ms,{kind:"success",title:"Shared",children:(0,yt.jsx)(he,{children:"Copied the Lore URL to your clipboard."})}),(0,yt.jsx)(Ee,{marginTop:1,children:(0,yt.jsx)(Ms,{kind:"error",title:"Failed",children:(0,yt.jsx)(he,{color:Re.muted,children:"presigned upload failed: HTTP 403"})})})]})},{id:"components/primitives/spinner",title:"Components / spinner",path:["TUI","Components","Primitives"],description:"Unrefed animated spinner primitive.",render:()=>(0,yt.jsx)(Qn,{title:"Spinner",children:(0,yt.jsx)(za,{label:"working on a terminal-friendly task\u2026"})})},{id:"components/inputs/menu",title:"Components / menu",path:["TUI","Components","Inputs"],description:"Keyboard menu with enabled and disabled items.",render:()=>(0,yt.jsx)(Qn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,yt.jsx)(l1,{items:[{id:"share",label:"Share",description:"upload a session"},{id:"status",label:"Status",description:"inspect daemon"},{id:"disabled",label:"Disabled",description:"not available in this state",disabled:!0}],onSelect:ro})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,yt.jsx)(Qn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,yt.jsx)($P,{items:[{id:"repo",label:"/Users/alex/code/tanagram-lore",initialChecked:!0},{id:"demo",label:"/Users/alex/code/customer-demo"},{id:"add",label:"+ Add a custom path\u2026",action:!0}],onSubmit:ro,onAction:ro})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,yt.jsx)(Qn,{title:"TextInput",children:(0,yt.jsx)(g$,{initialValue:"~/code",onSubmit:ro,onCancel:ro})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,yt.jsx)(Qn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,yt.jsx)(h$,{initialValue:"/Users/alex/code",loadSuggestions:async()=>det,onSubmit:ro,onCancel:ro})})}];function pet(e){return LA.find(t=>t.id===e)}function f1(e){return e.path.slice(1).join(" / ")}var Fr=ue(jt(),1);function met({initialStoryId:e}){let t=Math.max(0,LA.findIndex(f=>f.id===e)),[n,r]=(0,FM.useState)(t),[o,i]=(0,FM.useState)("sidebar"),s=(0,FM.useRef)(o);s.current=o;let{exit:u}=ws();xu((f,h)=>{if(h.ctrl&&f==="c"){u();return}if(s.current==="sidebar"&&f==="q"){u();return}if(h.escape){if(s.current==="preview"){s.current="sidebar",i("sidebar");return}u();return}if(s.current==="preview"&&h.tab&&h.shift){s.current="sidebar",i("sidebar");return}if(s.current==="sidebar"&&h.tab&&!h.shift){s.current="preview",i("preview");return}if(s.current==="sidebar"){if(h.upArrow||f==="k"){r(_=>fet(_-1));return}(h.downArrow||f==="j")&&r(_=>fet(_+1))}});let l=LA[n]??LA[0];return(0,Fr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Fr.jsx)(Ps,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${LA.length}`}),(0,Fr.jsx)(Ee,{marginBottom:1,children:(0,Fr.jsx)(he,{color:Re.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,Fr.jsxs)(Ee,{flexDirection:"row",gap:2,children:[(0,Fr.jsx)(Ee,{width:36,flexShrink:0,children:(0,Fr.jsx)(Qn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,Fr.jsx)(wen,{stories:LA,selectedIndex:n,focused:o==="sidebar"})})}),(0,Fr.jsx)(Ee,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,Fr.jsx)(Qn,{title:l.title,focused:o==="preview",subtitle:o==="preview"?`${f1(l)} \xB7 focused`:f1(l),children:(0,Fr.jsxs)(Ee,{flexDirection:"column",children:[(0,Fr.jsx)(he,{color:Re.muted,children:l.description}),o==="sidebar"?(0,Fr.jsxs)(he,{color:Re.muted,children:["Press ",(0,Fr.jsx)(he,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,Fr.jsx)(Ee,{marginTop:1,children:l.render()})]})})})]})]})}function wen({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,s)=>{let u=i.path.slice(1),l=Len(o,u);for(let f=l;f<u.length;f++)r.push((0,Fr.jsx)(Oen,{label:u[f]??"",level:f,marginTop:Men(u[f]??"",f,l),focused:n},`group:${u.slice(0,f+1).join("/")}`));r.push((0,Fr.jsx)(ken,{story:i,selected:s===t,focused:n},i.id)),o=u}),(0,Fr.jsx)(Ee,{flexDirection:"column",children:r})}function Oen({label:e,level:t,marginTop:n,focused:r}){return(0,Fr.jsx)(Ee,{marginLeft:Aet(t),marginTop:n,children:(0,Fr.jsx)(he,{color:r?Re.primary:Re.muted,bold:r,wrap:"truncate-end",children:e})})}function ken({story:e,selected:t,focused:n}){let r=n?t?Re.accent:Re.highlight:Re.muted;return(0,Fr.jsxs)(Ee,{marginLeft:Aet(e.path.slice(1).length),children:[(0,Fr.jsx)(he,{color:n&&t?Re.accent:Re.muted,children:t?"\u203A ":" "}),(0,Fr.jsx)(he,{color:r,bold:n&&t,wrap:"truncate-end",children:Pen(e)})]})}function Pen(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function Aet(e){return Math.min(e,4)}function Men(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Len(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function fet(e){let t=LA.length;return(e%t+t)%t}function get({story:e}){let{exit:t}=ws();return xu((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,Fr.jsxs)(Ee,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Fr.jsx)(Ps,{title:e.title,subtitle:f1(e),right:"Esc to exit"}),(0,Fr.jsx)(Ee,{marginBottom:1,children:(0,Fr.jsx)(he,{color:Re.muted,children:e.description})}),e.render()]})}var ife=ue(jt(),1),het={meta:{name:"tui:stories",description:"Open the terminal story runner for Ink TUI screens.",hidden:!0,skipAutoupdate:!0},args:{story:{type:"string",description:"Open a specific story id."},list:{type:"boolean",description:"Print story ids instead of opening the runner."}},async run({args:e}){if(e.list||!process.stdin.isTTY||!process.stdout.isTTY){Uen();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=pet(e.story.trim());if(!n){console.error(`Unknown TUI story: ${e.story}`),console.error("Run `lore tui:stories --list` to see available ids."),process.exitCode=1;return}await sl((0,ife.jsx)(get,{story:n})).waitUntilExit();return}await sl((0,ife.jsx)(met,{})).waitUntilExit()}};function Uen(){for(let e of LA)console.log(`${e.id} ${f1(e)} ${e.title}`)}m();Bn();s0();m();await Ao();var J9=ue(dn(),1);await pb();var sfe=ue(jt(),1);function Qen({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,s]=(0,J9.useState)(PM),{exit:u}=ws();return(0,J9.useEffect)(()=>{let l=!1,f=h=>{l||s(_=>K9(_,h))};return(async()=>{try{let h=await n(f);if(l)return;r(h),setTimeout(()=>u(),100)}catch(h){if(f({kind:"error",message:h instanceof Error?h.message:String(h)}),l)return;o(h),setTimeout(()=>u(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{l=!0}},[]),(0,sfe.jsx)(Nh,{title:e,subtitle:t,state:i})}async function m1(e){let t,n,r=!1;if(await sl((0,sfe.jsx)(Qen,{title:e.title,subtitle:e.subtitle,perform:e.perform,onResolve:i=>{t=i,r=!0},onReject:i=>{n=i}})).waitUntilExit(),!r)throw n instanceof Error?n:new Error(String(n??"share flow failed"));return t}m();WR();Pr();import utn from"node:os";import Met from"node:path";m();import{spawn as Fen}from"node:child_process";import Gen from"node:os";async function _et(e,t={}){let n=t.timeoutMs??2e3,r=jen();for(let o of r)if(await zen(o,e,n))return!0;return!1}function jen(){switch(Gen.platform()){case"darwin":return[{name:"pbcopy",args:[]}];case"linux":return[{name:"wl-copy",args:[]},{name:"xclip",args:["-selection","clipboard"]},{name:"xsel",args:["--clipboard","--input"]}];case"win32":return[{name:"clip.exe",args:[]}];default:return[]}}async function zen(e,t,n){return new Promise(r=>{let o;try{o=Fen(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,s=l=>{i||(i=!0,r(l))},u=setTimeout(()=>{o.kill("SIGKILL"),s(!1)},n);o.on("error",()=>{clearTimeout(u),s(!1)}),o.on("close",l=>{clearTimeout(u),s(l===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}on();Bn();FP();m();import dl from"node:fs/promises";import xet from"node:os";import fs from"node:path";m();m();import Hen from"node:os";import Eet from"node:path";function yet(e){return e.replace(/[^A-Za-z0-9_-]/g,"-")}function Tet(e=Hen.homedir(),t=process.env.CLAUDE_CONFIG_DIR){let n=t?.trim();return n?Eet.join(n,"projects"):Eet.join(e,".claude","projects")}m();import ll from"node:fs";import $en from"node:os";import vb from"node:path";var afe="local-agent-mode-sessions",ufe=["audit.jsonl","transcript.jsonl"];function bet(e=$en.homedir()){return vb.join(e,"Library","Application Support","Claude",afe)}function Iet(e){if(!ll.existsSync(e))return[];let t=[];for(let n of ll.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=vb.join(e,n.name);for(let o of ll.readdirSync(r,{withFileTypes:!0})){if(!o.isDirectory())continue;let i=vb.join(r,o.name);for(let s of ll.readdirSync(i,{withFileTypes:!0})){if(!s.isDirectory()||!s.name.startsWith("local_"))continue;let u=s.name.replace(/^local_/,"");if(!u)continue;let l=vb.join(i,s.name),f=W9(l),h=f?ll.statSync(f):ll.statSync(l);t.push({accountId:n.name,orgId:o.name,sessionId:u,sessionDir:i,localDir:l,mtimeMs:h.mtimeMs})}}}return t.sort((n,r)=>r.mtimeMs-n.mtimeMs),t}function Z9(e){if(!ll.existsSync(e))return null;let t=null;for(let n of ll.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory()||!n.name.startsWith("local_"))continue;let r=vb.join(e,n.name),o=W9(r),i=o!==null,s=o?ll.statSync(o).mtimeMs:ll.statSync(r).mtimeMs;(t===null||i&&!t.hasTranscript||i===t.hasTranscript&&s>t.mtimeMs)&&(t={dir:r,mtimeMs:s,hasTranscript:i})}return t?.dir??null}function W9(e){for(let t of ufe){let n=vb.join(e,t);if(ll.existsSync(n)&&ll.statSync(n).isFile())return n}return null}function cfe(e,t){let n=vb.join(e,t);return ll.existsSync(n)?ll.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}on();l$();Bn();Ga();Th();m();on();import{createReadStream as qen}from"node:fs";import Ven from"node:fs/promises";import{createInterface as Yen}from"node:readline";var Ken=50;async function Cet(e,t={}){let n=t.maxLines??Ken;try{await Ven.stat(e)}catch(o){if(kr(o,"ENOENT"))return null;throw o}let r=qen(e,{encoding:"utf8"});return await new Promise((o,i)=>{let s=!1,u=0,l=_=>{s||(s=!0,f.close(),r.destroy(),o(_))},f=Yen({input:r,crlfDelay:Number.POSITIVE_INFINITY});f.on("line",_=>{if(s)return;let y=_.trim();if(y){u+=1;try{let T=JSON.parse(y);if(typeof T=="object"&&T!==null&&"cwd"in T&&typeof T.cwd=="string"){let v=T.cwd.trim();if(v){l(v);return}}}catch{}u>=n&&l(null)}}),f.on("close",()=>l(null));let h=_=>{if(!s){if(s=!0,kr(_,"ENOENT")){o(null);return}i(_)}};f.on("error",h),r.on("error",h)})}var Jen=3600*1e3,Zen=336*60*60*1e3,X9=Symbol("missingSessionID"),Det={name:"claudeCode",historyFilePath:eq,readUnuploadedEntries:Net,collectLocalFiles:etn,buildPendingTranscriptWatches:ttn};async function Net(e){let t=eq(),n=Date.now()-Zen,r;try{r=await dl.readdir(t,{withFileTypes:!0})}catch(i){if(kr(i,"ENOENT"))return[];throw new Error(`readdir ${t}: ${String(i)}`)}let o=[];for(let i of r){if(!i.isDirectory())continue;let s=fs.join(t,i.name),u;try{u=await dl.readdir(s,{withFileTypes:!0})}catch{continue}for(let l of u){if(!l.isFile()||!l.name.endsWith(".jsonl"))continue;let f=fs.join(s,l.name),h;try{h=await dl.stat(f)}catch{continue}!h.isFile()||h.mtimeMs<n||o.push({sessionId:l.name.slice(0,-6),project:"",timestamp:h.mtimeMs,resolvedTranscriptPath:f})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}async function Bet(){let e=new Map,t;try{t=await dl.readFile(S0(),"utf8")}catch{return e}for(let n of HP(t)){let r=n.sessionId?.trim(),o=n.project?.trim();r&&o&&!e.has(r)&&e.set(r,o)}return e}async function wet(e,t,n){let r=await Cet(e);return r||((await n()).get(t)??null)}async function Wen(){let e=S0(),t;try{t=await dl.readFile(e,"utf8")}catch(n){if(kr(n,"ENOENT"))return[];throw n}return HP(t,e)}async function Oet(e){let t=await Wen(),n=e.sessionId.trim();if(n){for(let u=t.length-1;u>=0;u-=1){let l=t[u];if(l?.sessionId?.trim()===n)return l}let s=await Xen(n);if(s){let u=e.project.trim()||process.cwd();return{sessionId:n,project:u,timestamp:s.mtimeMs,resolvedTranscriptPath:s.fullPath}}throw new De(`no history entry or transcript file found for session-id "${n}" \u2014 check ~/.claude/history.jsonl and ~/.claude/projects/`)}let r=fs.normalize(e.project.trim());if(!r)throw new De("export requires either --session-id or a project path");let o=await PD(r),i=[...t].sort((s,u)=>u.timestamp-s.timestamp);for(let s of i){if(!s.sessionId?.trim())continue;let u=fs.normalize(s.project.trim());if(!u||u===".")continue;if(u===r)return s;if(!o)continue;let l=await PD(u);if(l&&l===o)return s}throw new De(`no history entry found for project "${r}" \u2014 pass --session-id to pick a specific session, or cd into the repo where the Claude Code session ran`)}async function Xen(e){let t=e.trim();if(!t)return null;let n=eq(),r;try{r=await dl.readdir(n,{withFileTypes:!0})}catch(o){if(kr(o,"ENOENT"))return null;throw new Error(`readdir ${n}: ${String(o)}`)}for(let o of r){if(!o.isDirectory())continue;let i=fs.join(n,o.name,`${t}.jsonl`);try{let s=await dl.stat(i);if(s.isFile())return{fullPath:i,mtimeMs:s.mtimeMs}}catch(s){if(!kr(s,"ENOENT")&&!kr(s,"ENOTDIR"))throw new Error(`stat ${i}: ${String(s)}`)}}return null}async function ket(e){let t=await lfe(e);if(t===X9)throw new Error("history entry is missing sessionId");return t}async function etn(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=null,f=async()=>(l??=await Bet(),l);try{for(let h=0;h<e.length;h+=1){let _=e[h],y=await lfe(_);if(y===X9){let V=`__missing_session__:${_.project}:${_.timestamp}:${h}`;r[h]=V,o.add(V),s.add(V);continue}if(r[h]=y.key,s.has(y.key))continue;let T=await Hi(y.fullPath);if(!T.exists){o.add(y.key),s.add(y.key);continue}if(t.isUnchanged?.(y.key,T)){o.add(y.key),s.add(y.key);continue}if(t.isThrottled?.(y.key)){i.add(y.key),s.add(y.key);continue}let v=_.project.trim()||await wet(y.fullPath,_.sessionId??"",f);if(!v){$.info("upload_filter_session_excluded",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:"<unresolved>",reason:"no_resolvable_cwd"}),o.add(y.key),s.add(y.key);continue}let R=await vp(v),x=null,O=async()=>(x!==null||(x=await dl.readFile(y.fullPath,"utf8")),x),P=await bh(t.uploadFilterConfig??vA(),{cwd:v,repoOriginPath:R,transcriptPath:y.fullPath,readTranscript:O});if(!P.shouldUpload){$.info("upload_filter_session_excluded",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:P.reason}),o.add(y.key),s.add(y.key);continue}$.info("upload_filter_session_included",{filename:y.relativeFilename,transcript_path:y.fullPath,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let j;try{j=await fd(y.fullPath)}catch(V){if(kr(V,"ENOENT")){o.add(y.key),s.add(y.key);continue}throw new Error(`read session transcript ${y.fullPath}: ${String(V)}`)}u.push(j.tempPath),n.push({key:y.key,filename:y.relativeFilename,sourcePath:y.fullPath,repoOriginPath:R,tempPath:j.tempPath,md5:j.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:_.sessionId?.trim()??"",watchedState:T}),s.add(y.key);let G=await dl.readFile(j.tempPath,"utf8"),H=itn(G);for(let V of H){let ae;try{ae=await stn(V)}catch{continue}let re=`${y.key}::plan:${ae}`;if(s.has(re))continue;let _e=await Hi(ae),Qe;try{Qe=await fd(ae)}catch(pt){if(kr(pt,"ENOENT"))continue;throw new Error(`read plan file ${ae}: ${String(pt)}`)}u.push(Qe.tempPath),n.push({key:re,filename:ae,sourcePath:ae,repoOriginPath:R,tempPath:Qe.tempPath,md5:Qe.md5,fileType:"plan",harness:"claudeCode",harnessInternalId:ae,watchedState:_e}),s.add(re)}}}catch(h){throw await Promise.all(u.map(_=>dl.rm(fs.dirname(_),{recursive:!0,force:!0}))),h}return{entries:e,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function ttn(e,t,n={}){let r=await Net(e),o=Date.now(),i=[],s=new Set,u=null,l=async()=>(u??=await Bet(),u);for(let f of r){let h=await lfe(f);if(h===X9||s.has(h.fullPath))continue;s.add(h.fullPath);let _=await Hi(h.fullPath);if(!_.exists)continue;let y=f.project.trim()||await wet(h.fullPath,f.sessionId??"",l);if(!y)continue;let T=await vp(y),v=await bh(n.uploadFilterConfig??vA(),{cwd:y,repoOriginPath:T,transcriptPath:h.fullPath,readTranscript:()=>dl.readFile(h.fullPath,"utf8")},{ignoreSkillRules:!0});if(!v.shouldUpload){$.info("upload_filter_watch_excluded",{filename:h.relativeFilename,transcript_path:h.fullPath,cwd:y,repo_origin_path:T||"<none>",reason:v.reason});continue}i.push({sessionId:f.sessionId?.trim()??"",project:y,transcriptPath:h.fullPath,expiresAt:new Date(o+Jen),baseline:t.get(h.fullPath)??_})}return i.sort((f,h)=>f.transcriptPath.localeCompare(h.transcriptPath))}async function lfe(e){let t=e.sessionId?.trim();if(!t)return X9;let n=eq(),r=e.resolvedTranscriptPath?.trim();if(r){let s=fs.relative(n,r).split(fs.sep).join("/");return{fullPath:r,relativeFilename:s,key:s}}let o=await ntn(e.project),i=null;for(let s of o){let u=rtn(s),l=fs.posix.join(u,`${t}.jsonl`),f=fs.join(n,...l.split("/")),h={fullPath:f,relativeFilename:l,key:l};i??=h;try{return await dl.stat(f),h}catch(_){if(!kr(_,"ENOENT"))throw new Error(`stat session transcript ${f}: ${String(_)}`)}}if(!i)throw new Error("history entry is missing project path");return i}async function ntn(e){let t=fs.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");let n=[t],r=await PD(t);if(!r||r===t)return n;for(let o=fs.dirname(t);o!==t&&(n.push(o),o!==r);)t=o,o=fs.dirname(o);return n}function rtn(e){let t=fs.normalize(e.trim());if(!t||t===".")throw new Error("history entry is missing project path");return yet(t)}function eq(){return Tet()}function otn(){return fs.join(xet.homedir(),".claude","plans")}function itn(e){let t=[],n=new Set;for(let r of e.split(`
|
|
696
696
|
`)){let o=r.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch{break}if(i.type!=="assistant")continue;let s=i.message?.content;if(Array.isArray(s))for(let u of s){if(!Ret(u)||u.type!=="tool_use"||u.name!=="ExitPlanMode"||!Ret(u.input))continue;let l=u.input.planFilePath;if(typeof l!="string")continue;let f=l.trim();!f||n.has(f)||(t.push(f),n.add(f))}}return t}async function stn(e){let t=e.trim();if(!t)throw new Error("plan file path is empty");let n=otn(),r=n;try{r=await dl.realpath(n)}catch{}if(t.startsWith("~/")&&(t=fs.join(xet.homedir(),t.slice(2))),!fs.isAbsolute(t))throw new Error(`plan file path must stay under ${n}`);if(t=fs.normalize(t),!vet(t,n))throw new Error(`plan file path must stay under ${n}`);try{let o=await dl.realpath(t);if(!vet(o,r))throw new Error(`plan file path must resolve under ${n}`)}catch(o){if(!kr(o,"ENOENT"))throw o}return t}function vet(e,t){let n=fs.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${fs.sep}`)}function Ret(e){return e!==null&&typeof e=="object"}Th();m();var A1=()=>{};m();Bn();async function atn(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw Np(`resolve share highlight for thread ${t}`,r.status,r.body);return{url:r.body.url,matched:r.body.matched,start_block_id:r.body.start_block_id,end_block_id:r.body.end_block_id}}async function tq(e,t,n){try{return await atn(e,t,n)}catch(r){return $.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}m();on();function Pet(e){if(e instanceof $x)return"billing_required";if(e instanceof YP)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof De)return"validation_failed";if(e instanceof Error){let t=e.message.toLowerCase();if(t.includes("not logged in")||t.includes("unauthorized")||t.includes("unauthenticated")||t.includes("authentication failed")||t.includes("authentication required")||t.includes("auth required")||t.includes("bearer token"))return"auth_failed";if(t.includes("timed out waiting for thread")&&t.includes("parsing")||t.includes("parse timeout"))return"parsing_timeout";if(t.includes("parsing failed permanently"))return"parsing_failed";if(t.includes("econnrefused")||t.includes("econnreset")||t.includes("etimedout")||t.includes("enotfound")||t.includes("network"))return"network_failed"}return"unknown"}var ctn=new Set(["private","workspace","public"]);function ltn(e){let t=(e??"").trim();if(!t)return"";if(!ctn.has(t))throw new De(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function dfe(e={}){let t=e.progress??A1,n=ltn(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",s=null;try{t({kind:"step",step:"resolving_session"});let u=await Oet({sessionId:o,project:r});i="auth",await Atn();let l=e.client??Gt();i="collecting_local_file",s=await dtn(u),t({kind:"step",step:"uploading",label:s.filename}),i="uploading";let f=await ptn(l,s);if(f.quarantined)return t({kind:"step",step:"done"}),{quarantined:!0,reason:f.reason,finding_count:f.findingCount,session_id:u.sessionId?.trim()??""};let{reused:h,thread:_}=f;$.info("export_upload_single_file_result",{filename:s.filename,reused:h,response:JSON.stringify(_)});let y=_?.id?.trim();if(!y)throw Wn().setContext("upload_single_file_response",{filename:s.filename,reused:h,response:_}),new Error(`upload session response missing thread id for ${s.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await VD(l,y);let T=_?.visibility?.trim()??"",v=T;n&&n!==T&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),v=await ftn(l,y,n));let R=mtn(y),x,O=e.highlight?.trim();if(O){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let j=await tq(l,y,O);j&&(R=j.url,x={query:O,matched:j.matched,start_block_id:j.start_block_id,end_block_id:j.end_block_id})}let P=await _et(R);return t({kind:"completed",url:R,reused:h,visibility:v,clipboardCopied:P,sessionId:u.sessionId?.trim()??""}),t({kind:"step",step:"done"}),Ch("lore.cli.thread_exported",{thread_id:y,harness:s.harness,visibility:v,reused:h}),{thread_id:y,url:R,session_id:u.sessionId?.trim()??"",project:u.project,reused:h,visibility:v,clipboard_copied:P,...x?{highlight:x}:{}}}catch(u){throw Ch("lore.cli.upload_failed",{error_category:Pet(u),error_message:ln(u),step:i}),u}finally{s&&await wp(s.tempPath)}}async function dtn(e){let t=await ket(e),n=await Hi(t.fullPath);if(!n.exists)throw new De(`session transcript not found at ${gtn(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await vp(e.project),o=await fd(t.fullPath);return{key:t.key,filename:t.relativeFilename,sourcePath:t.fullPath,repoOriginPath:r,tempPath:o.tempPath,md5:o.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:e.sessionId?.trim()??"",watchedState:n}}async function ptn(e,t){let[n]=await MA(e,[t]);if(!n)throw new Error("upload session response missing thread file");if(n.status==="quarantined")return{quarantined:!0,reason:n.reason,findingCount:n.findingCount};if(n.status==="no_upload"){let r=n.error?.trim()?`: ${n.error.trim()}`:"";throw new De(`upload session for ${t.filename} returned no upload URL and no reusable thread${r}`)}return{quarantined:!1,reused:n.status==="deduped",thread:n.thread}}async function ftn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Np(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function mtn(e){return`${C0().replace(/\/+$/,"")}/thread/${e}`}async function Atn(){let e=await sn();if(!e)throw new De("not logged in \u2014 run 'lore login' first");return e}function gtn(e){let t=utn.homedir();if(!t)return e;let n=Met.relative(t,e);return!n||n.startsWith("..")?e:Met.join("~",n)}var Let={meta:{name:"export",description:"Upload a single Claude Code session to Lore and print its URL"},args:{"session-id":{type:"string",description:"Claude Code session ID to export. Defaults to the most recent session for $PWD."},project:{type:"string",description:"Project path used to resolve a session when --session-id is not provided. Defaults to the current working directory."},visibility:{type:"string",description:"Set thread visibility: private, workspace, or public. Defaults to leaving the existing visibility untouched."},highlight:{type:"string",description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e,data:t}){$.info("command_start",{command:"export"});let n={sessionId:typeof e["session-id"]=="string"?e["session-id"]:void 0,project:typeof e.project=="string"?e.project:void 0,visibility:typeof e.visibility=="string"?e.visibility:void 0,highlight:typeof e.highlight=="string"?e.highlight:void 0,client:t?.client};if(vu()&&!t?.progress){let o=await m1({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:i=>dfe({...n,progress:i})});"quarantined"in o&&o.quarantined&&console.log(`
|
|
697
|
-
Held locally \u2014 not uploaded. ${o.finding_count} finding(s); reason: ${o.reason}. See \`lore quarantine\`.`);return}let r=await dfe({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};m();m();i0();Pr();sc();on();Bn();Ga();LD();var htn=5,_tn=1e3;async function Qet(e={}){(e.environment??Kr())!=="dev"||!await Etn({fetchFn:e.fetchFn})||await ytn({client:e.client})}async function Etn(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return $.warn("dev_preflight_no_email",{hint:"set LORE_DEV_CLI_USER_EMAIL in .env.local (run `pnpm bootstrap`) to auto-authenticate the dev uploader"}),!1;let n=e.fetchFn??globalThis.fetch,r=e.attempts??htn,o=e.retryDelayMs??_tn,i=`${cd()}/api/cli-auth/dev-token`;for(let s=1;s<=r;s+=1)try{let u=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(u.status===404){let f=await Uet(u);return dh(),$.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f,url:i}),!1}if(!u.ok){let f=await Uet(u);return dh(),$.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f}),!1}let l=await u.json();return l.access_token?(bje(l.access_token),$.info("dev_preflight_token_minted",{email:t,expiresIn:l.expires_in}),!0):(dh(),$.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(u){if(s===r)return dh(),$.warn("dev_preflight_token_unreachable",{url:i,error:ln(u)}),!1;await Stn(o)}return!1}async function ytn(e={}){await Ih();let t=await Ho();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=ji(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Gt();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){$.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){$.warn("dev_preflight_whoami_error",{error:ln(o)});return}await pd({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),$.info("dev_preflight_upload_dir_seeded",{path:n})}async function Uet(e){try{let t=await e.json(),n=t.message??t.error;return typeof n=="string"?n:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}function Stn(e){return new Promise(t=>{setTimeout(t,e)})}m();t$();Pr();Bn();Ga();import{setTimeout as Jet}from"node:timers/promises";m();on();Bn();Ga();import{createReadStream as Ttn}from"node:fs";import F0 from"node:fs/promises";import btn from"node:os";import Kf from"node:path";import{createInterface as Itn}from"node:readline";Th();var Ctn=3600*1e3,Get={name:"codex",historyFilePath:pfe,readUnuploadedEntries:jet,collectLocalFiles:Rtn,buildPendingTranscriptWatches:xtn};function pfe(){return process.env.LORE_CODEX_SESSIONS_DIR??Kf.join(btn.homedir(),".codex","sessions")}async function jet(e){let t=pfe(),n;try{n=await F0.readdir(t,{withFileTypes:!0})}catch(o){if(kr(o,"ENOENT"))return[];throw o}let r=[];for(let o of n){if(!o.isDirectory())continue;let i=Kf.join(t,o.name),s;try{s=await F0.readdir(i,{withFileTypes:!0})}catch{continue}for(let u of s){if(!u.isDirectory())continue;let l=Kf.join(i,u.name),f;try{f=await F0.readdir(l,{withFileTypes:!0})}catch{continue}for(let h of f){if(!h.isDirectory())continue;let _=Kf.join(l,h.name),y;try{y=await F0.readdir(_,{withFileTypes:!0})}catch{continue}for(let T of y){if(!T.isFile()||!T.name.startsWith("rollout-")||!T.name.endsWith(".jsonl"))continue;let v=Kf.join(_,T.name),R;try{R=await F0.stat(v)}catch{continue}if(R.mtimeMs<=e)continue;let x=await vtn(v);x!==null&&r.push({timestamp:R.mtimeMs,sessionId:x.id,project:x.cwd,transcriptPath:v})}}}}return r.sort((o,i)=>o.timestamp-i.timestamp)}async function vtn(e){let t,n=Ttn(e,{encoding:"utf8"});try{t=await new Promise((u,l)=>{let f=Itn({input:n,crlfDelay:Number.POSITIVE_INFINITY}),h=!1;f.on("line",_=>{if(h)return;let y=_.trim();y&&(h=!0,f.close(),n.destroy(),u(y))}),f.on("close",()=>{h||u("")}),f.on("error",l),n.on("error",l)})}finally{n.destroy()}if(!t)return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"empty_first_line"}),null;let r;try{r=JSON.parse(t)}catch{return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"unparseable_json"}),null}if(!Fet(r))return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;if(r.type!=="session_meta")return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;let o=r.payload;if(!Fet(o))return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_payload"}),null;let i=typeof o.id=="string"?o.id.trim():"",s=typeof o.cwd=="string"?o.cwd.trim():"";return!i||!s?($.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_id_or_cwd"}),null):{id:i,cwd:s}}async function Rtn(e,t={}){let n=pfe(),r=[],o=new Array(e.length),i=new Set,s=new Set,u=new Set,l=[];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=Kf.relative(n,h.transcriptPath).split(Kf.sep).join("/");if(o[f]=_,u.has(_))continue;let y=await Hi(h.transcriptPath);if(!y.exists){i.add(_),u.add(_);continue}if(t.isUnchanged?.(_,y)){i.add(_),u.add(_);continue}if(t.isThrottled?.(_)){s.add(_),u.add(_);continue}let T=await vp(h.project),v=()=>F0.readFile(h.transcriptPath,"utf8"),R=await bh(t.uploadFilterConfig??vA(),{cwd:h.project,repoOriginPath:T,transcriptPath:h.transcriptPath,readTranscript:v});if(!R.shouldUpload){$.info("upload_filter_session_excluded",{filename:Kf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:R.reason}),i.add(_),u.add(_);continue}$.info("upload_filter_session_included",{filename:Kf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:"matched"});let x;try{x=await fd(h.transcriptPath)}catch(O){if(kr(O,"ENOENT")){i.add(_),u.add(_);continue}throw new Error(`read codex rollout ${h.transcriptPath}: ${String(O)}`)}l.push(x.tempPath),r.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:T,tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"codex",harnessInternalId:h.sessionId,watchedState:y}),u.add(_)}}catch(f){throw await Promise.all(l.map(h=>F0.rm(Kf.dirname(h),{recursive:!0,force:!0}))),f}return{entries:e,localFiles:r,entryFileKeys:o,skippedFileKeys:i,deferredFileKeys:s}}async function xtn(e,t,n={}){let r=await jet(e),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await Hi(u.transcriptPath);if(!l.exists)continue;let f=await vp(u.project),h=await bh(n.uploadFilterConfig??vA(),{cwd:u.project,repoOriginPath:f,transcriptPath:u.transcriptPath,readTranscript:()=>F0.readFile(u.transcriptPath,"utf8")},{ignoreSkillRules:!0});if(!h.shouldUpload){$.info("upload_filter_watch_excluded",{filename:Kf.basename(u.transcriptPath),transcript_path:u.transcriptPath,cwd:u.project,repo_origin_path:f||"<none>",reason:h.reason});continue}i.push({sessionId:u.sessionId,project:u.project,transcriptPath:u.transcriptPath,expiresAt:new Date(o+Ctn),baseline:t.get(u.transcriptPath)??l})}return i}function Fet(e){return e!==null&&typeof e=="object"}m();on();Bn();Ga();import mfe from"node:fs";import Afe from"node:fs/promises";import jM from"node:path";m();import Dtn from"node:fs";var Ntn=Z9,ffe=W9;function zet(e){let t=Ntn(e);if(!t)throw new Error(`Session ${e} has no local_* subdirectory \u2014 is this a Cowork session?`);let n=ffe(t);if(!n)throw new Error(`Session ${e} has no transcript file under ${t} (looked for ${ufe.join(", ")})`);let r=Dtn.readFileSync(n,"utf8"),o=cfe(t,"uploads"),i=cfe(t,"outputs");return{transcriptPath:n,transcript:r,uploads:o,outputs:i}}m();import GM from"node:path";var nq=bet;function Het(e){let t=GM.resolve(e).split(GM.sep),n=t.lastIndexOf(afe);if(n<0)return null;let r=t[n+1],o=t[n+2];if(!r||!o)return null;let i=t.slice(0,n+1).join(GM.sep),s=GM.join(i,r,o),l=t.slice(n+3).find(h=>h.startsWith("local_"))??GM.basename(Z9(s)??""),f=l.startsWith("local_")?l.replace(/^local_/,""):"";return{accountId:r,orgId:o,sessionId:f,sessionDir:s,sessionsRoot:i}}function g1(e){return Iet(e)}function $et(e){return g1(e)[0]??null}Th();var Btn=3600*1e3,Vet={name:"cowork",historyFilePath:Yet,readUnuploadedEntries:wtn,collectLocalFiles:Ptn,buildPendingTranscriptWatches:Mtn};function Yet(){return process.env.LORE_COWORK_SESSIONS_DIR??nq()}async function wtn(e){return Ket(e,{includeWatermark:!1})}async function Ket(e,t){let n=Yet(),r=g1(n),o=[];for(let i of r){let s=i.localDir,u=ffe(s);if(!u)continue;let l=jM.basename(s),f=jM.join(i.sessionDir,`${l}.json`),h=Otn(f,i.sessionDir);if(h!==null){if(t.includeWatermark){if(h.lastActivityAt<e)continue}else if(h.lastActivityAt<=e)continue;o.push({timestamp:h.lastActivityAt,sessionId:h.sessionId,accountId:i.accountId,orgId:i.orgId,project:"",userSelectedFolders:h.userSelectedFolders,transcriptPath:u})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}function Otn(e,t){let n;try{n=mfe.readFileSync(e,"utf8")}catch{return $.warn("cowork_manifest_missing",{session_dir:t,manifest_path:e}),null}let r;try{r=JSON.parse(n)}catch{return $.warn("cowork_manifest_unparseable",{session_dir:t,manifest_path:e}),null}if(!Ltn(r))return $.warn("cowork_manifest_not_object",{session_dir:t,manifest_path:e}),null;let o=typeof r.sessionId=="string"?r.sessionId.trim():"";if(!o)return $.warn("cowork_manifest_missing_session_id",{session_dir:t,manifest_path:e}),null;let i=typeof r.lastActivityAt=="number"?r.lastActivityAt:0,s=typeof r.cwd=="string"?r.cwd.trim():"",u=Array.isArray(r.userSelectedFolders)?r.userSelectedFolders.filter(l=>typeof l=="string"&&l.trim().length>0):[];return u.length===0&&$.info("cowork_no_user_folders",{session_dir:t,manifest_path:e,cwd:s||"<none>"}),{sessionId:o,cwd:s,userSelectedFolders:u,lastActivityAt:i}}function ktn(e){return{uploads:qet(e,"uploads"),outputs:qet(e,"outputs")}}function qet(e,t){let n=jM.join(e,t);return mfe.existsSync(n)?mfe.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}async function Ptn(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=[...e];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=`${h.accountId}/${h.orgId}/${h.sessionId}/audit.jsonl`;if(r[f]=_,s.has(_))continue;let y=await Hi(h.transcriptPath);if(!y.exists){o.add(_),s.add(_);continue}if(t.isUnchanged?.(_,y)){o.add(_),s.add(_);continue}if(t.isThrottled?.(_)){i.add(_),s.add(_);continue}let T=()=>Afe.readFile(h.transcriptPath,"utf8"),v=null,R=null;for(let[j,G]of h.userSelectedFolders.entries()){let H=await vp(G),V=await bh(t.uploadFilterConfig??vA(),{cwd:G,repoOriginPath:H,transcriptPath:h.transcriptPath,readTranscript:T});if($.info("cowork_upload_filter_folder_evaluated",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,folder_index:j,folder:G,repo_origin_path:H||"<none>",should_upload:V.shouldUpload,reason:V.shouldUpload?"matched":V.reason}),V.shouldUpload){v=G,R=H;break}}if(v===null){$.info("upload_filter_session_excluded",{filename:"audit.jsonl",transcript_path:h.transcriptPath,user_selected_folders:h.userSelectedFolders,reason:h.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"}),o.add(_),s.add(_);continue}l[f]={...h,project:v},$.info("cowork_upload_filter_session_accepted",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,matched_project:v,repo_origin_path:R||"<none>",user_selected_folders:h.userSelectedFolders}),$.info("upload_filter_session_included",{filename:"audit.jsonl",transcript_path:h.transcriptPath,session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let x;try{x=await fd(h.transcriptPath)}catch(j){if(kr(j,"ENOENT")){o.add(_),s.add(_);continue}throw new Error(`read cowork audit ${h.transcriptPath}: ${String(j)}`)}u.push(x.tempPath);let O=jM.dirname(h.transcriptPath),P=ktn(O);n.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:R??"",tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"cowork",harnessInternalId:h.sessionId,watchedState:y,artifactMetadata:P}),s.add(_)}}catch(f){throw await Promise.all(u.map(h=>Afe.rm(jM.dirname(h),{recursive:!0,force:!0}))),f}return{entries:l,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function Mtn(e,t,n={}){let r=await Ket(e,{includeWatermark:!0}),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await Hi(u.transcriptPath);if(!l.exists)continue;let f=()=>Afe.readFile(u.transcriptPath,"utf8"),h=null,_=null;for(let[y,T]of u.userSelectedFolders.entries()){let v=await vp(T),R=await bh(n.uploadFilterConfig??vA(),{cwd:T,repoOriginPath:v,transcriptPath:u.transcriptPath,readTranscript:f},{ignoreSkillRules:!0});if($.info("cowork_upload_filter_watch_folder_evaluated",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,folder_index:y,folder:T,repo_origin_path:v||"<none>",should_upload:R.shouldUpload,reason:R.shouldUpload?"matched":R.reason}),R.shouldUpload){h=T,_=v;break}}if(h===null){$.info("upload_filter_watch_excluded",{filename:"audit.jsonl",transcript_path:u.transcriptPath,user_selected_folders:u.userSelectedFolders,reason:u.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"});continue}i.push({sessionId:u.sessionId,project:h,transcriptPath:u.transcriptPath,expiresAt:new Date(o+Btn),baseline:t.get(u.transcriptPath)??l}),$.info("cowork_upload_filter_watch_accepted",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,matched_project:h,repo_origin_path:_||"<none>",user_selected_folders:u.userSelectedFolders})}return i}function Ltn(e){return e!==null&&typeof e=="object"}Ple();var Utn=1e3,Qtn=250,Ftn=2,Gtn=5e3,hfe=[Det,Get,Vet],h1=class extends Error{constructor(){super("lore is logged out")}};function jtn(e){return e.adapters!==void 0?e.adapters:e.adapter!==void 0?[e.adapter]:hfe}async function Wet(e={}){return(await _fe(e)).threadIDs}async function _fe(e={}){G0(e.signal);let t=await d$(),n=e.recorder??new UD,r=jtn(e),o=e.client??Gt();$.info("run_upload_start",{adapters:r.map(h=>h.name),hasInjectedClient:!!e.client,hasInjectedRecorder:!!e.recorder}),await n.markRunning();let i=[],s=0,u=t,l=new Map,f=!1;try{let h=e.uploadFilterConfig??await Ho(),_=await Xet({syncState:t,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,minReuploadIntervalMs:e.minReuploadIntervalMs,now:e.now,signal:e.signal});i=_.threadIDs,s=_.deferredCount,u=_.syncState,l=_.watchBaselineOverrides,f=_.loggedOut,G0(e.signal),f||(await n.markSyncSuccess(i),i.length>0&&e.onUploadCompleted?.());let y=e.tailActiveSessions!==!1;if(!f&&y&&i.length>0){let T=await ztn({syncState:u,baselineOverrides:l,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});i=[...i,...T.threadIDs],u=T.syncState,f=T.loggedOut,G0(e.signal)}return f?($.warn("run_upload_marking_logged_out",{threadIDs:i.length,adapters:r.map(T=>T.name)}),await n.markLoggedOut()):await n.markSuccess(i),{threadIDs:i,deferredCount:s}}catch(h){throw ett(h)||await n.markError(h),h}}function gfe(e){if(e==="claudeCode"||e==="codex"||e==="cowork")return e;throw new Error(`runUpload: adapter.name "${e}" is not a known HarnessKey. Expected one of: claudeCode, codex, cowork. Custom adapters must use one of these names or the per-harness watermark cannot be persisted.`)}async function Xet(e){let t=[],n=0,r=e.syncState,o=new Map,i=await Vtn(e.adapters,qtn(e.adapterConcurrency,e.adapters.length),async h=>{G0(e.signal);let _=gfe(h.name),y=f$(e.syncState,_),T=e.syncState.harnesses[_]?.cursors??{};try{let v=await Htn({...e,adapter:h,harnessKey:_,floor:y,cursors:T});return{adapter:h,harnessKey:_,uploadResult:v}}catch(v){return{adapter:h,harnessKey:_,error:v}}}),s=[],u=0,l,f;for(let h of i)if(G0(e.signal),!!h){if("error"in h){if(h.error instanceof h1){l=h.adapter.name;continue}if(ett(h.error)){f??=h.error;continue}s.push(h.error),$.error("run_upload_adapter_failed",{adapter:h.adapter.name,error:h.error instanceof Error?h.error.message:String(h.error)});continue}u+=1,t=[...t,...h.uploadResult.threadIDs],n+=h.uploadResult.deferredCount;for(let[_,y]of h.uploadResult.cursorUpdates)r=LYe(r,h.harnessKey,_,y);r=UYe(r,h.harnessKey,Gtn),r=MYe(r,h.harnessKey,h.uploadResult.newFloor);for(let[_,y]of h.uploadResult.watchBaselineOverrides)o.set(_,y);await p$(r)}if(f)throw f;if(u===0&&s.length>0)throw s.length===1?s[0]:new AggregateError(s,"all upload adapters failed");return l?($.warn("run_upload_logged_out_short_circuit",{adapter:l,threadIDs:t.length}),{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!0}):{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!1}}async function ztn(e){let t=new Map;for(let i of e.adapters){let s=i.historyFilePath();t.set(s,await Hi(s))}let n=[];for(let i of e.adapters){let s=gfe(i.name),u=await i.buildPendingTranscriptWatches(f$(e.syncState,s),e.baselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...u]}if(await e.recorder.setPendingWatchers(n),n.length===0)return await e.recorder.setPendingWatchers([]),{threadIDs:[],syncState:e.syncState,loggedOut:!1};let r=[],o=e.syncState;try{for(;;){await Jet(Utn,void 0,{signal:e.signal}),G0(e.signal),await e.recorder.heartbeat();let i=new Date,s=!1;for(let l of e.adapters){let f=l.historyFilePath(),h=t.get(f),_=await Hi(f);h!==void 0&&D9(h,_)&&(s=!0),t.set(f,_)}if(s||(s=await Ytn(n)),!s){let l=Ktn(n,i);if(n=l.watchers,l.changed&&await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};continue}await Jet(Qtn,void 0,{signal:e.signal});let u=await Xet({syncState:o,adapters:e.adapters,client:e.client,recorder:e.recorder,uploadFilterConfig:e.uploadFilterConfig,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});if(o=u.syncState,u.loggedOut)return{threadIDs:r,syncState:o,loggedOut:!0};if(r.push(...u.threadIDs),await e.recorder.markSyncSuccess(u.threadIDs),u.threadIDs.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};for(let l of e.adapters){let f=l.historyFilePath();t.set(f,await Hi(f))}n=[];for(let l of e.adapters){let f=gfe(l.name),h=await l.buildPendingTranscriptWatches(f$(o,f),u.watchBaselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...h]}if(await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1}}}finally{await e.recorder.setPendingWatchers([])}}async function Htn(e){let t=new Map,n=(_,y)=>{let T=e.cursors[_];return T===void 0?!1:!D9({exists:!0,size:T.sizeBytes,modTimeUnixMs:T.modTimeUnixMs},y)},r=e.minReuploadIntervalMs??0,o=e.now??Date.now,i=o(),s=_=>{if(r<=0)return!1;let y=e.cursors[_];return y===void 0?!1:i-y.lastUploadedAtMs<r};G0(e.signal);let u=await e.adapter.readUnuploadedEntries(e.floor);if($.info("run_upload_adapter_entries_read",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),u.length===0)return{threadIDs:[],cursorUpdates:t,newFloor:e.floor,watchBaselineOverrides:new Map,deferredCount:0};if(!await sn())throw $.warn("run_upload_no_access_token_for_entries",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),new h1;$.info("run_upload_access_token_available",{adapter:e.adapter.name,entryCount:u.length}),await e.recorder.markAuthenticated();let f=await e.adapter.collectLocalFiles(u,{uploadFilterConfig:e.uploadFilterConfig,isUnchanged:n,isThrottled:s}),h=f.deferredFileKeys?.size??0;try{if(f.localFiles.length===0){let O=Zet(e.floor,f.entries,f.entryFileKeys,f.skippedFileKeys);return{threadIDs:[],cursorUpdates:t,newFloor:O,watchBaselineOverrides:new Map,deferredCount:h}}let _=await MA(e.client,f.localFiles,{networkTimeoutMs:e.uploadNetworkTimeoutMs}),y=[],T=new Map,v=new Set(f.skippedFileKeys),R=O=>{t.set(O.key,{sizeBytes:O.watchedState.size,modTimeUnixMs:O.watchedState.modTimeUnixMs,md5:O.md5,lastUploadedAtMs:o()})};for(let O of _){let{localFile:P}=O;if(O.status==="quarantined"){$.info("run_upload_quarantine",{filename:P.filename,reason:O.reason,findings:O.findingCount}),v.add(P.key);continue}if(O.status!=="uploaded"){let G=(O.status==="no_upload"?O.error?.trim():"")||`upload session response missing presigned_url for ${P.filename}`;$.info("run_upload_skip",{filename:P.filename,reason:G}),v.add(P.key),R(P);continue}await e.recorder.heartbeat(),G0(e.signal);let j=O.thread?.id?.trim()??"";if(!j){if(P.fileType==="plan"){v.add(P.key),R(P);continue}throw new Error(`complete upload session response missing thread for ${P.filename}`)}y.push(j);try{await $tn(e.client,j,e.recorder,{timeoutMs:e.parseTimeoutMs,signal:e.signal})}catch(G){if(G instanceof Error&&(G.message.includes("timed out waiting for thread")||G.message.includes("parsing failed permanently")||G.message.includes("unexpected transcript parsing state")))$.warn("parse_wait_soft_failure",{threadID:j,filename:P.filename,message:G.message});else throw G}v.add(P.key),R(P),P.sourcePath&&T.set(P.sourcePath,P.watchedState)}let x=Zet(e.floor,f.entries,f.entryFileKeys,v);return{threadIDs:y,cursorUpdates:t,newFloor:x,watchBaselineOverrides:T,deferredCount:h}}finally{await Promise.all(f.localFiles.map(_=>wp(_.tempPath)))}}async function $tn(e,t,n,r={}){let o={...r,onPoll:()=>n.heartbeat()};await VD(e,t,o)}function G0(e){if(e?.aborted)throw new DOMException("The operation was aborted","AbortError")}function ett(e){return e instanceof Error&&e.name==="AbortError"}function qtn(e,t){return t<=0?1:e===void 0?Math.min(Ftn,t):!Number.isFinite(e)||e<1?1:Math.min(Math.floor(e),t)}async function Vtn(e,t,n){let r=new Array(e.length),o=0,i=Math.min(t,e.length),s=Array.from({length:i},async()=>{for(;;){let u=o;if(o+=1,u>=e.length)return;let l=e[u];if(l===void 0)return;r[u]=await n(l)}});return await Promise.all(s),r}function Zet(e,t,n,r){let o=Number.POSITIVE_INFINITY;for(let s=0;s<t.length;s+=1){let u=n[s];u&&r.has(u)||(o=Math.min(o,t[s]?.timestamp??o))}let i=e;for(let s=0;s<t.length;s+=1){let u=n[s];if(!u||!r.has(u))continue;let l=t[s]?.timestamp??i;l<o&&(i=Math.max(i,l))}return i}async function Ytn(e){for(let t of e){let n=await Hi(t.transcriptPath);if(D9(t.baseline,n))return!0}return!1}function Ktn(e,t){let n=e.filter(r=>t<r.expiresAt);return{watchers:n,changed:n.length!==e.length}}m();t$();on();Bn();Mo();import Rb from"node:fs";import{watch as Ztn}from"node:fs/promises";import Efe from"node:path";import{setTimeout as oq}from"node:timers/promises";m();Pr();Bn();var Jtn=6e4,rq=class{client;now;minIntervalMs;lastBeatAt=Number.NEGATIVE_INFINITY;constructor(t={}){this.client=t.client??Gt(),this.now=t.now??Date.now,this.minIntervalMs=t.minIntervalMs??Jtn}async beat(){let t=this.now();t-this.lastBeatAt<this.minIntervalMs||(this.lastBeatAt=t,await this.post({}))}async uploadCompleted(){this.lastBeatAt=this.now(),await this.post({upload_completed:!0})}async post(t){try{await this.client.recordCliHeartbeat({body:t})}catch(n){$.warn("cli_heartbeat_failed",{error:n instanceof Error?n.message:String(n)})}}};var Wtn=2e3,Xtn=6e4,enn=5e3,tnn=ede*3,nnn=5e3,rnn=5*6e4,onn=.2,inn=15e3;function snn(e){return Array.isArray(e)?{threadIDs:e,deferredCount:0}:e}var iq=class extends Error{constructor(t){super(t),this.name="SyncPassDeadlineError"}};function ann(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??hfe).map(n=>n.historyFilePath())}async function ntt(e={}){let t=e.debounceMs??Wtn,n=e.pollIntervalMs,r=n??e.idlePollIntervalMs??Xtn,o=n??e.activePollIntervalMs??enn,i=e.syncDeadlineMs??tnn,s=e.failureBackoffBaseMs??nnn,u=e.failureBackoffMaxMs??rnn,l=e.failureBackoffJitterRatio??onn,f=e.random??Math.random,h=ann(e),_=e.runUploadFn??_fe,y=e.uploadOptions?.minReuploadIntervalMs??e.minReuploadIntervalMs??inn,T=e.uploadOptions?.recorder??new UD,v=e.heartbeatReporter??new rq,R={...e.uploadOptions,recorder:T,tailActiveSessions:!1,onUploadCompleted:()=>{v.uploadCompleted()},minReuploadIntervalMs:y},x=e.signal?void 0:new AbortController,O=e.signal??x.signal,P=()=>x?.abort();x&&(process.once("SIGINT",P),process.once("SIGTERM",P));let j=await cnn(e.lockFilePath??lje());if(!j.acquired){x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P)),$.info("watch_skip_already_running",{pid:j.pid});return}let G=j.release,H=!1,V=!1,ae=0,re=r,_e=async Tt=>{if(H){V=!0;return}H=!0;try{do{if(V=!1,O.aborted)break;if(ae>0){let ye=unn({consecutiveFailures:ae,baseMs:s,maxMs:u,jitterRatio:l,random:f});if($.warn("watch_sync_backoff",{reason:Tt,consecutiveFailures:ae,backoffMs:ye}),await oq(ye,void 0,{signal:O}).catch(()=>{}),O.aborted)break}try{let ye=new AbortController,Je=()=>ye.abort();O.addEventListener("abort",Je,{once:!0});let ot=`sync pass exceeded ${i}ms deadline`,ut,Lt=new Promise((be,mt)=>{ut=setTimeout(()=>{$.error("watch_sync_stuck",{reason:Tt,syncDeadlineMs:i}),T.markStuck(ot).catch(en=>$.warn("watch_mark_stuck_failed",{error:ln(en)})),ye.abort(),mt(new iq(ot))},i),ut.unref?.()}),Gr=_({...R,signal:ye.signal});try{let{threadIDs:be,deferredCount:mt}=snn(await Promise.race([Gr,Lt]));ae=0,re=be.length>0||mt>0?o:r,$.info("watch_sync_complete",{reason:Tt,uploaded:be.length,deferred:mt,nextPollIntervalMs:re})}finally{ut&&clearTimeout(ut),O.removeEventListener("abort",Je),await Gr.catch(()=>{})}}catch(ye){if(O.aborted&&ye?.name==="AbortError")break;ae+=1,!(ye instanceof iq)&&ye?.name!=="AbortError"&&await T.markDegraded(ye).catch(Je=>$.warn("watch_mark_degraded_failed",{error:ln(Je)})),$.error("watch_sync_failed",{reason:Tt,consecutiveFailures:ae,error:ln(ye)})}}while(V&&!O.aborted)}finally{H=!1}},Qe,pt=Tt=>{Qe&&clearTimeout(Qe),Qe=setTimeout(()=>{Qe=void 0,_e(Tt)},t),Qe.unref?.()};$.info("watch_start",{watchPaths:h,debounceMs:t,idlePollIntervalMs:r,activePollIntervalMs:o,syncDeadlineMs:i}),v.beat(),_e("startup");let Ge=async Tt=>{for(;!O.aborted;)try{let ye=Rb.existsSync(Tt)&&Rb.statSync(Tt).isDirectory(),Je=ye?Tt:Efe.dirname(Tt),ot=ye?void 0:Efe.basename(Tt),ut=e.watchEventSource?.({watchDir:Je,watchPath:Tt,recursive:ye,signal:O})??Ztn(Je,{signal:O,recursive:ye});for await(let Lt of ut){if(O.aborted)break;(ot===void 0||!Lt.filename||Lt.filename===ot)&&pt("fs-event")}}catch(ye){if(O.aborted||ye?.name==="AbortError")break;$.warn("watch_fs_retry",{path:Tt,error:ln(ye)}),await oq(r,void 0,{signal:O}).catch(()=>{})}},Pt=async()=>{for(;!O.aborted;){try{await oq(re,void 0,{signal:O})}catch{break}if(O.aborted)break;v.beat(),_e("poll")}};try{await Promise.all([...h.map(Ge),Pt()])}finally{for(Qe&&clearTimeout(Qe),x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P));H;)await oq(50).catch(()=>{});await G(),$.info("watch_stop",{})}}function unn(e){let t=e.baseMs*2**Math.max(0,e.consecutiveFailures-1),n=Math.min(e.maxMs,t),r=n*e.jitterRatio,o=r===0?0:(e.random()*2-1)*r;return Math.max(0,Math.round(n+o))}async function cnn(e){if($.info("upload_daemon_lock_check",{lockFilePath:e}),e===!1)return{acquired:!0,release:async()=>{}};for(await Rb.promises.mkdir(Efe.dirname(e),{recursive:!0,mode:448});;)try{let t=await Rb.promises.open(e,"wx",384);return await t.writeFile(JSON.stringify({pid:process.pid,started_at:new Date().toISOString()})),await t.close(),{acquired:!0,release:async()=>{(await ttt(e))?.pid===process.pid&&await Rb.promises.rm(e,{force:!0})}}}catch(t){if(!dnn(t))throw t;let n=await ttt(e);if(n?.pid&&lnn(n.pid))return{acquired:!1,pid:n.pid};await Rb.promises.rm(e,{force:!0})}}async function ttt(e){try{let t=JSON.parse(await Rb.promises.readFile(e,"utf8"));return typeof t.pid=="number"?{pid:t.pid}:{}}catch{return}}function lnn(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}function dnn(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}var rtt={meta:{name:"_run_upload",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously: watch the Claude history file and re-sync on every change. This is the launchd-free daemon `pnpm dev` runs locally.",default:!1}},async run({args:e,data:t}){let n={client:t?.client,...t?.adapters!==void 0?{adapters:t.adapters}:t?.adapter!==void 0?{adapter:t.adapter}:{},recorder:t?.recorder};if(e.watch){await Qet(),await ntt({uploadOptions:n});return}let r=await Wet(n);console.log(JSON.stringify(r))}};m();s0();m();Pr();import{spawn as pnn}from"node:child_process";import ott from"node:path";async function yfe(e){let t=e.progress??A1;if(!await sn())throw new h1;t({kind:"step",step:"resolving_session"});let r=ott.resolve(e.sessionFile),o=ott.basename(r),i=e.harnessInternalId?.trim()||gnn(o)||o,s=await Hi(r);if(!s.exists)throw new Error(`session file does not exist: ${r}`);let u=await fd(r),l={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:u.tempPath,md5:u.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:s},f=e.client??Gt();try{t({kind:"step",step:"uploading",label:o});let[h]=await MA(f,[l]);if(!h)throw new Error("create upload session returned no thread files");if(h.status==="quarantined")return t({kind:"step",step:"done"}),{quarantined:!0,reason:h.reason,finding_count:h.findingCount,session_id:i};if(h.status==="no_upload"){let V=h.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${V}`)}let _=h.status==="deduped",y=h.thread,T=y?.id?.trim();if(!T)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await VD(f,T);let v=y?.visibility?.trim()??"",R=v,x=e.visibility;x&&x!==v&&(t({kind:"step",step:"updating_visibility"}),R=await fnn(f,T,x));let O=`${C0().replace(/\/+$/,"")}/thread/${T}`,P,j=e.highlight?.trim();if(j){t({kind:"step",step:"resolving_highlight"});let V=await tq(f,T,j);V&&(O=V.url,P={query:j,matched:V.matched,start_block_id:V.start_block_id,end_block_id:V.end_block_id})}let G=await hnn(O),H=Ann(R)?R:"private";return t({kind:"completed",url:O,reused:_,visibility:H,clipboardCopied:G,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:T,url:O,session_id:i,project:"",reused:_,visibility:H,clipboard_copied:G,...P?{highlight:P}:{}}}finally{await wp(u.tempPath)}}async function fnn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Np(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var mnn=new Set(["private","workspace","public"]);function Ann(e){return mnn.has(e)}function gnn(e){let n=e.replace(/\.jsonl$/i,"").split("-").filter(o=>o.length>0);if(n.length===0)return"";let r=n.slice(-5);return r.length===5&&r.every(o=>/^[0-9a-fA-F]+$/.test(o))?r.join("-"):n[n.length-1]??""}async function hnn(e){let t=process.platform==="darwin"?[{command:"pbcopy",args:[]}]:process.platform==="win32"?[{command:"clip.exe",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];for(let{command:n,args:r}of t)if(await _nn(n,r,e))return!0;return!1}function _nn(e,t,n){return new Promise(r=>{let o;try{o=pnn(e,t,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}o.on("error",()=>r(!1)),o.on("exit",i=>r(i===0)),o.stdin?.on("error",()=>r(!1)),o.stdin?.end(n)})}var itt=["private","workspace","public"],stt={meta:{name:"share-codex",description:"Upload a Codex session rollout (.jsonl) to Lore and print a shareable URL."},args:{"session-file":{type:"string",required:!0,description:"Absolute path to a Codex rollout file (e.g. ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl)"},visibility:{type:"string",required:!1,description:"After upload, set thread visibility to one of: private, workspace, public"},highlight:{type:"string",required:!1,description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e}){let t=e["session-file"];if(typeof t!="string"||t.trim()==="")throw new Error("--session-file is required");let n=Enn(e.visibility);if(vu()){let r=await m1({title:"lore share-codex",subtitle:"sharing this Codex session",perform:o=>yfe({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:o})});"quarantined"in r&&r.quarantined&&console.log(`
|
|
697
|
+
Held locally \u2014 not uploaded. ${o.finding_count} finding(s); reason: ${o.reason}. See \`lore quarantine\`.`);return}let r=await dfe({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};m();m();i0();Pr();sc();on();Bn();Ga();LD();var htn=5,_tn=1e3;async function Qet(e={}){(e.environment??Kr())!=="dev"||!await Etn({fetchFn:e.fetchFn})||await ytn({client:e.client})}async function Etn(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return $.warn("dev_preflight_no_email",{hint:"set LORE_DEV_CLI_USER_EMAIL in .env.local (run `pnpm bootstrap`) to auto-authenticate the dev uploader"}),!1;let n=e.fetchFn??globalThis.fetch,r=e.attempts??htn,o=e.retryDelayMs??_tn,i=`${cd()}/api/cli-auth/dev-token`;for(let s=1;s<=r;s+=1)try{let u=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(u.status===404){let f=await Uet(u);return dh(),$.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f,url:i}),!1}if(!u.ok){let f=await Uet(u);return dh(),$.warn("dev_preflight_token_rejected",{status:u.status,email:t,detail:f}),!1}let l=await u.json();return l.access_token?(bje(l.access_token),$.info("dev_preflight_token_minted",{email:t,expiresIn:l.expires_in}),!0):(dh(),$.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(u){if(s===r)return dh(),$.warn("dev_preflight_token_unreachable",{url:i,error:ln(u)}),!1;await Stn(o)}return!1}async function ytn(e={}){await Ih();let t=await Ho();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=ji(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Gt();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){$.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){$.warn("dev_preflight_whoami_error",{error:ln(o)});return}await pd({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),$.info("dev_preflight_upload_dir_seeded",{path:n})}async function Uet(e){try{let t=await e.json(),n=t.message??t.error;return typeof n=="string"?n:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}function Stn(e){return new Promise(t=>{setTimeout(t,e)})}m();t$();Pr();Bn();Ga();import{setTimeout as Jet}from"node:timers/promises";m();on();Bn();Ga();import{createReadStream as Ttn}from"node:fs";import F0 from"node:fs/promises";import btn from"node:os";import Kf from"node:path";import{createInterface as Itn}from"node:readline";Th();var Ctn=3600*1e3,Get={name:"codex",historyFilePath:pfe,readUnuploadedEntries:jet,collectLocalFiles:Rtn,buildPendingTranscriptWatches:xtn};function pfe(){return process.env.LORE_CODEX_SESSIONS_DIR??Kf.join(btn.homedir(),".codex","sessions")}async function jet(e){let t=pfe(),n;try{n=await F0.readdir(t,{withFileTypes:!0})}catch(o){if(kr(o,"ENOENT"))return[];throw o}let r=[];for(let o of n){if(!o.isDirectory())continue;let i=Kf.join(t,o.name),s;try{s=await F0.readdir(i,{withFileTypes:!0})}catch{continue}for(let u of s){if(!u.isDirectory())continue;let l=Kf.join(i,u.name),f;try{f=await F0.readdir(l,{withFileTypes:!0})}catch{continue}for(let h of f){if(!h.isDirectory())continue;let _=Kf.join(l,h.name),y;try{y=await F0.readdir(_,{withFileTypes:!0})}catch{continue}for(let T of y){if(!T.isFile()||!T.name.startsWith("rollout-")||!T.name.endsWith(".jsonl"))continue;let v=Kf.join(_,T.name),R;try{R=await F0.stat(v)}catch{continue}if(R.mtimeMs<=e)continue;let x=await vtn(v);x!==null&&r.push({timestamp:R.mtimeMs,sessionId:x.id,project:x.cwd,transcriptPath:v})}}}}return r.sort((o,i)=>o.timestamp-i.timestamp)}async function vtn(e){let t,n=Ttn(e,{encoding:"utf8"});try{t=await new Promise((u,l)=>{let f=Itn({input:n,crlfDelay:Number.POSITIVE_INFINITY}),h=!1;f.on("line",_=>{if(h)return;let y=_.trim();y&&(h=!0,f.close(),n.destroy(),u(y))}),f.on("close",()=>{h||u("")}),f.on("error",l),n.on("error",l)})}finally{n.destroy()}if(!t)return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"empty_first_line"}),null;let r;try{r=JSON.parse(t)}catch{return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"unparseable_json"}),null}if(!Fet(r))return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;if(r.type!=="session_meta")return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"not_session_meta"}),null;let o=r.payload;if(!Fet(o))return $.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_payload"}),null;let i=typeof o.id=="string"?o.id.trim():"",s=typeof o.cwd=="string"?o.cwd.trim():"";return!i||!s?($.warn("codex_rollout_skipped",{transcript_path:e,reason:"missing_id_or_cwd"}),null):{id:i,cwd:s}}async function Rtn(e,t={}){let n=pfe(),r=[],o=new Array(e.length),i=new Set,s=new Set,u=new Set,l=[];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=Kf.relative(n,h.transcriptPath).split(Kf.sep).join("/");if(o[f]=_,u.has(_))continue;let y=await Hi(h.transcriptPath);if(!y.exists){i.add(_),u.add(_);continue}if(t.isUnchanged?.(_,y)){i.add(_),u.add(_);continue}if(t.isThrottled?.(_)){s.add(_),u.add(_);continue}let T=await vp(h.project),v=()=>F0.readFile(h.transcriptPath,"utf8"),R=await bh(t.uploadFilterConfig??vA(),{cwd:h.project,repoOriginPath:T,transcriptPath:h.transcriptPath,readTranscript:v});if(!R.shouldUpload){$.info("upload_filter_session_excluded",{filename:Kf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:R.reason}),i.add(_),u.add(_);continue}$.info("upload_filter_session_included",{filename:Kf.basename(h.transcriptPath),transcript_path:h.transcriptPath,cwd:h.project,repo_origin_path:T||"<none>",reason:"matched"});let x;try{x=await fd(h.transcriptPath)}catch(O){if(kr(O,"ENOENT")){i.add(_),u.add(_);continue}throw new Error(`read codex rollout ${h.transcriptPath}: ${String(O)}`)}l.push(x.tempPath),r.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:T,tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"codex",harnessInternalId:h.sessionId,watchedState:y}),u.add(_)}}catch(f){throw await Promise.all(l.map(h=>F0.rm(Kf.dirname(h),{recursive:!0,force:!0}))),f}return{entries:e,localFiles:r,entryFileKeys:o,skippedFileKeys:i,deferredFileKeys:s}}async function xtn(e,t,n={}){let r=await jet(e),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await Hi(u.transcriptPath);if(!l.exists)continue;let f=await vp(u.project),h=await bh(n.uploadFilterConfig??vA(),{cwd:u.project,repoOriginPath:f,transcriptPath:u.transcriptPath,readTranscript:()=>F0.readFile(u.transcriptPath,"utf8")},{ignoreSkillRules:!0});if(!h.shouldUpload){$.info("upload_filter_watch_excluded",{filename:Kf.basename(u.transcriptPath),transcript_path:u.transcriptPath,cwd:u.project,repo_origin_path:f||"<none>",reason:h.reason});continue}i.push({sessionId:u.sessionId,project:u.project,transcriptPath:u.transcriptPath,expiresAt:new Date(o+Ctn),baseline:t.get(u.transcriptPath)??l})}return i}function Fet(e){return e!==null&&typeof e=="object"}m();on();Bn();Ga();import mfe from"node:fs";import Afe from"node:fs/promises";import jM from"node:path";m();import Dtn from"node:fs";var Ntn=Z9,ffe=W9;function zet(e){let t=Ntn(e);if(!t)throw new Error(`Session ${e} has no local_* subdirectory \u2014 is this a Cowork session?`);let n=ffe(t);if(!n)throw new Error(`Session ${e} has no transcript file under ${t} (looked for ${ufe.join(", ")})`);let r=Dtn.readFileSync(n,"utf8"),o=cfe(t,"uploads"),i=cfe(t,"outputs");return{transcriptPath:n,transcript:r,uploads:o,outputs:i}}m();import GM from"node:path";var nq=bet;function Het(e){let t=GM.resolve(e).split(GM.sep),n=t.lastIndexOf(afe);if(n<0)return null;let r=t[n+1],o=t[n+2];if(!r||!o)return null;let i=t.slice(0,n+1).join(GM.sep),s=GM.join(i,r,o),l=t.slice(n+3).find(h=>h.startsWith("local_"))??GM.basename(Z9(s)??""),f=l.startsWith("local_")?l.replace(/^local_/,""):"";return{accountId:r,orgId:o,sessionId:f,sessionDir:s,sessionsRoot:i}}function g1(e){return Iet(e)}function $et(e){return g1(e)[0]??null}Th();var Btn=3600*1e3,Vet={name:"cowork",historyFilePath:Yet,readUnuploadedEntries:wtn,collectLocalFiles:Ptn,buildPendingTranscriptWatches:Mtn};function Yet(){return process.env.LORE_COWORK_SESSIONS_DIR??nq()}async function wtn(e){return Ket(e,{includeWatermark:!1})}async function Ket(e,t){let n=Yet(),r=g1(n),o=[];for(let i of r){let s=i.localDir,u=ffe(s);if(!u)continue;let l=jM.basename(s),f=jM.join(i.sessionDir,`${l}.json`),h=Otn(f,i.sessionDir);if(h!==null){if(t.includeWatermark){if(h.lastActivityAt<e)continue}else if(h.lastActivityAt<=e)continue;o.push({timestamp:h.lastActivityAt,sessionId:h.sessionId,accountId:i.accountId,orgId:i.orgId,project:"",userSelectedFolders:h.userSelectedFolders,transcriptPath:u})}}return o.sort((i,s)=>i.timestamp-s.timestamp)}function Otn(e,t){let n;try{n=mfe.readFileSync(e,"utf8")}catch{return $.warn("cowork_manifest_missing",{session_dir:t,manifest_path:e}),null}let r;try{r=JSON.parse(n)}catch{return $.warn("cowork_manifest_unparseable",{session_dir:t,manifest_path:e}),null}if(!Ltn(r))return $.warn("cowork_manifest_not_object",{session_dir:t,manifest_path:e}),null;let o=typeof r.sessionId=="string"?r.sessionId.trim():"";if(!o)return $.warn("cowork_manifest_missing_session_id",{session_dir:t,manifest_path:e}),null;let i=typeof r.lastActivityAt=="number"?r.lastActivityAt:0,s=typeof r.cwd=="string"?r.cwd.trim():"",u=Array.isArray(r.userSelectedFolders)?r.userSelectedFolders.filter(l=>typeof l=="string"&&l.trim().length>0):[];return u.length===0&&$.info("cowork_no_user_folders",{session_dir:t,manifest_path:e,cwd:s||"<none>"}),{sessionId:o,cwd:s,userSelectedFolders:u,lastActivityAt:i}}function ktn(e){return{uploads:qet(e,"uploads"),outputs:qet(e,"outputs")}}function qet(e,t){let n=jM.join(e,t);return mfe.existsSync(n)?mfe.readdirSync(n,{withFileTypes:!0}).filter(r=>r.isFile()&&!r.name.startsWith(".")).map(r=>r.name).sort((r,o)=>r.localeCompare(o)):[]}async function Ptn(e,t={}){let n=[],r=new Array(e.length),o=new Set,i=new Set,s=new Set,u=[],l=[...e];try{for(let f=0;f<e.length;f+=1){let h=e[f];if(!h)continue;let _=`${h.accountId}/${h.orgId}/${h.sessionId}/audit.jsonl`;if(r[f]=_,s.has(_))continue;let y=await Hi(h.transcriptPath);if(!y.exists){o.add(_),s.add(_);continue}if(t.isUnchanged?.(_,y)){o.add(_),s.add(_);continue}if(t.isThrottled?.(_)){i.add(_),s.add(_);continue}let T=()=>Afe.readFile(h.transcriptPath,"utf8"),v=null,R=null;for(let[j,G]of h.userSelectedFolders.entries()){let H=await vp(G),V=await bh(t.uploadFilterConfig??vA(),{cwd:G,repoOriginPath:H,transcriptPath:h.transcriptPath,readTranscript:T});if($.info("cowork_upload_filter_folder_evaluated",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,folder_index:j,folder:G,repo_origin_path:H||"<none>",should_upload:V.shouldUpload,reason:V.shouldUpload?"matched":V.reason}),V.shouldUpload){v=G,R=H;break}}if(v===null){$.info("upload_filter_session_excluded",{filename:"audit.jsonl",transcript_path:h.transcriptPath,user_selected_folders:h.userSelectedFolders,reason:h.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"}),o.add(_),s.add(_);continue}l[f]={...h,project:v},$.info("cowork_upload_filter_session_accepted",{session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,transcript_path:h.transcriptPath,matched_project:v,repo_origin_path:R||"<none>",user_selected_folders:h.userSelectedFolders}),$.info("upload_filter_session_included",{filename:"audit.jsonl",transcript_path:h.transcriptPath,session_id:h.sessionId,account_id:h.accountId,org_id:h.orgId,cwd:v,repo_origin_path:R||"<none>",reason:"matched"});let x;try{x=await fd(h.transcriptPath)}catch(j){if(kr(j,"ENOENT")){o.add(_),s.add(_);continue}throw new Error(`read cowork audit ${h.transcriptPath}: ${String(j)}`)}u.push(x.tempPath);let O=jM.dirname(h.transcriptPath),P=ktn(O);n.push({key:_,filename:_,sourcePath:h.transcriptPath,repoOriginPath:R??"",tempPath:x.tempPath,md5:x.md5,fileType:"transcript",harness:"cowork",harnessInternalId:h.sessionId,watchedState:y,artifactMetadata:P}),s.add(_)}}catch(f){throw await Promise.all(u.map(h=>Afe.rm(jM.dirname(h),{recursive:!0,force:!0}))),f}return{entries:l,localFiles:n,entryFileKeys:r,skippedFileKeys:o,deferredFileKeys:i}}async function Mtn(e,t,n={}){let r=await Ket(e,{includeWatermark:!0}),o=Date.now(),i=[],s=new Set;for(let u of r){if(s.has(u.transcriptPath))continue;s.add(u.transcriptPath);let l=await Hi(u.transcriptPath);if(!l.exists)continue;let f=()=>Afe.readFile(u.transcriptPath,"utf8"),h=null,_=null;for(let[y,T]of u.userSelectedFolders.entries()){let v=await vp(T),R=await bh(n.uploadFilterConfig??vA(),{cwd:T,repoOriginPath:v,transcriptPath:u.transcriptPath,readTranscript:f},{ignoreSkillRules:!0});if($.info("cowork_upload_filter_watch_folder_evaluated",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,folder_index:y,folder:T,repo_origin_path:v||"<none>",should_upload:R.shouldUpload,reason:R.shouldUpload?"matched":R.reason}),R.shouldUpload){h=T,_=v;break}}if(h===null){$.info("upload_filter_watch_excluded",{filename:"audit.jsonl",transcript_path:u.transcriptPath,user_selected_folders:u.userSelectedFolders,reason:u.userSelectedFolders.length===0?"no_user_selected_folders":"no_matching_folder"});continue}i.push({sessionId:u.sessionId,project:h,transcriptPath:u.transcriptPath,expiresAt:new Date(o+Btn),baseline:t.get(u.transcriptPath)??l}),$.info("cowork_upload_filter_watch_accepted",{session_id:u.sessionId,account_id:u.accountId,org_id:u.orgId,transcript_path:u.transcriptPath,matched_project:h,repo_origin_path:_||"<none>",user_selected_folders:u.userSelectedFolders})}return i}function Ltn(e){return e!==null&&typeof e=="object"}Ple();var Utn=1e3,Qtn=250,Ftn=2,Gtn=5e3,hfe=[Det,Get,Vet],h1=class extends Error{constructor(){super("lore is logged out")}};function jtn(e){return e.adapters!==void 0?e.adapters:e.adapter!==void 0?[e.adapter]:hfe}async function Wet(e={}){return(await _fe(e)).threadIDs}async function _fe(e={}){G0(e.signal);let t=await d$(),n=e.recorder??new UD,r=jtn(e),o=e.client??Gt();$.info("run_upload_start",{adapters:r.map(h=>h.name),hasInjectedClient:!!e.client,hasInjectedRecorder:!!e.recorder}),await n.markRunning();let i=[],s=0,u=t,l=new Map,f=!1;try{let h=e.uploadFilterConfig??await Ho(),_=await Xet({syncState:t,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,minReuploadIntervalMs:e.minReuploadIntervalMs,now:e.now,signal:e.signal});i=_.threadIDs,s=_.deferredCount,u=_.syncState,l=_.watchBaselineOverrides,f=_.loggedOut,G0(e.signal),f||(await n.markSyncSuccess(i),i.length>0&&e.onUploadCompleted?.());let y=e.tailActiveSessions!==!1;if(!f&&y&&i.length>0){let T=await ztn({syncState:u,baselineOverrides:l,adapters:r,client:o,recorder:n,uploadFilterConfig:h,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});i=[...i,...T.threadIDs],u=T.syncState,f=T.loggedOut,G0(e.signal)}return f?($.warn("run_upload_marking_logged_out",{threadIDs:i.length,adapters:r.map(T=>T.name)}),await n.markLoggedOut()):await n.markSuccess(i),{threadIDs:i,deferredCount:s}}catch(h){throw ett(h)||await n.markError(h),h}}function gfe(e){if(e==="claudeCode"||e==="codex"||e==="cowork")return e;throw new Error(`runUpload: adapter.name "${e}" is not a known HarnessKey. Expected one of: claudeCode, codex, cowork. Custom adapters must use one of these names or the per-harness watermark cannot be persisted.`)}async function Xet(e){let t=[],n=0,r=e.syncState,o=new Map,i=await Vtn(e.adapters,qtn(e.adapterConcurrency,e.adapters.length),async h=>{G0(e.signal);let _=gfe(h.name),y=f$(e.syncState,_),T=e.syncState.harnesses[_]?.cursors??{};try{let v=await Htn({...e,adapter:h,harnessKey:_,floor:y,cursors:T});return{adapter:h,harnessKey:_,uploadResult:v}}catch(v){return{adapter:h,harnessKey:_,error:v}}}),s=[],u=0,l,f;for(let h of i)if(G0(e.signal),!!h){if("error"in h){if(h.error instanceof h1){l=h.adapter.name;continue}if(ett(h.error)){f??=h.error;continue}s.push(h.error),$.error("run_upload_adapter_failed",{adapter:h.adapter.name,error:h.error instanceof Error?h.error.message:String(h.error)});continue}u+=1,t=[...t,...h.uploadResult.threadIDs],n+=h.uploadResult.deferredCount;for(let[_,y]of h.uploadResult.cursorUpdates)r=LYe(r,h.harnessKey,_,y);r=UYe(r,h.harnessKey,Gtn),r=MYe(r,h.harnessKey,h.uploadResult.newFloor);for(let[_,y]of h.uploadResult.watchBaselineOverrides)o.set(_,y);await p$(r)}if(f)throw f;if(u===0&&s.length>0)throw s.length===1?s[0]:new AggregateError(s,"all upload adapters failed");return l?($.warn("run_upload_logged_out_short_circuit",{adapter:l,threadIDs:t.length}),{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!0}):{threadIDs:t,deferredCount:n,syncState:r,watchBaselineOverrides:o,loggedOut:!1}}async function ztn(e){let t=new Map;for(let i of e.adapters){let s=i.historyFilePath();t.set(s,await Hi(s))}let n=[];for(let i of e.adapters){let s=gfe(i.name),u=await i.buildPendingTranscriptWatches(f$(e.syncState,s),e.baselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...u]}if(await e.recorder.setPendingWatchers(n),n.length===0)return await e.recorder.setPendingWatchers([]),{threadIDs:[],syncState:e.syncState,loggedOut:!1};let r=[],o=e.syncState;try{for(;;){await Jet(Utn,void 0,{signal:e.signal}),G0(e.signal),await e.recorder.heartbeat();let i=new Date,s=!1;for(let l of e.adapters){let f=l.historyFilePath(),h=t.get(f),_=await Hi(f);h!==void 0&&D9(h,_)&&(s=!0),t.set(f,_)}if(s||(s=await Ytn(n)),!s){let l=Ktn(n,i);if(n=l.watchers,l.changed&&await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};continue}await Jet(Qtn,void 0,{signal:e.signal});let u=await Xet({syncState:o,adapters:e.adapters,client:e.client,recorder:e.recorder,uploadFilterConfig:e.uploadFilterConfig,parseTimeoutMs:e.parseTimeoutMs,uploadNetworkTimeoutMs:e.uploadNetworkTimeoutMs,adapterConcurrency:e.adapterConcurrency,signal:e.signal});if(o=u.syncState,u.loggedOut)return{threadIDs:r,syncState:o,loggedOut:!0};if(r.push(...u.threadIDs),await e.recorder.markSyncSuccess(u.threadIDs),u.threadIDs.length===0)return{threadIDs:r,syncState:o,loggedOut:!1};for(let l of e.adapters){let f=l.historyFilePath();t.set(f,await Hi(f))}n=[];for(let l of e.adapters){let f=gfe(l.name),h=await l.buildPendingTranscriptWatches(f$(o,f),u.watchBaselineOverrides,{uploadFilterConfig:e.uploadFilterConfig});n=[...n,...h]}if(await e.recorder.setPendingWatchers(n),n.length===0)return{threadIDs:r,syncState:o,loggedOut:!1}}}finally{await e.recorder.setPendingWatchers([])}}async function Htn(e){let t=new Map,n=(_,y)=>{let T=e.cursors[_];return T===void 0?!1:!D9({exists:!0,size:T.sizeBytes,modTimeUnixMs:T.modTimeUnixMs},y)},r=e.minReuploadIntervalMs??0,o=e.now??Date.now,i=o(),s=_=>{if(r<=0)return!1;let y=e.cursors[_];return y===void 0?!1:i-y.lastUploadedAtMs<r};G0(e.signal);let u=await e.adapter.readUnuploadedEntries(e.floor);if($.info("run_upload_adapter_entries_read",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),u.length===0)return{threadIDs:[],cursorUpdates:t,newFloor:e.floor,watchBaselineOverrides:new Map,deferredCount:0};if(!await sn())throw $.warn("run_upload_no_access_token_for_entries",{adapter:e.adapter.name,entryCount:u.length,floor:e.floor}),new h1;$.info("run_upload_access_token_available",{adapter:e.adapter.name,entryCount:u.length}),await e.recorder.markAuthenticated();let f=await e.adapter.collectLocalFiles(u,{uploadFilterConfig:e.uploadFilterConfig,isUnchanged:n,isThrottled:s}),h=f.deferredFileKeys?.size??0;try{if(f.localFiles.length===0){let O=Zet(e.floor,f.entries,f.entryFileKeys,f.skippedFileKeys);return{threadIDs:[],cursorUpdates:t,newFloor:O,watchBaselineOverrides:new Map,deferredCount:h}}let _=await MA(e.client,f.localFiles,{networkTimeoutMs:e.uploadNetworkTimeoutMs}),y=[],T=new Map,v=new Set(f.skippedFileKeys),R=O=>{t.set(O.key,{sizeBytes:O.watchedState.size,modTimeUnixMs:O.watchedState.modTimeUnixMs,md5:O.md5,lastUploadedAtMs:o()})};for(let O of _){let{localFile:P}=O;if(O.status==="quarantined"){$.info("run_upload_quarantine",{filename:P.filename,reason:O.reason,findings:O.findingCount}),v.add(P.key);continue}if(O.status!=="uploaded"){let G=(O.status==="no_upload"?O.error?.trim():"")||`upload session response missing presigned_url for ${P.filename}`;$.info("run_upload_skip",{filename:P.filename,reason:G}),v.add(P.key),R(P);continue}await e.recorder.heartbeat(),G0(e.signal);let j=O.thread?.id?.trim()??"";if(!j){if(P.fileType==="plan"){v.add(P.key),R(P);continue}throw new Error(`complete upload session response missing thread for ${P.filename}`)}y.push(j);try{await $tn(e.client,j,e.recorder,{timeoutMs:e.parseTimeoutMs,signal:e.signal})}catch(G){if(G instanceof Error&&(G.message.includes("timed out waiting for thread")||G.message.includes("parsing failed permanently")||G.message.includes("unexpected transcript parsing state")))$.warn("parse_wait_soft_failure",{threadID:j,filename:P.filename,message:G.message});else throw G}v.add(P.key),R(P),P.sourcePath&&T.set(P.sourcePath,P.watchedState)}let x=Zet(e.floor,f.entries,f.entryFileKeys,v);return{threadIDs:y,cursorUpdates:t,newFloor:x,watchBaselineOverrides:T,deferredCount:h}}finally{await Promise.all(f.localFiles.map(_=>wp(_.tempPath)))}}async function $tn(e,t,n,r={}){let o={...r,onPoll:()=>n.heartbeat()};await VD(e,t,o)}function G0(e){if(e?.aborted)throw new DOMException("The operation was aborted","AbortError")}function ett(e){return e instanceof Error&&e.name==="AbortError"}function qtn(e,t){return t<=0?1:e===void 0?Math.min(Ftn,t):!Number.isFinite(e)||e<1?1:Math.min(Math.floor(e),t)}async function Vtn(e,t,n){let r=new Array(e.length),o=0,i=Math.min(t,e.length),s=Array.from({length:i},async()=>{for(;;){let u=o;if(o+=1,u>=e.length)return;let l=e[u];if(l===void 0)return;r[u]=await n(l)}});return await Promise.all(s),r}function Zet(e,t,n,r){let o=Number.POSITIVE_INFINITY;for(let s=0;s<t.length;s+=1){let u=n[s];u&&r.has(u)||(o=Math.min(o,t[s]?.timestamp??o))}let i=e;for(let s=0;s<t.length;s+=1){let u=n[s];if(!u||!r.has(u))continue;let l=t[s]?.timestamp??i;l<o&&(i=Math.max(i,l))}return i}async function Ytn(e){for(let t of e){let n=await Hi(t.transcriptPath);if(D9(t.baseline,n))return!0}return!1}function Ktn(e,t){let n=e.filter(r=>t<r.expiresAt);return{watchers:n,changed:n.length!==e.length}}m();t$();on();Bn();Mo();import Rb from"node:fs";import{watch as Ztn}from"node:fs/promises";import Efe from"node:path";import{setTimeout as oq}from"node:timers/promises";m();Pr();Bn();var Jtn=6e4,rq=class{client;now;minIntervalMs;lastBeatAt=Number.NEGATIVE_INFINITY;constructor(t={}){this.client=t.client??Gt(),this.now=t.now??Date.now,this.minIntervalMs=t.minIntervalMs??Jtn}async beat(){let t=this.now();t-this.lastBeatAt<this.minIntervalMs||(this.lastBeatAt=t,await this.post({}))}async uploadCompleted(){this.lastBeatAt=this.now(),await this.post({upload_completed:!0})}async post(t){try{await this.client.recordCliHeartbeat({body:t})}catch(n){$.warn("cli_heartbeat_failed",{error:n instanceof Error?n.message:String(n)})}}};var Wtn=2e3,Xtn=6e4,enn=5e3,tnn=ede*3,nnn=5e3,rnn=5*6e4,onn=.2,inn=15e3;function snn(e){return Array.isArray(e)?{threadIDs:e,deferredCount:0}:e}var iq=class extends Error{constructor(t){super(t),this.name="SyncPassDeadlineError"}};function ann(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??hfe).map(n=>n.historyFilePath())}async function ntt(e={}){let t=e.debounceMs??Wtn,n=e.pollIntervalMs,r=n??e.idlePollIntervalMs??Xtn,o=n??e.activePollIntervalMs??enn,i=e.syncDeadlineMs??tnn,s=e.failureBackoffBaseMs??nnn,u=e.failureBackoffMaxMs??rnn,l=e.failureBackoffJitterRatio??onn,f=e.random??Math.random,h=ann(e),_=e.runUploadFn??_fe,y=e.uploadOptions?.minReuploadIntervalMs??e.minReuploadIntervalMs??inn,T=e.uploadOptions?.recorder??new UD,v=e.heartbeatReporter??new rq,R={...e.uploadOptions,recorder:T,tailActiveSessions:!1,onUploadCompleted:()=>{v.uploadCompleted()},minReuploadIntervalMs:y},x=e.signal?void 0:new AbortController,O=e.signal??x.signal,P=()=>x?.abort();x&&(process.once("SIGINT",P),process.once("SIGTERM",P));let j=await cnn(e.lockFilePath??lje());if(!j.acquired){x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P)),$.info("watch_skip_already_running",{pid:j.pid});return}let G=j.release,H=!1,V=!1,ae=0,re=r,_e=async Tt=>{if(H){V=!0;return}H=!0;try{do{if(V=!1,O.aborted)break;if(ae>0){let ye=unn({consecutiveFailures:ae,baseMs:s,maxMs:u,jitterRatio:l,random:f});if($.warn("watch_sync_backoff",{reason:Tt,consecutiveFailures:ae,backoffMs:ye}),await oq(ye,void 0,{signal:O}).catch(()=>{}),O.aborted)break}try{let ye=new AbortController,Je=()=>ye.abort();O.addEventListener("abort",Je,{once:!0});let ot=`sync pass exceeded ${i}ms deadline`,ut,Lt=new Promise((be,mt)=>{ut=setTimeout(()=>{$.error("watch_sync_stuck",{reason:Tt,syncDeadlineMs:i}),T.markStuck(ot).catch(en=>$.warn("watch_mark_stuck_failed",{error:ln(en)})),ye.abort(),mt(new iq(ot))},i),ut.unref?.()}),Gr=_({...R,signal:ye.signal});try{let{threadIDs:be,deferredCount:mt}=snn(await Promise.race([Gr,Lt]));ae=0,re=be.length>0||mt>0?o:r,$.info("watch_sync_complete",{reason:Tt,uploaded:be.length,deferred:mt,nextPollIntervalMs:re})}finally{ut&&clearTimeout(ut),O.removeEventListener("abort",Je),await Gr.catch(()=>{})}}catch(ye){if(O.aborted&&ye?.name==="AbortError")break;ae+=1,!(ye instanceof iq)&&ye?.name!=="AbortError"&&await T.markDegraded(ye).catch(Je=>$.warn("watch_mark_degraded_failed",{error:ln(Je)})),$.error("watch_sync_failed",{reason:Tt,consecutiveFailures:ae,error:ln(ye)})}}while(V&&!O.aborted)}finally{H=!1}},Qe,pt=Tt=>{Qe&&clearTimeout(Qe),Qe=setTimeout(()=>{Qe=void 0,_e(Tt)},t),Qe.unref?.()};$.info("watch_start",{watchPaths:h,debounceMs:t,idlePollIntervalMs:r,activePollIntervalMs:o,syncDeadlineMs:i}),v.beat(),_e("startup");let Ge=async Tt=>{for(;!O.aborted;)try{let ye=Rb.existsSync(Tt)&&Rb.statSync(Tt).isDirectory(),Je=ye?Tt:Efe.dirname(Tt),ot=ye?void 0:Efe.basename(Tt),ut=e.watchEventSource?.({watchDir:Je,watchPath:Tt,recursive:ye,signal:O})??Ztn(Je,{signal:O,recursive:ye});for await(let Lt of ut){if(O.aborted)break;(ot===void 0||!Lt.filename||Lt.filename===ot)&&pt("fs-event")}}catch(ye){if(O.aborted||ye?.name==="AbortError")break;$.warn("watch_fs_retry",{path:Tt,error:ln(ye)}),await oq(r,void 0,{signal:O}).catch(()=>{})}},Pt=async()=>{for(;!O.aborted;){try{await oq(re,void 0,{signal:O})}catch{break}if(O.aborted)break;v.beat(),await _e("poll")}};try{await Promise.all([...h.map(Ge),Pt()])}finally{for(Qe&&clearTimeout(Qe),x&&(process.removeListener("SIGINT",P),process.removeListener("SIGTERM",P));H;)await oq(50).catch(()=>{});await G(),$.info("watch_stop",{})}}function unn(e){let t=e.baseMs*2**Math.max(0,e.consecutiveFailures-1),n=Math.min(e.maxMs,t),r=n*e.jitterRatio,o=r===0?0:(e.random()*2-1)*r;return Math.max(0,Math.round(n+o))}async function cnn(e){if($.info("upload_daemon_lock_check",{lockFilePath:e}),e===!1)return{acquired:!0,release:async()=>{}};for(await Rb.promises.mkdir(Efe.dirname(e),{recursive:!0,mode:448});;)try{let t=await Rb.promises.open(e,"wx",384);return await t.writeFile(JSON.stringify({pid:process.pid,started_at:new Date().toISOString()})),await t.close(),{acquired:!0,release:async()=>{(await ttt(e))?.pid===process.pid&&await Rb.promises.rm(e,{force:!0})}}}catch(t){if(!dnn(t))throw t;let n=await ttt(e);if(n?.pid&&lnn(n.pid))return{acquired:!1,pid:n.pid};await Rb.promises.rm(e,{force:!0})}}async function ttt(e){try{let t=JSON.parse(await Rb.promises.readFile(e,"utf8"));return typeof t.pid=="number"?{pid:t.pid}:{}}catch{return}}function lnn(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}function dnn(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}var rtt={meta:{name:"_run_upload",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously: watch the Claude history file and re-sync on every change. This is the launchd-free daemon `pnpm dev` runs locally.",default:!1}},async run({args:e,data:t}){let n={client:t?.client,...t?.adapters!==void 0?{adapters:t.adapters}:t?.adapter!==void 0?{adapter:t.adapter}:{},recorder:t?.recorder};if(e.watch){await Qet(),await ntt({uploadOptions:n});return}let r=await Wet(n);console.log(JSON.stringify(r))}};m();s0();m();Pr();import{spawn as pnn}from"node:child_process";import ott from"node:path";async function yfe(e){let t=e.progress??A1;if(!await sn())throw new h1;t({kind:"step",step:"resolving_session"});let r=ott.resolve(e.sessionFile),o=ott.basename(r),i=e.harnessInternalId?.trim()||gnn(o)||o,s=await Hi(r);if(!s.exists)throw new Error(`session file does not exist: ${r}`);let u=await fd(r),l={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:u.tempPath,md5:u.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:s},f=e.client??Gt();try{t({kind:"step",step:"uploading",label:o});let[h]=await MA(f,[l]);if(!h)throw new Error("create upload session returned no thread files");if(h.status==="quarantined")return t({kind:"step",step:"done"}),{quarantined:!0,reason:h.reason,finding_count:h.findingCount,session_id:i};if(h.status==="no_upload"){let V=h.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${V}`)}let _=h.status==="deduped",y=h.thread,T=y?.id?.trim();if(!T)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await VD(f,T);let v=y?.visibility?.trim()??"",R=v,x=e.visibility;x&&x!==v&&(t({kind:"step",step:"updating_visibility"}),R=await fnn(f,T,x));let O=`${C0().replace(/\/+$/,"")}/thread/${T}`,P,j=e.highlight?.trim();if(j){t({kind:"step",step:"resolving_highlight"});let V=await tq(f,T,j);V&&(O=V.url,P={query:j,matched:V.matched,start_block_id:V.start_block_id,end_block_id:V.end_block_id})}let G=await hnn(O),H=Ann(R)?R:"private";return t({kind:"completed",url:O,reused:_,visibility:H,clipboardCopied:G,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:T,url:O,session_id:i,project:"",reused:_,visibility:H,clipboard_copied:G,...P?{highlight:P}:{}}}finally{await wp(u.tempPath)}}async function fnn(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw Np(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var mnn=new Set(["private","workspace","public"]);function Ann(e){return mnn.has(e)}function gnn(e){let n=e.replace(/\.jsonl$/i,"").split("-").filter(o=>o.length>0);if(n.length===0)return"";let r=n.slice(-5);return r.length===5&&r.every(o=>/^[0-9a-fA-F]+$/.test(o))?r.join("-"):n[n.length-1]??""}async function hnn(e){let t=process.platform==="darwin"?[{command:"pbcopy",args:[]}]:process.platform==="win32"?[{command:"clip.exe",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];for(let{command:n,args:r}of t)if(await _nn(n,r,e))return!0;return!1}function _nn(e,t,n){return new Promise(r=>{let o;try{o=pnn(e,t,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}o.on("error",()=>r(!1)),o.on("exit",i=>r(i===0)),o.stdin?.on("error",()=>r(!1)),o.stdin?.end(n)})}var itt=["private","workspace","public"],stt={meta:{name:"share-codex",description:"Upload a Codex session rollout (.jsonl) to Lore and print a shareable URL."},args:{"session-file":{type:"string",required:!0,description:"Absolute path to a Codex rollout file (e.g. ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl)"},visibility:{type:"string",required:!1,description:"After upload, set thread visibility to one of: private, workspace, public"},highlight:{type:"string",required:!1,description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e}){let t=e["session-file"];if(typeof t!="string"||t.trim()==="")throw new Error("--session-file is required");let n=Enn(e.visibility);if(vu()){let r=await m1({title:"lore share-codex",subtitle:"sharing this Codex session",perform:o=>yfe({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:o})});"quarantined"in r&&r.quarantined&&console.log(`
|
|
698
698
|
Held locally \u2014 not uploaded. ${r.finding_count} finding(s); reason: ${r.reason}. See \`lore quarantine\`.`)}else{let r=await yfe({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}}};function Enn(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!itt.includes(e))throw new Error(`--visibility must be one of: ${itt.join(", ")}`);return e}}m();Pr();Bn();s0();m();async function Sfe(e,t,n={}){let r=n.progress??A1,{contents:o,accountId:i,orgId:s,sessionId:u}=t;r({kind:"step",step:"resolving_session",label:u});let l=await N9("audit.jsonl",o.transcript),f={key:u,filename:"audit.jsonl",sourcePath:o.transcriptPath,repoOriginPath:"",tempPath:l.tempPath,md5:l.md5,fileType:"transcript",harness:"cowork",harnessInternalId:u,watchedState:{exists:!0,size:0,modTimeUnixMs:0},artifactMetadata:{uploads:o.uploads,outputs:o.outputs}};try{r({kind:"step",step:"uploading"});let[h]=await MA(e,[f]);if(!h)throw new Error("createUploadSession returned no thread files");if(h.status==="quarantined")return{quarantined:!0,reason:h.reason,findingCount:h.findingCount};if(h.status==="no_upload")throw new Error(`createUploadSession returned no presigned_url and no existing thread: ${JSON.stringify(h)}`);let _=h.thread?.id;if(!_)throw new Error(`upload session did not return a thread id: ${JSON.stringify(h)}`);return{threadId:_,duplicate:h.status==="deduped"}}finally{await wp(l.tempPath)}}var att={meta:{name:"share-cowork",description:"Share a Claude Cowork local-agent-mode session to Lore. Defaults to the current session when run from inside one (e.g. by the Cowork agent itself); otherwise shares the most recent local session."},args:{session:{type:"string",description:"Share a specific session by session-id (the bottom-level uuid)"},list:{type:"boolean",description:"List local Cowork sessions (newest first) and exit without sharing"}},async run({args:e,data:t}){$.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=nq();if(e.list){let f=g1(n);if(f.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of f)console.log(Snn(h));return}let r=ynn(n,typeof e.session=="string"?e.session:void 0);if(!r)throw console.error(`No Cowork session found. Tried CWD walk-up and the most recent under
|
|
699
699
|
${n}
|
|
700
700
|
Run with --list to see available sessions.`),new Error("no session resolved");let o=t?.client??Gt(),i=zet(r.sessionDir),s=C0();if(vu()){let f=await m1({title:"lore share-cowork",subtitle:`session ${r.sessionId}`,perform:async h=>{let _=await Sfe(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i},{progress:h});return _.quarantined?(h({kind:"step",step:"done"}),_):(h({kind:"completed",url:`${s.replace(/\/+$/,"")}/thread/${_.threadId}`,reused:_.duplicate,clipboardCopied:!1,sessionId:r.sessionId}),h({kind:"step",step:"done"}),_)}});f.quarantined&&console.log(`
|