@tanagram/lore 0.1.45 → 0.1.46
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 +5 -5
- package/package.json +1 -1
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 mX=Object.create;var Pm=Object.defineProperty;var _X=Object.getOwnPropertyDescriptor;var hX=Object.getOwnPropertyNames;var gX=Object.getPrototypeOf,TX=Object.prototype.hasOwnProperty;var B=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var K=(t,e)=>()=>(t&&(e=t(t=0)),e);var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),oa=(t,e)=>{for(var n in e)Pm(t,n,{get:e[n],enumerable:!0})},I1=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of hX(e))!TX.call(t,o)&&o!==n&&Pm(t,o,{get:()=>e[o],enumerable:!(r=_X(e,o))||r.enumerable});return t};var J=(t,e,n)=>(n=t!=null?mX(gX(t)):{},I1(e||!t||!t.__esModule?Pm(n,"default",{value:t,enumerable:!0}):n,t)),x=t=>I1(Pm({},"__esModule",{value:!0}),t);var c=K(()=>{(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"0.1.45"}}catch{}})()});var es,fA=K(()=>{c();es="1.9.1"});function EX(t){let e=new Set([t]),n=new Set,r=t.match(O1);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(u){return u===t};function s(a){return n.add(a),!1}function i(a){return e.add(a),!0}return function(u){if(e.has(u))return!0;if(n.has(u))return!1;let d=u.match(O1);if(!d)return s(u);let p={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return p.prerelease!=null||o.major!==p.major?s(u):o.major===0?o.minor===p.minor&&o.patch<=p.patch?i(u):s(u):o.minor<=p.minor?i(u):s(u)}}var O1,C1,N1=K(()=>{c();fA();O1=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;C1=EX(es)});function uo(t,e,n,r=!1){var o;let s=Pd[xd]=(o=Pd[xd])!==null&&o!==void 0?o:{version:es};if(!r&&s[t]){let i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return n.error(i.stack||i.message),!1}if(s.version!==es){let i=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${es}`);return n.error(i.stack||i.message),!1}return s[t]=e,n.debug(`@opentelemetry/api: Registered a global for ${t} v${es}.`),!0}function Yn(t){var e,n;let r=(e=Pd[xd])===null||e===void 0?void 0:e.version;if(!(!r||!C1(r)))return(n=Pd[xd])===null||n===void 0?void 0:n[t]}function co(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${es}.`);let n=Pd[xd];n&&delete n[t]}var SX,xd,Pd,sa=K(()=>{c();fA();N1();SX=es.split(".")[0],xd=Symbol.for(`opentelemetry.js.api.${SX}`),Pd=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function Md(t,e,n){let r=Yn("diag");if(r)return r[t](e,...n)}var Mm,x1=K(()=>{c();sa();Mm=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return Md("debug",this._namespace,e)}error(...e){return Md("error",this._namespace,e)}info(...e){return Md("info",this._namespace,e)}warn(...e){return Md("warn",this._namespace,e)}verbose(...e){return Md("verbose",this._namespace,e)}}});var St,vm=K(()=>{c();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(St||(St={}))});function P1(t,e){t<St.NONE?t=St.NONE:t>St.ALL&&(t=St.ALL),e=e||{};function n(r,o){let s=e[r];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return{error:n("error",St.ERROR),warn:n("warn",St.WARN),info:n("info",St.INFO),debug:n("debug",St.DEBUG),verbose:n("verbose",St.VERBOSE)}}var M1=K(()=>{c();vm()});var AX,Ot,ia=K(()=>{c();x1();M1();vm();sa();AX="diag",Ot=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(o){return function(...s){let i=Yn("diag");if(i)return i[o](...s)}}let n=this,r=(o,s={logLevel:St.INFO})=>{var i,a,u;if(o===n){let f=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=f.stack)!==null&&i!==void 0?i:f.message),!1}typeof s=="number"&&(s={logLevel:s});let d=Yn("diag"),p=P1((a=s.logLevel)!==null&&a!==void 0?a:St.INFO,o);if(d&&!s.suppressOverrideMessage){let f=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";d.warn(`Current logger will be overwritten from ${f}`),p.warn(`Current logger will overwrite one already registered from ${f}`)}return uo("diag",p,n,!0)};n.setLogger=r,n.disable=()=>{co(AX,n)},n.createComponentLogger=o=>new Mm(o),n.verbose=e("verbose"),n.debug=e("debug"),n.info=e("info"),n.warn=e("warn"),n.error=e("error")}}});var km,v1=K(()=>{c();km=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let n=this._entries.get(e);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,n){let r=new t(this._entries);return r._entries.set(e,n),r}removeEntry(e){let n=new t(this._entries);return n._entries.delete(e),n}removeEntries(...e){let n=new t(this._entries);for(let r of e)n._entries.delete(r);return n}clear(){return new t}}});var k1,w1=K(()=>{c();k1=Symbol("BaggageEntryMetadata")});function L1(t={}){return new km(new Map(Object.entries(t)))}function D1(t){return typeof t!="string"&&(yX.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:k1,toString(){return t}}}var yX,mA=K(()=>{c();ia();v1();w1();yX=Ot.instance()});function Wn(t){return Symbol.for(t)}var _A,ju,vd=K(()=>{c();_A=class t{constructor(e){let n=this;n._currentContext=e?new Map(e):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let s=new t(n._currentContext);return s._currentContext.set(r,o),s},n.deleteValue=r=>{let o=new t(n._currentContext);return o._currentContext.delete(r),o}}},ju=new _A});var hA,gA,wm,U1=K(()=>{c();hA=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],gA={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(gA[e]=console[e])}wm=class{constructor(){function e(n){return function(...r){let o=gA[n];if(typeof o!="function"&&(o=gA.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<hA.length;n++)this[hA[n].n]=e(hA[n].c)}}});function B1(){return OA}var TA,Hu,EA,SA,AA,yA,kd,bA,RA,IA,OA,bX,RX,IX,OX,CX,NX,xX,CA=K(()=>{c();TA=class{constructor(){}createGauge(e,n){return RX}createHistogram(e,n){return IX}createCounter(e,n){return bX}createUpDownCounter(e,n){return OX}createObservableGauge(e,n){return NX}createObservableCounter(e,n){return CX}createObservableUpDownCounter(e,n){return xX}addBatchObservableCallback(e,n){}removeBatchObservableCallback(e){}},Hu=class{},EA=class extends Hu{add(e,n){}},SA=class extends Hu{add(e,n){}},AA=class extends Hu{record(e,n){}},yA=class extends Hu{record(e,n){}},kd=class{addCallback(e){}removeCallback(e){}},bA=class extends kd{},RA=class extends kd{},IA=class extends kd{},OA=new TA,bX=new EA,RX=new AA,IX=new yA,OX=new SA,CX=new bA,NX=new RA,xX=new IA});var Lm,F1=K(()=>{c();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Lm||(Lm={}))});var Dm,Um,NA=K(()=>{c();Dm={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},Um={set(t,e,n){t!=null&&(t[e]=n)}}});var Bm,G1=K(()=>{c();vd();Bm=class{active(){return ju}with(e,n,r,...o){return n.call(r,...o)}bind(e,n){return n}enable(){return this}disable(){return this}}});var xA,PX,lo,wd=K(()=>{c();G1();sa();ia();xA="context",PX=new Bm,lo=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return uo(xA,e,Ot.instance())}active(){return this._getContextManager().active()}with(e,n,r,...o){return this._getContextManager().with(e,n,r,...o)}bind(e,n){return this._getContextManager().bind(e,n)}_getContextManager(){return Yn(xA)||PX}disable(){this._getContextManager().disable(),co(xA,Ot.instance())}}});var tn,PA=K(()=>{c();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(tn||(tn={}))});var Ld,aa,Fm,Gm=K(()=>{c();PA();Ld="0000000000000000",aa="00000000000000000000000000000000",Fm={traceId:aa,spanId:Ld,traceFlags:tn.NONE}});var po,jm=K(()=>{c();Gm();po=class{constructor(e=Fm){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,n){return this}setAttributes(e){return this}addEvent(e,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,n){}}});function Hm(t){return t.getValue(MA)||void 0}function j1(){return Hm(lo.getInstance().active())}function Dd(t,e){return t.setValue(MA,e)}function H1(t){return t.deleteValue(MA)}function V1(t,e){return Dd(t,new po(e))}function Vm(t){var e;return(e=Hm(t))===null||e===void 0?void 0:e.spanContext()}var MA,vA=K(()=>{c();vd();jm();wd();MA=Wn("OpenTelemetry Context Key SPAN")});function q1(t,e){if(typeof t!="string"||t.length!==e)return!1;let n=0;for(let r=0;r<t.length;r+=4)n+=(qm[t.charCodeAt(r)]|0)+(qm[t.charCodeAt(r+1)]|0)+(qm[t.charCodeAt(r+2)]|0)+(qm[t.charCodeAt(r+3)]|0);return n===e}function kA(t){return q1(t,32)&&t!==aa}function wA(t){return q1(t,16)&&t!==Ld}function ts(t){return kA(t.traceId)&&wA(t.spanId)}function $1(t){return new po(t)}var qm,$m=K(()=>{c();Gm();jm();qm=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 MX(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var LA,Vu,DA=K(()=>{c();wd();vA();jm();$m();LA=lo.getInstance(),Vu=class{startSpan(e,n,r=LA.active()){if(!!n?.root)return new po;let s=r&&Vm(r);return MX(s)&&ts(s)?new po(s):new po}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let u=i??LA.active(),d=this.startSpan(e,s,u),p=Dd(u,d);return LA.with(p,a,void 0,d)}}});var vX,qu,UA=K(()=>{c();DA();vX=new Vu,qu=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}startSpan(e,n,r){return this._getTracer().startSpan(e,n,r)}startActiveSpan(e,n,r,o){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):vX}}});var zm,z1=K(()=>{c();DA();zm=class{getTracer(e,n,r){return new Vu}}});var kX,ua,BA=K(()=>{c();UA();z1();kX=new zm,ua=class{getTracer(e,n,r){var o;return(o=this.getDelegateTracer(e,n,r))!==null&&o!==void 0?o:new qu(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:kX}setDelegate(e){this._delegate=e}getDelegateTracer(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,n,r)}}});var Ym,Y1=K(()=>{c();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Ym||(Ym={}))});var Me,W1=K(()=>{c();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(Me||(Me={}))});var ze,K1=K(()=>{c();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(ze||(ze={}))});function Q1(t){return DX.test(t)}function J1(t){return UX.test(t)&&!BX.test(t)}var FA,wX,LX,DX,UX,BX,X1=K(()=>{c();FA="[_0-9a-z-*/]",wX=`[a-z]${FA}{0,255}`,LX=`[a-z0-9]${FA}{0,240}@[a-z]${FA}{0,13}`,DX=new RegExp(`^(?:${wX}|${LX})$`),UX=/^[ -~]{0,255}[!-~]$/,BX=/,|=/});var Z1,FX,eM,tM,Wm,nM=K(()=>{c();X1();Z1=32,FX=512,eM=",",tM="=",Wm=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,n)=>(e.push(n+tM+this.get(n)),e),[]).join(eM)}_parse(e){e.length>FX||(this._internalState=e.split(eM).reduceRight((n,r)=>{let o=r.trim(),s=o.indexOf(tM);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);Q1(i)&&J1(a)&&n.set(i,a)}return n},new Map),this._internalState.size>Z1&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Z1))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function rM(t){return new Wm(t)}var oM=K(()=>{c();nM()});var k,sM=K(()=>{c();wd();k=lo.getInstance()});var Kn,iM=K(()=>{c();ia();Kn=Ot.instance()});var GA,aM,uM=K(()=>{c();CA();GA=class{getMeter(e,n,r){return OA}},aM=new GA});var jA,Km,cM=K(()=>{c();uM();sa();ia();jA="metrics",Km=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return uo(jA,e,Ot.instance())}getMeterProvider(){return Yn(jA)||aM}getMeter(e,n,r){return this.getMeterProvider().getMeter(e,n,r)}disable(){co(jA,Ot.instance())}}});var HA,lM=K(()=>{c();cM();HA=Km.getInstance()});var Qm,dM=K(()=>{c();Qm=class{inject(e,n){}extract(e,n){return e}fields(){return[]}}});function qA(t){return t.getValue(VA)||void 0}function pM(){return qA(lo.getInstance().active())}function fM(t,e){return t.setValue(VA,e)}function mM(t){return t.deleteValue(VA)}var VA,_M=K(()=>{c();wd();vd();VA=Wn("OpenTelemetry Baggage Key")});var $A,GX,Jm,hM=K(()=>{c();sa();dM();NA();_M();mA();ia();$A="propagation",GX=new Qm,Jm=class t{constructor(){this.createBaggage=L1,this.getBaggage=qA,this.getActiveBaggage=pM,this.setBaggage=fM,this.deleteBaggage=mM}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return uo($A,e,Ot.instance())}inject(e,n,r=Um){return this._getGlobalPropagator().inject(e,n,r)}extract(e,n,r=Dm){return this._getGlobalPropagator().extract(e,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){co($A,Ot.instance())}_getGlobalPropagator(){return Yn($A)||GX}}});var Gr,gM=K(()=>{c();hM();Gr=Jm.getInstance()});var zA,Xm,TM=K(()=>{c();sa();BA();$m();vA();ia();zA="trace",Xm=class t{constructor(){this._proxyTracerProvider=new ua,this.wrapSpanContext=$1,this.isSpanContextValid=ts,this.deleteSpan=H1,this.getSpan=Hm,this.getActiveSpan=j1,this.getSpanContext=Vm,this.setSpan=Dd,this.setSpanContext=V1}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let n=uo(zA,this._proxyTracerProvider,Ot.instance());return n&&this._proxyTracerProvider.setDelegate(e),n}getTracerProvider(){return Yn(zA)||this._proxyTracerProvider}getTracer(e,n){return this.getTracerProvider().getTracer(e,n)}disable(){co(zA,Ot.instance()),this._proxyTracerProvider=new ua}}});var Z,EM=K(()=>{c();TM();Z=Xm.getInstance()});var L={};oa(L,{DiagConsoleLogger:()=>wm,DiagLogLevel:()=>St,INVALID_SPANID:()=>Ld,INVALID_SPAN_CONTEXT:()=>Fm,INVALID_TRACEID:()=>aa,ProxyTracer:()=>qu,ProxyTracerProvider:()=>ua,ROOT_CONTEXT:()=>ju,SamplingDecision:()=>Ym,SpanKind:()=>Me,SpanStatusCode:()=>ze,TraceFlags:()=>tn,ValueType:()=>Lm,baggageEntryMetadataFromString:()=>D1,context:()=>k,createContextKey:()=>Wn,createNoopMeter:()=>B1,createTraceState:()=>rM,default:()=>jX,defaultTextMapGetter:()=>Dm,defaultTextMapSetter:()=>Um,diag:()=>Kn,isSpanContextValid:()=>ts,isValidSpanId:()=>wA,isValidTraceId:()=>kA,metrics:()=>HA,propagation:()=>Gr,trace:()=>Z});var jX,M=K(()=>{c();mA();vd();U1();vm();CA();F1();NA();UA();BA();Y1();W1();K1();PA();oM();$m();Gm();sM();iM();lM();gM();EM();jX={context:k,diag:Kn,metrics:HA,propagation:Gr,trace:Z}});var Ud=E(js=>{"use strict";c();Object.defineProperty(js,"__esModule",{value:!0});js.isTracingSuppressed=js.unsuppressTracing=js.suppressTracing=void 0;var HX=(M(),x(L)),YA=(0,HX.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function VX(t){return t.setValue(YA,!0)}js.suppressTracing=VX;function qX(t){return t.deleteValue(YA)}js.unsuppressTracing=qX;function $X(t){return t.getValue(YA)===!0}js.isTracingSuppressed=$X});var WA=E(nn=>{"use strict";c();Object.defineProperty(nn,"__esModule",{value:!0});nn.BAGGAGE_MAX_TOTAL_LENGTH=nn.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=nn.BAGGAGE_MAX_NAME_VALUE_PAIRS=nn.BAGGAGE_HEADER=nn.BAGGAGE_ITEMS_SEPARATOR=nn.BAGGAGE_PROPERTIES_SEPARATOR=nn.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;nn.BAGGAGE_KEY_PAIR_SEPARATOR="=";nn.BAGGAGE_PROPERTIES_SEPARATOR=";";nn.BAGGAGE_ITEMS_SEPARATOR=",";nn.BAGGAGE_HEADER="baggage";nn.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;nn.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;nn.BAGGAGE_MAX_TOTAL_LENGTH=8192});var KA=E(fo=>{"use strict";c();Object.defineProperty(fo,"__esModule",{value:!0});fo.parseKeyPairsIntoRecord=fo.parsePairKeyValue=fo.getKeyPairs=fo.serializeKeyPairs=void 0;var zX=(M(),x(L)),$u=WA();function YX(t){return t.reduce((e,n)=>{let r=`${e}${e!==""?$u.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>$u.BAGGAGE_MAX_TOTAL_LENGTH?e:r},"")}fo.serializeKeyPairs=YX;function WX(t){return t.getAllEntries().map(([e,n])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=$u.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}fo.getKeyPairs=WX;function SM(t){if(!t)return;let e=t.indexOf($u.BAGGAGE_PROPERTIES_SEPARATOR),n=e===-1?t:t.substring(0,e),r=n.indexOf($u.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),s=n.substring(r+1).trim();if(!o||!s)return;let i,a;try{i=decodeURIComponent(o),a=decodeURIComponent(s)}catch{return}let u;if(e!==-1&&e<t.length-1){let d=t.substring(e+1);u=(0,zX.baggageEntryMetadataFromString)(d)}return{key:i,value:a,metadata:u}}fo.parsePairKeyValue=SM;function KX(t){let e={};return typeof t=="string"&&t.length>0&&t.split($u.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=SM(n);r!==void 0&&r.value.length>0&&(e[r.key]=r.value)}),e}fo.parseKeyPairsIntoRecord=KX});var AM=E(Zm=>{"use strict";c();Object.defineProperty(Zm,"__esModule",{value:!0});Zm.W3CBaggagePropagator=void 0;var QA=(M(),x(L)),QX=Ud(),ca=WA(),JA=KA(),XA=class{inject(e,n,r){let o=QA.propagation.getBaggage(e);if(!o||(0,QX.isTracingSuppressed)(e))return;let s=(0,JA.getKeyPairs)(o).filter(a=>a.length<=ca.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,ca.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,JA.serializeKeyPairs)(s);i.length>0&&r.set(n,ca.BAGGAGE_HEADER,i)}extract(e,n,r){let o=r.get(n,ca.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(ca.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let i={};return s.length===0||(s.split(ca.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let d=(0,JA.parsePairKeyValue)(u);if(d){let p={value:d.value};d.metadata&&(p.metadata=d.metadata),i[d.key]=p}}),Object.entries(i).length===0)?e:QA.propagation.setBaggage(e,QA.propagation.createBaggage(i))}fields(){return[ca.BAGGAGE_HEADER]}};Zm.W3CBaggagePropagator=XA});var yM=E(e_=>{"use strict";c();Object.defineProperty(e_,"__esModule",{value:!0});e_.AnchoredClock=void 0;var ZA=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,n){this._monotonicClock=n,this._epochMillis=e.now(),this._performanceMillis=n.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};e_.AnchoredClock=ZA});var CM=E(Hs=>{"use strict";c();Object.defineProperty(Hs,"__esModule",{value:!0});Hs.isAttributeValue=Hs.isAttributeKey=Hs.sanitizeAttributes=void 0;var bM=(M(),x(L));function JX(t){let e={};if(typeof t!="object"||t==null)return e;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(!RM(n)){bM.diag.warn(`Invalid attribute key: ${n}`);continue}let r=t[n];if(!IM(r)){bM.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?e[n]=r.slice():e[n]=r}return e}Hs.sanitizeAttributes=JX;function RM(t){return typeof t=="string"&&t!==""}Hs.isAttributeKey=RM;function IM(t){return t==null?!0:Array.isArray(t)?XX(t):OM(typeof t)}Hs.isAttributeValue=IM;function XX(t){let e;for(let n of t){if(n==null)continue;let r=typeof n;if(r!==e){if(!e){if(OM(r)){e=r;continue}return!1}return!1}}return!0}function OM(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}});var ey=E(t_=>{"use strict";c();Object.defineProperty(t_,"__esModule",{value:!0});t_.loggingErrorHandler=void 0;var ZX=(M(),x(L));function eZ(){return t=>{ZX.diag.error(tZ(t))}}t_.loggingErrorHandler=eZ;function tZ(t){return typeof t=="string"?t:JSON.stringify(nZ(t))}function nZ(t){let e={},n=t;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(e[r])return;let o=n[r];o&&(e[r]=String(o))}),n=Object.getPrototypeOf(n);return e}});var xM=E(zu=>{"use strict";c();Object.defineProperty(zu,"__esModule",{value:!0});zu.globalErrorHandler=zu.setGlobalErrorHandler=void 0;var rZ=ey(),NM=(0,rZ.loggingErrorHandler)();function oZ(t){NM=t}zu.setGlobalErrorHandler=oZ;function sZ(t){try{NM(t)}catch{}}zu.globalErrorHandler=sZ});var kM=E(mo=>{"use strict";c();Object.defineProperty(mo,"__esModule",{value:!0});mo.getStringListFromEnv=mo.getBooleanFromEnv=mo.getStringFromEnv=mo.getNumberFromEnv=void 0;var PM=(M(),x(L)),MM=B("util");function iZ(t){let e=process.env[t];if(e==null||e.trim()==="")return;let n=Number(e);if(isNaN(n)){PM.diag.warn(`Unknown value ${(0,MM.inspect)(e)} for ${t}, expected a number, using defaults`);return}return n}mo.getNumberFromEnv=iZ;function vM(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}mo.getStringFromEnv=vM;function aZ(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||PM.diag.warn(`Unknown value ${(0,MM.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}mo.getBooleanFromEnv=aZ;function uZ(t){return vM(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}mo.getStringListFromEnv=uZ});var wM=E(n_=>{"use strict";c();Object.defineProperty(n_,"__esModule",{value:!0});n_._globalThis=void 0;n_._globalThis=globalThis});var LM=E(r_=>{"use strict";c();Object.defineProperty(r_,"__esModule",{value:!0});r_.VERSION=void 0;r_.VERSION="2.6.1"});function et(t){let e={},n=t.length;for(let r=0;r<n;r++){let o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var ty=K(()=>{c()});var DM,UM,BM,FM,GM,jM,HM,VM,qM,$M,zM,YM,WM,KM,QM,JM,XM,ZM,ev,tv,nv,rv,ov,sv,iv,av,uv,cv,lv,dv,pv,fv,mv,_v,hv,gv,Tv,Ev,Sv,Av,yv,bv,Rv,Iv,Ov,Cv,Nv,xv,Pv,Mv,vv,kv,wv,Lv,Dv,Uv,Bv,Fv,Gv,jv,Hv,Vv,qv,$v,zv,Yv,Wv,Kv,Qv,Jv,Xv,Zv,ek,tk,nk,rk,ok,sk,ik,ak,uk,ck,lk,dk,pk,fk,mk,_k,hk,gk,Tk,Ek,Sk,Ak,yk,bk,Rk,Ik,Ok,Ck,Nk,xk,Pk,Mk,vk,kk,wk,Lk,Dk,Uk,Bk,Fk,Gk,jk,Hk,Vk,qk,$k,zk,Yk,Wk,Kk,Qk,Jk,Xk,Zk,ew,tw,cZ,ny,lZ,dZ,pZ,fZ,ry,mZ,_Z,hZ,gZ,TZ,EZ,SZ,AZ,yZ,bZ,RZ,IZ,OZ,CZ,NZ,xZ,PZ,MZ,oy,vZ,kZ,wZ,LZ,DZ,UZ,BZ,FZ,GZ,jZ,HZ,VZ,sy,qZ,$Z,iy,ay,zZ,YZ,WZ,KZ,QZ,JZ,XZ,ZZ,eee,tee,nee,ree,oee,see,iee,aee,uee,Bd,Yu,uy,cee,lee,la,dee,pee,fee,mee,cy,ly,_ee,dy,hee,gee,Tee,Eee,See,Aee,yee,bee,Ree,Iee,Oee,Cee,Nee,xee,Pee,Mee,vee,kee,wee,Lee,Dee,Uee,Bee,py,Fee,Gee,jee,Hee,Vee,qee,$ee,zee,Yee,Wee,Kee,Qee,Jee,Xee,Zee,ete,tte,nte,rte,fy,ote,my,ste,ite,ate,ute,cte,lte,dte,pte,fte,nw,rw,ow,sw,iw,aw,uw,cw,lw,dw,pw,fw,mw,_w,hw,gw,Tw,Ew,Sw,Aw,yw,bw,Rw,Iw,Ow,Cw,Nw,xw,Pw,Mw,vw,kw,ww,Lw,Dw,Uw,Bw,Fw,Gw,jw,Hw,Vw,qw,$w,zw,Yw,Ww,mte,_te,hte,gte,Tte,Ete,Ste,Ate,yte,bte,Rte,Ite,Ote,Cte,Nte,xte,Pte,Mte,vte,kte,wte,Lte,Dte,Ute,Bte,Fte,Gte,jte,Hte,Vte,qte,$te,zte,Yte,Wte,Kte,Qte,Jte,Xte,Zte,ene,tne,nne,rne,one,sne,ine,ane,Kw,Qw,Jw,Xw,Zw,eL,tL,nL,rL,oL,sL,une,cne,lne,dne,pne,fne,mne,_ne,hne,gne,Tne,Ene,iL,aL,uL,cL,lL,Sne,Ane,yne,bne,Rne,Ine,dL,pL,fL,One,Cne,Nne,xne,mL,_L,hL,gL,Pne,Mne,vne,kne,wne,TL,EL,SL,AL,yL,bL,RL,Lne,Dne,Une,Bne,Fne,Gne,jne,Hne,IL,OL,CL,NL,xL,Vne,qne,$ne,zne,Yne,Wne,PL,ML,vL,kL,wL,LL,DL,UL,BL,FL,GL,jL,HL,VL,qL,$L,zL,YL,WL,KL,QL,Kne,Qne,Jne,Xne,Zne,ere,tre,nre,rre,ore,sre,ire,are,ure,cre,lre,dre,pre,fre,mre,_re,hre,JL,XL,ZL,eD,tD,gre,Tre,Ere,Sre,Are,yre,nD,rD,bre,Rre,Ire,oD,sD,Ore,Cre,Nre,iD,aD,uD,cD,lD,dD,pD,fD,mD,_D,hD,gD,TD,ED,SD,AD,yD,xre,Pre,Mre,vre,kre,wre,Lre,Dre,Ure,Bre,Fre,Gre,jre,Hre,Vre,qre,$re,zre,bD,RD,Yre,Wre,Kre,ID=K(()=>{c();ty();DM="aws.lambda.invoked_arn",UM="db.system",BM="db.connection_string",FM="db.user",GM="db.jdbc.driver_classname",jM="db.name",HM="db.statement",VM="db.operation",qM="db.mssql.instance_name",$M="db.cassandra.keyspace",zM="db.cassandra.page_size",YM="db.cassandra.consistency_level",WM="db.cassandra.table",KM="db.cassandra.idempotence",QM="db.cassandra.speculative_execution_count",JM="db.cassandra.coordinator.id",XM="db.cassandra.coordinator.dc",ZM="db.hbase.namespace",ev="db.redis.database_index",tv="db.mongodb.collection",nv="db.sql.table",rv="exception.type",ov="exception.message",sv="exception.stacktrace",iv="exception.escaped",av="faas.trigger",uv="faas.execution",cv="faas.document.collection",lv="faas.document.operation",dv="faas.document.time",pv="faas.document.name",fv="faas.time",mv="faas.cron",_v="faas.coldstart",hv="faas.invoked_name",gv="faas.invoked_provider",Tv="faas.invoked_region",Ev="net.transport",Sv="net.peer.ip",Av="net.peer.port",yv="net.peer.name",bv="net.host.ip",Rv="net.host.port",Iv="net.host.name",Ov="net.host.connection.type",Cv="net.host.connection.subtype",Nv="net.host.carrier.name",xv="net.host.carrier.mcc",Pv="net.host.carrier.mnc",Mv="net.host.carrier.icc",vv="peer.service",kv="enduser.id",wv="enduser.role",Lv="enduser.scope",Dv="thread.id",Uv="thread.name",Bv="code.function",Fv="code.namespace",Gv="code.filepath",jv="code.lineno",Hv="http.method",Vv="http.url",qv="http.target",$v="http.host",zv="http.scheme",Yv="http.status_code",Wv="http.flavor",Kv="http.user_agent",Qv="http.request_content_length",Jv="http.request_content_length_uncompressed",Xv="http.response_content_length",Zv="http.response_content_length_uncompressed",ek="http.server_name",tk="http.route",nk="http.client_ip",rk="aws.dynamodb.table_names",ok="aws.dynamodb.consumed_capacity",sk="aws.dynamodb.item_collection_metrics",ik="aws.dynamodb.provisioned_read_capacity",ak="aws.dynamodb.provisioned_write_capacity",uk="aws.dynamodb.consistent_read",ck="aws.dynamodb.projection",lk="aws.dynamodb.limit",dk="aws.dynamodb.attributes_to_get",pk="aws.dynamodb.index_name",fk="aws.dynamodb.select",mk="aws.dynamodb.global_secondary_indexes",_k="aws.dynamodb.local_secondary_indexes",hk="aws.dynamodb.exclusive_start_table",gk="aws.dynamodb.table_count",Tk="aws.dynamodb.scan_forward",Ek="aws.dynamodb.segment",Sk="aws.dynamodb.total_segments",Ak="aws.dynamodb.count",yk="aws.dynamodb.scanned_count",bk="aws.dynamodb.attribute_definitions",Rk="aws.dynamodb.global_secondary_index_updates",Ik="messaging.system",Ok="messaging.destination",Ck="messaging.destination_kind",Nk="messaging.temp_destination",xk="messaging.protocol",Pk="messaging.protocol_version",Mk="messaging.url",vk="messaging.message_id",kk="messaging.conversation_id",wk="messaging.message_payload_size_bytes",Lk="messaging.message_payload_compressed_size_bytes",Dk="messaging.operation",Uk="messaging.consumer_id",Bk="messaging.rabbitmq.routing_key",Fk="messaging.kafka.message_key",Gk="messaging.kafka.consumer_group",jk="messaging.kafka.client_id",Hk="messaging.kafka.partition",Vk="messaging.kafka.tombstone",qk="rpc.system",$k="rpc.service",zk="rpc.method",Yk="rpc.grpc.status_code",Wk="rpc.jsonrpc.version",Kk="rpc.jsonrpc.request_id",Qk="rpc.jsonrpc.error_code",Jk="rpc.jsonrpc.error_message",Xk="message.type",Zk="message.id",ew="message.compressed_size",tw="message.uncompressed_size",cZ=DM,ny=UM,lZ=BM,dZ=FM,pZ=GM,fZ=jM,ry=HM,mZ=VM,_Z=qM,hZ=$M,gZ=zM,TZ=YM,EZ=WM,SZ=KM,AZ=QM,yZ=JM,bZ=XM,RZ=ZM,IZ=ev,OZ=tv,CZ=nv,NZ=rv,xZ=ov,PZ=sv,MZ=iv,oy=av,vZ=uv,kZ=cv,wZ=lv,LZ=dv,DZ=pv,UZ=fv,BZ=mv,FZ=_v,GZ=hv,jZ=gv,HZ=Tv,VZ=Ev,sy=Sv,qZ=Av,$Z=yv,iy=bv,ay=Rv,zZ=Iv,YZ=Ov,WZ=Cv,KZ=Nv,QZ=xv,JZ=Pv,XZ=Mv,ZZ=vv,eee=kv,tee=wv,nee=Lv,ree=Dv,oee=Uv,see=Bv,iee=Fv,aee=Gv,uee=jv,Bd=Hv,Yu=Vv,uy=qv,cee=$v,lee=zv,la=Yv,dee=Wv,pee=Kv,fee=Qv,mee=Jv,cy=Xv,ly=Zv,_ee=ek,dy=tk,hee=nk,gee=rk,Tee=ok,Eee=sk,See=ik,Aee=ak,yee=uk,bee=ck,Ree=lk,Iee=dk,Oee=pk,Cee=fk,Nee=mk,xee=_k,Pee=hk,Mee=gk,vee=Tk,kee=Ek,wee=Sk,Lee=Ak,Dee=yk,Uee=bk,Bee=Rk,py=Ik,Fee=Ok,Gee=Ck,jee=Nk,Hee=xk,Vee=Pk,qee=Mk,$ee=vk,zee=kk,Yee=wk,Wee=Lk,Kee=Dk,Qee=Uk,Jee=Bk,Xee=Fk,Zee=Gk,ete=jk,tte=Hk,nte=Vk,rte=qk,fy=$k,ote=zk,my=Yk,ste=Wk,ite=Kk,ate=Qk,ute=Jk,cte=Xk,lte=Zk,dte=ew,pte=tw,fte=et([DM,UM,BM,FM,GM,jM,HM,VM,qM,$M,zM,YM,WM,KM,QM,JM,XM,ZM,ev,tv,nv,rv,ov,sv,iv,av,uv,cv,lv,dv,pv,fv,mv,_v,hv,gv,Tv,Ev,Sv,Av,yv,bv,Rv,Iv,Ov,Cv,Nv,xv,Pv,Mv,vv,kv,wv,Lv,Dv,Uv,Bv,Fv,Gv,jv,Hv,Vv,qv,$v,zv,Yv,Wv,Kv,Qv,Jv,Xv,Zv,ek,tk,nk,rk,ok,sk,ik,ak,uk,ck,lk,dk,pk,fk,mk,_k,hk,gk,Tk,Ek,Sk,Ak,yk,bk,Rk,Ik,Ok,Ck,Nk,xk,Pk,Mk,vk,kk,wk,Lk,Dk,Uk,Bk,Fk,Gk,jk,Hk,Vk,qk,$k,zk,Yk,Wk,Kk,Qk,Jk,Xk,Zk,ew,tw]),nw="other_sql",rw="mssql",ow="mysql",sw="oracle",iw="db2",aw="postgresql",uw="redshift",cw="hive",lw="cloudscape",dw="hsqldb",pw="progress",fw="maxdb",mw="hanadb",_w="ingres",hw="firstsql",gw="edb",Tw="cache",Ew="adabas",Sw="firebird",Aw="derby",yw="filemaker",bw="informix",Rw="instantdb",Iw="interbase",Ow="mariadb",Cw="netezza",Nw="pervasive",xw="pointbase",Pw="sqlite",Mw="sybase",vw="teradata",kw="vertica",ww="h2",Lw="coldfusion",Dw="cassandra",Uw="hbase",Bw="mongodb",Fw="redis",Gw="couchbase",jw="couchdb",Hw="cosmosdb",Vw="dynamodb",qw="neo4j",$w="geode",zw="elasticsearch",Yw="memcached",Ww="cockroachdb",mte=nw,_te=rw,hte=ow,gte=sw,Tte=iw,Ete=aw,Ste=uw,Ate=cw,yte=lw,bte=dw,Rte=pw,Ite=fw,Ote=mw,Cte=_w,Nte=hw,xte=gw,Pte=Tw,Mte=Ew,vte=Sw,kte=Aw,wte=yw,Lte=bw,Dte=Rw,Ute=Iw,Bte=Ow,Fte=Cw,Gte=Nw,jte=xw,Hte=Pw,Vte=Mw,qte=vw,$te=kw,zte=ww,Yte=Lw,Wte=Dw,Kte=Uw,Qte=Bw,Jte=Fw,Xte=Gw,Zte=jw,ene=Hw,tne=Vw,nne=qw,rne=$w,one=zw,sne=Yw,ine=Ww,ane=et([nw,rw,ow,sw,iw,aw,uw,cw,lw,dw,pw,fw,mw,_w,hw,gw,Tw,Ew,Sw,Aw,yw,bw,Rw,Iw,Ow,Cw,Nw,xw,Pw,Mw,vw,kw,ww,Lw,Dw,Uw,Bw,Fw,Gw,jw,Hw,Vw,qw,$w,zw,Yw,Ww]),Kw="all",Qw="each_quorum",Jw="quorum",Xw="local_quorum",Zw="one",eL="two",tL="three",nL="local_one",rL="any",oL="serial",sL="local_serial",une=Kw,cne=Qw,lne=Jw,dne=Xw,pne=Zw,fne=eL,mne=tL,_ne=nL,hne=rL,gne=oL,Tne=sL,Ene=et([Kw,Qw,Jw,Xw,Zw,eL,tL,nL,rL,oL,sL]),iL="datasource",aL="http",uL="pubsub",cL="timer",lL="other",Sne=iL,Ane=aL,yne=uL,bne=cL,Rne=lL,Ine=et([iL,aL,uL,cL,lL]),dL="insert",pL="edit",fL="delete",One=dL,Cne=pL,Nne=fL,xne=et([dL,pL,fL]),mL="alibaba_cloud",_L="aws",hL="azure",gL="gcp",Pne=mL,Mne=_L,vne=hL,kne=gL,wne=et([mL,_L,hL,gL]),TL="ip_tcp",EL="ip_udp",SL="ip",AL="unix",yL="pipe",bL="inproc",RL="other",Lne=TL,Dne=EL,Une=SL,Bne=AL,Fne=yL,Gne=bL,jne=RL,Hne=et([TL,EL,SL,AL,yL,bL,RL]),IL="wifi",OL="wired",CL="cell",NL="unavailable",xL="unknown",Vne=IL,qne=OL,$ne=CL,zne=NL,Yne=xL,Wne=et([IL,OL,CL,NL,xL]),PL="gprs",ML="edge",vL="umts",kL="cdma",wL="evdo_0",LL="evdo_a",DL="cdma2000_1xrtt",UL="hsdpa",BL="hsupa",FL="hspa",GL="iden",jL="evdo_b",HL="lte",VL="ehrpd",qL="hspap",$L="gsm",zL="td_scdma",YL="iwlan",WL="nr",KL="nrnsa",QL="lte_ca",Kne=PL,Qne=ML,Jne=vL,Xne=kL,Zne=wL,ere=LL,tre=DL,nre=UL,rre=BL,ore=FL,sre=GL,ire=jL,are=HL,ure=VL,cre=qL,lre=$L,dre=zL,pre=YL,fre=WL,mre=KL,_re=QL,hre=et([PL,ML,vL,kL,wL,LL,DL,UL,BL,FL,GL,jL,HL,VL,qL,$L,zL,YL,WL,KL,QL]),JL="1.0",XL="1.1",ZL="2.0",eD="SPDY",tD="QUIC",gre=JL,Tre=XL,Ere=ZL,Sre=eD,Are=tD,yre={HTTP_1_0:JL,HTTP_1_1:XL,HTTP_2_0:ZL,SPDY:eD,QUIC:tD},nD="queue",rD="topic",bre=nD,Rre=rD,Ire=et([nD,rD]),oD="receive",sD="process",Ore=oD,Cre=sD,Nre=et([oD,sD]),iD=0,aD=1,uD=2,cD=3,lD=4,dD=5,pD=6,fD=7,mD=8,_D=9,hD=10,gD=11,TD=12,ED=13,SD=14,AD=15,yD=16,xre=iD,Pre=aD,Mre=uD,vre=cD,kre=lD,wre=dD,Lre=pD,Dre=fD,Ure=mD,Bre=_D,Fre=hD,Gre=gD,jre=TD,Hre=ED,Vre=SD,qre=AD,$re=yD,zre={OK:iD,CANCELLED:aD,UNKNOWN:uD,INVALID_ARGUMENT:cD,DEADLINE_EXCEEDED:lD,NOT_FOUND:dD,ALREADY_EXISTS:pD,PERMISSION_DENIED:fD,RESOURCE_EXHAUSTED:mD,FAILED_PRECONDITION:_D,ABORTED:hD,OUT_OF_RANGE:gD,UNIMPLEMENTED:TD,INTERNAL:ED,UNAVAILABLE:SD,DATA_LOSS:AD,UNAUTHENTICATED:yD},bD="SENT",RD="RECEIVED",Yre=bD,Wre=RD,Kre=et([bD,RD])});var OD=K(()=>{c();ID()});var CD,ND,xD,PD,MD,vD,kD,wD,LD,DD,UD,BD,FD,GD,jD,HD,VD,qD,$D,zD,YD,WD,KD,QD,JD,XD,ZD,e2,t2,n2,r2,o2,s2,i2,a2,u2,c2,l2,d2,p2,f2,m2,_2,h2,g2,T2,E2,S2,A2,y2,b2,R2,I2,O2,C2,N2,x2,P2,M2,v2,k2,w2,L2,D2,U2,B2,F2,G2,j2,H2,V2,q2,$2,z2,Y2,W2,K2,Q2,J2,X2,Z2,Qre,Jre,Xre,Zre,eoe,toe,noe,roe,ooe,soe,ioe,aoe,uoe,coe,loe,doe,poe,foe,moe,_oe,hoe,goe,Toe,Eoe,Soe,Aoe,yoe,boe,Roe,Ioe,Ooe,Coe,Noe,xoe,Poe,Moe,voe,koe,woe,Loe,Doe,Uoe,Boe,Foe,Goe,joe,Hoe,Voe,qoe,$oe,zoe,Yoe,Woe,Koe,Qoe,Joe,Xoe,Zoe,ese,tse,nse,rse,ose,sse,ise,ase,use,cse,lse,dse,pse,_y,fse,mse,_se,hse,gse,Tse,Ese,Sse,Ase,yse,eU,tU,nU,rU,bse,Rse,Ise,Ose,Cse,oU,sU,iU,aU,uU,cU,lU,dU,pU,fU,mU,_U,hU,gU,TU,EU,SU,Nse,xse,Pse,Mse,vse,kse,wse,Lse,Dse,Use,Bse,Fse,Gse,jse,Hse,Vse,qse,$se,AU,yU,zse,Yse,Wse,bU,RU,IU,OU,CU,NU,xU,Kse,Qse,Jse,Xse,Zse,eie,tie,nie,PU,MU,vU,kU,wU,LU,DU,UU,BU,FU,GU,rie,oie,sie,iie,aie,uie,cie,lie,die,pie,fie,mie,jU,HU,VU,qU,$U,zU,YU,WU,KU,QU,_ie,hie,gie,Tie,Eie,Sie,Aie,yie,bie,Rie,Iie,JU=K(()=>{c();ty();CD="cloud.provider",ND="cloud.account.id",xD="cloud.region",PD="cloud.availability_zone",MD="cloud.platform",vD="aws.ecs.container.arn",kD="aws.ecs.cluster.arn",wD="aws.ecs.launchtype",LD="aws.ecs.task.arn",DD="aws.ecs.task.family",UD="aws.ecs.task.revision",BD="aws.eks.cluster.arn",FD="aws.log.group.names",GD="aws.log.group.arns",jD="aws.log.stream.names",HD="aws.log.stream.arns",VD="container.name",qD="container.id",$D="container.runtime",zD="container.image.name",YD="container.image.tag",WD="deployment.environment",KD="device.id",QD="device.model.identifier",JD="device.model.name",XD="faas.name",ZD="faas.id",e2="faas.version",t2="faas.instance",n2="faas.max_memory",r2="host.id",o2="host.name",s2="host.type",i2="host.arch",a2="host.image.name",u2="host.image.id",c2="host.image.version",l2="k8s.cluster.name",d2="k8s.node.name",p2="k8s.node.uid",f2="k8s.namespace.name",m2="k8s.pod.uid",_2="k8s.pod.name",h2="k8s.container.name",g2="k8s.replicaset.uid",T2="k8s.replicaset.name",E2="k8s.deployment.uid",S2="k8s.deployment.name",A2="k8s.statefulset.uid",y2="k8s.statefulset.name",b2="k8s.daemonset.uid",R2="k8s.daemonset.name",I2="k8s.job.uid",O2="k8s.job.name",C2="k8s.cronjob.uid",N2="k8s.cronjob.name",x2="os.type",P2="os.description",M2="os.name",v2="os.version",k2="process.pid",w2="process.executable.name",L2="process.executable.path",D2="process.command",U2="process.command_line",B2="process.command_args",F2="process.owner",G2="process.runtime.name",j2="process.runtime.version",H2="process.runtime.description",V2="service.name",q2="service.namespace",$2="service.instance.id",z2="service.version",Y2="telemetry.sdk.name",W2="telemetry.sdk.language",K2="telemetry.sdk.version",Q2="telemetry.auto.version",J2="webengine.name",X2="webengine.version",Z2="webengine.description",Qre=CD,Jre=ND,Xre=xD,Zre=PD,eoe=MD,toe=vD,noe=kD,roe=wD,ooe=LD,soe=DD,ioe=UD,aoe=BD,uoe=FD,coe=GD,loe=jD,doe=HD,poe=VD,foe=qD,moe=$D,_oe=zD,hoe=YD,goe=WD,Toe=KD,Eoe=QD,Soe=JD,Aoe=XD,yoe=ZD,boe=e2,Roe=t2,Ioe=n2,Ooe=r2,Coe=o2,Noe=s2,xoe=i2,Poe=a2,Moe=u2,voe=c2,koe=l2,woe=d2,Loe=p2,Doe=f2,Uoe=m2,Boe=_2,Foe=h2,Goe=g2,joe=T2,Hoe=E2,Voe=S2,qoe=A2,$oe=y2,zoe=b2,Yoe=R2,Woe=I2,Koe=O2,Qoe=C2,Joe=N2,Xoe=x2,Zoe=P2,ese=M2,tse=v2,nse=k2,rse=w2,ose=L2,sse=D2,ise=U2,ase=B2,use=F2,cse=G2,lse=j2,dse=H2,pse=V2,_y=q2,fse=$2,mse=z2,_se=Y2,hse=W2,gse=K2,Tse=Q2,Ese=J2,Sse=X2,Ase=Z2,yse=et([CD,ND,xD,PD,MD,vD,kD,wD,LD,DD,UD,BD,FD,GD,jD,HD,VD,qD,$D,zD,YD,WD,KD,QD,JD,XD,ZD,e2,t2,n2,r2,o2,s2,i2,a2,u2,c2,l2,d2,p2,f2,m2,_2,h2,g2,T2,E2,S2,A2,y2,b2,R2,I2,O2,C2,N2,x2,P2,M2,v2,k2,w2,L2,D2,U2,B2,F2,G2,j2,H2,V2,q2,$2,z2,Y2,W2,K2,Q2,J2,X2,Z2]),eU="alibaba_cloud",tU="aws",nU="azure",rU="gcp",bse=eU,Rse=tU,Ise=nU,Ose=rU,Cse=et([eU,tU,nU,rU]),oU="alibaba_cloud_ecs",sU="alibaba_cloud_fc",iU="aws_ec2",aU="aws_ecs",uU="aws_eks",cU="aws_lambda",lU="aws_elastic_beanstalk",dU="azure_vm",pU="azure_container_instances",fU="azure_aks",mU="azure_functions",_U="azure_app_service",hU="gcp_compute_engine",gU="gcp_cloud_run",TU="gcp_kubernetes_engine",EU="gcp_cloud_functions",SU="gcp_app_engine",Nse=oU,xse=sU,Pse=iU,Mse=aU,vse=uU,kse=cU,wse=lU,Lse=dU,Dse=pU,Use=fU,Bse=mU,Fse=_U,Gse=hU,jse=gU,Hse=TU,Vse=EU,qse=SU,$se=et([oU,sU,iU,aU,uU,cU,lU,dU,pU,fU,mU,_U,hU,gU,TU,EU,SU]),AU="ec2",yU="fargate",zse=AU,Yse=yU,Wse=et([AU,yU]),bU="amd64",RU="arm32",IU="arm64",OU="ia64",CU="ppc32",NU="ppc64",xU="x86",Kse=bU,Qse=RU,Jse=IU,Xse=OU,Zse=CU,eie=NU,tie=xU,nie=et([bU,RU,IU,OU,CU,NU,xU]),PU="windows",MU="linux",vU="darwin",kU="freebsd",wU="netbsd",LU="openbsd",DU="dragonflybsd",UU="hpux",BU="aix",FU="solaris",GU="z_os",rie=PU,oie=MU,sie=vU,iie=kU,aie=wU,uie=LU,cie=DU,lie=UU,die=BU,pie=FU,fie=GU,mie=et([PU,MU,vU,kU,wU,LU,DU,UU,BU,FU,GU]),jU="cpp",HU="dotnet",VU="erlang",qU="go",$U="java",zU="nodejs",YU="php",WU="python",KU="ruby",QU="webjs",_ie=jU,hie=HU,gie=VU,Tie=qU,Eie=$U,Sie=zU,Aie=YU,yie=WU,bie=KU,Rie=QU,Iie=et([jU,HU,VU,qU,$U,zU,YU,WU,KU,QU])});var XU=K(()=>{c();JU()});var Oie,Cie,Nie,xie,Pie,Mie,vie,kie,wie,Lie,Die,Uie,Bie,Fie,Gie,jie,Hie,Vie,qie,$ie,zie,Yie,Wie,Kie,Qie,hy,gy,Jie,Wu,Xie,Ty,Ey,Zie,da,eae,tae,nae,rae,oae,sae,iae,aae,uae,cae,Sy,lae,dae,pae,fae,mae,_ae,pa,hae,gae,Tae,Eae,Sae,Aae,yae,bae,Rae,Iae,Oae,Cae,Nae,ns,rs,xae,Pae,Mae,vae,kae,wae,Lae,Dae,Uae,Bae,Fae,Gae,jae,Hae,Vae,qae,Ay,yy,$ae,by,Ry,zae,Yae,Wae,Kae,Qae,Jae,Xae,Zae,eue,tue,nue,rue,oue,sue,Iy,Oy,iue,Cy,aue,Ny,uue,cue,lue,due,pue,fue,mue,_ue,hue,gue,Tue,Eue,Sue,Aue,yue,bue,Rue,Iue,Oue,Cue,Nue,xue,Pue,Mue,Vs,vue,kue,wue,xy,ZU=K(()=>{c();Oie="aspnetcore.diagnostics.exception.result",Cie="aborted",Nie="handled",xie="skipped",Pie="unhandled",Mie="aspnetcore.diagnostics.handler.type",vie="aspnetcore.rate_limiting.policy",kie="aspnetcore.rate_limiting.result",wie="acquired",Lie="endpoint_limiter",Die="global_limiter",Uie="request_canceled",Bie="aspnetcore.request.is_unhandled",Fie="aspnetcore.routing.is_fallback",Gie="aspnetcore.routing.match_status",jie="failure",Hie="success",Vie="aspnetcore.user.is_authenticated",qie="client.address",$ie="client.port",zie="code.column.number",Yie="code.file.path",Wie="code.function.name",Kie="code.line.number",Qie="code.stacktrace",hy="db.collection.name",gy="db.namespace",Jie="db.operation.batch.size",Wu="db.operation.name",Xie="db.query.summary",Ty="db.query.text",Ey="db.response.status_code",Zie="db.stored_procedure.name",da="db.system.name",eae="mariadb",tae="microsoft.sql_server",nae="mysql",rae="postgresql",oae="dotnet.gc.heap.generation",sae="gen0",iae="gen1",aae="gen2",uae="loh",cae="poh",Sy="error.type",lae="_OTHER",dae="exception.escaped",pae="exception.message",fae="exception.stacktrace",mae="exception.type",_ae=t=>`http.request.header.${t}`,pa="http.request.method",hae="_OTHER",gae="CONNECT",Tae="DELETE",Eae="GET",Sae="HEAD",Aae="OPTIONS",yae="PATCH",bae="POST",Rae="PUT",Iae="TRACE",Oae="http.request.method_original",Cae="http.request.resend_count",Nae=t=>`http.response.header.${t}`,ns="http.response.status_code",rs="http.route",xae="jvm.gc.action",Pae="jvm.gc.name",Mae="jvm.memory.pool.name",vae="jvm.memory.type",kae="heap",wae="non_heap",Lae="jvm.thread.daemon",Dae="jvm.thread.state",Uae="blocked",Bae="new",Fae="runnable",Gae="terminated",jae="timed_waiting",Hae="waiting",Vae="network.local.address",qae="network.local.port",Ay="network.peer.address",yy="network.peer.port",$ae="network.protocol.name",by="network.protocol.version",Ry="network.transport",zae="pipe",Yae="quic",Wae="tcp",Kae="udp",Qae="unix",Jae="network.type",Xae="ipv4",Zae="ipv6",eue="otel.scope.name",tue="otel.scope.version",nue="otel.status_code",rue="ERROR",oue="OK",sue="otel.status_description",Iy="server.address",Oy="server.port",iue="service.instance.id",Cy="service.name",aue="service.namespace",Ny="service.version",uue="signalr.connection.status",cue="app_shutdown",lue="normal_closure",due="timeout",pue="signalr.transport",fue="long_polling",mue="server_sent_events",_ue="web_sockets",hue="telemetry.sdk.language",gue="cpp",Tue="dotnet",Eue="erlang",Sue="go",Aue="java",yue="nodejs",bue="php",Rue="python",Iue="ruby",Oue="rust",Cue="swift",Nue="webjs",xue="telemetry.sdk.name",Pue="telemetry.sdk.version",Mue="url.fragment",Vs="url.full",vue="url.path",kue="url.query",wue="url.scheme",xy="user_agent.original"});var Lue,Due,Uue,Bue,Fue,Gue,jue,Hue,Vue,que,$ue,zue,Yue,Wue,Kue,Que,Jue,Xue,Zue,ece,tce,nce,rce,oce,sce,ice,ace,uce,cce,lce,dce,pce,fce,mce,_ce,hce,gce,Tce,Ece,Sce,Ace,yce,bce,Rce,Ice,Oce,Cce,Nce,xce,Pce,Mce,eB=K(()=>{c();Lue="aspnetcore.diagnostics.exceptions",Due="aspnetcore.rate_limiting.active_request_leases",Uue="aspnetcore.rate_limiting.queued_requests",Bue="aspnetcore.rate_limiting.request.time_in_queue",Fue="aspnetcore.rate_limiting.request_lease.duration",Gue="aspnetcore.rate_limiting.requests",jue="aspnetcore.routing.match_attempts",Hue="db.client.operation.duration",Vue="dotnet.assembly.count",que="dotnet.exceptions",$ue="dotnet.gc.collections",zue="dotnet.gc.heap.total_allocated",Yue="dotnet.gc.last_collection.heap.fragmentation.size",Wue="dotnet.gc.last_collection.heap.size",Kue="dotnet.gc.last_collection.memory.committed_size",Que="dotnet.gc.pause.time",Jue="dotnet.jit.compilation.time",Xue="dotnet.jit.compiled_il.size",Zue="dotnet.jit.compiled_methods",ece="dotnet.monitor.lock_contentions",tce="dotnet.process.cpu.count",nce="dotnet.process.cpu.time",rce="dotnet.process.memory.working_set",oce="dotnet.thread_pool.queue.length",sce="dotnet.thread_pool.thread.count",ice="dotnet.thread_pool.work_item.count",ace="dotnet.timer.count",uce="http.client.request.duration",cce="http.server.request.duration",lce="jvm.class.count",dce="jvm.class.loaded",pce="jvm.class.unloaded",fce="jvm.cpu.count",mce="jvm.cpu.recent_utilization",_ce="jvm.cpu.time",hce="jvm.gc.duration",gce="jvm.memory.committed",Tce="jvm.memory.limit",Ece="jvm.memory.used",Sce="jvm.memory.used_after_last_gc",Ace="jvm.thread.count",yce="kestrel.active_connections",bce="kestrel.active_tls_handshakes",Rce="kestrel.connection.duration",Ice="kestrel.queued_connections",Oce="kestrel.queued_requests",Cce="kestrel.rejected_connections",Nce="kestrel.tls_handshake.duration",xce="kestrel.upgraded_connections",Pce="signalr.server.active_connections",Mce="signalr.server.connection.duration"});var vce,tB=K(()=>{c();vce="exception"});var Oe={};oa(Oe,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Cie,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Nie,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>xie,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Pie,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>wie,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Lie,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Die,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Uie,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>jie,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Hie,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Oie,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Mie,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>vie,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>kie,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Bie,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Fie,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Gie,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Vie,ATTR_CLIENT_ADDRESS:()=>qie,ATTR_CLIENT_PORT:()=>$ie,ATTR_CODE_COLUMN_NUMBER:()=>zie,ATTR_CODE_FILE_PATH:()=>Yie,ATTR_CODE_FUNCTION_NAME:()=>Wie,ATTR_CODE_LINE_NUMBER:()=>Kie,ATTR_CODE_STACKTRACE:()=>Qie,ATTR_DB_COLLECTION_NAME:()=>hy,ATTR_DB_NAMESPACE:()=>gy,ATTR_DB_OPERATION_BATCH_SIZE:()=>Jie,ATTR_DB_OPERATION_NAME:()=>Wu,ATTR_DB_QUERY_SUMMARY:()=>Xie,ATTR_DB_QUERY_TEXT:()=>Ty,ATTR_DB_RESPONSE_STATUS_CODE:()=>Ey,ATTR_DB_STORED_PROCEDURE_NAME:()=>Zie,ATTR_DB_SYSTEM_NAME:()=>da,ATTR_DOTNET_GC_HEAP_GENERATION:()=>oae,ATTR_ERROR_TYPE:()=>Sy,ATTR_EXCEPTION_ESCAPED:()=>dae,ATTR_EXCEPTION_MESSAGE:()=>pae,ATTR_EXCEPTION_STACKTRACE:()=>fae,ATTR_EXCEPTION_TYPE:()=>mae,ATTR_HTTP_REQUEST_HEADER:()=>_ae,ATTR_HTTP_REQUEST_METHOD:()=>pa,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Oae,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Cae,ATTR_HTTP_RESPONSE_HEADER:()=>Nae,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>ns,ATTR_HTTP_ROUTE:()=>rs,ATTR_JVM_GC_ACTION:()=>xae,ATTR_JVM_GC_NAME:()=>Pae,ATTR_JVM_MEMORY_POOL_NAME:()=>Mae,ATTR_JVM_MEMORY_TYPE:()=>vae,ATTR_JVM_THREAD_DAEMON:()=>Lae,ATTR_JVM_THREAD_STATE:()=>Dae,ATTR_NETWORK_LOCAL_ADDRESS:()=>Vae,ATTR_NETWORK_LOCAL_PORT:()=>qae,ATTR_NETWORK_PEER_ADDRESS:()=>Ay,ATTR_NETWORK_PEER_PORT:()=>yy,ATTR_NETWORK_PROTOCOL_NAME:()=>$ae,ATTR_NETWORK_PROTOCOL_VERSION:()=>by,ATTR_NETWORK_TRANSPORT:()=>Ry,ATTR_NETWORK_TYPE:()=>Jae,ATTR_OTEL_SCOPE_NAME:()=>eue,ATTR_OTEL_SCOPE_VERSION:()=>tue,ATTR_OTEL_STATUS_CODE:()=>nue,ATTR_OTEL_STATUS_DESCRIPTION:()=>sue,ATTR_SERVER_ADDRESS:()=>Iy,ATTR_SERVER_PORT:()=>Oy,ATTR_SERVICE_INSTANCE_ID:()=>iue,ATTR_SERVICE_NAME:()=>Cy,ATTR_SERVICE_NAMESPACE:()=>aue,ATTR_SERVICE_VERSION:()=>Ny,ATTR_SIGNALR_CONNECTION_STATUS:()=>uue,ATTR_SIGNALR_TRANSPORT:()=>pue,ATTR_TELEMETRY_SDK_LANGUAGE:()=>hue,ATTR_TELEMETRY_SDK_NAME:()=>xue,ATTR_TELEMETRY_SDK_VERSION:()=>Pue,ATTR_URL_FRAGMENT:()=>Mue,ATTR_URL_FULL:()=>Vs,ATTR_URL_PATH:()=>vue,ATTR_URL_QUERY:()=>kue,ATTR_URL_SCHEME:()=>wue,ATTR_USER_AGENT_ORIGINAL:()=>xy,AWSECSLAUNCHTYPEVALUES_EC2:()=>zse,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Yse,AwsEcsLaunchtypeValues:()=>Wse,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Nse,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>xse,CLOUDPLATFORMVALUES_AWS_EC2:()=>Pse,CLOUDPLATFORMVALUES_AWS_ECS:()=>Mse,CLOUDPLATFORMVALUES_AWS_EKS:()=>vse,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>wse,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>kse,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Use,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Fse,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Dse,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Bse,CLOUDPLATFORMVALUES_AZURE_VM:()=>Lse,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>qse,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Vse,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>jse,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Gse,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Hse,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>bse,CLOUDPROVIDERVALUES_AWS:()=>Rse,CLOUDPROVIDERVALUES_AZURE:()=>Ise,CLOUDPROVIDERVALUES_GCP:()=>Ose,CloudPlatformValues:()=>$se,CloudProviderValues:()=>Cse,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>une,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>hne,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>cne,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>_ne,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>dne,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Tne,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>pne,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>lne,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>gne,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>mne,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>fne,DBSYSTEMVALUES_ADABAS:()=>Mte,DBSYSTEMVALUES_CACHE:()=>Pte,DBSYSTEMVALUES_CASSANDRA:()=>Wte,DBSYSTEMVALUES_CLOUDSCAPE:()=>yte,DBSYSTEMVALUES_COCKROACHDB:()=>ine,DBSYSTEMVALUES_COLDFUSION:()=>Yte,DBSYSTEMVALUES_COSMOSDB:()=>ene,DBSYSTEMVALUES_COUCHBASE:()=>Xte,DBSYSTEMVALUES_COUCHDB:()=>Zte,DBSYSTEMVALUES_DB2:()=>Tte,DBSYSTEMVALUES_DERBY:()=>kte,DBSYSTEMVALUES_DYNAMODB:()=>tne,DBSYSTEMVALUES_EDB:()=>xte,DBSYSTEMVALUES_ELASTICSEARCH:()=>one,DBSYSTEMVALUES_FILEMAKER:()=>wte,DBSYSTEMVALUES_FIREBIRD:()=>vte,DBSYSTEMVALUES_FIRSTSQL:()=>Nte,DBSYSTEMVALUES_GEODE:()=>rne,DBSYSTEMVALUES_H2:()=>zte,DBSYSTEMVALUES_HANADB:()=>Ote,DBSYSTEMVALUES_HBASE:()=>Kte,DBSYSTEMVALUES_HIVE:()=>Ate,DBSYSTEMVALUES_HSQLDB:()=>bte,DBSYSTEMVALUES_INFORMIX:()=>Lte,DBSYSTEMVALUES_INGRES:()=>Cte,DBSYSTEMVALUES_INSTANTDB:()=>Dte,DBSYSTEMVALUES_INTERBASE:()=>Ute,DBSYSTEMVALUES_MARIADB:()=>Bte,DBSYSTEMVALUES_MAXDB:()=>Ite,DBSYSTEMVALUES_MEMCACHED:()=>sne,DBSYSTEMVALUES_MONGODB:()=>Qte,DBSYSTEMVALUES_MSSQL:()=>_te,DBSYSTEMVALUES_MYSQL:()=>hte,DBSYSTEMVALUES_NEO4J:()=>nne,DBSYSTEMVALUES_NETEZZA:()=>Fte,DBSYSTEMVALUES_ORACLE:()=>gte,DBSYSTEMVALUES_OTHER_SQL:()=>mte,DBSYSTEMVALUES_PERVASIVE:()=>Gte,DBSYSTEMVALUES_POINTBASE:()=>jte,DBSYSTEMVALUES_POSTGRESQL:()=>Ete,DBSYSTEMVALUES_PROGRESS:()=>Rte,DBSYSTEMVALUES_REDIS:()=>Jte,DBSYSTEMVALUES_REDSHIFT:()=>Ste,DBSYSTEMVALUES_SQLITE:()=>Hte,DBSYSTEMVALUES_SYBASE:()=>Vte,DBSYSTEMVALUES_TERADATA:()=>qte,DBSYSTEMVALUES_VERTICA:()=>$te,DB_SYSTEM_NAME_VALUE_MARIADB:()=>eae,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>tae,DB_SYSTEM_NAME_VALUE_MYSQL:()=>nae,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>rae,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>sae,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>iae,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>aae,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>uae,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>cae,DbCassandraConsistencyLevelValues:()=>Ene,DbSystemValues:()=>ane,ERROR_TYPE_VALUE_OTHER:()=>lae,EVENT_EXCEPTION:()=>vce,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Nne,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Cne,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>One,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Pne,FAASINVOKEDPROVIDERVALUES_AWS:()=>Mne,FAASINVOKEDPROVIDERVALUES_AZURE:()=>vne,FAASINVOKEDPROVIDERVALUES_GCP:()=>kne,FAASTRIGGERVALUES_DATASOURCE:()=>Sne,FAASTRIGGERVALUES_HTTP:()=>Ane,FAASTRIGGERVALUES_OTHER:()=>Rne,FAASTRIGGERVALUES_PUBSUB:()=>yne,FAASTRIGGERVALUES_TIMER:()=>bne,FaasDocumentOperationValues:()=>xne,FaasInvokedProviderValues:()=>wne,FaasTriggerValues:()=>Ine,HOSTARCHVALUES_AMD64:()=>Kse,HOSTARCHVALUES_ARM32:()=>Qse,HOSTARCHVALUES_ARM64:()=>Jse,HOSTARCHVALUES_IA64:()=>Xse,HOSTARCHVALUES_PPC32:()=>Zse,HOSTARCHVALUES_PPC64:()=>eie,HOSTARCHVALUES_X86:()=>tie,HTTPFLAVORVALUES_HTTP_1_0:()=>gre,HTTPFLAVORVALUES_HTTP_1_1:()=>Tre,HTTPFLAVORVALUES_HTTP_2_0:()=>Ere,HTTPFLAVORVALUES_QUIC:()=>Are,HTTPFLAVORVALUES_SPDY:()=>Sre,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>gae,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Tae,HTTP_REQUEST_METHOD_VALUE_GET:()=>Eae,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Sae,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Aae,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>hae,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>yae,HTTP_REQUEST_METHOD_VALUE_POST:()=>bae,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Rae,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Iae,HostArchValues:()=>nie,HttpFlavorValues:()=>yre,JVM_MEMORY_TYPE_VALUE_HEAP:()=>kae,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>wae,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Uae,JVM_THREAD_STATE_VALUE_NEW:()=>Bae,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Fae,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Gae,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>jae,JVM_THREAD_STATE_VALUE_WAITING:()=>Hae,MESSAGETYPEVALUES_RECEIVED:()=>Wre,MESSAGETYPEVALUES_SENT:()=>Yre,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>bre,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Rre,MESSAGINGOPERATIONVALUES_PROCESS:()=>Cre,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Ore,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Lue,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Due,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Uue,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Gue,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Fue,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Bue,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>jue,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Hue,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Vue,METRIC_DOTNET_EXCEPTIONS:()=>que,METRIC_DOTNET_GC_COLLECTIONS:()=>$ue,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>zue,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>Yue,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Wue,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Kue,METRIC_DOTNET_GC_PAUSE_TIME:()=>Que,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Jue,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Xue,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Zue,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>ece,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>tce,METRIC_DOTNET_PROCESS_CPU_TIME:()=>nce,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>rce,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>oce,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>sce,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>ice,METRIC_DOTNET_TIMER_COUNT:()=>ace,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>uce,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>cce,METRIC_JVM_CLASS_COUNT:()=>lce,METRIC_JVM_CLASS_LOADED:()=>dce,METRIC_JVM_CLASS_UNLOADED:()=>pce,METRIC_JVM_CPU_COUNT:()=>fce,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>mce,METRIC_JVM_CPU_TIME:()=>_ce,METRIC_JVM_GC_DURATION:()=>hce,METRIC_JVM_MEMORY_COMMITTED:()=>gce,METRIC_JVM_MEMORY_LIMIT:()=>Tce,METRIC_JVM_MEMORY_USED:()=>Ece,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Sce,METRIC_JVM_THREAD_COUNT:()=>Ace,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>yce,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>bce,METRIC_KESTREL_CONNECTION_DURATION:()=>Rce,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Ice,METRIC_KESTREL_QUEUED_REQUESTS:()=>Oce,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Cce,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Nce,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>xce,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Pce,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Mce,MessageTypeValues:()=>Kre,MessagingDestinationKindValues:()=>Ire,MessagingOperationValues:()=>Nre,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Xne,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>tre,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Qne,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>ure,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Zne,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>ere,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>ire,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Kne,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>lre,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>nre,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>ore,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>cre,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>rre,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>sre,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>pre,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>are,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>_re,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>fre,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>mre,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>dre,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Jne,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>$ne,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>zne,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Yne,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Vne,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>qne,NETTRANSPORTVALUES_INPROC:()=>Gne,NETTRANSPORTVALUES_IP:()=>Une,NETTRANSPORTVALUES_IP_TCP:()=>Lne,NETTRANSPORTVALUES_IP_UDP:()=>Dne,NETTRANSPORTVALUES_OTHER:()=>jne,NETTRANSPORTVALUES_PIPE:()=>Fne,NETTRANSPORTVALUES_UNIX:()=>Bne,NETWORK_TRANSPORT_VALUE_PIPE:()=>zae,NETWORK_TRANSPORT_VALUE_QUIC:()=>Yae,NETWORK_TRANSPORT_VALUE_TCP:()=>Wae,NETWORK_TRANSPORT_VALUE_UDP:()=>Kae,NETWORK_TRANSPORT_VALUE_UNIX:()=>Qae,NETWORK_TYPE_VALUE_IPV4:()=>Xae,NETWORK_TYPE_VALUE_IPV6:()=>Zae,NetHostConnectionSubtypeValues:()=>hre,NetHostConnectionTypeValues:()=>Wne,NetTransportValues:()=>Hne,OSTYPEVALUES_AIX:()=>die,OSTYPEVALUES_DARWIN:()=>sie,OSTYPEVALUES_DRAGONFLYBSD:()=>cie,OSTYPEVALUES_FREEBSD:()=>iie,OSTYPEVALUES_HPUX:()=>lie,OSTYPEVALUES_LINUX:()=>oie,OSTYPEVALUES_NETBSD:()=>aie,OSTYPEVALUES_OPENBSD:()=>uie,OSTYPEVALUES_SOLARIS:()=>pie,OSTYPEVALUES_WINDOWS:()=>rie,OSTYPEVALUES_Z_OS:()=>fie,OTEL_STATUS_CODE_VALUE_ERROR:()=>rue,OTEL_STATUS_CODE_VALUE_OK:()=>oue,OsTypeValues:()=>mie,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Fre,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Lre,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Pre,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>qre,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>kre,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Bre,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Hre,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>vre,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>wre,RPCGRPCSTATUSCODEVALUES_OK:()=>xre,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Gre,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>Dre,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Ure,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>$re,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Vre,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>jre,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Mre,RpcGrpcStatusCodeValues:()=>zre,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Iee,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Uee,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>yee,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Tee,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Lee,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Pee,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Nee,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Bee,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Oee,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Eee,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Ree,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>xee,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>bee,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>See,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Aee,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Dee,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>vee,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>kee,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Cee,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Mee,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>gee,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>wee,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>cZ,SEMATTRS_CODE_FILEPATH:()=>aee,SEMATTRS_CODE_FUNCTION:()=>see,SEMATTRS_CODE_LINENO:()=>uee,SEMATTRS_CODE_NAMESPACE:()=>iee,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>TZ,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>bZ,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>yZ,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>SZ,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>hZ,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>gZ,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>AZ,SEMATTRS_DB_CASSANDRA_TABLE:()=>EZ,SEMATTRS_DB_CONNECTION_STRING:()=>lZ,SEMATTRS_DB_HBASE_NAMESPACE:()=>RZ,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>pZ,SEMATTRS_DB_MONGODB_COLLECTION:()=>OZ,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>_Z,SEMATTRS_DB_NAME:()=>fZ,SEMATTRS_DB_OPERATION:()=>mZ,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>IZ,SEMATTRS_DB_SQL_TABLE:()=>CZ,SEMATTRS_DB_STATEMENT:()=>ry,SEMATTRS_DB_SYSTEM:()=>ny,SEMATTRS_DB_USER:()=>dZ,SEMATTRS_ENDUSER_ID:()=>eee,SEMATTRS_ENDUSER_ROLE:()=>tee,SEMATTRS_ENDUSER_SCOPE:()=>nee,SEMATTRS_EXCEPTION_ESCAPED:()=>MZ,SEMATTRS_EXCEPTION_MESSAGE:()=>xZ,SEMATTRS_EXCEPTION_STACKTRACE:()=>PZ,SEMATTRS_EXCEPTION_TYPE:()=>NZ,SEMATTRS_FAAS_COLDSTART:()=>FZ,SEMATTRS_FAAS_CRON:()=>BZ,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>kZ,SEMATTRS_FAAS_DOCUMENT_NAME:()=>DZ,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>wZ,SEMATTRS_FAAS_DOCUMENT_TIME:()=>LZ,SEMATTRS_FAAS_EXECUTION:()=>vZ,SEMATTRS_FAAS_INVOKED_NAME:()=>GZ,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>jZ,SEMATTRS_FAAS_INVOKED_REGION:()=>HZ,SEMATTRS_FAAS_TIME:()=>UZ,SEMATTRS_FAAS_TRIGGER:()=>oy,SEMATTRS_HTTP_CLIENT_IP:()=>hee,SEMATTRS_HTTP_FLAVOR:()=>dee,SEMATTRS_HTTP_HOST:()=>cee,SEMATTRS_HTTP_METHOD:()=>Bd,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>fee,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>mee,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>cy,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>ly,SEMATTRS_HTTP_ROUTE:()=>dy,SEMATTRS_HTTP_SCHEME:()=>lee,SEMATTRS_HTTP_SERVER_NAME:()=>_ee,SEMATTRS_HTTP_STATUS_CODE:()=>la,SEMATTRS_HTTP_TARGET:()=>uy,SEMATTRS_HTTP_URL:()=>Yu,SEMATTRS_HTTP_USER_AGENT:()=>pee,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>dte,SEMATTRS_MESSAGE_ID:()=>lte,SEMATTRS_MESSAGE_TYPE:()=>cte,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>pte,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Qee,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>zee,SEMATTRS_MESSAGING_DESTINATION:()=>Fee,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Gee,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>ete,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Zee,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Xee,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>tte,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>nte,SEMATTRS_MESSAGING_MESSAGE_ID:()=>$ee,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Wee,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Yee,SEMATTRS_MESSAGING_OPERATION:()=>Kee,SEMATTRS_MESSAGING_PROTOCOL:()=>Hee,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Vee,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Jee,SEMATTRS_MESSAGING_SYSTEM:()=>py,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>jee,SEMATTRS_MESSAGING_URL:()=>qee,SEMATTRS_NET_HOST_CARRIER_ICC:()=>XZ,SEMATTRS_NET_HOST_CARRIER_MCC:()=>QZ,SEMATTRS_NET_HOST_CARRIER_MNC:()=>JZ,SEMATTRS_NET_HOST_CARRIER_NAME:()=>KZ,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>WZ,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>YZ,SEMATTRS_NET_HOST_IP:()=>iy,SEMATTRS_NET_HOST_NAME:()=>zZ,SEMATTRS_NET_HOST_PORT:()=>ay,SEMATTRS_NET_PEER_IP:()=>sy,SEMATTRS_NET_PEER_NAME:()=>$Z,SEMATTRS_NET_PEER_PORT:()=>qZ,SEMATTRS_NET_TRANSPORT:()=>VZ,SEMATTRS_PEER_SERVICE:()=>ZZ,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>my,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>ate,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>ute,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>ite,SEMATTRS_RPC_JSONRPC_VERSION:()=>ste,SEMATTRS_RPC_METHOD:()=>ote,SEMATTRS_RPC_SERVICE:()=>fy,SEMATTRS_RPC_SYSTEM:()=>rte,SEMATTRS_THREAD_ID:()=>ree,SEMATTRS_THREAD_NAME:()=>oee,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>noe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>toe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>roe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>ooe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>soe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>ioe,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>aoe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>coe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>uoe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>doe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>loe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Jre,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Zre,SEMRESATTRS_CLOUD_PLATFORM:()=>eoe,SEMRESATTRS_CLOUD_PROVIDER:()=>Qre,SEMRESATTRS_CLOUD_REGION:()=>Xre,SEMRESATTRS_CONTAINER_ID:()=>foe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>_oe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>hoe,SEMRESATTRS_CONTAINER_NAME:()=>poe,SEMRESATTRS_CONTAINER_RUNTIME:()=>moe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>goe,SEMRESATTRS_DEVICE_ID:()=>Toe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Eoe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Soe,SEMRESATTRS_FAAS_ID:()=>yoe,SEMRESATTRS_FAAS_INSTANCE:()=>Roe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Ioe,SEMRESATTRS_FAAS_NAME:()=>Aoe,SEMRESATTRS_FAAS_VERSION:()=>boe,SEMRESATTRS_HOST_ARCH:()=>xoe,SEMRESATTRS_HOST_ID:()=>Ooe,SEMRESATTRS_HOST_IMAGE_ID:()=>Moe,SEMRESATTRS_HOST_IMAGE_NAME:()=>Poe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>voe,SEMRESATTRS_HOST_NAME:()=>Coe,SEMRESATTRS_HOST_TYPE:()=>Noe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>koe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Foe,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Joe,SEMRESATTRS_K8S_CRONJOB_UID:()=>Qoe,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Yoe,SEMRESATTRS_K8S_DAEMONSET_UID:()=>zoe,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Voe,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Hoe,SEMRESATTRS_K8S_JOB_NAME:()=>Koe,SEMRESATTRS_K8S_JOB_UID:()=>Woe,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>Doe,SEMRESATTRS_K8S_NODE_NAME:()=>woe,SEMRESATTRS_K8S_NODE_UID:()=>Loe,SEMRESATTRS_K8S_POD_NAME:()=>Boe,SEMRESATTRS_K8S_POD_UID:()=>Uoe,SEMRESATTRS_K8S_REPLICASET_NAME:()=>joe,SEMRESATTRS_K8S_REPLICASET_UID:()=>Goe,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>$oe,SEMRESATTRS_K8S_STATEFULSET_UID:()=>qoe,SEMRESATTRS_OS_DESCRIPTION:()=>Zoe,SEMRESATTRS_OS_NAME:()=>ese,SEMRESATTRS_OS_TYPE:()=>Xoe,SEMRESATTRS_OS_VERSION:()=>tse,SEMRESATTRS_PROCESS_COMMAND:()=>sse,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>ase,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>ise,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>rse,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>ose,SEMRESATTRS_PROCESS_OWNER:()=>use,SEMRESATTRS_PROCESS_PID:()=>nse,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>dse,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>cse,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>lse,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>fse,SEMRESATTRS_SERVICE_NAME:()=>pse,SEMRESATTRS_SERVICE_NAMESPACE:()=>_y,SEMRESATTRS_SERVICE_VERSION:()=>mse,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Tse,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>hse,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>_se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>gse,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Ase,SEMRESATTRS_WEBENGINE_NAME:()=>Ese,SEMRESATTRS_WEBENGINE_VERSION:()=>Sse,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>cue,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>lue,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>due,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>fue,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>mue,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>_ue,SemanticAttributes:()=>fte,SemanticResourceAttributes:()=>yse,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>_ie,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>hie,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>gie,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Tie,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Eie,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Sie,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Aie,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>yie,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>bie,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Rie,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>gue,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Tue,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Eue,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>Sue,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Aue,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>yue,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>bue,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Rue,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Iue,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Oue,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Cue,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Nue,TelemetrySdkLanguageValues:()=>Iie});var fe=K(()=>{c();OD();XU();ZU();eB();tB()});var nB=E(o_=>{"use strict";c();Object.defineProperty(o_,"__esModule",{value:!0});o_.ATTR_PROCESS_RUNTIME_NAME=void 0;o_.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var rB=E(i_=>{"use strict";c();Object.defineProperty(i_,"__esModule",{value:!0});i_.SDK_INFO=void 0;var kce=LM(),s_=(fe(),x(Oe)),wce=nB();i_.SDK_INFO={[s_.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[wce.ATTR_PROCESS_RUNTIME_NAME]:"node",[s_.ATTR_TELEMETRY_SDK_LANGUAGE]:s_.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[s_.ATTR_TELEMETRY_SDK_VERSION]:kce.VERSION}});var oB=E(rn=>{"use strict";c();Object.defineProperty(rn,"__esModule",{value:!0});rn.otperformance=rn.SDK_INFO=rn._globalThis=rn.getStringListFromEnv=rn.getNumberFromEnv=rn.getBooleanFromEnv=rn.getStringFromEnv=void 0;var a_=kM();Object.defineProperty(rn,"getStringFromEnv",{enumerable:!0,get:function(){return a_.getStringFromEnv}});Object.defineProperty(rn,"getBooleanFromEnv",{enumerable:!0,get:function(){return a_.getBooleanFromEnv}});Object.defineProperty(rn,"getNumberFromEnv",{enumerable:!0,get:function(){return a_.getNumberFromEnv}});Object.defineProperty(rn,"getStringListFromEnv",{enumerable:!0,get:function(){return a_.getStringListFromEnv}});var Lce=wM();Object.defineProperty(rn,"_globalThis",{enumerable:!0,get:function(){return Lce._globalThis}});var Dce=rB();Object.defineProperty(rn,"SDK_INFO",{enumerable:!0,get:function(){return Dce.SDK_INFO}});rn.otperformance=performance});var Py=E(on=>{"use strict";c();Object.defineProperty(on,"__esModule",{value:!0});on.getStringListFromEnv=on.getNumberFromEnv=on.getStringFromEnv=on.getBooleanFromEnv=on.otperformance=on._globalThis=on.SDK_INFO=void 0;var fa=oB();Object.defineProperty(on,"SDK_INFO",{enumerable:!0,get:function(){return fa.SDK_INFO}});Object.defineProperty(on,"_globalThis",{enumerable:!0,get:function(){return fa._globalThis}});Object.defineProperty(on,"otperformance",{enumerable:!0,get:function(){return fa.otperformance}});Object.defineProperty(on,"getBooleanFromEnv",{enumerable:!0,get:function(){return fa.getBooleanFromEnv}});Object.defineProperty(on,"getStringFromEnv",{enumerable:!0,get:function(){return fa.getStringFromEnv}});Object.defineProperty(on,"getNumberFromEnv",{enumerable:!0,get:function(){return fa.getNumberFromEnv}});Object.defineProperty(on,"getStringListFromEnv",{enumerable:!0,get:function(){return fa.getStringListFromEnv}})});var uB=E(ve=>{"use strict";c();Object.defineProperty(ve,"__esModule",{value:!0});ve.addHrTimes=ve.isTimeInput=ve.isTimeInputHrTime=ve.hrTimeToMicroseconds=ve.hrTimeToMilliseconds=ve.hrTimeToNanoseconds=ve.hrTimeToTimeStamp=ve.hrTimeDuration=ve.timeInputToHrTime=ve.hrTime=ve.getTimeOrigin=ve.millisToHrTime=void 0;var u_=Py(),sB=9,Uce=6,Bce=Math.pow(10,Uce),c_=Math.pow(10,sB);function Fd(t){let e=t/1e3,n=Math.trunc(e),r=Math.round(t%1e3*Bce);return[n,r]}ve.millisToHrTime=Fd;function Fce(){return u_.otperformance.timeOrigin}ve.getTimeOrigin=Fce;function iB(t){let e=Fd(u_.otperformance.timeOrigin),n=Fd(typeof t=="number"?t:u_.otperformance.now());return aB(e,n)}ve.hrTime=iB;function Gce(t){if(My(t))return t;if(typeof t=="number")return t<u_.otperformance.timeOrigin?iB(t):Fd(t);if(t instanceof Date)return Fd(t.getTime());throw TypeError("Invalid input type")}ve.timeInputToHrTime=Gce;function jce(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=c_),[n,r]}ve.hrTimeDuration=jce;function Hce(t){let e=sB,n=`${"0".repeat(e)}${t[1]}Z`,r=n.substring(n.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",r)}ve.hrTimeToTimeStamp=Hce;function Vce(t){return t[0]*c_+t[1]}ve.hrTimeToNanoseconds=Vce;function qce(t){return t[0]*1e3+t[1]/1e6}ve.hrTimeToMilliseconds=qce;function $ce(t){return t[0]*1e6+t[1]/1e3}ve.hrTimeToMicroseconds=$ce;function My(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}ve.isTimeInputHrTime=My;function zce(t){return My(t)||typeof t=="number"||t instanceof Date}ve.isTimeInput=zce;function aB(t,e){let n=[t[0]+e[0],t[1]+e[1]];return n[1]>=c_&&(n[1]-=c_,n[0]+=1),n}ve.addHrTimes=aB});var cB=E(l_=>{"use strict";c();Object.defineProperty(l_,"__esModule",{value:!0});l_.unrefTimer=void 0;function Yce(t){typeof t!="number"&&t.unref()}l_.unrefTimer=Yce});var lB=E(Gd=>{"use strict";c();Object.defineProperty(Gd,"__esModule",{value:!0});Gd.ExportResultCode=void 0;var Wce;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Wce=Gd.ExportResultCode||(Gd.ExportResultCode={}))});var pB=E(d_=>{"use strict";c();Object.defineProperty(d_,"__esModule",{value:!0});d_.CompositePropagator=void 0;var dB=(M(),x(L)),vy=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(e,n,r){for(let o of this._propagators)try{o.inject(e,n,r)}catch(s){dB.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,n,r){return this._propagators.reduce((o,s)=>{try{return s.extract(o,n,r)}catch(i){dB.diag.warn(`Failed to extract with ${s.constructor.name}. Err: ${i.message}`)}return o},e)}fields(){return this._fields.slice()}};d_.CompositePropagator=vy});var fB=E(Ku=>{"use strict";c();Object.defineProperty(Ku,"__esModule",{value:!0});Ku.validateValue=Ku.validateKey=void 0;var ky="[_0-9a-z-*/]",Kce=`[a-z]${ky}{0,255}`,Qce=`[a-z0-9]${ky}{0,240}@[a-z]${ky}{0,13}`,Jce=new RegExp(`^(?:${Kce}|${Qce})$`),Xce=/^[ -~]{0,255}[!-~]$/,Zce=/,|=/;function ele(t){return Jce.test(t)}Ku.validateKey=ele;function tle(t){return Xce.test(t)&&!Zce.test(t)}Ku.validateValue=tle});var Ly=E(p_=>{"use strict";c();Object.defineProperty(p_,"__esModule",{value:!0});p_.TraceState=void 0;var mB=fB(),_B=32,nle=512,hB=",",gB="=",wy=class t{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,n)=>(e.push(n+gB+this.get(n)),e),[]).join(hB)}_parse(e){e.length>nle||(this._internalState=e.split(hB).reverse().reduce((n,r)=>{let o=r.trim(),s=o.indexOf(gB);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);(0,mB.validateKey)(i)&&(0,mB.validateValue)(a)&&n.set(i,a)}return n},new Map),this._internalState.size>_B&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,_B))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};p_.TraceState=wy});var EB=E(sn=>{"use strict";c();Object.defineProperty(sn,"__esModule",{value:!0});sn.W3CTraceContextPropagator=sn.parseTraceParent=sn.TRACE_STATE_HEADER=sn.TRACE_PARENT_HEADER=void 0;var f_=(M(),x(L)),rle=Ud(),ole=Ly();sn.TRACE_PARENT_HEADER="traceparent";sn.TRACE_STATE_HEADER="tracestate";var sle="00",ile="(?!ff)[\\da-f]{2}",ale="(?![0]{32})[\\da-f]{32}",ule="(?![0]{16})[\\da-f]{16}",cle="[\\da-f]{2}",lle=new RegExp(`^\\s?(${ile})-(${ale})-(${ule})-(${cle})(-.*)?\\s?$`);function TB(t){let e=lle.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}sn.parseTraceParent=TB;var Dy=class{inject(e,n,r){let o=f_.trace.getSpanContext(e);if(!o||(0,rle.isTracingSuppressed)(e)||!(0,f_.isSpanContextValid)(o))return;let s=`${sle}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||f_.TraceFlags.NONE).toString(16)}`;r.set(n,sn.TRACE_PARENT_HEADER,s),o.traceState&&r.set(n,sn.TRACE_STATE_HEADER,o.traceState.serialize())}extract(e,n,r){let o=r.get(n,sn.TRACE_PARENT_HEADER);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let i=TB(s);if(!i)return e;i.isRemote=!0;let a=r.get(n,sn.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;i.traceState=new ole.TraceState(typeof u=="string"?u:void 0)}return f_.trace.setSpanContext(e,i)}fields(){return[sn.TRACE_PARENT_HEADER,sn.TRACE_STATE_HEADER]}};sn.W3CTraceContextPropagator=Dy});var SB=E(jr=>{"use strict";c();Object.defineProperty(jr,"__esModule",{value:!0});jr.getRPCMetadata=jr.deleteRPCMetadata=jr.setRPCMetadata=jr.RPCType=void 0;var dle=(M(),x(L)),Uy=(0,dle.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),ple;(function(t){t.HTTP="http"})(ple=jr.RPCType||(jr.RPCType={}));function fle(t,e){return t.setValue(Uy,e)}jr.setRPCMetadata=fle;function mle(t){return t.deleteValue(Uy)}jr.deleteRPCMetadata=mle;function _le(t){return t.getValue(Uy)}jr.getRPCMetadata=_le});var IB=E(m_=>{"use strict";c();Object.defineProperty(m_,"__esModule",{value:!0});m_.isPlainObject=void 0;var hle="[object Object]",gle="[object Null]",Tle="[object Undefined]",Ele=Function.prototype,AB=Ele.toString,Sle=AB.call(Object),Ale=Object.getPrototypeOf,yB=Object.prototype,bB=yB.hasOwnProperty,ma=Symbol?Symbol.toStringTag:void 0,RB=yB.toString;function yle(t){if(!ble(t)||Rle(t)!==hle)return!1;let e=Ale(t);if(e===null)return!0;let n=bB.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&AB.call(n)===Sle}m_.isPlainObject=yle;function ble(t){return t!=null&&typeof t=="object"}function Rle(t){return t==null?t===void 0?Tle:gle:ma&&ma in Object(t)?Ile(t):Ole(t)}function Ile(t){let e=bB.call(t,ma),n=t[ma],r=!1;try{t[ma]=void 0,r=!0}catch{}let o=RB.call(t);return r&&(e?t[ma]=n:delete t[ma]),o}function Ole(t){return RB.call(t)}});var PB=E(g_=>{"use strict";c();Object.defineProperty(g_,"__esModule",{value:!0});g_.merge=void 0;var OB=IB(),Cle=20;function Nle(...t){let e=t.shift(),n=new WeakMap;for(;t.length>0;)e=NB(e,t.shift(),0,n);return e}g_.merge=Nle;function By(t){return h_(t)?t.slice():t}function NB(t,e,n=0,r){let o;if(!(n>Cle)){if(n++,__(t)||__(e)||xB(e))o=By(e);else if(h_(t)){if(o=t.slice(),h_(e))for(let s=0,i=e.length;s<i;s++)o.push(By(e[s]));else if(jd(e)){let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let u=s[i];o[u]=By(e[u])}}}else if(jd(t))if(jd(e)){if(!xle(t,e))return e;o=Object.assign({},t);let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let u=s[i],d=e[u];if(__(d))typeof d>"u"?delete o[u]:o[u]=d;else{let p=o[u],f=d;if(CB(t,u,r)||CB(e,u,r))delete o[u];else{if(jd(p)&&jd(f)){let m=r.get(p)||[],_=r.get(f)||[];m.push({obj:t,key:u}),_.push({obj:e,key:u}),r.set(p,m),r.set(f,_)}o[u]=NB(o[u],d,n,r)}}}}else o=e;return o}}function CB(t,e,n){let r=n.get(t[e])||[];for(let o=0,s=r.length;o<s;o++){let i=r[o];if(i.key===e&&i.obj===t)return!0}return!1}function h_(t){return Array.isArray(t)}function xB(t){return typeof t=="function"}function jd(t){return!__(t)&&!h_(t)&&!xB(t)&&typeof t=="object"}function __(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function xle(t,e){return!(!(0,OB.isPlainObject)(t)||!(0,OB.isPlainObject)(e))}});var MB=E(Qu=>{"use strict";c();Object.defineProperty(Qu,"__esModule",{value:!0});Qu.callWithTimeout=Qu.TimeoutError=void 0;var T_=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};Qu.TimeoutError=T_;function Ple(t,e){let n,r=new Promise(function(s,i){n=setTimeout(function(){i(new T_("Operation timed out."))},e)});return Promise.race([t,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}Qu.callWithTimeout=Ple});var kB=E(Ju=>{"use strict";c();Object.defineProperty(Ju,"__esModule",{value:!0});Ju.isUrlIgnored=Ju.urlMatches=void 0;function vB(t,e){return typeof e=="string"?t===e:!!t.match(e)}Ju.urlMatches=vB;function Mle(t,e){if(!e)return!1;for(let n of e)if(vB(t,n))return!0;return!1}Ju.isUrlIgnored=Mle});var wB=E(E_=>{"use strict";c();Object.defineProperty(E_,"__esModule",{value:!0});E_.Deferred=void 0;var Fy=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,n)=>{this._resolve=e,this._reject=n})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};E_.Deferred=Fy});var LB=E(S_=>{"use strict";c();Object.defineProperty(S_,"__esModule",{value:!0});S_.BindOnceFuture=void 0;var vle=wB(),Gy=class{_isCalled=!1;_deferred=new vle.Deferred;_callback;_that;constructor(e,n){this._callback=e,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};S_.BindOnceFuture=Gy});var UB=E(A_=>{"use strict";c();Object.defineProperty(A_,"__esModule",{value:!0});A_.diagLogLevelFromString=void 0;var os=(M(),x(L)),DB={ALL:os.DiagLogLevel.ALL,VERBOSE:os.DiagLogLevel.VERBOSE,DEBUG:os.DiagLogLevel.DEBUG,INFO:os.DiagLogLevel.INFO,WARN:os.DiagLogLevel.WARN,ERROR:os.DiagLogLevel.ERROR,NONE:os.DiagLogLevel.NONE};function kle(t){if(t==null)return;let e=DB[t.toUpperCase()];return e??(os.diag.warn(`Unknown log level "${t}", expected one of ${Object.keys(DB)}, using default`),os.DiagLogLevel.INFO)}A_.diagLogLevelFromString=kle});var FB=E(y_=>{"use strict";c();Object.defineProperty(y_,"__esModule",{value:!0});y_._export=void 0;var BB=(M(),x(L)),wle=Ud();function Lle(t,e){return new Promise(n=>{BB.context.with((0,wle.suppressTracing)(BB.context.active()),()=>{t.export(e,n)})})}y_._export=Lle});var ye=E(C=>{"use strict";c();Object.defineProperty(C,"__esModule",{value:!0});C.internal=C.diagLogLevelFromString=C.BindOnceFuture=C.urlMatches=C.isUrlIgnored=C.callWithTimeout=C.TimeoutError=C.merge=C.TraceState=C.unsuppressTracing=C.suppressTracing=C.isTracingSuppressed=C.setRPCMetadata=C.getRPCMetadata=C.deleteRPCMetadata=C.RPCType=C.parseTraceParent=C.W3CTraceContextPropagator=C.TRACE_STATE_HEADER=C.TRACE_PARENT_HEADER=C.CompositePropagator=C.otperformance=C.getStringListFromEnv=C.getNumberFromEnv=C.getBooleanFromEnv=C.getStringFromEnv=C._globalThis=C.SDK_INFO=C.parseKeyPairsIntoRecord=C.ExportResultCode=C.unrefTimer=C.timeInputToHrTime=C.millisToHrTime=C.isTimeInputHrTime=C.isTimeInput=C.hrTimeToTimeStamp=C.hrTimeToNanoseconds=C.hrTimeToMilliseconds=C.hrTimeToMicroseconds=C.hrTimeDuration=C.hrTime=C.getTimeOrigin=C.addHrTimes=C.loggingErrorHandler=C.setGlobalErrorHandler=C.globalErrorHandler=C.sanitizeAttributes=C.isAttributeValue=C.AnchoredClock=C.W3CBaggagePropagator=void 0;var Dle=AM();Object.defineProperty(C,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Dle.W3CBaggagePropagator}});var Ule=yM();Object.defineProperty(C,"AnchoredClock",{enumerable:!0,get:function(){return Ule.AnchoredClock}});var GB=CM();Object.defineProperty(C,"isAttributeValue",{enumerable:!0,get:function(){return GB.isAttributeValue}});Object.defineProperty(C,"sanitizeAttributes",{enumerable:!0,get:function(){return GB.sanitizeAttributes}});var jB=xM();Object.defineProperty(C,"globalErrorHandler",{enumerable:!0,get:function(){return jB.globalErrorHandler}});Object.defineProperty(C,"setGlobalErrorHandler",{enumerable:!0,get:function(){return jB.setGlobalErrorHandler}});var Ble=ey();Object.defineProperty(C,"loggingErrorHandler",{enumerable:!0,get:function(){return Ble.loggingErrorHandler}});var fr=uB();Object.defineProperty(C,"addHrTimes",{enumerable:!0,get:function(){return fr.addHrTimes}});Object.defineProperty(C,"getTimeOrigin",{enumerable:!0,get:function(){return fr.getTimeOrigin}});Object.defineProperty(C,"hrTime",{enumerable:!0,get:function(){return fr.hrTime}});Object.defineProperty(C,"hrTimeDuration",{enumerable:!0,get:function(){return fr.hrTimeDuration}});Object.defineProperty(C,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return fr.hrTimeToMicroseconds}});Object.defineProperty(C,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return fr.hrTimeToMilliseconds}});Object.defineProperty(C,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return fr.hrTimeToNanoseconds}});Object.defineProperty(C,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return fr.hrTimeToTimeStamp}});Object.defineProperty(C,"isTimeInput",{enumerable:!0,get:function(){return fr.isTimeInput}});Object.defineProperty(C,"isTimeInputHrTime",{enumerable:!0,get:function(){return fr.isTimeInputHrTime}});Object.defineProperty(C,"millisToHrTime",{enumerable:!0,get:function(){return fr.millisToHrTime}});Object.defineProperty(C,"timeInputToHrTime",{enumerable:!0,get:function(){return fr.timeInputToHrTime}});var Fle=cB();Object.defineProperty(C,"unrefTimer",{enumerable:!0,get:function(){return Fle.unrefTimer}});var Gle=lB();Object.defineProperty(C,"ExportResultCode",{enumerable:!0,get:function(){return Gle.ExportResultCode}});var jle=KA();Object.defineProperty(C,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return jle.parseKeyPairsIntoRecord}});var _a=Py();Object.defineProperty(C,"SDK_INFO",{enumerable:!0,get:function(){return _a.SDK_INFO}});Object.defineProperty(C,"_globalThis",{enumerable:!0,get:function(){return _a._globalThis}});Object.defineProperty(C,"getStringFromEnv",{enumerable:!0,get:function(){return _a.getStringFromEnv}});Object.defineProperty(C,"getBooleanFromEnv",{enumerable:!0,get:function(){return _a.getBooleanFromEnv}});Object.defineProperty(C,"getNumberFromEnv",{enumerable:!0,get:function(){return _a.getNumberFromEnv}});Object.defineProperty(C,"getStringListFromEnv",{enumerable:!0,get:function(){return _a.getStringListFromEnv}});Object.defineProperty(C,"otperformance",{enumerable:!0,get:function(){return _a.otperformance}});var Hle=pB();Object.defineProperty(C,"CompositePropagator",{enumerable:!0,get:function(){return Hle.CompositePropagator}});var b_=EB();Object.defineProperty(C,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return b_.TRACE_PARENT_HEADER}});Object.defineProperty(C,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return b_.TRACE_STATE_HEADER}});Object.defineProperty(C,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return b_.W3CTraceContextPropagator}});Object.defineProperty(C,"parseTraceParent",{enumerable:!0,get:function(){return b_.parseTraceParent}});var R_=SB();Object.defineProperty(C,"RPCType",{enumerable:!0,get:function(){return R_.RPCType}});Object.defineProperty(C,"deleteRPCMetadata",{enumerable:!0,get:function(){return R_.deleteRPCMetadata}});Object.defineProperty(C,"getRPCMetadata",{enumerable:!0,get:function(){return R_.getRPCMetadata}});Object.defineProperty(C,"setRPCMetadata",{enumerable:!0,get:function(){return R_.setRPCMetadata}});var jy=Ud();Object.defineProperty(C,"isTracingSuppressed",{enumerable:!0,get:function(){return jy.isTracingSuppressed}});Object.defineProperty(C,"suppressTracing",{enumerable:!0,get:function(){return jy.suppressTracing}});Object.defineProperty(C,"unsuppressTracing",{enumerable:!0,get:function(){return jy.unsuppressTracing}});var Vle=Ly();Object.defineProperty(C,"TraceState",{enumerable:!0,get:function(){return Vle.TraceState}});var qle=PB();Object.defineProperty(C,"merge",{enumerable:!0,get:function(){return qle.merge}});var HB=MB();Object.defineProperty(C,"TimeoutError",{enumerable:!0,get:function(){return HB.TimeoutError}});Object.defineProperty(C,"callWithTimeout",{enumerable:!0,get:function(){return HB.callWithTimeout}});var VB=kB();Object.defineProperty(C,"isUrlIgnored",{enumerable:!0,get:function(){return VB.isUrlIgnored}});Object.defineProperty(C,"urlMatches",{enumerable:!0,get:function(){return VB.urlMatches}});var $le=LB();Object.defineProperty(C,"BindOnceFuture",{enumerable:!0,get:function(){return $le.BindOnceFuture}});var zle=UB();Object.defineProperty(C,"diagLogLevelFromString",{enumerable:!0,get:function(){return zle.diagLogLevelFromString}});var Yle=FB();C.internal={_export:Yle._export}});var qB=E(I_=>{"use strict";c();Object.defineProperty(I_,"__esModule",{value:!0});I_.VERSION=void 0;I_.VERSION="0.214.0"});var $B=E(Hd=>{"use strict";c();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.SeverityNumber=void 0;var Wle;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Wle=Hd.SeverityNumber||(Hd.SeverityNumber={}))});var C_=E(Xu=>{"use strict";c();Object.defineProperty(Xu,"__esModule",{value:!0});Xu.NOOP_LOGGER=Xu.NoopLogger=void 0;var O_=class{emit(e){}};Xu.NoopLogger=O_;Xu.NOOP_LOGGER=new O_});var zB=E(_o=>{"use strict";c();Object.defineProperty(_o,"__esModule",{value:!0});_o.API_BACKWARDS_COMPATIBILITY_VERSION=_o.makeGetter=_o._global=_o.GLOBAL_LOGS_API_KEY=void 0;_o.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");_o._global=globalThis;function Kle(t,e,n){return r=>r===t?e:n}_o.makeGetter=Kle;_o.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Hy=E(Zu=>{"use strict";c();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.NOOP_LOGGER_PROVIDER=Zu.NoopLoggerProvider=void 0;var Qle=C_(),N_=class{getLogger(e,n,r){return new Qle.NoopLogger}};Zu.NoopLoggerProvider=N_;Zu.NOOP_LOGGER_PROVIDER=new N_});var YB=E(x_=>{"use strict";c();Object.defineProperty(x_,"__esModule",{value:!0});x_.ProxyLogger=void 0;var Jle=C_(),Vy=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Jle.NOOP_LOGGER}};x_.ProxyLogger=Vy});var WB=E(P_=>{"use strict";c();Object.defineProperty(P_,"__esModule",{value:!0});P_.ProxyLoggerProvider=void 0;var Xle=Hy(),Zle=YB(),qy=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new Zle.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Xle.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};P_.ProxyLoggerProvider=qy});var QB=E(M_=>{"use strict";c();Object.defineProperty(M_,"__esModule",{value:!0});M_.LogsAPI=void 0;var mr=zB(),ede=Hy(),KB=WB(),$y=class t{constructor(){this._proxyLoggerProvider=new KB.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return mr._global[mr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(mr._global[mr.GLOBAL_LOGS_API_KEY]=(0,mr.makeGetter)(mr.API_BACKWARDS_COMPATIBILITY_VERSION,e,ede.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=mr._global[mr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(mr._global,mr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete mr._global[mr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new KB.ProxyLoggerProvider}};M_.LogsAPI=$y});var zy=E(ho=>{"use strict";c();Object.defineProperty(ho,"__esModule",{value:!0});ho.logs=ho.NoopLogger=ho.NOOP_LOGGER=ho.SeverityNumber=void 0;var tde=$B();Object.defineProperty(ho,"SeverityNumber",{enumerable:!0,get:function(){return tde.SeverityNumber}});var JB=C_();Object.defineProperty(ho,"NOOP_LOGGER",{enumerable:!0,get:function(){return JB.NOOP_LOGGER}});Object.defineProperty(ho,"NoopLogger",{enumerable:!0,get:function(){return JB.NoopLogger}});var nde=QB();ho.logs=nde.LogsAPI.getInstance()});var XB=E(ec=>{"use strict";c();Object.defineProperty(ec,"__esModule",{value:!0});ec.disableInstrumentations=ec.enableInstrumentations=void 0;function rde(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}ec.enableInstrumentations=rde;function ode(t){t.forEach(e=>e.disable())}ec.disableInstrumentations=ode});var t3=E(v_=>{"use strict";c();Object.defineProperty(v_,"__esModule",{value:!0});v_.registerInstrumentations=void 0;var ZB=(M(),x(L)),sde=zy(),e3=XB();function ide(t){let e=t.tracerProvider||ZB.trace.getTracerProvider(),n=t.meterProvider||ZB.metrics.getMeterProvider(),r=t.loggerProvider||sde.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,e3.enableInstrumentations)(o,e,n,r),()=>{(0,e3.disableInstrumentations)(o)}}v_.registerInstrumentations=ide});var l3=E(k_=>{"use strict";c();Object.defineProperty(k_,"__esModule",{value:!0});k_.satisfies=void 0;var Qy=(M(),x(L)),i3=/^(?: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-]+)*))?$/,ade=/^(?<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-]+)*))?$/,ude={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function cde(t,e,n){if(!lde(t))return Qy.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=mde(t);if(!r)return!1;let o=[],s=a3(r,e,o,n);return s&&!n?.includePrerelease?pde(r,o):s}k_.satisfies=cde;function lde(t){return typeof t=="string"&&i3.test(t)}function a3(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Yy(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=Lde(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Yy(t,s,n,r))return!1;return!0}return Yy(t,e,n,r)}function Yy(t,e,n,r){if(e=fde(e,r),e.includes(" "))return a3(t,e,n,r);{let o=_de(e);return n.push(o),dde(t,o)}}function dde(t,e){if(e.invalid)return!1;if(!e.version||Ky(e.version))return!0;let n=r3(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=r3(r,o)}return ude[e.op]?.includes(n)}function pde(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function fde(t,e){return t=t.trim(),t=kde(t,e),t=vde(t),t=wde(t,e),t=t.trim(),t}function gn(t){return!t||t.toLowerCase()==="x"||t==="*"}function mde(t){let e=t.match(i3);if(!e){Qy.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function _de(t){if(!t)return{};let e=t.match(ade);if(!e)return Qy.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function Ky(t){return t==="*"||t==="x"||t==="X"}function n3(t){let e=parseInt(t,10);return isNaN(e)?t:e}function hde(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function gde(t,e){if(Ky(t)||Ky(e))return 0;let[n,r]=hde(n3(t),n3(e));return n>r?1:n<r?-1:0}function r3(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=gde(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var u3="[a-zA-Z0-9-]",c3="0|[1-9]\\d*",Tde=`\\d*[a-zA-Z-]${u3}*`,Ede="((?:<|>)?=?)",o3=`(?:${c3}|${Tde})`,Sde=`(?:-(${o3}(?:\\.${o3})*))`,s3=`${u3}+`,Ade=`(?:\\+(${s3}(?:\\.${s3})*))`,Wy=`${c3}|x|X|\\*`,Vd=`[v=\\s]*(${Wy})(?:\\.(${Wy})(?:\\.(${Wy})(?:${Sde})?${Ade}?)?)?`,yde=`^${Ede}\\s*${Vd}$`,bde=new RegExp(yde),Rde=`^\\s*(${Vd})\\s+-\\s+(${Vd})\\s*$`,Ide=new RegExp(Rde),Ode="(?:~>?)",Cde=`^${Ode}${Vd}$`,Nde=new RegExp(Cde),xde="(?:\\^)",Pde=`^${xde}${Vd}$`,Mde=new RegExp(Pde);function vde(t){let e=Nde;return t.replace(e,(n,r,o,s,i)=>{let a;return gn(r)?a="":gn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:gn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function kde(t,e){let n=Mde,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,u)=>{let d;return gn(s)?d="":gn(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:gn(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:u?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${u} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${u} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${u} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function wde(t,e){let n=bde;return t.replace(n,(r,o,s,i,a,u)=>{let d=gn(s),p=d||gn(i),f=p||gn(a),m=f;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&m?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(u="-0"),r=`${o+s}.${i}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:f&&(r=`>=${s}.${i}.0${u} <${s}.${+i+1}.0-0`),r})}function Lde(t,e){let n=Ide;return t.replace(n,(r,o,s,i,a,u,d,p,f,m,_,h)=>(gn(s)?o="":gn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:gn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,gn(f)?p="":gn(m)?p=`<${+f+1}.0.0-0`:gn(_)?p=`<${f}.${+m+1}.0-0`:h?p=`<=${f}.${m}.${_}-${h}`:e?.includePrerelease?p=`<${f}.${m}.${+_+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var Jy=E(Vt=>{"use strict";c();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.massUnwrap=Vt.unwrap=Vt.massWrap=Vt.wrap=void 0;var Tn=console.error.bind(console);function qd(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var Dde=(t,e,n)=>{if(!t||!t[e]){Tn("no original function "+String(e)+" to wrap");return}if(!n){Tn("no wrapper function"),Tn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Tn("original object and wrapper must be functions");return}let o=n(r,e);return qd(o,"__original",r),qd(o,"__unwrap",()=>{t[e]===o&&qd(t,e,r)}),qd(o,"__wrapped",!0),qd(t,e,o),o};Vt.wrap=Dde;var Ude=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Tn("must provide one or more modules to patch"),Tn(new Error().stack);return}if(!(e&&Array.isArray(e))){Tn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Vt.wrap)(r,o,n)})})};Vt.massWrap=Ude;var Bde=(t,e)=>{if(!t||!t[e]){Tn("no function to unwrap."),Tn(new Error().stack);return}let n=t[e];if(!n.__unwrap)Tn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Vt.unwrap=Bde;var Fde=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Tn("must provide one or more modules to patch"),Tn(new Error().stack);return}if(!(e&&Array.isArray(e))){Tn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Vt.unwrap)(n,r)})})};Vt.massUnwrap=Fde;function $d(t){t&&t.logger&&(typeof t.logger!="function"?Tn("new logger isn't a function, not replacing"):Tn=t.logger)}Vt.default=$d;$d.wrap=Vt.wrap;$d.massWrap=Vt.massWrap;$d.unwrap=Vt.unwrap;$d.massUnwrap=Vt.massUnwrap});var d3=E(L_=>{"use strict";c();Object.defineProperty(L_,"__esModule",{value:!0});L_.InstrumentationAbstract=void 0;var Xy=(M(),x(L)),Gde=zy(),w_=Jy(),Zy=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=Xy.diag.createComponentLogger({namespace:e}),this._tracer=Xy.trace.getTracer(e,n),this._meter=Xy.metrics.getMeter(e,n),this._logger=Gde.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=w_.wrap;_unwrap=w_.unwrap;_massWrap=w_.massWrap;_massUnwrap=w_.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};L_.InstrumentationAbstract=Zy});var f3=E((U6e,p3)=>{c();var tc=1e3,nc=tc*60,rc=nc*60,ha=rc*24,jde=ha*7,Hde=ha*365.25;p3.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return Vde(t);if(n==="number"&&isFinite(t))return e.long?$de(t):qde(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Vde(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Hde;case"weeks":case"week":case"w":return n*jde;case"days":case"day":case"d":return n*ha;case"hours":case"hour":case"hrs":case"hr":case"h":return n*rc;case"minutes":case"minute":case"mins":case"min":case"m":return n*nc;case"seconds":case"second":case"secs":case"sec":case"s":return n*tc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function qde(t){var e=Math.abs(t);return e>=ha?Math.round(t/ha)+"d":e>=rc?Math.round(t/rc)+"h":e>=nc?Math.round(t/nc)+"m":e>=tc?Math.round(t/tc)+"s":t+"ms"}function $de(t){var e=Math.abs(t);return e>=ha?D_(t,e,ha,"day"):e>=rc?D_(t,e,rc,"hour"):e>=nc?D_(t,e,nc,"minute"):e>=tc?D_(t,e,tc,"second"):t+" ms"}function D_(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}});var eb=E((F6e,m3)=>{c();function zde(t){n.debug=n,n.default=n,n.coerce=u,n.disable=i,n.enable=o,n.enabled=a,n.humanize=f3(),n.destroy=d,Object.keys(t).forEach(p=>{n[p]=t[p]}),n.names=[],n.skips=[],n.formatters={};function e(p){let f=0;for(let m=0;m<p.length;m++)f=(f<<5)-f+p.charCodeAt(m),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=e;function n(p){let f,m=null,_,h;function g(...T){if(!g.enabled)return;let S=g,A=Number(new Date),R=A-(f||A);S.diff=R,S.prev=f,S.curr=A,f=A,T[0]=n.coerce(T[0]),typeof T[0]!="string"&&T.unshift("%O");let I=0;T[0]=T[0].replace(/%([a-zA-Z%])/g,(N,V)=>{if(N==="%%")return"%";I++;let ge=n.formatters[V];if(typeof ge=="function"){let Be=T[I];N=ge.call(S,Be),T.splice(I,1),I--}return N}),n.formatArgs.call(S,T),(S.log||n.log).apply(S,T)}return g.namespace=p,g.useColors=n.useColors(),g.color=n.selectColor(p),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(_!==n.namespaces&&(_=n.namespaces,h=n.enabled(p)),h),set:T=>{m=T}}),typeof n.init=="function"&&n.init(g),g}function r(p,f){let m=n(this.namespace+(typeof f>"u"?":":f)+p);return m.log=this.log,m}function o(p){n.save(p),n.namespaces=p,n.names=[],n.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)m[0]==="-"?n.skips.push(m.slice(1)):n.names.push(m)}function s(p,f){let m=0,_=0,h=-1,g=0;for(;m<p.length;)if(_<f.length&&(f[_]===p[m]||f[_]==="*"))f[_]==="*"?(h=_,g=m,_++):(m++,_++);else if(h!==-1)_=h+1,g++,m=g;else return!1;for(;_<f.length&&f[_]==="*";)_++;return _===f.length}function i(){let p=[...n.names,...n.skips.map(f=>"-"+f)].join(",");return n.enable(""),p}function a(p){for(let f of n.skips)if(s(p,f))return!1;for(let f of n.names)if(s(p,f))return!0;return!1}function u(p){return p instanceof Error?p.stack||p.message:p}function d(){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}m3.exports=zde});var _3=E((Mn,U_)=>{c();Mn.formatArgs=Wde;Mn.save=Kde;Mn.load=Qde;Mn.useColors=Yde;Mn.storage=Jde();Mn.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Mn.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 Yde(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Wde(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+U_.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),t.splice(r,0,e)}Mn.log=console.debug||console.log||(()=>{});function Kde(t){try{t?Mn.storage.setItem("debug",t):Mn.storage.removeItem("debug")}catch{}}function Qde(){let t;try{t=Mn.storage.getItem("debug")||Mn.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Jde(){try{return localStorage}catch{}}U_.exports=eb()(Mn);var{formatters:Xde}=U_.exports;Xde.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var g3=E((H6e,h3)=>{"use strict";c();h3.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),o=e.indexOf("--");return r!==-1&&(o===-1||r<o)}});var S3=E((q6e,E3)=>{"use strict";c();var Zde=B("os"),T3=B("tty"),_r=g3(),{env:Ct}=process,qs;_r("no-color")||_r("no-colors")||_r("color=false")||_r("color=never")?qs=0:(_r("color")||_r("colors")||_r("color=true")||_r("color=always"))&&(qs=1);"FORCE_COLOR"in Ct&&(Ct.FORCE_COLOR==="true"?qs=1:Ct.FORCE_COLOR==="false"?qs=0:qs=Ct.FORCE_COLOR.length===0?1:Math.min(parseInt(Ct.FORCE_COLOR,10),3));function tb(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function nb(t,e){if(qs===0)return 0;if(_r("color=16m")||_r("color=full")||_r("color=truecolor"))return 3;if(_r("color=256"))return 2;if(t&&!e&&qs===void 0)return 0;let n=qs||0;if(Ct.TERM==="dumb")return n;if(process.platform==="win32"){let r=Zde.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ct)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Ct)||Ct.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Ct)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ct.TEAMCITY_VERSION)?1:0;if(Ct.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ct){let r=parseInt((Ct.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ct.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ct.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ct.TERM)||"COLORTERM"in Ct?1:n}function epe(t){let e=nb(t,t&&t.isTTY);return tb(e)}E3.exports={supportsColor:epe,stdout:tb(nb(!0,T3.isatty(1))),stderr:tb(nb(!0,T3.isatty(2)))}});var y3=E((Nt,F_)=>{c();var tpe=B("tty"),B_=B("util");Nt.init=upe;Nt.log=spe;Nt.formatArgs=rpe;Nt.save=ipe;Nt.load=ape;Nt.useColors=npe;Nt.destroy=B_.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Nt.colors=[6,2,3,4,5,1];try{let t=S3();t&&(t.stderr||t).level>=2&&(Nt.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{}Nt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function npe(){return"colors"in Nt.inspectOpts?!!Nt.inspectOpts.colors:tpe.isatty(process.stderr.fd)}function rpe(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
3
|
+
var mX=Object.create;var Pm=Object.defineProperty;var _X=Object.getOwnPropertyDescriptor;var hX=Object.getOwnPropertyNames;var gX=Object.getPrototypeOf,TX=Object.prototype.hasOwnProperty;var B=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var K=(t,e)=>()=>(t&&(e=t(t=0)),e);var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),oa=(t,e)=>{for(var n in e)Pm(t,n,{get:e[n],enumerable:!0})},I1=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of hX(e))!TX.call(t,o)&&o!==n&&Pm(t,o,{get:()=>e[o],enumerable:!(r=_X(e,o))||r.enumerable});return t};var J=(t,e,n)=>(n=t!=null?mX(gX(t)):{},I1(e||!t||!t.__esModule?Pm(n,"default",{value:t,enumerable:!0}):n,t)),x=t=>I1(Pm({},"__esModule",{value:!0}),t);var c=K(()=>{(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"0.1.46"}}catch{}})()});var es,fA=K(()=>{c();es="1.9.1"});function EX(t){let e=new Set([t]),n=new Set,r=t.match(O1);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(u){return u===t};function s(a){return n.add(a),!1}function i(a){return e.add(a),!0}return function(u){if(e.has(u))return!0;if(n.has(u))return!1;let d=u.match(O1);if(!d)return s(u);let p={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return p.prerelease!=null||o.major!==p.major?s(u):o.major===0?o.minor===p.minor&&o.patch<=p.patch?i(u):s(u):o.minor<=p.minor?i(u):s(u)}}var O1,C1,N1=K(()=>{c();fA();O1=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;C1=EX(es)});function uo(t,e,n,r=!1){var o;let s=Pd[xd]=(o=Pd[xd])!==null&&o!==void 0?o:{version:es};if(!r&&s[t]){let i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return n.error(i.stack||i.message),!1}if(s.version!==es){let i=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${es}`);return n.error(i.stack||i.message),!1}return s[t]=e,n.debug(`@opentelemetry/api: Registered a global for ${t} v${es}.`),!0}function Yn(t){var e,n;let r=(e=Pd[xd])===null||e===void 0?void 0:e.version;if(!(!r||!C1(r)))return(n=Pd[xd])===null||n===void 0?void 0:n[t]}function co(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${es}.`);let n=Pd[xd];n&&delete n[t]}var SX,xd,Pd,sa=K(()=>{c();fA();N1();SX=es.split(".")[0],xd=Symbol.for(`opentelemetry.js.api.${SX}`),Pd=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function Md(t,e,n){let r=Yn("diag");if(r)return r[t](e,...n)}var Mm,x1=K(()=>{c();sa();Mm=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return Md("debug",this._namespace,e)}error(...e){return Md("error",this._namespace,e)}info(...e){return Md("info",this._namespace,e)}warn(...e){return Md("warn",this._namespace,e)}verbose(...e){return Md("verbose",this._namespace,e)}}});var St,vm=K(()=>{c();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(St||(St={}))});function P1(t,e){t<St.NONE?t=St.NONE:t>St.ALL&&(t=St.ALL),e=e||{};function n(r,o){let s=e[r];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return{error:n("error",St.ERROR),warn:n("warn",St.WARN),info:n("info",St.INFO),debug:n("debug",St.DEBUG),verbose:n("verbose",St.VERBOSE)}}var M1=K(()=>{c();vm()});var AX,Ot,ia=K(()=>{c();x1();M1();vm();sa();AX="diag",Ot=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(o){return function(...s){let i=Yn("diag");if(i)return i[o](...s)}}let n=this,r=(o,s={logLevel:St.INFO})=>{var i,a,u;if(o===n){let f=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=f.stack)!==null&&i!==void 0?i:f.message),!1}typeof s=="number"&&(s={logLevel:s});let d=Yn("diag"),p=P1((a=s.logLevel)!==null&&a!==void 0?a:St.INFO,o);if(d&&!s.suppressOverrideMessage){let f=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";d.warn(`Current logger will be overwritten from ${f}`),p.warn(`Current logger will overwrite one already registered from ${f}`)}return uo("diag",p,n,!0)};n.setLogger=r,n.disable=()=>{co(AX,n)},n.createComponentLogger=o=>new Mm(o),n.verbose=e("verbose"),n.debug=e("debug"),n.info=e("info"),n.warn=e("warn"),n.error=e("error")}}});var km,v1=K(()=>{c();km=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let n=this._entries.get(e);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,n){let r=new t(this._entries);return r._entries.set(e,n),r}removeEntry(e){let n=new t(this._entries);return n._entries.delete(e),n}removeEntries(...e){let n=new t(this._entries);for(let r of e)n._entries.delete(r);return n}clear(){return new t}}});var k1,w1=K(()=>{c();k1=Symbol("BaggageEntryMetadata")});function L1(t={}){return new km(new Map(Object.entries(t)))}function D1(t){return typeof t!="string"&&(yX.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:k1,toString(){return t}}}var yX,mA=K(()=>{c();ia();v1();w1();yX=Ot.instance()});function Wn(t){return Symbol.for(t)}var _A,ju,vd=K(()=>{c();_A=class t{constructor(e){let n=this;n._currentContext=e?new Map(e):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let s=new t(n._currentContext);return s._currentContext.set(r,o),s},n.deleteValue=r=>{let o=new t(n._currentContext);return o._currentContext.delete(r),o}}},ju=new _A});var hA,gA,wm,U1=K(()=>{c();hA=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],gA={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(gA[e]=console[e])}wm=class{constructor(){function e(n){return function(...r){let o=gA[n];if(typeof o!="function"&&(o=gA.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<hA.length;n++)this[hA[n].n]=e(hA[n].c)}}});function B1(){return OA}var TA,Hu,EA,SA,AA,yA,kd,bA,RA,IA,OA,bX,RX,IX,OX,CX,NX,xX,CA=K(()=>{c();TA=class{constructor(){}createGauge(e,n){return RX}createHistogram(e,n){return IX}createCounter(e,n){return bX}createUpDownCounter(e,n){return OX}createObservableGauge(e,n){return NX}createObservableCounter(e,n){return CX}createObservableUpDownCounter(e,n){return xX}addBatchObservableCallback(e,n){}removeBatchObservableCallback(e){}},Hu=class{},EA=class extends Hu{add(e,n){}},SA=class extends Hu{add(e,n){}},AA=class extends Hu{record(e,n){}},yA=class extends Hu{record(e,n){}},kd=class{addCallback(e){}removeCallback(e){}},bA=class extends kd{},RA=class extends kd{},IA=class extends kd{},OA=new TA,bX=new EA,RX=new AA,IX=new yA,OX=new SA,CX=new bA,NX=new RA,xX=new IA});var Lm,F1=K(()=>{c();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Lm||(Lm={}))});var Dm,Um,NA=K(()=>{c();Dm={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},Um={set(t,e,n){t!=null&&(t[e]=n)}}});var Bm,G1=K(()=>{c();vd();Bm=class{active(){return ju}with(e,n,r,...o){return n.call(r,...o)}bind(e,n){return n}enable(){return this}disable(){return this}}});var xA,PX,lo,wd=K(()=>{c();G1();sa();ia();xA="context",PX=new Bm,lo=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return uo(xA,e,Ot.instance())}active(){return this._getContextManager().active()}with(e,n,r,...o){return this._getContextManager().with(e,n,r,...o)}bind(e,n){return this._getContextManager().bind(e,n)}_getContextManager(){return Yn(xA)||PX}disable(){this._getContextManager().disable(),co(xA,Ot.instance())}}});var tn,PA=K(()=>{c();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(tn||(tn={}))});var Ld,aa,Fm,Gm=K(()=>{c();PA();Ld="0000000000000000",aa="00000000000000000000000000000000",Fm={traceId:aa,spanId:Ld,traceFlags:tn.NONE}});var po,jm=K(()=>{c();Gm();po=class{constructor(e=Fm){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,n){return this}setAttributes(e){return this}addEvent(e,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,n){}}});function Hm(t){return t.getValue(MA)||void 0}function j1(){return Hm(lo.getInstance().active())}function Dd(t,e){return t.setValue(MA,e)}function H1(t){return t.deleteValue(MA)}function V1(t,e){return Dd(t,new po(e))}function Vm(t){var e;return(e=Hm(t))===null||e===void 0?void 0:e.spanContext()}var MA,vA=K(()=>{c();vd();jm();wd();MA=Wn("OpenTelemetry Context Key SPAN")});function q1(t,e){if(typeof t!="string"||t.length!==e)return!1;let n=0;for(let r=0;r<t.length;r+=4)n+=(qm[t.charCodeAt(r)]|0)+(qm[t.charCodeAt(r+1)]|0)+(qm[t.charCodeAt(r+2)]|0)+(qm[t.charCodeAt(r+3)]|0);return n===e}function kA(t){return q1(t,32)&&t!==aa}function wA(t){return q1(t,16)&&t!==Ld}function ts(t){return kA(t.traceId)&&wA(t.spanId)}function $1(t){return new po(t)}var qm,$m=K(()=>{c();Gm();jm();qm=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 MX(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var LA,Vu,DA=K(()=>{c();wd();vA();jm();$m();LA=lo.getInstance(),Vu=class{startSpan(e,n,r=LA.active()){if(!!n?.root)return new po;let s=r&&Vm(r);return MX(s)&&ts(s)?new po(s):new po}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let u=i??LA.active(),d=this.startSpan(e,s,u),p=Dd(u,d);return LA.with(p,a,void 0,d)}}});var vX,qu,UA=K(()=>{c();DA();vX=new Vu,qu=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}startSpan(e,n,r){return this._getTracer().startSpan(e,n,r)}startActiveSpan(e,n,r,o){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):vX}}});var zm,z1=K(()=>{c();DA();zm=class{getTracer(e,n,r){return new Vu}}});var kX,ua,BA=K(()=>{c();UA();z1();kX=new zm,ua=class{getTracer(e,n,r){var o;return(o=this.getDelegateTracer(e,n,r))!==null&&o!==void 0?o:new qu(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:kX}setDelegate(e){this._delegate=e}getDelegateTracer(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,n,r)}}});var Ym,Y1=K(()=>{c();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Ym||(Ym={}))});var Me,W1=K(()=>{c();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(Me||(Me={}))});var ze,K1=K(()=>{c();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(ze||(ze={}))});function Q1(t){return DX.test(t)}function J1(t){return UX.test(t)&&!BX.test(t)}var FA,wX,LX,DX,UX,BX,X1=K(()=>{c();FA="[_0-9a-z-*/]",wX=`[a-z]${FA}{0,255}`,LX=`[a-z0-9]${FA}{0,240}@[a-z]${FA}{0,13}`,DX=new RegExp(`^(?:${wX}|${LX})$`),UX=/^[ -~]{0,255}[!-~]$/,BX=/,|=/});var Z1,FX,eM,tM,Wm,nM=K(()=>{c();X1();Z1=32,FX=512,eM=",",tM="=",Wm=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,n)=>(e.push(n+tM+this.get(n)),e),[]).join(eM)}_parse(e){e.length>FX||(this._internalState=e.split(eM).reduceRight((n,r)=>{let o=r.trim(),s=o.indexOf(tM);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);Q1(i)&&J1(a)&&n.set(i,a)}return n},new Map),this._internalState.size>Z1&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Z1))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function rM(t){return new Wm(t)}var oM=K(()=>{c();nM()});var k,sM=K(()=>{c();wd();k=lo.getInstance()});var Kn,iM=K(()=>{c();ia();Kn=Ot.instance()});var GA,aM,uM=K(()=>{c();CA();GA=class{getMeter(e,n,r){return OA}},aM=new GA});var jA,Km,cM=K(()=>{c();uM();sa();ia();jA="metrics",Km=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return uo(jA,e,Ot.instance())}getMeterProvider(){return Yn(jA)||aM}getMeter(e,n,r){return this.getMeterProvider().getMeter(e,n,r)}disable(){co(jA,Ot.instance())}}});var HA,lM=K(()=>{c();cM();HA=Km.getInstance()});var Qm,dM=K(()=>{c();Qm=class{inject(e,n){}extract(e,n){return e}fields(){return[]}}});function qA(t){return t.getValue(VA)||void 0}function pM(){return qA(lo.getInstance().active())}function fM(t,e){return t.setValue(VA,e)}function mM(t){return t.deleteValue(VA)}var VA,_M=K(()=>{c();wd();vd();VA=Wn("OpenTelemetry Baggage Key")});var $A,GX,Jm,hM=K(()=>{c();sa();dM();NA();_M();mA();ia();$A="propagation",GX=new Qm,Jm=class t{constructor(){this.createBaggage=L1,this.getBaggage=qA,this.getActiveBaggage=pM,this.setBaggage=fM,this.deleteBaggage=mM}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return uo($A,e,Ot.instance())}inject(e,n,r=Um){return this._getGlobalPropagator().inject(e,n,r)}extract(e,n,r=Dm){return this._getGlobalPropagator().extract(e,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){co($A,Ot.instance())}_getGlobalPropagator(){return Yn($A)||GX}}});var Gr,gM=K(()=>{c();hM();Gr=Jm.getInstance()});var zA,Xm,TM=K(()=>{c();sa();BA();$m();vA();ia();zA="trace",Xm=class t{constructor(){this._proxyTracerProvider=new ua,this.wrapSpanContext=$1,this.isSpanContextValid=ts,this.deleteSpan=H1,this.getSpan=Hm,this.getActiveSpan=j1,this.getSpanContext=Vm,this.setSpan=Dd,this.setSpanContext=V1}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let n=uo(zA,this._proxyTracerProvider,Ot.instance());return n&&this._proxyTracerProvider.setDelegate(e),n}getTracerProvider(){return Yn(zA)||this._proxyTracerProvider}getTracer(e,n){return this.getTracerProvider().getTracer(e,n)}disable(){co(zA,Ot.instance()),this._proxyTracerProvider=new ua}}});var Z,EM=K(()=>{c();TM();Z=Xm.getInstance()});var L={};oa(L,{DiagConsoleLogger:()=>wm,DiagLogLevel:()=>St,INVALID_SPANID:()=>Ld,INVALID_SPAN_CONTEXT:()=>Fm,INVALID_TRACEID:()=>aa,ProxyTracer:()=>qu,ProxyTracerProvider:()=>ua,ROOT_CONTEXT:()=>ju,SamplingDecision:()=>Ym,SpanKind:()=>Me,SpanStatusCode:()=>ze,TraceFlags:()=>tn,ValueType:()=>Lm,baggageEntryMetadataFromString:()=>D1,context:()=>k,createContextKey:()=>Wn,createNoopMeter:()=>B1,createTraceState:()=>rM,default:()=>jX,defaultTextMapGetter:()=>Dm,defaultTextMapSetter:()=>Um,diag:()=>Kn,isSpanContextValid:()=>ts,isValidSpanId:()=>wA,isValidTraceId:()=>kA,metrics:()=>HA,propagation:()=>Gr,trace:()=>Z});var jX,M=K(()=>{c();mA();vd();U1();vm();CA();F1();NA();UA();BA();Y1();W1();K1();PA();oM();$m();Gm();sM();iM();lM();gM();EM();jX={context:k,diag:Kn,metrics:HA,propagation:Gr,trace:Z}});var Ud=E(js=>{"use strict";c();Object.defineProperty(js,"__esModule",{value:!0});js.isTracingSuppressed=js.unsuppressTracing=js.suppressTracing=void 0;var HX=(M(),x(L)),YA=(0,HX.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function VX(t){return t.setValue(YA,!0)}js.suppressTracing=VX;function qX(t){return t.deleteValue(YA)}js.unsuppressTracing=qX;function $X(t){return t.getValue(YA)===!0}js.isTracingSuppressed=$X});var WA=E(nn=>{"use strict";c();Object.defineProperty(nn,"__esModule",{value:!0});nn.BAGGAGE_MAX_TOTAL_LENGTH=nn.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=nn.BAGGAGE_MAX_NAME_VALUE_PAIRS=nn.BAGGAGE_HEADER=nn.BAGGAGE_ITEMS_SEPARATOR=nn.BAGGAGE_PROPERTIES_SEPARATOR=nn.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;nn.BAGGAGE_KEY_PAIR_SEPARATOR="=";nn.BAGGAGE_PROPERTIES_SEPARATOR=";";nn.BAGGAGE_ITEMS_SEPARATOR=",";nn.BAGGAGE_HEADER="baggage";nn.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;nn.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;nn.BAGGAGE_MAX_TOTAL_LENGTH=8192});var KA=E(fo=>{"use strict";c();Object.defineProperty(fo,"__esModule",{value:!0});fo.parseKeyPairsIntoRecord=fo.parsePairKeyValue=fo.getKeyPairs=fo.serializeKeyPairs=void 0;var zX=(M(),x(L)),$u=WA();function YX(t){return t.reduce((e,n)=>{let r=`${e}${e!==""?$u.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>$u.BAGGAGE_MAX_TOTAL_LENGTH?e:r},"")}fo.serializeKeyPairs=YX;function WX(t){return t.getAllEntries().map(([e,n])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=$u.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}fo.getKeyPairs=WX;function SM(t){if(!t)return;let e=t.indexOf($u.BAGGAGE_PROPERTIES_SEPARATOR),n=e===-1?t:t.substring(0,e),r=n.indexOf($u.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),s=n.substring(r+1).trim();if(!o||!s)return;let i,a;try{i=decodeURIComponent(o),a=decodeURIComponent(s)}catch{return}let u;if(e!==-1&&e<t.length-1){let d=t.substring(e+1);u=(0,zX.baggageEntryMetadataFromString)(d)}return{key:i,value:a,metadata:u}}fo.parsePairKeyValue=SM;function KX(t){let e={};return typeof t=="string"&&t.length>0&&t.split($u.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=SM(n);r!==void 0&&r.value.length>0&&(e[r.key]=r.value)}),e}fo.parseKeyPairsIntoRecord=KX});var AM=E(Zm=>{"use strict";c();Object.defineProperty(Zm,"__esModule",{value:!0});Zm.W3CBaggagePropagator=void 0;var QA=(M(),x(L)),QX=Ud(),ca=WA(),JA=KA(),XA=class{inject(e,n,r){let o=QA.propagation.getBaggage(e);if(!o||(0,QX.isTracingSuppressed)(e))return;let s=(0,JA.getKeyPairs)(o).filter(a=>a.length<=ca.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,ca.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,JA.serializeKeyPairs)(s);i.length>0&&r.set(n,ca.BAGGAGE_HEADER,i)}extract(e,n,r){let o=r.get(n,ca.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(ca.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let i={};return s.length===0||(s.split(ca.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let d=(0,JA.parsePairKeyValue)(u);if(d){let p={value:d.value};d.metadata&&(p.metadata=d.metadata),i[d.key]=p}}),Object.entries(i).length===0)?e:QA.propagation.setBaggage(e,QA.propagation.createBaggage(i))}fields(){return[ca.BAGGAGE_HEADER]}};Zm.W3CBaggagePropagator=XA});var yM=E(e_=>{"use strict";c();Object.defineProperty(e_,"__esModule",{value:!0});e_.AnchoredClock=void 0;var ZA=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,n){this._monotonicClock=n,this._epochMillis=e.now(),this._performanceMillis=n.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};e_.AnchoredClock=ZA});var CM=E(Hs=>{"use strict";c();Object.defineProperty(Hs,"__esModule",{value:!0});Hs.isAttributeValue=Hs.isAttributeKey=Hs.sanitizeAttributes=void 0;var bM=(M(),x(L));function JX(t){let e={};if(typeof t!="object"||t==null)return e;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(!RM(n)){bM.diag.warn(`Invalid attribute key: ${n}`);continue}let r=t[n];if(!IM(r)){bM.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?e[n]=r.slice():e[n]=r}return e}Hs.sanitizeAttributes=JX;function RM(t){return typeof t=="string"&&t!==""}Hs.isAttributeKey=RM;function IM(t){return t==null?!0:Array.isArray(t)?XX(t):OM(typeof t)}Hs.isAttributeValue=IM;function XX(t){let e;for(let n of t){if(n==null)continue;let r=typeof n;if(r!==e){if(!e){if(OM(r)){e=r;continue}return!1}return!1}}return!0}function OM(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}});var ey=E(t_=>{"use strict";c();Object.defineProperty(t_,"__esModule",{value:!0});t_.loggingErrorHandler=void 0;var ZX=(M(),x(L));function eZ(){return t=>{ZX.diag.error(tZ(t))}}t_.loggingErrorHandler=eZ;function tZ(t){return typeof t=="string"?t:JSON.stringify(nZ(t))}function nZ(t){let e={},n=t;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(e[r])return;let o=n[r];o&&(e[r]=String(o))}),n=Object.getPrototypeOf(n);return e}});var xM=E(zu=>{"use strict";c();Object.defineProperty(zu,"__esModule",{value:!0});zu.globalErrorHandler=zu.setGlobalErrorHandler=void 0;var rZ=ey(),NM=(0,rZ.loggingErrorHandler)();function oZ(t){NM=t}zu.setGlobalErrorHandler=oZ;function sZ(t){try{NM(t)}catch{}}zu.globalErrorHandler=sZ});var kM=E(mo=>{"use strict";c();Object.defineProperty(mo,"__esModule",{value:!0});mo.getStringListFromEnv=mo.getBooleanFromEnv=mo.getStringFromEnv=mo.getNumberFromEnv=void 0;var PM=(M(),x(L)),MM=B("util");function iZ(t){let e=process.env[t];if(e==null||e.trim()==="")return;let n=Number(e);if(isNaN(n)){PM.diag.warn(`Unknown value ${(0,MM.inspect)(e)} for ${t}, expected a number, using defaults`);return}return n}mo.getNumberFromEnv=iZ;function vM(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}mo.getStringFromEnv=vM;function aZ(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||PM.diag.warn(`Unknown value ${(0,MM.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}mo.getBooleanFromEnv=aZ;function uZ(t){return vM(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}mo.getStringListFromEnv=uZ});var wM=E(n_=>{"use strict";c();Object.defineProperty(n_,"__esModule",{value:!0});n_._globalThis=void 0;n_._globalThis=globalThis});var LM=E(r_=>{"use strict";c();Object.defineProperty(r_,"__esModule",{value:!0});r_.VERSION=void 0;r_.VERSION="2.6.1"});function et(t){let e={},n=t.length;for(let r=0;r<n;r++){let o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var ty=K(()=>{c()});var DM,UM,BM,FM,GM,jM,HM,VM,qM,$M,zM,YM,WM,KM,QM,JM,XM,ZM,ev,tv,nv,rv,ov,sv,iv,av,uv,cv,lv,dv,pv,fv,mv,_v,hv,gv,Tv,Ev,Sv,Av,yv,bv,Rv,Iv,Ov,Cv,Nv,xv,Pv,Mv,vv,kv,wv,Lv,Dv,Uv,Bv,Fv,Gv,jv,Hv,Vv,qv,$v,zv,Yv,Wv,Kv,Qv,Jv,Xv,Zv,ek,tk,nk,rk,ok,sk,ik,ak,uk,ck,lk,dk,pk,fk,mk,_k,hk,gk,Tk,Ek,Sk,Ak,yk,bk,Rk,Ik,Ok,Ck,Nk,xk,Pk,Mk,vk,kk,wk,Lk,Dk,Uk,Bk,Fk,Gk,jk,Hk,Vk,qk,$k,zk,Yk,Wk,Kk,Qk,Jk,Xk,Zk,ew,tw,cZ,ny,lZ,dZ,pZ,fZ,ry,mZ,_Z,hZ,gZ,TZ,EZ,SZ,AZ,yZ,bZ,RZ,IZ,OZ,CZ,NZ,xZ,PZ,MZ,oy,vZ,kZ,wZ,LZ,DZ,UZ,BZ,FZ,GZ,jZ,HZ,VZ,sy,qZ,$Z,iy,ay,zZ,YZ,WZ,KZ,QZ,JZ,XZ,ZZ,eee,tee,nee,ree,oee,see,iee,aee,uee,Bd,Yu,uy,cee,lee,la,dee,pee,fee,mee,cy,ly,_ee,dy,hee,gee,Tee,Eee,See,Aee,yee,bee,Ree,Iee,Oee,Cee,Nee,xee,Pee,Mee,vee,kee,wee,Lee,Dee,Uee,Bee,py,Fee,Gee,jee,Hee,Vee,qee,$ee,zee,Yee,Wee,Kee,Qee,Jee,Xee,Zee,ete,tte,nte,rte,fy,ote,my,ste,ite,ate,ute,cte,lte,dte,pte,fte,nw,rw,ow,sw,iw,aw,uw,cw,lw,dw,pw,fw,mw,_w,hw,gw,Tw,Ew,Sw,Aw,yw,bw,Rw,Iw,Ow,Cw,Nw,xw,Pw,Mw,vw,kw,ww,Lw,Dw,Uw,Bw,Fw,Gw,jw,Hw,Vw,qw,$w,zw,Yw,Ww,mte,_te,hte,gte,Tte,Ete,Ste,Ate,yte,bte,Rte,Ite,Ote,Cte,Nte,xte,Pte,Mte,vte,kte,wte,Lte,Dte,Ute,Bte,Fte,Gte,jte,Hte,Vte,qte,$te,zte,Yte,Wte,Kte,Qte,Jte,Xte,Zte,ene,tne,nne,rne,one,sne,ine,ane,Kw,Qw,Jw,Xw,Zw,eL,tL,nL,rL,oL,sL,une,cne,lne,dne,pne,fne,mne,_ne,hne,gne,Tne,Ene,iL,aL,uL,cL,lL,Sne,Ane,yne,bne,Rne,Ine,dL,pL,fL,One,Cne,Nne,xne,mL,_L,hL,gL,Pne,Mne,vne,kne,wne,TL,EL,SL,AL,yL,bL,RL,Lne,Dne,Une,Bne,Fne,Gne,jne,Hne,IL,OL,CL,NL,xL,Vne,qne,$ne,zne,Yne,Wne,PL,ML,vL,kL,wL,LL,DL,UL,BL,FL,GL,jL,HL,VL,qL,$L,zL,YL,WL,KL,QL,Kne,Qne,Jne,Xne,Zne,ere,tre,nre,rre,ore,sre,ire,are,ure,cre,lre,dre,pre,fre,mre,_re,hre,JL,XL,ZL,eD,tD,gre,Tre,Ere,Sre,Are,yre,nD,rD,bre,Rre,Ire,oD,sD,Ore,Cre,Nre,iD,aD,uD,cD,lD,dD,pD,fD,mD,_D,hD,gD,TD,ED,SD,AD,yD,xre,Pre,Mre,vre,kre,wre,Lre,Dre,Ure,Bre,Fre,Gre,jre,Hre,Vre,qre,$re,zre,bD,RD,Yre,Wre,Kre,ID=K(()=>{c();ty();DM="aws.lambda.invoked_arn",UM="db.system",BM="db.connection_string",FM="db.user",GM="db.jdbc.driver_classname",jM="db.name",HM="db.statement",VM="db.operation",qM="db.mssql.instance_name",$M="db.cassandra.keyspace",zM="db.cassandra.page_size",YM="db.cassandra.consistency_level",WM="db.cassandra.table",KM="db.cassandra.idempotence",QM="db.cassandra.speculative_execution_count",JM="db.cassandra.coordinator.id",XM="db.cassandra.coordinator.dc",ZM="db.hbase.namespace",ev="db.redis.database_index",tv="db.mongodb.collection",nv="db.sql.table",rv="exception.type",ov="exception.message",sv="exception.stacktrace",iv="exception.escaped",av="faas.trigger",uv="faas.execution",cv="faas.document.collection",lv="faas.document.operation",dv="faas.document.time",pv="faas.document.name",fv="faas.time",mv="faas.cron",_v="faas.coldstart",hv="faas.invoked_name",gv="faas.invoked_provider",Tv="faas.invoked_region",Ev="net.transport",Sv="net.peer.ip",Av="net.peer.port",yv="net.peer.name",bv="net.host.ip",Rv="net.host.port",Iv="net.host.name",Ov="net.host.connection.type",Cv="net.host.connection.subtype",Nv="net.host.carrier.name",xv="net.host.carrier.mcc",Pv="net.host.carrier.mnc",Mv="net.host.carrier.icc",vv="peer.service",kv="enduser.id",wv="enduser.role",Lv="enduser.scope",Dv="thread.id",Uv="thread.name",Bv="code.function",Fv="code.namespace",Gv="code.filepath",jv="code.lineno",Hv="http.method",Vv="http.url",qv="http.target",$v="http.host",zv="http.scheme",Yv="http.status_code",Wv="http.flavor",Kv="http.user_agent",Qv="http.request_content_length",Jv="http.request_content_length_uncompressed",Xv="http.response_content_length",Zv="http.response_content_length_uncompressed",ek="http.server_name",tk="http.route",nk="http.client_ip",rk="aws.dynamodb.table_names",ok="aws.dynamodb.consumed_capacity",sk="aws.dynamodb.item_collection_metrics",ik="aws.dynamodb.provisioned_read_capacity",ak="aws.dynamodb.provisioned_write_capacity",uk="aws.dynamodb.consistent_read",ck="aws.dynamodb.projection",lk="aws.dynamodb.limit",dk="aws.dynamodb.attributes_to_get",pk="aws.dynamodb.index_name",fk="aws.dynamodb.select",mk="aws.dynamodb.global_secondary_indexes",_k="aws.dynamodb.local_secondary_indexes",hk="aws.dynamodb.exclusive_start_table",gk="aws.dynamodb.table_count",Tk="aws.dynamodb.scan_forward",Ek="aws.dynamodb.segment",Sk="aws.dynamodb.total_segments",Ak="aws.dynamodb.count",yk="aws.dynamodb.scanned_count",bk="aws.dynamodb.attribute_definitions",Rk="aws.dynamodb.global_secondary_index_updates",Ik="messaging.system",Ok="messaging.destination",Ck="messaging.destination_kind",Nk="messaging.temp_destination",xk="messaging.protocol",Pk="messaging.protocol_version",Mk="messaging.url",vk="messaging.message_id",kk="messaging.conversation_id",wk="messaging.message_payload_size_bytes",Lk="messaging.message_payload_compressed_size_bytes",Dk="messaging.operation",Uk="messaging.consumer_id",Bk="messaging.rabbitmq.routing_key",Fk="messaging.kafka.message_key",Gk="messaging.kafka.consumer_group",jk="messaging.kafka.client_id",Hk="messaging.kafka.partition",Vk="messaging.kafka.tombstone",qk="rpc.system",$k="rpc.service",zk="rpc.method",Yk="rpc.grpc.status_code",Wk="rpc.jsonrpc.version",Kk="rpc.jsonrpc.request_id",Qk="rpc.jsonrpc.error_code",Jk="rpc.jsonrpc.error_message",Xk="message.type",Zk="message.id",ew="message.compressed_size",tw="message.uncompressed_size",cZ=DM,ny=UM,lZ=BM,dZ=FM,pZ=GM,fZ=jM,ry=HM,mZ=VM,_Z=qM,hZ=$M,gZ=zM,TZ=YM,EZ=WM,SZ=KM,AZ=QM,yZ=JM,bZ=XM,RZ=ZM,IZ=ev,OZ=tv,CZ=nv,NZ=rv,xZ=ov,PZ=sv,MZ=iv,oy=av,vZ=uv,kZ=cv,wZ=lv,LZ=dv,DZ=pv,UZ=fv,BZ=mv,FZ=_v,GZ=hv,jZ=gv,HZ=Tv,VZ=Ev,sy=Sv,qZ=Av,$Z=yv,iy=bv,ay=Rv,zZ=Iv,YZ=Ov,WZ=Cv,KZ=Nv,QZ=xv,JZ=Pv,XZ=Mv,ZZ=vv,eee=kv,tee=wv,nee=Lv,ree=Dv,oee=Uv,see=Bv,iee=Fv,aee=Gv,uee=jv,Bd=Hv,Yu=Vv,uy=qv,cee=$v,lee=zv,la=Yv,dee=Wv,pee=Kv,fee=Qv,mee=Jv,cy=Xv,ly=Zv,_ee=ek,dy=tk,hee=nk,gee=rk,Tee=ok,Eee=sk,See=ik,Aee=ak,yee=uk,bee=ck,Ree=lk,Iee=dk,Oee=pk,Cee=fk,Nee=mk,xee=_k,Pee=hk,Mee=gk,vee=Tk,kee=Ek,wee=Sk,Lee=Ak,Dee=yk,Uee=bk,Bee=Rk,py=Ik,Fee=Ok,Gee=Ck,jee=Nk,Hee=xk,Vee=Pk,qee=Mk,$ee=vk,zee=kk,Yee=wk,Wee=Lk,Kee=Dk,Qee=Uk,Jee=Bk,Xee=Fk,Zee=Gk,ete=jk,tte=Hk,nte=Vk,rte=qk,fy=$k,ote=zk,my=Yk,ste=Wk,ite=Kk,ate=Qk,ute=Jk,cte=Xk,lte=Zk,dte=ew,pte=tw,fte=et([DM,UM,BM,FM,GM,jM,HM,VM,qM,$M,zM,YM,WM,KM,QM,JM,XM,ZM,ev,tv,nv,rv,ov,sv,iv,av,uv,cv,lv,dv,pv,fv,mv,_v,hv,gv,Tv,Ev,Sv,Av,yv,bv,Rv,Iv,Ov,Cv,Nv,xv,Pv,Mv,vv,kv,wv,Lv,Dv,Uv,Bv,Fv,Gv,jv,Hv,Vv,qv,$v,zv,Yv,Wv,Kv,Qv,Jv,Xv,Zv,ek,tk,nk,rk,ok,sk,ik,ak,uk,ck,lk,dk,pk,fk,mk,_k,hk,gk,Tk,Ek,Sk,Ak,yk,bk,Rk,Ik,Ok,Ck,Nk,xk,Pk,Mk,vk,kk,wk,Lk,Dk,Uk,Bk,Fk,Gk,jk,Hk,Vk,qk,$k,zk,Yk,Wk,Kk,Qk,Jk,Xk,Zk,ew,tw]),nw="other_sql",rw="mssql",ow="mysql",sw="oracle",iw="db2",aw="postgresql",uw="redshift",cw="hive",lw="cloudscape",dw="hsqldb",pw="progress",fw="maxdb",mw="hanadb",_w="ingres",hw="firstsql",gw="edb",Tw="cache",Ew="adabas",Sw="firebird",Aw="derby",yw="filemaker",bw="informix",Rw="instantdb",Iw="interbase",Ow="mariadb",Cw="netezza",Nw="pervasive",xw="pointbase",Pw="sqlite",Mw="sybase",vw="teradata",kw="vertica",ww="h2",Lw="coldfusion",Dw="cassandra",Uw="hbase",Bw="mongodb",Fw="redis",Gw="couchbase",jw="couchdb",Hw="cosmosdb",Vw="dynamodb",qw="neo4j",$w="geode",zw="elasticsearch",Yw="memcached",Ww="cockroachdb",mte=nw,_te=rw,hte=ow,gte=sw,Tte=iw,Ete=aw,Ste=uw,Ate=cw,yte=lw,bte=dw,Rte=pw,Ite=fw,Ote=mw,Cte=_w,Nte=hw,xte=gw,Pte=Tw,Mte=Ew,vte=Sw,kte=Aw,wte=yw,Lte=bw,Dte=Rw,Ute=Iw,Bte=Ow,Fte=Cw,Gte=Nw,jte=xw,Hte=Pw,Vte=Mw,qte=vw,$te=kw,zte=ww,Yte=Lw,Wte=Dw,Kte=Uw,Qte=Bw,Jte=Fw,Xte=Gw,Zte=jw,ene=Hw,tne=Vw,nne=qw,rne=$w,one=zw,sne=Yw,ine=Ww,ane=et([nw,rw,ow,sw,iw,aw,uw,cw,lw,dw,pw,fw,mw,_w,hw,gw,Tw,Ew,Sw,Aw,yw,bw,Rw,Iw,Ow,Cw,Nw,xw,Pw,Mw,vw,kw,ww,Lw,Dw,Uw,Bw,Fw,Gw,jw,Hw,Vw,qw,$w,zw,Yw,Ww]),Kw="all",Qw="each_quorum",Jw="quorum",Xw="local_quorum",Zw="one",eL="two",tL="three",nL="local_one",rL="any",oL="serial",sL="local_serial",une=Kw,cne=Qw,lne=Jw,dne=Xw,pne=Zw,fne=eL,mne=tL,_ne=nL,hne=rL,gne=oL,Tne=sL,Ene=et([Kw,Qw,Jw,Xw,Zw,eL,tL,nL,rL,oL,sL]),iL="datasource",aL="http",uL="pubsub",cL="timer",lL="other",Sne=iL,Ane=aL,yne=uL,bne=cL,Rne=lL,Ine=et([iL,aL,uL,cL,lL]),dL="insert",pL="edit",fL="delete",One=dL,Cne=pL,Nne=fL,xne=et([dL,pL,fL]),mL="alibaba_cloud",_L="aws",hL="azure",gL="gcp",Pne=mL,Mne=_L,vne=hL,kne=gL,wne=et([mL,_L,hL,gL]),TL="ip_tcp",EL="ip_udp",SL="ip",AL="unix",yL="pipe",bL="inproc",RL="other",Lne=TL,Dne=EL,Une=SL,Bne=AL,Fne=yL,Gne=bL,jne=RL,Hne=et([TL,EL,SL,AL,yL,bL,RL]),IL="wifi",OL="wired",CL="cell",NL="unavailable",xL="unknown",Vne=IL,qne=OL,$ne=CL,zne=NL,Yne=xL,Wne=et([IL,OL,CL,NL,xL]),PL="gprs",ML="edge",vL="umts",kL="cdma",wL="evdo_0",LL="evdo_a",DL="cdma2000_1xrtt",UL="hsdpa",BL="hsupa",FL="hspa",GL="iden",jL="evdo_b",HL="lte",VL="ehrpd",qL="hspap",$L="gsm",zL="td_scdma",YL="iwlan",WL="nr",KL="nrnsa",QL="lte_ca",Kne=PL,Qne=ML,Jne=vL,Xne=kL,Zne=wL,ere=LL,tre=DL,nre=UL,rre=BL,ore=FL,sre=GL,ire=jL,are=HL,ure=VL,cre=qL,lre=$L,dre=zL,pre=YL,fre=WL,mre=KL,_re=QL,hre=et([PL,ML,vL,kL,wL,LL,DL,UL,BL,FL,GL,jL,HL,VL,qL,$L,zL,YL,WL,KL,QL]),JL="1.0",XL="1.1",ZL="2.0",eD="SPDY",tD="QUIC",gre=JL,Tre=XL,Ere=ZL,Sre=eD,Are=tD,yre={HTTP_1_0:JL,HTTP_1_1:XL,HTTP_2_0:ZL,SPDY:eD,QUIC:tD},nD="queue",rD="topic",bre=nD,Rre=rD,Ire=et([nD,rD]),oD="receive",sD="process",Ore=oD,Cre=sD,Nre=et([oD,sD]),iD=0,aD=1,uD=2,cD=3,lD=4,dD=5,pD=6,fD=7,mD=8,_D=9,hD=10,gD=11,TD=12,ED=13,SD=14,AD=15,yD=16,xre=iD,Pre=aD,Mre=uD,vre=cD,kre=lD,wre=dD,Lre=pD,Dre=fD,Ure=mD,Bre=_D,Fre=hD,Gre=gD,jre=TD,Hre=ED,Vre=SD,qre=AD,$re=yD,zre={OK:iD,CANCELLED:aD,UNKNOWN:uD,INVALID_ARGUMENT:cD,DEADLINE_EXCEEDED:lD,NOT_FOUND:dD,ALREADY_EXISTS:pD,PERMISSION_DENIED:fD,RESOURCE_EXHAUSTED:mD,FAILED_PRECONDITION:_D,ABORTED:hD,OUT_OF_RANGE:gD,UNIMPLEMENTED:TD,INTERNAL:ED,UNAVAILABLE:SD,DATA_LOSS:AD,UNAUTHENTICATED:yD},bD="SENT",RD="RECEIVED",Yre=bD,Wre=RD,Kre=et([bD,RD])});var OD=K(()=>{c();ID()});var CD,ND,xD,PD,MD,vD,kD,wD,LD,DD,UD,BD,FD,GD,jD,HD,VD,qD,$D,zD,YD,WD,KD,QD,JD,XD,ZD,e2,t2,n2,r2,o2,s2,i2,a2,u2,c2,l2,d2,p2,f2,m2,_2,h2,g2,T2,E2,S2,A2,y2,b2,R2,I2,O2,C2,N2,x2,P2,M2,v2,k2,w2,L2,D2,U2,B2,F2,G2,j2,H2,V2,q2,$2,z2,Y2,W2,K2,Q2,J2,X2,Z2,Qre,Jre,Xre,Zre,eoe,toe,noe,roe,ooe,soe,ioe,aoe,uoe,coe,loe,doe,poe,foe,moe,_oe,hoe,goe,Toe,Eoe,Soe,Aoe,yoe,boe,Roe,Ioe,Ooe,Coe,Noe,xoe,Poe,Moe,voe,koe,woe,Loe,Doe,Uoe,Boe,Foe,Goe,joe,Hoe,Voe,qoe,$oe,zoe,Yoe,Woe,Koe,Qoe,Joe,Xoe,Zoe,ese,tse,nse,rse,ose,sse,ise,ase,use,cse,lse,dse,pse,_y,fse,mse,_se,hse,gse,Tse,Ese,Sse,Ase,yse,eU,tU,nU,rU,bse,Rse,Ise,Ose,Cse,oU,sU,iU,aU,uU,cU,lU,dU,pU,fU,mU,_U,hU,gU,TU,EU,SU,Nse,xse,Pse,Mse,vse,kse,wse,Lse,Dse,Use,Bse,Fse,Gse,jse,Hse,Vse,qse,$se,AU,yU,zse,Yse,Wse,bU,RU,IU,OU,CU,NU,xU,Kse,Qse,Jse,Xse,Zse,eie,tie,nie,PU,MU,vU,kU,wU,LU,DU,UU,BU,FU,GU,rie,oie,sie,iie,aie,uie,cie,lie,die,pie,fie,mie,jU,HU,VU,qU,$U,zU,YU,WU,KU,QU,_ie,hie,gie,Tie,Eie,Sie,Aie,yie,bie,Rie,Iie,JU=K(()=>{c();ty();CD="cloud.provider",ND="cloud.account.id",xD="cloud.region",PD="cloud.availability_zone",MD="cloud.platform",vD="aws.ecs.container.arn",kD="aws.ecs.cluster.arn",wD="aws.ecs.launchtype",LD="aws.ecs.task.arn",DD="aws.ecs.task.family",UD="aws.ecs.task.revision",BD="aws.eks.cluster.arn",FD="aws.log.group.names",GD="aws.log.group.arns",jD="aws.log.stream.names",HD="aws.log.stream.arns",VD="container.name",qD="container.id",$D="container.runtime",zD="container.image.name",YD="container.image.tag",WD="deployment.environment",KD="device.id",QD="device.model.identifier",JD="device.model.name",XD="faas.name",ZD="faas.id",e2="faas.version",t2="faas.instance",n2="faas.max_memory",r2="host.id",o2="host.name",s2="host.type",i2="host.arch",a2="host.image.name",u2="host.image.id",c2="host.image.version",l2="k8s.cluster.name",d2="k8s.node.name",p2="k8s.node.uid",f2="k8s.namespace.name",m2="k8s.pod.uid",_2="k8s.pod.name",h2="k8s.container.name",g2="k8s.replicaset.uid",T2="k8s.replicaset.name",E2="k8s.deployment.uid",S2="k8s.deployment.name",A2="k8s.statefulset.uid",y2="k8s.statefulset.name",b2="k8s.daemonset.uid",R2="k8s.daemonset.name",I2="k8s.job.uid",O2="k8s.job.name",C2="k8s.cronjob.uid",N2="k8s.cronjob.name",x2="os.type",P2="os.description",M2="os.name",v2="os.version",k2="process.pid",w2="process.executable.name",L2="process.executable.path",D2="process.command",U2="process.command_line",B2="process.command_args",F2="process.owner",G2="process.runtime.name",j2="process.runtime.version",H2="process.runtime.description",V2="service.name",q2="service.namespace",$2="service.instance.id",z2="service.version",Y2="telemetry.sdk.name",W2="telemetry.sdk.language",K2="telemetry.sdk.version",Q2="telemetry.auto.version",J2="webengine.name",X2="webengine.version",Z2="webengine.description",Qre=CD,Jre=ND,Xre=xD,Zre=PD,eoe=MD,toe=vD,noe=kD,roe=wD,ooe=LD,soe=DD,ioe=UD,aoe=BD,uoe=FD,coe=GD,loe=jD,doe=HD,poe=VD,foe=qD,moe=$D,_oe=zD,hoe=YD,goe=WD,Toe=KD,Eoe=QD,Soe=JD,Aoe=XD,yoe=ZD,boe=e2,Roe=t2,Ioe=n2,Ooe=r2,Coe=o2,Noe=s2,xoe=i2,Poe=a2,Moe=u2,voe=c2,koe=l2,woe=d2,Loe=p2,Doe=f2,Uoe=m2,Boe=_2,Foe=h2,Goe=g2,joe=T2,Hoe=E2,Voe=S2,qoe=A2,$oe=y2,zoe=b2,Yoe=R2,Woe=I2,Koe=O2,Qoe=C2,Joe=N2,Xoe=x2,Zoe=P2,ese=M2,tse=v2,nse=k2,rse=w2,ose=L2,sse=D2,ise=U2,ase=B2,use=F2,cse=G2,lse=j2,dse=H2,pse=V2,_y=q2,fse=$2,mse=z2,_se=Y2,hse=W2,gse=K2,Tse=Q2,Ese=J2,Sse=X2,Ase=Z2,yse=et([CD,ND,xD,PD,MD,vD,kD,wD,LD,DD,UD,BD,FD,GD,jD,HD,VD,qD,$D,zD,YD,WD,KD,QD,JD,XD,ZD,e2,t2,n2,r2,o2,s2,i2,a2,u2,c2,l2,d2,p2,f2,m2,_2,h2,g2,T2,E2,S2,A2,y2,b2,R2,I2,O2,C2,N2,x2,P2,M2,v2,k2,w2,L2,D2,U2,B2,F2,G2,j2,H2,V2,q2,$2,z2,Y2,W2,K2,Q2,J2,X2,Z2]),eU="alibaba_cloud",tU="aws",nU="azure",rU="gcp",bse=eU,Rse=tU,Ise=nU,Ose=rU,Cse=et([eU,tU,nU,rU]),oU="alibaba_cloud_ecs",sU="alibaba_cloud_fc",iU="aws_ec2",aU="aws_ecs",uU="aws_eks",cU="aws_lambda",lU="aws_elastic_beanstalk",dU="azure_vm",pU="azure_container_instances",fU="azure_aks",mU="azure_functions",_U="azure_app_service",hU="gcp_compute_engine",gU="gcp_cloud_run",TU="gcp_kubernetes_engine",EU="gcp_cloud_functions",SU="gcp_app_engine",Nse=oU,xse=sU,Pse=iU,Mse=aU,vse=uU,kse=cU,wse=lU,Lse=dU,Dse=pU,Use=fU,Bse=mU,Fse=_U,Gse=hU,jse=gU,Hse=TU,Vse=EU,qse=SU,$se=et([oU,sU,iU,aU,uU,cU,lU,dU,pU,fU,mU,_U,hU,gU,TU,EU,SU]),AU="ec2",yU="fargate",zse=AU,Yse=yU,Wse=et([AU,yU]),bU="amd64",RU="arm32",IU="arm64",OU="ia64",CU="ppc32",NU="ppc64",xU="x86",Kse=bU,Qse=RU,Jse=IU,Xse=OU,Zse=CU,eie=NU,tie=xU,nie=et([bU,RU,IU,OU,CU,NU,xU]),PU="windows",MU="linux",vU="darwin",kU="freebsd",wU="netbsd",LU="openbsd",DU="dragonflybsd",UU="hpux",BU="aix",FU="solaris",GU="z_os",rie=PU,oie=MU,sie=vU,iie=kU,aie=wU,uie=LU,cie=DU,lie=UU,die=BU,pie=FU,fie=GU,mie=et([PU,MU,vU,kU,wU,LU,DU,UU,BU,FU,GU]),jU="cpp",HU="dotnet",VU="erlang",qU="go",$U="java",zU="nodejs",YU="php",WU="python",KU="ruby",QU="webjs",_ie=jU,hie=HU,gie=VU,Tie=qU,Eie=$U,Sie=zU,Aie=YU,yie=WU,bie=KU,Rie=QU,Iie=et([jU,HU,VU,qU,$U,zU,YU,WU,KU,QU])});var XU=K(()=>{c();JU()});var Oie,Cie,Nie,xie,Pie,Mie,vie,kie,wie,Lie,Die,Uie,Bie,Fie,Gie,jie,Hie,Vie,qie,$ie,zie,Yie,Wie,Kie,Qie,hy,gy,Jie,Wu,Xie,Ty,Ey,Zie,da,eae,tae,nae,rae,oae,sae,iae,aae,uae,cae,Sy,lae,dae,pae,fae,mae,_ae,pa,hae,gae,Tae,Eae,Sae,Aae,yae,bae,Rae,Iae,Oae,Cae,Nae,ns,rs,xae,Pae,Mae,vae,kae,wae,Lae,Dae,Uae,Bae,Fae,Gae,jae,Hae,Vae,qae,Ay,yy,$ae,by,Ry,zae,Yae,Wae,Kae,Qae,Jae,Xae,Zae,eue,tue,nue,rue,oue,sue,Iy,Oy,iue,Cy,aue,Ny,uue,cue,lue,due,pue,fue,mue,_ue,hue,gue,Tue,Eue,Sue,Aue,yue,bue,Rue,Iue,Oue,Cue,Nue,xue,Pue,Mue,Vs,vue,kue,wue,xy,ZU=K(()=>{c();Oie="aspnetcore.diagnostics.exception.result",Cie="aborted",Nie="handled",xie="skipped",Pie="unhandled",Mie="aspnetcore.diagnostics.handler.type",vie="aspnetcore.rate_limiting.policy",kie="aspnetcore.rate_limiting.result",wie="acquired",Lie="endpoint_limiter",Die="global_limiter",Uie="request_canceled",Bie="aspnetcore.request.is_unhandled",Fie="aspnetcore.routing.is_fallback",Gie="aspnetcore.routing.match_status",jie="failure",Hie="success",Vie="aspnetcore.user.is_authenticated",qie="client.address",$ie="client.port",zie="code.column.number",Yie="code.file.path",Wie="code.function.name",Kie="code.line.number",Qie="code.stacktrace",hy="db.collection.name",gy="db.namespace",Jie="db.operation.batch.size",Wu="db.operation.name",Xie="db.query.summary",Ty="db.query.text",Ey="db.response.status_code",Zie="db.stored_procedure.name",da="db.system.name",eae="mariadb",tae="microsoft.sql_server",nae="mysql",rae="postgresql",oae="dotnet.gc.heap.generation",sae="gen0",iae="gen1",aae="gen2",uae="loh",cae="poh",Sy="error.type",lae="_OTHER",dae="exception.escaped",pae="exception.message",fae="exception.stacktrace",mae="exception.type",_ae=t=>`http.request.header.${t}`,pa="http.request.method",hae="_OTHER",gae="CONNECT",Tae="DELETE",Eae="GET",Sae="HEAD",Aae="OPTIONS",yae="PATCH",bae="POST",Rae="PUT",Iae="TRACE",Oae="http.request.method_original",Cae="http.request.resend_count",Nae=t=>`http.response.header.${t}`,ns="http.response.status_code",rs="http.route",xae="jvm.gc.action",Pae="jvm.gc.name",Mae="jvm.memory.pool.name",vae="jvm.memory.type",kae="heap",wae="non_heap",Lae="jvm.thread.daemon",Dae="jvm.thread.state",Uae="blocked",Bae="new",Fae="runnable",Gae="terminated",jae="timed_waiting",Hae="waiting",Vae="network.local.address",qae="network.local.port",Ay="network.peer.address",yy="network.peer.port",$ae="network.protocol.name",by="network.protocol.version",Ry="network.transport",zae="pipe",Yae="quic",Wae="tcp",Kae="udp",Qae="unix",Jae="network.type",Xae="ipv4",Zae="ipv6",eue="otel.scope.name",tue="otel.scope.version",nue="otel.status_code",rue="ERROR",oue="OK",sue="otel.status_description",Iy="server.address",Oy="server.port",iue="service.instance.id",Cy="service.name",aue="service.namespace",Ny="service.version",uue="signalr.connection.status",cue="app_shutdown",lue="normal_closure",due="timeout",pue="signalr.transport",fue="long_polling",mue="server_sent_events",_ue="web_sockets",hue="telemetry.sdk.language",gue="cpp",Tue="dotnet",Eue="erlang",Sue="go",Aue="java",yue="nodejs",bue="php",Rue="python",Iue="ruby",Oue="rust",Cue="swift",Nue="webjs",xue="telemetry.sdk.name",Pue="telemetry.sdk.version",Mue="url.fragment",Vs="url.full",vue="url.path",kue="url.query",wue="url.scheme",xy="user_agent.original"});var Lue,Due,Uue,Bue,Fue,Gue,jue,Hue,Vue,que,$ue,zue,Yue,Wue,Kue,Que,Jue,Xue,Zue,ece,tce,nce,rce,oce,sce,ice,ace,uce,cce,lce,dce,pce,fce,mce,_ce,hce,gce,Tce,Ece,Sce,Ace,yce,bce,Rce,Ice,Oce,Cce,Nce,xce,Pce,Mce,eB=K(()=>{c();Lue="aspnetcore.diagnostics.exceptions",Due="aspnetcore.rate_limiting.active_request_leases",Uue="aspnetcore.rate_limiting.queued_requests",Bue="aspnetcore.rate_limiting.request.time_in_queue",Fue="aspnetcore.rate_limiting.request_lease.duration",Gue="aspnetcore.rate_limiting.requests",jue="aspnetcore.routing.match_attempts",Hue="db.client.operation.duration",Vue="dotnet.assembly.count",que="dotnet.exceptions",$ue="dotnet.gc.collections",zue="dotnet.gc.heap.total_allocated",Yue="dotnet.gc.last_collection.heap.fragmentation.size",Wue="dotnet.gc.last_collection.heap.size",Kue="dotnet.gc.last_collection.memory.committed_size",Que="dotnet.gc.pause.time",Jue="dotnet.jit.compilation.time",Xue="dotnet.jit.compiled_il.size",Zue="dotnet.jit.compiled_methods",ece="dotnet.monitor.lock_contentions",tce="dotnet.process.cpu.count",nce="dotnet.process.cpu.time",rce="dotnet.process.memory.working_set",oce="dotnet.thread_pool.queue.length",sce="dotnet.thread_pool.thread.count",ice="dotnet.thread_pool.work_item.count",ace="dotnet.timer.count",uce="http.client.request.duration",cce="http.server.request.duration",lce="jvm.class.count",dce="jvm.class.loaded",pce="jvm.class.unloaded",fce="jvm.cpu.count",mce="jvm.cpu.recent_utilization",_ce="jvm.cpu.time",hce="jvm.gc.duration",gce="jvm.memory.committed",Tce="jvm.memory.limit",Ece="jvm.memory.used",Sce="jvm.memory.used_after_last_gc",Ace="jvm.thread.count",yce="kestrel.active_connections",bce="kestrel.active_tls_handshakes",Rce="kestrel.connection.duration",Ice="kestrel.queued_connections",Oce="kestrel.queued_requests",Cce="kestrel.rejected_connections",Nce="kestrel.tls_handshake.duration",xce="kestrel.upgraded_connections",Pce="signalr.server.active_connections",Mce="signalr.server.connection.duration"});var vce,tB=K(()=>{c();vce="exception"});var Oe={};oa(Oe,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Cie,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Nie,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>xie,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Pie,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>wie,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Lie,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Die,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Uie,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>jie,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Hie,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Oie,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Mie,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>vie,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>kie,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Bie,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Fie,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Gie,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Vie,ATTR_CLIENT_ADDRESS:()=>qie,ATTR_CLIENT_PORT:()=>$ie,ATTR_CODE_COLUMN_NUMBER:()=>zie,ATTR_CODE_FILE_PATH:()=>Yie,ATTR_CODE_FUNCTION_NAME:()=>Wie,ATTR_CODE_LINE_NUMBER:()=>Kie,ATTR_CODE_STACKTRACE:()=>Qie,ATTR_DB_COLLECTION_NAME:()=>hy,ATTR_DB_NAMESPACE:()=>gy,ATTR_DB_OPERATION_BATCH_SIZE:()=>Jie,ATTR_DB_OPERATION_NAME:()=>Wu,ATTR_DB_QUERY_SUMMARY:()=>Xie,ATTR_DB_QUERY_TEXT:()=>Ty,ATTR_DB_RESPONSE_STATUS_CODE:()=>Ey,ATTR_DB_STORED_PROCEDURE_NAME:()=>Zie,ATTR_DB_SYSTEM_NAME:()=>da,ATTR_DOTNET_GC_HEAP_GENERATION:()=>oae,ATTR_ERROR_TYPE:()=>Sy,ATTR_EXCEPTION_ESCAPED:()=>dae,ATTR_EXCEPTION_MESSAGE:()=>pae,ATTR_EXCEPTION_STACKTRACE:()=>fae,ATTR_EXCEPTION_TYPE:()=>mae,ATTR_HTTP_REQUEST_HEADER:()=>_ae,ATTR_HTTP_REQUEST_METHOD:()=>pa,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Oae,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Cae,ATTR_HTTP_RESPONSE_HEADER:()=>Nae,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>ns,ATTR_HTTP_ROUTE:()=>rs,ATTR_JVM_GC_ACTION:()=>xae,ATTR_JVM_GC_NAME:()=>Pae,ATTR_JVM_MEMORY_POOL_NAME:()=>Mae,ATTR_JVM_MEMORY_TYPE:()=>vae,ATTR_JVM_THREAD_DAEMON:()=>Lae,ATTR_JVM_THREAD_STATE:()=>Dae,ATTR_NETWORK_LOCAL_ADDRESS:()=>Vae,ATTR_NETWORK_LOCAL_PORT:()=>qae,ATTR_NETWORK_PEER_ADDRESS:()=>Ay,ATTR_NETWORK_PEER_PORT:()=>yy,ATTR_NETWORK_PROTOCOL_NAME:()=>$ae,ATTR_NETWORK_PROTOCOL_VERSION:()=>by,ATTR_NETWORK_TRANSPORT:()=>Ry,ATTR_NETWORK_TYPE:()=>Jae,ATTR_OTEL_SCOPE_NAME:()=>eue,ATTR_OTEL_SCOPE_VERSION:()=>tue,ATTR_OTEL_STATUS_CODE:()=>nue,ATTR_OTEL_STATUS_DESCRIPTION:()=>sue,ATTR_SERVER_ADDRESS:()=>Iy,ATTR_SERVER_PORT:()=>Oy,ATTR_SERVICE_INSTANCE_ID:()=>iue,ATTR_SERVICE_NAME:()=>Cy,ATTR_SERVICE_NAMESPACE:()=>aue,ATTR_SERVICE_VERSION:()=>Ny,ATTR_SIGNALR_CONNECTION_STATUS:()=>uue,ATTR_SIGNALR_TRANSPORT:()=>pue,ATTR_TELEMETRY_SDK_LANGUAGE:()=>hue,ATTR_TELEMETRY_SDK_NAME:()=>xue,ATTR_TELEMETRY_SDK_VERSION:()=>Pue,ATTR_URL_FRAGMENT:()=>Mue,ATTR_URL_FULL:()=>Vs,ATTR_URL_PATH:()=>vue,ATTR_URL_QUERY:()=>kue,ATTR_URL_SCHEME:()=>wue,ATTR_USER_AGENT_ORIGINAL:()=>xy,AWSECSLAUNCHTYPEVALUES_EC2:()=>zse,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Yse,AwsEcsLaunchtypeValues:()=>Wse,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Nse,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>xse,CLOUDPLATFORMVALUES_AWS_EC2:()=>Pse,CLOUDPLATFORMVALUES_AWS_ECS:()=>Mse,CLOUDPLATFORMVALUES_AWS_EKS:()=>vse,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>wse,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>kse,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Use,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Fse,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Dse,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Bse,CLOUDPLATFORMVALUES_AZURE_VM:()=>Lse,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>qse,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Vse,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>jse,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Gse,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Hse,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>bse,CLOUDPROVIDERVALUES_AWS:()=>Rse,CLOUDPROVIDERVALUES_AZURE:()=>Ise,CLOUDPROVIDERVALUES_GCP:()=>Ose,CloudPlatformValues:()=>$se,CloudProviderValues:()=>Cse,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>une,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>hne,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>cne,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>_ne,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>dne,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Tne,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>pne,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>lne,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>gne,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>mne,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>fne,DBSYSTEMVALUES_ADABAS:()=>Mte,DBSYSTEMVALUES_CACHE:()=>Pte,DBSYSTEMVALUES_CASSANDRA:()=>Wte,DBSYSTEMVALUES_CLOUDSCAPE:()=>yte,DBSYSTEMVALUES_COCKROACHDB:()=>ine,DBSYSTEMVALUES_COLDFUSION:()=>Yte,DBSYSTEMVALUES_COSMOSDB:()=>ene,DBSYSTEMVALUES_COUCHBASE:()=>Xte,DBSYSTEMVALUES_COUCHDB:()=>Zte,DBSYSTEMVALUES_DB2:()=>Tte,DBSYSTEMVALUES_DERBY:()=>kte,DBSYSTEMVALUES_DYNAMODB:()=>tne,DBSYSTEMVALUES_EDB:()=>xte,DBSYSTEMVALUES_ELASTICSEARCH:()=>one,DBSYSTEMVALUES_FILEMAKER:()=>wte,DBSYSTEMVALUES_FIREBIRD:()=>vte,DBSYSTEMVALUES_FIRSTSQL:()=>Nte,DBSYSTEMVALUES_GEODE:()=>rne,DBSYSTEMVALUES_H2:()=>zte,DBSYSTEMVALUES_HANADB:()=>Ote,DBSYSTEMVALUES_HBASE:()=>Kte,DBSYSTEMVALUES_HIVE:()=>Ate,DBSYSTEMVALUES_HSQLDB:()=>bte,DBSYSTEMVALUES_INFORMIX:()=>Lte,DBSYSTEMVALUES_INGRES:()=>Cte,DBSYSTEMVALUES_INSTANTDB:()=>Dte,DBSYSTEMVALUES_INTERBASE:()=>Ute,DBSYSTEMVALUES_MARIADB:()=>Bte,DBSYSTEMVALUES_MAXDB:()=>Ite,DBSYSTEMVALUES_MEMCACHED:()=>sne,DBSYSTEMVALUES_MONGODB:()=>Qte,DBSYSTEMVALUES_MSSQL:()=>_te,DBSYSTEMVALUES_MYSQL:()=>hte,DBSYSTEMVALUES_NEO4J:()=>nne,DBSYSTEMVALUES_NETEZZA:()=>Fte,DBSYSTEMVALUES_ORACLE:()=>gte,DBSYSTEMVALUES_OTHER_SQL:()=>mte,DBSYSTEMVALUES_PERVASIVE:()=>Gte,DBSYSTEMVALUES_POINTBASE:()=>jte,DBSYSTEMVALUES_POSTGRESQL:()=>Ete,DBSYSTEMVALUES_PROGRESS:()=>Rte,DBSYSTEMVALUES_REDIS:()=>Jte,DBSYSTEMVALUES_REDSHIFT:()=>Ste,DBSYSTEMVALUES_SQLITE:()=>Hte,DBSYSTEMVALUES_SYBASE:()=>Vte,DBSYSTEMVALUES_TERADATA:()=>qte,DBSYSTEMVALUES_VERTICA:()=>$te,DB_SYSTEM_NAME_VALUE_MARIADB:()=>eae,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>tae,DB_SYSTEM_NAME_VALUE_MYSQL:()=>nae,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>rae,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>sae,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>iae,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>aae,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>uae,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>cae,DbCassandraConsistencyLevelValues:()=>Ene,DbSystemValues:()=>ane,ERROR_TYPE_VALUE_OTHER:()=>lae,EVENT_EXCEPTION:()=>vce,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Nne,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Cne,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>One,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Pne,FAASINVOKEDPROVIDERVALUES_AWS:()=>Mne,FAASINVOKEDPROVIDERVALUES_AZURE:()=>vne,FAASINVOKEDPROVIDERVALUES_GCP:()=>kne,FAASTRIGGERVALUES_DATASOURCE:()=>Sne,FAASTRIGGERVALUES_HTTP:()=>Ane,FAASTRIGGERVALUES_OTHER:()=>Rne,FAASTRIGGERVALUES_PUBSUB:()=>yne,FAASTRIGGERVALUES_TIMER:()=>bne,FaasDocumentOperationValues:()=>xne,FaasInvokedProviderValues:()=>wne,FaasTriggerValues:()=>Ine,HOSTARCHVALUES_AMD64:()=>Kse,HOSTARCHVALUES_ARM32:()=>Qse,HOSTARCHVALUES_ARM64:()=>Jse,HOSTARCHVALUES_IA64:()=>Xse,HOSTARCHVALUES_PPC32:()=>Zse,HOSTARCHVALUES_PPC64:()=>eie,HOSTARCHVALUES_X86:()=>tie,HTTPFLAVORVALUES_HTTP_1_0:()=>gre,HTTPFLAVORVALUES_HTTP_1_1:()=>Tre,HTTPFLAVORVALUES_HTTP_2_0:()=>Ere,HTTPFLAVORVALUES_QUIC:()=>Are,HTTPFLAVORVALUES_SPDY:()=>Sre,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>gae,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Tae,HTTP_REQUEST_METHOD_VALUE_GET:()=>Eae,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Sae,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Aae,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>hae,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>yae,HTTP_REQUEST_METHOD_VALUE_POST:()=>bae,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Rae,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Iae,HostArchValues:()=>nie,HttpFlavorValues:()=>yre,JVM_MEMORY_TYPE_VALUE_HEAP:()=>kae,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>wae,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Uae,JVM_THREAD_STATE_VALUE_NEW:()=>Bae,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Fae,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Gae,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>jae,JVM_THREAD_STATE_VALUE_WAITING:()=>Hae,MESSAGETYPEVALUES_RECEIVED:()=>Wre,MESSAGETYPEVALUES_SENT:()=>Yre,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>bre,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Rre,MESSAGINGOPERATIONVALUES_PROCESS:()=>Cre,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Ore,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Lue,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Due,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Uue,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Gue,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Fue,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Bue,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>jue,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Hue,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Vue,METRIC_DOTNET_EXCEPTIONS:()=>que,METRIC_DOTNET_GC_COLLECTIONS:()=>$ue,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>zue,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>Yue,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Wue,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Kue,METRIC_DOTNET_GC_PAUSE_TIME:()=>Que,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Jue,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Xue,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Zue,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>ece,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>tce,METRIC_DOTNET_PROCESS_CPU_TIME:()=>nce,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>rce,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>oce,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>sce,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>ice,METRIC_DOTNET_TIMER_COUNT:()=>ace,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>uce,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>cce,METRIC_JVM_CLASS_COUNT:()=>lce,METRIC_JVM_CLASS_LOADED:()=>dce,METRIC_JVM_CLASS_UNLOADED:()=>pce,METRIC_JVM_CPU_COUNT:()=>fce,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>mce,METRIC_JVM_CPU_TIME:()=>_ce,METRIC_JVM_GC_DURATION:()=>hce,METRIC_JVM_MEMORY_COMMITTED:()=>gce,METRIC_JVM_MEMORY_LIMIT:()=>Tce,METRIC_JVM_MEMORY_USED:()=>Ece,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Sce,METRIC_JVM_THREAD_COUNT:()=>Ace,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>yce,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>bce,METRIC_KESTREL_CONNECTION_DURATION:()=>Rce,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Ice,METRIC_KESTREL_QUEUED_REQUESTS:()=>Oce,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Cce,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Nce,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>xce,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Pce,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Mce,MessageTypeValues:()=>Kre,MessagingDestinationKindValues:()=>Ire,MessagingOperationValues:()=>Nre,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Xne,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>tre,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Qne,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>ure,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Zne,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>ere,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>ire,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Kne,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>lre,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>nre,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>ore,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>cre,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>rre,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>sre,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>pre,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>are,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>_re,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>fre,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>mre,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>dre,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Jne,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>$ne,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>zne,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Yne,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Vne,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>qne,NETTRANSPORTVALUES_INPROC:()=>Gne,NETTRANSPORTVALUES_IP:()=>Une,NETTRANSPORTVALUES_IP_TCP:()=>Lne,NETTRANSPORTVALUES_IP_UDP:()=>Dne,NETTRANSPORTVALUES_OTHER:()=>jne,NETTRANSPORTVALUES_PIPE:()=>Fne,NETTRANSPORTVALUES_UNIX:()=>Bne,NETWORK_TRANSPORT_VALUE_PIPE:()=>zae,NETWORK_TRANSPORT_VALUE_QUIC:()=>Yae,NETWORK_TRANSPORT_VALUE_TCP:()=>Wae,NETWORK_TRANSPORT_VALUE_UDP:()=>Kae,NETWORK_TRANSPORT_VALUE_UNIX:()=>Qae,NETWORK_TYPE_VALUE_IPV4:()=>Xae,NETWORK_TYPE_VALUE_IPV6:()=>Zae,NetHostConnectionSubtypeValues:()=>hre,NetHostConnectionTypeValues:()=>Wne,NetTransportValues:()=>Hne,OSTYPEVALUES_AIX:()=>die,OSTYPEVALUES_DARWIN:()=>sie,OSTYPEVALUES_DRAGONFLYBSD:()=>cie,OSTYPEVALUES_FREEBSD:()=>iie,OSTYPEVALUES_HPUX:()=>lie,OSTYPEVALUES_LINUX:()=>oie,OSTYPEVALUES_NETBSD:()=>aie,OSTYPEVALUES_OPENBSD:()=>uie,OSTYPEVALUES_SOLARIS:()=>pie,OSTYPEVALUES_WINDOWS:()=>rie,OSTYPEVALUES_Z_OS:()=>fie,OTEL_STATUS_CODE_VALUE_ERROR:()=>rue,OTEL_STATUS_CODE_VALUE_OK:()=>oue,OsTypeValues:()=>mie,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Fre,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Lre,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Pre,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>qre,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>kre,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Bre,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Hre,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>vre,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>wre,RPCGRPCSTATUSCODEVALUES_OK:()=>xre,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Gre,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>Dre,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Ure,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>$re,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Vre,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>jre,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Mre,RpcGrpcStatusCodeValues:()=>zre,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Iee,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Uee,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>yee,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Tee,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Lee,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Pee,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Nee,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Bee,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Oee,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Eee,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Ree,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>xee,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>bee,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>See,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Aee,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Dee,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>vee,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>kee,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Cee,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Mee,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>gee,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>wee,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>cZ,SEMATTRS_CODE_FILEPATH:()=>aee,SEMATTRS_CODE_FUNCTION:()=>see,SEMATTRS_CODE_LINENO:()=>uee,SEMATTRS_CODE_NAMESPACE:()=>iee,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>TZ,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>bZ,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>yZ,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>SZ,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>hZ,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>gZ,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>AZ,SEMATTRS_DB_CASSANDRA_TABLE:()=>EZ,SEMATTRS_DB_CONNECTION_STRING:()=>lZ,SEMATTRS_DB_HBASE_NAMESPACE:()=>RZ,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>pZ,SEMATTRS_DB_MONGODB_COLLECTION:()=>OZ,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>_Z,SEMATTRS_DB_NAME:()=>fZ,SEMATTRS_DB_OPERATION:()=>mZ,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>IZ,SEMATTRS_DB_SQL_TABLE:()=>CZ,SEMATTRS_DB_STATEMENT:()=>ry,SEMATTRS_DB_SYSTEM:()=>ny,SEMATTRS_DB_USER:()=>dZ,SEMATTRS_ENDUSER_ID:()=>eee,SEMATTRS_ENDUSER_ROLE:()=>tee,SEMATTRS_ENDUSER_SCOPE:()=>nee,SEMATTRS_EXCEPTION_ESCAPED:()=>MZ,SEMATTRS_EXCEPTION_MESSAGE:()=>xZ,SEMATTRS_EXCEPTION_STACKTRACE:()=>PZ,SEMATTRS_EXCEPTION_TYPE:()=>NZ,SEMATTRS_FAAS_COLDSTART:()=>FZ,SEMATTRS_FAAS_CRON:()=>BZ,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>kZ,SEMATTRS_FAAS_DOCUMENT_NAME:()=>DZ,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>wZ,SEMATTRS_FAAS_DOCUMENT_TIME:()=>LZ,SEMATTRS_FAAS_EXECUTION:()=>vZ,SEMATTRS_FAAS_INVOKED_NAME:()=>GZ,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>jZ,SEMATTRS_FAAS_INVOKED_REGION:()=>HZ,SEMATTRS_FAAS_TIME:()=>UZ,SEMATTRS_FAAS_TRIGGER:()=>oy,SEMATTRS_HTTP_CLIENT_IP:()=>hee,SEMATTRS_HTTP_FLAVOR:()=>dee,SEMATTRS_HTTP_HOST:()=>cee,SEMATTRS_HTTP_METHOD:()=>Bd,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>fee,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>mee,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>cy,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>ly,SEMATTRS_HTTP_ROUTE:()=>dy,SEMATTRS_HTTP_SCHEME:()=>lee,SEMATTRS_HTTP_SERVER_NAME:()=>_ee,SEMATTRS_HTTP_STATUS_CODE:()=>la,SEMATTRS_HTTP_TARGET:()=>uy,SEMATTRS_HTTP_URL:()=>Yu,SEMATTRS_HTTP_USER_AGENT:()=>pee,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>dte,SEMATTRS_MESSAGE_ID:()=>lte,SEMATTRS_MESSAGE_TYPE:()=>cte,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>pte,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Qee,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>zee,SEMATTRS_MESSAGING_DESTINATION:()=>Fee,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Gee,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>ete,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Zee,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Xee,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>tte,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>nte,SEMATTRS_MESSAGING_MESSAGE_ID:()=>$ee,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Wee,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Yee,SEMATTRS_MESSAGING_OPERATION:()=>Kee,SEMATTRS_MESSAGING_PROTOCOL:()=>Hee,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Vee,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Jee,SEMATTRS_MESSAGING_SYSTEM:()=>py,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>jee,SEMATTRS_MESSAGING_URL:()=>qee,SEMATTRS_NET_HOST_CARRIER_ICC:()=>XZ,SEMATTRS_NET_HOST_CARRIER_MCC:()=>QZ,SEMATTRS_NET_HOST_CARRIER_MNC:()=>JZ,SEMATTRS_NET_HOST_CARRIER_NAME:()=>KZ,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>WZ,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>YZ,SEMATTRS_NET_HOST_IP:()=>iy,SEMATTRS_NET_HOST_NAME:()=>zZ,SEMATTRS_NET_HOST_PORT:()=>ay,SEMATTRS_NET_PEER_IP:()=>sy,SEMATTRS_NET_PEER_NAME:()=>$Z,SEMATTRS_NET_PEER_PORT:()=>qZ,SEMATTRS_NET_TRANSPORT:()=>VZ,SEMATTRS_PEER_SERVICE:()=>ZZ,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>my,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>ate,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>ute,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>ite,SEMATTRS_RPC_JSONRPC_VERSION:()=>ste,SEMATTRS_RPC_METHOD:()=>ote,SEMATTRS_RPC_SERVICE:()=>fy,SEMATTRS_RPC_SYSTEM:()=>rte,SEMATTRS_THREAD_ID:()=>ree,SEMATTRS_THREAD_NAME:()=>oee,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>noe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>toe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>roe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>ooe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>soe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>ioe,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>aoe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>coe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>uoe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>doe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>loe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Jre,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Zre,SEMRESATTRS_CLOUD_PLATFORM:()=>eoe,SEMRESATTRS_CLOUD_PROVIDER:()=>Qre,SEMRESATTRS_CLOUD_REGION:()=>Xre,SEMRESATTRS_CONTAINER_ID:()=>foe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>_oe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>hoe,SEMRESATTRS_CONTAINER_NAME:()=>poe,SEMRESATTRS_CONTAINER_RUNTIME:()=>moe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>goe,SEMRESATTRS_DEVICE_ID:()=>Toe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Eoe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Soe,SEMRESATTRS_FAAS_ID:()=>yoe,SEMRESATTRS_FAAS_INSTANCE:()=>Roe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Ioe,SEMRESATTRS_FAAS_NAME:()=>Aoe,SEMRESATTRS_FAAS_VERSION:()=>boe,SEMRESATTRS_HOST_ARCH:()=>xoe,SEMRESATTRS_HOST_ID:()=>Ooe,SEMRESATTRS_HOST_IMAGE_ID:()=>Moe,SEMRESATTRS_HOST_IMAGE_NAME:()=>Poe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>voe,SEMRESATTRS_HOST_NAME:()=>Coe,SEMRESATTRS_HOST_TYPE:()=>Noe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>koe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Foe,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Joe,SEMRESATTRS_K8S_CRONJOB_UID:()=>Qoe,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Yoe,SEMRESATTRS_K8S_DAEMONSET_UID:()=>zoe,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Voe,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Hoe,SEMRESATTRS_K8S_JOB_NAME:()=>Koe,SEMRESATTRS_K8S_JOB_UID:()=>Woe,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>Doe,SEMRESATTRS_K8S_NODE_NAME:()=>woe,SEMRESATTRS_K8S_NODE_UID:()=>Loe,SEMRESATTRS_K8S_POD_NAME:()=>Boe,SEMRESATTRS_K8S_POD_UID:()=>Uoe,SEMRESATTRS_K8S_REPLICASET_NAME:()=>joe,SEMRESATTRS_K8S_REPLICASET_UID:()=>Goe,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>$oe,SEMRESATTRS_K8S_STATEFULSET_UID:()=>qoe,SEMRESATTRS_OS_DESCRIPTION:()=>Zoe,SEMRESATTRS_OS_NAME:()=>ese,SEMRESATTRS_OS_TYPE:()=>Xoe,SEMRESATTRS_OS_VERSION:()=>tse,SEMRESATTRS_PROCESS_COMMAND:()=>sse,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>ase,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>ise,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>rse,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>ose,SEMRESATTRS_PROCESS_OWNER:()=>use,SEMRESATTRS_PROCESS_PID:()=>nse,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>dse,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>cse,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>lse,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>fse,SEMRESATTRS_SERVICE_NAME:()=>pse,SEMRESATTRS_SERVICE_NAMESPACE:()=>_y,SEMRESATTRS_SERVICE_VERSION:()=>mse,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Tse,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>hse,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>_se,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>gse,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Ase,SEMRESATTRS_WEBENGINE_NAME:()=>Ese,SEMRESATTRS_WEBENGINE_VERSION:()=>Sse,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>cue,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>lue,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>due,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>fue,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>mue,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>_ue,SemanticAttributes:()=>fte,SemanticResourceAttributes:()=>yse,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>_ie,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>hie,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>gie,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Tie,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Eie,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Sie,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Aie,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>yie,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>bie,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Rie,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>gue,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Tue,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Eue,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>Sue,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Aue,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>yue,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>bue,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Rue,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Iue,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Oue,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Cue,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Nue,TelemetrySdkLanguageValues:()=>Iie});var fe=K(()=>{c();OD();XU();ZU();eB();tB()});var nB=E(o_=>{"use strict";c();Object.defineProperty(o_,"__esModule",{value:!0});o_.ATTR_PROCESS_RUNTIME_NAME=void 0;o_.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var rB=E(i_=>{"use strict";c();Object.defineProperty(i_,"__esModule",{value:!0});i_.SDK_INFO=void 0;var kce=LM(),s_=(fe(),x(Oe)),wce=nB();i_.SDK_INFO={[s_.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[wce.ATTR_PROCESS_RUNTIME_NAME]:"node",[s_.ATTR_TELEMETRY_SDK_LANGUAGE]:s_.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[s_.ATTR_TELEMETRY_SDK_VERSION]:kce.VERSION}});var oB=E(rn=>{"use strict";c();Object.defineProperty(rn,"__esModule",{value:!0});rn.otperformance=rn.SDK_INFO=rn._globalThis=rn.getStringListFromEnv=rn.getNumberFromEnv=rn.getBooleanFromEnv=rn.getStringFromEnv=void 0;var a_=kM();Object.defineProperty(rn,"getStringFromEnv",{enumerable:!0,get:function(){return a_.getStringFromEnv}});Object.defineProperty(rn,"getBooleanFromEnv",{enumerable:!0,get:function(){return a_.getBooleanFromEnv}});Object.defineProperty(rn,"getNumberFromEnv",{enumerable:!0,get:function(){return a_.getNumberFromEnv}});Object.defineProperty(rn,"getStringListFromEnv",{enumerable:!0,get:function(){return a_.getStringListFromEnv}});var Lce=wM();Object.defineProperty(rn,"_globalThis",{enumerable:!0,get:function(){return Lce._globalThis}});var Dce=rB();Object.defineProperty(rn,"SDK_INFO",{enumerable:!0,get:function(){return Dce.SDK_INFO}});rn.otperformance=performance});var Py=E(on=>{"use strict";c();Object.defineProperty(on,"__esModule",{value:!0});on.getStringListFromEnv=on.getNumberFromEnv=on.getStringFromEnv=on.getBooleanFromEnv=on.otperformance=on._globalThis=on.SDK_INFO=void 0;var fa=oB();Object.defineProperty(on,"SDK_INFO",{enumerable:!0,get:function(){return fa.SDK_INFO}});Object.defineProperty(on,"_globalThis",{enumerable:!0,get:function(){return fa._globalThis}});Object.defineProperty(on,"otperformance",{enumerable:!0,get:function(){return fa.otperformance}});Object.defineProperty(on,"getBooleanFromEnv",{enumerable:!0,get:function(){return fa.getBooleanFromEnv}});Object.defineProperty(on,"getStringFromEnv",{enumerable:!0,get:function(){return fa.getStringFromEnv}});Object.defineProperty(on,"getNumberFromEnv",{enumerable:!0,get:function(){return fa.getNumberFromEnv}});Object.defineProperty(on,"getStringListFromEnv",{enumerable:!0,get:function(){return fa.getStringListFromEnv}})});var uB=E(ve=>{"use strict";c();Object.defineProperty(ve,"__esModule",{value:!0});ve.addHrTimes=ve.isTimeInput=ve.isTimeInputHrTime=ve.hrTimeToMicroseconds=ve.hrTimeToMilliseconds=ve.hrTimeToNanoseconds=ve.hrTimeToTimeStamp=ve.hrTimeDuration=ve.timeInputToHrTime=ve.hrTime=ve.getTimeOrigin=ve.millisToHrTime=void 0;var u_=Py(),sB=9,Uce=6,Bce=Math.pow(10,Uce),c_=Math.pow(10,sB);function Fd(t){let e=t/1e3,n=Math.trunc(e),r=Math.round(t%1e3*Bce);return[n,r]}ve.millisToHrTime=Fd;function Fce(){return u_.otperformance.timeOrigin}ve.getTimeOrigin=Fce;function iB(t){let e=Fd(u_.otperformance.timeOrigin),n=Fd(typeof t=="number"?t:u_.otperformance.now());return aB(e,n)}ve.hrTime=iB;function Gce(t){if(My(t))return t;if(typeof t=="number")return t<u_.otperformance.timeOrigin?iB(t):Fd(t);if(t instanceof Date)return Fd(t.getTime());throw TypeError("Invalid input type")}ve.timeInputToHrTime=Gce;function jce(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=c_),[n,r]}ve.hrTimeDuration=jce;function Hce(t){let e=sB,n=`${"0".repeat(e)}${t[1]}Z`,r=n.substring(n.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",r)}ve.hrTimeToTimeStamp=Hce;function Vce(t){return t[0]*c_+t[1]}ve.hrTimeToNanoseconds=Vce;function qce(t){return t[0]*1e3+t[1]/1e6}ve.hrTimeToMilliseconds=qce;function $ce(t){return t[0]*1e6+t[1]/1e3}ve.hrTimeToMicroseconds=$ce;function My(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}ve.isTimeInputHrTime=My;function zce(t){return My(t)||typeof t=="number"||t instanceof Date}ve.isTimeInput=zce;function aB(t,e){let n=[t[0]+e[0],t[1]+e[1]];return n[1]>=c_&&(n[1]-=c_,n[0]+=1),n}ve.addHrTimes=aB});var cB=E(l_=>{"use strict";c();Object.defineProperty(l_,"__esModule",{value:!0});l_.unrefTimer=void 0;function Yce(t){typeof t!="number"&&t.unref()}l_.unrefTimer=Yce});var lB=E(Gd=>{"use strict";c();Object.defineProperty(Gd,"__esModule",{value:!0});Gd.ExportResultCode=void 0;var Wce;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Wce=Gd.ExportResultCode||(Gd.ExportResultCode={}))});var pB=E(d_=>{"use strict";c();Object.defineProperty(d_,"__esModule",{value:!0});d_.CompositePropagator=void 0;var dB=(M(),x(L)),vy=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(e,n,r){for(let o of this._propagators)try{o.inject(e,n,r)}catch(s){dB.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,n,r){return this._propagators.reduce((o,s)=>{try{return s.extract(o,n,r)}catch(i){dB.diag.warn(`Failed to extract with ${s.constructor.name}. Err: ${i.message}`)}return o},e)}fields(){return this._fields.slice()}};d_.CompositePropagator=vy});var fB=E(Ku=>{"use strict";c();Object.defineProperty(Ku,"__esModule",{value:!0});Ku.validateValue=Ku.validateKey=void 0;var ky="[_0-9a-z-*/]",Kce=`[a-z]${ky}{0,255}`,Qce=`[a-z0-9]${ky}{0,240}@[a-z]${ky}{0,13}`,Jce=new RegExp(`^(?:${Kce}|${Qce})$`),Xce=/^[ -~]{0,255}[!-~]$/,Zce=/,|=/;function ele(t){return Jce.test(t)}Ku.validateKey=ele;function tle(t){return Xce.test(t)&&!Zce.test(t)}Ku.validateValue=tle});var Ly=E(p_=>{"use strict";c();Object.defineProperty(p_,"__esModule",{value:!0});p_.TraceState=void 0;var mB=fB(),_B=32,nle=512,hB=",",gB="=",wy=class t{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,n)=>(e.push(n+gB+this.get(n)),e),[]).join(hB)}_parse(e){e.length>nle||(this._internalState=e.split(hB).reverse().reduce((n,r)=>{let o=r.trim(),s=o.indexOf(gB);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);(0,mB.validateKey)(i)&&(0,mB.validateValue)(a)&&n.set(i,a)}return n},new Map),this._internalState.size>_B&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,_B))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};p_.TraceState=wy});var EB=E(sn=>{"use strict";c();Object.defineProperty(sn,"__esModule",{value:!0});sn.W3CTraceContextPropagator=sn.parseTraceParent=sn.TRACE_STATE_HEADER=sn.TRACE_PARENT_HEADER=void 0;var f_=(M(),x(L)),rle=Ud(),ole=Ly();sn.TRACE_PARENT_HEADER="traceparent";sn.TRACE_STATE_HEADER="tracestate";var sle="00",ile="(?!ff)[\\da-f]{2}",ale="(?![0]{32})[\\da-f]{32}",ule="(?![0]{16})[\\da-f]{16}",cle="[\\da-f]{2}",lle=new RegExp(`^\\s?(${ile})-(${ale})-(${ule})-(${cle})(-.*)?\\s?$`);function TB(t){let e=lle.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}sn.parseTraceParent=TB;var Dy=class{inject(e,n,r){let o=f_.trace.getSpanContext(e);if(!o||(0,rle.isTracingSuppressed)(e)||!(0,f_.isSpanContextValid)(o))return;let s=`${sle}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||f_.TraceFlags.NONE).toString(16)}`;r.set(n,sn.TRACE_PARENT_HEADER,s),o.traceState&&r.set(n,sn.TRACE_STATE_HEADER,o.traceState.serialize())}extract(e,n,r){let o=r.get(n,sn.TRACE_PARENT_HEADER);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let i=TB(s);if(!i)return e;i.isRemote=!0;let a=r.get(n,sn.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;i.traceState=new ole.TraceState(typeof u=="string"?u:void 0)}return f_.trace.setSpanContext(e,i)}fields(){return[sn.TRACE_PARENT_HEADER,sn.TRACE_STATE_HEADER]}};sn.W3CTraceContextPropagator=Dy});var SB=E(jr=>{"use strict";c();Object.defineProperty(jr,"__esModule",{value:!0});jr.getRPCMetadata=jr.deleteRPCMetadata=jr.setRPCMetadata=jr.RPCType=void 0;var dle=(M(),x(L)),Uy=(0,dle.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),ple;(function(t){t.HTTP="http"})(ple=jr.RPCType||(jr.RPCType={}));function fle(t,e){return t.setValue(Uy,e)}jr.setRPCMetadata=fle;function mle(t){return t.deleteValue(Uy)}jr.deleteRPCMetadata=mle;function _le(t){return t.getValue(Uy)}jr.getRPCMetadata=_le});var IB=E(m_=>{"use strict";c();Object.defineProperty(m_,"__esModule",{value:!0});m_.isPlainObject=void 0;var hle="[object Object]",gle="[object Null]",Tle="[object Undefined]",Ele=Function.prototype,AB=Ele.toString,Sle=AB.call(Object),Ale=Object.getPrototypeOf,yB=Object.prototype,bB=yB.hasOwnProperty,ma=Symbol?Symbol.toStringTag:void 0,RB=yB.toString;function yle(t){if(!ble(t)||Rle(t)!==hle)return!1;let e=Ale(t);if(e===null)return!0;let n=bB.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&AB.call(n)===Sle}m_.isPlainObject=yle;function ble(t){return t!=null&&typeof t=="object"}function Rle(t){return t==null?t===void 0?Tle:gle:ma&&ma in Object(t)?Ile(t):Ole(t)}function Ile(t){let e=bB.call(t,ma),n=t[ma],r=!1;try{t[ma]=void 0,r=!0}catch{}let o=RB.call(t);return r&&(e?t[ma]=n:delete t[ma]),o}function Ole(t){return RB.call(t)}});var PB=E(g_=>{"use strict";c();Object.defineProperty(g_,"__esModule",{value:!0});g_.merge=void 0;var OB=IB(),Cle=20;function Nle(...t){let e=t.shift(),n=new WeakMap;for(;t.length>0;)e=NB(e,t.shift(),0,n);return e}g_.merge=Nle;function By(t){return h_(t)?t.slice():t}function NB(t,e,n=0,r){let o;if(!(n>Cle)){if(n++,__(t)||__(e)||xB(e))o=By(e);else if(h_(t)){if(o=t.slice(),h_(e))for(let s=0,i=e.length;s<i;s++)o.push(By(e[s]));else if(jd(e)){let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let u=s[i];o[u]=By(e[u])}}}else if(jd(t))if(jd(e)){if(!xle(t,e))return e;o=Object.assign({},t);let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let u=s[i],d=e[u];if(__(d))typeof d>"u"?delete o[u]:o[u]=d;else{let p=o[u],f=d;if(CB(t,u,r)||CB(e,u,r))delete o[u];else{if(jd(p)&&jd(f)){let m=r.get(p)||[],_=r.get(f)||[];m.push({obj:t,key:u}),_.push({obj:e,key:u}),r.set(p,m),r.set(f,_)}o[u]=NB(o[u],d,n,r)}}}}else o=e;return o}}function CB(t,e,n){let r=n.get(t[e])||[];for(let o=0,s=r.length;o<s;o++){let i=r[o];if(i.key===e&&i.obj===t)return!0}return!1}function h_(t){return Array.isArray(t)}function xB(t){return typeof t=="function"}function jd(t){return!__(t)&&!h_(t)&&!xB(t)&&typeof t=="object"}function __(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function xle(t,e){return!(!(0,OB.isPlainObject)(t)||!(0,OB.isPlainObject)(e))}});var MB=E(Qu=>{"use strict";c();Object.defineProperty(Qu,"__esModule",{value:!0});Qu.callWithTimeout=Qu.TimeoutError=void 0;var T_=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};Qu.TimeoutError=T_;function Ple(t,e){let n,r=new Promise(function(s,i){n=setTimeout(function(){i(new T_("Operation timed out."))},e)});return Promise.race([t,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}Qu.callWithTimeout=Ple});var kB=E(Ju=>{"use strict";c();Object.defineProperty(Ju,"__esModule",{value:!0});Ju.isUrlIgnored=Ju.urlMatches=void 0;function vB(t,e){return typeof e=="string"?t===e:!!t.match(e)}Ju.urlMatches=vB;function Mle(t,e){if(!e)return!1;for(let n of e)if(vB(t,n))return!0;return!1}Ju.isUrlIgnored=Mle});var wB=E(E_=>{"use strict";c();Object.defineProperty(E_,"__esModule",{value:!0});E_.Deferred=void 0;var Fy=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,n)=>{this._resolve=e,this._reject=n})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};E_.Deferred=Fy});var LB=E(S_=>{"use strict";c();Object.defineProperty(S_,"__esModule",{value:!0});S_.BindOnceFuture=void 0;var vle=wB(),Gy=class{_isCalled=!1;_deferred=new vle.Deferred;_callback;_that;constructor(e,n){this._callback=e,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};S_.BindOnceFuture=Gy});var UB=E(A_=>{"use strict";c();Object.defineProperty(A_,"__esModule",{value:!0});A_.diagLogLevelFromString=void 0;var os=(M(),x(L)),DB={ALL:os.DiagLogLevel.ALL,VERBOSE:os.DiagLogLevel.VERBOSE,DEBUG:os.DiagLogLevel.DEBUG,INFO:os.DiagLogLevel.INFO,WARN:os.DiagLogLevel.WARN,ERROR:os.DiagLogLevel.ERROR,NONE:os.DiagLogLevel.NONE};function kle(t){if(t==null)return;let e=DB[t.toUpperCase()];return e??(os.diag.warn(`Unknown log level "${t}", expected one of ${Object.keys(DB)}, using default`),os.DiagLogLevel.INFO)}A_.diagLogLevelFromString=kle});var FB=E(y_=>{"use strict";c();Object.defineProperty(y_,"__esModule",{value:!0});y_._export=void 0;var BB=(M(),x(L)),wle=Ud();function Lle(t,e){return new Promise(n=>{BB.context.with((0,wle.suppressTracing)(BB.context.active()),()=>{t.export(e,n)})})}y_._export=Lle});var ye=E(C=>{"use strict";c();Object.defineProperty(C,"__esModule",{value:!0});C.internal=C.diagLogLevelFromString=C.BindOnceFuture=C.urlMatches=C.isUrlIgnored=C.callWithTimeout=C.TimeoutError=C.merge=C.TraceState=C.unsuppressTracing=C.suppressTracing=C.isTracingSuppressed=C.setRPCMetadata=C.getRPCMetadata=C.deleteRPCMetadata=C.RPCType=C.parseTraceParent=C.W3CTraceContextPropagator=C.TRACE_STATE_HEADER=C.TRACE_PARENT_HEADER=C.CompositePropagator=C.otperformance=C.getStringListFromEnv=C.getNumberFromEnv=C.getBooleanFromEnv=C.getStringFromEnv=C._globalThis=C.SDK_INFO=C.parseKeyPairsIntoRecord=C.ExportResultCode=C.unrefTimer=C.timeInputToHrTime=C.millisToHrTime=C.isTimeInputHrTime=C.isTimeInput=C.hrTimeToTimeStamp=C.hrTimeToNanoseconds=C.hrTimeToMilliseconds=C.hrTimeToMicroseconds=C.hrTimeDuration=C.hrTime=C.getTimeOrigin=C.addHrTimes=C.loggingErrorHandler=C.setGlobalErrorHandler=C.globalErrorHandler=C.sanitizeAttributes=C.isAttributeValue=C.AnchoredClock=C.W3CBaggagePropagator=void 0;var Dle=AM();Object.defineProperty(C,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Dle.W3CBaggagePropagator}});var Ule=yM();Object.defineProperty(C,"AnchoredClock",{enumerable:!0,get:function(){return Ule.AnchoredClock}});var GB=CM();Object.defineProperty(C,"isAttributeValue",{enumerable:!0,get:function(){return GB.isAttributeValue}});Object.defineProperty(C,"sanitizeAttributes",{enumerable:!0,get:function(){return GB.sanitizeAttributes}});var jB=xM();Object.defineProperty(C,"globalErrorHandler",{enumerable:!0,get:function(){return jB.globalErrorHandler}});Object.defineProperty(C,"setGlobalErrorHandler",{enumerable:!0,get:function(){return jB.setGlobalErrorHandler}});var Ble=ey();Object.defineProperty(C,"loggingErrorHandler",{enumerable:!0,get:function(){return Ble.loggingErrorHandler}});var fr=uB();Object.defineProperty(C,"addHrTimes",{enumerable:!0,get:function(){return fr.addHrTimes}});Object.defineProperty(C,"getTimeOrigin",{enumerable:!0,get:function(){return fr.getTimeOrigin}});Object.defineProperty(C,"hrTime",{enumerable:!0,get:function(){return fr.hrTime}});Object.defineProperty(C,"hrTimeDuration",{enumerable:!0,get:function(){return fr.hrTimeDuration}});Object.defineProperty(C,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return fr.hrTimeToMicroseconds}});Object.defineProperty(C,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return fr.hrTimeToMilliseconds}});Object.defineProperty(C,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return fr.hrTimeToNanoseconds}});Object.defineProperty(C,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return fr.hrTimeToTimeStamp}});Object.defineProperty(C,"isTimeInput",{enumerable:!0,get:function(){return fr.isTimeInput}});Object.defineProperty(C,"isTimeInputHrTime",{enumerable:!0,get:function(){return fr.isTimeInputHrTime}});Object.defineProperty(C,"millisToHrTime",{enumerable:!0,get:function(){return fr.millisToHrTime}});Object.defineProperty(C,"timeInputToHrTime",{enumerable:!0,get:function(){return fr.timeInputToHrTime}});var Fle=cB();Object.defineProperty(C,"unrefTimer",{enumerable:!0,get:function(){return Fle.unrefTimer}});var Gle=lB();Object.defineProperty(C,"ExportResultCode",{enumerable:!0,get:function(){return Gle.ExportResultCode}});var jle=KA();Object.defineProperty(C,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return jle.parseKeyPairsIntoRecord}});var _a=Py();Object.defineProperty(C,"SDK_INFO",{enumerable:!0,get:function(){return _a.SDK_INFO}});Object.defineProperty(C,"_globalThis",{enumerable:!0,get:function(){return _a._globalThis}});Object.defineProperty(C,"getStringFromEnv",{enumerable:!0,get:function(){return _a.getStringFromEnv}});Object.defineProperty(C,"getBooleanFromEnv",{enumerable:!0,get:function(){return _a.getBooleanFromEnv}});Object.defineProperty(C,"getNumberFromEnv",{enumerable:!0,get:function(){return _a.getNumberFromEnv}});Object.defineProperty(C,"getStringListFromEnv",{enumerable:!0,get:function(){return _a.getStringListFromEnv}});Object.defineProperty(C,"otperformance",{enumerable:!0,get:function(){return _a.otperformance}});var Hle=pB();Object.defineProperty(C,"CompositePropagator",{enumerable:!0,get:function(){return Hle.CompositePropagator}});var b_=EB();Object.defineProperty(C,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return b_.TRACE_PARENT_HEADER}});Object.defineProperty(C,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return b_.TRACE_STATE_HEADER}});Object.defineProperty(C,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return b_.W3CTraceContextPropagator}});Object.defineProperty(C,"parseTraceParent",{enumerable:!0,get:function(){return b_.parseTraceParent}});var R_=SB();Object.defineProperty(C,"RPCType",{enumerable:!0,get:function(){return R_.RPCType}});Object.defineProperty(C,"deleteRPCMetadata",{enumerable:!0,get:function(){return R_.deleteRPCMetadata}});Object.defineProperty(C,"getRPCMetadata",{enumerable:!0,get:function(){return R_.getRPCMetadata}});Object.defineProperty(C,"setRPCMetadata",{enumerable:!0,get:function(){return R_.setRPCMetadata}});var jy=Ud();Object.defineProperty(C,"isTracingSuppressed",{enumerable:!0,get:function(){return jy.isTracingSuppressed}});Object.defineProperty(C,"suppressTracing",{enumerable:!0,get:function(){return jy.suppressTracing}});Object.defineProperty(C,"unsuppressTracing",{enumerable:!0,get:function(){return jy.unsuppressTracing}});var Vle=Ly();Object.defineProperty(C,"TraceState",{enumerable:!0,get:function(){return Vle.TraceState}});var qle=PB();Object.defineProperty(C,"merge",{enumerable:!0,get:function(){return qle.merge}});var HB=MB();Object.defineProperty(C,"TimeoutError",{enumerable:!0,get:function(){return HB.TimeoutError}});Object.defineProperty(C,"callWithTimeout",{enumerable:!0,get:function(){return HB.callWithTimeout}});var VB=kB();Object.defineProperty(C,"isUrlIgnored",{enumerable:!0,get:function(){return VB.isUrlIgnored}});Object.defineProperty(C,"urlMatches",{enumerable:!0,get:function(){return VB.urlMatches}});var $le=LB();Object.defineProperty(C,"BindOnceFuture",{enumerable:!0,get:function(){return $le.BindOnceFuture}});var zle=UB();Object.defineProperty(C,"diagLogLevelFromString",{enumerable:!0,get:function(){return zle.diagLogLevelFromString}});var Yle=FB();C.internal={_export:Yle._export}});var qB=E(I_=>{"use strict";c();Object.defineProperty(I_,"__esModule",{value:!0});I_.VERSION=void 0;I_.VERSION="0.214.0"});var $B=E(Hd=>{"use strict";c();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.SeverityNumber=void 0;var Wle;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Wle=Hd.SeverityNumber||(Hd.SeverityNumber={}))});var C_=E(Xu=>{"use strict";c();Object.defineProperty(Xu,"__esModule",{value:!0});Xu.NOOP_LOGGER=Xu.NoopLogger=void 0;var O_=class{emit(e){}};Xu.NoopLogger=O_;Xu.NOOP_LOGGER=new O_});var zB=E(_o=>{"use strict";c();Object.defineProperty(_o,"__esModule",{value:!0});_o.API_BACKWARDS_COMPATIBILITY_VERSION=_o.makeGetter=_o._global=_o.GLOBAL_LOGS_API_KEY=void 0;_o.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");_o._global=globalThis;function Kle(t,e,n){return r=>r===t?e:n}_o.makeGetter=Kle;_o.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Hy=E(Zu=>{"use strict";c();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.NOOP_LOGGER_PROVIDER=Zu.NoopLoggerProvider=void 0;var Qle=C_(),N_=class{getLogger(e,n,r){return new Qle.NoopLogger}};Zu.NoopLoggerProvider=N_;Zu.NOOP_LOGGER_PROVIDER=new N_});var YB=E(x_=>{"use strict";c();Object.defineProperty(x_,"__esModule",{value:!0});x_.ProxyLogger=void 0;var Jle=C_(),Vy=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Jle.NOOP_LOGGER}};x_.ProxyLogger=Vy});var WB=E(P_=>{"use strict";c();Object.defineProperty(P_,"__esModule",{value:!0});P_.ProxyLoggerProvider=void 0;var Xle=Hy(),Zle=YB(),qy=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new Zle.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Xle.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};P_.ProxyLoggerProvider=qy});var QB=E(M_=>{"use strict";c();Object.defineProperty(M_,"__esModule",{value:!0});M_.LogsAPI=void 0;var mr=zB(),ede=Hy(),KB=WB(),$y=class t{constructor(){this._proxyLoggerProvider=new KB.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return mr._global[mr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(mr._global[mr.GLOBAL_LOGS_API_KEY]=(0,mr.makeGetter)(mr.API_BACKWARDS_COMPATIBILITY_VERSION,e,ede.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=mr._global[mr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(mr._global,mr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete mr._global[mr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new KB.ProxyLoggerProvider}};M_.LogsAPI=$y});var zy=E(ho=>{"use strict";c();Object.defineProperty(ho,"__esModule",{value:!0});ho.logs=ho.NoopLogger=ho.NOOP_LOGGER=ho.SeverityNumber=void 0;var tde=$B();Object.defineProperty(ho,"SeverityNumber",{enumerable:!0,get:function(){return tde.SeverityNumber}});var JB=C_();Object.defineProperty(ho,"NOOP_LOGGER",{enumerable:!0,get:function(){return JB.NOOP_LOGGER}});Object.defineProperty(ho,"NoopLogger",{enumerable:!0,get:function(){return JB.NoopLogger}});var nde=QB();ho.logs=nde.LogsAPI.getInstance()});var XB=E(ec=>{"use strict";c();Object.defineProperty(ec,"__esModule",{value:!0});ec.disableInstrumentations=ec.enableInstrumentations=void 0;function rde(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}ec.enableInstrumentations=rde;function ode(t){t.forEach(e=>e.disable())}ec.disableInstrumentations=ode});var t3=E(v_=>{"use strict";c();Object.defineProperty(v_,"__esModule",{value:!0});v_.registerInstrumentations=void 0;var ZB=(M(),x(L)),sde=zy(),e3=XB();function ide(t){let e=t.tracerProvider||ZB.trace.getTracerProvider(),n=t.meterProvider||ZB.metrics.getMeterProvider(),r=t.loggerProvider||sde.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,e3.enableInstrumentations)(o,e,n,r),()=>{(0,e3.disableInstrumentations)(o)}}v_.registerInstrumentations=ide});var l3=E(k_=>{"use strict";c();Object.defineProperty(k_,"__esModule",{value:!0});k_.satisfies=void 0;var Qy=(M(),x(L)),i3=/^(?: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-]+)*))?$/,ade=/^(?<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-]+)*))?$/,ude={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function cde(t,e,n){if(!lde(t))return Qy.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=mde(t);if(!r)return!1;let o=[],s=a3(r,e,o,n);return s&&!n?.includePrerelease?pde(r,o):s}k_.satisfies=cde;function lde(t){return typeof t=="string"&&i3.test(t)}function a3(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Yy(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=Lde(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Yy(t,s,n,r))return!1;return!0}return Yy(t,e,n,r)}function Yy(t,e,n,r){if(e=fde(e,r),e.includes(" "))return a3(t,e,n,r);{let o=_de(e);return n.push(o),dde(t,o)}}function dde(t,e){if(e.invalid)return!1;if(!e.version||Ky(e.version))return!0;let n=r3(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=r3(r,o)}return ude[e.op]?.includes(n)}function pde(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function fde(t,e){return t=t.trim(),t=kde(t,e),t=vde(t),t=wde(t,e),t=t.trim(),t}function gn(t){return!t||t.toLowerCase()==="x"||t==="*"}function mde(t){let e=t.match(i3);if(!e){Qy.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function _de(t){if(!t)return{};let e=t.match(ade);if(!e)return Qy.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function Ky(t){return t==="*"||t==="x"||t==="X"}function n3(t){let e=parseInt(t,10);return isNaN(e)?t:e}function hde(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function gde(t,e){if(Ky(t)||Ky(e))return 0;let[n,r]=hde(n3(t),n3(e));return n>r?1:n<r?-1:0}function r3(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=gde(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var u3="[a-zA-Z0-9-]",c3="0|[1-9]\\d*",Tde=`\\d*[a-zA-Z-]${u3}*`,Ede="((?:<|>)?=?)",o3=`(?:${c3}|${Tde})`,Sde=`(?:-(${o3}(?:\\.${o3})*))`,s3=`${u3}+`,Ade=`(?:\\+(${s3}(?:\\.${s3})*))`,Wy=`${c3}|x|X|\\*`,Vd=`[v=\\s]*(${Wy})(?:\\.(${Wy})(?:\\.(${Wy})(?:${Sde})?${Ade}?)?)?`,yde=`^${Ede}\\s*${Vd}$`,bde=new RegExp(yde),Rde=`^\\s*(${Vd})\\s+-\\s+(${Vd})\\s*$`,Ide=new RegExp(Rde),Ode="(?:~>?)",Cde=`^${Ode}${Vd}$`,Nde=new RegExp(Cde),xde="(?:\\^)",Pde=`^${xde}${Vd}$`,Mde=new RegExp(Pde);function vde(t){let e=Nde;return t.replace(e,(n,r,o,s,i)=>{let a;return gn(r)?a="":gn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:gn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function kde(t,e){let n=Mde,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,u)=>{let d;return gn(s)?d="":gn(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:gn(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:u?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${u} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${u} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${u} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function wde(t,e){let n=bde;return t.replace(n,(r,o,s,i,a,u)=>{let d=gn(s),p=d||gn(i),f=p||gn(a),m=f;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&m?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(u="-0"),r=`${o+s}.${i}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:f&&(r=`>=${s}.${i}.0${u} <${s}.${+i+1}.0-0`),r})}function Lde(t,e){let n=Ide;return t.replace(n,(r,o,s,i,a,u,d,p,f,m,_,h)=>(gn(s)?o="":gn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:gn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,gn(f)?p="":gn(m)?p=`<${+f+1}.0.0-0`:gn(_)?p=`<${f}.${+m+1}.0-0`:h?p=`<=${f}.${m}.${_}-${h}`:e?.includePrerelease?p=`<${f}.${m}.${+_+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var Jy=E(Vt=>{"use strict";c();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.massUnwrap=Vt.unwrap=Vt.massWrap=Vt.wrap=void 0;var Tn=console.error.bind(console);function qd(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var Dde=(t,e,n)=>{if(!t||!t[e]){Tn("no original function "+String(e)+" to wrap");return}if(!n){Tn("no wrapper function"),Tn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Tn("original object and wrapper must be functions");return}let o=n(r,e);return qd(o,"__original",r),qd(o,"__unwrap",()=>{t[e]===o&&qd(t,e,r)}),qd(o,"__wrapped",!0),qd(t,e,o),o};Vt.wrap=Dde;var Ude=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Tn("must provide one or more modules to patch"),Tn(new Error().stack);return}if(!(e&&Array.isArray(e))){Tn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Vt.wrap)(r,o,n)})})};Vt.massWrap=Ude;var Bde=(t,e)=>{if(!t||!t[e]){Tn("no function to unwrap."),Tn(new Error().stack);return}let n=t[e];if(!n.__unwrap)Tn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Vt.unwrap=Bde;var Fde=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Tn("must provide one or more modules to patch"),Tn(new Error().stack);return}if(!(e&&Array.isArray(e))){Tn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Vt.unwrap)(n,r)})})};Vt.massUnwrap=Fde;function $d(t){t&&t.logger&&(typeof t.logger!="function"?Tn("new logger isn't a function, not replacing"):Tn=t.logger)}Vt.default=$d;$d.wrap=Vt.wrap;$d.massWrap=Vt.massWrap;$d.unwrap=Vt.unwrap;$d.massUnwrap=Vt.massUnwrap});var d3=E(L_=>{"use strict";c();Object.defineProperty(L_,"__esModule",{value:!0});L_.InstrumentationAbstract=void 0;var Xy=(M(),x(L)),Gde=zy(),w_=Jy(),Zy=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=Xy.diag.createComponentLogger({namespace:e}),this._tracer=Xy.trace.getTracer(e,n),this._meter=Xy.metrics.getMeter(e,n),this._logger=Gde.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=w_.wrap;_unwrap=w_.unwrap;_massWrap=w_.massWrap;_massUnwrap=w_.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};L_.InstrumentationAbstract=Zy});var f3=E((U6e,p3)=>{c();var tc=1e3,nc=tc*60,rc=nc*60,ha=rc*24,jde=ha*7,Hde=ha*365.25;p3.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return Vde(t);if(n==="number"&&isFinite(t))return e.long?$de(t):qde(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Vde(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Hde;case"weeks":case"week":case"w":return n*jde;case"days":case"day":case"d":return n*ha;case"hours":case"hour":case"hrs":case"hr":case"h":return n*rc;case"minutes":case"minute":case"mins":case"min":case"m":return n*nc;case"seconds":case"second":case"secs":case"sec":case"s":return n*tc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function qde(t){var e=Math.abs(t);return e>=ha?Math.round(t/ha)+"d":e>=rc?Math.round(t/rc)+"h":e>=nc?Math.round(t/nc)+"m":e>=tc?Math.round(t/tc)+"s":t+"ms"}function $de(t){var e=Math.abs(t);return e>=ha?D_(t,e,ha,"day"):e>=rc?D_(t,e,rc,"hour"):e>=nc?D_(t,e,nc,"minute"):e>=tc?D_(t,e,tc,"second"):t+" ms"}function D_(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}});var eb=E((F6e,m3)=>{c();function zde(t){n.debug=n,n.default=n,n.coerce=u,n.disable=i,n.enable=o,n.enabled=a,n.humanize=f3(),n.destroy=d,Object.keys(t).forEach(p=>{n[p]=t[p]}),n.names=[],n.skips=[],n.formatters={};function e(p){let f=0;for(let m=0;m<p.length;m++)f=(f<<5)-f+p.charCodeAt(m),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=e;function n(p){let f,m=null,_,h;function g(...T){if(!g.enabled)return;let S=g,A=Number(new Date),R=A-(f||A);S.diff=R,S.prev=f,S.curr=A,f=A,T[0]=n.coerce(T[0]),typeof T[0]!="string"&&T.unshift("%O");let I=0;T[0]=T[0].replace(/%([a-zA-Z%])/g,(N,V)=>{if(N==="%%")return"%";I++;let ge=n.formatters[V];if(typeof ge=="function"){let Be=T[I];N=ge.call(S,Be),T.splice(I,1),I--}return N}),n.formatArgs.call(S,T),(S.log||n.log).apply(S,T)}return g.namespace=p,g.useColors=n.useColors(),g.color=n.selectColor(p),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(_!==n.namespaces&&(_=n.namespaces,h=n.enabled(p)),h),set:T=>{m=T}}),typeof n.init=="function"&&n.init(g),g}function r(p,f){let m=n(this.namespace+(typeof f>"u"?":":f)+p);return m.log=this.log,m}function o(p){n.save(p),n.namespaces=p,n.names=[],n.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)m[0]==="-"?n.skips.push(m.slice(1)):n.names.push(m)}function s(p,f){let m=0,_=0,h=-1,g=0;for(;m<p.length;)if(_<f.length&&(f[_]===p[m]||f[_]==="*"))f[_]==="*"?(h=_,g=m,_++):(m++,_++);else if(h!==-1)_=h+1,g++,m=g;else return!1;for(;_<f.length&&f[_]==="*";)_++;return _===f.length}function i(){let p=[...n.names,...n.skips.map(f=>"-"+f)].join(",");return n.enable(""),p}function a(p){for(let f of n.skips)if(s(p,f))return!1;for(let f of n.names)if(s(p,f))return!0;return!1}function u(p){return p instanceof Error?p.stack||p.message:p}function d(){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}m3.exports=zde});var _3=E((Mn,U_)=>{c();Mn.formatArgs=Wde;Mn.save=Kde;Mn.load=Qde;Mn.useColors=Yde;Mn.storage=Jde();Mn.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Mn.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 Yde(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Wde(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+U_.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),t.splice(r,0,e)}Mn.log=console.debug||console.log||(()=>{});function Kde(t){try{t?Mn.storage.setItem("debug",t):Mn.storage.removeItem("debug")}catch{}}function Qde(){let t;try{t=Mn.storage.getItem("debug")||Mn.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Jde(){try{return localStorage}catch{}}U_.exports=eb()(Mn);var{formatters:Xde}=U_.exports;Xde.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var g3=E((H6e,h3)=>{"use strict";c();h3.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),o=e.indexOf("--");return r!==-1&&(o===-1||r<o)}});var S3=E((q6e,E3)=>{"use strict";c();var Zde=B("os"),T3=B("tty"),_r=g3(),{env:Ct}=process,qs;_r("no-color")||_r("no-colors")||_r("color=false")||_r("color=never")?qs=0:(_r("color")||_r("colors")||_r("color=true")||_r("color=always"))&&(qs=1);"FORCE_COLOR"in Ct&&(Ct.FORCE_COLOR==="true"?qs=1:Ct.FORCE_COLOR==="false"?qs=0:qs=Ct.FORCE_COLOR.length===0?1:Math.min(parseInt(Ct.FORCE_COLOR,10),3));function tb(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function nb(t,e){if(qs===0)return 0;if(_r("color=16m")||_r("color=full")||_r("color=truecolor"))return 3;if(_r("color=256"))return 2;if(t&&!e&&qs===void 0)return 0;let n=qs||0;if(Ct.TERM==="dumb")return n;if(process.platform==="win32"){let r=Zde.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ct)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Ct)||Ct.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Ct)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ct.TEAMCITY_VERSION)?1:0;if(Ct.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ct){let r=parseInt((Ct.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ct.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ct.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ct.TERM)||"COLORTERM"in Ct?1:n}function epe(t){let e=nb(t,t&&t.isTTY);return tb(e)}E3.exports={supportsColor:epe,stdout:tb(nb(!0,T3.isatty(1))),stderr:tb(nb(!0,T3.isatty(2)))}});var y3=E((Nt,F_)=>{c();var tpe=B("tty"),B_=B("util");Nt.init=upe;Nt.log=spe;Nt.formatArgs=rpe;Nt.save=ipe;Nt.load=ape;Nt.useColors=npe;Nt.destroy=B_.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Nt.colors=[6,2,3,4,5,1];try{let t=S3();t&&(t.stderr||t).level>=2&&(Nt.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{}Nt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function npe(){return"colors"in Nt.inspectOpts?!!Nt.inspectOpts.colors:tpe.isatty(process.stderr.fd)}function rpe(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
4
4
|
`).join(`
|
|
5
5
|
`+s),t.push(o+"m+"+F_.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=ope()+e+" "+t[0]}function ope(){return Nt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function spe(...t){return process.stderr.write(B_.formatWithOptions(Nt.inspectOpts,...t)+`
|
|
6
6
|
`)}function ipe(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function ape(){return process.env.DEBUG}function upe(t){t.inspectOpts={};let e=Object.keys(Nt.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=Nt.inspectOpts[e[n]]}F_.exports=eb()(Nt);var{formatters:A3}=F_.exports;A3.o=function(t){return this.inspectOpts.colors=this.useColors,B_.inspect(t,this.inspectOpts).split(`
|
|
@@ -9,7 +9,7 @@ var mX=Object.create;var Pm=Object.defineProperty;var _X=Object.getOwnPropertyDe
|
|
|
9
9
|
`);for(let o of r){if(!o)continue;let s=o.indexOf(":");if(s===-1)continue;let i=o.substring(0,s).toLowerCase(),a=o.substring(s+1).trim(),u=n.get(i);u&&Array.isArray(u)?u.push(a):u?n.set(i,[u,a]):n.set(i,a)}}return n}onRequestCreated({request:e}){let n=this.getConfig(),r=n.enabled!==!1;if((0,nf.safeExecuteInTheMiddle)(()=>!r||e.method==="CONNECT"||n.ignoreRequestHook?.(e),N=>N&&this._diag.error("caught ignoreRequestHook error: ",N),!0))return;let s=(0,ET.hrTime)(),i;try{i=new TAe.URL(e.path,e.origin)}catch(N){this._diag.warn("could not determine url.full:",N);return}let a=i.protocol.replace(":",""),u=this.getRequestMethod(e.method),d={[ft.ATTR_HTTP_REQUEST_METHOD]:u,[ft.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:e.method,[ft.ATTR_URL_FULL]:i.toString(),[ft.ATTR_URL_PATH]:i.pathname,[ft.ATTR_URL_QUERY]:i.search,[ft.ATTR_URL_SCHEME]:a},p={https:"443",http:"80"},f=i.hostname,m=i.port||p[a];d[ft.ATTR_SERVER_ADDRESS]=f,m&&!isNaN(Number(m))&&(d[ft.ATTR_SERVER_PORT]=Number(m));let h=this.parseRequestHeaders(e).get("user-agent");if(h){let N=Array.isArray(h)?h[h.length-1]:h;d[ft.ATTR_USER_AGENT_ORIGINAL]=N}let g=(0,nf.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(e),N=>N&&this._diag.error("caught startSpanHook error: ",N),!0);g&&Object.entries(g).forEach(([N,V])=>{d[N]=V});let T=rr.context.active(),S=rr.trace.getSpan(T),A;n.requireParentforSpans&&(!S||!rr.trace.isSpanContextValid(S.spanContext()))?A=rr.trace.wrapSpanContext(rr.INVALID_SPAN_CONTEXT):A=this.tracer.startSpan(u==="_OTHER"?"HTTP":u,{kind:rr.SpanKind.CLIENT,attributes:d},T),(0,nf.safeExecuteInTheMiddle)(()=>n.requestHook?.(A,e),N=>N&&this._diag.error("caught requestHook error: ",N),!0);let R=rr.trace.setSpan(rr.context.active(),A),I={};rr.propagation.inject(R,I);let O=Object.entries(I);for(let N=0;N<O.length;N++){let[V,ge]=O[N];typeof e.addHeader=="function"?e.addHeader(V,ge):typeof e.headers=="string"?e.headers+=`${V}: ${ge}\r
|
|
10
10
|
`:Array.isArray(e.headers)&&e.headers.push(V,ge)}this._recordFromReq.set(e,{span:A,attributes:d,startTime:s})}onRequestHeaders({request:e,socket:n}){let r=this._recordFromReq.get(e);if(!r)return;let o=this.getConfig(),{span:s}=r,{remoteAddress:i,remotePort:a}=n,u={[ft.ATTR_NETWORK_PEER_ADDRESS]:i,[ft.ATTR_NETWORK_PEER_PORT]:a};if(o.headersToSpanAttributes?.requestHeaders){let d=new Set(o.headersToSpanAttributes.requestHeaders.map(f=>f.toLowerCase())),p=this.parseRequestHeaders(e);for(let[f,m]of p.entries())if(d.has(f)){let _=Array.isArray(m)?m:[m];u[`http.request.header.${f}`]=_}}s.setAttributes(u)}onResponseHeaders({request:e,response:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s}=r,i={[ft.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},a=this.getConfig();if((0,nf.safeExecuteInTheMiddle)(()=>a.responseHook?.(o,{request:e,response:n}),u=>u&&this._diag.error("caught responseHook error: ",u),!0),a.headersToSpanAttributes?.responseHeaders){let u=new Set;a.headersToSpanAttributes?.responseHeaders.forEach(d=>u.add(d.toLowerCase()));for(let d=0;d<n.headers.length;d=d+2){let p=n.headers[d].toString().toLowerCase(),f=n.headers[d+1];if(u.has(p)){let m=`http.response.header.${p}`;Object.hasOwn(i,m)?i[m].push(f.toString()):i[m]=[f.toString()]}}}o.setAttributes(i),o.setStatus({code:n.statusCode>=400?rr.SpanStatusCode.ERROR:rr.SpanStatusCode.UNSET}),r.attributes=Object.assign(s,i)}onDone({request:e}){let n=this._recordFromReq.get(e);if(!n)return;let{span:r,attributes:o,startTime:s}=n;r.end(),this._recordFromReq.delete(e),this.recordRequestDuration(o,s)}onError({request:e,error:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s,startTime:i}=r;o.recordException(n),o.setStatus({code:rr.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(e),s[ft.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(s,i)}recordRequestDuration(e,n){let r={};[ft.ATTR_HTTP_RESPONSE_STATUS_CODE,ft.ATTR_HTTP_REQUEST_METHOD,ft.ATTR_SERVER_ADDRESS,ft.ATTR_SERVER_PORT,ft.ATTR_URL_SCHEME,ft.ATTR_ERROR_TYPE].forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,ET.hrTimeToMilliseconds)((0,ET.hrTimeDuration)(n,(0,ET.hrTime)()))/1e3;this._httpClientDurationHistogram.record(s,r)}getRequestMethod(e){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return e.toUpperCase()in n?e.toUpperCase():"_OTHER"}};ST.UndiciInstrumentation=HO});var WV=E(AT=>{"use strict";c();Object.defineProperty(AT,"__esModule",{value:!0});AT.UndiciInstrumentation=void 0;var EAe=YV();Object.defineProperty(AT,"UndiciInstrumentation",{enumerable:!0,get:function(){return EAe.UndiciInstrumentation}})});var yT=E(rf=>{"use strict";c();Object.defineProperty(rf,"__esModule",{value:!0});rf.ExpressLayerType=void 0;var IAe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(IAe=rf.ExpressLayerType||(rf.ExpressLayerType={}))});var bT=E(of=>{"use strict";c();Object.defineProperty(of,"__esModule",{value:!0});of.AttributeNames=void 0;var OAe;(function(t){t.EXPRESS_TYPE="express.type",t.EXPRESS_NAME="express.name"})(OAe=of.AttributeNames||(of.AttributeNames={}))});var VO=E(ol=>{"use strict";c();Object.defineProperty(ol,"__esModule",{value:!0});ol._LAYERS_STORE_PROPERTY=ol.kLayerPatched=void 0;ol.kLayerPatched=Symbol("express-layer-patched");ol._LAYERS_STORE_PROPERTY="__ot_middlewares"});var t8=E(mt=>{"use strict";c();Object.defineProperty(mt,"__esModule",{value:!0});mt.getActualMatchedRoute=mt.getConstructedRoute=mt.getLayerPath=mt.asErrorAndMessage=mt.isLayerIgnored=mt.getLayerMetadata=mt.getRouterPath=mt.storeLayerPath=void 0;var qO=yT(),sl=bT(),qa=VO(),CAe=(t,e)=>(Array.isArray(t[qa._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,qa._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e===void 0?{isLayerPathStored:!1}:(t[qa._LAYERS_STORE_PROPERTY].push(e),{isLayerPathStored:!0}));mt.storeLayerPath=CAe;var NAe=(t,e)=>{let n=e.handle?.stack?.[0];return n?.route?.path?`${t}${n.route.path}`:n?.handle?.stack?(0,mt.getRouterPath)(t,n):t};mt.getRouterPath=NAe;var xAe=(t,e,n)=>{if(e.name==="router"){let r=(0,mt.getRouterPath)("",e),o=r||n||t||"/";return{attributes:{[sl.AttributeNames.EXPRESS_NAME]:o,[sl.AttributeNames.EXPRESS_TYPE]:qO.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return e.name==="bound dispatch"||e.name==="handle"?{attributes:{[sl.AttributeNames.EXPRESS_NAME]:(t||n)??"request handler",[sl.AttributeNames.EXPRESS_TYPE]:qO.ExpressLayerType.REQUEST_HANDLER},name:`request handler${e.path?` - ${t||n}`:""}`}:{attributes:{[sl.AttributeNames.EXPRESS_NAME]:e.name,[sl.AttributeNames.EXPRESS_TYPE]:qO.ExpressLayerType.MIDDLEWARE},name:`middleware - ${e.name}`}};mt.getLayerMetadata=xAe;var PAe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")},MAe=(t,e,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(e))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(PAe(t,r))return!0}catch{}return!1};mt.isLayerIgnored=MAe;var vAe=t=>t instanceof Error?[t,t.message]:[String(t),String(t)];mt.asErrorAndMessage=vAe;var kAe=t=>{let e=t[0];return Array.isArray(e)?e.map(n=>ZV(n)||"").join(","):ZV(e)};mt.getLayerPath=kAe;var ZV=t=>{if(typeof t=="string")return t;if(t instanceof RegExp||typeof t=="number")return t.toString()};function e8(t){let n=(Array.isArray(t[qa._LAYERS_STORE_PROPERTY])?t[qa._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}mt.getConstructedRoute=e8;function wAe(t){let e=Array.isArray(t[qa._LAYERS_STORE_PROPERTY])?t[qa._LAYERS_STORE_PROPERTY]:[];if(e.length===0)return;if(e.every(s=>s==="/"))return t.originalUrl==="/"?"/":void 0;let n=e8(t);if(n==="*"||n.includes("/")&&(n.includes(",")||n.includes("\\")||n.includes("*")||n.includes("[")))return n;let r=n.startsWith("/")?n:`/${n}`;return r.length>0&&(t.originalUrl===r||t.originalUrl.startsWith(r)||LAe(r))?r:void 0}mt.getActualMatchedRoute=wAe;function LAe(t){return t.includes(":")||t.includes("*")}});var n8=E(il=>{"use strict";c();Object.defineProperty(il,"__esModule",{value:!0});il.PACKAGE_NAME=il.PACKAGE_VERSION=void 0;il.PACKAGE_VERSION="0.62.0";il.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var a8=E(IT=>{"use strict";c();Object.defineProperty(IT,"__esModule",{value:!0});IT.ExpressInstrumentation=void 0;var r8=ye(),Un=(M(),x(L)),o8=yT(),s8=bT(),vo=t8(),i8=n8(),al=se(),DAe=(fe(),x(Oe)),RT=VO(),$O=class extends al.InstrumentationBase{constructor(e={}){super(i8.PACKAGE_NAME,i8.PACKAGE_VERSION,e)}init(){return[new al.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],e=>{let n=typeof e?.Router?.prototype?.route=="function",r=n?e.Router.prototype:e.Router;return(0,al.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,al.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,al.isWrapped)(e.application.use)&&this._unwrap(e.application,"use"),this._wrap(e.application,"use",this._getAppUsePatch(n)),e},e=>{if(e===void 0)return;let r=typeof e?.Router?.prototype?.route=="function"?e.Router.prototype:e.Router;this._unwrap(r,"route"),this._unwrap(r,"use"),this._unwrap(e.application,"use")})]}_getRoutePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,vo.getLayerPath)(o)),s}}}_getRouterUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,vo.getLayerPath)(o)),s}}}_getAppUsePatch(e){let n=this;return function(r){return function(...s){let i=e?this.router:this._router,a=r.apply(this,s);if(i){let u=i.stack[i.stack.length-1];n._applyPatch(u,(0,vo.getLayerPath)(s))}return a}}}_applyPatch(e,n){let r=this;e[RT.kLayerPatched]!==!0&&(e[RT.kLayerPatched]=!0,this._wrap(e,"handle",o=>{if(o.length===4)return o;let s=function(i,a){let{isLayerPathStored:u}=(0,vo.storeLayerPath)(i,n),d=(0,vo.getConstructedRoute)(i),p=(0,vo.getActualMatchedRoute)(i),f={[DAe.ATTR_HTTP_ROUTE]:p},m=(0,vo.getLayerMetadata)(d,e,n),_=m.attributes[s8.AttributeNames.EXPRESS_TYPE],h=(0,r8.getRPCMetadata)(Un.context.active());if(h?.type===r8.RPCType.HTTP&&(h.route=p),(0,vo.isLayerIgnored)(m.name,_,r.getConfig()))return _===o8.ExpressLayerType.MIDDLEWARE&&i[RT._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Un.trace.getSpan(Un.context.active())===void 0)return o.apply(this,arguments);let g=r._getSpanName({request:i,layerType:_,route:d},m.name),T=r.tracer.startSpan(g,{attributes:Object.assign(f,m.attributes)}),S=Un.context.active(),A=Un.trace.setSpan(S,T),{requestHook:R}=r.getConfig();R&&(0,al.safeExecuteInTheMiddle)(()=>R(T,{request:i,layerType:_,route:d}),ge=>{ge&&Un.diag.error("express instrumentation: request hook failed",ge)},!0);let I=!1;m.attributes[s8.AttributeNames.EXPRESS_TYPE]===o8.ExpressLayerType.ROUTER&&(T.end(),I=!0,A=S);let O=()=>{I===!1&&(I=!0,T.end())},N=Array.from(arguments),V=N.findIndex(ge=>typeof ge=="function");V>=0&&(arguments[V]=function(){let ge=arguments[0],Be=![void 0,null,"route","router"].includes(ge);if(!I&&Be){let[Zo,zn]=(0,vo.asErrorAndMessage)(ge);T.recordException(Zo),T.setStatus({code:Un.SpanStatusCode.ERROR,message:zn})}I===!1&&(I=!0,i.res?.removeListener("finish",O),T.end()),!(i.route&&Be)&&u&&i[RT._LAYERS_STORE_PROPERTY].pop();let hn=N[V],pr=Un.context.active(),Xo=Un.trace.getSpan(S),ct=Xo?Un.trace.setSpan(pr,Xo):pr;return Un.context.bind(ct,hn).apply(this,arguments)});try{return Un.context.bind(A,o).apply(this,arguments)}catch(ge){let[Be,hn]=(0,vo.asErrorAndMessage)(ge);throw T.recordException(Be),T.setStatus({code:Un.SpanStatusCode.ERROR,message:hn}),ge}finally{I||a.once("finish",O)}};for(let i in o)Object.defineProperty(s,i,{get(){return o[i]},set(a){o[i]=a}});return s}))}_getSpanName(e,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(e,n)??n}catch(o){return Un.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};IT.ExpressInstrumentation=$O});var u8=E(yi=>{"use strict";c();Object.defineProperty(yi,"__esModule",{value:!0});yi.AttributeNames=yi.ExpressLayerType=yi.ExpressInstrumentation=void 0;var UAe=a8();Object.defineProperty(yi,"ExpressInstrumentation",{enumerable:!0,get:function(){return UAe.ExpressInstrumentation}});var BAe=yT();Object.defineProperty(yi,"ExpressLayerType",{enumerable:!0,get:function(){return BAe.ExpressLayerType}});var FAe=bT();Object.defineProperty(yi,"AttributeNames",{enumerable:!0,get:function(){return FAe.AttributeNames}})});var f8=E(sf=>{"use strict";c();Object.defineProperty(sf,"__esModule",{value:!0});sf.SeverityNumber=void 0;var VAe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(VAe=sf.SeverityNumber||(sf.SeverityNumber={}))});var NT=E(ul=>{"use strict";c();Object.defineProperty(ul,"__esModule",{value:!0});ul.NOOP_LOGGER=ul.NoopLogger=void 0;var CT=class{emit(e){}};ul.NoopLogger=CT;ul.NOOP_LOGGER=new CT});var m8=E(ko=>{"use strict";c();Object.defineProperty(ko,"__esModule",{value:!0});ko.API_BACKWARDS_COMPATIBILITY_VERSION=ko.makeGetter=ko._global=ko.GLOBAL_LOGS_API_KEY=void 0;ko.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");ko._global=globalThis;function qAe(t,e,n){return r=>r===t?e:n}ko.makeGetter=qAe;ko.API_BACKWARDS_COMPATIBILITY_VERSION=1});var zO=E(cl=>{"use strict";c();Object.defineProperty(cl,"__esModule",{value:!0});cl.NOOP_LOGGER_PROVIDER=cl.NoopLoggerProvider=void 0;var $Ae=NT(),xT=class{getLogger(e,n,r){return new $Ae.NoopLogger}};cl.NoopLoggerProvider=xT;cl.NOOP_LOGGER_PROVIDER=new xT});var _8=E(PT=>{"use strict";c();Object.defineProperty(PT,"__esModule",{value:!0});PT.ProxyLogger=void 0;var zAe=NT(),YO=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):zAe.NOOP_LOGGER}};PT.ProxyLogger=YO});var h8=E(MT=>{"use strict";c();Object.defineProperty(MT,"__esModule",{value:!0});MT.ProxyLoggerProvider=void 0;var YAe=zO(),WAe=_8(),WO=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new WAe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:YAe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};MT.ProxyLoggerProvider=WO});var T8=E(vT=>{"use strict";c();Object.defineProperty(vT,"__esModule",{value:!0});vT.LogsAPI=void 0;var Rr=m8(),KAe=zO(),g8=h8(),KO=class t{constructor(){this._proxyLoggerProvider=new g8.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Rr._global[Rr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Rr._global[Rr.GLOBAL_LOGS_API_KEY]=(0,Rr.makeGetter)(Rr.API_BACKWARDS_COMPATIBILITY_VERSION,e,KAe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=Rr._global[Rr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(Rr._global,Rr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete Rr._global[Rr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new g8.ProxyLoggerProvider}};vT.LogsAPI=KO});var QO=E(wo=>{"use strict";c();Object.defineProperty(wo,"__esModule",{value:!0});wo.logs=wo.NoopLogger=wo.NOOP_LOGGER=wo.SeverityNumber=void 0;var QAe=f8();Object.defineProperty(wo,"SeverityNumber",{enumerable:!0,get:function(){return QAe.SeverityNumber}});var E8=NT();Object.defineProperty(wo,"NOOP_LOGGER",{enumerable:!0,get:function(){return E8.NOOP_LOGGER}});Object.defineProperty(wo,"NoopLogger",{enumerable:!0,get:function(){return E8.NoopLogger}});var JAe=T8();wo.logs=JAe.LogsAPI.getInstance()});var S8=E(ll=>{"use strict";c();Object.defineProperty(ll,"__esModule",{value:!0});ll.disableInstrumentations=ll.enableInstrumentations=void 0;function XAe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}ll.enableInstrumentations=XAe;function ZAe(t){t.forEach(e=>e.disable())}ll.disableInstrumentations=ZAe});var b8=E(kT=>{"use strict";c();Object.defineProperty(kT,"__esModule",{value:!0});kT.registerInstrumentations=void 0;var A8=(M(),x(L)),eye=QO(),y8=S8();function tye(t){let e=t.tracerProvider||A8.trace.getTracerProvider(),n=t.meterProvider||A8.metrics.getMeterProvider(),r=t.loggerProvider||eye.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,y8.enableInstrumentations)(o,e,n,r),()=>{(0,y8.disableInstrumentations)(o)}}kT.registerInstrumentations=tye});var v8=E(wT=>{"use strict";c();Object.defineProperty(wT,"__esModule",{value:!0});wT.satisfies=void 0;var eC=(M(),x(L)),N8=/^(?: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-]+)*))?$/,nye=/^(?<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-]+)*))?$/,rye={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function oye(t,e,n){if(!sye(t))return eC.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=cye(t);if(!r)return!1;let o=[],s=x8(r,e,o,n);return s&&!n?.includePrerelease?aye(r,o):s}wT.satisfies=oye;function sye(t){return typeof t=="string"&&N8.test(t)}function x8(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(JO(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=Pye(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!JO(t,s,n,r))return!1;return!0}return JO(t,e,n,r)}function JO(t,e,n,r){if(e=uye(e,r),e.includes(" "))return x8(t,e,n,r);{let o=lye(e);return n.push(o),iye(t,o)}}function iye(t,e){if(e.invalid)return!1;if(!e.version||ZO(e.version))return!0;let n=I8(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=I8(r,o)}return rye[e.op]?.includes(n)}function aye(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function uye(t,e){return t=t.trim(),t=Nye(t,e),t=Cye(t),t=xye(t,e),t=t.trim(),t}function Rn(t){return!t||t.toLowerCase()==="x"||t==="*"}function cye(t){let e=t.match(N8);if(!e){eC.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function lye(t){if(!t)return{};let e=t.match(nye);if(!e)return eC.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function ZO(t){return t==="*"||t==="x"||t==="X"}function R8(t){let e=parseInt(t,10);return isNaN(e)?t:e}function dye(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function pye(t,e){if(ZO(t)||ZO(e))return 0;let[n,r]=dye(R8(t),R8(e));return n>r?1:n<r?-1:0}function I8(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=pye(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var P8="[a-zA-Z0-9-]",M8="0|[1-9]\\d*",fye=`\\d*[a-zA-Z-]${P8}*`,mye="((?:<|>)?=?)",O8=`(?:${M8}|${fye})`,_ye=`(?:-(${O8}(?:\\.${O8})*))`,C8=`${P8}+`,hye=`(?:\\+(${C8}(?:\\.${C8})*))`,XO=`${M8}|x|X|\\*`,af=`[v=\\s]*(${XO})(?:\\.(${XO})(?:\\.(${XO})(?:${_ye})?${hye}?)?)?`,gye=`^${mye}\\s*${af}$`,Tye=new RegExp(gye),Eye=`^\\s*(${af})\\s+-\\s+(${af})\\s*$`,Sye=new RegExp(Eye),Aye="(?:~>?)",yye=`^${Aye}${af}$`,bye=new RegExp(yye),Rye="(?:\\^)",Iye=`^${Rye}${af}$`,Oye=new RegExp(Iye);function Cye(t){let e=bye;return t.replace(e,(n,r,o,s,i)=>{let a;return Rn(r)?a="":Rn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Rn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function Nye(t,e){let n=Oye,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,u)=>{let d;return Rn(s)?d="":Rn(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Rn(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:u?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${u} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${u} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${u} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function xye(t,e){let n=Tye;return t.replace(n,(r,o,s,i,a,u)=>{let d=Rn(s),p=d||Rn(i),f=p||Rn(a),m=f;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&m?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(u="-0"),r=`${o+s}.${i}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:f&&(r=`>=${s}.${i}.0${u} <${s}.${+i+1}.0-0`),r})}function Pye(t,e){let n=Sye;return t.replace(n,(r,o,s,i,a,u,d,p,f,m,_,h)=>(Rn(s)?o="":Rn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Rn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Rn(f)?p="":Rn(m)?p=`<${+f+1}.0.0-0`:Rn(_)?p=`<${f}.${+m+1}.0-0`:h?p=`<=${f}.${m}.${_}-${h}`:e?.includePrerelease?p=`<${f}.${m}.${+_+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var tC=E(Qt=>{"use strict";c();Object.defineProperty(Qt,"__esModule",{value:!0});Qt.massUnwrap=Qt.unwrap=Qt.massWrap=Qt.wrap=void 0;var In=console.error.bind(console);function uf(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var Mye=(t,e,n)=>{if(!t||!t[e]){In("no original function "+String(e)+" to wrap");return}if(!n){In("no wrapper function"),In(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){In("original object and wrapper must be functions");return}let o=n(r,e);return uf(o,"__original",r),uf(o,"__unwrap",()=>{t[e]===o&&uf(t,e,r)}),uf(o,"__wrapped",!0),uf(t,e,o),o};Qt.wrap=Mye;var vye=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{In("must provide one or more modules to patch"),In(new Error().stack);return}if(!(e&&Array.isArray(e))){In("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Qt.wrap)(r,o,n)})})};Qt.massWrap=vye;var kye=(t,e)=>{if(!t||!t[e]){In("no function to unwrap."),In(new Error().stack);return}let n=t[e];if(!n.__unwrap)In("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Qt.unwrap=kye;var wye=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{In("must provide one or more modules to patch"),In(new Error().stack);return}if(!(e&&Array.isArray(e))){In("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Qt.unwrap)(n,r)})})};Qt.massUnwrap=wye;function cf(t){t&&t.logger&&(typeof t.logger!="function"?In("new logger isn't a function, not replacing"):In=t.logger)}Qt.default=cf;cf.wrap=Qt.wrap;cf.massWrap=Qt.massWrap;cf.unwrap=Qt.unwrap;cf.massUnwrap=Qt.massUnwrap});var k8=E(DT=>{"use strict";c();Object.defineProperty(DT,"__esModule",{value:!0});DT.InstrumentationAbstract=void 0;var nC=(M(),x(L)),Lye=QO(),LT=tC(),rC=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=nC.diag.createComponentLogger({namespace:e}),this._tracer=nC.trace.getTracer(e,n),this._meter=nC.metrics.getMeter(e,n),this._logger=Lye.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=LT.wrap;_unwrap=LT.unwrap;_massWrap=LT.massWrap;_massUnwrap=LT.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};DT.InstrumentationAbstract=rC});var w8=E(bi=>{"use strict";c();Object.defineProperty(bi,"__esModule",{value:!0});bi.ModuleNameTrie=bi.ModuleNameSeparator=void 0;bi.ModuleNameSeparator="/";var UT=class{hooks=[];children=new Map},oC=class{_trie=new UT;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(bi.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new UT,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(bi.ModuleNameSeparator)){let u=o.children.get(a);if(!u){i=!1;break}r||s.push(...u.hooks),o=u}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,u)=>a.insertedId-u.insertedId),s.map(({hook:a})=>a))}};bi.ModuleNameTrie=oC});var D8=E(BT=>{"use strict";c();Object.defineProperty(BT,"__esModule",{value:!0});BT.RequireInTheMiddleSingleton=void 0;var Dye=ga(),L8=B("path"),sC=w8(),Uye=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),iC=class t{_moduleNameTrie=new sC.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new Dye.Hook(null,{internals:!0},(e,n,r)=>{let o=Bye(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return Uye?new t:this._instance=this._instance??new t}};BT.RequireInTheMiddleSingleton=iC;function Bye(t){return L8.sep!==sC.ModuleNameSeparator?t.split(L8.sep).join(sC.ModuleNameSeparator):t}});var j8=E(lf=>{c();var U8=[],aC=new WeakMap,B8=new WeakMap,F8=new Map,G8=[],Fye={set(t,e,n){let r=aC.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=B8.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=aC.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function Gye(t,e,n,r,o){F8.set(t,o),aC.set(e,n),B8.set(e,r);let s=new Proxy(e,Fye);U8.forEach(i=>i(t,s,o)),G8.push([t,s,o])}lf.register=Gye;lf.importHooks=U8;lf.specifiers=F8;lf.toHook=G8});var dC=E((Mst,pl)=>{c();var H8=B("path"),jye=G_(),{fileURLToPath:Hye}=B("url"),{MessageChannel:Vye}=B("worker_threads"),{isBuiltin:uC}=B("module");uC||(uC=()=>!0);var{importHooks:cC,specifiers:qye,toHook:$ye}=j8();function V8(t){cC.push(t),$ye.forEach(([e,n,r])=>t(e,n,r))}function q8(t){let e=cC.indexOf(t);e>-1&&cC.splice(e,1)}function dl(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var lC;function zye(){let{port1:t,port2:e}=new Vye,n=0,r;lC=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),u=new Promise(d=>{r=d}).then(()=>{clearInterval(a)});return n===0&&r(),u}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function df(t,e,n){if(!(this instanceof df))return new df(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;lC&&Array.isArray(t)&&lC(t),this._iitmHook=(o,s,i)=>{let a=o,u=a.startsWith("node:"),d,p;if(u){let f=o.slice(5);uC(f)&&(o=f)}else if(a.startsWith("file://")){let f=Error.stackTraceLimit;Error.stackTraceLimit=0;try{d=Hye(o),o=d}catch{}if(Error.stackTraceLimit=f,d){let m=jye(d);m&&(o=m.name,p=m.basedir)}}if(t)for(let f of t)if(d&&f===d)dl(n,s,d,void 0);else if(f===o){if(!p)dl(n,s,o,p);else if(p.endsWith(qye.get(a)))dl(n,s,o,p);else if(r){let m=o+H8.sep+H8.relative(p,d);dl(n,s,m,p)}}else f===i&&dl(n,s,i,p);else dl(n,s,o,p)},V8(this._iitmHook)}df.prototype.unhook=function(){q8(this._iitmHook)};pl.exports=df;pl.exports.Hook=df;pl.exports.addHook=V8;pl.exports.removeHook=q8;pl.exports.createAddHookMessageChannel=zye});var pC=E(Ri=>{"use strict";c();Object.defineProperty(Ri,"__esModule",{value:!0});Ri.isWrapped=Ri.safeExecuteInTheMiddleAsync=Ri.safeExecuteInTheMiddle=void 0;function Yye(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Ri.safeExecuteInTheMiddle=Yye;async function Wye(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(await e(r,o),r&&!n)throw r;return o}}Ri.safeExecuteInTheMiddleAsync=Wye;function Kye(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}Ri.isWrapped=Kye});var Y8=E(FT=>{"use strict";c();Object.defineProperty(FT,"__esModule",{value:!0});FT.InstrumentationBase=void 0;var pf=B("path"),$8=B("util"),Qye=v8(),fC=tC(),Jye=k8(),Xye=D8(),Zye=dC(),ff=(M(),x(L)),ebe=ga(),tbe=B("fs"),nbe=pC(),mC=class extends Jye.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=Xye.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,nbe.isWrapped)(e[n])&&this._unwrap(e,n),$8.types.isProxy(e)){let o=(0,fC.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,fC.wrap)(e,n,r)};_unwrap=(e,n)=>$8.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,fC.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{ff.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){ff.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ff.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){ff.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=B.resolve(n);B.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,tbe.readFileSync)(pf.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{ff.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return z8(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=pf.normalize(r);return i.filter(d=>d.name===a&&z8(d.supportedVersions,s,e.includePrerelease)).reduce((d,p)=>(p.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(d,e.moduleVersion)):d),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,u)=>{if(!u&&pf.isAbsolute(a)){let d=pf.parse(a);a=d.name,u=d.dir}return this._onRequire(e,i,a,u)},r=(i,a,u)=>this._onRequire(e,i,a,u),o=pf.isAbsolute(e.name)?new ebe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new Zye.Hook([e.name],{internals:!0},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};FT.InstrumentationBase=mC;function z8(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,Qye.satisfies)(e,r,{includePrerelease:n}))}});var W8=E(GT=>{"use strict";c();Object.defineProperty(GT,"__esModule",{value:!0});GT.normalize=void 0;var rbe=B("path");Object.defineProperty(GT,"normalize",{enumerable:!0,get:function(){return rbe.normalize}})});var K8=E(fl=>{"use strict";c();Object.defineProperty(fl,"__esModule",{value:!0});fl.normalize=fl.InstrumentationBase=void 0;var obe=Y8();Object.defineProperty(fl,"InstrumentationBase",{enumerable:!0,get:function(){return obe.InstrumentationBase}});var sbe=W8();Object.defineProperty(fl,"normalize",{enumerable:!0,get:function(){return sbe.normalize}})});var _C=E(ml=>{"use strict";c();Object.defineProperty(ml,"__esModule",{value:!0});ml.normalize=ml.InstrumentationBase=void 0;var Q8=K8();Object.defineProperty(ml,"InstrumentationBase",{enumerable:!0,get:function(){return Q8.InstrumentationBase}});Object.defineProperty(ml,"normalize",{enumerable:!0,get:function(){return Q8.normalize}})});var J8=E(jT=>{"use strict";c();Object.defineProperty(jT,"__esModule",{value:!0});jT.InstrumentationNodeModuleDefinition=void 0;var hC=class{files;name;supportedVersions;patch;unpatch;constructor(e,n,r,o,s){this.files=s||[],this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o}};jT.InstrumentationNodeModuleDefinition=hC});var X8=E(HT=>{"use strict";c();Object.defineProperty(HT,"__esModule",{value:!0});HT.InstrumentationNodeModuleFile=void 0;var ibe=_C(),gC=class{name;supportedVersions;patch;unpatch;constructor(e,n,r,o){this.name=(0,ibe.normalize)(e),this.supportedVersions=n,this.patch=r,this.unpatch=o}};HT.InstrumentationNodeModuleFile=gC});var Z8=E($a=>{"use strict";c();Object.defineProperty($a,"__esModule",{value:!0});$a.semconvStabilityFromStr=$a.SemconvStability=void 0;var VT;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(VT=$a.SemconvStability||($a.SemconvStability={}));function abe(t,e){let n=VT.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=VT.DUPLICATE;break}else o.toLowerCase()===t&&(n=VT.STABLE);return n}$a.semconvStabilityFromStr=abe});var tq=E(_t=>{"use strict";c();Object.defineProperty(_t,"__esModule",{value:!0});_t.semconvStabilityFromStr=_t.SemconvStability=_t.safeExecuteInTheMiddleAsync=_t.safeExecuteInTheMiddle=_t.isWrapped=_t.InstrumentationNodeModuleFile=_t.InstrumentationNodeModuleDefinition=_t.InstrumentationBase=_t.registerInstrumentations=void 0;var ube=b8();Object.defineProperty(_t,"registerInstrumentations",{enumerable:!0,get:function(){return ube.registerInstrumentations}});var cbe=_C();Object.defineProperty(_t,"InstrumentationBase",{enumerable:!0,get:function(){return cbe.InstrumentationBase}});var lbe=J8();Object.defineProperty(_t,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return lbe.InstrumentationNodeModuleDefinition}});var dbe=X8();Object.defineProperty(_t,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return dbe.InstrumentationNodeModuleFile}});var TC=pC();Object.defineProperty(_t,"isWrapped",{enumerable:!0,get:function(){return TC.isWrapped}});Object.defineProperty(_t,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return TC.safeExecuteInTheMiddle}});Object.defineProperty(_t,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return TC.safeExecuteInTheMiddleAsync}});var eq=Z8();Object.defineProperty(_t,"SemconvStability",{enumerable:!0,get:function(){return eq.SemconvStability}});Object.defineProperty(_t,"semconvStabilityFromStr",{enumerable:!0,get:function(){return eq.semconvStabilityFromStr}})});var nq=E((Xst,pbe)=>{pbe.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 oq=E(za=>{"use strict";c();Object.defineProperty(za,"__esModule",{value:!0});za.range=za.balanced=void 0;var fbe=(t,e,n)=>{let r=t instanceof RegExp?rq(t,n):t,o=e instanceof RegExp?rq(e,n):e,s=r!==null&&o!=null&&(0,za.range)(r,o,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+o.length)}};za.balanced=fbe;var rq=(t,e)=>{let n=e.match(t);return n?n[0]:null},mbe=(t,e,n)=>{let r,o,s,i,a,u=n.indexOf(t),d=n.indexOf(e,u+1),p=u;if(u>=0&&d>0){if(t===e)return[u,d];for(r=[],s=n.length;p>=0&&!a;){if(p===u)r.push(p),u=n.indexOf(t,p+1);else if(r.length===1){let f=r.pop();f!==void 0&&(a=[f,d])}else o=r.pop(),o!==void 0&&o<s&&(s=o,i=d),d=n.indexOf(e,p+1);p=u<d&&u>=0?u:d}r.length&&i!==void 0&&(a=[s,i])}return a};za.range=mbe});var dq=E(_l=>{"use strict";c();Object.defineProperty(_l,"__esModule",{value:!0});_l.EXPANSION_MAX=void 0;_l.expand=Cbe;var sq=oq(),iq="\0SLASH"+Math.random()+"\0",aq="\0OPEN"+Math.random()+"\0",SC="\0CLOSE"+Math.random()+"\0",uq="\0COMMA"+Math.random()+"\0",cq="\0PERIOD"+Math.random()+"\0",_be=new RegExp(iq,"g"),hbe=new RegExp(aq,"g"),gbe=new RegExp(SC,"g"),Tbe=new RegExp(uq,"g"),Ebe=new RegExp(cq,"g"),Sbe=/\\\\/g,Abe=/\\{/g,ybe=/\\}/g,bbe=/\\,/g,Rbe=/\\\./g;_l.EXPANSION_MAX=1e5;function EC(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function Ibe(t){return t.replace(Sbe,iq).replace(Abe,aq).replace(ybe,SC).replace(bbe,uq).replace(Rbe,cq)}function Obe(t){return t.replace(_be,"\\").replace(hbe,"{").replace(gbe,"}").replace(Tbe,",").replace(Ebe,".")}function lq(t){if(!t)return[""];let e=[],n=(0,sq.balanced)("{","}",t);if(!n)return t.split(",");let{pre:r,body:o,post:s}=n,i=r.split(",");i[i.length-1]+="{"+o+"}";let a=lq(s);return s.length&&(i[i.length-1]+=a.shift(),i.push.apply(i,a)),e.push.apply(e,i),e}function Cbe(t,e={}){if(!t)return[];let{max:n=_l.EXPANSION_MAX}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),mf(Ibe(t),n,!0).map(Obe)}function Nbe(t){return"{"+t+"}"}function xbe(t){return/^-?0\d/.test(t)}function Pbe(t,e){return t<=e}function Mbe(t,e){return t>=e}function mf(t,e,n){let r=[],o=(0,sq.balanced)("{","}",t);if(!o)return[t];let s=o.pre,i=o.post.length?mf(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let a=0;a<i.length&&a<e;a++){let u=s+"{"+o.body+"}"+i[a];r.push(u)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),d=a||u,p=o.body.indexOf(",")>=0;if(!d&&!p)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+SC+o.post,mf(t,e,!0)):[t];let f;if(d)f=o.body.split(/\.\./);else if(f=lq(o.body),f.length===1&&f[0]!==void 0&&(f=mf(f[0],e,!1).map(Nbe),f.length===1))return i.map(_=>o.pre+f[0]+_);let m;if(d&&f[0]!==void 0&&f[1]!==void 0){let _=EC(f[0]),h=EC(f[1]),g=Math.max(f[0].length,f[1].length),T=f.length===3&&f[2]!==void 0?Math.abs(EC(f[2])):1,S=Pbe;h<_&&(T*=-1,S=Mbe);let R=f.some(xbe);m=[];for(let I=_;S(I,h);I+=T){let O;if(u)O=String.fromCharCode(I),O==="\\"&&(O="");else if(O=String(I),R){let N=g-O.length;if(N>0){let V=new Array(N+1).join("0");I<0?O="-"+V+O.slice(1):O=V+O}}m.push(O)}}else{m=[];for(let _=0;_<f.length;_++)m.push.apply(m,mf(f[_],e,!1))}for(let _=0;_<m.length;_++)for(let h=0;h<i.length&&r.length<e;h++){let g=s+m[_]+i[h];(!n||d||g)&&r.push(g)}}return r}});var pq=E(qT=>{"use strict";c();Object.defineProperty(qT,"__esModule",{value:!0});qT.assertValidPattern=void 0;var vbe=1024*64,kbe=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>vbe)throw new TypeError("pattern is too long")};qT.assertValidPattern=kbe});var mq=E($T=>{"use strict";c();Object.defineProperty($T,"__esModule",{value:!0});$T.parseClass=void 0;var wbe={"[: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]},_f=t=>t.replace(/[[\]\\-]/g,"\\$&"),Lbe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fq=t=>t.join(""),Dbe=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],s=n+1,i=!1,a=!1,u=!1,d=!1,p=n,f="";e:for(;s<t.length;){let g=t.charAt(s);if((g==="!"||g==="^")&&s===n+1){d=!0,s++;continue}if(g==="]"&&i&&!u){p=s+1;break}if(i=!0,g==="\\"&&!u){u=!0,s++;continue}if(g==="["&&!u){for(let[T,[S,A,R]]of Object.entries(wbe))if(t.startsWith(T,s)){if(f)return["$.",!1,t.length-n,!0];s+=T.length,R?o.push(S):r.push(S),a=a||A;continue e}}if(u=!1,f){g>f?r.push(_f(f)+"-"+_f(g)):g===f&&r.push(_f(g)),f="",s++;continue}if(t.startsWith("-]",s+1)){r.push(_f(g+"-")),s+=2;continue}if(t.startsWith("-",s+1)){f=g,s+=2;continue}r.push(_f(g)),s++}if(p<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,t.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!d){let g=r[0].length===2?r[0].slice(-1):r[0];return[Lbe(g),!1,p-n,!1]}let m="["+(d?"^":"")+fq(r)+"]",_="["+(d?"":"^")+fq(o)+"]";return[r.length&&o.length?"("+m+"|"+_+")":r.length?m:_,a,p-n,!0]};$T.parseClass=Dbe});var YT=E(zT=>{"use strict";c();Object.defineProperty(zT,"__esModule",{value:!0});zT.unescape=void 0;var Ube=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!0}={})=>n?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");zT.unescape=Ube});var bC=E(JT=>{"use strict";c();var Bn;Object.defineProperty(JT,"__esModule",{value:!0});JT.AST=void 0;var Bbe=mq(),WT=YT(),Fbe=new Set(["!","?","+","*","@"]),AC=t=>Fbe.has(t),_q=t=>AC(t.type),Gbe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),jbe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Hbe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),hq=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Vbe="(?!(?:^|/)\\.\\.?(?:$|/))",KT="(?!\\.)",qbe=new Set(["[","."]),$be=new Set(["..","."]),zbe=new Set("().*{}+?[]^$\\!"),Ybe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),yC="[^/]",gq=yC+"*?",Tq=yC+"+?",Wbe=0,QT=class{type;#n;#r;#o=!1;#e=[];#t;#a;#c;#u=!1;#s;#i;#l=!1;id=++Wbe;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#n.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,n,r={}){this.type=e,e&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#c=this.#n===this?[]:this.#n.#c,e==="!"&&!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 e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#i!==void 0?this.#i:this.type?this.#i=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#i=this.#e.map(e=>String(e)).join("")}#g(){if(this!==this.#n)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let n=e,r=n.#t;for(;r;){for(let o=n.#a+1;!r.type&&o<r.#e.length;o++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof Bn&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let e=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#u&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let e=this.#t;for(let n=0;n<this.#a;n++){let r=e.#e[n];if(!(r instanceof Bn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let e=this.#t?this.#t.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new Bn(this.type,e);for(let r of this.#e)n.copyIn(r);return n}static#d(e,n,r,o,s){let i=o.maxExtglobRecursion??2,a=!1,u=!1,d=-1,p=!1;if(n.type===null){let g=r,T="";for(;g<e.length;){let S=e.charAt(g++);if(a||S==="\\"){a=!a,T+=S;continue}if(u){g===d+1?(S==="^"||S==="!")&&(p=!0):S==="]"&&!(g===d+2&&p)&&(u=!1),T+=S;continue}else if(S==="["){u=!0,d=g,p=!1,T+=S;continue}if(!o.noext&&AC(S)&&e.charAt(g)==="("&&s<=i){n.push(T),T="";let R=new Bn(S,n);g=Bn.#d(e,R,g,o,s+1),n.push(R);continue}T+=S}return n.push(T),g}let f=r+1,m=new Bn(null,n),_=[],h="";for(;f<e.length;){let g=e.charAt(f++);if(a||g==="\\"){a=!a,h+=g;continue}if(u){f===d+1?(g==="^"||g==="!")&&(p=!0):g==="]"&&!(f===d+2&&p)&&(u=!1),h+=g;continue}else if(g==="["){u=!0,d=f,p=!1,h+=g;continue}if(!o.noext&&AC(g)&&e.charAt(f)==="("&&(s<=i||n&&n.#p(g))){let S=n&&n.#p(g)?0:1;m.push(h),h="";let A=new Bn(g,m);m.push(A),f=Bn.#d(e,A,f,o,s+S);continue}if(g==="|"){m.push(h),h="",_.push(m),m=new Bn(null,n);continue}if(g===")")return h===""&&n.#e.length===0&&(n.#l=!0),m.push(h),h="",n.push(..._,m),f;h+=g}return n.type=null,n.#r=void 0,n.#e=[e.substring(r-1)],f}#T(e){return this.#m(e,jbe)}#m(e,n=Gbe){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let r=e.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#p(r.type,n)}#p(e,n=Hbe){return!!n.get(this.type)?.includes(e)}#E(e,n){let r=e.#e[0],o=new Bn(null,r,this.options);o.#e.push(""),r.push(o),this.#_(e,n)}#_(e,n){let r=e.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#i=void 0}#S(e){return!!hq.get(this.type)?.has(e)}#A(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(e){let n=hq.get(this.type),r=e.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let s of this.#e)typeof s=="object"&&(s.#t=this);this.type=o,this.#i=void 0,this.#l=!1}static fromGlob(e,n={}){let r=new Bn(null,void 0,n);return Bn.#d(e,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let e=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#s}toRegExpSource(e){let n=e??!!this.#s.dot;if(this.#n===this&&(this.#f(),this.#g()),!_q(this)){let u=this.isStart()&&this.isEnd()&&!this.#e.some(_=>typeof _!="string"),d=this.#e.map(_=>{let[h,g,T,S]=typeof _=="string"?Bn.#b(_,this.#r,u):_.toRegExpSource(e);return this.#r=this.#r||T,this.#o=this.#o||S,h}).join(""),p="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&$be.has(this.#e[0]))){let h=qbe,g=n&&h.has(d.charAt(0))||d.startsWith("\\.")&&h.has(d.charAt(2))||d.startsWith("\\.\\.")&&h.has(d.charAt(4)),T=!n&&!e&&h.has(d.charAt(0));p=g?Vbe:T?KT:""}let f="";return this.isEnd()&&this.#n.#u&&this.#t?.type==="!"&&(f="(?:$|\\/)"),[p+d+f,(0,WT.unescape)(d),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),d=this;return d.#e=[u],d.type=null,d.#r=void 0,[u,(0,WT.unescape)(this.toString()),!1,!1]}let i=!r||e||n||!KT?"":this.#h(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!n?KT:"")+Tq;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?KT:"")+gq+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`;a=o+s+u}return[a,(0,WT.unescape)(s),this.#r=!!this.#r,this.#o]}#f(){if(_q(this)){let e=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#f(),this.#m(o)?(n=!1,this.#_(o,r)):this.#T(o)?(n=!1,this.#E(o,r)):this.#A(o)&&(n=!1,this.#y(o)))}}while(!n&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#f();this.#i=void 0}#h(e){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,s,i]=n.toRegExpSource(e);return this.#o=this.#o||i,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#b(e,n,r=!1){let o=!1,s="",i=!1,a=!1;for(let u=0;u<e.length;u++){let d=e.charAt(u);if(o){o=!1,s+=(zbe.has(d)?"\\":"")+d;continue}if(d==="*"){if(a)continue;a=!0,s+=r&&/^[*]+$/.test(e)?Tq:gq,n=!0;continue}else a=!1;if(d==="\\"){u===e.length-1?s+="\\\\":o=!0;continue}if(d==="["){let[p,f,m,_]=(0,Bbe.parseClass)(e,u);if(m){s+=p,i=i||f,u+=m-1,n=n||_;continue}}if(d==="?"){s+=yC,n=!0;continue}s+=Ybe(d)}return[s,(0,WT.unescape)(e),!!n,i]}};JT.AST=QT;Bn=QT});var RC=E(XT=>{"use strict";c();Object.defineProperty(XT,"__esModule",{value:!0});XT.escape=void 0;var Kbe=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!1}={})=>n?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");XT.escape=Kbe});var Iq=E(G=>{"use strict";c();Object.defineProperty(G,"__esModule",{value:!0});G.unescape=G.escape=G.AST=G.Minimatch=G.match=G.makeRe=G.braceExpand=G.defaults=G.filter=G.GLOBSTAR=G.sep=G.minimatch=void 0;var Qbe=dq(),ZT=pq(),Aq=bC(),Jbe=RC(),Xbe=YT(),Zbe=(t,e,n={})=>((0,ZT.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Ya(e,n).match(t));G.minimatch=Zbe;var eRe=/^\*+([^+@!?\*\[\(]*)$/,tRe=t=>e=>!e.startsWith(".")&&e.endsWith(t),nRe=t=>e=>e.endsWith(t),rRe=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),oRe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),sRe=/^\*+\.\*+$/,iRe=t=>!t.startsWith(".")&&t.includes("."),aRe=t=>t!=="."&&t!==".."&&t.includes("."),uRe=/^\.\*+$/,cRe=t=>t!=="."&&t!==".."&&t.startsWith("."),lRe=/^\*+$/,dRe=t=>t.length!==0&&!t.startsWith("."),pRe=t=>t.length!==0&&t!=="."&&t!=="..",fRe=/^\?+([^+@!?\*\[\(]*)?$/,mRe=([t,e=""])=>{let n=yq([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},_Re=([t,e=""])=>{let n=bq([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},hRe=([t,e=""])=>{let n=bq([t]);return e?r=>n(r)&&r.endsWith(e):n},gRe=([t,e=""])=>{let n=yq([t]);return e?r=>n(r)&&r.endsWith(e):n},yq=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},bq=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},Rq=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Eq={win32:{sep:"\\"},posix:{sep:"/"}};G.sep=Rq==="win32"?Eq.win32.sep:Eq.posix.sep;G.minimatch.sep=G.sep;G.GLOBSTAR=Symbol("globstar **");G.minimatch.GLOBSTAR=G.GLOBSTAR;var TRe="[^/]",ERe=TRe+"*?",SRe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ARe="(?:(?!(?:\\/|^)\\.).)*?",yRe=(t,e={})=>n=>(0,G.minimatch)(n,t,e);G.filter=yRe;G.minimatch.filter=G.filter;var Ir=(t,e={})=>Object.assign({},t,e),bRe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return G.minimatch;let e=G.minimatch;return Object.assign((r,o,s={})=>e(r,o,Ir(t,s)),{Minimatch:class extends e.Minimatch{constructor(o,s={}){super(o,Ir(t,s))}static defaults(o){return e.defaults(Ir(t,o)).Minimatch}},AST:class extends e.AST{constructor(o,s,i={}){super(o,s,Ir(t,i))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Ir(t,s))}},unescape:(r,o={})=>e.unescape(r,Ir(t,o)),escape:(r,o={})=>e.escape(r,Ir(t,o)),filter:(r,o={})=>e.filter(r,Ir(t,o)),defaults:r=>e.defaults(Ir(t,r)),makeRe:(r,o={})=>e.makeRe(r,Ir(t,o)),braceExpand:(r,o={})=>e.braceExpand(r,Ir(t,o)),match:(r,o,s={})=>e.match(r,o,Ir(t,s)),sep:e.sep,GLOBSTAR:G.GLOBSTAR})};G.defaults=bRe;G.minimatch.defaults=G.defaults;var RRe=(t,e={})=>((0,ZT.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Qbe.expand)(t,{max:e.braceExpandMax}));G.braceExpand=RRe;G.minimatch.braceExpand=G.braceExpand;var IRe=(t,e={})=>new Ya(t,e).makeRe();G.makeRe=IRe;G.minimatch.makeRe=G.makeRe;var ORe=(t,e,n={})=>{let r=new Ya(e,n);return t=t.filter(o=>r.match(o)),r.options.nonull&&!t.length&&t.push(e),t};G.match=ORe;G.minimatch.match=G.match;var Sq=/[?*]|[+@!]\(.*?\)|\[|\]/,CRe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ya=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,n={}){(0,ZT.assertValidPattern)(e),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=e,this.platform=n.platform||Rq,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,i,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!Sq.test(s[2]))&&!Sq.test(s[3]),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(p=>this.parse(p))];if(d)return[s[0],...s.slice(1).map(p=>this.parse(p))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let o=0;o<e[r].length;o++)e[r][o]==="**"&&(e[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,o)=>{let s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let s=e[o];o===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let o=e[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let a=r[o+1],u=r[o+2],d=r[o+3];if(a!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;n=!0,r.splice(o,1);let p=r.slice(0);p[o]="**",e.push(p),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){let a=r[i];i===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(i,1),i--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let o=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(o){e[n]=[],e[r]=o;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let o=0,s=0,i=[],a="";for(;o<e.length&&s<n.length;)if(e[o]===n[s])i.push(a==="b"?n[s]:e[o]),o++,s++;else if(r&&e[o]==="**"&&n[s]===e[o+1])i.push(e[o]),o++;else if(r&&n[s]==="**"&&e[o]===n[s+1])i.push(n[s]),s++;else if(e[o]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",i.push(e[o]),o++,s++}else if(n[s]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(a==="a")return!1;a="b",i.push(n[s]),o++,s++}else return!1;return e.length===n.length&&i}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let o=0;o<e.length&&e.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let o=0,s=0;if(this.isWindows){let a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),u=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),d=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),p=!d&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),f=u?3:a?0:void 0,m=p?3:d?0:void 0;if(typeof f=="number"&&typeof m=="number"){let[_,h]=[e[f],n[m]];_.toLowerCase()===h.toLowerCase()&&(n[m]=_,s=m,o=f)}}let{optimizationLevel:i=1}=this.options;return i>=2&&(e=this.levelTwoFileOptimize(e)),n.includes(G.GLOBSTAR)?this.#n(e,n,r,o,s):this.#o(e,n,r,o,s)}#n(e,n,r,o,s){let i=n.indexOf(G.GLOBSTAR,s),a=n.lastIndexOf(G.GLOBSTAR),[u,d,p]=r?[n.slice(s,i),n.slice(i+1),[]]:[n.slice(s,i),n.slice(i+1,a),n.slice(a+1)];if(u.length){let A=e.slice(o,o+u.length);if(!this.#o(A,u,r,0,0))return!1;o+=u.length,s+=u.length}let f=0;if(p.length){if(p.length+o>e.length)return!1;let A=e.length-p.length;if(this.#o(e,p,r,A,0))f=p.length;else{if(e[e.length-1]!==""||o+p.length===e.length||(A--,!this.#o(e,p,r,A,0)))return!1;f=p.length+1}}if(!d.length){let A=!!f;for(let R=o;R<e.length-f;R++){let I=String(e[R]);if(A=!0,I==="."||I===".."||!this.options.dot&&I.startsWith("."))return!1}return r||A}let m=[[[],0]],_=m[0],h=0,g=[0];for(let A of d)A===G.GLOBSTAR?(g.push(h),_=[[],0],m.push(_)):(_[0].push(A),h++);let T=m.length-1,S=e.length-f;for(let A of m)A[1]=S-(g[T--]+A[0].length);return!!this.#r(e,m,o,0,r,0,!!f)}#r(e,n,r,o,s,i,a){let u=n[o];if(!u){for(let f=r;f<e.length;f++){a=!0;let m=e[f];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1}return a}let[d,p]=u;for(;r<=p;){if(this.#o(e.slice(0,r+d.length),d,s,r,0)&&i<this.maxGlobstarRecursion){let _=this.#r(e,n,r+d.length,o+1,s,i+1,a);if(_!==!1)return _}let m=e[r];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1;r++}return s||null}#o(e,n,r,o,s){let i,a,u,d;for(i=o,a=s,d=e.length,u=n.length;i<d&&a<u;i++,a++){this.debug("matchOne loop");let p=n[a],f=e[i];if(this.debug(n,p,f),p===!1||p===G.GLOBSTAR)return!1;let m;if(typeof p=="string"?(m=f===p,this.debug("string match",p,f,m)):(m=p.test(f),this.debug("pattern match",p,f,m)),!m)return!1}if(i===d&&a===u)return!0;if(i===d)return r;if(a===u)return i===d-1&&e[i]==="";throw new Error("wtf?")}braceExpand(){return(0,G.braceExpand)(this.pattern,this.options)}parse(e){(0,ZT.assertValidPattern)(e);let n=this.options;if(e==="**")return G.GLOBSTAR;if(e==="")return"";let r,o=null;(r=e.match(lRe))?o=n.dot?pRe:dRe:(r=e.match(eRe))?o=(n.nocase?n.dot?oRe:rRe:n.dot?nRe:tRe)(r[1]):(r=e.match(fRe))?o=(n.nocase?n.dot?_Re:mRe:n.dot?hRe:gRe)(r):(r=e.match(sRe))?o=n.dot?aRe:iRe:(r=e.match(uRe))&&(o=cRe);let s=Aq.AST.fromGlob(e,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?ERe:n.dot?SRe:ARe,o=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let d=u.map(f=>{if(f instanceof RegExp)for(let m of f.flags.split(""))o.add(m);return typeof f=="string"?CRe(f):f===G.GLOBSTAR?G.GLOBSTAR:f._src});d.forEach((f,m)=>{let _=d[m+1],h=d[m-1];f!==G.GLOBSTAR||h===G.GLOBSTAR||(h===void 0?_!==void 0&&_!==G.GLOBSTAR?d[m+1]="(?:\\/|"+r+"\\/)?"+_:d[m]=r:_===void 0?d[m-1]=h+"(?:\\/|\\/"+r+")?":_!==G.GLOBSTAR&&(d[m-1]=h+"(?:\\/|\\/"+r+"\\/)"+_,d[m+1]=G.GLOBSTAR))});let p=d.filter(f=>f!==G.GLOBSTAR);if(this.partial&&p.length>=1){let f=[];for(let m=1;m<=p.length;m++)f.push(p.slice(0,m).join("/"));return"(?:"+f.join("|")+")"}return p.join("/")}).join("|"),[i,a]=e.length>1?["(?:",")"]:["",""];s="^"+i+s+a+"$",this.partial&&(s="^(?:\\/|"+i+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let a=o.length-2;!i&&a>=0;a--)i=o[a];for(let a=0;a<s.length;a++){let u=s[a],d=o;if(r.matchBase&&u.length===1&&(d=[i]),this.matchOne(d,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return G.minimatch.defaults(e).Minimatch}};G.Minimatch=Ya;var NRe=bC();Object.defineProperty(G,"AST",{enumerable:!0,get:function(){return NRe.AST}});var xRe=RC();Object.defineProperty(G,"escape",{enumerable:!0,get:function(){return xRe.escape}});var PRe=YT();Object.defineProperty(G,"unescape",{enumerable:!0,get:function(){return PRe.unescape}});G.minimatch.AST=Aq.AST;G.minimatch.Minimatch=Ya;G.minimatch.escape=Jbe.escape;G.minimatch.unescape=Xbe.unescape});var vq=E((git,CC)=>{"use strict";c();var Oq=B("node:diagnostics_channel"),{context:eE,trace:IC,SpanStatusCode:tE,propagation:OC,diag:MRe}=(M(),x(L)),{getRPCMetadata:vRe,RPCType:kRe}=ye(),{ATTR_HTTP_ROUTE:nE,ATTR_HTTP_RESPONSE_STATUS_CODE:Cq,ATTR_HTTP_REQUEST_METHOD:wRe,ATTR_URL_PATH:LRe}=(fe(),x(Oe)),{InstrumentationBase:DRe}=tq(),{version:URe,name:Nq}=nq(),BRe=">=4.0.0 <6",xq=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],Le={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},Ii={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Es="anonymous",Oi=Symbol("fastify otel instance"),Ci=Symbol("fastify otel request spans"),hf=Symbol("fastify otel request context"),Pq=Symbol("fastify otel addhook original"),Mq=Symbol("fastify otel setnotfound original"),gf=Symbol("fastify otel ignore path"),Tf=Symbol("fastify otel record exceptions"),rE=class extends DRe{logger=null;_requestHook=null;_lifecycleHook=null;constructor(e){if(super(Nq,URe,e),this.logger=MRe.createComponentLogger({namespace:Nq}),this[gf]=null,this[Tf]=!0,e?.recordExceptions!=null){if(typeof e.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[Tf]=e.recordExceptions}if(typeof e?.requestHook=="function"&&(this._requestHook=e.requestHook),typeof e?.lifecycleHook=="function"&&(this._lifecycleHook=e.lifecycleHook),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=null;this[gf]=o=>typeof n=="function"?n(o):(r==null&&(r=Iq().minimatch),r(o.url,n))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=e=>{this.plugin()(e.fastify,void 0,()=>{});let n=(r,o,s)=>{s()};n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",e.fastify.register(n)},Oq.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(Oq.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:BRe,name:"@fastify/otel"},n;function n(r,o,s){r.decorate(Oi,e),r.decorate(Pq,r.addHook),r.decorate(Mq,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let _=this[hf],h=this[Ci];return{enabled:this.routeOptions.config?.otel!==!1,span:h,tracer:e.tracer,context:_,inject:(g,T)=>OC.inject(_,g,T),extract:(g,T)=>OC.extract(_,g,T)}}),r.decorateRequest(Ci,null),r.decorateRequest(hf,null),r.addHook("onRoute",function(_){if(e[gf]?.(_)===!0){e.logger.debug(`Ignoring route instrumentation ${_.method} ${_.url} because it matches the ignore path`);return}if(_.config?.otel===!1){e.logger.debug(`Ignoring route instrumentation ${_.method} ${_.url} because it is disabled`);return}for(let h of xq)if(_[h]!=null){let g=_[h];if(typeof g=="function")_[h]=f(g,h,{[Le.HOOK_NAME]:`${this.pluginName} - route -> ${h}`,[Le.FASTIFY_TYPE]:Ii.ROUTE,[nE]:_.url,[Le.HOOK_CALLBACK_NAME]:g.name?.length>0?g.name:Es});else if(Array.isArray(g)){let T=[];for(let S of g)T.push(f(S,h,{[Le.HOOK_NAME]:`${this.pluginName} - route -> ${h}`,[Le.FASTIFY_TYPE]:Ii.ROUTE,[nE]:_.url,[Le.HOOK_CALLBACK_NAME]:S.name?.length>0?S.name:Es}));_[h]=T}}_.onSend!=null?_.onSend=Array.isArray(_.onSend)?[..._.onSend,i]:[_.onSend,i]:_.onSend=i,_.onError!=null?_.onError=Array.isArray(_.onError)?[..._.onError,a]:[_.onError,a]:_.onError=a,_.handler=f(_.handler,"handler",{[Le.HOOK_NAME]:`${this.pluginName} - route-handler`,[Le.FASTIFY_TYPE]:Ii.HANDLER,[nE]:_.url,[Le.HOOK_CALLBACK_NAME]:_.handler.name.length>0?_.handler.name:Es})}),r.addHook("onRequest",function(_,h,g){if(this[Oi].isEnabled()===!1||_.routeOptions.config?.otel===!1)return g();if(this[Oi][gf]?.({url:_.url,method:_.method})===!0)return this[Oi].logger.debug(`Ignoring request ${_.method} ${_.url} because it matches the ignore path`),g();let T=eE.active();IC.getSpan(T)==null&&(T=OC.extract(T,_.headers));let S=vRe(T);_.routeOptions.url!=null&&S?.type===kRe.HTTP&&(S.route=_.routeOptions.url);let A={[Le.ROOT]:"@fastify/otel",[wRe]:_.method,[LRe]:_.url};_.routeOptions.url!=null&&(A[nE]=_.routeOptions.url);let R=this[Oi].tracer.startSpan("request",{attributes:A},T);try{this[Oi]._requestHook?.(R,_)}catch(I){this[Oi].logger.error({err:I},"requestHook threw")}_[hf]=IC.setSpan(T,R),_[Ci]=R,eE.with(_[hf],()=>{g()})}),r.addHook("onResponse",function(_,h,g){let T=_[Ci];T!=null&&(T.setAttributes({[Cq]:h.statusCode}),T.end()),_[Ci]=null,g()}),r.addHook=u,r.setNotFoundHandler=d,s();function i(m,_,h,g){let T=m[Ci];T!=null&&(_.statusCode>=500&&T.setStatus({code:tE.ERROR}),T.setAttributes({[Cq]:_.statusCode}),T.end()),m[Ci]=null,g(null,h)}function a(m,_,h,g){let T=m[Ci];T!=null&&(T.setStatus({code:tE.ERROR,message:h.message}),e[Tf]!==!1&&T.recordException(h)),g()}function u(m,_){let h=this[Pq];return xq.includes(m)?h.call(this,m,f(_,m,{[Le.HOOK_NAME]:`${this.pluginName} - ${m}`,[Le.FASTIFY_TYPE]:Ii.INSTANCE,[Le.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:Es})):h.call(this,m,_)}function d(m,_){let h=this[Mq];typeof m=="function"?(_=f(m,"notFoundHandler",{[Le.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Le.FASTIFY_TYPE]:Ii.INSTANCE,[Le.HOOK_CALLBACK_NAME]:m.name?.length>0?m.name:Es}),h.call(this,_)):(m.preValidation!=null&&(m.preValidation=f(m.preValidation,"notFoundHandler - preValidation",{[Le.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[Le.FASTIFY_TYPE]:Ii.INSTANCE,[Le.HOOK_CALLBACK_NAME]:m.preValidation.name?.length>0?m.preValidation.name:Es})),m.preHandler!=null&&(m.preHandler=f(m.preHandler,"notFoundHandler - preHandler",{[Le.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[Le.FASTIFY_TYPE]:Ii.INSTANCE,[Le.HOOK_CALLBACK_NAME]:m.preHandler.name?.length>0?m.preHandler.name:Es})),_=f(_,"notFoundHandler",{[Le.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Le.FASTIFY_TYPE]:Ii.INSTANCE,[Le.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:Es}),h.call(this,m,_))}function p(m){for(let _ of m)if(_?.routeOptions&&_.url&&_.method)return _;return null}function f(m,_,h={}){return function(...T){let S=this[Oi],A=p(T);if(A===null)return S.logger.debug(`Ignoring route instrumentation because ${_} was called without a Fastify request argument`),m.call(this,...T);if(S.isEnabled()===!1||A.routeOptions.config?.otel===!1)return S.logger.debug(`Ignoring route instrumentation ${A.routeOptions.method} ${A.routeOptions.url} because it is disabled`),m.call(this,...T);if(S[gf]?.({url:A.url,method:A.method})===!0)return S.logger.debug(`Ignoring route instrumentation ${A.routeOptions.method} ${A.routeOptions.url} because it matches the ignore path`),m.call(this,...T);let R=A[hf]??eE.active(),I=m.name?.length>0?m.name:this.pluginName??Es,O=S.tracer.startSpan(`${_} - ${I}`,{attributes:h},R);if(S._lifecycleHook!=null)try{S._lifecycleHook(O,{hookName:_,request:A,handler:I})}catch(N){S.logger.error({err:N},"Execution of lifecycleHook failed")}return eE.with(IC.setSpan(R,O),function(){try{let N=m.call(this,...T);return typeof N?.then=="function"?N.then(V=>(O.end(),V),V=>(O.setStatus({code:tE.ERROR,message:V.message}),S[Tf]!==!1&&O.recordException(V),O.end(),Promise.reject(V))):(O.end(),N)}catch(N){throw O.setStatus({code:tE.ERROR,message:N.message}),S[Tf]!==!1&&O.recordException(N),O.end(),N}},this)}}}}};CC.exports=rE;CC.exports.FastifyOtelInstrumentation=rE});var PC=E(Zr=>{"use strict";c();Object.defineProperty(Zr,"__esModule",{value:!0});Zr.SpanNames=Zr.TokenKind=Zr.AllowedOperationTypes=void 0;var YRe;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(YRe=Zr.AllowedOperationTypes||(Zr.AllowedOperationTypes={}));var WRe;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(WRe=Zr.TokenKind||(Zr.TokenKind={}));var KRe;(function(t){t.EXECUTE="graphql.execute",t.PARSE="graphql.parse",t.RESOLVE="graphql.resolve",t.VALIDATE="graphql.validate",t.SCHEMA_VALIDATE="graphql.validateSchema",t.SCHEMA_PARSE="graphql.parseSchema"})(KRe=Zr.SpanNames||(Zr.SpanNames={}))});var MC=E(yf=>{"use strict";c();Object.defineProperty(yf,"__esModule",{value:!0});yf.AttributeNames=void 0;var QRe;(function(t){t.SOURCE="graphql.source",t.FIELD_NAME="graphql.field.name",t.FIELD_PATH="graphql.field.path",t.FIELD_TYPE="graphql.field.type",t.PARENT_NAME="graphql.parent.name",t.OPERATION_TYPE="graphql.operation.type",t.OPERATION_NAME="graphql.operation.name",t.VARIABLES="graphql.variables.",t.ERROR_VALIDATION_NAME="graphql.validation.error"})(QRe=yf.AttributeNames||(yf.AttributeNames={}))});var uE=E(hl=>{"use strict";c();Object.defineProperty(hl,"__esModule",{value:!0});hl.OTEL_GRAPHQL_DATA_SYMBOL=hl.OTEL_PATCHED_SYMBOL=void 0;hl.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");hl.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var qq=E(cE=>{"use strict";c();Object.defineProperty(cE,"__esModule",{value:!0});cE.OPERATION_NOT_SUPPORTED=void 0;var zit=uE();cE.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var o5=E(Rt=>{"use strict";c();Object.defineProperty(Rt,"__esModule",{value:!0});Rt.wrapFieldResolver=Rt.wrapFields=Rt.getSourceFromLocation=Rt.getOperation=Rt.endSpan=Rt.addSpanSource=Rt.addInputVariableAttributes=Rt.isPromise=void 0;var gl=(M(),x(L)),Ni=PC(),Ka=MC(),As=uE(),$q=Object.values(Ni.AllowedOperationTypes),JRe=t=>typeof t?.then=="function";Rt.isPromise=JRe;var XRe=t=>typeof t=="object"&&t!==null;function vC(t,e,n){Array.isArray(n)?n.forEach((r,o)=>{vC(t,`${e}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{vC(t,`${e}.${r}`,o)}):t.setAttribute(`${Ka.AttributeNames.VARIABLES}${String(e)}`,n)}function ZRe(t,e){Object.entries(e).forEach(([n,r])=>{vC(t,n,r)})}Rt.addInputVariableAttributes=ZRe;function Kq(t,e,n,r,o){let s=e5(e,n,r,o);t.setAttribute(Ka.AttributeNames.SOURCE,s)}Rt.addSpanSource=Kq;function eIe(t,e,n,r,o){let s=Qq(n,o);if(s)return{field:s,spanAdded:!1};let a=e().flatResolveSpans?Xq(n):Jq(n,o);return s={span:tIe(t,e,n,r,o,a)},oIe(n,o,s),{field:s,spanAdded:!0}}function tIe(t,e,n,r,o,s){let i={[Ka.AttributeNames.FIELD_NAME]:r.fieldName,[Ka.AttributeNames.FIELD_PATH]:o.join("."),[Ka.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[Ka.AttributeNames.PARENT_NAME]:r.parentType.name},a=t.startSpan(`${Ni.SpanNames.RESOLVE} ${i[Ka.AttributeNames.FIELD_PATH]}`,{attributes:i},s?gl.trace.setSpan(gl.context.active(),s):void 0),u=n[As.OTEL_GRAPHQL_DATA_SYMBOL].source,d=r.fieldNodes.find(p=>p.kind==="Field");return d&&Kq(a,u.loc,e().allowValues,d.loc?.start,d.loc?.end),a}function nIe(t,e){e&&t.recordException(e),t.end()}Rt.endSpan=nIe;function rIe(t,e){if(!(!t||!Array.isArray(t.definitions)))return e?t.definitions.filter(n=>$q.indexOf(n?.operation)!==-1).find(n=>e===n?.name?.value):t.definitions.find(n=>$q.indexOf(n?.operation)!==-1)}Rt.getOperation=rIe;function oIe(t,e,n){return t[As.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]=n}function Qq(t,e){return t[As.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]}function Jq(t,e){for(let n=e.length-1;n>0;n--){let r=Qq(t,e.slice(0,n));if(r)return r.span}return Xq(t)}function Xq(t){return t[As.OTEL_GRAPHQL_DATA_SYMBOL].span}function sIe(t,e){let n=[],r=e;for(;r;){let o=r.key;t&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function iIe(t){return Zq(`
|
|
11
11
|
`,t)}function zq(t){return Zq(" ",t)}function Zq(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}var aIe=[Ni.TokenKind.FLOAT,Ni.TokenKind.STRING,Ni.TokenKind.INT,Ni.TokenKind.BLOCK_STRING];function e5(t,e=!1,n,r){let o="";if(t?.startToken){let s=typeof n=="number"?n:t.start,i=typeof r=="number"?r:t.end,a=t.startToken.next,u=1;for(;a;){if(a.start<s){a=a.next,u=a?.line;continue}if(a.end>i){a=a.next,u=a?.line;continue}let d=a.value||a.kind,p="";!e&&aIe.indexOf(a.kind)>=0&&(d="*"),a.kind===Ni.TokenKind.STRING&&(d=`"${d}"`),a.kind===Ni.TokenKind.EOF&&(d=""),a.line>u?(o+=iIe(a.line-u),u=a.line,p=zq(a.column-1)):a.line===a.prev?.line&&(p=zq(a.start-(a.prev?.end||0))),o+=p+d,a&&(a=a.next)}}return o}Rt.getSourceFromLocation=e5;function t5(t,e,n){if(!t||t[As.OTEL_PATCHED_SYMBOL])return;let r=t.getFields();t[As.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let s=r[o];if(s&&(s.resolve&&(s.resolve=r5(e,n,s.resolve)),s.type)){let i=n5(s.type);for(let a of i)t5(a,e,n)}})}Rt.wrapFields=t5;function n5(t){return"ofType"in t?n5(t.ofType):uIe(t)?t.getTypes():cIe(t)?[t]:[]}function uIe(t){return"getTypes"in t&&typeof t.getTypes=="function"}function cIe(t){return"getFields"in t&&typeof t.getFields=="function"}var Yq=(t,e,n)=>{n&&(t.recordException(e),t.setStatus({code:gl.SpanStatusCode.ERROR,message:e.message}),t.end())},Wq=(t,e)=>{e&&t.end()};function r5(t,e,n,r=!1){if(o[As.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(s,i,a,u){if(!n)return;let d=e();if(d.ignoreTrivialResolveSpans&&r&&(XRe(s)||typeof s=="function")&&typeof s[u.fieldName]!="function")return n.call(this,s,i,a,u);if(!a[As.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,s,i,a,u);let p=sIe(d.mergeItems,u&&u.path),f=p.filter(h=>typeof h=="string").length,m,_=!1;if(d.depth>=0&&d.depth<f)m=Jq(a,p);else{let{field:h,spanAdded:g}=eIe(t,e,a,u,p);m=h.span,_=g}return gl.context.with(gl.trace.setSpan(gl.context.active(),m),()=>{try{let h=n.call(this,s,i,a,u);return(0,Rt.isPromise)(h)?h.then(g=>(Wq(m,_),g),g=>{throw Yq(m,g,_),g}):(Wq(m,_),h)}catch(h){throw Yq(m,h,_),h}})}return o[As.OTEL_PATCHED_SYMBOL]=!0,o}Rt.wrapFieldResolver=r5});var s5=E(Tl=>{"use strict";c();Object.defineProperty(Tl,"__esModule",{value:!0});Tl.PACKAGE_NAME=Tl.PACKAGE_VERSION=void 0;Tl.PACKAGE_VERSION="0.62.0";Tl.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var u5=E(pE=>{"use strict";c();Object.defineProperty(pE,"__esModule",{value:!0});pE.GraphQLInstrumentation=void 0;var ys=(M(),x(L)),Or=se(),bf=PC(),lE=MC(),kC=uE(),lIe=qq(),cn=o5(),i5=s5(),a5={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},dE=[">=14.0.0 <17"],wC=class extends Or.InstrumentationBase{constructor(e={}){super(i5.PACKAGE_NAME,i5.PACKAGE_VERSION,{...a5,...e})}setConfig(e={}){super.setConfig({...a5,...e})}init(){let e=new Or.InstrumentationNodeModuleDefinition("graphql",dE);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new Or.InstrumentationNodeModuleFile("graphql/execution/execute.js",dE,e=>((0,Or.isWrapped)(e.execute)&&this._unwrap(e,"execute"),this._wrap(e,"execute",this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,"execute")})}_addPatchingParser(){return new Or.InstrumentationNodeModuleFile("graphql/language/parser.js",dE,e=>((0,Or.isWrapped)(e.parse)&&this._unwrap(e,"parse"),this._wrap(e,"parse",this._patchParse()),e),e=>{e&&this._unwrap(e,"parse")})}_addPatchingValidate(){return new Or.InstrumentationNodeModuleFile("graphql/validation/validate.js",dE,e=>((0,Or.isWrapped)(e.validate)&&this._unwrap(e,"validate"),this._wrap(e,"validate",this._patchValidate()),e),e=>{e&&this._unwrap(e,"validate")})}_patchExecute(e){let n=this;return function(o){return function(){let i;if(arguments.length>=2){let d=arguments;i=n._wrapExecuteArgs(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],e)}else{let d=arguments[0];i=n._wrapExecuteArgs(d.schema,d.document,d.rootValue,d.contextValue,d.variableValues,d.operationName,d.fieldResolver,d.typeResolver,e)}let a=(0,cn.getOperation)(i.document,i.operationName),u=n._createExecuteSpan(a,i);return i.contextValue[kC.OTEL_GRAPHQL_DATA_SYMBOL]={source:i.document?i.document||i.document[kC.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:u,fields:{}},ys.context.with(ys.trace.setSpan(ys.context.active(),u),()=>(0,Or.safeExecuteInTheMiddle)(()=>o.apply(this,[i]),(d,p)=>{n._handleExecutionResult(u,d,p)}))}}}_handleExecutionResult(e,n,r){let o=this.getConfig();if(r===void 0||n){(0,cn.endSpan)(e,n);return}if((0,cn.isPromise)(r))r.then(s=>{if(typeof o.responseHook!="function"){(0,cn.endSpan)(e);return}this._executeResponseHook(e,s)},s=>{(0,cn.endSpan)(e,s)});else{if(typeof o.responseHook!="function"){(0,cn.endSpan)(e);return}this._executeResponseHook(e,r)}}_executeResponseHook(e,n){let{responseHook:r}=this.getConfig();r&&(0,Or.safeExecuteInTheMiddle)(()=>{r(e,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,cn.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(r){return function(s,i){return e._parse(this,r,s,i)}}}_patchValidate(){let e=this;return function(r){return function(s,i,a,u,d){return e._validate(this,r,s,i,a,d,u)}}}_parse(e,n,r,o){let s=this.getConfig(),i=this.tracer.startSpan(bf.SpanNames.PARSE);return ys.context.with(ys.trace.setSpan(ys.context.active(),i),()=>(0,Or.safeExecuteInTheMiddle)(()=>n.call(e,r,o),(a,u)=>{u&&((0,cn.getOperation)(u)?u.loc&&(0,cn.addSpanSource)(i,u.loc,s.allowValues):i.updateName(bf.SpanNames.SCHEMA_PARSE)),(0,cn.endSpan)(i,a)}))}_validate(e,n,r,o,s,i,a){let u=this.tracer.startSpan(bf.SpanNames.VALIDATE,{});return ys.context.with(ys.trace.setSpan(ys.context.active(),u),()=>(0,Or.safeExecuteInTheMiddle)(()=>n.call(e,r,o,s,a,i),(d,p)=>{o.loc||u.updateName(bf.SpanNames.SCHEMA_VALIDATE),p&&p.length&&u.recordException({name:lE.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(p)}),(0,cn.endSpan)(u,d)}))}_createExecuteSpan(e,n){let r=this.getConfig(),o=this.tracer.startSpan(bf.SpanNames.EXECUTE,{});if(e){let{operation:s,name:i}=e;o.setAttribute(lE.AttributeNames.OPERATION_TYPE,s);let a=i?.value;a?(o.setAttribute(lE.AttributeNames.OPERATION_NAME,a),o.updateName(`${s} ${a}`)):o.updateName(s)}else{let s=" ";n.operationName&&(s=` "${n.operationName}" `),s=lIe.OPERATION_NOT_SUPPORTED.replace("$operationName$",s),o.setAttribute(lE.AttributeNames.OPERATION_NAME,s)}return n.document?.loc&&(0,cn.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,cn.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(e,n,r,o,s,i,a,u,d){if(o||(o={}),o[kC.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:u};let p=a==null,f=a??d;return a=(0,cn.wrapFieldResolver)(this.tracer,()=>this.getConfig(),f,p),e&&((0,cn.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,cn.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:u}}};pE.GraphQLInstrumentation=wC});var c5=E(fE=>{"use strict";c();Object.defineProperty(fE,"__esModule",{value:!0});fE.GraphQLInstrumentation=void 0;var dIe=u5();Object.defineProperty(fE,"GraphQLInstrumentation",{enumerable:!0,get:function(){return dIe.GraphQLInstrumentation}})});var _5=E(mE=>{"use strict";c();Object.defineProperty(mE,"__esModule",{value:!0});mE.EVENT_LISTENERS_SET=void 0;mE.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var h5=E(_E=>{"use strict";c();Object.defineProperty(_E,"__esModule",{value:!0});_E.bufferTextMapGetter=void 0;_E.bufferTextMapGetter={get(t,e){if(!t)return;let n=Object.keys(t);for(let r of n)if(r===e||r.toLowerCase()===e)return t[r]?.toString()},keys(t){return t?Object.keys(t):[]}}});var g5=E(Ee=>{"use strict";c();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.METRIC_MESSAGING_PROCESS_DURATION=Ee.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=Ee.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=Ee.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=Ee.MESSAGING_SYSTEM_VALUE_KAFKA=Ee.MESSAGING_OPERATION_TYPE_VALUE_SEND=Ee.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=Ee.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=Ee.ATTR_MESSAGING_SYSTEM=Ee.ATTR_MESSAGING_OPERATION_TYPE=Ee.ATTR_MESSAGING_OPERATION_NAME=Ee.ATTR_MESSAGING_KAFKA_OFFSET=Ee.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=Ee.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=Ee.ATTR_MESSAGING_DESTINATION_PARTITION_ID=Ee.ATTR_MESSAGING_DESTINATION_NAME=Ee.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;Ee.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";Ee.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";Ee.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";Ee.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";Ee.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";Ee.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";Ee.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";Ee.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";Ee.ATTR_MESSAGING_SYSTEM="messaging.system";Ee.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";Ee.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";Ee.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";Ee.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";Ee.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";Ee.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";Ee.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";Ee.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var T5=E(El=>{"use strict";c();Object.defineProperty(El,"__esModule",{value:!0});El.PACKAGE_NAME=El.PACKAGE_VERSION=void 0;El.PACKAGE_VERSION="0.23.0";El.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var R5=E(gE=>{"use strict";c();Object.defineProperty(gE,"__esModule",{value:!0});gE.KafkaJsInstrumentation=void 0;var Ne=(M(),x(L)),Cr=se(),Sl=(fe(),x(Oe)),E5=_5(),S5=h5(),j=g5(),A5=T5();function hE(t,e,n){return r=>{t.add(e,{...n,...r?{[Sl.ATTR_ERROR_TYPE]:r}:{}})}}function y5(t,e,n){return r=>{t.record((Date.now()-e)/1e3,{...n,...r?{[Sl.ATTR_ERROR_TYPE]:r}:{}})}}var b5=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],LC=class extends Cr.InstrumentationBase{constructor(e={}){super(A5.PACKAGE_NAME,A5.PACKAGE_VERSION,e)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(j.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:b5}}),this._sentMessages=this.meter.createCounter(j.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(j.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(j.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:b5}})}init(){let e=r=>{(0,Cr.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,Cr.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new Cr.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(e(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),e)}_getConsumerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Cr.isWrapped)(s.run)&&e._unwrap(s,"run"),e._wrap(s,"run",e._getConsumerRunPatch()),e._setKafkaEventListeners(s),s}}_setKafkaEventListeners(e){e[E5.EVENT_LISTENERS_SET]||(e.events?.REQUEST&&e.on(e.events.REQUEST,this._recordClientDurationMetric.bind(this)),e[E5.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(e){let[n,r]=e.payload.broker.split(":");this._clientDuration.record(e.payload.duration/1e3,{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_OPERATION_NAME]:`${e.payload.apiName}`,[Sl.ATTR_SERVER_ADDRESS]:n,[Sl.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Cr.isWrapped)(s.sendBatch)&&e._unwrap(s,"sendBatch"),e._wrap(s,"sendBatch",e._getSendBatchPatch()),(0,Cr.isWrapped)(s.send)&&e._unwrap(s,"send"),e._wrap(s,"send",e._getSendPatch()),(0,Cr.isWrapped)(s.transaction)&&e._unwrap(s,"transaction"),e._wrap(s,"transaction",e._getProducerTransactionPatch()),e._setKafkaEventListeners(s),s}}_getConsumerRunPatch(){let e=this;return n=>function(...o){let s=o[0];return s?.eachMessage&&((0,Cr.isWrapped)(s.eachMessage)&&e._unwrap(s,"eachMessage"),e._wrap(s,"eachMessage",e._getConsumerEachMessagePatch())),s?.eachBatch&&((0,Cr.isWrapped)(s.eachBatch)&&e._unwrap(s,"eachBatch"),e._wrap(s,"eachBatch",e._getConsumerEachBatchPatch())),n.call(this,s)}}_getConsumerEachMessagePatch(){let e=this;return n=>function(...o){let s=o[0],i=Ne.propagation.extract(Ne.ROOT_CONTEXT,s.message.headers,S5.bufferTextMapGetter),a=e._startConsumerSpan({topic:s.topic,message:s.message,operationType:j.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:i,attributes:{[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}}),u=[y5(e._processDuration,Date.now(),{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_OPERATION_NAME]:"process",[j.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}),hE(e._consumedMessages,1,{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_OPERATION_NAME]:"process",[j.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)})],d=Ne.context.with(Ne.trace.setSpan(i,a),()=>n.apply(this,o));return e._endSpansOnPromise([a],u,d)}}_getConsumerEachBatchPatch(){return e=>{let n=this;return function(...o){let s=o[0],i=n._startConsumerSpan({topic:s.batch.topic,message:void 0,operationType:j.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:Ne.ROOT_CONTEXT,attributes:{[j.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:s.batch.messages.length,[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}});return Ne.context.with(Ne.trace.setSpan(Ne.context.active(),i),()=>{let a=Date.now(),u=[],d=[hE(n._consumedMessages,s.batch.messages.length,{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_OPERATION_NAME]:"process",[j.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)})];s.batch.messages.forEach(f=>{let m=Ne.propagation.extract(Ne.ROOT_CONTEXT,f.headers,S5.bufferTextMapGetter),_=Ne.trace.getSpan(m)?.spanContext(),h;_&&(h={context:_}),u.push(n._startConsumerSpan({topic:s.batch.topic,message:f,operationType:j.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:h,attributes:{[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}})),d.push(y5(n._processDuration,a,{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_OPERATION_NAME]:"process",[j.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}))});let p=e.apply(this,o);return u.unshift(i),n._endSpansOnPromise(u,d,p)})}}}_getProducerTransactionPatch(){let e=this;return n=>function(...o){let s=e.tracer.startSpan("transaction"),i=n.apply(this,o);return i.then(a=>{let u=a.send;a.send=function(..._){return Ne.context.with(Ne.trace.setSpan(Ne.context.active(),s),()=>e._getSendPatch()(u).apply(this,_).catch(g=>{throw s.setStatus({code:Ne.SpanStatusCode.ERROR,message:g?.message}),s.recordException(g),g}))};let d=a.sendBatch;a.sendBatch=function(..._){return Ne.context.with(Ne.trace.setSpan(Ne.context.active(),s),()=>e._getSendBatchPatch()(d).apply(this,_).catch(g=>{throw s.setStatus({code:Ne.SpanStatusCode.ERROR,message:g?.message}),s.recordException(g),g}))};let p=a.commit;a.commit=function(..._){let h=p.apply(this,_).then(()=>{s.setStatus({code:Ne.SpanStatusCode.OK})});return e._endSpansOnPromise([s],[],h)};let f=a.abort;a.abort=function(..._){let h=f.apply(this,_);return e._endSpansOnPromise([s],[],h)}}).catch(a=>{s.setStatus({code:Ne.SpanStatusCode.ERROR,message:a?.message}),s.recordException(a),s.end()}),i}}_getSendBatchPatch(){let e=this;return n=>function(...o){let i=o[0].topicMessages||[],a=[],u=[];i.forEach(p=>{p.messages.forEach(f=>{a.push(e._startProducerSpan(p.topic,f)),u.push(hE(e._sentMessages,1,{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_OPERATION_NAME]:"send",[j.ATTR_MESSAGING_DESTINATION_NAME]:p.topic,...f.partition!==void 0?{[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(f.partition)}:{}}))})});let d=n.apply(this,o);return e._endSpansOnPromise(a,u,d)}}_getSendPatch(){let e=this;return n=>function(...o){let s=o[0],i=s.messages.map(d=>e._startProducerSpan(s.topic,d)),a=s.messages.map(d=>hE(e._sentMessages,1,{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_OPERATION_NAME]:"send",[j.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,...d.partition!==void 0?{[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(d.partition)}:{}})),u=n.apply(this,o);return e._endSpansOnPromise(i,a,u)}}_endSpansOnPromise(e,n,r){return Promise.resolve(r).then(o=>(n.forEach(s=>s()),o)).catch(o=>{let s,i=Sl.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?s=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(s=o.message,i=o.constructor.name),n.forEach(a=>a(i)),e.forEach(a=>{a.setAttribute(Sl.ATTR_ERROR_TYPE,i),a.setStatus({code:Ne.SpanStatusCode.ERROR,message:s})}),o}).finally(()=>{e.forEach(o=>o.end())})}_startConsumerSpan({topic:e,message:n,operationType:r,ctx:o,link:s,attributes:i}){let a=r===j.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,u=this.tracer.startSpan(`${a} ${e}`,{kind:r===j.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?Ne.SpanKind.CLIENT:Ne.SpanKind.CONSUMER,attributes:{...i,[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_DESTINATION_NAME]:e,[j.ATTR_MESSAGING_OPERATION_TYPE]:r,[j.ATTR_MESSAGING_OPERATION_NAME]:a,[j.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[j.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[j.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:s?[s]:[]},o),{consumerHook:d}=this.getConfig();return d&&n&&(0,Cr.safeExecuteInTheMiddle)(()=>d(u,{topic:e,message:n}),p=>{p&&this._diag.error("consumerHook error",p)},!0),u}_startProducerSpan(e,n){let r=this.tracer.startSpan(`send ${e}`,{kind:Ne.SpanKind.PRODUCER,attributes:{[j.ATTR_MESSAGING_SYSTEM]:j.MESSAGING_SYSTEM_VALUE_KAFKA,[j.ATTR_MESSAGING_DESTINATION_NAME]:e,[j.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[j.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[j.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[j.ATTR_MESSAGING_OPERATION_NAME]:"send",[j.ATTR_MESSAGING_OPERATION_TYPE]:j.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},Ne.propagation.inject(Ne.trace.setSpan(Ne.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,Cr.safeExecuteInTheMiddle)(()=>o(r,{topic:e,message:n}),s=>{s&&this._diag.error("producerHook error",s)},!0),r}};gE.KafkaJsInstrumentation=LC});var I5=E(TE=>{"use strict";c();Object.defineProperty(TE,"__esModule",{value:!0});TE.KafkaJsInstrumentation=void 0;var mIe=R5();Object.defineProperty(TE,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return mIe.KafkaJsInstrumentation}})});var P5=E(Al=>{"use strict";c();Object.defineProperty(Al,"__esModule",{value:!0});Al.PACKAGE_NAME=Al.PACKAGE_VERSION=void 0;Al.PACKAGE_VERSION="0.58.0";Al.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var w5=E(EE=>{"use strict";c();Object.defineProperty(EE,"__esModule",{value:!0});EE.LruMemoizerInstrumentation=void 0;var M5=(M(),x(L)),v5=se(),k5=P5(),DC=class extends v5.InstrumentationBase{constructor(e={}){super(k5.PACKAGE_NAME,k5.PACKAGE_VERSION,e)}init(){return[new v5.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],e=>{let n=function(){let r=e.apply(this,arguments);return function(){let o=[...arguments],s=o.pop(),i=typeof s=="function"?M5.context.bind(M5.context.active(),s):s;return o.push(i),r.apply(this,o)}};return n.sync=e.sync,n},void 0)]}};EE.LruMemoizerInstrumentation=DC});var L5=E(SE=>{"use strict";c();Object.defineProperty(SE,"__esModule",{value:!0});SE.LruMemoizerInstrumentation=void 0;var hIe=w5();Object.defineProperty(SE,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return hIe.LruMemoizerInstrumentation}})});var G5=E(Ge=>{"use strict";c();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Ge.DB_SYSTEM_VALUE_MONGODB=Ge.DB_SYSTEM_NAME_VALUE_MONGODB=Ge.ATTR_NET_PEER_PORT=Ge.ATTR_NET_PEER_NAME=Ge.ATTR_DB_SYSTEM=Ge.ATTR_DB_STATEMENT=Ge.ATTR_DB_OPERATION=Ge.ATTR_DB_NAME=Ge.ATTR_DB_MONGODB_COLLECTION=Ge.ATTR_DB_CONNECTION_STRING=void 0;Ge.ATTR_DB_CONNECTION_STRING="db.connection_string";Ge.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Ge.ATTR_DB_NAME="db.name";Ge.ATTR_DB_OPERATION="db.operation";Ge.ATTR_DB_STATEMENT="db.statement";Ge.ATTR_DB_SYSTEM="db.system";Ge.ATTR_NET_PEER_NAME="net.peer.name";Ge.ATTR_NET_PEER_PORT="net.peer.port";Ge.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";Ge.DB_SYSTEM_VALUE_MONGODB="mongodb";Ge.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var j5=E(Rf=>{"use strict";c();Object.defineProperty(Rf,"__esModule",{value:!0});Rf.MongodbCommandType=void 0;var TIe;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.AGGREGATE="aggregate",t.UNKNOWN="unknown"})(TIe=Rf.MongodbCommandType||(Rf.MongodbCommandType={}))});var H5=E(yl=>{"use strict";c();Object.defineProperty(yl,"__esModule",{value:!0});yl.PACKAGE_NAME=yl.PACKAGE_VERSION=void 0;yl.PACKAGE_VERSION="0.67.0";yl.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var $5=E(AE=>{"use strict";c();Object.defineProperty(AE,"__esModule",{value:!0});AE.MongoDBInstrumentation=void 0;var He=(M(),x(L)),Se=se(),bs=(fe(),x(Oe)),or=G5(),Qa=j5(),V5=H5(),q5={requireParentSpan:!0},UC=class t extends Se.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(V5.PACKAGE_NAME,V5.PACKAGE_VERSION,{...q5,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Se.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Se.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...q5,...e})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(or.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsage?.add(e,{"pool.name":n,state:r})}init(){let{v3PatchConnection:e,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:s,v4PatchConnectionPromise:i,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:u,v4UnpatchConnectionPool:d}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:p,v4UnpatchSessions:f}=this._getV4SessionsPatches();return[new Se.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new Se.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],e,n)]),new Se.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new Se.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],s,a),new Se.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],i,a),new Se.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],u,d),new Se.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new Se.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],p,f)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,Se.isWrapped)(e.insert)&&this._unwrap(e,"insert"),this._wrap(e,"insert",this._getV3PatchOperation("insert")),(0,Se.isWrapped)(e.remove)&&this._unwrap(e,"remove"),this._wrap(e,"remove",this._getV3PatchOperation("remove")),(0,Se.isWrapped)(e.update)&&this._unwrap(e,"update"),this._wrap(e,"update",this._getV3PatchOperation("update")),(0,Se.isWrapped)(e.command)&&this._unwrap(e,"command"),this._wrap(e,"command",this._getV3PatchCommand()),(0,Se.isWrapped)(e.query)&&this._unwrap(e,"query"),this._wrap(e,"query",this._getV3PatchFind()),(0,Se.isWrapped)(e.getMore)&&this._unwrap(e,"getMore"),this._wrap(e,"getMore",this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,"insert"),this._unwrap(e,"remove"),this._unwrap(e,"update"),this._unwrap(e,"command"),this._unwrap(e,"query"),this._unwrap(e,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,Se.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),this._wrap(e.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,Se.isWrapped)(e.release)&&this._unwrap(e,"release"),this._wrap(e.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,Se.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),(0,Se.isWrapped)(e.release)&&this._unwrap(e,"release"))}}}_getV4AcquireCommand(){let e=this;return n=>function(){let o=this.sessions.length,s=n.call(this),i=this.sessions.length;return o===i?e._connCountAdd(1,e._poolName,"used"):o-1===i&&(e._connCountAdd(-1,e._poolName,"idle"),e._connCountAdd(1,e._poolName,"used")),s}}_getV4ReleaseCommand(){let e=this;return n=>function(o){let s=n.call(this,o);return e._connCountAdd(-1,e._poolName,"used"),e._connCountAdd(1,e._poolName,"idle"),s}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let n=e.ConnectionPool.prototype;return(0,Se.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,Se.isWrapped)(e.connect)&&this._unwrap(e,"connect"),this._wrap(e,"connect",this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,"connect")}}}_getV4ConnectionPoolCheckOut(){return e=>function(r){let o=He.context.bind(He.context.active(),r);return e.call(this,o)}}_getV4ConnectCommand(){let e=this;return n=>function(o,s){if(n.length===1){let a=n.call(this,o);return a&&typeof a.then=="function"&&a.then(()=>e.setPoolName(o),()=>{}),a}let i=function(a,u){if(a||!u){s(a,u);return}e.setPoolName(o),s(a,u)};return n.call(this,o,i)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,Se.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,Se.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,"command")}}}_getV3PatchOperation(e){let n=this;return r=>function(s,i,a,u,d){let p=He.trace.getSpan(He.context.active()),f=n._checkSkipInstrumentation(p),m=typeof u=="function"?u:d;if(f||typeof m!="function"||typeof a!="object")return typeof u=="function"?r.call(this,s,i,a,u):r.call(this,s,i,a,u,d);let _=n._getV3SpanAttributes(i,s,a[0],e),h=n._spanNameFromAttrs(_),g=n.tracer.startSpan(h,{kind:He.SpanKind.CLIENT,attributes:_}),T=n._patchEnd(g,m);return typeof u=="function"?r.call(this,s,i,a,T):r.call(this,s,i,a,u,T)}}_getV3PatchCommand(){let e=this;return n=>function(o,s,i,a,u){let d=He.trace.getSpan(He.context.active()),p=e._checkSkipInstrumentation(d),f=typeof a=="function"?a:u;if(p||typeof f!="function"||typeof i!="object")return typeof a=="function"?n.call(this,o,s,i,a):n.call(this,o,s,i,a,u);let m=t._getCommandType(i),_=m===Qa.MongodbCommandType.UNKNOWN?void 0:m,h=e._getV3SpanAttributes(s,o,i,_),g=e._spanNameFromAttrs(h),T=e.tracer.startSpan(g,{kind:He.SpanKind.CLIENT,attributes:h}),S=e._patchEnd(T,f);return typeof a=="function"?n.call(this,o,s,i,S):n.call(this,o,s,i,a,S)}}_getV4PatchCommandCallback(){let e=this;return n=>function(o,s,i,a){let u=He.trace.getSpan(He.context.active()),d=e._checkSkipInstrumentation(u),p=a,f=Object.keys(s)[0];if(typeof s!="object"||s.ismaster||s.hello)return n.call(this,o,s,i,a);let m;if(!d){let h=e._getV4SpanAttributes(this,o,s,f),g=e._spanNameFromAttrs(h);m=e.tracer.startSpan(g,{kind:He.SpanKind.CLIENT,attributes:h})}let _=e._patchEnd(m,p,this.id,f);return n.call(this,o,s,i,_)}}_getV4PatchCommandPromise(){let e=this;return n=>function(...o){let[s,i]=o,a=He.trace.getSpan(He.context.active()),u=e._checkSkipInstrumentation(a),d=Object.keys(i)[0],p=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return n.apply(this,o);let f;if(!u){let h=e._getV4SpanAttributes(this,s,i,d),g=e._spanNameFromAttrs(h);f=e.tracer.startSpan(g,{kind:He.SpanKind.CLIENT,attributes:h})}let m=e._patchEnd(f,p,this.id,d),_=n.apply(this,o);return _.then(h=>m(null,h),h=>m(h)),_}}_getV3PatchFind(){let e=this;return n=>function(o,s,i,a,u,d){let p=He.trace.getSpan(He.context.active()),f=e._checkSkipInstrumentation(p),m=typeof u=="function"?u:d;if(f||typeof m!="function"||typeof i!="object")return typeof u=="function"?n.call(this,o,s,i,a,u):n.call(this,o,s,i,a,u,d);let _=e._getV3SpanAttributes(s,o,i,"find"),h=e._spanNameFromAttrs(_),g=e.tracer.startSpan(h,{kind:He.SpanKind.CLIENT,attributes:_}),T=e._patchEnd(g,m);return typeof u=="function"?n.call(this,o,s,i,a,T):n.call(this,o,s,i,a,u,T)}}_getV3PatchCursor(){let e=this;return n=>function(o,s,i,a,u,d){let p=He.trace.getSpan(He.context.active()),f=e._checkSkipInstrumentation(p),m=typeof u=="function"?u:d;if(f||typeof m!="function")return typeof u=="function"?n.call(this,o,s,i,a,u):n.call(this,o,s,i,a,u,d);let _=e._getV3SpanAttributes(s,o,i.cmd,"getMore"),h=e._spanNameFromAttrs(_),g=e.tracer.startSpan(h,{kind:He.SpanKind.CLIENT,attributes:_}),T=e._patchEnd(g,m);return typeof u=="function"?n.call(this,o,s,i,a,T):n.call(this,o,s,i,a,u,T)}}static _getCommandType(e){return e.createIndexes!==void 0?Qa.MongodbCommandType.CREATE_INDEXES:e.findandmodify!==void 0?Qa.MongodbCommandType.FIND_AND_MODIFY:e.ismaster!==void 0?Qa.MongodbCommandType.IS_MASTER:e.count!==void 0?Qa.MongodbCommandType.COUNT:e.aggregate!==void 0?Qa.MongodbCommandType.AGGREGATE:Qa.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(e,n,r,o){let s,i;if(e){let u=typeof e.address=="string"?e.address.split(":"):"";u.length===2&&(s=u[0],i=u[1])}let a;return r?.documents&&r.documents[0]?a=r.documents[0]:r?.cursors?a=r.cursors:a=r,this._getSpanAttributes(n.db,n.collection,s,i,a,o)}_getV3SpanAttributes(e,n,r,o){let s,i;if(n&&n.s&&(s=n.s.options?.host??n.s.host,i=(n.s.options?.port??n.s.port)?.toString(),s==null||i==null)){let p=n.description?.address;if(p){let f=p.split(":");s=f[0],i=f[1]}}let[a,u]=e.toString().split("."),d=r?.query??r?.q??r;return this._getSpanAttributes(a,u,s,i,d,o)}_getSpanAttributes(e,n,r,o,s,i){let a={};if(this._dbSemconvStability&Se.SemconvStability.OLD&&(a[or.ATTR_DB_SYSTEM]=or.DB_SYSTEM_VALUE_MONGODB,a[or.ATTR_DB_NAME]=e,a[or.ATTR_DB_MONGODB_COLLECTION]=n,a[or.ATTR_DB_OPERATION]=i,a[or.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${e}`),this._dbSemconvStability&Se.SemconvStability.STABLE&&(a[bs.ATTR_DB_SYSTEM_NAME]=or.DB_SYSTEM_NAME_VALUE_MONGODB,a[bs.ATTR_DB_NAMESPACE]=e,a[bs.ATTR_DB_OPERATION_NAME]=i,a[bs.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&Se.SemconvStability.OLD&&(a[or.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&Se.SemconvStability.STABLE&&(a[bs.ATTR_SERVER_ADDRESS]=r);let u=parseInt(o,10);isNaN(u)||(this._netSemconvStability&Se.SemconvStability.OLD&&(a[or.ATTR_NET_PEER_PORT]=u),this._netSemconvStability&Se.SemconvStability.STABLE&&(a[bs.ATTR_SERVER_PORT]=u))}if(s){let{dbStatementSerializer:u}=this.getConfig(),d=typeof u=="function"?u:this._defaultDbStatementSerializer.bind(this);(0,Se.safeExecuteInTheMiddle)(()=>{let p=d(s);this._dbSemconvStability&Se.SemconvStability.OLD&&(a[or.ATTR_DB_STATEMENT]=p),this._dbSemconvStability&Se.SemconvStability.STABLE&&(a[bs.ATTR_DB_QUERY_TEXT]=p)},p=>{p&&this._diag.error("Error running dbStatementSerializer hook",p)},!0)}return a}_spanNameFromAttrs(e){let n;return this._dbSemconvStability&Se.SemconvStability.STABLE?n=[e[bs.ATTR_DB_OPERATION_NAME],e[bs.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||or.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${e[or.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let e=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":e.has(r)?"[Circular]":(e.add(r),r)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(e):JSON.stringify(e,this._getDefaultDbStatementReplacer())}_handleExecutionResult(e,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,Se.safeExecuteInTheMiddle)(()=>{r(e,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(e,n,r,o){let s=He.context.active(),i=this,a=!1;return function(...d){if(!a){a=!0;let p=d[0];if(e){if(p instanceof Error)e.setStatus({code:He.SpanStatusCode.ERROR,message:p.message});else{let f=d[1];i._handleExecutionResult(e,f)}e.end()}o==="endSessions"&&i._connCountAdd(-1,i._poolName,"idle")}return He.context.with(s,()=>n.apply(this,d))}}setPoolName(e){let n=e.hostAddress?.host,r=e.hostAddress?.port,o=e.dbName,s=`mongodb://${n}:${r}/${o}`;this._poolName=s}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}};AE.MongoDBInstrumentation=UC});var z5=E(If=>{"use strict";c();Object.defineProperty(If,"__esModule",{value:!0});If.MongodbCommandType=void 0;var EIe;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.UNKNOWN="unknown"})(EIe=If.MongodbCommandType||(If.MongodbCommandType={}))});var Y5=E(bl=>{"use strict";c();Object.defineProperty(bl,"__esModule",{value:!0});bl.MongodbCommandType=bl.MongoDBInstrumentation=void 0;var SIe=$5();Object.defineProperty(bl,"MongoDBInstrumentation",{enumerable:!0,get:function(){return SIe.MongoDBInstrumentation}});var AIe=z5();Object.defineProperty(bl,"MongodbCommandType",{enumerable:!0,get:function(){return AIe.MongodbCommandType}})});var FC=E(ht=>{"use strict";c();Object.defineProperty(ht,"__esModule",{value:!0});ht.DB_SYSTEM_NAME_VALUE_MONGODB=ht.ATTR_NET_PEER_PORT=ht.ATTR_NET_PEER_NAME=ht.ATTR_DB_USER=ht.ATTR_DB_SYSTEM=ht.ATTR_DB_STATEMENT=ht.ATTR_DB_OPERATION=ht.ATTR_DB_NAME=ht.ATTR_DB_MONGODB_COLLECTION=void 0;ht.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";ht.ATTR_DB_NAME="db.name";ht.ATTR_DB_OPERATION="db.operation";ht.ATTR_DB_STATEMENT="db.statement";ht.ATTR_DB_SYSTEM="db.system";ht.ATTR_DB_USER="db.user";ht.ATTR_NET_PEER_NAME="net.peer.name";ht.ATTR_NET_PEER_PORT="net.peer.port";ht.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var e$=E(xi=>{"use strict";c();Object.defineProperty(xi,"__esModule",{value:!0});xi.handleCallbackResponse=xi.handlePromiseResponse=xi.getAttributesFromCollection=void 0;var X5=(M(),x(L)),Cf=se(),Of=FC(),yE=(fe(),x(Oe));function CIe(t,e,n){let r={};return e&Cf.SemconvStability.OLD&&(r[Of.ATTR_DB_MONGODB_COLLECTION]=t.name,r[Of.ATTR_DB_NAME]=t.conn.name,r[Of.ATTR_DB_USER]=t.conn.user),e&Cf.SemconvStability.STABLE&&(r[yE.ATTR_DB_COLLECTION_NAME]=t.name,r[yE.ATTR_DB_NAMESPACE]=t.conn.name),n&Cf.SemconvStability.OLD&&(r[Of.ATTR_NET_PEER_NAME]=t.conn.host,r[Of.ATTR_NET_PEER_PORT]=t.conn.port),n&Cf.SemconvStability.STABLE&&(r[yE.ATTR_SERVER_ADDRESS]=t.conn.host,r[yE.ATTR_SERVER_PORT]=t.conn.port),r}xi.getAttributesFromCollection=CIe;function Z5(t,e={}){t.recordException(e),t.setStatus({code:X5.SpanStatusCode.ERROR,message:`${e.message} ${e.code?`
|
|
12
|
-
Mongoose Error Code: ${e.code}`:""}`})}function GC(t,e,n,r=void 0){n&&(0,Cf.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&X5.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function NIe(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(GC(e,o,n,r),o)).catch(o=>{throw Z5(e,o),o}).finally(()=>e.end()):(GC(e,t,n,r),e.end(),t)}xi.handlePromiseResponse=NIe;function xIe(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(u,d)=>(u?Z5(r,u):GC(r,d,s,i),r.end(),t(u,d)),e.apply(n,o)}xi.handleCallbackResponse=xIe});var t$=E(Rl=>{"use strict";c();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.PACKAGE_NAME=Rl.PACKAGE_VERSION=void 0;Rl.PACKAGE_VERSION="0.60.0";Rl.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var i$=E(Fn=>{"use strict";c();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.MongooseInstrumentation=Fn._ALREADY_INSTRUMENTED=Fn._STORED_PARENT_SPAN=void 0;var It=(M(),x(L)),PIe=ye(),jC=e$(),Jt=se(),n$=t$(),Pi=FC(),Ja=(fe(),x(Oe)),bE=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],MIe=["remove","count","findOneAndRemove",...bE],vIe=["count","findOneAndRemove",...bE],kIe=[...bE];function r$(t){return t?t.startsWith("6.")||t.startsWith("5.")?MIe:t.startsWith("7.")?vIe:kIe:bE}function o$(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function s$(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}Fn._STORED_PARENT_SPAN=Symbol("stored-parent-span");Fn._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var HC=class extends Jt.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(n$.PACKAGE_NAME,n$.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Jt.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Jt.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Jt.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,o$(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),s$(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)),r$(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=r$(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,o$(n)&&this._unwrap(r.Model.prototype,"remove"),s$(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return r.apply(this,arguments);let i=this[Fn._STORED_PARENT_SPAN],a={},{dbStatementSerializer:u}=n.getConfig();if(u){let p=u("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Jt.SemconvStability.OLD&&(a[Pi.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&Jt.SemconvStability.STABLE&&(a[Ja.ATTR_DB_QUERY_TEXT]=p)}let d=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[Fn._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return r.apply(this,arguments);let i=this[Fn._STORED_PARENT_SPAN],a={},{dbStatementSerializer:u}=n.getConfig();if(u){let p=u(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Jt.SemconvStability.OLD&&(a[Pi.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&Jt.SemconvStability.STABLE&&(a[Ja.ATTR_DB_QUERY_TEXT]=p)}let d=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return o.apply(this,arguments);let u={document:this};i&&!(i instanceof Function)&&(u.options=i);let d={},{dbStatementSerializer:p}=r.getConfig();if(p){let m=p(e,u);r._dbSemconvStability&Jt.SemconvStability.OLD&&(d[Pi.ATTR_DB_STATEMENT]=m),r._dbSemconvStability&Jt.SemconvStability.STABLE&&(d[Ja.ATTR_DB_QUERY_TEXT]=m)}let f=r._startSpan(this.constructor.collection,this.constructor.modelName,e,d);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(f,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,u){if(r.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return o.apply(this,arguments);let d=u,p=i,f=a;typeof i=="function"?(d=i,p=void 0,f=void 0):typeof a=="function"&&(d=a,f=void 0);let m={},_=r.getConfig().dbStatementSerializer;if(_){let T=_(e,{condition:{_id:this._id},updates:p,options:f});r._dbSemconvStability&Jt.SemconvStability.OLD&&(m[Pi.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&Jt.SemconvStability.STABLE&&(m[Ja.ATTR_DB_QUERY_TEXT]=T)}let h=r._startSpan(this.constructor.collection,this.constructor.modelName,e,m),g=r._handleResponse(h,o,this,arguments,d,n);return g&&typeof g=="object"&&(g[Fn._ALREADY_INSTRUMENTED]=!0),g}}patchModelStatic(e,n){let r=this;return o=>function(i,a,u){if(r.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(u=a,a=void 0);let d={};switch(e){case"insertMany":d.documents=i;break;case"bulkWrite":d.operations=i;break;default:d.document=i;break}a!==void 0&&(d.options=a);let p={},{dbStatementSerializer:f}=r.getConfig();if(f){let _=f(e,d);r._dbSemconvStability&Jt.SemconvStability.OLD&&(p[Pi.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&Jt.SemconvStability.STABLE&&(p[Ja.ATTR_DB_QUERY_TEXT]=_)}let m=r._startSpan(this.collection,this.modelName,e,p);return r._handleResponse(m,o,this,arguments,u,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=It.trace.getSpan(It.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[Fn._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[Fn._STORED_PARENT_SPAN]=It.trace.getSpan(It.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,jC.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Jt.SemconvStability.OLD&&(i[Pi.ATTR_DB_OPERATION]=r,i[Pi.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Jt.SemconvStability.STABLE&&(i[Ja.ATTR_DB_OPERATION_NAME]=r,i[Ja.ATTR_DB_SYSTEM_NAME]=Pi.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&Jt.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:It.SpanKind.CLIENT,attributes:i},s?It.trace.setSpan(It.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,jC.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let u=a._callOriginalFunction(()=>n.apply(r,o));return(0,jC.handlePromiseResponse)(u,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?It.context.with((0,PIe.suppressTracing)(It.context.active()),e):e()}};Fn.MongooseInstrumentation=HC});var a$=E(RE=>{"use strict";c();Object.defineProperty(RE,"__esModule",{value:!0});RE.MongooseInstrumentation=void 0;var wIe=i$();Object.defineProperty(RE,"MongooseInstrumentation",{enumerable:!0,get:function(){return wIe.MongooseInstrumentation}})});var p$=E(gt=>{"use strict";c();Object.defineProperty(gt,"__esModule",{value:!0});gt.METRIC_DB_CLIENT_CONNECTIONS_USAGE=gt.DB_SYSTEM_VALUE_MYSQL=gt.ATTR_NET_PEER_PORT=gt.ATTR_NET_PEER_NAME=gt.ATTR_DB_USER=gt.ATTR_DB_SYSTEM=gt.ATTR_DB_STATEMENT=gt.ATTR_DB_NAME=gt.ATTR_DB_CONNECTION_STRING=void 0;gt.ATTR_DB_CONNECTION_STRING="db.connection_string";gt.ATTR_DB_NAME="db.name";gt.ATTR_DB_STATEMENT="db.statement";gt.ATTR_DB_SYSTEM="db.system";gt.ATTR_DB_USER="db.user";gt.ATTR_NET_PEER_NAME="net.peer.name";gt.ATTR_NET_PEER_PORT="net.peer.port";gt.DB_SYSTEM_VALUE_MYSQL="mysql";gt.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var f$=E(Nf=>{"use strict";c();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.AttributeNames=void 0;var DIe;(function(t){t.MYSQL_VALUES="db.mysql.values"})(DIe=Nf.AttributeNames||(Nf.AttributeNames={}))});var m$=E(ln=>{"use strict";c();Object.defineProperty(ln,"__esModule",{value:!0});ln.getPoolNameOld=ln.arrayStringifyHelper=ln.getSpanName=ln.getDbValues=ln.getDbQueryText=ln.getJDBCString=ln.getConfig=void 0;function UIe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}ln.getConfig=UIe;function BIe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}ln.getJDBCString=BIe;function FIe(t){return typeof t=="string"?t:t.sql}ln.getDbQueryText=FIe;function GIe(t,e){return VC(typeof t=="string"?e:e||t.values)}ln.getDbValues=GIe;function jIe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}ln.getSpanName=jIe;function VC(t){return t?`[${t.toString()}]`:""}ln.arrayStringifyHelper=VC;function HIe(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}ln.getPoolNameOld=HIe});var _$=E(Il=>{"use strict";c();Object.defineProperty(Il,"__esModule",{value:!0});Il.PACKAGE_NAME=Il.PACKAGE_VERSION=void 0;Il.PACKAGE_VERSION="0.60.0";Il.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var g$=E(IE=>{"use strict";c();Object.defineProperty(IE,"__esModule",{value:!0});IE.MySQLInstrumentation=void 0;var Gn=(M(),x(L)),Nr=se(),Ol=(fe(),x(Oe)),Rs=p$(),VIe=f$(),Xa=m$(),h$=_$(),qC=class extends Nr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(h$.PACKAGE_NAME,h$.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Nr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Nr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Rs.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new Nr.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,Nr.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,Nr.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,Nr.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,u=i-a,d=(0,Xa.getPoolNameOld)(e);r._connCountAdd(-u,d,"used"),r._connCountAdd(-a,d,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let u=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),d=a[u].pool;r._setPoolCallbacks(d,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let u=r._getConnectionCallbackPatchFn(s);return n.call(e,u)}if(arguments.length===2&&typeof i=="function"){let u=r._getConnectionCallbackPatchFn(i);return n.call(e,s,u)}if(arguments.length===3&&typeof a=="function"){let u=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,u)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=Gn.context.active();return function(o,s){s&&((0,Nr.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&Gn.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:u,port:d,database:p,user:f}=(0,Xa.getConfig)(e.config),m=parseInt(d,10),_=(0,Xa.getDbQueryText)(o);r._dbSemconvStability&Nr.SemconvStability.OLD&&(a[Rs.ATTR_DB_SYSTEM]=Rs.DB_SYSTEM_VALUE_MYSQL,a[Rs.ATTR_DB_CONNECTION_STRING]=(0,Xa.getJDBCString)(u,d,p),a[Rs.ATTR_DB_NAME]=p,a[Rs.ATTR_DB_USER]=f,a[Rs.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&Nr.SemconvStability.STABLE&&(a[Ol.ATTR_DB_SYSTEM_NAME]=Ol.DB_SYSTEM_NAME_VALUE_MYSQL,a[Ol.ATTR_DB_NAMESPACE]=p,a[Ol.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Nr.SemconvStability.OLD&&(a[Rs.ATTR_NET_PEER_NAME]=u,isNaN(m)||(a[Rs.ATTR_NET_PEER_PORT]=m)),r._netSemconvStability&Nr.SemconvStability.STABLE&&(a[Ol.ATTR_SERVER_ADDRESS]=u,isNaN(m)||(a[Ol.ATTR_SERVER_PORT]=m));let h=r.tracer.startSpan((0,Xa.getSpanName)(o),{kind:Gn.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let S;Array.isArray(s)?S=s:arguments[2]&&(S=[s]),h.setAttribute(VIe.AttributeNames.MYSQL_VALUES,(0,Xa.getDbValues)(o,S))}let g=Array.from(arguments).findIndex(S=>typeof S=="function"),T=Gn.context.active();if(g===-1){let S=Gn.context.with(Gn.trace.setSpan(Gn.context.active(),h),()=>n.apply(e,arguments));return Gn.context.bind(T,S),S.on("error",A=>h.setStatus({code:Gn.SpanStatusCode.ERROR,message:A.message})).on("end",()=>{h.end()})}else return r._wrap(arguments,g,r._patchCallbackQuery(h,T)),Gn.context.with(Gn.trace.setSpan(Gn.context.active(),h),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:Gn.SpanStatusCode.ERROR,message:o.message}),e.end(),Gn.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,Xa.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};IE.MySQLInstrumentation=qC});var T$=E(OE=>{"use strict";c();Object.defineProperty(OE,"__esModule",{value:!0});OE.MySQLInstrumentation=void 0;var qIe=g$();Object.defineProperty(OE,"MySQLInstrumentation",{enumerable:!0,get:function(){return qIe.MySQLInstrumentation}})});var $C=E(Lt=>{"use strict";c();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.DB_SYSTEM_VALUE_MYSQL=Lt.ATTR_NET_PEER_PORT=Lt.ATTR_NET_PEER_NAME=Lt.ATTR_DB_USER=Lt.ATTR_DB_SYSTEM=Lt.ATTR_DB_STATEMENT=Lt.ATTR_DB_NAME=Lt.ATTR_DB_CONNECTION_STRING=void 0;Lt.ATTR_DB_CONNECTION_STRING="db.connection_string";Lt.ATTR_DB_NAME="db.name";Lt.ATTR_DB_STATEMENT="db.statement";Lt.ATTR_DB_SYSTEM="db.system";Lt.ATTR_DB_USER="db.user";Lt.ATTR_NET_PEER_NAME="net.peer.name";Lt.ATTR_NET_PEER_PORT="net.peer.port";Lt.DB_SYSTEM_VALUE_MYSQL="mysql"});var YC=E(CE=>{"use strict";c();Object.defineProperty(CE,"__esModule",{value:!0});CE.addSqlCommenterComment=void 0;var zC=(M(),x(L)),zIe=ye();function YIe(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function WIe(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function KIe(t,e){if(typeof e!="string"||e.length===0||YIe(e))return e;let n=new zIe.W3CTraceContextPropagator,r={};n.inject(zC.trace.setSpan(zC.ROOT_CONTEXT,t),r,zC.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=WIe(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}CE.addSqlCommenterComment=KIe});var b$=E(xr=>{"use strict";c();Object.defineProperty(xr,"__esModule",{value:!0});xr.getConnectionPrototypeToInstrument=xr.once=xr.getSpanName=xr.getQueryText=xr.getConnectionAttributes=void 0;var xf=$C(),NE=se(),WC=(fe(),x(Oe));function QIe(t,e,n){let{host:r,port:o,database:s,user:i}=JIe(t),a={};e&NE.SemconvStability.OLD&&(a[xf.ATTR_DB_CONNECTION_STRING]=XIe(r,o,s),a[xf.ATTR_DB_NAME]=s,a[xf.ATTR_DB_USER]=i),e&NE.SemconvStability.STABLE&&(a[WC.ATTR_DB_NAMESPACE]=s);let u=parseInt(o,10);return n&NE.SemconvStability.OLD&&(a[xf.ATTR_NET_PEER_NAME]=r,isNaN(u)||(a[xf.ATTR_NET_PEER_PORT]=u)),n&NE.SemconvStability.STABLE&&(a[WC.ATTR_SERVER_ADDRESS]=r,isNaN(u)||(a[WC.ATTR_SERVER_PORT]=u)),a}xr.getConnectionAttributes=QIe;function JIe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function XIe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function ZIe(t,e,n,r=!1,o=eOe){let[s,i]=typeof t=="string"?[t,n]:[t.sql,tOe(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}xr.getQueryText=ZIe;function eOe(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function tOe(t){return"values"in t}function nOe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}xr.getSpanName=nOe;var rOe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};xr.once=rOe;function oOe(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}xr.getConnectionPrototypeToInstrument=oOe});var R$=E(Cl=>{"use strict";c();Object.defineProperty(Cl,"__esModule",{value:!0});Cl.PACKAGE_NAME=Cl.PACKAGE_VERSION=void 0;Cl.PACKAGE_VERSION="0.60.0";Cl.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var N$=E(xE=>{"use strict";c();Object.defineProperty(xE,"__esModule",{value:!0});xE.MySQL2Instrumentation=void 0;var I$=(M(),x(L)),eo=se(),KC=$C(),O$=YC(),Nl=b$(),C$=R$(),QC=(fe(),x(Oe)),JC=[">=1.4.2 <4"],XC=class extends eo.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(C$.PACKAGE_NAME,C$.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,eo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,eo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,eo.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,eo.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new eo.InstrumentationNodeModuleDefinition("mysql2",JC,s=>(n(s),s),()=>{},[new eo.InstrumentationNodeModuleFile("mysql2/promise.js",JC,s=>(n(s),s),()=>{}),new eo.InstrumentationNodeModuleFile("mysql2/lib/connection.js",JC,s=>{let i=(0,Nl.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,Nl.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let u;Array.isArray(i)?u=i:arguments[2]&&(u=[i]);let{maskStatement:d,maskStatementHook:p,responseHook:f}=o.getConfig(),m=(0,Nl.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),_=(0,Nl.getQueryText)(s,e,u,d,p);o._dbSemconvStability&eo.SemconvStability.OLD&&(m[KC.ATTR_DB_SYSTEM]=KC.DB_SYSTEM_VALUE_MYSQL,m[KC.ATTR_DB_STATEMENT]=_),o._dbSemconvStability&eo.SemconvStability.STABLE&&(m[QC.ATTR_DB_SYSTEM_NAME]=QC.DB_SYSTEM_NAME_VALUE_MYSQL,m[QC.ATTR_DB_QUERY_TEXT]=_);let h=o.tracer.startSpan((0,Nl.getSpanName)(s),{kind:I$.SpanKind.CLIENT,attributes:m});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,O$.addSqlCommenterComment)(h,s):Object.assign(s,{sql:(0,O$.addSqlCommenterComment)(h,s.sql)}));let g=(0,Nl.once)((T,S)=>{T?h.setStatus({code:I$.SpanStatusCode.ERROR,message:T.message}):typeof f=="function"&&(0,eo.safeExecuteInTheMiddle)(()=>{f(h,{queryResults:S})},A=>{A&&o._diag.warn("Failed executing responseHook",A)},!0),h.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(g));let T=r.apply(this,arguments);return T.once("error",S=>{g(S)}).once("result",S=>{g(void 0,S)}),T}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(g)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(g)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};xE.MySQL2Instrumentation=XC});var x$=E(PE=>{"use strict";c();Object.defineProperty(PE,"__esModule",{value:!0});PE.MySQL2Instrumentation=void 0;var sOe=N$();Object.defineProperty(PE,"MySQL2Instrumentation",{enumerable:!0,get:function(){return sOe.MySQL2Instrumentation}})});var w$=E(dn=>{"use strict";c();Object.defineProperty(dn,"__esModule",{value:!0});dn.DB_SYSTEM_VALUE_REDIS=dn.DB_SYSTEM_NAME_VALUE_REDIS=dn.ATTR_NET_PEER_PORT=dn.ATTR_NET_PEER_NAME=dn.ATTR_DB_SYSTEM=dn.ATTR_DB_STATEMENT=dn.ATTR_DB_CONNECTION_STRING=void 0;dn.ATTR_DB_CONNECTION_STRING="db.connection_string";dn.ATTR_DB_STATEMENT="db.statement";dn.ATTR_DB_SYSTEM="db.system";dn.ATTR_NET_PEER_NAME="net.peer.name";dn.ATTR_NET_PEER_PORT="net.peer.port";dn.DB_SYSTEM_NAME_VALUE_REDIS="redis";dn.DB_SYSTEM_VALUE_REDIS="redis"});var L$=E(ME=>{"use strict";c();Object.defineProperty(ME,"__esModule",{value:!0});ME.endSpan=void 0;var aOe=(M(),x(L)),uOe=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:aOe.SpanStatusCode.ERROR,message:e.message})),t.end()};ME.endSpan=uOe});var kE=E(vE=>{"use strict";c();Object.defineProperty(vE,"__esModule",{value:!0});vE.defaultDbStatementSerializer=void 0;var cOe=[{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}],lOe=(t,e)=>{if(Array.isArray(e)&&e.length){let n=cOe.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};vE.defaultDbStatementSerializer=lOe});var D$=E(xl=>{"use strict";c();Object.defineProperty(xl,"__esModule",{value:!0});xl.PACKAGE_NAME=xl.PACKAGE_VERSION=void 0;xl.PACKAGE_VERSION="0.62.0";xl.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var G$=E(wE=>{"use strict";c();Object.defineProperty(wE,"__esModule",{value:!0});wE.IORedisInstrumentation=void 0;var Mi=(M(),x(L)),jn=se(),vi=(fe(),x(Oe)),Hn=w$(),U$=se(),Pf=L$(),dOe=kE(),B$=D$(),F$={requireParentSpan:!0},ZC=class extends jn.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(B$.PACKAGE_NAME,B$.PACKAGE_VERSION,{...F$,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,jn.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,jn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...F$,...e})}init(){return[new jn.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,jn.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,jn.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||dOe.defaultDbStatementSerializer,a=Mi.trace.getSpan(Mi.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let u={},{host:d,port:p}=this.options,f=i(o.name,o.args);r._dbSemconvStability&jn.SemconvStability.OLD&&(u[Hn.ATTR_DB_SYSTEM]=Hn.DB_SYSTEM_VALUE_REDIS,u[Hn.ATTR_DB_STATEMENT]=f,u[Hn.ATTR_DB_CONNECTION_STRING]=`redis://${d}:${p}`),r._dbSemconvStability&jn.SemconvStability.STABLE&&(u[vi.ATTR_DB_SYSTEM_NAME]=Hn.DB_SYSTEM_NAME_VALUE_REDIS,u[vi.ATTR_DB_QUERY_TEXT]=f),r._netSemconvStability&jn.SemconvStability.OLD&&(u[Hn.ATTR_NET_PEER_NAME]=d,u[Hn.ATTR_NET_PEER_PORT]=p),r._netSemconvStability&jn.SemconvStability.STABLE&&(u[vi.ATTR_SERVER_ADDRESS]=d,u[vi.ATTR_SERVER_PORT]=p);let m=r.tracer.startSpan(o.name,{kind:Mi.SpanKind.CLIENT,attributes:u}),{requestHook:_}=s;_&&(0,U$.safeExecuteInTheMiddle)(()=>_(m,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),h=>{h&&Mi.diag.error("ioredis instrumentation: request hook failed",h)},!0);try{let h=e.apply(this,arguments),g=o.resolve;o.resolve=function(S){(0,U$.safeExecuteInTheMiddle)(()=>s.responseHook?.(m,o.name,o.args,S),A=>{A&&Mi.diag.error("ioredis instrumentation: response hook failed",A)},!0),(0,Pf.endSpan)(m,null),g(S)};let T=o.reject;return o.reject=function(S){(0,Pf.endSpan)(m,S),T(S)},h}catch(h){throw(0,Pf.endSpan)(m,h),h}}}_traceConnection(e){let n=this;return function(){let r=Mi.trace.getSpan(Mi.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&jn.SemconvStability.OLD&&(o[Hn.ATTR_DB_SYSTEM]=Hn.DB_SYSTEM_VALUE_REDIS,o[Hn.ATTR_DB_STATEMENT]="connect",o[Hn.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&jn.SemconvStability.STABLE&&(o[vi.ATTR_DB_SYSTEM_NAME]=Hn.DB_SYSTEM_NAME_VALUE_REDIS,o[vi.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&jn.SemconvStability.OLD&&(o[Hn.ATTR_NET_PEER_NAME]=s,o[Hn.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&jn.SemconvStability.STABLE&&(o[vi.ATTR_SERVER_ADDRESS]=s,o[vi.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:Mi.SpanKind.CLIENT,attributes:o});try{let u=e.apply(this,arguments);return(0,Pf.endSpan)(a,null),u}catch(u){throw(0,Pf.endSpan)(a,u),u}}}};wE.IORedisInstrumentation=ZC});var j$=E(LE=>{"use strict";c();Object.defineProperty(LE,"__esModule",{value:!0});LE.IORedisInstrumentation=void 0;var pOe=G$();Object.defineProperty(LE,"IORedisInstrumentation",{enumerable:!0,get:function(){return pOe.IORedisInstrumentation}})});var DE=E(Pl=>{"use strict";c();Object.defineProperty(Pl,"__esModule",{value:!0});Pl.PACKAGE_NAME=Pl.PACKAGE_VERSION=void 0;Pl.PACKAGE_VERSION="0.62.0";Pl.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var H$=E(ki=>{"use strict";c();Object.defineProperty(ki,"__esModule",{value:!0});ki.getTracedCreateStreamTrace=ki.getTracedCreateClient=ki.endSpan=void 0;var Mf=(M(),x(L)),fOe=(t,e)=>{e&&t.setStatus({code:Mf.SpanStatusCode.ERROR,message:e.message}),t.end()};ki.endSpan=fOe;var mOe=t=>function(){let n=t.apply(this,arguments);return Mf.context.bind(Mf.context.active(),n)};ki.getTracedCreateClient=mOe;var _Oe=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){Mf.context.bind(Mf.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};ki.getTracedCreateStreamTrace=_Oe});var UE=E(pn=>{"use strict";c();Object.defineProperty(pn,"__esModule",{value:!0});pn.DB_SYSTEM_VALUE_REDIS=pn.DB_SYSTEM_NAME_VALUE_REDIS=pn.ATTR_NET_PEER_PORT=pn.ATTR_NET_PEER_NAME=pn.ATTR_DB_SYSTEM=pn.ATTR_DB_STATEMENT=pn.ATTR_DB_CONNECTION_STRING=void 0;pn.ATTR_DB_CONNECTION_STRING="db.connection_string";pn.ATTR_DB_STATEMENT="db.statement";pn.ATTR_DB_SYSTEM="db.system";pn.ATTR_NET_PEER_NAME="net.peer.name";pn.ATTR_NET_PEER_PORT="net.peer.port";pn.DB_SYSTEM_NAME_VALUE_REDIS="redis";pn.DB_SYSTEM_VALUE_REDIS="redis"});var q$=E(FE=>{"use strict";c();Object.defineProperty(FE,"__esModule",{value:!0});FE.RedisInstrumentationV2_V3=void 0;var sr=se(),BE=H$(),V$=DE(),vf=(M(),x(L)),kf=(fe(),x(Oe)),Za=UE(),hOe=kE(),eN=class t extends sr.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(V$.PACKAGE_NAME,V$.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,sr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,sr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new sr.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,sr.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,sr.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,sr.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=vf.trace.getSpan(vf.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let u=i?.dbStatementSerializer||hOe.defaultDbStatementSerializer,d={};e._semconvStability&sr.SemconvStability.OLD&&Object.assign(d,{[Za.ATTR_DB_SYSTEM]:Za.DB_SYSTEM_VALUE_REDIS,[Za.ATTR_DB_STATEMENT]:u(s.command,s.args)}),e._semconvStability&sr.SemconvStability.STABLE&&Object.assign(d,{[kf.ATTR_DB_SYSTEM_NAME]:Za.DB_SYSTEM_NAME_VALUE_REDIS,[kf.ATTR_DB_OPERATION_NAME]:s.command,[kf.ATTR_DB_QUERY_TEXT]:u(s.command,s.args)});let p=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:vf.SpanKind.CLIENT,attributes:d});if(this.connection_options){let m={};e._semconvStability&sr.SemconvStability.OLD&&Object.assign(m,{[Za.ATTR_NET_PEER_NAME]:this.connection_options.host,[Za.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&sr.SemconvStability.STABLE&&Object.assign(m,{[kf.ATTR_SERVER_ADDRESS]:this.connection_options.host,[kf.ATTR_SERVER_PORT]:this.connection_options.port}),p.setAttributes(m)}this.address&&e._semconvStability&sr.SemconvStability.OLD&&p.setAttribute(Za.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let f=arguments[0].callback;if(f){let m=vf.context.active();arguments[0].callback=function(h,g){if(i?.responseHook){let T=i.responseHook;(0,sr.safeExecuteInTheMiddle)(()=>{T(p,s.command,s.args,g)},S=>{S&&e._diag.error("Error executing responseHook",S)},!0)}return(0,BE.endSpan)(p,h),vf.context.with(m,f,this,...arguments)}}try{return r.apply(this,arguments)}catch(m){throw(0,BE.endSpan)(p,m),m}}}}_getPatchCreateClient(){return function(n){return(0,BE.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,BE.getTracedCreateStreamTrace)(n)}}};FE.RedisInstrumentationV2_V3=eN});var z$=E(GE=>{"use strict";c();Object.defineProperty(GE,"__esModule",{value:!0});GE.getClientAttributes=void 0;var tN=(fe(),x(Oe)),Ml=UE(),$$=se();function gOe(t,e,n){let r={};return n&$$.SemconvStability.OLD&&Object.assign(r,{[Ml.ATTR_DB_SYSTEM]:Ml.DB_SYSTEM_VALUE_REDIS,[Ml.ATTR_NET_PEER_NAME]:e?.socket?.host,[Ml.ATTR_NET_PEER_PORT]:e?.socket?.port,[Ml.ATTR_DB_CONNECTION_STRING]:TOe(t,e?.url)}),n&$$.SemconvStability.STABLE&&Object.assign(r,{[tN.ATTR_DB_SYSTEM_NAME]:Ml.DB_SYSTEM_NAME_VALUE_REDIS,[tN.ATTR_SERVER_ADDRESS]:e?.socket?.host,[tN.ATTR_SERVER_PORT]:e?.socket?.port}),r}GE.getClientAttributes=gOe;function TOe(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var Q$=E(jE=>{"use strict";c();Object.defineProperty(jE,"__esModule",{value:!0});jE.RedisInstrumentationV4_V5=void 0;var Pr=(M(),x(L)),De=se(),Y$=z$(),EOe=kE(),W$=DE(),nN=(fe(),x(Oe)),SOe=UE(),wf=Symbol("opentelemetry.instrumentation.redis.open_spans"),K$=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),rN=class t extends De.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(W$.PACKAGE_NAME,W$.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,De.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,De.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new De.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let u=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,De.isWrapped)(s?.[u])&&this._unwrap(s,u),this._wrap(s,u,this._getPatchExtendWithCommands(a)),s},s=>{(0,De.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,De.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new De.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,De.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,De.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,De.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,De.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,De.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new De.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,De.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,De.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,De.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,De.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,De.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,De.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new De.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(u,d){let p=e(u,d).args;return n._traceClientCommand(a,this,arguments,p)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let u=this[wf];return n._endSpansWithRedisReplies(u,a,e),a}).catch(a=>{let u=this[wf];if(!u)n._diag.error("cannot find open spans to end for multi/pipeline");else{let d=a.constructor.name==="MultiErrorReply"?a.replies:new Array(u.length).fill(a);n._endSpansWithRedisReplies(u,d,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[K$]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,Y$.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:Pr.SpanKind.CLIENT,attributes:i});return Pr.context.with(Pr.trace.setSpan(Pr.context.active(),a),()=>r.apply(this)).then(d=>(a.end(),d)).catch(d=>(a.recordException(d),a.setStatus({code:Pr.SpanStatusCode.ERROR,message:d.message}),a.end(),Promise.reject(d)))}}}_traceClientCommand(e,n,r,o){if(Pr.trace.getSpan(Pr.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[K$],a=o[0],u=o.slice(1),d=this.getConfig().dbStatementSerializer||EOe.defaultDbStatementSerializer,p=(0,Y$.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&De.SemconvStability.STABLE&&(p[nN.ATTR_DB_OPERATION_NAME]=a);try{let _=d(a,u);_!=null&&(this._semconvStability&De.SemconvStability.OLD&&(p[SOe.ATTR_DB_STATEMENT]=_),this._semconvStability&De.SemconvStability.STABLE&&(p[nN.ATTR_DB_QUERY_TEXT]=_))}catch(_){this._diag.error("dbStatementSerializer throw an exception",_,{commandName:a})}let f=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:Pr.SpanKind.CLIENT,attributes:p}),m=Pr.context.with(Pr.trace.setSpan(Pr.context.active(),f),()=>e.apply(n,r));if(typeof m?.then=="function")m.then(_=>{this._endSpanWithResponse(f,a,u,_,void 0)},_=>{this._endSpanWithResponse(f,a,u,null,_)});else{let _=m;_[wf]=_[wf]||[],_[wf].push({span:f,commandName:a,commandArgs:u})}return m}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:u,commandArgs:d}=e[a],p=n[a],[f,m]=p instanceof Error?[null,p]:[p,void 0];this._semconvStability&De.SemconvStability.STABLE&&u.setAttribute(nN.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(u,o[a],d,f,m)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:Pr.SpanStatusCode.ERROR,message:s?.message})),e.end()}};jE.RedisInstrumentationV4_V5=rN});var Z$=E(HE=>{"use strict";c();Object.defineProperty(HE,"__esModule",{value:!0});HE.RedisInstrumentation=void 0;var AOe=se(),J$=DE(),yOe=q$(),bOe=Q$(),X$={requireParentSpan:!1},oN=class extends AOe.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...X$,...e};super(J$.PACKAGE_NAME,J$.PACKAGE_VERSION,n),this.instrumentationV2_V3=new yOe.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new bOe.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...X$,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};HE.RedisInstrumentation=oN});var e9=E(VE=>{"use strict";c();Object.defineProperty(VE,"__esModule",{value:!0});VE.RedisInstrumentation=void 0;var ROe=Z$();Object.defineProperty(VE,"RedisInstrumentation",{enumerable:!0,get:function(){return ROe.RedisInstrumentation}})});var l9=E($E=>{"use strict";c();Object.defineProperty($E,"__esModule",{value:!0});$E.EVENT_LISTENERS_SET=void 0;$E.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var aN=E(Uf=>{"use strict";c();Object.defineProperty(Uf,"__esModule",{value:!0});Uf.AttributeNames=void 0;var MOe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(MOe=Uf.AttributeNames||(Uf.AttributeNames={}))});var uN=E(Re=>{"use strict";c();Object.defineProperty(Re,"__esModule",{value:!0});Re.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Re.METRIC_DB_CLIENT_CONNECTION_COUNT=Re.DB_SYSTEM_VALUE_POSTGRESQL=Re.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Re.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Re.ATTR_NET_PEER_PORT=Re.ATTR_NET_PEER_NAME=Re.ATTR_DB_USER=Re.ATTR_DB_SYSTEM=Re.ATTR_DB_STATEMENT=Re.ATTR_DB_NAME=Re.ATTR_DB_CONNECTION_STRING=Re.ATTR_DB_CLIENT_CONNECTION_STATE=Re.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Re.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Re.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Re.ATTR_DB_CONNECTION_STRING="db.connection_string";Re.ATTR_DB_NAME="db.name";Re.ATTR_DB_STATEMENT="db.statement";Re.ATTR_DB_SYSTEM="db.system";Re.ATTR_DB_USER="db.user";Re.ATTR_NET_PEER_NAME="net.peer.name";Re.ATTR_NET_PEER_PORT="net.peer.port";Re.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Re.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Re.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Re.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Re.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var cN=E(Bf=>{"use strict";c();Object.defineProperty(Bf,"__esModule",{value:!0});Bf.SpanNames=void 0;var vOe;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(vOe=Bf.SpanNames||(Bf.SpanNames={}))});var g9=E(Ae=>{"use strict";c();Object.defineProperty(Ae,"__esModule",{value:!0});Ae.sanitizedErrorMessage=Ae.isObjectWithTextString=Ae.getErrorMessage=Ae.patchClientConnectCallback=Ae.patchCallbackPGPool=Ae.updateCounter=Ae.getPoolName=Ae.patchCallback=Ae.handleExecutionResult=Ae.handleConfigQuery=Ae.shouldSkipInstrumentation=Ae.getSemanticAttributesFromPoolConnection=Ae.getSemanticAttributesFromConnection=Ae.getConnectionString=Ae.parseAndMaskConnectionString=Ae.parseNormalizedOperationName=Ae.getQuerySpanName=void 0;var wi=(M(),x(L)),zE=aN(),Mr=(fe(),x(Oe)),Qe=uN(),eu=se(),d9=cN();function p9(t,e){if(!e)return d9.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:f9(e.text);return`${d9.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Ae.getQuerySpanName=p9;function f9(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}Ae.parseNormalizedOperationName=f9;function m9(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}Ae.parseAndMaskConnectionString=m9;function lN(t){if("connectionString"in t&&t.connectionString)return m9(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Ae.getConnectionString=lN;function YE(t){if(Number.isInteger(t))return t}function _9(t,e){let n={};return e&eu.SemconvStability.OLD&&(n={...n,[Qe.ATTR_DB_SYSTEM]:Qe.DB_SYSTEM_VALUE_POSTGRESQL,[Qe.ATTR_DB_NAME]:t.database,[Qe.ATTR_DB_CONNECTION_STRING]:lN(t),[Qe.ATTR_DB_USER]:t.user,[Qe.ATTR_NET_PEER_NAME]:t.host,[Qe.ATTR_NET_PEER_PORT]:YE(t.port)}),e&eu.SemconvStability.STABLE&&(n={...n,[Mr.ATTR_DB_SYSTEM_NAME]:Mr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Mr.ATTR_DB_NAMESPACE]:t.namespace,[Mr.ATTR_SERVER_ADDRESS]:t.host,[Mr.ATTR_SERVER_PORT]:YE(t.port)}),n}Ae.getSemanticAttributesFromConnection=_9;function kOe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[zE.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[zE.AttributeNames.MAX_CLIENT]:t.maxClient};return e&eu.SemconvStability.OLD&&(r={...r,[Qe.ATTR_DB_SYSTEM]:Qe.DB_SYSTEM_VALUE_POSTGRESQL,[Qe.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Qe.ATTR_DB_CONNECTION_STRING]:lN(t),[Qe.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Qe.ATTR_NET_PEER_PORT]:Number(n?.port)||YE(t.port),[Qe.ATTR_DB_USER]:n?.username??t.user}),e&eu.SemconvStability.STABLE&&(r={...r,[Mr.ATTR_DB_SYSTEM_NAME]:Mr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Mr.ATTR_DB_NAMESPACE]:t.namespace,[Mr.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[Mr.ATTR_SERVER_PORT]:Number(n?.port)||YE(t.port)}),r}Ae.getSemanticAttributesFromPoolConnection=kOe;function wOe(t){return t.requireParentSpan===!0&&wi.trace.getSpan(wi.context.active())===void 0}Ae.shouldSkipInstrumentation=wOe;function LOe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=p9(s,r),a=t.startSpan(i,{kind:wi.SpanKind.CLIENT,attributes:_9(o,n)});if(!r)return a;if(r.text&&(n&eu.SemconvStability.OLD&&a.setAttribute(Qe.ATTR_DB_STATEMENT,r.text),n&eu.SemconvStability.STABLE&&a.setAttribute(Mr.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let u=r.values.map(d=>d==null?"null":d instanceof Buffer?d.toString():typeof d=="object"?typeof d.toPostgres=="function"?d.toPostgres():JSON.stringify(d):d.toString());a.setAttribute(zE.AttributeNames.PG_VALUES,u)}catch(u){wi.diag.error("failed to stringify ",r.values,u)}return typeof r.name=="string"&&a.setAttribute(zE.AttributeNames.PG_PLAN,r.name),a}Ae.handleConfigQuery=LOe;function h9(t,e,n){typeof t.responseHook=="function"&&(0,eu.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&wi.diag.error("Error running response hook",r)},!0)}Ae.handleExecutionResult=h9;function DOe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[Mr.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(WE(i)),e.setStatus({code:wi.SpanStatusCode.ERROR,message:i.message})):h9(t,e,a),o(),e.end(),n.call(this,i,a)}}Ae.patchCallback=DOe;function UOe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Ae.getPoolName=UOe;function BOe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,u=s-a;return n.add(u-o.used,{[Qe.ATTR_DB_CLIENT_CONNECTION_STATE]:Qe.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Qe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Qe.ATTR_DB_CLIENT_CONNECTION_STATE]:Qe.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Qe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Qe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:u,idle:a,pending:i}}Ae.updateCounter=BOe;function FOe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(WE(r)),t.setStatus({code:wi.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}Ae.patchCallbackPGPool=FOe;function GOe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(WE(r)),t.setStatus({code:wi.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}Ae.patchClientConnectCallback=GOe;function jOe(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Ae.getErrorMessage=jOe;function HOe(t){return typeof t=="object"&&typeof t?.text=="string"}Ae.isObjectWithTextString=HOe;function WE(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}Ae.sanitizedErrorMessage=WE});var T9=E(vl=>{"use strict";c();Object.defineProperty(vl,"__esModule",{value:!0});vl.PACKAGE_NAME=vl.PACKAGE_VERSION=void 0;vl.PACKAGE_VERSION="0.66.0";vl.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var R9=E(QE=>{"use strict";c();Object.defineProperty(QE,"__esModule",{value:!0});QE.PgInstrumentation=void 0;var On=se(),xe=(M(),x(L)),E9=l9(),Ve=g9(),S9=YC(),A9=T9(),y9=cN(),KE=ye(),to=(fe(),x(Oe)),Ff=uN();function kl(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var dN=class extends On.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(A9.PACKAGE_NAME,A9.PACKAGE_VERSION,e),this._semconvStability=(0,On.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(to.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:xe.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(Ff.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(Ff.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new On.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new On.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new On.InstrumentationNodeModuleDefinition("pg",e,a=>{let u=kl(a);return this._patchPgClient(u.Client),a},a=>{let u=kl(a);return this._unpatchPgClient(u.Client),a},[o,r]),i=new On.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let u=kl(a);return(0,On.isWrapped)(u.prototype.connect)&&this._unwrap(u.prototype,"connect"),this._wrap(u.prototype,"connect",this._getPoolConnectPatch()),u},a=>{let u=kl(a);(0,On.isWrapped)(u.prototype.connect)&&this._unwrap(u.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=kl(e);return(0,On.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,On.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=kl(e);return(0,On.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,On.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(Ve.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(y9.SpanNames.CONNECT,{kind:xe.SpanKind.CLIENT,attributes:Ve.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let u=xe.trace.getSpan(xe.context.active());o=Ve.patchClientConnectCallback(i,o),u&&(o=xe.context.bind(xe.context.active(),o))}let a=xe.context.with(xe.trace.setSpan(xe.context.active(),i),()=>n.call(this,o));return b9(i,a)}}recordOperationDuration(e,n){let r={},o=[to.ATTR_DB_NAMESPACE,to.ATTR_ERROR_TYPE,to.ATTR_SERVER_PORT,to.ATTR_SERVER_ADDRESS,to.ATTR_DB_OPERATION_NAME];this._semconvStability&On.SemconvStability.OLD&&o.push(Ff.ATTR_DB_SYSTEM),this._semconvStability&On.SemconvStability.STABLE&&o.push(to.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,KE.hrTimeToMilliseconds)((0,KE.hrTimeDuration)(n,(0,KE.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Ve.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,KE.hrTime)(),i=o[0],a=typeof i=="string",u=Ve.isObjectWithTextString(i),d=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:u?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,p={[Ff.ATTR_DB_SYSTEM]:Ff.DB_SYSTEM_VALUE_POSTGRESQL,[to.ATTR_DB_NAMESPACE]:this.database,[to.ATTR_SERVER_PORT]:this.connectionParameters.port,[to.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};d?.text&&(p[to.ATTR_DB_OPERATION_NAME]=Ve.parseNormalizedOperationName(d?.text));let f=()=>{e.recordOperationDuration(p,s)},m=e.getConfig(),_=Ve.handleConfigQuery.call(this,e.tracer,m,e._semconvStability,d);if(m.addSqlCommenterCommentToQueries&&(a?o[0]=(0,S9.addSqlCommenterComment)(_,i):u&&!("name"in i)&&(o[0]={...i,text:(0,S9.addSqlCommenterComment)(_,i.text)})),o.length>0){let T=xe.trace.getSpan(xe.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Ve.patchCallback(m,_,o[o.length-1],p,f),T&&(o[o.length-1]=xe.context.bind(xe.context.active(),o[o.length-1]));else if(typeof d?.callback=="function"){let S=Ve.patchCallback(e.getConfig(),_,d.callback,p,f);T&&(S=xe.context.bind(xe.context.active(),S)),o[0].callback=S}}let{requestHook:h}=m;typeof h=="function"&&d&&(0,On.safeExecuteInTheMiddle)(()=>{let{database:T,host:S,port:A,user:R}=this.connectionParameters;h(_,{connection:{database:T,host:S,port:A,user:R},query:{text:d.text,values:d.values,name:d.name}})},T=>{T&&e._diag.error("Error running query hook",T)},!0);let g;try{g=n.apply(this,o)}catch(T){throw T instanceof Error&&_.recordException(Ve.sanitizedErrorMessage(T)),_.setStatus({code:xe.SpanStatusCode.ERROR,message:Ve.getErrorMessage(T)}),_.end(),T}return g instanceof Promise?g.then(T=>new Promise(S=>{Ve.handleExecutionResult(e.getConfig(),_,T),f(),_.end(),S(T)})).catch(T=>new Promise((S,A)=>{T instanceof Error&&_.recordException(Ve.sanitizedErrorMessage(T)),_.setStatus({code:xe.SpanStatusCode.ERROR,message:T.message}),f(),_.end(),A(T)})):g})}_setPoolConnectEventListeners(e){if(e[E9.EVENT_LISTENERS_SET])return;let n=Ve.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[E9.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(Ve.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(y9.SpanNames.POOL_CONNECT,{kind:xe.SpanKind.CLIENT,attributes:Ve.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let u=xe.trace.getSpan(xe.context.active());o=Ve.patchCallbackPGPool(i,o),u&&(o=xe.context.bind(xe.context.active(),o))}let a=xe.context.with(xe.trace.setSpan(xe.context.active(),i),()=>n.call(this,o));return b9(i,a)}}};QE.PgInstrumentation=dN;function b9(t,e){if(!(e instanceof Promise))return e;let n=e;return xe.context.bind(xe.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(Ve.sanitizedErrorMessage(r)),t.setStatus({code:xe.SpanStatusCode.ERROR,message:Ve.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var I9=E(wl=>{"use strict";c();Object.defineProperty(wl,"__esModule",{value:!0});wl.AttributeNames=wl.PgInstrumentation=void 0;var VOe=R9();Object.defineProperty(wl,"PgInstrumentation",{enumerable:!0,get:function(){return VOe.PgInstrumentation}});var qOe=aN();Object.defineProperty(wl,"AttributeNames",{enumerable:!0,get:function(){return qOe.AttributeNames}})});var k9=E(Gf=>{"use strict";c();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.SeverityNumber=void 0;var KOe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(KOe=Gf.SeverityNumber||(Gf.SeverityNumber={}))});var XE=E(Ll=>{"use strict";c();Object.defineProperty(Ll,"__esModule",{value:!0});Ll.NOOP_LOGGER=Ll.NoopLogger=void 0;var JE=class{emit(e){}};Ll.NoopLogger=JE;Ll.NOOP_LOGGER=new JE});var eS=E(Dl=>{"use strict";c();Object.defineProperty(Dl,"__esModule",{value:!0});Dl.NOOP_LOGGER_PROVIDER=Dl.NoopLoggerProvider=void 0;var QOe=XE(),ZE=class{getLogger(e,n,r){return new QOe.NoopLogger}};Dl.NoopLoggerProvider=ZE;Dl.NOOP_LOGGER_PROVIDER=new ZE});var _N=E(tS=>{"use strict";c();Object.defineProperty(tS,"__esModule",{value:!0});tS.ProxyLogger=void 0;var JOe=XE(),mN=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):JOe.NOOP_LOGGER}};tS.ProxyLogger=mN});var gN=E(nS=>{"use strict";c();Object.defineProperty(nS,"__esModule",{value:!0});nS.ProxyLoggerProvider=void 0;var XOe=eS(),ZOe=_N(),hN=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new ZOe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:XOe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};nS.ProxyLoggerProvider=hN});var w9=E(rS=>{"use strict";c();Object.defineProperty(rS,"__esModule",{value:!0});rS._globalThis=void 0;rS._globalThis=typeof globalThis=="object"?globalThis:global});var L9=E(oS=>{"use strict";c();Object.defineProperty(oS,"__esModule",{value:!0});oS._globalThis=void 0;var eCe=w9();Object.defineProperty(oS,"_globalThis",{enumerable:!0,get:function(){return eCe._globalThis}})});var D9=E(sS=>{"use strict";c();Object.defineProperty(sS,"__esModule",{value:!0});sS._globalThis=void 0;var tCe=L9();Object.defineProperty(sS,"_globalThis",{enumerable:!0,get:function(){return tCe._globalThis}})});var U9=E(Lo=>{"use strict";c();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.API_BACKWARDS_COMPATIBILITY_VERSION=Lo.makeGetter=Lo._global=Lo.GLOBAL_LOGS_API_KEY=void 0;var nCe=D9();Lo.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Lo._global=nCe._globalThis;function rCe(t,e,n){return r=>r===t?e:n}Lo.makeGetter=rCe;Lo.API_BACKWARDS_COMPATIBILITY_VERSION=1});var F9=E(iS=>{"use strict";c();Object.defineProperty(iS,"__esModule",{value:!0});iS.LogsAPI=void 0;var vr=U9(),oCe=eS(),B9=gN(),TN=class t{constructor(){this._proxyLoggerProvider=new B9.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return vr._global[vr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(vr._global[vr.GLOBAL_LOGS_API_KEY]=(0,vr.makeGetter)(vr.API_BACKWARDS_COMPATIBILITY_VERSION,e,oCe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=vr._global[vr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(vr._global,vr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete vr._global[vr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new B9.ProxyLoggerProvider}};iS.LogsAPI=TN});var EN=E(Dt=>{"use strict";c();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.logs=Dt.ProxyLoggerProvider=Dt.ProxyLogger=Dt.NoopLoggerProvider=Dt.NOOP_LOGGER_PROVIDER=Dt.NoopLogger=Dt.NOOP_LOGGER=Dt.SeverityNumber=void 0;var sCe=k9();Object.defineProperty(Dt,"SeverityNumber",{enumerable:!0,get:function(){return sCe.SeverityNumber}});var G9=XE();Object.defineProperty(Dt,"NOOP_LOGGER",{enumerable:!0,get:function(){return G9.NOOP_LOGGER}});Object.defineProperty(Dt,"NoopLogger",{enumerable:!0,get:function(){return G9.NoopLogger}});var j9=eS();Object.defineProperty(Dt,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return j9.NOOP_LOGGER_PROVIDER}});Object.defineProperty(Dt,"NoopLoggerProvider",{enumerable:!0,get:function(){return j9.NoopLoggerProvider}});var iCe=_N();Object.defineProperty(Dt,"ProxyLogger",{enumerable:!0,get:function(){return iCe.ProxyLogger}});var aCe=gN();Object.defineProperty(Dt,"ProxyLoggerProvider",{enumerable:!0,get:function(){return aCe.ProxyLoggerProvider}});var uCe=F9();Dt.logs=uCe.LogsAPI.getInstance()});var H9=E(Ul=>{"use strict";c();Object.defineProperty(Ul,"__esModule",{value:!0});Ul.disableInstrumentations=Ul.enableInstrumentations=void 0;function cCe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Ul.enableInstrumentations=cCe;function lCe(t){t.forEach(e=>e.disable())}Ul.disableInstrumentations=lCe});var $9=E(aS=>{"use strict";c();Object.defineProperty(aS,"__esModule",{value:!0});aS.registerInstrumentations=void 0;var V9=(M(),x(L)),dCe=EN(),q9=H9();function pCe(t){let e=t.tracerProvider||V9.trace.getTracerProvider(),n=t.meterProvider||V9.metrics.getMeterProvider(),r=t.loggerProvider||dCe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,q9.enableInstrumentations)(o,e,n,r),()=>{(0,q9.disableInstrumentations)(o)}}aS.registerInstrumentations=pCe});var ez=E(uS=>{"use strict";c();Object.defineProperty(uS,"__esModule",{value:!0});uS.satisfies=void 0;var bN=(M(),x(L)),Q9=/^(?: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-]+)*))?$/,fCe=/^(?<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-]+)*))?$/,mCe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function _Ce(t,e,n){if(!hCe(t))return bN.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=SCe(t);if(!r)return!1;let o=[],s=J9(r,e,o,n);return s&&!n?.includePrerelease?TCe(r,o):s}uS.satisfies=_Ce;function hCe(t){return typeof t=="string"&&Q9.test(t)}function J9(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(SN(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=jCe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!SN(t,s,n,r))return!1;return!0}return SN(t,e,n,r)}function SN(t,e,n,r){if(e=ECe(e,r),e.includes(" "))return J9(t,e,n,r);{let o=ACe(e);return n.push(o),gCe(t,o)}}function gCe(t,e){if(e.invalid)return!1;if(!e.version||yN(e.version))return!0;let n=Y9(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=Y9(r,o)}return mCe[e.op]?.includes(n)}function TCe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function ECe(t,e){return t=t.trim(),t=FCe(t,e),t=BCe(t),t=GCe(t,e),t=t.trim(),t}function Cn(t){return!t||t.toLowerCase()==="x"||t==="*"}function SCe(t){let e=t.match(Q9);if(!e){bN.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function ACe(t){if(!t)return{};let e=t.match(fCe);if(!e)return bN.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function yN(t){return t==="*"||t==="x"||t==="X"}function z9(t){let e=parseInt(t,10);return isNaN(e)?t:e}function yCe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function bCe(t,e){if(yN(t)||yN(e))return 0;let[n,r]=yCe(z9(t),z9(e));return n>r?1:n<r?-1:0}function Y9(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=bCe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var X9="[a-zA-Z0-9-]",Z9="0|[1-9]\\d*",RCe=`\\d*[a-zA-Z-]${X9}*`,ICe="((?:<|>)?=?)",W9=`(?:${Z9}|${RCe})`,OCe=`(?:-(${W9}(?:\\.${W9})*))`,K9=`${X9}+`,CCe=`(?:\\+(${K9}(?:\\.${K9})*))`,AN=`${Z9}|x|X|\\*`,jf=`[v=\\s]*(${AN})(?:\\.(${AN})(?:\\.(${AN})(?:${OCe})?${CCe}?)?)?`,NCe=`^${ICe}\\s*${jf}$`,xCe=new RegExp(NCe),PCe=`^\\s*(${jf})\\s+-\\s+(${jf})\\s*$`,MCe=new RegExp(PCe),vCe="(?:~>?)",kCe=`^${vCe}${jf}$`,wCe=new RegExp(kCe),LCe="(?:\\^)",DCe=`^${LCe}${jf}$`,UCe=new RegExp(DCe);function BCe(t){let e=wCe;return t.replace(e,(n,r,o,s,i)=>{let a;return Cn(r)?a="":Cn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Cn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function FCe(t,e){let n=UCe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,u)=>{let d;return Cn(s)?d="":Cn(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Cn(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:u?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${u} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${u} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${u} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function GCe(t,e){let n=xCe;return t.replace(n,(r,o,s,i,a,u)=>{let d=Cn(s),p=d||Cn(i),f=p||Cn(a),m=f;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&m?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(u="-0"),r=`${o+s}.${i}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:f&&(r=`>=${s}.${i}.0${u} <${s}.${+i+1}.0-0`),r})}function jCe(t,e){let n=MCe;return t.replace(n,(r,o,s,i,a,u,d,p,f,m,_,h)=>(Cn(s)?o="":Cn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Cn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Cn(f)?p="":Cn(m)?p=`<${+f+1}.0.0-0`:Cn(_)?p=`<${f}.${+m+1}.0-0`:h?p=`<=${f}.${m}.${_}-${h}`:e?.includePrerelease?p=`<${f}.${m}.${+_+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var RN=E(Xt=>{"use strict";c();Object.defineProperty(Xt,"__esModule",{value:!0});Xt.massUnwrap=Xt.unwrap=Xt.massWrap=Xt.wrap=void 0;var Nn=console.error.bind(console);function Hf(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var HCe=(t,e,n)=>{if(!t||!t[e]){Nn("no original function "+String(e)+" to wrap");return}if(!n){Nn("no wrapper function"),Nn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Nn("original object and wrapper must be functions");return}let o=n(r,e);return Hf(o,"__original",r),Hf(o,"__unwrap",()=>{t[e]===o&&Hf(t,e,r)}),Hf(o,"__wrapped",!0),Hf(t,e,o),o};Xt.wrap=HCe;var VCe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Nn("must provide one or more modules to patch"),Nn(new Error().stack);return}if(!(e&&Array.isArray(e))){Nn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Xt.wrap)(r,o,n)})})};Xt.massWrap=VCe;var qCe=(t,e)=>{if(!t||!t[e]){Nn("no function to unwrap."),Nn(new Error().stack);return}let n=t[e];if(!n.__unwrap)Nn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Xt.unwrap=qCe;var $Ce=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Nn("must provide one or more modules to patch"),Nn(new Error().stack);return}if(!(e&&Array.isArray(e))){Nn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Xt.unwrap)(n,r)})})};Xt.massUnwrap=$Ce;function Vf(t){t&&t.logger&&(typeof t.logger!="function"?Nn("new logger isn't a function, not replacing"):Nn=t.logger)}Xt.default=Vf;Vf.wrap=Xt.wrap;Vf.massWrap=Xt.massWrap;Vf.unwrap=Xt.unwrap;Vf.massUnwrap=Xt.massUnwrap});var tz=E(lS=>{"use strict";c();Object.defineProperty(lS,"__esModule",{value:!0});lS.InstrumentationAbstract=void 0;var IN=(M(),x(L)),zCe=EN(),cS=RN(),ON=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=IN.diag.createComponentLogger({namespace:e}),this._tracer=IN.trace.getTracer(e,n),this._meter=IN.metrics.getMeter(e,n),this._logger=zCe.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=cS.wrap;_unwrap=cS.unwrap;_massWrap=cS.massWrap;_massUnwrap=cS.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};lS.InstrumentationAbstract=ON});var nz=E(Di=>{"use strict";c();Object.defineProperty(Di,"__esModule",{value:!0});Di.ModuleNameTrie=Di.ModuleNameSeparator=void 0;Di.ModuleNameSeparator="/";var dS=class{hooks=[];children=new Map},CN=class{_trie=new dS;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(Di.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new dS,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(Di.ModuleNameSeparator)){let u=o.children.get(a);if(!u){i=!1;break}r||s.push(...u.hooks),o=u}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,u)=>a.insertedId-u.insertedId),s.map(({hook:a})=>a))}};Di.ModuleNameTrie=CN});var oz=E(pS=>{"use strict";c();Object.defineProperty(pS,"__esModule",{value:!0});pS.RequireInTheMiddleSingleton=void 0;var YCe=ga(),rz=B("path"),NN=nz(),WCe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),xN=class t{_moduleNameTrie=new NN.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new YCe.Hook(null,{internals:!0},(e,n,r)=>{let o=KCe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return WCe?new t:this._instance=this._instance??new t}};pS.RequireInTheMiddleSingleton=xN;function KCe(t){return rz.sep!==NN.ModuleNameSeparator?t.split(rz.sep).join(NN.ModuleNameSeparator):t}});var PN=E(Ui=>{"use strict";c();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.isWrapped=Ui.safeExecuteInTheMiddleAsync=Ui.safeExecuteInTheMiddle=void 0;function QCe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Ui.safeExecuteInTheMiddle=QCe;async function JCe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Ui.safeExecuteInTheMiddleAsync=JCe;function XCe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}Ui.isWrapped=XCe});var az=E(fS=>{"use strict";c();Object.defineProperty(fS,"__esModule",{value:!0});fS.InstrumentationBase=void 0;var qf=B("path"),sz=B("util"),ZCe=ez(),MN=RN(),eNe=tz(),tNe=oz(),nNe=dC(),$f=(M(),x(L)),rNe=ga(),oNe=B("fs"),sNe=PN(),vN=class extends eNe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=tNe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,sNe.isWrapped)(e[n])&&this._unwrap(e,n),sz.types.isProxy(e)){let o=(0,MN.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,MN.wrap)(e,n,r)};_unwrap=(e,n)=>sz.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,MN.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{$f.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){$f.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{$f.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){$f.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=B.resolve(n);B.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,oNe.readFileSync)(qf.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{$f.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return iz(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=qf.normalize(r);return i.filter(d=>d.name===a).filter(d=>iz(d.supportedVersions,s,e.includePrerelease)).reduce((d,p)=>(p.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(d,e.moduleVersion)):d),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,u)=>{if(!u&&qf.isAbsolute(a)){let d=qf.parse(a);a=d.name,u=d.dir}return this._onRequire(e,i,a,u)},r=(i,a,u)=>this._onRequire(e,i,a,u),o=qf.isAbsolute(e.name)?new rNe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new nNe.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};fS.InstrumentationBase=vN;function iz(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,ZCe.satisfies)(e,r,{includePrerelease:n}))}});var uz=E(mS=>{"use strict";c();Object.defineProperty(mS,"__esModule",{value:!0});mS.normalize=void 0;var iNe=B("path");Object.defineProperty(mS,"normalize",{enumerable:!0,get:function(){return iNe.normalize}})});var cz=E(Bl=>{"use strict";c();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.normalize=Bl.InstrumentationBase=void 0;var aNe=az();Object.defineProperty(Bl,"InstrumentationBase",{enumerable:!0,get:function(){return aNe.InstrumentationBase}});var uNe=uz();Object.defineProperty(Bl,"normalize",{enumerable:!0,get:function(){return uNe.normalize}})});var kN=E(Fl=>{"use strict";c();Object.defineProperty(Fl,"__esModule",{value:!0});Fl.normalize=Fl.InstrumentationBase=void 0;var lz=cz();Object.defineProperty(Fl,"InstrumentationBase",{enumerable:!0,get:function(){return lz.InstrumentationBase}});Object.defineProperty(Fl,"normalize",{enumerable:!0,get:function(){return lz.normalize}})});var dz=E(_S=>{"use strict";c();Object.defineProperty(_S,"__esModule",{value:!0});_S.InstrumentationNodeModuleDefinition=void 0;var wN=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};_S.InstrumentationNodeModuleDefinition=wN});var pz=E(hS=>{"use strict";c();Object.defineProperty(hS,"__esModule",{value:!0});hS.InstrumentationNodeModuleFile=void 0;var cNe=kN(),LN=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,cNe.normalize)(e)}};hS.InstrumentationNodeModuleFile=LN});var fz=E(tu=>{"use strict";c();Object.defineProperty(tu,"__esModule",{value:!0});tu.semconvStabilityFromStr=tu.SemconvStability=void 0;var gS;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(gS=tu.SemconvStability||(tu.SemconvStability={}));function lNe(t,e){let n=gS.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=gS.DUPLICATE;break}else o.toLowerCase()===t&&(n=gS.STABLE);return n}tu.semconvStabilityFromStr=lNe});var _z=E(Tt=>{"use strict";c();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.semconvStabilityFromStr=Tt.SemconvStability=Tt.safeExecuteInTheMiddleAsync=Tt.safeExecuteInTheMiddle=Tt.isWrapped=Tt.InstrumentationNodeModuleFile=Tt.InstrumentationNodeModuleDefinition=Tt.InstrumentationBase=Tt.registerInstrumentations=void 0;var dNe=$9();Object.defineProperty(Tt,"registerInstrumentations",{enumerable:!0,get:function(){return dNe.registerInstrumentations}});var pNe=kN();Object.defineProperty(Tt,"InstrumentationBase",{enumerable:!0,get:function(){return pNe.InstrumentationBase}});var fNe=dz();Object.defineProperty(Tt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return fNe.InstrumentationNodeModuleDefinition}});var mNe=pz();Object.defineProperty(Tt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return mNe.InstrumentationNodeModuleFile}});var DN=PN();Object.defineProperty(Tt,"isWrapped",{enumerable:!0,get:function(){return DN.isWrapped}});Object.defineProperty(Tt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return DN.safeExecuteInTheMiddle}});Object.defineProperty(Tt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return DN.safeExecuteInTheMiddleAsync}});var mz=fz();Object.defineProperty(Tt,"SemconvStability",{enumerable:!0,get:function(){return mz.SemconvStability}});Object.defineProperty(Tt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return mz.semconvStabilityFromStr}})});var Iz=E(jl=>{"use strict";c();Object.defineProperty(jl,"__esModule",{value:!0});jl.PACKAGE_NAME=jl.PACKAGE_VERSION=void 0;jl.PACKAGE_VERSION="0.60.0";jl.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var GN=E(Do=>{"use strict";c();Object.defineProperty(Do,"__esModule",{value:!0});Do.HapiLifecycleMethodNames=Do.HapiLayerType=Do.handlerPatched=Do.HapiComponentName=void 0;Do.HapiComponentName="@hapi/hapi";Do.handlerPatched=Symbol("hapi-handler-patched");Do.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};Do.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var Oz=E(ES=>{"use strict";c();Object.defineProperty(ES,"__esModule",{value:!0});ES.ATTR_HTTP_METHOD=void 0;ES.ATTR_HTTP_METHOD="http.method"});var jN=E(zf=>{"use strict";c();Object.defineProperty(zf,"__esModule",{value:!0});zf.AttributeNames=void 0;var PNe;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(PNe=zf.AttributeNames||(zf.AttributeNames={}))});var xz=E(Et=>{"use strict";c();Object.defineProperty(Et,"__esModule",{value:!0});Et.getPluginFromInput=Et.getExtMetadata=Et.getRouteMetadata=Et.isPatchableExtMethod=Et.isDirectExtInput=Et.isLifecycleExtEventObj=Et.isLifecycleExtType=Et.getPluginName=void 0;var Cz=(fe(),x(Oe)),MNe=Oz(),Yf=GN(),Bi=jN(),Nz=se();function vNe(t){return t.name?t.name:t.pkg.name}Et.getPluginName=vNe;var kNe=t=>typeof t=="string"&&Yf.HapiLifecycleMethodNames.has(t);Et.isLifecycleExtType=kNe;var wNe=t=>{let e=t?.type;return e!==void 0&&(0,Et.isLifecycleExtType)(e)};Et.isLifecycleExtEventObj=wNe;var LNe=t=>Array.isArray(t)&&t.length<=3&&(0,Et.isLifecycleExtType)(t[0])&&typeof t[1]=="function";Et.isDirectExtInput=LNe;var DNe=t=>!Array.isArray(t);Et.isPatchableExtMethod=DNe;var UNe=(t,e,n)=>{let r={[Cz.ATTR_HTTP_ROUTE]:t.path};e&Nz.SemconvStability.OLD&&(r[MNe.ATTR_HTTP_METHOD]=t.method),e&Nz.SemconvStability.STABLE&&(r[Cz.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[Bi.AttributeNames.HAPI_TYPE]=Yf.HapiLayerType.PLUGIN,r[Bi.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[Bi.AttributeNames.HAPI_TYPE]=Yf.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};Et.getRouteMetadata=UNe;var BNe=(t,e,n)=>{let r=`ext - ${t}`;return n&&n!=="method"&&(r=`ext - ${t} - ${n}`),e?{attributes:{[Bi.AttributeNames.EXT_TYPE]:t,[Bi.AttributeNames.HAPI_TYPE]:Yf.HapiLayerType.EXT,[Bi.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ${r}`}:{attributes:{[Bi.AttributeNames.EXT_TYPE]:t,[Bi.AttributeNames.HAPI_TYPE]:Yf.HapiLayerType.EXT},name:r}};Et.getExtMetadata=BNe;var FNe=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;Et.getPluginFromInput=FNe});var vz=E(SS=>{"use strict";c();Object.defineProperty(SS,"__esModule",{value:!0});SS.HapiInstrumentation=void 0;var ir=(M(),x(L)),Pz=ye(),Wf=se(),Mz=Iz(),Kf=GN(),Is=xz(),HN=class extends Wf.InstrumentationBase{_semconvStability;constructor(e={}){super(Mz.PACKAGE_NAME,Mz.PACKAGE_VERSION,e),this._semconvStability=(0,Wf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Wf.InstrumentationNodeModuleDefinition(Kf.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Wf.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Wf.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Is.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Is.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let u=i[a];if((0,Is.isLifecycleExtType)(u.type)){let d=u,p=r._wrapExtMethods(d.method,u.type,n);d.method=p,i[a]=d}}return e.apply(this,s)}else if((0,Is.isDirectExtInput)(s)){let i=s,a=i[1],u=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],u,i[2]])}else if((0,Is.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Is.getPluginName)(e),o=e.register,s=this,i=function(a,u){return s._wrap(a,"route",d=>n._getServerRoutePatch.bind(n)(d,r)),s._wrap(a,"ext",d=>n._getServerExtPatch.bind(n)(d,r)),o.call(this,a,u)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Is.isPatchableExtMethod)(e))return e[Kf.handlerPatched]===!0?e:(e[Kf.handlerPatched]=!0,async function(...i){if(ir.trace.getSpan(ir.context.active())===void 0)return await e.apply(this,i);let a=(0,Is.getExtMetadata)(n,r,e.name),u=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await ir.context.with(ir.trace.setSpan(ir.context.active(),u),e,void 0,...i)}catch(d){throw u.recordException(d),u.setStatus({code:ir.SpanStatusCode.ERROR,message:d.message}),d}finally{u.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[Kf.handlerPatched]===!0)return e;e[Kf.handlerPatched]=!0;let o=s=>async function(...i){if(ir.trace.getSpan(ir.context.active())===void 0)return await s.call(this,...i);let a=(0,Pz.getRPCMetadata)(ir.context.active());a?.type===Pz.RPCType.HTTP&&(a.route=e.path);let u=(0,Is.getRouteMetadata)(e,r._semconvStability,n),d=r.tracer.startSpan(u.name,{attributes:u.attributes});try{return await ir.context.with(ir.trace.setSpan(ir.context.active(),d),()=>s.call(this,...i))}catch(p){throw d.recordException(p),d.setStatus({code:ir.SpanStatusCode.ERROR,message:p.message}),p}finally{d.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};SS.HapiInstrumentation=HN});var kz=E(Hl=>{"use strict";c();Object.defineProperty(Hl,"__esModule",{value:!0});Hl.AttributeNames=Hl.HapiInstrumentation=void 0;var GNe=vz();Object.defineProperty(Hl,"HapiInstrumentation",{enumerable:!0,get:function(){return GNe.HapiInstrumentation}});var jNe=jN();Object.defineProperty(Hl,"AttributeNames",{enumerable:!0,get:function(){return jNe.AttributeNames}})});var bS=E(Jf=>{"use strict";c();Object.defineProperty(Jf,"__esModule",{value:!0});Jf.KoaLayerType=void 0;var YNe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(YNe=Jf.KoaLayerType||(Jf.KoaLayerType={}))});var jz=E(Vl=>{"use strict";c();Object.defineProperty(Vl,"__esModule",{value:!0});Vl.PACKAGE_NAME=Vl.PACKAGE_VERSION=void 0;Vl.PACKAGE_VERSION="0.62.0";Vl.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var VN=E(Xf=>{"use strict";c();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.AttributeNames=void 0;var WNe;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(WNe=Xf.AttributeNames||(Xf.AttributeNames={}))});var Vz=E(ql=>{"use strict";c();Object.defineProperty(ql,"__esModule",{value:!0});ql.isLayerIgnored=ql.getMiddlewareMetadata=void 0;var Hz=bS(),RS=VN(),KNe=(fe(),x(Oe)),QNe=(t,e,n,r)=>n?{attributes:{[RS.AttributeNames.KOA_NAME]:r?.toString(),[RS.AttributeNames.KOA_TYPE]:Hz.KoaLayerType.ROUTER,[KNe.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[RS.AttributeNames.KOA_NAME]:e.name??"middleware",[RS.AttributeNames.KOA_TYPE]:Hz.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};ql.getMiddlewareMetadata=QNe;var JNe=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));ql.isLayerIgnored=JNe});var qz=E(IS=>{"use strict";c();Object.defineProperty(IS,"__esModule",{value:!0});IS.kLayerPatched=void 0;IS.kLayerPatched=Symbol("koa-layer-patched")});var Qz=E(OS=>{"use strict";c();Object.defineProperty(OS,"__esModule",{value:!0});OS.KoaInstrumentation=void 0;var Uo=(M(),x(L)),Zf=se(),$z=bS(),zz=jz(),Yz=Vz(),Wz=ye(),Kz=qz(),qN=class extends Zf.InstrumentationBase{constructor(e={}){super(zz.PACKAGE_NAME,zz.PACKAGE_VERSION,e)}init(){return new Zf.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Zf.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Zf.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){Uo.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let u=i[a];i[a]=this._patchLayer(u,!0,s)}}return e}_patchLayer(e,n,r){let o=n?$z.KoaLayerType.ROUTER:$z.KoaLayerType.MIDDLEWARE;return e[Kz.kLayerPatched]===!0||(0,Yz.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(Uo.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[Kz.kLayerPatched]=!0,Uo.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(Uo.trace.getSpan(Uo.context.active())===void 0)return e(s,i);let u=(0,Yz.getMiddlewareMetadata)(s,e,n,r),d=this.tracer.startSpan(u.name,{attributes:u.attributes}),p=(0,Wz.getRPCMetadata)(Uo.context.active());p?.type===Wz.RPCType.HTTP&&s._matchedRoute&&(p.route=s._matchedRoute.toString());let{requestHook:f}=this.getConfig();f&&(0,Zf.safeExecuteInTheMiddle)(()=>f(d,{context:s,middlewareLayer:e,layerType:o}),_=>{_&&Uo.diag.error("koa instrumentation: request hook failed",_)},!0);let m=Uo.trace.setSpan(Uo.context.active(),d);return Uo.context.with(m,async()=>{try{return await e(s,i)}catch(_){throw d.recordException(_),_}finally{d.end()}})})}};OS.KoaInstrumentation=qN});var Jz=E(Gi=>{"use strict";c();Object.defineProperty(Gi,"__esModule",{value:!0});Gi.KoaLayerType=Gi.AttributeNames=Gi.KoaInstrumentation=void 0;var XNe=Qz();Object.defineProperty(Gi,"KoaInstrumentation",{enumerable:!0,get:function(){return XNe.KoaInstrumentation}});var ZNe=VN();Object.defineProperty(Gi,"AttributeNames",{enumerable:!0,get:function(){return ZNe.AttributeNames}});var exe=bS();Object.defineProperty(Gi,"KoaLayerType",{enumerable:!0,get:function(){return exe.KoaLayerType}})});var $N=E(no=>{"use strict";c();Object.defineProperty(no,"__esModule",{value:!0});no.ConnectNames=no.ConnectTypes=no.AttributeNames=void 0;var nxe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(nxe=no.AttributeNames||(no.AttributeNames={}));var rxe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(rxe=no.ConnectTypes||(no.ConnectTypes={}));var oxe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(oxe=no.ConnectNames||(no.ConnectNames={}))});var nY=E($l=>{"use strict";c();Object.defineProperty($l,"__esModule",{value:!0});$l.PACKAGE_NAME=$l.PACKAGE_VERSION=void 0;$l.PACKAGE_VERSION="0.57.0";$l.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var rY=E(CS=>{"use strict";c();Object.defineProperty(CS,"__esModule",{value:!0});CS._LAYERS_STORE_PROPERTY=void 0;CS._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var oY=E(Hi=>{"use strict";c();Object.defineProperty(Hi,"__esModule",{value:!0});Hi.generateRoute=Hi.replaceCurrentStackRoute=Hi.addNewStackLayer=void 0;var sxe=(M(),x(L)),ji=rY(),ixe=t=>{Array.isArray(t[ji._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,ji._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[ji._LAYERS_STORE_PROPERTY].push("/");let e=t[ji._LAYERS_STORE_PROPERTY].length;return()=>{e===t[ji._LAYERS_STORE_PROPERTY].length?t[ji._LAYERS_STORE_PROPERTY].pop():sxe.diag.warn("Connect: Trying to pop the stack multiple time")}};Hi.addNewStackLayer=ixe;var axe=(t,e)=>{e&&t[ji._LAYERS_STORE_PROPERTY].splice(-1,1,e)};Hi.replaceCurrentStackRoute=axe;var uxe=t=>t[ji._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);Hi.generateRoute=uxe});var aY=E(Vi=>{"use strict";c();Object.defineProperty(Vi,"__esModule",{value:!0});Vi.ConnectInstrumentation=Vi.ANONYMOUS_NAME=void 0;var cxe=(M(),x(L)),sY=ye(),zl=$N(),iY=nY(),NS=se(),lxe=(fe(),x(Oe)),zN=oY();Vi.ANONYMOUS_NAME="anonymous";var YN=class extends NS.InstrumentationBase{constructor(e={}){super(iY.PACKAGE_NAME,iY.PACKAGE_VERSION,e)}init(){return[new NS.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,NS.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,NS.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=zl.ConnectTypes.REQUEST_HANDLER,s=zl.ConnectNames.REQUEST_HANDLER,o=e):(r=zl.ConnectTypes.MIDDLEWARE,s=zl.ConnectNames.MIDDLEWARE,o=n.name||Vi.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[lxe.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[zl.AttributeNames.CONNECT_TYPE]:r,[zl.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,u]=o?[1,2,3]:[0,1,2],d=arguments[i],p=arguments[a],f=arguments[u];(0,zN.replaceCurrentStackRoute)(d,e);let m=(0,sY.getRPCMetadata)(cxe.context.active());e&&m?.type===sY.RPCType.HTTP&&(m.route=(0,zN.generateRoute)(d));let _="";e?_=`request handler - ${e}`:_=`middleware - ${n.name||Vi.ANONYMOUS_NAME}`;let h=r._startSpan(e,n);r._diag.debug("start span",_);let g=!1;function T(){g?r._diag.debug(`span ${h.name} - already finished`):(g=!0,r._diag.debug(`finishing span ${h.name}`),h.end()),p.removeListener("close",T)}return p.addListener("close",T),arguments[u]=r._patchNext(f,T),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,zN.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};Vi.ConnectInstrumentation=YN});var cY=E(kr=>{"use strict";c();Object.defineProperty(kr,"__esModule",{value:!0});kr.ConnectTypes=kr.ConnectNames=kr.AttributeNames=kr.ANONYMOUS_NAME=kr.ConnectInstrumentation=void 0;var uY=aY();Object.defineProperty(kr,"ConnectInstrumentation",{enumerable:!0,get:function(){return uY.ConnectInstrumentation}});Object.defineProperty(kr,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return uY.ANONYMOUS_NAME}});var WN=$N();Object.defineProperty(kr,"AttributeNames",{enumerable:!0,get:function(){return WN.AttributeNames}});Object.defineProperty(kr,"ConnectNames",{enumerable:!0,get:function(){return WN.ConnectNames}});Object.defineProperty(kr,"ConnectTypes",{enumerable:!0,get:function(){return WN.ConnectTypes}})});var mY=E(Ut=>{"use strict";c();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.DB_SYSTEM_VALUE_MSSQL=Ut.ATTR_NET_PEER_PORT=Ut.ATTR_NET_PEER_NAME=Ut.ATTR_DB_USER=Ut.ATTR_DB_SYSTEM=Ut.ATTR_DB_STATEMENT=Ut.ATTR_DB_SQL_TABLE=Ut.ATTR_DB_NAME=void 0;Ut.ATTR_DB_NAME="db.name";Ut.ATTR_DB_SQL_TABLE="db.sql.table";Ut.ATTR_DB_STATEMENT="db.statement";Ut.ATTR_DB_SYSTEM="db.system";Ut.ATTR_DB_USER="db.user";Ut.ATTR_NET_PEER_NAME="net.peer.name";Ut.ATTR_NET_PEER_PORT="net.peer.port";Ut.DB_SYSTEM_VALUE_MSSQL="mssql"});var _Y=E(Yl=>{"use strict";c();Object.defineProperty(Yl,"__esModule",{value:!0});Yl.once=Yl.getSpanName=void 0;function pxe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}Yl.getSpanName=pxe;var fxe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Yl.once=fxe});var hY=E(Wl=>{"use strict";c();Object.defineProperty(Wl,"__esModule",{value:!0});Wl.PACKAGE_NAME=Wl.PACKAGE_VERSION=void 0;Wl.PACKAGE_VERSION="0.33.0";Wl.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var AY=E($i=>{"use strict";c();Object.defineProperty($i,"__esModule",{value:!0});$i.TediousInstrumentation=$i.INJECTED_CTX=void 0;var Kl=(M(),x(L)),mxe=B("events"),Bo=se(),nu=(fe(),x(Oe)),qi=mY(),gY=_Y(),TY=hY(),SY=Symbol("opentelemetry.instrumentation-tedious.current-database");$i.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var EY=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function xS(t){Object.defineProperty(this,SY,{value:t,writable:!0})}var KN=class t extends Bo.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(TY.PACKAGE_NAME,TY.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Bo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Bo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Bo.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of EY)(0,Bo.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,Bo.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of EY)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return xS.call(this,this.config?.options?.database),this.removeListener("databaseChange",xS),this.on("databaseChange",xS),this.once("end",()=>{this.removeListener("databaseChange",xS)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Kl.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,u=>{o()});Object.defineProperty(i,$i.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[$i.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof mxe.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,u=0,d=()=>u++,p=()=>a++,f=this[SY],m=(I=>I.sqlTextOrProcedure==="sp_prepare"&&I.parametersByName?.stmt?.value?I.parametersByName.stmt.value:I.sqlTextOrProcedure)(i),_={};o._dbSemconvStability&Bo.SemconvStability.OLD&&(_[qi.ATTR_DB_SYSTEM]=qi.DB_SYSTEM_VALUE_MSSQL,_[qi.ATTR_DB_NAME]=f,_[qi.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,_[qi.ATTR_DB_STATEMENT]=m,_[qi.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&Bo.SemconvStability.STABLE&&(_[nu.ATTR_DB_NAMESPACE]=f,_[nu.ATTR_DB_SYSTEM_NAME]=nu.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,_[nu.ATTR_DB_QUERY_TEXT]=m,_[nu.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&Bo.SemconvStability.OLD&&(_[qi.ATTR_NET_PEER_NAME]=this.config?.server,_[qi.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&Bo.SemconvStability.STABLE&&(_[nu.ATTR_SERVER_ADDRESS]=this.config?.server,_[nu.ATTR_SERVER_PORT]=this.config?.options?.port);let h=o.tracer.startSpan((0,gY.getSpanName)(e,f,m,i.table),{kind:Kl.SpanKind.CLIENT,attributes:_}),g=(0,gY.once)(I=>{i.removeListener("done",d),i.removeListener("doneInProc",d),i.removeListener("doneProc",p),i.removeListener("error",g),this.removeListener("end",g),h.setAttribute("tedious.procedure_count",a),h.setAttribute("tedious.statement_count",u),I&&h.setStatus({code:Kl.SpanStatusCode.ERROR,message:I.message}),h.end()});i.on("done",d),i.on("doneInProc",d),i.on("doneProc",p),i.once("error",g),this.on("end",g),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(g)):o._diag.error("Expected request.callback to be a function");let T=()=>Kl.context.with(Kl.trace.setSpan(Kl.context.active(),h),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return T();let R=o._buildTraceparent(h);o._injectContextInfo(this,n,R).finally(T)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};$i.TediousInstrumentation=KN});var yY=E(PS=>{"use strict";c();Object.defineProperty(PS,"__esModule",{value:!0});PS.TediousInstrumentation=void 0;var _xe=AY();Object.defineProperty(PS,"TediousInstrumentation",{enumerable:!0,get:function(){return _xe.TediousInstrumentation}})});var CY=E(Ql=>{"use strict";c();Object.defineProperty(Ql,"__esModule",{value:!0});Ql.PACKAGE_NAME=Ql.PACKAGE_VERSION=void 0;Ql.PACKAGE_VERSION="0.57.0";Ql.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var xY=E(MS=>{"use strict";c();Object.defineProperty(MS,"__esModule",{value:!0});MS.GenericPoolInstrumentation=void 0;var Jl=(M(),x(L)),ru=se(),NY=CY(),QN="generic-pool",JN=class extends ru.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(NY.PACKAGE_NAME,NY.PACKAGE_VERSION,e)}init(){return[new ru.InstrumentationNodeModuleDefinition(QN,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,ru.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new ru.InstrumentationNodeModuleDefinition(QN,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,ru.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new ru.InstrumentationNodeModuleDefinition(QN,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,ru.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=Jl.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return Jl.context.with(Jl.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=Jl.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return Jl.context.with(Jl.trace.setSpan(i,a),()=>{e.call(this,(u,d)=>{if(a.end(),o)return o(u,d)},s)})}}};MS.GenericPoolInstrumentation=JN});var PY=E(vS=>{"use strict";c();Object.defineProperty(vS,"__esModule",{value:!0});vS.GenericPoolInstrumentation=void 0;var Txe=xY();Object.defineProperty(vS,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return Txe.GenericPoolInstrumentation}})});var XN=E(Fo=>{"use strict";c();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ATTR_NET_PEER_PORT=Fo.ATTR_NET_PEER_NAME=Fo.ATTR_MESSAGING_SYSTEM=Fo.ATTR_MESSAGING_OPERATION=void 0;Fo.ATTR_MESSAGING_OPERATION="messaging.operation";Fo.ATTR_MESSAGING_SYSTEM="messaging.system";Fo.ATTR_NET_PEER_NAME="net.peer.name";Fo.ATTR_NET_PEER_PORT="net.peer.port"});var ZN=E(Je=>{"use strict";c();Object.defineProperty(Je,"__esModule",{value:!0});Je.ATTR_MESSAGING_CONVERSATION_ID=Je.OLD_ATTR_MESSAGING_MESSAGE_ID=Je.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=Je.ATTR_MESSAGING_URL=Je.ATTR_MESSAGING_PROTOCOL_VERSION=Je.ATTR_MESSAGING_PROTOCOL=Je.MESSAGING_OPERATION_VALUE_PROCESS=Je.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=Je.ATTR_MESSAGING_DESTINATION_KIND=Je.ATTR_MESSAGING_DESTINATION=void 0;Je.ATTR_MESSAGING_DESTINATION="messaging.destination";Je.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";Je.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";Je.MESSAGING_OPERATION_VALUE_PROCESS="process";Je.ATTR_MESSAGING_PROTOCOL="messaging.protocol";Je.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";Je.ATTR_MESSAGING_URL="messaging.url";Je.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";Je.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";Je.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var ex=E(ou=>{"use strict";c();Object.defineProperty(ou,"__esModule",{value:!0});ou.DEFAULT_CONFIG=ou.EndOperation=void 0;var Sxe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(Sxe=ou.EndOperation||(ou.EndOperation={}));ou.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var BY=E(Xe=>{"use strict";c();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.isConfirmChannelTracing=Xe.unmarkConfirmChannelTracing=Xe.markConfirmChannelTracing=Xe.getConnectionAttributesFromUrl=Xe.getConnectionAttributesFromServer=Xe.normalizeExchange=Xe.CONNECTION_ATTRIBUTES=Xe.CHANNEL_CONSUME_TIMEOUT_TIMER=Xe.CHANNEL_SPANS_NOT_ENDED=Xe.MESSAGE_STORED_SPAN=void 0;var tx=(M(),x(L)),zi=se(),kS=(fe(),x(Oe)),em=XN(),wS=ZN();Xe.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Xe.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Xe.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Xe.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var nx=(0,tx.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),Axe=t=>t!==""?t:"<default>";Xe.normalizeExchange=Axe;var yxe=t=>t.replace(/:[^:@/]*@/,":***@"),LY=(t,e)=>t||(e==="AMQP"?5672:5671),DY=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},UY=t=>t||"localhost",Go=(t,e,n,r)=>n?{[e]:n}:(tx.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),bxe=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[em.ATTR_MESSAGING_SYSTEM]:e}:{}};Xe.getConnectionAttributesFromServer=bxe;var Rxe=(t,e)=>{let n={[wS.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=DY(r?.protocol);Object.assign(n,{...Go(t,wS.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=UY(r?.hostname);e&zi.SemconvStability.OLD&&Object.assign(n,{...Go(t,em.ATTR_NET_PEER_NAME,s,"hostname")}),e&zi.SemconvStability.STABLE&&Object.assign(n,{...Go(t,kS.ATTR_SERVER_ADDRESS,s,"hostname")});let i=LY(r.port,o);e&zi.SemconvStability.OLD&&Object.assign(n,Go(t,em.ATTR_NET_PEER_PORT,i,"port")),e&zi.SemconvStability.STABLE&&Object.assign(n,Go(t,kS.ATTR_SERVER_PORT,i,"port"))}else{let r=yxe(t);n[wS.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=DY(o.protocol);Object.assign(n,{...Go(r,wS.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=UY(o.hostname);e&zi.SemconvStability.OLD&&Object.assign(n,{...Go(r,em.ATTR_NET_PEER_NAME,i,"hostname")}),e&zi.SemconvStability.STABLE&&Object.assign(n,{...Go(r,kS.ATTR_SERVER_ADDRESS,i,"hostname")});let a=LY(o.port?parseInt(o.port):void 0,s);e&zi.SemconvStability.OLD&&Object.assign(n,Go(r,em.ATTR_NET_PEER_PORT,a,"port")),e&zi.SemconvStability.STABLE&&Object.assign(n,Go(r,kS.ATTR_SERVER_PORT,a,"port"))}catch(o){tx.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Xe.getConnectionAttributesFromUrl=Rxe;var Ixe=t=>t.setValue(nx,!0);Xe.markConfirmChannelTracing=Ixe;var Oxe=t=>t.deleteValue(nx);Xe.unmarkConfirmChannelTracing=Oxe;var Cxe=t=>t.getValue(nx)===!0;Xe.isConfirmChannelTracing=Cxe});var FY=E(Xl=>{"use strict";c();Object.defineProperty(Xl,"__esModule",{value:!0});Xl.PACKAGE_NAME=Xl.PACKAGE_VERSION=void 0;Xl.PACKAGE_VERSION="0.61.0";Xl.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var jY=E(US=>{"use strict";c();Object.defineProperty(US,"__esModule",{value:!0});US.AmqplibInstrumentation=void 0;var qe=(M(),x(L)),LS=ye(),be=se(),Nxe=XN(),ar=ZN(),xn=ex(),Ze=BY(),GY=FY(),DS=[">=0.5.5 <1"],rx=class extends be.InstrumentationBase{_netSemconvStability;constructor(e={}){super(GY.PACKAGE_NAME,GY.PACKAGE_VERSION,{...xn.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,be.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...xn.DEFAULT_CONFIG,...e})}init(){let e=new be.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",DS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new be.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",DS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new be.InstrumentationNodeModuleFile("amqplib/lib/connect.js",DS,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new be.InstrumentationNodeModuleDefinition("amqplib",DS,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,be.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,be.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,be.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,be.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,be.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,xn.EndOperation.Ack)),(0,be.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,xn.EndOperation.Nack)),(0,be.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,xn.EndOperation.Reject)),(0,be.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,xn.EndOperation.AckAll)),(0,be.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,xn.EndOperation.NackAll)),(0,be.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,be.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,be.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,be.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,be.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,be.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,be.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,be.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,be.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,be.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,be.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,u){if(a==null){let d=(0,Ze.getConnectionAttributesFromUrl)(o,n._netSemconvStability),p=(0,Ze.getConnectionAttributesFromServer)(u);u[Ze.CONNECTION_ATTRIBUTES]={...d,...p}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,xn.EndOperation.ChannelClosed,void 0);let s=this[Ze.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[Ze.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,xn.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,u){let d=this,p=n===xn.EndOperation.Reject?a:u,f=d[Ze.CHANNEL_SPANS_NOT_ENDED]??[],m=f.findIndex(_=>_.msg===i);if(m<0)o.endConsumerSpan(i,e,n,p);else if(n!==xn.EndOperation.Reject&&a){for(let _=0;_<=m;_++)o.endConsumerSpan(f[_].msg,e,n,p);f.splice(0,m+1)}else o.endConsumerSpan(i,e,n,p),f.splice(m,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let u=this;if(!Object.prototype.hasOwnProperty.call(u,Ze.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:p}=r.getConfig();if(p){let f=setInterval(()=>{r.checkConsumeTimeoutOnChannel(u)},p);f.unref(),u[Ze.CHANNEL_CONSUME_TIMEOUT_TIMER]=f}u[Ze.CHANNEL_SPANS_NOT_ENDED]=[]}let d=function(p){if(!p)return i.call(this,p);let f=p.properties.headers??{},m=qe.propagation.extract(qe.ROOT_CONTEXT,f),_=p.fields?.exchange,h;if(r._config.useLinksForConsume){let A=m?qe.trace.getSpan(m)?.spanContext():void 0;m=void 0,A&&(h=[{context:A}])}let g=r.tracer.startSpan(`${s} process`,{kind:qe.SpanKind.CONSUMER,attributes:{...u?.connection?.[Ze.CONNECTION_ATTRIBUTES],[ar.ATTR_MESSAGING_DESTINATION]:_,[ar.ATTR_MESSAGING_DESTINATION_KIND]:ar.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[ar.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:p.fields?.routingKey,[Nxe.ATTR_MESSAGING_OPERATION]:ar.MESSAGING_OPERATION_VALUE_PROCESS,[ar.OLD_ATTR_MESSAGING_MESSAGE_ID]:p?.properties.messageId,[ar.ATTR_MESSAGING_CONVERSATION_ID]:p?.properties.correlationId},links:h},m),{consumeHook:T}=r.getConfig();T&&(0,be.safeExecuteInTheMiddle)(()=>T(g,{moduleVersion:e,msg:p}),A=>{A&&qe.diag.error("amqplib instrumentation: consumerHook error",A)},!0),a?.noAck||(u[Ze.CHANNEL_SPANS_NOT_ENDED].push({msg:p,timeOfConsume:(0,LS.hrTime)()}),p[Ze.MESSAGE_STORED_SPAN]=g);let S=m||qe.ROOT_CONTEXT;qe.context.with(qe.trace.setSpan(S,g),()=>{i.call(this,p)}),a?.noAck&&(r.callConsumeEndHook(g,p,!1,xn.EndOperation.AutoAck),g.end())};return arguments[1]=d,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,u,d){let p=this,{span:f,modifiedOptions:m}=r.createPublishSpan(r,s,i,p,u),{publishHook:_}=r.getConfig();_&&(0,be.safeExecuteInTheMiddle)(()=>_(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:m,isConfirmChannel:!0}),S=>{S&&qe.diag.error("amqplib instrumentation: publishHook error",S)},!0);let h=function(S,A){try{d?.call(this,S,A)}finally{let{publishConfirmHook:R}=r.getConfig();R&&(0,be.safeExecuteInTheMiddle)(()=>R(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:u,isConfirmChannel:!0,confirmError:S}),I=>{I&&qe.diag.error("amqplib instrumentation: publishConfirmHook error",I)},!0),S&&f.setStatus({code:qe.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),f.end()}},g=(0,Ze.markConfirmChannelTracing)(qe.context.active()),T=[...arguments];return T[3]=m,T[4]=qe.context.bind((0,Ze.unmarkConfirmChannelTracing)(qe.trace.setSpan(g,f)),h),qe.context.with(g,n.bind(this,...T))}}getPublishPatch(e,n){let r=this;return function(s,i,a,u){if((0,Ze.isConfirmChannelTracing)(qe.context.active()))return n.apply(this,arguments);{let d=this,{span:p,modifiedOptions:f}=r.createPublishSpan(r,s,i,d,u),{publishHook:m}=r.getConfig();m&&(0,be.safeExecuteInTheMiddle)(()=>m(p,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:f,isConfirmChannel:!1}),g=>{g&&qe.diag.error("amqplib instrumentation: publishHook error",g)},!0);let _=[...arguments];_[3]=f;let h=n.apply(this,_);return p.end(),h}}}createPublishSpan(e,n,r,o,s){let i=(0,Ze.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:qe.SpanKind.PRODUCER,attributes:{...o.connection[Ze.CONNECTION_ATTRIBUTES],[ar.ATTR_MESSAGING_DESTINATION]:n,[ar.ATTR_MESSAGING_DESTINATION_KIND]:ar.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[ar.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[ar.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[ar.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),u=s??{};return u.headers=u.headers??{},qe.propagation.inject(qe.trace.setSpan(qe.context.active(),a),u.headers),{span:a,modifiedOptions:u}}endConsumerSpan(e,n,r,o){let s=e[Ze.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:qe.SpanStatusCode.ERROR,message:r!==xn.EndOperation.ChannelClosed&&r!==xn.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[Ze.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[Ze.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[Ze.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,be.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&qe.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,LS.hrTime)(),r=e[Ze.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,LS.hrTimeDuration)(i.timeOfConsume,n);if((0,LS.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,xn.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};US.AmqplibInstrumentation=rx});var VY=E(Yi=>{"use strict";c();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.EndOperation=Yi.DEFAULT_CONFIG=Yi.AmqplibInstrumentation=void 0;var xxe=jY();Object.defineProperty(Yi,"AmqplibInstrumentation",{enumerable:!0,get:function(){return xxe.AmqplibInstrumentation}});var HY=ex();Object.defineProperty(Yi,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return HY.DEFAULT_CONFIG}});Object.defineProperty(Yi,"EndOperation",{enumerable:!0,get:function(){return HY.EndOperation}})});var SQ=E((nyt,EQ)=>{"use strict";c();var fQ="-",o2e=/^xn--/,s2e=/[^\0-\x7F]/,i2e=/[\x2E\u3002\uFF0E\uFF61]/g,a2e={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$P=35,Jo=Math.floor,zP=String.fromCharCode;function na(t){throw new RangeError(a2e[t])}function u2e(t,e){let n=[],r=t.length;for(;r--;)n[r]=e(t[r]);return n}function mQ(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(i2e,".");let o=t.split("."),s=u2e(o,e).join(".");return r+s}function _Q(t){let e=[],n=0,r=t.length;for(;n<r;){let o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){let s=t.charCodeAt(n++);(s&64512)==56320?e.push(((o&1023)<<10)+(s&1023)+65536):(e.push(o),n--)}else e.push(o)}return e}var c2e=t=>String.fromCodePoint(...t),l2e=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},pQ=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},hQ=function(t,e,n){let r=0;for(t=n?Jo(t/700):t>>1,t+=Jo(t/e);t>$P*26>>1;r+=36)t=Jo(t/$P);return Jo(r+($P+1)*t/(t+38))},gQ=function(t){let e=[],n=t.length,r=0,o=128,s=72,i=t.lastIndexOf(fQ);i<0&&(i=0);for(let a=0;a<i;++a)t.charCodeAt(a)>=128&&na("not-basic"),e.push(t.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){let u=r;for(let p=1,f=36;;f+=36){a>=n&&na("invalid-input");let m=l2e(t.charCodeAt(a++));m>=36&&na("invalid-input"),m>Jo((2147483647-r)/p)&&na("overflow"),r+=m*p;let _=f<=s?1:f>=s+26?26:f-s;if(m<_)break;let h=36-_;p>Jo(2147483647/h)&&na("overflow"),p*=h}let d=e.length+1;s=hQ(r-u,d,u==0),Jo(r/d)>2147483647-o&&na("overflow"),o+=Jo(r/d),r%=d,e.splice(r++,0,o)}return String.fromCodePoint(...e)},TQ=function(t){let e=[];t=_Q(t);let n=t.length,r=128,o=0,s=72;for(let u of t)u<128&&e.push(zP(u));let i=e.length,a=i;for(i&&e.push(fQ);a<n;){let u=2147483647;for(let p of t)p>=r&&p<u&&(u=p);let d=a+1;u-r>Jo((2147483647-o)/d)&&na("overflow"),o+=(u-r)*d,r=u;for(let p of t)if(p<r&&++o>2147483647&&na("overflow"),p===r){let f=o;for(let m=36;;m+=36){let _=m<=s?1:m>=s+26?26:m-s;if(f<_)break;let h=f-_,g=36-_;e.push(zP(pQ(_+h%g,0))),f=Jo(h/g)}e.push(zP(pQ(f,0))),s=hQ(o,d,a===i),o=0,++a}++o,++r}return e.join("")},d2e=function(t){return mQ(t,function(e){return o2e.test(e)?gQ(e.slice(4).toLowerCase()):e})},p2e=function(t){return mQ(t,function(e){return s2e.test(e)?"xn--"+TQ(e):e})},f2e={version:"2.3.1",ucs2:{decode:_Q,encode:c2e},decode:gQ,encode:TQ,toASCII:p2e,toUnicode:d2e};EQ.exports=f2e});c();c();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="86f9ae46-f16c-4a73-b84d-34620c4c67af",t._sentryDebugIdIdentifier="sentry-dbid-86f9ae46-f16c-4a73-b84d-34620c4c67af")}catch{}})();c();c();c();c();M();var VV=J(fF(),1);c();c();c();var v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;c();c();var ee=globalThis;c();c();c();c();var me="10.47.0";function En(){return Ks(ee),ee}function Ks(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||me,e[me]=e[me]||{}}function Vr(t,e,n=ee){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[me]=r[me]||{};return o[t]||(o[t]=e())}var ep=["debug","info","warn","error","log","assert","trace"],xfe="Sentry Logger ",lc={};function rt(t){if(!("console"in ee))return t();let e=ee.console,n={},r=Object.keys(lc);r.forEach(o=>{let s=lc[o];n[o]=e[o],e[o]=s});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function Pfe(){Nb().enabled=!0}function Mfe(){Nb().enabled=!1}function mF(){return Nb().enabled}function vfe(...t){Cb("log",...t)}function kfe(...t){Cb("warn",...t)}function wfe(...t){Cb("error",...t)}function Cb(t,...e){v&&mF()&&rt(()=>{ee.console[t](`${xfe}[${t}]:`,...e)})}function Nb(){return v?Vr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var b={enable:Pfe,disable:Mfe,isEnabled:mF,log:vfe,warn:kfe,error:wfe};c();var th="?",_F=/\(error: (.*)\)/,hF=/captureMessage|captureException/;function nh(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
|
|
12
|
+
Mongoose Error Code: ${e.code}`:""}`})}function GC(t,e,n,r=void 0){n&&(0,Cf.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&X5.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function NIe(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(GC(e,o,n,r),o)).catch(o=>{throw Z5(e,o),o}).finally(()=>e.end()):(GC(e,t,n,r),e.end(),t)}xi.handlePromiseResponse=NIe;function xIe(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(u,d)=>(u?Z5(r,u):GC(r,d,s,i),r.end(),t(u,d)),e.apply(n,o)}xi.handleCallbackResponse=xIe});var t$=E(Rl=>{"use strict";c();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.PACKAGE_NAME=Rl.PACKAGE_VERSION=void 0;Rl.PACKAGE_VERSION="0.60.0";Rl.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var i$=E(Fn=>{"use strict";c();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.MongooseInstrumentation=Fn._ALREADY_INSTRUMENTED=Fn._STORED_PARENT_SPAN=void 0;var It=(M(),x(L)),PIe=ye(),jC=e$(),Jt=se(),n$=t$(),Pi=FC(),Ja=(fe(),x(Oe)),bE=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],MIe=["remove","count","findOneAndRemove",...bE],vIe=["count","findOneAndRemove",...bE],kIe=[...bE];function r$(t){return t?t.startsWith("6.")||t.startsWith("5.")?MIe:t.startsWith("7.")?vIe:kIe:bE}function o$(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function s$(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}Fn._STORED_PARENT_SPAN=Symbol("stored-parent-span");Fn._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var HC=class extends Jt.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(n$.PACKAGE_NAME,n$.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Jt.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Jt.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Jt.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,o$(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),s$(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)),r$(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=r$(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,o$(n)&&this._unwrap(r.Model.prototype,"remove"),s$(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return r.apply(this,arguments);let i=this[Fn._STORED_PARENT_SPAN],a={},{dbStatementSerializer:u}=n.getConfig();if(u){let p=u("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Jt.SemconvStability.OLD&&(a[Pi.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&Jt.SemconvStability.STABLE&&(a[Ja.ATTR_DB_QUERY_TEXT]=p)}let d=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[Fn._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return r.apply(this,arguments);let i=this[Fn._STORED_PARENT_SPAN],a={},{dbStatementSerializer:u}=n.getConfig();if(u){let p=u(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Jt.SemconvStability.OLD&&(a[Pi.ATTR_DB_STATEMENT]=p),n._dbSemconvStability&Jt.SemconvStability.STABLE&&(a[Ja.ATTR_DB_QUERY_TEXT]=p)}let d=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return o.apply(this,arguments);let u={document:this};i&&!(i instanceof Function)&&(u.options=i);let d={},{dbStatementSerializer:p}=r.getConfig();if(p){let m=p(e,u);r._dbSemconvStability&Jt.SemconvStability.OLD&&(d[Pi.ATTR_DB_STATEMENT]=m),r._dbSemconvStability&Jt.SemconvStability.STABLE&&(d[Ja.ATTR_DB_QUERY_TEXT]=m)}let f=r._startSpan(this.constructor.collection,this.constructor.modelName,e,d);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(f,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,u){if(r.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return o.apply(this,arguments);let d=u,p=i,f=a;typeof i=="function"?(d=i,p=void 0,f=void 0):typeof a=="function"&&(d=a,f=void 0);let m={},_=r.getConfig().dbStatementSerializer;if(_){let T=_(e,{condition:{_id:this._id},updates:p,options:f});r._dbSemconvStability&Jt.SemconvStability.OLD&&(m[Pi.ATTR_DB_STATEMENT]=T),r._dbSemconvStability&Jt.SemconvStability.STABLE&&(m[Ja.ATTR_DB_QUERY_TEXT]=T)}let h=r._startSpan(this.constructor.collection,this.constructor.modelName,e,m),g=r._handleResponse(h,o,this,arguments,d,n);return g&&typeof g=="object"&&(g[Fn._ALREADY_INSTRUMENTED]=!0),g}}patchModelStatic(e,n){let r=this;return o=>function(i,a,u){if(r.getConfig().requireParentSpan&&It.trace.getSpan(It.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(u=a,a=void 0);let d={};switch(e){case"insertMany":d.documents=i;break;case"bulkWrite":d.operations=i;break;default:d.document=i;break}a!==void 0&&(d.options=a);let p={},{dbStatementSerializer:f}=r.getConfig();if(f){let _=f(e,d);r._dbSemconvStability&Jt.SemconvStability.OLD&&(p[Pi.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&Jt.SemconvStability.STABLE&&(p[Ja.ATTR_DB_QUERY_TEXT]=_)}let m=r._startSpan(this.collection,this.modelName,e,p);return r._handleResponse(m,o,this,arguments,u,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=It.trace.getSpan(It.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[Fn._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[Fn._STORED_PARENT_SPAN]=It.trace.getSpan(It.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,jC.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Jt.SemconvStability.OLD&&(i[Pi.ATTR_DB_OPERATION]=r,i[Pi.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Jt.SemconvStability.STABLE&&(i[Ja.ATTR_DB_OPERATION_NAME]=r,i[Ja.ATTR_DB_SYSTEM_NAME]=Pi.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&Jt.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:It.SpanKind.CLIENT,attributes:i},s?It.trace.setSpan(It.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,jC.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let u=a._callOriginalFunction(()=>n.apply(r,o));return(0,jC.handlePromiseResponse)(u,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?It.context.with((0,PIe.suppressTracing)(It.context.active()),e):e()}};Fn.MongooseInstrumentation=HC});var a$=E(RE=>{"use strict";c();Object.defineProperty(RE,"__esModule",{value:!0});RE.MongooseInstrumentation=void 0;var wIe=i$();Object.defineProperty(RE,"MongooseInstrumentation",{enumerable:!0,get:function(){return wIe.MongooseInstrumentation}})});var p$=E(gt=>{"use strict";c();Object.defineProperty(gt,"__esModule",{value:!0});gt.METRIC_DB_CLIENT_CONNECTIONS_USAGE=gt.DB_SYSTEM_VALUE_MYSQL=gt.ATTR_NET_PEER_PORT=gt.ATTR_NET_PEER_NAME=gt.ATTR_DB_USER=gt.ATTR_DB_SYSTEM=gt.ATTR_DB_STATEMENT=gt.ATTR_DB_NAME=gt.ATTR_DB_CONNECTION_STRING=void 0;gt.ATTR_DB_CONNECTION_STRING="db.connection_string";gt.ATTR_DB_NAME="db.name";gt.ATTR_DB_STATEMENT="db.statement";gt.ATTR_DB_SYSTEM="db.system";gt.ATTR_DB_USER="db.user";gt.ATTR_NET_PEER_NAME="net.peer.name";gt.ATTR_NET_PEER_PORT="net.peer.port";gt.DB_SYSTEM_VALUE_MYSQL="mysql";gt.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var f$=E(Nf=>{"use strict";c();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.AttributeNames=void 0;var DIe;(function(t){t.MYSQL_VALUES="db.mysql.values"})(DIe=Nf.AttributeNames||(Nf.AttributeNames={}))});var m$=E(ln=>{"use strict";c();Object.defineProperty(ln,"__esModule",{value:!0});ln.getPoolNameOld=ln.arrayStringifyHelper=ln.getSpanName=ln.getDbValues=ln.getDbQueryText=ln.getJDBCString=ln.getConfig=void 0;function UIe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}ln.getConfig=UIe;function BIe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}ln.getJDBCString=BIe;function FIe(t){return typeof t=="string"?t:t.sql}ln.getDbQueryText=FIe;function GIe(t,e){return VC(typeof t=="string"?e:e||t.values)}ln.getDbValues=GIe;function jIe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}ln.getSpanName=jIe;function VC(t){return t?`[${t.toString()}]`:""}ln.arrayStringifyHelper=VC;function HIe(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}ln.getPoolNameOld=HIe});var _$=E(Il=>{"use strict";c();Object.defineProperty(Il,"__esModule",{value:!0});Il.PACKAGE_NAME=Il.PACKAGE_VERSION=void 0;Il.PACKAGE_VERSION="0.60.0";Il.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var g$=E(IE=>{"use strict";c();Object.defineProperty(IE,"__esModule",{value:!0});IE.MySQLInstrumentation=void 0;var Gn=(M(),x(L)),Nr=se(),Ol=(fe(),x(Oe)),Rs=p$(),VIe=f$(),Xa=m$(),h$=_$(),qC=class extends Nr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(h$.PACKAGE_NAME,h$.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Nr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Nr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Rs.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new Nr.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,Nr.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,Nr.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,Nr.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,u=i-a,d=(0,Xa.getPoolNameOld)(e);r._connCountAdd(-u,d,"used"),r._connCountAdd(-a,d,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let u=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),d=a[u].pool;r._setPoolCallbacks(d,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let u=r._getConnectionCallbackPatchFn(s);return n.call(e,u)}if(arguments.length===2&&typeof i=="function"){let u=r._getConnectionCallbackPatchFn(i);return n.call(e,s,u)}if(arguments.length===3&&typeof a=="function"){let u=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,u)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=Gn.context.active();return function(o,s){s&&((0,Nr.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&Gn.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:u,port:d,database:p,user:f}=(0,Xa.getConfig)(e.config),m=parseInt(d,10),_=(0,Xa.getDbQueryText)(o);r._dbSemconvStability&Nr.SemconvStability.OLD&&(a[Rs.ATTR_DB_SYSTEM]=Rs.DB_SYSTEM_VALUE_MYSQL,a[Rs.ATTR_DB_CONNECTION_STRING]=(0,Xa.getJDBCString)(u,d,p),a[Rs.ATTR_DB_NAME]=p,a[Rs.ATTR_DB_USER]=f,a[Rs.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&Nr.SemconvStability.STABLE&&(a[Ol.ATTR_DB_SYSTEM_NAME]=Ol.DB_SYSTEM_NAME_VALUE_MYSQL,a[Ol.ATTR_DB_NAMESPACE]=p,a[Ol.ATTR_DB_QUERY_TEXT]=_),r._netSemconvStability&Nr.SemconvStability.OLD&&(a[Rs.ATTR_NET_PEER_NAME]=u,isNaN(m)||(a[Rs.ATTR_NET_PEER_PORT]=m)),r._netSemconvStability&Nr.SemconvStability.STABLE&&(a[Ol.ATTR_SERVER_ADDRESS]=u,isNaN(m)||(a[Ol.ATTR_SERVER_PORT]=m));let h=r.tracer.startSpan((0,Xa.getSpanName)(o),{kind:Gn.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let S;Array.isArray(s)?S=s:arguments[2]&&(S=[s]),h.setAttribute(VIe.AttributeNames.MYSQL_VALUES,(0,Xa.getDbValues)(o,S))}let g=Array.from(arguments).findIndex(S=>typeof S=="function"),T=Gn.context.active();if(g===-1){let S=Gn.context.with(Gn.trace.setSpan(Gn.context.active(),h),()=>n.apply(e,arguments));return Gn.context.bind(T,S),S.on("error",A=>h.setStatus({code:Gn.SpanStatusCode.ERROR,message:A.message})).on("end",()=>{h.end()})}else return r._wrap(arguments,g,r._patchCallbackQuery(h,T)),Gn.context.with(Gn.trace.setSpan(Gn.context.active(),h),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:Gn.SpanStatusCode.ERROR,message:o.message}),e.end(),Gn.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,Xa.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};IE.MySQLInstrumentation=qC});var T$=E(OE=>{"use strict";c();Object.defineProperty(OE,"__esModule",{value:!0});OE.MySQLInstrumentation=void 0;var qIe=g$();Object.defineProperty(OE,"MySQLInstrumentation",{enumerable:!0,get:function(){return qIe.MySQLInstrumentation}})});var $C=E(Lt=>{"use strict";c();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.DB_SYSTEM_VALUE_MYSQL=Lt.ATTR_NET_PEER_PORT=Lt.ATTR_NET_PEER_NAME=Lt.ATTR_DB_USER=Lt.ATTR_DB_SYSTEM=Lt.ATTR_DB_STATEMENT=Lt.ATTR_DB_NAME=Lt.ATTR_DB_CONNECTION_STRING=void 0;Lt.ATTR_DB_CONNECTION_STRING="db.connection_string";Lt.ATTR_DB_NAME="db.name";Lt.ATTR_DB_STATEMENT="db.statement";Lt.ATTR_DB_SYSTEM="db.system";Lt.ATTR_DB_USER="db.user";Lt.ATTR_NET_PEER_NAME="net.peer.name";Lt.ATTR_NET_PEER_PORT="net.peer.port";Lt.DB_SYSTEM_VALUE_MYSQL="mysql"});var YC=E(CE=>{"use strict";c();Object.defineProperty(CE,"__esModule",{value:!0});CE.addSqlCommenterComment=void 0;var zC=(M(),x(L)),zIe=ye();function YIe(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function WIe(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function KIe(t,e){if(typeof e!="string"||e.length===0||YIe(e))return e;let n=new zIe.W3CTraceContextPropagator,r={};n.inject(zC.trace.setSpan(zC.ROOT_CONTEXT,t),r,zC.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=WIe(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}CE.addSqlCommenterComment=KIe});var b$=E(xr=>{"use strict";c();Object.defineProperty(xr,"__esModule",{value:!0});xr.getConnectionPrototypeToInstrument=xr.once=xr.getSpanName=xr.getQueryText=xr.getConnectionAttributes=void 0;var xf=$C(),NE=se(),WC=(fe(),x(Oe));function QIe(t,e,n){let{host:r,port:o,database:s,user:i}=JIe(t),a={};e&NE.SemconvStability.OLD&&(a[xf.ATTR_DB_CONNECTION_STRING]=XIe(r,o,s),a[xf.ATTR_DB_NAME]=s,a[xf.ATTR_DB_USER]=i),e&NE.SemconvStability.STABLE&&(a[WC.ATTR_DB_NAMESPACE]=s);let u=parseInt(o,10);return n&NE.SemconvStability.OLD&&(a[xf.ATTR_NET_PEER_NAME]=r,isNaN(u)||(a[xf.ATTR_NET_PEER_PORT]=u)),n&NE.SemconvStability.STABLE&&(a[WC.ATTR_SERVER_ADDRESS]=r,isNaN(u)||(a[WC.ATTR_SERVER_PORT]=u)),a}xr.getConnectionAttributes=QIe;function JIe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function XIe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function ZIe(t,e,n,r=!1,o=eOe){let[s,i]=typeof t=="string"?[t,n]:[t.sql,tOe(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}xr.getQueryText=ZIe;function eOe(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function tOe(t){return"values"in t}function nOe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}xr.getSpanName=nOe;var rOe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};xr.once=rOe;function oOe(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}xr.getConnectionPrototypeToInstrument=oOe});var R$=E(Cl=>{"use strict";c();Object.defineProperty(Cl,"__esModule",{value:!0});Cl.PACKAGE_NAME=Cl.PACKAGE_VERSION=void 0;Cl.PACKAGE_VERSION="0.60.0";Cl.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var N$=E(xE=>{"use strict";c();Object.defineProperty(xE,"__esModule",{value:!0});xE.MySQL2Instrumentation=void 0;var I$=(M(),x(L)),eo=se(),KC=$C(),O$=YC(),Nl=b$(),C$=R$(),QC=(fe(),x(Oe)),JC=[">=1.4.2 <4"],XC=class extends eo.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(C$.PACKAGE_NAME,C$.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,eo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,eo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,eo.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,eo.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new eo.InstrumentationNodeModuleDefinition("mysql2",JC,s=>(n(s),s),()=>{},[new eo.InstrumentationNodeModuleFile("mysql2/promise.js",JC,s=>(n(s),s),()=>{}),new eo.InstrumentationNodeModuleFile("mysql2/lib/connection.js",JC,s=>{let i=(0,Nl.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,Nl.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let u;Array.isArray(i)?u=i:arguments[2]&&(u=[i]);let{maskStatement:d,maskStatementHook:p,responseHook:f}=o.getConfig(),m=(0,Nl.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),_=(0,Nl.getQueryText)(s,e,u,d,p);o._dbSemconvStability&eo.SemconvStability.OLD&&(m[KC.ATTR_DB_SYSTEM]=KC.DB_SYSTEM_VALUE_MYSQL,m[KC.ATTR_DB_STATEMENT]=_),o._dbSemconvStability&eo.SemconvStability.STABLE&&(m[QC.ATTR_DB_SYSTEM_NAME]=QC.DB_SYSTEM_NAME_VALUE_MYSQL,m[QC.ATTR_DB_QUERY_TEXT]=_);let h=o.tracer.startSpan((0,Nl.getSpanName)(s),{kind:I$.SpanKind.CLIENT,attributes:m});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,O$.addSqlCommenterComment)(h,s):Object.assign(s,{sql:(0,O$.addSqlCommenterComment)(h,s.sql)}));let g=(0,Nl.once)((T,S)=>{T?h.setStatus({code:I$.SpanStatusCode.ERROR,message:T.message}):typeof f=="function"&&(0,eo.safeExecuteInTheMiddle)(()=>{f(h,{queryResults:S})},A=>{A&&o._diag.warn("Failed executing responseHook",A)},!0),h.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(g));let T=r.apply(this,arguments);return T.once("error",S=>{g(S)}).once("result",S=>{g(void 0,S)}),T}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(g)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(g)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};xE.MySQL2Instrumentation=XC});var x$=E(PE=>{"use strict";c();Object.defineProperty(PE,"__esModule",{value:!0});PE.MySQL2Instrumentation=void 0;var sOe=N$();Object.defineProperty(PE,"MySQL2Instrumentation",{enumerable:!0,get:function(){return sOe.MySQL2Instrumentation}})});var w$=E(dn=>{"use strict";c();Object.defineProperty(dn,"__esModule",{value:!0});dn.DB_SYSTEM_VALUE_REDIS=dn.DB_SYSTEM_NAME_VALUE_REDIS=dn.ATTR_NET_PEER_PORT=dn.ATTR_NET_PEER_NAME=dn.ATTR_DB_SYSTEM=dn.ATTR_DB_STATEMENT=dn.ATTR_DB_CONNECTION_STRING=void 0;dn.ATTR_DB_CONNECTION_STRING="db.connection_string";dn.ATTR_DB_STATEMENT="db.statement";dn.ATTR_DB_SYSTEM="db.system";dn.ATTR_NET_PEER_NAME="net.peer.name";dn.ATTR_NET_PEER_PORT="net.peer.port";dn.DB_SYSTEM_NAME_VALUE_REDIS="redis";dn.DB_SYSTEM_VALUE_REDIS="redis"});var L$=E(ME=>{"use strict";c();Object.defineProperty(ME,"__esModule",{value:!0});ME.endSpan=void 0;var aOe=(M(),x(L)),uOe=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:aOe.SpanStatusCode.ERROR,message:e.message})),t.end()};ME.endSpan=uOe});var kE=E(vE=>{"use strict";c();Object.defineProperty(vE,"__esModule",{value:!0});vE.defaultDbStatementSerializer=void 0;var cOe=[{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}],lOe=(t,e)=>{if(Array.isArray(e)&&e.length){let n=cOe.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};vE.defaultDbStatementSerializer=lOe});var D$=E(xl=>{"use strict";c();Object.defineProperty(xl,"__esModule",{value:!0});xl.PACKAGE_NAME=xl.PACKAGE_VERSION=void 0;xl.PACKAGE_VERSION="0.62.0";xl.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var G$=E(wE=>{"use strict";c();Object.defineProperty(wE,"__esModule",{value:!0});wE.IORedisInstrumentation=void 0;var Mi=(M(),x(L)),jn=se(),vi=(fe(),x(Oe)),Hn=w$(),U$=se(),Pf=L$(),dOe=kE(),B$=D$(),F$={requireParentSpan:!0},ZC=class extends jn.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(B$.PACKAGE_NAME,B$.PACKAGE_VERSION,{...F$,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,jn.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,jn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...F$,...e})}init(){return[new jn.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,jn.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,jn.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||dOe.defaultDbStatementSerializer,a=Mi.trace.getSpan(Mi.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let u={},{host:d,port:p}=this.options,f=i(o.name,o.args);r._dbSemconvStability&jn.SemconvStability.OLD&&(u[Hn.ATTR_DB_SYSTEM]=Hn.DB_SYSTEM_VALUE_REDIS,u[Hn.ATTR_DB_STATEMENT]=f,u[Hn.ATTR_DB_CONNECTION_STRING]=`redis://${d}:${p}`),r._dbSemconvStability&jn.SemconvStability.STABLE&&(u[vi.ATTR_DB_SYSTEM_NAME]=Hn.DB_SYSTEM_NAME_VALUE_REDIS,u[vi.ATTR_DB_QUERY_TEXT]=f),r._netSemconvStability&jn.SemconvStability.OLD&&(u[Hn.ATTR_NET_PEER_NAME]=d,u[Hn.ATTR_NET_PEER_PORT]=p),r._netSemconvStability&jn.SemconvStability.STABLE&&(u[vi.ATTR_SERVER_ADDRESS]=d,u[vi.ATTR_SERVER_PORT]=p);let m=r.tracer.startSpan(o.name,{kind:Mi.SpanKind.CLIENT,attributes:u}),{requestHook:_}=s;_&&(0,U$.safeExecuteInTheMiddle)(()=>_(m,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),h=>{h&&Mi.diag.error("ioredis instrumentation: request hook failed",h)},!0);try{let h=e.apply(this,arguments),g=o.resolve;o.resolve=function(S){(0,U$.safeExecuteInTheMiddle)(()=>s.responseHook?.(m,o.name,o.args,S),A=>{A&&Mi.diag.error("ioredis instrumentation: response hook failed",A)},!0),(0,Pf.endSpan)(m,null),g(S)};let T=o.reject;return o.reject=function(S){(0,Pf.endSpan)(m,S),T(S)},h}catch(h){throw(0,Pf.endSpan)(m,h),h}}}_traceConnection(e){let n=this;return function(){let r=Mi.trace.getSpan(Mi.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&jn.SemconvStability.OLD&&(o[Hn.ATTR_DB_SYSTEM]=Hn.DB_SYSTEM_VALUE_REDIS,o[Hn.ATTR_DB_STATEMENT]="connect",o[Hn.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&jn.SemconvStability.STABLE&&(o[vi.ATTR_DB_SYSTEM_NAME]=Hn.DB_SYSTEM_NAME_VALUE_REDIS,o[vi.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&jn.SemconvStability.OLD&&(o[Hn.ATTR_NET_PEER_NAME]=s,o[Hn.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&jn.SemconvStability.STABLE&&(o[vi.ATTR_SERVER_ADDRESS]=s,o[vi.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:Mi.SpanKind.CLIENT,attributes:o});try{let u=e.apply(this,arguments);return(0,Pf.endSpan)(a,null),u}catch(u){throw(0,Pf.endSpan)(a,u),u}}}};wE.IORedisInstrumentation=ZC});var j$=E(LE=>{"use strict";c();Object.defineProperty(LE,"__esModule",{value:!0});LE.IORedisInstrumentation=void 0;var pOe=G$();Object.defineProperty(LE,"IORedisInstrumentation",{enumerable:!0,get:function(){return pOe.IORedisInstrumentation}})});var DE=E(Pl=>{"use strict";c();Object.defineProperty(Pl,"__esModule",{value:!0});Pl.PACKAGE_NAME=Pl.PACKAGE_VERSION=void 0;Pl.PACKAGE_VERSION="0.62.0";Pl.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var H$=E(ki=>{"use strict";c();Object.defineProperty(ki,"__esModule",{value:!0});ki.getTracedCreateStreamTrace=ki.getTracedCreateClient=ki.endSpan=void 0;var Mf=(M(),x(L)),fOe=(t,e)=>{e&&t.setStatus({code:Mf.SpanStatusCode.ERROR,message:e.message}),t.end()};ki.endSpan=fOe;var mOe=t=>function(){let n=t.apply(this,arguments);return Mf.context.bind(Mf.context.active(),n)};ki.getTracedCreateClient=mOe;var _Oe=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){Mf.context.bind(Mf.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};ki.getTracedCreateStreamTrace=_Oe});var UE=E(pn=>{"use strict";c();Object.defineProperty(pn,"__esModule",{value:!0});pn.DB_SYSTEM_VALUE_REDIS=pn.DB_SYSTEM_NAME_VALUE_REDIS=pn.ATTR_NET_PEER_PORT=pn.ATTR_NET_PEER_NAME=pn.ATTR_DB_SYSTEM=pn.ATTR_DB_STATEMENT=pn.ATTR_DB_CONNECTION_STRING=void 0;pn.ATTR_DB_CONNECTION_STRING="db.connection_string";pn.ATTR_DB_STATEMENT="db.statement";pn.ATTR_DB_SYSTEM="db.system";pn.ATTR_NET_PEER_NAME="net.peer.name";pn.ATTR_NET_PEER_PORT="net.peer.port";pn.DB_SYSTEM_NAME_VALUE_REDIS="redis";pn.DB_SYSTEM_VALUE_REDIS="redis"});var q$=E(FE=>{"use strict";c();Object.defineProperty(FE,"__esModule",{value:!0});FE.RedisInstrumentationV2_V3=void 0;var sr=se(),BE=H$(),V$=DE(),vf=(M(),x(L)),kf=(fe(),x(Oe)),Za=UE(),hOe=kE(),eN=class t extends sr.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(V$.PACKAGE_NAME,V$.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,sr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,sr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new sr.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,sr.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,sr.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,sr.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=vf.trace.getSpan(vf.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let u=i?.dbStatementSerializer||hOe.defaultDbStatementSerializer,d={};e._semconvStability&sr.SemconvStability.OLD&&Object.assign(d,{[Za.ATTR_DB_SYSTEM]:Za.DB_SYSTEM_VALUE_REDIS,[Za.ATTR_DB_STATEMENT]:u(s.command,s.args)}),e._semconvStability&sr.SemconvStability.STABLE&&Object.assign(d,{[kf.ATTR_DB_SYSTEM_NAME]:Za.DB_SYSTEM_NAME_VALUE_REDIS,[kf.ATTR_DB_OPERATION_NAME]:s.command,[kf.ATTR_DB_QUERY_TEXT]:u(s.command,s.args)});let p=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:vf.SpanKind.CLIENT,attributes:d});if(this.connection_options){let m={};e._semconvStability&sr.SemconvStability.OLD&&Object.assign(m,{[Za.ATTR_NET_PEER_NAME]:this.connection_options.host,[Za.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&sr.SemconvStability.STABLE&&Object.assign(m,{[kf.ATTR_SERVER_ADDRESS]:this.connection_options.host,[kf.ATTR_SERVER_PORT]:this.connection_options.port}),p.setAttributes(m)}this.address&&e._semconvStability&sr.SemconvStability.OLD&&p.setAttribute(Za.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let f=arguments[0].callback;if(f){let m=vf.context.active();arguments[0].callback=function(h,g){if(i?.responseHook){let T=i.responseHook;(0,sr.safeExecuteInTheMiddle)(()=>{T(p,s.command,s.args,g)},S=>{S&&e._diag.error("Error executing responseHook",S)},!0)}return(0,BE.endSpan)(p,h),vf.context.with(m,f,this,...arguments)}}try{return r.apply(this,arguments)}catch(m){throw(0,BE.endSpan)(p,m),m}}}}_getPatchCreateClient(){return function(n){return(0,BE.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,BE.getTracedCreateStreamTrace)(n)}}};FE.RedisInstrumentationV2_V3=eN});var z$=E(GE=>{"use strict";c();Object.defineProperty(GE,"__esModule",{value:!0});GE.getClientAttributes=void 0;var tN=(fe(),x(Oe)),Ml=UE(),$$=se();function gOe(t,e,n){let r={};return n&$$.SemconvStability.OLD&&Object.assign(r,{[Ml.ATTR_DB_SYSTEM]:Ml.DB_SYSTEM_VALUE_REDIS,[Ml.ATTR_NET_PEER_NAME]:e?.socket?.host,[Ml.ATTR_NET_PEER_PORT]:e?.socket?.port,[Ml.ATTR_DB_CONNECTION_STRING]:TOe(t,e?.url)}),n&$$.SemconvStability.STABLE&&Object.assign(r,{[tN.ATTR_DB_SYSTEM_NAME]:Ml.DB_SYSTEM_NAME_VALUE_REDIS,[tN.ATTR_SERVER_ADDRESS]:e?.socket?.host,[tN.ATTR_SERVER_PORT]:e?.socket?.port}),r}GE.getClientAttributes=gOe;function TOe(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var Q$=E(jE=>{"use strict";c();Object.defineProperty(jE,"__esModule",{value:!0});jE.RedisInstrumentationV4_V5=void 0;var Pr=(M(),x(L)),De=se(),Y$=z$(),EOe=kE(),W$=DE(),nN=(fe(),x(Oe)),SOe=UE(),wf=Symbol("opentelemetry.instrumentation.redis.open_spans"),K$=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),rN=class t extends De.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(W$.PACKAGE_NAME,W$.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,De.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,De.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new De.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let u=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,De.isWrapped)(s?.[u])&&this._unwrap(s,u),this._wrap(s,u,this._getPatchExtendWithCommands(a)),s},s=>{(0,De.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,De.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new De.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,De.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,De.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,De.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,De.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,De.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new De.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,De.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,De.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,De.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,De.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,De.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,De.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new De.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(u,d){let p=e(u,d).args;return n._traceClientCommand(a,this,arguments,p)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let u=this[wf];return n._endSpansWithRedisReplies(u,a,e),a}).catch(a=>{let u=this[wf];if(!u)n._diag.error("cannot find open spans to end for multi/pipeline");else{let d=a.constructor.name==="MultiErrorReply"?a.replies:new Array(u.length).fill(a);n._endSpansWithRedisReplies(u,d,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[K$]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,Y$.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:Pr.SpanKind.CLIENT,attributes:i});return Pr.context.with(Pr.trace.setSpan(Pr.context.active(),a),()=>r.apply(this)).then(d=>(a.end(),d)).catch(d=>(a.recordException(d),a.setStatus({code:Pr.SpanStatusCode.ERROR,message:d.message}),a.end(),Promise.reject(d)))}}}_traceClientCommand(e,n,r,o){if(Pr.trace.getSpan(Pr.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[K$],a=o[0],u=o.slice(1),d=this.getConfig().dbStatementSerializer||EOe.defaultDbStatementSerializer,p=(0,Y$.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&De.SemconvStability.STABLE&&(p[nN.ATTR_DB_OPERATION_NAME]=a);try{let _=d(a,u);_!=null&&(this._semconvStability&De.SemconvStability.OLD&&(p[SOe.ATTR_DB_STATEMENT]=_),this._semconvStability&De.SemconvStability.STABLE&&(p[nN.ATTR_DB_QUERY_TEXT]=_))}catch(_){this._diag.error("dbStatementSerializer throw an exception",_,{commandName:a})}let f=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:Pr.SpanKind.CLIENT,attributes:p}),m=Pr.context.with(Pr.trace.setSpan(Pr.context.active(),f),()=>e.apply(n,r));if(typeof m?.then=="function")m.then(_=>{this._endSpanWithResponse(f,a,u,_,void 0)},_=>{this._endSpanWithResponse(f,a,u,null,_)});else{let _=m;_[wf]=_[wf]||[],_[wf].push({span:f,commandName:a,commandArgs:u})}return m}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:u,commandArgs:d}=e[a],p=n[a],[f,m]=p instanceof Error?[null,p]:[p,void 0];this._semconvStability&De.SemconvStability.STABLE&&u.setAttribute(nN.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(u,o[a],d,f,m)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:Pr.SpanStatusCode.ERROR,message:s?.message})),e.end()}};jE.RedisInstrumentationV4_V5=rN});var Z$=E(HE=>{"use strict";c();Object.defineProperty(HE,"__esModule",{value:!0});HE.RedisInstrumentation=void 0;var AOe=se(),J$=DE(),yOe=q$(),bOe=Q$(),X$={requireParentSpan:!1},oN=class extends AOe.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...X$,...e};super(J$.PACKAGE_NAME,J$.PACKAGE_VERSION,n),this.instrumentationV2_V3=new yOe.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new bOe.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...X$,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};HE.RedisInstrumentation=oN});var e9=E(VE=>{"use strict";c();Object.defineProperty(VE,"__esModule",{value:!0});VE.RedisInstrumentation=void 0;var ROe=Z$();Object.defineProperty(VE,"RedisInstrumentation",{enumerable:!0,get:function(){return ROe.RedisInstrumentation}})});var l9=E($E=>{"use strict";c();Object.defineProperty($E,"__esModule",{value:!0});$E.EVENT_LISTENERS_SET=void 0;$E.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var aN=E(Uf=>{"use strict";c();Object.defineProperty(Uf,"__esModule",{value:!0});Uf.AttributeNames=void 0;var MOe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(MOe=Uf.AttributeNames||(Uf.AttributeNames={}))});var uN=E(Re=>{"use strict";c();Object.defineProperty(Re,"__esModule",{value:!0});Re.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Re.METRIC_DB_CLIENT_CONNECTION_COUNT=Re.DB_SYSTEM_VALUE_POSTGRESQL=Re.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Re.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Re.ATTR_NET_PEER_PORT=Re.ATTR_NET_PEER_NAME=Re.ATTR_DB_USER=Re.ATTR_DB_SYSTEM=Re.ATTR_DB_STATEMENT=Re.ATTR_DB_NAME=Re.ATTR_DB_CONNECTION_STRING=Re.ATTR_DB_CLIENT_CONNECTION_STATE=Re.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Re.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Re.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Re.ATTR_DB_CONNECTION_STRING="db.connection_string";Re.ATTR_DB_NAME="db.name";Re.ATTR_DB_STATEMENT="db.statement";Re.ATTR_DB_SYSTEM="db.system";Re.ATTR_DB_USER="db.user";Re.ATTR_NET_PEER_NAME="net.peer.name";Re.ATTR_NET_PEER_PORT="net.peer.port";Re.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Re.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Re.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Re.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Re.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var cN=E(Bf=>{"use strict";c();Object.defineProperty(Bf,"__esModule",{value:!0});Bf.SpanNames=void 0;var vOe;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(vOe=Bf.SpanNames||(Bf.SpanNames={}))});var g9=E(Ae=>{"use strict";c();Object.defineProperty(Ae,"__esModule",{value:!0});Ae.sanitizedErrorMessage=Ae.isObjectWithTextString=Ae.getErrorMessage=Ae.patchClientConnectCallback=Ae.patchCallbackPGPool=Ae.updateCounter=Ae.getPoolName=Ae.patchCallback=Ae.handleExecutionResult=Ae.handleConfigQuery=Ae.shouldSkipInstrumentation=Ae.getSemanticAttributesFromPoolConnection=Ae.getSemanticAttributesFromConnection=Ae.getConnectionString=Ae.parseAndMaskConnectionString=Ae.parseNormalizedOperationName=Ae.getQuerySpanName=void 0;var wi=(M(),x(L)),zE=aN(),Mr=(fe(),x(Oe)),Qe=uN(),eu=se(),d9=cN();function p9(t,e){if(!e)return d9.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:f9(e.text);return`${d9.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Ae.getQuerySpanName=p9;function f9(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}Ae.parseNormalizedOperationName=f9;function m9(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}Ae.parseAndMaskConnectionString=m9;function lN(t){if("connectionString"in t&&t.connectionString)return m9(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Ae.getConnectionString=lN;function YE(t){if(Number.isInteger(t))return t}function _9(t,e){let n={};return e&eu.SemconvStability.OLD&&(n={...n,[Qe.ATTR_DB_SYSTEM]:Qe.DB_SYSTEM_VALUE_POSTGRESQL,[Qe.ATTR_DB_NAME]:t.database,[Qe.ATTR_DB_CONNECTION_STRING]:lN(t),[Qe.ATTR_DB_USER]:t.user,[Qe.ATTR_NET_PEER_NAME]:t.host,[Qe.ATTR_NET_PEER_PORT]:YE(t.port)}),e&eu.SemconvStability.STABLE&&(n={...n,[Mr.ATTR_DB_SYSTEM_NAME]:Mr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Mr.ATTR_DB_NAMESPACE]:t.namespace,[Mr.ATTR_SERVER_ADDRESS]:t.host,[Mr.ATTR_SERVER_PORT]:YE(t.port)}),n}Ae.getSemanticAttributesFromConnection=_9;function kOe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[zE.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[zE.AttributeNames.MAX_CLIENT]:t.maxClient};return e&eu.SemconvStability.OLD&&(r={...r,[Qe.ATTR_DB_SYSTEM]:Qe.DB_SYSTEM_VALUE_POSTGRESQL,[Qe.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Qe.ATTR_DB_CONNECTION_STRING]:lN(t),[Qe.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Qe.ATTR_NET_PEER_PORT]:Number(n?.port)||YE(t.port),[Qe.ATTR_DB_USER]:n?.username??t.user}),e&eu.SemconvStability.STABLE&&(r={...r,[Mr.ATTR_DB_SYSTEM_NAME]:Mr.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Mr.ATTR_DB_NAMESPACE]:t.namespace,[Mr.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[Mr.ATTR_SERVER_PORT]:Number(n?.port)||YE(t.port)}),r}Ae.getSemanticAttributesFromPoolConnection=kOe;function wOe(t){return t.requireParentSpan===!0&&wi.trace.getSpan(wi.context.active())===void 0}Ae.shouldSkipInstrumentation=wOe;function LOe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=p9(s,r),a=t.startSpan(i,{kind:wi.SpanKind.CLIENT,attributes:_9(o,n)});if(!r)return a;if(r.text&&(n&eu.SemconvStability.OLD&&a.setAttribute(Qe.ATTR_DB_STATEMENT,r.text),n&eu.SemconvStability.STABLE&&a.setAttribute(Mr.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let u=r.values.map(d=>d==null?"null":d instanceof Buffer?d.toString():typeof d=="object"?typeof d.toPostgres=="function"?d.toPostgres():JSON.stringify(d):d.toString());a.setAttribute(zE.AttributeNames.PG_VALUES,u)}catch(u){wi.diag.error("failed to stringify ",r.values,u)}return typeof r.name=="string"&&a.setAttribute(zE.AttributeNames.PG_PLAN,r.name),a}Ae.handleConfigQuery=LOe;function h9(t,e,n){typeof t.responseHook=="function"&&(0,eu.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&wi.diag.error("Error running response hook",r)},!0)}Ae.handleExecutionResult=h9;function DOe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[Mr.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(WE(i)),e.setStatus({code:wi.SpanStatusCode.ERROR,message:i.message})):h9(t,e,a),o(),e.end(),n.call(this,i,a)}}Ae.patchCallback=DOe;function UOe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Ae.getPoolName=UOe;function BOe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,u=s-a;return n.add(u-o.used,{[Qe.ATTR_DB_CLIENT_CONNECTION_STATE]:Qe.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Qe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Qe.ATTR_DB_CLIENT_CONNECTION_STATE]:Qe.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Qe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Qe.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:u,idle:a,pending:i}}Ae.updateCounter=BOe;function FOe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(WE(r)),t.setStatus({code:wi.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}Ae.patchCallbackPGPool=FOe;function GOe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(WE(r)),t.setStatus({code:wi.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}Ae.patchClientConnectCallback=GOe;function jOe(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Ae.getErrorMessage=jOe;function HOe(t){return typeof t=="object"&&typeof t?.text=="string"}Ae.isObjectWithTextString=HOe;function WE(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}Ae.sanitizedErrorMessage=WE});var T9=E(vl=>{"use strict";c();Object.defineProperty(vl,"__esModule",{value:!0});vl.PACKAGE_NAME=vl.PACKAGE_VERSION=void 0;vl.PACKAGE_VERSION="0.66.0";vl.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var R9=E(QE=>{"use strict";c();Object.defineProperty(QE,"__esModule",{value:!0});QE.PgInstrumentation=void 0;var On=se(),xe=(M(),x(L)),E9=l9(),Ve=g9(),S9=YC(),A9=T9(),y9=cN(),KE=ye(),to=(fe(),x(Oe)),Ff=uN();function kl(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var dN=class extends On.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(A9.PACKAGE_NAME,A9.PACKAGE_VERSION,e),this._semconvStability=(0,On.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(to.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:xe.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(Ff.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(Ff.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new On.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new On.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new On.InstrumentationNodeModuleDefinition("pg",e,a=>{let u=kl(a);return this._patchPgClient(u.Client),a},a=>{let u=kl(a);return this._unpatchPgClient(u.Client),a},[o,r]),i=new On.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let u=kl(a);return(0,On.isWrapped)(u.prototype.connect)&&this._unwrap(u.prototype,"connect"),this._wrap(u.prototype,"connect",this._getPoolConnectPatch()),u},a=>{let u=kl(a);(0,On.isWrapped)(u.prototype.connect)&&this._unwrap(u.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=kl(e);return(0,On.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,On.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=kl(e);return(0,On.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,On.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(Ve.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(y9.SpanNames.CONNECT,{kind:xe.SpanKind.CLIENT,attributes:Ve.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let u=xe.trace.getSpan(xe.context.active());o=Ve.patchClientConnectCallback(i,o),u&&(o=xe.context.bind(xe.context.active(),o))}let a=xe.context.with(xe.trace.setSpan(xe.context.active(),i),()=>n.call(this,o));return b9(i,a)}}recordOperationDuration(e,n){let r={},o=[to.ATTR_DB_NAMESPACE,to.ATTR_ERROR_TYPE,to.ATTR_SERVER_PORT,to.ATTR_SERVER_ADDRESS,to.ATTR_DB_OPERATION_NAME];this._semconvStability&On.SemconvStability.OLD&&o.push(Ff.ATTR_DB_SYSTEM),this._semconvStability&On.SemconvStability.STABLE&&o.push(to.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,KE.hrTimeToMilliseconds)((0,KE.hrTimeDuration)(n,(0,KE.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Ve.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,KE.hrTime)(),i=o[0],a=typeof i=="string",u=Ve.isObjectWithTextString(i),d=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:u?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,p={[Ff.ATTR_DB_SYSTEM]:Ff.DB_SYSTEM_VALUE_POSTGRESQL,[to.ATTR_DB_NAMESPACE]:this.database,[to.ATTR_SERVER_PORT]:this.connectionParameters.port,[to.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};d?.text&&(p[to.ATTR_DB_OPERATION_NAME]=Ve.parseNormalizedOperationName(d?.text));let f=()=>{e.recordOperationDuration(p,s)},m=e.getConfig(),_=Ve.handleConfigQuery.call(this,e.tracer,m,e._semconvStability,d);if(m.addSqlCommenterCommentToQueries&&(a?o[0]=(0,S9.addSqlCommenterComment)(_,i):u&&!("name"in i)&&(o[0]={...i,text:(0,S9.addSqlCommenterComment)(_,i.text)})),o.length>0){let T=xe.trace.getSpan(xe.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Ve.patchCallback(m,_,o[o.length-1],p,f),T&&(o[o.length-1]=xe.context.bind(xe.context.active(),o[o.length-1]));else if(typeof d?.callback=="function"){let S=Ve.patchCallback(e.getConfig(),_,d.callback,p,f);T&&(S=xe.context.bind(xe.context.active(),S)),o[0].callback=S}}let{requestHook:h}=m;typeof h=="function"&&d&&(0,On.safeExecuteInTheMiddle)(()=>{let{database:T,host:S,port:A,user:R}=this.connectionParameters;h(_,{connection:{database:T,host:S,port:A,user:R},query:{text:d.text,values:d.values,name:d.name}})},T=>{T&&e._diag.error("Error running query hook",T)},!0);let g;try{g=n.apply(this,o)}catch(T){throw T instanceof Error&&_.recordException(Ve.sanitizedErrorMessage(T)),_.setStatus({code:xe.SpanStatusCode.ERROR,message:Ve.getErrorMessage(T)}),_.end(),T}return g instanceof Promise?g.then(T=>new Promise(S=>{Ve.handleExecutionResult(e.getConfig(),_,T),f(),_.end(),S(T)})).catch(T=>new Promise((S,A)=>{T instanceof Error&&_.recordException(Ve.sanitizedErrorMessage(T)),_.setStatus({code:xe.SpanStatusCode.ERROR,message:T.message}),f(),_.end(),A(T)})):g})}_setPoolConnectEventListeners(e){if(e[E9.EVENT_LISTENERS_SET])return;let n=Ve.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=Ve.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[E9.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(Ve.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(y9.SpanNames.POOL_CONNECT,{kind:xe.SpanKind.CLIENT,attributes:Ve.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let u=xe.trace.getSpan(xe.context.active());o=Ve.patchCallbackPGPool(i,o),u&&(o=xe.context.bind(xe.context.active(),o))}let a=xe.context.with(xe.trace.setSpan(xe.context.active(),i),()=>n.call(this,o));return b9(i,a)}}};QE.PgInstrumentation=dN;function b9(t,e){if(!(e instanceof Promise))return e;let n=e;return xe.context.bind(xe.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(Ve.sanitizedErrorMessage(r)),t.setStatus({code:xe.SpanStatusCode.ERROR,message:Ve.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var I9=E(wl=>{"use strict";c();Object.defineProperty(wl,"__esModule",{value:!0});wl.AttributeNames=wl.PgInstrumentation=void 0;var VOe=R9();Object.defineProperty(wl,"PgInstrumentation",{enumerable:!0,get:function(){return VOe.PgInstrumentation}});var qOe=aN();Object.defineProperty(wl,"AttributeNames",{enumerable:!0,get:function(){return qOe.AttributeNames}})});var k9=E(Gf=>{"use strict";c();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.SeverityNumber=void 0;var KOe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(KOe=Gf.SeverityNumber||(Gf.SeverityNumber={}))});var XE=E(Ll=>{"use strict";c();Object.defineProperty(Ll,"__esModule",{value:!0});Ll.NOOP_LOGGER=Ll.NoopLogger=void 0;var JE=class{emit(e){}};Ll.NoopLogger=JE;Ll.NOOP_LOGGER=new JE});var eS=E(Dl=>{"use strict";c();Object.defineProperty(Dl,"__esModule",{value:!0});Dl.NOOP_LOGGER_PROVIDER=Dl.NoopLoggerProvider=void 0;var QOe=XE(),ZE=class{getLogger(e,n,r){return new QOe.NoopLogger}};Dl.NoopLoggerProvider=ZE;Dl.NOOP_LOGGER_PROVIDER=new ZE});var _N=E(tS=>{"use strict";c();Object.defineProperty(tS,"__esModule",{value:!0});tS.ProxyLogger=void 0;var JOe=XE(),mN=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):JOe.NOOP_LOGGER}};tS.ProxyLogger=mN});var gN=E(nS=>{"use strict";c();Object.defineProperty(nS,"__esModule",{value:!0});nS.ProxyLoggerProvider=void 0;var XOe=eS(),ZOe=_N(),hN=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new ZOe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:XOe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};nS.ProxyLoggerProvider=hN});var w9=E(rS=>{"use strict";c();Object.defineProperty(rS,"__esModule",{value:!0});rS._globalThis=void 0;rS._globalThis=typeof globalThis=="object"?globalThis:global});var L9=E(oS=>{"use strict";c();Object.defineProperty(oS,"__esModule",{value:!0});oS._globalThis=void 0;var eCe=w9();Object.defineProperty(oS,"_globalThis",{enumerable:!0,get:function(){return eCe._globalThis}})});var D9=E(sS=>{"use strict";c();Object.defineProperty(sS,"__esModule",{value:!0});sS._globalThis=void 0;var tCe=L9();Object.defineProperty(sS,"_globalThis",{enumerable:!0,get:function(){return tCe._globalThis}})});var U9=E(Lo=>{"use strict";c();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.API_BACKWARDS_COMPATIBILITY_VERSION=Lo.makeGetter=Lo._global=Lo.GLOBAL_LOGS_API_KEY=void 0;var nCe=D9();Lo.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Lo._global=nCe._globalThis;function rCe(t,e,n){return r=>r===t?e:n}Lo.makeGetter=rCe;Lo.API_BACKWARDS_COMPATIBILITY_VERSION=1});var F9=E(iS=>{"use strict";c();Object.defineProperty(iS,"__esModule",{value:!0});iS.LogsAPI=void 0;var vr=U9(),oCe=eS(),B9=gN(),TN=class t{constructor(){this._proxyLoggerProvider=new B9.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return vr._global[vr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(vr._global[vr.GLOBAL_LOGS_API_KEY]=(0,vr.makeGetter)(vr.API_BACKWARDS_COMPATIBILITY_VERSION,e,oCe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=vr._global[vr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(vr._global,vr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete vr._global[vr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new B9.ProxyLoggerProvider}};iS.LogsAPI=TN});var EN=E(Dt=>{"use strict";c();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.logs=Dt.ProxyLoggerProvider=Dt.ProxyLogger=Dt.NoopLoggerProvider=Dt.NOOP_LOGGER_PROVIDER=Dt.NoopLogger=Dt.NOOP_LOGGER=Dt.SeverityNumber=void 0;var sCe=k9();Object.defineProperty(Dt,"SeverityNumber",{enumerable:!0,get:function(){return sCe.SeverityNumber}});var G9=XE();Object.defineProperty(Dt,"NOOP_LOGGER",{enumerable:!0,get:function(){return G9.NOOP_LOGGER}});Object.defineProperty(Dt,"NoopLogger",{enumerable:!0,get:function(){return G9.NoopLogger}});var j9=eS();Object.defineProperty(Dt,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return j9.NOOP_LOGGER_PROVIDER}});Object.defineProperty(Dt,"NoopLoggerProvider",{enumerable:!0,get:function(){return j9.NoopLoggerProvider}});var iCe=_N();Object.defineProperty(Dt,"ProxyLogger",{enumerable:!0,get:function(){return iCe.ProxyLogger}});var aCe=gN();Object.defineProperty(Dt,"ProxyLoggerProvider",{enumerable:!0,get:function(){return aCe.ProxyLoggerProvider}});var uCe=F9();Dt.logs=uCe.LogsAPI.getInstance()});var H9=E(Ul=>{"use strict";c();Object.defineProperty(Ul,"__esModule",{value:!0});Ul.disableInstrumentations=Ul.enableInstrumentations=void 0;function cCe(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Ul.enableInstrumentations=cCe;function lCe(t){t.forEach(e=>e.disable())}Ul.disableInstrumentations=lCe});var $9=E(aS=>{"use strict";c();Object.defineProperty(aS,"__esModule",{value:!0});aS.registerInstrumentations=void 0;var V9=(M(),x(L)),dCe=EN(),q9=H9();function pCe(t){let e=t.tracerProvider||V9.trace.getTracerProvider(),n=t.meterProvider||V9.metrics.getMeterProvider(),r=t.loggerProvider||dCe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,q9.enableInstrumentations)(o,e,n,r),()=>{(0,q9.disableInstrumentations)(o)}}aS.registerInstrumentations=pCe});var ez=E(uS=>{"use strict";c();Object.defineProperty(uS,"__esModule",{value:!0});uS.satisfies=void 0;var bN=(M(),x(L)),Q9=/^(?: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-]+)*))?$/,fCe=/^(?<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-]+)*))?$/,mCe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function _Ce(t,e,n){if(!hCe(t))return bN.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=SCe(t);if(!r)return!1;let o=[],s=J9(r,e,o,n);return s&&!n?.includePrerelease?TCe(r,o):s}uS.satisfies=_Ce;function hCe(t){return typeof t=="string"&&Q9.test(t)}function J9(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(SN(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=jCe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!SN(t,s,n,r))return!1;return!0}return SN(t,e,n,r)}function SN(t,e,n,r){if(e=ECe(e,r),e.includes(" "))return J9(t,e,n,r);{let o=ACe(e);return n.push(o),gCe(t,o)}}function gCe(t,e){if(e.invalid)return!1;if(!e.version||yN(e.version))return!0;let n=Y9(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=Y9(r,o)}return mCe[e.op]?.includes(n)}function TCe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function ECe(t,e){return t=t.trim(),t=FCe(t,e),t=BCe(t),t=GCe(t,e),t=t.trim(),t}function Cn(t){return!t||t.toLowerCase()==="x"||t==="*"}function SCe(t){let e=t.match(Q9);if(!e){bN.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function ACe(t){if(!t)return{};let e=t.match(fCe);if(!e)return bN.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function yN(t){return t==="*"||t==="x"||t==="X"}function z9(t){let e=parseInt(t,10);return isNaN(e)?t:e}function yCe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function bCe(t,e){if(yN(t)||yN(e))return 0;let[n,r]=yCe(z9(t),z9(e));return n>r?1:n<r?-1:0}function Y9(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=bCe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var X9="[a-zA-Z0-9-]",Z9="0|[1-9]\\d*",RCe=`\\d*[a-zA-Z-]${X9}*`,ICe="((?:<|>)?=?)",W9=`(?:${Z9}|${RCe})`,OCe=`(?:-(${W9}(?:\\.${W9})*))`,K9=`${X9}+`,CCe=`(?:\\+(${K9}(?:\\.${K9})*))`,AN=`${Z9}|x|X|\\*`,jf=`[v=\\s]*(${AN})(?:\\.(${AN})(?:\\.(${AN})(?:${OCe})?${CCe}?)?)?`,NCe=`^${ICe}\\s*${jf}$`,xCe=new RegExp(NCe),PCe=`^\\s*(${jf})\\s+-\\s+(${jf})\\s*$`,MCe=new RegExp(PCe),vCe="(?:~>?)",kCe=`^${vCe}${jf}$`,wCe=new RegExp(kCe),LCe="(?:\\^)",DCe=`^${LCe}${jf}$`,UCe=new RegExp(DCe);function BCe(t){let e=wCe;return t.replace(e,(n,r,o,s,i)=>{let a;return Cn(r)?a="":Cn(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Cn(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function FCe(t,e){let n=UCe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,u)=>{let d;return Cn(s)?d="":Cn(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Cn(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:u?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${u} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${u} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${u} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function GCe(t,e){let n=xCe;return t.replace(n,(r,o,s,i,a,u)=>{let d=Cn(s),p=d||Cn(i),f=p||Cn(a),m=f;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&m?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(u="-0"),r=`${o+s}.${i}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:f&&(r=`>=${s}.${i}.0${u} <${s}.${+i+1}.0-0`),r})}function jCe(t,e){let n=MCe;return t.replace(n,(r,o,s,i,a,u,d,p,f,m,_,h)=>(Cn(s)?o="":Cn(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Cn(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Cn(f)?p="":Cn(m)?p=`<${+f+1}.0.0-0`:Cn(_)?p=`<${f}.${+m+1}.0-0`:h?p=`<=${f}.${m}.${_}-${h}`:e?.includePrerelease?p=`<${f}.${m}.${+_+1}-0`:p=`<=${p}`,`${o} ${p}`.trim()))}});var RN=E(Xt=>{"use strict";c();Object.defineProperty(Xt,"__esModule",{value:!0});Xt.massUnwrap=Xt.unwrap=Xt.massWrap=Xt.wrap=void 0;var Nn=console.error.bind(console);function Hf(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var HCe=(t,e,n)=>{if(!t||!t[e]){Nn("no original function "+String(e)+" to wrap");return}if(!n){Nn("no wrapper function"),Nn(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Nn("original object and wrapper must be functions");return}let o=n(r,e);return Hf(o,"__original",r),Hf(o,"__unwrap",()=>{t[e]===o&&Hf(t,e,r)}),Hf(o,"__wrapped",!0),Hf(t,e,o),o};Xt.wrap=HCe;var VCe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Nn("must provide one or more modules to patch"),Nn(new Error().stack);return}if(!(e&&Array.isArray(e))){Nn("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,Xt.wrap)(r,o,n)})})};Xt.massWrap=VCe;var qCe=(t,e)=>{if(!t||!t[e]){Nn("no function to unwrap."),Nn(new Error().stack);return}let n=t[e];if(!n.__unwrap)Nn("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};Xt.unwrap=qCe;var $Ce=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Nn("must provide one or more modules to patch"),Nn(new Error().stack);return}if(!(e&&Array.isArray(e))){Nn("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,Xt.unwrap)(n,r)})})};Xt.massUnwrap=$Ce;function Vf(t){t&&t.logger&&(typeof t.logger!="function"?Nn("new logger isn't a function, not replacing"):Nn=t.logger)}Xt.default=Vf;Vf.wrap=Xt.wrap;Vf.massWrap=Xt.massWrap;Vf.unwrap=Xt.unwrap;Vf.massUnwrap=Xt.massUnwrap});var tz=E(lS=>{"use strict";c();Object.defineProperty(lS,"__esModule",{value:!0});lS.InstrumentationAbstract=void 0;var IN=(M(),x(L)),zCe=EN(),cS=RN(),ON=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=IN.diag.createComponentLogger({namespace:e}),this._tracer=IN.trace.getTracer(e,n),this._meter=IN.metrics.getMeter(e,n),this._logger=zCe.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=cS.wrap;_unwrap=cS.unwrap;_massWrap=cS.massWrap;_massUnwrap=cS.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};lS.InstrumentationAbstract=ON});var nz=E(Di=>{"use strict";c();Object.defineProperty(Di,"__esModule",{value:!0});Di.ModuleNameTrie=Di.ModuleNameSeparator=void 0;Di.ModuleNameSeparator="/";var dS=class{hooks=[];children=new Map},CN=class{_trie=new dS;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(Di.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new dS,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(Di.ModuleNameSeparator)){let u=o.children.get(a);if(!u){i=!1;break}r||s.push(...u.hooks),o=u}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,u)=>a.insertedId-u.insertedId),s.map(({hook:a})=>a))}};Di.ModuleNameTrie=CN});var oz=E(pS=>{"use strict";c();Object.defineProperty(pS,"__esModule",{value:!0});pS.RequireInTheMiddleSingleton=void 0;var YCe=ga(),rz=B("path"),NN=nz(),WCe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),xN=class t{_moduleNameTrie=new NN.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new YCe.Hook(null,{internals:!0},(e,n,r)=>{let o=KCe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return WCe?new t:this._instance=this._instance??new t}};pS.RequireInTheMiddleSingleton=xN;function KCe(t){return rz.sep!==NN.ModuleNameSeparator?t.split(rz.sep).join(NN.ModuleNameSeparator):t}});var PN=E(Ui=>{"use strict";c();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.isWrapped=Ui.safeExecuteInTheMiddleAsync=Ui.safeExecuteInTheMiddle=void 0;function QCe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Ui.safeExecuteInTheMiddle=QCe;async function JCe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}Ui.safeExecuteInTheMiddleAsync=JCe;function XCe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}Ui.isWrapped=XCe});var az=E(fS=>{"use strict";c();Object.defineProperty(fS,"__esModule",{value:!0});fS.InstrumentationBase=void 0;var qf=B("path"),sz=B("util"),ZCe=ez(),MN=RN(),eNe=tz(),tNe=oz(),nNe=dC(),$f=(M(),x(L)),rNe=ga(),oNe=B("fs"),sNe=PN(),vN=class extends eNe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=tNe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,sNe.isWrapped)(e[n])&&this._unwrap(e,n),sz.types.isProxy(e)){let o=(0,MN.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,MN.wrap)(e,n,r)};_unwrap=(e,n)=>sz.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,MN.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{$f.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){$f.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{$f.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){$f.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=B.resolve(n);B.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,oNe.readFileSync)(qf.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{$f.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return iz(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=qf.normalize(r);return i.filter(d=>d.name===a).filter(d=>iz(d.supportedVersions,s,e.includePrerelease)).reduce((d,p)=>(p.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:p.name,baseDir:o}),p.patch(d,e.moduleVersion)):d),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,u)=>{if(!u&&qf.isAbsolute(a)){let d=qf.parse(a);a=d.name,u=d.dir}return this._onRequire(e,i,a,u)},r=(i,a,u)=>this._onRequire(e,i,a,u),o=qf.isAbsolute(e.name)?new rNe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new nNe.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};fS.InstrumentationBase=vN;function iz(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,ZCe.satisfies)(e,r,{includePrerelease:n}))}});var uz=E(mS=>{"use strict";c();Object.defineProperty(mS,"__esModule",{value:!0});mS.normalize=void 0;var iNe=B("path");Object.defineProperty(mS,"normalize",{enumerable:!0,get:function(){return iNe.normalize}})});var cz=E(Bl=>{"use strict";c();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.normalize=Bl.InstrumentationBase=void 0;var aNe=az();Object.defineProperty(Bl,"InstrumentationBase",{enumerable:!0,get:function(){return aNe.InstrumentationBase}});var uNe=uz();Object.defineProperty(Bl,"normalize",{enumerable:!0,get:function(){return uNe.normalize}})});var kN=E(Fl=>{"use strict";c();Object.defineProperty(Fl,"__esModule",{value:!0});Fl.normalize=Fl.InstrumentationBase=void 0;var lz=cz();Object.defineProperty(Fl,"InstrumentationBase",{enumerable:!0,get:function(){return lz.InstrumentationBase}});Object.defineProperty(Fl,"normalize",{enumerable:!0,get:function(){return lz.normalize}})});var dz=E(_S=>{"use strict";c();Object.defineProperty(_S,"__esModule",{value:!0});_S.InstrumentationNodeModuleDefinition=void 0;var wN=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};_S.InstrumentationNodeModuleDefinition=wN});var pz=E(hS=>{"use strict";c();Object.defineProperty(hS,"__esModule",{value:!0});hS.InstrumentationNodeModuleFile=void 0;var cNe=kN(),LN=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,cNe.normalize)(e)}};hS.InstrumentationNodeModuleFile=LN});var fz=E(tu=>{"use strict";c();Object.defineProperty(tu,"__esModule",{value:!0});tu.semconvStabilityFromStr=tu.SemconvStability=void 0;var gS;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(gS=tu.SemconvStability||(tu.SemconvStability={}));function lNe(t,e){let n=gS.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=gS.DUPLICATE;break}else o.toLowerCase()===t&&(n=gS.STABLE);return n}tu.semconvStabilityFromStr=lNe});var _z=E(Tt=>{"use strict";c();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.semconvStabilityFromStr=Tt.SemconvStability=Tt.safeExecuteInTheMiddleAsync=Tt.safeExecuteInTheMiddle=Tt.isWrapped=Tt.InstrumentationNodeModuleFile=Tt.InstrumentationNodeModuleDefinition=Tt.InstrumentationBase=Tt.registerInstrumentations=void 0;var dNe=$9();Object.defineProperty(Tt,"registerInstrumentations",{enumerable:!0,get:function(){return dNe.registerInstrumentations}});var pNe=kN();Object.defineProperty(Tt,"InstrumentationBase",{enumerable:!0,get:function(){return pNe.InstrumentationBase}});var fNe=dz();Object.defineProperty(Tt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return fNe.InstrumentationNodeModuleDefinition}});var mNe=pz();Object.defineProperty(Tt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return mNe.InstrumentationNodeModuleFile}});var DN=PN();Object.defineProperty(Tt,"isWrapped",{enumerable:!0,get:function(){return DN.isWrapped}});Object.defineProperty(Tt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return DN.safeExecuteInTheMiddle}});Object.defineProperty(Tt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return DN.safeExecuteInTheMiddleAsync}});var mz=fz();Object.defineProperty(Tt,"SemconvStability",{enumerable:!0,get:function(){return mz.SemconvStability}});Object.defineProperty(Tt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return mz.semconvStabilityFromStr}})});var Iz=E(jl=>{"use strict";c();Object.defineProperty(jl,"__esModule",{value:!0});jl.PACKAGE_NAME=jl.PACKAGE_VERSION=void 0;jl.PACKAGE_VERSION="0.60.0";jl.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var GN=E(Do=>{"use strict";c();Object.defineProperty(Do,"__esModule",{value:!0});Do.HapiLifecycleMethodNames=Do.HapiLayerType=Do.handlerPatched=Do.HapiComponentName=void 0;Do.HapiComponentName="@hapi/hapi";Do.handlerPatched=Symbol("hapi-handler-patched");Do.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};Do.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var Oz=E(ES=>{"use strict";c();Object.defineProperty(ES,"__esModule",{value:!0});ES.ATTR_HTTP_METHOD=void 0;ES.ATTR_HTTP_METHOD="http.method"});var jN=E(zf=>{"use strict";c();Object.defineProperty(zf,"__esModule",{value:!0});zf.AttributeNames=void 0;var PNe;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(PNe=zf.AttributeNames||(zf.AttributeNames={}))});var xz=E(Et=>{"use strict";c();Object.defineProperty(Et,"__esModule",{value:!0});Et.getPluginFromInput=Et.getExtMetadata=Et.getRouteMetadata=Et.isPatchableExtMethod=Et.isDirectExtInput=Et.isLifecycleExtEventObj=Et.isLifecycleExtType=Et.getPluginName=void 0;var Cz=(fe(),x(Oe)),MNe=Oz(),Yf=GN(),Bi=jN(),Nz=se();function vNe(t){return t.name?t.name:t.pkg.name}Et.getPluginName=vNe;var kNe=t=>typeof t=="string"&&Yf.HapiLifecycleMethodNames.has(t);Et.isLifecycleExtType=kNe;var wNe=t=>{let e=t?.type;return e!==void 0&&(0,Et.isLifecycleExtType)(e)};Et.isLifecycleExtEventObj=wNe;var LNe=t=>Array.isArray(t)&&t.length<=3&&(0,Et.isLifecycleExtType)(t[0])&&typeof t[1]=="function";Et.isDirectExtInput=LNe;var DNe=t=>!Array.isArray(t);Et.isPatchableExtMethod=DNe;var UNe=(t,e,n)=>{let r={[Cz.ATTR_HTTP_ROUTE]:t.path};e&Nz.SemconvStability.OLD&&(r[MNe.ATTR_HTTP_METHOD]=t.method),e&Nz.SemconvStability.STABLE&&(r[Cz.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[Bi.AttributeNames.HAPI_TYPE]=Yf.HapiLayerType.PLUGIN,r[Bi.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[Bi.AttributeNames.HAPI_TYPE]=Yf.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};Et.getRouteMetadata=UNe;var BNe=(t,e,n)=>{let r=`ext - ${t}`;return n&&n!=="method"&&(r=`ext - ${t} - ${n}`),e?{attributes:{[Bi.AttributeNames.EXT_TYPE]:t,[Bi.AttributeNames.HAPI_TYPE]:Yf.HapiLayerType.EXT,[Bi.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ${r}`}:{attributes:{[Bi.AttributeNames.EXT_TYPE]:t,[Bi.AttributeNames.HAPI_TYPE]:Yf.HapiLayerType.EXT},name:r}};Et.getExtMetadata=BNe;var FNe=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;Et.getPluginFromInput=FNe});var vz=E(SS=>{"use strict";c();Object.defineProperty(SS,"__esModule",{value:!0});SS.HapiInstrumentation=void 0;var ir=(M(),x(L)),Pz=ye(),Wf=se(),Mz=Iz(),Kf=GN(),Is=xz(),HN=class extends Wf.InstrumentationBase{_semconvStability;constructor(e={}){super(Mz.PACKAGE_NAME,Mz.PACKAGE_VERSION,e),this._semconvStability=(0,Wf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Wf.InstrumentationNodeModuleDefinition(Kf.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Wf.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Wf.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Is.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Is.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let u=i[a];if((0,Is.isLifecycleExtType)(u.type)){let d=u,p=r._wrapExtMethods(d.method,u.type,n);d.method=p,i[a]=d}}return e.apply(this,s)}else if((0,Is.isDirectExtInput)(s)){let i=s,a=i[1],u=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],u,i[2]])}else if((0,Is.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Is.getPluginName)(e),o=e.register,s=this,i=function(a,u){return s._wrap(a,"route",d=>n._getServerRoutePatch.bind(n)(d,r)),s._wrap(a,"ext",d=>n._getServerExtPatch.bind(n)(d,r)),o.call(this,a,u)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Is.isPatchableExtMethod)(e))return e[Kf.handlerPatched]===!0?e:(e[Kf.handlerPatched]=!0,async function(...i){if(ir.trace.getSpan(ir.context.active())===void 0)return await e.apply(this,i);let a=(0,Is.getExtMetadata)(n,r,e.name),u=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await ir.context.with(ir.trace.setSpan(ir.context.active(),u),e,void 0,...i)}catch(d){throw u.recordException(d),u.setStatus({code:ir.SpanStatusCode.ERROR,message:d.message}),d}finally{u.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[Kf.handlerPatched]===!0)return e;e[Kf.handlerPatched]=!0;let o=s=>async function(...i){if(ir.trace.getSpan(ir.context.active())===void 0)return await s.call(this,...i);let a=(0,Pz.getRPCMetadata)(ir.context.active());a?.type===Pz.RPCType.HTTP&&(a.route=e.path);let u=(0,Is.getRouteMetadata)(e,r._semconvStability,n),d=r.tracer.startSpan(u.name,{attributes:u.attributes});try{return await ir.context.with(ir.trace.setSpan(ir.context.active(),d),()=>s.call(this,...i))}catch(p){throw d.recordException(p),d.setStatus({code:ir.SpanStatusCode.ERROR,message:p.message}),p}finally{d.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};SS.HapiInstrumentation=HN});var kz=E(Hl=>{"use strict";c();Object.defineProperty(Hl,"__esModule",{value:!0});Hl.AttributeNames=Hl.HapiInstrumentation=void 0;var GNe=vz();Object.defineProperty(Hl,"HapiInstrumentation",{enumerable:!0,get:function(){return GNe.HapiInstrumentation}});var jNe=jN();Object.defineProperty(Hl,"AttributeNames",{enumerable:!0,get:function(){return jNe.AttributeNames}})});var bS=E(Jf=>{"use strict";c();Object.defineProperty(Jf,"__esModule",{value:!0});Jf.KoaLayerType=void 0;var YNe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(YNe=Jf.KoaLayerType||(Jf.KoaLayerType={}))});var jz=E(Vl=>{"use strict";c();Object.defineProperty(Vl,"__esModule",{value:!0});Vl.PACKAGE_NAME=Vl.PACKAGE_VERSION=void 0;Vl.PACKAGE_VERSION="0.62.0";Vl.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var VN=E(Xf=>{"use strict";c();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.AttributeNames=void 0;var WNe;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(WNe=Xf.AttributeNames||(Xf.AttributeNames={}))});var Vz=E(ql=>{"use strict";c();Object.defineProperty(ql,"__esModule",{value:!0});ql.isLayerIgnored=ql.getMiddlewareMetadata=void 0;var Hz=bS(),RS=VN(),KNe=(fe(),x(Oe)),QNe=(t,e,n,r)=>n?{attributes:{[RS.AttributeNames.KOA_NAME]:r?.toString(),[RS.AttributeNames.KOA_TYPE]:Hz.KoaLayerType.ROUTER,[KNe.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[RS.AttributeNames.KOA_NAME]:e.name??"middleware",[RS.AttributeNames.KOA_TYPE]:Hz.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};ql.getMiddlewareMetadata=QNe;var JNe=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));ql.isLayerIgnored=JNe});var qz=E(IS=>{"use strict";c();Object.defineProperty(IS,"__esModule",{value:!0});IS.kLayerPatched=void 0;IS.kLayerPatched=Symbol("koa-layer-patched")});var Qz=E(OS=>{"use strict";c();Object.defineProperty(OS,"__esModule",{value:!0});OS.KoaInstrumentation=void 0;var Uo=(M(),x(L)),Zf=se(),$z=bS(),zz=jz(),Yz=Vz(),Wz=ye(),Kz=qz(),qN=class extends Zf.InstrumentationBase{constructor(e={}){super(zz.PACKAGE_NAME,zz.PACKAGE_VERSION,e)}init(){return new Zf.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Zf.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Zf.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){Uo.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let u=i[a];i[a]=this._patchLayer(u,!0,s)}}return e}_patchLayer(e,n,r){let o=n?$z.KoaLayerType.ROUTER:$z.KoaLayerType.MIDDLEWARE;return e[Kz.kLayerPatched]===!0||(0,Yz.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(Uo.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[Kz.kLayerPatched]=!0,Uo.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(Uo.trace.getSpan(Uo.context.active())===void 0)return e(s,i);let u=(0,Yz.getMiddlewareMetadata)(s,e,n,r),d=this.tracer.startSpan(u.name,{attributes:u.attributes}),p=(0,Wz.getRPCMetadata)(Uo.context.active());p?.type===Wz.RPCType.HTTP&&s._matchedRoute&&(p.route=s._matchedRoute.toString());let{requestHook:f}=this.getConfig();f&&(0,Zf.safeExecuteInTheMiddle)(()=>f(d,{context:s,middlewareLayer:e,layerType:o}),_=>{_&&Uo.diag.error("koa instrumentation: request hook failed",_)},!0);let m=Uo.trace.setSpan(Uo.context.active(),d);return Uo.context.with(m,async()=>{try{return await e(s,i)}catch(_){throw d.recordException(_),_}finally{d.end()}})})}};OS.KoaInstrumentation=qN});var Jz=E(Gi=>{"use strict";c();Object.defineProperty(Gi,"__esModule",{value:!0});Gi.KoaLayerType=Gi.AttributeNames=Gi.KoaInstrumentation=void 0;var XNe=Qz();Object.defineProperty(Gi,"KoaInstrumentation",{enumerable:!0,get:function(){return XNe.KoaInstrumentation}});var ZNe=VN();Object.defineProperty(Gi,"AttributeNames",{enumerable:!0,get:function(){return ZNe.AttributeNames}});var exe=bS();Object.defineProperty(Gi,"KoaLayerType",{enumerable:!0,get:function(){return exe.KoaLayerType}})});var $N=E(no=>{"use strict";c();Object.defineProperty(no,"__esModule",{value:!0});no.ConnectNames=no.ConnectTypes=no.AttributeNames=void 0;var nxe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(nxe=no.AttributeNames||(no.AttributeNames={}));var rxe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(rxe=no.ConnectTypes||(no.ConnectTypes={}));var oxe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(oxe=no.ConnectNames||(no.ConnectNames={}))});var nY=E($l=>{"use strict";c();Object.defineProperty($l,"__esModule",{value:!0});$l.PACKAGE_NAME=$l.PACKAGE_VERSION=void 0;$l.PACKAGE_VERSION="0.57.0";$l.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var rY=E(CS=>{"use strict";c();Object.defineProperty(CS,"__esModule",{value:!0});CS._LAYERS_STORE_PROPERTY=void 0;CS._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var oY=E(Hi=>{"use strict";c();Object.defineProperty(Hi,"__esModule",{value:!0});Hi.generateRoute=Hi.replaceCurrentStackRoute=Hi.addNewStackLayer=void 0;var sxe=(M(),x(L)),ji=rY(),ixe=t=>{Array.isArray(t[ji._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,ji._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[ji._LAYERS_STORE_PROPERTY].push("/");let e=t[ji._LAYERS_STORE_PROPERTY].length;return()=>{e===t[ji._LAYERS_STORE_PROPERTY].length?t[ji._LAYERS_STORE_PROPERTY].pop():sxe.diag.warn("Connect: Trying to pop the stack multiple time")}};Hi.addNewStackLayer=ixe;var axe=(t,e)=>{e&&t[ji._LAYERS_STORE_PROPERTY].splice(-1,1,e)};Hi.replaceCurrentStackRoute=axe;var uxe=t=>t[ji._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);Hi.generateRoute=uxe});var aY=E(Vi=>{"use strict";c();Object.defineProperty(Vi,"__esModule",{value:!0});Vi.ConnectInstrumentation=Vi.ANONYMOUS_NAME=void 0;var cxe=(M(),x(L)),sY=ye(),zl=$N(),iY=nY(),NS=se(),lxe=(fe(),x(Oe)),zN=oY();Vi.ANONYMOUS_NAME="anonymous";var YN=class extends NS.InstrumentationBase{constructor(e={}){super(iY.PACKAGE_NAME,iY.PACKAGE_VERSION,e)}init(){return[new NS.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,NS.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,NS.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=zl.ConnectTypes.REQUEST_HANDLER,s=zl.ConnectNames.REQUEST_HANDLER,o=e):(r=zl.ConnectTypes.MIDDLEWARE,s=zl.ConnectNames.MIDDLEWARE,o=n.name||Vi.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[lxe.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[zl.AttributeNames.CONNECT_TYPE]:r,[zl.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,u]=o?[1,2,3]:[0,1,2],d=arguments[i],p=arguments[a],f=arguments[u];(0,zN.replaceCurrentStackRoute)(d,e);let m=(0,sY.getRPCMetadata)(cxe.context.active());e&&m?.type===sY.RPCType.HTTP&&(m.route=(0,zN.generateRoute)(d));let _="";e?_=`request handler - ${e}`:_=`middleware - ${n.name||Vi.ANONYMOUS_NAME}`;let h=r._startSpan(e,n);r._diag.debug("start span",_);let g=!1;function T(){g?r._diag.debug(`span ${h.name} - already finished`):(g=!0,r._diag.debug(`finishing span ${h.name}`),h.end()),p.removeListener("close",T)}return p.addListener("close",T),arguments[u]=r._patchNext(f,T),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,zN.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};Vi.ConnectInstrumentation=YN});var cY=E(kr=>{"use strict";c();Object.defineProperty(kr,"__esModule",{value:!0});kr.ConnectTypes=kr.ConnectNames=kr.AttributeNames=kr.ANONYMOUS_NAME=kr.ConnectInstrumentation=void 0;var uY=aY();Object.defineProperty(kr,"ConnectInstrumentation",{enumerable:!0,get:function(){return uY.ConnectInstrumentation}});Object.defineProperty(kr,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return uY.ANONYMOUS_NAME}});var WN=$N();Object.defineProperty(kr,"AttributeNames",{enumerable:!0,get:function(){return WN.AttributeNames}});Object.defineProperty(kr,"ConnectNames",{enumerable:!0,get:function(){return WN.ConnectNames}});Object.defineProperty(kr,"ConnectTypes",{enumerable:!0,get:function(){return WN.ConnectTypes}})});var mY=E(Ut=>{"use strict";c();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.DB_SYSTEM_VALUE_MSSQL=Ut.ATTR_NET_PEER_PORT=Ut.ATTR_NET_PEER_NAME=Ut.ATTR_DB_USER=Ut.ATTR_DB_SYSTEM=Ut.ATTR_DB_STATEMENT=Ut.ATTR_DB_SQL_TABLE=Ut.ATTR_DB_NAME=void 0;Ut.ATTR_DB_NAME="db.name";Ut.ATTR_DB_SQL_TABLE="db.sql.table";Ut.ATTR_DB_STATEMENT="db.statement";Ut.ATTR_DB_SYSTEM="db.system";Ut.ATTR_DB_USER="db.user";Ut.ATTR_NET_PEER_NAME="net.peer.name";Ut.ATTR_NET_PEER_PORT="net.peer.port";Ut.DB_SYSTEM_VALUE_MSSQL="mssql"});var _Y=E(Yl=>{"use strict";c();Object.defineProperty(Yl,"__esModule",{value:!0});Yl.once=Yl.getSpanName=void 0;function pxe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}Yl.getSpanName=pxe;var fxe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Yl.once=fxe});var hY=E(Wl=>{"use strict";c();Object.defineProperty(Wl,"__esModule",{value:!0});Wl.PACKAGE_NAME=Wl.PACKAGE_VERSION=void 0;Wl.PACKAGE_VERSION="0.33.0";Wl.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var AY=E($i=>{"use strict";c();Object.defineProperty($i,"__esModule",{value:!0});$i.TediousInstrumentation=$i.INJECTED_CTX=void 0;var Kl=(M(),x(L)),mxe=B("events"),Bo=se(),nu=(fe(),x(Oe)),qi=mY(),gY=_Y(),TY=hY(),SY=Symbol("opentelemetry.instrumentation-tedious.current-database");$i.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var EY=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function xS(t){Object.defineProperty(this,SY,{value:t,writable:!0})}var KN=class t extends Bo.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(TY.PACKAGE_NAME,TY.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Bo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Bo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Bo.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of EY)(0,Bo.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,Bo.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of EY)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return xS.call(this,this.config?.options?.database),this.removeListener("databaseChange",xS),this.on("databaseChange",xS),this.once("end",()=>{this.removeListener("databaseChange",xS)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Kl.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,u=>{o()});Object.defineProperty(i,$i.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[$i.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof mxe.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,u=0,d=()=>u++,p=()=>a++,f=this[SY],m=(I=>I.sqlTextOrProcedure==="sp_prepare"&&I.parametersByName?.stmt?.value?I.parametersByName.stmt.value:I.sqlTextOrProcedure)(i),_={};o._dbSemconvStability&Bo.SemconvStability.OLD&&(_[qi.ATTR_DB_SYSTEM]=qi.DB_SYSTEM_VALUE_MSSQL,_[qi.ATTR_DB_NAME]=f,_[qi.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,_[qi.ATTR_DB_STATEMENT]=m,_[qi.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&Bo.SemconvStability.STABLE&&(_[nu.ATTR_DB_NAMESPACE]=f,_[nu.ATTR_DB_SYSTEM_NAME]=nu.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,_[nu.ATTR_DB_QUERY_TEXT]=m,_[nu.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&Bo.SemconvStability.OLD&&(_[qi.ATTR_NET_PEER_NAME]=this.config?.server,_[qi.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&Bo.SemconvStability.STABLE&&(_[nu.ATTR_SERVER_ADDRESS]=this.config?.server,_[nu.ATTR_SERVER_PORT]=this.config?.options?.port);let h=o.tracer.startSpan((0,gY.getSpanName)(e,f,m,i.table),{kind:Kl.SpanKind.CLIENT,attributes:_}),g=(0,gY.once)(I=>{i.removeListener("done",d),i.removeListener("doneInProc",d),i.removeListener("doneProc",p),i.removeListener("error",g),this.removeListener("end",g),h.setAttribute("tedious.procedure_count",a),h.setAttribute("tedious.statement_count",u),I&&h.setStatus({code:Kl.SpanStatusCode.ERROR,message:I.message}),h.end()});i.on("done",d),i.on("doneInProc",d),i.on("doneProc",p),i.once("error",g),this.on("end",g),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(g)):o._diag.error("Expected request.callback to be a function");let T=()=>Kl.context.with(Kl.trace.setSpan(Kl.context.active(),h),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return T();let R=o._buildTraceparent(h);o._injectContextInfo(this,n,R).finally(T)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};$i.TediousInstrumentation=KN});var yY=E(PS=>{"use strict";c();Object.defineProperty(PS,"__esModule",{value:!0});PS.TediousInstrumentation=void 0;var _xe=AY();Object.defineProperty(PS,"TediousInstrumentation",{enumerable:!0,get:function(){return _xe.TediousInstrumentation}})});var CY=E(Ql=>{"use strict";c();Object.defineProperty(Ql,"__esModule",{value:!0});Ql.PACKAGE_NAME=Ql.PACKAGE_VERSION=void 0;Ql.PACKAGE_VERSION="0.57.0";Ql.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var xY=E(MS=>{"use strict";c();Object.defineProperty(MS,"__esModule",{value:!0});MS.GenericPoolInstrumentation=void 0;var Jl=(M(),x(L)),ru=se(),NY=CY(),QN="generic-pool",JN=class extends ru.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(NY.PACKAGE_NAME,NY.PACKAGE_VERSION,e)}init(){return[new ru.InstrumentationNodeModuleDefinition(QN,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,ru.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new ru.InstrumentationNodeModuleDefinition(QN,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,ru.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new ru.InstrumentationNodeModuleDefinition(QN,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,ru.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=Jl.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return Jl.context.with(Jl.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=Jl.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return Jl.context.with(Jl.trace.setSpan(i,a),()=>{e.call(this,(u,d)=>{if(a.end(),o)return o(u,d)},s)})}}};MS.GenericPoolInstrumentation=JN});var PY=E(vS=>{"use strict";c();Object.defineProperty(vS,"__esModule",{value:!0});vS.GenericPoolInstrumentation=void 0;var Txe=xY();Object.defineProperty(vS,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return Txe.GenericPoolInstrumentation}})});var XN=E(Fo=>{"use strict";c();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ATTR_NET_PEER_PORT=Fo.ATTR_NET_PEER_NAME=Fo.ATTR_MESSAGING_SYSTEM=Fo.ATTR_MESSAGING_OPERATION=void 0;Fo.ATTR_MESSAGING_OPERATION="messaging.operation";Fo.ATTR_MESSAGING_SYSTEM="messaging.system";Fo.ATTR_NET_PEER_NAME="net.peer.name";Fo.ATTR_NET_PEER_PORT="net.peer.port"});var ZN=E(Je=>{"use strict";c();Object.defineProperty(Je,"__esModule",{value:!0});Je.ATTR_MESSAGING_CONVERSATION_ID=Je.OLD_ATTR_MESSAGING_MESSAGE_ID=Je.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=Je.ATTR_MESSAGING_URL=Je.ATTR_MESSAGING_PROTOCOL_VERSION=Je.ATTR_MESSAGING_PROTOCOL=Je.MESSAGING_OPERATION_VALUE_PROCESS=Je.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=Je.ATTR_MESSAGING_DESTINATION_KIND=Je.ATTR_MESSAGING_DESTINATION=void 0;Je.ATTR_MESSAGING_DESTINATION="messaging.destination";Je.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";Je.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";Je.MESSAGING_OPERATION_VALUE_PROCESS="process";Je.ATTR_MESSAGING_PROTOCOL="messaging.protocol";Je.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";Je.ATTR_MESSAGING_URL="messaging.url";Je.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";Je.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";Je.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var ex=E(ou=>{"use strict";c();Object.defineProperty(ou,"__esModule",{value:!0});ou.DEFAULT_CONFIG=ou.EndOperation=void 0;var Sxe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(Sxe=ou.EndOperation||(ou.EndOperation={}));ou.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var BY=E(Xe=>{"use strict";c();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.isConfirmChannelTracing=Xe.unmarkConfirmChannelTracing=Xe.markConfirmChannelTracing=Xe.getConnectionAttributesFromUrl=Xe.getConnectionAttributesFromServer=Xe.normalizeExchange=Xe.CONNECTION_ATTRIBUTES=Xe.CHANNEL_CONSUME_TIMEOUT_TIMER=Xe.CHANNEL_SPANS_NOT_ENDED=Xe.MESSAGE_STORED_SPAN=void 0;var tx=(M(),x(L)),zi=se(),kS=(fe(),x(Oe)),em=XN(),wS=ZN();Xe.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Xe.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Xe.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Xe.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var nx=(0,tx.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),Axe=t=>t!==""?t:"<default>";Xe.normalizeExchange=Axe;var yxe=t=>t.replace(/:[^:@/]*@/,":***@"),LY=(t,e)=>t||(e==="AMQP"?5672:5671),DY=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},UY=t=>t||"localhost",Go=(t,e,n,r)=>n?{[e]:n}:(tx.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),bxe=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[em.ATTR_MESSAGING_SYSTEM]:e}:{}};Xe.getConnectionAttributesFromServer=bxe;var Rxe=(t,e)=>{let n={[wS.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=DY(r?.protocol);Object.assign(n,{...Go(t,wS.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=UY(r?.hostname);e&zi.SemconvStability.OLD&&Object.assign(n,{...Go(t,em.ATTR_NET_PEER_NAME,s,"hostname")}),e&zi.SemconvStability.STABLE&&Object.assign(n,{...Go(t,kS.ATTR_SERVER_ADDRESS,s,"hostname")});let i=LY(r.port,o);e&zi.SemconvStability.OLD&&Object.assign(n,Go(t,em.ATTR_NET_PEER_PORT,i,"port")),e&zi.SemconvStability.STABLE&&Object.assign(n,Go(t,kS.ATTR_SERVER_PORT,i,"port"))}else{let r=yxe(t);n[wS.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=DY(o.protocol);Object.assign(n,{...Go(r,wS.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=UY(o.hostname);e&zi.SemconvStability.OLD&&Object.assign(n,{...Go(r,em.ATTR_NET_PEER_NAME,i,"hostname")}),e&zi.SemconvStability.STABLE&&Object.assign(n,{...Go(r,kS.ATTR_SERVER_ADDRESS,i,"hostname")});let a=LY(o.port?parseInt(o.port):void 0,s);e&zi.SemconvStability.OLD&&Object.assign(n,Go(r,em.ATTR_NET_PEER_PORT,a,"port")),e&zi.SemconvStability.STABLE&&Object.assign(n,Go(r,kS.ATTR_SERVER_PORT,a,"port"))}catch(o){tx.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Xe.getConnectionAttributesFromUrl=Rxe;var Ixe=t=>t.setValue(nx,!0);Xe.markConfirmChannelTracing=Ixe;var Oxe=t=>t.deleteValue(nx);Xe.unmarkConfirmChannelTracing=Oxe;var Cxe=t=>t.getValue(nx)===!0;Xe.isConfirmChannelTracing=Cxe});var FY=E(Xl=>{"use strict";c();Object.defineProperty(Xl,"__esModule",{value:!0});Xl.PACKAGE_NAME=Xl.PACKAGE_VERSION=void 0;Xl.PACKAGE_VERSION="0.61.0";Xl.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var jY=E(US=>{"use strict";c();Object.defineProperty(US,"__esModule",{value:!0});US.AmqplibInstrumentation=void 0;var qe=(M(),x(L)),LS=ye(),be=se(),Nxe=XN(),ar=ZN(),xn=ex(),Ze=BY(),GY=FY(),DS=[">=0.5.5 <1"],rx=class extends be.InstrumentationBase{_netSemconvStability;constructor(e={}){super(GY.PACKAGE_NAME,GY.PACKAGE_VERSION,{...xn.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,be.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...xn.DEFAULT_CONFIG,...e})}init(){let e=new be.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",DS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new be.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",DS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new be.InstrumentationNodeModuleFile("amqplib/lib/connect.js",DS,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new be.InstrumentationNodeModuleDefinition("amqplib",DS,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,be.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,be.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,be.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,be.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,be.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,xn.EndOperation.Ack)),(0,be.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,xn.EndOperation.Nack)),(0,be.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,xn.EndOperation.Reject)),(0,be.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,xn.EndOperation.AckAll)),(0,be.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,xn.EndOperation.NackAll)),(0,be.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,be.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,be.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,be.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,be.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,be.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,be.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,be.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,be.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,be.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,be.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,u){if(a==null){let d=(0,Ze.getConnectionAttributesFromUrl)(o,n._netSemconvStability),p=(0,Ze.getConnectionAttributesFromServer)(u);u[Ze.CONNECTION_ATTRIBUTES]={...d,...p}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,xn.EndOperation.ChannelClosed,void 0);let s=this[Ze.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[Ze.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,xn.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,u){let d=this,p=n===xn.EndOperation.Reject?a:u,f=d[Ze.CHANNEL_SPANS_NOT_ENDED]??[],m=f.findIndex(_=>_.msg===i);if(m<0)o.endConsumerSpan(i,e,n,p);else if(n!==xn.EndOperation.Reject&&a){for(let _=0;_<=m;_++)o.endConsumerSpan(f[_].msg,e,n,p);f.splice(0,m+1)}else o.endConsumerSpan(i,e,n,p),f.splice(m,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let u=this;if(!Object.prototype.hasOwnProperty.call(u,Ze.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:p}=r.getConfig();if(p){let f=setInterval(()=>{r.checkConsumeTimeoutOnChannel(u)},p);f.unref(),u[Ze.CHANNEL_CONSUME_TIMEOUT_TIMER]=f}u[Ze.CHANNEL_SPANS_NOT_ENDED]=[]}let d=function(p){if(!p)return i.call(this,p);let f=p.properties.headers??{},m=qe.propagation.extract(qe.ROOT_CONTEXT,f),_=p.fields?.exchange,h;if(r._config.useLinksForConsume){let A=m?qe.trace.getSpan(m)?.spanContext():void 0;m=void 0,A&&(h=[{context:A}])}let g=r.tracer.startSpan(`${s} process`,{kind:qe.SpanKind.CONSUMER,attributes:{...u?.connection?.[Ze.CONNECTION_ATTRIBUTES],[ar.ATTR_MESSAGING_DESTINATION]:_,[ar.ATTR_MESSAGING_DESTINATION_KIND]:ar.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[ar.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:p.fields?.routingKey,[Nxe.ATTR_MESSAGING_OPERATION]:ar.MESSAGING_OPERATION_VALUE_PROCESS,[ar.OLD_ATTR_MESSAGING_MESSAGE_ID]:p?.properties.messageId,[ar.ATTR_MESSAGING_CONVERSATION_ID]:p?.properties.correlationId},links:h},m),{consumeHook:T}=r.getConfig();T&&(0,be.safeExecuteInTheMiddle)(()=>T(g,{moduleVersion:e,msg:p}),A=>{A&&qe.diag.error("amqplib instrumentation: consumerHook error",A)},!0),a?.noAck||(u[Ze.CHANNEL_SPANS_NOT_ENDED].push({msg:p,timeOfConsume:(0,LS.hrTime)()}),p[Ze.MESSAGE_STORED_SPAN]=g);let S=m||qe.ROOT_CONTEXT;qe.context.with(qe.trace.setSpan(S,g),()=>{i.call(this,p)}),a?.noAck&&(r.callConsumeEndHook(g,p,!1,xn.EndOperation.AutoAck),g.end())};return arguments[1]=d,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,u,d){let p=this,{span:f,modifiedOptions:m}=r.createPublishSpan(r,s,i,p,u),{publishHook:_}=r.getConfig();_&&(0,be.safeExecuteInTheMiddle)(()=>_(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:m,isConfirmChannel:!0}),S=>{S&&qe.diag.error("amqplib instrumentation: publishHook error",S)},!0);let h=function(S,A){try{d?.call(this,S,A)}finally{let{publishConfirmHook:R}=r.getConfig();R&&(0,be.safeExecuteInTheMiddle)(()=>R(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:u,isConfirmChannel:!0,confirmError:S}),I=>{I&&qe.diag.error("amqplib instrumentation: publishConfirmHook error",I)},!0),S&&f.setStatus({code:qe.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),f.end()}},g=(0,Ze.markConfirmChannelTracing)(qe.context.active()),T=[...arguments];return T[3]=m,T[4]=qe.context.bind((0,Ze.unmarkConfirmChannelTracing)(qe.trace.setSpan(g,f)),h),qe.context.with(g,n.bind(this,...T))}}getPublishPatch(e,n){let r=this;return function(s,i,a,u){if((0,Ze.isConfirmChannelTracing)(qe.context.active()))return n.apply(this,arguments);{let d=this,{span:p,modifiedOptions:f}=r.createPublishSpan(r,s,i,d,u),{publishHook:m}=r.getConfig();m&&(0,be.safeExecuteInTheMiddle)(()=>m(p,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:f,isConfirmChannel:!1}),g=>{g&&qe.diag.error("amqplib instrumentation: publishHook error",g)},!0);let _=[...arguments];_[3]=f;let h=n.apply(this,_);return p.end(),h}}}createPublishSpan(e,n,r,o,s){let i=(0,Ze.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:qe.SpanKind.PRODUCER,attributes:{...o.connection[Ze.CONNECTION_ATTRIBUTES],[ar.ATTR_MESSAGING_DESTINATION]:n,[ar.ATTR_MESSAGING_DESTINATION_KIND]:ar.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[ar.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[ar.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[ar.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),u=s??{};return u.headers=u.headers??{},qe.propagation.inject(qe.trace.setSpan(qe.context.active(),a),u.headers),{span:a,modifiedOptions:u}}endConsumerSpan(e,n,r,o){let s=e[Ze.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:qe.SpanStatusCode.ERROR,message:r!==xn.EndOperation.ChannelClosed&&r!==xn.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[Ze.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[Ze.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[Ze.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,be.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&qe.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,LS.hrTime)(),r=e[Ze.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,LS.hrTimeDuration)(i.timeOfConsume,n);if((0,LS.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,xn.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};US.AmqplibInstrumentation=rx});var VY=E(Yi=>{"use strict";c();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.EndOperation=Yi.DEFAULT_CONFIG=Yi.AmqplibInstrumentation=void 0;var xxe=jY();Object.defineProperty(Yi,"AmqplibInstrumentation",{enumerable:!0,get:function(){return xxe.AmqplibInstrumentation}});var HY=ex();Object.defineProperty(Yi,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return HY.DEFAULT_CONFIG}});Object.defineProperty(Yi,"EndOperation",{enumerable:!0,get:function(){return HY.EndOperation}})});var SQ=E((nyt,EQ)=>{"use strict";c();var fQ="-",o2e=/^xn--/,s2e=/[^\0-\x7F]/,i2e=/[\x2E\u3002\uFF0E\uFF61]/g,a2e={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$P=35,Jo=Math.floor,zP=String.fromCharCode;function na(t){throw new RangeError(a2e[t])}function u2e(t,e){let n=[],r=t.length;for(;r--;)n[r]=e(t[r]);return n}function mQ(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(i2e,".");let o=t.split("."),s=u2e(o,e).join(".");return r+s}function _Q(t){let e=[],n=0,r=t.length;for(;n<r;){let o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){let s=t.charCodeAt(n++);(s&64512)==56320?e.push(((o&1023)<<10)+(s&1023)+65536):(e.push(o),n--)}else e.push(o)}return e}var c2e=t=>String.fromCodePoint(...t),l2e=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},pQ=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},hQ=function(t,e,n){let r=0;for(t=n?Jo(t/700):t>>1,t+=Jo(t/e);t>$P*26>>1;r+=36)t=Jo(t/$P);return Jo(r+($P+1)*t/(t+38))},gQ=function(t){let e=[],n=t.length,r=0,o=128,s=72,i=t.lastIndexOf(fQ);i<0&&(i=0);for(let a=0;a<i;++a)t.charCodeAt(a)>=128&&na("not-basic"),e.push(t.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){let u=r;for(let p=1,f=36;;f+=36){a>=n&&na("invalid-input");let m=l2e(t.charCodeAt(a++));m>=36&&na("invalid-input"),m>Jo((2147483647-r)/p)&&na("overflow"),r+=m*p;let _=f<=s?1:f>=s+26?26:f-s;if(m<_)break;let h=36-_;p>Jo(2147483647/h)&&na("overflow"),p*=h}let d=e.length+1;s=hQ(r-u,d,u==0),Jo(r/d)>2147483647-o&&na("overflow"),o+=Jo(r/d),r%=d,e.splice(r++,0,o)}return String.fromCodePoint(...e)},TQ=function(t){let e=[];t=_Q(t);let n=t.length,r=128,o=0,s=72;for(let u of t)u<128&&e.push(zP(u));let i=e.length,a=i;for(i&&e.push(fQ);a<n;){let u=2147483647;for(let p of t)p>=r&&p<u&&(u=p);let d=a+1;u-r>Jo((2147483647-o)/d)&&na("overflow"),o+=(u-r)*d,r=u;for(let p of t)if(p<r&&++o>2147483647&&na("overflow"),p===r){let f=o;for(let m=36;;m+=36){let _=m<=s?1:m>=s+26?26:m-s;if(f<_)break;let h=f-_,g=36-_;e.push(zP(pQ(_+h%g,0))),f=Jo(h/g)}e.push(zP(pQ(f,0))),s=hQ(o,d,a===i),o=0,++a}++o,++r}return e.join("")},d2e=function(t){return mQ(t,function(e){return o2e.test(e)?gQ(e.slice(4).toLowerCase()):e})},p2e=function(t){return mQ(t,function(e){return s2e.test(e)?"xn--"+TQ(e):e})},f2e={version:"2.3.1",ucs2:{decode:_Q,encode:c2e},decode:gQ,encode:TQ,toASCII:p2e,toUnicode:d2e};EQ.exports=f2e});c();c();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="901c05ad-4a64-4d3e-8adc-77cc0a54ea06",t._sentryDebugIdIdentifier="sentry-dbid-901c05ad-4a64-4d3e-8adc-77cc0a54ea06")}catch{}})();c();c();c();c();M();var VV=J(fF(),1);c();c();c();var v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;c();c();var ee=globalThis;c();c();c();c();var me="10.47.0";function En(){return Ks(ee),ee}function Ks(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||me,e[me]=e[me]||{}}function Vr(t,e,n=ee){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[me]=r[me]||{};return o[t]||(o[t]=e())}var ep=["debug","info","warn","error","log","assert","trace"],xfe="Sentry Logger ",lc={};function rt(t){if(!("console"in ee))return t();let e=ee.console,n={},r=Object.keys(lc);r.forEach(o=>{let s=lc[o];n[o]=e[o],e[o]=s});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function Pfe(){Nb().enabled=!0}function Mfe(){Nb().enabled=!1}function mF(){return Nb().enabled}function vfe(...t){Cb("log",...t)}function kfe(...t){Cb("warn",...t)}function wfe(...t){Cb("error",...t)}function Cb(t,...e){v&&mF()&&rt(()=>{ee.console[t](`${xfe}[${t}]:`,...e)})}function Nb(){return v?Vr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var b={enable:Pfe,disable:Mfe,isEnabled:mF,log:vfe,warn:kfe,error:wfe};c();var th="?",_F=/\(error: (.*)\)/,hF=/captureMessage|captureException/;function nh(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
|
|
13
13
|
`);for(let a=r;a<i.length;a++){let u=i[a];u.length>1024&&(u=u.slice(0,1024));let d=_F.test(u)?u.replace(_F,"$1"):u;if(!d.match(/\S*Error: /)){for(let p of e){let f=p(d);if(f){s.push(f);break}}if(s.length>=50+o)break}}return gF(s.slice(o))}}function Pb(t){return Array.isArray(t)?nh(...t):t}function gF(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(eh(e).function||"")&&e.pop(),e.reverse(),hF.test(eh(e).function||"")&&(e.pop(),hF.test(eh(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||eh(e).filename,function:n.function||th}))}function eh(t){return t[t.length-1]||{}}var xb="<anonymous>";function tp(t){try{return!t||typeof t!="function"?xb:t.name||xb}catch{return xb}}function rh(t){return"__v_isVNode"in t&&t.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function TF(t){let e=t?.startsWith("file://")?t.slice(7):t;return e?.match(/\/[A-Z]:/)&&(e=e.slice(1)),e}var oh={},EF={};function dc(t,e){oh[t]=oh[t]||[],oh[t].push(e)}function pc(t,e){if(!EF[t]){EF[t]=!0;try{e()}catch(n){v&&b.error(`Error while instrumenting ${t}`,n)}}}function fc(t,e){let n=t&&oh[t];if(n)for(let r of n)try{r(e)}catch(o){v&&b.error(`Error while triggering instrumentation handler.
|
|
14
14
|
Type: ${t}
|
|
15
15
|
Name: ${tp(r)}
|
|
@@ -35,9 +35,9 @@ Url: ${Uh(t)}`),!0}return!1}function S_e(t,e){return e?.length?vh(t).some(n=>Xs(
|
|
|
35
35
|
`),h=_.shift();if(!h)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let g=h.split(" "),T=+(g[1]||0),S=g.slice(2).join(" "),A={};for(let R of _){if(!R)continue;let I=R.indexOf(":");if(I===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${R}"`));let O=R.slice(0,I).toLowerCase(),N=R.slice(I+1).trimStart(),V=A[O];typeof V=="string"?A[O]=[V,N]:Array.isArray(V)?V.push(N):A[O]=N}_T("got proxy server response: %o %o",h,A),i(),e({connect:{statusCode:T,statusText:S,headers:A},buffered:f})}t.on("error",u),t.on("end",a),s()})}function Zp(...t){b.log("[https-proxy-agent]",...t)}var ef=class extends mT{static __initStatic(){this.protocols=["http","https"]}constructor(e,n){super(n),this.options={},this.proxy=typeof e=="string"?new URL(e):e,this.proxyHeaders=n?.headers??{},Zp("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?MV(n,"headers"):null,host:r,port:o}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let o;if(r.protocol==="https:"){Zp("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=DO.connect({...this.connectOpts,servername:m&&Ts.isIP(m)?void 0:m})}else Zp("Creating `net.Socket`: %o",this.connectOpts),o=Ts.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=Ts.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${i}:${n.port} HTTP/1.1\r
|
|
36
36
|
`;if(r.username||r.password){let m=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${i}:${n.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))a+=`${m}: ${s[m]}\r
|
|
37
37
|
`;let u=PV(o);o.write(`${a}\r
|
|
38
|
-
`);let{connect:d,buffered:p}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",K0e),n.secureEndpoint){Zp("Upgrading socket connection to TLS");let m=n.servername||n.host;return DO.connect({...MV(n,"host","path","port"),socket:o,servername:Ts.isIP(m)?void 0:m})}return o}o.destroy();let f=new Ts.Socket({writable:!1});return f.readable=!0,e.once("socket",m=>{Zp("Replaying proxy buffer for failed request"),m.push(p),m.push(null)}),f}};ef.__initStatic();function K0e(t){t.resume()}function MV(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}var eAe=1024*32;function tAe(t){return new X0e({read(){this.push(t),this.push(null)}})}function vV(t){let e;try{e=new URL(t.url)}catch{return rt(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),Sp(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=nAe(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?J0e:Q0e,s=t.keepAlive===void 0?!1:t.keepAlive,i=r?new ef(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=rAe(t,t.httpModule??o,i);return Sp(t,a)}function nAe(t,e){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>t.host.endsWith(o)||t.hostname.endsWith(o)))return e}function rAe(t,e,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(d){return new Promise((p,f)=>{Ic(()=>{let m=tAe(d.body),_={...t.headers};d.body.length>eAe&&(_["content-encoding"]="gzip",m=m.pipe(Z0e()));let h=r.startsWith("["),g=e.request({method:"POST",agent:n,headers:_,hostname:h?r.slice(1,-1):r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},T=>{T.on("data",()=>{}),T.on("end",()=>{}),T.setEncoding("utf8");let S=T.headers["retry-after"]??null,A=T.headers["x-sentry-rate-limits"]??null;p({statusCode:T.statusCode,headers:{"retry-after":S,"x-sentry-rate-limits":Array.isArray(A)?A[0]||null:A}})});g.on("error",f),m.pipe(g)})})}}c();function kV(t){if(t===!1)return!1;if(typeof t=="string")return t;let e=xc(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=e===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return t===!0?n??!0:e??n}c();c();import{posix as oAe,sep as sAe}from"node:path";function wV(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function LV(t=process.argv[1]?UR(process.argv[1]):process.cwd(),e=sAe==="\\"){let n=e?wV(t):t;return r=>{if(!r)return;let o=e?wV(r):r,{dir:s,base:i,ext:a}=oAe.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let u=decodeURIComponent(i);s||(s=".");let d=s.lastIndexOf("/node_modules");if(d>-1)return`${s.slice(d+14).replace(/\//g,".")}:${u}`;if(s.startsWith(n)){let p=s.slice(n.length+1).replace(/\//g,".");return p?`${p}:${u}`:u}return u}}function DV(t){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(ee.SENTRY_RELEASE?.id)return ee.SENTRY_RELEASE.id;let e=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return e||n||r||t}var UV=nh(_I(LV()));c();M();var FV=J(se(),1);import*as BV from"node:os";import{threadId as iAe,isMainThread as aAe}from"worker_threads";var uAe=6e4,hT=class extends Ap{constructor(e){let n=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||BV.hostname(),r={...e,platform:"node",runtime:e.runtime||{name:"node",version:global.process.version},serverName:n};e.openTelemetryInstrumentations&&(0,FV.registerInstrumentations)({instrumentations:e.openTelemetryInstrumentations}),Pa(r,"node"),b.log(`Initializing Sentry: process: ${process.pid}, thread: ${aAe?"main":`worker-${iAe}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Cc(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let e="@sentry/node",n=me,r=Z.getTracer(e,n);return this._tracer=r,r}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}async close(e){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener);let n=await super.close(e);return this.traceProvider&&await this.traceProvider.shutdown(),n}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{ie&&b.log("Flushing client reports based on interval."),this._flushOutcomes()},e.clientReportFlushInterval??uAe).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_setupIntegrations(){PR(),super._setupIntegrations()}_getTraceInfoFromScope(e){return e?HH(this,e):[void 0,void 0]}};c();var GV=J(_b(),1);import*as jV from"module";function UO(){if(TV()&&!ee._sentryEsmLoaderHookRegistered){ee._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:t}=(0,GV.createAddHookMessageChannel)();jV.register("import-in-the-middle/hook.mjs",import.meta.url,{data:{addHookMessagePort:t,include:[]},transferList:[t]})}catch(t){b.warn("Failed to register 'import-in-the-middle' hook",t)}}}function gT(){return[Bh(),Dh(),Fh(),Gh(),xV(),jR(),Hh(),d6(),h6(),bV(),RV(),uV(),hV(),nV(),ZH(),IV(),yV()]}function BO(t={}){return cAe(t,gT)}function cAe(t={},e){let n=lAe(t,e);n.debug===!0&&(ie?b.enable():rt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&UO(),$H(),Te().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===wO)&&n.integrations.push(CV({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),Pa(n,"node-core");let o=new hT(n);return Te().setClient(o),o.init(),b.log(`SDK initialized from ${Jp()?"CommonJS":"ESM"}`),o.startClientReportTracking(),fAe(),NH(o),qH(o),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function FO(){if(!ie)return;let t=vH(),e=["SentryContextManager","SentryPropagator"];ot()&&e.push("SentrySpanProcessor");for(let n of e)t.includes(n)||b.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);t.includes("SentrySampler")||b.warn("You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.")}function lAe(t,e){let n=dAe(t.release),r=kV(t.spotlight),o=pAe(t.tracesSampleRate),s={...t,dsn:t.dsn??process.env.SENTRY_DSN,environment:t.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:t.sendClientReports??!0,transport:t.transport??vV,stackParser:Pb(t.stackParser||UV),release:n,tracesSampleRate:o,spotlight:r,debug:xc(t.debug??process.env.SENTRY_DEBUG)},i=t.integrations,a=t.defaultIntegrations??e(s);return{...s,integrations:yR({defaultIntegrations:a,integrations:i})}}function dAe(t){if(t!==void 0)return t;let e=DV();if(e!==void 0)return e}function pAe(t){if(t!==void 0)return t;let e=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!e)return;let n=parseFloat(e);return isFinite(n)?n:void 0}function fAe(){if(xc(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let t=process.env.SENTRY_TRACE,e=process.env.SENTRY_BAGGAGE,n=ip(t,e);Te().setPropagationContext(n)}}c();function Ce(t,e){t.setAttribute(Q,e)}c();function tf(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`,o=t.path?t.path:"/";return`${e}//${n}${r}${o}`}var GO="Http",HV="@opentelemetry_sentry-patched/instrumentation-http",TT=Xr.major===22&&Xr.minor>=12||Xr.major===23&&Xr.minor>=2||Xr.major>=24,mAe=F(`${GO}.sentry`,t=>new Ba(t)),_Ae=F(GO,t=>{let e=new VV.HttpInstrumentation({...t,disableIncomingRequestInstrumentation:!0});try{e._diag=Kn.createComponentLogger({namespace:HV}),e.instrumentationName=HV}catch{}try{let n={get:()=>!1,set:()=>{}};Object.defineProperty(e,"_httpPatched",n),Object.defineProperty(e,"_httpsPatched",n)}catch{}return e});function hAe(t,e={}){return typeof t.spans=="boolean"?t.spans:!(e.skipOpenTelemetrySetup||!ot(e)&&TT)}var qV=(t={})=>{let e=t.spans??!0,n=t.disableIncomingRequestSpans,r={sessions:t.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:t.sessionFlushingDelayMS,ignoreRequestBody:t.ignoreIncomingRequestBody,maxRequestBodySize:t.maxIncomingRequestBodySize},o={ignoreIncomingRequests:t.ignoreIncomingRequests,ignoreStaticAssets:t.ignoreStaticAssets,ignoreStatusCodes:t.dropSpansForIncomingRequestStatusCodes,instrumentation:t.instrumentation,onSpanCreated:t.incomingRequestSpanHook},s=Dp(r),i=Up(o),a=e&&!n;return{name:GO,setup(u){let d=u.getOptions();a&&ot(d)&&i.setup(u)},setupOnce(){let u=q()?.getOptions()||{},d=hAe(t,u);s.setupOnce();let p={breadcrumbs:t.breadcrumbs,propagateTraceInOutgoingRequests:typeof t.tracePropagation=="boolean"?t.tracePropagation:TT||!d,createSpansForOutgoingRequests:TT,spans:t.spans,ignoreOutgoingRequests:t.ignoreOutgoingRequests,outgoingRequestHook:(f,m)=>{let _=tf(m);if(_.startsWith("data:")){let h=Pc(_);f.setAttribute("http.url",h),f.setAttribute(ni,h),f.updateName(`${m.method||"GET"} ${h}`)}t.instrumentation?.requestHook?.(f,m)},outgoingResponseHook:t.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:t.instrumentation?.applyCustomAttributesOnSpan};if(mAe(p),d){let f=gAe(t);_Ae(f)}},processEvent(u){return i.processEvent(u)}}};function gAe(t={}){return{disableOutgoingRequestInstrumentation:TT,ignoreOutgoingRequestHook:n=>{let r=tf(n);if(!r)return!1;let o=t.ignoreOutgoingRequests;return!!o?.(r,n)},requireParentforOutgoingSpans:!1,requestHook:(n,r)=>{Ce(n,"auto.http.otel.http");let o=tf(r);if(o.startsWith("data:")){let s=Pc(o);n.setAttribute("http.url",s),n.setAttribute(ni,s),n.updateName(`${r.method||"GET"} ${s}`)}t.instrumentation?.requestHook?.(n,r)},responseHook:(n,r)=>{t.instrumentation?.responseHook?.(n,r)},applyCustomAttributesOnSpan:(n,r,o)=>{t.instrumentation?.applyCustomAttributesOnSpan?.(n,r,o)}}}c();var QV=J(WV(),1);var JV="NodeFetch",SAe=F(JV,QV.UndiciInstrumentation,t=>RAe(t)),AAe=F(`${JV}.sentry`,Fa,t=>t),yAe=(t={})=>({name:"NodeFetch",setupOnce(){bAe(t,q()?.getOptions())&&SAe(t),AAe(t)}}),XV=yAe;function KV(t,e="/"){let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e}`:`${n}${e}`}function bAe(t,e={}){return typeof t.spans=="boolean"?t.spans:!e.skipOpenTelemetrySetup&&ot(e)}function RAe(t={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=KV(n.origin,n.path),o=t.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=KV(n.origin,n.path);if(r.startsWith("data:")){let o=Pc(r);return{[Q]:"auto.http.otel.node_fetch","http.url":o,[ni]:o,[Tr]:`${n.method||"GET"} ${o}`}}return{[Q]:"auto.http.otel.node_fetch"}},requestHook:t.requestHook,responseHook:t.responseHook,headersToSpanAttributes:t.headersToSpanAttributes}}c();var c8=J(u8(),1);c();var bt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var l8="Express";function GAe(t){Ce(t,"auto.http.otel.express");let e=W(t).data,n=e["express.type"];n&&t.setAttribute(re,`${n}.express`);let r=e["express.name"];typeof r=="string"&&t.updateName(r)}function jAe(t,e){if(pe()===gr())return bt&&b.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let n=t.request,r=n.method?n.method.toUpperCase():"GET";pe().setTransactionName(`${r} ${t.route}`)}return e}var d8=F(l8,()=>new c8.ExpressInstrumentation({requestHook:t=>GAe(t),spanNameHook:(t,e)=>jAe(t,e)})),HAe=()=>({name:l8,setupOnce(){d8()}}),p8=HAe;c();var Bq=J(vq(),1);import*as xC from"node:diagnostics_channel";c();M();var iE=J(ye(),1),Wa=J(se(),1);fe();c();var Ss;(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})(Ss||(Ss={}));var Ef;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(Ef||(Ef={}));var Sf;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(Sf||(Sf={}));c();M();c();var Af=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function NC(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[Af]||[];return s.push(o),Object.defineProperty(t,Af,{enumerable:!1,configurable:!0,value:s}),o}function oE(t,e){let n=t[Af]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:ze.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[Af])}function wq(t,e,n){let r,o;try{o=t(),kq(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!kq(o)&&(e(r,o),r))throw r;return o}}function kq(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var FRe="0.1.0",GRe="@sentry/instrumentation-fastify-v3",Lq="anonymous",jRe=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),sE=class extends Wa.InstrumentationBase{constructor(e={}){super(GRe,FRe,e)}init(){return[new Wa.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,iE.getRPCMetadata)(k.active()),u=i.routeOptions?i.routeOptions.url:r.routerPath;u&&a?.type===iE.RPCType.HTTP&&(a.route=u);let d=r.method||"GET";pe().setTransactionName(`${d} ${u}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||Lq,u=`${Sf.MIDDLEWARE} - ${a}`,d=i[1],p=NC(d,s.tracer,u,{[Ss.FASTIFY_TYPE]:Ef.MIDDLEWARE,[Ss.PLUGIN_NAME]:e,[Ss.HOOK_NAME]:n}),f=o&&i[i.length-1];return f&&(i[i.length-1]=function(...m){oE(d),f.apply(this,m)}),k.with(Z.setSpan(k.active(),p),()=>wq(()=>r.apply(this,i),m=>{m instanceof Error&&(p.setStatus({code:ze.ERROR,message:m.message}),p.recordException(m)),o||oE(d)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!jRe.has(s))return n.apply(this,o);let u=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,u)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),HRe(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,Wa.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),oE(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,u=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,d=`${Sf.REQUEST_HANDLER} - ${u||this.pluginName||Lq}`,p={[Ss.PLUGIN_NAME]:this.pluginName,[Ss.FASTIFY_TYPE]:Ef.REQUEST_HANDLER,[dy]:i.routeOptions?i.routeOptions.url:r.routerPath};u&&(p[Ss.FASTIFY_NAME]=u);let f=NC(o,e.tracer,d,p);Dq(f);let{requestHook:m}=e.getConfig();return m&&(0,Wa.safeExecuteInTheMiddle)(()=>m(f,{request:r}),_=>{_&&e._diag.error("request hook failed",_)},!0),k.with(Z.setSpan(k.active(),f),()=>{s()})}}};function HRe(){let t=q();t&&t.on("spanStart",e=>{Dq(e)})}function Dq(t){let e=W(t).data,n=e["fastify.type"];if(e[re]||!n)return;t.setAttributes({[Q]:"auto.http.otel.fastify",[re]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var aE="Fastify",Fq=F(`${aE}.v3`,()=>new sE);function VRe(){let t=q();if(t)return t.getIntegrationByName(aE)}function Uq(t,e,n,r){let o=VRe()?.getShouldHandleError()||Hq;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){bt&&b.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&oe(t,{mechanism:{handled:!1,type:"auto.function.fastify"}})}var Gq=F(`${aE}.v5`,()=>{let t=new Bq.FastifyOtelInstrumentation,e=t.plugin();return xC.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?bt&&b.error("Failed to setup Fastify instrumentation",o):($Re(),r&&zRe(r))})}),xC.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;Uq.call(Uq,r,o,s,"diagnostics-channel")}),t}),qRe=({shouldHandleError:t})=>{let e;return{name:aE,setupOnce(){e=t||Hq,Fq(),Gq()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}},jq=(t={})=>qRe(t);function Hq(t,e,n){let r=n.statusCode;return r>=500||r<=299}function Vq(t){let e=W(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[re]||!i&&!a&&!s)return;let u=s?"hook":i?"middleware":a?"request_handler":"<unknown>";t.setAttributes({[Q]:"auto.http.otel.fastify",[re]:`${u}.fastify`});let d=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof d=="string"){let p=d.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(p)}}function $Re(){let t=q();t&&t.on("spanStart",e=>{Vq(e)})}function zRe(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&Vq(s)}let r=e.routeOptions?.url,o=e.method||"GET";pe().setTransactionName(`${o} ${r}`)})}c();M();var l5=J(c5(),1);var d5="Graphql",p5=F(d5,l5.GraphQLInstrumentation,t=>{let e=m5(t);return{...e,responseHook(n,r){Ce(n,"auto.graphql.otel.graphql"),r.errors?.length&&!W(n).status&&n.setStatus({code:ze.ERROR});let s=W(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let u=Ye(n),p=W(u).data[tl]||[],f=a?`${i} ${a}`:`${i}`;Array.isArray(p)?(p.push(f),u.setAttribute(tl,p)):typeof p=="string"?u.setAttribute(tl,[p,f]):u.setAttribute(tl,f),W(u).data["original-description"]||u.setAttribute("original-description",W(u).description),u.updateName(`${W(u).data["original-description"]} (${fIe(p)})`)}}}}),pIe=(t={})=>({name:d5,setupOnce(){p5(m5(t))}}),f5=pIe;function m5(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function fIe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}c();var O5=J(I5(),1);var C5="Kafka",N5=F(C5,()=>new O5.KafkaJsInstrumentation({consumerHook(t){Ce(t,"auto.kafkajs.otel.consumer")},producerHook(t){Ce(t,"auto.kafkajs.otel.producer")}})),_Ie=()=>({name:C5,setupOnce(){N5()}}),x5=_Ie;c();var D5=J(L5(),1);var U5="LruMemoizer",B5=F(U5,()=>new D5.LruMemoizerInstrumentation),gIe=()=>({name:U5,setupOnce(){B5()}}),F5=gIe;c();var W5=J(Y5(),1);var K5="Mongo",Q5=F(K5,()=>new W5.MongoDBInstrumentation({dbStatementSerializer:yIe,responseHook(t){Ce(t,"auto.db.otel.mongo")}}));function yIe(t){let e=BC(t);return JSON.stringify(e)}function BC(t){if(Array.isArray(t))return t.map(e=>BC(e));if(bIe(t)){let e={};return Object.entries(t).map(([n,r])=>[n,BC(r)]).reduce((n,r)=>(IIe(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function bIe(t){return typeof t=="object"&&t!==null&&!RIe(t)}function RIe(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function IIe(t){return Array.isArray(t)}var OIe=()=>({name:K5,setupOnce(){Q5()}}),J5=OIe;c();var u$=J(a$(),1);var c$="Mongoose",l$=F(c$,()=>new u$.MongooseInstrumentation({responseHook(t){Ce(t,"auto.db.otel.mongoose")}})),LIe=()=>({name:c$,setupOnce(){l$()}}),d$=LIe;c();var E$=J(T$(),1);var S$="Mysql",A$=F(S$,()=>new E$.MySQLInstrumentation({})),$Ie=()=>({name:S$,setupOnce(){A$()}}),y$=$Ie;c();var P$=J(x$(),1);var M$="Mysql2",v$=F(M$,()=>new P$.MySQL2Instrumentation({responseHook(t){Ce(t,"auto.db.otel.mysql2")}})),iOe=()=>({name:M$,setupOnce(){v$()}}),k$=iOe;c();var s9=J(j$(),1),i9=J(e9(),1);c();var IOe=["get","set","setex"],sN=["get","mget"],OOe=["set","setex"];function Lf(t,e){return t.includes(e.toLowerCase())}function iN(t){return Lf(sN,t)?"cache.get":Lf(OOe,t)?"cache.put":void 0}function COe(t,e){return e.some(n=>t.startsWith(n))}function n9(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?t9(o.map(s=>n(s))):["<unknown>"],r=e[0];return Lf(IOe,t)&&r!=null?n(r):t9(e.map(o=>n(o)))}catch{return}}function r9(t,e,n){if(!iN(t))return!1;for(let r of e)if(COe(r,n))return!0;return!1}function o9(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function t9(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var qE="Redis",Df={},a9=(t,e,n,r)=>{t.setAttribute(Q,"auto.db.otel.redis");let o=n9(e,n),s=iN(e);if(!o||!s||!Df.cachePrefixes||!r9(e,o,Df.cachePrefixes))return;let i=W(t).data["net.peer.name"],a=W(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let u=o9(r);u&&t.setAttribute(nR,u),Lf(sN,e)&&u!==void 0&&t.setAttribute(eR,u>0),t.setAttributes({[re]:s,[tR]:o});let d=o.join(", ");t.updateName(Df.maxCacheKeyLength?Js(d,Df.maxCacheKeyLength):d)},NOe=F(`${qE}.IORedis`,()=>new s9.IORedisInstrumentation({responseHook:a9})),xOe=F(`${qE}.Redis`,()=>new i9.RedisInstrumentation({responseHook:a9})),u9=Object.assign(()=>{NOe(),xOe()},{id:qE}),POe=(t={})=>({name:qE,setupOnce(){Df=t,u9()}}),c9=POe;c();var O9=J(I9(),1);var C9="Postgres",N9=F(C9,O9.PgInstrumentation,t=>({requireParentSpan:!0,requestHook(e){Ce(e,"auto.db.otel.postgres")},ignoreConnectSpans:t?.ignoreConnectSpans??!1})),$Oe=t=>({name:C9,setupOnce(){N9(t)}}),x9=$Oe;c();M();var Li=J(se(),1);fe();var fN="PostgresJs",P9=[">=3.0.0 <4"],zOe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,YOe=Symbol.for("sentry.query.from.instrumented.sql"),M9=F(fN,t=>new pN({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),pN=class extends Li.InstrumentationBase{constructor(e){super("sentry-postgres-js",me,e)}init(){let e=new Li.InstrumentationNodeModuleDefinition("postgres",P9,n=>{try{return this._patchPostgres(n)}catch(r){return bt&&b.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new Li.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,P9,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return bt&&b.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);if(!a||typeof a!="function")return bt&&b.warn("postgres() did not return a valid instance"),a;let u=o.getConfig();return GR(a,{requireParentSpan:u.requireParentSpan,requestHook:u.requestHook})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(kp(e,"default",s),e)}_shouldCreateSpans(){let e=this.getConfig();return Z.getSpan(k.active())!==void 0||!e.requireParentSpan}_setOperationName(e,n,r){if(r){e.setAttribute(Wu,r);return}let o=n?.match(zOe);o?.[1]&&e.setAttribute(Wu,o[1].toUpperCase())}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[YOe])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return Mt({name:i||"postgresjs.query",op:"db"},a=>{Ce(a,"auto.db.postgresjs"),a.setAttributes({[da]:"postgres",[Ty]:i});let u=n.getConfig(),{requestHook:d}=u;d&&(0,Li.safeExecuteInTheMiddle)(()=>d(a,i,void 0),m=>{m&&(a.setAttribute("sentry.hook.error","requestHook failed"),bt&&b.error(`Error in requestHook for ${fN} integration:`,m))},!0);let p=this.resolve;this.resolve=new Proxy(p,{apply:(m,_,h)=>{try{n._setOperationName(a,i,h?.[0]?.command),a.end()}catch(g){bt&&b.error("Error ending span in resolve callback:",g)}return Reflect.apply(m,_,h)}});let f=this.reject;this.reject=new Proxy(f,{apply:(m,_,h)=>{try{a.setStatus({code:2,message:h?.[0]?.message||"unknown_error"}),a.setAttribute(Ey,h?.[0]?.code||"unknown"),a.setAttribute(Sy,h?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(g){bt&&b.error("Error ending span in reject callback:",g)}return Reflect.apply(m,_,h)}});try{return r.apply(this,o)}catch(m){throw a.setStatus({code:2,message:m instanceof Error?m.message:"unknown_error"}),a.end(),m}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},WOe=t=>({name:fN,setupOnce(){M9(t)}}),v9=WOe;c();M();c();M();var TS=J(_z(),1);M();var _Ne={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"}},hNe=_Ne.version.split(".")[0],UN="PRISMA_INSTRUMENTATION",BN=`V${hNe}_PRISMA_INSTRUMENTATION`,Gl=globalThis;function gNe(){let t=Gl[BN];return t?.helper?t.helper:Gl[UN]?.helper}function TNe(t){let e={helper:t};Gl[BN]=e,Gl[UN]=e}function ENe(){delete Gl[BN],delete Gl[UN]}var SNe=process.env.PRISMA_SHOW_ALL_TRACES==="true",ANe="00-10-10-00";function yNe(t){switch(t){case"client":return Me.CLIENT;case"internal":default:return Me.INTERNAL}}var bNe=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=Z.getSpanContext(t??k.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:ANe}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)Tz(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return k.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!SNe)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(Ez(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return hz(s,e(s,r))}return n.startActiveSpan(o,t,s=>hz(s,e(s,r)))}};function Tz(t,e,n,r,o){if(Ez(e.name,o))return;let s={attributes:e.attributes,kind:yNe(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(u=>{let d=r.get(u);return d?{context:{spanId:d,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(u=>u.parentId===e.id);for(let u of a)Tz(t,u,n,r,o);i.end(e.endTime)})}function hz(t,e){return RNe(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function RNe(t){return t!=null&&typeof t.then=="function"}function Ez(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var Sz={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},gz=Sz.version,INe=Sz.name,ONe="@prisma/client",Az=class extends TS.InstrumentationBase{tracerProvider;constructor(t={}){super(INe,gz,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new TS.InstrumentationNodeModuleDefinition(ONe,[gz])]}enable(){let t=this._config;TNe(new bNe({tracerProvider:this.tracerProvider??Z.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){ENe()}isEnabled(){return gNe()!==void 0}};var yz="Prisma";function CNe(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function bz(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}var FN=class extends Az{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=bz();CNe(e)&&(e.createEngineSpan=n=>{let r=Z.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){rt(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=NNe(s.kind),a=s.parent_span_id,u=s.span_id,d=s.trace_id,p=s.links?.map(m=>({context:{traceId:m.trace_id,spanId:m.span_id,traceFlags:tn.SAMPLED}})),f=Z.setSpanContext(k.active(),{traceId:d,spanId:a,traceFlags:tn.SAMPLED});k.with(f,()=>{let m={generateTraceId:()=>d,generateSpanId:()=>u};r._idGenerator=m,r.startSpan(s.name,{kind:i,links:p,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};function NNe(t){switch(t){case"client":return Me.CLIENT;case"internal":default:return Me.INTERNAL}}var xNe=F(yz,t=>new FN(t)),Rz=t=>({name:yz,setupOnce(){xNe(t)},setup(e){bz()&&e.on("spanStart",n=>{let r=W(n);r.description?.startsWith("prisma:")&&n.setAttribute(Q,"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")})}});c();var wz=J(kz(),1);var Lz="Hapi",Dz=F(Lz,()=>new wz.HapiInstrumentation),HNe=()=>({name:Lz,setupOnce(){Dz()}}),Uz=HNe;c();fe();c();var Fi={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Qf={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"};c();M();var yS=J(se(),1);var VNe="@sentry/instrumentation-hono",qNe="0.0.1",AS=class extends yS.InstrumentationBase{constructor(e={}){super(VNe,qNe,e)}init(){return[new yS.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return k.with(Z.setSpan(k.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(qt(a))return a.then(u=>{let d=n._determineHandlerType(u);return i.setAttributes({[Fi.HONO_TYPE]:d,[Fi.HONO_NAME]:d===Qf.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),u});{let u=n._determineHandlerType(a);return i.setAttributes({[Fi.HONO_TYPE]:u,[Fi.HONO_NAME]:u===Qf.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return qt(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Qf.MIDDLEWARE:Qf.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:ze.ERROR,message:n.message}),e.recordException(n))}};var Bz="Hono";function $Ne(t){let e=W(t).data,n=e[Fi.HONO_TYPE];if(e[re]||!n)return;t.setAttributes({[Q]:"auto.http.otel.hono",[re]:`${n}.hono`});let r=e[Fi.HONO_NAME];if(typeof r=="string"&&t.updateName(r),pe()===gr()){bt&&b.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[rs],s=e[pa];typeof o=="string"&&typeof s=="string"&&pe().setTransactionName(`${s} ${o}`)}var Fz=F(Bz,()=>new AS({responseHook:t=>{$Ne(t)}})),zNe=()=>({name:Bz,setupOnce(){Fz()}}),Gz=zNe;c();var Xz=J(Jz(),1);fe();var Zz="Koa",eY=F(Zz,Xz.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Ce(e,"auto.http.otel.koa");let r=W(e).data,o=r["koa.type"];o&&e.setAttribute(re,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),pe()===gr()){bt&&b.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[rs],a=n.context?.request?.method?.toUpperCase()||"GET";i&&pe().setTransactionName(`${a} ${i}`)}})),txe=(t={})=>({name:Zz,setupOnce(){eY(t)}}),tY=txe;c();var lY=J(cY(),1);var dY="Connect",pY=F(dY,()=>new lY.ConnectInstrumentation),dxe=()=>({name:dY,setupOnce(){pY()}}),fY=dxe;c();var bY=J(yY(),1);var hxe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),RY="Tedious",IY=F(RY,()=>new bY.TediousInstrumentation({})),gxe=()=>{let t;return{name:RY,setupOnce(){let e=IY();t=Lp(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=W(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";hxe.has(s)&&n.setAttribute(Q,"auto.db.otel.tedious")}))}}},OY=gxe;c();var MY=J(PY(),1);var vY="GenericPool",kY=F(vY,()=>new MY.GenericPoolInstrumentation({})),Exe=()=>{let t;return{name:vY,setupOnce(){let e=kY();t=Lp(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=W(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Q,"auto.db.otel.generic_pool")}))}}},wY=Exe;c();var qY=J(VY(),1);var $Y="Amqplib",Pxe={consumeEndHook:t=>{Ce(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Ce(t,"auto.amqplib.otel.publisher")}},zY=F($Y,()=>new qY.AmqplibInstrumentation(Pxe)),Mxe=()=>({name:$Y,setupOnce(){zY()}}),YY=Mxe;c();c();var tm="VercelAI";c();var FS=J(se(),1);var vxe=[">=3.0.0 <7"],WY=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];function kxe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function wxe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;Array.isArray(e.content)&&(Lxe(e.content),Dxe(e.content))}function Lxe(t){for(let e of t){if(!kxe(e))continue;let n=iI(e.toolCallId);n?Jn(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),oe(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):Jn(r=>{r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),oe(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function Dxe(t){for(let e of t)typeof e=="object"&&e!==null&&"toolCallId"in e&&typeof e.toolCallId=="string"&&aI(e.toolCallId)}function Uxe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var BS=class t extends FS.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",me,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new FS.InstrumentationNodeModuleDefinition("ai",vxe,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},u=a.isEnabled,d=q(),p=d?.getIntegrationByName(tm),f=p?.options,m=p?!!d?.getOptions().sendDefaultPii:!1,{recordInputs:_,recordOutputs:h}=Uxe(f,a,u,m);return i[0].experimental_telemetry={...a,isEnabled:u!==void 0?u:!0,recordInputs:_,recordOutputs:h},Kr(()=>Reflect.apply(o,s,i),g=>{g&&typeof g=="object"&&dt(g,"_sentry_active_span",Er())},()=>{},g=>{wxe(g)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of WY)e[r]!=null&&(e[r]=n(e[r]));return e}else{let r=WY.reduce((o,s)=>(e[s]!=null&&(o[s]=n(e[s])),o),{});return{...e,...r}}}};var KY=F(tm,()=>new BS({}));function Bxe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var Fxe=(t={})=>{let e;return{name:tm,options:t,setupOnce(){e=KY()},afterAllSetup(n){t.force??Bxe(n)?Jh(n):e?.callWhenPatched(()=>Jh(n))}}},QY=Fxe;c();c();var jS=J(se(),1);var Gxe=[">=4.0.0 <7"],GS=class extends jS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",me,e)}init(){return new jS.InstrumentationNodeModuleDefinition("openai",Gxe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(xa(gi))return Reflect.construct(r,i);let a=Reflect.construct(r,i);return Zh(a,o)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}};var JY=F(gi,t=>new GS(t)),jxe=(t={})=>({name:gi,setupOnce(){JY(t)}}),XY=jxe;c();c();var VS=J(se(),1);var Hxe=[">=0.19.2 <1.0.0"],HS=class extends VS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",me,e)}init(){return new VS.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",Hxe,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(xa(Ti))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return eg(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}};var ZY=F(Ti,t=>new HS(t)),Vxe=(t={})=>({name:Ti,options:t,setupOnce(){ZY(t)}}),e7=Vxe;c();c();var Zl=J(se(),1);var t7=[">=0.10.0 <2"],qS=class extends Zl.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",me,e)}init(){return new Zl.InstrumentationNodeModuleDefinition("@google/genai",t7,n=>this._patch(n),n=>n,[new Zl.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",t7,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(xa(Ei))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return tg(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return kp(e,"GoogleGenAI",o),e}};var n7=F(Ei,t=>new qS(t)),qxe=(t={})=>({name:Ei,setupOnce(){n7(t)}}),r7=qxe;c();c();var Wi=J(se(),1);var $S=[">=0.1.0 <2.0.0"];function $xe(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function zxe(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let u=a.callbacks,d=$xe(u,e);return a.callbacks=d,Reflect.apply(r,o,s)}})}var zS=class extends Wi.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",me,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new Wi.InstrumentationNodeModuleDefinition(r,$S,this._patch.bind(this),o=>o,[new Wi.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,$S,this._patch.bind(this),o=>o)]));return e.push(new Wi.InstrumentationNodeModuleDefinition("langchain",$S,this._patch.bind(this),r=>r,[new Wi.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",$S,this._patch.bind(this),r=>r)])),e}_patch(e){xR([gi,Ti,Ei]);let n=rg(this.getConfig());return this._patchRunnableMethods(e,n),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(u=>typeof u=="function"&&r.includes(u.name));if(!s)return;let i=s.prototype;if(i.__sentry_patched__)return;i.__sentry_patched__=!0;let a=["invoke","stream","batch"];for(let u of a){let d=i[u];typeof d=="function"&&(i[u]=zxe(d,n))}}};var o7=F(ng,t=>new zS(t)),Yxe=(t={})=>({name:ng,setupOnce(){o7(t)}}),s7=Yxe;c();c();var ed=J(se(),1);var i7=[">=0.0.0 <2.0.0"],YS=class extends ed.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",me,e)}init(){return new ed.InstrumentationNodeModuleDefinition("@langchain/langgraph",i7,this._patch.bind(this),n=>n,[new ed.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",i7,this._patch.bind(this),n=>n)])}_patch(e){return e.StateGraph&&typeof e.StateGraph=="function"&&sg(e.StateGraph.prototype,this.getConfig()),e}};var a7=F(og,t=>new YS(t)),Wxe=(t={})=>({name:og,setupOnce(){a7(t)}}),u7=Wxe;c();c();var h7=J(se(),1);c();M();var Os=J(se(),1);fe();import*as l7 from"node:net";function d7(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=p=>{(0,Os.safeExecuteInTheMiddle)(()=>a(p),f=>{f&&Kn.error(f?.message)},!0)});let u=new Os.InstrumentationNodeModuleDefinition("@firebase/firestore",e,p=>c7(p,n,r,t,i)),d=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let p of d)u.files.push(new Os.InstrumentationNodeModuleFile(p,e,f=>c7(f,n,r,t,i),f=>p7(f,r)));return u}function c7(t,e,n,r,o){return p7(t,n),e(t,"addDoc",Kxe(r,o)),e(t,"getDocs",Jxe(r,o)),e(t,"setDoc",Xxe(r,o)),e(t,"deleteDoc",Qxe(r,o)),t}function p7(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Os.isWrapped)(t[n])&&e(t,n);return t}function Kxe(t,e){return function(r){return function(o,s){let i=KS(t,"addDoc",o);return e(i),WS(i,()=>r(o,s))}}}function Qxe(t,e){return function(r){return function(o){let s=KS(t,"deleteDoc",o.parent||o);return e(s),WS(s,()=>r(o))}}}function Jxe(t,e){return function(r){return function(o){let s=KS(t,"getDocs",o);return e(s),WS(s,()=>r(o))}}}function Xxe(t,e){return function(r){return function(o,s,i){let a=KS(t,"setDoc",o.parent||o);return e(a),WS(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function WS(t,e){return k.with(Z.setSpan(k.active(),t),()=>(0,Os.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function KS(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Me.CLIENT});return ePe(r,n),r.setAttribute(Wu,e),r}function Zxe(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(l7.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function ePe(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[hy]:e.path,[gy]:n.name,[da]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:u}=Zxe(s);a&&(i[Iy]=a),u&&(i[Oy]=u),t.setAttributes(i)}c();M();var Cs=J(se(),1);function f7(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,u=o.functions?.requestHook,d=o.functions?.responseHook;typeof d=="function"&&(i=(m,_)=>{(0,Cs.safeExecuteInTheMiddle)(()=>d(m,_),h=>{h&&Kn.error(h?.message)},!0)}),typeof u=="function"&&(s=m=>{(0,Cs.safeExecuteInTheMiddle)(()=>u(m),_=>{_&&Kn.error(_?.message)},!0)});let p=new Cs.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:m,triggerType:_})=>{p.files.push(new Cs.InstrumentationNodeModuleFile(m,e,h=>tPe(h,n,r,t,{requestHook:s,responseHook:i,errorHook:a},_),h=>m7(h,r)))}),p}function Pn(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let u=async function(...d){let p=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",f=t.startSpan(`firebase.function.${n}`,{kind:Me.SERVER}),m={"faas.name":p,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(m["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(m["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),f.setAttributes(m),e?.requestHook?.(f),k.with(Z.setSpan(k.active(),f),async()=>{let _,h;try{h=await i.apply(this,d)}catch(g){_=g}if(e?.responseHook?.(f,_),_&&f.recordException(_),f.end(),_)throw await e?.errorHook?.(f,_),_;return h})};return a?o.call(this,a,u):o.call(this,u)}}}function tPe(t,e,n,r,o,s){switch(m7(t,n),s){case"function":e(t,"onRequest",Pn(r,o,"http.request")),e(t,"onCall",Pn(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",Pn(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",Pn(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",Pn(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",Pn(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",Pn(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",Pn(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",Pn(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",Pn(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",Pn(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",Pn(r,o,"storage.object.finalized")),e(t,"onObjectArchived",Pn(r,o,"storage.object.archived")),e(t,"onObjectDeleted",Pn(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",Pn(r,o,"storage.object.metadataUpdated"));break}return t}function m7(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Cs.isWrapped)(t[r])&&e(t,r);return t}var _7={},nPe=[">=3.0.0 <5"],rPe=[">=6.0.0 <7"],QS=class extends h7.InstrumentationBase{constructor(e=_7){super("@sentry/instrumentation-firebase",me,e)}setConfig(e={}){super.setConfig({..._7,...e})}init(){let e=[];return e.push(d7(this.tracer,nPe,this._wrap,this._unwrap,this.getConfig())),e.push(f7(this.tracer,rPe,this._wrap,this._unwrap,this.getConfig())),e}};var g7="Firebase",oPe={firestoreSpanCreationHook:t=>{Ce(t,"auto.firebase.otel.firestore"),t.setAttribute(re,"db.query")},functions:{requestHook:t=>{Ce(t,"auto.firebase.otel.functions"),t.setAttribute(re,"http.request")},errorHook:async(t,e)=>{e&&(oe(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Ch(2e3))}}},T7=F(g7,()=>new QS(oPe)),sPe=()=>({name:g7,setupOnce(){T7()}}),E7=sPe;c();c();function S7(){return[p8(),jq(),f5(),Gz(),J5(),d$(),y$(),k$(),c9(),x9(),Rz(),Uz(),tY(),fY(),OY(),wY(),x5(),YY(),F5(),s7(),u7(),QY(),XY(),e7(),r7(),v9(),E7()]}c();M();var JS=J(jI(),1),A7=J(fO(),1);fe();var ox=1e6;function y7(t,e={}){t.getOptions().debug&&xO();let[n,r]=iPe(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function iPe(t,e={}){let n=new A7.BasicTracerProvider({sampler:new cT(t),resource:(0,JS.defaultResource)().merge((0,JS.resourceFromAttributes)({[Cy]:"node",[_y]:"sentry",[Ny]:me})),forceFlushTimeoutMillis:500,spanProcessors:[new uT({timeout:aPe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});Z.setGlobalTracerProvider(n),Gr.setGlobalPropagator(new aT);let r=new NO;return k.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function aPe(t){if(t!=null){if(t>ox)return bt&&b.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ox}`),ox;if(t<=0||Number.isNaN(t)){bt&&b.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}function b7(){return gT().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(qV(),XV())}function R7(t){return[...b7(),...ot(t)?S7():[]]}function sx(t={}){return uPe(t,R7)}function uPe(t={},e){Pa(t,"node");let n=BO({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(y7(n,{spanProcessors:t.openTelemetrySpanProcessors}),FO()),n}c();var cPe="prod",I7="0.1.45",lPe=`@tanagram/lore/${I7}`;function $e(){return cPe}function ro(){return I7}function O7(){return lPe}sx({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:$e(),release:ro(),sendDefaultPii:!0});Oh("service_name","lore-cli");import{realpathSync as _3e}from"node:fs";import{fileURLToPath as h3e,pathToFileURL as pX}from"node:url";c();c();var dPe=/\d/,pPe=["-","_","/","."];function fPe(t=""){if(!dPe.test(t))return t!==t.toLowerCase()}function C7(t,e){let n=e??pPe,r=[];if(!t||typeof t!="string")return r;let o="",s,i;for(let a of t){let u=n.includes(a);if(u===!0){r.push(o),o="",s=void 0;continue}let d=fPe(a);if(i===!1){if(s===!1&&d===!0){r.push(o),o=a,s=d;continue}if(s===!0&&d===!1&&o.length>1){let p=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=p+a,s=d;continue}}o+=a,s=d,i=u}return r.push(o),r}function mPe(t){return t?t[0].toUpperCase()+t.slice(1):""}function _Pe(t){return t?t[0].toLowerCase()+t.slice(1):""}function hPe(t,e){return t?(Array.isArray(t)?t:C7(t)).map(n=>mPe(e?.normalize?n.toLowerCase():n)).join(""):""}function nm(t,e){return _Pe(hPe(t||"",e))}function XS(t,e){return t?(Array.isArray(t)?t:C7(t)).map(n=>n.toLowerCase()).join(e??"-"):""}function N7(t){return XS(t||"","_")}import{parseArgs as gPe}from"node:util";function n0(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function ax(t,e=""){let n=[];for(let r of t)for(let[o,s]of r.entries())n[o]=Math.max(n[o]||0,s.length);return t.map(r=>r.map((o,s)=>e+o[s===0?"padStart":"padEnd"](n[s])).join(" ")).join(`
|
|
38
|
+
`);let{connect:d,buffered:p}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",K0e),n.secureEndpoint){Zp("Upgrading socket connection to TLS");let m=n.servername||n.host;return DO.connect({...MV(n,"host","path","port"),socket:o,servername:Ts.isIP(m)?void 0:m})}return o}o.destroy();let f=new Ts.Socket({writable:!1});return f.readable=!0,e.once("socket",m=>{Zp("Replaying proxy buffer for failed request"),m.push(p),m.push(null)}),f}};ef.__initStatic();function K0e(t){t.resume()}function MV(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}var eAe=1024*32;function tAe(t){return new X0e({read(){this.push(t),this.push(null)}})}function vV(t){let e;try{e=new URL(t.url)}catch{return rt(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),Sp(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=nAe(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?J0e:Q0e,s=t.keepAlive===void 0?!1:t.keepAlive,i=r?new ef(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=rAe(t,t.httpModule??o,i);return Sp(t,a)}function nAe(t,e){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>t.host.endsWith(o)||t.hostname.endsWith(o)))return e}function rAe(t,e,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(d){return new Promise((p,f)=>{Ic(()=>{let m=tAe(d.body),_={...t.headers};d.body.length>eAe&&(_["content-encoding"]="gzip",m=m.pipe(Z0e()));let h=r.startsWith("["),g=e.request({method:"POST",agent:n,headers:_,hostname:h?r.slice(1,-1):r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},T=>{T.on("data",()=>{}),T.on("end",()=>{}),T.setEncoding("utf8");let S=T.headers["retry-after"]??null,A=T.headers["x-sentry-rate-limits"]??null;p({statusCode:T.statusCode,headers:{"retry-after":S,"x-sentry-rate-limits":Array.isArray(A)?A[0]||null:A}})});g.on("error",f),m.pipe(g)})})}}c();function kV(t){if(t===!1)return!1;if(typeof t=="string")return t;let e=xc(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=e===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return t===!0?n??!0:e??n}c();c();import{posix as oAe,sep as sAe}from"node:path";function wV(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function LV(t=process.argv[1]?UR(process.argv[1]):process.cwd(),e=sAe==="\\"){let n=e?wV(t):t;return r=>{if(!r)return;let o=e?wV(r):r,{dir:s,base:i,ext:a}=oAe.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let u=decodeURIComponent(i);s||(s=".");let d=s.lastIndexOf("/node_modules");if(d>-1)return`${s.slice(d+14).replace(/\//g,".")}:${u}`;if(s.startsWith(n)){let p=s.slice(n.length+1).replace(/\//g,".");return p?`${p}:${u}`:u}return u}}function DV(t){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(ee.SENTRY_RELEASE?.id)return ee.SENTRY_RELEASE.id;let e=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return e||n||r||t}var UV=nh(_I(LV()));c();M();var FV=J(se(),1);import*as BV from"node:os";import{threadId as iAe,isMainThread as aAe}from"worker_threads";var uAe=6e4,hT=class extends Ap{constructor(e){let n=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||BV.hostname(),r={...e,platform:"node",runtime:e.runtime||{name:"node",version:global.process.version},serverName:n};e.openTelemetryInstrumentations&&(0,FV.registerInstrumentations)({instrumentations:e.openTelemetryInstrumentations}),Pa(r,"node"),b.log(`Initializing Sentry: process: ${process.pid}, thread: ${aAe?"main":`worker-${iAe}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Cc(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let e="@sentry/node",n=me,r=Z.getTracer(e,n);return this._tracer=r,r}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}async close(e){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener);let n=await super.close(e);return this.traceProvider&&await this.traceProvider.shutdown(),n}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{ie&&b.log("Flushing client reports based on interval."),this._flushOutcomes()},e.clientReportFlushInterval??uAe).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_setupIntegrations(){PR(),super._setupIntegrations()}_getTraceInfoFromScope(e){return e?HH(this,e):[void 0,void 0]}};c();var GV=J(_b(),1);import*as jV from"module";function UO(){if(TV()&&!ee._sentryEsmLoaderHookRegistered){ee._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:t}=(0,GV.createAddHookMessageChannel)();jV.register("import-in-the-middle/hook.mjs",import.meta.url,{data:{addHookMessagePort:t,include:[]},transferList:[t]})}catch(t){b.warn("Failed to register 'import-in-the-middle' hook",t)}}}function gT(){return[Bh(),Dh(),Fh(),Gh(),xV(),jR(),Hh(),d6(),h6(),bV(),RV(),uV(),hV(),nV(),ZH(),IV(),yV()]}function BO(t={}){return cAe(t,gT)}function cAe(t={},e){let n=lAe(t,e);n.debug===!0&&(ie?b.enable():rt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&UO(),$H(),Te().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===wO)&&n.integrations.push(CV({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),Pa(n,"node-core");let o=new hT(n);return Te().setClient(o),o.init(),b.log(`SDK initialized from ${Jp()?"CommonJS":"ESM"}`),o.startClientReportTracking(),fAe(),NH(o),qH(o),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function FO(){if(!ie)return;let t=vH(),e=["SentryContextManager","SentryPropagator"];ot()&&e.push("SentrySpanProcessor");for(let n of e)t.includes(n)||b.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);t.includes("SentrySampler")||b.warn("You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.")}function lAe(t,e){let n=dAe(t.release),r=kV(t.spotlight),o=pAe(t.tracesSampleRate),s={...t,dsn:t.dsn??process.env.SENTRY_DSN,environment:t.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:t.sendClientReports??!0,transport:t.transport??vV,stackParser:Pb(t.stackParser||UV),release:n,tracesSampleRate:o,spotlight:r,debug:xc(t.debug??process.env.SENTRY_DEBUG)},i=t.integrations,a=t.defaultIntegrations??e(s);return{...s,integrations:yR({defaultIntegrations:a,integrations:i})}}function dAe(t){if(t!==void 0)return t;let e=DV();if(e!==void 0)return e}function pAe(t){if(t!==void 0)return t;let e=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!e)return;let n=parseFloat(e);return isFinite(n)?n:void 0}function fAe(){if(xc(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let t=process.env.SENTRY_TRACE,e=process.env.SENTRY_BAGGAGE,n=ip(t,e);Te().setPropagationContext(n)}}c();function Ce(t,e){t.setAttribute(Q,e)}c();function tf(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`,o=t.path?t.path:"/";return`${e}//${n}${r}${o}`}var GO="Http",HV="@opentelemetry_sentry-patched/instrumentation-http",TT=Xr.major===22&&Xr.minor>=12||Xr.major===23&&Xr.minor>=2||Xr.major>=24,mAe=F(`${GO}.sentry`,t=>new Ba(t)),_Ae=F(GO,t=>{let e=new VV.HttpInstrumentation({...t,disableIncomingRequestInstrumentation:!0});try{e._diag=Kn.createComponentLogger({namespace:HV}),e.instrumentationName=HV}catch{}try{let n={get:()=>!1,set:()=>{}};Object.defineProperty(e,"_httpPatched",n),Object.defineProperty(e,"_httpsPatched",n)}catch{}return e});function hAe(t,e={}){return typeof t.spans=="boolean"?t.spans:!(e.skipOpenTelemetrySetup||!ot(e)&&TT)}var qV=(t={})=>{let e=t.spans??!0,n=t.disableIncomingRequestSpans,r={sessions:t.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:t.sessionFlushingDelayMS,ignoreRequestBody:t.ignoreIncomingRequestBody,maxRequestBodySize:t.maxIncomingRequestBodySize},o={ignoreIncomingRequests:t.ignoreIncomingRequests,ignoreStaticAssets:t.ignoreStaticAssets,ignoreStatusCodes:t.dropSpansForIncomingRequestStatusCodes,instrumentation:t.instrumentation,onSpanCreated:t.incomingRequestSpanHook},s=Dp(r),i=Up(o),a=e&&!n;return{name:GO,setup(u){let d=u.getOptions();a&&ot(d)&&i.setup(u)},setupOnce(){let u=q()?.getOptions()||{},d=hAe(t,u);s.setupOnce();let p={breadcrumbs:t.breadcrumbs,propagateTraceInOutgoingRequests:typeof t.tracePropagation=="boolean"?t.tracePropagation:TT||!d,createSpansForOutgoingRequests:TT,spans:t.spans,ignoreOutgoingRequests:t.ignoreOutgoingRequests,outgoingRequestHook:(f,m)=>{let _=tf(m);if(_.startsWith("data:")){let h=Pc(_);f.setAttribute("http.url",h),f.setAttribute(ni,h),f.updateName(`${m.method||"GET"} ${h}`)}t.instrumentation?.requestHook?.(f,m)},outgoingResponseHook:t.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:t.instrumentation?.applyCustomAttributesOnSpan};if(mAe(p),d){let f=gAe(t);_Ae(f)}},processEvent(u){return i.processEvent(u)}}};function gAe(t={}){return{disableOutgoingRequestInstrumentation:TT,ignoreOutgoingRequestHook:n=>{let r=tf(n);if(!r)return!1;let o=t.ignoreOutgoingRequests;return!!o?.(r,n)},requireParentforOutgoingSpans:!1,requestHook:(n,r)=>{Ce(n,"auto.http.otel.http");let o=tf(r);if(o.startsWith("data:")){let s=Pc(o);n.setAttribute("http.url",s),n.setAttribute(ni,s),n.updateName(`${r.method||"GET"} ${s}`)}t.instrumentation?.requestHook?.(n,r)},responseHook:(n,r)=>{t.instrumentation?.responseHook?.(n,r)},applyCustomAttributesOnSpan:(n,r,o)=>{t.instrumentation?.applyCustomAttributesOnSpan?.(n,r,o)}}}c();var QV=J(WV(),1);var JV="NodeFetch",SAe=F(JV,QV.UndiciInstrumentation,t=>RAe(t)),AAe=F(`${JV}.sentry`,Fa,t=>t),yAe=(t={})=>({name:"NodeFetch",setupOnce(){bAe(t,q()?.getOptions())&&SAe(t),AAe(t)}}),XV=yAe;function KV(t,e="/"){let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e}`:`${n}${e}`}function bAe(t,e={}){return typeof t.spans=="boolean"?t.spans:!e.skipOpenTelemetrySetup&&ot(e)}function RAe(t={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=KV(n.origin,n.path),o=t.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=KV(n.origin,n.path);if(r.startsWith("data:")){let o=Pc(r);return{[Q]:"auto.http.otel.node_fetch","http.url":o,[ni]:o,[Tr]:`${n.method||"GET"} ${o}`}}return{[Q]:"auto.http.otel.node_fetch"}},requestHook:t.requestHook,responseHook:t.responseHook,headersToSpanAttributes:t.headersToSpanAttributes}}c();var c8=J(u8(),1);c();var bt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var l8="Express";function GAe(t){Ce(t,"auto.http.otel.express");let e=W(t).data,n=e["express.type"];n&&t.setAttribute(re,`${n}.express`);let r=e["express.name"];typeof r=="string"&&t.updateName(r)}function jAe(t,e){if(pe()===gr())return bt&&b.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let n=t.request,r=n.method?n.method.toUpperCase():"GET";pe().setTransactionName(`${r} ${t.route}`)}return e}var d8=F(l8,()=>new c8.ExpressInstrumentation({requestHook:t=>GAe(t),spanNameHook:(t,e)=>jAe(t,e)})),HAe=()=>({name:l8,setupOnce(){d8()}}),p8=HAe;c();var Bq=J(vq(),1);import*as xC from"node:diagnostics_channel";c();M();var iE=J(ye(),1),Wa=J(se(),1);fe();c();var Ss;(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})(Ss||(Ss={}));var Ef;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(Ef||(Ef={}));var Sf;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(Sf||(Sf={}));c();M();c();var Af=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function NC(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[Af]||[];return s.push(o),Object.defineProperty(t,Af,{enumerable:!1,configurable:!0,value:s}),o}function oE(t,e){let n=t[Af]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:ze.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[Af])}function wq(t,e,n){let r,o;try{o=t(),kq(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!kq(o)&&(e(r,o),r))throw r;return o}}function kq(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var FRe="0.1.0",GRe="@sentry/instrumentation-fastify-v3",Lq="anonymous",jRe=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),sE=class extends Wa.InstrumentationBase{constructor(e={}){super(GRe,FRe,e)}init(){return[new Wa.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,iE.getRPCMetadata)(k.active()),u=i.routeOptions?i.routeOptions.url:r.routerPath;u&&a?.type===iE.RPCType.HTTP&&(a.route=u);let d=r.method||"GET";pe().setTransactionName(`${d} ${u}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||Lq,u=`${Sf.MIDDLEWARE} - ${a}`,d=i[1],p=NC(d,s.tracer,u,{[Ss.FASTIFY_TYPE]:Ef.MIDDLEWARE,[Ss.PLUGIN_NAME]:e,[Ss.HOOK_NAME]:n}),f=o&&i[i.length-1];return f&&(i[i.length-1]=function(...m){oE(d),f.apply(this,m)}),k.with(Z.setSpan(k.active(),p),()=>wq(()=>r.apply(this,i),m=>{m instanceof Error&&(p.setStatus({code:ze.ERROR,message:m.message}),p.recordException(m)),o||oE(d)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!jRe.has(s))return n.apply(this,o);let u=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,u)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),HRe(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,Wa.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),oE(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,u=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,d=`${Sf.REQUEST_HANDLER} - ${u||this.pluginName||Lq}`,p={[Ss.PLUGIN_NAME]:this.pluginName,[Ss.FASTIFY_TYPE]:Ef.REQUEST_HANDLER,[dy]:i.routeOptions?i.routeOptions.url:r.routerPath};u&&(p[Ss.FASTIFY_NAME]=u);let f=NC(o,e.tracer,d,p);Dq(f);let{requestHook:m}=e.getConfig();return m&&(0,Wa.safeExecuteInTheMiddle)(()=>m(f,{request:r}),_=>{_&&e._diag.error("request hook failed",_)},!0),k.with(Z.setSpan(k.active(),f),()=>{s()})}}};function HRe(){let t=q();t&&t.on("spanStart",e=>{Dq(e)})}function Dq(t){let e=W(t).data,n=e["fastify.type"];if(e[re]||!n)return;t.setAttributes({[Q]:"auto.http.otel.fastify",[re]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var aE="Fastify",Fq=F(`${aE}.v3`,()=>new sE);function VRe(){let t=q();if(t)return t.getIntegrationByName(aE)}function Uq(t,e,n,r){let o=VRe()?.getShouldHandleError()||Hq;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){bt&&b.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&oe(t,{mechanism:{handled:!1,type:"auto.function.fastify"}})}var Gq=F(`${aE}.v5`,()=>{let t=new Bq.FastifyOtelInstrumentation,e=t.plugin();return xC.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?bt&&b.error("Failed to setup Fastify instrumentation",o):($Re(),r&&zRe(r))})}),xC.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;Uq.call(Uq,r,o,s,"diagnostics-channel")}),t}),qRe=({shouldHandleError:t})=>{let e;return{name:aE,setupOnce(){e=t||Hq,Fq(),Gq()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}},jq=(t={})=>qRe(t);function Hq(t,e,n){let r=n.statusCode;return r>=500||r<=299}function Vq(t){let e=W(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[re]||!i&&!a&&!s)return;let u=s?"hook":i?"middleware":a?"request_handler":"<unknown>";t.setAttributes({[Q]:"auto.http.otel.fastify",[re]:`${u}.fastify`});let d=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof d=="string"){let p=d.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(p)}}function $Re(){let t=q();t&&t.on("spanStart",e=>{Vq(e)})}function zRe(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&Vq(s)}let r=e.routeOptions?.url,o=e.method||"GET";pe().setTransactionName(`${o} ${r}`)})}c();M();var l5=J(c5(),1);var d5="Graphql",p5=F(d5,l5.GraphQLInstrumentation,t=>{let e=m5(t);return{...e,responseHook(n,r){Ce(n,"auto.graphql.otel.graphql"),r.errors?.length&&!W(n).status&&n.setStatus({code:ze.ERROR});let s=W(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let u=Ye(n),p=W(u).data[tl]||[],f=a?`${i} ${a}`:`${i}`;Array.isArray(p)?(p.push(f),u.setAttribute(tl,p)):typeof p=="string"?u.setAttribute(tl,[p,f]):u.setAttribute(tl,f),W(u).data["original-description"]||u.setAttribute("original-description",W(u).description),u.updateName(`${W(u).data["original-description"]} (${fIe(p)})`)}}}}),pIe=(t={})=>({name:d5,setupOnce(){p5(m5(t))}}),f5=pIe;function m5(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function fIe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}c();var O5=J(I5(),1);var C5="Kafka",N5=F(C5,()=>new O5.KafkaJsInstrumentation({consumerHook(t){Ce(t,"auto.kafkajs.otel.consumer")},producerHook(t){Ce(t,"auto.kafkajs.otel.producer")}})),_Ie=()=>({name:C5,setupOnce(){N5()}}),x5=_Ie;c();var D5=J(L5(),1);var U5="LruMemoizer",B5=F(U5,()=>new D5.LruMemoizerInstrumentation),gIe=()=>({name:U5,setupOnce(){B5()}}),F5=gIe;c();var W5=J(Y5(),1);var K5="Mongo",Q5=F(K5,()=>new W5.MongoDBInstrumentation({dbStatementSerializer:yIe,responseHook(t){Ce(t,"auto.db.otel.mongo")}}));function yIe(t){let e=BC(t);return JSON.stringify(e)}function BC(t){if(Array.isArray(t))return t.map(e=>BC(e));if(bIe(t)){let e={};return Object.entries(t).map(([n,r])=>[n,BC(r)]).reduce((n,r)=>(IIe(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function bIe(t){return typeof t=="object"&&t!==null&&!RIe(t)}function RIe(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function IIe(t){return Array.isArray(t)}var OIe=()=>({name:K5,setupOnce(){Q5()}}),J5=OIe;c();var u$=J(a$(),1);var c$="Mongoose",l$=F(c$,()=>new u$.MongooseInstrumentation({responseHook(t){Ce(t,"auto.db.otel.mongoose")}})),LIe=()=>({name:c$,setupOnce(){l$()}}),d$=LIe;c();var E$=J(T$(),1);var S$="Mysql",A$=F(S$,()=>new E$.MySQLInstrumentation({})),$Ie=()=>({name:S$,setupOnce(){A$()}}),y$=$Ie;c();var P$=J(x$(),1);var M$="Mysql2",v$=F(M$,()=>new P$.MySQL2Instrumentation({responseHook(t){Ce(t,"auto.db.otel.mysql2")}})),iOe=()=>({name:M$,setupOnce(){v$()}}),k$=iOe;c();var s9=J(j$(),1),i9=J(e9(),1);c();var IOe=["get","set","setex"],sN=["get","mget"],OOe=["set","setex"];function Lf(t,e){return t.includes(e.toLowerCase())}function iN(t){return Lf(sN,t)?"cache.get":Lf(OOe,t)?"cache.put":void 0}function COe(t,e){return e.some(n=>t.startsWith(n))}function n9(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?t9(o.map(s=>n(s))):["<unknown>"],r=e[0];return Lf(IOe,t)&&r!=null?n(r):t9(e.map(o=>n(o)))}catch{return}}function r9(t,e,n){if(!iN(t))return!1;for(let r of e)if(COe(r,n))return!0;return!1}function o9(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function t9(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var qE="Redis",Df={},a9=(t,e,n,r)=>{t.setAttribute(Q,"auto.db.otel.redis");let o=n9(e,n),s=iN(e);if(!o||!s||!Df.cachePrefixes||!r9(e,o,Df.cachePrefixes))return;let i=W(t).data["net.peer.name"],a=W(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let u=o9(r);u&&t.setAttribute(nR,u),Lf(sN,e)&&u!==void 0&&t.setAttribute(eR,u>0),t.setAttributes({[re]:s,[tR]:o});let d=o.join(", ");t.updateName(Df.maxCacheKeyLength?Js(d,Df.maxCacheKeyLength):d)},NOe=F(`${qE}.IORedis`,()=>new s9.IORedisInstrumentation({responseHook:a9})),xOe=F(`${qE}.Redis`,()=>new i9.RedisInstrumentation({responseHook:a9})),u9=Object.assign(()=>{NOe(),xOe()},{id:qE}),POe=(t={})=>({name:qE,setupOnce(){Df=t,u9()}}),c9=POe;c();var O9=J(I9(),1);var C9="Postgres",N9=F(C9,O9.PgInstrumentation,t=>({requireParentSpan:!0,requestHook(e){Ce(e,"auto.db.otel.postgres")},ignoreConnectSpans:t?.ignoreConnectSpans??!1})),$Oe=t=>({name:C9,setupOnce(){N9(t)}}),x9=$Oe;c();M();var Li=J(se(),1);fe();var fN="PostgresJs",P9=[">=3.0.0 <4"],zOe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,YOe=Symbol.for("sentry.query.from.instrumented.sql"),M9=F(fN,t=>new pN({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),pN=class extends Li.InstrumentationBase{constructor(e){super("sentry-postgres-js",me,e)}init(){let e=new Li.InstrumentationNodeModuleDefinition("postgres",P9,n=>{try{return this._patchPostgres(n)}catch(r){return bt&&b.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new Li.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,P9,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return bt&&b.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);if(!a||typeof a!="function")return bt&&b.warn("postgres() did not return a valid instance"),a;let u=o.getConfig();return GR(a,{requireParentSpan:u.requireParentSpan,requestHook:u.requestHook})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(kp(e,"default",s),e)}_shouldCreateSpans(){let e=this.getConfig();return Z.getSpan(k.active())!==void 0||!e.requireParentSpan}_setOperationName(e,n,r){if(r){e.setAttribute(Wu,r);return}let o=n?.match(zOe);o?.[1]&&e.setAttribute(Wu,o[1].toUpperCase())}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[YOe])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return Mt({name:i||"postgresjs.query",op:"db"},a=>{Ce(a,"auto.db.postgresjs"),a.setAttributes({[da]:"postgres",[Ty]:i});let u=n.getConfig(),{requestHook:d}=u;d&&(0,Li.safeExecuteInTheMiddle)(()=>d(a,i,void 0),m=>{m&&(a.setAttribute("sentry.hook.error","requestHook failed"),bt&&b.error(`Error in requestHook for ${fN} integration:`,m))},!0);let p=this.resolve;this.resolve=new Proxy(p,{apply:(m,_,h)=>{try{n._setOperationName(a,i,h?.[0]?.command),a.end()}catch(g){bt&&b.error("Error ending span in resolve callback:",g)}return Reflect.apply(m,_,h)}});let f=this.reject;this.reject=new Proxy(f,{apply:(m,_,h)=>{try{a.setStatus({code:2,message:h?.[0]?.message||"unknown_error"}),a.setAttribute(Ey,h?.[0]?.code||"unknown"),a.setAttribute(Sy,h?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(g){bt&&b.error("Error ending span in reject callback:",g)}return Reflect.apply(m,_,h)}});try{return r.apply(this,o)}catch(m){throw a.setStatus({code:2,message:m instanceof Error?m.message:"unknown_error"}),a.end(),m}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},WOe=t=>({name:fN,setupOnce(){M9(t)}}),v9=WOe;c();M();c();M();var TS=J(_z(),1);M();var _Ne={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"}},hNe=_Ne.version.split(".")[0],UN="PRISMA_INSTRUMENTATION",BN=`V${hNe}_PRISMA_INSTRUMENTATION`,Gl=globalThis;function gNe(){let t=Gl[BN];return t?.helper?t.helper:Gl[UN]?.helper}function TNe(t){let e={helper:t};Gl[BN]=e,Gl[UN]=e}function ENe(){delete Gl[BN],delete Gl[UN]}var SNe=process.env.PRISMA_SHOW_ALL_TRACES==="true",ANe="00-10-10-00";function yNe(t){switch(t){case"client":return Me.CLIENT;case"internal":default:return Me.INTERNAL}}var bNe=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=Z.getSpanContext(t??k.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:ANe}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)Tz(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return k.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!SNe)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(Ez(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return hz(s,e(s,r))}return n.startActiveSpan(o,t,s=>hz(s,e(s,r)))}};function Tz(t,e,n,r,o){if(Ez(e.name,o))return;let s={attributes:e.attributes,kind:yNe(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(u=>{let d=r.get(u);return d?{context:{spanId:d,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(u=>u.parentId===e.id);for(let u of a)Tz(t,u,n,r,o);i.end(e.endTime)})}function hz(t,e){return RNe(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function RNe(t){return t!=null&&typeof t.then=="function"}function Ez(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var Sz={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},gz=Sz.version,INe=Sz.name,ONe="@prisma/client",Az=class extends TS.InstrumentationBase{tracerProvider;constructor(t={}){super(INe,gz,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new TS.InstrumentationNodeModuleDefinition(ONe,[gz])]}enable(){let t=this._config;TNe(new bNe({tracerProvider:this.tracerProvider??Z.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){ENe()}isEnabled(){return gNe()!==void 0}};var yz="Prisma";function CNe(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function bz(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}var FN=class extends Az{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=bz();CNe(e)&&(e.createEngineSpan=n=>{let r=Z.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){rt(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=NNe(s.kind),a=s.parent_span_id,u=s.span_id,d=s.trace_id,p=s.links?.map(m=>({context:{traceId:m.trace_id,spanId:m.span_id,traceFlags:tn.SAMPLED}})),f=Z.setSpanContext(k.active(),{traceId:d,spanId:a,traceFlags:tn.SAMPLED});k.with(f,()=>{let m={generateTraceId:()=>d,generateSpanId:()=>u};r._idGenerator=m,r.startSpan(s.name,{kind:i,links:p,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};function NNe(t){switch(t){case"client":return Me.CLIENT;case"internal":default:return Me.INTERNAL}}var xNe=F(yz,t=>new FN(t)),Rz=t=>({name:yz,setupOnce(){xNe(t)},setup(e){bz()&&e.on("spanStart",n=>{let r=W(n);r.description?.startsWith("prisma:")&&n.setAttribute(Q,"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")})}});c();var wz=J(kz(),1);var Lz="Hapi",Dz=F(Lz,()=>new wz.HapiInstrumentation),HNe=()=>({name:Lz,setupOnce(){Dz()}}),Uz=HNe;c();fe();c();var Fi={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Qf={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"};c();M();var yS=J(se(),1);var VNe="@sentry/instrumentation-hono",qNe="0.0.1",AS=class extends yS.InstrumentationBase{constructor(e={}){super(VNe,qNe,e)}init(){return[new yS.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return k.with(Z.setSpan(k.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(qt(a))return a.then(u=>{let d=n._determineHandlerType(u);return i.setAttributes({[Fi.HONO_TYPE]:d,[Fi.HONO_NAME]:d===Qf.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),u});{let u=n._determineHandlerType(a);return i.setAttributes({[Fi.HONO_TYPE]:u,[Fi.HONO_NAME]:u===Qf.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return qt(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Qf.MIDDLEWARE:Qf.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:ze.ERROR,message:n.message}),e.recordException(n))}};var Bz="Hono";function $Ne(t){let e=W(t).data,n=e[Fi.HONO_TYPE];if(e[re]||!n)return;t.setAttributes({[Q]:"auto.http.otel.hono",[re]:`${n}.hono`});let r=e[Fi.HONO_NAME];if(typeof r=="string"&&t.updateName(r),pe()===gr()){bt&&b.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[rs],s=e[pa];typeof o=="string"&&typeof s=="string"&&pe().setTransactionName(`${s} ${o}`)}var Fz=F(Bz,()=>new AS({responseHook:t=>{$Ne(t)}})),zNe=()=>({name:Bz,setupOnce(){Fz()}}),Gz=zNe;c();var Xz=J(Jz(),1);fe();var Zz="Koa",eY=F(Zz,Xz.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Ce(e,"auto.http.otel.koa");let r=W(e).data,o=r["koa.type"];o&&e.setAttribute(re,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),pe()===gr()){bt&&b.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[rs],a=n.context?.request?.method?.toUpperCase()||"GET";i&&pe().setTransactionName(`${a} ${i}`)}})),txe=(t={})=>({name:Zz,setupOnce(){eY(t)}}),tY=txe;c();var lY=J(cY(),1);var dY="Connect",pY=F(dY,()=>new lY.ConnectInstrumentation),dxe=()=>({name:dY,setupOnce(){pY()}}),fY=dxe;c();var bY=J(yY(),1);var hxe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),RY="Tedious",IY=F(RY,()=>new bY.TediousInstrumentation({})),gxe=()=>{let t;return{name:RY,setupOnce(){let e=IY();t=Lp(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=W(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";hxe.has(s)&&n.setAttribute(Q,"auto.db.otel.tedious")}))}}},OY=gxe;c();var MY=J(PY(),1);var vY="GenericPool",kY=F(vY,()=>new MY.GenericPoolInstrumentation({})),Exe=()=>{let t;return{name:vY,setupOnce(){let e=kY();t=Lp(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=W(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(Q,"auto.db.otel.generic_pool")}))}}},wY=Exe;c();var qY=J(VY(),1);var $Y="Amqplib",Pxe={consumeEndHook:t=>{Ce(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Ce(t,"auto.amqplib.otel.publisher")}},zY=F($Y,()=>new qY.AmqplibInstrumentation(Pxe)),Mxe=()=>({name:$Y,setupOnce(){zY()}}),YY=Mxe;c();c();var tm="VercelAI";c();var FS=J(se(),1);var vxe=[">=3.0.0 <7"],WY=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];function kxe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function wxe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;Array.isArray(e.content)&&(Lxe(e.content),Dxe(e.content))}function Lxe(t){for(let e of t){if(!kxe(e))continue;let n=iI(e.toolCallId);n?Jn(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),oe(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):Jn(r=>{r.setTag("vercel.ai.tool.name",e.toolName),r.setTag("vercel.ai.tool.callId",e.toolCallId),r.setLevel("error"),oe(e.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function Dxe(t){for(let e of t)typeof e=="object"&&e!==null&&"toolCallId"in e&&typeof e.toolCallId=="string"&&aI(e.toolCallId)}function Uxe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var BS=class t extends FS.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",me,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new FS.InstrumentationNodeModuleDefinition("ai",vxe,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},u=a.isEnabled,d=q(),p=d?.getIntegrationByName(tm),f=p?.options,m=p?!!d?.getOptions().sendDefaultPii:!1,{recordInputs:_,recordOutputs:h}=Uxe(f,a,u,m);return i[0].experimental_telemetry={...a,isEnabled:u!==void 0?u:!0,recordInputs:_,recordOutputs:h},Kr(()=>Reflect.apply(o,s,i),g=>{g&&typeof g=="object"&&dt(g,"_sentry_active_span",Er())},()=>{},g=>{wxe(g)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of WY)e[r]!=null&&(e[r]=n(e[r]));return e}else{let r=WY.reduce((o,s)=>(e[s]!=null&&(o[s]=n(e[s])),o),{});return{...e,...r}}}};var KY=F(tm,()=>new BS({}));function Bxe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var Fxe=(t={})=>{let e;return{name:tm,options:t,setupOnce(){e=KY()},afterAllSetup(n){t.force??Bxe(n)?Jh(n):e?.callWhenPatched(()=>Jh(n))}}},QY=Fxe;c();c();var jS=J(se(),1);var Gxe=[">=4.0.0 <7"],GS=class extends jS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",me,e)}init(){return new jS.InstrumentationNodeModuleDefinition("openai",Gxe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(xa(gi))return Reflect.construct(r,i);let a=Reflect.construct(r,i);return Zh(a,o)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}};var JY=F(gi,t=>new GS(t)),jxe=(t={})=>({name:gi,setupOnce(){JY(t)}}),XY=jxe;c();c();var VS=J(se(),1);var Hxe=[">=0.19.2 <1.0.0"],HS=class extends VS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",me,e)}init(){return new VS.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",Hxe,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(xa(Ti))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return eg(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}};var ZY=F(Ti,t=>new HS(t)),Vxe=(t={})=>({name:Ti,options:t,setupOnce(){ZY(t)}}),e7=Vxe;c();c();var Zl=J(se(),1);var t7=[">=0.10.0 <2"],qS=class extends Zl.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",me,e)}init(){return new Zl.InstrumentationNodeModuleDefinition("@google/genai",t7,n=>this._patch(n),n=>n,[new Zl.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",t7,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(xa(Ei))return Reflect.construct(n,s);let i=Reflect.construct(n,s);return tg(i,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return kp(e,"GoogleGenAI",o),e}};var n7=F(Ei,t=>new qS(t)),qxe=(t={})=>({name:Ei,setupOnce(){n7(t)}}),r7=qxe;c();c();var Wi=J(se(),1);var $S=[">=0.1.0 <2.0.0"];function $xe(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function zxe(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let u=a.callbacks,d=$xe(u,e);return a.callbacks=d,Reflect.apply(r,o,s)}})}var zS=class extends Wi.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",me,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new Wi.InstrumentationNodeModuleDefinition(r,$S,this._patch.bind(this),o=>o,[new Wi.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,$S,this._patch.bind(this),o=>o)]));return e.push(new Wi.InstrumentationNodeModuleDefinition("langchain",$S,this._patch.bind(this),r=>r,[new Wi.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",$S,this._patch.bind(this),r=>r)])),e}_patch(e){xR([gi,Ti,Ei]);let n=rg(this.getConfig());return this._patchRunnableMethods(e,n),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(u=>typeof u=="function"&&r.includes(u.name));if(!s)return;let i=s.prototype;if(i.__sentry_patched__)return;i.__sentry_patched__=!0;let a=["invoke","stream","batch"];for(let u of a){let d=i[u];typeof d=="function"&&(i[u]=zxe(d,n))}}};var o7=F(ng,t=>new zS(t)),Yxe=(t={})=>({name:ng,setupOnce(){o7(t)}}),s7=Yxe;c();c();var ed=J(se(),1);var i7=[">=0.0.0 <2.0.0"],YS=class extends ed.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",me,e)}init(){return new ed.InstrumentationNodeModuleDefinition("@langchain/langgraph",i7,this._patch.bind(this),n=>n,[new ed.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",i7,this._patch.bind(this),n=>n)])}_patch(e){return e.StateGraph&&typeof e.StateGraph=="function"&&sg(e.StateGraph.prototype,this.getConfig()),e}};var a7=F(og,t=>new YS(t)),Wxe=(t={})=>({name:og,setupOnce(){a7(t)}}),u7=Wxe;c();c();var h7=J(se(),1);c();M();var Os=J(se(),1);fe();import*as l7 from"node:net";function d7(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=p=>{(0,Os.safeExecuteInTheMiddle)(()=>a(p),f=>{f&&Kn.error(f?.message)},!0)});let u=new Os.InstrumentationNodeModuleDefinition("@firebase/firestore",e,p=>c7(p,n,r,t,i)),d=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let p of d)u.files.push(new Os.InstrumentationNodeModuleFile(p,e,f=>c7(f,n,r,t,i),f=>p7(f,r)));return u}function c7(t,e,n,r,o){return p7(t,n),e(t,"addDoc",Kxe(r,o)),e(t,"getDocs",Jxe(r,o)),e(t,"setDoc",Xxe(r,o)),e(t,"deleteDoc",Qxe(r,o)),t}function p7(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Os.isWrapped)(t[n])&&e(t,n);return t}function Kxe(t,e){return function(r){return function(o,s){let i=KS(t,"addDoc",o);return e(i),WS(i,()=>r(o,s))}}}function Qxe(t,e){return function(r){return function(o){let s=KS(t,"deleteDoc",o.parent||o);return e(s),WS(s,()=>r(o))}}}function Jxe(t,e){return function(r){return function(o){let s=KS(t,"getDocs",o);return e(s),WS(s,()=>r(o))}}}function Xxe(t,e){return function(r){return function(o,s,i){let a=KS(t,"setDoc",o.parent||o);return e(a),WS(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function WS(t,e){return k.with(Z.setSpan(k.active(),t),()=>(0,Os.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function KS(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Me.CLIENT});return ePe(r,n),r.setAttribute(Wu,e),r}function Zxe(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(l7.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function ePe(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[hy]:e.path,[gy]:n.name,[da]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:u}=Zxe(s);a&&(i[Iy]=a),u&&(i[Oy]=u),t.setAttributes(i)}c();M();var Cs=J(se(),1);function f7(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,u=o.functions?.requestHook,d=o.functions?.responseHook;typeof d=="function"&&(i=(m,_)=>{(0,Cs.safeExecuteInTheMiddle)(()=>d(m,_),h=>{h&&Kn.error(h?.message)},!0)}),typeof u=="function"&&(s=m=>{(0,Cs.safeExecuteInTheMiddle)(()=>u(m),_=>{_&&Kn.error(_?.message)},!0)});let p=new Cs.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:m,triggerType:_})=>{p.files.push(new Cs.InstrumentationNodeModuleFile(m,e,h=>tPe(h,n,r,t,{requestHook:s,responseHook:i,errorHook:a},_),h=>m7(h,r)))}),p}function Pn(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let u=async function(...d){let p=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",f=t.startSpan(`firebase.function.${n}`,{kind:Me.SERVER}),m={"faas.name":p,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(m["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(m["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),f.setAttributes(m),e?.requestHook?.(f),k.with(Z.setSpan(k.active(),f),async()=>{let _,h;try{h=await i.apply(this,d)}catch(g){_=g}if(e?.responseHook?.(f,_),_&&f.recordException(_),f.end(),_)throw await e?.errorHook?.(f,_),_;return h})};return a?o.call(this,a,u):o.call(this,u)}}}function tPe(t,e,n,r,o,s){switch(m7(t,n),s){case"function":e(t,"onRequest",Pn(r,o,"http.request")),e(t,"onCall",Pn(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",Pn(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",Pn(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",Pn(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",Pn(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",Pn(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",Pn(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",Pn(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",Pn(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",Pn(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",Pn(r,o,"storage.object.finalized")),e(t,"onObjectArchived",Pn(r,o,"storage.object.archived")),e(t,"onObjectDeleted",Pn(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",Pn(r,o,"storage.object.metadataUpdated"));break}return t}function m7(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Cs.isWrapped)(t[r])&&e(t,r);return t}var _7={},nPe=[">=3.0.0 <5"],rPe=[">=6.0.0 <7"],QS=class extends h7.InstrumentationBase{constructor(e=_7){super("@sentry/instrumentation-firebase",me,e)}setConfig(e={}){super.setConfig({..._7,...e})}init(){let e=[];return e.push(d7(this.tracer,nPe,this._wrap,this._unwrap,this.getConfig())),e.push(f7(this.tracer,rPe,this._wrap,this._unwrap,this.getConfig())),e}};var g7="Firebase",oPe={firestoreSpanCreationHook:t=>{Ce(t,"auto.firebase.otel.firestore"),t.setAttribute(re,"db.query")},functions:{requestHook:t=>{Ce(t,"auto.firebase.otel.functions"),t.setAttribute(re,"http.request")},errorHook:async(t,e)=>{e&&(oe(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Ch(2e3))}}},T7=F(g7,()=>new QS(oPe)),sPe=()=>({name:g7,setupOnce(){T7()}}),E7=sPe;c();c();function S7(){return[p8(),jq(),f5(),Gz(),J5(),d$(),y$(),k$(),c9(),x9(),Rz(),Uz(),tY(),fY(),OY(),wY(),x5(),YY(),F5(),s7(),u7(),QY(),XY(),e7(),r7(),v9(),E7()]}c();M();var JS=J(jI(),1),A7=J(fO(),1);fe();var ox=1e6;function y7(t,e={}){t.getOptions().debug&&xO();let[n,r]=iPe(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function iPe(t,e={}){let n=new A7.BasicTracerProvider({sampler:new cT(t),resource:(0,JS.defaultResource)().merge((0,JS.resourceFromAttributes)({[Cy]:"node",[_y]:"sentry",[Ny]:me})),forceFlushTimeoutMillis:500,spanProcessors:[new uT({timeout:aPe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});Z.setGlobalTracerProvider(n),Gr.setGlobalPropagator(new aT);let r=new NO;return k.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function aPe(t){if(t!=null){if(t>ox)return bt&&b.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${ox}`),ox;if(t<=0||Number.isNaN(t)){bt&&b.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}function b7(){return gT().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(qV(),XV())}function R7(t){return[...b7(),...ot(t)?S7():[]]}function sx(t={}){return uPe(t,R7)}function uPe(t={},e){Pa(t,"node");let n=BO({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(y7(n,{spanProcessors:t.openTelemetrySpanProcessors}),FO()),n}c();var cPe="prod",I7="0.1.46",lPe=`@tanagram/lore/${I7}`;function $e(){return cPe}function ro(){return I7}function O7(){return lPe}sx({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:$e(),release:ro(),sendDefaultPii:!0});Oh("service_name","lore-cli");import{realpathSync as _3e}from"node:fs";import{fileURLToPath as h3e,pathToFileURL as pX}from"node:url";c();c();var dPe=/\d/,pPe=["-","_","/","."];function fPe(t=""){if(!dPe.test(t))return t!==t.toLowerCase()}function C7(t,e){let n=e??pPe,r=[];if(!t||typeof t!="string")return r;let o="",s,i;for(let a of t){let u=n.includes(a);if(u===!0){r.push(o),o="",s=void 0;continue}let d=fPe(a);if(i===!1){if(s===!1&&d===!0){r.push(o),o=a,s=d;continue}if(s===!0&&d===!1&&o.length>1){let p=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=p+a,s=d;continue}}o+=a,s=d,i=u}return r.push(o),r}function mPe(t){return t?t[0].toUpperCase()+t.slice(1):""}function _Pe(t){return t?t[0].toLowerCase()+t.slice(1):""}function hPe(t,e){return t?(Array.isArray(t)?t:C7(t)).map(n=>mPe(e?.normalize?n.toLowerCase():n)).join(""):""}function nm(t,e){return _Pe(hPe(t||"",e))}function XS(t,e){return t?(Array.isArray(t)?t:C7(t)).map(n=>n.toLowerCase()).join(e??"-"):""}function N7(t){return XS(t||"","_")}import{parseArgs as gPe}from"node:util";function n0(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function ax(t,e=""){let n=[];for(let r of t)for(let[o,s]of r.entries())n[o]=Math.max(n[o]||0,s.length);return t.map(r=>r.map((o,s)=>e+o[s===0?"padStart":"padEnd"](n[s])).join(" ")).join(`
|
|
39
39
|
`)}function ur(t){return typeof t=="function"?t():t}var su=class extends Error{code;constructor(t,e){super(t),this.name="CLIError",this.code=e}};function TPe(t=[],e={}){let n=new Set(e.boolean||[]),r=new Set(e.string||[]),o=e.alias||{},s=e.default||{},i=new Map,a=new Map;for(let[T,S]of Object.entries(o)){let A=S;for(let R of A)i.set(T,R),a.has(R)||a.set(R,[]),a.get(R).push(T),i.set(R,T),a.has(T)||a.set(T,[]),a.get(T).push(R)}let u={};function d(T){if(n.has(T))return"boolean";let S=a.get(T)||[];for(let A of S)if(n.has(A))return"boolean";return"string"}function p(T){if(r.has(T))return!0;let S=a.get(T)||[];for(let A of S)if(r.has(A))return!0;return!1}let f=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(s)]);for(let T of f)u[T]||(u[T]={type:d(T),default:s[T]});for(let[T,S]of i.entries())T.length===1&&u[S]&&!u[S].short&&(u[S].short=T);let m=[],_={};for(let T=0;T<t.length;T++){let S=t[T];if(S==="--"){m.push(...t.slice(T));break}if(S.startsWith("--no-")){let A=S.slice(5);_[A]=!0;continue}m.push(S)}let h;try{h=gPe({args:m,options:Object.keys(u).length>0?u:void 0,allowPositionals:!0,strict:!1})}catch{h={values:{},positionals:m}}let g={_:[]};g._=h.positionals;for(let[T,S]of Object.entries(h.values)){let A=S;d(T)==="boolean"&&typeof S=="string"?A=S!=="false":p(T)&&typeof S=="boolean"&&(A=""),g[T]=A}for(let[T]of Object.entries(_)){g[T]=!1;let S=i.get(T);S&&(g[S]=!1);let A=a.get(T);if(A)for(let R of A)g[R]=!1}for(let[T,S]of i.entries())g[T]!==void 0&&g[S]===void 0&&(g[S]=g[T]),g[S]!==void 0&&g[T]===void 0&&(g[T]=g[S]),g[T]!==g[S]&&s[S]===g[S]&&(g[S]=g[T]);return g}var EPe=(()=>{let t=globalThis.process?.env??{};return t.NO_COLOR==="1"||t.TERM==="dumb"||t.TEST||t.CI})(),r0=(t,e=39)=>n=>EPe?n:`\x1B[${t}m${n}\x1B[${e}m`,ZS=r0(1,22),oo=r0(36),t0=r0(90),e0=r0(4,24);function SPe(t,e){let n={boolean:[],string:[],alias:{},default:{}},r=M7(e);for(let a of r){if(a.type==="positional")continue;a.type==="string"||a.type==="enum"?n.string.push(a.name):a.type==="boolean"&&n.boolean.push(a.name),a.default!==void 0&&(n.default[a.name]=a.default),a.alias&&(n.alias[a.name]=a.alias);let u=nm(a.name),d=XS(a.name);if(u!==a.name||d!==a.name){let p=n0(n.alias[a.name]||[]);u!==a.name&&!p.includes(u)&&p.push(u),d!==a.name&&!p.includes(d)&&p.push(d),p.length>0&&(n.alias[a.name]=p)}}let o=TPe(t,n),[...s]=o._,i=new Proxy(o,{get(a,u){return a[u]??a[nm(u)]??a[XS(u)]}});for(let[,a]of r.entries())if(a.type==="positional"){let u=s.shift();if(u!==void 0)i[a.name]=u;else{if(a.default===void 0&&a.required!==!1)throw new su(`Missing required positional argument: ${a.name.toUpperCase()}`,"EARG");i[a.name]=a.default}}else if(a.type==="enum"){let u=i[a.name],d=a.options||[];if(u!==void 0&&d.length>0&&!d.includes(u))throw new su(`Invalid value for argument: ${oo(`--${a.name}`)} (${oo(u)}). Expected one of: ${d.map(p=>oo(p)).join(", ")}.`,"EARG")}else if(a.required&&i[a.name]===void 0)throw new su(`Missing required argument: --${a.name}`,"EARG");return i}function M7(t){let e=[];for(let[n,r]of Object.entries(t||{}))e.push({...r,name:n,alias:n0(r.alias)});return e}async function APe(t){return Promise.all(t.map(e=>ur(e)))}async function iu(t,e){let n=await ur(t.args||{}),r=SPe(e.rawArgs,n),o={rawArgs:e.rawArgs,args:r,data:e.data,cmd:t},s=await APe(t.plugins??[]),i,a;try{for(let p of s)await p.setup?.(o);typeof t.setup=="function"&&await t.setup(o);let d=await ur(t.subCommands);if(d&&Object.keys(d).length>0){let p=yPe(e.rawArgs,n),f=e.rawArgs[p];if(f){let m=await x7(d,f);if(!m)throw new su(`Unknown command ${oo(f)}`,"E_UNKNOWN_COMMAND");await iu(m,{rawArgs:e.rawArgs.slice(p+1)})}else{let m=await ur(t.default);if(m){if(t.run)throw new su("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let _=await x7(d,m);if(!_)throw new su(`Default sub command ${oo(m)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await iu(_,{rawArgs:e.rawArgs})}else if(!t.run)throw new su("No command specified.","E_NO_COMMAND")}}typeof t.run=="function"&&(i=await t.run(o))}catch(d){a=d}let u=[];if(typeof t.cleanup=="function")try{await t.cleanup(o)}catch(d){u.push(d)}for(let d of[...s].reverse())try{await d.cleanup?.(o)}catch(p){u.push(p)}if(a)throw a;if(u.length===1)throw u[0];if(u.length>1)throw new Error("Multiple cleanup errors",{cause:u});return{result:i}}async function x7(t,e){if(e in t)return ur(t[e]);for(let n of Object.values(t)){let r=await ur(n),o=await ur(r?.meta);if(o?.alias&&n0(o.alias).includes(e))return r}}function yPe(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&bPe(r,e)&&n++;continue}return n}return-1}function bPe(t,e){let n=t.replace(/^-{1,2}/,""),r=nm(n);for(let[o,s]of Object.entries(e))if(!(s.type!=="string"&&s.type!=="enum")&&(r===nm(o)||(Array.isArray(s.alias)?s.alias:s.alias?[s.alias]:[]).includes(n)))return!0;return!1}var RPe=/^no[-A-Z]/;async function o0(t,e){let n=await ur(t.meta||{}),r=M7(await ur(t.args||{})),o=await ur(e?.meta||{}),s=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),i=[],a=[],u=[],d=[];for(let _ of r)if(_.type==="positional"){let h=_.name.toUpperCase(),g=_.required!==!1&&_.default===void 0;a.push([oo(h+ux(_)),P7(_,g)]),d.push(g?`<${h}>`:`[${h}]`)}else{let h=_.required===!0&&_.default===void 0,g=[...(_.alias||[]).map(T=>`-${T}`),`--${_.name}`].join(", ")+ux(_);if(i.push([oo(g),P7(_,h)]),_.type==="boolean"&&(_.default===!0||_.negativeDescription)&&!RPe.test(_.name)){let T=[...(_.alias||[]).map(S=>`--no-${S}`),`--no-${_.name}`].join(", ");i.push([oo(T),[_.negativeDescription,h?t0("(Required)"):""].filter(Boolean).join(" ")])}h&&d.push(`--${_.name}`+ux(_))}if(t.subCommands){let _=[],h=await ur(t.subCommands);for(let[g,T]of Object.entries(h)){let S=await ur((await ur(T))?.meta);if(S?.hidden)continue;let A=n0(S?.alias),R=[g,...A].join(", ");u.push([oo(R),S?.description||""]),_.push(g,...A)}d.push(_.join("|"))}let p=[],f=n.version||o.version;p.push(t0(`${n.description} (${s+(f?` v${f}`:"")})`),"");let m=i.length>0||a.length>0;return p.push(`${e0(ZS("USAGE"))} ${oo(`${s}${m?" [OPTIONS]":""} ${d.join(" ")}`)}`,""),a.length>0&&(p.push(e0(ZS("ARGUMENTS")),""),p.push(ax(a," ")),p.push("")),i.length>0&&(p.push(e0(ZS("OPTIONS")),""),p.push(ax(i," ")),p.push("")),u.length>0&&(p.push(e0(ZS("COMMANDS")),""),p.push(ax(u," ")),p.push("",`Use ${oo(`${s} <command> --help`)} for more information about a command.`)),p.filter(_=>typeof _=="string").join(`
|
|
40
|
-
`)}function ux(t){let e=t.valueHint?`=<${t.valueHint}>`:"",n=e||`=<${N7(t.name)}>`;return!t.type||t.type==="positional"||t.type==="boolean"?e:t.type==="enum"&&t.options?.length?`=<${t.options.join("|")}>`:n}function P7(t,e){let n=e?t0("(Required)"):"",r=t.default===void 0?"":t0(`(Default: ${t.default})`);return[t.description,n,r].filter(Boolean).join(" ")}c();import{spawn as TUe}from"node:child_process";c();c();c();c();var l={};oa(l,{BRAND:()=>QPe,DIRTY:()=>au,EMPTY_PATH:()=>NPe,INVALID:()=>X,NEVER:()=>w1e,OK:()=>fn,ParseStatus:()=>Zt,Schema:()=>le,ZodAny:()=>Ji,ZodArray:()=>Ms,ZodBigInt:()=>cu,ZodBoolean:()=>lu,ZodBranded:()=>om,ZodCatch:()=>Au,ZodDate:()=>du,ZodDefault:()=>Su,ZodDiscriminatedUnion:()=>a0,ZodEffects:()=>Dr,ZodEnum:()=>Tu,ZodError:()=>Vn,ZodFirstPartyTypeKind:()=>te,ZodFunction:()=>c0,ZodIntersection:()=>_u,ZodIssueCode:()=>P,ZodLazy:()=>hu,ZodLiteral:()=>gu,ZodMap:()=>id,ZodNaN:()=>ud,ZodNativeEnum:()=>Eu,ZodNever:()=>so,ZodNull:()=>fu,ZodNullable:()=>Vo,ZodNumber:()=>uu,ZodObject:()=>qn,ZodOptional:()=>wr,ZodParsedType:()=>U,ZodPipeline:()=>sm,ZodPromise:()=>Xi,ZodReadonly:()=>yu,ZodRecord:()=>u0,ZodSchema:()=>le,ZodSet:()=>ad,ZodString:()=>Qi,ZodSymbol:()=>od,ZodTransformer:()=>Dr,ZodTuple:()=>Ho,ZodType:()=>le,ZodUndefined:()=>pu,ZodUnion:()=>mu,ZodUnknown:()=>Ps,ZodVoid:()=>sd,addIssueToContext:()=>w,any:()=>s1e,array:()=>c1e,bigint:()=>e1e,boolean:()=>H7,coerce:()=>k1e,custom:()=>F7,date:()=>t1e,datetimeRegex:()=>U7,defaultErrorMap:()=>Ns,discriminatedUnion:()=>f1e,effect:()=>I1e,enum:()=>y1e,function:()=>E1e,getErrorMap:()=>td,getParsedType:()=>jo,instanceof:()=>XPe,intersection:()=>m1e,isAborted:()=>s0,isAsync:()=>nd,isDirty:()=>i0,isValid:()=>Ki,late:()=>JPe,lazy:()=>S1e,literal:()=>A1e,makeIssue:()=>rm,map:()=>g1e,nan:()=>ZPe,nativeEnum:()=>b1e,never:()=>a1e,null:()=>o1e,nullable:()=>C1e,number:()=>j7,object:()=>l1e,objectUtil:()=>cx,oboolean:()=>v1e,onumber:()=>M1e,optional:()=>O1e,ostring:()=>P1e,pipeline:()=>x1e,preprocess:()=>N1e,promise:()=>R1e,quotelessJson:()=>IPe,record:()=>h1e,set:()=>T1e,setErrorMap:()=>CPe,strictObject:()=>d1e,string:()=>G7,symbol:()=>n1e,transformer:()=>I1e,tuple:()=>_1e,undefined:()=>r1e,union:()=>p1e,unknown:()=>i1e,util:()=>_e,void:()=>u1e});c();c();c();c();c();var _e;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(_e||(_e={}));var cx;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(cx||(cx={}));var U=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),jo=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var P=_e.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"]),IPe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Vn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,u=0;for(;u<i.path.length;){let d=i.path[u];u===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],u++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Vn.create=t=>new Vn(t);var OPe=(t,e)=>{let n;switch(t.code){case P.invalid_type:t.received===U.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case P.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,_e.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:n=`Unrecognized key(s) in object: ${_e.joinValues(t.keys,", ")}`;break;case P.invalid_union:n="Invalid input";break;case P.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_e.joinValues(t.options)}`;break;case P.invalid_enum_value:n=`Invalid enum value. Expected ${_e.joinValues(t.options)}, received '${t.received}'`;break;case P.invalid_arguments:n="Invalid function arguments";break;case P.invalid_return_type:n="Invalid function return type";break;case P.invalid_date:n="Invalid date";break;case P.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:_e.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case P.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case P.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case P.custom:n="Invalid input";break;case P.invalid_intersection_types:n="Intersection results could not be merged";break;case P.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case P.not_finite:n="Number must be finite";break;default:n=e.defaultError,_e.assertNever(t)}return{message:n}},Ns=OPe;var v7=Ns;function CPe(t){v7=t}function td(){return v7}c();var rm=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",u=r.filter(d=>!!d).slice().reverse();for(let d of u)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},NPe=[];function w(t,e){let n=td(),r=rm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Ns?void 0:Ns].filter(o=>!!o)});t.common.issues.push(r)}var Zt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return X;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return X;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},X=Object.freeze({status:"aborted"}),au=t=>({status:"dirty",value:t}),fn=t=>({status:"valid",value:t}),s0=t=>t.status==="aborted",i0=t=>t.status==="dirty",Ki=t=>t.status==="valid",nd=t=>typeof Promise<"u"&&t instanceof Promise;c();c();var H;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(H||(H={}));var Lr=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},k7=(t,e)=>{if(Ki(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Vn(t.common.issues);return this._error=n,this._error}}};function ue(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:u}=t;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:u??n??a.defaultError}},description:o}}var le=class{get description(){return this._def.description}_getType(e){return jo(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:jo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zt,ctx:{common:e.parent.common,data:e.data,parsedType:jo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(nd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jo(e)},o=this._parseSync({data:e,path:r.path,parent:r});return k7(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jo(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Ki(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Ki(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jo(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(nd(o)?o:Promise.resolve(o));return k7(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:P.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new Dr({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return wr.create(this,this._def)}nullable(){return Vo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ms.create(this)}promise(){return Xi.create(this,this._def)}or(e){return mu.create([this,e],this._def)}and(e){return _u.create(this,e,this._def)}transform(e){return new Dr({...ue(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Su({...ue(this._def),innerType:this,defaultValue:n,typeName:te.ZodDefault})}brand(){return new om({typeName:te.ZodBranded,type:this,...ue(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Au({...ue(this._def),innerType:this,catchValue:n,typeName:te.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return sm.create(this,e)}readonly(){return yu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xPe=/^c[^\s-]{8,}$/i,PPe=/^[0-9a-z]+$/,MPe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vPe=/^[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,kPe=/^[a-z0-9_-]{21}$/i,wPe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LPe=/^[-+]?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)?)??$/,DPe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UPe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lx,BPe=/^(?:(?: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])$/,FPe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,GPe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jPe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HPe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VPe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L7="((\\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])))",qPe=new RegExp(`^${L7}$`);function D7(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function $Pe(t){return new RegExp(`^${D7(t)}$`)}function U7(t){let e=`${L7}T${D7(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function zPe(t,e){return!!((e==="v4"||!e)&&BPe.test(t)||(e==="v6"||!e)&&GPe.test(t))}function YPe(t,e){if(!wPe.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function WPe(t,e){return!!((e==="v4"||!e)&&FPe.test(t)||(e==="v6"||!e)&&jPe.test(t))}var Qi=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_type,expected:U.string,received:s.parsedType}),X}let r=new Zt,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?w(o,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&w(o,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")DPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"email",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")lx||(lx=new RegExp(UPe,"u")),lx.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"emoji",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")vPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"uuid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")kPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"nanoid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")xPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cuid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")PPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cuid2",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")MPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"ulid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),w(o,{validation:"url",code:P.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"regex",code:P.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?U7(s).test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?qPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?$Pe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?LPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"duration",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?zPe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"ip",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?YPe(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"jwt",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?WPe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cidr",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?HPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"base64",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?VPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"base64url",code:P.invalid_string,message:s.message}),r.dirty()):_e.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:P.invalid_string,...H.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...H.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...H.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...H.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...H.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...H.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...H.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...H.errToObj(n)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Qi.create=t=>new Qi({checks:[],typeName:te.ZodString,coerce:t?.coerce??!1,...ue(t)});function KPe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}var uu=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_type,expected:U.number,received:s.parsedType}),X}let r,o=new Zt;for(let s of this._def.checks)s.kind==="int"?_e.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:P.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?KPe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:P.not_finite,message:s.message}),o.dirty()):_e.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:H.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_e.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};uu.create=t=>new uu({checks:[],typeName:te.ZodNumber,coerce:t?.coerce||!1,...ue(t)});var cu=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let r,o=new Zt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):_e.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return w(n,{code:P.invalid_type,expected:U.bigint,received:n.parsedType}),X}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:H.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};cu.create=t=>new cu({checks:[],typeName:te.ZodBigInt,coerce:t?.coerce??!1,...ue(t)});var lu=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.boolean,received:r.parsedType}),X}return fn(e.data)}};lu.create=t=>new lu({typeName:te.ZodBoolean,coerce:t?.coerce||!1,...ue(t)});var du=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_type,expected:U.date,received:s.parsedType}),X}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_date}),X}let r=new Zt,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):_e.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};du.create=t=>new du({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ue(t)});var od=class extends le{_parse(e){if(this._getType(e)!==U.symbol){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.symbol,received:r.parsedType}),X}return fn(e.data)}};od.create=t=>new od({typeName:te.ZodSymbol,...ue(t)});var pu=class extends le{_parse(e){if(this._getType(e)!==U.undefined){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.undefined,received:r.parsedType}),X}return fn(e.data)}};pu.create=t=>new pu({typeName:te.ZodUndefined,...ue(t)});var fu=class extends le{_parse(e){if(this._getType(e)!==U.null){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.null,received:r.parsedType}),X}return fn(e.data)}};fu.create=t=>new fu({typeName:te.ZodNull,...ue(t)});var Ji=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return fn(e.data)}};Ji.create=t=>new Ji({typeName:te.ZodAny,...ue(t)});var Ps=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fn(e.data)}};Ps.create=t=>new Ps({typeName:te.ZodUnknown,...ue(t)});var so=class extends le{_parse(e){let n=this._getOrReturnCtx(e);return w(n,{code:P.invalid_type,expected:U.never,received:n.parsedType}),X}};so.create=t=>new so({typeName:te.ZodNever,...ue(t)});var sd=class extends le{_parse(e){if(this._getType(e)!==U.undefined){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.void,received:r.parsedType}),X}return fn(e.data)}};sd.create=t=>new sd({typeName:te.ZodVoid,...ue(t)});var Ms=class t extends le{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==U.array)return w(n,{code:P.invalid_type,expected:U.array,received:n.parsedType}),X;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(w(n,{code:i?P.too_big:P.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(w(n,{code:P.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&&(w(n,{code:P.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Lr(n,i,n.path,a)))).then(i=>Zt.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Lr(n,i,n.path,a)));return Zt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:H.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:H.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:H.toString(n)}})}nonempty(e){return this.min(1,e)}};Ms.create=(t,e)=>new Ms({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ue(e)});function rd(t){if(t instanceof qn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=wr.create(rd(r))}return new qn({...t._def,shape:()=>e})}else return t instanceof Ms?new Ms({...t._def,type:rd(t.element)}):t instanceof wr?wr.create(rd(t.unwrap())):t instanceof Vo?Vo.create(rd(t.unwrap())):t instanceof Ho?Ho.create(t.items.map(e=>rd(e))):t}var qn=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=_e.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==U.object){let d=this._getOrReturnCtx(e);return w(d,{code:P.invalid_type,expected:U.object,received:d.parsedType}),X}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof so&&this._def.unknownKeys==="strip"))for(let d in o.data)i.includes(d)||a.push(d);let u=[];for(let d of i){let p=s[d],f=o.data[d];u.push({key:{status:"valid",value:d},value:p._parse(new Lr(o,f,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof so){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of a)u.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(d==="strict")a.length>0&&(w(o,{code:P.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of a){let f=o.data[p];u.push({key:{status:"valid",value:p},value:d._parse(new Lr(o,f,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of u){let f=await p.key,m=await p.value;d.push({key:f,value:m,alwaysSet:p.alwaysSet})}return d}).then(d=>Zt.mergeObjectSync(r,d)):Zt.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:H.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:te.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of _e.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of _e.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return rd(this)}partial(e){let n={};for(let r of _e.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of _e.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof wr;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return B7(_e.objectKeys(this.shape))}};qn.create=(t,e)=>new qn({shape:()=>t,unknownKeys:"strip",catchall:so.create(),typeName:te.ZodObject,...ue(e)});qn.strictCreate=(t,e)=>new qn({shape:()=>t,unknownKeys:"strict",catchall:so.create(),typeName:te.ZodObject,...ue(e)});qn.lazycreate=(t,e)=>new qn({shape:t,unknownKeys:"strip",catchall:so.create(),typeName:te.ZodObject,...ue(e)});var mu=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Vn(a.ctx.common.issues));return w(n,{code:P.invalid_union,unionErrors:i}),X}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let u of r){let d={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(u=>new Vn(u));return w(n,{code:P.invalid_union,unionErrors:a}),X}}get options(){return this._def.options}};mu.create=(t,e)=>new mu({options:t,typeName:te.ZodUnion,...ue(e)});var xs=t=>t instanceof hu?xs(t.schema):t instanceof Dr?xs(t.innerType()):t instanceof gu?[t.value]:t instanceof Tu?t.options:t instanceof Eu?_e.objectValues(t.enum):t instanceof Su?xs(t._def.innerType):t instanceof pu?[void 0]:t instanceof fu?[null]:t instanceof wr?[void 0,...xs(t.unwrap())]:t instanceof Vo?[null,...xs(t.unwrap())]:t instanceof om||t instanceof yu?xs(t.unwrap()):t instanceof Au?xs(t._def.innerType):[],a0=class t extends le{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return w(n,{code:P.invalid_type,expected:U.object,received:n.parsedType}),X;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(w(n,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),X)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=xs(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...ue(r)})}};function dx(t,e){let n=jo(t),r=jo(e);if(t===e)return{valid:!0,data:t};if(n===U.object&&r===U.object){let o=_e.objectKeys(e),s=_e.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let u=dx(t[a],e[a]);if(!u.valid)return{valid:!1};i[a]=u.data}return{valid:!0,data:i}}else if(n===U.array&&r===U.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],u=dx(i,a);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===U.date&&r===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var _u=class extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(s0(s)||s0(i))return X;let a=dx(s.value,i.value);return a.valid?((i0(s)||i0(i))&&n.dirty(),{status:n.value,value:a.data}):(w(r,{code:P.invalid_intersection_types}),X)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};_u.create=(t,e,n)=>new _u({left:t,right:e,typeName:te.ZodIntersection,...ue(n)});var Ho=class t extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.array)return w(r,{code:P.invalid_type,expected:U.array,received:r.parsedType}),X;if(r.data.length<this._def.items.length)return w(r,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X;!this._def.rest&&r.data.length>this._def.items.length&&(w(r,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Lr(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Zt.mergeArray(n,i)):Zt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ho.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ho({items:t,typeName:te.ZodTuple,rest:null,...ue(e)})};var u0=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return w(r,{code:P.invalid_type,expected:U.object,received:r.parsedType}),X;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Lr(r,a,r.path,a)),value:i._parse(new Lr(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Zt.mergeObjectAsync(n,o):Zt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof le?new t({keyType:e,valueType:n,typeName:te.ZodRecord,...ue(r)}):new t({keyType:Qi.create(),valueType:e,typeName:te.ZodRecord,...ue(n)})}},id=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.map)return w(r,{code:P.invalid_type,expected:U.map,received:r.parsedType}),X;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,u],d)=>({key:o._parse(new Lr(r,a,r.path,[d,"key"])),value:s._parse(new Lr(r,u,r.path,[d,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of i){let d=await u.key,p=await u.value;if(d.status==="aborted"||p.status==="aborted")return X;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(d.value,p.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let u of i){let d=u.key,p=u.value;if(d.status==="aborted"||p.status==="aborted")return X;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(d.value,p.value)}return{status:n.value,value:a}}}};id.create=(t,e,n)=>new id({valueType:e,keyType:t,typeName:te.ZodMap,...ue(n)});var ad=class t extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.set)return w(r,{code:P.invalid_type,expected:U.set,received:r.parsedType}),X;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(w(r,{code:P.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&&(w(r,{code:P.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(u){let d=new Set;for(let p of u){if(p.status==="aborted")return X;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}let a=[...r.data.values()].map((u,d)=>s._parse(new Lr(r,u,r.path,d)));return r.common.async?Promise.all(a).then(u=>i(u)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:H.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:H.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ad.create=(t,e)=>new ad({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ue(e)});var c0=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.function)return w(n,{code:P.invalid_type,expected:U.function,received:n.parsedType}),X;function r(a,u){return rm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,td(),Ns].filter(d=>!!d),issueData:{code:P.invalid_arguments,argumentsError:u}})}function o(a,u){return rm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,td(),Ns].filter(d=>!!d),issueData:{code:P.invalid_return_type,returnTypeError:u}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Xi){let a=this;return fn(async function(...u){let d=new Vn([]),p=await a._def.args.parseAsync(u,s).catch(_=>{throw d.addIssue(r(u,_)),d}),f=await Reflect.apply(i,this,p);return await a._def.returns._def.type.parseAsync(f,s).catch(_=>{throw d.addIssue(o(f,_)),d})})}else{let a=this;return fn(function(...u){let d=a._def.args.safeParse(u,s);if(!d.success)throw new Vn([r(u,d.error)]);let p=Reflect.apply(i,this,d.data),f=a._def.returns.safeParse(p,s);if(!f.success)throw new Vn([o(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ho.create(e).rest(Ps.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Ho.create([]).rest(Ps.create()),returns:n||Ps.create(),typeName:te.ZodFunction,...ue(r)})}},hu=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};hu.create=(t,e)=>new hu({getter:t,typeName:te.ZodLazy,...ue(e)});var gu=class extends le{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return w(n,{received:n.data,code:P.invalid_literal,expected:this._def.value}),X}return{status:"valid",value:e.data}}get value(){return this._def.value}};gu.create=(t,e)=>new gu({value:t,typeName:te.ZodLiteral,...ue(e)});function B7(t,e){return new Tu({values:t,typeName:te.ZodEnum,...ue(e)})}var Tu=class t extends le{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return w(n,{expected:_e.joinValues(r),received:n.parsedType,code:P.invalid_type}),X}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return w(n,{received:n.data,code:P.invalid_enum_value,options:r}),X}return fn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Tu.create=B7;var Eu=class extends le{_parse(e){let n=_e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==U.string&&r.parsedType!==U.number){let o=_e.objectValues(n);return w(r,{expected:_e.joinValues(o),received:r.parsedType,code:P.invalid_type}),X}if(this._cache||(this._cache=new Set(_e.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=_e.objectValues(n);return w(r,{received:r.data,code:P.invalid_enum_value,options:o}),X}return fn(e.data)}get enum(){return this._def.values}};Eu.create=(t,e)=>new Eu({values:t,typeName:te.ZodNativeEnum,...ue(e)});var Xi=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.promise&&n.common.async===!1)return w(n,{code:P.invalid_type,expected:U.promise,received:n.parsedType}),X;let r=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return fn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Xi.create=(t,e)=>new Xi({type:t,typeName:te.ZodPromise,...ue(e)});var Dr=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{w(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return X;let u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?X:u.status==="dirty"?au(u.value):n.value==="dirty"?au(u.value):u});{if(n.value==="aborted")return X;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?X:a.status==="dirty"?au(a.value):n.value==="dirty"?au(a.value):a}}if(o.type==="refinement"){let i=a=>{let u=o.refinement(a,s);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?X:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?X:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ki(i))return X;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Ki(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):X);_e.assertNever(o)}};Dr.create=(t,e,n)=>new Dr({schema:t,typeName:te.ZodEffects,effect:e,...ue(n)});Dr.createWithPreprocess=(t,e,n)=>new Dr({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ue(n)});var wr=class extends le{_parse(e){return this._getType(e)===U.undefined?fn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};wr.create=(t,e)=>new wr({innerType:t,typeName:te.ZodOptional,...ue(e)});var Vo=class extends le{_parse(e){return this._getType(e)===U.null?fn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Vo.create=(t,e)=>new Vo({innerType:t,typeName:te.ZodNullable,...ue(e)});var Su=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===U.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Su.create=(t,e)=>new Su({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ue(e)});var Au=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return nd(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Vn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Vn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Au.create=(t,e)=>new Au({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ue(e)});var ud=class extends le{_parse(e){if(this._getType(e)!==U.nan){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.nan,received:r.parsedType}),X}return{status:"valid",value:e.data}}};ud.create=t=>new ud({typeName:te.ZodNaN,...ue(t)});var QPe=Symbol("zod_brand"),om=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},sm=class t extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?X:s.status==="dirty"?(n.dirty(),au(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?X:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:te.ZodPipeline})}},yu=class extends le{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Ki(o)&&(o.value=Object.freeze(o.value)),o);return nd(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};yu.create=(t,e)=>new yu({innerType:t,typeName:te.ZodReadonly,...ue(e)});function w7(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function F7(t,e={},n){return t?Ji.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=w7(e,r),u=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:u})}});if(!s){let i=w7(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Ji.create()}var JPe={object:qn.lazycreate},te;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(te||(te={}));var XPe=(t,e={message:`Input not instance of ${t.name}`})=>F7(n=>n instanceof t,e),G7=Qi.create,j7=uu.create,ZPe=ud.create,e1e=cu.create,H7=lu.create,t1e=du.create,n1e=od.create,r1e=pu.create,o1e=fu.create,s1e=Ji.create,i1e=Ps.create,a1e=so.create,u1e=sd.create,c1e=Ms.create,l1e=qn.create,d1e=qn.strictCreate,p1e=mu.create,f1e=a0.create,m1e=_u.create,_1e=Ho.create,h1e=u0.create,g1e=id.create,T1e=ad.create,E1e=c0.create,S1e=hu.create,A1e=gu.create,y1e=Tu.create,b1e=Eu.create,R1e=Xi.create,I1e=Dr.create,O1e=wr.create,C1e=Vo.create,N1e=Dr.createWithPreprocess,x1e=sm.create,P1e=()=>G7().optional(),M1e=()=>j7().optional(),v1e=()=>H7().optional(),k1e={string:t=>Qi.create({...t,coerce:!0}),number:t=>uu.create({...t,coerce:!0}),boolean:t=>lu.create({...t,coerce:!0}),bigint:t=>cu.create({...t,coerce:!0}),date:t=>du.create({...t,coerce:!0})};var w1e=X;var L1e=t=>typeof t?.safeParse=="function";var px=t=>typeof t?.passthrough=="function";var D1e=(t,e)=>px(t)?px(e)?t.merge(e):t:px(e)?e:Object.assign({},t,e);var bht=l.object({name:l.literal("ZodError"),issues:l.array(l.object({path:l.array(l.union([l.string(),l.number()])),message:l.string().optional(),code:l.nativeEnum(l.ZodIssueCode)}).catchall(l.any()))}),U1e=Symbol("ContractNoBody"),q7=t=>"method"in t&&"path"in t;var $7=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>{var o,s,i;return q7(r)?[n,{...r,path:e?.pathPrefix?e.pathPrefix+r.path:r.path,headers:D1e(e?.baseHeaders,r.headers),strictStatusCodes:(o=r.strictStatusCodes)!==null&&o!==void 0?o:e?.strictStatusCodes,validateResponseOnClient:(s=r.validateResponseOnClient)!==null&&s!==void 0?s:e?.validateResponseOnClient,responses:{...e?.commonResponses,...r.responses},metadata:e?.metadata?{...e?.metadata,...(i=r.metadata)!==null&&i!==void 0?i:{}}:r.metadata}]:[n,$7(r,e)]})),fx=Symbol("ContractPlainType"),Ur=()=>({router:(t,e)=>$7(t,e),query:t=>t,mutation:t=>t,responses:t=>t,response:()=>fx,body:()=>fx,type:()=>fx,otherResponse:({contentType:t,body:e})=>({contentType:t,body:e}),noBody:()=>U1e}),B1e=({path:t,params:e})=>{let n=e;return t.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},F1e=(t,e=!1)=>{let n=e?G1e(t):j1e(t);return n?.length>0?"?"+n:""},G1e=t=>t?Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>{let r;return typeof n=="string"&&!["true","false","null"].includes(n.trim())&&isNaN(Number(n))?r=n:r=JSON.stringify(n),`${encodeURIComponent(e)}=${encodeURIComponent(r)}`}).join("&"):"",j1e=t=>t?Object.keys(t).flatMap(e=>mx(e,t[e])).map(([e,n])=>`${encodeURIComponent(e)}=${encodeURIComponent(n)}`).join("&"):"",mx=(t,e)=>Array.isArray(e)?e.flatMap((n,r)=>mx(`${t}[${r}]`,n)):e instanceof Date?[[`${t}`,e.toISOString()]]:e===null?[[`${t}`,""]]:e===void 0?[]:typeof e=="object"?Object.keys(e).flatMap(n=>mx(`${t}[${n}]`,e[n])):[[`${t}`,`${e}`]];var _x=class extends Error{constructor(e,n){let r=n.join(",");super(`Server returned unexpected response. Expected one of: ${r} got: ${e.status}`),this.response=e}};var H1e=async({route:t,path:e,method:n,headers:r,body:o,validateResponse:s,fetchOptions:i})=>{let a=await fetch(e,{...i,method:n,headers:r,body:o}),u=a.headers.get("content-type");if(u?.includes("application/")&&u?.includes("json")){let d={status:a.status,body:await a.json(),headers:a.headers},p=t.responses[d.status];return(s??t.validateResponseOnClient)&&L1e(p)?{...d,body:p.parse(d.body)}:d}return u?.includes("text/")?{status:a.status,body:await a.text(),headers:a.headers}:{status:a.status,body:await a.blob(),headers:a.headers}},V1e=t=>{let e=new FormData,n=(r,o)=>{o instanceof File?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t).forEach(([r,o])=>{if(Array.isArray(o))for(let s of o)n(r,s);else n(r,o)}),e},V7=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLowerCase(),n])),q1e=t=>{let{path:e,clientArgs:n,route:r,body:o,query:s,extraInputArgs:i,headers:a,fetchOptions:u}=t,d=n.api||H1e,p=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([_,h])=>typeof h=="function"?[_,h(t)]:[_,h])),f={...p&&V7(p),...V7(a)};Object.keys(f).forEach(_=>{f[_]===void 0&&delete f[_]});let m={route:r,path:e,method:r.method,headers:f,body:void 0,rawBody:o,rawQuery:s,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...u},...u?.signal&&{signal:u.signal},...u?.cache&&{cache:u.cache},...u&&"next"in u&&!!u?.next&&{next:u.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?m={...m,contentType:"multipart/form-data",body:o instanceof FormData?o:V1e(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?m={...m,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...m.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(m={...m,contentType:"application/json",headers:{"content-type":"application/json",...m.headers},body:JSON.stringify(o)})),d({...m,...i})},$1e=(t,e,n)=>{let{query:r,params:o,body:s,headers:i,extraHeaders:a,overrideClientOptions:u,fetchOptions:d,cache:p,next:f,...m}=n||{},_={...e,...u};return{path:z1e(r,_.baseUrl,o,t,!!_.jsonQuery),clientArgs:_,route:t,body:s,query:r,extraInputArgs:m,fetchOptions:{...p&&{cache:p},...f&&{next:f},...d},headers:{...a,...i}}},z1e=(t,e,n,r,o)=>{let s=B1e({path:r.path,params:n}),i=F1e(t,o);return`${e}${s}${i}`},Y1e=(t,e)=>{let n=Object.keys(t.responses);return async r=>{let o=$1e(t,e,r),s=await q1e(o);if(!e.throwOnUnknownStatus||n.includes(s.status.toString()))return s;throw new _x(s,n)}},hx=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>q7(r)?[n,Y1e(r,e)]:[n,hx(r,e)]));c();c();var gx=["free","creator","team"],z7=typeof process<"u"&&process.env?.NODE_ENV!=="production",W1e={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:z7?"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:z7?"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}}]}};var Y7=W1e.stripe.plans,Oht=Object.freeze(Object.fromEntries(Y7.map(t=>[t.tier,t])));c();c();var K1e=Ur(),mn=l.object({message:l.string()}),Tx=l.record(l.unknown()),bu=l.string().regex(/^doc_[0-9A-Za-z]{22}$/),l0=l.string().regex(/^proj_[0-9A-Za-z]{22}$/),Q1e=["active","archived"],d0=l.enum(Q1e),W7=l.object({id:l.string().min(1),display_name:l.string().min(1)}),K7=l.object({id:l0,name:l.string().min(1)}),Ex=l.object({id:bu,title:l.string().min(1),status:d0,author:W7,project:K7.nullable(),created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable()}),J1e=l.object({type:l.literal("list"),list_type:l.literal("doc"),objects:l.array(Ex)}),X1e=l.object({project_id:l0.optional(),status:d0.optional()}),Z1e=l.object({title:l.string().trim().min(1).max(300).optional(),prosemirror_json:Tx.optional(),project_id:l0.nullable().optional()}),eMe=l.object({id:bu,created_at:l.string().datetime()}),tMe=l.object({title:l.string().trim().min(1).max(300).optional(),prosemirror_json:Tx.optional(),project_id:l0.nullable().optional(),status:d0.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),nMe=l.object({id:bu,updated_at:l.string().datetime()}),rMe=l.object({id:bu,title:l.string().min(1),prosemirror_json:Tx,status:d0,author:W7,project:K7.nullable(),created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable()}),Q7=K1e.router({listDocs:{method:"GET",path:"/docs",headers:l.object({authorization:l.string().min(1).optional()}),query:X1e,responses:{200:J1e,401:mn,403:mn},summary:"List docs in the authenticated user\u2019s organization. Optional project_id filter scopes to a single project."},createDoc:{method:"POST",path:"/docs",headers:l.object({authorization:l.string().min(1).optional()}),body:Z1e,responses:{201:eMe,401:mn,403:mn,404:mn,422:mn},summary:"Create a doc. If project_id is provided, the doc is scoped to that project; otherwise it lives at the workspace level."},getDoc:{method:"GET",path:"/docs/:docId",pathParams:l.object({docId:bu}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:rMe,401:mn,403:mn,404:mn},summary:"Get a doc by id with its rich-text body and parent project (if any)"},updateDoc:{method:"PATCH",path:"/docs/:docId",pathParams:l.object({docId:bu}),headers:l.object({authorization:l.string().min(1).optional()}),body:tMe,responses:{200:nMe,401:mn,403:mn,404:mn,422:mn},summary:"Update a doc. If prosemirror_json changes, the server re-syncs lore.mention_references from mention nodes."},deleteDoc:{method:"DELETE",path:"/docs/:docId",pathParams:l.object({docId:bu}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.object({}),401:mn,403:mn,404:mn},summary:"Hard-delete a doc and any mention references it owns"}});var oMe=Ur(),at=l.object({message:l.string()}),Sx=l.record(l.unknown()),qo=l.string().regex(/^proj_[0-9A-Za-z]{22}$/),sMe=["active","archived"],p0=l.enum(sMe),Ax=l.object({id:l.string().min(1),display_name:l.string().min(1)}),J7=l.object({thread_id:l.string().min(1),title:l.string().min(1),added_at:l.string().datetime(),added_by:Ax}),iMe=l.object({id:qo,name:l.string().min(1),status:p0,author:Ax,thread_count:l.number().int().nonnegative(),doc_count:l.number().int().nonnegative(),created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable()}),aMe=l.object({type:l.literal("list"),list_type:l.literal("project"),objects:l.array(iMe)}),uMe=l.object({status:p0.optional()}),cMe=l.object({name:l.string().trim().min(1).max(200),prosemirror_json:Sx.optional()}),lMe=l.object({id:qo,created_at:l.string().datetime()}),dMe=l.object({name:l.string().trim().min(1).max(200).optional(),prosemirror_json:Sx.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),pMe=l.object({id:qo,updated_at:l.string().datetime()}),fMe=l.object({archived:l.boolean()}),mMe=l.object({id:qo,status:p0,archived_at:l.string().datetime().nullable()}),_Me=l.object({id:qo,name:l.string().min(1),prosemirror_json:Sx,status:p0,author:Ax,created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable(),threads:l.array(J7),docs:l.array(Ex)}),hMe=l.object({thread_id:l.string().min(1).max(64)}),gMe=J7,X7=oMe.router({listProjects:{method:"GET",path:"/projects",headers:l.object({authorization:l.string().min(1).optional()}),query:uMe,responses:{200:aMe,401:at},summary:"List projects in the authenticated user\u2019s organization"},createProject:{method:"POST",path:"/projects",headers:l.object({authorization:l.string().min(1).optional()}),body:cMe,responses:{201:lMe,401:at,422:at},summary:"Create a new project in the authenticated user\u2019s organization"},getProject:{method:"GET",path:"/projects/:projectId",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:_Me,401:at,403:at,404:at},summary:"Get a project with its attached threads and child docs. The project description is the canonical mention source for project-scoped @-mentions."},updateProject:{method:"PATCH",path:"/projects/:projectId",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),body:dMe,responses:{200:pMe,401:at,403:at,404:at,422:at},summary:"Update a project\u2019s name or rich-text body. Body changes re-sync mention_references for source_kind=project."},archiveProject:{method:"POST",path:"/projects/:projectId/archive",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),body:fMe,responses:{200:mMe,401:at,403:at,404:at},summary:"Archive (soft-delete) or unarchive a project"},addProjectThread:{method:"POST",path:"/projects/:projectId/threads",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),body:hMe,responses:{201:gMe,401:at,403:at,404:at,409:at,422:at},summary:"Pin an existing visible thread to this project. Idempotent \u2014 re-adding returns the existing membership."},removeProjectThread:{method:"DELETE",path:"/projects/:projectId/threads/:threadId",pathParams:l.object({projectId:qo,threadId:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.object({}),401:at,403:at,404:at},summary:"Remove a thread membership from a project"}});c();var TMe=Ur(),f0=l.object({message:l.string()}),EMe=["thread","plan","doc","user"],m0=l.enum(EMe),SMe=["doc","project"],AMe=l.enum(SMe),yMe=l.object({kind:m0,id:l.string().min(1),title:l.string().min(1),href:l.string().min(1)}),bMe=l.object({type:l.literal("list"),list_type:l.literal("mention"),objects:l.array(yMe)}),RMe=l.object({q:l.string().trim().min(1).max(50),kinds:l.string().optional().transform(t=>{if(!t)return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}).pipe(l.array(m0).optional())}),IMe=l.object({source_kind:AMe,source_id:l.string().min(1),source_title:l.string().min(1),source_href:l.string().min(1),target_kind:m0,target_id:l.string().min(1),created_at:l.string().datetime()}),OMe=l.object({type:l.literal("list"),list_type:l.literal("backlink"),objects:l.array(IMe)}),CMe=l.object({target_kind:m0,target_id:l.string().min(1).max(64)}),Z7=TMe.router({searchMentions:{method:"GET",path:"/mentions/search",headers:l.object({authorization:l.string().min(1).optional()}),query:RMe,responses:{200:bMe,401:f0,422:f0},summary:"Search threads, plans, files, and users by title/name for @-mention typeahead. Org-scoped, max 10 results across all kinds."},listBacklinks:{method:"GET",path:"/mentions/backlinks",headers:l.object({authorization:l.string().min(1).optional()}),query:CMe,responses:{200:OMe,401:f0,403:f0},summary:"List every doc/project body in the caller\u2019s organization that mentions the given target. Newest-first."}});c();var NMe=Ur(),xMe=l.object({type:l.literal("list"),list_type:l.literal("thread"),has_more:l.boolean(),objects:l.array(l.unknown())}),Bt=l.object({message:l.string()}),eW=l.object({thread_id:l.string().min(1),is_favorited:l.boolean(),favorited_at:l.string().datetime().nullable()}),PMe=l.object({before:l.string().min(1).max(64).optional()}),MMe=l.object({id:l.string().min(1),display_name:l.string().min(1)}),vMe=l.object({block_id:l.string().min(1),thread_id:l.string().min(1),thread_title:l.string(),thread_visibility:l.enum(["private","workspace","public"]),author:MMe,preview:l.string(),prompted_at:l.string().datetime().nullable(),favorited_at:l.string().datetime()}),kMe=l.object({type:l.literal("list"),list_type:l.literal("favorite_prompt"),has_more:l.boolean(),objects:l.array(vMe)}),tW=l.object({block_id:l.string().min(1),thread_id:l.string().min(1).nullable(),is_favorited:l.boolean(),favorited_at:l.string().datetime().nullable()}),wMe=l.object({before:l.string().min(1).max(64).optional()}),LMe=l.object({block_ids:l.array(l.string().min(1))}),nW=NMe.router({addThreadFavorite:{method:"POST",path:"/threads/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{201:eW,401:Bt,403:Bt,404:Bt},summary:"Bookmark a thread for the authenticated user. Idempotent \u2014 re-favoriting returns the existing membership."},removeThreadFavorite:{method:"DELETE",path:"/threads/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:eW,401:Bt,403:Bt,404:Bt},summary:"Remove a thread bookmark for the authenticated user (no-op if absent)."},listFavoriteThreads:{method:"GET",path:"/favorites/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:PMe,responses:{200:xMe,401:Bt,403:Bt},summary:"List threads the authenticated user has favorited, newest favorited first. Visibility filtering still applies \u2014 a thread the viewer can no longer see (e.g. visibility downgraded) is omitted from the list."},addPromptFavorite:{method:"POST",path:"/thread-blocks/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{201:tW,401:Bt,403:Bt,404:Bt,409:Bt},summary:'Bookmark a single user prompt (a thread_blocks row with type="user") for the authenticated user. Idempotent.'},removePromptFavorite:{method:"DELETE",path:"/thread-blocks/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:tW,401:Bt,404:Bt},summary:"Remove a prompt bookmark for the authenticated user (no-op if absent)."},listFavoritePrompts:{method:"GET",path:"/favorites/prompts",headers:l.object({authorization:l.string().min(1).optional()}),query:wMe,responses:{200:kMe,401:Bt},summary:"List the user's favorited prompts, newest first. Prompts whose parent thread the viewer can no longer see (visibility downgraded) are filtered out at read time."},listFavoritedBlockIdsInThread:{method:"GET",path:"/threads/:id/favorited-blocks",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:LMe,401:Bt,403:Bt,404:Bt},summary:"Returns the set of thread_block ids the authenticated viewer has favorited within a single thread, used to bootstrap per-prompt star state on the SessionView."}});c();var DMe=Ur(),rW=l.object({message:l.string()}),UMe=l.object({id:l.string().min(1),title:l.string(),href:l.string().min(1),author_display_name:l.string().nullable(),author_handle:l.string().nullable()}),BMe=l.object({name:l.string().min(1),usage_count:l.number().int().nonnegative(),href:l.string().min(1)}),FMe=l.object({id:l.string().min(1),display_name:l.string(),handle:l.string().nullable(),avatar_url:l.string().nullable(),href:l.string().min(1)}),GMe=l.object({type:l.literal("global_search"),threads:l.array(UMe),skills:l.array(BMe),people:l.array(FMe)}),jMe=l.object({q:l.string().trim().min(1).max(80)}),oW=DMe.router({globalSearch:{method:"GET",path:"/search",headers:l.object({authorization:l.string().min(1).optional()}),query:jMe,responses:{200:GMe,401:rW,422:rW},summary:"Global navbar search. Threads and people are searched globally (subject to thread visibility); skills are scoped to the viewer workspace. Max 5 results per kind."}});var HMe=Ur(),VMe=["gmail.com","googlemail.com","hotmail.com","outlook.com","live.com","msn.com","yahoo.com","ymail.com","rocketmail.com","icloud.com","me.com","mac.com","aol.com","proton.me","protonmail.com","pm.me","tutanota.com","tuta.io","fastmail.com","hey.com","mail.com","gmx.com","gmx.net","zoho.com","zohomail.com","hushmail.com","lycos.com","inbox.com","yandex.com","yandex.ru","mail.ru","inbox.ru","bk.ru","list.ru","rambler.ru","qq.com","163.com","126.com","yeah.net","sina.com","naver.com","daum.net","hanmail.net","kakao.com","rediffmail.com","comcast.net","verizon.net","att.net","sbcglobal.net","bellsouth.net","earthlink.net","charter.net","cox.net","roadrunner.com","spectrum.net","btinternet.com","virginmedia.com","sky.com","orange.fr","wanadoo.fr","free.fr","laposte.net","web.de","t-online.de","gmx.de","libero.it","virgilio.it","alice.it","seznam.cz","centrum.cz","wp.pl","interia.pl","o2.pl","onet.pl"],hgt=new Set(VMe);var qMe=l.object({id:l.string().uuid(),role:l.enum(["user","assistant"]),content:l.string().min(1),timestamp:l.string().datetime()}),$Me=l.object({id:l.string().uuid(),title:l.string().min(1),author:l.string().min(1),authorAvatar:l.string().min(1).max(4),model:l.string().min(1),turnCount:l.number().int().nonnegative(),createdAt:l.string().datetime(),preview:l.string()}),ggt=$Me.extend({messages:l.array(qMe)}),y=l.object({message:l.string()}),zMe=/^[a-zA-Z0-9_-]{2,32}$/,pW=l.string().regex(zMe,"Handle must be 2\u201332 characters: letters, numbers, dashes, or underscores."),yx=l.object({id:l.string(),first_name:l.string().min(1),last_name:l.string().min(1),display_name:l.string().min(1),stytch_id:l.string().nullable(),handle:l.string().nullable(),bio:l.string().max(280).nullable(),avatar_url:l.string().nullable(),banner_url:l.string().nullable(),share_new_threads_to_workspace:l.boolean(),experimental_features_enabled:l.boolean(),onboarded_at:l.string().nullable()}),YMe=l.object({authProviderUserId:l.string().min(1).optional(),organizationId:l.string().min(1).optional(),org_name:l.string().min(1).optional(),organizations:l.array(l.object({id:l.string().min(1),name:l.string().min(1)})),emailAddress:l.string().email(),name:l.string().nullable(),user:yx,is_admin:l.boolean()}),WMe=l.object({workos_client_id:l.string().min(1),workos_api_origin:l.string().url()}),KMe=l.object({share_new_threads_to_workspace:l.boolean().optional(),experimental_features_enabled:l.boolean().optional(),onboarded_at:l.union([l.literal("now"),l.null()]).optional(),display_name:l.string().min(1).max(120).optional(),handle:pW.optional(),bio:l.string().max(280).nullable().optional(),avatar_storage_url:l.string().min(1).nullable().optional(),banner_storage_url:l.string().min(1).nullable().optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),QMe=l.object({id:l.string(),display_name:l.string(),handle:l.string().nullable(),avatar_url:l.string().nullable(),visible_thread_count:l.number().int().nonnegative(),last_active_at:l.string().datetime().nullable()}),fW=l.object({id:l.string().min(1),display_name:l.string().min(1),handle:l.string().nullable(),bio:l.string().max(280).nullable(),avatar_url:l.string().nullable(),banner_url:l.string().nullable(),organization_name:l.string().min(1).nullable(),created_at:l.string().min(1),visible_thread_count:l.number().int().nonnegative(),follower_count:l.number().int().nonnegative(),following_count:l.number().int().nonnegative(),published_project_count:l.number().int().nonnegative(),is_following:l.boolean(),is_self:l.boolean()}),JMe=l.object({type:l.literal("list"),list_type:l.literal("organization_member"),objects:l.array(QMe)}),XMe=l.object({email_address:l.string().email()}),ZMe=l.object({email_address:l.string().email(),invitation_id:l.string().min(1)}),eve=l.object({organization_id:l.string().min(1),organization_name:l.string().min(1),domain:l.string().min(1),created:l.boolean()}),tve=l.object({location:l.string().trim().min(1),contact:l.string().trim().email()}),nve=l.object({location:l.string().min(1),contact:l.string().email(),created_at:l.string().datetime()}),rve=l.object({first_name:l.string().min(1),last_name:l.string().min(1),display_name:l.string().min(1),stytch_id:l.string().min(1).optional()}),ove=l.object({name:l.string().min(1),email_domains:l.array(l.string().min(1)).nonempty(),stytch_org_id:l.string().min(1)}),sve=l.object({user:rve,organization:ove}),ive=l.object({path_glob:l.string().min(1),name:l.string().min(1),description:l.string().min(1)}),ave=l.object({repo_origin_path:l.string().min(1),building_blocks:l.array(ive)}),mW=l.string().regex(/^th_[0-9A-Za-z]{22}$/),h0=l.string().regex(/^tb_[0-9A-Za-z]{22}$/),uve=l.object({id:mW,author:l.object({id:l.string().min(1),display_name:l.string().min(1)}),body:l.string(),created_at:l.string().datetime(),repo_origin_path:l.string().min(1),latest_revision_id:h0,revision_count:l.number().int().positive()}),cve=l.object({id:l.string().min(1),display_name:l.string().min(1)}),lve=l.object({id:l.string().min(1),author_id:l.string().min(1).nullable(),author:cve.nullable(),created_at:l.string().datetime(),deleted_at:l.string().datetime().nullable(),content:l.string().min(1)}),dve=l.object({id:l.string().min(1),thread_block_id:l.string().min(1),created_at:l.string().datetime(),resolved_at:l.string().datetime().nullable(),comments:l.array(lve)}),pve=l.object({thread_block_id:h0,from_position:l.number().int().positive(),to_position:l.number().int().positive(),selected_text:l.string().min(1),content:l.string().trim().min(1)}),fve=l.object({id:l.string().min(1)}),mve=l.object({content:l.string().trim().min(1)}),_ve=l.object({id:l.string().min(1)}),hve=l.object({content:l.string().trim().min(1)}),gve=l.object({id:l.string().min(1)}),Tve=l.object({content:l.string().trim().min(1)}),Eve=l.object({id:l.string().min(1)}),Sve=l.object({resolved:l.boolean()}),Ave=l.object({id:l.string().min(1),resolved_at:l.string().datetime().nullable()}),yve=l.object({resolved:l.boolean()}),bve=l.object({id:l.string().min(1),resolved_at:l.string().datetime().nullable()}),_W=l.record(l.unknown()),Rve=l.object({id:h0,body:l.string(),created_at:l.string().datetime(),prosemirror_json:_W,comment_threads:l.array(dve)}),Ive=l.object({id:mW,created_at:l.string().datetime(),repo_origin_path:l.string().min(1),author:l.object({id:l.string().min(1),display_name:l.string().min(1)}),latest_revision_id:h0,revision_count:l.number().int().positive(),revisions:l.array(Rve)}),Ove=l.object({type:l.literal("list"),list_type:l.literal("plan"),has_more:l.boolean(),objects:l.array(uve)}),Cve=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional(),author_id:l.string().min(1).optional(),repo_origin_path:l.string().min(1).optional()}),hW=l.object({id:l.string().min(1),organization_id:l.string().min(1),created_at:l.string().min(1),repo_origin_path:l.string().min(1),path_glob:l.string().min(1),name:l.string().min(1),description:l.string().min(1)}),Nve=l.array(hW),xve=l.object({type:l.literal("list"),list_type:l.literal("building_block"),has_more:l.boolean(),objects:l.array(hW)}),Pve=l.object({repo_origin_path:l.string().min(1),before:l.string().min(1).optional(),after:l.string().min(1).optional()}),Mve=l.enum(["thread","building_block"]),vve=l.object({repo_origin_path:l.string().min(1),sources:l.array(Mve).nonempty()}),kve=l.object({type:l.literal("list"),list_type:l.literal("repository"),has_more:l.boolean(),objects:l.array(vve)}),$o=l.enum(["claudeCode","codex","amp","cursor","cowork","unspecified"]),wve=l.object({uploads:l.array(l.string()),outputs:l.array(l.string())}),Lve=l.object({connected:l.boolean(),last_upload_at:l.string().nullable(),harnesses:l.array($o)}),Dve=["transcript","plan"],Uve=l.enum(Dve),Bve=l.object({md5:l.string().min(1),harness:$o,filename:l.string().min(1).optional(),repo_origin_path:l.string().min(1).optional(),harness_internal_id:l.string().min(1).optional(),file_type:Uve.optional(),remix_of_thread_id:l.string().min(1).optional(),artifact_metadata:wve.optional()}).refine(t=>(t.filename?.trim().length??0)>0||(t.harness_internal_id?.trim().length??0)>0,{path:["harness_internal_id"],message:"filename or harness_internal_id is required"}),Rx=l.object({id:l.string().min(1),display_name:l.string().min(1),avatar_url:l.string().nullable()}),Fve=l.object({id:l.string().min(1),display_name:l.string().min(1)}),gW=l.object({id:l.string().min(1),author_id:l.string().min(1).nullable(),author:Fve.nullable(),created_at:l.string().datetime(),deleted_at:l.string().datetime().nullable(),content:l.string().min(1)}),TW=l.object({id:l.string().min(1),thread_block_id:l.string().min(1),created_at:l.string().datetime(),resolved_at:l.string().datetime().nullable()}),Gve=TW.extend({comments:l.array(gW)}),im=l.object({id:l.string().min(1),type:l.string().min(1),index_in_thread:l.number().int().nonnegative(),isCritiqued:l.boolean(),comment_threads:l.array(Gve).optional()}).passthrough(),EW=l.object({type:l.literal("list"),list_type:l.literal("thread_block"),has_more:l.boolean(),objects:l.array(im)}),sW=im.extend({type:l.literal("plan"),prosemirror_json:_W,thread_file_id:l.string().min(1)}),jve=l.union([l.literal(-1),l.literal(1)]),SW=l.union([l.literal(-1),l.literal(0),l.literal(1)]),iW=l.object({score:l.number().int(),up_count:l.number().int().nonnegative(),down_count:l.number().int().nonnegative(),viewer_vote:SW}),Hve=l.object({value:jve}),Vve=l.object({id:l.string().min(1),display_name:l.string().min(1),avatar_url:l.string().nullable()}),Ru=l.object({id:l.string().min(1),thread_id:l.string().min(1),author_id:l.string().min(1).nullable(),author:Vve.nullable(),parent_comment_id:l.string().min(1).nullable(),content:l.string(),created_at:l.string().datetime(),updated_at:l.string().datetime(),deleted_at:l.string().datetime().nullable()}),qve=l.object({type:l.literal("list"),list_type:l.literal("thread_comment"),objects:l.array(Ru)}),$ve=l.object({content:l.string().trim().min(1).max(4e3),parent_comment_id:l.string().min(1).optional()}),zve=Ru,Yve=l.object({content:l.string().trim().min(1).max(4e3)}),Wve=Ru,Kve=Ru,Tgt=l.discriminatedUnion("kind",[l.object({kind:l.literal("created"),thread_id:l.string().min(1),actor_user_id:l.string().min(1),version:l.number(),comment:Ru}),l.object({kind:l.literal("updated"),thread_id:l.string().min(1),actor_user_id:l.string().min(1),version:l.number(),comment:Ru}),l.object({kind:l.literal("deleted"),thread_id:l.string().min(1),actor_user_id:l.string().min(1),version:l.number(),comment:Ru})]),Qve=l.enum(["pending","generating","ready","failed"]),Jve=l.enum(["pending","generating","ready","failed"]),Xve=l.enum(["pending","placeholder","ai","user"]),AW=l.enum(["pending","generating","ready","failed"]),Ix=l.enum(["pending","generating","ready","failed","disabled"]),yW=l.enum(["pending","generating","ready","failed"]),Zve=l.object({title:l.string().min(1),body:l.string().min(1),files:l.array(l.string()).optional()}),eke=l.object({status:Ix,url:l.string().nullable(),url_expires_at:l.string().nullable(),generated_at:l.string().nullable(),model:l.string().nullable()}),tke=l.object({status:yW,steps:l.array(Zve),generated_at:l.string().nullable()}),nke=l.object({remix_of_thread_id:l.string().nullable(),remix_count:l.number().int().nonnegative()}),rke=l.object({cover:eke,how_to:tke,lineage:nke}),oke=l.object({id:l.string().min(1),title:l.string().min(1),author:l.object({id:l.string().min(1),display_name:l.string(),handle:l.string().nullable(),avatar_url:l.string().nullable()}),cover:l.object({url:l.string(),url_expires_at:l.string()}),remix_count:l.number().int().nonnegative(),started_at:l.string(),cover_generated_at:l.string()}),ske=l.object({type:l.literal("list"),list_type:l.literal("card_feed_item"),has_more:l.boolean(),objects:l.array(oke)}),bW=l.enum(["asked","requested","decided","corrected","shared"]),ike=l.object({id:l.string().min(1),kind:bW,summary:l.string().min(1),block_id:l.string().min(1)}),ake=l.object({type:l.literal("list"),list_type:l.literal("thread_decision"),status:AW,generated_at:l.string().nullable(),objects:l.array(ike)}),uke=l.object({thread_id:l.string().min(1),source_url:l.string().min(1),title:l.string().min(1),summary:l.string().nullable(),harness:$o,visibility:l.enum(["private","workspace","public"]),started_at:l.string().min(1),author:l.object({display_name:l.string().min(1),handle:l.string().nullable()}),original_user_prompt:l.string().nullable(),last_assistant_message:l.string().nullable(),decisions:l.array(l.object({kind:bW,summary:l.string().min(1)})),files_touched:l.array(l.string()),truncated:l.boolean()}),cd=l.object({id:l.string().min(1),thread_file_id:l.string().min(1),organization_id:l.string().min(1),author:Rx,repo:l.string().min(1),title:l.string().min(1),started_at:l.string().min(1),blocks:EW,user_message_count:l.number().int().nonnegative(),files_touched:l.array(l.string()),skills_invoked:l.array(l.string()),harness:$o,transcript_parsing_state:l.enum(["pending","parsed","too_large_to_parse"]),visibility:l.enum(["private","workspace","public"]),has_plan:l.boolean().optional(),summary:l.string().nullable(),summary_status:Qve,summary_generated_at:l.string().nullable(),title_status:Jve,title_generated_at:l.string().nullable(),title_source:Xve,decisions_status:AW,decisions_generated_at:l.string().nullable(),score:l.number().int(),up_count:l.number().int().nonnegative(),down_count:l.number().int().nonnegative(),viewer_vote:SW,comment_count:l.number().int().nonnegative(),is_favorited:l.boolean(),card:rke}),cke=l.object({storage_url:l.string().min(1)}),lke=l.object({storage_url:l.string(),harness:$o,thread:cd.nullable()}),dke=l.object({status:l.literal("complete"),thread_files:l.array(lke)}),pke=l.object({id:l.string(),presigned_url:l.string().nullable(),presigned_url_expires_at:l.string().nullable(),storage_url:l.string(),harness:$o,expected_md5:l.string(),error:l.string().nullable(),thread:cd.nullable(),remix_parent_dropped:l.boolean().optional()}),fke=l.object({id:l.string(),substrate:l.enum(["s3","filesystem"]),status:l.enum(["incomplete","locked_for_parsing","complete","error"]),thread_files:l.array(pke)}),mke=l.object({visibility:l.enum(["private","workspace","public"]).optional(),title:l.string().trim().min(1).max(200).optional()}).refine(t=>t.visibility!==void 0||t.title!==void 0,{message:"At least one of visibility or title must be provided"}),_ke=l.discriminatedUnion("visibility",[l.object({visibility:l.literal("private")}),l.object({visibility:l.literal("workspace")}),l.object({visibility:l.literal("public"),title:l.string().min(1),author_display_name:l.string().min(1),author_avatar_url:l.string().nullable(),first_user_message:l.string().nullable(),summary:l.string().nullable(),started_at:l.string().min(1),harness:$o,cover_url:l.string().nullable()})]),hke=cd,aW=l.object({type:l.literal("list"),list_type:l.literal("thread"),has_more:l.boolean(),objects:l.array(hke)}),gke=l.enum(["recent","popular"]),Tke=l.enum(["everyone","following"]),Eke=cd,Ske=l.object({type:l.literal("list"),list_type:l.literal("discover_thread"),has_more:l.boolean(),objects:l.array(Eke)}),Ake=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional(),sort:gke.optional(),scope:Tke.optional(),harness:$o.optional(),search:l.string().max(200).optional()}),yke=l.object({thread_count:l.number().int().nonnegative(),author_count:l.number().int().nonnegative(),organization_count:l.number().int().nonnegative(),harness_breakdown:l.record($o,l.number().int().nonnegative())}),bke=l.object({id:l.string(),status:l.enum(["incomplete","locked_for_parsing","complete","error"]),created_at:l.string(),thread_count:l.number().int().nonnegative()}),Rke=l.object({type:l.literal("list"),list_type:l.literal("upload_session"),objects:l.array(bke)}),Ike=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional()}),Oke=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional(),author_ids:l.string().min(1).optional(),created_at:l.string().min(1).optional(),filepath_prefixes:l.string().min(1).optional()}),Cke=l.object({path:l.string().min(1),start_offset:l.number().int().nonnegative(),end_offset:l.number().int().positive()}),Ox=l.enum(["captured","published"]),Nke=l.enum(["workspace","link"]),RW=l.object({id:l.string(),display_name:l.string(),avatar_url:l.string().nullable()}),xke=l.object({name:l.string(),usage_count:l.number().int().nonnegative(),author_count:l.number().int().nonnegative(),first_used_at:l.string().nullable(),last_used_at:l.string().nullable(),usage_count_last_24h:l.number().int().nonnegative(),usage_count_last_7d:l.number().int().nonnegative(),id:l.string().nullable(),description:l.string().nullable(),source:Ox.nullable(),has_content:l.boolean()}),Pke=l.object({type:l.literal("list"),list_type:l.literal("skill"),objects:l.array(xke)}),Mke=l.object({id:l.string(),title:l.string(),visibility:l.enum(["private","workspace","public"]),started_at:l.string(),author:Rx,skills_invoked:l.array(l.string())}),vke=l.object({id:l.string().nullable(),name:l.string(),description:l.string().nullable(),body_md:l.string().nullable(),source:Ox.nullable(),visibility:Nke.nullable(),share_url:l.string().nullable(),latest_version:l.number().int().nonnegative().nullable(),author:RW.nullable(),usage_count:l.number().int().nonnegative(),author_count:l.number().int().nonnegative(),first_used_at:l.string().nullable(),last_used_at:l.string().nullable(),threads:l.array(Mke)}),kke=l.object({description:l.string().nullable().optional(),body_md:l.string().min(1),display_name:l.string().nullable().optional(),published:l.boolean().optional()}),wke=l.object({id:l.string(),name:l.string(),latest_version:l.number().int().positive(),source:Ox,content_hash:l.string()}),Lke=l.object({share_url:l.string(),share_token:l.string()}),Dke=l.object({id:l.string(),name:l.string(),description:l.string().nullable(),body_md:l.string(),latest_version:l.number().int().positive(),author:RW.nullable(),shared_at:l.string()}),Uke=l.object({path:l.string().min(1),text:l.string().max(64e3)}),Bke=l.enum(["text_edit","redact","delete_block"]),Fke=l.object({id:l.string(),thread_block_id:l.string(),editor:l.object({id:l.string(),display_name:l.string()}),kind:Bke,path:l.string().nullable(),previous_text:l.string().nullable(),new_text:l.string().nullable(),created_at:l.string()}),Gke=l.object({type:l.literal("list"),list_type:l.literal("thread_block_edit"),objects:l.array(Fke)}),jke=l.object({organization_count:l.number().int().nonnegative(),user_count:l.number().int().nonnegative(),thread_count:l.number().int().nonnegative(),thread_count_last_24h:l.number().int().nonnegative(),user_count_last_24h:l.number().int().nonnegative()}),Hke=l.object({id:l.string(),name:l.string(),email_domains:l.array(l.string()),stytch_org_id:l.string(),member_count:l.number().int().nonnegative(),thread_count:l.number().int().nonnegative(),default_thread_visibility:l.enum(["private","workspace","public"]),created_at:l.string()}),Vke=l.object({type:l.literal("list"),list_type:l.literal("admin_organization"),objects:l.array(Hke)}),IW=l.object({id:l.string(),name:l.string()}),qke=l.object({id:l.string(),display_name:l.string(),stytch_id:l.string().nullable(),thread_count:l.number().int().nonnegative(),onboarded_at:l.string().nullable(),created_at:l.string(),organizations:l.array(IW)}),$ke=l.object({q:l.string().trim().min(1).max(120).optional()}),zke=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1)}),Yke=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1),is_following:l.literal(!0)}),Wke=l.object({type:l.literal("list"),list_type:l.literal("admin_user"),objects:l.array(qke)}),Kke=l.object({id:l.string(),title:l.string(),started_at:l.string(),created_at:l.string(),deleted_at:l.string().nullable(),visibility:l.enum(["private","workspace","public"]),harness:$o,author:Rx,organization:IW}),Qke=l.object({type:l.literal("list"),list_type:l.literal("admin_thread"),has_more:l.boolean(),objects:l.array(Kke)}),Jke=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional()}),uW=l.object({token:l.string().min(1),thread_id:l.string().min(1)}),Xke=l.object({visitor:l.string().min(1).max(64).optional()}),Zke=l.object({user_id:l.string(),display_name:l.string(),shares_sent:l.number().int().nonnegative(),unique_viewers:l.number().int().nonnegative(),attributed_signups:l.number().int().nonnegative()}),ewe=l.object({window_days:l.number().int().positive(),shares_sent:l.number().int().nonnegative(),unique_viewers:l.number().int().nonnegative(),attributed_signups:l.number().int().nonnegative(),active_sharers:l.number().int().nonnegative(),k_factor:l.number().nullable(),shares_sent_sparkline:l.array(l.number().int().nonnegative()),top_sharers:l.array(Zke)}),twe=l.object({windows:l.array(ewe)}),nwe=l.object({quoted_text:l.string().min(1),comment:l.string().nullable(),type:l.enum(["comment","highlight:trapdoor"])}),rwe=TW,owe=gW.extend({comment_thread_id:l.string().min(1)}),swe=l.object({markdown:l.string().min(1)}),iwe=l.object({storage_url:l.string().min(1),thread_file_id:l.string().min(1),parsed_plan_block:sW,critiqued_plan_block:sW,annotations:l.array(nwe),comment_threads:l.array(rwe),comments:l.array(owe)}),ld=l.enum(gx),OW=l.object({workspace_scope:l.boolean(),review:l.boolean(),shared_thread_ttl_days:l.number().int().positive().nullable()}),bx=l.object({subject_type:l.enum(["user","organization"]),subject_id:l.string().min(1),effective_plan:ld,admin_override:ld.nullable(),stripe_subscription_status:l.string().nullable(),cancel_at_period_end:l.boolean(),current_period_end:l.string().nullable(),seat_quantity:l.number().int().positive(),member_count:l.number().int().nonnegative().nullable(),features:OW}),awe=l.object({effective_plan:ld,features:OW,user:bx,organization:bx.nullable()}),uwe=l.object({plan:l.enum(["creator","team"]),seat_quantity:l.number().int().positive().optional()}),cwe=l.object({checkout_url:l.string().min(1)}),lwe=l.object({portal_url:l.string().min(1)}),dwe=l.object({seat_quantity:l.number().int().positive()}),cW=l.object({plan:ld.nullable()}),_0=l.object({subject_type:l.enum(["user","organization"]),subject_id:l.string().min(1),label:l.string().min(1),effective_plan:ld,admin_override:ld.nullable(),stripe_subscription_status:l.string().nullable(),seat_quantity:l.number().int().positive()}),pwe=l.object({users:l.array(_0),organizations:l.array(_0)}),fwe=l.object({id:l.string().min(1),display_name:l.string().min(1),handle:l.string().nullable(),avatar_url:l.string().nullable()}),mwe=l.object({thread_id:l.string().min(1),title:l.string().min(1),author:fwe,last_active_at:l.string().datetime(),last_block_excerpt:l.string().nullable(),last_block_kind:l.string().min(1).nullable(),is_streaming:l.boolean()}),_we=l.object({type:l.literal("list"),list_type:l.literal("live_thread"),objects:l.array(mwe)}),hwe=l.object({thread_id:l.string().min(1)}),gwe=l.object({thread_id:l.string().min(1),last_seen_at:l.string().datetime(),started_at:l.string().datetime()}),Twe=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1),is_following:l.literal(!0),follower_count:l.number().int().nonnegative()}),Ewe=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1),is_following:l.literal(!1),follower_count:l.number().int().nonnegative()}),CW=l.object({id:l.string().min(1),display_name:l.string().min(1),handle:l.string().nullable(),avatar_url:l.string().nullable(),bio:l.string().max(280).nullable(),is_following:l.boolean(),is_self:l.boolean()}),lW=l.object({type:l.literal("list"),list_type:l.literal("user_follow"),objects:l.array(CW)}),Swe=l.object({date:l.string().regex(/^\d{4}-\d{2}-\d{2}$/),count:l.number().int().nonnegative()}),Awe=l.object({window_start:l.string().datetime(),window_end:l.string().datetime(),total_contributions:l.number().int().nonnegative(),days_active:l.number().int().nonnegative(),daily_average:l.number().nonnegative(),current_streak_days:l.number().int().nonnegative(),days:l.array(Swe)}),ywe=l.object({type:l.literal("thread_created"),occurred_at:l.string().datetime(),id:l.string().min(1),thread:l.object({id:l.string().min(1),title:l.string(),visibility:l.enum(["private","workspace","public"])})}),bwe=l.object({type:l.literal("comment_posted"),occurred_at:l.string().datetime(),id:l.string().min(1),comment_excerpt:l.string(),thread:l.object({id:l.string().min(1),title:l.string(),visibility:l.enum(["private","workspace","public"])})}),Rwe=l.object({type:l.literal("project_published"),occurred_at:l.string().datetime(),id:l.string().min(1),project:l.object({id:l.string().min(1),name:l.string().min(1)})}),Iwe=l.object({type:l.literal("user_followed"),occurred_at:l.string().datetime(),id:l.string().min(1),followee:CW}),Owe=l.discriminatedUnion("type",[ywe,bwe,Rwe,Iwe]),Cwe=l.object({type:l.literal("list"),list_type:l.literal("user_activity"),objects:l.array(Owe)}),Nwe=l.object({id:l.string().min(1),name:l.string().min(1),excerpt:l.string(),published_at:l.string().datetime(),updated_at:l.string().datetime()}),xwe=l.object({type:l.literal("list"),list_type:l.literal("profile_published_project"),objects:l.array(Nwe)}),dW=l.object({id:l.string().min(1),published_at:l.string().datetime().nullable()}),Pwe=l.enum(["avatar","banner"]),NW=l.enum(["image/png","image/jpeg","image/webp","image/gif"]),Mwe=l.object({kind:Pwe,content_type:NW,base64_data:l.string().min(1)}),vwe=l.object({substrate:l.enum(["s3","filesystem"]),storage_url:l.string().min(1)}),kwe=l.object({content_type:NW,base64_data:l.string().min(1)}),wwe=l.object({cover_status:Ix,cover_url:l.string().min(1),cover_url_expires_at:l.string().min(1),cover_generated_at:l.string().min(1)}),Lwe=fW,xW=HMe.router({health:{method:"GET",path:"/health",responses:{200:l.object({status:l.literal("ok")})},summary:"Health check"},whoAmI:{method:"GET",path:"/whoami",headers:l.object({authorization:l.string().min(1).optional(),"x-lore-referral-token":l.string().min(1).max(16).optional()}),responses:{200:YMe,401:y},summary:"Validate a WorkOS Bearer token and return member plus user fields"},getCliAuthConfig:{method:"GET",path:"/cli-auth/config",responses:{200:WMe,503:y},summary:"Return public WorkOS CLI Auth configuration for the Lore CLI"},getCliStatus:{method:"GET",path:"/users/me/cli-status",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Lve,401:y},summary:"Return whether the viewer has connected the Lore CLI (i.e., uploaded any thread under a non-unspecified harness), plus the latest upload timestamp."},recordHeartbeat:{method:"POST",path:"/heartbeat",headers:l.object({authorization:l.string().min(1).optional()}),body:hwe,responses:{200:gwe,401:y,403:y,404:y,422:y},summary:"Record (or refresh) a presence heartbeat for the authenticated user against one of their own threads. Idempotent; the daemon should call this every ~30s while a session is open."},listLiveThreads:{method:"GET",path:"/threads/live",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:_we,401:y,403:y},summary:"List members with user-block activity in the last 10 minutes. Org-scoped, deduped per author, max 10."},listThreads:{method:"GET",path:"/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:Oke,responses:{200:aW,401:y},summary:"List threads visible to the authenticated user"},getThread:{method:"GET",path:"/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:cd,404:y},summary:"Load a visible thread by id"},getSimilarThreads:{method:"GET",path:"/threads/:id/similar",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:aW,404:y,409:y},summary:"List the top 20 visible threads with the closest summary embedding"},getThreadRemixBrief:{method:"GET",path:"/threads/:id/remix",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:uke,401:y,403:y,404:y},summary:"Fetch a portable handoff brief that lets another agent continue this thread"},listThreadBlocks:{method:"GET",path:"/threads/:id/blocks",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),query:Ike,responses:{200:EW,401:y},summary:"List blocks for a visible thread"},createThreadBlockCommentThread:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:mve,responses:{201:_ve,401:y,404:y},summary:"Create a new block-level comment thread on a visible thread block"},createThreadBlockComment:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId/comments",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1),commentThreadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Tve,responses:{201:Eve,401:y,404:y,409:y},summary:"Reply to a block-level comment thread on a visible thread block"},updateThreadBlockCommentThread:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1),commentThreadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:yve,responses:{200:bve,401:y,404:y},summary:"Resolve or reopen a block-level comment thread on a visible thread block"},listSkills:{method:"GET",path:"/skills",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Pke,401:y},summary:"Aggregate skill usage across threads the viewer can see"},getSkillDetail:{method:"GET",path:"/skills/:name",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:vke,401:y,404:y},summary:"Per-skill detail: usage stats + visible threads that invoked it"},getSkillRaw:{method:"GET",path:"/skills/:name/raw",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:l.string(),401:y,403:y,404:y},summary:"Raw SKILL.md body for a skill (download / install path)"},publishSkill:{method:"PUT",path:"/skills/:name",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:kke,responses:{200:wke,401:y,403:y,422:y},summary:"Publish or capture a skill body for the caller\u2019s workspace"},mintSkillShare:{method:"POST",path:"/skills/:name/share",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Lke,401:y,403:y,404:y},summary:"Mint (or rotate) a public share token for a skill"},revokeSkillShare:{method:"DELETE",path:"/skills/:name/share",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{204:l.null(),401:y,403:y,404:y},summary:"Revoke an active share token for a skill"},getSharedSkill:{method:"GET",path:"/shared-skills/:token",pathParams:l.object({token:l.string().min(1)}),responses:{200:Dke,404:y},summary:"Read a shared skill by its public share token (no auth)"},redactThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/redactions",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Cke,responses:{200:im,401:y,403:y,404:y,422:y},summary:"Permanently redact a character range within a text field of a thread block (author only)"},updateThreadBlockText:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/text",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Uke,responses:{200:im,401:y,403:y,404:y,422:y},summary:"Replace a single text leaf in a thread block with new content (author only)"},critiqueThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/critique",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:im,401:y,403:y,404:y,409:y,422:y},summary:"Critique a plan block once and persist its annotations as nested comment threads (author only)"},deleteThreadBlock:{method:"DELETE",path:"/threads/:threadId/blocks/:blockId",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.null(),401:y,403:y,404:y},summary:"Soft-delete a thread block (author only)"},listThreadBlockEdits:{method:"GET",path:"/threads/:threadId/blocks/:blockId/edits",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Gke,401:y,404:y},summary:"List edits made to a thread block (visible to anyone who can see the thread)"},listThreadDecisions:{method:"GET",path:"/threads/:id/decisions",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:ake,401:y,404:y},summary:"List AI-extracted user decisions for a thread, in chronological order"},updateThread:{method:"PATCH",path:"/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:mke,responses:{200:cd,401:y,403:y,404:y},summary:"Update thread visibility (author only)"},deleteThread:{method:"DELETE",path:"/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.null(),401:y,403:y,404:y},summary:"Soft-delete a thread (author only)"},generateThreadCard:{method:"POST",path:"/threads/:id/card/generate",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:l.object({cover_status:Ix,how_to_status:yW}),401:y,403:y,404:y,429:y.extend({retry_after_seconds:l.number().int().nonnegative()})},summary:"Enqueue cover image + how-to recipe generation for the thread. Author-only. Idempotent \u2014 recently-fired statuses are not double-enqueued. Rate-limited: at most one cover generation per minute per thread (cooldown begins when the previous cover finishes). Used to populate cards on legacy threads (created before Lore Cards) and to retry after a 'failed' status or opt back in from 'disabled'."},uploadThreadCover:{method:"POST",path:"/threads/:id/card/cover/upload",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:kwe,responses:{200:wwe,401:y,403:y,404:y,413:y,422:y},summary:"Upload a custom cover image for a thread. Author or Tanagram admin only. Bytes go to the same storage substrate the AI cover uses (S3 in prod, filesystem in dev), and the threads row is updated atomically with the new cover_storage_url, cover_status='ready', cover_generated_at=now, cover_model='user-uploaded' so subsequent re-rolls / how-to fan-outs treat the upload like any other ready cover."},castThreadVote:{method:"PUT",path:"/threads/:id/vote",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Hve,responses:{200:iW,401:y,403:y,404:y,422:y},summary:"Cast or change the caller's up/down vote on a public thread. Idempotent \u2014 re-casting the same value is a no-op."},clearThreadVote:{method:"DELETE",path:"/threads/:id/vote",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:iW,401:y,404:y},summary:"Clear the caller's vote on a thread. No-op when the caller hasn't voted."},listThreadComments:{method:"GET",path:"/threads/:threadId/comments",pathParams:l.object({threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:qve,403:y,404:y},summary:"List all (live + soft-deleted as tombstones) comments on a public thread, flat with parent_comment_id pointers."},createThreadComment:{method:"POST",path:"/threads/:threadId/comments",pathParams:l.object({threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:$ve,responses:{201:zve,401:y,403:y,404:y,422:y},summary:"Post a top-level or reply comment on a public thread."},updateThreadComment:{method:"PATCH",path:"/threads/:threadId/comments/:commentId",pathParams:l.object({threadId:l.string().min(1),commentId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Yve,responses:{200:Wve,401:y,403:y,404:y,422:y},summary:"Edit your own thread comment (author only; rejects edits to soft-deleted rows)."},deleteThreadComment:{method:"DELETE",path:"/threads/:threadId/comments/:commentId",pathParams:l.object({threadId:l.string().min(1),commentId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Kve,401:y,403:y,404:y},summary:"Soft-delete your own thread comment (author only). Idempotent."},getThreadPreview:{method:"GET",path:"/threads/:id/preview",pathParams:l.object({id:l.string().min(1)}),responses:{200:_ke,404:y},summary:"Unauthenticated, visibility-redacted metadata for OG / social preview consumers"},createUser:{method:"POST",path:"/users",headers:l.object({authorization:l.string().min(1).optional()}),body:sve,responses:{201:yx,401:y},summary:"Create a user record with ApiKey authentication"},getUser:{method:"GET",path:"/users/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:fW,404:y},summary:"Public profile for a user. Optional auth \u2014 unauthenticated viewers see only public thread metadata; signed-in viewers see counts scoped to the threads they'd normally be able to access."},updateCurrentUser:{method:"PATCH",path:"/users/me",headers:l.object({authorization:l.string().min(1).optional()}),body:KMe,responses:{200:yx,401:y,409:y,422:y},summary:"Update the authenticated user profile"},getUserByHandle:{method:"GET",path:"/users/by-handle/:handle",pathParams:l.object({handle:pW}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Lwe,404:y},summary:"Resolve a public profile by handle \u2014 same shape as GET /users/:id but keyed on the user's chosen handle."},listUserActivity:{method:"GET",path:"/users/:id/activity",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),query:l.object({limit:l.coerce.number().int().positive().max(100).optional()}),responses:{200:Cwe,404:y},summary:"Reverse-chronological activity feed for a user, scoped to what the viewer can see (same visibility rules as listThreads)."},getUserContributions:{method:"GET",path:"/users/:id/contributions",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Awe,404:y},summary:"Daily contribution counts for the trailing 365 days \u2014 counts thread blocks the user authored on threads visible to the viewer."},listUserFollowers:{method:"GET",path:"/users/:id/followers",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:lW,404:y},summary:"List the users following a given user."},listUserFollowing:{method:"GET",path:"/users/:id/following",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:lW,404:y},summary:"List the users a given user is following."},followUser:{method:"POST",path:"/users/:id/follow",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Twe,401:y,404:y,409:y,422:y},summary:"Follow another user. Idempotent \u2014 repeating the call is a no-op."},unfollowUser:{method:"DELETE",path:"/users/:id/follow",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Ewe,401:y,404:y},summary:"Unfollow a user. Idempotent \u2014 repeating the call is a no-op."},listProfilePublishedProjects:{method:"GET",path:"/users/:id/projects",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:xwe,404:y},summary:"Projects the user has published to their public profile."},publishProject:{method:"POST",path:"/projects/:id/publish",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:dW,401:y,403:y,404:y},summary:"Publish a project to the author's public profile. Stamps published_at with `now()`. Author-only."},unpublishProject:{method:"DELETE",path:"/projects/:id/publish",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:dW,401:y,403:y,404:y},summary:"Remove a project from the author's public profile."},uploadProfileImage:{method:"POST",path:"/users/me/profile-image",headers:l.object({authorization:l.string().min(1).optional()}),body:Mwe,responses:{200:vwe,401:y,413:y,422:y},summary:"Upload an avatar or banner image (base64-encoded JSON body). The API streams the bytes to its configured storage substrate using its own credentials and returns the canonical storage URL the client passes to PATCH /users/me."},listOrganizationMembers:{method:"GET",path:"/organization/members",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:JMe,401:y},summary:"List members of the authenticated user\u2019s organization"},createOrganizationInvite:{method:"POST",path:"/organization/invites",headers:l.object({authorization:l.string().min(1).optional()}),body:XMe,responses:{201:ZMe,401:y,403:y,409:y,422:y},summary:"Invite a teammate to the authenticated user\u2019s workspace via WorkOS AuthKit"},ensureWorkOSOrganization:{method:"POST",path:"/organization/workos/ensure",headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:eve,401:y,422:y,503:y},summary:"Create or reuse a WorkOS organization for the authenticated user\u2019s non-public email domain and add the user as a member."},listRepositories:{method:"GET",path:"/repositories",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:kve,401:y,403:y},summary:"List repositories known to the authenticated user\u2019s organization across threads and building blocks"},createBuildingBlockSnapshots:{method:"POST",path:"/building_blocks",headers:l.object({authorization:l.string().min(1).optional()}),body:ave,responses:{201:Nve,401:y,403:y},summary:"Create building block snapshots for the authenticated user\u2019s organization"},getPlan:{method:"GET",path:"/plans/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Ive,401:y,403:y,404:y},summary:"Load a thread-backed plan container visible to the authenticated user, including all visible plan revisions in that thread"},createPlanCommentThread:{method:"POST",path:"/plans/:id/comment-threads",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:pve,responses:{201:fve,401:y,403:y,404:y,422:y},summary:"Create a new inline comment thread on a specific revision inside a thread-backed plan container"},createPlanComment:{method:"POST",path:"/plans/:id/comment-threads/:threadId/comments",pathParams:l.object({id:l.string().min(1),threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:hve,responses:{201:gve,401:y,403:y,404:y,409:y},summary:"Reply to an inline comment thread on a thread-backed plan container"},updatePlanCommentThread:{method:"PATCH",path:"/plans/:id/comment-threads/:threadId",pathParams:l.object({id:l.string().min(1),threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Sve,responses:{200:Ave,401:y,403:y,404:y},summary:"Resolve or reopen an inline comment thread on a thread-backed plan container"},listPlans:{method:"GET",path:"/plans",headers:l.object({authorization:l.string().min(1).optional()}),query:Cve,responses:{200:Ove,401:y,403:y},summary:"List thread-backed plan containers visible to the authenticated user in their organization, ordered by latest visible revision and optionally filtered by author or repository"},listBuildingBlockSnapshots:{method:"GET",path:"/building_blocks",headers:l.object({authorization:l.string().min(1).optional()}),query:Pve,responses:{200:xve,401:y,403:y},summary:"List building block snapshots for the authenticated user\u2019s organization and repo origin path"},listUploadSessions:{method:"GET",path:"/upload_sessions",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Rke,401:y},summary:"List recent upload sessions for the authenticated user"},createUploadSession:{method:"POST",path:"/upload_sessions",headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({thread_files:l.array(Bve).nonempty()}),responses:{201:fke,400:y,401:y},summary:"Create an upload session with presigned URLs for file uploads"},completeUploadSession:{method:"POST",path:"/upload_sessions/:id/complete",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({thread_files:l.array(cke).nonempty()}),responses:{200:dke,400:y,401:y,404:y,409:y,422:y},summary:"Complete an upload session after files have been uploaded to storage"},adminStats:{method:"GET",path:"/admin/stats",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:jke,401:y,403:y},summary:"Cross-org operational counts. Tanagram admins only."},adminListOrganizations:{method:"GET",path:"/admin/organizations",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Vke,401:y,403:y},summary:"List every organization with member and thread counts. Tanagram admins only."},adminListUsers:{method:"GET",path:"/admin/users",query:$ke,headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Wke,401:y,403:y},summary:"List every user with their org memberships and thread count. Tanagram admins only."},adminListThreads:{method:"GET",path:"/admin/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:Jke,responses:{200:Qke,401:y,403:y},summary:"List live threads across every organization. Tanagram admins only."},adminForceFollow:{method:"POST",path:"/admin/connections/follow",headers:l.object({authorization:l.string().min(1).optional()}),body:zke,responses:{200:Yke,401:y,403:y,404:y,422:y},summary:"Force follower->followee edge. Admin-only and non-destructive."},adminHardDeleteThread:{method:"DELETE",path:"/admin/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.null(),401:y,403:y,404:y},summary:"Permanently remove a thread. Tanagram admins only."},listCardFeed:{method:"GET",path:"/cards/feed",query:l.object({limit:l.coerce.number().int().min(1).max(48).optional()}),responses:{200:ske},summary:"Slim feed of public threads with a ready cover image, ordered by cover_generated_at descending. Powers the landing-page UGC card scroll. Returns presigned cover URLs inline so the grid renders without a follow-up round trip per card."},listDiscoverThreads:{method:"GET",path:"/discover/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:Ake,responses:{200:Ske},summary:"Feed of public threads with sort, harness filter, search, and cursor pagination. Auth is optional and populates viewer_vote."},discoverStats:{method:"GET",path:"/discover/stats",responses:{200:yke},summary:"Unauthenticated rollup of public-thread counts for the Discover header."},createWaitlistEntry:{method:"POST",path:"/waitlist_entries",body:tve,responses:{201:nve,409:y},summary:"Create an unauthenticated waitlist entry keyed by (location, contact)."},createShareToken:{method:"POST",path:"/threads/:id/share-token",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{201:uW,401:y,403:y,404:y,409:y},summary:"Mint a short share-link token for a public thread. Author only. The token powers `/s/:token` short URLs and enables k-factor attribution."},resolveShareToken:{method:"GET",path:"/referrals/resolve/:token",pathParams:l.object({token:l.string().min(1).max(16)}),query:Xke,responses:{200:uW,404:y},summary:"Resolve a share-link token to its thread and record the view. Unauthenticated by design."},adminGrowth:{method:"GET",path:"/admin/growth",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:twe,401:y,403:y},summary:"Share-link k-factor, funnel, sparkline, and top sharers by window. Tanagram admins only."},adminRunCritiquePlayground:{method:"POST",path:"/admin/critique-playground/run",headers:l.object({authorization:l.string().min(1).optional()}),body:swe,responses:{200:iwe,401:y,403:y,409:y},summary:"Admin-only critique playground that saves markdown to a file:// plan artifact and returns parsed + critiqued plan blocks."},getBillingState:{method:"GET",path:"/billing/state",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:awe,401:y},summary:"Resolve the caller's plan, features, seat count, and any admin override."},createBillingCheckout:{method:"POST",path:"/billing/checkout",headers:l.object({authorization:l.string().min(1).optional()}),body:uwe,responses:{200:cwe,400:y,401:y,403:y,503:y},summary:"Start a Stripe Checkout session for Creator ($29/mo) or Team ($19/seat/mo, min 2)."},createBillingPortal:{method:"POST",path:"/billing/portal",headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({subject_type:l.enum(["user","organization"]).default("user")}).optional(),responses:{200:lwe,401:y,404:y,503:y},summary:"Open the Stripe customer portal so the subject can manage their subscription."},updateTeamSeats:{method:"PATCH",path:"/billing/team-seats",headers:l.object({authorization:l.string().min(1).optional()}),body:dwe,responses:{200:bx,400:y,401:y,403:y,404:y,503:y},summary:"Adjust the caller-organization's Team seat quantity (admin of that org only)."},adminListBilling:{method:"GET",path:"/admin/billing",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:pwe,401:y,403:y},summary:"List every user and org with current plan + override for the admin panel."},adminSetUserPlanOverride:{method:"PUT",path:"/admin/billing/users/:id/override",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:cW,responses:{200:_0,401:y,403:y,404:y},summary:"Admin override for a user's plan tier. Null clears the override."},adminSetOrganizationPlanOverride:{method:"PUT",path:"/admin/billing/organizations/:id/override",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:cW,responses:{200:_0,401:y,403:y,404:y},summary:"Admin override for an organization's plan tier. Null clears the override."},projects:X7,docs:Q7,mentions:Z7,favorites:nW,search:oW},{pathPrefix:"/api"});c();import ws from"node:fs";import E0 from"node:path";c();import PW from"node:os";import vs from"node:path";function Br(){let t=$e()==="dev"?".lore-dev":".lore";return vs.join(PW.homedir(),t)}function ks(){return vs.join(Br(),"log.txt")}function Cx(){return vs.join(Br(),"sync_state.json")}function MW(){return vs.join(Br(),"upload_filters.json")}function g0(){return vs.join(Br(),"status.json")}function Iu(){return vs.join(Br(),"install_source.json")}function T0(){return vs.join(Br(),"skill_sync_state.json")}function Ou(){return vs.join(Br(),"bin","lore")}function am(){let t=$e();return t==="prod"?"ai.tanagram.lore":`ai.tanagram.lore.${t}`}function dd(){return vs.join(PW.homedir(),"Library","LaunchAgents",`${am()}.plist`)}function S0(){return E0.join(Br(),"token")}function Nx(){return E0.join(Br(),"analytics_distinct_id")}function vW(){let t;try{t=ws.readFileSync(Nx(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return null;throw n}let e=t.trim();return e.length>0?e:null}function kW(t){let e=Nx();ws.mkdirSync(E0.dirname(e),{recursive:!0,mode:448}),ws.writeFileSync(e,t,{mode:384})}function wW(){try{ws.rmSync(Nx())}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return;throw t}}function um(){let t;try{t=ws.readFileSync(S0(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return{token:"",source:"none"};throw n}let e=t.trim();return!e||Dwe(e,new Date)?{token:"",source:"none"}:{token:e,source:"file"}}function Ft(){return um().token}function LW(){return ws.existsSync(S0())}function DW(t){let e=S0();ws.mkdirSync(E0.dirname(e),{recursive:!0,mode:448}),ws.writeFileSync(e,t,{mode:384})}function UW(){try{ws.rmSync(S0())}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return;throw t}}function xx(t){let e=t.split(".");if(e.length<2)throw new Error("invalid JWT format");return JSON.parse(Buffer.from(e[1],"base64url").toString("utf8"))}function Dwe(t,e){let n;try{n=xx(t)}catch{return!1}return typeof n.exp!="number"?!1:e.getTime()>=n.exp*1e3}var Uwe={dev:"http://localhost:4000",prod:"https://lore-api.tanagram.ai"};function Bwe(t=$e(),e=process.env.LORE_API_ORIGIN){let n=e?.trim();return n?n.replace(/\/$/,""):Uwe[t]}function Ue(t={}){let e=t.token??Ft();return hx(xW,{baseUrl:Bwe(),baseHeaders:{"User-Agent":O7(),...e?{authorization:`Bearer ${e}`}:{}}})}c();import FW from"node:fs";var BW=null;function Fwe(){let t=Br();BW!==t&&(FW.mkdirSync(t,{recursive:!0}),BW=t)}function Gwe(t){let e=typeof t=="string"?t:JSON.stringify(t);return/[\s"=]/.test(e)?JSON.stringify(e):e}function jwe(t,e,n){let r=`${new Date().toISOString()} ${t} ${e}`;if(!n)return`${r}
|
|
40
|
+
`)}function ux(t){let e=t.valueHint?`=<${t.valueHint}>`:"",n=e||`=<${N7(t.name)}>`;return!t.type||t.type==="positional"||t.type==="boolean"?e:t.type==="enum"&&t.options?.length?`=<${t.options.join("|")}>`:n}function P7(t,e){let n=e?t0("(Required)"):"",r=t.default===void 0?"":t0(`(Default: ${t.default})`);return[t.description,n,r].filter(Boolean).join(" ")}c();import{spawn as TUe}from"node:child_process";c();c();c();c();var l={};oa(l,{BRAND:()=>QPe,DIRTY:()=>au,EMPTY_PATH:()=>NPe,INVALID:()=>X,NEVER:()=>w1e,OK:()=>fn,ParseStatus:()=>Zt,Schema:()=>le,ZodAny:()=>Ji,ZodArray:()=>Ms,ZodBigInt:()=>cu,ZodBoolean:()=>lu,ZodBranded:()=>om,ZodCatch:()=>Au,ZodDate:()=>du,ZodDefault:()=>Su,ZodDiscriminatedUnion:()=>a0,ZodEffects:()=>Dr,ZodEnum:()=>Tu,ZodError:()=>Vn,ZodFirstPartyTypeKind:()=>te,ZodFunction:()=>c0,ZodIntersection:()=>_u,ZodIssueCode:()=>P,ZodLazy:()=>hu,ZodLiteral:()=>gu,ZodMap:()=>id,ZodNaN:()=>ud,ZodNativeEnum:()=>Eu,ZodNever:()=>so,ZodNull:()=>fu,ZodNullable:()=>Vo,ZodNumber:()=>uu,ZodObject:()=>qn,ZodOptional:()=>wr,ZodParsedType:()=>U,ZodPipeline:()=>sm,ZodPromise:()=>Xi,ZodReadonly:()=>yu,ZodRecord:()=>u0,ZodSchema:()=>le,ZodSet:()=>ad,ZodString:()=>Qi,ZodSymbol:()=>od,ZodTransformer:()=>Dr,ZodTuple:()=>Ho,ZodType:()=>le,ZodUndefined:()=>pu,ZodUnion:()=>mu,ZodUnknown:()=>Ps,ZodVoid:()=>sd,addIssueToContext:()=>w,any:()=>s1e,array:()=>c1e,bigint:()=>e1e,boolean:()=>H7,coerce:()=>k1e,custom:()=>F7,date:()=>t1e,datetimeRegex:()=>U7,defaultErrorMap:()=>Ns,discriminatedUnion:()=>f1e,effect:()=>I1e,enum:()=>y1e,function:()=>E1e,getErrorMap:()=>td,getParsedType:()=>jo,instanceof:()=>XPe,intersection:()=>m1e,isAborted:()=>s0,isAsync:()=>nd,isDirty:()=>i0,isValid:()=>Ki,late:()=>JPe,lazy:()=>S1e,literal:()=>A1e,makeIssue:()=>rm,map:()=>g1e,nan:()=>ZPe,nativeEnum:()=>b1e,never:()=>a1e,null:()=>o1e,nullable:()=>C1e,number:()=>j7,object:()=>l1e,objectUtil:()=>cx,oboolean:()=>v1e,onumber:()=>M1e,optional:()=>O1e,ostring:()=>P1e,pipeline:()=>x1e,preprocess:()=>N1e,promise:()=>R1e,quotelessJson:()=>IPe,record:()=>h1e,set:()=>T1e,setErrorMap:()=>CPe,strictObject:()=>d1e,string:()=>G7,symbol:()=>n1e,transformer:()=>I1e,tuple:()=>_1e,undefined:()=>r1e,union:()=>p1e,unknown:()=>i1e,util:()=>_e,void:()=>u1e});c();c();c();c();c();var _e;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(_e||(_e={}));var cx;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(cx||(cx={}));var U=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),jo=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var P=_e.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"]),IPe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Vn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,u=0;for(;u<i.path.length;){let d=i.path[u];u===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],u++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Vn.create=t=>new Vn(t);var OPe=(t,e)=>{let n;switch(t.code){case P.invalid_type:t.received===U.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case P.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,_e.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:n=`Unrecognized key(s) in object: ${_e.joinValues(t.keys,", ")}`;break;case P.invalid_union:n="Invalid input";break;case P.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_e.joinValues(t.options)}`;break;case P.invalid_enum_value:n=`Invalid enum value. Expected ${_e.joinValues(t.options)}, received '${t.received}'`;break;case P.invalid_arguments:n="Invalid function arguments";break;case P.invalid_return_type:n="Invalid function return type";break;case P.invalid_date:n="Invalid date";break;case P.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:_e.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case P.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case P.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case P.custom:n="Invalid input";break;case P.invalid_intersection_types:n="Intersection results could not be merged";break;case P.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case P.not_finite:n="Number must be finite";break;default:n=e.defaultError,_e.assertNever(t)}return{message:n}},Ns=OPe;var v7=Ns;function CPe(t){v7=t}function td(){return v7}c();var rm=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",u=r.filter(d=>!!d).slice().reverse();for(let d of u)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},NPe=[];function w(t,e){let n=td(),r=rm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Ns?void 0:Ns].filter(o=>!!o)});t.common.issues.push(r)}var Zt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return X;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return X;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},X=Object.freeze({status:"aborted"}),au=t=>({status:"dirty",value:t}),fn=t=>({status:"valid",value:t}),s0=t=>t.status==="aborted",i0=t=>t.status==="dirty",Ki=t=>t.status==="valid",nd=t=>typeof Promise<"u"&&t instanceof Promise;c();c();var H;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(H||(H={}));var Lr=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},k7=(t,e)=>{if(Ki(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Vn(t.common.issues);return this._error=n,this._error}}};function ue(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:u}=t;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:u??n??a.defaultError}},description:o}}var le=class{get description(){return this._def.description}_getType(e){return jo(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:jo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zt,ctx:{common:e.parent.common,data:e.data,parsedType:jo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(nd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jo(e)},o=this._parseSync({data:e,path:r.path,parent:r});return k7(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jo(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Ki(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Ki(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jo(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(nd(o)?o:Promise.resolve(o));return k7(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:P.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new Dr({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return wr.create(this,this._def)}nullable(){return Vo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ms.create(this)}promise(){return Xi.create(this,this._def)}or(e){return mu.create([this,e],this._def)}and(e){return _u.create(this,e,this._def)}transform(e){return new Dr({...ue(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Su({...ue(this._def),innerType:this,defaultValue:n,typeName:te.ZodDefault})}brand(){return new om({typeName:te.ZodBranded,type:this,...ue(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Au({...ue(this._def),innerType:this,catchValue:n,typeName:te.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return sm.create(this,e)}readonly(){return yu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xPe=/^c[^\s-]{8,}$/i,PPe=/^[0-9a-z]+$/,MPe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vPe=/^[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,kPe=/^[a-z0-9_-]{21}$/i,wPe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LPe=/^[-+]?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)?)??$/,DPe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UPe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lx,BPe=/^(?:(?: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])$/,FPe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,GPe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jPe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HPe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VPe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L7="((\\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])))",qPe=new RegExp(`^${L7}$`);function D7(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function $Pe(t){return new RegExp(`^${D7(t)}$`)}function U7(t){let e=`${L7}T${D7(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function zPe(t,e){return!!((e==="v4"||!e)&&BPe.test(t)||(e==="v6"||!e)&&GPe.test(t))}function YPe(t,e){if(!wPe.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function WPe(t,e){return!!((e==="v4"||!e)&&FPe.test(t)||(e==="v6"||!e)&&jPe.test(t))}var Qi=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_type,expected:U.string,received:s.parsedType}),X}let r=new Zt,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?w(o,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&w(o,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")DPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"email",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")lx||(lx=new RegExp(UPe,"u")),lx.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"emoji",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")vPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"uuid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")kPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"nanoid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")xPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cuid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")PPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cuid2",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")MPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"ulid",code:P.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),w(o,{validation:"url",code:P.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"regex",code:P.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?U7(s).test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?qPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?$Pe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:P.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?LPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"duration",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?zPe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"ip",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?YPe(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"jwt",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?WPe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cidr",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?HPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"base64",code:P.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?VPe.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"base64url",code:P.invalid_string,message:s.message}),r.dirty()):_e.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:P.invalid_string,...H.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...H.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...H.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...H.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...H.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...H.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...H.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...H.errToObj(n)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Qi.create=t=>new Qi({checks:[],typeName:te.ZodString,coerce:t?.coerce??!1,...ue(t)});function KPe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}var uu=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_type,expected:U.number,received:s.parsedType}),X}let r,o=new Zt;for(let s of this._def.checks)s.kind==="int"?_e.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:P.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?KPe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:P.not_finite,message:s.message}),o.dirty()):_e.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:H.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_e.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};uu.create=t=>new uu({checks:[],typeName:te.ZodNumber,coerce:t?.coerce||!1,...ue(t)});var cu=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let r,o=new Zt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),w(r,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):_e.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return w(n,{code:P.invalid_type,expected:U.bigint,received:n.parsedType}),X}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:H.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};cu.create=t=>new cu({checks:[],typeName:te.ZodBigInt,coerce:t?.coerce??!1,...ue(t)});var lu=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.boolean,received:r.parsedType}),X}return fn(e.data)}};lu.create=t=>new lu({typeName:te.ZodBoolean,coerce:t?.coerce||!1,...ue(t)});var du=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_type,expected:U.date,received:s.parsedType}),X}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return w(s,{code:P.invalid_date}),X}let r=new Zt,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:P.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):_e.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};du.create=t=>new du({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ue(t)});var od=class extends le{_parse(e){if(this._getType(e)!==U.symbol){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.symbol,received:r.parsedType}),X}return fn(e.data)}};od.create=t=>new od({typeName:te.ZodSymbol,...ue(t)});var pu=class extends le{_parse(e){if(this._getType(e)!==U.undefined){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.undefined,received:r.parsedType}),X}return fn(e.data)}};pu.create=t=>new pu({typeName:te.ZodUndefined,...ue(t)});var fu=class extends le{_parse(e){if(this._getType(e)!==U.null){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.null,received:r.parsedType}),X}return fn(e.data)}};fu.create=t=>new fu({typeName:te.ZodNull,...ue(t)});var Ji=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return fn(e.data)}};Ji.create=t=>new Ji({typeName:te.ZodAny,...ue(t)});var Ps=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fn(e.data)}};Ps.create=t=>new Ps({typeName:te.ZodUnknown,...ue(t)});var so=class extends le{_parse(e){let n=this._getOrReturnCtx(e);return w(n,{code:P.invalid_type,expected:U.never,received:n.parsedType}),X}};so.create=t=>new so({typeName:te.ZodNever,...ue(t)});var sd=class extends le{_parse(e){if(this._getType(e)!==U.undefined){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.void,received:r.parsedType}),X}return fn(e.data)}};sd.create=t=>new sd({typeName:te.ZodVoid,...ue(t)});var Ms=class t extends le{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==U.array)return w(n,{code:P.invalid_type,expected:U.array,received:n.parsedType}),X;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(w(n,{code:i?P.too_big:P.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(w(n,{code:P.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&&(w(n,{code:P.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Lr(n,i,n.path,a)))).then(i=>Zt.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Lr(n,i,n.path,a)));return Zt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:H.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:H.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:H.toString(n)}})}nonempty(e){return this.min(1,e)}};Ms.create=(t,e)=>new Ms({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ue(e)});function rd(t){if(t instanceof qn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=wr.create(rd(r))}return new qn({...t._def,shape:()=>e})}else return t instanceof Ms?new Ms({...t._def,type:rd(t.element)}):t instanceof wr?wr.create(rd(t.unwrap())):t instanceof Vo?Vo.create(rd(t.unwrap())):t instanceof Ho?Ho.create(t.items.map(e=>rd(e))):t}var qn=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=_e.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==U.object){let d=this._getOrReturnCtx(e);return w(d,{code:P.invalid_type,expected:U.object,received:d.parsedType}),X}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof so&&this._def.unknownKeys==="strip"))for(let d in o.data)i.includes(d)||a.push(d);let u=[];for(let d of i){let p=s[d],f=o.data[d];u.push({key:{status:"valid",value:d},value:p._parse(new Lr(o,f,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof so){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of a)u.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(d==="strict")a.length>0&&(w(o,{code:P.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of a){let f=o.data[p];u.push({key:{status:"valid",value:p},value:d._parse(new Lr(o,f,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of u){let f=await p.key,m=await p.value;d.push({key:f,value:m,alwaysSet:p.alwaysSet})}return d}).then(d=>Zt.mergeObjectSync(r,d)):Zt.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:H.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:te.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of _e.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of _e.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return rd(this)}partial(e){let n={};for(let r of _e.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of _e.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof wr;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return B7(_e.objectKeys(this.shape))}};qn.create=(t,e)=>new qn({shape:()=>t,unknownKeys:"strip",catchall:so.create(),typeName:te.ZodObject,...ue(e)});qn.strictCreate=(t,e)=>new qn({shape:()=>t,unknownKeys:"strict",catchall:so.create(),typeName:te.ZodObject,...ue(e)});qn.lazycreate=(t,e)=>new qn({shape:t,unknownKeys:"strip",catchall:so.create(),typeName:te.ZodObject,...ue(e)});var mu=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Vn(a.ctx.common.issues));return w(n,{code:P.invalid_union,unionErrors:i}),X}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let u of r){let d={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(u=>new Vn(u));return w(n,{code:P.invalid_union,unionErrors:a}),X}}get options(){return this._def.options}};mu.create=(t,e)=>new mu({options:t,typeName:te.ZodUnion,...ue(e)});var xs=t=>t instanceof hu?xs(t.schema):t instanceof Dr?xs(t.innerType()):t instanceof gu?[t.value]:t instanceof Tu?t.options:t instanceof Eu?_e.objectValues(t.enum):t instanceof Su?xs(t._def.innerType):t instanceof pu?[void 0]:t instanceof fu?[null]:t instanceof wr?[void 0,...xs(t.unwrap())]:t instanceof Vo?[null,...xs(t.unwrap())]:t instanceof om||t instanceof yu?xs(t.unwrap()):t instanceof Au?xs(t._def.innerType):[],a0=class t extends le{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return w(n,{code:P.invalid_type,expected:U.object,received:n.parsedType}),X;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(w(n,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),X)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=xs(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...ue(r)})}};function dx(t,e){let n=jo(t),r=jo(e);if(t===e)return{valid:!0,data:t};if(n===U.object&&r===U.object){let o=_e.objectKeys(e),s=_e.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let u=dx(t[a],e[a]);if(!u.valid)return{valid:!1};i[a]=u.data}return{valid:!0,data:i}}else if(n===U.array&&r===U.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],u=dx(i,a);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===U.date&&r===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var _u=class extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(s0(s)||s0(i))return X;let a=dx(s.value,i.value);return a.valid?((i0(s)||i0(i))&&n.dirty(),{status:n.value,value:a.data}):(w(r,{code:P.invalid_intersection_types}),X)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};_u.create=(t,e,n)=>new _u({left:t,right:e,typeName:te.ZodIntersection,...ue(n)});var Ho=class t extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.array)return w(r,{code:P.invalid_type,expected:U.array,received:r.parsedType}),X;if(r.data.length<this._def.items.length)return w(r,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X;!this._def.rest&&r.data.length>this._def.items.length&&(w(r,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Lr(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Zt.mergeArray(n,i)):Zt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ho.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ho({items:t,typeName:te.ZodTuple,rest:null,...ue(e)})};var u0=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return w(r,{code:P.invalid_type,expected:U.object,received:r.parsedType}),X;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Lr(r,a,r.path,a)),value:i._parse(new Lr(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Zt.mergeObjectAsync(n,o):Zt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof le?new t({keyType:e,valueType:n,typeName:te.ZodRecord,...ue(r)}):new t({keyType:Qi.create(),valueType:e,typeName:te.ZodRecord,...ue(n)})}},id=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.map)return w(r,{code:P.invalid_type,expected:U.map,received:r.parsedType}),X;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,u],d)=>({key:o._parse(new Lr(r,a,r.path,[d,"key"])),value:s._parse(new Lr(r,u,r.path,[d,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of i){let d=await u.key,p=await u.value;if(d.status==="aborted"||p.status==="aborted")return X;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(d.value,p.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let u of i){let d=u.key,p=u.value;if(d.status==="aborted"||p.status==="aborted")return X;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(d.value,p.value)}return{status:n.value,value:a}}}};id.create=(t,e,n)=>new id({valueType:e,keyType:t,typeName:te.ZodMap,...ue(n)});var ad=class t extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==U.set)return w(r,{code:P.invalid_type,expected:U.set,received:r.parsedType}),X;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(w(r,{code:P.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&&(w(r,{code:P.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(u){let d=new Set;for(let p of u){if(p.status==="aborted")return X;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}let a=[...r.data.values()].map((u,d)=>s._parse(new Lr(r,u,r.path,d)));return r.common.async?Promise.all(a).then(u=>i(u)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:H.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:H.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ad.create=(t,e)=>new ad({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ue(e)});var c0=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.function)return w(n,{code:P.invalid_type,expected:U.function,received:n.parsedType}),X;function r(a,u){return rm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,td(),Ns].filter(d=>!!d),issueData:{code:P.invalid_arguments,argumentsError:u}})}function o(a,u){return rm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,td(),Ns].filter(d=>!!d),issueData:{code:P.invalid_return_type,returnTypeError:u}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Xi){let a=this;return fn(async function(...u){let d=new Vn([]),p=await a._def.args.parseAsync(u,s).catch(_=>{throw d.addIssue(r(u,_)),d}),f=await Reflect.apply(i,this,p);return await a._def.returns._def.type.parseAsync(f,s).catch(_=>{throw d.addIssue(o(f,_)),d})})}else{let a=this;return fn(function(...u){let d=a._def.args.safeParse(u,s);if(!d.success)throw new Vn([r(u,d.error)]);let p=Reflect.apply(i,this,d.data),f=a._def.returns.safeParse(p,s);if(!f.success)throw new Vn([o(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ho.create(e).rest(Ps.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Ho.create([]).rest(Ps.create()),returns:n||Ps.create(),typeName:te.ZodFunction,...ue(r)})}},hu=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};hu.create=(t,e)=>new hu({getter:t,typeName:te.ZodLazy,...ue(e)});var gu=class extends le{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return w(n,{received:n.data,code:P.invalid_literal,expected:this._def.value}),X}return{status:"valid",value:e.data}}get value(){return this._def.value}};gu.create=(t,e)=>new gu({value:t,typeName:te.ZodLiteral,...ue(e)});function B7(t,e){return new Tu({values:t,typeName:te.ZodEnum,...ue(e)})}var Tu=class t extends le{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return w(n,{expected:_e.joinValues(r),received:n.parsedType,code:P.invalid_type}),X}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return w(n,{received:n.data,code:P.invalid_enum_value,options:r}),X}return fn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Tu.create=B7;var Eu=class extends le{_parse(e){let n=_e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==U.string&&r.parsedType!==U.number){let o=_e.objectValues(n);return w(r,{expected:_e.joinValues(o),received:r.parsedType,code:P.invalid_type}),X}if(this._cache||(this._cache=new Set(_e.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=_e.objectValues(n);return w(r,{received:r.data,code:P.invalid_enum_value,options:o}),X}return fn(e.data)}get enum(){return this._def.values}};Eu.create=(t,e)=>new Eu({values:t,typeName:te.ZodNativeEnum,...ue(e)});var Xi=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==U.promise&&n.common.async===!1)return w(n,{code:P.invalid_type,expected:U.promise,received:n.parsedType}),X;let r=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return fn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Xi.create=(t,e)=>new Xi({type:t,typeName:te.ZodPromise,...ue(e)});var Dr=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{w(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return X;let u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?X:u.status==="dirty"?au(u.value):n.value==="dirty"?au(u.value):u});{if(n.value==="aborted")return X;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?X:a.status==="dirty"?au(a.value):n.value==="dirty"?au(a.value):a}}if(o.type==="refinement"){let i=a=>{let u=o.refinement(a,s);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?X:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?X:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ki(i))return X;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Ki(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):X);_e.assertNever(o)}};Dr.create=(t,e,n)=>new Dr({schema:t,typeName:te.ZodEffects,effect:e,...ue(n)});Dr.createWithPreprocess=(t,e,n)=>new Dr({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ue(n)});var wr=class extends le{_parse(e){return this._getType(e)===U.undefined?fn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};wr.create=(t,e)=>new wr({innerType:t,typeName:te.ZodOptional,...ue(e)});var Vo=class extends le{_parse(e){return this._getType(e)===U.null?fn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Vo.create=(t,e)=>new Vo({innerType:t,typeName:te.ZodNullable,...ue(e)});var Su=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===U.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Su.create=(t,e)=>new Su({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ue(e)});var Au=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return nd(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Vn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Vn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Au.create=(t,e)=>new Au({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ue(e)});var ud=class extends le{_parse(e){if(this._getType(e)!==U.nan){let r=this._getOrReturnCtx(e);return w(r,{code:P.invalid_type,expected:U.nan,received:r.parsedType}),X}return{status:"valid",value:e.data}}};ud.create=t=>new ud({typeName:te.ZodNaN,...ue(t)});var QPe=Symbol("zod_brand"),om=class extends le{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},sm=class t extends le{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?X:s.status==="dirty"?(n.dirty(),au(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?X:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:te.ZodPipeline})}},yu=class extends le{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Ki(o)&&(o.value=Object.freeze(o.value)),o);return nd(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};yu.create=(t,e)=>new yu({innerType:t,typeName:te.ZodReadonly,...ue(e)});function w7(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function F7(t,e={},n){return t?Ji.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=w7(e,r),u=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:u})}});if(!s){let i=w7(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Ji.create()}var JPe={object:qn.lazycreate},te;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(te||(te={}));var XPe=(t,e={message:`Input not instance of ${t.name}`})=>F7(n=>n instanceof t,e),G7=Qi.create,j7=uu.create,ZPe=ud.create,e1e=cu.create,H7=lu.create,t1e=du.create,n1e=od.create,r1e=pu.create,o1e=fu.create,s1e=Ji.create,i1e=Ps.create,a1e=so.create,u1e=sd.create,c1e=Ms.create,l1e=qn.create,d1e=qn.strictCreate,p1e=mu.create,f1e=a0.create,m1e=_u.create,_1e=Ho.create,h1e=u0.create,g1e=id.create,T1e=ad.create,E1e=c0.create,S1e=hu.create,A1e=gu.create,y1e=Tu.create,b1e=Eu.create,R1e=Xi.create,I1e=Dr.create,O1e=wr.create,C1e=Vo.create,N1e=Dr.createWithPreprocess,x1e=sm.create,P1e=()=>G7().optional(),M1e=()=>j7().optional(),v1e=()=>H7().optional(),k1e={string:t=>Qi.create({...t,coerce:!0}),number:t=>uu.create({...t,coerce:!0}),boolean:t=>lu.create({...t,coerce:!0}),bigint:t=>cu.create({...t,coerce:!0}),date:t=>du.create({...t,coerce:!0})};var w1e=X;var L1e=t=>typeof t?.safeParse=="function";var px=t=>typeof t?.passthrough=="function";var D1e=(t,e)=>px(t)?px(e)?t.merge(e):t:px(e)?e:Object.assign({},t,e);var bht=l.object({name:l.literal("ZodError"),issues:l.array(l.object({path:l.array(l.union([l.string(),l.number()])),message:l.string().optional(),code:l.nativeEnum(l.ZodIssueCode)}).catchall(l.any()))}),U1e=Symbol("ContractNoBody"),q7=t=>"method"in t&&"path"in t;var $7=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>{var o,s,i;return q7(r)?[n,{...r,path:e?.pathPrefix?e.pathPrefix+r.path:r.path,headers:D1e(e?.baseHeaders,r.headers),strictStatusCodes:(o=r.strictStatusCodes)!==null&&o!==void 0?o:e?.strictStatusCodes,validateResponseOnClient:(s=r.validateResponseOnClient)!==null&&s!==void 0?s:e?.validateResponseOnClient,responses:{...e?.commonResponses,...r.responses},metadata:e?.metadata?{...e?.metadata,...(i=r.metadata)!==null&&i!==void 0?i:{}}:r.metadata}]:[n,$7(r,e)]})),fx=Symbol("ContractPlainType"),Ur=()=>({router:(t,e)=>$7(t,e),query:t=>t,mutation:t=>t,responses:t=>t,response:()=>fx,body:()=>fx,type:()=>fx,otherResponse:({contentType:t,body:e})=>({contentType:t,body:e}),noBody:()=>U1e}),B1e=({path:t,params:e})=>{let n=e;return t.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},F1e=(t,e=!1)=>{let n=e?G1e(t):j1e(t);return n?.length>0?"?"+n:""},G1e=t=>t?Object.entries(t).filter(([,e])=>e!==void 0).map(([e,n])=>{let r;return typeof n=="string"&&!["true","false","null"].includes(n.trim())&&isNaN(Number(n))?r=n:r=JSON.stringify(n),`${encodeURIComponent(e)}=${encodeURIComponent(r)}`}).join("&"):"",j1e=t=>t?Object.keys(t).flatMap(e=>mx(e,t[e])).map(([e,n])=>`${encodeURIComponent(e)}=${encodeURIComponent(n)}`).join("&"):"",mx=(t,e)=>Array.isArray(e)?e.flatMap((n,r)=>mx(`${t}[${r}]`,n)):e instanceof Date?[[`${t}`,e.toISOString()]]:e===null?[[`${t}`,""]]:e===void 0?[]:typeof e=="object"?Object.keys(e).flatMap(n=>mx(`${t}[${n}]`,e[n])):[[`${t}`,`${e}`]];var _x=class extends Error{constructor(e,n){let r=n.join(",");super(`Server returned unexpected response. Expected one of: ${r} got: ${e.status}`),this.response=e}};var H1e=async({route:t,path:e,method:n,headers:r,body:o,validateResponse:s,fetchOptions:i})=>{let a=await fetch(e,{...i,method:n,headers:r,body:o}),u=a.headers.get("content-type");if(u?.includes("application/")&&u?.includes("json")){let d={status:a.status,body:await a.json(),headers:a.headers},p=t.responses[d.status];return(s??t.validateResponseOnClient)&&L1e(p)?{...d,body:p.parse(d.body)}:d}return u?.includes("text/")?{status:a.status,body:await a.text(),headers:a.headers}:{status:a.status,body:await a.blob(),headers:a.headers}},V1e=t=>{let e=new FormData,n=(r,o)=>{o instanceof File?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t).forEach(([r,o])=>{if(Array.isArray(o))for(let s of o)n(r,s);else n(r,o)}),e},V7=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLowerCase(),n])),q1e=t=>{let{path:e,clientArgs:n,route:r,body:o,query:s,extraInputArgs:i,headers:a,fetchOptions:u}=t,d=n.api||H1e,p=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([_,h])=>typeof h=="function"?[_,h(t)]:[_,h])),f={...p&&V7(p),...V7(a)};Object.keys(f).forEach(_=>{f[_]===void 0&&delete f[_]});let m={route:r,path:e,method:r.method,headers:f,body:void 0,rawBody:o,rawQuery:s,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...u},...u?.signal&&{signal:u.signal},...u?.cache&&{cache:u.cache},...u&&"next"in u&&!!u?.next&&{next:u.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?m={...m,contentType:"multipart/form-data",body:o instanceof FormData?o:V1e(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?m={...m,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...m.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(m={...m,contentType:"application/json",headers:{"content-type":"application/json",...m.headers},body:JSON.stringify(o)})),d({...m,...i})},$1e=(t,e,n)=>{let{query:r,params:o,body:s,headers:i,extraHeaders:a,overrideClientOptions:u,fetchOptions:d,cache:p,next:f,...m}=n||{},_={...e,...u};return{path:z1e(r,_.baseUrl,o,t,!!_.jsonQuery),clientArgs:_,route:t,body:s,query:r,extraInputArgs:m,fetchOptions:{...p&&{cache:p},...f&&{next:f},...d},headers:{...a,...i}}},z1e=(t,e,n,r,o)=>{let s=B1e({path:r.path,params:n}),i=F1e(t,o);return`${e}${s}${i}`},Y1e=(t,e)=>{let n=Object.keys(t.responses);return async r=>{let o=$1e(t,e,r),s=await q1e(o);if(!e.throwOnUnknownStatus||n.includes(s.status.toString()))return s;throw new _x(s,n)}},hx=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>q7(r)?[n,Y1e(r,e)]:[n,hx(r,e)]));c();c();var gx=["free","creator","team"],z7=typeof process<"u"&&process.env?.NODE_ENV!=="production",W1e={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:z7?"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:z7?"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}}]}};var Y7=W1e.stripe.plans,Oht=Object.freeze(Object.fromEntries(Y7.map(t=>[t.tier,t])));c();c();var K1e=Ur(),mn=l.object({message:l.string()}),Tx=l.record(l.unknown()),bu=l.string().regex(/^doc_[0-9A-Za-z]{22}$/),l0=l.string().regex(/^proj_[0-9A-Za-z]{22}$/),Q1e=["active","archived"],d0=l.enum(Q1e),W7=l.object({id:l.string().min(1),display_name:l.string().min(1)}),K7=l.object({id:l0,name:l.string().min(1)}),Ex=l.object({id:bu,title:l.string().min(1),status:d0,author:W7,project:K7.nullable(),created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable()}),J1e=l.object({type:l.literal("list"),list_type:l.literal("doc"),objects:l.array(Ex)}),X1e=l.object({project_id:l0.optional(),status:d0.optional()}),Z1e=l.object({title:l.string().trim().min(1).max(300).optional(),prosemirror_json:Tx.optional(),project_id:l0.nullable().optional()}),eMe=l.object({id:bu,created_at:l.string().datetime()}),tMe=l.object({title:l.string().trim().min(1).max(300).optional(),prosemirror_json:Tx.optional(),project_id:l0.nullable().optional(),status:d0.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),nMe=l.object({id:bu,updated_at:l.string().datetime()}),rMe=l.object({id:bu,title:l.string().min(1),prosemirror_json:Tx,status:d0,author:W7,project:K7.nullable(),created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable()}),Q7=K1e.router({listDocs:{method:"GET",path:"/docs",headers:l.object({authorization:l.string().min(1).optional()}),query:X1e,responses:{200:J1e,401:mn,403:mn},summary:"List docs in the authenticated user\u2019s organization. Optional project_id filter scopes to a single project."},createDoc:{method:"POST",path:"/docs",headers:l.object({authorization:l.string().min(1).optional()}),body:Z1e,responses:{201:eMe,401:mn,403:mn,404:mn,422:mn},summary:"Create a doc. If project_id is provided, the doc is scoped to that project; otherwise it lives at the workspace level."},getDoc:{method:"GET",path:"/docs/:docId",pathParams:l.object({docId:bu}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:rMe,401:mn,403:mn,404:mn},summary:"Get a doc by id with its rich-text body and parent project (if any)"},updateDoc:{method:"PATCH",path:"/docs/:docId",pathParams:l.object({docId:bu}),headers:l.object({authorization:l.string().min(1).optional()}),body:tMe,responses:{200:nMe,401:mn,403:mn,404:mn,422:mn},summary:"Update a doc. If prosemirror_json changes, the server re-syncs lore.mention_references from mention nodes."},deleteDoc:{method:"DELETE",path:"/docs/:docId",pathParams:l.object({docId:bu}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.object({}),401:mn,403:mn,404:mn},summary:"Hard-delete a doc and any mention references it owns"}});var oMe=Ur(),at=l.object({message:l.string()}),Sx=l.record(l.unknown()),qo=l.string().regex(/^proj_[0-9A-Za-z]{22}$/),sMe=["active","archived"],p0=l.enum(sMe),Ax=l.object({id:l.string().min(1),display_name:l.string().min(1)}),J7=l.object({thread_id:l.string().min(1),title:l.string().min(1),added_at:l.string().datetime(),added_by:Ax}),iMe=l.object({id:qo,name:l.string().min(1),status:p0,author:Ax,thread_count:l.number().int().nonnegative(),doc_count:l.number().int().nonnegative(),created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable()}),aMe=l.object({type:l.literal("list"),list_type:l.literal("project"),objects:l.array(iMe)}),uMe=l.object({status:p0.optional()}),cMe=l.object({name:l.string().trim().min(1).max(200),prosemirror_json:Sx.optional()}),lMe=l.object({id:qo,created_at:l.string().datetime()}),dMe=l.object({name:l.string().trim().min(1).max(200).optional(),prosemirror_json:Sx.optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),pMe=l.object({id:qo,updated_at:l.string().datetime()}),fMe=l.object({archived:l.boolean()}),mMe=l.object({id:qo,status:p0,archived_at:l.string().datetime().nullable()}),_Me=l.object({id:qo,name:l.string().min(1),prosemirror_json:Sx,status:p0,author:Ax,created_at:l.string().datetime(),updated_at:l.string().datetime(),archived_at:l.string().datetime().nullable(),threads:l.array(J7),docs:l.array(Ex)}),hMe=l.object({thread_id:l.string().min(1).max(64)}),gMe=J7,X7=oMe.router({listProjects:{method:"GET",path:"/projects",headers:l.object({authorization:l.string().min(1).optional()}),query:uMe,responses:{200:aMe,401:at},summary:"List projects in the authenticated user\u2019s organization"},createProject:{method:"POST",path:"/projects",headers:l.object({authorization:l.string().min(1).optional()}),body:cMe,responses:{201:lMe,401:at,422:at},summary:"Create a new project in the authenticated user\u2019s organization"},getProject:{method:"GET",path:"/projects/:projectId",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:_Me,401:at,403:at,404:at},summary:"Get a project with its attached threads and child docs. The project description is the canonical mention source for project-scoped @-mentions."},updateProject:{method:"PATCH",path:"/projects/:projectId",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),body:dMe,responses:{200:pMe,401:at,403:at,404:at,422:at},summary:"Update a project\u2019s name or rich-text body. Body changes re-sync mention_references for source_kind=project."},archiveProject:{method:"POST",path:"/projects/:projectId/archive",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),body:fMe,responses:{200:mMe,401:at,403:at,404:at},summary:"Archive (soft-delete) or unarchive a project"},addProjectThread:{method:"POST",path:"/projects/:projectId/threads",pathParams:l.object({projectId:qo}),headers:l.object({authorization:l.string().min(1).optional()}),body:hMe,responses:{201:gMe,401:at,403:at,404:at,409:at,422:at},summary:"Pin an existing visible thread to this project. Idempotent \u2014 re-adding returns the existing membership."},removeProjectThread:{method:"DELETE",path:"/projects/:projectId/threads/:threadId",pathParams:l.object({projectId:qo,threadId:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.object({}),401:at,403:at,404:at},summary:"Remove a thread membership from a project"}});c();var TMe=Ur(),f0=l.object({message:l.string()}),EMe=["thread","plan","doc","user"],m0=l.enum(EMe),SMe=["doc","project"],AMe=l.enum(SMe),yMe=l.object({kind:m0,id:l.string().min(1),title:l.string().min(1),href:l.string().min(1)}),bMe=l.object({type:l.literal("list"),list_type:l.literal("mention"),objects:l.array(yMe)}),RMe=l.object({q:l.string().trim().min(1).max(50),kinds:l.string().optional().transform(t=>{if(!t)return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}).pipe(l.array(m0).optional())}),IMe=l.object({source_kind:AMe,source_id:l.string().min(1),source_title:l.string().min(1),source_href:l.string().min(1),target_kind:m0,target_id:l.string().min(1),created_at:l.string().datetime()}),OMe=l.object({type:l.literal("list"),list_type:l.literal("backlink"),objects:l.array(IMe)}),CMe=l.object({target_kind:m0,target_id:l.string().min(1).max(64)}),Z7=TMe.router({searchMentions:{method:"GET",path:"/mentions/search",headers:l.object({authorization:l.string().min(1).optional()}),query:RMe,responses:{200:bMe,401:f0,422:f0},summary:"Search threads, plans, files, and users by title/name for @-mention typeahead. Org-scoped, max 10 results across all kinds."},listBacklinks:{method:"GET",path:"/mentions/backlinks",headers:l.object({authorization:l.string().min(1).optional()}),query:CMe,responses:{200:OMe,401:f0,403:f0},summary:"List every doc/project body in the caller\u2019s organization that mentions the given target. Newest-first."}});c();var NMe=Ur(),xMe=l.object({type:l.literal("list"),list_type:l.literal("thread"),has_more:l.boolean(),objects:l.array(l.unknown())}),Bt=l.object({message:l.string()}),eW=l.object({thread_id:l.string().min(1),is_favorited:l.boolean(),favorited_at:l.string().datetime().nullable()}),PMe=l.object({before:l.string().min(1).max(64).optional()}),MMe=l.object({id:l.string().min(1),display_name:l.string().min(1)}),vMe=l.object({block_id:l.string().min(1),thread_id:l.string().min(1),thread_title:l.string(),thread_visibility:l.enum(["private","workspace","public"]),author:MMe,preview:l.string(),prompted_at:l.string().datetime().nullable(),favorited_at:l.string().datetime()}),kMe=l.object({type:l.literal("list"),list_type:l.literal("favorite_prompt"),has_more:l.boolean(),objects:l.array(vMe)}),tW=l.object({block_id:l.string().min(1),thread_id:l.string().min(1).nullable(),is_favorited:l.boolean(),favorited_at:l.string().datetime().nullable()}),wMe=l.object({before:l.string().min(1).max(64).optional()}),LMe=l.object({block_ids:l.array(l.string().min(1))}),nW=NMe.router({addThreadFavorite:{method:"POST",path:"/threads/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{201:eW,401:Bt,403:Bt,404:Bt},summary:"Bookmark a thread for the authenticated user. Idempotent \u2014 re-favoriting returns the existing membership."},removeThreadFavorite:{method:"DELETE",path:"/threads/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:eW,401:Bt,403:Bt,404:Bt},summary:"Remove a thread bookmark for the authenticated user (no-op if absent)."},listFavoriteThreads:{method:"GET",path:"/favorites/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:PMe,responses:{200:xMe,401:Bt,403:Bt},summary:"List threads the authenticated user has favorited, newest favorited first. Visibility filtering still applies \u2014 a thread the viewer can no longer see (e.g. visibility downgraded) is omitted from the list."},addPromptFavorite:{method:"POST",path:"/thread-blocks/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{201:tW,401:Bt,403:Bt,404:Bt,409:Bt},summary:'Bookmark a single user prompt (a thread_blocks row with type="user") for the authenticated user. Idempotent.'},removePromptFavorite:{method:"DELETE",path:"/thread-blocks/:id/favorite",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:tW,401:Bt,404:Bt},summary:"Remove a prompt bookmark for the authenticated user (no-op if absent)."},listFavoritePrompts:{method:"GET",path:"/favorites/prompts",headers:l.object({authorization:l.string().min(1).optional()}),query:wMe,responses:{200:kMe,401:Bt},summary:"List the user's favorited prompts, newest first. Prompts whose parent thread the viewer can no longer see (visibility downgraded) are filtered out at read time."},listFavoritedBlockIdsInThread:{method:"GET",path:"/threads/:id/favorited-blocks",pathParams:l.object({id:l.string().min(1).max(64)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:LMe,401:Bt,403:Bt,404:Bt},summary:"Returns the set of thread_block ids the authenticated viewer has favorited within a single thread, used to bootstrap per-prompt star state on the SessionView."}});c();var DMe=Ur(),rW=l.object({message:l.string()}),UMe=l.object({id:l.string().min(1),title:l.string(),href:l.string().min(1),author_display_name:l.string().nullable(),author_handle:l.string().nullable()}),BMe=l.object({name:l.string().min(1),usage_count:l.number().int().nonnegative(),href:l.string().min(1)}),FMe=l.object({id:l.string().min(1),display_name:l.string(),handle:l.string().nullable(),avatar_url:l.string().nullable(),href:l.string().min(1)}),GMe=l.object({type:l.literal("global_search"),threads:l.array(UMe),skills:l.array(BMe),people:l.array(FMe)}),jMe=l.object({q:l.string().trim().min(1).max(80)}),oW=DMe.router({globalSearch:{method:"GET",path:"/search",headers:l.object({authorization:l.string().min(1).optional()}),query:jMe,responses:{200:GMe,401:rW,422:rW},summary:"Global navbar search. Threads and people are searched globally (subject to thread visibility); skills are scoped to the viewer workspace. Max 5 results per kind."}});var HMe=Ur(),VMe=["gmail.com","googlemail.com","hotmail.com","outlook.com","live.com","msn.com","yahoo.com","ymail.com","rocketmail.com","icloud.com","me.com","mac.com","aol.com","proton.me","protonmail.com","pm.me","tutanota.com","tuta.io","fastmail.com","hey.com","mail.com","gmx.com","gmx.net","zoho.com","zohomail.com","hushmail.com","lycos.com","inbox.com","yandex.com","yandex.ru","mail.ru","inbox.ru","bk.ru","list.ru","rambler.ru","qq.com","163.com","126.com","yeah.net","sina.com","naver.com","daum.net","hanmail.net","kakao.com","rediffmail.com","comcast.net","verizon.net","att.net","sbcglobal.net","bellsouth.net","earthlink.net","charter.net","cox.net","roadrunner.com","spectrum.net","btinternet.com","virginmedia.com","sky.com","orange.fr","wanadoo.fr","free.fr","laposte.net","web.de","t-online.de","gmx.de","libero.it","virgilio.it","alice.it","seznam.cz","centrum.cz","wp.pl","interia.pl","o2.pl","onet.pl"],hgt=new Set(VMe);var qMe=l.object({id:l.string().uuid(),role:l.enum(["user","assistant"]),content:l.string().min(1),timestamp:l.string().datetime()}),$Me=l.object({id:l.string().uuid(),title:l.string().min(1),author:l.string().min(1),authorAvatar:l.string().min(1).max(4),model:l.string().min(1),turnCount:l.number().int().nonnegative(),createdAt:l.string().datetime(),preview:l.string()}),ggt=$Me.extend({messages:l.array(qMe)}),y=l.object({message:l.string()}),zMe=/^[a-zA-Z0-9_-]{2,32}$/,pW=l.string().regex(zMe,"Handle must be 2\u201332 characters: letters, numbers, dashes, or underscores."),yx=l.object({id:l.string(),first_name:l.string().min(1),last_name:l.string().min(1),display_name:l.string().min(1),stytch_id:l.string().nullable(),handle:l.string().nullable(),bio:l.string().max(280).nullable(),avatar_url:l.string().nullable(),banner_url:l.string().nullable(),share_new_threads_to_workspace:l.boolean(),experimental_features_enabled:l.boolean(),onboarded_at:l.string().nullable()}),YMe=l.object({authProviderUserId:l.string().min(1).optional(),organizationId:l.string().min(1).optional(),org_name:l.string().min(1).optional(),organizations:l.array(l.object({id:l.string().min(1),name:l.string().min(1)})),emailAddress:l.string().email(),name:l.string().nullable(),user:yx,is_admin:l.boolean()}),WMe=l.object({workos_client_id:l.string().min(1),workos_api_origin:l.string().url()}),KMe=l.object({share_new_threads_to_workspace:l.boolean().optional(),experimental_features_enabled:l.boolean().optional(),onboarded_at:l.union([l.literal("now"),l.null()]).optional(),display_name:l.string().min(1).max(120).optional(),handle:pW.optional(),bio:l.string().max(280).nullable().optional(),avatar_storage_url:l.string().min(1).nullable().optional(),banner_storage_url:l.string().min(1).nullable().optional()}).refine(t=>Object.keys(t).length>0,{message:"At least one field must be provided"}),QMe=l.object({id:l.string(),display_name:l.string(),handle:l.string().nullable(),avatar_url:l.string().nullable(),visible_thread_count:l.number().int().nonnegative(),last_active_at:l.string().datetime().nullable()}),fW=l.object({id:l.string().min(1),display_name:l.string().min(1),handle:l.string().nullable(),bio:l.string().max(280).nullable(),avatar_url:l.string().nullable(),banner_url:l.string().nullable(),organization_name:l.string().min(1).nullable(),created_at:l.string().min(1),visible_thread_count:l.number().int().nonnegative(),follower_count:l.number().int().nonnegative(),following_count:l.number().int().nonnegative(),published_project_count:l.number().int().nonnegative(),is_following:l.boolean(),is_self:l.boolean()}),JMe=l.object({type:l.literal("list"),list_type:l.literal("organization_member"),objects:l.array(QMe)}),XMe=l.object({email_address:l.string().email()}),ZMe=l.object({email_address:l.string().email(),invitation_id:l.string().min(1)}),eve=l.object({organization_id:l.string().min(1),organization_name:l.string().min(1),domain:l.string().min(1),created:l.boolean()}),tve=l.object({location:l.string().trim().min(1),contact:l.string().trim().email()}),nve=l.object({location:l.string().min(1),contact:l.string().email(),created_at:l.string().datetime()}),rve=l.object({first_name:l.string().min(1),last_name:l.string().min(1),display_name:l.string().min(1),stytch_id:l.string().min(1).optional()}),ove=l.object({name:l.string().min(1),email_domains:l.array(l.string().min(1)).nonempty(),stytch_org_id:l.string().min(1)}),sve=l.object({user:rve,organization:ove}),ive=l.object({path_glob:l.string().min(1),name:l.string().min(1),description:l.string().min(1)}),ave=l.object({repo_origin_path:l.string().min(1),building_blocks:l.array(ive)}),mW=l.string().regex(/^th_[0-9A-Za-z]{22}$/),h0=l.string().regex(/^tb_[0-9A-Za-z]{22}$/),uve=l.object({id:mW,author:l.object({id:l.string().min(1),display_name:l.string().min(1)}),body:l.string(),created_at:l.string().datetime(),repo_origin_path:l.string().min(1),latest_revision_id:h0,revision_count:l.number().int().positive()}),cve=l.object({id:l.string().min(1),display_name:l.string().min(1)}),lve=l.object({id:l.string().min(1),author_id:l.string().min(1).nullable(),author:cve.nullable(),created_at:l.string().datetime(),deleted_at:l.string().datetime().nullable(),content:l.string().min(1)}),dve=l.object({id:l.string().min(1),thread_block_id:l.string().min(1),created_at:l.string().datetime(),resolved_at:l.string().datetime().nullable(),comments:l.array(lve)}),pve=l.object({thread_block_id:h0,from_position:l.number().int().positive(),to_position:l.number().int().positive(),selected_text:l.string().min(1),content:l.string().trim().min(1)}),fve=l.object({id:l.string().min(1)}),mve=l.object({content:l.string().trim().min(1)}),_ve=l.object({id:l.string().min(1)}),hve=l.object({content:l.string().trim().min(1)}),gve=l.object({id:l.string().min(1)}),Tve=l.object({content:l.string().trim().min(1)}),Eve=l.object({id:l.string().min(1)}),Sve=l.object({resolved:l.boolean()}),Ave=l.object({id:l.string().min(1),resolved_at:l.string().datetime().nullable()}),yve=l.object({resolved:l.boolean()}),bve=l.object({id:l.string().min(1),resolved_at:l.string().datetime().nullable()}),_W=l.record(l.unknown()),Rve=l.object({id:h0,body:l.string(),created_at:l.string().datetime(),prosemirror_json:_W,comment_threads:l.array(dve)}),Ive=l.object({id:mW,created_at:l.string().datetime(),repo_origin_path:l.string().min(1),author:l.object({id:l.string().min(1),display_name:l.string().min(1)}),latest_revision_id:h0,revision_count:l.number().int().positive(),revisions:l.array(Rve)}),Ove=l.object({type:l.literal("list"),list_type:l.literal("plan"),has_more:l.boolean(),objects:l.array(uve)}),Cve=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional(),author_id:l.string().min(1).optional(),repo_origin_path:l.string().min(1).optional()}),hW=l.object({id:l.string().min(1),organization_id:l.string().min(1),created_at:l.string().min(1),repo_origin_path:l.string().min(1),path_glob:l.string().min(1),name:l.string().min(1),description:l.string().min(1)}),Nve=l.array(hW),xve=l.object({type:l.literal("list"),list_type:l.literal("building_block"),has_more:l.boolean(),objects:l.array(hW)}),Pve=l.object({repo_origin_path:l.string().min(1),before:l.string().min(1).optional(),after:l.string().min(1).optional()}),Mve=l.enum(["thread","building_block"]),vve=l.object({repo_origin_path:l.string().min(1),sources:l.array(Mve).nonempty()}),kve=l.object({type:l.literal("list"),list_type:l.literal("repository"),has_more:l.boolean(),objects:l.array(vve)}),$o=l.enum(["claudeCode","codex","amp","cursor","cowork","unspecified"]),wve=l.object({uploads:l.array(l.string()),outputs:l.array(l.string())}),Lve=l.object({connected:l.boolean(),last_upload_at:l.string().nullable(),harnesses:l.array($o)}),Dve=["transcript","plan"],Uve=l.enum(Dve),Bve=l.object({md5:l.string().min(1),harness:$o,filename:l.string().min(1).optional(),repo_origin_path:l.string().min(1).optional(),harness_internal_id:l.string().min(1).optional(),file_type:Uve.optional(),remix_of_thread_id:l.string().min(1).optional(),artifact_metadata:wve.optional()}).refine(t=>(t.filename?.trim().length??0)>0||(t.harness_internal_id?.trim().length??0)>0,{path:["harness_internal_id"],message:"filename or harness_internal_id is required"}),Rx=l.object({id:l.string().min(1),display_name:l.string().min(1),avatar_url:l.string().nullable()}),Fve=l.object({id:l.string().min(1),display_name:l.string().min(1)}),gW=l.object({id:l.string().min(1),author_id:l.string().min(1).nullable(),author:Fve.nullable(),created_at:l.string().datetime(),deleted_at:l.string().datetime().nullable(),content:l.string().min(1)}),TW=l.object({id:l.string().min(1),thread_block_id:l.string().min(1),created_at:l.string().datetime(),resolved_at:l.string().datetime().nullable()}),Gve=TW.extend({comments:l.array(gW)}),im=l.object({id:l.string().min(1),type:l.string().min(1),index_in_thread:l.number().int().nonnegative(),isCritiqued:l.boolean(),comment_threads:l.array(Gve).optional()}).passthrough(),EW=l.object({type:l.literal("list"),list_type:l.literal("thread_block"),has_more:l.boolean(),objects:l.array(im)}),sW=im.extend({type:l.literal("plan"),prosemirror_json:_W,thread_file_id:l.string().min(1)}),jve=l.union([l.literal(-1),l.literal(1)]),SW=l.union([l.literal(-1),l.literal(0),l.literal(1)]),iW=l.object({score:l.number().int(),up_count:l.number().int().nonnegative(),down_count:l.number().int().nonnegative(),viewer_vote:SW}),Hve=l.object({value:jve}),Vve=l.object({id:l.string().min(1),display_name:l.string().min(1),avatar_url:l.string().nullable()}),Ru=l.object({id:l.string().min(1),thread_id:l.string().min(1),author_id:l.string().min(1).nullable(),author:Vve.nullable(),parent_comment_id:l.string().min(1).nullable(),content:l.string(),created_at:l.string().datetime(),updated_at:l.string().datetime(),deleted_at:l.string().datetime().nullable()}),qve=l.object({type:l.literal("list"),list_type:l.literal("thread_comment"),objects:l.array(Ru)}),$ve=l.object({content:l.string().trim().min(1).max(4e3),parent_comment_id:l.string().min(1).optional()}),zve=Ru,Yve=l.object({content:l.string().trim().min(1).max(4e3)}),Wve=Ru,Kve=Ru,Tgt=l.discriminatedUnion("kind",[l.object({kind:l.literal("created"),thread_id:l.string().min(1),actor_user_id:l.string().min(1),version:l.number(),comment:Ru}),l.object({kind:l.literal("updated"),thread_id:l.string().min(1),actor_user_id:l.string().min(1),version:l.number(),comment:Ru}),l.object({kind:l.literal("deleted"),thread_id:l.string().min(1),actor_user_id:l.string().min(1),version:l.number(),comment:Ru})]),Qve=l.enum(["pending","generating","ready","failed"]),Jve=l.enum(["pending","generating","ready","failed"]),Xve=l.enum(["pending","placeholder","ai","user"]),AW=l.enum(["pending","generating","ready","failed"]),Ix=l.enum(["pending","generating","ready","failed","disabled"]),yW=l.enum(["pending","generating","ready","failed"]),Zve=l.object({title:l.string().min(1),body:l.string().min(1),files:l.array(l.string()).optional()}),eke=l.object({status:Ix,url:l.string().nullable(),url_expires_at:l.string().nullable(),generated_at:l.string().nullable(),model:l.string().nullable()}),tke=l.object({status:yW,steps:l.array(Zve),generated_at:l.string().nullable()}),nke=l.object({remix_of_thread_id:l.string().nullable(),remix_count:l.number().int().nonnegative()}),rke=l.object({cover:eke,how_to:tke,lineage:nke}),oke=l.object({id:l.string().min(1),title:l.string().min(1),author:l.object({id:l.string().min(1),display_name:l.string(),handle:l.string().nullable(),avatar_url:l.string().nullable()}),cover:l.object({url:l.string(),url_expires_at:l.string()}),remix_count:l.number().int().nonnegative(),started_at:l.string(),cover_generated_at:l.string()}),ske=l.object({type:l.literal("list"),list_type:l.literal("card_feed_item"),has_more:l.boolean(),objects:l.array(oke)}),bW=l.enum(["asked","requested","decided","corrected","shared","requirement"]),ike=l.object({id:l.string().min(1),kind:bW,summary:l.string().min(1),block_id:l.string().min(1)}),ake=l.object({type:l.literal("list"),list_type:l.literal("thread_decision"),status:AW,generated_at:l.string().nullable(),objects:l.array(ike)}),uke=l.object({thread_id:l.string().min(1),source_url:l.string().min(1),title:l.string().min(1),summary:l.string().nullable(),harness:$o,visibility:l.enum(["private","workspace","public"]),started_at:l.string().min(1),author:l.object({display_name:l.string().min(1),handle:l.string().nullable()}),original_user_prompt:l.string().nullable(),last_assistant_message:l.string().nullable(),decisions:l.array(l.object({kind:bW,summary:l.string().min(1)})),files_touched:l.array(l.string()),truncated:l.boolean()}),cd=l.object({id:l.string().min(1),thread_file_id:l.string().min(1),organization_id:l.string().min(1),author:Rx,repo:l.string().min(1),title:l.string().min(1),started_at:l.string().min(1),blocks:EW,user_message_count:l.number().int().nonnegative(),files_touched:l.array(l.string()),skills_invoked:l.array(l.string()),harness:$o,transcript_parsing_state:l.enum(["pending","parsed","too_large_to_parse"]),visibility:l.enum(["private","workspace","public"]),has_plan:l.boolean().optional(),summary:l.string().nullable(),summary_status:Qve,summary_generated_at:l.string().nullable(),title_status:Jve,title_generated_at:l.string().nullable(),title_source:Xve,decisions_status:AW,decisions_generated_at:l.string().nullable(),score:l.number().int(),up_count:l.number().int().nonnegative(),down_count:l.number().int().nonnegative(),viewer_vote:SW,comment_count:l.number().int().nonnegative(),is_favorited:l.boolean(),card:rke}),cke=l.object({storage_url:l.string().min(1)}),lke=l.object({storage_url:l.string(),harness:$o,thread:cd.nullable()}),dke=l.object({status:l.literal("complete"),thread_files:l.array(lke)}),pke=l.object({id:l.string(),presigned_url:l.string().nullable(),presigned_url_expires_at:l.string().nullable(),storage_url:l.string(),harness:$o,expected_md5:l.string(),error:l.string().nullable(),thread:cd.nullable(),remix_parent_dropped:l.boolean().optional()}),fke=l.object({id:l.string(),substrate:l.enum(["s3","filesystem"]),status:l.enum(["incomplete","locked_for_parsing","complete","error"]),thread_files:l.array(pke)}),mke=l.object({visibility:l.enum(["private","workspace","public"]).optional(),title:l.string().trim().min(1).max(200).optional()}).refine(t=>t.visibility!==void 0||t.title!==void 0,{message:"At least one of visibility or title must be provided"}),_ke=l.discriminatedUnion("visibility",[l.object({visibility:l.literal("private")}),l.object({visibility:l.literal("workspace")}),l.object({visibility:l.literal("public"),title:l.string().min(1),author_display_name:l.string().min(1),author_avatar_url:l.string().nullable(),first_user_message:l.string().nullable(),summary:l.string().nullable(),started_at:l.string().min(1),harness:$o,cover_url:l.string().nullable()})]),hke=cd,aW=l.object({type:l.literal("list"),list_type:l.literal("thread"),has_more:l.boolean(),objects:l.array(hke)}),gke=l.enum(["recent","popular"]),Tke=l.enum(["everyone","following"]),Eke=cd,Ske=l.object({type:l.literal("list"),list_type:l.literal("discover_thread"),has_more:l.boolean(),objects:l.array(Eke)}),Ake=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional(),sort:gke.optional(),scope:Tke.optional(),harness:$o.optional(),search:l.string().max(200).optional()}),yke=l.object({thread_count:l.number().int().nonnegative(),author_count:l.number().int().nonnegative(),organization_count:l.number().int().nonnegative(),harness_breakdown:l.record($o,l.number().int().nonnegative())}),bke=l.object({id:l.string(),status:l.enum(["incomplete","locked_for_parsing","complete","error"]),created_at:l.string(),thread_count:l.number().int().nonnegative()}),Rke=l.object({type:l.literal("list"),list_type:l.literal("upload_session"),objects:l.array(bke)}),Ike=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional()}),Oke=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional(),author_ids:l.string().min(1).optional(),created_at:l.string().min(1).optional(),filepath_prefixes:l.string().min(1).optional()}),Cke=l.object({path:l.string().min(1),start_offset:l.number().int().nonnegative(),end_offset:l.number().int().positive()}),Ox=l.enum(["captured","published"]),Nke=l.enum(["workspace","link"]),RW=l.object({id:l.string(),display_name:l.string(),avatar_url:l.string().nullable()}),xke=l.object({name:l.string(),usage_count:l.number().int().nonnegative(),author_count:l.number().int().nonnegative(),first_used_at:l.string().nullable(),last_used_at:l.string().nullable(),usage_count_last_24h:l.number().int().nonnegative(),usage_count_last_7d:l.number().int().nonnegative(),id:l.string().nullable(),description:l.string().nullable(),source:Ox.nullable(),has_content:l.boolean()}),Pke=l.object({type:l.literal("list"),list_type:l.literal("skill"),objects:l.array(xke)}),Mke=l.object({id:l.string(),title:l.string(),visibility:l.enum(["private","workspace","public"]),started_at:l.string(),author:Rx,skills_invoked:l.array(l.string())}),vke=l.object({id:l.string().nullable(),name:l.string(),description:l.string().nullable(),body_md:l.string().nullable(),source:Ox.nullable(),visibility:Nke.nullable(),share_url:l.string().nullable(),latest_version:l.number().int().nonnegative().nullable(),author:RW.nullable(),usage_count:l.number().int().nonnegative(),author_count:l.number().int().nonnegative(),first_used_at:l.string().nullable(),last_used_at:l.string().nullable(),threads:l.array(Mke)}),kke=l.object({description:l.string().nullable().optional(),body_md:l.string().min(1),display_name:l.string().nullable().optional(),published:l.boolean().optional()}),wke=l.object({id:l.string(),name:l.string(),latest_version:l.number().int().positive(),source:Ox,content_hash:l.string()}),Lke=l.object({share_url:l.string(),share_token:l.string()}),Dke=l.object({id:l.string(),name:l.string(),description:l.string().nullable(),body_md:l.string(),latest_version:l.number().int().positive(),author:RW.nullable(),shared_at:l.string()}),Uke=l.object({path:l.string().min(1),text:l.string().max(64e3)}),Bke=l.enum(["text_edit","redact","delete_block"]),Fke=l.object({id:l.string(),thread_block_id:l.string(),editor:l.object({id:l.string(),display_name:l.string()}),kind:Bke,path:l.string().nullable(),previous_text:l.string().nullable(),new_text:l.string().nullable(),created_at:l.string()}),Gke=l.object({type:l.literal("list"),list_type:l.literal("thread_block_edit"),objects:l.array(Fke)}),jke=l.object({organization_count:l.number().int().nonnegative(),user_count:l.number().int().nonnegative(),thread_count:l.number().int().nonnegative(),thread_count_last_24h:l.number().int().nonnegative(),user_count_last_24h:l.number().int().nonnegative()}),Hke=l.object({id:l.string(),name:l.string(),email_domains:l.array(l.string()),stytch_org_id:l.string(),member_count:l.number().int().nonnegative(),thread_count:l.number().int().nonnegative(),default_thread_visibility:l.enum(["private","workspace","public"]),created_at:l.string()}),Vke=l.object({type:l.literal("list"),list_type:l.literal("admin_organization"),objects:l.array(Hke)}),IW=l.object({id:l.string(),name:l.string()}),qke=l.object({id:l.string(),display_name:l.string(),stytch_id:l.string().nullable(),thread_count:l.number().int().nonnegative(),onboarded_at:l.string().nullable(),created_at:l.string(),organizations:l.array(IW)}),$ke=l.object({q:l.string().trim().min(1).max(120).optional()}),zke=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1)}),Yke=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1),is_following:l.literal(!0)}),Wke=l.object({type:l.literal("list"),list_type:l.literal("admin_user"),objects:l.array(qke)}),Kke=l.object({id:l.string(),title:l.string(),started_at:l.string(),created_at:l.string(),deleted_at:l.string().nullable(),visibility:l.enum(["private","workspace","public"]),harness:$o,author:Rx,organization:IW}),Qke=l.object({type:l.literal("list"),list_type:l.literal("admin_thread"),has_more:l.boolean(),objects:l.array(Kke)}),Jke=l.object({before:l.string().min(1).optional(),after:l.string().min(1).optional()}),uW=l.object({token:l.string().min(1),thread_id:l.string().min(1)}),Xke=l.object({visitor:l.string().min(1).max(64).optional()}),Zke=l.object({user_id:l.string(),display_name:l.string(),shares_sent:l.number().int().nonnegative(),unique_viewers:l.number().int().nonnegative(),attributed_signups:l.number().int().nonnegative()}),ewe=l.object({window_days:l.number().int().positive(),shares_sent:l.number().int().nonnegative(),unique_viewers:l.number().int().nonnegative(),attributed_signups:l.number().int().nonnegative(),active_sharers:l.number().int().nonnegative(),k_factor:l.number().nullable(),shares_sent_sparkline:l.array(l.number().int().nonnegative()),top_sharers:l.array(Zke)}),twe=l.object({windows:l.array(ewe)}),nwe=l.object({quoted_text:l.string().min(1),comment:l.string().nullable(),type:l.enum(["comment","highlight:trapdoor"])}),rwe=TW,owe=gW.extend({comment_thread_id:l.string().min(1)}),swe=l.object({markdown:l.string().min(1)}),iwe=l.object({storage_url:l.string().min(1),thread_file_id:l.string().min(1),parsed_plan_block:sW,critiqued_plan_block:sW,annotations:l.array(nwe),comment_threads:l.array(rwe),comments:l.array(owe)}),ld=l.enum(gx),OW=l.object({workspace_scope:l.boolean(),review:l.boolean(),shared_thread_ttl_days:l.number().int().positive().nullable()}),bx=l.object({subject_type:l.enum(["user","organization"]),subject_id:l.string().min(1),effective_plan:ld,admin_override:ld.nullable(),stripe_subscription_status:l.string().nullable(),cancel_at_period_end:l.boolean(),current_period_end:l.string().nullable(),seat_quantity:l.number().int().positive(),member_count:l.number().int().nonnegative().nullable(),features:OW}),awe=l.object({effective_plan:ld,features:OW,user:bx,organization:bx.nullable()}),uwe=l.object({plan:l.enum(["creator","team"]),seat_quantity:l.number().int().positive().optional()}),cwe=l.object({checkout_url:l.string().min(1)}),lwe=l.object({portal_url:l.string().min(1)}),dwe=l.object({seat_quantity:l.number().int().positive()}),cW=l.object({plan:ld.nullable()}),_0=l.object({subject_type:l.enum(["user","organization"]),subject_id:l.string().min(1),label:l.string().min(1),effective_plan:ld,admin_override:ld.nullable(),stripe_subscription_status:l.string().nullable(),seat_quantity:l.number().int().positive()}),pwe=l.object({users:l.array(_0),organizations:l.array(_0)}),fwe=l.object({id:l.string().min(1),display_name:l.string().min(1),handle:l.string().nullable(),avatar_url:l.string().nullable()}),mwe=l.object({thread_id:l.string().min(1),title:l.string().min(1),author:fwe,last_active_at:l.string().datetime(),last_block_excerpt:l.string().nullable(),last_block_kind:l.string().min(1).nullable(),is_streaming:l.boolean()}),_we=l.object({type:l.literal("list"),list_type:l.literal("live_thread"),objects:l.array(mwe)}),hwe=l.object({thread_id:l.string().min(1)}),gwe=l.object({thread_id:l.string().min(1),last_seen_at:l.string().datetime(),started_at:l.string().datetime()}),Twe=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1),is_following:l.literal(!0),follower_count:l.number().int().nonnegative()}),Ewe=l.object({follower_id:l.string().min(1),followee_id:l.string().min(1),is_following:l.literal(!1),follower_count:l.number().int().nonnegative()}),CW=l.object({id:l.string().min(1),display_name:l.string().min(1),handle:l.string().nullable(),avatar_url:l.string().nullable(),bio:l.string().max(280).nullable(),is_following:l.boolean(),is_self:l.boolean()}),lW=l.object({type:l.literal("list"),list_type:l.literal("user_follow"),objects:l.array(CW)}),Swe=l.object({date:l.string().regex(/^\d{4}-\d{2}-\d{2}$/),count:l.number().int().nonnegative()}),Awe=l.object({window_start:l.string().datetime(),window_end:l.string().datetime(),total_contributions:l.number().int().nonnegative(),days_active:l.number().int().nonnegative(),daily_average:l.number().nonnegative(),current_streak_days:l.number().int().nonnegative(),days:l.array(Swe)}),ywe=l.object({type:l.literal("thread_created"),occurred_at:l.string().datetime(),id:l.string().min(1),thread:l.object({id:l.string().min(1),title:l.string(),visibility:l.enum(["private","workspace","public"])})}),bwe=l.object({type:l.literal("comment_posted"),occurred_at:l.string().datetime(),id:l.string().min(1),comment_excerpt:l.string(),thread:l.object({id:l.string().min(1),title:l.string(),visibility:l.enum(["private","workspace","public"])})}),Rwe=l.object({type:l.literal("project_published"),occurred_at:l.string().datetime(),id:l.string().min(1),project:l.object({id:l.string().min(1),name:l.string().min(1)})}),Iwe=l.object({type:l.literal("user_followed"),occurred_at:l.string().datetime(),id:l.string().min(1),followee:CW}),Owe=l.discriminatedUnion("type",[ywe,bwe,Rwe,Iwe]),Cwe=l.object({type:l.literal("list"),list_type:l.literal("user_activity"),objects:l.array(Owe)}),Nwe=l.object({id:l.string().min(1),name:l.string().min(1),excerpt:l.string(),published_at:l.string().datetime(),updated_at:l.string().datetime()}),xwe=l.object({type:l.literal("list"),list_type:l.literal("profile_published_project"),objects:l.array(Nwe)}),dW=l.object({id:l.string().min(1),published_at:l.string().datetime().nullable()}),Pwe=l.enum(["avatar","banner"]),NW=l.enum(["image/png","image/jpeg","image/webp","image/gif"]),Mwe=l.object({kind:Pwe,content_type:NW,base64_data:l.string().min(1)}),vwe=l.object({substrate:l.enum(["s3","filesystem"]),storage_url:l.string().min(1)}),kwe=l.object({content_type:NW,base64_data:l.string().min(1)}),wwe=l.object({cover_status:Ix,cover_url:l.string().min(1),cover_url_expires_at:l.string().min(1),cover_generated_at:l.string().min(1)}),Lwe=fW,xW=HMe.router({health:{method:"GET",path:"/health",responses:{200:l.object({status:l.literal("ok")})},summary:"Health check"},whoAmI:{method:"GET",path:"/whoami",headers:l.object({authorization:l.string().min(1).optional(),"x-lore-referral-token":l.string().min(1).max(16).optional()}),responses:{200:YMe,401:y},summary:"Validate a WorkOS Bearer token and return member plus user fields"},getCliAuthConfig:{method:"GET",path:"/cli-auth/config",responses:{200:WMe,503:y},summary:"Return public WorkOS CLI Auth configuration for the Lore CLI"},getCliStatus:{method:"GET",path:"/users/me/cli-status",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Lve,401:y},summary:"Return whether the viewer has connected the Lore CLI (i.e., uploaded any thread under a non-unspecified harness), plus the latest upload timestamp."},recordHeartbeat:{method:"POST",path:"/heartbeat",headers:l.object({authorization:l.string().min(1).optional()}),body:hwe,responses:{200:gwe,401:y,403:y,404:y,422:y},summary:"Record (or refresh) a presence heartbeat for the authenticated user against one of their own threads. Idempotent; the daemon should call this every ~30s while a session is open."},listLiveThreads:{method:"GET",path:"/threads/live",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:_we,401:y,403:y},summary:"List members with user-block activity in the last 10 minutes. Org-scoped, deduped per author, max 10."},listThreads:{method:"GET",path:"/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:Oke,responses:{200:aW,401:y},summary:"List threads visible to the authenticated user"},getThread:{method:"GET",path:"/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:cd,404:y},summary:"Load a visible thread by id"},getSimilarThreads:{method:"GET",path:"/threads/:id/similar",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:aW,404:y,409:y},summary:"List the top 20 visible threads with the closest summary embedding"},getThreadRemixBrief:{method:"GET",path:"/threads/:id/remix",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:uke,401:y,403:y,404:y},summary:"Fetch a portable handoff brief that lets another agent continue this thread"},listThreadBlocks:{method:"GET",path:"/threads/:id/blocks",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),query:Ike,responses:{200:EW,401:y},summary:"List blocks for a visible thread"},createThreadBlockCommentThread:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:mve,responses:{201:_ve,401:y,404:y},summary:"Create a new block-level comment thread on a visible thread block"},createThreadBlockComment:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId/comments",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1),commentThreadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Tve,responses:{201:Eve,401:y,404:y,409:y},summary:"Reply to a block-level comment thread on a visible thread block"},updateThreadBlockCommentThread:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1),commentThreadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:yve,responses:{200:bve,401:y,404:y},summary:"Resolve or reopen a block-level comment thread on a visible thread block"},listSkills:{method:"GET",path:"/skills",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Pke,401:y},summary:"Aggregate skill usage across threads the viewer can see"},getSkillDetail:{method:"GET",path:"/skills/:name",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:vke,401:y,404:y},summary:"Per-skill detail: usage stats + visible threads that invoked it"},getSkillRaw:{method:"GET",path:"/skills/:name/raw",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:l.string(),401:y,403:y,404:y},summary:"Raw SKILL.md body for a skill (download / install path)"},publishSkill:{method:"PUT",path:"/skills/:name",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:kke,responses:{200:wke,401:y,403:y,422:y},summary:"Publish or capture a skill body for the caller\u2019s workspace"},mintSkillShare:{method:"POST",path:"/skills/:name/share",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Lke,401:y,403:y,404:y},summary:"Mint (or rotate) a public share token for a skill"},revokeSkillShare:{method:"DELETE",path:"/skills/:name/share",pathParams:l.object({name:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{204:l.null(),401:y,403:y,404:y},summary:"Revoke an active share token for a skill"},getSharedSkill:{method:"GET",path:"/shared-skills/:token",pathParams:l.object({token:l.string().min(1)}),responses:{200:Dke,404:y},summary:"Read a shared skill by its public share token (no auth)"},redactThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/redactions",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Cke,responses:{200:im,401:y,403:y,404:y,422:y},summary:"Permanently redact a character range within a text field of a thread block (author only)"},updateThreadBlockText:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/text",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Uke,responses:{200:im,401:y,403:y,404:y,422:y},summary:"Replace a single text leaf in a thread block with new content (author only)"},critiqueThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/critique",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:im,401:y,403:y,404:y,409:y,422:y},summary:"Critique a plan block once and persist its annotations as nested comment threads (author only)"},deleteThreadBlock:{method:"DELETE",path:"/threads/:threadId/blocks/:blockId",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.null(),401:y,403:y,404:y},summary:"Soft-delete a thread block (author only)"},listThreadBlockEdits:{method:"GET",path:"/threads/:threadId/blocks/:blockId/edits",pathParams:l.object({threadId:l.string().min(1),blockId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Gke,401:y,404:y},summary:"List edits made to a thread block (visible to anyone who can see the thread)"},listThreadDecisions:{method:"GET",path:"/threads/:id/decisions",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:ake,401:y,404:y},summary:"List AI-extracted user decisions for a thread, in chronological order"},updateThread:{method:"PATCH",path:"/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:mke,responses:{200:cd,401:y,403:y,404:y},summary:"Update thread visibility (author only)"},deleteThread:{method:"DELETE",path:"/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.null(),401:y,403:y,404:y},summary:"Soft-delete a thread (author only)"},generateThreadCard:{method:"POST",path:"/threads/:id/card/generate",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:l.object({cover_status:Ix,how_to_status:yW}),401:y,403:y,404:y,429:y.extend({retry_after_seconds:l.number().int().nonnegative()})},summary:"Enqueue cover image + how-to recipe generation for the thread. Author-only. Idempotent \u2014 recently-fired statuses are not double-enqueued. Rate-limited: at most one cover generation per minute per thread (cooldown begins when the previous cover finishes). Used to populate cards on legacy threads (created before Lore Cards) and to retry after a 'failed' status or opt back in from 'disabled'."},uploadThreadCover:{method:"POST",path:"/threads/:id/card/cover/upload",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:kwe,responses:{200:wwe,401:y,403:y,404:y,413:y,422:y},summary:"Upload a custom cover image for a thread. Author or Tanagram admin only. Bytes go to the same storage substrate the AI cover uses (S3 in prod, filesystem in dev), and the threads row is updated atomically with the new cover_storage_url, cover_status='ready', cover_generated_at=now, cover_model='user-uploaded' so subsequent re-rolls / how-to fan-outs treat the upload like any other ready cover."},castThreadVote:{method:"PUT",path:"/threads/:id/vote",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Hve,responses:{200:iW,401:y,403:y,404:y,422:y},summary:"Cast or change the caller's up/down vote on a public thread. Idempotent \u2014 re-casting the same value is a no-op."},clearThreadVote:{method:"DELETE",path:"/threads/:id/vote",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:iW,401:y,404:y},summary:"Clear the caller's vote on a thread. No-op when the caller hasn't voted."},listThreadComments:{method:"GET",path:"/threads/:threadId/comments",pathParams:l.object({threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:qve,403:y,404:y},summary:"List all (live + soft-deleted as tombstones) comments on a public thread, flat with parent_comment_id pointers."},createThreadComment:{method:"POST",path:"/threads/:threadId/comments",pathParams:l.object({threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:$ve,responses:{201:zve,401:y,403:y,404:y,422:y},summary:"Post a top-level or reply comment on a public thread."},updateThreadComment:{method:"PATCH",path:"/threads/:threadId/comments/:commentId",pathParams:l.object({threadId:l.string().min(1),commentId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Yve,responses:{200:Wve,401:y,403:y,404:y,422:y},summary:"Edit your own thread comment (author only; rejects edits to soft-deleted rows)."},deleteThreadComment:{method:"DELETE",path:"/threads/:threadId/comments/:commentId",pathParams:l.object({threadId:l.string().min(1),commentId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Kve,401:y,403:y,404:y},summary:"Soft-delete your own thread comment (author only). Idempotent."},getThreadPreview:{method:"GET",path:"/threads/:id/preview",pathParams:l.object({id:l.string().min(1)}),responses:{200:_ke,404:y},summary:"Unauthenticated, visibility-redacted metadata for OG / social preview consumers"},createUser:{method:"POST",path:"/users",headers:l.object({authorization:l.string().min(1).optional()}),body:sve,responses:{201:yx,401:y},summary:"Create a user record with ApiKey authentication"},getUser:{method:"GET",path:"/users/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:fW,404:y},summary:"Public profile for a user. Optional auth \u2014 unauthenticated viewers see only public thread metadata; signed-in viewers see counts scoped to the threads they'd normally be able to access."},updateCurrentUser:{method:"PATCH",path:"/users/me",headers:l.object({authorization:l.string().min(1).optional()}),body:KMe,responses:{200:yx,401:y,409:y,422:y},summary:"Update the authenticated user profile"},getUserByHandle:{method:"GET",path:"/users/by-handle/:handle",pathParams:l.object({handle:pW}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Lwe,404:y},summary:"Resolve a public profile by handle \u2014 same shape as GET /users/:id but keyed on the user's chosen handle."},listUserActivity:{method:"GET",path:"/users/:id/activity",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),query:l.object({limit:l.coerce.number().int().positive().max(100).optional()}),responses:{200:Cwe,404:y},summary:"Reverse-chronological activity feed for a user, scoped to what the viewer can see (same visibility rules as listThreads)."},getUserContributions:{method:"GET",path:"/users/:id/contributions",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Awe,404:y},summary:"Daily contribution counts for the trailing 365 days \u2014 counts thread blocks the user authored on threads visible to the viewer."},listUserFollowers:{method:"GET",path:"/users/:id/followers",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:lW,404:y},summary:"List the users following a given user."},listUserFollowing:{method:"GET",path:"/users/:id/following",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:lW,404:y},summary:"List the users a given user is following."},followUser:{method:"POST",path:"/users/:id/follow",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Twe,401:y,404:y,409:y,422:y},summary:"Follow another user. Idempotent \u2014 repeating the call is a no-op."},unfollowUser:{method:"DELETE",path:"/users/:id/follow",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:Ewe,401:y,404:y},summary:"Unfollow a user. Idempotent \u2014 repeating the call is a no-op."},listProfilePublishedProjects:{method:"GET",path:"/users/:id/projects",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:xwe,404:y},summary:"Projects the user has published to their public profile."},publishProject:{method:"POST",path:"/projects/:id/publish",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:dW,401:y,403:y,404:y},summary:"Publish a project to the author's public profile. Stamps published_at with `now()`. Author-only."},unpublishProject:{method:"DELETE",path:"/projects/:id/publish",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:dW,401:y,403:y,404:y},summary:"Remove a project from the author's public profile."},uploadProfileImage:{method:"POST",path:"/users/me/profile-image",headers:l.object({authorization:l.string().min(1).optional()}),body:Mwe,responses:{200:vwe,401:y,413:y,422:y},summary:"Upload an avatar or banner image (base64-encoded JSON body). The API streams the bytes to its configured storage substrate using its own credentials and returns the canonical storage URL the client passes to PATCH /users/me."},listOrganizationMembers:{method:"GET",path:"/organization/members",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:JMe,401:y},summary:"List members of the authenticated user\u2019s organization"},createOrganizationInvite:{method:"POST",path:"/organization/invites",headers:l.object({authorization:l.string().min(1).optional()}),body:XMe,responses:{201:ZMe,401:y,403:y,409:y,422:y},summary:"Invite a teammate to the authenticated user\u2019s workspace via WorkOS AuthKit"},ensureWorkOSOrganization:{method:"POST",path:"/organization/workos/ensure",headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{200:eve,401:y,422:y,503:y},summary:"Create or reuse a WorkOS organization for the authenticated user\u2019s non-public email domain and add the user as a member."},listRepositories:{method:"GET",path:"/repositories",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:kve,401:y,403:y},summary:"List repositories known to the authenticated user\u2019s organization across threads and building blocks"},createBuildingBlockSnapshots:{method:"POST",path:"/building_blocks",headers:l.object({authorization:l.string().min(1).optional()}),body:ave,responses:{201:Nve,401:y,403:y},summary:"Create building block snapshots for the authenticated user\u2019s organization"},getPlan:{method:"GET",path:"/plans/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Ive,401:y,403:y,404:y},summary:"Load a thread-backed plan container visible to the authenticated user, including all visible plan revisions in that thread"},createPlanCommentThread:{method:"POST",path:"/plans/:id/comment-threads",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:pve,responses:{201:fve,401:y,403:y,404:y,422:y},summary:"Create a new inline comment thread on a specific revision inside a thread-backed plan container"},createPlanComment:{method:"POST",path:"/plans/:id/comment-threads/:threadId/comments",pathParams:l.object({id:l.string().min(1),threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:hve,responses:{201:gve,401:y,403:y,404:y,409:y},summary:"Reply to an inline comment thread on a thread-backed plan container"},updatePlanCommentThread:{method:"PATCH",path:"/plans/:id/comment-threads/:threadId",pathParams:l.object({id:l.string().min(1),threadId:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:Sve,responses:{200:Ave,401:y,403:y,404:y},summary:"Resolve or reopen an inline comment thread on a thread-backed plan container"},listPlans:{method:"GET",path:"/plans",headers:l.object({authorization:l.string().min(1).optional()}),query:Cve,responses:{200:Ove,401:y,403:y},summary:"List thread-backed plan containers visible to the authenticated user in their organization, ordered by latest visible revision and optionally filtered by author or repository"},listBuildingBlockSnapshots:{method:"GET",path:"/building_blocks",headers:l.object({authorization:l.string().min(1).optional()}),query:Pve,responses:{200:xve,401:y,403:y},summary:"List building block snapshots for the authenticated user\u2019s organization and repo origin path"},listUploadSessions:{method:"GET",path:"/upload_sessions",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Rke,401:y},summary:"List recent upload sessions for the authenticated user"},createUploadSession:{method:"POST",path:"/upload_sessions",headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({thread_files:l.array(Bve).nonempty()}),responses:{201:fke,400:y,401:y},summary:"Create an upload session with presigned URLs for file uploads"},completeUploadSession:{method:"POST",path:"/upload_sessions/:id/complete",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({thread_files:l.array(cke).nonempty()}),responses:{200:dke,400:y,401:y,404:y,409:y,422:y},summary:"Complete an upload session after files have been uploaded to storage"},adminStats:{method:"GET",path:"/admin/stats",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:jke,401:y,403:y},summary:"Cross-org operational counts. Tanagram admins only."},adminListOrganizations:{method:"GET",path:"/admin/organizations",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Vke,401:y,403:y},summary:"List every organization with member and thread counts. Tanagram admins only."},adminListUsers:{method:"GET",path:"/admin/users",query:$ke,headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:Wke,401:y,403:y},summary:"List every user with their org memberships and thread count. Tanagram admins only."},adminListThreads:{method:"GET",path:"/admin/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:Jke,responses:{200:Qke,401:y,403:y},summary:"List live threads across every organization. Tanagram admins only."},adminForceFollow:{method:"POST",path:"/admin/connections/follow",headers:l.object({authorization:l.string().min(1).optional()}),body:zke,responses:{200:Yke,401:y,403:y,404:y,422:y},summary:"Force follower->followee edge. Admin-only and non-destructive."},adminHardDeleteThread:{method:"DELETE",path:"/admin/threads/:id",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{204:l.null(),401:y,403:y,404:y},summary:"Permanently remove a thread. Tanagram admins only."},listCardFeed:{method:"GET",path:"/cards/feed",query:l.object({limit:l.coerce.number().int().min(1).max(48).optional()}),responses:{200:ske},summary:"Slim feed of public threads with a ready cover image, ordered by cover_generated_at descending. Powers the landing-page UGC card scroll. Returns presigned cover URLs inline so the grid renders without a follow-up round trip per card."},listDiscoverThreads:{method:"GET",path:"/discover/threads",headers:l.object({authorization:l.string().min(1).optional()}),query:Ake,responses:{200:Ske},summary:"Feed of public threads with sort, harness filter, search, and cursor pagination. Auth is optional and populates viewer_vote."},discoverStats:{method:"GET",path:"/discover/stats",responses:{200:yke},summary:"Unauthenticated rollup of public-thread counts for the Discover header."},createWaitlistEntry:{method:"POST",path:"/waitlist_entries",body:tve,responses:{201:nve,409:y},summary:"Create an unauthenticated waitlist entry keyed by (location, contact)."},createShareToken:{method:"POST",path:"/threads/:id/share-token",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({}).optional(),responses:{201:uW,401:y,403:y,404:y,409:y},summary:"Mint a short share-link token for a public thread. Author only. The token powers `/s/:token` short URLs and enables k-factor attribution."},resolveShareToken:{method:"GET",path:"/referrals/resolve/:token",pathParams:l.object({token:l.string().min(1).max(16)}),query:Xke,responses:{200:uW,404:y},summary:"Resolve a share-link token to its thread and record the view. Unauthenticated by design."},adminGrowth:{method:"GET",path:"/admin/growth",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:twe,401:y,403:y},summary:"Share-link k-factor, funnel, sparkline, and top sharers by window. Tanagram admins only."},adminRunCritiquePlayground:{method:"POST",path:"/admin/critique-playground/run",headers:l.object({authorization:l.string().min(1).optional()}),body:swe,responses:{200:iwe,401:y,403:y,409:y},summary:"Admin-only critique playground that saves markdown to a file:// plan artifact and returns parsed + critiqued plan blocks."},getBillingState:{method:"GET",path:"/billing/state",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:awe,401:y},summary:"Resolve the caller's plan, features, seat count, and any admin override."},createBillingCheckout:{method:"POST",path:"/billing/checkout",headers:l.object({authorization:l.string().min(1).optional()}),body:uwe,responses:{200:cwe,400:y,401:y,403:y,503:y},summary:"Start a Stripe Checkout session for Creator ($29/mo) or Team ($19/seat/mo, min 2)."},createBillingPortal:{method:"POST",path:"/billing/portal",headers:l.object({authorization:l.string().min(1).optional()}),body:l.object({subject_type:l.enum(["user","organization"]).default("user")}).optional(),responses:{200:lwe,401:y,404:y,503:y},summary:"Open the Stripe customer portal so the subject can manage their subscription."},updateTeamSeats:{method:"PATCH",path:"/billing/team-seats",headers:l.object({authorization:l.string().min(1).optional()}),body:dwe,responses:{200:bx,400:y,401:y,403:y,404:y,503:y},summary:"Adjust the caller-organization's Team seat quantity (admin of that org only)."},adminListBilling:{method:"GET",path:"/admin/billing",headers:l.object({authorization:l.string().min(1).optional()}),responses:{200:pwe,401:y,403:y},summary:"List every user and org with current plan + override for the admin panel."},adminSetUserPlanOverride:{method:"PUT",path:"/admin/billing/users/:id/override",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:cW,responses:{200:_0,401:y,403:y,404:y},summary:"Admin override for a user's plan tier. Null clears the override."},adminSetOrganizationPlanOverride:{method:"PUT",path:"/admin/billing/organizations/:id/override",pathParams:l.object({id:l.string().min(1)}),headers:l.object({authorization:l.string().min(1).optional()}),body:cW,responses:{200:_0,401:y,403:y,404:y},summary:"Admin override for an organization's plan tier. Null clears the override."},projects:X7,docs:Q7,mentions:Z7,favorites:nW,search:oW},{pathPrefix:"/api"});c();import ws from"node:fs";import E0 from"node:path";c();import PW from"node:os";import vs from"node:path";function Br(){let t=$e()==="dev"?".lore-dev":".lore";return vs.join(PW.homedir(),t)}function ks(){return vs.join(Br(),"log.txt")}function Cx(){return vs.join(Br(),"sync_state.json")}function MW(){return vs.join(Br(),"upload_filters.json")}function g0(){return vs.join(Br(),"status.json")}function Iu(){return vs.join(Br(),"install_source.json")}function T0(){return vs.join(Br(),"skill_sync_state.json")}function Ou(){return vs.join(Br(),"bin","lore")}function am(){let t=$e();return t==="prod"?"ai.tanagram.lore":`ai.tanagram.lore.${t}`}function dd(){return vs.join(PW.homedir(),"Library","LaunchAgents",`${am()}.plist`)}function S0(){return E0.join(Br(),"token")}function Nx(){return E0.join(Br(),"analytics_distinct_id")}function vW(){let t;try{t=ws.readFileSync(Nx(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return null;throw n}let e=t.trim();return e.length>0?e:null}function kW(t){let e=Nx();ws.mkdirSync(E0.dirname(e),{recursive:!0,mode:448}),ws.writeFileSync(e,t,{mode:384})}function wW(){try{ws.rmSync(Nx())}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return;throw t}}function um(){let t;try{t=ws.readFileSync(S0(),"utf8")}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT")return{token:"",source:"none"};throw n}let e=t.trim();return!e||Dwe(e,new Date)?{token:"",source:"none"}:{token:e,source:"file"}}function Ft(){return um().token}function LW(){return ws.existsSync(S0())}function DW(t){let e=S0();ws.mkdirSync(E0.dirname(e),{recursive:!0,mode:448}),ws.writeFileSync(e,t,{mode:384})}function UW(){try{ws.rmSync(S0())}catch(t){if(t&&typeof t=="object"&&"code"in t&&t.code==="ENOENT")return;throw t}}function xx(t){let e=t.split(".");if(e.length<2)throw new Error("invalid JWT format");return JSON.parse(Buffer.from(e[1],"base64url").toString("utf8"))}function Dwe(t,e){let n;try{n=xx(t)}catch{return!1}return typeof n.exp!="number"?!1:e.getTime()>=n.exp*1e3}var Uwe={dev:"http://localhost:4000",prod:"https://lore-api.tanagram.ai"};function Bwe(t=$e(),e=process.env.LORE_API_ORIGIN){let n=e?.trim();return n?n.replace(/\/$/,""):Uwe[t]}function Ue(t={}){let e=t.token??Ft();return hx(xW,{baseUrl:Bwe(),baseHeaders:{"User-Agent":O7(),...e?{authorization:`Bearer ${e}`}:{}}})}c();import FW from"node:fs";var BW=null;function Fwe(){let t=Br();BW!==t&&(FW.mkdirSync(t,{recursive:!0}),BW=t)}function Gwe(t){let e=typeof t=="string"?t:JSON.stringify(t);return/[\s"=]/.test(e)?JSON.stringify(e):e}function jwe(t,e,n){let r=`${new Date().toISOString()} ${t} ${e}`;if(!n)return`${r}
|
|
41
41
|
`;let o=Object.entries(n).map(([s,i])=>`${s}=${Gwe(i)}`).join(" ");return o?`${r} ${o}
|
|
42
42
|
`:`${r}
|
|
43
43
|
`}function Px(t,e,n){try{let r=jwe(t,e,n);Fwe(),FW.appendFileSync(ks(),r),$e()==="dev"&&process.stderr.write(r)}catch{}}var ne={info(t,e){Px("info",t,e)},warn(t,e){Px("warn",t,e)},error(t,e){Px("error",t,e)}};c();import{execFile as nUe}from"node:child_process";import $n from"node:fs/promises";import rUe from"node:os";import Fs from"node:path";import{promisify as oUe}from"node:util";c();import A0 from"node:fs/promises";import Hwe from"node:path";var y0=class{status={};async markRunning(){let e=new Date().toISOString();this.status={pid:process.pid,state:"running",started_at:e,last_heartbeat_at:e},await this.persist()}async heartbeat(){this.status.pid=process.pid,this.status.last_heartbeat_at=new Date().toISOString(),await this.persist()}async markAuthenticated(){this.status.auth="logged_in",await this.heartbeat()}async markSyncSuccess(e){let n=new Date().toISOString();this.status.pid=process.pid,this.status.auth="logged_in",this.status.last_heartbeat_at=n,this.status.last_completed_at=n,this.status.last_success_at=n,this.status.last_error=void 0,this.status.last_thread_ids=[...e],await this.persist()}async setPendingWatchers(e){this.status.pid=process.pid,this.status.state="running",this.status.pending_watchers=e.map(n=>({session_id:n.sessionId||void 0,project:n.project||void 0,transcript_path:n.transcriptPath||void 0,expires_at:n.expiresAt.toISOString()})),await this.heartbeat()}async markLoggedOut(){let e=new Date().toISOString();this.status.pid=process.pid,this.status.state="logged_out",this.status.auth="logged_out",this.status.last_heartbeat_at=e,this.status.last_completed_at=e,this.status.last_error=void 0,this.status.last_thread_ids=void 0,this.status.pending_watchers=void 0,await this.persist()}async markSuccess(e){let n=new Date().toISOString();this.status.pid=process.pid,this.status.state="idle",this.status.auth="logged_in",this.status.last_heartbeat_at=n,this.status.last_completed_at=n,this.status.last_success_at=n,this.status.last_error=void 0,this.status.last_thread_ids=[...e],this.status.pending_watchers=void 0,await this.persist()}async markError(e){let n=new Date().toISOString();this.status.pid=process.pid,this.status.state="error",this.status.last_heartbeat_at=n,this.status.last_completed_at=n,this.status.last_error=e instanceof Error?e.message:String(e),this.status.pending_watchers=void 0,await this.persist()}async persist(){let e=g0();await A0.mkdir(Hwe.dirname(e),{recursive:!0,mode:448}),await A0.writeFile(e,`${JSON.stringify(Vwe(this.status),null,2)}
|
|
@@ -138,7 +138,7 @@ exec ${a1(n)} ${a1(t)} "$@"
|
|
|
138
138
|
`)},PJ={meta:{name:"list",description:"List organizations you belong to."},async run({data:t}){ne.info("command_start",{command:"organizations list"});let e=t;if(!(e?.getAccessToken??Ft)())throw new de("not logged in \u2014 run 'lore login' first");let o=await(e?.client??Ue()).whoAmI({headers:{}});if(o.status!==200){let s=o.body?.message??`whoAmI returned ${o.status}`;throw new de(s)}console.log(sBe(o.body.organizations))}};var MJ={meta:{name:"organizations",description:"List organizations from your WorkOS AuthKit account."},subCommands:{list:PJ}};c();c();import{createInterface as iBe}from"node:readline/promises";var aBe=/\/skills\/s\/([A-Za-z0-9_-]+)/,kJ={meta:{name:"install",description:"Pull a skill from Lore and write it to ~/.claude/skills/<name>/SKILL.md. Accepts a workspace skill name, a /skills/s/<token> share URL, or a bare share token."},args:{target:{type:"positional",required:!0,description:"Skill name (workspace) or share URL/token (cross-team)"},yes:{type:"boolean",required:!1,description:"Skip the confirmation prompt before overwriting an existing SKILL.md"}},async run({args:t}){let e=typeof t.target=="string"?t.target.trim():"";if(!e)throw new de("install needs a target \u2014 e.g. `lore skills install feature` or `lore skills install https://lore.so/skills/s/<token>`");let n=cBe(e),r=await lBe(n);if(!Rm(r.name))throw new de(`refusing to install skill with invalid name: ${JSON.stringify(r.name)}`);let o=await bd(r.name);if(o&&o.bodyMd===r.bodyMd){console.log(`/${r.name} is already up to date at ${o.filePath}`);return}if(o){if(console.log(`A SKILL.md for /${r.name} already exists at:
|
|
139
139
|
${o.filePath}`),console.log(""),console.log("--- diff (- local, + remote) ---"),dBe(o.bodyMd,r.bodyMd),console.log("--------------------------------"),!(!!t.yes||await vJ("Overwrite with the remote version? "))){console.log("install cancelled");return}}else if(n.kind==="shared"&&!t.yes&&(console.log(`About to install /${r.name} from a shared link.`),r.description&&console.log(` description: ${r.description}`),r.author&&console.log(` author: ${r.author}`),console.log(""),console.log("--- skill body ---"),console.log(r.bodyMd),console.log("------------------"),!await vJ("Install this skill? "))){console.log("install cancelled");return}let s=await uJ(r.name,r.bodyMd);console.log(`installed /${r.name} -> ${s}`)}},uBe=/^[A-Za-z0-9_-]{32}$/;function cBe(t){let e=aBe.exec(t);return e?.[1]?{kind:"shared",token:e[1]}:uBe.test(t)?{kind:"shared",token:t}:{kind:"workspace",name:t}}async function lBe(t){let e=Ue();if(t.kind==="shared"){let r=await e.getSharedSkill({params:{token:t.token}});if(r.status!==200){let o=r.body?.message??`shared skill lookup returned ${r.status}`;throw new de(o)}return{name:r.body.name,description:r.body.description,bodyMd:r.body.body_md,author:r.body.author?.display_name??null}}if(!Ft())throw new de("workspace skill installs require login \u2014 run 'lore login' first");let n=await e.getSkillRaw({params:{name:t.name}});if(n.status!==200){let r=n.body?.message??`getSkillRaw returned ${n.status}`;throw new de(r)}return{name:t.name,description:null,bodyMd:typeof n.body=="string"?n.body:String(n.body),author:null}}function dBe(t,e){let n=t.split(`
|
|
140
140
|
`),r=e.split(`
|
|
141
|
-
`),o=Math.max(n.length,r.length);for(let s=0;s<o;s+=1){let i=n[s],a=r[s];if(i===a){console.log(` ${i}`);continue}i!==void 0&&console.log(`- ${i}`),a!==void 0&&console.log(`+ ${a}`)}}async function vJ(t){let e=iBe({input:process.stdin,output:process.stdout});try{let n=(await e.question(`${t}[y/N] `)).trim().toLowerCase();return n==="y"||n==="yes"}finally{e.close()}}c();var wJ={meta:{name:"list",description:"List skills available in your workspace."},async run(){if(!Ft())throw new de("not logged in \u2014 run 'lore login' first");let e=await Ue().listSkills({});if(e.status!==200){let n=e.body?.message??`listSkills returned ${e.status}`;throw new de(n)}if(e.body.objects.length===0){console.log("no skills in this workspace yet");return}for(let n of e.body.objects){let r=n.source?` [${n.source}]`:"",o=n.description?` \u2014 ${n.description}`:"";console.log(`/${n.name}${r}${o}`)}}};c();var LJ={meta:{name:"publish",description:"Push a local SKILL.md to Lore so it can be downloaded and installed by your team. Pass --all to publish every skill in ~/.claude/skills/."},args:{name:{type:"positional",required:!1,description:"Skill directory name under ~/.claude/skills/<name>/SKILL.md or ./.claude/skills/<name>/SKILL.md"},all:{type:"boolean",required:!1,description:"Publish every locally installed skill in one go"}},async run({args:t}){if(!Ft())throw new de("not logged in \u2014 run 'lore login' first");let e=Ue(),n=await pBe(t);if(n.length===0)throw new de("no skills to publish \u2014 pass a name like `lore skills publish feature` or `--all`");let r=0;for(let o of n){let s=await bd(o);if(!s){console.error(`skip ${o}: no SKILL.md found locally`);continue}let i=await e.publishSkill({params:{name:o},body:{body_md:s.bodyMd,description:s.description,published:!0}});if(i.status!==200){let a=i.body?.message??`publishSkill returned ${i.status}`;throw new de(`failed to publish ${o}: ${a}`)}r+=1,console.log(`published /${o} (v${i.body.latest_version}, ${i.body.source}) from ${s.filePath}`)}if(r===0)throw new de("no skills were published \u2014 check the names and try again")}};async function pBe(t){if(t.all)return nA();let e=typeof t.name=="string"?t.name.trim():"";return e?[e]:[]}var DJ={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:LJ,install:kJ,list:wJ}};c();c();import LBe from"node:fs/promises";import DBe from"node:os";import lA from"node:path";c();import{spawn as fBe}from"node:child_process";import mBe from"node:os";async function UJ(t,e={}){let n=e.timeoutMs??2e3,r=_Be();for(let o of r)if(await hBe(o,t,n))return!0;return!1}function _Be(){switch(mBe.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 hBe(t,e,n){return new Promise(r=>{let o;try{o=fBe(t.name,t.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let s=!1,i=u=>{s||(s=!0,r(u))},a=setTimeout(()=>{o.kill("SIGKILL"),i(!1)},n);o.on("error",()=>{clearTimeout(a),i(!1)}),o.on("close",u=>{clearTimeout(a),i(u===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(e)})}c();var gBe={dev:"http://localhost:8080",prod:"https://lore.tanagram.ai"};function uA(){return gBe[$e()]}c();import HJ from"node:fs/promises";import Om from"node:path";c();var TBe={claudeCode:"Claude Code",codex:"Codex",amp:"Amp",cursor:"Cursor",cowork:"Cowork",unspecified:"Unspecified harness"},EBe={private:"Private",workspace:"Workspace",public:"Public"},SBe={asked:"Asked",requested:"Requested",decided:"Decided",corrected:"Corrected",shared:"Shared"},_1="<!-- lore:remix-of ",BJ=" -->";function ABe(t){return`${_1}${t}${BJ}`}function FJ(t){let e=t.slice(0,4096),n=e.indexOf(_1);if(n<0)return null;let r=n+_1.length,o=e.indexOf(BJ,r);if(o<0)return null;let s=e.slice(r,o).trim();return s.startsWith("th_")?s:null}function GJ(t){let e=[];if(e.push(ABe(t.thread_id)),e.push(`# Lore Remix \xB7 ${bBe(t.title)}`),e.push(""),t.summary&&(e.push(`> ${RBe(t.summary)}`),e.push("")),e.push(...yBe(t)),e.push(""),t.original_user_prompt&&(e.push("## What was being built"),e.push(""),e.push(t.original_user_prompt.trim()),e.push("")),t.decisions.length>0){e.push("## Key decisions"),e.push("");for(let n of t.decisions){let r=SBe[n.kind];e.push(`- **${r}.** ${n.summary.trim()}`)}e.push("")}if(t.last_assistant_message&&(e.push("## Where the session left off"),e.push(""),e.push(t.last_assistant_message.trim()),e.push("")),t.files_touched.length>0){e.push("## Files touched"),e.push("");for(let n of t.files_touched)e.push(`- \`${n}\``);e.push("")}return e.push("## Continue from here"),e.push(""),e.push("Pick up where this thread left off. In your next prompt, reference this file and tell the agent what you want to do next:"),e.push(""),e.push('> "Read ./LORE_REMIX.md and continue from there. I want to ..."'),e.push(""),e.push(`When you \`lore export\` your new session, it will be linked back to ${t.source_url} as a remix. The original author's thread will show your remix in its lineage.`),e.push(""),t.truncated&&(e.push(`_This brief was condensed. For the full thread (every prompt, tool call, diff), open ${t.source_url}._`),e.push("")),`${e.join(`
|
|
141
|
+
`),o=Math.max(n.length,r.length);for(let s=0;s<o;s+=1){let i=n[s],a=r[s];if(i===a){console.log(` ${i}`);continue}i!==void 0&&console.log(`- ${i}`),a!==void 0&&console.log(`+ ${a}`)}}async function vJ(t){let e=iBe({input:process.stdin,output:process.stdout});try{let n=(await e.question(`${t}[y/N] `)).trim().toLowerCase();return n==="y"||n==="yes"}finally{e.close()}}c();var wJ={meta:{name:"list",description:"List skills available in your workspace."},async run(){if(!Ft())throw new de("not logged in \u2014 run 'lore login' first");let e=await Ue().listSkills({});if(e.status!==200){let n=e.body?.message??`listSkills returned ${e.status}`;throw new de(n)}if(e.body.objects.length===0){console.log("no skills in this workspace yet");return}for(let n of e.body.objects){let r=n.source?` [${n.source}]`:"",o=n.description?` \u2014 ${n.description}`:"";console.log(`/${n.name}${r}${o}`)}}};c();var LJ={meta:{name:"publish",description:"Push a local SKILL.md to Lore so it can be downloaded and installed by your team. Pass --all to publish every skill in ~/.claude/skills/."},args:{name:{type:"positional",required:!1,description:"Skill directory name under ~/.claude/skills/<name>/SKILL.md or ./.claude/skills/<name>/SKILL.md"},all:{type:"boolean",required:!1,description:"Publish every locally installed skill in one go"}},async run({args:t}){if(!Ft())throw new de("not logged in \u2014 run 'lore login' first");let e=Ue(),n=await pBe(t);if(n.length===0)throw new de("no skills to publish \u2014 pass a name like `lore skills publish feature` or `--all`");let r=0;for(let o of n){let s=await bd(o);if(!s){console.error(`skip ${o}: no SKILL.md found locally`);continue}let i=await e.publishSkill({params:{name:o},body:{body_md:s.bodyMd,description:s.description,published:!0}});if(i.status!==200){let a=i.body?.message??`publishSkill returned ${i.status}`;throw new de(`failed to publish ${o}: ${a}`)}r+=1,console.log(`published /${o} (v${i.body.latest_version}, ${i.body.source}) from ${s.filePath}`)}if(r===0)throw new de("no skills were published \u2014 check the names and try again")}};async function pBe(t){if(t.all)return nA();let e=typeof t.name=="string"?t.name.trim():"";return e?[e]:[]}var DJ={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:LJ,install:kJ,list:wJ}};c();c();import LBe from"node:fs/promises";import DBe from"node:os";import lA from"node:path";c();import{spawn as fBe}from"node:child_process";import mBe from"node:os";async function UJ(t,e={}){let n=e.timeoutMs??2e3,r=_Be();for(let o of r)if(await hBe(o,t,n))return!0;return!1}function _Be(){switch(mBe.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 hBe(t,e,n){return new Promise(r=>{let o;try{o=fBe(t.name,t.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let s=!1,i=u=>{s||(s=!0,r(u))},a=setTimeout(()=>{o.kill("SIGKILL"),i(!1)},n);o.on("error",()=>{clearTimeout(a),i(!1)}),o.on("close",u=>{clearTimeout(a),i(u===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(e)})}c();var gBe={dev:"http://localhost:8080",prod:"https://lore.tanagram.ai"};function uA(){return gBe[$e()]}c();import HJ from"node:fs/promises";import Om from"node:path";c();var TBe={claudeCode:"Claude Code",codex:"Codex",amp:"Amp",cursor:"Cursor",cowork:"Cowork",unspecified:"Unspecified harness"},EBe={private:"Private",workspace:"Workspace",public:"Public"},SBe={asked:"Asked",requested:"Requested",decided:"Decided",corrected:"Corrected",shared:"Shared",requirement:"Requirement"},_1="<!-- lore:remix-of ",BJ=" -->";function ABe(t){return`${_1}${t}${BJ}`}function FJ(t){let e=t.slice(0,4096),n=e.indexOf(_1);if(n<0)return null;let r=n+_1.length,o=e.indexOf(BJ,r);if(o<0)return null;let s=e.slice(r,o).trim();return s.startsWith("th_")?s:null}function GJ(t){let e=[];if(e.push(ABe(t.thread_id)),e.push(`# Lore Remix \xB7 ${bBe(t.title)}`),e.push(""),t.summary&&(e.push(`> ${RBe(t.summary)}`),e.push("")),e.push(...yBe(t)),e.push(""),t.original_user_prompt&&(e.push("## What was being built"),e.push(""),e.push(t.original_user_prompt.trim()),e.push("")),t.decisions.length>0){e.push("## Key decisions"),e.push("");for(let n of t.decisions){let r=SBe[n.kind];e.push(`- **${r}.** ${n.summary.trim()}`)}e.push("")}if(t.last_assistant_message&&(e.push("## Where the session left off"),e.push(""),e.push(t.last_assistant_message.trim()),e.push("")),t.files_touched.length>0){e.push("## Files touched"),e.push("");for(let n of t.files_touched)e.push(`- \`${n}\``);e.push("")}return e.push("## Continue from here"),e.push(""),e.push("Pick up where this thread left off. In your next prompt, reference this file and tell the agent what you want to do next:"),e.push(""),e.push('> "Read ./LORE_REMIX.md and continue from there. I want to ..."'),e.push(""),e.push(`When you \`lore export\` your new session, it will be linked back to ${t.source_url} as a remix. The original author's thread will show your remix in its lineage.`),e.push(""),t.truncated&&(e.push(`_This brief was condensed. For the full thread (every prompt, tool call, diff), open ${t.source_url}._`),e.push("")),`${e.join(`
|
|
142
142
|
`).trimEnd()}
|
|
143
143
|
`}function yBe(t){let e=[];e.push(`**Source**: ${t.source_url}`);let n=t.author.handle?`@${t.author.handle} (${t.author.display_name})`:t.author.display_name;return e.push(`**Original author**: ${n}`),e.push(`**Original harness**: ${TBe[t.harness]??t.harness}`),e.push(`**Started**: ${IBe(t.started_at)}`),e.push(`**Visibility**: ${EBe[t.visibility]}`),e}function bBe(t){return t.replace(/[\r\n]+/g," ").trim()}function RBe(t){return t.replace(/\s+/g," ").trim()}function IBe(t){let e=Date.parse(t);return Number.isNaN(e)?t:new Date(e).toISOString().replace("T"," ").replace(/\..*$/," UTC")}c();import OBe from"node:fs/promises";import{setTimeout as CBe}from"node:timers/promises";var NBe=1e3,xBe=2*60*1e3;async function Rd(t,e){let n=e.map(o=>({md5:o.md5,harness:o.harness,filename:o.filename,repo_origin_path:o.repoOriginPath||void 0,file_type:o.fileType,harness_internal_id:o.harnessInternalId,remix_of_thread_id:o.remixOfThreadId||void 0})),r=await t.createUploadSession({body:{thread_files:n}});if(r.status!==201)throw new Error(Gs("create upload session",r.status,r.body));return r.body}async function Id(t,e){let n=await OBe.readFile(e),r=await fetch(t,{method:"PUT",body:n,headers:{"content-length":String(n.length)}});if(!r.ok)throw new Error(`upload transcript: unexpected status ${r.status}: ${await r.text()}`)}async function Od(t,e,n){let r=n.map(s=>({storage_url:PBe(s)})),o=await t.completeUploadSession({params:{id:e},body:{thread_files:r}});if(o.status!==200)throw new Error(Gs("complete upload session",o.status,o.body));return o.body}async function Cd(t,e,n={}){let r=n.timeoutMs??xBe,o=n.pollIntervalMs??NBe,s=Date.now();for(;;){n.onPoll&&await n.onPoll();let i=await t.getThread({params:{id:e}});if(i.status!==200)throw new Error(Gs(`get thread ${e}`,i.status,i.body));let a=i.body.transcript_parsing_state;if(a==="parsed"||a==="too_large_to_parse")return;if(a!=="pending"&&a!=="parsing")throw new Error(`unexpected transcript parsing state for thread ${e}: ${JSON.stringify(a)}`);let u=Date.now()-s;if(u>=r)throw new Error(`timed out waiting for thread ${e} parsing after ${r}ms`);await CBe(Math.min(o,r-u))}}function jJ(t,e){let n=new Map;for(let r of t){let o=r.md5.trim().toLowerCase();n.set(o,[...n.get(o)??[],r])}return e.map((r,o)=>{let s=r.expected_md5?.trim();if(!s)throw new Error(`upload session response missing expected_md5 for thread_files[${o}]`);let i=s.toLowerCase(),a=n.get(i);if(!a||a.length===0)throw new Error(`upload session response returned unexpected expected_md5 ${s}`);let[u,...d]=a;if(!u)throw new Error(`upload session response returned unexpected expected_md5 ${s}`);return d.length===0?n.delete(i):n.set(i,d),u})}function PBe(t){if(!t.storage_url.trim())throw new Error("upload session response missing storage_url");return t.storage_url}function Gs(t,e,n){return MBe(n)&&typeof n.message=="string"?`${t} failed: HTTP ${e}: ${n.message}`:`${t} failed: HTTP ${e}`}function MBe(t){return t!==null&&typeof t=="object"}var cA="LORE_REMIX.md";async function VJ(t){let e=t.threadRef.trim();if(!e)throw new de("lore remix needs a thread id or URL");let n=vBe(e),r=Om.resolve((t.cwd??process.cwd()).trim()||process.cwd()),o=Om.resolve(r,t.outPath?.trim()||cA),s=t.client??Ue({token:Ft()}),i=await kBe(s,n);await HJ.mkdir(Om.dirname(o),{recursive:!0}),await HJ.writeFile(o,GJ(i),{mode:384});let a=wBe(i,o);return{thread_id:i.thread_id,source_url:i.source_url,brief_path:o,visibility:i.visibility,remix_count_will_increment:!0,message:a}}function vBe(t){let e=t.trim();if(!e)throw new de("lore remix needs a thread id or URL");if(e.startsWith("th_"))return e;let n;try{n=new URL(e)}catch{throw new de(`lore remix could not parse "${t}" as a thread id or URL \u2014 pass a th_\u2026 id or a https://\u2026/session/th_\u2026 URL`)}let r=n.pathname.split("/").filter(Boolean),o=r.indexOf("session");if(o>=0&&r[o+1]?.startsWith("th_"))return r[o+1];let s=r[r.length-1];if(s?.startsWith("th_"))return s;throw new de(`lore remix could not find a th_\u2026 id in "${t}" \u2014 pass the full session URL or the bare thread id`)}async function kBe(t,e){let n=await t.getThreadRemixBrief({params:{id:e}});if(n.status===200)return n.body;throw n.status===404?new de(`thread ${e} not found \u2014 check the link or id`):n.status===401?new de(`thread ${e} requires sign-in \u2014 run \`lore login\` and try again`):n.status===403?new de(`thread ${e} is not visible to you \u2014 only public threads and workspace threads inside your org can be remixed`):new Error(Gs(`fetch remix brief for ${e}`,n.status,n.body))}function wBe(t,e){return[`Wrote remix brief to ${e}`,"",`Source: ${t.source_url}`,"Open Claude Code (or Codex / Cursor) in this directory and reference the brief in your first prompt:","",`> "Read ${Om.basename(e)} and continue from there. I want to ..."`,"",`When you \`lore export\` your next session from this directory, the brief is read and the new thread is stamped as a remix of ${t.thread_id}. Delete ${Om.basename(e)} to opt out.`].join(`
|
|
144
144
|
`)}var UBe=new Set(["private","workspace","public"]);function BBe(t){let e=(t??"").trim();if(!e)return"";if(!UBe.has(e))throw new de(`invalid --visibility "${t}": use one of private, workspace, public`);return e}async function qJ(t={}){let e=BBe(t.visibility),n=(t.project??process.cwd()).trim()||process.cwd(),r=(t.sessionId??"").trim(),o=t.warn??FBe,s=await VQ({sessionId:r,project:n}),i=qBe(),a=t.client??Ue({token:i}),u=await GBe(),d=await jBe(s,{remixOfThreadId:u});try{let{reused:p,file:f}=await HBe(a,d);ne.info("export_upload_single_file_result",{filename:d.filename,reused:p,response:JSON.stringify(f)});let m=f.thread?.id?.trim();if(!m)throw Te().setContext("upload_single_file_response",{filename:d.filename,reused:p,response:f}),new Error(`upload session response missing thread id for ${d.filename}`);let _=!!u&&f.remix_parent_dropped===!0;if(_){let A=lA.join(process.cwd(),cA),R=`warning: remix parent ${u} not found or not visible \u2014 lineage dropped. Delete ${$J(A)} if this is stale.`;o(R),ne.warn("export_remix_parent_dropped",{remix_of_thread_id:u??"",brief_path:A})}await Cd(a,m);let h=f.thread?.visibility?.trim()??"",g=e&&e!==h?await VBe(a,m,e):h,T=`${uA().replace(/\/+$/,"")}/session/${m}`,S=await UJ(T);return{thread_id:m,url:T,session_id:s.sessionId?.trim()??"",project:s.project,reused:p,visibility:g,clipboard_copied:S,remix_of_thread_id:_?null:u??null,remix_parent_dropped:_}}finally{await fd(d.tempPath)}}function FBe(t){process.stderr.write(`${t}
|